| 34 |
34 |
| 35 #include "resource.h" |
35 #include "resource.h" |
| 36 #include "MinimizeToTray.h" |
36 #include "MinimizeToTray.h" |
| 37 #include "gtkwin32dep.h" |
37 #include "gtkwin32dep.h" |
| 38 #include "gtkdocklet.h" |
38 #include "gtkdocklet.h" |
| 39 #include "pidginstock.h" |
39 #include "pidginicon.h" |
| 40 |
40 |
| 41 /* |
41 /* |
| 42 * DEFINES, MACROS & DATA TYPES |
42 * DEFINES, MACROS & DATA TYPES |
| 43 */ |
43 */ |
| 44 #define WM_TRAYMESSAGE WM_USER /* User defined WM Message */ |
44 #define WM_TRAYMESSAGE WM_USER /* User defined WM Message */ |
| 516 g_return_if_fail(icon_index < (sizeof(cached_icons) / sizeof(HICON))); |
516 g_return_if_fail(icon_index < (sizeof(cached_icons) / sizeof(HICON))); |
| 517 |
517 |
| 518 /* Look up and cache the HICON if we don't already have it */ |
518 /* Look up and cache the HICON if we don't already have it */ |
| 519 if (cached_icons[icon_index] == NULL) { |
519 if (cached_icons[icon_index] == NULL) { |
| 520 const gchar *icon_name = NULL; |
520 const gchar *icon_name = NULL; |
| 521 switch (status) { |
521 |
| 522 case PURPLE_STATUS_OFFLINE: |
522 icon_name = pidgin_status_icon_from_primitive(status); |
| 523 icon_name = PIDGIN_STOCK_TRAY_OFFLINE; |
|
| 524 break; |
|
| 525 case PURPLE_STATUS_AWAY: |
|
| 526 icon_name = PIDGIN_STOCK_TRAY_AWAY; |
|
| 527 break; |
|
| 528 case PURPLE_STATUS_UNAVAILABLE: |
|
| 529 icon_name = PIDGIN_STOCK_TRAY_BUSY; |
|
| 530 break; |
|
| 531 case PURPLE_STATUS_EXTENDED_AWAY: |
|
| 532 icon_name = PIDGIN_STOCK_TRAY_XA; |
|
| 533 break; |
|
| 534 case PURPLE_STATUS_INVISIBLE: |
|
| 535 icon_name = PIDGIN_STOCK_TRAY_INVISIBLE; |
|
| 536 break; |
|
| 537 default: |
|
| 538 icon_name = PIDGIN_STOCK_TRAY_AVAILABLE; |
|
| 539 break; |
|
| 540 } |
|
| 541 |
523 |
| 542 if (flags & PIDGIN_DOCKLET_EMAIL_PENDING) |
524 if (flags & PIDGIN_DOCKLET_EMAIL_PENDING) |
| 543 icon_name = PIDGDIN_STOCK_TRAY_EMAIL; |
525 icon_name = PIDGDIN_ICON_MAIL_NEW; |
| 544 else if (flags & PIDGIN_DOCKLET_CONV_PENDING) |
526 else if (flags & PIDGIN_DOCKLET_CONV_PENDING) |
| 545 icon_name = PIDGIN_STOCK_TRAY_PENDING; |
527 icon_name = PIDGIN_ICON_MESSAGE_NEW; |
| 546 else if (flags & PIDGIN_DOCKLET_CONNECTING) |
528 else if (flags & PIDGIN_DOCKLET_CONNECTING) |
| 547 icon_name = PIDGIN_STOCK_TRAY_CONNECT; |
529 icon_name = PIDGIN_ICON_CONNECT; |
| 548 |
530 |
| 549 g_return_if_fail(icon_name != NULL); |
531 g_return_if_fail(icon_name != NULL); |
| 550 |
532 |
| 551 cached_icons[icon_index] = load_hicon_from_stock(icon_name); |
533 cached_icons[icon_index] = load_hicon_from_stock(icon_name); |
| 552 } |
534 } |