| 73 |
73 |
| 74 /* |
74 /* |
| 75 * PROTOS |
75 * PROTOS |
| 76 */ |
76 */ |
| 77 BOOL (*MySetLayeredWindowAttributes)(HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags)=NULL; |
77 BOOL (*MySetLayeredWindowAttributes)(HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags)=NULL; |
| 78 extern GtkWidget *gaim_button(const char*, guint*, int, GtkWidget*); |
|
| 79 static void save_trans_prefs(); |
78 static void save_trans_prefs(); |
| 80 |
79 |
| 81 /* |
80 /* |
| 82 * CODE |
81 * CODE |
| 83 */ |
82 */ |
| |
83 static GtkWidget *wgaim_button(const char *text, guint *options, int option, GtkWidget *page) { |
| |
84 GtkWidget *button; |
| |
85 button = gtk_check_button_new_with_mnemonic(text); |
| |
86 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), (*options & option)); |
| |
87 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); |
| |
88 g_object_set_data(G_OBJECT(button), "options", options); |
| |
89 gtk_widget_show(button); |
| |
90 return button; |
| |
91 } |
| |
92 |
| 84 /* Set window transparency level */ |
93 /* Set window transparency level */ |
| 85 void set_wintrans(GtkWidget *window, int trans) { |
94 void set_wintrans(GtkWidget *window, int trans) { |
| 86 if(MySetLayeredWindowAttributes) { |
95 if(MySetLayeredWindowAttributes) { |
| 87 HWND hWnd = GDK_WINDOW_HWND(window->window); |
96 HWND hWnd = GDK_WINDOW_HWND(window->window); |
| 88 SetWindowLong(hWnd,GWL_EXSTYLE,GetWindowLong(hWnd,GWL_EXSTYLE) | WS_EX_LAYERED); |
97 SetWindowLong(hWnd,GWL_EXSTYLE,GetWindowLong(hWnd,GWL_EXSTYLE) | WS_EX_LAYERED); |
| 166 |
175 |
| 167 static void gaim_new_conversation(char *who) { |
176 static void gaim_new_conversation(char *who) { |
| 168 GList *wl, *wl1; |
177 GList *wl, *wl1; |
| 169 GtkWidget *vbox=NULL; |
178 GtkWidget *vbox=NULL; |
| 170 GtkWidget *win=NULL; |
179 GtkWidget *win=NULL; |
| 171 struct gaim_gtk_window *gaimwin; |
180 GaimConversation *c; |
| 172 struct gaim_conversation *c; |
181 GaimGtkConversation *gtkconv; |
| |
182 GaimGtkWindow *gtkwin; |
| 173 |
183 |
| 174 c = gaim_find_conversation(who); |
184 c = gaim_find_conversation(who); |
| 175 gaimwin = GAIM_GTK_WINDOW(c->window); |
185 gtkconv = GAIM_GTK_CONVERSATION(c); |
| 176 win = gaimwin->window; |
186 gtkwin = GAIM_GTK_WINDOW(gaim_conversation_get_window(c)); |
| |
187 |
| |
188 win = gtkwin->window; |
| 177 |
189 |
| 178 /* check prefs to see if we want trans */ |
190 /* check prefs to see if we want trans */ |
| 179 if ((trans_options & OPT_WGAIM_IMTRANS) && |
191 if ((trans_options & OPT_WGAIM_IMTRANS) && |
| 180 (trans_options & OPT_WGAIM_SHOW_IMTRANS)) { |
192 (trans_options & OPT_WGAIM_SHOW_IMTRANS)) { |
| 181 /* Look up this window to see if it already has a scroller */ |
193 /* Look up this window to see if it already has a scroller */ |
| 388 |
400 |
| 389 ret = gtk_vbox_new(FALSE, 18); |
401 ret = gtk_vbox_new(FALSE, 18); |
| 390 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); |
402 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); |
| 391 |
403 |
| 392 /* IM Convo trans options */ |
404 /* IM Convo trans options */ |
| 393 imtransbox = make_frame (ret, _("IM Conversation Windows")); |
405 imtransbox = gaim_gtk_make_frame (ret, _("IM Conversation Windows")); |
| 394 button = gaim_button(_("_IM window transparency"), &trans_options, OPT_WGAIM_IMTRANS, imtransbox); |
406 button = wgaim_button(_("_IM window transparency"), &trans_options, OPT_WGAIM_IMTRANS, imtransbox); |
| 395 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_trans_option), (int *)OPT_WGAIM_IMTRANS); |
407 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_trans_option), (int *)OPT_WGAIM_IMTRANS); |
| 396 |
408 |
| 397 trans_box = gtk_vbox_new(FALSE, 18); |
409 trans_box = gtk_vbox_new(FALSE, 18); |
| 398 if (!(trans_options & OPT_WGAIM_IMTRANS)) |
410 if (!(trans_options & OPT_WGAIM_IMTRANS)) |
| 399 gtk_widget_set_sensitive(GTK_WIDGET(trans_box), FALSE); |
411 gtk_widget_set_sensitive(GTK_WIDGET(trans_box), FALSE); |
| 400 gtk_widget_show(trans_box); |
412 gtk_widget_show(trans_box); |
| 401 |
413 |
| 402 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(gaim_gtk_toggle_sensitive), trans_box); |
414 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(gaim_gtk_toggle_sensitive), trans_box); |
| 403 |
415 |
| 404 button = gaim_button(_("_Show slider bar in IM window"), &trans_options, OPT_WGAIM_SHOW_IMTRANS, trans_box); |
416 button = wgaim_button(_("_Show slider bar in IM window"), &trans_options, OPT_WGAIM_SHOW_IMTRANS, trans_box); |
| 405 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_trans_option), (int *)OPT_WGAIM_SHOW_IMTRANS); |
417 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_trans_option), (int *)OPT_WGAIM_SHOW_IMTRANS); |
| 406 |
418 |
| 407 gtk_box_pack_start(GTK_BOX(imtransbox), trans_box, FALSE, FALSE, 5); |
419 gtk_box_pack_start(GTK_BOX(imtransbox), trans_box, FALSE, FALSE, 5); |
| 408 |
420 |
| 409 /* IM transparency slider */ |
421 /* IM transparency slider */ |
| 424 gtk_widget_show_all(hbox); |
436 gtk_widget_show_all(hbox); |
| 425 |
437 |
| 426 gtk_box_pack_start(GTK_BOX(trans_box), hbox, FALSE, FALSE, 5); |
438 gtk_box_pack_start(GTK_BOX(trans_box), hbox, FALSE, FALSE, 5); |
| 427 |
439 |
| 428 /* Buddy List trans options */ |
440 /* Buddy List trans options */ |
| 429 bltransbox = make_frame (ret, _("Buddy List Window")); |
441 bltransbox = gaim_gtk_make_frame (ret, _("Buddy List Window")); |
| 430 button = gaim_button(_("_Keep Buddy List window on top"), &trans_options, OPT_WGAIM_BUDDYWIN_ONTOP, bltransbox); |
442 button = wgaim_button(_("_Keep Buddy List window on top"), &trans_options, OPT_WGAIM_BUDDYWIN_ONTOP, bltransbox); |
| 431 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_trans_option), (int *)OPT_WGAIM_BUDDYWIN_ONTOP); |
443 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_trans_option), (int *)OPT_WGAIM_BUDDYWIN_ONTOP); |
| 432 |
444 |
| 433 button = gaim_button(_("_Buddy List window transparency"), &trans_options, OPT_WGAIM_BLTRANS, bltransbox); |
445 button = wgaim_button(_("_Buddy List window transparency"), &trans_options, OPT_WGAIM_BLTRANS, bltransbox); |
| 434 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_trans_option), (int *)OPT_WGAIM_BLTRANS); |
446 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_trans_option), (int *)OPT_WGAIM_BLTRANS); |
| 435 |
447 |
| 436 trans_box = gtk_vbox_new(FALSE, 18); |
448 trans_box = gtk_vbox_new(FALSE, 18); |
| 437 if (!(trans_options & OPT_WGAIM_BLTRANS)) |
449 if (!(trans_options & OPT_WGAIM_BLTRANS)) |
| 438 gtk_widget_set_sensitive(GTK_WIDGET(trans_box), FALSE); |
450 gtk_widget_set_sensitive(GTK_WIDGET(trans_box), FALSE); |