grim/guifications3

cleaned a ton up here...
org.guifications.gf3
2009-08-02, Gary Kramlich
f7ab774df309
Parents c27de203934f
Children afeee984c3d3
cleaned a ton up here...

removed gf_gtk_menu.[ch] since i somehow missed that this stuff was really already in gtk (the stock stuff and so on)
removed gf_gtk_tray_icon since we're using new enough gtk to actually use GtkStatusIcon
--- a/gflib-gtk/INSTALL Sun Jul 26 23:11:55 2009 -0500
+++ b/gflib-gtk/INSTALL Sun Aug 02 18:25:52 2009 -0500
@@ -1,16 +1,19 @@
Installation Instructions
*************************
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
-Software Foundation, Inc.
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006, 2007, 2008 Free Software Foundation, Inc.
-This file is free documentation; the Free Software Foundation gives
+ This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
-These are generic installation instructions.
+ Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package. The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
@@ -23,9 +26,9 @@
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring. (Caching is
+the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
-cache files.)
+cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
@@ -35,20 +38,17 @@
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'. You only need
-`configure.ac' if you want to change it or regenerate `configure' using
-a newer version of `autoconf'.
+`configure' by a program called `autoconf'. You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
- `./configure' to configure the package for your system. If you're
- using `csh' on an old version of System V, you might need to type
- `sh ./configure' instead to prevent `csh' from trying to execute
- `configure' itself.
+ `./configure' to configure the package for your system.
- Running `configure' takes awhile. While running, it prints some
- messages telling which features it is checking for.
+ Running `configure' might take a while. While running, it prints
+ some messages telling which features it is checking for.
2. Type `make' to compile the package.
@@ -67,42 +67,57 @@
all sorts of other programs in order to regenerate files that came
with the distribution.
+ 6. Often, you can also type `make uninstall' to remove the installed
+ files again.
+
Compilers and Options
=====================
-Some systems require unusual options for compilation or linking that the
-`configure' script does not know about. Run `./configure --help' for
-details on some of the pertinent environment variables.
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. Run `./configure --help'
+for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
- ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
-You can compile the package for more than one kind of computer at the
+ You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
-own directory. To do this, you must use a version of `make' that
-supports the `VPATH' variable, such as GNU `make'. `cd' to the
+own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
- If you have to use a `make' that does not support the `VPATH'
-variable, you have to compile the package for one architecture at a
-time in the source code directory. After you have installed the
-package for one architecture, use `make distclean' before reconfiguring
-for another architecture.
+ With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory. After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+ On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor. Like
+this:
+
+ ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CPP="gcc -E" CXXCPP="g++ -E"
+
+ This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
Installation Names
==================
-By default, `make install' installs the package's commands under
+ By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX'.
@@ -125,7 +140,7 @@
Optional Features
=================
-Some packages pay attention to `--enable-FEATURE' options to
+ Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
@@ -137,14 +152,36 @@
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
+Particular systems
+==================
+
+ On HP-UX, the default C compiler is not ANSI C compatible. If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+ ./configure CC="cc -Ae"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+ On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file. The option `-nodtk' can be used as
+a workaround. If GNU CC is not installed, it is therefore recommended
+to try
+
+ ./configure CC="cc"
+
+and if that doesn't work, try
+
+ ./configure CC="cc -nodtk"
+
Specifying the System Type
==========================
-There may be some features `configure' cannot figure out automatically,
-but needs to determine by the type of machine the package will run on.
-Usually, assuming the package is built to be run on the _same_
-architectures, `configure' can figure that out, but if it prints a
-message saying it cannot guess the machine type, give it the
+ There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on. Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
@@ -170,9 +207,9 @@
Sharing Defaults
================
-If you want to set default values for `configure' scripts to share, you
-can create a site shell script called `config.site' that gives default
-values for variables like `CC', `cache_file', and `prefix'.
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
@@ -181,7 +218,7 @@
Defining Variables
==================
-Variables not defined in a site shell script can be set in the
+ Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
@@ -190,21 +227,29 @@
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
-overridden in the site shell script). Here is a another example:
+overridden in the site shell script).
- /bin/bash ./configure CONFIG_SHELL=/bin/bash
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug. Until the bug is fixed you can use this workaround:
-Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
-configuration-related scripts to be executed by `/bin/bash'.
+ CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
-`configure' recognizes the following options to control how it operates.
+ `configure' recognizes the following options to control how it
+operates.
`--help'
`-h'
- Print a summary of the options to `configure', and exit.
+ Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+ Print a summary of the options unique to this package's
+ `configure', and exit. The `short' variant lists options used
+ only in the top level, while the `recursive' variant lists options
+ also present in any nested packages.
`--version'
`-V'
@@ -231,6 +276,16 @@
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
+`--prefix=DIR'
+ Use DIR as the installation prefix. *Note Installation Names::
+ for more details, including other options available for fine-tuning
+ the installation locations.
+
+`--no-create'
+`-n'
+ Run the configure checks, but stop before creating any output
+ files.
+
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
--- a/gflib-gtk/Makefile.am Sun Jul 26 23:11:55 2009 -0500
+++ b/gflib-gtk/Makefile.am Sun Aug 02 18:25:52 2009 -0500
@@ -1,4 +1,4 @@
-SUBDIRS = gflib-gtk doc po po-properties tests
+SUBDIRS = gflib-gtk doc po tests
DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
@@ -13,8 +13,7 @@
ChangeLog \
configure.ac \
gflib-gtk.pc \
- gtk-doc.make \
- po-properties/ChangeLog
+ gtk-doc.make
pcdata_DATA=gflib-gtk.pc
pcdatadir = $(libdir)/pkgconfig
--- a/gflib-gtk/autogen.sh Sun Jul 26 23:11:55 2009 -0500
+++ b/gflib-gtk/autogen.sh Sun Aug 02 18:25:52 2009 -0500
@@ -183,6 +183,6 @@
###############################################################################
# Run configure
###############################################################################
-echo "running ./configure ${CONFIGURE_ARGS} $@"
-./configure ${CONFIGURE_ARGS} $@
+echo "running ./configure ${CONFIGURE_FLAGS} $@"
+./configure ${CONFIGURE_FLAGS} $@
--- a/gflib-gtk/configure.ac Sun Jul 26 23:11:55 2009 -0500
+++ b/gflib-gtk/configure.ac Sun Aug 02 18:25:52 2009 -0500
@@ -104,10 +104,6 @@
ALL_LINGUAS=""
AM_GLIB_GNU_GETTEXT
-AC_OUTPUT_COMMANDS(
-[case "$CONFIG_FILES" in *po-properties/Makefile.in*)
- sed -e "/POTFILES =/r po-properties/POTFILES" po-properties/Makefile.in > po-properties/Makefile
- esac])
dnl #######################################################################
dnl # Look for the C compiler
@@ -124,7 +120,9 @@
AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.])
fi
-AC_ARG_ENABLE(deprecated, [ --disable-deprecated compile without deprecated API usage],,enable_deprecated=yes)
+AC_ARG_ENABLE(deprecated,
+ AC_HELP_STRING([--disable-deprecated],[compile without deprecated API usage])
+ ,,enable_deprecated=yes)
if test "x$enable_deprecated" = no; then
DEBUG_CFLAGS = "$DEBUG_CFLAGS -DG_DISABLE_DEPRECATED"
@@ -169,7 +167,7 @@
dnl #######################################################################
AC_MSG_CHECKING([golden ticket])
AC_MSG_RESULT([no])
-PKG_CHECK_MODULES(GTK, [gtk+-2.0])
+PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.10.0])
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
@@ -195,9 +193,7 @@
doc/Makefile
doc/gflib-gtk/Makefile
gflib-gtk/Makefile
- gflib-gtk/x11/Makefile
po/Makefile.in
- po-properties/Makefile.in
tests/Makefile
])
--- a/gflib-gtk/gflib-gtk/Makefile.am Sun Jul 26 23:11:55 2009 -0500
+++ b/gflib-gtk/gflib-gtk/Makefile.am Sun Aug 02 18:25:52 2009 -0500
@@ -1,7 +1,5 @@
EXTRA_DIST=
-SUBDIRS = x11
-
gfgtkincdir = $(includedir)/gflib-gtk-1.0/gflib-gtk
lib_LTLIBRARIES = libgflib-gtk.la
@@ -11,9 +9,7 @@
gf_gtk_core.h \
gf_gtk_gc.h \
gf_gtk_image.h \
- gf_gtk_intl.h \
- gf_gtk_menu.h \
- gf_gtk_tray_icon.h
+ gf_gtk_intl.h
gfgtkinc_DATA = gf_lib_gtk.h
@@ -21,13 +17,10 @@
gf_gtk_color.c \
gf_gtk_core.c \
gf_gtk_gc.c \
- gf_gtk_image.c \
- gf_gtk_menu.c \
- gf_gtk_tray_icon.c
+ gf_gtk_image.c
libgflib_gtk_la_LIBADD = \
-lm \
- x11/libgflib-gtk-x11.la \
$(GFLIB_LIBS) \
$(GFLIB_UI_LIBS) \
$(GLIB_LIBS) \
--- a/gflib-gtk/gflib-gtk/gf_gtk_menu.c Sun Jul 26 23:11:55 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,285 +0,0 @@
-/*
- * Guifications - The end-all, be-all notification framework
- * Copyright (C) 2003-2009 Gary Kramlich <grim@reaperworld.com>
- *
- * 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 3 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, see <http://www.gnu.org/licenses/>.
- */
-#include <gflib/gf_lib.h>
-
-#include <gflib-gtk/gf_gtk_intl.h>
-#include <gflib-gtk/gf_gtk_menu.h>
-
-/**
- * gf_gtk_menu_item_new:
- * @caption : The caption.
- * @image : The #GtkImage or @c NULL.
- * @sg : The #GtkSizeGroup or @c NULL.
- * @cb : The #GCallback to use for the activate signal.
- * @data : The user data to pass to @cb.
- *
- * Creates a new menu item.
- *
- * Return Value: The new menu item.
- */
-GtkWidget *
-gf_gtk_menu_item_new(const gchar *caption, GtkWidget *image,
- GtkSizeGroup *sg, GCallback cb, gpointer data)
-{
- GtkWidget *item = NULL, *box = NULL, *label = NULL;
-
- g_return_val_if_fail(caption, NULL);
-
- item = gtk_menu_item_new();
- gtk_widget_show(item);
-
- box = gtk_hbox_new(FALSE, 4);
- gtk_container_add(GTK_CONTAINER(item), box);
- gtk_widget_show(box);
-
- if(!GTK_IS_IMAGE(image))
- image = gtk_image_new();
-
- gtk_box_pack_start(GTK_BOX(box), image, FALSE, FALSE, 0);
- gtk_widget_show(image);
-
- if(GTK_IS_SIZE_GROUP(sg))
- gtk_size_group_add_widget(sg, image);
-
- label = gtk_label_new_with_mnemonic(_(caption));
- gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 0);
- gtk_widget_show(label);
-
- if(cb)
- g_signal_connect(G_OBJECT(item), "activate", cb, data);
-
- return item;
-}
-
-/**
- * gf_gtk_menu_item_new_from_stock:
- * @caption : The caption.
- * @stock_id : The #GtkStockItem id to use.
- * @sg : The #GtkSizeGroup.
- * @cb : The #GCallback function to use for the activate signal.
- * @data : The user data to pass to @cb.
- *
- * Creates a new menu item from @stock_id.
- *
- * Return Value: The new menu item from @stock_id.
- */
-GtkWidget *
-gf_gtk_menu_item_new_from_stock(const gchar *caption, const gchar *stock_id,
- GtkSizeGroup *sg, GCallback cb, gpointer data)
-{
- GtkWidget *img = NULL;
-
- g_return_val_if_fail(caption, NULL);
- g_return_val_if_fail(stock_id, NULL);
-
- img = gtk_image_new_from_stock(stock_id, GTK_ICON_SIZE_MENU);
-
- return gf_gtk_menu_item_new(caption, img, sg, cb, data);
-}
-
-/**
- * gf_gtk_menu_add_separator:
- * @menu : The menu.
- *
- * Adds a separator to @menu.
- *
- * Return Value: The separator.
- */
-GtkWidget *
-gf_gtk_menu_add_separator(GtkWidget *menu) {
- GtkWidget *separator;
-
- g_return_val_if_fail(GTK_IS_MENU(menu), NULL);
-
- separator = gtk_separator_menu_item_new();
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), separator);
- gtk_widget_show(separator);
-
- return separator;
-}
-
-/**
- * gf_gtk_menu_add_new_item:
- * @menu : The menu.
- * @caption : The caption.
- * @image : The #GtkImage to use.
- * @sg : The #GtkSizeGroup for the menu.
- * @cb : The #GCallback for the activate signal.
- * @data : The user data to pass to @cb.
- *
- * Creates a new menu item and adds it to @menu.
- *
- * Return Value: The new menu item.
- */
-GtkWidget *
-gf_gtk_menu_add_new_item(GtkWidget *menu, const gchar *caption,
- GtkWidget *image, GtkSizeGroup *sg,
- GCallback cb, gpointer data)
-{
- GtkWidget *item;
-
- g_return_val_if_fail(GTK_IS_MENU(menu), NULL);
- g_return_val_if_fail(caption, NULL);
-
- item = gf_gtk_menu_item_new(caption, image, sg, cb, data);
-
- if(GTK_IS_MENU_ITEM(item))
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
-
- return item;
-}
-
-/**
- * gf_gtk_menu_add_new_item_from_stock:
- * @menu : The menu.
- * @caption : The caption.
- * @stock_id : The #GtkStockItem id to use.
- * @sg : The #GtkSizeGroup for the menu.
- * @cb : The #GCallback for the activate signal.
- * @data : The user data to pass to @cb.
- *
- * Creates a new menu item from @stock_id and adds it to @menu.
- *
- * Return Value: The new menu item.
- */
-GtkWidget *
-gf_gtk_menu_add_new_item_from_stock(GtkWidget *menu, const gchar *caption,
- const gchar *stock_id, GtkSizeGroup *sg,
- GCallback cb, gpointer data)
-{
- GtkWidget *item;
-
- g_return_val_if_fail(GTK_IS_MENU(menu), NULL);
- g_return_val_if_fail(caption, NULL);
- g_return_val_if_fail(stock_id, NULL);
-
- item = gf_gtk_menu_item_new_from_stock(caption, stock_id, sg, cb, data);
-
- if(GTK_IS_MENU_ITEM(item))
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
-
- return item;
-}
-
-/******************************************************************************
- * Menus
- *****************************************************************************/
-static GtkWidget *
-gf_gtk_menu_builder(GType type, const gchar *empty_str, GCallback cb) {
- GtkWidget *menu, *item;
- GType *types;
- guint n = 0;
-
- menu = gtk_menu_new();
-
- types = gf_type_concrete_children(type, &n);
-
- if(n == 0) {
- item = gf_gtk_menu_add_new_item(menu, _(empty_str),
- NULL, NULL,
- NULL, NULL);
- gtk_widget_set_sensitive(item, FALSE);
- } else {
- if(g_type_is_a(type, GF_TYPE_NAMED_OBJECT)) {
- GfNamedObjectClass *gfno_class;
- const gchar *name;
- guint i;
-
- for(i = 0; i < n; i++) {
- gfno_class = g_type_class_ref(types[i]);
-
- if(!gfno_class)
- continue;
-
- name = (gfno_class->name) ? gfno_class->name :
- g_type_name(types[i]);
- gf_gtk_menu_add_new_item(menu, name,
- NULL, NULL,
- cb, GINT_TO_POINTER(types[i]));
-
- g_type_class_unref(gfno_class);
- }
- } else {
- GTypeClass *type_class;
- guint i;
-
- for(i = 0; i < n; i++) {
- type_class = g_type_class_ref(types[i]);
- gf_gtk_menu_add_new_item(menu, g_type_name(types[i]),
- NULL, NULL,
- cb, GINT_TO_POINTER(types[i]));
- g_type_class_unref(type_class);
- }
- }
- }
-
- g_free(types);
-
- return menu;
-}
-
-/**
- * gf_gtk_menu_connections:
- * @cb : The #GCallback to use for the activate signal.
- *
- * Creates a #GtkMenu of all the registered #GfConnection's.
- *
- * Note: The activate signal will be connected with the #GType as the data.
- *
- * Return Value: The menu.
- */
-GtkWidget *
-gf_gtk_menu_connections(GCallback cb) {
- return gf_gtk_menu_builder(GF_TYPE_CONNECTION,
- _("(No Connections Available)"),
- cb);
-}
-
-/**
- * gf_gtk_menu_client_connections:
- * @cb : The #GCallback to use for the activate signal.
- *
- * Creates a #GtkMenu of all the registered client connections.
- *
- * Note: The activate signal will be connected with the #GType as the data.
- *
- * Return Value: The menu.
- */
-GtkWidget *
-gf_gtk_menu_client_connections(GCallback cb) {
- return gf_gtk_menu_builder(GF_TYPE_CLIENT_CONNECTION,
- _("(No Client Connections Available)"),
- cb);
-}
-
-/**
- * gf_gtk_menu_server_connections:
- * @cb : The #GCallback to use for the activate signal.
- *
- * Creates a #GtkMenu of all the registered server connections.
- *
- * Note: The activate signal will be connected with the #GType as the data.
- *
- * Return Value: The menu.
- */
-GtkWidget *
-gf_gtk_menu_server_connections(GCallback cb) {
- return gf_gtk_menu_builder(GF_TYPE_SERVER_CONNECTION,
- _("(No Server Connections Available)"),
- cb);
-}
--- a/gflib-gtk/gflib-gtk/gf_gtk_menu.h Sun Jul 26 23:11:55 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Guifications - The end-all, be-all notification framework
- * Copyright (C) 2003-2009 Gary Kramlich <grim@reaperworld.com>
- *
- * 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 3 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, see <http://www.gnu.org/licenses/>.
- */
-#ifndef GF_GTK_MENU_H
-#define GF_GTK_MENU_H
-
-#include <glib.h>
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS
-
-GtkWidget *gf_gtk_menu_item_new(const gchar *caption, GtkWidget *image, GtkSizeGroup *sg, GCallback cb, gpointer data);
-GtkWidget *gf_gtk_menu_item_new_from_stock(const gchar *caption, const gchar *stock_id, GtkSizeGroup *sg, GCallback cb, gpointer data);
-
-GtkWidget *gf_gtk_menu_add_separator(GtkWidget *menu);
-
-GtkWidget *gf_gtk_menu_add_new_item(GtkWidget *menu, const gchar *caption, GtkWidget *image, GtkSizeGroup *sg, GCallback cb, gpointer data);
-GtkWidget *gf_gtk_menu_add_new_item_from_stock(GtkWidget *menu, const gchar *caption, const gchar *stock_id, GtkSizeGroup *sg, GCallback cb, gpointer data);
-
-GtkWidget *gf_gtk_menu_connections(GCallback cb);
-GtkWidget *gf_gtk_menu_client_connections(GCallback cb);
-GtkWidget *gf_gtk_menu_server_connections(GCallback cb);
-
-G_END_DECLS
-
-#endif /* GF_GTK_MENU_H */
--- a/gflib-gtk/gflib-gtk/gf_gtk_tray_icon.c Sun Jul 26 23:11:55 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +0,0 @@
-/*
- * Guifications - The end-all, be-all notification framework
- * Copyright (C) 2003-2009 Gary Kramlich <grim@reaperworld.com>
- *
- * 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 3 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, see <http://www.gnu.org/licenses/>.
- */
-#include <gflib-gtk/gf_gtk_tray_icon.h>
-
-/**
- * gf_gtk_tray_icon_new_from_pixbuf:
- * @pixbuf : The #GdkPixbuf to use as an image.
- *
- * Creates a new #GfGtkTrayIcon with @pixbuf.
- *
- * Return Value: A new #GfGtkTrayIcon with @pixbuf.
- */
-GtkWidget *
-gf_gtk_tray_icon_new_from_pixbuf(GdkPixbuf *pixbuf) {
- GtkWidget *widget = NULL;
-
- g_return_val_if_fail(GDK_IS_PIXBUF(pixbuf), NULL);
-
- widget = gf_gtk_tray_icon_new();
-
- gf_gtk_tray_icon_set_from_pixbuf(GF_GTK_TRAY_ICON(widget), pixbuf);
-
- return widget;
-}
-
-/**
- * gf_gtk_tray_icon_new_from_stock:
- * @stock_id : The #GtkStockItem id to use for an image.
- *
- * Creates a new #GfGtkTrayIcon with @stock_id.
- *
- * Return Value: A new #GfGtkTrayIcon with @stock_id.
- */
-GtkWidget *
-gf_gtk_tray_icon_new_from_stock(const gchar *stock_id) {
- GtkWidget *widget = NULL;
-
- g_return_val_if_fail(stock_id, NULL);
-
- widget = gf_gtk_tray_icon_new();
-
- gf_gtk_tray_icon_set_from_stock(GF_GTK_TRAY_ICON(widget), stock_id);
-
- return widget;
-}
-
-/**
- * gf_gtk_tray_icon_new_from_file:
- * @filename : The filename of an image to use.
- *
- * Creates a new #GfGtkTrayIcon with an image from @filename.
- *
- * Return Value: A new #GfGtkTrayIcon with an image from @filename.
- */
-GtkWidget *
-gf_gtk_tray_icon_new_from_file(const gchar *filename) {
- GtkWidget *widget = NULL;
-
- g_return_val_if_fail(filename, NULL);
-
- widget = gf_gtk_tray_icon_new();
-
- gf_gtk_tray_icon_set_from_file(GF_GTK_TRAY_ICON(widget), filename);
-
- return widget;
-}
-
-/**
- * gf_gtk_tray_icon_set_from_pixbuf:
- * @tray_icon : The #GfGtkTrayIcon instance.
- * @pixbuf : The new #GdkPixbuf.
- *
- * Sets the image of @tray_icon to @pixbuf.
- */
-void
-gf_gtk_tray_icon_set_from_pixbuf(GfGtkTrayIcon *tray_icon, GdkPixbuf *pixbuf) {
- g_return_if_fail(GF_GTK_IS_TRAY_ICON(tray_icon));
-
- gtk_image_set_from_pixbuf(GTK_IMAGE(tray_icon->image), pixbuf);
-}
-
-/**
- * gf_gtk_tray_icon_set_from_stock:
- * @tray_icon : The #GfGtkTrayIcon instance.
- * @stock_id : The #GtkStockItem id to use as an image.
- *
- * Sets the image of @tray_icon to the image of @stock_id.
- */
-void
-gf_gtk_tray_icon_set_from_stock(GfGtkTrayIcon *tray_icon,
- const gchar *stock_id)
-{
- g_return_if_fail(GF_GTK_IS_TRAY_ICON(tray_icon));
- g_return_if_fail(stock_id);
-
- gtk_image_set_from_stock(GTK_IMAGE(tray_icon->image), stock_id,
- GTK_ICON_SIZE_MENU);
-}
-
-/**
- * gf_gtk_tray_icon_set_from_file:
- * @tray_icon : The #GfGtkTrayIcon instance.
- * @filename : The filename of an image to set.
- *
- * Sets the image of @tray_icon to the image from @filename.
- */
-void
-gf_gtk_tray_icon_set_from_file(GfGtkTrayIcon *tray_icon,
- const gchar *filename)
-{
- g_return_if_fail(GF_GTK_IS_TRAY_ICON(tray_icon));
- g_return_if_fail(filename);
-
- gtk_image_set_from_file(GTK_IMAGE(tray_icon->image), filename);
-}
-
-/**
- * gf_gtk_tray_icon_position_menu:
- * @tray_icon : The #GfGtkTrayIcon instance.
- * @menu : The #GtkMenu instance.
- * @x : The return address for the x position.
- * @y : The return address for the y position.
- * @push_in : The return address for whether or not to "push" the menu in.
- *
- * Gets the position for @menu.
- */
-void
-gf_gtk_tray_icon_position_menu(GfGtkTrayIcon *tray_icon, GtkMenu *menu,
- gint *x, gint *y, gboolean *push_in)
-{
- GfGtkTrayIconClass *klass = NULL;
-
- g_return_if_fail(GF_GTK_IS_TRAY_ICON(tray_icon));
- g_return_if_fail(GTK_IS_MENU(menu));
-
- klass = GF_GTK_TRAY_ICON_GET_CLASS(tray_icon);
-
- if(klass && klass->position_menu)
- klass->position_menu(tray_icon, menu, x, y, push_in);
-}
--- a/gflib-gtk/gflib-gtk/gf_gtk_tray_icon.h Sun Jul 26 23:11:55 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * Guifications - The end-all, be-all notification framework
- * Copyright (C) 2003-2009 Gary Kramlich <grim@reaperworld.com>
- *
- * 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 3 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, see <http://www.gnu.org/licenses/>.
- */
-#ifndef GF_GTK_TRAY_ICON_H
-#define GF_GTK_TRAY_ICON_H
-
-#include <gdk/gdk.h>
-#include <gtk/gtkeventbox.h>
-#include <gtk/gtkimage.h>
-#include <gtk/gtkmenu.h>
-#include <gtk/gtkplug.h>
-#include <gtk/gtkversion.h>
-
-#define GF_GTK_TYPE_TRAY_ICON (gf_gtk_tray_icon_get_gtype())
-#define GF_GTK_TRAY_ICON(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GF_GTK_TYPE_TRAY_ICON, GfGtkTrayIcon))
-#define GF_GTK_TRAY_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GF_GTK_TYPE_TRAY_ICON, GfGtkTrayIconClass))
-#define GF_GTK_IS_TRAY_ICON(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GF_GTK_TYPE_TRAY_ICON))
-#define GF_GTK_IS_TRAY_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GF_GTK_TYPE_TRAY_ICON))
-#define GF_GTK_TRAY_ICON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GF_GTK_TYPE_TRAY_ICON, GfGtkTrayIconClass))
-
-typedef struct _GfGtkTrayIcon GfGtkTrayIcon;
-typedef struct _GfGtkTrayIconClass GfGtkTrayIconClass;
-
-struct _GfGtkTrayIcon {
- GtkEventBox gparent;
-
- GtkWidget *plug;
- GtkWidget *image;
-
- void (*gf_reserved1)(void);
- void (*gf_reserved2)(void);
- void (*gf_reserved3)(void);
- void (*gf_reserved4)(void);
-};
-
-struct _GfGtkTrayIconClass {
- GtkEventBoxClass gparent;
-
- void (*position_menu)(GfGtkTrayIcon *tray_icon, GtkMenu *menu, gint *x, gint *y, gboolean *push_in);
-
- void (*gf_reserved1)(void);
- void (*gf_reserved2)(void);
- void (*gf_reserved3)(void);
- void (*gf_reserved4)(void);
-};
-
-G_BEGIN_DECLS
-
-GType gf_gtk_tray_icon_get_gtype(void);
-
-GtkOrientation gf_gtk_tray_icon_get_orientation(const GfGtkTrayIcon *tray_icon);
-
-GtkWidget *gf_gtk_tray_icon_new();
-GtkWidget *gf_gtk_tray_icon_new_from_pixbuf(GdkPixbuf *pixbuf);
-GtkWidget *gf_gtk_tray_icon_new_from_stock(const gchar *stock_id);
-GtkWidget *gf_gtk_tray_icon_new_from_file(const gchar *filename);
-
-void gf_gtk_tray_icon_set_from_pixbuf(GfGtkTrayIcon *tray_icon, GdkPixbuf *pixbuf);
-void gf_gtk_tray_icon_set_from_stock(GfGtkTrayIcon *tray_icon, const gchar *stock_id);
-void gf_gtk_tray_icon_set_from_file(GfGtkTrayIcon *tray_icon, const gchar *filename);
-
-void gf_gtk_tray_icon_position_menu(GfGtkTrayIcon *tray_icon, GtkMenu *menu, gint *x, gint *y, gboolean *push_in);
-
-G_END_DECLS
-
-#endif /* GF_GTK_TRAY_ICON_H */
--- a/gflib-gtk/gflib-gtk/x11/Makefile.am Sun Jul 26 23:11:55 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-noinst_LTLIBRARIES = libgflib-gtk-x11.la
-
-libgflib_gtk_x11_la_SOURCES = \
- gf_gtk_x11_tray_icon.c
-
-INCLUDES = \
- -I$(top_srcdir)
-
-AM_CPPFLAGS = \
- $(DEBUG_CFLAGS) \
- $(GFLIB_CFLAGS) \
- $(GLIB_CFLAGS) \
- $(GTK_CFLAGS)
--- a/gflib-gtk/gflib-gtk/x11/gf_gtk_x11_tray_icon.c Sun Jul 26 23:11:55 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,503 +0,0 @@
-/*
- * Guifications - The end-all, be-all notification framework
- * Copyright (C) 2003-2009 Gary Kramlich <grim@reaperworld.com>
- *
- * 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 3 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, see <http://www.gnu.org/licenses/>.
- */
-#include <gdk/gdkx.h>
-#include <X11/Xatom.h>
-
-#include <gflib/gf_intl.h>
-
-#include <gflib-gtk/gf_gtk_tray_icon.h>
-
-#include <stdio.h>
-
-/******************************************************************************
- * Macros
- *****************************************************************************/
-#define GF_GTK_TRAY_ICON_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE((obj), GF_GTK_TYPE_TRAY_ICON, GfGtkTrayIconPrivate))
-
-#if GTK_CHECK_VERSION(2,2,0)
-# define gf_gtk_tray_icon_get_root_window(widget) \
- gdk_screen_get_root_window(gtk_widget_get_screen((widget)))
-# define gf_gtk_tray_icon_get_screen_number(widget) \
- gdk_screen_get_number(gtk_widget_get_screen((widget)))
-# define gf_gtk_tray_icon_get_xdisplay(widget) \
- GDK_DISPLAY_XDISPLAY(gtk_widget_get_display((widget)))
-# define gf_gtk_tray_icon_get_xwindow(widget, manager) \
- gdk_window_lookup_for_display(gtk_widget_get_display((widget)), (manager))
-
-#else /* GTK 2.0 */
-# define gf_gtk_tray_icon_get_root_window(widget) \
- gdk_window_look_up(gdk_x11_get_default_root_window());
-# define gf_gtk_tray_icon_get_screen_number(widget) \
- XScreenNumberOfScreen(DefaultScreenOfDisplay(GDK_DISPLAY()))
-# define gf_gtk_tray_icon_get_xdisplay(widget) \
- GDK_DISPLAY()
-# define gf_gtk_tray_icon_get_xwindow(widget, manager) \
- gdk_window_lookup((manager))
-
-#endif /* GTK_CHECK_VERSION(2,2,0) */
-
-/******************************************************************************
- * Structs
- *****************************************************************************/
-typedef struct {
- GtkOrientation gtk_orientation;
-
- Atom selection;
- Atom manager;
- Atom opcode;
- Atom x_orientation;
- Window manager_window;
-} GfGtkTrayIconPrivate;
-
-/******************************************************************************
- * Enums
- *****************************************************************************/
-enum {
- REQUEST_DOCK = 0,
- BEGIN_MESSAGE,
- CANCEL_MESSAGE
-};
-
-enum {
- PROP_ZERO = 0,
- PROP_ORIENTATION,
- PROP_LAST
-};
-
-enum {
- TRAY_ICON_HORZ = 0,
- TRAY_ICON_VERT
-};
-
-/******************************************************************************
- * globals
- *****************************************************************************/
-static GtkEventBoxClass *parent_class = NULL;
-
-/******************************************************************************
- * Widget stuff
- *****************************************************************************/
-static GdkFilterReturn gf_gtk_tray_icon_manager_filter(GdkXEvent *xe, GdkEvent *e, void *data);
-
-static void
-gf_gtk_tray_icon_send_manager_message(GfGtkTrayIcon *tray_icon,
- glong message, Window w,
- glong d1, glong d2, glong d3)
-{
- GfGtkTrayIconPrivate *priv = GF_GTK_TRAY_ICON_GET_PRIVATE(tray_icon);
- XClientMessageEvent e;
- Display *display;
-
- e.type = ClientMessage;
- e.window = w;
- e.message_type = priv->opcode;
- e.format = 32;
- e.data.l[0] = gdk_x11_get_server_time(GTK_WIDGET(tray_icon)->window);
- e.data.l[1] = message;
- e.data.l[2] = d1;
- e.data.l[3] = d2;
- e.data.l[4] = d3;
-
- display = gf_gtk_tray_icon_get_xdisplay(GTK_WIDGET(tray_icon));
-
- gdk_error_trap_push();
- XSendEvent(display, priv->manager_window, False, NoEventMask,
- (XEvent *)&e);
- XSync(display, False);
- gdk_error_trap_pop();
-}
-
-static void
-gf_gtk_tray_icon_send_dock_request(GfGtkTrayIcon *tray_icon) {
- GfGtkTrayIconPrivate *priv = GF_GTK_TRAY_ICON_GET_PRIVATE(tray_icon);
- GdkNativeWindow plug_id = gtk_plug_get_id(GTK_PLUG(tray_icon->plug));
-
- gf_gtk_tray_icon_send_manager_message(tray_icon, REQUEST_DOCK,
- priv->manager_window,
- plug_id, 0, 0);
-}
-
-static void
-gf_gtk_tray_icon_update_orientation(GfGtkTrayIcon *tray_icon) {
- GfGtkTrayIconPrivate *priv = GF_GTK_TRAY_ICON_GET_PRIVATE(tray_icon);
- Display *xdisplay;
- Atom type;
- gint format;
- gulong nitems;
- gulong leftovers;
- gint error, result;
-
- union {
- gulong *prop;
- guchar *prop_char;
- } prop = { NULL };
-
- g_return_if_fail(priv->manager_window != None);
-
- xdisplay = gf_gtk_tray_icon_get_xdisplay(GTK_WIDGET(tray_icon));
-
- gdk_error_trap_push();
- type = None;
- result = XGetWindowProperty(xdisplay, priv->manager_window,
- priv->x_orientation,
- 0, G_MAXLONG, FALSE, XA_CARDINAL,
- &type, &format, &nitems, &leftovers,
- &(prop.prop_char));
-
- error = gdk_error_trap_pop();
-
- if(error || result != Success)
- return;
-
- if(type == XA_CARDINAL) {
- GtkOrientation orientation;
-
- if(prop.prop[0] == TRAY_ICON_HORZ)
- orientation = GTK_ORIENTATION_HORIZONTAL;
- else
- orientation = GTK_ORIENTATION_VERTICAL;
-
- if(priv->gtk_orientation != orientation) {
- priv->gtk_orientation = orientation;
-
- g_object_notify(G_OBJECT(tray_icon), "orientation");
- }
- }
-
- if(prop.prop)
- XFree(prop.prop);
-}
-
-static void
-gf_gtk_tray_icon_manager_window_update(GfGtkTrayIcon *tray_icon,
- gboolean realized)
-{
- GfGtkTrayIconPrivate *priv = GF_GTK_TRAY_ICON_GET_PRIVATE(tray_icon);
- Display *xdisplay;
-
- if(priv->manager_window != None)
- return;
-
- xdisplay = gf_gtk_tray_icon_get_xdisplay(GTK_WIDGET(tray_icon));
-
- XGrabServer(xdisplay);
-
- priv->manager_window = XGetSelectionOwner(xdisplay, priv->selection);
-
- if(priv->manager_window != None) {
- XSelectInput(xdisplay, priv->manager_window,
- StructureNotifyMask | PropertyChangeMask);
- }
-
- XUngrabServer(xdisplay);
- XFlush(xdisplay);
-
- if(priv->manager_window != None) {
- GdkWindow *gdkwin;
-
- gdkwin =
- gf_gtk_tray_icon_get_xwindow(GTK_WIDGET(tray_icon->plug),
- priv->manager_window);
-
- gdk_window_add_filter(gdkwin, gf_gtk_tray_icon_manager_filter,
- tray_icon);
-
- if(realized && GTK_WIDGET_REALIZED(tray_icon))
- gf_gtk_tray_icon_send_dock_request(tray_icon);
-
- gf_gtk_tray_icon_update_orientation(tray_icon);
- }
-}
-
-static void
-gf_gtk_tray_icon_manager_window_destroyed(GfGtkTrayIcon *tray_icon) {
- GfGtkTrayIconPrivate *priv = GF_GTK_TRAY_ICON_GET_PRIVATE(tray_icon);
- GdkWindow *window;
-
- g_return_if_fail(priv->manager_window != None);
-
- window =
- gf_gtk_tray_icon_get_xwindow(GTK_WIDGET(tray_icon),
- priv->manager_window);
-
- gdk_window_remove_filter(window, gf_gtk_tray_icon_manager_filter,
- tray_icon);
-
- priv->manager_window = None;
-
- gf_gtk_tray_icon_manager_window_update(tray_icon, TRUE);
-}
-
-static GdkFilterReturn
-gf_gtk_tray_icon_manager_filter(GdkXEvent *xe, GdkEvent *e, void *data) {
- GfGtkTrayIcon *tray_icon = GF_GTK_TRAY_ICON(data);
- GfGtkTrayIconPrivate *priv = GF_GTK_TRAY_ICON_GET_PRIVATE(tray_icon);
- XEvent *xev = (XEvent *)xe;
-
- if(xev->xany.type == ClientMessage &&
- xev->xclient.message_type == priv->manager &&
- xev->xclient.data.l[1] == priv->selection)
- {
- gf_gtk_tray_icon_manager_window_update(tray_icon, TRUE);
- } else if(xev->xany.window == priv->manager_window) {
- if(xev->xany.type == PropertyNotify &&
- xev->xproperty.atom == priv->x_orientation)
- {
- gf_gtk_tray_icon_update_orientation(tray_icon);
- }
- if(xev->xany.type == DestroyNotify) {
- gf_gtk_tray_icon_manager_window_destroyed(tray_icon);
- }
- }
-
- return GDK_FILTER_CONTINUE;
-}
-
-static void
-gf_gtk_tray_icon_show(GtkWidget *widget) {
- GfGtkTrayIcon *tray_icon = GF_GTK_TRAY_ICON(widget);
-
- gtk_widget_show(tray_icon->plug);
- gtk_widget_show(tray_icon->image);
-
- GTK_WIDGET_CLASS(parent_class)->show(widget);
-}
-
-static void
-gf_gtk_tray_icon_realize(GtkWidget *widget) {
- GfGtkTrayIcon *tray_icon = GF_GTK_TRAY_ICON(widget);
- GfGtkTrayIconPrivate *priv = GF_GTK_TRAY_ICON_GET_PRIVATE(tray_icon);
- GdkWindow *root;
- Display *xdisplay;
- gint screen;
- gchar buffer[256];
-
- if(GTK_WIDGET_CLASS(parent_class)->realize)
- GTK_WIDGET_CLASS(parent_class)->realize(widget);
-
- screen = gf_gtk_tray_icon_get_screen_number(widget);
- xdisplay = gf_gtk_tray_icon_get_xdisplay(widget);
-
- g_snprintf(buffer, sizeof(buffer), "_NET_SYSTEM_TRAY_S%d", screen);
-
- priv->selection = XInternAtom(xdisplay, buffer, False);
- priv->manager = XInternAtom(xdisplay, "MANAGER", False);
- priv->opcode = XInternAtom(xdisplay, "_NET_SYSTEM_TRAY_OPCODE", False);
- priv->x_orientation = XInternAtom(xdisplay, "_NET_SYSTEM_TRAY_ORIENTATION",
- False);
-
- gf_gtk_tray_icon_manager_window_update(tray_icon, FALSE);
- gf_gtk_tray_icon_send_dock_request(tray_icon);
-
- root = gf_gtk_tray_icon_get_root_window(widget);
- gdk_window_add_filter(root, gf_gtk_tray_icon_manager_filter,
- tray_icon);
-}
-
-static void
-gf_gtk_tray_icon_unrealize(GtkWidget *widget) {
- GfGtkTrayIcon *tray_icon = GF_GTK_TRAY_ICON(widget);
- GfGtkTrayIconPrivate *priv = GF_GTK_TRAY_ICON_GET_PRIVATE(tray_icon);
- GdkWindow *root;
-
- if(priv->manager != None) {
- GdkWindow *gdkwin;
-
- gdkwin = gf_gtk_tray_icon_get_xwindow(widget, priv->manager);
-
- gdk_window_remove_filter(gdkwin, gf_gtk_tray_icon_manager_filter,
- tray_icon);
- }
-
- root = gf_gtk_tray_icon_get_root_window(widget);
- gdk_window_remove_filter(root, gf_gtk_tray_icon_manager_filter,
- tray_icon);
-
- if(GTK_WIDGET_CLASS(parent_class)->unrealize)
- GTK_WIDGET_CLASS(parent_class)->unrealize(widget);
-}
-
-/******************************************************************************
- * Tray icon stuff
- *****************************************************************************/
-static void
-gf_gtk_x11_tray_icon_position_menu(GfGtkTrayIcon *tray_icon, GtkMenu *menu,
- gint *x, gint *y, gboolean *push_in)
-{
- GtkWidget *widget = GTK_WIDGET(tray_icon);
- GtkRequisition req;
- gint xp = 0, yp = 0;
- gint w, h;
-
- gtk_widget_size_request(GTK_WIDGET(menu), &req);
- gdk_window_get_origin(widget->window, &xp, &yp);
-
- xp += widget->allocation.x;
- yp += widget->allocation.y;
-
-#if GTK_CHECK_VERSION(2,2,0)
- {
- GdkScreen *screen = gtk_widget_get_screen(widget);
-
- w = gdk_screen_get_width(screen);
- h = gdk_screen_get_height(screen);
- }
-#else /* GTK_CHECK_VERSION(2,2,0) */
- w = gdk_screen_width();
- h = gdk_screen_height();
-#endif /* !GTK_CHECK_VERSION(2,2,0) */
-
- if(yp > h / 2)
- yp -= req.height;
- else
- yp += widget->allocation.height;
-
- *x = xp;
- *y = yp;
-
- *push_in = TRUE;
-}
-
-/******************************************************************************
- * Object stuff
- *****************************************************************************/
-static void
-gf_gtk_tray_icon_get_property(GObject *obj, guint param_id, GValue *value,
- GParamSpec *pspec)
-{
- GfGtkTrayIcon *tray_icon = GF_GTK_TRAY_ICON(obj);
-
- switch(param_id) {
- case PROP_ORIENTATION:
- g_value_set_enum(value,
- gf_gtk_tray_icon_get_orientation(tray_icon));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
- break;
- }
-}
-
-static void
-gf_gtk_tray_icon_class_init(GfGtkTrayIconClass *klass) {
- GObjectClass *obj_class = G_OBJECT_CLASS(klass);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
- GParamSpec *pspec;
-
- parent_class = g_type_class_peek_parent(klass);
-
- g_type_class_add_private(klass, sizeof(GfGtkTrayIconPrivate));
-
- obj_class->get_property = gf_gtk_tray_icon_get_property;
-
- widget_class->show = gf_gtk_tray_icon_show;
- widget_class->realize = gf_gtk_tray_icon_realize;
- widget_class->unrealize = gf_gtk_tray_icon_unrealize;
-
- klass->position_menu = gf_gtk_x11_tray_icon_position_menu;
-
- pspec = g_param_spec_enum("orientation", P_("orientation"),
- P_("The orientation of the tray."),
- GTK_TYPE_ORIENTATION,
- GTK_ORIENTATION_HORIZONTAL,
- G_PARAM_READABLE);
- g_object_class_install_property(obj_class, PROP_ORIENTATION, pspec);
-}
-
-static void
-gf_gtk_tray_icon_init(GTypeInstance *instance, gpointer g_class) {
- GfGtkTrayIcon *tray_icon = GF_GTK_TRAY_ICON(instance);
- GtkWidget *widget = GTK_WIDGET(tray_icon);
-
- gtk_widget_add_events(GTK_WIDGET(tray_icon), GDK_PROPERTY_CHANGE_MASK);
-
- /* dirty hack */
- tray_icon->plug = g_object_new(GTK_TYPE_PLUG, NULL);
-
- /* add ourselfs to the plug */
- gtk_container_add(GTK_CONTAINER(tray_icon->plug), widget);
-
- /* create the image and pack it into the tray icon (event box) */
- tray_icon->image = gtk_image_new();
- gtk_container_add(GTK_CONTAINER(tray_icon), tray_icon->image);
-}
-
-/******************************************************************************
- * API
- *****************************************************************************/
-GType
-gf_gtk_tray_icon_get_gtype(void) {
- static GType type = 0;
-
- if(type == 0) {
- static const GTypeInfo info = {
- sizeof(GfGtkTrayIconClass),
- NULL,
- NULL,
- (GClassInitFunc)gf_gtk_tray_icon_class_init,
- NULL,
- NULL,
- sizeof(GfGtkTrayIcon),
- 0,
- gf_gtk_tray_icon_init,
- };
-
- type = g_type_register_static(GTK_TYPE_EVENT_BOX,
- "GfGtkTrayIcon",
- &info, 0);
- }
-
- return type;
-}
-
-/**
- * gf_gtk_tray_icon_new:
- *
- * Creates a new #GfGtkTrayIcon.
- *
- * Return Value: A new #GfGtkTrayIcon.
- */
-GtkWidget *
-gf_gtk_tray_icon_new() {
- GtkWidget *tray_icon;
-
- tray_icon = g_object_new(GF_GTK_TYPE_TRAY_ICON, NULL);
-
- return tray_icon;
-}
-
-/**
- * gf_gtk_tray_icon_get_orientation:
- * @tray_icon : The #GfGtkTrayIcon instance.
- *
- * Gets the orientation of @tray_icon.
- *
- * Return Value: The orientation of @tray_icon.
- */
-GtkOrientation
-gf_gtk_tray_icon_get_orientation(const GfGtkTrayIcon *tray_icon) {
- GfGtkTrayIconPrivate *priv = NULL;
-
- g_return_val_if_fail(GF_GTK_IS_TRAY_ICON(tray_icon),
- GTK_ORIENTATION_HORIZONTAL);
-
- priv = GF_GTK_TRAY_ICON_GET_PRIVATE(tray_icon);
-
- return priv->gtk_orientation;
-}
--- a/gflib-gtk/po-properties/Makefile.in.in Sun Jul 26 23:11:55 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,256 +0,0 @@
-# Makefile for program source directory in GNU NLS utilities package.
-# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
-#
-# This file file be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
-#
-# - Modified by Owen Taylor <otaylor@redhat.com> to use GETTEXT_PACKAGE
-# instead of PACKAGE and to look for po2tbl in ./ not in intl/
-#
-# - Modified by jacob berkman <jacob@ximian.com> to install
-# Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
-
-GETTEXT_PACKAGE = @GETTEXT_PACKAGE@-properties
-PACKAGE = @PACKAGE@
-VERSION = @VERSION@
-
-XGETTEXT_KEYWORDS = --keyword --keyword=P_
-
-SHELL = /bin/sh
-@SET_MAKE@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-datadir = @datadir@
-libdir = @libdir@
-localedir = $(libdir)/locale
-gnulocaledir = $(datadir)/locale
-gettextsrcdir = $(datadir)/glib-2.0/gettext/po
-subdir = po-properties
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@
-
-CC = @CC@
-GENCAT = @GENCAT@
-GMSGFMT = @GMSGFMT@
-MSGFMT = @MSGFMT@
-XGETTEXT = @XGETTEXT@
-MSGMERGE = msgmerge
-
-DEFS = @DEFS@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-
-INCLUDES = -I.. -I$(top_srcdir)/intl
-
-COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
-
-SOURCES =
-POFILES = @POFILES@
-GMOFILES = @GMOFILES@
-DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(GETTEXT_PACKAGE).pot \
-$(POFILES) $(GMOFILES) $(SOURCES)
-
-POTFILES = \
-
-CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
-INSTOBJEXT = @INSTOBJEXT@
-
-.SUFFIXES:
-.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
-
-.c.o:
- $(COMPILE) $<
-
-.po.pox:
- $(MAKE) $(GETTEXT_PACKAGE).pot
- $(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*.pox
-
-.po.mo:
- $(MSGFMT) -o $@ $<
-
-.po.gmo:
- file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
- && rm -f $$file && $(GMSGFMT) -c -o $$file $<
-
-.po.cat:
- sed -f ../intl/po2msg.sed < $< > $*.msg \
- && rm -f $@ && $(GENCAT) $@ $*.msg
-
-
-all: all-@USE_NLS@
-
-all-yes: $(CATALOGS)
-all-no:
-
-$(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES)
- $(XGETTEXT) --default-domain=$(GETTEXT_PACKAGE) --directory=$(top_srcdir) \
- --add-comments --keyword --keyword=P_ \
- --files-from=$(srcdir)/POTFILES.in \
- && test ! -f $(GETTEXT_PACKAGE).po \
- || ( rm -f $(srcdir)/$(GETTEXT_PACKAGE).pot \
- && mv $(GETTEXT_PACKAGE).po $(srcdir)/$(GETTEXT_PACKAGE).pot )
-
-install: install-exec install-data
-install-exec:
-install-data: install-data-@USE_NLS@
-install-data-no: all
-install-data-yes: all
- if test -r "$(MKINSTALLDIRS)"; then \
- $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
- else \
- $(SHELL) $(top_srcdir)/install-sh -d $(DESTDIR)$(datadir); \
- fi
- @catalogs='$(CATALOGS)'; \
- for cat in $$catalogs; do \
- cat=`basename $$cat`; \
- case "$$cat" in \
- *.gmo) destdir=$(gnulocaledir);; \
- *) destdir=$(localedir);; \
- esac; \
- lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
- dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
- if test -r "$(MKINSTALLDIRS)"; then \
- $(MKINSTALLDIRS) $$dir; \
- else \
- $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
- fi; \
- if test -r $$cat; then \
- $(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
- echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
- else \
- $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
- echo "installing $(srcdir)/$$cat as" \
- "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
- fi; \
- if test -r $$cat.m; then \
- $(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
- echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
- else \
- if test -r $(srcdir)/$$cat.m ; then \
- $(INSTALL_DATA) $(srcdir)/$$cat.m \
- $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
- echo "installing $(srcdir)/$$cat as" \
- "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
- else \
- true; \
- fi; \
- fi; \
- done
- if test "$(PACKAGE)" = "glib"; then \
- if test -r "$(MKINSTALLDIRS)"; then \
- $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
- else \
- $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
- fi; \
- $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
- $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
- else \
- : ; \
- fi
-
-# Define this as empty until I found a useful application.
-installcheck:
-
-uninstall:
- catalogs='$(CATALOGS)'; \
- for cat in $$catalogs; do \
- cat=`basename $$cat`; \
- lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
- rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
- rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
- rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
- rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
- done
- if test "$(PACKAGE)" = "glib"; then \
- rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
- fi
-
-check: all
-
-dvi info tags TAGS ID:
-
-mostlyclean:
- rm -f core core.* *.pox $(GETTEXT_PACKAGE).po *.old.po cat-id-tbl.tmp
- rm -fr *.o
-
-clean: mostlyclean
-
-distclean: clean
- rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
-
-maintainer-clean: distclean
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
- rm -f $(GMOFILES)
-
-distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir)
-dist distdir: update-po $(DISTFILES)
- dists="$(DISTFILES)"; \
- for file in $$dists; do \
- ln $(srcdir)/$$file $(distdir) 2> /dev/null \
- || cp -p $(srcdir)/$$file $(distdir); \
- done
-
-update-po: Makefile
- $(MAKE) $(GETTEXT_PACKAGE).pot
- tmpdir=`pwd`; \
- cd $(srcdir); \
- catalogs='$(CATALOGS)'; \
- for cat in $$catalogs; do \
- cat=`basename $$cat`; \
- lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
- echo "$$lang:"; \
- if $(MSGMERGE) $$lang.po $(GETTEXT_PACKAGE).pot -o $$tmpdir/$$lang.new.po; then \
- if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
- rm -f $$tmpdir/$$lang.new.po; \
- else \
- if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
- :; \
- else \
- echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
- rm -f $$tmpdir/$$lang.new.po; \
- exit 1; \
- fi; \
- fi; \
- else \
- echo "msgmerge for $$cat failed!"; \
- rm -f $$tmpdir/$$lang.new.po; \
- fi; \
- done
-
-# POTFILES is created from POTFILES.in by stripping comments, empty lines
-# and Intltool tags (enclosed in square brackets), and appending a full
-# relative path to them
-POTFILES: POTFILES.in
- ( if test 'x$(srcdir)' != 'x.'; then \
- posrcprefix='$(top_srcdir)/'; \
- else \
- posrcprefix="../"; \
- fi; \
- rm -f $@-t $@ \
- && (sed -e '/^#/d' \
- -e "s/^\[.*\] +//" \
- -e '/^[ ]*$$/d' \
- -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
- | sed -e '$$s/\\$$//') > $@-t \
- && chmod a-w $@-t \
- && mv $@-t $@ )
-
-Makefile: Makefile.in.in ../config.status POTFILES
- cd .. \
- && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
- $(SHELL) ./config.status
-
-# Tell versions [3.59,3.63) of GNU make not to export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
--- a/gflib-gtk/po-properties/POTFILES.in Sun Jul 26 23:11:55 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-gflib-gtk/gf_gtk_color.c
-gflib-gtk/gf_gtk_core.c
-gflib-gtk/gf_gtk_gc.c
-gflib-gtk/gf_gtk_menu.c
-gflib-gtk/gf_gtk_tray_icon.c
-gflib-gtk/x11/gf_gtk_x11_tray_icon.c
--- a/gflib-gtk/po/POTFILES.in Sun Jul 26 23:11:55 2009 -0500
+++ b/gflib-gtk/po/POTFILES.in Sun Aug 02 18:25:52 2009 -0500
@@ -1,6 +1,4 @@
gflib-gtk/gf_gtk_color.c
gflib-gtk/gf_gtk_core.c
gflib-gtk/gf_gtk_gc.c
-gflib-gtk/gf_gtk_menu.c
-gflib-gtk/gf_gtk_tray_icon.c
-gflib-gtk/x11/gf_gtk_x11_tray_icon.c
+gflib-gtk/gf_gtk_ui.c
--- a/gflib-gtk/tests/testimage.c Sun Jul 26 23:11:55 2009 -0500
+++ b/gflib-gtk/tests/testimage.c Sun Aug 02 18:25:52 2009 -0500
@@ -23,6 +23,8 @@
#include <gflib-gtk/gf_lib_gtk.h>
+#include <gtk/gtk.h>
+
static void
delete_cb(GtkWidget *w, GdkEvent *e, gpointer data) {
gtk_main_quit();