Start of the clean up for the next release..
--- a/AUTHORS Thu Jan 15 15:25:19 2004 +0000
+++ b/AUTHORS Wed Mar 10 00:59:18 2004 +0000
@@ -7,4 +7,4 @@
Stu Tomlinson for the rpm's
-Nathan Walp for helping cleanup the out of tree compile
+Nathan Walp for helping with cleaning up the out of tree compile --- a/ChangeLog Thu Jan 15 15:25:19 2004 +0000
+++ b/ChangeLog Wed Mar 10 00:59:18 2004 +0000
@@ -1,8 +1,8 @@
* Added a signal emit so that we can display other plugins contributions to
- * Added configure arguments to the advanced tab. Not much use for this yet
+ * Fixed some memory leaks in the ellipsis code + * Fixed some spelling mistakes * Guifications will no longer work with Gaim prior to 0.75, if you do
--- a/VERSION Thu Jan 15 15:25:19 2004 +0000
+++ b/VERSION Wed Mar 10 00:59:18 2004 +0000
@@ -1,1 +1,1 @@
--- a/src/Makefile.am Thu Jan 15 15:25:19 2004 +0000
+++ b/src/Makefile.am Wed Mar 10 00:59:18 2004 +0000
@@ -6,9 +6,7 @@
plugindir = $(libdir)/gaim
@@ -24,8 +22,7 @@
--- a/src/gf_conf.c Thu Jan 15 15:25:19 2004 +0000
+++ b/src/gf_conf.c Wed Mar 10 00:59:18 2004 +0000
@@ -80,7 +80,7 @@
sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
/* create behavior tab */
- vbox = gf_add_page(GTK_NOTEBOOK(note), "Bahavior", -1);
+ vbox = gf_add_page(GTK_NOTEBOOK(note), "Behavior", -1); /* create notification frame */
frame = gaim_gtk_make_frame(vbox, "Notifications");
--- a/src/gf_gtkutils.c Thu Jan 15 15:25:19 2004 +0000
+++ b/src/gf_gtkutils.c Wed Mar 10 00:59:18 2004 +0000
@@ -20,7 +20,6 @@
/***********************************************************************
@@ -170,10 +169,18 @@
- case text_clipping_truncate: label = gtk_label_new("Truncate"); break;
- case text_clipping_elipse_start: label = gtk_label_new("Elipse at the beginning"); break;
- case text_clipping_elipse_middle: label = gtk_label_new("Elipse in the middle"); break;
- case text_clipping_elipse_end: label = gtk_label_new("Elipse at the end"); break;
+ case text_clipping_truncate: + label = gtk_label_new("Truncate"); + case text_clipping_elipse_start: + label = gtk_label_new("Ellipsis at the beginning"); + case text_clipping_elipse_middle: + label = gtk_label_new("Ellipsis in the middle"); + case text_clipping_elipse_end: + label = gtk_label_new("Ellipsis at the end"); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
--- a/src/gf_gtkutils.h Thu Jan 15 15:25:19 2004 +0000
+++ b/src/gf_gtkutils.h Wed Mar 10 00:59:18 2004 +0000
@@ -22,7 +22,6 @@
GtkWidget *gf_make_hig_frame(GtkWidget *parent, const gchar *title);
GtkWidget *gf_make_label(gchar *text, GtkSizeGroup *sg);
--- a/src/gf_pixbuf.c Thu Jan 15 15:25:19 2004 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,315 +0,0 @@
- Guifications - The notification plugin to end all notification plugins!
- Copyright (C) 2003-2004 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_format_text(GaimBuddy *buddy, gint line, gf_event event, gf_theme *theme) {
- %N = Screen Name %A = Alias
- %P = Protocol %M = Away Message
- %C = Account %W = Warning level
- char formatted[255], *format;
- format = theme->notification[event].text[line].format;
- case 'N': /* screen name */
- for (i = 0; i < strlen(buddy->name); i++)
- formatted[c+i] = buddy->name[i];
- case 'A': /* alias, follows alias pref rules */
- buff = g_strdup(gaim_get_buddy_alias(buddy));
- for (i = 0; i < strlen(buff); i++)
- formatted[c+i] = buff[i];
- case 'P': /* protocol */
- buff = g_strdup(gaim_account_get_protocol_id(buddy->account));
- for (i = 0; i < strlen(buff); i++)
- formatted[c+i] = buff[i];
- case 'M': /* away message if event isn't away this value
- if (event == gf_event_away) {
- /*buff = g_strdup(serv_get_away(buddy->account->gc, buddy->name)); */
- for (i = 0; i < strlen(buff); i++)
- formatted[c+i] = buff[i];
- case 'C': /* account name */
- buff = g_strdup(buddy->account->username);
- for (i = 0; i < strlen(buff); i++)
- formatted[c+i] = buff[i];
- case 'W': /* warning level, if protocol isn't oscar this
- formatted[i] = *format;
- return g_strdup(formatted);
-gf_background_get_size(gint *width, gint *height, gf_event event, gf_theme *theme) {
- if (g_path_is_absolute(theme->notification[event].image))
- filename = g_strdup(theme->notification[event].image);
- filename = g_build_filename(theme->directory, theme->notification[event].image, NULL);
- background = gdk_pixbuf_new_from_file(filename, &error);
- if (background == NULL) {
- gaim_debug_info("Guifications", "Error getting background image size: %s\n", error->message);
- *width = gdk_pixbuf_get_width(background);
- *height = gdk_pixbuf_get_height(background);
- g_object_unref(background);
-gf_icon_get_size(gint icon, gf_event event, gf_theme *theme) {
- switch (theme->notification[event].icon[icon].size) {
- case icon_size_tiny: return 16; break;
- case icon_size_small: return 24; break;
- case icon_size_normal: return 48; break;
- case icon_size_large: return 96; break;
- case icon_size_huge: return 144; break;
- default: return 0; break;
-gf_icon_get_position(gint *x, gint *y, gint icon, gf_event event, gf_theme *theme) {
- gint bg_width, bg_height;
- gint bg_half_width, bg_half_height;
- gint icon_size, icon_half_size;
- gint icon_offset_x, icon_offset_y;
- gint icon_half_offset_x, icon_half_offset_y;
- gint north, east, south, west, lat, lon;
- gf_background_get_size(&bg_width, &bg_height, event, theme);
- if ((bg_width == -1) || (bg_height == -1)) {
- gaim_debug_info("Guifications", "Failed to get background image size\n");
- bg_half_width = bg_width / 2;
- bg_half_height = bg_height / 2;
- icon_size = gf_icon_get_size(icon, event, theme);
- icon_half_size = icon_size / 2;
- icon_offset_x = theme->notification[event].icon[icon].item.offset_horizontal;
- icon_offset_y = theme->notification[event].icon[icon].item.offset_vertical;
- icon_half_offset_x = icon_offset_x / 2;
- icon_half_offset_y = icon_offset_y / 2;
- north = icon_half_offset_y;
- east = bg_width - (icon_size + icon_offset_x);
- south = bg_height - (icon_size + icon_offset_y);
- lon = bg_half_width - (icon_half_size + icon_half_offset_x); /* x */
- lat = bg_half_height - (icon_half_size + icon_half_offset_y); /* y */
- switch (theme->notification[event].icon[icon].position) {
- case item_position_nw: *x = west; *y = north; break;
- case item_position_n: *x = lon; *y = north; break;
- case item_position_ne: *x = east; *y = north; break;
- case item_position_w: *x = west; *y = lat; break;
- case item_position_c: *x = lon; *y = lat; break;
- case item_position_e: *x = east; *y = lat; break;
- case item_position_sw: *x = west; *y = south; break;
- case item_position_s: *x = lon; *y = south; break;
- case item_position_se: *x = east; *y = south; break;
-gf_get_text_position(gint *x, gint *y, gint line, PangoLayout *layout, gf_event event, gf_theme *theme) {
- gint bg_width, bg_height;
- gint bg_half_width, bg_half_height;
- gint text_width, text_height;
- gint text_half_width, text_half_height;
- gint text_offset_x, text_offset_y;
- gint text_half_offset_x, text_half_offset_y;
- gint north, east, south, west, lat, lon;
- gf_background_get_size(&bg_width, &bg_height, event, theme);
- bg_half_width = bg_width / 2;
- bg_half_height = bg_height / 2;
- pango_layout_get_pixel_size(layout, &text_width, &text_height);
- if (theme->notification[event].text[line].width != 0)
- text_width = theme->notification[event].text[line].width;
- text_half_width = text_width / 2;
- text_half_height = text_height / 2;
- text_offset_x = theme->notification[event].text[line].item.offset_horizontal;
- text_offset_y = theme->notification[event].text[line].item.offset_vertical;
- text_half_offset_x = text_offset_x / 2;
- text_half_offset_y = text_offset_y / 2;
- east = bg_width - (text_width + text_offset_x);
- south = bg_height - (text_height + text_offset_y);
- lon = bg_half_width - (text_half_width + text_half_offset_x); /* x */
- lat = bg_half_height - (text_half_height + text_half_offset_y); /* y */
- switch (theme->notification[event].text[line].position) {
- case item_position_nw: *x = west; *y = north; break;
- case item_position_n: *x = lon; *y = north; break;
- case item_position_ne: *x = east; *y = north; break;
- case item_position_w: *x = west; *y = lat; break;
- case item_position_c: *x = lon; *y = lat; break;
- case item_position_e: *x = east; *y = lat; break;
- case item_position_sw: *x = west; *y = south; break;
- case item_position_s: *x = lon; *y = south; break;
- case item_position_se: *x = east; *y = south; break;
-gf_get_event_background(gf_event event, gf_theme *theme) {
- GdkPixbuf *background = NULL;
- if (g_path_is_absolute(theme->notification[event].image))
- filename = g_strdup(theme->notification[event].image);
- filename = g_build_filename(theme->directory, theme->notification[event].image, NULL);
- background = gdk_pixbuf_new_from_file(filename, &error);
- if (background == NULL)
- gaim_debug_info("Guifications", "Error loading %s: %s\n", filename, error->message);
-gf_make_pixbuf(GaimBuddy *buddy, gf_event event, gf_theme *theme) {
- GdkPixbuf *gf_pixbuf = NULL;
- GdkPixbuf *background = NULL;
- GdkPixbuf *icon = NULL, *icon_scaled = NULL;
- gint icon_size = 0, icon_x = 0, icon_y = 0;
- const char *buddy_icon_file;
- if ((background = gf_get_event_background(event, theme)) == NULL)
- gf_pixbuf = gdk_pixbuf_copy(background);
- g_object_unref(background);
- if (theme->notification[event].icons > 0)
- for (i = 0; i < theme->notification[event].icons; i++) {
- if (!theme->notification[event].icon[i].item.visible)
- switch (theme->notification[event].icon[i].type) {
- icon = create_prpl_icon(buddy->account);
- if ((buddy_icon_file = gaim_blist_node_get_string((GaimBlistNode*)buddy, "buddy_icon")) == NULL)
- icon = gdk_pixbuf_new_from_file(buddy_icon_file, NULL);
- icon = gaim_gtk_blist_get_status_icon((GaimBlistNode*)buddy, GAIM_STATUS_ICON_LARGE);
- icon_size = gf_icon_get_size(i, event, theme);
- icon_scaled = gdk_pixbuf_scale_simple(icon, icon_size, icon_size, GDK_INTERP_BILINEAR);
- gf_icon_get_position(&icon_x, &icon_y, i, event, theme);
- gdk_pixbuf_composite(icon_scaled, gf_pixbuf,
- g_object_unref(icon_scaled);
- if (theme->notification[event].lines > 0)
- for (i = 0; i < theme->notification[event].lines; i++) {
--- a/src/gf_pixbuf.h Thu Jan 15 15:25:19 2004 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
- Guifications - The notification plugin to end all notification plugins!
- Copyright (C) 2003-2004 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.
-GdkPixbuf *gf_make_pixbuf(GaimBuddy *buddy, gf_event event, gf_theme *theme);
--- a/src/gf_pngs.c Thu Jan 15 15:25:19 2004 +0000
+++ b/src/gf_pngs.c Wed Mar 10 00:59:18 2004 +0000
@@ -27,7 +27,6 @@
/***********************************************************************
--- a/src/gf_pngs.h Thu Jan 15 15:25:19 2004 +0000
+++ b/src/gf_pngs.h Wed Mar 10 00:59:18 2004 +0000
@@ -22,7 +22,6 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
/***********************************************************************
**********************************************************************/
--- a/src/gf_prefs.c Thu Jan 15 15:25:19 2004 +0000
+++ b/src/gf_prefs.c Wed Mar 10 00:59:18 2004 +0000
@@ -20,7 +20,6 @@
/**********************************************************************/
--- a/src/gf_theme.h Thu Jan 15 15:25:19 2004 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
- Guifications - The notification plugin to end all notification plugins!
- Copyright (C) 2003-2004 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.
-typedef enum _gf_theme_info {
- gf_theme_info_name = 0,
- gf_theme_info_description,
-typedef enum _gf_item_position {
-typedef enum _gf_text_clipping {
- text_clipping_truncate = 0,
- text_clipping_elipse_start,
- text_clipping_elipse_middle,
- text_clipping_elipse_end
-typedef enum _gf_icon_size {
-typedef struct _gf_theme_item {
- gint offset_horizontal;
-typedef struct _gf_theme_shadow {
-typedef struct _gf_theme_text {
- gf_item_position position;
- gf_text_clipping clipping;
- gf_theme_shadow shadow;
-typedef struct _gf_theme_icon {
- gf_item_position position;
- gf_theme_shadow shadow;
-typedef struct _gf_theme_notification {
-} gf_theme_notification;
-typedef struct _gf_theme {
- gf_theme_notification notification[7];
- /* this member should be consider private, the plugin will fill it
- in when it loads the theme, so we can use multiple theme dirs */
--- a/src/gf_types.h Thu Jan 15 15:25:19 2004 +0000
+++ b/src/gf_types.h Wed Mar 10 00:59:18 2004 +0000
@@ -55,4 +55,31 @@
+typedef enum _gf_item_position { +typedef enum _gf_text_clipping { + text_clipping_truncate = 0, + text_clipping_elipse_start, + text_clipping_elipse_middle, + text_clipping_elipse_end +typedef enum _gf_icon_size { --- a/src/gf_utils.c Thu Jan 15 15:25:19 2004 +0000
+++ b/src/gf_utils.c Wed Mar 10 00:59:18 2004 +0000
@@ -34,7 +34,6 @@
/**********************************************************************/
@@ -234,6 +233,7 @@
text = pango_layout_get_text(lay);
new_text = g_strndup(text, strlen(text) - 1);
pango_layout_set_text(lay, new_text, -1);
@@ -249,6 +249,7 @@
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);
@@ -276,10 +277,23 @@
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);
+ 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);
@@ -298,6 +312,7 @@
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);