3729
|
1 /*
|
|
2 * win2ktrans
|
|
3 *
|
|
4 * copyright (c) 1998-2002, rob flynn <rob@marko.net>
|
|
5 *
|
|
6 * this program is free software; you can redistribute it and/or modify
|
|
7 * it under the terms of the gnu general public license as published by
|
|
8 * the free software foundation; either version 2 of the license, or
|
|
9 * (at your option) any later version.
|
|
10 *
|
|
11 * this program is distributed in the hope that it will be useful,
|
|
12 * but without any warranty; without even the implied warranty of
|
|
13 * merchantability or fitness for a particular purpose. see the
|
|
14 * gnu general public license for more details.
|
|
15 *
|
|
16 * you should have received a copy of the gnu general public license
|
|
17 * along with this program; if not, write to the free software
|
|
18 * foundation, inc., 59 temple place, suite 330, boston, ma 02111-1307 usa
|
|
19 *
|
|
20 */
|
|
21 #define GAIM_PLUGINS
|
|
22
|
|
23 #include <gtk/gtk.h>
|
|
24 #include "wintransparency.h"
|
|
25 #include "gaim.h"
|
|
26
|
|
27 int alpha = 255;
|
|
28
|
|
29 static void gaim_new_conversation(char *who) {
|
|
30 struct conversation *c = find_conversation(who);
|
|
31
|
3740
|
32 if (!c || alpha == 255)
|
3729
|
33 return;
|
|
34
|
|
35 gdk_window_add_filter (GTK_WIDGET(c->window)->window, wgaim_window_filter, c);
|
|
36 }
|
|
37
|
|
38
|
|
39 G_MODULE_EXPORT char *gaim_plugin_init(GModule *handle) {
|
|
40
|
|
41
|
|
42 gaim_signal_connect(handle, event_new_conversation, gaim_new_conversation, NULL);
|
|
43
|
|
44 return NULL;
|
|
45 }
|
|
46
|
|
47 G_MODULE_EXPORT void gaim_plugin_remove() {
|
|
48 }
|
|
49
|
|
50 struct gaim_plugin_description desc;
|
|
51
|
|
52 G_MODULE_EXPORT struct gaim_plugin_description *gaim_plugin_desc() {
|
|
53 desc.api_version = PLUGIN_API_VERSION;
|
|
54 desc.name = g_strdup(_("Transparency"));
|
|
55 desc.version = g_strdup(VERSION);
|
|
56 desc.description = g_strdup(_("This plugin enables variable alpha transparency on conversation windows.\n\n* Note: This plugin requires Win2000 or WinXP."));
|
3831
|
57 desc.authors = g_strdup(_("Rob Flynn <rob@marko.net>"));
|
3729
|
58 desc.url = g_strdup(WEBSITE);
|
|
59 return &desc;
|
|
60 }
|
|
61
|
|
62 G_MODULE_EXPORT char *name() {
|
|
63 return _("Transparency");
|
|
64 }
|
|
65
|
|
66 G_MODULE_EXPORT char *description() {
|
|
67 return _("This plugin enables variable alpha transparency on conversation windows.\n\n* Note: This plugin requires Win2000 or WinXP.");
|
|
68 }
|
|
69
|
|
70 void alpha_value_changed(GtkWidget *w, gpointer data)
|
|
71 {
|
|
72 alpha = gtk_range_get_value(GTK_RANGE(w));
|
|
73 }
|
|
74
|
|
75 G_MODULE_EXPORT GtkWidget *gaim_plugin_config_gtk() {
|
|
76 GtkWidget *hbox;
|
|
77 GtkWidget *label, *slider;
|
|
78
|
|
79 hbox = gtk_hbox_new(FALSE, 5);
|
|
80
|
|
81 label = gtk_label_new(_("Opacity:"));
|
|
82 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
|
|
83
|
|
84 slider = gtk_hscale_new_with_range(50,255,1);
|
|
85 gtk_range_set_value(GTK_RANGE(slider), 255);
|
|
86 gtk_widget_set_usize(GTK_WIDGET(slider), 200, -1);
|
|
87
|
|
88 gtk_signal_connect(GTK_OBJECT(slider), "value-changed", GTK_SIGNAL_FUNC(alpha_value_changed), NULL);
|
|
89
|
|
90 gtk_box_pack_start(GTK_BOX(hbox), slider, FALSE, TRUE, 5);
|
|
91
|
|
92 gtk_widget_show_all(hbox);
|
|
93
|
|
94 return hbox;
|
|
95 }
|