Mercurial > pidgin
annotate src/win32/systray.c @ 4661:ccc304cb0389
[gaim-migrate @ 4972]
I feel like one of them email spammers.
So as not to completely waste a few KB of bandwidth, let me
ask you a question: Who do you think is cooler, Bono or Sting?
I definately think Sting is cooler. I mean, Bono is pretty
cool and all, but Sting just has that whole "I'm pretty old"
thing going on.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Fri, 07 Mar 2003 06:00:37 +0000 |
parents | f5e7949668a5 |
children | 362490c75f74 |
rev | line source |
---|---|
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
1 /* |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
2 * systray.c |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
3 * |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
4 * Author: Herman Bloggs <hermanator12002@yahoo.com> |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
5 * Date: November, 2002 |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
6 * Description: Gaim systray functionality |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
7 */ |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
8 #include <windows.h> |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
9 #include <gdk/gdkwin32.h> |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
10 #include "resource.h" |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
11 #include "gaim.h" |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
12 #include "win32dep.h" |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
13 #include "MinimizeToTray.h" |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
14 #include "ui.h" |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
15 |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
16 /* |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
17 * DEFINES, MACROS & DATA TYPES |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
18 */ |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
19 #define GAIM_SYSTRAY_HINT _("Gaim Instant Messenger") |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
20 #define GAIM_SYSTRAY_DISCONN_HINT _("Gaim Instant Messenger - Signed off") |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
21 #define GAIM_SYSTRAY_AWAY_HINT _("Gaim Instant Messenger - Away") |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
22 #define WM_TRAYMESSAGE WM_USER /* User defined WM Message */ |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
23 #define MAX_AWY_MESSAGES 50 |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
24 |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
25 enum _SYSTRAY_STATE { |
4500
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
26 SYSTRAY_STATE_ONLINE, |
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
27 SYSTRAY_STATE_ONLINE_CONNECTING, |
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
28 SYSTRAY_STATE_OFFLINE, |
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
29 SYSTRAY_STATE_OFFLINE_CONNECTING, |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
30 SYSTRAY_STATE_AWAY, |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
31 SYSTRAY_STATE_COUNT |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
32 }; |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
33 typedef enum _SYSTRAY_STATE SYSTRAY_STATE; |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
34 |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
35 enum _SYSTRAY_CMND { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
36 SYSTRAY_CMND_MENU_EXIT, |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
37 SYSTRAY_CMND_SIGNON, |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
38 SYSTRAY_CMND_SIGNOFF, |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
39 SYSTRAY_CMND_AUTOLOGIN, |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
40 SYSTRAY_CMND_PREFS, |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
41 SYSTRAY_CMND_BACK, |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
42 SYSTRAY_CMND_SET_AWY_NEW, |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
43 SYSTRAY_CMND_SET_AWY, |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
44 SYSTRAY_CMND_SET_AWY_LAST=SYSTRAY_CMND_SET_AWY+MAX_AWY_MESSAGES |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
45 }; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
46 typedef enum _SYSTRAY_CMND SYSTRAY_CMND; |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
47 |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
48 /* |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
49 * LOCALS |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
50 */ |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
51 static HWND systray_hwnd=0; |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
52 static HICON sysicon_disconn=0; |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
53 static HICON sysicon_conn=0; |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
54 static HICON sysicon_away=0; |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
55 static NOTIFYICONDATA wgaim_nid; |
4500
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
56 static SYSTRAY_STATE st_state=SYSTRAY_STATE_OFFLINE; |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
57 static HMENU systray_menu=0; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
58 static HMENU systray_away_menu=0; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
59 |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
60 /* |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
61 * GLOBALS |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
62 */ |
3972
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
63 extern GtkWidget *imaway; |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
64 |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
65 /* |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
66 * PRIVATE CODE |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
67 */ |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
68 |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
69 /* |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
70 * SYSTRAY HELPERS |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
71 ********************/ |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
72 |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
73 /* Returns 1 if menu item exists, 0 if not */ |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
74 static int IsMenuItem( HMENU hMenu, UINT id ) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
75 if(0xFFFFFFFF == GetMenuState(hMenu, id, MF_BYCOMMAND)) |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
76 return 0; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
77 else |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
78 return 1; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
79 } |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
80 |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
81 /* |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
82 * WGAIM SYSTRAY GUI |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
83 ********************/ |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
84 |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
85 static HMENU systray_create_awy_menu(void) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
86 int item_count = SYSTRAY_CMND_SET_AWY; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
87 struct away_message *a = NULL; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
88 GSList *awy = away_messages; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
89 |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
90 /* Delete previous away submenu */ |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
91 if(systray_away_menu) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
92 DestroyMenu(systray_away_menu); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
93 systray_away_menu = 0; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
94 } |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
95 systray_away_menu = CreatePopupMenu(); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
96 while (awy && (item_count <= SYSTRAY_CMND_SET_AWY+MAX_AWY_MESSAGES)) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
97 a = (struct away_message *)awy->data; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
98 AppendMenu(systray_away_menu, MF_STRING, item_count, a->name); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
99 awy = g_slist_next(awy); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
100 item_count+=1; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
101 } |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
102 AppendMenu(systray_away_menu, MF_SEPARATOR, 0, 0); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
103 AppendMenu(systray_away_menu, MF_STRING, SYSTRAY_CMND_SET_AWY_NEW, _("New")); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
104 return systray_away_menu; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
105 } |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
106 |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
107 static void systray_show_menu(int x, int y, BOOL connected) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
108 /* need to call this so that the menu disappears if clicking outside |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
109 of the menu scope */ |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
110 SetForegroundWindow(systray_hwnd); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
111 |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
112 /* Different menus depending on signed on/off state */ |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
113 if(connected) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
114 /* If signoff item dosn't exist.. create it */ |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
115 if(!IsMenuItem(systray_menu, SYSTRAY_CMND_SIGNOFF)) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
116 DeleteMenu(systray_menu, SYSTRAY_CMND_SIGNON, MF_BYCOMMAND); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
117 InsertMenu(systray_menu, SYSTRAY_CMND_MENU_EXIT, |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
118 MF_BYCOMMAND | MF_STRING, SYSTRAY_CMND_SIGNOFF, _("Signoff")); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
119 } |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
120 /* if away menu exists, remove and rebuild it */ |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
121 if(systray_away_menu) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
122 if(!DeleteMenu(systray_menu, (UINT)systray_away_menu, MF_BYCOMMAND)) |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
123 debug_printf("Error using DeleteMenu\n"); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
124 } |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
125 InsertMenu(systray_menu, SYSTRAY_CMND_PREFS, |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
126 MF_BYCOMMAND | MF_POPUP | MF_STRING, (UINT)systray_create_awy_menu(), |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
127 _("Set Away Message")); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
128 EnableMenuItem(systray_menu, SYSTRAY_CMND_AUTOLOGIN, MF_GRAYED); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
129 /* If away, put "I'm Back" option in menu */ |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
130 if(st_state == SYSTRAY_STATE_AWAY) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
131 if(!IsMenuItem(systray_menu, SYSTRAY_CMND_BACK)) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
132 InsertMenu(systray_menu, (UINT)systray_away_menu, |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
133 MF_BYCOMMAND | MF_STRING, SYSTRAY_CMND_BACK, |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
134 _("I'm Back")); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
135 } |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
136 } else { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
137 /* Delete I'm Back item if it exists */ |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
138 DeleteMenu(systray_menu, SYSTRAY_CMND_BACK, MF_BYCOMMAND); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
139 } |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
140 } else { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
141 /* If signon item dosn't exist.. create it */ |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
142 if(!IsMenuItem(systray_menu, SYSTRAY_CMND_SIGNON)) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
143 DeleteMenu(systray_menu, SYSTRAY_CMND_SIGNOFF, MF_BYCOMMAND); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
144 InsertMenu(systray_menu, SYSTRAY_CMND_MENU_EXIT, |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
145 MF_BYCOMMAND | MF_STRING, SYSTRAY_CMND_SIGNON, _("Sign On")); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
146 } |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
147 EnableMenuItem(systray_menu, SYSTRAY_CMND_AUTOLOGIN, MF_ENABLED); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
148 EnableMenuItem(systray_menu, (UINT)systray_away_menu, MF_GRAYED); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
149 /* Delete I'm Back item if it exists */ |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
150 DeleteMenu(systray_menu, SYSTRAY_CMND_BACK, MF_BYCOMMAND); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
151 } |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
152 |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
153 TrackPopupMenu(systray_menu, // handle to shortcut menu |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
154 TPM_RIGHTALIGN | TPM_BOTTOMALIGN | TPM_LEFTBUTTON, |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
155 x, // horizontal position, in screen coordinates |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
156 y, // vertical position, in screen coordinates |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
157 0, // reserved, must be zero |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
158 systray_hwnd, // handle to owner window |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
159 NULL // ignored |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
160 ); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
161 } |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
162 |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
163 /* Set nth away message from away_messages list */ |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
164 static void systray_set_away(int nth) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
165 int item_count = 0; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
166 GSList *awy = away_messages; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
167 struct away_message *a = NULL; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
168 |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
169 while (awy && (item_count != nth)) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
170 awy = g_slist_next(awy); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
171 item_count+=1; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
172 } |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
173 if(awy) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
174 a = (struct away_message *)awy->data; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
175 do_away_message(NULL, a); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
176 } |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
177 } |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
178 |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
179 static LRESULT CALLBACK systray_mainmsg_handler(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
180 |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
181 switch(msg) { |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
182 case WM_CREATE: |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
183 debug_printf("WM_CREATE\n"); |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
184 break; |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
185 |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
186 case WM_TIMER: |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
187 debug_printf("WM_TIMER\n"); |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
188 break; |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
189 |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
190 case WM_DESTROY: |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
191 debug_printf("WM_DESTROY\n"); |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
192 break; |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
193 |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
194 case WM_COMMAND: |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
195 debug_printf("WM_COMMAND\n"); |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
196 switch(LOWORD(wparam)) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
197 case SYSTRAY_CMND_MENU_EXIT: |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
198 do_quit(); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
199 break; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
200 case SYSTRAY_CMND_SIGNON: |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
201 debug_printf("signon\n"); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
202 show_login(); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
203 break; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
204 case SYSTRAY_CMND_SIGNOFF: |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
205 debug_printf("signoff\n"); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
206 signoff_all(); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
207 break; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
208 case SYSTRAY_CMND_AUTOLOGIN: |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
209 debug_printf("autologin\n"); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
210 auto_login(); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
211 break; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
212 case SYSTRAY_CMND_PREFS: |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
213 debug_printf("Prefs\n"); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
214 show_prefs(); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
215 break; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
216 case SYSTRAY_CMND_BACK: |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
217 debug_printf("I'm back\n"); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
218 do_im_back(NULL, NULL); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
219 break; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
220 case SYSTRAY_CMND_SET_AWY_NEW: |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
221 debug_printf("New away item\n"); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
222 create_away_mess(NULL, NULL); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
223 break; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
224 default: |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
225 /* SYSTRAY_CMND_SET_AWY */ |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
226 if((LOWORD(wparam) >= SYSTRAY_CMND_SET_AWY) && |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
227 (LOWORD(wparam) <= (SYSTRAY_CMND_SET_AWY + MAX_AWY_MESSAGES))) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
228 debug_printf("Set away message\n"); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
229 systray_set_away(LOWORD(wparam)-SYSTRAY_CMND_SET_AWY); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
230 } |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
231 } |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
232 break; |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
233 case WM_TRAYMESSAGE: |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
234 { |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
235 if( lparam == WM_LBUTTONDBLCLK ) { |
4500
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
236 /* Double Click */ |
3972
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
237 /* Either hide or show current window (login or buddy) */ |
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
238 docklet_toggle(); |
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
239 /* if away.. hide/show I'm back win too */ |
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
240 if(st_state == SYSTRAY_STATE_AWAY) { |
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
241 if(GTK_WIDGET_VISIBLE(blist) && !GTK_WIDGET_VISIBLE(imaway)) { |
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
242 RestoreWndFromTray(GDK_WINDOW_HWND(GTK_WIDGET(imaway)->window)); |
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
243 gtk_window_present(GTK_WINDOW(imaway)); |
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
244 } else if(!GTK_WIDGET_VISIBLE(blist) && GTK_WIDGET_VISIBLE(imaway)) { |
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
245 wgaim_systray_minimize(imaway); |
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
246 gtk_widget_hide(imaway); |
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
247 } |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
248 } |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
249 debug_printf("Systray got double click\n"); |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
250 } |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
251 if( lparam == WM_RBUTTONUP ) { |
4500
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
252 /* Right Click */ |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
253 POINT mpoint; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
254 GetCursorPos(&mpoint); |
4500
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
255 |
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
256 switch(st_state) { |
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
257 case SYSTRAY_STATE_OFFLINE: |
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
258 case SYSTRAY_STATE_OFFLINE_CONNECTING: |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
259 systray_show_menu(mpoint.x, mpoint.y, 0); |
4500
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
260 break; |
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
261 default: |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
262 systray_show_menu(mpoint.x, mpoint.y, 1); |
4500
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
263 } |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
264 } |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
265 break; |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
266 } |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
267 default: |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
268 }/* end switch */ |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
269 |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
270 return DefWindowProc(hwnd, msg, wparam, lparam); |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
271 } |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
272 |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
273 /* Create hidden window to process systray messages */ |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
274 static HWND systray_create_hiddenwin() { |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
275 WNDCLASSEX wcex; |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
276 TCHAR wname[32]; |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
277 |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
278 strcpy(wname, "GaimWin"); |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
279 |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
280 wcex.cbSize = sizeof(WNDCLASSEX); |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
281 |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
282 wcex.style = 0; |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
283 wcex.lpfnWndProc = (WNDPROC)systray_mainmsg_handler; |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
284 wcex.cbClsExtra = 0; |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
285 wcex.cbWndExtra = 0; |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
286 wcex.hInstance = wgaim_hinstance(); |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
287 wcex.hIcon = NULL; |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
288 wcex.hCursor = NULL, |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
289 wcex.hbrBackground = NULL; |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
290 wcex.lpszMenuName = NULL; |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
291 wcex.lpszClassName = wname; |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
292 wcex.hIconSm = NULL; |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
293 |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
294 RegisterClassEx(&wcex); |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
295 |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
296 // Create the window |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
297 return (CreateWindow(wname, "", 0, 0, 0, 0, 0, GetDesktopWindow(), NULL, wgaim_hinstance(), 0)); |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
298 } |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
299 |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
300 static void systray_create_menu(void) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
301 /* create popup menu */ |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
302 if((systray_menu = CreatePopupMenu())) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
303 if(!AppendMenu(systray_menu, MF_STRING, SYSTRAY_CMND_PREFS, _("Preferences"))) |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
304 debug_printf("AppendMenu error: %d\n", GetLastError()); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
305 if(!AppendMenu(systray_menu, MF_STRING, SYSTRAY_CMND_AUTOLOGIN, _("Auto-login"))) |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
306 debug_printf("AppendMenu error: %d\n", GetLastError()); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
307 if(!AppendMenu(systray_menu, MF_SEPARATOR, 0, 0)) |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
308 debug_printf("AppendMenu error: %d\n", GetLastError()); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
309 if(!AppendMenu(systray_menu, MF_STRING, SYSTRAY_CMND_MENU_EXIT, _("Exit"))) |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
310 debug_printf("AppendMenu error: %d\n", GetLastError()); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
311 } else |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
312 debug_printf("CreatePopupMenu error: %d\n", GetLastError()); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
313 } |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
314 |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
315 static void systray_init_icon(HWND hWnd, HICON icon) { |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
316 ZeroMemory(&wgaim_nid,sizeof(wgaim_nid)); |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
317 wgaim_nid.cbSize=sizeof(NOTIFYICONDATA); |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
318 wgaim_nid.hWnd=hWnd; |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
319 wgaim_nid.uID=0; |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
320 wgaim_nid.uFlags=NIF_ICON | NIF_MESSAGE | NIF_TIP; |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
321 wgaim_nid.uCallbackMessage=WM_TRAYMESSAGE; |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
322 wgaim_nid.hIcon=icon; |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
323 strcpy(wgaim_nid.szTip,GAIM_SYSTRAY_DISCONN_HINT); |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
324 |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
325 Shell_NotifyIcon(NIM_ADD,&wgaim_nid); |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
326 } |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
327 |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
328 static void systray_change_icon(HICON icon, char* text) { |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
329 wgaim_nid.hIcon = icon; |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
330 lstrcpy(wgaim_nid.szTip, text); |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
331 Shell_NotifyIcon(NIM_MODIFY,&wgaim_nid); |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
332 } |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
333 |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
334 static void systray_remove_nid(void) { |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
335 Shell_NotifyIcon(NIM_DELETE,&wgaim_nid); |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
336 } |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
337 |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
338 static void systray_update_icon() { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
339 switch(st_state) { |
4500
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
340 case SYSTRAY_STATE_ONLINE: |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
341 systray_change_icon(sysicon_conn, GAIM_SYSTRAY_HINT); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
342 break; |
4500
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
343 case SYSTRAY_STATE_ONLINE_CONNECTING: |
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
344 case SYSTRAY_STATE_OFFLINE_CONNECTING: |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
345 break; |
4500
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
346 case SYSTRAY_STATE_OFFLINE: |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
347 systray_change_icon(sysicon_disconn, GAIM_SYSTRAY_DISCONN_HINT); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
348 break; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
349 case SYSTRAY_STATE_AWAY: |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
350 systray_change_icon(sysicon_away, GAIM_SYSTRAY_AWAY_HINT); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
351 break; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
352 } |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
353 } |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
354 |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
355 static void systray_update_status() { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
356 SYSTRAY_STATE old_state = st_state; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
357 |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
358 if(connections) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
359 if(awaymessage) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
360 st_state = SYSTRAY_STATE_AWAY; |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
361 } else if(connecting_count) { |
4500
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
362 st_state = SYSTRAY_STATE_ONLINE_CONNECTING; |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
363 } else { |
4500
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
364 st_state = SYSTRAY_STATE_ONLINE; |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
365 } |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
366 } else { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
367 if(connecting_count) { |
4500
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
368 /* Don't rely on this state.. signoff in multi.c sends |
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
369 event_signoff before decrementing connecting_count |
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
370 for a reason unknown to me.. |
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
371 */ |
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
372 st_state = SYSTRAY_STATE_OFFLINE_CONNECTING; |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
373 } else { |
4500
f5e7949668a5
[gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4106
diff
changeset
|
374 st_state = SYSTRAY_STATE_OFFLINE; |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
375 } |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
376 } |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
377 if(st_state != old_state) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
378 systray_update_icon(); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
379 } |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
380 } |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
381 |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
382 /* |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
383 * GAIM EVENT CALLBACKS |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
384 ***********************/ |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
385 |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
386 static void st_signon(struct gaim_connection *gc, void *data) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
387 systray_update_status(); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
388 } |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
389 |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
390 static void st_signoff(struct gaim_connection *gc, void *data) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
391 systray_update_status(); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
392 } |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
393 |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
394 static void st_away(struct gaim_connection *gc, void *data) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
395 systray_update_status(); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
396 } |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
397 |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
398 static void st_back(struct gaim_connection *gc, void *data) { |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
399 systray_update_status(); |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
400 } |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
401 |
3972
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
402 static void st_im_recieve(struct gaim_connection *gc, void *data) { |
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
403 |
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
404 } |
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
405 |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
406 /* |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
407 * PUBLIC CODE |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
408 */ |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
409 |
4106
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
410 /* |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
411 * GAIM WINDOW FILTERS |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
412 **********************/ |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
413 |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
414 GdkFilterReturn st_buddywin_filter( GdkXEvent *xevent, GdkEvent *event, gpointer data) { |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
415 |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
416 MSG *msg = (MSG*)xevent; |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
417 |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
418 switch( msg->message ) { |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
419 case WM_SYSCOMMAND: |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
420 if( msg->wParam == SC_MINIMIZE ) { |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
421 hide_buddy_list(); |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
422 return GDK_FILTER_REMOVE; |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
423 } |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
424 break; |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
425 case WM_CLOSE: |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
426 hide_buddy_list(); |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
427 return GDK_FILTER_REMOVE; |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
428 } |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
429 |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
430 return GDK_FILTER_CONTINUE; |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
431 } |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
432 |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
433 GdkFilterReturn st_loginwin_filter( GdkXEvent *xevent, GdkEvent *event, gpointer data) { |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
434 MSG *msg = (MSG*)xevent; |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
435 |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
436 switch( msg->message ) { |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
437 case WM_CLOSE: |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
438 wgaim_systray_minimize(mainwindow); |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
439 gtk_widget_hide(mainwindow); |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
440 return GDK_FILTER_REMOVE; |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
441 } |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
442 |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
443 return GDK_FILTER_CONTINUE; |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
444 } |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
445 |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
446 GdkFilterReturn st_backwin_filter( GdkXEvent *xevent, GdkEvent *event, gpointer data) { |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
447 MSG *msg = (MSG*)xevent; |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
448 |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
449 switch( msg->message ) { |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
450 case WM_SYSCOMMAND: |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
451 if( msg->wParam == SC_MINIMIZE ) { |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
452 if(imaway) { |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
453 wgaim_systray_minimize(imaway); |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
454 gtk_widget_hide(imaway); |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
455 } |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
456 return GDK_FILTER_REMOVE; |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
457 } |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
458 break; |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
459 } |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
460 return GDK_FILTER_CONTINUE; |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
461 } |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
462 |
a843ce9d77ea
[gaim-migrate @ 4321]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4101
diff
changeset
|
463 |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
464 /* Create a hidden window and associate it with the systray icon. |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
465 We use this hidden window to proccess WM_TRAYMESSAGE msgs. */ |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
466 void wgaim_systray_init(void) { |
3972
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
467 docklet_add(); |
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
468 |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
469 /* dummy window to process systray messages */ |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
470 systray_hwnd = systray_create_hiddenwin(); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
471 |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
472 systray_create_menu(); |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
473 |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
474 /* Load icons, and init systray notify icon */ |
4101
003e0a02d6b9
[gaim-migrate @ 4316]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4087
diff
changeset
|
475 sysicon_disconn = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_OFFLINE_TRAY_ICON), IMAGE_ICON, 16, 16, 0); |
003e0a02d6b9
[gaim-migrate @ 4316]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4087
diff
changeset
|
476 sysicon_conn = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_TRAY_ICON), IMAGE_ICON, 16, 16, 0); |
003e0a02d6b9
[gaim-migrate @ 4316]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4087
diff
changeset
|
477 sysicon_away = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_AWAY_TRAY_ICON), IMAGE_ICON, 16, 16, 0); |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
478 |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
479 /* Create icon in systray */ |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
480 systray_init_icon(systray_hwnd, sysicon_disconn); |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
481 |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
482 /* Register Gaim event callbacks */ |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
483 gaim_signal_connect(NULL, event_signon, st_signon, NULL); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
484 gaim_signal_connect(NULL, event_signoff, st_signoff, NULL); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
485 gaim_signal_connect(NULL, event_away, st_away, NULL); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
486 gaim_signal_connect(NULL, event_back, st_back, NULL); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
487 /*gaim_signal_connect(NULL, event_connecting, wgaim_st_connecting, NULL); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
488 gaim_signal_connect(NULL, event_im_displayed_rcvd, wgaim_st_im_displayed_recv, NULL);*/ |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
489 } |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
490 |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
491 void wgaim_systray_cleanup(void) { |
3972
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
492 docklet_remove(); |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
493 systray_remove_nid(); |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
494 DestroyMenu(systray_menu); |
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
495 DestroyWindow(systray_hwnd); |
3946
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
496 } |
8ef1360becfe
[gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
497 |
3972
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
498 void wgaim_systray_minimize( GtkWidget *window ) { |
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
499 MinimizeWndToTray(GDK_WINDOW_HWND(window->window)); |
3959
9c2d8579ff3e
[gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3946
diff
changeset
|
500 } |
3972
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
501 |
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
502 void wgaim_systray_maximize( GtkWidget *window ) { |
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
503 RestoreWndFromTray(GDK_WINDOW_HWND(window->window)); |
f9e961773058
[gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3959
diff
changeset
|
504 } |