Compare commits

...

44 Commits

Author SHA1 Message Date
TingPing cd72f2a55b Python: Use iterator for get_list() 2013-09-25 21:11:24 -04:00
TingPing d18a95fda6 Make Python version consistent on both platforms
and don't hardcode 2.7/3.3
2013-09-25 20:53:23 -04:00
TingPing c7a00a4aba Only show users country if its not unknown 2013-09-25 17:16:47 -04:00
TingPing 7bc3317eeb Don't open most windows at mouse position 2013-09-25 02:09:47 -04:00
TingPing 8028bb7f82 Make join dialog modal 2013-09-25 02:02:26 -04:00
TingPing 6fc412c4e2 Update installer links to 2013 redist 2013-09-25 00:54:28 -04:00
TingPing 0749cb1553 Remove hextray 2013-09-24 21:01:16 -04:00
TingPing f198581a09 Split long messages at spaces 2013-09-24 19:57:37 -04:00
TingPing 4c9b193b45 Fix tab completion with utf8 completion char
Closes #738
2013-09-24 17:03:19 -04:00
TingPing 130be78dbb typo.. 2013-09-23 23:10:31 -04:00
TingPing 29d6db30ba Update help messages for userlist buttons and user popups 2013-09-23 23:08:56 -04:00
TingPing 2e6001f1ed Revert menu.c @ ae04663aa9
This caused a few bugs such as improperly setting away/back
and redrawing the channel tree when the menu is opened.
2013-09-23 22:00:07 -04:00
TingPing 9c4112cda7 Fix /cycle command
- Uses the correct channelkey when called from another tab
- Allows it to be used from any tab in the same server
- Verifies it's a channel you are in
2013-09-23 17:17:35 -04:00
TingPing 04dbcdffc0 Only underline the channel part if nick prefix 2013-09-23 15:10:00 -04:00
TingPing 0146a38faa Fix url detection of channel with nick prefix
Closes #769
2013-09-23 14:58:11 -04:00
TingPing 145ceba124 Strip trailing space from CAP REQ
Mentioned in #770
2013-09-23 12:45:08 -04:00
TingPing 90ea691b75 Add screenshot to appdata file 2013-09-20 23:01:27 -04:00
TingPing 51cdcfca82 Fix warning 2013-09-20 17:33:27 -04:00
TingPing ae04663aa9 First round of using GTK accessor functions
This is the first step to build with GSEAL_ENABLE
setup.c uses a deprecated fontchooser,
chanview-tabs.c didn't like the conversion, and
I am waiting to do some work on xtext.c before
converting it.
2013-09-20 17:24:39 -04:00
TingPing 9f8073ab77 Fix messages on networks that have chantypes the same as nick prefixes
Closes #763
2013-09-20 08:59:25 -04:00
Eustachy Kapusta bfa199be79 Add /d2Zi+ switch for better debug symbols 2013-09-20 13:11:01 +02:00
TingPing 36911710fd Make manual reposition after unfullscreen Windows only 2013-09-19 22:01:15 -04:00
TingPing 267ac71d4f Replace more GDK_* with GDK_KEY 2013-09-19 17:58:10 -04:00
TingPing f6ba274134 Add fullscreen to to view menu 2013-09-19 17:52:17 -04:00
Richard Hitt cd825ac735 Improve text repositioning when searchbar string is modified. 2013-09-18 15:25:50 -07:00
TingPing 1007af9506 Add message arguement to /query
Closes #757
2013-09-17 18:19:02 -04:00
TingPing b67953c70c Searchbar: Don't show error on empty string 2013-09-16 21:48:04 -04:00
TingPing 1a67e245ac Fix searchbar loading highlight all pref on start 2013-09-16 21:31:05 -04:00
Arnavion 648de4410c plugins: fishlim: VS2013 comes with a working stdbool.h 2013-09-15 15:08:40 -07:00
Eustachy Kapusta b658fca4a7 Convert project files to vs2013 2013-09-15 15:07:46 -07:00
TingPing 277732e384 Fix xtext crash in rawlog/text events window
Closes #740
2013-09-15 10:44:55 -04:00
TingPing f13413c26a Fix logging networks with invalid names on Windows 2013-09-15 07:40:47 -04:00
RichardHitt c9418ffca3 Translate -ize to -ise, favor[ite] to favour[ite], Behavior to Behaviour 2013-09-15 01:28:10 -07:00
TingPing ddb3bf05d8 use GDK_KEY 2013-09-15 03:22:04 -04:00
TingPing 8b463e6b14 Update POTFILES.in 2013-09-15 03:07:45 -04:00
TingPing bc8eaf6588 Replace search window with a searchbar 2013-09-15 02:55:18 -04:00
TingPing b0b8f40791 Replace search window with a searchbar 2013-09-15 02:51:35 -04:00
Eustachy Kapusta aa37686bbd Move optimization settings from all subsequent projects to hexchat.props 2013-09-15 02:45:38 -04:00
TingPing 4721a3747e Python: return hooks with PyLong_FromVoidPtr
Fixes #685
2013-09-15 02:45:38 -04:00
TingPing e5cb69db5d Python: Use keywords for attributes in emit_print() 2013-09-15 02:45:37 -04:00
TingPing 414b591358 Python: Add support for attributes in hooks 2013-09-15 02:45:37 -04:00
TingPing ccd4945504 Merge xchat r1525
Fixes possible crash
2013-09-15 02:45:36 -04:00
TingPing 59b19bac70 Update tooltip for sound alerts without libcanberra 2013-09-14 12:46:38 -04:00
TingPing 14b8a77b78 Default spotchat to SASL 2013-09-12 03:55:17 -04:00
93 changed files with 842 additions and 3600 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
-5
View File
@@ -1,5 +0,0 @@
/* stdbool.h replacement for MSVC */
#define false 0
#define true 1
#define bool _Bool
typedef int _Bool;
-4
View File
@@ -25,11 +25,7 @@
#ifndef FISH_H
#define FISH_H
#ifdef _MSC_VER
#include "bool.h"
#else
#include <stdbool.h>
#endif
#include <stddef.h>
char *fish_encrypt(const char *key, size_t keylen, const char *message);
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
-4
View File
@@ -25,11 +25,7 @@
#ifndef IRC_H
#define IRC_H
#ifdef _MSC_VER
#include "bool.h"
#else
#include <stdbool.h>
#endif
#include <stddef.h>
bool irc_parse_message(const char *words[],
-4
View File
@@ -25,11 +25,7 @@
#ifndef KEYSTORE_H
#define KEYSTORE_H
#ifdef _MSC_VER
#include "bool.h"
#else
#include <stdbool.h>
#endif
#include <stddef.h>
char *keystore_get_key(const char *nick);
Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

-734
View File
@@ -1,734 +0,0 @@
/* X-Tray
* Copyright (C) 2005 Michael Hotaling <Mike.Hotaling@SinisterDevelopments.com>
*
* X-Tray 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.
*
* X-Tray 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 X-Tray; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define _WIN32_IE 0x0601
#include <windows.h>
#include <stdio.h>
#include <commctrl.h>
#include <tchar.h>
#include "hexchat-plugin.h"
#include "utility.h"
#include "hextray.h"
#include "hexchat.h"
#include "callbacks.h"
#include "resource.h"
#include "sdTray.h"
#include "sdAlerts.h"
HWND g_hPrefTabEvents;
HWND g_hPrefTabSettings;
HWND g_hPrefTabAlerts;
HWND g_hPrefTabAbout;
bool g_bCanQuit;
int g_iIsActive = 1;
BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam)
{
TCHAR szTitle[10];
GetWindowText(hWnd, szTitle, 9);
if(_tcsstr(szTitle, _T("HexChat [")))
{
g_hXchatWnd = hWnd;
return false;
}
return true;
}
/***********************************************************************************************/
/******* our HexChat event call back, get the name and info for each event and save it *********/
/******* for our alerts later ******************************************************************/
/***********************************************************************************************/
int event_cb(char *word[], void *userdata)
{
int iEvent = (int)userdata;
if(iEvent > 10 && iEvent != 21)
return HEXCHAT_EAT_NONE;
/***************************************************************************************/
/***** if the window is minimized or if we're allowed to show alerts when its not **/
/***** and if the option to show the specified alert is true and if we're even **/
/***** allowed to show alerts at all then we show them (a bit confusing but it works) **/
/***************************************************************************************/
if(((g_iIsActive == 0) || !(g_dwPrefs & (1<<PREF_OSBWM))) && (g_dwPrefs & (1<<PREF_AMAE)) && (g_dwPrefs & (1<<iEvent)))
{
/*********************************/
/*********** Our Buffers *********/
/*********************************/
char szInfo[512];
char szName[64];
DWORD dwInfoFlags;
int iTime = g_iTime*1000;
char *szTemp = NULL;
if(g_dwPrefs & (1<<PREF_KAOI))
{
iTime = 0;
}
switch(iEvent)
{
case CHAN_HILIGHT:
_snprintf(szInfo, 512, "%s:\r\n%s", word[1], word[2]);
_snprintf(szName, 64, "Highlight: %s", hexchat_get_info (ph, "channel"));
dwInfoFlags = NIIF_INFO;
break;
case CHAN_MESSAGE:
_snprintf(szInfo, 512, "%s:\r\n%s", word[1], word[2]);
_snprintf(szName, 64, "Channel Message: %s", hexchat_get_info (ph, "channel"));
dwInfoFlags = NIIF_INFO;
break;
case CHAN_TOPIC_CHANGE:
_snprintf(szInfo, 512, "%s has changed the topic to %s", word[1], word[2]);
_snprintf(szName, 64, "Topic Change: %s", word[3]);
dwInfoFlags = NIIF_INFO;
break;
case CHAN_INVITE:
_snprintf(szInfo, 512, "%s has invited you into %s", word[1], word[2]);
_snprintf(szName, 64, "Invite");
dwInfoFlags = NIIF_INFO;
break;
case CHAN_KICKED:
_snprintf(szInfo, 512, "Kicked from %s by %s:\r\n%s", word[2], word[3], word[4]);
_snprintf(szName, 64, "Kick");
dwInfoFlags = NIIF_WARNING;
break;
case CHAN_BANNED:
_snprintf(szInfo, 512, "Cannot join %s You are banned.", word[1]);
_snprintf(szName, 64, "Banned");
dwInfoFlags = NIIF_WARNING;
break;
case CTCP_GENERIC:
_snprintf(szInfo, 512, "%s:\r\nCTCP %s", word[2], word[1]);
_snprintf(szName, 64, "CTCP");
dwInfoFlags = NIIF_INFO;
break;
case PMSG_RECEIVE:
_snprintf(szInfo, 512, "%s:\r\n%s", word[1], word[2]);
_snprintf(szName, 64, "Private Message");
dwInfoFlags = NIIF_INFO;
break;
case SERV_DISCONNECT:
_snprintf(szInfo, 512, "Disconnected\r\nError: %s", word[1]);
_snprintf(szName, 64, "Disconnect");
dwInfoFlags = NIIF_ERROR;
break;
case SERV_KILLED:
_snprintf(szInfo, 512, "Killed(%s(%s))", word[1], word[2]);
_snprintf(szName, 64, "Server Admin has killed you");
dwInfoFlags = NIIF_ERROR;
break;
case SERV_NOTICE:
_snprintf(szInfo, 512, "Notice:\r\n%s: %s", word[1], word[2]);
_snprintf(szName, 64, "Notice");
dwInfoFlags = NIIF_INFO;
break;
case 11:
_snprintf(szInfo, 512, ":\r\n%s: %s", word[1], word[2]);
_snprintf(szName, 64, "Notice");
dwInfoFlags = NIIF_INFO;
break;
}
/**************************************************************************************/
/***** Use windows instead of balloons, and if its a window should we keep it open ****/
/***** indefinitely? ****/
/**************************************************************************************/
szTemp = hexchat_strip_color(szInfo);
if(g_dwPrefs & (1<<PREF_UWIOB))
{
sdSystemAlert((HINSTANCE)g_hInstance, IDD_ALERT, szTemp, szName, iTime);
}
else
{
ShowBalloon(g_hXchatWnd, 1, szTemp, szName, iTime, dwInfoFlags);
}
free(szTemp);
}
if(g_dwPrefs & (1<<PREF_BLINK) && (g_dwPrefs & (1<<iEvent)))
{
BlinkIcon(g_hXchatWnd, 1, g_hIcons[0], g_hIcons[(iEvent+1)], 700, 5);
}
/***********************************/
/***** pass the events to HexChat **/
/***********************************/
return HEXCHAT_EAT_NONE;
}
int command_cb(char *word[], char *word_eol[], void *userdata)
{
char szInfo[512];
char *szTemp = NULL;
int iTime = g_iTime*1000;
_snprintf(szInfo, 512, word_eol[2]);
szTemp = hexchat_strip_color(szInfo);
if(g_dwPrefs & (1<<PREF_KAOI))
{
iTime = 0;
}
if(((g_iIsActive == 0) || !(g_dwPrefs & (1<<PREF_OSBWM))) && (g_dwPrefs & (1<<PREF_AMAE)))
{
if(g_dwPrefs & (1<<PREF_UWIOB))
{
sdSystemAlert((HINSTANCE)g_hInstance, IDD_ALERT, szTemp, "Alert", iTime);
}
else
{
ShowBalloon(g_hXchatWnd, 1, szTemp, "Alert", iTime, NIIF_INFO);
}
}
free(szTemp);
return HEXCHAT_EAT_ALL;
}
LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
switch(msg)
{
case WM_CLOSE:
{
if((g_dwPrefs & (1<<PREF_MIOC)) && (g_bCanQuit == false))
{
/*******************************************/
/**** to autoaway or not to autoaway... ***/
/*******************************************/
if(g_dwPrefs & (1<<PREF_AOM))
{
hexchat_globally_away(g_szAway);
}
/**************************************************/
/**** Win32 API call to hide the window and **/
/**** save the fact that its minimized for later **/
/**************************************************/
g_iIsActive = 0;
ShowWindow(hWnd, SW_HIDE);
return 0;
}
else
{
if(g_hPrefDlg != NULL)
{
DestroyWindow(g_hPrefDlg);
}
StopBlink(hWnd, 1, g_hIcons[0]);
if(sdAlertNum())
{
sdCloseAlerts();
HoldClose();
return 0;
}
}
}
break;
case WM_SIZE:
{
/******************************************/
/***** User wants to minimize HexChat, ****/
/***** are we allowed to go to tray? ******/
/******************************************/
if((g_dwPrefs & (1<<PREF_TOT)) && (wparam == SIZE_MINIMIZED))
{
/*******************************************/
/**** to autoaway or not to autoaway... ***/
/*******************************************/
if(g_dwPrefs & (1<<PREF_AOM))
{
hexchat_globally_away(g_szAway);
}
/**************************************************/
/**** Win32 API call to hide the window and **/
/**** save the fact that its minimized for later **/
/**************************************************/
g_iIsActive = 0;
ShowWindow(hWnd, SW_HIDE);
}
}
break;
/**********************************/
/*** user clicked the tray icon ***/
/**********************************/
case WM_TRAYMSG:
{
switch(lparam)
{
case WM_LBUTTONDOWN:
{
if(!g_iIsActive)
{
/*********************************************************/
/*** 0: its hiden, restore it and show it, if autoaway ***/
/*** is on, set us as back ***/
/*********************************************************/
SendMessage(hWnd, WM_SYSCOMMAND, SC_RESTORE, 0);
SetForegroundWindow(hWnd);
g_iIsActive = 1;
if(g_dwPrefs & (1<<PREF_AOM))
{
hexchat_globally_back();
}
}
else
{
SendMessage(hWnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
}
}
break;
case WM_RBUTTONDOWN:
{
/******************************************/
/*** user wants to see the menu find out **/
/*** where the mouse is and show it **/
/******************************************/
POINT pt;
int iRet;
GetCursorPos(&pt);
SetForegroundWindow(hWnd);
ModifyMenu(g_hTrayMenu, 2, (MF_POPUP | MF_BYPOSITION), (UINT)setServerMenu(), _T("Away"));
Sleep(175);
iRet = TrackPopupMenuEx(g_hTrayMenu, (TPM_RETURNCMD | TPM_LEFTALIGN), pt.x, pt.y, hWnd, NULL);
/***********************************/
/*** nRet is the users selection, **/
/*** process it **/
/***********************************/
sdTrayProc(hWnd, iRet);
}
break;
}
}
break;
default:
{
/*****************************************************/
/*** the taskbar has been restarted, re-add our icon */
/*****************************************************/
if(msg == RegisterWindowMessage(_T("TaskbarCreated")))
{
char szVersion[64];
_snprintf(szVersion, 64, "HexChat [%s]", hexchat_get_info(ph, "version"));
AddIcon(g_hXchatWnd, 1, g_hIcons[0], szVersion, (NIF_ICON | NIF_MESSAGE | NIF_TIP), WM_TRAYMSG);
}
}
break;
}
return CallWindowProc(g_hOldProc, hWnd, msg, wparam, lparam);
}
/****************************************************/
/*** process messages from the tray menu ************/
/****************************************************/
LRESULT CALLBACK sdTrayProc(HWND hWnd, int msg)
{
switch(msg)
{
case ACT_EXIT:
{
g_bCanQuit = true;
PostMessage(hWnd, WM_CLOSE, 0, 0);
}
break;
case ACT_RESTORE:
{
/*************************************************/
/** user wants us to restore the HexChat window **/
/** and of autoaway is on, set as back ******** **/
/*************************************************/
SendMessage(g_hXchatWnd, WM_SYSCOMMAND, SC_RESTORE, 0);
SetForegroundWindow(hWnd);
if((!g_iIsActive) && (g_dwPrefs & (1<<PREF_AOM)))
{
hexchat_globally_back();
g_iIsActive = 1;
}
}
break;
case ACT_SETTINGS:
{
ShowWindow(g_hPrefDlg, SW_SHOW);
}
break;
case ACT_AWAY:
{
hexchat_globally_away(g_szAway);
}
break;
case ACT_BACK:
{
hexchat_globally_back();
}
break;
default:
{
if(msg > 0)
{
hexchat_set_context(ph, hexchat_find_server(msg-1));
if(!hexchat_get_info(ph, "away"))
{
hexchat_away(g_szAway);
}
else
{
hexchat_back();
}
}
}
break;
}
return 1;
}
int CALLBACK PrefProc(HWND hWnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
switch(msg)
{
case WM_INITDIALOG:
{
TCITEM tci1;
TCITEM tci2;
TCITEM tci3;
TCITEM tci4;
tci1.mask = TCIF_TEXT;
tci1.pszText = _T("Settings");
tci1.cchTextMax = strlen("Settings");
SendDlgItemMessage(hWnd, IDC_TAB_CONTROL, TCM_INSERTITEM, 0, (LPARAM)&tci1);
tci2.mask = TCIF_TEXT;
tci2.pszText = _T("Alerts");
tci2.cchTextMax = strlen("Alerts");
SendDlgItemMessage(hWnd, IDC_TAB_CONTROL, TCM_INSERTITEM, 1, (LPARAM)&tci2);
tci3.mask = TCIF_TEXT;
tci3.pszText = _T("Events");
tci3.cchTextMax = strlen("Events");
SendDlgItemMessage(hWnd, IDC_TAB_CONTROL, TCM_INSERTITEM, 2, (LPARAM)&tci3);
tci4.mask = TCIF_TEXT;
tci4.pszText = _T("About");
tci4.cchTextMax = strlen("About");
SendDlgItemMessage(hWnd, IDC_TAB_CONTROL, TCM_INSERTITEM, 3, (LPARAM)&tci4);
/***********************************************************************************/
/***********************************************************************************/
/***********************************************************************************/
g_hPrefTabSettings = CreateDialog((HINSTANCE)g_hInstance,
MAKEINTRESOURCE(IDD_SETTINGS),
hWnd,
(DLGPROC)SettingsProc);
SetDialog(g_hPrefTabSettings, IDD_SETTINGS);
g_hPrefTabAlerts = CreateDialog((HINSTANCE)g_hInstance,
MAKEINTRESOURCE(IDD_ALERTS),
hWnd,
(DLGPROC)AlertsProc);
SetDialog(g_hPrefTabAlerts, IDD_ALERTS);
g_hPrefTabEvents = CreateDialog((HINSTANCE)g_hInstance,
MAKEINTRESOURCE(IDD_EVENTS),
hWnd,
(DLGPROC)EventsProc);
SetDialog(g_hPrefTabEvents, IDD_EVENTS);
g_hPrefTabAbout = CreateDialog((HINSTANCE)g_hInstance,
MAKEINTRESOURCE(IDD_ABOUT),
hWnd,
(DLGPROC)AboutProc);
}
break;
case WM_SHOWWINDOW:
{
if(wparam)
{
SendDlgItemMessage(hWnd, IDC_TAB_CONTROL, TCM_SETCURSEL, 0, 0);
ShowWindow(g_hPrefTabSettings, SW_SHOW);
ShowWindow(g_hPrefTabAlerts, SW_HIDE);
ShowWindow(g_hPrefTabEvents, SW_HIDE);
ShowWindow(g_hPrefTabAbout, SW_HIDE);
}
}
break;
case WM_NOTIFY:
{
NMHDR *pData = (NMHDR *)lparam;
switch(pData->code)
{
case TCN_SELCHANGE:
{
switch(SendDlgItemMessage(hWnd, IDC_TAB_CONTROL, TCM_GETCURSEL, 0, 0))
{
case 0:
{
ShowWindow(g_hPrefTabSettings, SW_SHOW);
ShowWindow(g_hPrefTabAlerts, SW_HIDE);
ShowWindow(g_hPrefTabEvents, SW_HIDE);
ShowWindow(g_hPrefTabAbout, SW_HIDE);
}
break;
case 1:
{
ShowWindow(g_hPrefTabSettings, SW_HIDE);
ShowWindow(g_hPrefTabAlerts, SW_SHOW);
ShowWindow(g_hPrefTabEvents, SW_HIDE);
ShowWindow(g_hPrefTabAbout, SW_HIDE);
}
break;
case 2:
{
ShowWindow(g_hPrefTabSettings, SW_HIDE);
ShowWindow(g_hPrefTabAlerts, SW_HIDE);
ShowWindow(g_hPrefTabEvents, SW_SHOW);
ShowWindow(g_hPrefTabAbout, SW_HIDE);
}
break;
case 3:
{
ShowWindow(g_hPrefTabSettings, SW_HIDE);
ShowWindow(g_hPrefTabAlerts, SW_HIDE);
ShowWindow(g_hPrefTabEvents, SW_HIDE);
ShowWindow(g_hPrefTabAbout, SW_SHOW);
}
break;
}
}
break;
}
}
break;
case WM_CLOSE:
{
ShowWindow(g_hPrefTabEvents, SW_HIDE);
ShowWindow(g_hPrefTabSettings, SW_HIDE);
ShowWindow(g_hPrefTabAlerts, SW_HIDE);
ShowWindow(g_hPrefTabAbout, SW_HIDE);
ShowWindow(hWnd, SW_HIDE);
return TRUE;
}
break;
case WM_COMMAND:
{
switch(wparam)
{
case IDC_PREF_OK:
{
CheckPrefs(g_hPrefTabEvents, IDD_EVENTS);
CheckPrefs(g_hPrefTabSettings, IDD_SETTINGS);
CheckPrefs(g_hPrefTabAlerts, IDD_ALERTS);
SavePrefs(0);
ShowWindow(g_hPrefTabEvents, SW_HIDE);
ShowWindow(g_hPrefTabSettings, SW_HIDE);
ShowWindow(g_hPrefTabAlerts, SW_HIDE);
ShowWindow(g_hPrefTabAbout, SW_HIDE);
ShowWindow(hWnd, SW_HIDE);
return TRUE;
}
break;
case IDC_PREF_CANCEL:
{
ShowWindow(g_hPrefTabEvents, SW_HIDE);
ShowWindow(g_hPrefTabSettings, SW_HIDE);
ShowWindow(g_hPrefTabAlerts, SW_HIDE);
ShowWindow(g_hPrefTabAbout, SW_HIDE);
ShowWindow(hWnd, SW_HIDE);
return TRUE;
}
break;
case IDC_PREF_APPLY:
{
CheckPrefs(g_hPrefTabEvents, IDD_EVENTS);
CheckPrefs(g_hPrefTabSettings, IDD_SETTINGS);
CheckPrefs(g_hPrefTabAlerts, IDD_ALERTS);
SavePrefs(0);
return FALSE;
}
break;
}
}
break;
case WM_DESTROY:
{
SendMessage(g_hPrefTabEvents, WM_CLOSE, 0, 0);
SendMessage(g_hPrefTabSettings, WM_CLOSE, 0, 0);
SendMessage(g_hPrefTabAbout, WM_CLOSE, 0, 0);
SendMessage(g_hPrefTabAlerts, WM_CLOSE, 0, 0);
}
break;
}
return FALSE;
}
/****************************************************/
/****************************************************/
/****************************************************/
LRESULT CALLBACK AlertsProc(HWND hWnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
switch(msg)
{
case WM_CLOSE:
{
DestroyWindow(hWnd);
return TRUE;
break;
}
break;
case WM_COMMAND:
{
switch(LOWORD(wparam))
{
case PREF_AMAE:
{
SetToggle(hWnd, PREF_OSBWM, PREF_AMAE, TRUE);
SetToggle(hWnd, PREF_UWIOB, PREF_AMAE, TRUE);
SetToggle(hWnd, PREF_KAOI, PREF_AMAE, TRUE);
if(IsDlgButtonChecked(hWnd, PREF_AMAE))
{
SetToggle(hWnd, IDC_ALERT_HOTKEY, PREF_UWIOB, TRUE);
SetToggle(hWnd, IDC_ALERT_HOTKEY_TEXT, PREF_UWIOB, TRUE);
SetToggle(hWnd, IDC_ALERT_TIME, PREF_KAOI, FALSE);
SetToggle(hWnd, IDC_ALERT_TIME_TEXT, PREF_KAOI, FALSE);
}
else
{
SetToggle(hWnd, IDC_ALERT_HOTKEY, PREF_AMAE, TRUE);
SetToggle(hWnd, IDC_ALERT_HOTKEY_TEXT, PREF_AMAE, TRUE);
SetToggle(hWnd, IDC_ALERT_TIME, PREF_AMAE, TRUE);
SetToggle(hWnd, IDC_ALERT_TIME_TEXT, PREF_AMAE, TRUE);
}
}
break;
case PREF_UWIOB:
{
SetToggle(hWnd, IDC_ALERT_HOTKEY, PREF_UWIOB, TRUE);
SetToggle(hWnd, IDC_ALERT_HOTKEY_TEXT, PREF_UWIOB, TRUE);
}
break;
case PREF_KAOI:
{
SetToggle(hWnd, IDC_ALERT_TIME, PREF_KAOI, FALSE);
SetToggle(hWnd, IDC_ALERT_TIME_TEXT, PREF_KAOI, FALSE);
}
break;
}
break;
}
}
return FALSE;
}
/****************************************************/
/****************************************************/
/****************************************************/
LRESULT CALLBACK AboutProc(HWND hWnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
if(msg == WM_CLOSE)
{
DestroyWindow(hWnd);
return true;
}
return FALSE;
}
/*****************************************************/
/** Process the events for our event dialog **********/
/*****************************************************/
LRESULT CALLBACK EventsProc(HWND hWnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
if(msg == WM_CLOSE)
{
DestroyWindow(hWnd);
return true;
}
return FALSE;
}
/*****************************************************/
/** Process the events for our settings dialog this **/
/** is alot more complicated because options are **/
/** enabled/disabled based on the state of others **/
/*****************************************************/
LRESULT CALLBACK SettingsProc(HWND hWnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
if(msg == WM_CLOSE)
{
DestroyWindow(hWnd);
return true;
}
return FALSE;
}
/*****************************************************/
/** this is the hotkey message processing function **/
/** this window is always open and ready to be told **/
/** if someone has hit the hotkey, if they did, we **/
/** need to close out all of the tray alerts, for **/
/** this I wrote sdCloseAlerts, more info there **/
/*****************************************************/
LRESULT CALLBACK HotKeyProc(HWND hWnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
if(msg == WM_CLOSE)
{
DestroyWindow(hWnd);
return true;
}
else if(msg == WM_HOTKEY)
{
sdCloseAlerts();
}
return FALSE;
}
-37
View File
@@ -1,37 +0,0 @@
/* X-Tray
* Copyright (C) 2005 Michael Hotaling <Mike.Hotaling@SinisterDevelopments.com>
*
* X-Tray 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.
*
* X-Tray 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 X-Tray; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _H_CALLBACKS_H
#define _H_CALLBACKS_H
int event_cb (char *word[], void *userdata);
int command_cb (char *word[], char *word_eol[], void *userdata);
LRESULT CALLBACK WindowProc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
BOOL CALLBACK EnumWindowsProc (HWND hWnd, LPARAM lParam);
LRESULT CALLBACK sdTrayProc (HWND hwnd, int msg);
LRESULT CALLBACK AlertProc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
LRESULT CALLBACK HotKeyProc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
LRESULT CALLBACK EventsProc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
LRESULT CALLBACK AboutProc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
LRESULT CALLBACK AlertsProc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
LRESULT CALLBACK SettingsProc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
int CALLBACK PrefProc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
#endif
-320
View File
@@ -1,320 +0,0 @@
/* X-Tray
* Copyright (C) 1998, 2005 Peter Zelezny, Michael Hotaling <Mike.Hotaling@SinisterDevelopments.com>
*
* X-Tray 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.
*
* X-Tray 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 X-Tray; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <windows.h>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <tchar.h>
#include "hexchat-plugin.h"
#include "hextray.h"
#include "resource.h"
#include "hexchat.h"
#include "utility.h"
// from util.c of HexChat source code ( slightly modified to fit HexTray Syntax )
char *hexchat_strip_color (char *text)
{
int nc = 0;
int i = 0;
int col = 0;
int len = strlen(text);
char *new_str = (char *)malloc(len + 2);
while (len > 0)
{
if ((col && isdigit(*text) && (nc < 2)) || (col && isdigit(*(text+1)) && (nc < 3) && (*text == ',')))
{
nc++;
if(*text == ',')
{
nc = 0;
}
}
else
{
col = 0;
switch (*text)
{
case '\003': /*ATTR_COLOR: */
{
col = 1;
nc = 0;
}
break;
case '\007': /*ATTR_BEEP: */
case '\017': /*ATTR_RESET: */
case '\026': /*ATTR_REVERSE: */
case '\002': /*ATTR_BOLD: */
case '\037': /*ATTR_UNDERLINE: */
break;
default:
{
new_str[i] = *text;
i++;
}
break;
}
}
text++;
len--;
}
new_str[i] = 0;
return new_str;
}
void check_special_chars (char *cmd)
{
int occur = 0;
int len = strlen (cmd);
int i = 0, j = 0;
char *buf;
if (!len)
return;
buf = (char *)malloc (len + 1);
if (buf)
{
while (cmd[j])
{
switch (cmd[j])
{
case '%':
{
occur++;
switch (cmd[j + 1])
{
case 'R':
buf[i] = '\026';
break;
case 'U':
buf[i] = '\037';
break;
case 'B':
buf[i] = '\002';
break;
case 'C':
buf[i] = '\003';
break;
case 'O':
buf[i] = '\017';
break;
case '%':
buf[i] = '%';
break;
default:
buf[i] = '%';
j--;
break;
}
j++;
}
break;
default:
{
buf[i] = cmd[j];
}
break;
}
j++;
i++;
}
buf[i] = 0;
if (occur)
strcpy (cmd, buf);
free (buf);
}
}
void hexchat_globally_away(TCHAR *tszAway)
{
char szTemp[512];
char szAway[512];
ConvertString(tszAway, szAway, 512);
_snprintf(szTemp, 512, "ALLSERV AWAY %s\0", szAway);
check_special_chars(szTemp);
hexchat_exec(szTemp);
}
void hexchat_away(TCHAR *tszAway)
{
char szTemp[512];
char szAway[512];
ConvertString(tszAway, szAway, 512);
_snprintf(szTemp, 512, szAway);
check_special_chars(szTemp);
hexchat_commandf(ph, "AWAY %s\0", szTemp);
}
void hexchat_globally_back()
{
std::vector<int> xs;
std::vector<int>::iterator xsi;
hexchat_list *xl = hexchat_list_get(ph, "channels");
if(xl)
{
while(hexchat_list_next(ph, xl))
{
xsi = std::find(xs.begin(), xs.end(), hexchat_list_int(ph, xl, "id"));
if((xsi == xs.end()) &&
((strlen(hexchat_list_str(ph, xl, "server")) > 0) ||
(strlen(hexchat_list_str(ph, xl, "channel")) > 0)))
{
xs.push_back(hexchat_list_int(ph, xl, "id"));
hexchat_set_context(ph, (hexchat_context *)hexchat_list_str(ph, xl, "context"));
hexchat_back();
}
}
hexchat_list_free(ph, xl);
}
}
void hexchat_back()
{
if(hexchat_get_info(ph, "away"))
{
hexchat_command(ph, "BACK");
}
}
HMENU setServerMenu()
{
HMENU sTemp = CreateMenu();
TCHAR wszServer[128];
TCHAR wszNick[128];
TCHAR wszMenuEntry[256];
std::vector<int> xs;
std::vector<int>::iterator xsi;
hexchat_list *xl = hexchat_list_get(ph, "channels");
AppendMenu(sTemp, MF_STRING, ACT_AWAY, _T("Set Globally Away"));
AppendMenu(sTemp, MF_STRING, ACT_BACK, _T("Set Globally Back"));
AppendMenu(sTemp, MF_SEPARATOR, 0, NULL);
if(xl)
{
while(hexchat_list_next(ph, xl))
{
xsi = std::find(xs.begin(), xs.end(), hexchat_list_int(ph, xl, "id"));
if( (xsi == xs.end()) &&
((strlen(hexchat_list_str(ph, xl, "server")) > 0) ||
(strlen(hexchat_list_str(ph, xl, "channel")) > 0)))
{
hexchat_set_context(ph, (hexchat_context *)hexchat_list_str(ph, xl, "context"));
xs.push_back(hexchat_list_int(ph, xl, "id"));
char *network = _strdup(hexchat_list_str(ph, xl, "network"));
char *server = _strdup(hexchat_list_str(ph, xl, "server"));
char *nick = _strdup(hexchat_get_info(ph, "nick"));
if(network != NULL)
{
ConvertString(network, wszServer, 128);
}
else
{
ConvertString(server, wszServer, 128);
}
if(server != NULL)
{
ConvertString(nick, wszNick, 128);
_sntprintf(wszMenuEntry, 256, _T("%s @ %s\0"), wszNick, wszServer);
if(!hexchat_get_info(ph, "away"))
{
AppendMenu(sTemp, MF_STRING, (hexchat_list_int(ph, xl, "id") + 1), wszMenuEntry);
}
else
{
AppendMenu(sTemp, (MF_CHECKED | MF_STRING), (hexchat_list_int(ph, xl, "id") + 1), wszMenuEntry);
}
}
free(network);
free(server);
free(nick);
}
}
hexchat_list_free(ph, xl);
}
return sTemp;
}
struct _hexchat_context *hexchat_find_server(int find_id)
{
hexchat_context *xc;
hexchat_list *xl = hexchat_list_get(ph, "channels");
int id;
if(!xl)
return NULL;
while(hexchat_list_next(ph, xl))
{
id = hexchat_list_int(ph, xl, "id");
if(id == -1)
{
return NULL;
}
else if(id == find_id)
{
xc = (hexchat_context *)hexchat_list_str(ph, xl, "context");
hexchat_list_free(ph, xl);
return xc;
}
}
hexchat_list_free(ph, xl);
return NULL;
}
void hexchat_exec(char *command)
{
hexchat_set_context(ph, hexchat_find_context(ph, NULL, NULL));
hexchat_command(ph, command);
}
-32
View File
@@ -1,32 +0,0 @@
/* X-Tray
* Copyright (C) 2005 Michael Hotaling <Mike.Hotaling@SinisterDevelopments.com>
*
* X-Tray 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.
*
* X-Tray 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 X-Tray; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _H_XCHAT_H
#define _H_XCHAT_H
void hexchat_exec (char *);
char *hexchat_strip_color (char *);
void hexchat_parse (char *);
struct _hexchat_context *hexchat_find_server (int);
void hexchat_globally_away (TCHAR *);
void hexchat_away (TCHAR *);
void hexchat_globally_back ();
void hexchat_back ();
HMENU setServerMenu ();
#endif
-246
View File
@@ -1,246 +0,0 @@
/* X-Tray
* Copyright (C) 2005 Michael Hotaling <Mike.Hotaling@SinisterDevelopments.com>
*
* X-Tray 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.
*
* X-Tray 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 X-Tray; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define _WIN32_IE 0x0601
#include <windows.h>
#include <list>
#include <string>
#include <shobjidl.h>
#include "hexchat-plugin.h"
#include "resource.h"
#include "callbacks.h"
#include "utility.h"
#include "hextray.h"
#include "sdTray.h"
#include "sdAlerts.h"
/*****************************************************/
/**** Don't want to pollute the namespace do we? *****/
/*****************************************************/
std::list<hexchat_hook *> g_vHooks;
/*****************************************************/
/************ Global Identifiers *********************/
/*****************************************************/
WNDPROC g_hOldProc;
hexchat_plugin *ph;
/*****************************************************/
/***************** Resources *************************/
/*****************************************************/
HWND g_hXchatWnd;
HWND g_hHotkeyWnd;
HWND g_hPrefDlg;
HMENU g_hTrayMenu;
HICON g_hIcons[24];
HANDLE g_hInstance;
/*****************************************************/
/***************** Preferences ***********************/
/*****************************************************/
unsigned int g_dwPrefs;
TCHAR g_szAway[512];
int g_iTime;
BOOL WINAPI DllMain(HANDLE hModule, DWORD fdwReason, LPVOID lpVoid)
{
if((fdwReason == DLL_PROCESS_ATTACH) || (fdwReason == DLL_THREAD_ATTACH))
{
g_hInstance = hModule;
}
return TRUE;
}
int hexchat_plugin_init(hexchat_plugin *plugin_handle, char **plugin_name, char **plugin_desc, char **plugin_version, char *arg)
{
ph = plugin_handle;
*plugin_name = "HexTray";
*plugin_desc = "Minimize HexChat to the Windows system tray";
*plugin_version = "1.3.0";
char buffer[256];
/***************************************************************************************************************************/
/************************* Initialize our preferences if they don't exist yet **********************************************/
/***************************************************************************************************************************/
if (hexchat_pluginpref_get_int (ph, "settings") == -1)
{
hexchat_pluginpref_set_int (ph, "settings", HT_DEF_SET);
}
if (hexchat_pluginpref_get_int (ph, "aot") == -1)
{
hexchat_pluginpref_set_int (ph, "aot", HT_DEF_AOT);
}
if (hexchat_pluginpref_get_int (ph, "key") == -1)
{
hexchat_pluginpref_set_int (ph, "key", HT_DEF_KEY);
}
if (hexchat_pluginpref_get_int (ph, "mod") == -1)
{
hexchat_pluginpref_set_int (ph, "mod", HT_DEF_MOD);
}
if (hexchat_pluginpref_get_str (ph, "away", buffer) == 0)
{
hexchat_pluginpref_set_str (ph, "away", "");
}
/***************************************************************************************************************************/
/************************* Load our preferences ****************************************************************************/
/***************************************************************************************************************************/
LoadPrefs();
/***************************************************************************************************************************/
/************************* Finds the HexChat window and saves it for later use *********************************************/
/***************************************************************************************************************************/
g_hXchatWnd = (HWND)hexchat_get_info(ph, "win_ptr");
if(g_hXchatWnd == NULL)
{
EnumThreadWindows(GetCurrentThreadId(), EnumWindowsProc, 0);
}
g_hOldProc = (WNDPROC)GetWindowLongPtr(g_hXchatWnd, GWLP_WNDPROC);
SetWindowLongPtr(g_hXchatWnd, GWLP_WNDPROC, (LONG_PTR)WindowProc);
/***************************************************************************************************************************/
/************************* Grab the HexChat Icon, Load our menu, create the window to receive the hotkey messages *********/
/************************* and register the windows message so we know if explorer crashes ***********/
/***************************************************************************************************************************/
g_hTrayMenu = GetSubMenu(LoadMenu((HINSTANCE)g_hInstance, MAKEINTRESOURCE(IDR_TRAY_MENU)), 0);
g_hHotkeyWnd = CreateDialog((HINSTANCE)g_hInstance, MAKEINTRESOURCE(IDD_ALERT), NULL, (DLGPROC)HotKeyProc);
g_hPrefDlg = CreateDialog((HINSTANCE)g_hInstance, MAKEINTRESOURCE(IDD_PREF), g_hXchatWnd, (DLGPROC)PrefProc);
g_hIcons[0] = (HICON)LoadImage((HINSTANCE)g_hInstance, MAKEINTRESOURCE(ICO_XCHAT), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
g_hIcons[2] = (HICON)LoadImage((HINSTANCE)g_hInstance, MAKEINTRESOURCE(ICO_HIGHLIGHT), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
g_hIcons[5] = (HICON)LoadImage((HINSTANCE)g_hInstance, MAKEINTRESOURCE(ICO_BANNED), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
g_hIcons[6] = (HICON)LoadImage((HINSTANCE)g_hInstance, MAKEINTRESOURCE(ICO_KICKED), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
g_hIcons[8] = (HICON)LoadImage((HINSTANCE)g_hInstance, MAKEINTRESOURCE(ICO_PMSG), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
g_hIcons[10]= (HICON)LoadImage((HINSTANCE)g_hInstance, MAKEINTRESOURCE(ICO_SNOTICE), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
g_hIcons[11]= (HICON)LoadImage((HINSTANCE)g_hInstance, MAKEINTRESOURCE(ICO_DISCONNECTED), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
g_hIcons[22] = (HICON)LoadImage((HINSTANCE)g_hInstance, MAKEINTRESOURCE(ICO_CHANMSG), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
/***************************************************************************************************************************/
/************************* Add our icon to the tray ************************************************************************/
/***************************************************************************************************************************/
char szVersion[64];
_snprintf(szVersion, 64, "HexChat %s", hexchat_get_info(ph, "version"));
AddIcon(g_hXchatWnd, 1, g_hIcons[0], szVersion, (NIF_ICON | NIF_MESSAGE | NIF_TIP), WM_TRAYMSG);
/***************************************************************************************************************************/
/***************************************************************************************************************************/
/***************************************************************************************************************************/
if(g_dwPrefs & (1<<PREF_DNSIT))
{
DWORD dwStyle;
dwStyle = GetWindowLong(g_hXchatWnd, GWL_STYLE);
dwStyle |= (1<<WS_CHILD);
SetWindowLongPtr(g_hXchatWnd, GWL_STYLE, (LONG_PTR)dwStyle);
SetWindowLongPtr(g_hXchatWnd, GWL_HWNDPARENT, (LONG_PTR)g_hHotkeyWnd);
}
/***************************************************************************************************************************/
/************************* Set our hooks and save them for later so we can unhook them *************************************/
/***************************************************************************************************************************/
g_vHooks.push_back(hexchat_hook_print(ph, "Channel Msg Hilight", HEXCHAT_PRI_NORM, event_cb, (void *)CHAN_HILIGHT));
g_vHooks.push_back(hexchat_hook_print(ph, "Channel Message", HEXCHAT_PRI_NORM, event_cb, (void *)CHAN_MESSAGE));
g_vHooks.push_back(hexchat_hook_print(ph, "Topic Change", HEXCHAT_PRI_NORM, event_cb, (void *)CHAN_TOPIC_CHANGE));
g_vHooks.push_back(hexchat_hook_print(ph, "Channel Action Hilight", HEXCHAT_PRI_NORM, event_cb, (void *)CHAN_HILIGHT));
g_vHooks.push_back(hexchat_hook_print(ph, "Channel INVITE", HEXCHAT_PRI_NORM, event_cb, (void *)CHAN_INVITE));
g_vHooks.push_back(hexchat_hook_print(ph, "You Kicked", HEXCHAT_PRI_NORM, event_cb, (void *)CHAN_KICKED));
g_vHooks.push_back(hexchat_hook_print(ph, "Banned", HEXCHAT_PRI_NORM, event_cb, (void *)CHAN_BANNED));
g_vHooks.push_back(hexchat_hook_print(ph, "CTCP Generic", HEXCHAT_PRI_NORM, event_cb, (void *)CTCP_GENERIC));
g_vHooks.push_back(hexchat_hook_print(ph, "Private Message", HEXCHAT_PRI_NORM, event_cb, (void *)PMSG_RECEIVE));
g_vHooks.push_back(hexchat_hook_print(ph, "Private Message to Dialog", HEXCHAT_PRI_NORM, event_cb, (void *)PMSG_RECEIVE));
g_vHooks.push_back(hexchat_hook_print(ph, "Disconnected", HEXCHAT_PRI_NORM, event_cb, (void *)SERV_DISCONNECT));
g_vHooks.push_back(hexchat_hook_print(ph, "Killed", HEXCHAT_PRI_NORM, event_cb, (void *)SERV_KILLED));
g_vHooks.push_back(hexchat_hook_print(ph, "Notice", HEXCHAT_PRI_NORM, event_cb, (void *)SERV_NOTICE));
g_vHooks.push_back(hexchat_hook_command(ph, "tray_alert", HEXCHAT_PRI_NORM, command_cb, "Create an Alert", NULL));
return 1;
}
int hexchat_plugin_deinit(hexchat_plugin *plugin_handle)
{
/******************************************/
/****** Remove the Icon from the tray *****/
/******************************************/
StopBlink(g_hXchatWnd, 1, g_hIcons[0]);
RemoveIcon(g_hXchatWnd, 1);
/*******************************************/
/*******************************************/
/*******************************************/
if(g_dwPrefs & (1<<PREF_DNSIT))
{
DWORD dwStyle;
dwStyle = GetWindowLong(g_hXchatWnd, GWL_STYLE);
dwStyle &= ~(1<<WS_CHILD);
SetWindowLongPtr(g_hXchatWnd, GWL_STYLE, (LONG_PTR)dwStyle);
SetWindowLongPtr(g_hXchatWnd, GWL_HWNDPARENT, NULL);
}
/******************************************/
/****** Unload our resources **************/
/******************************************/
DestroyMenu(g_hTrayMenu);
for(int i = 0; i <= 11; i++)
{
DestroyIcon(g_hIcons[i]);
}
/******************************************/
/****** Remove our window hook ************/
/******************************************/
SetWindowLongPtr(g_hXchatWnd, GWLP_WNDPROC, (LONG_PTR)g_hOldProc);
/******************************************/
/****** Remove our hotkey, and destroy ****/
/****** the window that receives its ****/
/****** messages ****/
/******************************************/
UnregisterHotKey(g_hHotkeyWnd, 1);
DestroyWindow(g_hHotkeyWnd);
DestroyWindow(g_hPrefDlg);
/******************************************/
/************* Clean up Isle 7 ************/
/******************************************/
if(sdAlertNum())
{
sdCloseAlerts();
}
/******************************************/
/****** remove our hexchat_hook_*s **********/
/******************************************/
while(!g_vHooks.empty())
{
if(g_vHooks.back() != NULL)
{
hexchat_unhook(ph, g_vHooks.back());
}
g_vHooks.pop_back();
}
return 1;
}
-3
View File
@@ -1,3 +0,0 @@
EXPORTS
hexchat_plugin_init
hexchat_plugin_deinit
-83
View File
@@ -1,83 +0,0 @@
/* X-Tray
* Copyright (C) 2005 Michael Hotaling <Mike.Hotaling@SinisterDevelopments.com>
*
* X-Tray 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.
*
* X-Tray 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 X-Tray; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _XTRAY_H
#define _XTRAY_H
/******************** Default settings*****************/
#define HT_DEF_SET 13814
#define HT_DEF_AOT 5
#define HT_DEF_KEY 84
#define HT_DEF_MOD 6
/******************** Globals *************************/
extern HWND g_hXchatWnd;
extern HWND g_hHotkeyWnd;
extern HWND g_hPrefDlg;
extern HMENU g_hTrayMenu;
extern HICON g_hIcons[24];
extern HANDLE g_hInstance;
extern unsigned int g_dwPrefs;
extern TCHAR g_szAway[512];
extern int g_iTime;
extern WNDPROC g_hOldProc;
extern struct _hexchat_plugin *ph;
/******************************************************/
/******************** Messages ************************/
#define WM_TRAYMSG WM_APP
/******************************************************/
/********************* Events *************************/
#define CHAN_HILIGHT 1
#define CHAN_INVITE 2
#define CHAN_TOPIC_CHANGE 3
#define CHAN_BANNED 4
#define CHAN_KICKED 5
#define CTCP_GENERIC 6
#define PMSG_RECEIVE 7
#define SERV_KILLED 8
#define SERV_NOTICE 9
#define SERV_DISCONNECT 10
/* new events */
#define CHAN_MESSAGE 21
#define PREF_AOM 11 // away on minimize
#define PREF_TOT 12 // Tray on Taskbar
#define PREF_AMAE 13 // alert me about events
#define PREF_OSBWM 14 // Only Show Balloon When Minimized
#define PREF_UWIOB 15 // Use Window Instead of Balloon
#define PREF_KAOI 16 // Keep alerts open indefinitely
#define PREF_MIOC 17 // Minimize instead of close
#define PREF_BLINK 18 // blink icon
#define PREF_CICO 19 // change icon - not implemented
#define PREF_DNSIT 20 // Do not show in taskbar
/******************************************************/
#endif
#ifdef _WIN64
/* use replacement with the same value, and use SetWindowLongPtr instead
of SetWindowLong. more info:
http://msdn.microsoft.com/en-us/library/ms633591.aspx
http://msdn.microsoft.com/en-us/library/ms644898.aspx */
#define GWL_HWNDPARENT GWLP_HWNDPARENT
#endif
-129
View File
@@ -1,129 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{3024CF36-85E5-4E00-9608-7002E2C7EF14}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>hextray</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\win32\hexchat.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\win32\hexchat.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(HexChatBin)</OutDir>
<IntDir>$(HexChatObj)$(ProjectName)\</IntDir>
<TargetName>hchextray</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(HexChatBin)</OutDir>
<IntDir>$(HexChatObj)$(ProjectName)\</IntDir>
<TargetName>hchextray</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;XTRAY_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalIncludeDirectories>..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<ModuleDefinitionFile>hextray.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;XTRAY_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalIncludeDirectories>..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<ModuleDefinitionFile>hextray.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="bitmaps\sd.bmp" />
<None Include="icons\ban.ico" />
<None Include="icons\disconnect.ico" />
<None Include="icons\highlight.ico" />
<None Include="icons\kick.ico" />
<None Include="icons\message.ico" />
<None Include="icons\sd.ico" />
<None Include="icons\notice.ico" />
<None Include="icons\hexchat.ico" />
<None Include="hextray.def" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="resource.rc" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="callbacks.cpp" />
<ClCompile Include="sdAlerts.cpp" />
<ClCompile Include="sdTray.cpp" />
<ClCompile Include="utility.cpp" />
<ClCompile Include="hexchat.cpp" />
<ClCompile Include="hextray.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="callbacks.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="sdAlerts.h" />
<ClInclude Include="sdTray.h" />
<ClInclude Include="utility.h" />
<ClInclude Include="hexchat.h" />
<ClInclude Include="hextray.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
-103
View File
@@ -1,103 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Resource Files\bitmaps">
<UniqueIdentifier>{448b49a5-e68b-451e-bfbc-0855da024b2e}</UniqueIdentifier>
</Filter>
<Filter Include="Resource Files\icons">
<UniqueIdentifier>{8345128a-0635-43d6-9115-a85ad9c77ee2}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<None Include="hextray.def">
<Filter>Resource Files</Filter>
</None>
<None Include="bitmaps\sd.bmp">
<Filter>Resource Files\bitmaps</Filter>
</None>
<None Include="icons\ban.ico">
<Filter>Resource Files\icons</Filter>
</None>
<None Include="icons\disconnect.ico">
<Filter>Resource Files\icons</Filter>
</None>
<None Include="icons\highlight.ico">
<Filter>Resource Files\icons</Filter>
</None>
<None Include="icons\kick.ico">
<Filter>Resource Files\icons</Filter>
</None>
<None Include="icons\message.ico">
<Filter>Resource Files\icons</Filter>
</None>
<None Include="icons\sd.ico">
<Filter>Resource Files\icons</Filter>
</None>
<None Include="icons\notice.ico">
<Filter>Resource Files\icons</Filter>
</None>
<None Include="icons\hexchat.ico">
<Filter>Resource Files\icons</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="resource.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<ClCompile Include="callbacks.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="sdAlerts.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="sdTray.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="utility.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="hexchat.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="hextray.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="callbacks.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="sdAlerts.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="sdTray.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="utility.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="hexchat.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="hextray.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

-47
View File
@@ -1,47 +0,0 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by resource.rc
//
#define IDD_ALERTS 104
#define IDD_EVENTS 105
#define IDD_SETTINGS 106
#define IDD_ALERT 107
#define IDD_PREF 108
#define IDD_ABOUT 109
#define IDR_TRAY_MENU 110
#define ICO_XCHAT 111
#define ICO_BANNED 112
#define ICO_CHANMSG 113
#define ICO_DISCONNECTED 114
#define ICO_HIGHLIGHT 115
#define ICO_KICKED 116
#define ICO_PMSG 117
#define ICO_SNOTICE 118
#define IDB_SD_LOGO 119
#define IDC_PREF_OK 1014
#define IDC_PREF_CANCEL 1015
#define IDC_PREF_APPLY 1016
#define IDC_AWAY_MSG 1017
#define IDC_ALERT_TIME 1018
#define IDC_TAB_CONTROL 1019
#define IDC_ALERT_HOTKEY 1020
#define IDC_ALERT_MSG 1021
#define IDC_ALERT_HOTKEY_TEXT 1022
#define IDC_ALERT_TIME_TEXT 1023
#define ACT_EXIT 40001
#define ACT_SETTINGS 40002
#define ACT_AWAY 40003
#define ACT_BACK 40004
#define ACT_RESTORE 40005
#define IDC_STATIC -1
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 120
#define _APS_NEXT_COMMAND_VALUE 40006
#define _APS_NEXT_CONTROL_VALUE 1024
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
-309
View File
@@ -1,309 +0,0 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#undef APSTUDIO_HIDDEN_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_EVENTS DIALOGEX 8, 20, 216, 143
STYLE DS_SETFONT | DS_SETFOREGROUND | WS_CHILD
FONT 8, "Tahoma", 0, 0, 0x0
BEGIN
GROUPBOX "HexChat Events",IDC_STATIC,5,5,205,77
CONTROL "Banned",4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,18,49,10
CONTROL "Kicked",5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,32,49,10
CONTROL "Killed",8,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,46,49,10
CONTROL "Disconnect",10,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,60,49,10
CONTROL "Private Message",7,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,70,18,69,10
CONTROL "Channel Message",21,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,70,32,69,10
CONTROL "Highlight",1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,70,46,69,10
CONTROL "CTCP",6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,70,60,69,10
CONTROL "Topic Change",3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,145,18,55,10
CONTROL "Server Notice",9,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,145,32,55,10
CONTROL "Invite",2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,145,46,55,10
END
IDD_SETTINGS DIALOGEX 8, 20, 216, 143
STYLE DS_SETFONT | WS_CHILD
FONT 8, "Tahoma", 0, 0, 0x0
BEGIN
GROUPBOX "Options",IDC_STATIC,5,5,205,135
CONTROL "Auto away on minimize",11,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,16,60,100,10
CONTROL "Minimize HexChat to the system tray",12,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,16,18,133,10
CONTROL "Minimize to the tray instead of closing",17,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,16,32,174,9
EDITTEXT IDC_AWAY_MSG,33,86,169,50,ES_AUTOHSCROLL
LTEXT "Away Msg:",IDC_STATIC,27,72,35,8
CONTROL "Remove HexChat from the taskbar (only show in tray)",
20,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,46,191,9
END
IDD_ALERT DIALOGEX 0, 0, 151, 28
STYLE DS_LOCALEDIT | DS_SETFONT | DS_NOIDLEMSG | DS_CENTER | WS_CAPTION |
WS_SYSMENU
EXSTYLE WS_EX_NOPARENTNOTIFY | WS_EX_ACCEPTFILES | WS_EX_TOOLWINDOW
CAPTION "Event Name"
FONT 8, "Tahoma", 0, 0, 0x1
BEGIN
LTEXT "Event Text",IDC_ALERT_MSG,3,0,147,27
END
IDD_PREF DIALOGEX 0, 0, 233, 190
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION |
WS_SYSMENU
CAPTION "HexTray Preferences"
FONT 8, "Tahoma", 0, 0, 0x0
BEGIN
DEFPUSHBUTTON "Ok",IDC_PREF_OK,57,173,50,14
PUSHBUTTON "Cancel",IDC_PREF_CANCEL,115,173,50,14
PUSHBUTTON "Apply",IDC_PREF_APPLY,175,173,50,14
CONTROL "Tab1",IDC_TAB_CONTROL,"SysTabControl32",0x0,7,7,218,159
END
IDD_ABOUT DIALOGEX 8, 20, 216, 143
STYLE DS_SETFONT | WS_CHILD
FONT 8, "Tahoma", 0, 0, 0x0
BEGIN
CONTROL 119,IDC_STATIC,"Static",SS_BITMAP | SS_SUNKEN |
WS_BORDER,3,6,88,81
CTEXT "HexTray\r\nBy: Michael Hotaling\r\n www.SinisterDevelopments.com",
IDC_STATIC,95,33,118,30
LTEXT "Folken\r\nBasket\r\nDonatzsky\r\nDaemon404",IDC_STATIC,
15,103,64,33
GROUPBOX "Special Thanks To:",IDC_STATIC,3,91,89,50
GROUPBOX "Version Information:",IDC_STATIC,101,92,109,49
LTEXT "1.3.0",IDC_STATIC,170,105,33,8,0,WS_EX_RIGHT
LTEXT "Compiled In: ",IDC_STATIC,110,117,54,8
LTEXT "2012",IDC_STATIC,170,117,33,8,0,WS_EX_RIGHT
LTEXT "Version Number:",IDC_STATIC,110,105,54,8
END
IDD_ALERTS DIALOGEX 8, 20, 216, 143
STYLE DS_SETFONT | WS_CHILD
FONT 8, "Tahoma", 0, 0, 0x0
BEGIN
GROUPBOX "Alerts",IDC_STATIC,5,5,205,117
CONTROL "Only show alerts while minimized",14,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,27,46,117,10
CONTROL "Use tray alerts to notify me about events",13,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,16,32,152,10
CONTROL "Use window instead of balloons",15,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,27,60,141,11
EDITTEXT IDC_ALERT_TIME,137,101,61,12,ES_AUTOHSCROLL | ES_NUMBER,
WS_EX_RIGHT
LTEXT "Show alert for x seconds:",IDC_ALERT_TIME_TEXT,40,103,
83,9
CONTROL "Alert Hotkey",IDC_ALERT_HOTKEY,"msctls_hotkey32",
WS_BORDER | WS_TABSTOP,137,74,61,13
LTEXT "Close all alerts hotkey:",IDC_ALERT_HOTKEY_TEXT,39,75,
76,10
CONTROL "Leave alerts open indefinitely",16,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,27,88,115,11
CONTROL "Blink Icon to alert me about events",18,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,16,18,127,10
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_EVENTS, DIALOG
BEGIN
BOTTOMMARGIN, 56
END
IDD_SETTINGS, DIALOG
BEGIN
BOTTOMMARGIN, 66
END
IDD_ALERT, DIALOG
BEGIN
RIGHTMARGIN, 150
BOTTOMMARGIN, 26
END
IDD_PREF, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 232
TOPMARGIN, 7
BOTTOMMARGIN, 176
END
IDD_ABOUT, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 209
TOPMARGIN, 7
BOTTOMMARGIN, 136
END
IDD_ALERTS, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 208
TOPMARGIN, 7
BOTTOMMARGIN, 136
END
END
#endif // APSTUDIO_INVOKED
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
"#include ""windows.h""\r\n"
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"hextray.h\0"
END
4 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,3,0,0
PRODUCTVERSION 1,3,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "SinisterDevelopments"
VALUE "FileDescription", "HexTray"
VALUE "FileVersion", "1,3,0,0"
VALUE "InternalName", "HexTray"
VALUE "LegalCopyright", "Copyright © 2005"
VALUE "OriginalFilename", "hchextray.dll"
VALUE "ProductName", "HexTray - HexChat Win32 System Tray Plugin"
VALUE "ProductVersion", "1,3,0,0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDR_TRAY_MENU MENU
BEGIN
POPUP "TRAY"
BEGIN
MENUITEM "Restore", ACT_RESTORE
MENUITEM SEPARATOR
MENUITEM "Away", 65535
MENUITEM "Settings", ACT_SETTINGS
MENUITEM SEPARATOR
MENUITEM "Exit", ACT_EXIT
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
ICO_XCHAT ICON "icons\\hexchat.ico"
ICO_BANNED ICON "icons\\ban.ico"
ICO_CHANMSG ICON "icons\\message.ico"
ICO_HIGHLIGHT ICON "icons\\highlight.ico"
ICO_KICKED ICON "icons\\kick.ico"
ICO_PMSG ICON "icons\\message.ico"
ICO_SNOTICE ICON "icons\\notice.ico"
ICO_DISCONNECTED ICON "icons\\disconnect.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDB_SD_LOGO BITMAP "bitmaps\\sd.bmp"
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
hextray.h
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
-109
View File
@@ -1,109 +0,0 @@
/* X-Tray
* Copyright (C) 2005 Michael Hotaling <Mike.Hotaling@SinisterDevelopments.com>
*
* X-Tray 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.
*
* X-Tray 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 X-Tray; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <windows.h>
#include <winuser.h>
#include <stdio.h>
#include "utility.h"
#include "resource.h"
#include "sdAlerts.h"
int g_iAlerts = 0;
void sdSystemAlert(HINSTANCE hModule, UINT uiDialog, char *szMsg, char *szName, unsigned int iTime)
{
TCHAR wszMsg[256];
TCHAR wszName[64];
HWND hDialog;
RECT rcWorkArea, rcDlg;
int ixPos, iyPos;
int iNumPerCol;
hDialog = CreateDialog(hModule, MAKEINTRESOURCE(uiDialog), NULL, (DLGPROC)sdAlertProc);
SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, 0);
GetWindowRect(hDialog, &rcDlg);
iNumPerCol = ((rcWorkArea.bottom - rcWorkArea.top) / (rcDlg.bottom - rcDlg.top));
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;
}
-26
View File
@@ -1,26 +0,0 @@
/* X-Tray
* Copyright (C) 2005 Michael Hotaling <Mike.Hotaling@SinisterDevelopments.com>
*
* X-Tray 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.
*
* X-Tray 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 X-Tray; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _H_SDALERTS_H
#define _H_SDALERTS_H
void sdSystemAlert (HINSTANCE, UINT, char *, char *, UINT);
LRESULT CALLBACK sdAlertProc (HWND, UINT, WPARAM, LPARAM);
int sdAlertNum ();
void sdCloseAlerts ();
#endif
-207
View File
@@ -1,207 +0,0 @@
/* X-Tray
* Copyright (C) 2005 Michael Hotaling <Mike.Hotaling@SinisterDevelopments.com>
*
* X-Tray 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.
*
* X-Tray 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 X-Tray; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define _WIN32_IE 0x601
#include <windows.h>
#include <stdio.h>
#include <tchar.h>
#include "sdTray.h"
#include "utility.h"
HANDLE hThread;
iBlink *tData = NULL;
int AddIcon(HWND hwnd, UINT id, HICON hicon, char *szTip, unsigned short flags, unsigned int cbMsg)
{
NOTIFYICONDATA nidata;
nidata.cbSize = NOTIFYICONDATA_V2_SIZE;
nidata.hIcon = hicon;
nidata.hWnd = hwnd;
nidata.uCallbackMessage = cbMsg;
nidata.uFlags = flags;
nidata.uID = id;
if(szTip != NULL)
{
TCHAR *szTemp = new TCHAR[64];
ConvertString(szTip, szTemp, 64);
_tcsncpy(nidata.szTip, szTemp, 64);
delete[] szTemp;
}
return Shell_NotifyIcon(NIM_ADD, &nidata);
}
int RemoveIcon(HWND hwnd, UINT id)
{
if(hThread != NULL)
{
TerminateThread(hThread, 0);
hThread = NULL;
delete tData;
}
NOTIFYICONDATA nidata;
nidata.cbSize = NOTIFYICONDATA_V2_SIZE;
nidata.hWnd = hwnd;
nidata.uID = id;
return Shell_NotifyIcon(NIM_DELETE, &nidata);
}
int SetIcon(HWND hwnd, UINT id, HICON hicon)
{
NOTIFYICONDATA nidata;
nidata.cbSize = NOTIFYICONDATA_V2_SIZE;
nidata.hWnd = hwnd;
nidata.uID = id;
nidata.hIcon = hicon;
nidata.uFlags = NIF_ICON;
return Shell_NotifyIcon(NIM_MODIFY, &nidata);
}
int SetTooltip(HWND hwnd, UINT id, char *szTip)
{
NOTIFYICONDATA nidata;
nidata.cbSize = NOTIFYICONDATA_V2_SIZE;
nidata.hWnd = hwnd;
nidata.uID = id;
nidata.uFlags = NIF_TIP;
if(szTip != NULL)
{
TCHAR *szTemp = new TCHAR[64];
ConvertString(szTip, szTemp, 64);
_tcsncpy(nidata.szTip, szTemp, 64);
delete[] szTemp;
}
return Shell_NotifyIcon(NIM_MODIFY, &nidata);
}
int ShowBalloon(HWND hwnd, UINT id, char *szInfo, char *szTitle, UINT time, UINT infoFlags)
{
NOTIFYICONDATA nidata;
nidata.cbSize = NOTIFYICONDATA_V2_SIZE;
nidata.hWnd = hwnd;
nidata.uID = id;
nidata.uFlags = NIF_INFO;
nidata.dwInfoFlags = infoFlags;
if(time > 0)
nidata.uTimeout = time;
else
nidata.uTimeout = 500000;
if(szInfo != NULL)
{
TCHAR *szTemp = new TCHAR[255];
ConvertString(szInfo, szTemp, 251);
szTemp[250] = 0;
if(strlen(szInfo) > 255)
{
_sntprintf(szTemp, 255, _T("%s..."), szTemp);
}
_tcsncpy(nidata.szInfo, szTemp, 255);
delete[] szTemp;
}
if(szTitle != NULL)
{
TCHAR *wszTitle = new TCHAR[64];
ConvertString(szTitle, wszTitle, 64);
_tcsncpy(nidata.szInfoTitle, wszTitle, 64);
delete[] wszTitle;
}
return Shell_NotifyIcon(NIM_MODIFY, &nidata);
}
DWORD WINAPI BlinkThread(LPVOID lpParam)
{
NOTIFYICONDATA nidata;
nidata.cbSize = NOTIFYICONDATA_V2_SIZE;
nidata.hWnd = tData->hwnd;
nidata.uID = tData->id;
nidata.uFlags = NIF_ICON;
for(UINT i = 0; i < tData->num; i++)
{
nidata.hIcon = tData->hBlink;
Shell_NotifyIcon(NIM_MODIFY, &nidata);
Sleep(tData->time);
nidata.hIcon = tData->hBase;
Shell_NotifyIcon(NIM_MODIFY, &nidata);
Sleep(tData->time);
}
delete tData;
hThread = NULL;
return 0;
}
int BlinkIcon(HWND hwnd, UINT id, HICON hBase, HICON hBlink, UINT time, UINT num)
{
if(hThread != NULL)
{
StopBlink(hwnd, id, hBase);
}
DWORD dwThreadID;
tData = new iBlink;
tData->hwnd = hwnd;
tData->id = id;
tData->hBase = hBase;
tData->hBlink = hBlink;
tData->time = time;
tData->num = num;
hThread = CreateThread(NULL, 0, BlinkThread, tData, 0, &dwThreadID);
return 0;
}
void StopBlink(HWND hwnd, UINT id, HICON hBase)
{
if(hThread != NULL)
{
TerminateThread(hThread, 0);
hThread = NULL;
delete tData;
}
SetIcon(hwnd, id, hBase);
}
-39
View File
@@ -1,39 +0,0 @@
/* X-Tray
* Copyright (C) 2005 Michael Hotaling <Mike.Hotaling@SinisterDevelopments.com>
*
* X-Tray 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.
*
* X-Tray 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 X-Tray; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _H_SDTRAY_H
#define _H_SDTRAY_H
int AddIcon (HWND, UINT, HICON, char *, unsigned short, UINT);
int ShowBalloon (HWND, UINT, char *, char *, UINT, UINT);
int BlinkIcon (HWND, UINT, HICON, HICON, UINT, UINT);
int SetTooltip (HWND, UINT, char *);
int SetIcon (HWND, UINT, HICON);
void StopBlink (HWND, UINT, HICON);
int RemoveIcon (HWND, UINT);
typedef struct IBLINK
{
HICON hBase;
HICON hBlink;
HWND hwnd;
UINT id;
UINT time;
UINT num;
}iBlink;
#endif
-410
View File
@@ -1,410 +0,0 @@
/* X-Tray
* Copyright (C) 2005 Michael Hotaling <Mike.Hotaling@SinisterDevelopments.com>
*
* X-Tray 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.
*
* X-Tray 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 X-Tray; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <windows.h>
#include <stdio.h>
#include <commctrl.h>
#include <tchar.h>
#include "hexchat-plugin.h"
#include "utility.h"
#include "hextray.h"
#include "callbacks.h"
#include "resource.h"
struct HOTKEY g_hHotKey;
/* we need to convert ALT and SHIFT modifiers
// from <winuser.h>
#define MOD_ALT 0x0001
#define MOD_CONTROL 0x0002
#define MOD_SHIFT 0x0004
// from <commctrl.h>
#define HOTKEYF_SHIFT 0x01
#define HOTKEYF_CONTROL 0x02
#define HOTKEYF_ALT 0x04
*/
WORD HotkeyfToMod(WORD modifiers)
{
WORD newmods = 0;
if (modifiers & HOTKEYF_SHIFT)
newmods |= MOD_SHIFT;
if (modifiers & HOTKEYF_CONTROL)
newmods |= MOD_CONTROL;
if (modifiers & HOTKEYF_ALT)
newmods |= MOD_ALT;
return newmods;
}
WORD ModToHotkeyf(WORD modifiers)
{
WORD newmods = 0;
if (modifiers & MOD_SHIFT)
newmods |= HOTKEYF_SHIFT;
if (modifiers & MOD_CONTROL)
newmods |= HOTKEYF_CONTROL;
if (modifiers & MOD_ALT)
newmods |= HOTKEYF_ALT;
return newmods;
}
void SavePrefs(int iDlg)
{
hexchat_pluginpref_set_int (ph, "settings", g_dwPrefs);
hexchat_pluginpref_set_int (ph, "aot", g_iTime);
hexchat_pluginpref_set_int (ph, "key", g_hHotKey.key);
hexchat_pluginpref_set_int (ph, "mod", g_hHotKey.mod);
hexchat_pluginpref_set_str (ph, "away", (const char*) g_szAway);
}
void LoadPrefs()
{
/**************************************************************************************************/
/*********************** Our Settings Section *****************************************************/
/**************************************************************************************************/
/**************************************************************************************************/
/*************************** Get the value for each of our preferances ****************************/
/**************************************************************************************************/
g_dwPrefs = hexchat_pluginpref_get_int (ph, "settings");
g_iTime = hexchat_pluginpref_get_int (ph, "aot");
g_hHotKey.key = hexchat_pluginpref_get_int (ph, "key");
g_hHotKey.mod = hexchat_pluginpref_get_int (ph, "mod");
hexchat_pluginpref_get_str (ph, "away", (char *) g_szAway);
/**************************************************************************************************/
/******************************** Register our hotkey with windows ********************************/
/**************************************************************************************************/
if(g_dwPrefs & (1<<PREF_UWIOB))
{
RegisterHotKey(g_hHotkeyWnd, 1, g_hHotKey.mod, g_hHotKey.key);
}
}
void CheckPrefs(HWND hwnd, int iDlg)
{
/**************************************************************************************************/
/**************** save the preferances based on the checkmarks/options ****************************/
/**************************************************************************************************/
switch(iDlg)
{
case IDD_EVENTS:
{
SetOption(hwnd, CHAN_HILIGHT, CHAN_HILIGHT);
SetOption(hwnd, CHAN_INVITE, CHAN_INVITE);
SetOption(hwnd, CHAN_TOPIC_CHANGE, CHAN_TOPIC_CHANGE);
SetOption(hwnd, CHAN_BANNED, CHAN_BANNED);
SetOption(hwnd, CHAN_KICKED, CHAN_KICKED);
SetOption(hwnd, CTCP_GENERIC, CTCP_GENERIC);
SetOption(hwnd, PMSG_RECEIVE, PMSG_RECEIVE);
SetOption(hwnd, SERV_KILLED, SERV_KILLED);
SetOption(hwnd, SERV_NOTICE, SERV_NOTICE);
SetOption(hwnd, SERV_DISCONNECT, SERV_DISCONNECT);
SetOption(hwnd, CHAN_MESSAGE, CHAN_MESSAGE);
}
break;
case IDD_ALERTS:
{
SetOption(hwnd, PREF_AMAE, PREF_AMAE);
SetOption(hwnd, PREF_OSBWM, PREF_OSBWM);
SetOption(hwnd, PREF_UWIOB, PREF_UWIOB);
SetOption(hwnd, PREF_KAOI, PREF_KAOI);
SetOption(hwnd, PREF_BLINK, PREF_BLINK);
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
TCHAR tTime[512];
GetWindowText(GetDlgItem(hwnd, IDC_ALERT_TIME), tTime, 511);
g_iTime = _tstoi(tTime);
/**************************************************************************/
/**************** Get our Hotkey and save it **********/
/**************** then remove the old hotkey and add the new one **********/
/**************************************************************************/
DWORD hHotkey;
hHotkey = SendDlgItemMessage(hwnd, IDC_ALERT_HOTKEY, HKM_GETHOTKEY, 0, 0);
g_hHotKey.key = LOBYTE(hHotkey);
g_hHotKey.mod = HotkeyfToMod(HIBYTE(hHotkey));
if(IsDlgButtonChecked(hwnd, PREF_UWIOB) == BST_CHECKED)
{
UnregisterHotKey(g_hHotkeyWnd, 1);
RegisterHotKey(g_hHotkeyWnd, 1, g_hHotKey.mod, g_hHotKey.key);
}
else
{
UnregisterHotKey(g_hHotkeyWnd, 1);
}
/*************************************************************************/
/*********** Get and save the away msg and alert time ********************/
/*************************************************************************/
}
break;
case IDD_SETTINGS:
{
SetOption(hwnd, PREF_AOM, PREF_AOM);
SetOption(hwnd, PREF_TOT, PREF_TOT);
SetOption(hwnd, PREF_MIOC, PREF_MIOC);
SetOption(hwnd, PREF_DNSIT, PREF_DNSIT);
GetDlgItemText(hwnd, IDC_AWAY_MSG, g_szAway, 511);
if(g_dwPrefs & (1<<PREF_DNSIT))
{
DWORD dwStyle;
dwStyle = GetWindowLong(g_hXchatWnd, GWL_STYLE);
dwStyle |= (1<<WS_CHILD);
SetWindowLongPtr(g_hXchatWnd, GWL_STYLE, (LONG_PTR)dwStyle);
SetWindowLongPtr(g_hXchatWnd, GWL_HWNDPARENT, (LONG_PTR)g_hHotkeyWnd);
}
else
{
DWORD dwStyle;
dwStyle = GetWindowLong(g_hXchatWnd, GWL_STYLE);
dwStyle &= ~(1<<WS_CHILD);
SetWindowLongPtr(g_hXchatWnd, GWL_STYLE, (LONG_PTR)dwStyle);
SetWindowLongPtr(g_hXchatWnd, GWL_HWNDPARENT, NULL);
}
}
break;
}
}
void SetDialog(HWND hwnd, int iDlg)
{
switch(iDlg)
{
case IDD_EVENTS:
{
SetCheck(hwnd, CHAN_HILIGHT, CHAN_HILIGHT);
SetCheck(hwnd, CHAN_INVITE, CHAN_INVITE);
SetCheck(hwnd, CHAN_TOPIC_CHANGE, CHAN_TOPIC_CHANGE);
SetCheck(hwnd, CHAN_BANNED, CHAN_BANNED);
SetCheck(hwnd, CHAN_KICKED, CHAN_KICKED);
SetCheck(hwnd, CTCP_GENERIC, CTCP_GENERIC);
SetCheck(hwnd, PMSG_RECEIVE, PMSG_RECEIVE);
SetCheck(hwnd, SERV_KILLED, SERV_KILLED);
SetCheck(hwnd, SERV_NOTICE, SERV_NOTICE);
SetCheck(hwnd, SERV_DISCONNECT, SERV_DISCONNECT);
SetCheck(hwnd, CHAN_MESSAGE, CHAN_MESSAGE);
}
break;
case IDD_SETTINGS:
{
SetCheck(hwnd, PREF_TOT, PREF_TOT);
SetCheck(hwnd, PREF_MIOC, PREF_MIOC);
SetCheck(hwnd, PREF_AOM, PREF_AOM);
SetCheck(hwnd, PREF_DNSIT, PREF_DNSIT);
SetDlgItemText(hwnd, IDC_AWAY_MSG, g_szAway);
}
break;
case IDD_ALERTS:
{
SetCheck(hwnd, PREF_BLINK, PREF_BLINK);
SetCheck(hwnd, PREF_OSBWM, PREF_OSBWM);
SetCheck(hwnd, PREF_UWIOB, PREF_UWIOB);
SetCheck(hwnd, PREF_KAOI, PREF_KAOI);
/**********************************************************/
/**********************************************************/
/**********************************************************/
if(SetCheck(hwnd, PREF_AMAE, PREF_AMAE) == false)
{
SetToggle(hwnd, PREF_OSBWM, PREF_AMAE, TRUE);
SetToggle(hwnd, PREF_UWIOB, PREF_AMAE, TRUE);
SetToggle(hwnd, PREF_KAOI, PREF_AMAE, TRUE);
SetToggle(hwnd, IDC_ALERT_TIME, PREF_AMAE, TRUE);
SetToggle(hwnd, IDC_ALERT_TIME_TEXT, PREF_AMAE, TRUE);
SetToggle(hwnd, IDC_ALERT_HOTKEY, PREF_AMAE, TRUE);
SetToggle(hwnd, IDC_ALERT_HOTKEY_TEXT, PREF_AMAE, TRUE);
}
else
{
SetToggle(hwnd, IDC_ALERT_HOTKEY, PREF_UWIOB, TRUE);
SetToggle(hwnd, IDC_ALERT_HOTKEY_TEXT, PREF_UWIOB, TRUE);
SetToggle(hwnd, IDC_ALERT_TIME, PREF_KAOI, FALSE);
SetToggle(hwnd, IDC_ALERT_TIME_TEXT, PREF_KAOI, FALSE);
}
/**********************************************************/
/**********************************************************/
/**********************************************************/
TCHAR tTime[255];
SendDlgItemMessage(hwnd, IDC_ALERT_TIME, WM_SETTEXT, 0, (LPARAM)_itot(g_iTime, tTime, 10));
SendDlgItemMessage(hwnd, IDC_ALERT_HOTKEY, HKM_SETHOTKEY, MAKEWORD(g_hHotKey.key, ModToHotkeyf(g_hHotKey.mod)), 0);
}
break;
}
}
int SetCheck(HWND hDialog, unsigned int uiCheckBox, unsigned int uiPref)
{
if((g_dwPrefs & (1<<uiPref)))
{
CheckDlgButton(hDialog, uiCheckBox, BST_CHECKED);
return 1;
}
else
{
CheckDlgButton(hDialog, uiCheckBox, BST_UNCHECKED);
return 0;
}
return 0;
}
int SetToggle(HWND hDialog, unsigned int uiCheckBox, unsigned int uiTestbox, bool offeqoff)
{
/**************************************************************************************************/
/*********************** if(true) then if option is off turn toggle off ***************************/
/*********************** if(false) then if option is off turn toggle on ***************************/
/**************************************************************************************************/
if(offeqoff)
{
if(IsDlgButtonChecked(hDialog, uiTestbox) == BST_CHECKED)
{
EnableWindow(GetDlgItem(hDialog, uiCheckBox), TRUE);
return 1;
}
else
{
EnableWindow(GetDlgItem(hDialog, uiCheckBox), FALSE);
return 0;
}
}
else
{
if(IsDlgButtonChecked(hDialog, uiTestbox) == BST_CHECKED)
{
EnableWindow(GetDlgItem(hDialog, uiCheckBox), FALSE);
return 1;
}
else
{
EnableWindow(GetDlgItem(hDialog, uiCheckBox), TRUE);
return 0;
}
}
return 0;
}
int SetOption(HWND hDialog, unsigned int uiCheckBox, unsigned int uiPref)
{
if(IsDlgButtonChecked(hDialog, uiCheckBox) == BST_CHECKED)
{
g_dwPrefs |= (1<<uiPref);
}
else
{
g_dwPrefs &= ~(1<<uiPref);
}
return (g_dwPrefs & (1<<uiPref));
}
// For cleanup ( Closing windows and the such )
void HoldClose()
{
HANDLE hcThread;
DWORD dwThreadID;
hcThread = CreateThread(NULL, 0, HoldCloseThread, 0, 0, &dwThreadID);
}
DWORD WINAPI HoldCloseThread(LPVOID lpParam)
{
Sleep(1000);
PostMessage(g_hXchatWnd, WM_CLOSE, 0, 0);
return 0;
}
bool FileExists(TCHAR *file)
{
HANDLE hTemp = CreateFile(file, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
int nRet = GetLastError();
CloseHandle(hTemp);
if(nRet == 0)
{
return true;
}
else
{
return false;
}
return false;
}
void ConvertString(const char *in, wchar_t *out, int size)
{
MultiByteToWideChar(CP_UTF8, 0, in, -1, out, size);
}
void ConvertString(const wchar_t *in, char *out, int size)
{
WideCharToMultiByte(CP_UTF8, 0, in, (size - 1), out, size, NULL, NULL);
}
void ConvertString(const char *in, char *out, int size)
{
strncpy(out, in, size);
}
void ErrorDebug(LPTSTR lpszFunction)
{
TCHAR szBuf[80];
LPVOID lpMsgBuf;
DWORD dw = GetLastError();
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
dw,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf,
0, NULL );
_stprintf(szBuf,
_T("%s failed with error %d: %s"),
lpszFunction, dw, lpMsgBuf);
MessageBox(NULL, szBuf, _T("Error"), MB_OK);
LocalFree(lpMsgBuf);
}
-46
View File
@@ -1,46 +0,0 @@
/* X-Tray
* Copyright (C) 2005 Michael Hotaling <Mike.Hotaling@SinisterDevelopments.com>
*
* X-Tray 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.
*
* X-Tray 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 X-Tray; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _H_UTILITY_H
#define _H_UTILITY_H
WORD HotkeyfToMod (WORD);
WORD ModToHotkeyf (WORD);
int SetOption (HWND, unsigned int, unsigned int);
int SetCheck (HWND, unsigned int, unsigned int);
int SetToggle (HWND, unsigned int, unsigned int, bool);
void ErrorDebug (LPTSTR lpszFunction);
void SetDialog (HWND, int);
void CheckPrefs (HWND, int);
bool FileExists (TCHAR *);
DWORD WINAPI HoldCloseThread (LPVOID);
void SavePrefs (int);
void LoadPrefs ();
void HoldClose ();
void ConvertString(const char *in, wchar_t *out, int size);
void ConvertString(const wchar_t *in, char *out, int size);
void ConvertString(const char *in, char *out, int size);
struct HOTKEY
{
WORD key;
WORD mod;
};
#endif
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
+179 -62
View File
@@ -83,18 +83,9 @@
#define VERSION_MAJOR 1
#define VERSION_MINOR 0
/* Version string macro */
#ifdef WIN32
#if PY_MAJOR_VERSION == 2
#define VERSION STRINGIZE(VERSION_MAJOR) "." STRINGIZE(VERSION_MINOR) "/2.7" /* Linked to python27.dll */
#elif PY_MAJOR_VERSION == 3
#define VERSION STRINGIZE(VERSION_MAJOR) "." STRINGIZE(VERSION_MINOR) "/3.3" /* Linked to python33.dll */
#endif
#endif
#ifndef VERSION
#define VERSION STRINGIZE(VERSION_MAJOR) "." STRINGIZE(VERSION_MINOR)
#endif
/* Version string macro e.g 1.0/3.3 */
#define VERSION STRINGIZE(VERSION_MAJOR) "." STRINGIZE(VERSION_MINOR) "/" \
STRINGIZE(PY_MAJOR_VERSION) "." STRINGIZE (PY_MINOR_VERSION)
/* #define's for Python 2 */
#if PY_MAJOR_VERSION == 2
@@ -254,6 +245,13 @@ typedef struct {
PyObject *dict;
} ListItemObject;
typedef struct {
PyObject_HEAD
hexchat_list *list;
char *name;
} ListObject;
typedef struct {
PyObject_HEAD
char *name;
@@ -358,6 +356,7 @@ static PyTypeObject XChatOut_Type;
static PyTypeObject Context_Type;
static PyTypeObject ListItem_Type;
static PyTypeObject Attribute_Type;
static PyTypeObject List_Type;
static PyThreadState *main_tstate = NULL;
static void *thread_timer = NULL;
@@ -382,7 +381,7 @@ Usage: /PY LOAD <filename>\n\
ABOUT\n\
\n";
static const char about[] = "HexChat Python " PY_VERSION " Interface Version " VERSION "\n";
static const char about[] = "HexChat Python interface version " VERSION "\n";
/* ===================================================================== */
/* Utility functions */
@@ -1359,7 +1358,167 @@ ListItem_New(const char *listname)
}
}
return (PyObject *) item;
}
};
/* ===================================================================== */
/* List object */
#undef OFF
#define OFF(x) offsetof(ListObject, x)
static void
List_dealloc(PyObject *self)
{
BEGIN_XCHAT_CALLS(RESTORE_CONTEXT);
hexchat_list_free(ph, ((ListObject*)self)->list);
END_XCHAT_CALLS();
Py_TYPE(self)->tp_free((PyObject *)self);
};
static PyObject *
List_repr(PyObject *self)
{
return PyUnicode_FromFormat("<%s list at %p>", ((ListObject*)self)->name, self);
};
static PyObject *
List_iter(PyObject *self)
{
Py_INCREF(self);
return self;
};
static PyObject *
List_iternext(PyObject *self)
{
hexchat_list *list = ((ListObject *)self)->list;
char *name = ((ListObject *)self)->name;
PyObject *o = NULL;
const char * const *fields;
int i;
BEGIN_XCHAT_CALLS(RESTORE_CONTEXT);
fields = hexchat_list_fields(ph, name);
if (hexchat_list_next(ph, list))
{
o = ListItem_New(name);
if (o == NULL)
goto error;
for (i = 0; fields[i]; i++)
{
const char *fld = fields[i]+1;
PyObject *attr = NULL;
const char *sattr;
int iattr;
time_t tattr;
switch(fields[i][0])
{
case 's':
sattr = hexchat_list_str(ph, list, (char*)fld);
attr = PyUnicode_FromString(sattr?sattr:"");
break;
case 'i':
iattr = hexchat_list_int(ph, list, (char*)fld);
attr = PyLong_FromLong((long)iattr);
break;
case 't':
tattr = hexchat_list_time(ph, list, (char*)fld);
attr = PyLong_FromLong((long)tattr);
break;
case 'p':
sattr = hexchat_list_str(ph, list, (char*)fld);
if (strcmp(fld, "context") == 0)
{
attr = Context_FromContext((hexchat_context*)sattr);
break;
}
default: /* ignore unknown (newly added?) types */
continue;
}
if (attr == NULL)
goto error;
PyObject_SetAttrString(o, (char*)fld, attr); /* add reference on attr in o */
Py_DECREF(attr); /* make o own attr */
}
}
else
{
/* Raising of standard StopIteration exception with empty value. */
PyErr_SetNone(PyExc_StopIteration);
}
goto exit;
error:
if (list)
hexchat_list_free(ph, list);
Py_DECREF(o);
o = NULL;
exit:
END_XCHAT_CALLS();
if (o)
return o;
return NULL;
};
static PyTypeObject List_Type = {
PyVarObject_HEAD_INIT(NULL, 0)
"hexchat.List", /*tp_name*/
sizeof(ListObject), /*tp_basicsize*/
0, /*tp_itemsize*/
List_dealloc, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
List_repr, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
PyObject_GenericGetAttr,/*tp_getattro*/
PyObject_GenericSetAttr,/*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT, /*tp_flags*/
0, /*tp_doc*/
0, /*tp_traverse*/
0, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
List_iter, /*tp_iter*/
List_iternext, /*tp_iternext*/
0, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
PyType_GenericAlloc, /*tp_alloc*/
PyType_GenericNew, /*tp_new*/
PyObject_Del, /*tp_free*/
0, /*tp_is_gc*/
};
static PyObject *
List_New(hexchat_list *list, char *name)
{
ListObject *listobj = PyObject_New(ListObject, &List_Type);
if (listobj != NULL) {
/* name parameter must be statically allocated. */
listobj->name = name;
//listobj->ph = ph;
listobj->list = list;
}
return (PyObject *)listobj;
};
/* ===================================================================== */
@@ -2275,6 +2434,7 @@ Module_xchat_get_list(PyObject *self, PyObject *args)
return NULL;
/* This function is thread safe, and returns statically
* allocated data. */
BEGIN_XCHAT_CALLS(RESTORE_CONTEXT);
fields = hexchat_list_fields(ph, "lists");
for (i = 0; fields[i]; i++) {
if (strcmp(fields[i], name) == 0) {
@@ -2287,57 +2447,14 @@ Module_xchat_get_list(PyObject *self, PyObject *args)
PyErr_SetString(PyExc_KeyError, "list not available");
return NULL;
}
l = PyList_New(0);
if (l == NULL)
return NULL;
BEGIN_XCHAT_CALLS(RESTORE_CONTEXT);
list = hexchat_list_get(ph, (char*)name);
if (list == NULL)
goto error;
fields = hexchat_list_fields(ph, (char*)name);
while (hexchat_list_next(ph, list)) {
PyObject *o = ListItem_New(name);
if (o == NULL || PyList_Append(l, o) == -1) {
Py_XDECREF(o);
goto error;
}
Py_DECREF(o); /* l is holding a reference */
for (i = 0; fields[i]; i++) {
const char *fld = fields[i]+1;
PyObject *attr = NULL;
const char *sattr;
int iattr;
time_t tattr;
switch(fields[i][0]) {
case 's':
sattr = hexchat_list_str(ph, list, (char*)fld);
attr = PyUnicode_FromString(sattr?sattr:"");
break;
case 'i':
iattr = hexchat_list_int(ph, list, (char*)fld);
attr = PyLong_FromLong((long)iattr);
break;
case 't':
tattr = hexchat_list_time(ph, list, (char*)fld);
attr = PyLong_FromLong((long)tattr);
break;
case 'p':
sattr = hexchat_list_str(ph, list, (char*)fld);
if (strcmp(fld, "context") == 0) {
attr = Context_FromContext(
(hexchat_context*)sattr);
break;
}
default: /* ignore unknown (newly added?) types */
continue;
}
if (attr == NULL)
goto error;
PyObject_SetAttrString(o, (char*)fld, attr); /* add reference on attr in o */
Py_DECREF(attr); /* make o own attr */
}
}
hexchat_list_free(ph, list);
l = List_New(list, (char*)name);
if (l == NULL)
goto error;
goto exit;
error:
if (list)
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
-1
View File
@@ -28,7 +28,6 @@ src/fe-gtk/notifygui.c
src/fe-gtk/plugin-tray.c
src/fe-gtk/plugingui.c
src/fe-gtk/rawlog.c
src/fe-gtk/search.c
src/fe-gtk/servlistgui.c
src/fe-gtk/setup.c
src/fe-gtk/sexy-spell-entry.c
+11 -10
View File
@@ -5,6 +5,7 @@
# sacarasc <sacarasc@gmail.com>, 2013
# Gareth Owen <gowen72@yahoo.com>, 2004
# tea <Srbulov.Ivan@gmail.com>, 2013
# rbh00 <rbh00@netcom.com>, 2013
# sacarasc <sacarasc@gmail.com>, 2012
# TheEndermen <theendermenofdoom@gmail.com>, 2012
msgid ""
@@ -12,8 +13,8 @@ msgstr ""
"Project-Id-Version: HexChat\n"
"Report-Msgid-Bugs-To: www.hexchat.org\n"
"POT-Creation-Date: 2013-09-08 01:16-0400\n"
"PO-Revision-Date: 2013-09-08 05:21+0000\n"
"Last-Translator: TingPing <tingping@tingping.se>\n"
"PO-Revision-Date: 2013-09-15 08:06+0000\n"
"Last-Translator: rbh00 <rbh00@netcom.com>\n"
"Language-Team: English (United Kingdom) (http://www.transifex.com/projects/p/hexchat/language/en_GB/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -3343,7 +3344,7 @@ msgstr "Open URL or execute command in an existing HexChat"
#: src/fe-gtk/fe-gtk.c:132
msgid "Begin minimized. Level 0=Normal 1=Iconified 2=Tray"
msgstr "Begin minimized. Level 0=Normal 1=Iconified 2=Tray"
msgstr "Begin minimised. Level 0=Normal 1=Iconified 2=Tray"
#: src/fe-gtk/fe-gtk.c:132
msgid "level"
@@ -3707,7 +3708,7 @@ msgstr "Some file transfers are still active."
#: src/fe-gtk/maingui.c:1280
msgid "_Minimize to Tray"
msgstr "_Minimize to Tray"
msgstr "_Minimise to Tray"
#: src/fe-gtk/maingui.c:1500
msgid "Insert Attribute or Color Code"
@@ -4687,7 +4688,7 @@ msgstr "Skip network list on startup"
#: src/fe-gtk/servlistgui.c:2071
msgid "Show favorites only"
msgstr "Show favorites only"
msgstr "Show favourites only"
#: src/fe-gtk/servlistgui.c:2101
msgid "_Edit..."
@@ -4705,11 +4706,11 @@ msgstr "Sorts the network list in alphabetical order. Use SHIFT-UP and SHIFT-DOW
#: src/fe-gtk/servlistgui.c:2117
msgid "_Favor"
msgstr "_Favor"
msgstr "_Favour"
#: src/fe-gtk/servlistgui.c:2118
msgid "Mark or unmark this network as a favorite."
msgstr "Mark or unmark this network as a favorite."
msgstr "Mark or unmark this network as a favourite."
#: src/fe-gtk/servlistgui.c:2142
msgid "C_onnect"
@@ -5436,7 +5437,7 @@ msgstr "Omit alerts while the window is focused"
#: src/fe-gtk/setup.c:435
msgid "Tray Behavior"
msgstr "Tray Behavior"
msgstr "Tray Behaviour"
#: src/fe-gtk/setup.c:437 src/fe-gtk/setup.c:439
msgid "Enable system tray icon"
@@ -5444,7 +5445,7 @@ msgstr "Enable system tray icon"
#: src/fe-gtk/setup.c:441
msgid "Minimize to tray"
msgstr "Minimize to tray"
msgstr "Minimise to tray"
#: src/fe-gtk/setup.c:442
msgid "Close to tray"
@@ -5567,7 +5568,7 @@ msgstr ""
#: src/fe-gtk/setup.c:512
msgid "Auto Copy Behavior"
msgstr "Auto Copy Behavior"
msgstr "Auto Copy Behaviour"
#: src/fe-gtk/setup.c:513
msgid "Automatically copy selected text"
+3
View File
@@ -7,6 +7,9 @@
<p>It supports features such as: DCC, SASL, proxies, spellcheck, and Python/Perl scripts.</p>
</description>
<url type="homepage">http://hexchat.github.io</url>
<screenshots>
<screenshot type="default">http://i.imgur.com/XBbQKXf.png</screenshot>
</screenshots>
<updatecontact>tingping_at_fedoraproject.org</updatecontact>
</application>
+2 -1
View File
@@ -438,6 +438,7 @@ const struct prefs vars[] =
{"gui_pane_right_size", P_OFFINT (hex_gui_pane_right_size), TYPE_INT},
{"gui_pane_right_size_min", P_OFFINT (hex_gui_pane_right_size_min), TYPE_INT},
{"gui_quit_dialog", P_OFFINT (hex_gui_quit_dialog), TYPE_BOOL},
{"gui_search_pos", P_OFFINT (hex_gui_search_pos), TYPE_INT},
/* {"gui_single", P_OFFINT (hex_gui_single), TYPE_BOOL}, */
{"gui_slist_fav", P_OFFINT (hex_gui_slist_fav), TYPE_BOOL},
{"gui_slist_select", P_OFFINT (hex_gui_slist_select), TYPE_INT},
@@ -476,6 +477,7 @@ const struct prefs vars[] =
{"gui_url_mod", P_OFFINT (hex_gui_url_mod), TYPE_INT},
{"gui_usermenu", P_OFFINT (hex_gui_usermenu), TYPE_BOOL},
{"gui_win_height", P_OFFINT (hex_gui_win_height), TYPE_INT},
{"gui_win_fullscreen", P_OFFINT (hex_gui_win_fullscreen), TYPE_INT},
{"gui_win_left", P_OFFINT (hex_gui_win_left), TYPE_INT},
{"gui_win_modes", P_OFFINT (hex_gui_win_modes), TYPE_BOOL},
{"gui_win_save", P_OFFINT (hex_gui_win_save), TYPE_BOOL},
@@ -573,7 +575,6 @@ const struct prefs vars[] =
{"text_max_lines", P_OFFINT (hex_text_max_lines), TYPE_INT},
{"text_replay", P_OFFINT (hex_text_replay), TYPE_BOOL},
{"text_search_case_match", P_OFFINT (hex_text_search_case_match), TYPE_BOOL},
{"text_search_backward", P_OFFINT (hex_text_search_backward), TYPE_BOOL},
{"text_search_highlight_all", P_OFFINT (hex_text_search_highlight_all), TYPE_BOOL},
{"text_search_follow", P_OFFINT (hex_text_search_follow), TYPE_BOOL},
{"text_search_regexp", P_OFFINT (hex_text_search_regexp), TYPE_BOOL},
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
+2 -1
View File
@@ -231,7 +231,6 @@ struct hexchatprefs
unsigned int hex_text_indent;
unsigned int hex_text_replay;
unsigned int hex_text_search_case_match;
unsigned int hex_text_search_backward;
unsigned int hex_text_search_highlight_all;
unsigned int hex_text_search_follow;
unsigned int hex_text_search_regexp;
@@ -278,6 +277,7 @@ struct hexchatprefs
int hex_gui_pane_left_size;
int hex_gui_pane_right_size;
int hex_gui_pane_right_size_min;
int hex_gui_search_pos;
int hex_gui_slist_select;
int hex_gui_tab_layout;
int hex_gui_tab_newtofront;
@@ -289,6 +289,7 @@ struct hexchatprefs
int hex_gui_ulist_sort;
int hex_gui_url_mod;
int hex_gui_win_height;
int hex_gui_win_fullscreen;
int hex_gui_win_left;
int hex_gui_win_state;
int hex_gui_win_top;
+1 -1
View File
@@ -1708,7 +1708,7 @@ inbound_cap_ls (server *serv, char *nick, char *extensions_str,
EMIT_SIGNAL_TIMESTAMP (XP_TE_CAPREQ, serv->server_session,
buffer + 9, NULL, NULL, NULL, 0,
tags_data->timestamp);
tcp_sendf (serv, "%s\r\n", buffer);
tcp_sendf (serv, "%s\r\n", g_strchomp (buffer));
}
if (!want_sasl)
{
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
+54 -6
View File
@@ -742,15 +742,25 @@ cmd_country (struct session *sess, char *tbuf, char *word[], char *word_eol[])
static int
cmd_cycle (struct session *sess, char *tbuf, char *word[], char *word_eol[])
{
char *key = sess->channelkey;
char *key = NULL;
char *chan = word[2];
session *chan_sess;
if (!*chan)
chan = sess->channel;
if (*chan && sess->type == SESS_CHANNEL)
if (chan)
{
sess->server->p_cycle (sess->server, chan, key);
return TRUE;
chan_sess = find_channel (sess->server, chan);
if (chan_sess && chan_sess->type == SESS_CHANNEL)
{
key = chan_sess->channelkey;
sess->server->p_cycle (sess->server, chan, key);
return TRUE;
}
}
return FALSE;
}
@@ -2559,7 +2569,8 @@ cmd_load (struct session *sess, char *tbuf, char *word[], char *word_eol[])
char *
split_up_text(struct session *sess, char *text, int cmd_length, char *split_text)
{
unsigned int max;
unsigned int max, space_offset;
char *space;
/* maximum allowed text */
/* :nickname!username@host.com cmd_length */
@@ -2592,6 +2603,17 @@ split_up_text(struct session *sess, char *text, int cmd_length, char *split_text
}
max = i;
/* Try splitting at last space */
space = g_utf8_strrchr (text, max, ' ');
if (space)
{
space_offset = g_utf8_pointer_to_offset (text, space);
/* Only split if last word is of sane length */
if (max != space_offset && max - space_offset < 20)
max = space_offset + 1;
}
split_text = g_strdup_printf ("%.*s", max, text);
return split_text;
@@ -2980,17 +3002,43 @@ static int
cmd_query (struct session *sess, char *tbuf, char *word[], char *word_eol[])
{
char *nick = word[2];
char *msg = word_eol[3];
char *split_text = NULL;
gboolean focus = TRUE;
int cmd_length = 13; /* " PRIVMSG ", " ", :, \r, \n */
int offset = 0;
if (strcmp (word[2], "-nofocus") == 0)
{
nick = word[3];
msg = word_eol[4];
focus = FALSE;
}
if (*nick && !is_channel (sess->server, nick))
{
open_query (sess->server, nick, focus);
if (*msg)
{
if (!sess->server->connected)
{
notc_msg (sess);
return TRUE;
}
while ((split_text = split_up_text (sess, msg + offset, cmd_length, split_text)))
{
sess->server->p_message (sess->server, nick, split_text);
if (*split_text)
offset += strlen(split_text);
g_free(split_text);
}
sess->server->p_message (sess->server, nick, msg + offset);
}
return TRUE;
}
return FALSE;
@@ -3936,7 +3984,7 @@ const struct commands xc_cmds[] = {
{"PING", cmd_ping, 1, 0, 1,
N_("PING <nick | channel>, CTCP pings nick or channel")},
{"QUERY", cmd_query, 0, 0, 1,
N_("QUERY [-nofocus] <nick>, opens up a new privmsg window to someone")},
N_("QUERY [-nofocus] <nick> [message], opens up a new privmsg window to someone and optionally sends a message")},
{"QUIET", cmd_quiet, 1, 1, 1,
N_("QUIET <mask> [<quiettype>], quiet everyone matching the mask in the current channel if supported by the server.")},
{"QUIT", cmd_quit, 0, 0, 1,
+2 -1
View File
@@ -1197,7 +1197,8 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
if (*to)
{
/* Handle limited channel messages, for now no special event */
if (strchr (serv->nick_prefixes, to[0]) != NULL)
if (strchr (serv->chantypes, to[0]) == NULL
&& strchr (serv->nick_prefixes, to[0]) != NULL)
to++;
text = word_eol[4];
+1 -1
View File
@@ -540,7 +540,7 @@ static const struct defaultserver def[] =
{0, "eu.spidernet.org"},
{0, "irc.spidernet.org"},*/
{"SpotChat", 0},
{"SpotChat", 0, 0, 0, LOGIN_SASL},
#ifdef USE_OPENSSL
{0, "irc.spotchat.org/+6697"},
#endif
+6 -1
View File
@@ -518,7 +518,11 @@ log_create_pathname (char *servname, char *channame, char *netname)
if (!netname)
{
netname = "NETWORK";
netname = strdup ("NETWORK");
}
else
{
netname = log_create_filename (netname);
}
/* first, everything is in UTF-8 */
@@ -533,6 +537,7 @@ log_create_pathname (char *servname, char *channame, char *netname)
log_insert_vars (fname, sizeof (fname), prefs.hex_irc_logmask, channame, netname, servname);
free (channame);
free (netname);
/* insert time/date */
now = time (NULL);
+13 -1
View File
@@ -266,11 +266,23 @@ match_channel (const char *word, int *start, int *end)
{
const server *serv = current_sess->server;
const char *chan_prefixes = serv ? serv->chantypes : CHANPRE;
const char *nick_prefixes = serv ? serv->nick_prefixes : NICKPRE;
if (!regex_match (re_channel (), word, start, end))
return FALSE;
return strchr (chan_prefixes, word[*start]) != NULL;
/* Check for +#channel (for example whois output) */
if (strchr (nick_prefixes, word[*start]) != NULL
&& strchr (chan_prefixes, word[*start + 1]) != NULL)
{
(*start)++;
return TRUE;
}
/* Or just #channel */
else if (strchr (chan_prefixes, word[*start]) != NULL)
return TRUE;
return FALSE;
}
static gboolean
+2 -2
View File
@@ -1253,7 +1253,7 @@ country (char *hostname)
domain_t *dom;
if (!hostname || !*hostname || isdigit ((unsigned char) hostname[strlen (hostname) - 1]))
return _("Unknown");
return NULL;
if ((p = strrchr (hostname, '.')))
p++;
else
@@ -1263,7 +1263,7 @@ country (char *hostname)
sizeof (domain_t), country_compare);
if (!dom)
return _("Unknown");
return NULL;
return _(dom->country);
}
+2 -2
View File
@@ -10,7 +10,7 @@ EXTRA_DIST = \
ascii.h banlist.h chanlist.h chanview.h chanview-tabs.c \
chanview-tree.c custom-list.h editlist.h fe-gtk.h fkeys.h gtkutil.h joind.h \
maingui.h menu.h mmx_cmod.S mmx_cmod.h notifygui.h palette.h pixmaps.h \
plugin-tray.h plugingui.c plugingui.h rawlog.h search.h sexy-iso-codes.h \
plugin-tray.h plugingui.c plugingui.h rawlog.h sexy-iso-codes.h \
sexy-spell-entry.h sexy-marshal.h textgui.h urlgrab.h userlistgui.h xtext.h
if USE_MMX
@@ -29,5 +29,5 @@ endif
hexchat_SOURCES = ascii.c banlist.c chanlist.c chanview.c custom-list.c \
dccgui.c editlist.c fe-gtk.c fkeys.c gtkutil.c ignoregui.c joind.c menu.c \
maingui.c $(mmx_cmod_S) notifygui.c palette.c pixmaps.c plugin-tray.c $(plugingui_c) \
rawlog.c search.c servlistgui.c setup.c $(sexy_spell) textgui.c \
rawlog.c servlistgui.c setup.c $(sexy_spell) textgui.c \
urlgrab.c userlistgui.c xtext.c
+1 -1
View File
@@ -632,7 +632,7 @@ banlist_toggle (GtkWidget *item, gpointer data)
if (bit) /* Should be gassert() */
{
banl->checked &= ~bit;
banl->checked |= (GTK_TOGGLE_BUTTON (item)->active)? bit: 0;
banl->checked |= (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (item)))? bit: 0;
banlist_do_refresh (banl);
}
}
+8 -8
View File
@@ -75,7 +75,7 @@ chanlist_match (server *serv, const char *str)
switch (serv->gui->chanlist_search_type)
{
case 1:
return match (GTK_ENTRY (serv->gui->chanlist_wild)->text, str);
return match (gtk_entry_get_text (GTK_ENTRY (serv->gui->chanlist_wild)), str);
#ifndef WIN32
case 2:
if (!serv->gui->have_regex)
@@ -84,7 +84,7 @@ chanlist_match (server *serv, const char *str)
return !regexec (&serv->gui->chanlist_match_regex, str, 1, NULL, REG_NOTBOL);
#endif
default: /* case 0: */
return nocasestrstr (str, GTK_ENTRY (serv->gui->chanlist_wild)->text) ? 1 : 0;
return nocasestrstr (str, gtk_entry_get_text (GTK_ENTRY (serv->gui->chanlist_wild))) ? 1 : 0;
}
}
@@ -227,7 +227,7 @@ chanlist_place_row_in_gui (server *serv, chanlistrow *next_row, gboolean force)
return;
}
if (GTK_ENTRY (serv->gui->chanlist_wild)->text[0])
if (gtk_entry_get_text (GTK_ENTRY (serv->gui->chanlist_wild))[0])
{
/* Check what the user wants to match. If both buttons or _neither_
* button is checked, look for match in both by default.
@@ -414,7 +414,7 @@ chanlist_find_cb (GtkWidget * wid, server *serv)
regfree (&serv->gui->chanlist_match_regex);
}
if (regcomp (&serv->gui->chanlist_match_regex, GTK_ENTRY (wid)->text,
if (regcomp (&serv->gui->chanlist_match_regex, gtk_entry_get_text (GTK_ENTRY (wid)),
REG_ICASE | REG_EXTENDED | REG_NOSUB) == 0)
serv->gui->have_regex = 1;
#endif
@@ -423,13 +423,13 @@ chanlist_find_cb (GtkWidget * wid, server *serv)
static void
chanlist_match_channel_button_toggled (GtkWidget * wid, server *serv)
{
serv->gui->chanlist_match_wants_channel = GTK_TOGGLE_BUTTON (wid)->active;
serv->gui->chanlist_match_wants_channel = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (wid));
}
static void
chanlist_match_topic_button_toggled (GtkWidget * wid, server *serv)
{
serv->gui->chanlist_match_wants_topic = GTK_TOGGLE_BUTTON (wid)->active;
serv->gui->chanlist_match_wants_topic = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (wid));
}
static char *
@@ -519,7 +519,7 @@ chanlist_save (GtkWidget * wid, server *serv)
static gboolean
chanlist_flash (server *serv)
{
if (serv->gui->chanlist_refresh->state != GTK_STATE_ACTIVE)
if (gtk_widget_get_state (serv->gui->chanlist_refresh) != GTK_STATE_ACTIVE)
gtk_widget_set_state (serv->gui->chanlist_refresh, GTK_STATE_ACTIVE);
else
gtk_widget_set_state (serv->gui->chanlist_refresh, GTK_STATE_PRELIGHT);
@@ -762,7 +762,7 @@ chanlist_opengui (server *serv, int do_refresh)
store = (GtkListStore *) custom_list_new();
view = gtkutil_treeview_new (vbox, GTK_TREE_MODEL (store), NULL, -1);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (view->parent),
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (gtk_widget_get_parent (view)),
GTK_SHADOW_IN);
serv->gui->chanlist_list = view;
+1 -1
View File
@@ -118,7 +118,7 @@ cv_tree_init (chanview *cv)
if (cv->style)
gtk_widget_set_style (view, cv->style);
/*gtk_widget_modify_base (view, GTK_STATE_NORMAL, &colors[COL_BG]);*/
GTK_WIDGET_UNSET_FLAGS (view, GTK_CAN_FOCUS);
gtk_widget_set_can_focus (view, FALSE);
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (view), FALSE);
if (prefs.hex_gui_tab_dots)
+1 -1
View File
@@ -769,7 +769,7 @@ dcc_exp_cb (GtkWidget *exp, GtkWidget *box)
static void
dcc_toggle (GtkWidget *item, gpointer data)
{
if (GTK_TOGGLE_BUTTON (item)->active)
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (item)))
{
view_mode = GPOINTER_TO_INT (data);
dcc_fill_window (GPOINTER_TO_INT (data));
+3 -3
View File
@@ -796,7 +796,7 @@ fe_set_lag (server *serv, int lag)
if (sess->gui->lagometer)
{
gtk_progress_bar_set_fraction ((GtkProgressBar *) sess->gui->lagometer, per);
add_tip (sess->gui->lagometer->parent, lagtip);
add_tip (gtk_widget_get_parent (sess->gui->lagometer), lagtip);
}
if (sess->gui->laginfo)
gtk_label_set_text ((GtkLabel *) sess->gui->laginfo, lagtext);
@@ -842,7 +842,7 @@ fe_set_throttle (server *serv)
if (sess->gui->throttlemeter)
{
gtk_progress_bar_set_fraction ((GtkProgressBar *) sess->gui->throttlemeter, per);
add_tip (sess->gui->throttlemeter->parent, tip);
add_tip (gtk_widget_get_parent (sess->gui->throttlemeter), tip);
}
if (sess->gui->throttleinfo)
gtk_label_set_text ((GtkLabel *) sess->gui->throttleinfo, tbuf);
@@ -948,7 +948,7 @@ fe_gui_info_ptr (session *sess, int info_type)
{
case 0: /* native window pointer (for plugins) */
#ifdef WIN32
return gdk_win32_window_get_impl_hwnd (sess->gui->window->window);
return gdk_win32_window_get_impl_hwnd (gtk_widget_get_window (sess->gui->window));
#else
return sess->gui->window;
#endif
+4 -1
View File
@@ -176,6 +176,9 @@ typedef struct session_gui
*limit_entry, /* +l */
*key_entry; /* +k */
GtkWidget *shbox, *shentry; /* search bar hbox */
gulong search_changed_signal; /* hook for search change event so blanking the box doesn't suck */
#define MENU_ID_NUM 12
GtkWidget *menu_item[MENU_ID_NUM+1]; /* some items we may change state of */
@@ -203,7 +206,7 @@ int SPELL_ENTRY_GET_POS (GtkWidget *entry);
void SPELL_ENTRY_SET_POS (GtkWidget *entry, int pos);
void SPELL_ENTRY_INSERT (GtkWidget *entry, const char *text, int len, int *pos);
#else
#define SPELL_ENTRY_GET_TEXT(e) (GTK_ENTRY(e)->text)
#define SPELL_ENTRY_GET_TEXT(e) ((char *)(gtk_entry_get_text (GTK_ENTRY(e))))
#define SPELL_ENTRY_SET_TEXT(e,txt) gtk_entry_set_text(GTK_ENTRY(e),txt)
#define SPELL_ENTRY_SET_EDITABLE(e,v) gtk_editable_set_editable(GTK_EDITABLE(e),v)
#define SPELL_ENTRY_GET_POS(e) gtk_editable_get_position(GTK_EDITABLE(e))
+2 -4
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
@@ -117,7 +117,6 @@
<ClInclude Include="plugin-tray.h" />
<ClInclude Include="plugingui.h" />
<ClInclude Include="rawlog.h" />
<ClInclude Include="search.h" />
<ClInclude Include="servlistgui.h" />
<ClInclude Include="setup.h" />
<ClInclude Include="sexy-iso-codes.h" />
@@ -149,7 +148,6 @@
<ClCompile Include="plugin-tray.c" />
<ClCompile Include="plugingui.c" />
<ClCompile Include="rawlog.c" />
<ClCompile Include="search.c" />
<ClCompile Include="servlistgui.c" />
<ClCompile Include="setup.c" />
<ClCompile Include="sexy-iso-codes.c" />
-6
View File
@@ -72,9 +72,6 @@
<ClInclude Include="rawlog.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="search.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="sexy-iso-codes.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -164,9 +161,6 @@
<ClCompile Include="rawlog.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="search.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="servlistgui.c">
<Filter>Source Files</Filter>
</ClCompile>
+11 -11
View File
@@ -297,14 +297,14 @@ key_handle_key_press (GtkWidget *wid, GdkEventKey *evt, session *sess)
switch (keyval)
{
case GDK_space:
case GDK_KEY_space:
key_action_tab_clean ();
break;
#if defined(USE_GTKSPELL)/* && !defined(WIN32) */
/* gtktextview has no 'activate' event, so we trap ENTER here */
case GDK_Return:
case GDK_KP_Enter:
case GDK_KEY_Return:
case GDK_KEY_KP_Enter:
if (!(evt->state & STATE_CTRL))
{
g_signal_stop_emission_by_name (G_OBJECT (wid), "key_press_event");
@@ -569,7 +569,7 @@ key_dialog_sel_row (GtkWidget * clist, gint row, gint column,
static void
key_dialog_tog_key (GtkWidget * tog, int kstate)
{
int state = GTK_TOGGLE_BUTTON (tog)->active;
int state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (tog));
int row = gtkutil_clist_selection (key_dialog_kb_clist);
struct key_binding *kb;
char buf[32];
@@ -1303,8 +1303,8 @@ key_action_scroll_page (GtkWidget * wid, GdkEventKey * evt, char *d1,
if (!sess)
return 0;
adj = GTK_RANGE (sess->gui->vscrollbar)->adjustment;
end = adj->upper - adj->lower - adj->page_size;
adj = gtk_range_get_adjustment (GTK_RANGE (sess->gui->vscrollbar));
end = gtk_adjustment_get_upper (adj) - gtk_adjustment_get_lower (adj) - gtk_adjustment_get_page_size (adj);
switch (type)
{
@@ -1317,19 +1317,19 @@ key_action_scroll_page (GtkWidget * wid, GdkEventKey * evt, char *d1,
break;
case PAGE_UP:
value = adj->value - (adj->page_size - 1);
value = gtk_adjustment_get_value (adj) - (gtk_adjustment_get_page_size (adj) - 1);
break;
case PAGE_DOWN:
value = adj->value + (adj->page_size - 1);
value = gtk_adjustment_get_value (adj) + (gtk_adjustment_get_page_size (adj) - 1);
break;
case LINE_UP:
value = adj->value - 1.0;
value = gtk_adjustment_get_value (adj) - 1.0;
break;
case LINE_DOWN:
value = adj->value + 1.0;
value = gtk_adjustment_get_value (adj) + 1.0;
break;
}
@@ -1499,7 +1499,7 @@ key_action_tab_comp (GtkWidget *t, GdkEventKey *entry, char *d1, char *d2,
cursor_pos = g_utf8_pointer_to_offset(text, ch);
if (cursor_pos && (g_utf8_get_char_validated(ch, -1) == ':' ||
g_utf8_get_char_validated(ch, -1) == ',' ||
g_utf8_get_char_validated(ch, -1) == prefs.hex_completion_suffix[0]))
g_utf8_get_char_validated (ch, -1) == g_utf8_get_char_validated (prefs.hex_completion_suffix, -1)))
{
skip_len++;
}
+11 -10
View File
@@ -264,7 +264,7 @@ gtkutil_esc_destroy (GtkWidget * win, GdkEventKey * key, gpointer userdata)
else
wid = win;
if (key->keyval == GDK_Escape)
if (key->keyval == GDK_KEY_Escape)
gtk_widget_destroy (wid);
return FALSE;
@@ -325,8 +325,9 @@ fe_get_str (char *msg, char *def, void *callback, void *userdata)
GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
NULL);
gtk_box_set_homogeneous (GTK_BOX (GTK_DIALOG (dialog)->vbox), TRUE);
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent_window));
gtk_box_set_homogeneous (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), TRUE);
if (userdata == (void *)1) /* nick box is usually on the very bottom, make it centered */
{
@@ -354,7 +355,7 @@ fe_get_str (char *msg, char *def, void *callback, void *userdata)
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (gtkutil_get_str_response), entry);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox);
gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), hbox);
gtk_widget_show_all (dialog);
}
@@ -397,7 +398,7 @@ fe_get_int (char *msg, int def, void *callback, void *userdata)
GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
NULL);
gtk_box_set_homogeneous (GTK_BOX (GTK_DIALOG (dialog)->vbox), TRUE);
gtk_box_set_homogeneous (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), TRUE);
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent_window));
@@ -408,9 +409,9 @@ fe_get_int (char *msg, int def, void *callback, void *userdata)
spin = gtk_spin_button_new (NULL, 1, 0);
adj = gtk_spin_button_get_adjustment ((GtkSpinButton*)spin);
adj->lower = 0;
adj->upper = 1024;
adj->step_increment = 1;
gtk_adjustment_set_lower (adj, 0);
gtk_adjustment_set_upper (adj, 1024);
gtk_adjustment_set_step_increment (adj, 1);
gtk_adjustment_changed (adj);
gtk_spin_button_set_value ((GtkSpinButton*)spin, def);
gtk_box_pack_end (GTK_BOX (hbox), spin, 0, 0, 0);
@@ -421,7 +422,7 @@ fe_get_int (char *msg, int def, void *callback, void *userdata)
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (gtkutil_get_number_response), spin);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox);
gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), hbox);
gtk_widget_show_all (dialog);
}
@@ -570,7 +571,7 @@ add_tip (GtkWidget * wid, char *text)
void
show_and_unfocus (GtkWidget * wid)
{
GTK_WIDGET_UNSET_FLAGS (wid, GTK_CAN_FOCUS);
gtk_widget_set_can_focus (wid, FALSE);
gtk_widget_show (wid);
}
@@ -621,7 +622,7 @@ gtkutil_copy_to_clipboard (GtkWidget *widget, GdkAtom selection,
GtkClipboard *clip, *clip2;
win = gtk_widget_get_toplevel (GTK_WIDGET (widget));
if (GTK_WIDGET_TOPLEVEL (win))
if (gtk_widget_is_toplevel (win))
{
int len = strlen (str);
+14 -11
View File
@@ -43,7 +43,7 @@
static void
joind_radio2_cb (GtkWidget *radio, server *serv)
{
if (GTK_TOGGLE_BUTTON (radio)->active)
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio)))
{
gtk_widget_grab_focus (serv->gui->joind_entry);
gtk_editable_set_position (GTK_EDITABLE (serv->gui->joind_entry), 999);
@@ -79,13 +79,13 @@ joind_ok_cb (GtkWidget *ok, server *serv)
}
/* do nothing */
if (GTK_TOGGLE_BUTTON (serv->gui->joind_radio1)->active)
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (serv->gui->joind_radio1)))
goto xit;
/* join specific channel */
if (GTK_TOGGLE_BUTTON (serv->gui->joind_radio2)->active)
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (serv->gui->joind_radio2)))
{
char *text = GTK_ENTRY (serv->gui->joind_entry)->text;
char *text = (char *)gtk_entry_get_text (GTK_ENTRY (serv->gui->joind_entry));
if (strlen (text) < 2)
{
fe_message (_("Channel name too short, try again."), FE_MSG_ERROR);
@@ -100,7 +100,7 @@ joind_ok_cb (GtkWidget *ok, server *serv)
xit:
prefs.hex_gui_join_dialog = 0;
if (GTK_TOGGLE_BUTTON (serv->gui->joind_check)->active)
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (serv->gui->joind_check)))
prefs.hex_gui_join_dialog = 1;
gtk_widget_destroy (serv->gui->joind_win);
@@ -132,9 +132,12 @@ joind_show_dialog (server *serv)
serv->gui->joind_win = dialog1 = gtk_dialog_new ();
gtk_window_set_title (GTK_WINDOW (dialog1), _(DISPLAY_NAME": Connection Complete"));
gtk_window_set_type_hint (GTK_WINDOW (dialog1), GDK_WINDOW_TYPE_HINT_DIALOG);
gtk_window_set_position (GTK_WINDOW (dialog1), GTK_WIN_POS_MOUSE);
gtk_window_set_position (GTK_WINDOW (dialog1), GTK_WIN_POS_CENTER_ON_PARENT);
gtk_window_set_transient_for (GTK_WINDOW(dialog1), GTK_WINDOW(serv->front_session->gui->window));
gtk_window_set_modal (GTK_WINDOW (dialog1), TRUE);
gtk_window_set_resizable (GTK_WINDOW (dialog1), FALSE);
dialog_vbox1 = GTK_DIALOG (dialog1)->vbox;
dialog_vbox1 = gtk_dialog_get_content_area (GTK_DIALOG (dialog1));
gtk_widget_show (dialog_vbox1);
vbox1 = gtk_vbox_new (FALSE, 0);
@@ -167,7 +170,7 @@ joind_show_dialog (server *serv)
label = gtk_label_new (_("In the Server-List window, no channel (chat room) has been entered to be automatically joined for this network."));
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0);
GTK_LABEL (label)->wrap = TRUE;
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
label = gtk_label_new (_("What would you like to do next?"));
@@ -223,14 +226,14 @@ joind_show_dialog (server *serv)
gtk_widget_show (checkbutton1);
gtk_box_pack_start (GTK_BOX (vbox1), checkbutton1, FALSE, FALSE, 0);
dialog_action_area1 = GTK_DIALOG (dialog1)->action_area;
dialog_action_area1 = gtk_dialog_get_action_area (GTK_DIALOG (dialog1));
gtk_widget_show (dialog_action_area1);
gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);
okbutton1 = gtk_button_new_from_stock ("gtk-ok");
gtk_widget_show (okbutton1);
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog1)->action_area), okbutton1, FALSE, TRUE, 0);
GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT);
gtk_box_pack_end (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (dialog1))), okbutton1, FALSE, TRUE, 0);
gtk_widget_set_can_default (okbutton1, TRUE);
g_signal_connect (G_OBJECT (dialog1), "destroy",
G_CALLBACK (joind_destroy_cb), serv);
+271 -71
View File
@@ -21,6 +21,8 @@
#include <stdio.h>
#include <ctype.h>
#include <gdk/gdkkeysyms.h>
#include "../common/hexchat.h"
#include "../common/fe.h"
#include "../common/server.h"
@@ -33,6 +35,7 @@
#include "../common/util.h"
#include "../common/text.h"
#include "../common/chanopt.h"
#include "../common/cfgfiles.h"
#include "fe-gtk.h"
#include "banlist.h"
@@ -77,6 +80,7 @@ enum
#define TAG_UTIL 1 /* dcc, notify, chanlist */
static void mg_create_entry (session *sess, GtkWidget *box);
static void mg_create_search (session *sess, GtkWidget *box);
static void mg_link_irctab (session *sess, int focus);
static session_gui static_mg_gui;
@@ -294,7 +298,7 @@ fe_set_tab_color (struct session *sess, int col)
static void
mg_set_myself_away (session_gui *gui, gboolean away)
{
gtk_label_set_attributes (GTK_LABEL (GTK_BIN (gui->nick_label)->child),
gtk_label_set_attributes (GTK_LABEL (gtk_bin_get_child (GTK_BIN (gui->nick_label))),
away ? away_list : NULL);
}
@@ -491,6 +495,10 @@ mg_windowstate_cb (GtkWindow *wid, GdkEventWindowState *event, gpointer userdata
if (event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED)
prefs.hex_gui_win_state = 1;
prefs.hex_gui_win_fullscreen = 0;
if (event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN)
prefs.hex_gui_win_fullscreen = 1;
return FALSE;
}
@@ -501,7 +509,7 @@ mg_configure_cb (GtkWidget *wid, GdkEventConfigure *event, session *sess)
{
if (mg_gui)
{
if (prefs.hex_gui_win_save)
if (prefs.hex_gui_win_save && !prefs.hex_gui_win_state && !prefs.hex_gui_win_fullscreen)
{
sess = current_sess;
gtk_window_get_position (GTK_WINDOW (wid), &prefs.hex_gui_win_left,
@@ -537,11 +545,7 @@ mg_show_generic_tab (GtkWidget *box)
int num;
GtkWidget *f = NULL;
#if defined(GTK_WIDGET_HAS_FOCUS)
if (current_sess && GTK_WIDGET_HAS_FOCUS (current_sess->gui->input_box))
#else
if (current_sess && gtk_widget_has_focus (current_sess->gui->input_box))
#endif
f = current_sess->gui->input_box;
num = gtk_notebook_page_num (GTK_NOTEBOOK (mg_gui->note_book), box);
@@ -650,16 +654,16 @@ mg_unpopulate (session *sess)
res = sess->res;
res->input_text = strdup (SPELL_ENTRY_GET_TEXT (gui->input_box));
res->topic_text = strdup (GTK_ENTRY (gui->topic_entry)->text);
res->limit_text = strdup (GTK_ENTRY (gui->limit_entry)->text);
res->key_text = strdup (GTK_ENTRY (gui->key_entry)->text);
res->topic_text = strdup (gtk_entry_get_text (GTK_ENTRY (gui->topic_entry)));
res->limit_text = strdup (gtk_entry_get_text (GTK_ENTRY (gui->limit_entry)));
res->key_text = strdup (gtk_entry_get_text (GTK_ENTRY (gui->key_entry)));
if (gui->laginfo)
res->lag_text = strdup (gtk_label_get_text (GTK_LABEL (gui->laginfo)));
if (gui->throttleinfo)
res->queue_text = strdup (gtk_label_get_text (GTK_LABEL (gui->throttleinfo)));
for (i = 0; i < NUM_FLAG_WIDS - 1; i++)
res->flag_wid_state[i] = GTK_TOGGLE_BUTTON (gui->flag_wid[i])->active;
res->flag_wid_state[i] = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gui->flag_wid[i]));
res->old_ul_value = userlist_get_value (gui->user_tree);
if (gui->lagometer)
@@ -741,9 +745,9 @@ mg_set_topic_tip (session *sess)
add_tip (sess->gui->topic_entry, _("No topic is set"));
break;
default:
if (GTK_ENTRY (sess->gui->topic_entry)->text &&
GTK_ENTRY (sess->gui->topic_entry)->text[0])
add_tip (sess->gui->topic_entry, GTK_ENTRY (sess->gui->topic_entry)->text);
if (gtk_entry_get_text (GTK_ENTRY (sess->gui->topic_entry)) &&
gtk_entry_get_text (GTK_ENTRY (sess->gui->topic_entry))[0])
add_tip (sess->gui->topic_entry, (char *)gtk_entry_get_text (GTK_ENTRY (sess->gui->topic_entry)));
else
add_tip (sess->gui->topic_entry, NULL);
}
@@ -752,13 +756,8 @@ mg_set_topic_tip (session *sess)
static void
mg_hide_empty_pane (GtkPaned *pane)
{
#if defined(GTK_WIDGET_VISIBLE)
if ((pane->child1 == NULL || !GTK_WIDGET_VISIBLE (pane->child1)) &&
(pane->child2 == NULL || !GTK_WIDGET_VISIBLE (pane->child2)))
#else
if ((pane->child1 == NULL || !gtk_widget_get_visible (pane->child1)) &&
(pane->child2 == NULL || !gtk_widget_get_visible (pane->child2)))
#endif
if ((gtk_paned_get_child1 (pane) == NULL || !gtk_widget_get_visible (gtk_paned_get_child1 (pane))) &&
(gtk_paned_get_child2 (pane) == NULL || !gtk_widget_get_visible (gtk_paned_get_child2 (pane))))
{
gtk_widget_hide (GTK_WIDGET (pane));
return;
@@ -781,6 +780,7 @@ mg_userlist_showhide (session *sess, int show)
session_gui *gui = sess->gui;
int handle_size;
int right_size;
GtkAllocation allocation;
right_size = MAX (prefs.hex_gui_pane_right_size, prefs.hex_gui_pane_right_size_min);
@@ -789,8 +789,9 @@ mg_userlist_showhide (session *sess, int show)
gtk_widget_show (gui->user_box);
gui->ul_hidden = 0;
gtk_widget_get_allocation (gui->hpane_right, &allocation);
gtk_widget_style_get (GTK_WIDGET (gui->hpane_right), "handle-size", &handle_size, NULL);
gtk_paned_set_position (GTK_PANED (gui->hpane_right), GTK_WIDGET (gui->hpane_right)->allocation.width - (right_size + handle_size));
gtk_paned_set_position (GTK_PANED (gui->hpane_right), allocation.width - (right_size + handle_size));
}
else
{
@@ -887,6 +888,7 @@ mg_populate (session *sess)
restore_gui *res = sess->res;
int i, render = TRUE;
guint16 vis = gui->ul_hidden;
GtkAllocation allocation;
switch (sess->type)
{
@@ -927,7 +929,8 @@ mg_populate (session *sess)
/* xtext size change? Then don't render, wait for the expose caused
by showing/hidding the userlist */
if (vis != gui->ul_hidden && gui->user_box->allocation.width > 1)
gtk_widget_get_allocation (gui->user_box, &allocation);
if (vis != gui->ul_hidden && allocation.width > 1)
render = FALSE;
gtk_xtext_buffer_show (GTK_XTEXT (gui->xtext), res->buffer, render);
@@ -974,14 +977,14 @@ mg_populate (session *sess)
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (gui->lagometer),
res->lag_value);
if (res->lag_tip)
add_tip (sess->gui->lagometer->parent, res->lag_tip);
add_tip (gtk_widget_get_parent (sess->gui->lagometer), res->lag_tip);
}
if (gui->throttlemeter)
{
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (gui->throttlemeter),
res->queue_value);
if (res->queue_tip)
add_tip (sess->gui->throttlemeter->parent, res->queue_tip);
add_tip (gtk_widget_get_parent (sess->gui->throttlemeter), res->queue_tip);
}
/* did this tab have a connecting graph? restore it.. */
@@ -992,7 +995,7 @@ mg_populate (session *sess)
}
/* menu items */
GTK_CHECK_MENU_ITEM (gui->menu_item[MENU_ID_AWAY])->active = sess->server->is_away;
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gui->menu_item[MENU_ID_AWAY]), sess->server->is_away);
gtk_widget_set_sensitive (gui->menu_item[MENU_ID_AWAY], sess->server->connected);
gtk_widget_set_sensitive (gui->menu_item[MENU_ID_JOIN], sess->server->end_of_motd);
gtk_widget_set_sensitive (gui->menu_item[MENU_ID_DISCONNECT],
@@ -1233,7 +1236,7 @@ mg_open_quit_dialog (gboolean minimize_button)
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
dialog_vbox1 = GTK_DIALOG (dialog)->vbox;
dialog_vbox1 = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
gtk_widget_show (dialog_vbox1);
table1 = gtk_table_new (2, 2, FALSE);
@@ -1270,7 +1273,7 @@ mg_open_quit_dialog (gboolean minimize_button)
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
dialog_action_area1 = GTK_DIALOG (dialog)->action_area;
dialog_action_area1 = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
gtk_widget_show (dialog_action_area1);
gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1),
GTK_BUTTONBOX_END);
@@ -1297,12 +1300,12 @@ mg_open_quit_dialog (gboolean minimize_button)
switch (gtk_dialog_run (GTK_DIALOG (dialog)))
{
case 0:
if (GTK_TOGGLE_BUTTON (checkbutton1)->active)
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbutton1)))
prefs.hex_gui_quit_dialog = 0;
hexchat_exit ();
break;
case 1: /* minimize to tray */
if (GTK_TOGGLE_BUTTON (checkbutton1)->active)
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbutton1)))
{
prefs.hex_gui_tray_close = 1;
/*prefs.hex_gui_quit_dialog = 0;*/
@@ -1401,7 +1404,7 @@ mg_link_gentab (chan *ch, GtkWidget *box)
win = gtkutil_window_new (g_object_get_data (G_OBJECT (box), "title"), "",
GPOINTER_TO_INT (g_object_get_data (G_OBJECT (box), "w")),
GPOINTER_TO_INT (g_object_get_data (G_OBJECT (box), "h")),
3);
2);
/* so it doesn't try to chan_remove (there's no tab anymore) */
g_object_steal_data (G_OBJECT (box), "ch");
gtk_container_set_border_width (GTK_CONTAINER (box), 0);
@@ -1466,7 +1469,7 @@ mg_markup_item (GtkWidget *menu, char *text, int arg)
GtkWidget *item;
item = gtk_menu_item_new_with_label ("");
gtk_label_set_markup (GTK_LABEL (GTK_BIN (item)->child), text);
gtk_label_set_markup (GTK_LABEL (gtk_bin_get_child (GTK_BIN (item))), text);
g_signal_connect (G_OBJECT (item), "activate",
G_CALLBACK (mg_color_insert), GINT_TO_POINTER (arg));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
@@ -1532,7 +1535,7 @@ mg_set_guint8 (GtkCheckMenuItem *item, guint8 *setting)
guint8 logging = sess->text_logging;
*setting = SET_OFF;
if (item->active)
if (gtk_check_menu_item_get_active (item))
*setting = SET_ON;
/* has the logging setting changed? */
@@ -1600,7 +1603,7 @@ mg_create_tabmenu (session *sess, GdkEventButton *event, chan *ch)
g_free (name);
item = gtk_menu_item_new_with_label ("");
gtk_label_set_markup (GTK_LABEL (GTK_BIN (item)->child), buf);
gtk_label_set_markup (GTK_LABEL (gtk_bin_get_child (GTK_BIN (item))), buf);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
gtk_widget_show (item);
@@ -1705,7 +1708,7 @@ mg_dialog_dnd_drop (GtkWidget * widget, GdkDragContext * context, gint x,
{
if (current_sess->type == SESS_DIALOG)
/* sess->channel is really the nickname of dialogs */
mg_dnd_drop_file (current_sess, current_sess->channel, selection_data->data);
mg_dnd_drop_file (current_sess, current_sess->channel, (char *)gtk_selection_data_get_data (selection_data));
}
/* add a tabbed channel */
@@ -1796,7 +1799,7 @@ mg_topic_cb (GtkWidget *entry, gpointer userdata)
if (sess->channel[0] && sess->server->connected && sess->type == SESS_CHANNEL)
{
text = GTK_ENTRY (entry)->text;
text = (char *)gtk_entry_get_text (GTK_ENTRY (entry));
if (text[0] == 0)
text = NULL;
sess->server->p_topic (sess->server, sess->channel, text);
@@ -1938,7 +1941,7 @@ mg_change_flag (GtkWidget * wid, session *sess, char flag)
mode[2] = '\0';
if (serv->connected && sess->channel[0])
{
if (GTK_TOGGLE_BUTTON (wid)->active)
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (wid)))
mode[0] = '+';
else
mode[0] = '-';
@@ -1956,7 +1959,7 @@ flagl_hit (GtkWidget * wid, struct session *sess)
const char *limit_str;
server *serv = sess->server;
if (GTK_TOGGLE_BUTTON (wid)->active)
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (wid)))
{
if (serv->connected && sess->channel[0])
{
@@ -1987,7 +1990,7 @@ flagk_hit (GtkWidget * wid, struct session *sess)
snprintf (modes, sizeof (modes), "-k %s",
gtk_entry_get_text (GTK_ENTRY (sess->gui->key_entry)));
if (GTK_TOGGLE_BUTTON (wid)->active)
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (wid)))
modes[0] = '+';
serv->p_mode (serv, sess->channel, modes);
@@ -2146,7 +2149,7 @@ mg_dialog_button_cb (GtkWidget *wid, char *cmd)
if (!current_sess)
return;
topic = (char *)(GTK_ENTRY (current_sess->gui->topic_entry)->text);
topic = (char *)(gtk_entry_get_text (GTK_ENTRY (current_sess->gui->topic_entry)));
topic = strrchr (topic, '@');
if (topic)
host = topic + 1;
@@ -2550,15 +2553,12 @@ static void
mg_rightpane_cb (GtkPaned *pane, GParamSpec *param, session_gui *gui)
{
int handle_size;
/* if (pane->child1 == NULL || (!GTK_WIDGET_VISIBLE (pane->child1)))
return;
if (pane->child2 == NULL || (!GTK_WIDGET_VISIBLE (pane->child2)))
return;*/
GtkAllocation allocation;
gtk_widget_style_get (GTK_WIDGET (pane), "handle-size", &handle_size, NULL);
/* record the position from the RIGHT side */
prefs.hex_gui_pane_right_size = GTK_WIDGET (pane)->allocation.width - gtk_paned_get_position (pane) - handle_size;
gtk_widget_get_allocation (GTK_WIDGET(pane), &allocation);
prefs.hex_gui_pane_right_size = allocation.width - gtk_paned_get_position (pane) - handle_size;
}
static gboolean
@@ -2621,7 +2621,18 @@ mg_create_center (session *sess, session_gui *gui, GtkWidget *box)
vbox = gtk_vbox_new (FALSE, 3);
gtk_notebook_append_page (GTK_NOTEBOOK (book), vbox, NULL);
mg_create_topicbar (sess, vbox);
mg_create_textarea (sess, vbox);
if (prefs.hex_gui_search_pos)
{
mg_create_search (sess, vbox);
mg_create_textarea (sess, vbox);
}
else
{
mg_create_textarea (sess, vbox);
mg_create_search (sess, vbox);
}
mg_create_entry (sess, vbox);
mg_add_pane_signals (gui);
@@ -2678,17 +2689,17 @@ mg_place_userlist_and_chanview_real (session_gui *gui, GtkWidget *userlist, GtkW
int unref_chanview = FALSE;
/* first, remove userlist/treeview from their containers */
if (userlist && userlist->parent)
if (userlist && gtk_widget_get_parent (userlist))
{
g_object_ref (userlist);
gtk_container_remove (GTK_CONTAINER (userlist->parent), userlist);
gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (userlist)), userlist);
unref_userlist = TRUE;
}
if (chanview && chanview->parent)
if (chanview && gtk_widget_get_parent (chanview))
{
g_object_ref (chanview);
gtk_container_remove (GTK_CONTAINER (chanview->parent), chanview);
gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (chanview)), chanview);
unref_chanview = TRUE;
}
@@ -2816,6 +2827,190 @@ mg_inputbox_rightclick (GtkEntry *entry, GtkWidget *menu)
mg_create_color_menu (menu, NULL);
}
/* Search bar adapted from Conspire's by William Pitcock */
#define SEARCH_CHANGE 1
#define SEARCH_NEXT 2
#define SEARCH_PREVIOUS 3
#define SEARCH_REFRESH 4
static void
search_handle_event(int search_type, session *sess)
{
textentry *last;
const gchar *text = NULL;
gtk_xtext_search_flags flags;
GError *err = NULL;
gboolean backwards = FALSE;
/* When just typing show most recent first */
if (search_type == SEARCH_PREVIOUS || search_type == SEARCH_CHANGE)
backwards = TRUE;
flags = ((prefs.hex_text_search_case_match == 1? case_match: 0) |
(backwards? backward: 0) |
(prefs.hex_text_search_highlight_all == 1? highlight: 0) |
(prefs.hex_text_search_follow == 1? follow: 0) |
(prefs.hex_text_search_regexp == 1? regexp: 0));
if (search_type != SEARCH_REFRESH)
text = gtk_entry_get_text (GTK_ENTRY(sess->gui->shentry));
last = gtk_xtext_search (GTK_XTEXT (sess->gui->xtext), text, flags, &err);
if (err)
{
gtk_entry_set_icon_from_stock (GTK_ENTRY (sess->gui->shentry), GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_DIALOG_ERROR);
gtk_entry_set_icon_tooltip_text (GTK_ENTRY (sess->gui->shentry), GTK_ENTRY_ICON_SECONDARY, _(err->message));
g_error_free (err);
}
else if (!last)
{
if (text && text[0] == 0) /* empty string, no error */
{
gtk_entry_set_icon_from_stock (GTK_ENTRY (sess->gui->shentry), GTK_ENTRY_ICON_SECONDARY, NULL);
}
else
{
/* Either end of search or not found, try again to wrap if only end */
last = gtk_xtext_search (GTK_XTEXT (sess->gui->xtext), text, flags, &err);
if (!last) /* Not found error */
{
gtk_entry_set_icon_from_stock (GTK_ENTRY (sess->gui->shentry), GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_DIALOG_ERROR);
gtk_entry_set_icon_tooltip_text (GTK_ENTRY (sess->gui->shentry), GTK_ENTRY_ICON_SECONDARY, _("No results found."));
}
}
}
else
{
gtk_entry_set_icon_from_stock (GTK_ENTRY (sess->gui->shentry), GTK_ENTRY_ICON_SECONDARY, NULL);
}
}
static void
search_handle_change(GtkWidget *wid, session *sess)
{
search_handle_event(SEARCH_CHANGE, sess);
}
static void
search_handle_refresh(GtkWidget *wid, session *sess)
{
search_handle_event(SEARCH_REFRESH, sess);
}
void
mg_search_handle_previous(GtkWidget *wid, session *sess)
{
search_handle_event(SEARCH_PREVIOUS, sess);
}
void
mg_search_handle_next(GtkWidget *wid, session *sess)
{
search_handle_event(SEARCH_NEXT, sess);
}
static void
search_set_option (GtkToggleButton *but, guint *pref)
{
*pref = gtk_toggle_button_get_active(but);
save_config();
}
void
mg_search_toggle(session *sess)
{
if (gtk_widget_get_visible(sess->gui->shbox))
{
gtk_widget_hide(sess->gui->shbox);
gtk_widget_grab_focus(sess->gui->input_box);
gtk_entry_set_text(GTK_ENTRY(sess->gui->shentry), "");
}
else
{
/* Reset search state */
gtk_entry_set_icon_from_stock (GTK_ENTRY (sess->gui->shentry), GTK_ENTRY_ICON_SECONDARY, NULL);
/* Show and focus */
gtk_widget_show(sess->gui->shbox);
gtk_widget_grab_focus(sess->gui->shentry);
}
}
static gboolean
search_handle_esc (GtkWidget *win, GdkEventKey *key, session *sess)
{
if (key->keyval == GDK_KEY_Escape)
mg_search_toggle(sess);
return FALSE;
}
static void
mg_create_search(session *sess, GtkWidget *box)
{
GtkWidget *entry, *label, *next, *previous, *highlight, *matchcase, *regex, *close;
session_gui *gui = sess->gui;
gui->shbox = gtk_hbox_new(FALSE, 5);
gtk_box_pack_start(GTK_BOX(box), gui->shbox, FALSE, FALSE, 0);
close = gtk_button_new ();
gtk_button_set_image (GTK_BUTTON (close), gtk_image_new_from_stock (GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU));
gtk_button_set_relief(GTK_BUTTON(close), GTK_RELIEF_NONE);
gtk_widget_set_can_focus (close, FALSE);
gtk_box_pack_start(GTK_BOX(gui->shbox), close, FALSE, FALSE, 0);
g_signal_connect_swapped(G_OBJECT(close), "clicked", G_CALLBACK(mg_search_toggle), sess);
label = gtk_label_new(_("Find:"));
gtk_box_pack_start(GTK_BOX(gui->shbox), label, FALSE, FALSE, 0);
gui->shentry = entry = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(gui->shbox), entry, FALSE, FALSE, 0);
gtk_widget_set_size_request (gui->shentry, 180, -1);
gui->search_changed_signal = g_signal_connect(G_OBJECT(entry), "changed", G_CALLBACK(search_handle_change), sess);
g_signal_connect (G_OBJECT (entry), "key_press_event", G_CALLBACK (search_handle_esc), sess);
g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(mg_search_handle_next), sess);
gtk_entry_set_icon_activatable (GTK_ENTRY (entry), GTK_ENTRY_ICON_SECONDARY, FALSE);
gtk_entry_set_icon_tooltip_text (GTK_ENTRY (sess->gui->shentry), GTK_ENTRY_ICON_SECONDARY, _("Search hit end or not found."));
previous = gtk_button_new ();
gtk_button_set_image (GTK_BUTTON (previous), gtk_image_new_from_stock (GTK_STOCK_GO_BACK, GTK_ICON_SIZE_MENU));
gtk_button_set_relief(GTK_BUTTON(previous), GTK_RELIEF_NONE);
gtk_widget_set_can_focus (previous, FALSE);
gtk_box_pack_start(GTK_BOX(gui->shbox), previous, FALSE, FALSE, 0);
g_signal_connect(G_OBJECT(previous), "clicked", G_CALLBACK(mg_search_handle_previous), sess);
next = gtk_button_new ();
gtk_button_set_image (GTK_BUTTON (next), gtk_image_new_from_stock (GTK_STOCK_GO_FORWARD, GTK_ICON_SIZE_MENU));
gtk_button_set_relief(GTK_BUTTON(next), GTK_RELIEF_NONE);
gtk_widget_set_can_focus (next, FALSE);
gtk_box_pack_start(GTK_BOX(gui->shbox), next, FALSE, FALSE, 0);
g_signal_connect(G_OBJECT(next), "clicked", G_CALLBACK(mg_search_handle_next), sess);
highlight = gtk_check_button_new_with_mnemonic (_("Highlight _all"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(highlight), prefs.hex_text_search_highlight_all);
gtk_widget_set_can_focus (highlight, FALSE);
g_signal_connect (G_OBJECT (highlight), "toggled", G_CALLBACK (search_set_option), &prefs.hex_text_search_highlight_all);
g_signal_connect (G_OBJECT (highlight), "toggled", G_CALLBACK (search_handle_refresh), sess);
gtk_box_pack_start(GTK_BOX(gui->shbox), highlight, FALSE, FALSE, 0);
add_tip (highlight, _("Highlight all occurrences, and underline the current occurrence."));
matchcase = gtk_check_button_new_with_mnemonic (_("Mat_ch case"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(matchcase), prefs.hex_text_search_case_match);
gtk_widget_set_can_focus (matchcase, FALSE);
g_signal_connect (G_OBJECT (matchcase), "toggled", G_CALLBACK (search_set_option), &prefs.hex_text_search_case_match);
gtk_box_pack_start(GTK_BOX(gui->shbox), matchcase, FALSE, FALSE, 0);
add_tip (matchcase, _("Perform a case-sensitive search."));
regex = gtk_check_button_new_with_mnemonic (_("_Regex"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(regex), prefs.hex_text_search_regexp);
gtk_widget_set_can_focus (regex, FALSE);
g_signal_connect (G_OBJECT (regex), "toggled", G_CALLBACK (search_set_option), &prefs.hex_text_search_regexp);
gtk_box_pack_start(GTK_BOX(gui->shbox), regex, FALSE, FALSE, 0);
add_tip (regex, _("Regard search string as a regular expression."));
}
static void
mg_create_entry (session *sess, GtkWidget *box)
{
@@ -2833,7 +3028,7 @@ mg_create_entry (session *sess, GtkWidget *box)
gui->nick_label = but = gtk_button_new_with_label (sess->server->nick);
gtk_button_set_relief (GTK_BUTTON (but), GTK_RELIEF_NONE);
GTK_WIDGET_UNSET_FLAGS (but, GTK_CAN_FOCUS);
gtk_widget_set_can_focus (but, FALSE);
gtk_box_pack_end (GTK_BOX (gui->nick_box), but, 0, 0, 0);
g_signal_connect (G_OBJECT (but), "clicked",
G_CALLBACK (mg_nickclick_cb), NULL);
@@ -3057,6 +3252,8 @@ mg_create_topwindow (session *sess)
if (!prefs.hex_gui_input_nick)
gtk_widget_hide (sess->gui->nick_box);
gtk_widget_hide(sess->gui->shbox);
mg_decide_userlist (sess, FALSE);
if (sess->type == SESS_DIALOG)
@@ -3112,6 +3309,8 @@ mg_create_tabwindow (session *sess)
prefs.hex_gui_win_top);
if (prefs.hex_gui_win_state)
gtk_window_maximize (GTK_WINDOW (win));
if (prefs.hex_gui_win_fullscreen)
gtk_window_fullscreen (GTK_WINDOW (win));
gtk_container_set_border_width (GTK_CONTAINER (win), GUI_BORDER);
g_signal_connect (G_OBJECT (win), "delete_event",
@@ -3160,6 +3359,8 @@ mg_create_tabwindow (session *sess)
if (!prefs.hex_gui_input_nick)
gtk_widget_hide (sess->gui->nick_box);
gtk_widget_hide (sess->gui->shbox);
mg_place_userlist_and_chanview (sess->gui);
gtk_widget_show (win);
@@ -3308,7 +3509,7 @@ fe_update_mode_buttons (session *sess, char mode, char sign)
if (!sess->gui->is_tab || sess == current_tab)
{
ignore_chanmode = TRUE;
if (GTK_TOGGLE_BUTTON (sess->gui->flag_wid[i])->active != state)
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (sess->gui->flag_wid[i])) != state)
gtk_toggle_button_set_active (
GTK_TOGGLE_BUTTON (sess->gui->flag_wid[i]), state);
ignore_chanmode = FALSE;
@@ -3352,7 +3553,7 @@ fe_set_away (server *serv)
{
if (!sess->gui->is_tab || sess == current_tab)
{
GTK_CHECK_MENU_ITEM (sess->gui->menu_item[MENU_ID_AWAY])->active = serv->is_away;
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (sess->gui->menu_item[MENU_ID_AWAY]), serv->is_away);
/* gray out my nickname */
mg_set_myself_away (sess->gui, serv->is_away);
}
@@ -3442,7 +3643,7 @@ mg_create_generic_tab (char *name, char *title, int force_toplevel,
if (force_toplevel || !prefs.hex_gui_tab_utils)
{
win = gtkutil_window_new (title, name, width, height, 3);
win = gtkutil_window_new (title, name, width, height, 2);
vbox = gtk_vbox_new (0, 0);
*vbox_ret = vbox;
gtk_container_add (GTK_CONTAINER (win), vbox);
@@ -3565,9 +3766,9 @@ is_child_of (GtkWidget *widget, GtkWidget *parent)
{
while (widget)
{
if (widget->parent == parent)
if (gtk_widget_get_parent (widget) == parent)
return TRUE;
widget = widget->parent;
widget = gtk_widget_get_parent (widget);
}
return FALSE;
}
@@ -3578,7 +3779,7 @@ mg_handle_drop (GtkWidget *widget, int y, int *pos, int *other_pos)
int height;
session_gui *gui = current_sess->gui;
gdk_drawable_get_size (widget->window, NULL, &height);
gdk_drawable_get_size (gtk_widget_get_window (widget), NULL, &height);
if (y < height / 2)
{
@@ -3623,10 +3824,10 @@ mg_is_gui_target (GdkDragContext *context)
{
char *target_name;
if (!context || !context->targets || !context->targets->data)
if (!context || !gdk_drag_context_list_targets (context) || !gdk_drag_context_list_targets (context)->data)
return FALSE;
target_name = gdk_atom_name (context->targets->data);
target_name = gdk_atom_name (gdk_drag_context_list_targets (context)->data);
if (target_name)
{
/* if it's not HEXCHAT_CHANVIEW or HEXCHAT_USERLIST */
@@ -3691,7 +3892,7 @@ mg_drag_drop_cb (GtkWidget *widget, GdkDragContext *context, int x, int y, guint
if (!mg_is_gui_target (context))
return FALSE;
switch (context->action)
switch (gdk_drag_context_get_selected_action (context))
{
case GDK_ACTION_MOVE:
/* from userlist */
@@ -3718,10 +3919,8 @@ mg_drag_motion_cb (GtkWidget *widget, GdkDragContext *context, int x, int y, gui
GdkGCValues val;
int half, width, height;
int ox, oy;
#if 0
GtkPaned *paned;
#endif
GdkDrawable *draw;
GtkAllocation allocation;
/* ignore file drops */
if (!mg_is_gui_target (context))
@@ -3729,24 +3928,25 @@ mg_drag_motion_cb (GtkWidget *widget, GdkDragContext *context, int x, int y, gui
if (scbar) /* scrollbar */
{
ox = widget->allocation.x;
oy = widget->allocation.y;
width = widget->allocation.width;
height = widget->allocation.height;
draw = widget->window;
gtk_widget_get_allocation (widget, &allocation);
ox = allocation.x;
oy = allocation.y;
width = allocation.width;
height = allocation.height;
draw = gtk_widget_get_window (widget);
}
else
{
ox = oy = 0;
gdk_drawable_get_size (widget->window, &width, &height);
draw = widget->window;
gdk_drawable_get_size (gtk_widget_get_window (widget), &width, &height);
draw = gtk_widget_get_window (widget);
}
val.subwindow_mode = GDK_INCLUDE_INFERIORS;
val.graphics_exposures = 0;
val.function = GDK_XOR;
gc = gdk_gc_new_with_values (widget->window, &val, GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW | GDK_GC_FUNCTION);
gc = gdk_gc_new_with_values (gtk_widget_get_window (widget), &val, GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW | GDK_GC_FUNCTION);
col.red = rand() % 0xffff;
col.green = rand() % 0xffff;
col.blue = rand() % 0xffff;
+5 -1
View File
@@ -52,6 +52,10 @@ GtkWidget *mg_submenu (GtkWidget *menu, char *text);
gboolean mg_drag_begin_cb (GtkWidget *widget, GdkDragContext *context, gpointer userdata);
void mg_drag_end_cb (GtkWidget *widget, GdkDragContext *context, gpointer userdata);
gboolean mg_drag_drop_cb (GtkWidget *widget, GdkDragContext *context, int x, int y, guint time, gpointer user_data);
gboolean mg_drag_motion_cb (GtkWidget *widget, GdkDragContext *context, int x, int y, guint time, gpointer user_data);
gboolean mg_drag_motion_cb (GtkWidget *widget, GdkDragContext *context, int x, int y, guint time, gpointer user_data);
/* search */
void mg_search_toggle(session *sess);
void mg_search_handle_previous(GtkWidget *wid, session *sess);
void mg_search_handle_next(GtkWidget *wid, session *sess);
#endif
+74 -75
View File
@@ -86,7 +86,7 @@ struct mymenu
unsigned char id; /* MENU_ID_XXX (menu.h) */
unsigned char state; /* ticked or not? */
unsigned char sensitive; /* shaded out? */
guint key; /* GDK_x */
guint key; /* GDK_KEY_x */
};
#define XCMENU_DOLIST 1
@@ -600,7 +600,7 @@ menu_create_nickinfo_menu (struct User *user, GtkWidget *submenu)
{
char buf[512];
char unknown[96];
char *real, *fmt;
char *real, *fmt, *users_country;
struct away_msg *away;
gboolean missing = FALSE;
GtkWidget *item;
@@ -637,12 +637,14 @@ menu_create_nickinfo_menu (struct User *user, GtkWidget *submenu)
G_CALLBACK (copy_to_clipboard_cb),
user->account ? user->account : unknown);
snprintf (buf, sizeof (buf), fmt, _("Country:"),
user->hostname ? country(user->hostname) : unknown);
item = menu_quick_item (0, buf, submenu, XCMENU_MARKUP, 0, 0);
g_signal_connect (G_OBJECT (item), "activate",
G_CALLBACK (copy_to_clipboard_cb),
user->hostname ? country(user->hostname) : unknown);
users_country = country (user->hostname);
if (users_country)
{
snprintf (buf, sizeof (buf), fmt, _ ("Country:"), users_country);
item = menu_quick_item (0, buf, submenu, XCMENU_MARKUP, 0, 0);
g_signal_connect (G_OBJECT (item), "activate",
G_CALLBACK (copy_to_clipboard_cb), users_country);
}
snprintf (buf, sizeof (buf), fmt, _("Server:"),
user->servername ? user->servername : unknown);
@@ -890,6 +892,25 @@ menu_cmbuttons_toggle (GtkWidget *wid, gpointer ud)
prefs.hex_gui_mode_buttons);
}
static void
menu_fullscreen_toggle (GtkWidget *wid, gpointer ud)
{
if (!prefs.hex_gui_win_fullscreen)
gtk_window_fullscreen (GTK_WINDOW(parent_window));
else
{
gtk_window_unfullscreen (GTK_WINDOW(parent_window));
#ifdef WIN32
/* other window managers seem to handle this */
gtk_window_resize (GTK_WINDOW(parent_window),
prefs.hex_gui_win_width, prefs.hex_gui_win_height);
gtk_window_move (GTK_WINDOW(parent_window),
prefs.hex_gui_win_left, prefs.hex_gui_win_top);
#endif
}
}
void
menu_middlemenu (session *sess, GdkEventButton *event)
{
@@ -1236,41 +1257,19 @@ menu_quit (GtkWidget * wid, gpointer none)
static void
menu_search ()
{
search_open (current_sess);
mg_search_toggle (current_sess);
}
static void
menu_search_next ()
menu_search_next (GtkWidget *wid)
{
GtkXText *xtext = GTK_XTEXT (current_sess->gui->xtext);
xtext_buffer *buf = xtext->buffer;
if (!gtk_xtext_search (xtext, buf->search_text,
(buf->search_flags & (case_match | follow | regexp)), NULL))
{
fe_message (_("Search hit end, not found."), FE_MSG_ERROR);
}
mg_search_handle_next(wid, current_sess);
}
static void
menu_search_prev ()
menu_search_prev (GtkWidget *wid)
{
GtkXText *xtext = GTK_XTEXT (current_sess->gui->xtext);
xtext_buffer *buf = xtext->buffer;
if (!gtk_xtext_search(xtext, buf->search_text,
(buf->search_flags & (case_match | follow | regexp)) | backward, NULL))
{
fe_message (_("Search hit end, not found."), FE_MSG_ERROR);
}
}
static void
menu_search_reset ()
{
GtkXText *xtext = GTK_XTEXT (current_sess->gui->xtext);
gtk_xtext_search (xtext, "", 0, NULL);
mg_search_handle_previous(wid, current_sess);
}
static void
@@ -1444,24 +1443,26 @@ menu_pluginlist (void)
"&2 would be \042john hello\042.")
#define ulbutton_help _("Userlist Buttons - Special codes:\n\n"\
"%a = all selected nicks\n"\
"%c = current channel\n"\
"%e = current network name\n"\
"%h = selected nick's hostname\n"\
"%m = machine info\n"\
"%n = your nick\n"\
"%s = selected nick\n"\
"%t = time/date\n")
"%a = all selected nicks\n"\
"%c = current channel\n"\
"%e = current network name\n"\
"%h = selected nick's hostname\n"\
"%m = machine info\n"\
"%n = your nick\n"\
"%s = selected nick\n"\
"%t = time/date\n"\
"%u = selected users account")
#define dlgbutton_help _("Dialog Buttons - Special codes:\n\n"\
"%a = all selected nicks\n"\
"%c = current channel\n"\
"%e = current network name\n"\
"%h = selected nick's hostname\n"\
"%m = machine info\n"\
"%n = your nick\n"\
"%s = selected nick\n"\
"%t = time/date\n")
"%a = all selected nicks\n"\
"%c = current channel\n"\
"%e = current network name\n"\
"%h = selected nick's hostname\n"\
"%m = machine info\n"\
"%n = your nick\n"\
"%s = selected nick\n"\
"%t = time/date\n"\
"%u = selected users account")
#define ctcp_help _("CTCP Replies - Special codes:\n\n"\
"%d = data (the whole ctcp)\n"\
@@ -1700,13 +1701,13 @@ menu_about (GtkWidget *wid, gpointer sess)
static struct mymenu mymenu[] = {
{N_("He_xChat"), 0, 0, M_NEWMENU, 0, 0, 1},
{N_("Network Li_st..."), menu_open_server_list, (char *)&pix_book, M_MENUPIX, 0, 0, 1, GDK_s},
{N_("Network Li_st..."), menu_open_server_list, (char *)&pix_book, M_MENUPIX, 0, 0, 1, GDK_KEY_s},
{0, 0, 0, M_SEP, 0, 0, 0},
{N_("_New"), 0, GTK_STOCK_NEW, M_MENUSUB, 0, 0, 1},
{N_("Server Tab..."), menu_newserver_tab, 0, M_MENUITEM, 0, 0, 1, GDK_t},
{N_("Server Tab..."), menu_newserver_tab, 0, M_MENUITEM, 0, 0, 1, GDK_KEY_t},
{N_("Channel Tab..."), menu_newchannel_tab, 0, M_MENUITEM, 0, 0, 1},
{N_("Server Window..."), menu_newserver_window, 0, M_MENUITEM, 0, 0, 1, GDK_n},
{N_("Server Window..."), menu_newserver_window, 0, M_MENUITEM, 0, 0, 1, GDK_KEY_n},
{N_("Channel Window..."), menu_newchannel_window, 0, M_MENUITEM, 0, 0, 1},
{0, 0, 0, M_END, 0, 0, 0},
{0, 0, 0, M_SEP, 0, 0, 0},
@@ -1718,17 +1719,17 @@ static struct mymenu mymenu[] = {
#endif
{0, 0, 0, M_SEP, 0, 0, 0}, /* 11 */
#define DETACH_OFFSET (12)
{0, menu_detach, GTK_STOCK_REDO, M_MENUSTOCK, 0, 0, 1, GDK_i}, /* 12 */
{0, menu_detach, GTK_STOCK_REDO, M_MENUSTOCK, 0, 0, 1, GDK_KEY_i}, /* 12 */
#define CLOSE_OFFSET (13)
{0, menu_close, GTK_STOCK_CLOSE, M_MENUSTOCK, 0, 0, 1, GDK_w},
{0, menu_close, GTK_STOCK_CLOSE, M_MENUSTOCK, 0, 0, 1, GDK_KEY_w},
{0, 0, 0, M_SEP, 0, 0, 0},
{N_("_Quit"), menu_quit, GTK_STOCK_QUIT, M_MENUSTOCK, 0, 0, 1, GDK_q}, /* 15 */
{N_("_Quit"), menu_quit, GTK_STOCK_QUIT, M_MENUSTOCK, 0, 0, 1, GDK_KEY_q}, /* 15 */
{N_("_View"), 0, 0, M_NEWMENU, 0, 0, 1},
#define MENUBAR_OFFSET (17)
{N_("_Menu Bar"), menu_bar_toggle_cb, 0, M_MENUTOG, MENU_ID_MENUBAR, 0, 1, GDK_F9},
{N_("_Menu Bar"), menu_bar_toggle_cb, 0, M_MENUTOG, MENU_ID_MENUBAR, 0, 1, GDK_KEY_F9},
{N_("_Topic Bar"), menu_topicbar_toggle, 0, M_MENUTOG, MENU_ID_TOPICBAR, 0, 1},
{N_("_User List"), menu_userlist_toggle, 0, M_MENUTOG, MENU_ID_USERLIST, 0, 1, GDK_F7},
{N_("_User List"), menu_userlist_toggle, 0, M_MENUTOG, MENU_ID_USERLIST, 0, 1, GDK_KEY_F7},
{N_("U_serlist Buttons"), menu_ulbuttons_toggle, 0, M_MENUTOG, MENU_ID_ULBUTTONS, 0, 1},
{N_("M_ode Buttons"), menu_cmbuttons_toggle, 0, M_MENUTOG, MENU_ID_MODEBUTTONS, 0, 1},
{0, 0, 0, M_SEP, 0, 0, 0},
@@ -1744,6 +1745,8 @@ static struct mymenu mymenu[] = {
{N_("Text"), menu_metres_text, 0, M_MENURADIO, 0, 0, 1},
{N_("Both"), menu_metres_both, 0, M_MENURADIO, 0, 0, 1},
{0, 0, 0, M_END, 0, 0, 0}, /* 32 */
{ 0, 0, 0, M_SEP, 0, 0, 0 },
{N_ ("Toggle _Fullscreen"), menu_fullscreen_toggle, 0, M_MENUITEM, 0, 0, 1, GDK_KEY_F11},
{N_("_Server"), 0, 0, M_NEWMENU, 0, 0, 1},
{N_("_Disconnect"), menu_disconnect, GTK_STOCK_DISCONNECT, M_MENUSTOCK, MENU_ID_DISCONNECT, 0, 1},
@@ -1751,8 +1754,8 @@ static struct mymenu mymenu[] = {
{N_("_Join a Channel..."), menu_join, GTK_STOCK_JUMP_TO, M_MENUSTOCK, MENU_ID_JOIN, 0, 1},
{N_("_List of Channels..."), menu_chanlist, GTK_STOCK_INDEX, M_MENUITEM, 0, 0, 1},
{0, 0, 0, M_SEP, 0, 0, 0},
#define AWAY_OFFSET (39)
{N_("Marked _Away"), menu_away, 0, M_MENUTOG, MENU_ID_AWAY, 0, 1, GDK_a},
#define AWAY_OFFSET (41)
{N_("Marked _Away"), menu_away, 0, M_MENUTOG, MENU_ID_AWAY, 0, 1, GDK_KEY_a},
{N_("_Usermenu"), 0, 0, M_NEWMENU, MENU_ID_USERMENU, 0, 1}, /* 40 */
@@ -1780,24 +1783,19 @@ static struct mymenu mymenu[] = {
{N_("_Raw Log..."), menu_rawlog, 0, M_MENUITEM, 0, 0, 1}, /* 61 */
{N_("URL Grabber..."), url_opengui, 0, M_MENUITEM, 0, 0, 1},
{0, 0, 0, M_SEP, 0, 0, 0},
{N_("Reset Marker Line"), menu_resetmarker, 0, M_MENUITEM, 0, 0, 1, GDK_m},
{N_("_Copy Selection"), menu_copy_selection, 0, M_MENUITEM, 0, 0, 1, GDK_C},
{N_("Reset Marker Line"), menu_resetmarker, 0, M_MENUITEM, 0, 0, 1, GDK_KEY_m},
{N_("_Copy Selection"), menu_copy_selection, 0, M_MENUITEM, 0, 0, 1, GDK_KEY_C},
{N_("C_lear Text"), menu_flushbuffer, GTK_STOCK_CLEAR, M_MENUSTOCK, 0, 0, 1},
{N_("Save Text..."), menu_savebuffer, GTK_STOCK_SAVE, M_MENUSTOCK, 0, 0, 1},
#define SEARCH_OFFSET 68
#define SEARCH_OFFSET (70)
{N_("Search"), 0, GTK_STOCK_JUSTIFY_LEFT, M_MENUSUB, 0, 0, 1},
{N_("Search Text..."), menu_search, GTK_STOCK_FIND, M_MENUSTOCK, 0, 0, 1, GDK_f},
{N_("Reset Search"), menu_search_reset, GTK_STOCK_FIND, M_MENUSTOCK, 0, 0, 1, GDK_F},
{N_("Search Next" ), menu_search_next, GTK_STOCK_FIND, M_MENUSTOCK, 0, 0, 1, GDK_g},
{N_("Search Previous" ), menu_search_prev, GTK_STOCK_FIND, M_MENUSTOCK, 0, 0, 1, GDK_G},
{N_("Search Text..."), menu_search, GTK_STOCK_FIND, M_MENUSTOCK, 0, 0, 1, GDK_KEY_f},
{N_("Search Next" ), menu_search_next, GTK_STOCK_FIND, M_MENUSTOCK, 0, 0, 1, GDK_KEY_g},
{N_("Search Previous" ), menu_search_prev, GTK_STOCK_FIND, M_MENUSTOCK, 0, 0, 1, GDK_KEY_G},
{0, 0, 0, M_END, 0, 0, 0},
{N_("_Help"), 0, 0, M_NEWMENU, 0, 0, 1}, /* 74 */
{N_("_Contents"), menu_docs, GTK_STOCK_HELP, M_MENUSTOCK, 0, 0, 1, GDK_F1},
#if 0
{N_("Check for updates"), menu_update, 0, M_MENUITEM, 0, 1},
#endif
{N_("_Contents"), menu_docs, GTK_STOCK_HELP, M_MENUSTOCK, 0, 0, 1, GDK_KEY_F1},
{N_("_About"), menu_about, GTK_STOCK_ABOUT, M_MENUSTOCK, 0, 0, 1},
{0, 0, 0, M_END, 0, 0, 0},
@@ -2318,8 +2316,9 @@ normalitem:
if (mymenu[i].key != 0)
gtk_widget_add_accelerator (item, "activate", accel_group,
mymenu[i].key,
mymenu[i].key == GDK_F1 ? 0 :
mymenu[i].key == GDK_w ? close_mask :
mymenu[i].key == GDK_KEY_F1 ? 0 :
mymenu[i].key == GDK_KEY_F11 ? 0 :
mymenu[i].key == GDK_KEY_w ? close_mask :
(g_ascii_isupper (mymenu[i].key)) ?
STATE_SHIFT | STATE_CTRL :
STATE_CTRL,
+3 -3
View File
@@ -311,10 +311,10 @@ notifygui_add_cb (GtkDialog *dialog, gint response, gpointer entry)
char *networks;
char *text;
text = GTK_ENTRY (entry)->text;
text = (char *)gtk_entry_get_text (GTK_ENTRY (entry));
if (text[0] && response == GTK_RESPONSE_ACCEPT)
{
networks = GTK_ENTRY (g_object_get_data (G_OBJECT (entry), "net"))->text;
networks = (char*)gtk_entry_get_text (GTK_ENTRY (g_object_get_data (G_OBJECT (entry), "net")));
if (g_ascii_strcasecmp (networks, "ALL") == 0 || networks[0] == 0)
notify_adduser (text, NULL);
else
@@ -353,7 +353,7 @@ fe_notify_ask (char *nick, char *networks)
gtk_container_set_border_width (GTK_CONTAINER (table), 12);
gtk_table_set_row_spacings (GTK_TABLE (table), 3);
gtk_table_set_col_spacings (GTK_TABLE (table), 8);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), table);
gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), table);
label = gtk_label_new (msg);
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1);
+5 -1
View File
@@ -408,6 +408,7 @@ tray_toggle_visibility (gboolean force_hide)
static int x, y;
static GdkScreen *screen;
static int maximized;
static int fullscreen;
GtkWindow *win;
if (!sticon)
@@ -431,6 +432,7 @@ tray_toggle_visibility (gboolean force_hide)
gtk_window_get_position (win, &x, &y);
screen = gtk_window_get_screen (win);
maximized = prefs.hex_gui_win_state;
fullscreen = prefs.hex_gui_win_fullscreen;
gtk_widget_hide (GTK_WIDGET (win));
}
else
@@ -441,6 +443,8 @@ tray_toggle_visibility (gboolean force_hide)
gtk_window_move (win, x, y);
if (maximized)
gtk_window_maximize (win);
if (fullscreen)
gtk_window_fullscreen (win);
gtk_widget_show (GTK_WIDGET (win));
gtk_window_present (win);
}
@@ -551,7 +555,7 @@ tray_make_item (GtkWidget *menu, char *label, void *callback, void *userdata)
static void
tray_toggle_cb (GtkCheckMenuItem *item, unsigned int *setting)
{
*setting = item->active;
*setting = gtk_check_menu_item_get_active (item);
}
static void
+1 -1
View File
@@ -88,7 +88,7 @@ rawlog_key_cb (GtkWidget * wid, GdkEventKey * key, gpointer userdata)
* but make sure not to copy twice, i.e. when auto-copy is enabled.
*/
if (!prefs.hex_text_autocopy_text &&
(key->keyval == GDK_c || key->keyval == GDK_C) &&
(key->keyval == GDK_KEY_c || key->keyval == GDK_KEY_C) &&
key->state & STATE_SHIFT &&
key->state & STATE_CTRL)
{
-246
View File
@@ -1,246 +0,0 @@
/* X-Chat
* Copyright (C) 1998 Peter Zelezny.
*
* 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 <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "fe-gtk.h"
#include "../common/hexchat.h"
#include "../common/fe.h"
#include "../common/util.h"
#include "../common/hexchatc.h"
#include "../common/cfgfiles.h"
#include "gtkutil.h"
#include "xtext.h"
#include "maingui.h"
GtkWidget *searchwin;
GtkWidget *searchentry;
static void
search_search (session * sess, const gchar *text)
{
gtk_xtext_search_flags flags;
textentry *last;
GError *err = NULL;
flags = ((prefs.hex_text_search_case_match == 1? case_match: 0) |
(prefs.hex_text_search_backward == 1? backward: 0) |
(prefs.hex_text_search_highlight_all == 1? highlight: 0) |
(prefs.hex_text_search_follow == 1? follow: 0) |
(prefs.hex_text_search_regexp == 1? regexp: 0));
if (!is_session (sess))
{
fe_message (_("The window you opened this Search "
"for doesn't exist anymore."), FE_MSG_ERROR);
return;
}
last = gtk_xtext_search (GTK_XTEXT (sess->gui->xtext), text, flags, &err);
if (text == NULL || text[0] == 0)
{
return;
}
if (err)
{
fe_message (_(err->message), FE_MSG_ERROR);
g_error_free (err);
}
else if (!last)
{
gtk_entry_set_icon_from_stock (GTK_ENTRY (searchentry), GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_DIALOG_ERROR);
}
else
{
gtk_entry_set_icon_from_stock (GTK_ENTRY (searchentry), GTK_ENTRY_ICON_SECONDARY, NULL);
}
}
static void
search_find_cb (GtkWidget * button, session * sess)
{
GtkEntry *entry;
const gchar *text;
entry = g_object_get_data (G_OBJECT (button), "e");
text = gtk_entry_get_text (entry);
search_search (sess, text);
}
static void
search_close_cb (GtkWidget * button, GtkWidget * win)
{
gtk_widget_destroy (win);
searchwin = NULL;
}
static void
search_reset_cb (GtkWidget * button, session * sess)
{
search_search (sess, "");
if (searchwin)
{
search_close_cb (button, searchwin);
}
}
static void
search_cleanup_cb (GtkWidget * button, GtkWidget * win)
{
searchwin = NULL;
}
static void
search_entry_cb (GtkWidget * entry, session * sess)
{
search_search (sess, gtk_entry_get_text (GTK_ENTRY (entry)));
}
static void
search_changed_cb (GtkWidget * entry, gpointer userdata)
{
gtk_entry_set_icon_from_stock (GTK_ENTRY (entry), GTK_ENTRY_ICON_SECONDARY, NULL);
}
static void
search_caseign_cb (GtkToggleButton * but, session * sess)
{
prefs.hex_text_search_case_match = (but->active)? 1: 0;
save_config();
}
static void
search_dirbwd_cb (GtkToggleButton * but, session * sess)
{
prefs.hex_text_search_backward = (but->active)? 1: 0;
save_config();
}
static void
search_regexp_cb (GtkToggleButton * but, session * sess)
{
prefs.hex_text_search_regexp = (but->active)? 1: 0;
save_config();
}
static void
search_highlight_cb (GtkToggleButton * but, session * sess)
{
prefs.hex_text_search_highlight_all = (but->active)? 1: 0;
save_config();
search_search (sess, NULL);
}
void
search_open (session * sess)
{
GtkWidget *win, *hbox, *vbox, *entry, *wid;
gchar *text;
if (searchwin)
{
gtk_widget_destroy (searchwin);
searchwin = NULL;
}
win = mg_create_generic_tab ("search", _(DISPLAY_NAME": Search"), TRUE, FALSE,
search_cleanup_cb, NULL, 0, 0, &vbox, 0);
gtk_container_set_border_width (GTK_CONTAINER (win), 12);
gtk_box_set_spacing (GTK_BOX (vbox), 4);
/* First line: _____________________ _Find */
hbox = gtk_hbox_new (0, 10);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
gtk_widget_show (hbox);
entry = searchentry = gtk_entry_new ();
text = GTK_XTEXT (sess->gui->xtext)->buffer->search_text;
gtk_entry_set_icon_activatable (GTK_ENTRY (entry), GTK_ENTRY_ICON_SECONDARY, FALSE);
gtk_entry_set_icon_tooltip_text (GTK_ENTRY (entry), GTK_ENTRY_ICON_SECONDARY, _("Search hit end or not found."));
if (text)
{
gtk_entry_set_text (GTK_ENTRY (entry), text);
gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1);
}
g_signal_connect (G_OBJECT (entry), "activate",
G_CALLBACK (search_entry_cb), sess);
g_signal_connect (G_OBJECT (entry), "changed",
G_CALLBACK (search_changed_cb), NULL);
gtk_container_add (GTK_CONTAINER (hbox), entry);
gtk_widget_show (entry);
gtk_widget_grab_focus (entry);
wid = gtk_hbutton_box_new ();
gtk_container_add (GTK_CONTAINER (hbox), wid);
gtk_widget_show (wid);
wid = gtkutil_button (wid, GTK_STOCK_FIND, 0, search_find_cb, sess,
_("_Find"));
g_object_set_data (G_OBJECT (wid), "e", entry);
/* Second line: X Match case */
wid = gtk_check_button_new_with_mnemonic (_("_Match case"));
GTK_TOGGLE_BUTTON (wid)->active = prefs.hex_text_search_case_match;
g_signal_connect (G_OBJECT (wid), "toggled", G_CALLBACK (search_caseign_cb), sess);
gtk_container_add (GTK_CONTAINER (vbox), wid);
add_tip (wid, _("Perform a case-sensitive search."));
gtk_widget_show (wid);
/* Third line: X Search backwards */
wid = gtk_check_button_new_with_mnemonic (_("Search _backwards"));
GTK_TOGGLE_BUTTON (wid)->active = prefs.hex_text_search_backward;
g_signal_connect (G_OBJECT (wid), "toggled", G_CALLBACK (search_dirbwd_cb), sess);
gtk_container_add (GTK_CONTAINER (vbox), wid);
add_tip (wid, _("Search from the newest text line to the oldest."));
gtk_widget_show (wid);
/* Fourth line: X Highlight all */
wid = gtk_check_button_new_with_mnemonic (_("_Highlight all"));
GTK_TOGGLE_BUTTON (wid)->active = prefs.hex_text_search_highlight_all;
g_signal_connect (G_OBJECT (wid), "toggled", G_CALLBACK (search_highlight_cb), sess);
gtk_container_add (GTK_CONTAINER (vbox), wid);
add_tip (wid, _("Highlight all occurrences, and underline the current occurrence."));
gtk_widget_show (wid);
/* Fifth line: X Regular expression */
wid = gtk_check_button_new_with_mnemonic (_("R_egular expression"));
GTK_TOGGLE_BUTTON (wid)->active = prefs.hex_text_search_regexp;
g_signal_connect (G_OBJECT (wid), "toggled", G_CALLBACK (search_regexp_cb), sess);
gtk_container_add (GTK_CONTAINER (vbox), wid);
add_tip (wid, _("Regard search string as a regular expression."));
gtk_widget_show (wid);
/* Sixth line: _Close Close and _Reset */
hbox = gtk_hbutton_box_new ();
gtk_box_pack_start (GTK_BOX (vbox), hbox, 0, 0, 4);
gtk_widget_show (hbox);
wid = gtkutil_button (hbox, GTK_STOCK_CLOSE, 0, search_close_cb, win,
_("_Close"));
add_tip (wid, _("Close this box, but continue searching new lines."));
wid = gtkutil_button (hbox, "gtk-reset", 0, search_reset_cb, sess,
_("Close and _Reset"));
add_tip (wid, _("Close this box, reset highlighted search items, and stop searching new lines."));
/* Add recognition of the ESC key to close the box */
gtkutil_destroy_on_esc (win);
/* That's all, folks */
searchwin = win;
gtk_widget_show (win);
}
-25
View File
@@ -1,25 +0,0 @@
/* 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
*/
#ifndef HEXCHAT_SEARCH_H
#define HEXCHAT_SEARCH_H
void search_open (session * sess);
#endif
+31 -34
View File
@@ -587,12 +587,12 @@ servlist_net_keypress_cb (GtkWidget *wid, GdkEventKey *evt, gpointer tree)
if (evt->state & STATE_SHIFT)
{
if (evt->keyval == GDK_Up)
if (evt->keyval == GDK_KEY_Up)
{
handled = TRUE;
network_list = servlist_move_item (GTK_TREE_VIEW (tree), network_list, selected_net, -1);
}
else if (evt->keyval == GDK_Down)
else if (evt->keyval == GDK_KEY_Down)
{
handled = TRUE;
network_list = servlist_move_item (GTK_TREE_VIEW (tree), network_list, selected_net, +1);
@@ -671,10 +671,10 @@ servlist_update_from_entry (char **str, GtkWidget *entry)
if (*str)
free (*str);
if (GTK_ENTRY (entry)->text[0] == 0)
if (gtk_entry_get_text (GTK_ENTRY (entry))[0] == 0)
*str = NULL;
else
*str = strdup (GTK_ENTRY (entry)->text);
*str = strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
}
static void
@@ -946,20 +946,20 @@ servlist_savegui (void)
char *sp;
/* check for blank username, ircd will not allow this */
if (GTK_ENTRY (entry_guser)->text[0] == 0)
if (gtk_entry_get_text (GTK_ENTRY (entry_guser))[0] == 0)
return 1;
/* if (GTK_ENTRY (entry_greal)->text[0] == 0)
/* if (gtk_entry_get_text (GTK_ENTRY (entry_greal))[0] == 0)
return 1; */
strcpy (prefs.hex_irc_nick1, GTK_ENTRY (entry_nick1)->text);
strcpy (prefs.hex_irc_nick2, GTK_ENTRY (entry_nick2)->text);
strcpy (prefs.hex_irc_nick3, GTK_ENTRY (entry_nick3)->text);
strcpy (prefs.hex_irc_user_name, GTK_ENTRY (entry_guser)->text);
strcpy (prefs.hex_irc_nick1, gtk_entry_get_text (GTK_ENTRY (entry_nick1)));
strcpy (prefs.hex_irc_nick2, gtk_entry_get_text (GTK_ENTRY (entry_nick2)));
strcpy (prefs.hex_irc_nick3, gtk_entry_get_text (GTK_ENTRY (entry_nick3)));
strcpy (prefs.hex_irc_user_name, gtk_entry_get_text (GTK_ENTRY (entry_guser)));
sp = strchr (prefs.hex_irc_user_name, ' ');
if (sp)
sp[0] = 0; /* spaces will break the login */
/* strcpy (prefs.hex_irc_real_name, GTK_ENTRY (entry_greal)->text); */
/* strcpy (prefs.hex_irc_real_name, gtk_entry_get_text (GTK_ENTRY (entry_greal))); */
servlist_save ();
save_config (); /* For nicks stored in hexchat.conf */
@@ -1030,12 +1030,12 @@ servlist_keypress_cb (GtkWidget *wid, GdkEventKey *evt, GtkNotebook *notebook)
if (evt->state & STATE_SHIFT)
{
if (evt->keyval == GDK_Up)
if (evt->keyval == GDK_KEY_Up)
{
handled = TRUE;
delta = -1;
}
else if (evt->keyval == GDK_Down)
else if (evt->keyval == GDK_KEY_Down)
{
handled = TRUE;
delta = +1;
@@ -1208,13 +1208,13 @@ servlist_check_cb (GtkWidget *but, gpointer num_p)
if ((1 << num) == FLAG_CYCLE || (1 << num) == FLAG_USE_PROXY)
{
/* these ones are reversed, so it's compat with 2.0.x */
if (GTK_TOGGLE_BUTTON (but)->active)
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (but)))
selected_net->flags &= ~(1 << num);
else
selected_net->flags |= (1 << num);
} else
{
if (GTK_TOGGLE_BUTTON (but)->active)
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (but)))
selected_net->flags |= (1 << num);
else
selected_net->flags &= ~(1 << num);
@@ -1222,7 +1222,7 @@ servlist_check_cb (GtkWidget *but, gpointer num_p)
if ((1 << num) == FLAG_USE_GLOBAL)
{
servlist_toggle_global_user (!GTK_TOGGLE_BUTTON (but)->active);
servlist_toggle_global_user (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (but)));
}
}
@@ -1496,7 +1496,7 @@ servlist_combo_cb (GtkEntry *entry, gpointer userdata)
if (selected_net->encoding)
free (selected_net->encoding);
selected_net->encoding = strdup (entry->text);
selected_net->encoding = strdup (gtk_entry_get_text (entry));
}
/* Fills up the network's authentication type so that it's guaranteed to be either NULL or a valid value. */
@@ -1549,7 +1549,7 @@ servlist_create_charsetcombo (void)
gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN(cb))), selected_net->encoding ? selected_net->encoding : "System default");
g_signal_connect (G_OBJECT (GTK_BIN (cb)->child), "changed",
g_signal_connect (G_OBJECT (gtk_bin_get_child (GTK_BIN (cb))), "changed",
G_CALLBACK (servlist_combo_cb), NULL);
return cb;
@@ -1582,7 +1582,7 @@ servlist_create_logintypecombo (GtkWidget *data)
static void
no_servlist (GtkWidget * igad, gpointer serv)
{
if (GTK_TOGGLE_BUTTON (igad)->active)
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (igad)))
prefs.hex_gui_slist_skip = TRUE;
else
prefs.hex_gui_slist_skip = FALSE;
@@ -1591,7 +1591,7 @@ no_servlist (GtkWidget * igad, gpointer serv)
static void
fav_servlist (GtkWidget * igad, gpointer serv)
{
if (GTK_TOGGLE_BUTTON (igad)->active)
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (igad)))
prefs.hex_gui_slist_fav = TRUE;
else
prefs.hex_gui_slist_fav = FALSE;
@@ -1650,7 +1650,6 @@ servlist_open_edit (GtkWidget *parent, ircnet *net)
snprintf (buf, sizeof (buf), _(DISPLAY_NAME": Edit %s"), net->name);
gtk_window_set_title (GTK_WINDOW (editwindow), buf);
gtk_window_set_default_size (GTK_WINDOW (editwindow), netedit_win_width, netedit_win_height);
gtk_window_set_position (GTK_WINDOW (editwindow), GTK_WIN_POS_MOUSE);
gtk_window_set_transient_for (GTK_WINDOW (editwindow), GTK_WINDOW (parent));
gtk_window_set_modal (GTK_WINDOW (editwindow), TRUE);
gtk_window_set_type_hint (GTK_WINDOW (editwindow), GDK_WINDOW_TYPE_HINT_DIALOG);
@@ -1711,7 +1710,6 @@ servlist_open_edit (GtkWidget *parent, ircnet *net)
"editable", 1,
NULL);
/* Channel Tree */
store = gtk_list_store_new (3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
model = GTK_TREE_MODEL (store);
@@ -1784,19 +1782,19 @@ servlist_open_edit (GtkWidget *parent, ircnet *net)
g_signal_connect (G_OBJECT (buttonadd), "clicked",
G_CALLBACK (servlist_addbutton_cb), notebook);
gtk_container_add (GTK_CONTAINER (vbuttonbox1), buttonadd);
GTK_WIDGET_SET_FLAGS (buttonadd, GTK_CAN_DEFAULT);
gtk_widget_set_can_default (buttonadd, TRUE);
buttonremove = gtk_button_new_from_stock ("gtk-remove");
g_signal_connect (G_OBJECT (buttonremove), "clicked",
G_CALLBACK (servlist_deletebutton_cb), notebook);
gtk_container_add (GTK_CONTAINER (vbuttonbox1), buttonremove);
GTK_WIDGET_SET_FLAGS (buttonremove, GTK_CAN_DEFAULT);
gtk_widget_set_can_default (buttonremove, TRUE);
buttonedit = gtk_button_new_with_mnemonic (_("_Edit"));
g_signal_connect (G_OBJECT (buttonedit), "clicked",
G_CALLBACK (servlist_editbutton_cb), notebook);
gtk_container_add (GTK_CONTAINER (vbuttonbox1), buttonedit);
GTK_WIDGET_SET_FLAGS (buttonedit, GTK_CAN_DEFAULT);
gtk_widget_set_can_default (buttonedit, TRUE);
/* Checkboxes and entries */
@@ -1854,7 +1852,7 @@ servlist_open_edit (GtkWidget *parent, ircnet *net)
g_signal_connect (G_OBJECT (button10), "clicked",
G_CALLBACK (servlist_edit_close_cb), 0);
gtk_container_add (GTK_CONTAINER (hbuttonbox4), button10);
GTK_WIDGET_SET_FLAGS (button10, GTK_CAN_DEFAULT);
gtk_widget_set_can_default (button10, TRUE);
if (net->flags & FLAG_USE_GLOBAL)
{
@@ -1917,7 +1915,6 @@ servlist_open_networks (void)
gtk_container_set_border_width (GTK_CONTAINER (servlist), 4);
gtk_window_set_title (GTK_WINDOW (servlist), _(DISPLAY_NAME": Network List"));
gtk_window_set_default_size (GTK_WINDOW (servlist), netlist_win_width, netlist_win_height);
gtk_window_set_position (GTK_WINDOW (servlist), GTK_WIN_POS_MOUSE);
gtk_window_set_role (GTK_WINDOW (servlist), "servlist");
gtk_window_set_type_hint (GTK_WINDOW (servlist), GDK_WINDOW_TYPE_HINT_DIALOG);
if (current_sess)
@@ -2089,21 +2086,21 @@ servlist_open_networks (void)
G_CALLBACK (servlist_addnet_cb), networks_tree);
gtk_widget_show (button_add);
gtk_container_add (GTK_CONTAINER (vbuttonbox2), button_add);
GTK_WIDGET_SET_FLAGS (button_add, GTK_CAN_DEFAULT);
gtk_widget_set_can_default (button_add, TRUE);
button_remove = gtk_button_new_from_stock ("gtk-remove");
g_signal_connect (G_OBJECT (button_remove), "clicked",
G_CALLBACK (servlist_deletenet_cb), 0);
gtk_widget_show (button_remove);
gtk_container_add (GTK_CONTAINER (vbuttonbox2), button_remove);
GTK_WIDGET_SET_FLAGS (button_remove, GTK_CAN_DEFAULT);
gtk_widget_set_can_default (button_remove, TRUE);
button_edit = gtk_button_new_with_mnemonic (_("_Edit..."));
g_signal_connect (G_OBJECT (button_edit), "clicked",
G_CALLBACK (servlist_edit_cb), 0);
gtk_widget_show (button_edit);
gtk_container_add (GTK_CONTAINER (vbuttonbox2), button_edit);
GTK_WIDGET_SET_FLAGS (button_edit, GTK_CAN_DEFAULT);
gtk_widget_set_can_default (button_edit, TRUE);
button_sort = gtk_button_new_with_mnemonic (_("_Sort"));
add_tip (button_sort, _("Sorts the network list in alphabetical order. "
@@ -2112,7 +2109,7 @@ servlist_open_networks (void)
G_CALLBACK (servlist_sort), 0);
gtk_widget_show (button_sort);
gtk_container_add (GTK_CONTAINER (vbuttonbox2), button_sort);
GTK_WIDGET_SET_FLAGS (button_sort, GTK_CAN_DEFAULT);
gtk_widget_set_can_default (button_sort, TRUE);
button_sort = gtk_button_new_with_mnemonic (_("_Favor"));
add_tip (button_sort, _("Mark or unmark this network as a favorite."));
@@ -2120,7 +2117,7 @@ servlist_open_networks (void)
G_CALLBACK (servlist_favor), 0);
gtk_widget_show (button_sort);
gtk_container_add (GTK_CONTAINER (vbuttonbox2), button_sort);
GTK_WIDGET_SET_FLAGS (button_sort, GTK_CAN_DEFAULT);
gtk_widget_set_can_default (button_sort, TRUE);
hseparator1 = gtk_hseparator_new ();
gtk_widget_show (hseparator1);
@@ -2136,11 +2133,11 @@ servlist_open_networks (void)
g_signal_connect (G_OBJECT (button_close), "clicked",
G_CALLBACK (servlist_close_cb), 0);
gtk_container_add (GTK_CONTAINER (hbuttonbox1), button_close);
GTK_WIDGET_SET_FLAGS (button_close, GTK_CAN_DEFAULT);
gtk_widget_set_can_default (button_close, TRUE);
button_connect = gtkutil_button (hbuttonbox1, GTK_STOCK_CONNECT, NULL,
servlist_connect_cb, NULL, _("C_onnect"));
GTK_WIDGET_SET_FLAGS (button_connect, GTK_CAN_DEFAULT);
gtk_widget_set_can_default (button_connect, TRUE);
gtk_label_set_mnemonic_widget (GTK_LABEL (label3), entry1);
gtk_label_set_mnemonic_widget (GTK_LABEL (label6), entry4);
+19 -15
View File
@@ -426,7 +426,11 @@ static const setting alert_settings[] =
#ifdef WIN32
{ST_3OGGLE, N_("Make a beep sound on:"), 0, N_("Play the \"Instant Message Notification\" system sound upon the selected events"), (void *)beeplist, 0},
#else
#ifdef USE_LIBCANBERRA
{ST_3OGGLE, N_("Make a beep sound on:"), 0, N_("Play \"message-new-instant\" from the freedesktop.org sound theme upon the selected events"), (void *)beeplist, 0},
#else
{ST_3OGGLE, N_("Make a beep sound on:"), 0, N_("Play a GTK beep upon the selected events"), (void *)beeplist, 0},
#endif
#endif
{ST_TOGGLE, N_("Omit alerts when marked as being away"), P_OFFINTNL(hex_away_omit_alerts), 0, 0, 0},
@@ -631,7 +635,7 @@ static const setting network_settings[] =
static void
setup_3oggle_cb (GtkToggleButton *but, unsigned int *setting)
{
*setting = but->active;
*setting = gtk_toggle_button_get_active (but);
}
static void
@@ -704,15 +708,15 @@ setup_toggle_cb (GtkToggleButton *but, const setting *set)
{
GtkWidget *label, *disable_wid;
setup_set_int (&setup_prefs, set, but->active ? 1 : 0);
setup_set_int (&setup_prefs, set, gtk_toggle_button_get_active (but));
/* does this toggle also enable/disable another widget? */
disable_wid = g_object_get_data (G_OBJECT (but), "nxt");
if (disable_wid)
{
gtk_widget_set_sensitive (disable_wid, but->active);
gtk_widget_set_sensitive (disable_wid, gtk_toggle_button_get_active (but));
label = g_object_get_data (G_OBJECT (disable_wid), "lbl");
gtk_widget_set_sensitive (label, but->active);
gtk_widget_set_sensitive (label, gtk_toggle_button_get_active (but));
}
}
@@ -900,7 +904,7 @@ setup_menu_cb (GtkWidget *cbox, const setting *set)
static void
setup_radio_cb (GtkWidget *item, const setting *set)
{
if (GTK_TOGGLE_BUTTON (item)->active)
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (item)))
{
int n = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "n"));
/* set the prefs.<field> */
@@ -1106,7 +1110,7 @@ setup_fontsel_cancel (GtkWidget *button, GtkFontSelectionDialog *dialog)
static void
setup_browsefolder_cb (GtkWidget *button, GtkEntry *entry)
{
gtkutil_file_req (_("Select Download Folder"), setup_filereq_cb, entry, entry->text, NULL, FRF_CHOOSEFOLDER);
gtkutil_file_req (_("Select Download Folder"), setup_filereq_cb, entry, (char*)gtk_entry_get_text (entry), NULL, FRF_CHOOSEFOLDER);
}
static void
@@ -1120,8 +1124,8 @@ setup_browsefont_cb (GtkWidget *button, GtkWidget *entry)
sel = (GtkFontSelection *) dialog->fontsel;
if (GTK_ENTRY (entry)->text[0])
gtk_font_selection_set_font_name (sel, GTK_ENTRY (entry)->text);
if (gtk_entry_get_text (GTK_ENTRY (entry))[0])
gtk_font_selection_set_font_name (sel, gtk_entry_get_text (GTK_ENTRY (entry)));
g_object_set_data (G_OBJECT (dialog->ok_button), "e", entry);
@@ -1140,8 +1144,8 @@ setup_entry_cb (GtkEntry *entry, setting *set)
{
int size;
int pos;
int len = strlen (entry->text);
unsigned char *p = entry->text;
int len = gtk_entry_get_text_length (entry);
unsigned char *p = (unsigned char*)gtk_entry_get_text (entry);
/* need to truncate? */
if (len >= set->extra)
@@ -1163,7 +1167,7 @@ setup_entry_cb (GtkEntry *entry, setting *set)
}
else
{
setup_set_str (&setup_prefs, set, entry->text);
setup_set_str (&setup_prefs, set, gtk_entry_get_text (entry));
}
}
@@ -1445,7 +1449,7 @@ setup_create_color_button (GtkWidget *table, int num, int row, int col)
/* 12345678901 23456789 01 23456789 */
sprintf (buf, "<span size=\"x-small\">%d</span>", num);
but = gtk_button_new_with_label (" ");
gtk_label_set_markup (GTK_LABEL (GTK_BIN (but)->child), buf);
gtk_label_set_markup (GTK_LABEL (gtk_bin_get_child (GTK_BIN (but))), buf);
/* win32 build uses this to turn off themeing */
g_object_set_data (G_OBJECT (but), "hexchat-color", (gpointer)1);
gtk_table_attach (GTK_TABLE (table), but, col, col+1, row, row+1,
@@ -1689,7 +1693,7 @@ setup_snd_browse_cb (GtkWidget *button, GtkEntry *entry)
static void
setup_snd_play_cb (GtkWidget *button, GtkEntry *entry)
{
sound_play (entry->text, FALSE);
sound_play (gtk_entry_get_text (entry), FALSE);
}
static void
@@ -1711,7 +1715,7 @@ setup_snd_changed_cb (GtkEntry *ent, GtkTreeView *tree)
/* get the new sound file */
if (sound_files[n])
free (sound_files[n]);
sound_files[n] = strdup (GTK_ENTRY (ent)->text);
sound_files[n] = strdup (gtk_entry_get_text (GTK_ENTRY (ent)));
/* update the TreeView list */
store = (GtkListStore *)gtk_tree_view_get_model (tree);
@@ -2268,7 +2272,7 @@ setup_window_open (void)
{
GtkWidget *wid, *win, *vbox, *hbox, *hbbox;
win = gtkutil_window_new (_(DISPLAY_NAME": Preferences"), "prefs", 0, 0, 3);
win = gtkutil_window_new (_(DISPLAY_NAME": Preferences"), "prefs", 0, 0, 2);
vbox = gtk_vbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
+3 -3
View File
@@ -420,7 +420,7 @@ replace_word(GtkWidget *menuitem, SexySpellEntry *entry)
get_word_extents_from_position(entry, &start, &end, entry->priv->mark_character);
oldword = gtk_editable_get_chars(GTK_EDITABLE(entry), start, end);
newword = gtk_label_get_text(GTK_LABEL(GTK_BIN(menuitem)->child));
newword = gtk_label_get_text(GTK_LABEL(gtk_bin_get_child (GTK_BIN(menuitem))));
cursor = gtk_editable_get_position(GTK_EDITABLE(entry));
/* is the cursor at the end? If so, restore it there */
@@ -821,7 +821,7 @@ sexy_spell_entry_recheck_all(SexySpellEntry *entry)
rect.x = 0; rect.y = 0;
rect.width = widget->allocation.width;
rect.height = widget->allocation.height;
gdk_window_invalidate_rect(widget->window, &rect, TRUE);
gdk_window_invalidate_rect(gtk_widget_get_window (widget), &rect, TRUE);
}
}
@@ -1338,7 +1338,7 @@ sexy_spell_entry_set_checked(SexySpellEntry *entry, gboolean checked)
rect.x = 0; rect.y = 0;
rect.width = widget->allocation.width;
rect.height = widget->allocation.height;
gdk_window_invalidate_rect(widget->window, &rect, TRUE);
gdk_window_invalidate_rect(gtk_widget_get_window (widget), &rect, TRUE);
} else {
if (entry->priv->words) {
g_strfreev(entry->priv->words);
+3 -3
View File
@@ -274,7 +274,7 @@ userlist_set_value (GtkWidget *treeview, gfloat val)
gfloat
userlist_get_value (GtkWidget *treeview)
{
return gtk_tree_view_get_vadjustment (GTK_TREE_VIEW (treeview))->value;
return gtk_adjustment_get_value (gtk_tree_view_get_vadjustment (GTK_TREE_VIEW (treeview)));
}
int
@@ -425,7 +425,7 @@ userlist_dnd_drop (GtkTreeView *widget, GdkDragContext *context,
return;
gtk_tree_model_get (model, &iter, COL_USER, &user, -1);
mg_dnd_drop_file (current_sess, user->nick, selection_data->data);
mg_dnd_drop_file (current_sess, user->nick, (char *)gtk_selection_data_get_data (selection_data));
}
static gboolean
@@ -579,7 +579,7 @@ userlist_click_cb (GtkWidget *widget, GdkEventButton *event, gpointer userdata)
static gboolean
userlist_key_cb (GtkWidget *wid, GdkEventKey *evt, gpointer userdata)
{
if (evt->keyval >= GDK_asterisk && evt->keyval <= GDK_z)
if (evt->keyval >= GDK_KEY_asterisk && evt->keyval <= GDK_KEY_z)
{
/* dirty trick to avoid auto-selection */
SPELL_ENTRY_SET_EDITABLE (current_sess->gui->input_box, FALSE);
+30 -28
View File
@@ -96,20 +96,6 @@
static GtkWidgetClass *parent_class = NULL;
/*
* offsets_t is used for retaining search information.
* It is stored in the 'data' member of a GList,
* as chained from ent->marks. It saves starting and
* ending+1 offset of a found occurrence.
*/
typedef union offsets_u {
struct offsets_s {
guint16 start;
guint16 end;
} o;
guint32 u;
} offsets_t;
struct textentry
{
struct textentry *next;
@@ -1951,7 +1937,7 @@ gtk_xtext_get_word (GtkXText * xtext, int x, int y, textentry ** ret_ent,
word = gtk_xtext_strip_color (word, len, xtext->scratch_buffer, NULL, NULL, slp, FALSE);
/* avoid turning the cursor into a hand for non-url part of the word */
if (xtext->urlcheck_function (GTK_WIDGET (xtext), word))
if (xtext->urlcheck_function && xtext->urlcheck_function (GTK_WIDGET (xtext), word))
{
int start, end;
url_last (&start, &end);
@@ -5265,7 +5251,7 @@ gtk_xtext_unstrip_color (gint start, gint end, GSList *slp, GList **gl, gint max
while (cursl)
{
offlen_t ol;
ol.u = GPOINTER_TO_UINT(cursl->data);
ol.u = GPOINTER_TO_UINT (cursl->data);
if (start < ol.o.len)
{
off1 = ol.o.off + start;
@@ -5281,7 +5267,7 @@ gtk_xtext_unstrip_color (gint start, gint end, GSList *slp, GList **gl, gint max
while (cursl)
{
offlen_t ol;
ol.u = GPOINTER_TO_UINT(cursl->data);
ol.u = GPOINTER_TO_UINT (cursl->data);
if (end < ol.o.len)
{
off2 = ol.o.off + end;
@@ -5393,6 +5379,7 @@ gtk_xtext_search_textentry_del (xtext_buffer *buf, textentry *ent)
{
buf->cursearch = NULL;
buf->curmark = NULL;
buf->curdata.u = 0;
}
if (buf->pagetop_ent == ent)
{
@@ -5429,6 +5416,7 @@ gtk_xtext_search_fini (xtext_buffer *buf)
buf->search_flags = 0;
buf->cursearch = NULL;
buf->curmark = NULL;
/* but leave buf->curdata.u alone! */
if (buf->search_re)
{
g_regex_unref (buf->search_re);
@@ -5475,6 +5463,7 @@ gtk_xtext_search_init (xtext_buffer *buf, const gchar *text, gtk_xtext_search_fl
buf->search_flags = flags;
buf->cursearch = NULL;
buf->curmark = NULL;
/* but leave buf->curdata.u alone! */
return FALSE;
}
@@ -5565,24 +5554,36 @@ gtk_xtext_search (GtkXText * xtext, const gchar *text, gtk_xtext_search_flags fl
}
}
}
#if 0
/* If user changed the search, let's look starting where he was */
else if (buf->hintsearch)
{
for (ent = buf->hintsearch; ent; ent = BACKWARD? ent->prev: ent->next)
if (ent->marks)
break;
if (ent == NULL)
for (ent = buf->hintsearch; ent; ent = BACKWARD? ent->next: ent->prev)
GList *mark;
offsets_t last, this;
/*
* If we already have a 'current' item from the last search, and if
* the first character of an occurrence on this line for this new search
* is within that former item, use the occurrence as current.
*/
ent = buf->hintsearch;
last.u = buf->curdata.u;
for (mark = ent->marks; mark; mark = mark->next)
{
this.u = GPOINTER_TO_UINT (mark->data);
if (this.o.start >= last.o.start && this.o.start < last.o.end)
break;
}
if (mark == NULL)
{
for (ent = buf->hintsearch; ent; ent = BACKWARD? ent->prev: ent->next)
if (ent->marks)
break;
if (ent)
{
buf->cursearch = g_list_find (buf->search_found, ent);
buf->curmark = FIRSTLAST (ent->marks);
mark = ent? FIRSTLAST (ent->marks): NULL;
}
buf->cursearch = g_list_find (buf->search_found, ent);
buf->curmark = mark;
}
#endif
/* This is a fresh search */
else
{
@@ -5590,6 +5591,7 @@ gtk_xtext_search (GtkXText * xtext, const gchar *text, gtk_xtext_search_flags fl
ent = buf->cursearch->data;
buf->curmark = FIRSTLAST (ent->marks);
}
buf->curdata.u = (buf->curmark)? GPOINTER_TO_UINT (buf->curmark->data): 0;
}
}
buf->hintsearch = ent;
+15
View File
@@ -64,6 +64,20 @@ typedef struct _GtkXText GtkXText;
typedef struct _GtkXTextClass GtkXTextClass;
typedef struct textentry textentry;
/*
* offsets_t is used for retaining search information.
* It is stored in the 'data' member of a GList,
* as chained from ent->marks. It saves starting and
* ending+1 offset of a found occurrence.
*/
typedef union offsets_u {
struct offsets_s {
guint16 start;
guint16 end;
} o;
guint32 u;
} offsets_t;
typedef struct {
GtkXText *xtext; /* attached to this widget */
@@ -105,6 +119,7 @@ typedef struct {
gtk_xtext_search_flags search_flags; /* match, bwd, highlight */
GList *cursearch; /* GList whose 'data' pts to current textentry */
GList *curmark; /* current item in ent->marks */
offsets_t curdata; /* current offset info, from *curmark */
GRegex *search_re; /* Compiled regular expression */
textentry *hintsearch; /* textentry found for last search */
} xtext_buffer;
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
+3 -3
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
@@ -109,4 +109,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
+2
View File
@@ -16,6 +16,7 @@
<!-- YOU SHOULDN'T TOUCH ANYTHING BELOW -->
<!-- G_DISABLE_DEPRECATED is unfeasible due to g_completion_* -->
<!-- must be buildable with GSEAL_ENABLE in the future, xtext, setup, and chanview-tabs stand in the way -->
<OwnFlags>GDK_PIXBUF_DISABLE_DEPRECATED;G_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES;HAVE_STRTOULL;strtoull=_strtoui64;strcasecmp=stricmp;strncasecmp=strnicmp;__inline__=__inline</OwnFlags>
<DepsRoot>$(YourDepsPath)\$(PlatformName)</DepsRoot>
<GendefPath>$(YourGendefPath)</GendefPath>
@@ -100,6 +101,7 @@ xcopy /q /s /i "$(DepsRoot)\share\locale" "$(HexChatRel)\share\locale"
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
<AdditionalOptions>/d2Zi+ %(AdditionalOptions)</AdditionalOptions>
<!-- UNCOMMENT ONLY ONE -->
<!--Optimization>Disabled</Optimization-->
<Optimization>MaxSpeed</Optimization>
+3 -7
View File
@@ -1,6 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2012 for Windows Desktop
# Visual Studio 2013
VisualStudioVersion = 12.0.20827.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "..\src\common\common.vcxproj", "{87554B59-006C-4D94-9714-897B27067BA3}"
ProjectSection(ProjectDependencies) = postProject
{A7D7CE59-2A31-48AE-BED2-A9828E241832} = {A7D7CE59-2A31-48AE-BED2-A9828E241832}
@@ -50,8 +52,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winamp", "..\plugins\winamp
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sysinfo", "..\plugins\sysinfo\sysinfo.vcxproj", "{6C0CA980-97C5-427A-BE61-5BCECAFABBDA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hextray", "..\plugins\hextray\hextray.vcxproj", "{3024CF36-85E5-4E00-9608-7002E2C7EF14}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "release", "release", "{0FD996A7-464F-4981-8380-3DCA3A244A13}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nls", "nls\nls.vcxproj", "{B10A2C41-344C-43E0-A32D-B9587C198D8B}"
@@ -61,7 +61,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "copy", "copy\copy.vcxproj",
{C2321A03-0BA7-45B3-8740-ABD82B36B0BF} = {C2321A03-0BA7-45B3-8740-ABD82B36B0BF}
{19C52A0A-A790-409E-A28A-9745FF990F5C} = {19C52A0A-A790-409E-A28A-9745FF990F5C}
{4980AF24-9D42-427D-A8E6-0DF3B97C455D} = {4980AF24-9D42-427D-A8E6-0DF3B97C455D}
{3024CF36-85E5-4E00-9608-7002E2C7EF14} = {3024CF36-85E5-4E00-9608-7002E2C7EF14}
{17E4BE39-76F7-4A06-AD21-EFD0C5091F76} = {17E4BE39-76F7-4A06-AD21-EFD0C5091F76}
{B10A2C41-344C-43E0-A32D-B9587C198D8B} = {B10A2C41-344C-43E0-A32D-B9587C198D8B}
{461DC24A-A410-4171-8C02-CCDBF3702C2A} = {461DC24A-A410-4171-8C02-CCDBF3702C2A}
@@ -156,8 +155,6 @@ Global
{6C0CA980-97C5-427A-BE61-5BCECAFABBDA}.Release|Win32.Build.0 = Release|Win32
{6C0CA980-97C5-427A-BE61-5BCECAFABBDA}.Release|x64.ActiveCfg = Release|x64
{6C0CA980-97C5-427A-BE61-5BCECAFABBDA}.Release|x64.Build.0 = Release|x64
{3024CF36-85E5-4E00-9608-7002E2C7EF14}.Release|Win32.ActiveCfg = Release|Win32
{3024CF36-85E5-4E00-9608-7002E2C7EF14}.Release|x64.ActiveCfg = Release|x64
{B10A2C41-344C-43E0-A32D-B9587C198D8B}.Release|Win32.ActiveCfg = Release|Win32
{B10A2C41-344C-43E0-A32D-B9587C198D8B}.Release|Win32.Build.0 = Release|Win32
{B10A2C41-344C-43E0-A32D-B9587C198D8B}.Release|x64.ActiveCfg = Release|x64
@@ -207,7 +204,6 @@ Global
{461DC24A-A410-4171-8C02-CCDBF3702C2A} = {561126F4-FA18-45FC-A2BF-8F858F161D6D}
{E78C0D9A-798E-4BF6-B0CC-6FECB8CA2FCE} = {561126F4-FA18-45FC-A2BF-8F858F161D6D}
{6C0CA980-97C5-427A-BE61-5BCECAFABBDA} = {561126F4-FA18-45FC-A2BF-8F858F161D6D}
{3024CF36-85E5-4E00-9608-7002E2C7EF14} = {561126F4-FA18-45FC-A2BF-8F858F161D6D}
{19C52A0A-A790-409E-A28A-9745FF990F5C} = {D237DA6B-BD5F-46C0-8BEA-50E9A1340240}
{D90BC3E3-1341-4849-9354-5F40489D39D1} = {D237DA6B-BD5F-46C0-8BEA-50E9A1340240}
{C2321A03-0BA7-45B3-8740-ABD82B36B0BF} = {D237DA6B-BD5F-46C0-8BEA-50E9A1340240}
+1 -1
View File
@@ -71,7 +71,7 @@ Root: HKCR; Subkey: ".hct\shell\open\command"; ValueType: string; ValueName: "";
[Run]
Filename: "{app}\hexchat.exe"; Description: "Run HexChat after closing the Wizard"; Flags: nowait postinstall skipifsilent
Filename: "http://www.microsoft.com/en-us/download/details.aspx?id=30679"; Description: "Download Visual C++ 2012 Redistributable"; Flags: shellexec runasoriginaluser postinstall skipifsilent
Filename: "https://www.microsoft.com/en-us/download/details.aspx?id=39315"; Description: "Download Visual C++ 2013 Redistributable"; Flags: shellexec runasoriginaluser postinstall skipifsilent
Filename: "http://docs.hexchat.org/en/latest/changelog.html"; Description: "See what's changed"; Flags: shellexec runasoriginaluser postinstall skipifsilent unchecked
Filename: "http://hexchat.org/downloads.html"; Description: "Download Perl"; Flags: shellexec runasoriginaluser postinstall skipifsilent unchecked; Components: langs\perl and not langs\python
Filename: "http://hexchat.org/downloads.html"; Description: "Download Python"; Flags: shellexec runasoriginaluser postinstall skipifsilent unchecked; Components: langs\python and not langs\perl
+1 -1
View File
@@ -70,7 +70,7 @@ Root: HKCR; Subkey: ".hct\shell\open\command"; ValueType: string; ValueName: "";
[Run]
Filename: "{app}\hexchat.exe"; Description: "Run HexChat after closing the Wizard"; Flags: nowait postinstall skipifsilent
Filename: "http://www.microsoft.com/en-us/download/details.aspx?id=30679"; Description: "Download Visual C++ 2012 Redistributable"; Flags: shellexec runasoriginaluser postinstall skipifsilent
Filename: "https://www.microsoft.com/en-us/download/details.aspx?id=39315"; Description: "Download Visual C++ 2013 Redistributable"; Flags: shellexec runasoriginaluser postinstall skipifsilent
Filename: "http://docs.hexchat.org/en/latest/changelog.html"; Description: "See what's changed"; Flags: shellexec runasoriginaluser postinstall skipifsilent unchecked
Filename: "http://hexchat.org/downloads.html"; Description: "Download Perl"; Flags: shellexec runasoriginaluser postinstall skipifsilent unchecked; Components: langs\perl and not langs\python
Filename: "http://hexchat.org/downloads.html"; Description: "Download Python"; Flags: shellexec runasoriginaluser postinstall skipifsilent unchecked; Components: langs\python and not langs\perl
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">