grim/guifications2

Fix cp gf_config.h.mingw gf_config.h
org.guifications.gf2
2007-05-02, datallah
5e11127271b1
Fix cp gf_config.h.mingw gf_config.h
make -C ./src -f Makefile.mingw
make[1]: Entering directory `/home/datallah/winpidgin/gf2/src'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/datallah/winpidgin/gf2/src'
make -C ./po -f Makefile.mingw
make[1]: Entering directory `/home/datallah/winpidgin/gf2/po'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/datallah/winpidgin/gf2/po'
make -C ./pixmaps -f Makefile.mingw install
make[1]: Entering directory `/home/datallah/winpidgin/gf2/pixmaps'
if test 'item_icon_size_big.png item_icon_size_huge.png item_icon_size_large.png item_icon_size_little.png item_icon_size_normal.png item_icon_size_small.png item_icon_size_tiny.png item_position_center.png item_position_east.png item_position_north_east.png item_position_north.png item_position_north_west.png item_position_south_east.png item_position_south.png item_position_south_west.png item_position_west.png item_text_clipping_ellipsis_end.png item_text_clipping_ellipsis_middle.png item_text_clipping_ellipsis_start.png item_text_clipping_truncate.png window_position_north_east.png window_position_north_west.png window_position_south_east.png window_position_south_west.png'; then \
mkdir -p ../../pidgin/win32-install-dir/pixmaps/pidgin/guifications/conf; \
cp item_icon_size_big.png item_icon_size_huge.png item_icon_size_large.png item_icon_size_little.png item_icon_size_normal.png item_icon_size_small.png item_icon_size_tiny.png item_position_center.png item_position_east.png item_position_north_east.png item_position_north.png item_position_north_west.png item_position_south_east.png item_position_south.png item_position_south_west.png item_position_west.png item_text_clipping_ellipsis_end.png item_text_clipping_ellipsis_middle.png item_text_clipping_ellipsis_start.png item_text_clipping_truncate.png window_position_north_east.png window_position_north_west.png window_position_south_east.png window_position_south_west.png ../../pidgin/win32-install-dir/pixmaps/pidgin/guifications/conf; \
fi;
if test ''; then \
mkdir -p ; \
cp ; \
fi;
make[1]: Leaving directory `/home/datallah/winpidgin/gf2/pixmaps'
make -C ./themes -f Makefile.mingw install
make[1]: Entering directory `/home/datallah/winpidgin/gf2/themes'
make -C ./default -f Makefile.mingw install
make[2]: Entering directory `/home/datallah/winpidgin/gf2/themes/default'
if test 'background.png theme.xml'; then \
mkdir -p ../../../pidgin/win32-install-dir/pixmaps/pidgin/guifications/themes/default; \
cp background.png theme.xml ../../../pidgin/win32-install-dir/pixmaps/pidgin/guifications/themes/default; \
fi;
make[2]: Leaving directory `/home/datallah/winpidgin/gf2/themes/default'
make -C ./mini -f Makefile.mingw install
make[2]: Entering directory `/home/datallah/winpidgin/gf2/themes/mini'
if test 'background.png theme.xml'; then \
mkdir -p ../../../pidgin/win32-install-dir/pixmaps/pidgin/guifications/themes/mini; \
cp background.png theme.xml ../../../pidgin/win32-install-dir/pixmaps/pidgin/guifications/themes/mini; \
fi;
make[2]: Leaving directory `/home/datallah/winpidgin/gf2/themes/mini'
make -C ./Penguins -f Makefile.mingw install
make[2]: Entering directory `/home/datallah/winpidgin/gf2/themes/Penguins'
if test 'penguin.png theme.xml'; then \
mkdir -p ../../../pidgin/win32-install-dir/pixmaps/pidgin/guifications/themes/Penguins; \
cp penguin.png theme.xml ../../../pidgin/win32-install-dir/pixmaps/pidgin/guifications/themes/Penguins; \
fi;
make[2]: Leaving directory `/home/datallah/winpidgin/gf2/themes/Penguins'
make[1]: Leaving directory `/home/datallah/winpidgin/gf2/themes'
make -C ./src -f Makefile.mingw install
make[1]: Entering directory `/home/datallah/winpidgin/gf2/src'
cp guifications.dll ../../pidgin/win32-install-dir/plugins
make[1]: Leaving directory `/home/datallah/winpidgin/gf2/src'
make -C ./po -f Makefile.mingw install
make[1]: Entering directory `/home/datallah/winpidgin/gf2/po'
mkdir -p ../../pidgin/win32-install-dir/locale
installing bn.gmo as ../../pidgin/win32-install-dir/locale/bn/LC_MESSAGES/guifications.mo
installing cs.gmo as ../../pidgin/win32-install-dir/locale/cs/LC_MESSAGES/guifications.mo
installing de.gmo as ../../pidgin/win32-install-dir/locale/de/LC_MESSAGES/guifications.mo
installing en_AU.gmo as ../../pidgin/win32-install-dir/locale/en_AU/LC_MESSAGES/guifications.mo
installing en_GB.gmo as ../../pidgin/win32-install-dir/locale/en_GB/LC_MESSAGES/guifications.mo
installing es.gmo as ../../pidgin/win32-install-dir/locale/es/LC_MESSAGES/guifications.mo
installing fr.gmo as ../../pidgin/win32-install-dir/locale/fr/LC_MESSAGES/guifications.mo
installing gl.gmo as ../../pidgin/win32-install-dir/locale/gl/LC_MESSAGES/guifications.mo
installing he.gmo as ../../pidgin/win32-install-dir/locale/he/LC_MESSAGES/guifications.mo
installing hu.gmo as ../../pidgin/win32-install-dir/locale/hu/LC_MESSAGES/guifications.mo
installing it.gmo as ../../pidgin/win32-install-dir/locale/it/LC_MESSAGES/guifications.mo
installing ja.gmo as ../../pidgin/win32-install-dir/locale/ja/LC_MESSAGES/guifications.mo
installing mk.gmo as ../../pidgin/win32-install-dir/locale/mk/LC_MESSAGES/guifications.mo
installing nl.gmo as ../../pidgin/win32-install-dir/locale/nl/LC_MESSAGES/guifications.mo
installing no.gmo as ../../pidgin/win32-install-dir/locale/no/LC_MESSAGES/guifications.mo
installing pt_BR.gmo as ../../pidgin/win32-install-dir/locale/pt_BR/LC_MESSAGES/guifications.mo
installing pt.gmo as ../../pidgin/win32-install-dir/locale/pt/LC_MESSAGES/guifications.mo
installing ru.gmo as ../../pidgin/win32-install-dir/locale/ru/LC_MESSAGES/guifications.mo
installing sk.gmo as ../../pidgin/win32-install-dir/locale/sk/LC_MESSAGES/guifications.mo
installing sr@Latn.gmo as ../../pidgin/win32-install-dir/locale/sr@Latn/LC_MESSAGES/guifications.mo
installing sr.gmo as ../../pidgin/win32-install-dir/locale/sr/LC_MESSAGES/guifications.mo
installing sv.gmo as ../../pidgin/win32-install-dir/locale/sv/LC_MESSAGES/guifications.mo
installing uk.gmo as ../../pidgin/win32-install-dir/locale/uk/LC_MESSAGES/guifications.mo
installing zh_CN.gmo as ../../pidgin/win32-install-dir/locale/zh_CN/LC_MESSAGES/guifications.mo
installing zh_TW.gmo as ../../pidgin/win32-install-dir/locale/zh_TW/LC_MESSAGES/guifications.mo
make[1]: Leaving directory `/home/datallah/winpidgin/gf2/po'
/*
* Guifications - The end all, be all, toaster popup plugin
* Copyright (C) 2003-2005 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 <gtk/gtk.h>
#ifdef HAVE_CONFIG_H
# include "../gf_config.h"
#endif
#include "gf_action.h"
#include "gf_display.h"
#include "gf_internal.h"
#include "gf_item.h"
#include "gf_item_icon.h"
#include "gf_item_text.h"
#include "gf_menu.h"
#include "gf_stock.h"
static GtkWidget *
gf_menu_make_item(GtkWidget *image, const gchar *text) {
GtkWidget *menu_item, *hbox, *label;
menu_item = gtk_menu_item_new();
hbox = gtk_hbox_new(FALSE, 4);
gtk_container_add(GTK_CONTAINER(menu_item), hbox);
if(image)
gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0);
label = gtk_label_new(_(text));
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
gtk_widget_show_all(menu_item);
return menu_item;
}
GtkWidget *
gf_menu_build(GfMenuItemBuilder builder, void *data) {
GtkWidget *menu;
gint i, max;
if(builder == gf_menu_position)
max = 4;
else if(builder == gf_menu_mouse)
max = gf_actions_count();
else if(builder == gf_menu_event)
max = gf_events_count();
else if(builder == gf_menu_item_position)
max = 9;
else if(builder == gf_menu_item_type)
max = 3;
else if(builder == gf_menu_item_icon_type)
max = 3;
else if(builder == gf_menu_item_icon_size)
max = 7;
else if(builder == gf_menu_item_text_clipping)
max = 4;
else
return NULL;
menu = gtk_menu_new();
for(i = 0; i < max; i++)
builder(menu, i, data);
gtk_widget_show_all(menu);
return menu;
}
GtkWidget *
gf_menu_position(GtkWidget *menu, gint item, void *data) {
GtkWidget *menu_item = NULL, *image;
g_return_val_if_fail(menu, NULL);
switch(item) {
case GF_DISPLAY_POSITION_NW:
image = gtk_image_new_from_stock(GF_STOCK_WINDOW_POSITION_NORTH_WEST,
GTK_ICON_SIZE_MENU);
menu_item = gf_menu_make_item(image, _("Top Left"));
break;
case GF_DISPLAY_POSITION_NE:
image = gtk_image_new_from_stock(GF_STOCK_WINDOW_POSITION_NORTH_EAST,
GTK_ICON_SIZE_MENU);
menu_item = gf_menu_make_item(image, _("Top Right"));
break;
case GF_DISPLAY_POSITION_SW:
image = gtk_image_new_from_stock(GF_STOCK_WINDOW_POSITION_SOUTH_WEST,
GTK_ICON_SIZE_MENU);
menu_item = gf_menu_make_item(image, _("Bottom Left"));
break;
case GF_DISPLAY_POSITION_SE:
image = gtk_image_new_from_stock(GF_STOCK_WINDOW_POSITION_SOUTH_EAST,
GTK_ICON_SIZE_MENU);
menu_item = gf_menu_make_item(image, _("Bottom Right"));
break;
case GF_DISPLAY_POSITION_UNKNOWN:
default:
break;
}
if(menu_item)
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
return menu_item;
}
GtkWidget *
gf_menu_mouse(GtkWidget *menu, gint item, void *data) {
GtkWidget *menu_item = NULL;
g_return_val_if_fail(menu, NULL);
menu_item = gf_menu_make_item(NULL, gf_actions_get_nth_i18n(item));
if(menu_item)
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
return menu_item;
}
GtkWidget *
gf_menu_event(GtkWidget *menu, gint item, void *data) {
GtkWidget *menu_item = NULL;
const gchar *name = NULL;
g_return_val_if_fail(menu, NULL);
name = gf_events_get_nth_name(item);
menu_item = gf_menu_make_item(NULL, name);
if(!g_utf8_collate(name, GF_NOTIFICATION_MASTER)) {
GfTheme *theme = GF_THEME(data);
if(theme && gf_theme_get_master(theme))
gtk_widget_set_sensitive(menu_item, FALSE);
}
if(menu_item)
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
return menu_item;
}
GtkWidget *
gf_menu_item_position(GtkWidget *menu, gint item, void *data) {
GtkWidget *menu_item = NULL, *image = NULL;
g_return_val_if_fail(menu, NULL);
switch(item) {
case GF_ITEM_POSITION_NW:
image = gtk_image_new_from_stock(GF_STOCK_ITEM_POSITION_NORTH_WEST,
GTK_ICON_SIZE_MENU);
break;
case GF_ITEM_POSITION_N:
image = gtk_image_new_from_stock(GF_STOCK_ITEM_POSITION_NORTH,
GTK_ICON_SIZE_MENU);
break;
case GF_ITEM_POSITION_NE:
image = gtk_image_new_from_stock(GF_STOCK_ITEM_POSITION_NORTH_EAST,
GTK_ICON_SIZE_MENU);
break;
case GF_ITEM_POSITION_W:
image = gtk_image_new_from_stock(GF_STOCK_ITEM_POSITION_WEST,
GTK_ICON_SIZE_MENU);
break;
case GF_ITEM_POSITION_C:
image = gtk_image_new_from_stock(GF_STOCK_ITEM_POSITION_CENTER,
GTK_ICON_SIZE_MENU);
break;
case GF_ITEM_POSITION_E:
image = gtk_image_new_from_stock(GF_STOCK_ITEM_POSITION_EAST,
GTK_ICON_SIZE_MENU);
break;
case GF_ITEM_POSITION_SW:
image = gtk_image_new_from_stock(GF_STOCK_ITEM_POSITION_SOUTH_WEST,
GTK_ICON_SIZE_MENU);
break;
case GF_ITEM_POSITION_S:
image = gtk_image_new_from_stock(GF_STOCK_ITEM_POSITION_SOUTH,
GTK_ICON_SIZE_MENU);
break;
case GF_ITEM_POSITION_SE:
image = gtk_image_new_from_stock(GF_STOCK_ITEM_POSITION_SOUTH_EAST,
GTK_ICON_SIZE_MENU);
break;
case GF_ITEM_POSITION_UNKNOWN:
default:
break;
}
menu_item = gf_menu_make_item(image,
gf_item_position_to_string(item, TRUE));
if(menu_item)
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
return menu_item;
}
GtkWidget *
gf_menu_item_type(GtkWidget *menu, gint item, void *data) {
GtkWidget *menu_item = NULL;
switch(item) {
case GF_ITEM_TYPE_ICON:
menu_item = gf_menu_make_item(NULL,
gf_item_type_to_string(item, TRUE));
break;
case GF_ITEM_TYPE_IMAGE:
menu_item = gf_menu_make_item(NULL,
gf_item_type_to_string(item, TRUE));
break;
case GF_ITEM_TYPE_TEXT:
menu_item = gf_menu_make_item(NULL,
gf_item_type_to_string(item, TRUE));
break;
case GF_ITEM_TYPE_UNKNOWN:
default:
break;
}
if(menu_item)
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
return menu_item;
}
GtkWidget *
gf_menu_item_icon_type(GtkWidget *menu, gint item, void *data) {
GtkWidget *menu_item = NULL;
g_return_val_if_fail(menu, NULL);
switch(item) {
case GF_ITEM_ICON_TYPE_BUDDY:
menu_item = gf_menu_make_item(NULL, _("Buddy"));
break;
case GF_ITEM_ICON_TYPE_PROTOCOL:
menu_item = gf_menu_make_item(NULL, _("Protocol"));
break;
case GF_ITEM_ICON_TYPE_STATUS:
menu_item = gf_menu_make_item(NULL, _("Status"));
break;
case GF_ITEM_ICON_TYPE_UNKNOWN:
default:
break;
}
if(menu_item)
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
return menu_item;
}
GtkWidget *
gf_menu_item_icon_size(GtkWidget *menu, gint item, void *data) {
GtkWidget *menu_item = NULL, *image;
g_return_val_if_fail(menu, NULL);
switch(item) {
case GF_ITEM_ICON_SIZE_HUGE:
image = gtk_image_new_from_stock(GF_STOCK_ITEM_ICON_SIZE_HUGE,
GTK_ICON_SIZE_MENU);
menu_item = gf_menu_make_item(image, _("Huge (144x144)"));
break;
case GF_ITEM_ICON_SIZE_LARGE:
image = gtk_image_new_from_stock(GF_STOCK_ITEM_ICON_SIZE_LARGE,
GTK_ICON_SIZE_MENU);
menu_item = gf_menu_make_item(image, _("Large (96x96)"));
break;
case GF_ITEM_ICON_SIZE_BIG:
image = gtk_image_new_from_stock(GF_STOCK_ITEM_ICON_SIZE_BIG,
GTK_ICON_SIZE_MENU);
menu_item = gf_menu_make_item(image, _("Big (64x64)"));
break;
case GF_ITEM_ICON_SIZE_NORMAL:
image = gtk_image_new_from_stock(GF_STOCK_ITEM_ICON_SIZE_NORMAL,
GTK_ICON_SIZE_MENU);
menu_item = gf_menu_make_item(image, _("Normal (48x48)"));
break;
case GF_ITEM_ICON_SIZE_LITTLE:
image = gtk_image_new_from_stock(GF_STOCK_ITEM_ICON_SIZE_LITTLE,
GTK_ICON_SIZE_MENU);
menu_item = gf_menu_make_item(image, _("Little (32x32)"));
break;
case GF_ITEM_ICON_SIZE_SMALL:
image = gtk_image_new_from_stock(GF_STOCK_ITEM_ICON_SIZE_SMALL,
GTK_ICON_SIZE_MENU);
menu_item = gf_menu_make_item(image, _("Small (24x24)"));
break;
case GF_ITEM_ICON_SIZE_TINY:
image = gtk_image_new_from_stock(GF_STOCK_ITEM_ICON_SIZE_TINY,
GTK_ICON_SIZE_MENU);
menu_item = gf_menu_make_item(image, _("Tiny (16x16)"));
break;
case GF_ITEM_ICON_SIZE_UNKNOWN:
default:
break;
}
if(menu_item)
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
return menu_item;
}
GtkWidget *
gf_menu_item_text_clipping(GtkWidget *menu, gint item, void *data) {
GtkWidget *menu_item = NULL, *image;
g_return_val_if_fail(menu, NULL);
switch(item) {
case GF_ITEM_TEXT_CLIPPING_TRUNCATE:
image = gtk_image_new_from_stock(GF_STOCK_ITEM_TEXT_CLIPPING_TRUNCATE,
GTK_ICON_SIZE_MENU);
menu_item = gf_menu_make_item(image, _("Truncate"));
break;
case GF_ITEM_TEXT_CLIPPING_ELLIPSIS_END:
image = gtk_image_new_from_stock(GF_STOCK_ITEM_TEXT_CLIPPING_ELLIPSIS_END,
GTK_ICON_SIZE_MENU);
menu_item = gf_menu_make_item(image, _("Ellipsis at the end"));
break;
case GF_ITEM_TEXT_CLIPPING_ELLIPSIS_MIDDLE:
image = gtk_image_new_from_stock(GF_STOCK_ITEM_TEXT_CLIPPING_ELLIPSIS_MIDDLE,
GTK_ICON_SIZE_MENU);
menu_item = gf_menu_make_item(image, _("Ellipsis in the middle"));
break;
case GF_ITEM_TEXT_CLIPPING_ELLIPSIS_START:
image = gtk_image_new_from_stock(GF_STOCK_ITEM_TEXT_CLIPPING_ELLIPSIS_START,
GTK_ICON_SIZE_MENU);
menu_item = gf_menu_make_item(image, _("Ellipsis at the beginning"));
break;
case GF_ITEM_TEXT_CLIPPING_UNKNOWN:
default:
break;
}
if(menu_item)
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
return menu_item;
}