summary refs log blame commit diff stats
path: root/plugins/hextray/sdAlerts.cpp
blob: bf61f1ebc7cdf7a269a45a57044ff2d00f51a40c (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15


/* HexChat
 * Copyright (C) 1998-2010 Peter Zelezny.
 * Copyright (C) 2009-2013 Berke Viktor.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

#include "proto-irc.h"

#ifndef HEXCHAT_MODES_H
#define HEXCHAT_MODES_H

int is_channel (server *serv, char *chan);
char get_nick_prefix (server *serv, unsigned int access);
unsigned int nick_access (server *serv, char *nick, int *modechars);
int mode_access (server *serv, char mode, char *prefix);
void inbound_005 (server *serv, char *word[], const message_tags_data *tags_data);
void handle_mode (server *serv, char *word[], char *word_eol[], char *nick,
						int numeric_324, const message_tags_data *tags_data);
void send_channel_modes (session *sess, char *tbuf, char *word[], int start, int end, char sign, char mode, int modes_per_line);

#endif
op)); ixPos = rcWorkArea.right - (rcDlg.right - rcDlg.left) + 1; iyPos = rcWorkArea.bottom - (rcDlg.bottom - rcDlg.top); if((g_iAlerts >= iNumPerCol) && (iNumPerCol > 0)) { ixPos -= ((g_iAlerts / iNumPerCol) * (rcDlg.right - rcDlg.left)); iyPos -= ((g_iAlerts - (iNumPerCol * (g_iAlerts / iNumPerCol))) * (rcDlg.bottom - rcDlg.top)); } else { iyPos -= (g_iAlerts * (rcDlg.bottom - rcDlg.top)); } SetWindowPos(hDialog, HWND_TOPMOST, ixPos, iyPos, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE); ConvertString(szName, wszName, 64); ConvertString(szMsg, wszMsg, 256); SetWindowText(hDialog, wszName); SetDlgItemText(hDialog, IDC_ALERT_MSG, wszMsg); ShowWindow(hDialog, SW_SHOWNA); if(iTime > 0) { SetTimer(hDialog, 1, iTime, NULL); } g_iAlerts++; } void sdCloseAlerts() { PostMessage(HWND_BROADCAST, RegisterWindowMessage(TEXT("xTray:CloseAllAlertWindows")), 0, 0); } LRESULT CALLBACK sdAlertProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { switch(msg) { case WM_CLOSE: if(g_iAlerts > 0){ g_iAlerts--; } DestroyWindow(hwnd); return TRUE; break; case WM_TIMER: if(g_iAlerts > 0){ g_iAlerts--; } AnimateWindow(hwnd, 600, AW_SLIDE | AW_HIDE | AW_VER_POSITIVE); DestroyWindow(hwnd); return TRUE; break; default: if(msg == RegisterWindowMessage(TEXT("xTray:CloseAllAlertWindows"))) { if(g_iAlerts > 0){ g_iAlerts--; } DestroyWindow(hwnd); return TRUE; } break; } return FALSE; } int sdAlertNum() { return g_iAlerts; }