--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ChangeLog Sat Dec 27 14:28:54 2003 +0000
@@ -0,0 +1,44 @@
+ * Fixed a bug where if a connection was canceled and then later established, no + guifications would be shown for that account + * Snakez added a toggle to hide guifications while away + * Fixed some errors and left out information in the INSTALL file + * Fixed a bug where local and server alias would not be displayed correct if they + contained html special chars + * Added user defined mouse buttons for clicking on a guification. These + include: Close Window, Get Info, Open Conversation, View Log, and the main + context menu from the buddy list. + * Potential bug where and image gets set with a notification up removed. + This really wasn't a bug, but it just looked bad. + * Made clicking a guification to open a window switch to that tab if tab + windows are enabled and a conversation is already open. + * Added release notification. Theres a toggle for it on the advanced tab. + * Fixed "growing" option menus (dropdown lists) + * Added the ability to "zoom" the guifications + * Notifications will now open up an IM window when they are clicked. This + is probably buggy, so play with it and let me know. + * Fixed the bug where the notifications were only showing if all events + * Added message box if an invalid image file is selected + * Fixed a compile warning + * Took animation out completely, I got it working but it looked like crap so + I just removed it all together. + * Windows makefiles added and it should compile under windows now + * Windows binary added to sf releases + * Debugging output added to all functions + * Fixed an issue with the file selection dialog showing the current font + * Other random fixes and clean ups in the configuration window + * Everything in the configuration window is working except for animations. + Since I haven't come up with a decent and effective way to do it yet, it --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/INSTALL Sat Dec 27 14:28:54 2003 +0000
@@ -0,0 +1,57 @@
+I'm aiming for this plugin to be distributed with gaim, even though I know +how against that Sean is. But anyways, here's what you have to do to get +The only dependices guifications have that gaim doesn't are these packages: +Please make sure these are installed prior to compiling, otherwise gaim will +not be able to load guifications. +For starters extract the source into: + gaim-source-tree/plugins/ +gaim-source being what ever path you extracted the gaim source tree to. +For example, if your gaim source tree is in /usr/local/src/gaim-VERSION +you want to "cd" over to /usr/local/src/gaim-VERSION/plugins/ and type: + tar zxvf guifications-VERSION.tar.gz +Now that you've gotten the source installed you have to modify gaim's main +autoconfig script. (Like I said this is aiming to be distributed with gaim) +so "cd" back to the top of the gaim source tree "cd .." +Open up configure.ac in your favorite editor and look for this line: +That's currently line 957 in the cvs (don't use that by the way) +Somewhere in this block you want to add these two lines: + plugins/guifications/Makefile + plugins/guifications/pixmaps/Makefile +They must be before the closing ]) otherwise you'll mess up the whole script. +Save configure.ac then run automake, autoconfig, and configure in that order: + automake --add-missing --copy +Once gaim is done configuring, cd to plugins/guifications +And you should be good to go. Restart gaim and try it out. --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/INSTALL.WIN32 Sat Dec 27 14:28:54 2003 +0000
@@ -0,0 +1,38 @@
+To install Guifications, simply extract the contents of this zip file +to your gaim install directory, which is C:\Program Files\Gaim by +I'm aiming for this plugin to be distributed with gaim, even though I know +how against that Sean is. But anyways, here's what you have to do to get +For starters extract the source into: + gaim-source-tree/plugins/ +gaim-source being what ever path you extracted the gaim source tree to. +For example, if your gaim source tree is in /usr/local/src/gaim-VERSION +you want to "cd" over to /usr/local/src/gaim-VERSION/plugins/ and type: + tar zxvf guifications-VERSION.tar.gz +Then cd into the source dir + cd guifications-VERSION + make -f Makefile.mingw install +When it's done building copy guifications.dll and the pixmaps dir from your +win32-install-dir to your gaim install dir. +And you should be good to go. Restart gaim and try it out. \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile.am Sat Dec 27 14:28:54 2003 +0000
@@ -0,0 +1,56 @@
+plugindir = $(libdir)/gaim +guificat_la_LDFLAGS = -module -avoid-version +plugin_LTLIBRARIES = guificat.la +bin_PROGRAMS = gf_theme_edit +gf_theme_edit_SOURCES = \ +gf_theme_edit_DEPENDENCIES = \ + $(top_srcdir)/src/xmlnode.o + $(top_srcdir)/src/xmlnode.o + -DDATADIR=\"$(datadir)\" \ + -DVERSION=\"$(VERSION)\" \ --- a/Makefile.mingw Sat Dec 27 14:20:24 2003 +0000
+++ b/Makefile.mingw Sat Dec 27 14:28:54 2003 +0000
@@ -67,7 +67,7 @@
OBJECTS = $(C_SRC:%.c=%.o)
OBJECTS2 = $(C_SRC2:%.c=%.o)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/README Sat Dec 27 14:28:54 2003 +0000
@@ -0,0 +1,18 @@
+ The Pimpin' Penguin Notification Plugin thats good for the soul! +Gary Kramlich <grim@reaperworld.com> +Ray Cockburn <snakez@l33t-2k.net> +Stu Tomlinson for the rpm's +Guifications, are notifications windows styled after those found in msn, +deadim, and newer version of aim. I've fashioned them after being as +user customizable as possible. It is entirely gtk based and there for +should compile on anything that gaim will compile on. --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/README.WIN32 Sat Dec 27 14:28:54 2003 +0000
@@ -0,0 +1,20 @@
+ The Pimpin' Penguin Notification Plugin thats good for the soul! +Gary Kramlich <grim@reaperworld.com> +Ray Cockburn <snakez@l33t-2k.net> +Guifications, are notifications windows styled after those found in msn, +deadim, and newer version of aim. I've fashioned them after being as +user customizable as possible. It is entirely gtk based and there for +should compile on anything that gaim will compile on. +To install Guifications, simply extract the contents of this zip file +to your gaim install directory, which is C:\Program Files\Gaim by \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/TODO Sat Dec 27 14:28:54 2003 +0000
@@ -0,0 +1,4 @@
+Add Signal so other plugins can create guifications --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gf_conf.c Sat Dec 27 14:28:54 2003 +0000
@@ -0,0 +1,1148 @@
+ Guifications - The notification plugin to end all notification plugins! + Copyright (C) 2003 Gary Kramlich + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#include "guifications.h" +/*********************************************************************** +***********************************************************************/ +/*********************************************************************** +***********************************************************************/ +static GtkWidget *make_label( gchar *text, GtkSizeGroup *sg ); +static GtkWidget *make_check_button( const gchar *pref, gchar *text, GtkSizeGroup *sg ); +static GtkWidget *make_entry( const gchar *pref ); +static GtkWidget *make_button( gchar *text ); +static GtkWidget *make_spin_button_with_label( gchar *text, const gchar *pref, GtkSizeGroup *sg ); +static GtkWidget *make_gfpos_option_menu_with_label( const gchar *pref, gchar *text, GtkSizeGroup *sg ); +static GtkWidget *make_gfpos_menu_item(gf_gfpos pos); +static GtkWidget *make_clip_option_menu_with_label(const gchar *pref, gchar *text, GtkSizeGroup *sg ); +static GtkWidget *make_clip_menu_item(gf_clip clip); +static GtkWidget *make_tpos_option_menu_with_label(const gchar *pref, gchar *text, GtkSizeGroup *sg ); +static GtkWidget *make_tpos_menu_item(gf_tpos pos); +static GtkWidget *make_ipos_option_menu_with_label(const gchar *pref, gchar *text, GtkSizeGroup *sg ); +static GtkWidget *make_ipos_menu_item(gf_ipos pos); +static GtkWidget *make_icon_size_option_menu_with_label(const gchar *pref, gchar *text, GtkSizeGroup *sg ); +static GtkWidget *make_icon_size_menu_item(gf_icon_size isize); +static GtkWidget *make_zoom_option_menu_with_label(const gchar *pref, gchar *text, GtkSizeGroup *sg); +static GtkWidget *make_zoom_menu_item(gf_zoom zoom); +static GtkWidget *make_mouse_option_menu_with_label(const gchar *pref, gchar *text, GtkSizeGroup *sg); +static GtkWidget *make_mouse_menu_item(gf_mouse mouse); +static void make_color_preview( GtkWidget *image, const gchar *color ); +static void chk_box_cb( GtkWidget *check, const gchar *pref ); +static void spn_btn_cb( GtkWidget *spin, const gchar *pref ); +static void opt_mnu_cb( GtkWidget *opt_menu, const gchar *pref ); +static gboolean edt_box_cb( GtkWidget *entry, GdkEventFocus *event, const gchar *pref ); +static void image_file_ok( GtkWidget *widget, gpointer data ); +static void image_file_dialog( GtkWidget *check, gpointer data ); +static void font_ok( GtkWidget *widget, gpointer data ); +static void font_dialog( GtkWidget *check, gpointer data ); +static void color_ok( GtkWidget *widget, gpointer data ); +static void color_dialog( GtkWidget *widget, gpointer data ); +/**********************************************************************/ +get_config_frame(GaimPlugin *plugin) { + GtkWidget *note, *vbox, *vbox2, *hbox, *frame, *label, *spin; + GtkWidget *chk_btn, *opt_mnu, *edt_box; + note = gtk_notebook_new(); + /******************************************************************* + *******************************************************************/ + /* setup behavior sizegroup */ + sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); + /* create behavior tab */ + vbox = gtk_vbox_new(FALSE, 4); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 12); + label = gtk_label_new("Behavior"); + gtk_notebook_insert_page(GTK_NOTEBOOK(note), vbox, label, -1); + /* create notification frame */ + frame = gaim_gtk_make_frame(vbox, "Notifications"); + /* create notification vbox */ + vbox2 = gtk_vbox_new(FALSE, 4); + gtk_container_add(GTK_CONTAINER(frame), vbox2); + /* create sign on/off hbox */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0); + /* create sign on check */ + chk_btn = make_check_button(GF_PREF_BEHAVIOR_SHOW_SIGN_ON, "Show _Sign On", sg); + gtk_box_pack_start(GTK_BOX(hbox), chk_btn, FALSE, FALSE, 0 ); + /* create sign off check */ + chk_btn = make_check_button(GF_PREF_BEHAVIOR_SHOW_SIGN_OFF, "Show Sign _Off", sg); + gtk_box_pack_start(GTK_BOX(hbox), chk_btn, FALSE, FALSE, 0); + /* create away/back hbox */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0); + /* create away check */ + chk_btn = make_check_button(GF_PREF_BEHAVIOR_SHOW_AWAY, "Show _Away", sg); + gtk_box_pack_start(GTK_BOX(hbox), chk_btn, FALSE, FALSE, 0 ); + /* create back check */ + chk_btn = make_check_button(GF_PREF_BEHAVIOR_SHOW_BACK, "Show _Back", sg); + gtk_box_pack_start(GTK_BOX(hbox), chk_btn, FALSE, FALSE, 0); + /* create idle/unidle hbox */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0); + /* create idle check */ + chk_btn = make_check_button(GF_PREF_BEHAVIOR_SHOW_IDLE, "Show _Idle", sg); + gtk_box_pack_start(GTK_BOX(hbox), chk_btn, FALSE, FALSE, 0); + /* create unidle check */ + chk_btn = make_check_button(GF_PREF_BEHAVIOR_SHOW_UNIDLE, "Show _Unidle", sg); + gtk_box_pack_start(GTK_BOX(hbox), chk_btn, FALSE, FALSE, 0); + /* create position frame */ + frame = gaim_gtk_make_frame(vbox, "Position"); + /* create position vbox */ + vbox2 = gtk_vbox_new(FALSE, 4); + gtk_container_add(GTK_CONTAINER(frame), vbox2); + /* create position option menu */ + opt_mnu = make_gfpos_option_menu_with_label(GF_PREF_BEHAVIOR_WINDOW_POS, "_Position:", sg); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), opt_mnu); + gtk_box_pack_start(GTK_BOX(vbox2), opt_mnu, FALSE, FALSE, 0); + /* create vertical check */ + chk_btn = make_check_button(GF_PREF_BEHAVIOR_WINDOW_VERTICAL, "_Vertical", sg); + gtk_box_pack_start(GTK_BOX(vbox2), chk_btn, FALSE, FALSE, 0); + /* create display frame */ + frame = gaim_gtk_make_frame(vbox, "Display"); + /* create display vbox */ + vbox2 = gtk_vbox_new(FALSE, 4); + gtk_container_add(GTK_CONTAINER(frame), vbox2); + /* create display spin */ + spin = make_spin_button_with_label("Display _time:", GF_PREF_BEHAVIOR_TIMEOUT, sg); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin); + label = make_label("seconds", NULL); + gtk_box_pack_start(GTK_BOX( spin ), label, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(vbox2), spin, FALSE, FALSE, 0); + /* create zoom option menu */ + opt_mnu = make_zoom_option_menu_with_label(GF_PREF_BEHAVIOR_ZOOM, "_Zoom:", sg); + gtk_box_pack_start(GTK_BOX(vbox2), opt_mnu, FALSE, FALSE, 0); + /* create alias check */ + chk_btn = make_check_button(GF_PREF_BEHAVIOR_ALIAS, "S_how alias if set", NULL); + gtk_box_pack_start(GTK_BOX(vbox2), chk_btn, FALSE, FALSE, 0); + /* show if away check */ + chk_btn = make_check_button(GF_PREF_BEHAVIOR_SHOWAWAY, "Sho_w Guifications while away", NULL); + gtk_box_pack_start(GTK_BOX(vbox2), chk_btn, FALSE, FALSE, 0); + /* create mouse frame */ + frame = gaim_gtk_make_frame(vbox, "Mouse"); + /* create mouse1 option */ + opt_mnu = make_mouse_option_menu_with_label(GF_PREF_BEHAVIOR_MOUSE1, "_Left Button:", sg); + gtk_box_pack_start(GTK_BOX(frame), opt_mnu, FALSE, FALSE, 0); + /* create mouse2 option */ + opt_mnu = make_mouse_option_menu_with_label(GF_PREF_BEHAVIOR_MOUSE2, "_Middle Button:", sg); + gtk_box_pack_start(GTK_BOX(frame), opt_mnu, FALSE, FALSE, 0); + /* create mouse3 option */ + opt_mnu = make_mouse_option_menu_with_label(GF_PREF_BEHAVIOR_MOUSE3, "_Right Button:", sg); + gtk_box_pack_start(GTK_BOX(frame), opt_mnu, FALSE, FALSE, 0); + /******************************************************************* + *******************************************************************/ + /* make appearance sizegroup */ + sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); + /* create appearance tab */ + vbox = gtk_vbox_new(FALSE, 4); + label = gtk_label_new("Appearance"); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 12); + gtk_notebook_insert_page(GTK_NOTEBOOK(note), vbox, label, -1); + /* create image frame */ + frame = gaim_gtk_make_frame(vbox, "Image"); + /* create image vbox */ + vbox2 = gtk_vbox_new(FALSE, 4); + gtk_container_add(GTK_CONTAINER(frame), vbox2); + /* create image check */ + chk_btn = make_check_button(GF_PREF_APPEARANCE_IMAGE, "Use custom _image", sg); + gtk_box_pack_start(GTK_BOX(vbox2), chk_btn, FALSE, FALSE, 0); + /* create image entry/button hbox */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0); + /* create image edit box */ + edt_image = make_entry(GF_PREF_APPEARANCE_IMAGE_FILE); + gtk_widget_set_sensitive(edt_image, FALSE); + gtk_box_pack_start(GTK_BOX(hbox), edt_image, FALSE, FALSE, 0); + /* create image button */ + btn_image = make_button("_Browse"); + gtk_widget_set_sensitive(btn_image, gaim_prefs_get_bool(GF_PREF_APPEARANCE_IMAGE)); + g_signal_connect(G_OBJECT(btn_image), "clicked", G_CALLBACK(image_file_dialog), NULL); + gtk_box_pack_start(GTK_BOX(hbox), btn_image, FALSE, FALSE, 0); + /* create text frame */ + frame = gaim_gtk_make_frame(vbox, "Text"); + vbox2 = gtk_vbox_new(FALSE, 4); + gtk_container_add(GTK_CONTAINER(frame), vbox2); + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0); + /* create font check */ + chk_btn = make_check_button(GF_PREF_APPEARANCE_FONT, "Use custom fon_t", sg); + gtk_box_pack_start(GTK_BOX(hbox), chk_btn, FALSE, FALSE, 0); + /* create font button */ + btn_font = gtk_button_new_from_stock(GTK_STOCK_SELECT_FONT); + gtk_widget_set_sensitive(btn_font, gaim_prefs_get_bool(GF_PREF_APPEARANCE_FONT)); + g_signal_connect(G_OBJECT(btn_font), "clicked", G_CALLBACK(font_dialog), NULL); + gtk_box_pack_start(GTK_BOX(hbox), btn_font, FALSE, FALSE, 0); + /* create color hbox */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0); + /* create color check */ + chk_btn = make_check_button(GF_PREF_APPEARANCE_COLOR, "Use custom co_lor", sg); + gtk_box_pack_start(GTK_BOX(hbox), chk_btn, FALSE, FALSE, 0); + /* create color button */ + btn_color = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); + gtk_widget_set_sensitive(btn_color, gaim_prefs_get_bool(GF_PREF_APPEARANCE_COLOR)); + g_signal_connect(G_OBJECT(btn_color), "clicked", G_CALLBACK(color_dialog), NULL); + gtk_box_pack_start(GTK_BOX(hbox), btn_color, FALSE, FALSE, 0); + /* create color event box */ + evt_color = gtk_event_box_new(); + gtk_widget_set_size_request(evt_color, 50, -1); + make_color_preview(evt_color, gaim_prefs_get_string(GF_PREF_COLORS_FOREGROUND)); + gtk_box_pack_start(GTK_BOX(hbox), evt_color, FALSE, FALSE, 0); + /* create clipping option menu */ + opt_mnu = make_clip_option_menu_with_label(GF_PREF_APPEARANCE_TEXT_CLIPPING, "Clippin_g:", sg); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), opt_mnu); + gtk_box_pack_start(GTK_BOX(vbox2), opt_mnu, FALSE, FALSE, 0); + /* create position option menu */ + opt_mnu = make_tpos_option_menu_with_label(GF_PREF_APPEARANCE_TEXT_POS, "_Position:", sg); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), opt_mnu); + gtk_box_pack_start(GTK_BOX(vbox2), opt_mnu, FALSE, FALSE, 0); + spin = make_spin_button_with_label("_Horizontal Offset:", GF_PREF_APPEARANCE_TEXT_X, sg); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin); + gtk_box_pack_start(GTK_BOX(vbox2), spin, FALSE, FALSE, 0); + spin = make_spin_button_with_label("_Vertical Offset:", GF_PREF_APPEARANCE_TEXT_Y, sg); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin); + gtk_box_pack_start(GTK_BOX(vbox2), spin, FALSE, FALSE, 0); + /* create protocol frame */ + frame = gaim_gtk_make_frame(vbox, "Protocol"); + /* create procotol vbox */ + vbox2 = gtk_vbox_new(FALSE, 4); + gtk_container_add(GTK_CONTAINER(frame), vbox2); + /* create position option menu */ + opt_mnu = make_ipos_option_menu_with_label(GF_PREF_APPEARANCE_PROT_POS, "P_osition:", sg); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), opt_mnu); + gtk_box_pack_start(GTK_BOX(vbox2), opt_mnu, FALSE, FALSE, 0); + /* create size option menu */ + opt_mnu = make_icon_size_option_menu_with_label(GF_PREF_APPEARANCE_PROT_SIZE, "Si_ze:", sg); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), opt_mnu); + gtk_box_pack_start(GTK_BOX(vbox2), opt_mnu, FALSE, FALSE, 0); + spin = make_spin_button_with_label("Ho_rizontal Offset:", GF_PREF_APPEARANCE_PROT_X, sg); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin); + gtk_box_pack_start(GTK_BOX(vbox2), spin, FALSE, FALSE, 0); + spin = make_spin_button_with_label("Ver_tical Offset:", GF_PREF_APPEARANCE_PROT_Y, sg); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin); + gtk_box_pack_start(GTK_BOX(vbox2), spin, FALSE, FALSE, 0); + /******************************************************************* + *******************************************************************/ + /* make messages size group */ + sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); + /* create message tab */ + vbox = gtk_vbox_new(FALSE, 4); + label = gtk_label_new("Messages"); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 12); + gtk_notebook_insert_page(GTK_NOTEBOOK(note), vbox, label, -1); + /* create messages frame */ + frame = gaim_gtk_make_frame(vbox, "Status Messages"); + /* create messages vbox */ + vbox2 = gtk_vbox_new(FALSE, 4); + gtk_container_add(GTK_CONTAINER(frame), vbox2); + /* create sign on hbox */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0); + /* create sign on label */ + label = make_label("_Sign on:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + /* create sign on edit */ + edt_box = make_entry(GF_PREF_MESSAGES_SIGN_ON); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), edt_box); + gtk_box_pack_start(GTK_BOX(hbox), edt_box, FALSE, FALSE, 0); + /* create sign off hbox */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0); + /* create sign off label */ + label = make_label("Sign _off:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + /* create sign off edit */ + edt_box = make_entry(GF_PREF_MESSAGES_SIGN_OFF); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), edt_box); + gtk_box_pack_start(GTK_BOX(hbox), edt_box, FALSE, FALSE, 0); + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0); + /* create away label */ + label = make_label("_Away:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + edt_box = make_entry(GF_PREF_MESSAGES_AWAY); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), edt_box); + gtk_box_pack_start(GTK_BOX(hbox), edt_box, FALSE, FALSE, 0); + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0); + /* create back label */ + label = make_label("_Back:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + edt_box = make_entry(GF_PREF_MESSAGES_BACK); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), edt_box); + gtk_box_pack_start(GTK_BOX(hbox), edt_box, FALSE, FALSE, 0); + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0); + /* create idle label */ + label = make_label("_Idle:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + edt_box = make_entry(GF_PREF_MESSAGES_IDLE); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), edt_box); + gtk_box_pack_start(GTK_BOX(hbox), edt_box, FALSE, FALSE, 0); + /* create unidle hbox */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0); + /* create unidle label */ + label = make_label("_Unidle:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + /* create unidle edit */ + edt_box = make_entry(GF_PREF_MESSAGES_UNIDLE); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), edt_box); + gtk_box_pack_start(GTK_BOX(hbox), edt_box, FALSE, FALSE, 0); + /******************************************************************* + *******************************************************************/ + /* make advanced sizeground */ + sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); + /* create advanced tab */ + vbox = gtk_vbox_new(FALSE, 4); + label = gtk_label_new("Advanced"); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 12); + gtk_notebook_insert_page(GTK_NOTEBOOK(note), vbox, label, -1); + /* create release notification frame */ + frame = gaim_gtk_make_frame(vbox, "Release Notification"); + /* create release notification check */ + chk_btn = make_check_button(GF_PREF_ADVANCED_RELEASE, "Check for new releases", sg); + gtk_box_pack_start(GTK_BOX(frame), chk_btn, FALSE, FALSE, 0); + /* create behavior frame */ + frame = gaim_gtk_make_frame(vbox, "Behavior"); + /* create sign on spin */ + spin = make_spin_button_with_label("_Sign on delay:", GF_PREF_ADVANCED_DELAY, sg); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin); + gtk_box_pack_start(GTK_BOX(frame), spin, FALSE, FALSE, 0); + /* create sign on description */ + label = make_label("milliseconds", NULL); + gtk_box_pack_start(GTK_BOX(spin), label, FALSE, FALSE, 0); + gtk_widget_show_all(note); +/**********************************************************************/ +make_color_preview(GtkWidget *image, const gchar *color) { + if (gaim_prefs_get_bool(GF_PREF_APPEARANCE_COLOR)) + pango_color_parse(&pcolor, color); + gcolor.red = pcolor.red; + gcolor.green = pcolor.green; + gcolor.blue = pcolor.blue; + gcolor.red = gcolor.green = gcolor.blue = 0; + style = gtk_style_new(); + gtk_widget_set_style(image, style); +/**********************************************************************/ +make_label(gchar *text, GtkSizeGroup *sg) { + ret = gtk_label_new_with_mnemonic(text); + gtk_misc_set_alignment(GTK_MISC(ret), 0.0, 0.5); + gtk_size_group_add_widget(sg, ret); +/**********************************************************************/ +make_check_button(const gchar *pref, gchar *text, GtkSizeGroup *sg) { + chk_btn = gtk_check_button_new_with_mnemonic(text); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chk_btn), gaim_prefs_get_bool(pref)); + g_signal_connect(G_OBJECT(chk_btn), "clicked", G_CALLBACK(chk_box_cb), (gpointer)pref); + gtk_size_group_add_widget(sg, chk_btn); +/**********************************************************************/ +make_entry(const gchar *pref) { + entry = gtk_entry_new(); + gtk_entry_set_text(GTK_ENTRY(entry), gaim_prefs_get_string(pref)); + g_signal_connect(G_OBJECT(entry), "focus-out-event", G_CALLBACK(edt_box_cb), (gpointer)pref); +/**********************************************************************/ +make_button(gchar *text) { + ret = gtk_button_new_with_mnemonic(text); +/**********************************************************************/ +make_spin_button_with_label(gchar *text, const gchar *pref, GtkSizeGroup *sg) { + GtkWidget *hbox, *label, *spin; + gdouble value = 0, max = 0, step = 0, page = 0; + if (pref == GF_PREF_BEHAVIOR_TIMEOUT) + else if (pref == GF_PREF_ADVANCED_DELAY) + hbox = gtk_hbox_new(FALSE, 4); + label = gtk_label_new_with_mnemonic(text); + gtk_misc_set_alignment(GTK_MISC(label), 0.05, 0.5); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + value = gaim_prefs_get_int(pref); + adjustment = gtk_adjustment_new(value, 0, max, step, page, 10); + spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjustment), 1, 0); + gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(spin), TRUE); + gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0); + g_signal_connect(G_OBJECT(spin), "changed", G_CALLBACK(spn_btn_cb), (gpointer)pref); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin); + gtk_size_group_add_widget(sg, label); +/**********************************************************************/ +make_gfpos_option_menu_with_label(const gchar *pref, gchar *text, GtkSizeGroup *sg) { + GtkWidget *hbox, *label, *option_menu, *menu; + hbox = gtk_hbox_new(FALSE, 4); + label = make_label(text, sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + option_menu = gtk_option_menu_new(); + for (i = 0; i < 4; i++) + gtk_menu_shell_append(GTK_MENU_SHELL(menu), make_gfpos_menu_item(i)); + gtk_widget_show_all(menu); + gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu), menu); + gtk_option_menu_set_history( GTK_OPTION_MENU(option_menu), gaim_prefs_get_int(pref)); + g_signal_connect(G_OBJECT(option_menu), "changed", G_CALLBACK(opt_mnu_cb), (gpointer)pref); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), option_menu); + gtk_box_pack_start(GTK_BOX(hbox), option_menu, FALSE, FALSE, 0); +/**********************************************************************/ +make_gfpos_menu_item(gf_gfpos pos) { + GtkWidget *item, *hbox, *label = NULL, *image; + GdkPixbuf *pixbuf = NULL; + item = gtk_menu_item_new(); + hbox = gtk_hbox_new(FALSE, 4); + gtk_container_add(GTK_CONTAINER(item), hbox); + pixbuf = get_window_image(pos); + case gfpos_nw: label = gtk_label_new("Top Left"); break; + case gfpos_ne: label = gtk_label_new("Top Right"); break; + case gfpos_sw: label = gtk_label_new("Bottom Left"); break; + case gfpos_se: label = gtk_label_new("Bottom Right"); break; + image = gtk_image_new_from_pixbuf(pixbuf); + g_object_unref(pixbuf); + gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); + gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5 ); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); +/**********************************************************************/ +make_clip_option_menu_with_label( const gchar *pref, gchar *text, GtkSizeGroup *sg ) { + GtkWidget *hbox, *label, *option_menu, *menu; + hbox = gtk_hbox_new(FALSE, 4); + label = make_label(text, sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + option_menu = gtk_option_menu_new(); + for (i = 0; i < 4; i++) + gtk_menu_shell_append(GTK_MENU_SHELL(menu), make_clip_menu_item(i)); + gtk_widget_show_all(menu); + gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu), menu); + gtk_option_menu_set_history(GTK_OPTION_MENU(option_menu), gaim_prefs_get_int(pref)); + g_signal_connect(G_OBJECT(option_menu), "changed", G_CALLBACK(opt_mnu_cb), (gpointer)pref); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), option_menu); + gtk_box_pack_start(GTK_BOX(hbox), option_menu, FALSE, FALSE, 0); +/**********************************************************************/ +make_clip_menu_item(gf_clip clip) { + GtkWidget *item, *hbox, *label = NULL, *image; + GdkPixbuf *pixbuf = NULL; + item = gtk_menu_item_new(); + hbox = gtk_hbox_new(FALSE, 4); + gtk_container_add(GTK_CONTAINER(item), hbox); + pixbuf = get_clipping_image(clip); + case clip_truncate: label = gtk_label_new("Truncate"); break; + case clip_elipse_start: label = gtk_label_new("Elipse at the beginning"); break; + case clip_elipse_middle: label = gtk_label_new("Elipse in the middle"); break; + case clip_elipse_end: label = gtk_label_new("Elipse at the end"); break; + image = gtk_image_new_from_pixbuf(pixbuf); + g_object_unref(pixbuf); + gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); + gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); +/**********************************************************************/ +make_tpos_option_menu_with_label(const gchar *pref, gchar *text, GtkSizeGroup *sg) { + GtkWidget *hbox, *label, *option_menu, *menu; + hbox = gtk_hbox_new(FALSE, 4); + label = make_label(text, sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + option_menu = gtk_option_menu_new(); + for (i = 0; i < 9; i++) + gtk_menu_shell_append(GTK_MENU_SHELL(menu), make_tpos_menu_item(i)); + gtk_widget_show_all(menu); + gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu), menu); + gtk_option_menu_set_history(GTK_OPTION_MENU(option_menu), gaim_prefs_get_int(pref)); + g_signal_connect(G_OBJECT(option_menu), "changed", G_CALLBACK(opt_mnu_cb), (gpointer)pref); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), option_menu); + gtk_box_pack_start(GTK_BOX(hbox), option_menu, FALSE, FALSE, 0); +/**********************************************************************/ +make_tpos_menu_item(gf_tpos pos) { + GtkWidget *item, *hbox, *label = NULL, *image; + GdkPixbuf *pixbuf = NULL; + item = gtk_menu_item_new(); + hbox = gtk_hbox_new(FALSE, 4); + gtk_container_add(GTK_CONTAINER(item), hbox); + pixbuf = get_text_position_image(pos); + case tpos_nw: label = gtk_label_new("Top Left"); break; + case tpos_n: label = gtk_label_new("Top"); break; + case tpos_ne: label = gtk_label_new("Top Right"); break; + case tpos_w: label = gtk_label_new("Left"); break; + case tpos_c: label = gtk_label_new("Center"); break; + case tpos_e: label = gtk_label_new("Right"); break; + case tpos_sw: label = gtk_label_new("Bottom Left"); break; + case tpos_s: label = gtk_label_new("Bottom"); break; + case tpos_se: label = gtk_label_new("Bottom Right"); break; + image = gtk_image_new_from_pixbuf(pixbuf); + g_object_unref(pixbuf); + gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); + gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); +/**********************************************************************/ +make_ipos_option_menu_with_label(const gchar *pref, gchar *text, GtkSizeGroup *sg) { + GtkWidget *hbox, *label, *option_menu, *menu; + hbox = gtk_hbox_new(FALSE, 4); + label = make_label(text, sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + option_menu = gtk_option_menu_new(); + for (i = 0; i < 10; i++) + gtk_menu_shell_append(GTK_MENU_SHELL(menu), make_ipos_menu_item(i)); + gtk_widget_show_all(menu); + gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu), menu); + gtk_option_menu_set_history(GTK_OPTION_MENU(option_menu), gaim_prefs_get_int(pref)); + g_signal_connect(G_OBJECT(option_menu), "changed", G_CALLBACK(opt_mnu_cb), (gpointer)pref); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), option_menu); + gtk_box_pack_start(GTK_BOX(hbox), option_menu, FALSE, FALSE, 0); +/**********************************************************************/ +make_ipos_menu_item(gf_ipos pos) { + GtkWidget *item, *hbox, *label = NULL, *image; + GdkPixbuf *pixbuf = NULL; + item = gtk_menu_item_new(); + hbox = gtk_hbox_new(FALSE, 4); + gtk_container_add(GTK_CONTAINER(item), hbox); + pixbuf = get_icon_position_image(pos); + case ipos_none: label = gtk_label_new("None"); break; + case ipos_nw: label = gtk_label_new("Top Left"); break; + case ipos_n: label = gtk_label_new("Top"); break; + case ipos_ne: label = gtk_label_new("Top Right"); break; + case ipos_w: label = gtk_label_new("Left"); break; + case ipos_c: label = gtk_label_new("Center"); break; + case ipos_e: label = gtk_label_new("Right"); break; + case ipos_sw: label = gtk_label_new("Bottom Left"); break; + case ipos_s: label = gtk_label_new("Bottom"); break; + case ipos_se: label = gtk_label_new("Bottom Right"); break; + image = gtk_image_new_from_pixbuf(pixbuf); + g_object_unref(pixbuf); + gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); + gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); +/**********************************************************************/ +make_icon_size_option_menu_with_label(const gchar *pref, gchar *text, GtkSizeGroup *sg) { + GtkWidget *hbox, *label, *option_menu, *menu; + hbox = gtk_hbox_new(FALSE, 4); + label = make_label(text, sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + option_menu = gtk_option_menu_new(); + for (i = 0; i < 5; i++) + gtk_menu_shell_append(GTK_MENU_SHELL(menu), make_icon_size_menu_item(i)); + gtk_widget_show_all(menu); + gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu), menu); + gtk_option_menu_set_history(GTK_OPTION_MENU(option_menu), gaim_prefs_get_int(pref)); + g_signal_connect(G_OBJECT(option_menu), "changed", G_CALLBACK(opt_mnu_cb), (gpointer)pref); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), option_menu); + gtk_box_pack_start(GTK_BOX(hbox), option_menu, FALSE, FALSE, 0); +/**********************************************************************/ +make_icon_size_menu_item(gf_icon_size isize) { + GtkWidget *item, *hbox, *label = NULL, *image; + GdkPixbuf *pixbuf = NULL; + item = gtk_menu_item_new(); + hbox = gtk_hbox_new(FALSE, 4); + gtk_container_add(GTK_CONTAINER(item), hbox); + pixbuf = get_icon_size_image(isize); + case isize_tiny: label = gtk_label_new("Tiny (16x16)"); break; + case isize_small: label = gtk_label_new("Small (24x24)"); break; + case isize_normal: label = gtk_label_new("Normal (48x48)"); break; + case isize_large: label = gtk_label_new("Large (96x96)"); break; + case isize_huge: label = gtk_label_new("Huge (144x144)"); break; + image = gtk_image_new_from_pixbuf(pixbuf); + g_object_unref(pixbuf); + gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); + gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); +/**********************************************************************/ +make_zoom_option_menu_with_label(const gchar *pref, gchar *text, GtkSizeGroup *sg) { + GtkWidget *hbox, *option_menu, *menu, *label; + hbox = gtk_hbox_new(FALSE, 4); + label = make_label(text, sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + option_menu = gtk_option_menu_new(); + for (i = 0; i < 8; i++) + gtk_menu_shell_append(GTK_MENU_SHELL(menu), make_zoom_menu_item(i)); + gtk_widget_show_all(menu); + gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu), menu); + gtk_option_menu_set_history(GTK_OPTION_MENU(option_menu), gaim_prefs_get_int(pref)); + g_signal_connect(G_OBJECT(option_menu), "changed", G_CALLBACK(opt_mnu_cb), (gpointer)pref); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), option_menu); + gtk_box_pack_start(GTK_BOX(hbox), option_menu, FALSE, FALSE, 0); +/**********************************************************************/ +make_zoom_menu_item(gf_zoom zoom) { + GtkWidget *hbox, *item, *label = NULL, *image; + GdkPixbuf *pixbuf = NULL; + item = gtk_menu_item_new(); + hbox = gtk_hbox_new(FALSE, 4); + gtk_container_add(GTK_CONTAINER(item), hbox); + pixbuf = get_zoom_image(zoom); + case zoom_200: label = gtk_label_new("200%"); break; + case zoom_175: label = gtk_label_new("175%"); break; + case zoom_150: label = gtk_label_new("150%"); break; + case zoom_125: label = gtk_label_new("125%"); break; + case zoom_100: label = gtk_label_new("100%"); break; + case zoom_75: label = gtk_label_new("75%"); break; + case zoom_50: label = gtk_label_new("50%"); break; + case zoom_25: label = gtk_label_new("25%"); break; + image = gtk_image_new_from_pixbuf(pixbuf); + g_object_unref(pixbuf); + gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); + gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); +/**********************************************************************/ +make_mouse_option_menu_with_label(const gchar *pref, gchar *text, GtkSizeGroup *sg) + GtkWidget *hbox, *option_menu, *menu, *label; + hbox = gtk_hbox_new(FALSE, 4); + label = make_label(text, sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + option_menu = gtk_option_menu_new(); + for (i = 0; i < mouse_count; i++) + gtk_menu_shell_append(GTK_MENU_SHELL(menu), make_mouse_menu_item(i)); + gtk_widget_show_all(menu); + gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu), menu); + gtk_option_menu_set_history(GTK_OPTION_MENU(option_menu), gaim_prefs_get_int(pref)); + g_signal_connect(G_OBJECT(option_menu), "changed", G_CALLBACK(opt_mnu_cb), (gpointer)pref ); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), option_menu); + gtk_box_pack_start(GTK_BOX(hbox), option_menu, FALSE, FALSE, 0); +/**********************************************************************/ +make_mouse_menu_item(gf_mouse mouse) { + GtkWidget *hbox, *item, *label = NULL; + item = gtk_menu_item_new(); + hbox = gtk_hbox_new(FALSE, 4); + gtk_container_add(GTK_CONTAINER(item), hbox); + case mouse_destroy: label = gtk_label_new("Close Window"); break; + case mouse_info: label = gtk_label_new("Buddy Info"); break; + case mouse_conversation: label = gtk_label_new("Open Conversation"); break; + case mouse_log: label = gtk_label_new("View Log"); break; + case mouse_context: label = gtk_label_new("Context Menu"); break; + case mouse_count: return NULL; break; + gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); +/*********************************************************************** +***********************************************************************/ +chk_box_cb(GtkWidget *check, const gchar *pref) { + gboolean enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check)); + gaim_prefs_set_bool(pref, enabled); + if (g_ascii_strcasecmp(pref, GF_PREF_APPEARANCE_IMAGE) == 0) + gtk_widget_set_sensitive(btn_image, enabled); + else if (g_ascii_strcasecmp(pref, GF_PREF_APPEARANCE_FONT) == 0) + gtk_widget_set_sensitive(btn_font, enabled); + else if (g_ascii_strcasecmp(pref, GF_PREF_APPEARANCE_COLOR) == 0) { + gtk_widget_set_sensitive(btn_color, enabled); + make_color_preview(evt_color, gaim_prefs_get_string(GF_PREF_COLORS_FOREGROUND)); +/**********************************************************************/ +spn_btn_cb(GtkWidget *spin, const gchar *pref) { + gaim_prefs_set_int(pref, gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin))); +/**********************************************************************/ +opt_mnu_cb(GtkWidget *opt_menu, const gchar *pref) { + if (g_ascii_strcasecmp(pref, GF_PREF_BEHAVIOR_ZOOM) == 0) + gaim_prefs_set_int(pref, gtk_option_menu_get_history(GTK_OPTION_MENU(opt_menu))); +/**********************************************************************/ +edt_box_cb(GtkWidget *entry, GdkEventFocus *event, const gchar *pref) { + gaim_prefs_set_string(pref, gtk_entry_get_text(GTK_ENTRY(entry))); +/**********************************************************************/ +image_file_dialog(GtkWidget *check, gpointer data) { + file_sel = gtk_file_selection_new("Select a background image"); + gtk_file_selection_set_filename(GTK_FILE_SELECTION(file_sel), gaim_prefs_get_string(GF_PREF_APPEARANCE_IMAGE_FILE)); + gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(file_sel)); + g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(file_sel)->ok_button), "clicked", G_CALLBACK(image_file_ok), (gpointer)file_sel); + g_signal_connect_swapped(G_OBJECT(GTK_FILE_SELECTION(file_sel)->ok_button), "clicked", G_CALLBACK(gtk_widget_destroy), (gpointer)file_sel); + g_signal_connect_swapped(G_OBJECT(GTK_FILE_SELECTION(file_sel)->cancel_button), "clicked", G_CALLBACK(gtk_widget_destroy), (gpointer)file_sel); + gtk_widget_show(file_sel); +/**********************************************************************/ +image_file_ok(GtkWidget *widget, gpointer data) { + GtkWidget *file_sel = (GtkWidget*)data, *message_box = NULL; + file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(file_sel)); + pixbuf = gdk_pixbuf_new_from_file(file, NULL); + gaim_prefs_set_string(GF_PREF_APPEARANCE_IMAGE_FILE, file); + g_object_unref(pixbuf); + gtk_entry_set_text(GTK_ENTRY(edt_image), file); + message_box = gtk_message_dialog_new(NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "The file \"%s\" is not a valid image file", file); + g_signal_connect_swapped(G_OBJECT(message_box), "response", G_CALLBACK(gtk_widget_destroy), GTK_OBJECT(message_box)); + gtk_widget_show(message_box); +/**********************************************************************/ +font_dialog(GtkWidget *check, gpointer data) { + font_sel = gtk_font_selection_dialog_new("Select Font"); + gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(font_sel), gaim_prefs_get_string(GF_PREF_APPEARANCE_FONT_FACE)); + gtk_font_selection_dialog_set_preview_text(GTK_FONT_SELECTION_DIALOG(font_sel), "Guifications"); + g_signal_connect(G_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel)->ok_button), "clicked", G_CALLBACK(font_ok), (gpointer)font_sel); + g_signal_connect_swapped(G_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel)->ok_button), "clicked", G_CALLBACK(gtk_widget_destroy), (gpointer)font_sel); + g_signal_connect_swapped(G_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel)->cancel_button), "clicked", G_CALLBACK(gtk_widget_destroy), (gpointer)font_sel); + gtk_widget_show(font_sel); +/**********************************************************************/ +font_ok(GtkWidget *widget, gpointer data) { + GtkWidget *font_sel = (GtkWidget*)data; + face = gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(font_sel)); + gaim_prefs_set_string(GF_PREF_APPEARANCE_FONT_FACE, face); +/**********************************************************************/ +color_dialog(GtkWidget *widget, gpointer data) { + pango_color_parse(&pcolor, gaim_prefs_get_string(GF_PREF_COLORS_FOREGROUND)); + color.red = pcolor.red; + color.green = pcolor.green; + color.blue = pcolor.blue; + color_sel = gtk_color_selection_dialog_new("Select Font Color"); + gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(color_sel)->colorsel), &color); + g_signal_connect(G_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_sel)->ok_button), "clicked", G_CALLBACK(color_ok), (gpointer)color_sel); + g_signal_connect_swapped(G_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_sel)->ok_button), "clicked", G_CALLBACK(gtk_widget_destroy), (gpointer)color_sel); + g_signal_connect_swapped(G_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_sel)->cancel_button), "clicked", G_CALLBACK(gtk_widget_destroy), (gpointer)color_sel); + gtk_widget_show(color_sel); +/**********************************************************************/ +color_ok(GtkWidget *widget, gpointer data) { + GtkWidget *color_sel = (GtkWidget*)data; + gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(color_sel)->colorsel), &color); + g_snprintf(buf, sizeof(buf), "#%04x%04x%04x", color.red, color.green, color.blue); + make_color_preview(evt_color, buf); + gaim_prefs_set_string(GF_PREF_COLORS_FOREGROUND, buf); +/**********************************************************************/ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gf_conf.h Sat Dec 27 14:28:54 2003 +0000
@@ -0,0 +1,30 @@
+ Guifications - The notification plugin to end all notification plugins! + Copyright (C) 2003 Gary Kramlich + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +/*********************************************************************** +***********************************************************************/ +GtkWidget *get_config_frame(GaimPlugin *plugin); +/**********************************************************************/ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gf_pngs.c Sat Dec 27 14:28:54 2003 +0000
@@ -0,0 +1,233 @@
+ Guifications - The notification plugin to end all notification plugins! + Copyright (C) 2003 Gary Kramlich + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#include <gdk-pixbuf/gdk-pixbuf.h> +#include "guifications.h" +/**********************************************************************/ + return g_build_filename(DATADIR, "pixmaps", "gaim", "guifications", NULL); +/**********************************************************************/ +get_def_background_image() { + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "backgrounds", "background_default.png", NULL), NULL); +/**********************************************************************/ +get_clipping_image(gf_clip clip) { + case clip_elipse_start: + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "clip_elipse_start.png", NULL), NULL); + case clip_elipse_middle: + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "clip_elipse_middle.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "clip_elipse_end.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "clip_truncate.png", NULL), NULL); +/**********************************************************************/ +get_text_position_image(gf_tpos pos) { + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "position_north_west.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "position_north.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "position_north_east.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "position_west.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "position_center.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "position_east.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "position_south_west.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "position_south.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "position_south_east.png", NULL), NULL); +/**********************************************************************/ +get_icon_position_image(gf_ipos pos) { + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "position_none.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "position_north_west.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "position_north.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "position_north_east.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "position_west.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "position_center.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "position_east.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "position_south_west.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "position_south.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "position_south_east.png", NULL), NULL); +/**********************************************************************/ +get_icon_size_image(gf_icon_size size) { + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "protocol_size_huge.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "protocol_size_large.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "protocol_size_normal.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "protocol_size_small.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "protocol_size_tiny.png", NULL), NULL); +/**********************************************************************/ +get_window_image(gf_gfpos pos) { + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "window_position_north_west.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "window_position_north_east.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "window_position_south_west.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "window_position_south_east.png", NULL), NULL); +/**********************************************************************/ +get_zoom_image(gf_zoom zoom) { + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "zoom_in.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "zoom_normal.png", NULL), NULL); + ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "zoom_out.png", NULL), NULL); +/**********************************************************************/ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gf_pngs.h Sat Dec 27 14:28:54 2003 +0000
@@ -0,0 +1,38 @@
+ Guifications - The notification plugin to end all notification plugins! + Copyright (C) 2003 Gary Kramlich + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#include <gdk-pixbuf/gdk-pixbuf.h> +#include "guifications.h" +/*********************************************************************** +***********************************************************************/ +gchar *gf_get_image_dir(); +GdkPixbuf *get_def_background_image(); +GdkPixbuf *get_clipping_image(gf_clip clip); +GdkPixbuf *get_text_position_image(gf_tpos pos); +GdkPixbuf *get_icon_position_image(gf_ipos pos); +GdkPixbuf *get_icon_size_image(gf_icon_size size); +GdkPixbuf *get_window_image(gf_gfpos pos); +GdkPixbuf *get_zoom_image(gf_zoom zoom); +/**********************************************************************/ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gf_prefs.c Sat Dec 27 14:28:54 2003 +0000
@@ -0,0 +1,85 @@
+ Guifications - The notification plugin to end all notification plugins! + Copyright (C) 2003 Gary Kramlich + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#include "guifications.h" +/**********************************************************************/ + gaim_prefs_add_none(GF_PREF_ROOT); + gaim_prefs_add_none(GF_PREF_PLUGIN_ROOT); + /* add behavior tree */ + gaim_prefs_add_none(GF_PREF_BEHAVIOR_ROOT); + gaim_prefs_add_bool(GF_PREF_BEHAVIOR_SHOW_SIGN_ON, TRUE); + gaim_prefs_add_bool(GF_PREF_BEHAVIOR_SHOW_SIGN_OFF, TRUE); + gaim_prefs_add_bool(GF_PREF_BEHAVIOR_SHOW_AWAY, TRUE); + gaim_prefs_add_bool(GF_PREF_BEHAVIOR_SHOW_BACK, TRUE); + gaim_prefs_add_bool(GF_PREF_BEHAVIOR_SHOW_IDLE, TRUE); + gaim_prefs_add_bool(GF_PREF_BEHAVIOR_SHOW_UNIDLE, TRUE); + gaim_prefs_add_int(GF_PREF_BEHAVIOR_WINDOW_POS, gfpos_se); + gaim_prefs_add_bool(GF_PREF_BEHAVIOR_WINDOW_VERTICAL, TRUE); + gaim_prefs_add_int(GF_PREF_BEHAVIOR_TIMEOUT, 6); + gaim_prefs_add_int(GF_PREF_BEHAVIOR_ZOOM, zoom_100); + gaim_prefs_add_bool(GF_PREF_BEHAVIOR_ALIAS, TRUE); + gaim_prefs_add_bool(GF_PREF_BEHAVIOR_SHOWAWAY, TRUE); /* snakez */ + gaim_prefs_add_int(GF_PREF_BEHAVIOR_MOUSE1, mouse_conversation); + gaim_prefs_add_int(GF_PREF_BEHAVIOR_MOUSE2, mouse_destroy); + gaim_prefs_add_int(GF_PREF_BEHAVIOR_MOUSE3, mouse_context); + /* add appearance tree */ + gaim_prefs_add_none(GF_PREF_APPEARANCE_ROOT); + gaim_prefs_add_bool(GF_PREF_APPEARANCE_IMAGE, FALSE); + gaim_prefs_add_string(GF_PREF_APPEARANCE_IMAGE_FILE, ""); + gaim_prefs_add_bool(GF_PREF_APPEARANCE_FONT, FALSE); + gaim_prefs_add_string(GF_PREF_APPEARANCE_FONT_FACE, ""); + gaim_prefs_add_bool(GF_PREF_APPEARANCE_COLOR, FALSE); + gaim_prefs_add_int(GF_PREF_APPEARANCE_TEXT_POS, tpos_c); + gaim_prefs_add_int(GF_PREF_APPEARANCE_TEXT_CLIPPING, clip_elipse_middle); + gaim_prefs_add_int(GF_PREF_APPEARANCE_TEXT_X, 0); + gaim_prefs_add_int(GF_PREF_APPEARANCE_TEXT_Y, 0); + gaim_prefs_add_int(GF_PREF_APPEARANCE_PROT_POS, ipos_sw); + gaim_prefs_add_int(GF_PREF_APPEARANCE_PROT_SIZE, isize_small); + gaim_prefs_add_int(GF_PREF_APPEARANCE_PROT_X, 5); + gaim_prefs_add_int(GF_PREF_APPEARANCE_PROT_Y, 5); + gaim_prefs_add_none(GF_PREF_COLORS_ROOT); + gaim_prefs_add_string(GF_PREF_COLORS_FOREGROUND, "#000000000000"); + /* add messages tree */ + gaim_prefs_add_none(GF_PREF_MESSAGES_ROOT); + gaim_prefs_add_string(GF_PREF_MESSAGES_SIGN_ON, "has signed on"); + gaim_prefs_add_string(GF_PREF_MESSAGES_SIGN_OFF, "has signed off"); + gaim_prefs_add_string(GF_PREF_MESSAGES_AWAY, "is now away"); + gaim_prefs_add_string(GF_PREF_MESSAGES_BACK, "is now back"); + gaim_prefs_add_string(GF_PREF_MESSAGES_IDLE, "is now idle"); + gaim_prefs_add_string(GF_PREF_MESSAGES_UNIDLE, "is no longer idle"); + /* add advanced tree */ + gaim_prefs_add_none(GF_PREF_ADVANCED_ROOT); + gaim_prefs_add_int(GF_PREF_ADVANCED_DELAY, 7000); + gaim_prefs_add_bool(GF_PREF_ADVANCED_RELEASE, TRUE); + gaim_prefs_add_int(GF_PREF_ADVANCED_RELEASE_CHECK, 0); +/**********************************************************************/ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gf_prefs.h Sat Dec 27 14:28:54 2003 +0000
@@ -0,0 +1,76 @@
+ Guifications - The notification plugin to end all notification plugins! + Copyright (C) 2003 Gary Kramlich + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +/*********************************************************************** +***********************************************************************/ +#define GF_PREF_ROOT "/plugins/gtk/amc_grim" +#define GF_PREF_PLUGIN_ROOT "/plugins/gtk/amc_grim/guifications" +#define GF_PREF_BEHAVIOR_ROOT "/plugins/gtk/amc_grim/guifications/behavior" +#define GF_PREF_BEHAVIOR_SHOW_SIGN_ON "/plugins/gtk/amc_grim/guifications/behavior/signon" +#define GF_PREF_BEHAVIOR_SHOW_SIGN_OFF "/plugins/gtk/amc_grim/guifications/behavior/signoff" +#define GF_PREF_BEHAVIOR_SHOW_AWAY "/plugins/gtk/amc_grim/guifications/behavior/away" +#define GF_PREF_BEHAVIOR_SHOW_BACK "/plugins/gtk/amc_grim/guifications/behavior/back" +#define GF_PREF_BEHAVIOR_SHOW_IDLE "/plugins/gtk/amc_grim/guifications/behavior/idle" +#define GF_PREF_BEHAVIOR_SHOW_UNIDLE "/plugins/gtk/amc_grim/guifications/behavior/unidle" +#define GF_PREF_BEHAVIOR_WINDOW_POS "/plugins/gtk/amc_grim/guifications/behavior/pos" +#define GF_PREF_BEHAVIOR_WINDOW_VERTICAL "/plugins/gtk/amc_grim/guifications/behavior/vertical" +#define GF_PREF_BEHAVIOR_TIMEOUT "/plugins/gtk/amc_grim/guifications/behavior/timeout" +#define GF_PREF_BEHAVIOR_ZOOM "/plugins/gtk/amc_grim/guifications/behavior/zoom" +#define GF_PREF_BEHAVIOR_ALIAS "/plugins/gtk/amc_grim/guifications/behavior/alias" +#define GF_PREF_BEHAVIOR_SHOWAWAY "/plugins/gtk/amc_grim/guifications/behavior/showaway" /* snakez */ +#define GF_PREF_BEHAVIOR_MOUSE1 "/plugins/gtk/amc_grim/guifications/behavior/mouse1" +#define GF_PREF_BEHAVIOR_MOUSE2 "/plugins/gtk/amc_grim/guifications/behavior/mouse2" +#define GF_PREF_BEHAVIOR_MOUSE3 "/plugins/gtk/amc_grim/guifications/behavior/mouse3" +#define GF_PREF_APPEARANCE_ROOT "/plugins/gtk/amc_grim/guifications/appearance" +#define GF_PREF_APPEARANCE_IMAGE "/plugins/gtk/amc_grim/guifications/appearance/image" +#define GF_PREF_APPEARANCE_IMAGE_FILE "/plugins/gtk/amc_grim/guifications/appearance/custom_image" +#define GF_PREF_APPEARANCE_FONT "/plugins/gtk/amc_grim/guifications/appearance/font" +#define GF_PREF_APPEARANCE_FONT_FACE "/plugins/gtk/amc_grim/guifications/appearance/face" +#define GF_PREF_APPEARANCE_COLOR "/plugins/gtk/amc_grim/guifications/appearance/color" +#define GF_PREF_APPEARANCE_TEXT_POS "/plugins/gtk/amc_grim/guifications/appearance/tpos" +#define GF_PREF_APPEARANCE_TEXT_CLIPPING "/plugins/gtk/amc_grim/guifications/appearance/clip" +#define GF_PREF_APPEARANCE_TEXT_X "/plugins/gtk/amc_grim/guifications/appearance/text_x" +#define GF_PREF_APPEARANCE_TEXT_Y "/plugins/gtk/amc_grim/guifications/appearance/text_y" +#define GF_PREF_APPEARANCE_PROT_POS "/plugins/gtk/amc_grim/guifications/appearance/ppos" +#define GF_PREF_APPEARANCE_PROT_SIZE "/plugins/gtk/amc_grim/guifications/appearance/psize" +#define GF_PREF_APPEARANCE_PROT_X "/plugins/gtk/amc_grim/guifications/appearance/prot_x" +#define GF_PREF_APPEARANCE_PROT_Y "/plugins/gtk/amc_grim/guifications/appearance/prot_y" +#define GF_PREF_COLORS_ROOT "/plugins/gtk/amc_grim/guifications/colors" +#define GF_PREF_COLORS_FOREGROUND "/plugins/gtk/amc_grim/guifications/colors/foreground" +#define GF_PREF_MESSAGES_ROOT "/plugins/gtk/amc_grim/guifications/messages" +#define GF_PREF_MESSAGES_SIGN_ON "/plugins/gtk/amc_grim/guifications/messages/signon" +#define GF_PREF_MESSAGES_SIGN_OFF "/plugins/gtk/amc_grim/guifications/messages/signoff" +#define GF_PREF_MESSAGES_AWAY "/plugins/gtk/amc_grim/guifications/messages/away" +#define GF_PREF_MESSAGES_BACK "/plugins/gtk/amc_grim/guifications/messages/back" +#define GF_PREF_MESSAGES_IDLE "/plugins/gtk/amc_grim/guifications/messages/idle" +#define GF_PREF_MESSAGES_UNIDLE "/plugins/gtk/amc_grim/guifications/messages/unidle" +#define GF_PREF_ADVANCED_ROOT "/plugins/gtk/amc_grim/guifications/advanced" +#define GF_PREF_ADVANCED_DELAY "/plugins/gtk/amc_grim/guifications/advanced/delay" +#define GF_PREF_ADVANCED_RELEASE "/plugins/gtk/amc_grim/guifications/advanced/release_notification" +#define GF_PREF_ADVANCED_RELEASE_CHECK "/plugins/gtk/amc_grim/guifications/advanced/release_check" +/*********************************************************************** +***********************************************************************/ +/**********************************************************************/ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gf_theme.h Sat Dec 27 14:28:54 2003 +0000
@@ -0,0 +1,51 @@
+typedef enum _gf_theme_type { + gf_theme_type_basic = 0, +typedef enum _gf_theme_info { + gf_theme_info_name = 0, + gf_theme_info_description, +typedef struct _gf_basic_theme { + gboolean text_custom_font; + gboolean text_custom_color; + gint proto_horz_offset; + gint proto_vert_offset; +typedef struct _gf_advanced_theme { +typedef struct _gf_theme { + gf_advanced_theme advanced; --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gf_theme_editor.c Sat Dec 27 14:28:54 2003 +0000
@@ -0,0 +1,1339 @@
+#include <gdk-pixbuf/gdk-pixbuf.h> +#include "guifications.h" +#include "grimdirtreeview.h" +/*********************************************************************** + **********************************************************************/ +#define base_title "Guifications Theme Editor" +gboolean theme_modified = FALSE; +GtkWidget *theme_name, *theme_version, *theme_description; +GtkWidget *theme_author, *theme_website; +GtkWidget *basic_image_file, *basic_image_button; +GtkWidget *basic_text_font_check, *basic_text_font_button; +GtkWidget *basic_text_color_check, *basic_text_color_button; +GtkWidget *basic_text_clipping_menu, *basic_text_pos_menu; +GtkWidget *basic_text_horz_offset, *basic_text_vert_offset; +GtkWidget *basic_proto_pos_menu, *basic_proto_size_menu; +GtkWidget *basic_proto_horz_offset, *basic_proto_vert_offset; +GtkWidget *basic_message_signon, *basic_message_signoff; +GtkWidget *basic_message_away, *basic_message_back; +GtkWidget *basic_message_idle, *basic_message_unidle; +GtkWidget *preview_menu, *preview_image; +/*********************************************************************** + **********************************************************************/ +gint main(gint argc, gchar *argv[]); +static GtkWidget *make_window(); +static void make_info_page(GtkWidget *notebook); +static void make_basic_page(GtkWidget *notebook); +static void make_messages_page(GtkWidget *notebook); +static void make_advanced_page(GtkWidget *notebook); +static void clear_theme(); +static void update_controls(); +static void update_modified(gboolean modified); +static GtkWidget *make_label(gchar *text, GtkSizeGroup *sg); +static GtkWidget *make_spin_button(); +static GtkWidget *make_frame(GtkWidget *parent, const gchar *title); +static GtkWidget *make_preview_menu(); +static GtkWidget *make_check_button(const gchar *text, GtkSizeGroup *sg); +static GtkWidget *make_clip_option_menu(); +static GtkWidget *make_clip_menu_item(gf_clip clip); +static GtkWidget *make_text_pos_option_menu(); +static GtkWidget *make_text_pos_menu_item(gf_tpos pos); +static GtkWidget *make_icon_pos_option_menu(); +static GtkWidget *make_icon_pos_menu_item(gf_ipos pos); +static GtkWidget *make_icon_size_option_menu(); +static GtkWidget *make_icon_size_menu_item(gf_icon_size isize); +static GtkWidget *make_file_dialog(gchar *title, gboolean open, gboolean quit); +static gboolean close_editor(GtkWidget *widget, GdkEvent *event, gpointer data); +static void menu_new_cb(); +static void menu_open_cb(); +static void menu_save_cb(); +static void menu_save_as_cb(); +static void menu_quit_cb(); +static void menu_debug_theme_dump_cb(); +static void preview_option_cb(GtkWidget *widget, gpointer data); +static gboolean entry_cb(GtkWidget *widget, gpointer data); +static void spin_button_cb(GtkWidget *widget, gpointer data); +static void check_button_cb(GtkWidget *widget, gpointer data); +static void option_menu_cb(GtkWidget *widget, gpointer data); +static void image_file_dialog(GtkWidget *widget, gpointer data); +static void image_file_dialog_ok(GtkWidget *widget, gpointer data); +static void font_dialog(GtkWidget *widget, gpointer data); +static void font_dialog_ok(GtkWidget *widget, gpointer data); +static void color_dialog(GtkWidget *widget, gpointer data); +static void color_dialog_ok(GtkWidget *widget, gpointer data); +static void modified_message_response_cb(GtkWidget *widget, gint response_id, gpointer data); +static void file_dialog_ok(GtkWidget *widget, gpointer data); +/*********************************************************************** + **********************************************************************/ +static GtkItemFactoryEntry main_menu[] = { + { "/_File", NULL, NULL, 0, "<Branch>" }, + { "/File/_New", "<CTL>N", menu_new_cb, 0, "<StockItem>", GTK_STOCK_NEW }, + { "/File/_Open...", "<CTL>O", menu_open_cb, 0, "<StockItem>", GTK_STOCK_OPEN }, + { "/File/_Save", "<CTL>S", menu_save_cb, 0, "<StockItem>", GTK_STOCK_SAVE }, + { "/File/Save _As...", NULL, menu_save_as_cb, 0, "<StockItem>", GTK_STOCK_SAVE_AS }, + { "/File/sep", NULL, NULL, 0, "<Separator>" }, + { "/File/_Refresh Preview", "F5", NULL, 0, "<StockItem>", GTK_STOCK_REFRESH }, + { "/File/sep1", NULL, NULL, 0, "<Separator>" }, + { "/File/_Quit", "<CTL>Q", menu_quit_cb, 0, "<StockItem>", GTK_STOCK_QUIT }, + { "/_Debug", NULL, NULL, 0, "<Branch>" }, + { "/Debug/_Dump Theme", "<CTL>D", menu_debug_theme_dump_cb, 0, NULL }, +/*********************************************************************** + **********************************************************************/ +main(gint argc, gchar *argv[]) { + gtk_init(&argc, &argv); + window = make_window(); +/*********************************************************************** + **********************************************************************/ + GtkWidget *win, *vbox, *hbox, *note, *frame; + GtkItemFactory *menubar; + win = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_window_set_title(GTK_WINDOW(win), base_title); + gtk_window_set_resizable(GTK_WINDOW(win), FALSE); + g_signal_connect(G_OBJECT(win), "delete_event", G_CALLBACK(close_editor), NULL); + vbox = gtk_vbox_new(FALSE, 0); + gtk_container_add(GTK_CONTAINER(win), vbox); + /* create and pack the menubar */ + menubar = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "<ThemeMain>", NULL); + gtk_item_factory_create_items(menubar, sizeof(main_menu) / sizeof(*main_menu), main_menu, NULL); + gtk_box_pack_start(GTK_BOX(vbox), gtk_item_factory_get_widget(menubar, "<ThemeMain>"), FALSE, FALSE, 0); + /* create and pack main hbox */ + hbox = gtk_hbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0); + /* create and pack the notebook */ + note = gtk_notebook_new(); + gtk_box_pack_start(GTK_BOX(hbox), note, TRUE, TRUE, 0); + /* create and add pages */ + make_messages_page(note); + make_advanced_page(note); + /* create and pack preview vbox */ + vbox = gtk_vbox_new(FALSE, 0); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 12); + gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 4); + /* create preview frame */ + frame = make_frame(vbox, "Preview"); + gtk_container_set_border_width(GTK_CONTAINER(frame), 12); + /* create and pack preview option menu */ + preview_menu = make_preview_menu(); + g_signal_connect(G_OBJECT(preview_menu), "changed", G_CALLBACK(preview_option_cb), NULL); + gtk_box_pack_start(GTK_BOX(frame), preview_menu, FALSE, FALSE, 0); + /* show all widgets and return the window */ + gtk_widget_show_all(win); +/**********************************************************************/ +make_info_page(GtkWidget *notebook) { + GtkWidget *vbox, *hbox, *label, *frame; + label = gtk_label_new("Information"); + vbox = gtk_vbox_new(FALSE, 4); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 12); + gtk_notebook_insert_page(GTK_NOTEBOOK(notebook), vbox, label, -1); + sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); + /* create and pack frame */ + frame = make_frame(vbox, "Theme Information"); + /* create and pack name line */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); + label = make_label("_Name:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + theme_name = gtk_entry_new(); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), theme_name); + g_signal_connect(G_OBJECT(theme_name), "changed", G_CALLBACK(entry_cb), &theme.info[0]); + gtk_box_pack_start(GTK_BOX(hbox), theme_name, FALSE, FALSE, 0); + /* create and pack version line */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); + label = make_label("_Version:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + theme_version = gtk_entry_new(); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), theme_version); + g_signal_connect(G_OBJECT(theme_version), "changed", G_CALLBACK(entry_cb), &theme.info[1]); + gtk_box_pack_start(GTK_BOX(hbox), theme_version, FALSE, FALSE, 0); + /* create and pack description line */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); + label = make_label("_Description:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + theme_description = gtk_entry_new(); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), theme_description); + g_signal_connect(G_OBJECT(theme_description), "changed", G_CALLBACK(entry_cb), &theme.info[2]); + gtk_box_pack_start(GTK_BOX(hbox), theme_description, FALSE, FALSE, 0); + /* create and pack author line */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); + label = make_label("_Author:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + theme_author = gtk_entry_new(); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), theme_author); + g_signal_connect(G_OBJECT(theme_author), "changed", G_CALLBACK(entry_cb), &theme.info[3]); + gtk_box_pack_start(GTK_BOX(hbox), theme_author, FALSE, FALSE, 0); + /* create and pack website list */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); + label = make_label("_Website:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + theme_website = gtk_entry_new(); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), theme_website); + g_signal_connect(G_OBJECT(theme_website), "changed", G_CALLBACK(entry_cb), &theme.info[4]); + gtk_box_pack_start(GTK_BOX(hbox), theme_website, FALSE, FALSE, 0); + /* free the sizegroup */ +/**********************************************************************/ +make_basic_page(GtkWidget *notebook) { + GtkWidget *vbox, *hbox, *frame, *label; + sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); + label = gtk_label_new("Basic Theme"); + vbox = gtk_vbox_new(FALSE, 4); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 12); + gtk_notebook_insert_page(GTK_NOTEBOOK(notebook), vbox, label, -1); + /* create and pack image frame */ + frame = make_frame(vbox, "Image"); + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(frame), hbox, TRUE, TRUE, 0); + basic_image_file = gtk_entry_new(); + gtk_widget_set_sensitive(basic_image_file, FALSE); + gtk_box_pack_start(GTK_BOX(hbox), basic_image_file, TRUE, TRUE, 0); + basic_image_button = gtk_button_new_with_mnemonic("_Browse"); + g_signal_connect(G_OBJECT(basic_image_button), "clicked", G_CALLBACK(image_file_dialog), &theme.data.basic.image); + gtk_box_pack_start(GTK_BOX(hbox), basic_image_button, FALSE, FALSE, 0); + /* create and pack text frame */ + frame = make_frame(vbox, "Text"); + /* create and pack font line */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); + basic_text_font_check = make_check_button("Use custom fon_t", sg); + g_signal_connect(G_OBJECT(basic_text_font_check), "clicked", G_CALLBACK(check_button_cb), &theme.data.basic.text_custom_font); + gtk_box_pack_start(GTK_BOX(hbox), basic_text_font_check, FALSE, FALSE, 0); + basic_text_font_button = gtk_button_new_from_stock(GTK_STOCK_SELECT_FONT); + g_signal_connect(G_OBJECT(basic_text_font_button), "clicked", G_CALLBACK(font_dialog), &theme.data.basic.text_font); + gtk_box_pack_start(GTK_BOX(hbox), basic_text_font_button, FALSE, FALSE, 0); + /* create and pack color line */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); + basic_text_color_check = make_check_button("Use custom co_lor", sg); + g_signal_connect(G_OBJECT(basic_text_color_check), "clicked", G_CALLBACK(check_button_cb), &theme.data.basic.text_custom_color); + gtk_box_pack_start(GTK_BOX(hbox), basic_text_color_check, FALSE, FALSE, 0); + basic_text_color_button = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); + g_signal_connect(G_OBJECT(basic_text_color_button), "clicked", G_CALLBACK(color_dialog), &theme.data.basic.text_color); + gtk_box_pack_start(GTK_BOX(hbox), basic_text_color_button, FALSE, FALSE, 0); + /* create and pack clipping line */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); + label = make_label("Clippin_g:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + basic_text_clipping_menu = make_clip_option_menu(); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), basic_text_clipping_menu); + g_signal_connect(G_OBJECT(basic_text_clipping_menu), "changed", G_CALLBACK(option_menu_cb), &theme.data.basic.text_clipping); + gtk_box_pack_start(GTK_BOX(hbox), basic_text_clipping_menu, FALSE, FALSE, 0); + /* create and pack text position line */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); + label = make_label("_Position:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + basic_text_pos_menu = make_text_pos_option_menu(); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), basic_text_pos_menu); + g_signal_connect(G_OBJECT(basic_text_pos_menu), "changed", G_CALLBACK(option_menu_cb), &theme.data.basic.text_position); + gtk_box_pack_start(GTK_BOX(hbox), basic_text_pos_menu, FALSE, FALSE, 0); + /* create and pack horizontal offset line */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); + label = make_label("_Horizontal offset:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + basic_text_horz_offset = make_spin_button(); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), basic_text_horz_offset); + g_signal_connect(G_OBJECT(basic_text_horz_offset), "changed", G_CALLBACK(spin_button_cb), &theme.data.basic.text_horz_offset); + gtk_box_pack_start(GTK_BOX(hbox), basic_text_horz_offset, FALSE, FALSE, 0); + /* create and pack vertical offset line */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); + label = make_label("_Vertical offset:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + basic_text_vert_offset = make_spin_button(); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), basic_text_vert_offset); + g_signal_connect(G_OBJECT(basic_text_vert_offset), "changed", G_CALLBACK(spin_button_cb), &theme.data.basic.text_vert_offset); + gtk_box_pack_start(GTK_BOX(hbox), basic_text_vert_offset, FALSE, FALSE, 0); + /* create and pack protocol frame */ + frame = make_frame(vbox, "Protocol Icon"); + /* create and pack protocol position line */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); + label = make_label("P_osition:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + basic_proto_pos_menu = make_icon_pos_option_menu(); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), basic_proto_pos_menu); + g_signal_connect(G_OBJECT(basic_proto_pos_menu), "changed", G_CALLBACK(option_menu_cb), &theme.data.basic.proto_position); + gtk_box_pack_start(GTK_BOX(hbox), basic_proto_pos_menu, FALSE, FALSE, 0); + /* create and pack protocol size line */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); + label = make_label("Si_ze:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + basic_proto_size_menu = make_icon_size_option_menu(); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), basic_proto_size_menu); + g_signal_connect(G_OBJECT(basic_proto_size_menu), "changed", G_CALLBACK(option_menu_cb), &theme.data.basic.proto_size); + gtk_box_pack_start(GTK_BOX(hbox), basic_proto_size_menu, FALSE, FALSE, 0); + /* create and pack protocol horizontal offset line */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); + label = make_label("Ho_rizontal offset:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + basic_proto_horz_offset = make_spin_button(); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), basic_proto_horz_offset); + g_signal_connect(G_OBJECT(basic_proto_horz_offset), "changed", G_CALLBACK(spin_button_cb), &theme.data.basic.proto_horz_offset); + gtk_box_pack_start(GTK_BOX(hbox), basic_proto_horz_offset, FALSE, FALSE, 0); + /* create and pack protocol vertical offset line */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); + label = make_label("Ver_tical offset:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + basic_proto_vert_offset = make_spin_button(); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), basic_proto_vert_offset); + g_signal_connect(G_OBJECT(basic_proto_vert_offset), "changed", G_CALLBACK(spin_button_cb), &theme.data.basic.proto_vert_offset); + gtk_box_pack_start(GTK_BOX(hbox), basic_proto_vert_offset, FALSE, FALSE, 0); + /* free the sizegroup */ +/**********************************************************************/ +make_messages_page(GtkWidget *notebook) { + GtkWidget *vbox, *hbox, *label, *frame; + sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); + label = gtk_label_new("Messages"); + vbox = gtk_vbox_new(FALSE, 0); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 12); + gtk_notebook_insert_page(GTK_NOTEBOOK(notebook), vbox, label, -1); + /* create and pack frame */ + frame = make_frame(vbox, "Status Messages"); + /* create and pack sign on line */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); + label = make_label("_Sign On:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + basic_message_signon = gtk_entry_new(); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), basic_message_signon); + g_signal_connect(G_OBJECT(basic_message_signon), "changed", G_CALLBACK(entry_cb), &theme.data.basic.messages[0]); + gtk_box_pack_start(GTK_BOX(hbox), basic_message_signon, FALSE, FALSE, 0); + /* create and pack sign off line */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); + label = make_label("Sign _Off:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + basic_message_signoff = gtk_entry_new(); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), basic_message_signoff); + g_signal_connect(G_OBJECT(basic_message_signoff), "changed", G_CALLBACK(entry_cb), &theme.data.basic.messages[1]); + gtk_box_pack_start(GTK_BOX(hbox), basic_message_signoff, FALSE, FALSE, 0); + /* create and pack away line */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); + label = make_label("_Away:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + basic_message_away = gtk_entry_new(); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), basic_message_away); + g_signal_connect(G_OBJECT(basic_message_away), "changed", G_CALLBACK(entry_cb), &theme.data.basic.messages[2]); + gtk_box_pack_start(GTK_BOX(hbox), basic_message_away, FALSE, FALSE, 0); + /* create and pack back line */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); + label = make_label("_Back:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + basic_message_back = gtk_entry_new(); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), basic_message_back); + g_signal_connect(G_OBJECT(basic_message_back), "changed", G_CALLBACK(entry_cb), &theme.data.basic.messages[3]); + gtk_box_pack_start(GTK_BOX(hbox), basic_message_back, FALSE, FALSE, 0); + /* create and pack idle line */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); + label = make_label("_Idle:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + basic_message_idle = gtk_entry_new(); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), basic_message_idle); + g_signal_connect(G_OBJECT(basic_message_idle), "changed", G_CALLBACK(entry_cb), &theme.data.basic.messages[4]); + gtk_box_pack_start(GTK_BOX(hbox), basic_message_idle, FALSE, FALSE, 0); + /* create and pack unidle line */ + hbox = gtk_hbox_new(FALSE, 4); + gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); + label = make_label("_Unidle:", sg); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + basic_message_unidle = gtk_entry_new(); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), basic_message_unidle); + g_signal_connect(G_OBJECT(basic_message_unidle), "changed", G_CALLBACK(entry_cb), &theme.data.basic.messages[5]); + gtk_box_pack_start(GTK_BOX(hbox), basic_message_unidle, FALSE, FALSE, 0); +/**********************************************************************/ +moved_cursor(GrimDirTreeView *dir_tree_view, GtkTreePath *path, GtkTreeViewColumn *column, gpointer data) { + gtk_window_set_title(GTK_WINDOW(window), grim_dir_tree_view_get_path(dir_tree_view)); + printf("path=%s\n", gtk_tree_path_to_string(path)); +make_advanced_page(GtkWidget *notebook) { + GtkWidget *vbox, *label, *scrolled_window, *dir_tree_view; + label = gtk_label_new("Advanced Theme"); + vbox = gtk_vbox_new(FALSE, 0); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 12); + gtk_notebook_insert_page(GTK_NOTEBOOK(notebook), vbox, label, -1); + scrolled_window = gtk_scrolled_window_new(NULL, NULL); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled_window), GTK_SHADOW_IN); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_box_pack_start(GTK_BOX(vbox), scrolled_window, TRUE, TRUE, 0); + dir_tree_view = grim_dir_tree_view_new(); + g_signal_connect(G_OBJECT(dir_tree_view), "row-activated", G_CALLBACK(moved_cursor), NULL); + gtk_container_add(GTK_CONTAINER(scrolled_window), dir_tree_view); + grim_dir_tree_view_set_path(GRIM_DIR_TREE_VIEW(dir_tree_view), g_get_home_dir()); +/**********************************************************************/ +make_label(gchar *text, GtkSizeGroup *sg) { + label = gtk_label_new_with_mnemonic(text); + gtk_misc_set_alignment(GTK_MISC(label), 0, .5); + gtk_size_group_add_widget(sg, label); +/**********************************************************************/ +make_frame(GtkWidget *parent, const gchar *title) { + GtkWidget *vbox, *hbox, *label; + fmt_title = g_strdup_printf("<span weight=\"bold\">%s</span>", title); + vbox = gtk_vbox_new(FALSE, 6); + gtk_box_pack_start(GTK_BOX(parent), vbox, FALSE, FALSE, 0); + label = gtk_label_new(NULL); + gtk_label_set_markup(GTK_LABEL(label), fmt_title); + gtk_misc_set_alignment(GTK_MISC(label), 0, 0); + gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); + gtk_widget_show(label); + hbox = gtk_hbox_new(FALSE, 6); + gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); + label = gtk_label_new(" "); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + gtk_widget_show(label); + vbox = gtk_vbox_new(FALSE, 6); + gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0); +/**********************************************************************/ + GtkWidget *option_menu, *menu, *item; + item = gtk_menu_item_new_with_label("Custom"); + gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); + item = gtk_menu_item_new_with_label("Sign On"); + gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); + item = gtk_menu_item_new_with_label("Sign Off"); + gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); + item = gtk_menu_item_new_with_label("Away"); + gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); + item = gtk_menu_item_new_with_label("Back"); + gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); + item = gtk_menu_item_new_with_label("Idle"); + gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); + item = gtk_menu_item_new_with_label("Unidle"); + gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); + gtk_widget_show_all(menu); + option_menu = gtk_option_menu_new(); + gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu), menu); +/**********************************************************************/ +make_check_button(const gchar *text, GtkSizeGroup *sg) { + check = gtk_check_button_new_with_mnemonic(text); + gtk_size_group_add_widget(sg, check); +/**********************************************************************/ +make_clip_option_menu() { + GtkWidget *option_menu, *menu; + option_menu = gtk_option_menu_new(); + for (i = 0; i < 4; i++) + gtk_menu_shell_append(GTK_MENU_SHELL(menu), make_clip_menu_item(i)); + gtk_widget_show_all(menu); + gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu), menu); +/**********************************************************************/ +make_clip_menu_item(gf_clip clip) { + GtkWidget *item, *hbox, *label = NULL, *image; + GdkPixbuf *pixbuf = NULL; + item = gtk_menu_item_new(); + hbox = gtk_hbox_new(FALSE, 4); + gtk_container_add(GTK_CONTAINER(item), hbox); + pixbuf = get_clipping_image(clip); + case clip_truncate: label = gtk_label_new("Truncate"); break; + case clip_elipse_start: label = gtk_label_new("Elipse at the beginning"); break; + case clip_elipse_middle: label = gtk_label_new("Elipse in the middle"); break; + case clip_elipse_end: label = gtk_label_new("Elipse at the end"); break; + image = gtk_image_new_from_pixbuf(pixbuf); + g_object_unref(pixbuf); + gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); + gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); +/**********************************************************************/ +make_text_pos_option_menu() { + GtkWidget *option_menu, *menu; + option_menu = gtk_option_menu_new(); + for (i = 0; i < 9; i++) + gtk_menu_shell_append(GTK_MENU_SHELL(menu), make_text_pos_menu_item(i)); + gtk_widget_show_all(menu); + gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu), menu); +/**********************************************************************/ +make_text_pos_menu_item(gf_tpos pos) { + GtkWidget *item, *hbox, *label = NULL, *image; + GdkPixbuf *pixbuf = NULL; + item = gtk_menu_item_new(); + hbox = gtk_hbox_new(FALSE, 4); + gtk_container_add(GTK_CONTAINER(item), hbox); + pixbuf = get_text_position_image(pos); + case tpos_nw: label = gtk_label_new("Top Left"); break; + case tpos_n: label = gtk_label_new("Top"); break; + case tpos_ne: label = gtk_label_new("Top Right"); break; + case tpos_w: label = gtk_label_new("Left"); break; + case tpos_c: label = gtk_label_new("Center"); break; + case tpos_e: label = gtk_label_new("Right"); break; + case tpos_sw: label = gtk_label_new("Bottom Left"); break; + case tpos_s: label = gtk_label_new("Bottom"); break; + case tpos_se: label = gtk_label_new("Bottom Right"); break; + image = gtk_image_new_from_pixbuf(pixbuf); + g_object_unref(pixbuf); + gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); + gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); +/**********************************************************************/ + adj = gtk_adjustment_new(0, 0, 255, 1, 10, 10); + spin = gtk_spin_button_new(GTK_ADJUSTMENT(adj), 1, 0); + gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(spin), TRUE); +/**********************************************************************/ +make_icon_pos_option_menu() { + GtkWidget *option_menu, *menu; + option_menu = gtk_option_menu_new(); + for (i = 0; i < 10; i++) + gtk_menu_shell_append(GTK_MENU_SHELL(menu), make_icon_pos_menu_item(i)); + gtk_widget_show_all(menu); + gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu), menu); +/**********************************************************************/ +make_icon_pos_menu_item(gf_ipos pos) { + GtkWidget *item, *hbox, *label = NULL, *image; + GdkPixbuf *pixbuf = NULL; + item = gtk_menu_item_new(); + hbox = gtk_hbox_new(FALSE, 4); + gtk_container_add(GTK_CONTAINER(item), hbox); + pixbuf = get_icon_position_image(pos); + case ipos_none: label = gtk_label_new("None"); break; + case ipos_nw: label = gtk_label_new("Top Left"); break; + case ipos_n: label = gtk_label_new("Top"); break; + case ipos_ne: label = gtk_label_new("Top Right"); break; + case ipos_w: label = gtk_label_new("Left"); break; + case ipos_c: label = gtk_label_new("Center"); break; + case ipos_e: label = gtk_label_new("Right"); break; + case ipos_sw: label = gtk_label_new("Bottom Left"); break; + case ipos_s: label = gtk_label_new("Bottom"); break; + case ipos_se: label = gtk_label_new("Bottom Right"); break; + image = gtk_image_new_from_pixbuf(pixbuf); + g_object_unref(pixbuf); + gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); + gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); +/**********************************************************************/ +make_icon_size_option_menu() { + GtkWidget *option_menu, *menu; + option_menu = gtk_option_menu_new(); + for (i = 0; i < 5; i++) + gtk_menu_shell_append(GTK_MENU_SHELL(menu), make_icon_size_menu_item(i)); + gtk_widget_show_all(menu); + gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu), menu); +/**********************************************************************/ +make_icon_size_menu_item(gf_icon_size isize) { + GtkWidget *item, *hbox, *label = NULL, *image; + GdkPixbuf *pixbuf = NULL; + item = gtk_menu_item_new(); + hbox = gtk_hbox_new(FALSE, 4); + gtk_container_add(GTK_CONTAINER(item), hbox); + pixbuf = get_icon_size_image(isize); + case isize_tiny: label = gtk_label_new("Tiny (16x16)"); break; + case isize_small: label = gtk_label_new("Small (24x24)"); break; + case isize_normal: label = gtk_label_new("Normal (48x48)"); break; + case isize_large: label = gtk_label_new("Large (96x96)"); break; + case isize_huge: label = gtk_label_new("Huge (144x144)"); break; + image = gtk_image_new_from_pixbuf(pixbuf); + g_object_unref(pixbuf); + gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); + gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); +/**********************************************************************/ + theme.type = gf_theme_type_basic; + for (i = 0; i < 5; i++) { + if (theme.info[i] != NULL) + /* clear basic theme */ + if (theme.data.basic.image != NULL) + g_free(theme.data.basic.image); + theme.data.basic.image = NULL; + theme.data.basic.text_custom_font = FALSE; + if (theme.data.basic.text_font != NULL) + g_free(theme.data.basic.text_font); + theme.data.basic.text_font = NULL; + theme.data.basic.text_custom_color = FALSE; + if (theme.data.basic.text_color != NULL) + g_free(theme.data.basic.text_color); + theme.data.basic.text_color = NULL; + theme.data.basic.text_clipping = 0; + theme.data.basic.text_position = 0; + theme.data.basic.text_horz_offset = 0; + theme.data.basic.text_vert_offset = 0; + theme.data.basic.proto_position = 0; + theme.data.basic.proto_size = 0; + theme.data.basic.proto_horz_offset = 0; + theme.data.basic.proto_vert_offset = 0; + /* clear basic messages */ + for (i = 0; i < 6; i++) { + if (theme.data.basic.messages[i] != NULL) + g_free(theme.data.basic.messages[i]); + theme.data.basic.messages[i] = NULL; +/**********************************************************************/ + if (theme.info[0] != NULL) + gtk_entry_set_text(GTK_ENTRY(theme_name), theme.info[0]); + gtk_entry_set_text(GTK_ENTRY(theme_name), ""); + if (theme.info[1] != NULL) + gtk_entry_set_text(GTK_ENTRY(theme_version), theme.info[1]); + gtk_entry_set_text(GTK_ENTRY(theme_version), ""); + if (theme.info[2] != NULL) + gtk_entry_set_text(GTK_ENTRY(theme_description), theme.info[2]); + gtk_entry_set_text(GTK_ENTRY(theme_description), ""); + if (theme.info[3] != NULL) + gtk_entry_set_text(GTK_ENTRY(theme_author), theme.info[3]); + gtk_entry_set_text(GTK_ENTRY(theme_author), ""); + if (theme.info[4] != NULL) + gtk_entry_set_text(GTK_ENTRY(theme_website), theme.info[4]); + gtk_entry_set_text(GTK_ENTRY(theme_website), ""); + if (theme.data.basic.image != NULL) + gtk_entry_set_text(GTK_ENTRY(basic_image_file), theme.data.basic.image); + gtk_entry_set_text(GTK_ENTRY(basic_image_file), ""); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(basic_text_font_check), theme.data.basic.text_custom_font); + gtk_widget_set_sensitive(basic_text_font_button, theme.data.basic.text_custom_font); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(basic_text_color_check), theme.data.basic.text_custom_color); + gtk_widget_set_sensitive(basic_text_color_button, theme.data.basic.text_custom_color); + gtk_option_menu_set_history(GTK_OPTION_MENU(basic_text_clipping_menu), theme.data.basic.text_clipping); + gtk_option_menu_set_history(GTK_OPTION_MENU(basic_text_pos_menu), theme.data.basic.text_position); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(basic_text_horz_offset), theme.data.basic.text_horz_offset); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(basic_text_vert_offset), theme.data.basic.text_vert_offset); + gtk_option_menu_set_history(GTK_OPTION_MENU(basic_proto_pos_menu), theme.data.basic.proto_position); + gtk_option_menu_set_history(GTK_OPTION_MENU(basic_proto_size_menu), theme.data.basic.proto_size); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(basic_proto_horz_offset), theme.data.basic.proto_horz_offset); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(basic_proto_vert_offset), theme.data.basic.proto_vert_offset); + if (theme.data.basic.messages[0] != NULL) + gtk_entry_set_text(GTK_ENTRY(basic_message_signon), theme.data.basic.messages[0]); + gtk_entry_set_text(GTK_ENTRY(basic_message_signon), ""); + if (theme.data.basic.messages[1] != NULL) + gtk_entry_set_text(GTK_ENTRY(basic_message_signoff), theme.data.basic.messages[1]); + gtk_entry_set_text(GTK_ENTRY(basic_message_signoff), ""); + if (theme.data.basic.messages[2] != NULL) + gtk_entry_set_text(GTK_ENTRY(basic_message_away), theme.data.basic.messages[2]); + gtk_entry_set_text(GTK_ENTRY(basic_message_away), ""); + if (theme.data.basic.messages[3] != NULL) + gtk_entry_set_text(GTK_ENTRY(basic_message_back), theme.data.basic.messages[3]); + gtk_entry_set_text(GTK_ENTRY(basic_message_back), ""); + if (theme.data.basic.messages[4] != NULL) + gtk_entry_set_text(GTK_ENTRY(basic_message_idle), theme.data.basic.messages[4]); + gtk_entry_set_text(GTK_ENTRY(basic_message_idle), ""); + if (theme.data.basic.messages[5] != NULL) + gtk_entry_set_text(GTK_ENTRY(basic_message_unidle), theme.data.basic.messages[5]); + gtk_entry_set_text(GTK_ENTRY(basic_message_unidle), ""); +/**********************************************************************/ +update_modified(gboolean modified) { + title = g_strdup_printf("%s %s", base_title, (modified) ? "(Modified)" : "(Saved)"); + theme_modified = modified; + gtk_window_set_title(GTK_WINDOW(window), title); +/**********************************************************************/ +make_file_dialog(gchar *title, gboolean open, gboolean quit) { + dialog = gtk_file_selection_new(title); + g_object_set_data(G_OBJECT(dialog), "open", (gpointer)open); + g_object_set_data(G_OBJECT(dialog), "quit", (gpointer)quit); + g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(dialog)->ok_button), "clicked", G_CALLBACK(file_dialog_ok), (gpointer)dialog); + g_signal_connect_swapped(G_OBJECT(GTK_FILE_SELECTION(dialog)->cancel_button), "clicked", G_CALLBACK(gtk_widget_destroy), (gpointer)dialog); +/*********************************************************************** + *********************************************************************/ +close_editor(GtkWidget *widget, GdkEvent *event, gpointer data) { + gtk_widget_destroy(window); +/**********************************************************************/ + GtkWidget *dialog = NULL; + dialog = gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, "The theme has not been saved.\nWould you like to save it?"); + g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(modified_message_response_cb), (gpointer)dialog); + gtk_widget_show(dialog); +/**********************************************************************/ + dialog = make_file_dialog("Open...", TRUE, FALSE); + gtk_widget_show(dialog); +/**********************************************************************/ + printf("Write save file code here....\n"); +/**********************************************************************/ + dialog = make_file_dialog("Save As...", FALSE, FALSE); + gtk_widget_show(dialog); +/**********************************************************************/ + GtkWidget *dialog = NULL; + gtk_widget_destroy(window); + dialog = gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, "The theme has not been saved.\nWould you like to save it?"); + g_object_set_data(G_OBJECT(dialog), "quit", (gpointer)TRUE); + g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(modified_message_response_cb), (gpointer)dialog); + gtk_widget_show(dialog); +/**********************************************************************/ +menu_debug_theme_dump_cb() { + printf(" ********************\n"); + printf(" * THEME DUMP START\n"); + printf("**********************\n"); + printf("* Type:\t\t\t%d\n", theme.type); + printf("* Name:\t\t\t%s\n", theme.info[0]); + printf("* Version:\t\t%s\n", theme.info[1]); + printf("* Description:\t\t%s\n", theme.info[2]); + printf("* Author:\t\t%s\n", theme.info[3]); + printf("* Website:\t\t%s\n", theme.info[4]); + if (theme.type == gf_theme_type_basic) { + printf("* Image:\t\t%s\n", theme.data.basic.image); + printf("* Custom Font:\t%d\n", theme.data.basic.text_custom_font); + printf("* Font:\t\t%s\n", theme.data.basic.text_font); + printf("* Custom Color:\t%d\n", theme.data.basic.text_custom_color); + printf("* Color:\t\t%s\n", theme.data.basic.text_color); + printf("* Clipping:\t\t%d\n", theme.data.basic.text_clipping); + printf("* Position:\t\t%d\n", theme.data.basic.text_position); + printf("* Horz Offset:\t%d\n", theme.data.basic.text_horz_offset); + printf("* Vert Offset:\t%d\n", theme.data.basic.text_vert_offset); + printf("* Protocol:\n"); + printf("* Position:\t\t%d\n", theme.data.basic.proto_position); + printf("* Size:\t\t%d\n", theme.data.basic.proto_size); + printf("* Horz Offset:\t%d\n", theme.data.basic.proto_horz_offset); + printf("* Vert Offset:\t%d\n", theme.data.basic.proto_vert_offset); + printf("* Messages:\n"); + printf("* Signon:\t\t%s\n", theme.data.basic.messages[0]); + printf("* Signoff:\t\t%s\n", theme.data.basic.messages[1]); + printf("* Away:\t\t%s\n", theme.data.basic.messages[2]); + printf("* Back:\t\t%s\n", theme.data.basic.messages[3]); + printf("* Idle:\t\t%s\n", theme.data.basic.messages[4]); + printf("* Unidle:\t\t%s\n", theme.data.basic.messages[5]); + printf("**********************\n"); + printf(" * THEME DUMP END\n"); + printf(" ********************\n"); +/**********************************************************************/ +preview_option_cb(GtkWidget *widget, gpointer data) { +/**********************************************************************/ +entry_cb(GtkWidget *widget, gpointer data) { + gchar **value = (gchar**)data; + (*value) = g_strdup(gtk_entry_get_text(GTK_ENTRY(widget))); +/**********************************************************************/ +spin_button_cb(GtkWidget *widget, gpointer data) { + gint *value = (gint*)data; + (*value) = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget)); +/**********************************************************************/ +check_button_cb(GtkWidget *widget, gpointer data) { + gboolean new_value = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); + gboolean *value = (gboolean*)data; + if (value == &theme.data.basic.text_custom_font) + gtk_widget_set_sensitive(basic_text_font_button, new_value); + else if (value == &theme.data.basic.text_custom_color) + gtk_widget_set_sensitive(basic_text_color_button, new_value); +/**********************************************************************/ +option_menu_cb(GtkWidget *widget, gpointer data) { + gint *value = (gint*)data; + (*value) = gtk_option_menu_get_history(GTK_OPTION_MENU(widget)); +/**********************************************************************/ +image_file_dialog(GtkWidget *widget, gpointer data) { + gchar **value = (gchar**)data; + dialog = gtk_file_selection_new(NULL); + g_object_set_data(G_OBJECT(dialog), "var_addr", value); + gtk_file_selection_set_filename(GTK_FILE_SELECTION(dialog), (*value)); + gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(dialog)); + g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(dialog)->ok_button), "clicked", G_CALLBACK(image_file_dialog_ok), (gpointer)dialog); + g_signal_connect_swapped(G_OBJECT(GTK_FILE_SELECTION(dialog)->ok_button), "clicked", G_CALLBACK(gtk_widget_destroy), (gpointer)dialog); + g_signal_connect_swapped(G_OBJECT(GTK_FILE_SELECTION(dialog)->cancel_button), "clicked", G_CALLBACK(gtk_widget_destroy), (gpointer)dialog); + gtk_widget_show(dialog); +/**********************************************************************/ +image_file_dialog_ok(GtkWidget *widget, gpointer data) { + GtkWidget *dialog = (GtkWidget*)data, *message_box = NULL; + gchar **value = (gchar**)g_object_get_data(G_OBJECT(dialog), "var_addr"); + file = g_strdup(gtk_file_selection_get_filename(GTK_FILE_SELECTION(dialog))); + pixbuf = gdk_pixbuf_new_from_file(file, NULL); + g_object_unref(pixbuf); + gtk_entry_set_text(GTK_ENTRY(basic_image_file), file); + message_box = gtk_message_dialog_new(GTK_WINDOW(window), 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "The file \"%s\" is not a valid image file", file); + gtk_window_set_modal(GTK_WINDOW(message_box), TRUE); + g_signal_connect_swapped(G_OBJECT(message_box), "response", G_CALLBACK(gtk_widget_destroy), GTK_OBJECT(message_box)); + gtk_widget_show(message_box); +/**********************************************************************/ +font_dialog(GtkWidget *widget, gpointer data) { + gchar **value = (gchar**)data; + dialog = gtk_font_selection_dialog_new("Select a font..."); + g_object_set_data(G_OBJECT(dialog), "var_addr", value); + gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(dialog), (*value)); + gtk_font_selection_dialog_set_preview_text(GTK_FONT_SELECTION_DIALOG(dialog), "Guifications"); + g_signal_connect(G_OBJECT(GTK_FONT_SELECTION_DIALOG(dialog)->ok_button), "clicked", G_CALLBACK(font_dialog_ok), (gpointer)dialog); + g_signal_connect_swapped(G_OBJECT(GTK_FONT_SELECTION_DIALOG(dialog)->ok_button), "clicked", G_CALLBACK(gtk_widget_destroy), (gpointer)dialog); + g_signal_connect_swapped(G_OBJECT(GTK_FONT_SELECTION_DIALOG(dialog)->cancel_button), "clicked", G_CALLBACK(gtk_widget_destroy), (gpointer)dialog); + gtk_widget_show(dialog); +/**********************************************************************/ +font_dialog_ok(GtkWidget *widget, gpointer data) { + GtkWidget *dialog = (GtkWidget*)data; + gchar **value = (gchar**)g_object_get_data(G_OBJECT(dialog), "var_addr"); + (*value) = g_strdup(gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(dialog))); +/**********************************************************************/ +color_dialog(GtkWidget *widget, gpointer data) { + gchar **value = (gchar**)data; + dialog = gtk_color_selection_dialog_new("Select a color..."); + g_object_set_data(G_OBJECT(dialog), "var_addr", value); + if ((*value) != NULL) { + pango_color_parse(&pan_color, (*value)); + gdk_color.red = pan_color.red; + gdk_color.green = pan_color.green; + gdk_color.blue = pan_color.blue; + gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(dialog)->colorsel), &gdk_color); + g_signal_connect(G_OBJECT(GTK_COLOR_SELECTION_DIALOG(dialog)->ok_button), "clicked", G_CALLBACK(color_dialog_ok), (gpointer)dialog); + g_signal_connect_swapped(G_OBJECT(GTK_COLOR_SELECTION_DIALOG(dialog)->ok_button), "clicked", G_CALLBACK(gtk_widget_destroy), (gpointer)dialog); + g_signal_connect_swapped(G_OBJECT(GTK_COLOR_SELECTION_DIALOG(dialog)->cancel_button), "clicked", G_CALLBACK(gtk_widget_destroy), (gpointer)dialog); + gtk_widget_show(dialog); +/**********************************************************************/ +color_dialog_ok(GtkWidget *widget, gpointer data) { + GtkWidget *dialog = (GtkWidget*)data; + gchar **value = (gchar**)g_object_get_data(G_OBJECT(dialog), "var_addr"); + gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(dialog)->colorsel), &gdk_color); + (*value) = g_strdup_printf("#%04x%04x%04x", gdk_color.red, gdk_color.green, gdk_color.blue); +/**********************************************************************/ +modified_message_response_cb(GtkWidget *widget, gint response_id, gpointer data) { + GtkWidget *dialog = (GtkWidget*)data; + gboolean quit = (gboolean)g_object_get_data(G_OBJECT(dialog), "quit"); + theme_modified = FALSE; + gtk_window_set_title(GTK_WINDOW(window), base_title); + gtk_widget_destroy(dialog); + gtk_widget_destroy(window); +/**********************************************************************/ +file_dialog_ok(GtkWidget *widget, gpointer data) { + GtkWidget *dialog = (GtkWidget*)data; + GtkWidget *overwrite_dialog = NULL; + gboolean open = (gboolean)g_object_get_data(G_OBJECT(dialog), "open"); + gboolean quit = (gboolean)g_object_get_data(G_OBJECT(dialog), "quit"); + printf("ok clicked\n"); + gtk_widget_destroy(dialog); +/**********************************************************************/ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gf_utils.c Sat Dec 27 14:28:54 2003 +0000
@@ -0,0 +1,483 @@
+ Guifications - The notification plugin to end all notification plugins! + Copyright (C) 2003 Gary Kramlich + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#include <pango/pango.h> +/**********************************************************************/ +gf_resize(GtkWidget *window, GtkWidget *box) { + gtk_window_resize(GTK_WINDOW(window), get_window_width(box), get_window_height(box)); + gtk_window_move(GTK_WINDOW(window), get_window_x(window), get_window_y(window)); +/**********************************************************************/ +get_window_x(GtkWidget *window) { + gtk_widget_size_request(window, &req); + switch(gaim_prefs_get_int(GF_PREF_BEHAVIOR_WINDOW_POS)) { + return gdk_screen_width() - req.width; +/**********************************************************************/ +get_window_y(GtkWidget *window) { + gtk_widget_size_request(window, &req); + switch(gaim_prefs_get_int(GF_PREF_BEHAVIOR_WINDOW_POS)) { + return gdk_screen_height() - req.height; +/**********************************************************************/ +get_window_width(GtkWidget *box) { + children = gtk_container_get_children(GTK_CONTAINER(box)); + if (gaim_prefs_get_bool(GF_PREF_BEHAVIOR_WINDOW_VERTICAL)) { + child = children->data; + gtk_widget_size_request(child, &req); + child = children->data; + children = children->next; + gtk_widget_size_request(child, &req); +/**********************************************************************/ +get_window_height(GtkWidget *box) { + children = gtk_container_get_children(GTK_CONTAINER(box)); + if (gaim_prefs_get_bool(GF_PREF_BEHAVIOR_WINDOW_VERTICAL)) { + child = children->data; + children = children->next; + gtk_widget_size_request(child, &req); + new_size += req.height; + child = children->data; + gtk_widget_size_request(child, &req); +/**********************************************************************/ +get_image_size(dimensions *image_size) { + GdkPixbuf *image = NULL; + if (gaim_prefs_get_bool(GF_PREF_APPEARANCE_IMAGE)) { + image = gdk_pixbuf_new_from_file(gaim_prefs_get_string(GF_PREF_APPEARANCE_IMAGE_FILE), NULL); + gaim_prefs_set_bool(GF_PREF_APPEARANCE_IMAGE, FALSE); + gaim_prefs_set_string(GF_PREF_APPEARANCE_IMAGE_FILE, ""); + image_size->width = 140; + image_size->height = 120; + image_size->width = gdk_pixbuf_get_width(image); + image_size->height = gdk_pixbuf_get_height(image); + image_size->width = 140; + image_size->height = 120; +/**********************************************************************/ +get_zoom_size(dimensions image_size, dimensions *zoom_size) { + gfloat width = 0, height = 0; + gfloat owidth = image_size.width, oheight = image_size.height; + switch(gaim_prefs_get_int(GF_PREF_BEHAVIOR_ZOOM)) { + height = oheight * 2.0f; + width = owidth * 1.75f; + height = oheight * 1.75f; + height = oheight * 1.5f; + width = owidth * 1.25f; + height = oheight * 1.25f; + width = owidth * 0.75f; + height = oheight * 0.75f; + height = oheight * 0.5f; + width = owidth * 0.25f; + height = oheight * 0.25f; + zoom_size->width = width; + zoom_size->height = height; +/**********************************************************************/ +clip_layout(PangoLayout **layout, gboolean use_color, const gchar *text_x, const gchar *text_color) { + PangoLayout *lay = (*layout), *elipse = NULL; + const gchar *text = NULL; + gchar *new_text = NULL, *left_text = NULL, *right_text = NULL; + gint width = 0, ewidth = 0, offset = 0, mid = 0; + offset = gaim_prefs_get_int(text_x); + elipse = pango_layout_copy(lay); + pango_layout_set_text(elipse, "...", -1); + pango_layout_get_pixel_size(elipse, &ewidth, NULL); + g_object_unref(elipse); + pango_layout_get_pixel_size(lay, &width, NULL); + if ((width + offset) > dim.width) { + switch (gaim_prefs_get_int(GF_PREF_APPEARANCE_TEXT_CLIPPING)) { + pango_layout_get_pixel_size(lay, &width, NULL); + if ((width + offset) <= dim.width) + text = pango_layout_get_text(lay); + new_text = g_strndup(text, strlen(text) - 1); + pango_layout_set_text(lay, new_text, -1); + case clip_elipse_start: + pango_layout_get_pixel_size(lay, &width, NULL); + if ((width + offset + ewidth) <= dim.width) + text = pango_layout_get_text(lay); + new_text = g_strrndup(text, strlen(text) - 1); + pango_layout_set_text(lay, new_text, -1); + text = pango_layout_get_text(lay); + new_text = g_strdup_printf("...%s", text); + pango_layout_set_text(lay, new_text, -1); + case clip_elipse_middle: + pango_layout_get_pixel_size(lay, &width, NULL); + if ((width + offset + ewidth) <= dim.width) + text = pango_layout_get_text(lay); + mid = strlen(text) / 2; + if (is_even(strlen(text))) { + left_text = g_strndup(text, mid); + right_text = g_strrndup(text, mid - 1); + left_text = g_strndup(text, mid); + right_text = g_strrndup(text, mid); + new_text = g_strdup_printf("%s%s", left_text, right_text); + pango_layout_set_text(lay, new_text, -1); + new_text = g_strdup_printf("%s...%s", left_text, right_text); + pango_layout_set_text(lay, new_text, -1); + pango_layout_get_pixel_size(lay, &width, NULL); + if ((width + offset + ewidth) <= dim.width) + text = pango_layout_get_text(lay); + new_text = g_strndup(text, strlen(text) - 1); + pango_layout_set_text(lay, new_text, -1); + text = pango_layout_get_text(lay); + new_text = g_strdup_printf("%s...", text); + pango_layout_set_text(lay, new_text, -1); + text = pango_layout_get_text(lay); + new_text = g_markup_escape_text(text, -1); + pango_layout_set_text(lay, new_text, -1); + set_color(&lay, use_color, text_color); +/**********************************************************************/ +g_strrndup(const gchar *src, gint n) { + gchar *dest = g_malloc(strlen(src)); + for (i = strlen(src) - n; i < strlen(src); i++) { +/**********************************************************************/ +set_color(PangoLayout **layout, gboolean custom_color, const gchar *pref) { + PangoLayout *lay = (*layout); + text = pango_layout_get_text(lay); + pango_layout_set_markup(lay, set_text_color(text, pref), -1); + pango_layout_set_markup(lay, g_strdup_printf("<span foreground=\"%s\">%s</span>", "#000000000000", text), -1); +/**********************************************************************/ +set_text_color(const gchar *text, const gchar *pref) { + ret = g_strdup_printf("<span foreground=\"%s\">%s</span>", gaim_prefs_get_string(pref), text); +/**********************************************************************/ + switch (gaim_prefs_get_int(GF_PREF_APPEARANCE_PROT_SIZE)) { + case isize_tiny: return 16; break; + case isize_small: return 24; break; + case isize_normal: return 48; break; + case isize_large: return 96; break; + case isize_huge: return 144; break; +/**********************************************************************/ +get_text_pos(gint *x, gint *y, gboolean line, PangoLayout *layout) { + gint north, east, south, west, lat, lon; + pango_layout_get_pixel_size(layout, &width, &height); + ox = gaim_prefs_get_int(GF_PREF_APPEARANCE_TEXT_X); + oy = gaim_prefs_get_int(GF_PREF_APPEARANCE_TEXT_Y); + north = line ? oy: height + oy; + east = dim.width - (width + ox); + south = line ? dim.height - (height * 2 + oy): dim.height - (height + oy); + lat = line ? dhh - (height + ohy): dhh + ohy; /* y */ + lon = dhw - (hw + ohx); /* x */ + switch (gaim_prefs_get_int(GF_PREF_APPEARANCE_TEXT_POS)) { + case tpos_nw: (*x) = west; (*y) = north; break; + case tpos_n: (*x) = lon; (*y) = north; break; + case tpos_ne: (*x) = east; (*y) = north; break; + case tpos_w: (*x) = west; (*y) = lat; break; + case tpos_c: (*x) = lon; (*y) = lat; break; + case tpos_e: (*x) = east; (*y) = lat; break; + case tpos_sw: (*x) = west; (*y) = south; break; + case tpos_s: (*x) = lon; (*y) = south; break; + case tpos_se: (*x) = east; (*y) = south; break; +/**********************************************************************/ +get_icon_pos(gint *x, gint *y) { + gint north, east, south, west, lat, lon; + width = height = get_proto_icon_size(); + ox = gaim_prefs_get_int(GF_PREF_APPEARANCE_PROT_X); + oy = gaim_prefs_get_int(GF_PREF_APPEARANCE_PROT_Y); + east = dim.width - (width + ox); + south = dim.height - (height + oy); + lat = dhh - (hh + ohy); /* y */ + lon = dhw - (hw + ohx); /* x */ + switch (gaim_prefs_get_int(GF_PREF_APPEARANCE_PROT_POS)) { + case ipos_none: (*x) = -1; (*y) = -1; break; + case ipos_nw: (*x) = west; (*y) = north; break; + case ipos_n: (*x) = lon; (*y) = north; break; + case ipos_ne: (*x) = east; (*y) = north; break; + case ipos_w: (*x) = west; (*y) = lat; break; + case ipos_c: (*x) = lon; (*y) = lat; break; + case ipos_e: (*x) = east; (*y) = lat; break; + case ipos_sw: (*x) = west; (*y) = south; break; + case ipos_s: (*x) = lon; (*y) = south; break; + case ipos_se: (*x) = east; (*y) = south; break; +/**********************************************************************/ +get_proto_icon(GaimBuddy *buddy) { + GaimPluginProtocolInfo *prplinfo = NULL; + GdkPixbuf *src = NULL, *ret = NULL; + gint height = 0, width = 0; + prplinfo = GAIM_PLUGIN_PROTOCOL_INFO(gaim_find_prpl(gaim_account_get_protocol(buddy->account))); + proto = g_strdup_printf("%s.png", prplinfo->list_icon(buddy->account, buddy)); + file = g_build_filename(DATADIR, "pixmaps", "gaim", "status", "default", proto, NULL); + src = gdk_pixbuf_new_from_file(file, NULL); + width = height = get_proto_icon_size(); + ret = gdk_pixbuf_scale_simple(src, width, height, GDK_INTERP_BILINEAR); +/**********************************************************************/ +/**********************************************************************/ --- a/gf_utils.h Sat Dec 27 14:20:24 2003 +0000
+++ b/gf_utils.h Sat Dec 27 14:28:54 2003 +0000
@@ -46,10 +46,10 @@
void set_color(PangoLayout **layout, gboolean custom_color, const gchar *pref);
gchar *set_text_color(const gchar *text, const gchar *pref);
gchar *g_strrndup(const gchar *src, gint n);
+gint get_proto_icon_size(); gboolean is_even(gint number);
void get_text_pos(gint *x, gint *y, gboolean line, PangoLayout *layout);
-void get_icon_pos(gint *x, gint *y);
+void get_proto_pos(gint *x, gint *y); GdkPixbuf *get_proto_icon(GaimBuddy *buddy);
/**********************************************************************/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/grimdirtreeview.c Sat Dec 27 14:28:54 2003 +0000
@@ -0,0 +1,520 @@
+#include "grimdirtreeview.h" +/* folder icons taken from galeon */ +static const char * folder_xpm[] = { +static const char * folder_open_xpm[] = { +static void grim_dir_tree_view_class_init(GrimDirTreeViewClass *klass); +static void grim_dir_tree_view_init(GrimDirTreeView *dir_tree_view); +static void add_dir(GtkTreeStore *store, GtkTreeIter *parent, gchar *parent_path, gchar *child_path); +static void expand_cb(GrimDirTreeView *dir_tree_view, GtkTreeIter *iter, GtkTreePath *path, gpointer data); +static void collapse_cb(GrimDirTreeView *dir_tree_view, GtkTreeIter *iter, GtkTreePath *path, gpointer data); +static void add_root_node(GrimDirTreeView *dir_tree_view); +static gboolean has_subdir(gchar *path); +grim_dir_tree_view_get_type (void) { + static GType dir_tree_view_type = 0; + if (!dir_tree_view_type) { + static const GTypeInfo dir_tree_view_type_info = { + sizeof (GrimDirTreeViewClass), + NULL, /* base_finalize */ + (GClassInitFunc) grim_dir_tree_view_class_init, + NULL, /* class_finalize */ + sizeof (GrimDirTreeView), + (GInstanceInitFunc) grim_dir_tree_view_init, + dir_tree_view_type = g_type_register_static(GTK_TYPE_TREE_VIEW, + &dir_tree_view_type_info, + return dir_tree_view_type; +grim_dir_tree_view_class_init(GrimDirTreeViewClass *klass) { +grim_dir_tree_view_init(GrimDirTreeView *dir_tree_view) { + GtkTreeViewColumn *directory; + GtkCellRenderer *renderer; + /* initialize variables */ + dir_tree_view->store = gtk_tree_store_new(DIR_COL_COUNT, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); + add_root_node(dir_tree_view); + /* set globals for tree view */ + gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(dir_tree_view), FALSE); + /* create and add the directory column to the tree view */ + directory = gtk_tree_view_column_new(); + //gtk_tree_view_column_set_alignment(directory, 0); + gtk_tree_view_append_column(GTK_TREE_VIEW(&dir_tree_view->tree_view), directory); + /* create and pack the cell renderer(s) */ + renderer = gtk_cell_renderer_pixbuf_new(); + gtk_tree_view_column_pack_start(directory, renderer, FALSE); + gtk_tree_view_column_add_attribute(directory, renderer, "pixbuf", DIR_COL_ICON); + renderer = gtk_cell_renderer_text_new(); + gtk_tree_view_column_pack_start(directory, renderer, FALSE); + gtk_tree_view_column_add_attribute(directory, renderer, "text", DIR_COL_TEXT); + g_signal_connect(G_OBJECT(dir_tree_view), "row_expanded", G_CALLBACK(expand_cb), NULL); + g_signal_connect(G_OBJECT(dir_tree_view), "row_collapsed", G_CALLBACK(collapse_cb), NULL); + /* attach the store to the tree view */ + gtk_tree_view_set_model(GTK_TREE_VIEW(&dir_tree_view->tree_view), GTK_TREE_MODEL(dir_tree_view->store)); +has_subdir(gchar *path) { + gchar *new_path, *name; + if (g_path_is_absolute(path)) { + if ((directory = g_dir_open(path, 0, FALSE)) != NULL) { + while ((name = g_strdup(g_dir_read_name(directory))) != NULL) { + /* add check for show hidden when I add the property */ + new_path = g_strconcat(path, name, NULL); + new_path = g_strdup(name); + if (g_file_test(new_path, G_FILE_TEST_IS_DIR)) { + g_dir_close(directory); + g_dir_close(directory); +add_dir(GtkTreeStore *store, GtkTreeIter *parent, gchar *parent_path, gchar *child_path) { + GtkTreeIter current, child; + /* tweak when show hidden property is added */ + if (child_path[0] == '.') + pixbuf = gdk_pixbuf_new_from_xpm_data(folder_xpm); + if (parent_path != NULL) + new_path = g_strconcat(parent_path, child_path, G_DIR_SEPARATOR_S, NULL); + if (g_ascii_strcasecmp(child_path, G_DIR_SEPARATOR_S) == 0) + new_path = g_strdup(child_path); + new_path = g_strconcat(child_path, G_DIR_SEPARATOR_S, NULL); + if (g_file_test(new_path, G_FILE_TEST_IS_DIR)) { + gtk_tree_store_append(store, ¤t, parent); + gtk_tree_store_set(store, ¤t, DIR_COL_ICON, pixbuf, DIR_COL_TEXT, child_path, DIR_COL_PATH, new_path, -1); + if (has_subdir(new_path)) { + gtk_tree_store_append(store, &child, ¤t); + gtk_tree_store_set(store, &child, DIR_COL_TEXT, "", DIR_COL_PATH, NULL, -1); + g_object_unref(pixbuf); +expand_cb(GrimDirTreeView *dir_tree_view, GtkTreeIter *iter, GtkTreePath *path, gpointer data) { + GtkTreeSortable *sortable; + gchar *dir_path, *child_path = NULL; + gtk_tree_model_get(GTK_TREE_MODEL(dir_tree_view->store), iter, DIR_COL_PATH, &dir_path, -1); + pixbuf = gdk_pixbuf_new_from_xpm_data(folder_open_xpm); + gtk_tree_store_set(dir_tree_view->store, iter, DIR_COL_ICON, pixbuf, -1); + g_object_unref(pixbuf); + if (gtk_tree_model_iter_children(GTK_TREE_MODEL(dir_tree_view->store), &child, iter)) { + gtk_tree_model_get(GTK_TREE_MODEL(dir_tree_view->store), &child, DIR_COL_PATH, &child_path); + if (child_path == NULL) { + if ((directory = g_dir_open(dir_path, 0, NULL)) != NULL) { + cursor = gdk_cursor_new(GDK_WATCH); + if (!GTK_WIDGET_REALIZED(dir_tree_view)) + gtk_widget_realize(GTK_WIDGET(dir_tree_view)); + gdk_window_set_cursor(GTK_WIDGET(dir_tree_view)->window, cursor); + while ((name = g_strdup(g_dir_read_name(directory))) != NULL) { + add_dir(dir_tree_view->store, iter, dir_path, name); + g_dir_close(directory); + gdk_window_set_cursor(GTK_WIDGET(dir_tree_view)->window, NULL); + gdk_cursor_unref(cursor); + gtk_tree_store_remove(dir_tree_view->store, &child); + sortable = GTK_TREE_SORTABLE(dir_tree_view->store); + gtk_tree_sortable_set_sort_column_id(sortable, DIR_COL_TEXT, GTK_SORT_ASCENDING); +collapse_cb(GrimDirTreeView *dir_tree_view, GtkTreeIter *iter, GtkTreePath *path, gpointer data) { + GtkTreeIter holder, child; + pixbuf = gdk_pixbuf_new_from_xpm_data(folder_xpm); + gtk_tree_store_set(dir_tree_view->store, iter, DIR_COL_ICON, pixbuf, -1); + g_object_unref(pixbuf); + count = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(dir_tree_view->store), iter); + gtk_tree_store_append(dir_tree_view->store, &holder, iter); + gtk_tree_store_set(dir_tree_view->store, &holder, DIR_COL_PATH, NULL, -1); + for (i = 0; i < count; i++) { + gtk_tree_model_iter_children(GTK_TREE_MODEL(dir_tree_view->store), &child, iter); + gtk_tree_store_remove(dir_tree_view->store, &child); +grim_dir_tree_view_new() { + return GTK_WIDGET (g_object_new(grim_dir_tree_view_get_type(), NULL)); +grim_dir_tree_view_get_path(GrimDirTreeView *dir_tree_view) { + GtkTreeSelection *selection; + gchar *path = NULL, *ret_path; + selection = gtk_tree_view_get_selection(&dir_tree_view->tree_view); + if (gtk_tree_selection_get_selected(selection, NULL, &selected)) { + gtk_tree_model_get(GTK_TREE_MODEL(dir_tree_view->store), &selected, DIR_COL_PATH, &path, -1); + if (path[0] == path[1] && path[0] == G_DIR_SEPARATOR) + ret_path = g_strdup(path); +grim_dir_tree_view_set_path(GrimDirTreeView *dir_tree_view, const gchar *path) { + GtkTreeSelection *selection; + GtkTreePath *tree_path; + GtkTreeIter parent, child; + gchar *search_path = NULL, *new_path = NULL, *child_path = NULL; + directories = g_strsplit(path, G_DIR_SEPARATOR_S, 0); + while (directories[dir] != NULL) { + search_path = g_strdup(G_DIR_SEPARATOR_S); + gtk_tree_model_get_iter_first(GTK_TREE_MODEL(dir_tree_view->store), &parent); + tree_path = gtk_tree_model_get_path(GTK_TREE_MODEL(dir_tree_view->store), &parent); + gtk_tree_view_expand_row(GTK_TREE_VIEW(dir_tree_view), tree_path, TRUE); + gtk_tree_path_free(tree_path); + new_path = g_strdup_printf("%s%s%s", search_path, directories[dir], G_DIR_SEPARATOR_S); + if(gtk_tree_model_iter_children(GTK_TREE_MODEL(dir_tree_view->store), &child, &parent)) { + search_path = g_strdup(new_path); + gtk_tree_model_get(GTK_TREE_MODEL(dir_tree_view->store), &child, DIR_COL_PATH, &child_path, -1); + if (g_ascii_strcasecmp(search_path, child_path) == 0) { + if (g_ascii_strncasecmp(path, child_path, strlen(path)) != 0) { + tree_path = gtk_tree_model_get_path(GTK_TREE_MODEL(dir_tree_view->store), &child); + gtk_tree_view_expand_row(GTK_TREE_VIEW(dir_tree_view), tree_path, TRUE); + gtk_tree_path_free(tree_path); + if (!gtk_tree_model_iter_next(GTK_TREE_MODEL(dir_tree_view->store), &child)) { + g_strfreev(directories); + if (search_path != NULL) + g_strfreev(directories); + gtk_widget_grab_focus(GTK_WIDGET(dir_tree_view)); + selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dir_tree_view)); + gtk_tree_selection_unselect_all(selection); + gtk_tree_selection_select_iter(selection, &child); +grim_dir_tree_view_set_show_hidden(GrimDirTreeView *dir_tree_view, gboolean value) { + dir_tree_view->show_hidden = value; + path = grim_dir_tree_view_get_path(dir_tree_view); + gtk_tree_store_clear(dir_tree_view->store); + add_root_node(dir_tree_view); +grim_dir_tree_view_get_show_hidden(GrimDirTreeView *dir_tree_view) { + return dir_tree_view->show_hidden; +add_root_node(GrimDirTreeView *dir_tree_view) { + drives = GetLogicalDrives(); + for (i = 0; i < 32; i++) { + if ((drives & (int)exp2(i)) == exp2(i)) { + drive = g_strdup_printf("%c:\\", 65 + i); + add_dir(dir_tree_view->store, NULL, NULL, drive); + add_dir(dir_tree_view->store, NULL, NULL, G_DIR_SEPARATOR_S); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/grimdirtreeview.h Sat Dec 27 14:28:54 2003 +0000
@@ -0,0 +1,48 @@
+#ifndef __GRIM_DIR_TREE_VIEW__ +#define __GRIM_DIR_TREE_VIEW__ +#include <glib-object.h> +#include <gtk/gtktreeview.h> +#endif /* __cplusplus */ +#define GRIM_TYPE_DIR_TREE_VIEW (grim_dir_tree_view_get_type ()) +#define GRIM_DIR_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GRIM_TYPE_DIR_TREE_VIEW, GrimDirTreeView)) +#define GRIM_DIR_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GRIM_TYPE_DIR_TREE_VIEW, GrimDirTreeViewClass)) +#define GRIM_IS_DIR_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GRIM_TYPE_DIR_TREE_VIEW)) +#define GRIM_IS_DIR_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GRIM_TYPE_DIR_TREE_VIEW)) +#define GRIM_DIR_TREE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GRIM_TYPE_DIR_TREE_VIEW, GrimDirTreeViewClass)) +typedef struct _GrimDirTreeView GrimDirTreeView; +typedef struct _GrimDirTreeViewClass GrimDirTreeViewClass; +struct _GrimDirTreeView { +struct _GrimDirTreeViewClass { + GtkTreeViewClass parent_class; +GType grim_dir_tree_view_get_type(void); +GtkWidget *grim_dir_tree_view_new(void); +const gchar *grim_dir_tree_view_get_path(GrimDirTreeView *dir_tree_view); +gboolean grim_dir_tree_view_set_path(GrimDirTreeView *dir_tree_view, const gchar *path); +void grim_dir_tree_view_set_show_hidden(GrimDirTreeView *dir_tree_view, gboolean value); +gboolean grim_dir_tree_view_get_show_hidden(GrimDirTreeView *dir_tree_view); +#endif /* __cplusplus */ +#endif /* __GTK_DIR_TREE_VIEW__ */ --- a/guifications.c Sat Dec 27 14:20:24 2003 +0000
+++ b/guifications.c Sat Dec 27 14:28:54 2003 +0000
@@ -324,7 +324,7 @@
g_object_unref(background);
if (gaim_prefs_get_int(GF_PREF_APPEARANCE_PROT_POS) != ipos_none) {
- get_icon_pos(&px, &py);
+ get_proto_pos(&px, &py); protocol = get_proto_icon(buddy);
gdk_draw_pixbuf(GDK_DRAWABLE(memmap), gf_window->style->bg_gc[GTK_STATE_NORMAL], protocol, 0, 0, px, py, -1, -1, GDK_RGB_DITHER_NORMAL, 0, 0);
g_object_unref(protocol);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/guifications.h Sat Dec 27 14:28:54 2003 +0000
@@ -0,0 +1,138 @@
+ Guifications - The notification plugin to end all notification plugins! + Copyright (C) 2003 Gary Kramlich + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#define my_id "Gtk-amc_grim-Guifications" +#define my_name "Guifications" +#define my_version "1.5-Internal" +#define my_summary "The notification plugin to end all notification plugins!" +#define my_description "Guifications: The Pimpin' Penguin Notification Plugin thats good for the soul!" +#define my_authors "Gary Kramlich <amc_grim@users.sf.net>" +#define my_homepage "http://guifications.sourceforge.net" +/*********************************************************************** +***********************************************************************/ +typedef enum _gf_guification_event { +/**********************************************************************/ +typedef enum _gf_gfpos { +/**********************************************************************/ +/**********************************************************************/ +/**********************************************************************/ +typedef enum _gf_position { +/**********************************************************************/ +typedef enum _gf_icon_size { +/**********************************************************************/ +/**********************************************************************/ +typedef enum _gf_mouse { +/**********************************************************************/ +/**********************************************************************/ +/*********************************************************************** +***********************************************************************/ +GdkPixmap *make_guification(GaimBuddy *buddy, gf_guification_event event); +/**********************************************************************/ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pixmaps/Makefile.am Sat Dec 27 14:28:54 2003 +0000
@@ -0,0 +1,35 @@
+ clip_elipse_middle.png \ + clip_elipse_start.png \ + position_north_east.png \ + position_north_west.png \ + position_south_east.png \ + position_south_west.png \ + protocol_size_huge.png \ + protocol_size_large.png \ + protocol_size_normal.png \ + protocol_size_small.png \ + protocol_size_tiny.png \ + window_position_north_east.png \ + window_position_north_west.png \ + window_position_south_east.png \ + window_position_south_west.png \ +EXTRA_DIST2 = Makefile.mingw +guificationsconfpixdir = $(datadir)/pixmaps/gaim/guifications/conf +guificationsconfpix_DATA = $(EXTRA_DIST) +guificationsbackgroundspixdir = $(datadir)/pixmaps/gaim/guifications/backgrounds +guificationsbackgroundspix_DATA = background_default.png --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pixmaps/Makefile.mingw Sat Dec 27 14:28:54 2003 +0000
@@ -0,0 +1,17 @@
+# Description: Makefile for guifications pixmaps +datadir = ../../../win32-install-dir + if test '$(guificationsconfpix_DATA)'; then \ + mkdir -p $(guificationsconfpixdir); \ + cp $(guificationsconfpix_DATA) $(guificationsconfpixdir); \ + if test '$(guificationsbackgroundspix_DATA)'; then \ + mkdir -p $(guificationsbackgroundspixdir); \ + cp $(guificationsbackgroundspix_DATA) $(guificationsbackgroundspixdir); \ Binary file pixmaps/background_default.png has changed
Binary file pixmaps/clip_elipse_end.png has changed
Binary file pixmaps/clip_elipse_middle.png has changed
Binary file pixmaps/clip_elipse_start.png has changed
Binary file pixmaps/clip_truncate.png has changed
Binary file pixmaps/position_center.png has changed
Binary file pixmaps/position_east.png has changed
Binary file pixmaps/position_none.png has changed
Binary file pixmaps/position_north.png has changed
Binary file pixmaps/position_north_east.png has changed
Binary file pixmaps/position_north_west.png has changed
Binary file pixmaps/position_south.png has changed
Binary file pixmaps/position_south_east.png has changed
Binary file pixmaps/position_south_west.png has changed
Binary file pixmaps/position_west.png has changed
Binary file pixmaps/protocol_size_huge.png has changed
Binary file pixmaps/protocol_size_large.png has changed
Binary file pixmaps/protocol_size_normal.png has changed
Binary file pixmaps/protocol_size_small.png has changed
Binary file pixmaps/protocol_size_tiny.png has changed
Binary file pixmaps/window_position_north_east.png has changed
Binary file pixmaps/window_position_north_west.png has changed
Binary file pixmaps/window_position_south_east.png has changed
Binary file pixmaps/window_position_south_west.png has changed
Binary file pixmaps/zoom_in.png has changed
Binary file pixmaps/zoom_normal.png has changed
Binary file pixmaps/zoom_out.png has changed