Mercurial > pidgin.yaz
comparison src/win32/systray.c @ 4106:a843ce9d77ea
[gaim-migrate @ 4321]
code re-org
committer: Tailor Script <tailor@pidgin.im>
author | Herman Bloggs <hermanator12002@yahoo.com> |
---|---|
date | Fri, 20 Dec 2002 18:10:17 +0000 |
parents | 003e0a02d6b9 |
children | f5e7949668a5 |
comparison
equal
deleted
inserted
replaced
4105:e92d7712b8ba | 4106:a843ce9d77ea |
---|---|
368 systray_update_icon(); | 368 systray_update_icon(); |
369 } | 369 } |
370 } | 370 } |
371 | 371 |
372 /* | 372 /* |
373 * GAIM EVENT CALLBACKS | |
374 ***********************/ | |
375 | |
376 static void st_signon(struct gaim_connection *gc, void *data) { | |
377 systray_update_status(); | |
378 } | |
379 | |
380 static void st_signoff(struct gaim_connection *gc, void *data) { | |
381 systray_update_status(); | |
382 } | |
383 | |
384 static void st_away(struct gaim_connection *gc, void *data) { | |
385 systray_update_status(); | |
386 } | |
387 | |
388 static void st_back(struct gaim_connection *gc, void *data) { | |
389 systray_update_status(); | |
390 } | |
391 | |
392 static void st_im_recieve(struct gaim_connection *gc, void *data) { | |
393 | |
394 } | |
395 | |
396 /* | |
397 * PUBLIC CODE | |
398 */ | |
399 | |
400 /* | |
373 * GAIM WINDOW FILTERS | 401 * GAIM WINDOW FILTERS |
374 **********************/ | 402 **********************/ |
375 | 403 |
376 static GdkFilterReturn st_buddywin_filter( GdkXEvent *xevent, GdkEvent *event, gpointer data) { | 404 GdkFilterReturn st_buddywin_filter( GdkXEvent *xevent, GdkEvent *event, gpointer data) { |
377 | 405 |
378 MSG *msg = (MSG*)xevent; | 406 MSG *msg = (MSG*)xevent; |
379 | 407 |
380 switch( msg->message ) { | 408 switch( msg->message ) { |
381 case WM_SYSCOMMAND: | 409 case WM_SYSCOMMAND: |
390 } | 418 } |
391 | 419 |
392 return GDK_FILTER_CONTINUE; | 420 return GDK_FILTER_CONTINUE; |
393 } | 421 } |
394 | 422 |
395 static GdkFilterReturn st_loginwin_filter( GdkXEvent *xevent, GdkEvent *event, gpointer data) { | 423 GdkFilterReturn st_loginwin_filter( GdkXEvent *xevent, GdkEvent *event, gpointer data) { |
396 MSG *msg = (MSG*)xevent; | 424 MSG *msg = (MSG*)xevent; |
397 | 425 |
398 switch( msg->message ) { | 426 switch( msg->message ) { |
399 case WM_CLOSE: | 427 case WM_CLOSE: |
400 wgaim_systray_minimize(mainwindow); | 428 wgaim_systray_minimize(mainwindow); |
403 } | 431 } |
404 | 432 |
405 return GDK_FILTER_CONTINUE; | 433 return GDK_FILTER_CONTINUE; |
406 } | 434 } |
407 | 435 |
408 static GdkFilterReturn st_backwin_filter( GdkXEvent *xevent, GdkEvent *event, gpointer data) { | 436 GdkFilterReturn st_backwin_filter( GdkXEvent *xevent, GdkEvent *event, gpointer data) { |
409 MSG *msg = (MSG*)xevent; | 437 MSG *msg = (MSG*)xevent; |
410 | 438 |
411 switch( msg->message ) { | 439 switch( msg->message ) { |
412 case WM_SYSCOMMAND: | 440 case WM_SYSCOMMAND: |
413 if( msg->wParam == SC_MINIMIZE ) { | 441 if( msg->wParam == SC_MINIMIZE ) { |
420 break; | 448 break; |
421 } | 449 } |
422 return GDK_FILTER_CONTINUE; | 450 return GDK_FILTER_CONTINUE; |
423 } | 451 } |
424 | 452 |
425 /* | |
426 * GAIM EVENT CALLBACKS | |
427 ***********************/ | |
428 | |
429 static void st_signon(struct gaim_connection *gc, void *data) { | |
430 systray_update_status(); | |
431 } | |
432 | |
433 static void st_signoff(struct gaim_connection *gc, void *data) { | |
434 systray_update_status(); | |
435 } | |
436 | |
437 static void st_away(struct gaim_connection *gc, void *data) { | |
438 systray_update_status(); | |
439 } | |
440 | |
441 static void st_back(struct gaim_connection *gc, void *data) { | |
442 systray_update_status(); | |
443 } | |
444 | |
445 static void st_im_recieve(struct gaim_connection *gc, void *data) { | |
446 | |
447 } | |
448 | |
449 /* | |
450 * PUBLIC CODE | |
451 */ | |
452 | 453 |
453 /* Create a hidden window and associate it with the systray icon. | 454 /* Create a hidden window and associate it with the systray icon. |
454 We use this hidden window to proccess WM_TRAYMESSAGE msgs. */ | 455 We use this hidden window to proccess WM_TRAYMESSAGE msgs. */ |
455 void wgaim_systray_init(void) { | 456 void wgaim_systray_init(void) { |
456 docklet_add(); | 457 docklet_add(); |
482 systray_remove_nid(); | 483 systray_remove_nid(); |
483 DestroyMenu(systray_menu); | 484 DestroyMenu(systray_menu); |
484 DestroyWindow(systray_hwnd); | 485 DestroyWindow(systray_hwnd); |
485 } | 486 } |
486 | 487 |
487 /* This function is called after the buddy list has been created */ | |
488 void wgaim_created_blistwin( GtkWidget *blist ) { | |
489 gdk_window_add_filter (GTK_WIDGET(blist)->window, | |
490 st_buddywin_filter, | |
491 NULL); | |
492 } | |
493 | |
494 /* This function is called after the login window has been created */ | |
495 void wgaim_created_loginwin( GtkWidget *loginwin ) { | |
496 gdk_window_add_filter (GTK_WIDGET(loginwin)->window, | |
497 st_loginwin_filter, | |
498 NULL); | |
499 } | |
500 | |
501 void wgaim_created_backwin( GtkWidget *backwin ) { | |
502 gdk_window_add_filter (GTK_WIDGET(backwin)->window, | |
503 st_backwin_filter, | |
504 NULL); | |
505 } | |
506 | |
507 void wgaim_systray_minimize( GtkWidget *window ) { | 488 void wgaim_systray_minimize( GtkWidget *window ) { |
508 MinimizeWndToTray(GDK_WINDOW_HWND(window->window)); | 489 MinimizeWndToTray(GDK_WINDOW_HWND(window->window)); |
509 } | 490 } |
510 | 491 |
511 void wgaim_systray_maximize( GtkWidget *window ) { | 492 void wgaim_systray_maximize( GtkWidget *window ) { |