[Xfce4-commits] <xfce4-panel:devel> * Drop .svn directory * Disable double buffering for the tray

Nick Schermer nick at xfce.org
Tue Aug 11 20:22:23 CEST 2009


Updating branch refs/heads/devel
         to faf2e3020d6958b40405d5196bf67f77b6aa4d6b (commit)
       from 93ee09ed5050ee328ce77c21969278be1c58eb6a (commit)

commit faf2e3020d6958b40405d5196bf67f77b6aa4d6b
Author: Nick Schermer <nick at xfce.org>
Date:   Sat Jun 21 11:13:49 2008 +0200

    * Drop .svn directory
    * Disable double buffering for the tray

 plugins/systray/.svn/all-wcprops                   |   71 --
 plugins/systray/.svn/dir-prop-base                 |   10 -
 plugins/systray/.svn/entries                       |  170 ----
 plugins/systray/.svn/format                        |    1 -
 .../systray/.svn/prop-base/Makefile.am.svn-base    |    5 -
 .../.svn/prop-base/xfce-tray-dialogs.c.svn-base    |    9 -
 .../.svn/prop-base/xfce-tray-dialogs.h.svn-base    |    9 -
 .../.svn/prop-base/xfce-tray-manager.c.svn-base    |    9 -
 .../.svn/prop-base/xfce-tray-manager.h.svn-base    |    9 -
 .../.svn/prop-base/xfce-tray-marshal.list.svn-base |    5 -
 .../.svn/prop-base/xfce-tray-plugin.c.svn-base     |    9 -
 .../.svn/prop-base/xfce-tray-plugin.h.svn-base     |    9 -
 .../.svn/prop-base/xfce-tray-widget.c.svn-base     |    9 -
 .../.svn/prop-base/xfce-tray-widget.h.svn-base     |    9 -
 .../systray/.svn/text-base/Makefile.am.svn-base    |  117 ---
 .../.svn/text-base/systray.desktop.in.in.svn-base  |    9 -
 .../.svn/text-base/xfce-tray-dialogs.c.svn-base    |  492 -----------
 .../.svn/text-base/xfce-tray-dialogs.h.svn-base    |   23 -
 .../.svn/text-base/xfce-tray-manager.c.svn-base    |  913 --------------------
 .../.svn/text-base/xfce-tray-manager.h.svn-base    |   76 --
 .../.svn/text-base/xfce-tray-marshal.list.svn-base |    2 -
 .../.svn/text-base/xfce-tray-plugin.c.svn-base     |  498 -----------
 .../.svn/text-base/xfce-tray-plugin.h.svn-base     |   42 -
 .../.svn/text-base/xfce-tray-widget.c.svn-base     |  870 -------------------
 .../.svn/text-base/xfce-tray-widget.h.svn-base     |   69 --
 plugins/systray/xfce-tray-manager.c                |   28 +-
 26 files changed, 27 insertions(+), 3446 deletions(-)

diff --git a/plugins/systray/.svn/all-wcprops b/plugins/systray/.svn/all-wcprops
deleted file mode 100644
index f9e097a..0000000
--- a/plugins/systray/.svn/all-wcprops
+++ /dev/null
@@ -1,71 +0,0 @@
-K 25
-svn:wc:ra_dav:version-url
-V 58
-/svn/xfce/!svn/ver/26462/xfce4-panel/trunk/plugins/systray
-END
-xfce-tray-plugin.c
-K 25
-svn:wc:ra_dav:version-url
-V 77
-/svn/xfce/!svn/ver/26462/xfce4-panel/trunk/plugins/systray/xfce-tray-plugin.c
-END
-systray.desktop.in.in
-K 25
-svn:wc:ra_dav:version-url
-V 80
-/svn/xfce/!svn/ver/25184/xfce4-panel/trunk/plugins/systray/systray.desktop.in.in
-END
-xfce-tray-manager.h
-K 25
-svn:wc:ra_dav:version-url
-V 78
-/svn/xfce/!svn/ver/26319/xfce4-panel/trunk/plugins/systray/xfce-tray-manager.h
-END
-xfce-tray-marshal.list
-K 25
-svn:wc:ra_dav:version-url
-V 81
-/svn/xfce/!svn/ver/26037/xfce4-panel/trunk/plugins/systray/xfce-tray-marshal.list
-END
-xfce-tray-dialogs.c
-K 25
-svn:wc:ra_dav:version-url
-V 78
-/svn/xfce/!svn/ver/26462/xfce4-panel/trunk/plugins/systray/xfce-tray-dialogs.c
-END
-xfce-tray-plugin.h
-K 25
-svn:wc:ra_dav:version-url
-V 77
-/svn/xfce/!svn/ver/26369/xfce4-panel/trunk/plugins/systray/xfce-tray-plugin.h
-END
-xfce-tray-widget.c
-K 25
-svn:wc:ra_dav:version-url
-V 77
-/svn/xfce/!svn/ver/26462/xfce4-panel/trunk/plugins/systray/xfce-tray-widget.c
-END
-xfce-tray-dialogs.h
-K 25
-svn:wc:ra_dav:version-url
-V 78
-/svn/xfce/!svn/ver/26319/xfce4-panel/trunk/plugins/systray/xfce-tray-dialogs.h
-END
-Makefile.am
-K 25
-svn:wc:ra_dav:version-url
-V 70
-/svn/xfce/!svn/ver/26179/xfce4-panel/trunk/plugins/systray/Makefile.am
-END
-xfce-tray-widget.h
-K 25
-svn:wc:ra_dav:version-url
-V 77
-/svn/xfce/!svn/ver/26462/xfce4-panel/trunk/plugins/systray/xfce-tray-widget.h
-END
-xfce-tray-manager.c
-K 25
-svn:wc:ra_dav:version-url
-V 78
-/svn/xfce/!svn/ver/26412/xfce4-panel/trunk/plugins/systray/xfce-tray-manager.c
-END
diff --git a/plugins/systray/.svn/dir-prop-base b/plugins/systray/.svn/dir-prop-base
deleted file mode 100644
index fcca934..0000000
--- a/plugins/systray/.svn/dir-prop-base
+++ /dev/null
@@ -1,10 +0,0 @@
-K 10
-svn:ignore
-V 42
-Makefile
-Makefile.in
-.deps
-.libs
-*desktop
-
-END
diff --git a/plugins/systray/.svn/entries b/plugins/systray/.svn/entries
deleted file mode 100644
index c057ccc..0000000
--- a/plugins/systray/.svn/entries
+++ /dev/null
@@ -1,170 +0,0 @@
-8
-
-dir
-26620
-https://svn.xfce.org/svn/xfce/xfce4-panel/trunk/plugins/systray
-https://svn.xfce.org/svn/xfce
-
-
-
-2007-12-12T12:00:59.135582Z
-26462
-nick
-has-props
-
-svn:special svn:externals svn:needs-lock
-
-
-
-
-
-
-
-
-
-
-
-a0aa69c2-05f4-0310-b83c-d5d913b14636
-
-xfce-tray-plugin.c
-file
-
-
-
-
-2007-12-21T07:30:11.000000Z
-02df61baac8a38857567edc3c701de6b
-2007-12-12T12:00:59.135582Z
-26462
-nick
-has-props
-
-systray.desktop.in.in
-file
-
-
-
-
-2007-12-21T07:30:11.000000Z
-b133b5a60ae9fd80d4c73a5be6ff1496
-2007-03-17T22:54:06.804764Z
-25184
-nick
-
-xfce-tray-manager.h
-file
-
-
-
-
-2007-12-21T07:30:11.000000Z
-f995d1fe15d1364d9bd539ba47892477
-2007-11-16T15:32:40.493177Z
-26319
-nick
-has-props
-
-xfce-tray-marshal.list
-file
-
-
-
-
-2007-12-21T07:30:11.000000Z
-c3d3745a0f2f744583838586202f6514
-2007-09-02T11:47:54.578625Z
-26037
-nick
-has-props
-
-xfce-tray-dialogs.c
-file
-
-
-
-
-2007-12-21T07:30:11.000000Z
-400ba78cca871a9b1af0f106c04ab9b4
-2007-12-12T12:00:59.135582Z
-26462
-nick
-has-props
-
-xfce-tray-plugin.h
-file
-
-
-
-
-2007-12-21T07:30:11.000000Z
-79deca82b6efa4ec9220c10bbb42d27e
-2007-11-18T17:19:08.997370Z
-26369
-nick
-has-props
-
-xfce-tray-widget.c
-file
-
-
-
-
-2007-12-21T07:30:11.000000Z
-eb5a826e15a18a72f1b929b3a19ddf13
-2007-12-12T12:00:59.135582Z
-26462
-nick
-has-props
-
-xfce-tray-dialogs.h
-file
-
-
-
-
-2007-12-21T07:30:11.000000Z
-e0324d2076e98be2220edec591293bb8
-2007-11-16T15:32:40.493177Z
-26319
-nick
-has-props
-
-Makefile.am
-file
-
-
-
-
-2007-12-21T07:30:11.000000Z
-5b0685db7bdcb5aa540280ad0a001f81
-2007-10-23T09:17:59.055592Z
-26179
-nick
-has-props
-
-xfce-tray-widget.h
-file
-
-
-
-
-2007-12-21T07:30:11.000000Z
-5439911b6b9494f06e91fc68e5e1c38c
-2007-12-12T12:00:59.135582Z
-26462
-nick
-has-props
-
-xfce-tray-manager.c
-file
-
-
-
-
-2007-12-21T07:30:11.000000Z
-5f0795e417e38bf6cd01701247e00aec
-2007-12-02T09:48:17.760613Z
-26412
-nick
-has-props
-
diff --git a/plugins/systray/.svn/format b/plugins/systray/.svn/format
deleted file mode 100644
index 45a4fb7..0000000
--- a/plugins/systray/.svn/format
+++ /dev/null
@@ -1 +0,0 @@
-8
diff --git a/plugins/systray/.svn/prop-base/Makefile.am.svn-base b/plugins/systray/.svn/prop-base/Makefile.am.svn-base
deleted file mode 100644
index 92c8ad7..0000000
--- a/plugins/systray/.svn/prop-base/Makefile.am.svn-base
+++ /dev/null
@@ -1,5 +0,0 @@
-K 12
-svn:keywords
-V 2
-Id
-END
diff --git a/plugins/systray/.svn/prop-base/xfce-tray-dialogs.c.svn-base b/plugins/systray/.svn/prop-base/xfce-tray-dialogs.c.svn-base
deleted file mode 100644
index ab0d44b..0000000
--- a/plugins/systray/.svn/prop-base/xfce-tray-dialogs.c.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 8
-keywords
-V 2
-Id
-K 12
-svn:keywords
-V 2
-Id
-END
diff --git a/plugins/systray/.svn/prop-base/xfce-tray-dialogs.h.svn-base b/plugins/systray/.svn/prop-base/xfce-tray-dialogs.h.svn-base
deleted file mode 100644
index ab0d44b..0000000
--- a/plugins/systray/.svn/prop-base/xfce-tray-dialogs.h.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 8
-keywords
-V 2
-Id
-K 12
-svn:keywords
-V 2
-Id
-END
diff --git a/plugins/systray/.svn/prop-base/xfce-tray-manager.c.svn-base b/plugins/systray/.svn/prop-base/xfce-tray-manager.c.svn-base
deleted file mode 100644
index ab0d44b..0000000
--- a/plugins/systray/.svn/prop-base/xfce-tray-manager.c.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 8
-keywords
-V 2
-Id
-K 12
-svn:keywords
-V 2
-Id
-END
diff --git a/plugins/systray/.svn/prop-base/xfce-tray-manager.h.svn-base b/plugins/systray/.svn/prop-base/xfce-tray-manager.h.svn-base
deleted file mode 100644
index ab0d44b..0000000
--- a/plugins/systray/.svn/prop-base/xfce-tray-manager.h.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 8
-keywords
-V 2
-Id
-K 12
-svn:keywords
-V 2
-Id
-END
diff --git a/plugins/systray/.svn/prop-base/xfce-tray-marshal.list.svn-base b/plugins/systray/.svn/prop-base/xfce-tray-marshal.list.svn-base
deleted file mode 100644
index 4d1314e..0000000
--- a/plugins/systray/.svn/prop-base/xfce-tray-marshal.list.svn-base
+++ /dev/null
@@ -1,5 +0,0 @@
-K 8
-keywords
-V 2
-Id
-END
diff --git a/plugins/systray/.svn/prop-base/xfce-tray-plugin.c.svn-base b/plugins/systray/.svn/prop-base/xfce-tray-plugin.c.svn-base
deleted file mode 100644
index ab0d44b..0000000
--- a/plugins/systray/.svn/prop-base/xfce-tray-plugin.c.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 8
-keywords
-V 2
-Id
-K 12
-svn:keywords
-V 2
-Id
-END
diff --git a/plugins/systray/.svn/prop-base/xfce-tray-plugin.h.svn-base b/plugins/systray/.svn/prop-base/xfce-tray-plugin.h.svn-base
deleted file mode 100644
index ab0d44b..0000000
--- a/plugins/systray/.svn/prop-base/xfce-tray-plugin.h.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 8
-keywords
-V 2
-Id
-K 12
-svn:keywords
-V 2
-Id
-END
diff --git a/plugins/systray/.svn/prop-base/xfce-tray-widget.c.svn-base b/plugins/systray/.svn/prop-base/xfce-tray-widget.c.svn-base
deleted file mode 100644
index ab0d44b..0000000
--- a/plugins/systray/.svn/prop-base/xfce-tray-widget.c.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 8
-keywords
-V 2
-Id
-K 12
-svn:keywords
-V 2
-Id
-END
diff --git a/plugins/systray/.svn/prop-base/xfce-tray-widget.h.svn-base b/plugins/systray/.svn/prop-base/xfce-tray-widget.h.svn-base
deleted file mode 100644
index ab0d44b..0000000
--- a/plugins/systray/.svn/prop-base/xfce-tray-widget.h.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 8
-keywords
-V 2
-Id
-K 12
-svn:keywords
-V 2
-Id
-END
diff --git a/plugins/systray/.svn/text-base/Makefile.am.svn-base b/plugins/systray/.svn/text-base/Makefile.am.svn-base
deleted file mode 100644
index 78e7c48..0000000
--- a/plugins/systray/.svn/text-base/Makefile.am.svn-base
+++ /dev/null
@@ -1,117 +0,0 @@
-# $Id$
-
-INCLUDES = 								\
-	-I$(top_srcdir)							\
-	-DG_LOG_DOMAIN=\"libsystray\"					\
-	-DLOCALEDIR=\"$(localedir)\"					\
-	$(PLATFORM_CPPFLAGS)
-
-plugindir =								\
-	$(libdir)/xfce4/panel-plugins
-
-plugin_LTLIBRARIES =							\
-	libsystray.la
-	
-libsystray_built_sources =						\
-	xfce-tray-marshal.c						\
-	xfce-tray-marshal.h
-
-libsystray_la_SOURCES = 						\
-	$(libsystray_built_sources)					\
-	xfce-tray-dialogs.c						\
-	xfce-tray-dialogs.h						\
-	xfce-tray-manager.c						\
-	xfce-tray-manager.h						\
-	xfce-tray-plugin.c						\
-	xfce-tray-plugin.h						\
-	xfce-tray-widget.c						\
-	xfce-tray-widget.h
-
-libsystray_la_CFLAGS =							\
-	$(LIBX11_CFLAGS)						\
-	$(GTK_CFLAGS)							\
-	$(LIBXFCE4UTIL_CFLAGS)						\
-	$(LIBXFCEGUI4_CFLAGS)						\
-	$(PLATFORM_CFLAGS)
-
-libsystray_la_LDFLAGS =							\
-	-avoid-version							\
-	-module								\
-	$(PLATFORM_LDFLAGS)
-
-if HAVE_CYGWIN
-libsystray_la_LDFLAGS += 						\
-	-no-undefined
-endif
-
-libsystray_la_LIBADD =							\
-	$(top_builddir)/libxfce4panel/libxfce4panel.la			\
-	$(LIBX11_LIBS)							\
-	$(GTK_LIBS)							\
-	$(LIBXFCE4UTIL_LIBS)						\
-	$(LIBXFCEGUI4_LIBS)
-
-libsystray_la_DEPENDENCIES =						\
-	$(top_builddir)/libxfce4panel/libxfce4panel.la
-
-#
-# .desktop file
-#
-desktopdir =								\
-	$(datadir)/xfce4/panel-plugins
-
-desktop_in_in_files =							\
-	systray.desktop.in.in
-
-desktop_in_files = 							\
-	$(desktop_in_in_files:.desktop.in.in=.desktop.in)
-
-%.desktop.in: %.desktop.in.in
-	sed -e "s,\@libdir\@,$(libdir),g" < $< > $@
-
-desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
- at INTLTOOL_DESKTOP_RULE@
-
-EXTRA_DIST = 								\
-	$(desktop_in_in_files)						\
-	xfce-tray-marshal.list
-	
-DISTCLEANFILES =							\
-	$(desktop_DATA)							\
-	$(desktop_in_files)
-	
-#
-# Rules to auto-generate built sources
-#
-if MAINTAINER_MODE
-CLEANFILES =								\
-	xgen-xtmc							\
-	xgen-xtmh
-
-BUILT_SOURCES =								\
-	$(libsystray_built_sources)
-
-DISTCLEANFILES +=							\
-	$(libsystray_built_sources)					\
-	stamp-xfce-tray-marshal.h
-
-xfce-tray-marshal.h: stamp-xfce-tray-marshal.h
-	@true
-stamp-xfce-tray-marshal.h: $(srcdir)/xfce-tray-marshal.list Makefile
-	( cd $(srcdir) && glib-genmarshal \
-		--prefix=_xfce_tray_marshal \
-		--header xfce-tray-marshal.list \
-		| sed -e 's/marshal_data);$$/marshal_data) G_GNUC_INTERNAL;/' ) >> xgen-xtmh \
-	&& ( cmp -s xgen-xtmh xfce-tray-marshal.h || cp xgen-xtmh xfce-tray-marshal.h ) \
-	&& rm -f xgen-xtmh \
-	&& echo timestamp > $(@F)
-
-xfce-tray-marshal.c: xfce-tray-marshal.h Makefile
-	( cd $(srcdir) && glib-genmarshal \
-		--prefix=_xfce_tray_marshal \
-		--body xfce-tray-marshal.list ) >> xgen-xtmc \
-	&& cp xgen-xtmc xfce-tray-marshal.c \
-	&& rm -f xgen-xtmc
-endif
-
-# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
diff --git a/plugins/systray/.svn/text-base/systray.desktop.in.in.svn-base b/plugins/systray/.svn/text-base/systray.desktop.in.in.svn-base
deleted file mode 100644
index 2bd3009..0000000
--- a/plugins/systray/.svn/text-base/systray.desktop.in.in.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-[Xfce Panel]
-Type=X-XFCE-PanelPlugin
-Encoding=UTF-8
-_Name=System Tray
-_Comment=Show notification icons
-Icon=xfce4-systray
-X-XFCE-Module=systray
-X-XFCE-Module-Path=@libdir@/xfce4/panel-plugins
-
diff --git a/plugins/systray/.svn/text-base/xfce-tray-dialogs.c.svn-base b/plugins/systray/.svn/text-base/xfce-tray-dialogs.c.svn-base
deleted file mode 100644
index 7582ab1..0000000
--- a/plugins/systray/.svn/text-base/xfce-tray-dialogs.c.svn-base
+++ /dev/null
@@ -1,492 +0,0 @@
-/* $Id$ */
-/*
- * Copyright (c) 2007 Nick Schermer <nick at xfce.org>
- *
- * 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
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#define XFCE_TRAY_DIALOG_ICON_SIZE 22
-
-#include <gtk/gtk.h>
-#include <libxfce4util/libxfce4util.h>
-#include <libxfcegui4/xfce-titled-dialog.h>
-#include <libxfcegui4/xfce-widget-helpers.h>
-#include <libxfce4panel/xfce-panel-plugin.h>
-#include <libxfce4panel/xfce-panel-macros.h>
-
-#include "xfce-tray-manager.h"
-#include "xfce-tray-widget.h"
-#include "xfce-tray-plugin.h"
-#include "xfce-tray-dialogs.h"
-
-
-
-enum
-{
-    APPLICATION_ICON,
-    APPLICATION_NAME,
-    APPLICATION_HIDDEN,
-    N_COLUMNS
-};
-
-
-
-/* prototypes */
-static gchar     *xfce_tray_dialogs_camel_case         (const gchar           *text);
-static GdkPixbuf *xfce_tray_dialogs_icon               (GtkIconTheme          *icon_theme,
-                                                        const gchar           *name);
-static void       xfce_tray_dialogs_show_frame_toggled (GtkToggleButton       *button,
-                                                        XfceTrayPlugin        *plugin);
-static void       xfce_tray_dialogs_n_rows_changed     (GtkSpinButton         *button,
-                                                        XfceTrayPlugin        *plugin);
-static void       xfce_tray_dialogs_treeview_toggled   (GtkCellRendererToggle *widget,
-                                                        gchar                 *path,
-                                                        GtkWidget             *treeview);
-static void       xfce_tray_dialogs_free_store         (GtkListStore          *store);
-static void       xfce_tray_dialogs_configure_response (GtkWidget             *dialog,
-                                                        gint                   response,
-                                                        XfceTrayPlugin        *plugin);
-
-
-
-static gchar *
-xfce_tray_dialogs_camel_case (const gchar *text)
-{
-    const gchar *t;
-    gboolean     upper = TRUE;
-    gunichar     c;
-    GString     *result;
-
-    /* allocate a new string for the result */
-    result = g_string_sized_new (32);
-
-    /* convert the input text */
-    for (t = text; *t != '\0'; t = g_utf8_next_char (t))
-    {
-        /* check the next char */
-        c = g_utf8_get_char (t);
-        if (g_unichar_isspace (c))
-        {
-            upper = TRUE;
-        }
-        else if (upper)
-        {
-            c = g_unichar_toupper (c);
-            upper = FALSE;
-        }
-        else
-        {
-           c = g_unichar_tolower (c);
-        }
-
-        /* append the char to the result */
-        g_string_append_unichar (result, c);
-    }
-
-  return g_string_free (result, FALSE);
-}
-
-
-
-static GdkPixbuf *
-xfce_tray_dialogs_icon (GtkIconTheme *icon_theme,
-                        const gchar  *name)
-{
-    GdkPixbuf   *icon;
-    guint        i;
-    gchar       *first_occ;
-    const gchar *p;
-    const gchar *fallback[][2] =
-    {
-        /* application name ,  fallback icon name or path */
-        { "xfce-mcs-manager", "input-mouse" },
-        { "bluetooth-applet", "stock_bluetooth" },
-        { "gdl_box",          "/opt/google/desktop/resource/gdl_small.png" }
-    };
-
-    /* return null on no name */
-    if (G_UNLIKELY (name == NULL))
-        return NULL;
-
-    /* try to load the icon from the theme */
-    icon = gtk_icon_theme_load_icon (icon_theme, name, XFCE_TRAY_DIALOG_ICON_SIZE, 0, NULL);
-    if (G_LIKELY (icon))
-        return icon;
-
-    /* try the first part when the name contains a space */
-    p = g_utf8_strchr (name, -1, ' ');
-    if (p)
-    {
-        /* get the string before the first occurrence */
-        first_occ = g_strndup (name, p - name);
-
-        /* try to load the icon from the theme */
-        icon = gtk_icon_theme_load_icon (icon_theme, first_occ, XFCE_TRAY_DIALOG_ICON_SIZE, 0, NULL);
-
-        /* cleanup */
-        g_free (first_occ);
-
-        if (icon)
-            return icon;
-    }
-
-    /* find and return a fall-back icon */
-    for (i = 0; i < G_N_ELEMENTS (fallback); i++)
-        if (strcmp (name, fallback[i][0]) == 0)
-        {
-            if (g_path_is_absolute (fallback[i][1]))
-            {
-               return gdk_pixbuf_new_from_file_at_size (fallback[i][1], XFCE_TRAY_DIALOG_ICON_SIZE,
-                                                        XFCE_TRAY_DIALOG_ICON_SIZE, NULL);
-            }
-            else
-            {
-               return gtk_icon_theme_load_icon (icon_theme, fallback[i][1], XFCE_TRAY_DIALOG_ICON_SIZE,
-                                                0, NULL);
-            }
-        }
-
-    return NULL;
-}
-
-
-
-static void
-xfce_tray_dialogs_show_frame_toggled (GtkToggleButton *button,
-                                      XfceTrayPlugin  *plugin)
-{
-    gboolean active;
-    gint     panel_size;
-
-    /* get state */
-    active = gtk_toggle_button_get_active (button);
-
-    /* set frame shadow */
-    gtk_frame_set_shadow_type (GTK_FRAME (plugin->frame), active ? GTK_SHADOW_IN : GTK_SHADOW_NONE);
-
-    /* save */
-    plugin->show_frame = active;
-
-    /* get the panel size */
-    panel_size = xfce_panel_plugin_get_size (plugin->panel_plugin);
-
-    /* emit size-changed signal */
-    g_signal_emit_by_name (G_OBJECT (plugin->panel_plugin), "size-changed", panel_size, &active);
-}
-
-
-
-static void
-xfce_tray_dialogs_n_rows_changed (GtkSpinButton  *button,
-                                  XfceTrayPlugin *plugin)
-{
-   gint value;
-
-   /* get value */
-   value = gtk_spin_button_get_value_as_int (button);
-
-   /* set rows */
-   xfce_tray_widget_set_rows (XFCE_TRAY_WIDGET (plugin->tray), value);
-}
-
-
-
-static void
-xfce_tray_dialogs_treeview_toggled (GtkCellRendererToggle *widget,
-                                    gchar                 *path,
-                                    GtkWidget             *treeview)
-{
-    GtkTreeModel   *model;
-    GtkTreeIter     iter;
-    gchar          *tmp, *name;
-    gboolean        hidden;
-    XfceTrayPlugin *plugin;
-
-    /* get the tree model */
-    model = gtk_tree_view_get_model (GTK_TREE_VIEW (treeview));
-
-    /* get the tree iter */
-    if (G_LIKELY (gtk_tree_model_get_iter_from_string (model, &iter, path)))
-    {
-        /* get the lower case application name and hidden state */
-        gtk_tree_model_get (model, &iter, APPLICATION_NAME, &tmp, APPLICATION_HIDDEN, &hidden, -1);
-        name = g_utf8_strdown (tmp, -1);
-        g_free (tmp);
-
-        /* get tray plugin */
-        plugin = g_object_get_data (G_OBJECT (treeview), I_("xfce-tray-plugin"));
-
-        if (G_LIKELY (name && plugin))
-        {
-           /* update the manager */
-           xfce_tray_widget_name_update (XFCE_TRAY_WIDGET (plugin->tray), name, !hidden);
-
-           /* set the new list value */
-           gtk_list_store_set (GTK_LIST_STORE (model), &iter, APPLICATION_HIDDEN, !hidden, -1);
-        }
-
-        /* cleanup */
-        g_free (name);
-    }
-}
-
-
-
-static void
-xfce_tray_dialogs_free_store (GtkListStore *store)
-{
-    /* clear store */
-    gtk_list_store_clear (store);
-
-    /* release the store */
-    g_object_unref (G_OBJECT (store));
-}
-
-
-
-static void
-xfce_tray_dialogs_configure_response (GtkWidget      *dialog,
-                                      gint            response,
-                                      XfceTrayPlugin *plugin)
-{
-    GtkWidget    *question;
-    GtkListStore *store;
-
-    if (response == GTK_RESPONSE_YES)
-    {
-        /* create question dialog, with hig buttons */
-        question = gtk_message_dialog_new (GTK_WINDOW (dialog), GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,
-                                           GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE,
-                                           _("Are you sure you want to clear the list of known applications?"));
-        gtk_dialog_add_buttons (GTK_DIALOG (question), GTK_STOCK_CANCEL, GTK_RESPONSE_NO,
-                                GTK_STOCK_CLEAR, GTK_RESPONSE_YES, NULL);
-        gtk_dialog_set_default_response (GTK_DIALOG (question), GTK_RESPONSE_NO);
-
-        /* run dialog */
-        if (gtk_dialog_run (GTK_DIALOG (question)) == GTK_RESPONSE_YES)
-        {
-           /* clear hash table and update tray */
-           xfce_tray_widget_clear_name_list (XFCE_TRAY_WIDGET (plugin->tray));
-
-           /* clear store */
-           store = g_object_get_data (G_OBJECT (dialog), I_("xfce-tray-store"));
-           gtk_list_store_clear (store);
-        }
-
-       /* destroy */
-       gtk_widget_destroy (question);
-    }
-    else
-    {
-        /* destroy dialog */
-        gtk_widget_destroy (dialog);
-
-        /* unblock plugin menu */
-        xfce_panel_plugin_unblock_menu (plugin->panel_plugin);
-    }
-}
-
-
-
-void
-xfce_tray_dialogs_configure (XfceTrayPlugin *plugin)
-{
-    GtkWidget           *dialog, *dialog_vbox;
-    GtkWidget           *frame, *bin, *button;
-    GtkWidget           *scroll, *treeview;
-    GtkWidget           *vbox, *label, *hbox, *spin;
-    GtkListStore        *store;
-    GtkTreeViewColumn   *column;
-    GtkCellRenderer     *renderer;
-    GtkTreeIter          iter;
-    GList               *names, *li;
-    const gchar         *name;
-    gchar               *camelcase;
-    gboolean             hidden;
-    GtkIconTheme        *icon_theme;
-    GdkPixbuf           *pixbuf;
-
-    /* lock plugin menu */
-    xfce_panel_plugin_block_menu (plugin->panel_plugin);
-
-    /* create dialog */
-    dialog = xfce_titled_dialog_new_with_buttons (_("System Tray"),
-                                                  NULL,
-                                                  GTK_DIALOG_NO_SEPARATOR,
-                                                  GTK_STOCK_CLEAR, GTK_RESPONSE_YES,
-                                                  GTK_STOCK_OK, GTK_RESPONSE_OK,
-                                                  NULL);
-    gtk_window_set_screen (GTK_WINDOW (dialog), gtk_widget_get_screen (GTK_WIDGET (plugin->panel_plugin)));
-    gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
-    gtk_window_set_icon_name (GTK_WINDOW (dialog), "xfce4-settings");
-    gtk_window_set_default_size (GTK_WINDOW (dialog), 280, 400);
-    gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
-    gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
-    g_signal_connect (G_OBJECT (dialog), "response", G_CALLBACK (xfce_tray_dialogs_configure_response), plugin);
-
-    /* main vbox */
-    dialog_vbox = GTK_DIALOG (dialog)->vbox;
-
-    /* appearance */
-    frame = xfce_create_framebox (_("Appearance"), &bin);
-    gtk_box_pack_start (GTK_BOX (dialog_vbox), frame, FALSE, TRUE, 0);
-    gtk_container_set_border_width (GTK_CONTAINER (frame), 6);
-    gtk_widget_show (frame);
-
-    /* vbox */
-    vbox = gtk_vbox_new (FALSE, 6);
-    gtk_container_add (GTK_CONTAINER (bin), vbox);
-    gtk_widget_show (vbox);
-
-    /* show frame */
-    button = gtk_check_button_new_with_mnemonic (_("Show _frame"));
-    gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
-    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), plugin->show_frame);
-    g_signal_connect (button, "toggled", G_CALLBACK (xfce_tray_dialogs_show_frame_toggled), plugin);
-    gtk_widget_show (button);
-
-    /* box */
-    hbox = gtk_hbox_new (FALSE, 12);
-    gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
-    gtk_widget_show (hbox);
-
-    /* number of rows */
-    label = gtk_label_new_with_mnemonic (_("_Number of rows:"));
-    gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
-    gtk_widget_show (label);
-
-    /* spin */
-    spin = gtk_spin_button_new_with_range (1, 6, 1);
-    gtk_spin_button_set_digits (GTK_SPIN_BUTTON (spin), 0);
-    gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spin), TRUE);
-    gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin), xfce_tray_widget_get_rows (XFCE_TRAY_WIDGET (plugin->tray)));
-    g_signal_connect (G_OBJECT (spin), "value-changed", G_CALLBACK (xfce_tray_dialogs_n_rows_changed), plugin);
-    gtk_box_pack_start (GTK_BOX (hbox), spin, FALSE, FALSE, 0);
-    gtk_label_set_mnemonic_widget (GTK_LABEL (label), spin);
-    gtk_widget_show (spin);
-
-    /* applications */
-    frame = xfce_create_framebox (_("Hidden Applications"), &bin);
-    gtk_box_pack_start (GTK_BOX (dialog_vbox), frame, TRUE, TRUE, 0);
-    gtk_container_set_border_width (GTK_CONTAINER (frame), 6);
-    gtk_widget_show (frame);
-
-    /* scrolled window */
-    scroll = gtk_scrolled_window_new (NULL, NULL);
-    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-    gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroll), GTK_SHADOW_IN);
-    gtk_container_add (GTK_CONTAINER (bin), scroll);
-    gtk_widget_show (scroll);
-
-    /* create list store */
-    store = gtk_list_store_new (N_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_BOOLEAN);
-    g_object_set_data (G_OBJECT (dialog), I_("xfce-tray-store"), store);
-
-    /* create treeview */
-    treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
-    gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE);
-    gtk_tree_view_set_search_column (GTK_TREE_VIEW (treeview), APPLICATION_NAME);
-    gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview), TRUE);
-    gtk_tree_view_set_fixed_height_mode (GTK_TREE_VIEW (treeview), TRUE);
-    gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview), TRUE);
-    g_signal_connect_swapped (G_OBJECT (treeview), "destroy", G_CALLBACK (xfce_tray_dialogs_free_store), store);
-    gtk_container_add (GTK_CONTAINER (scroll), treeview);
-    gtk_widget_show (treeview);
-
-    /* connect the plugin to the treeview */
-    g_object_set_data (G_OBJECT (treeview), I_("xfce-tray-plugin"), plugin);
-
-    /* create column */
-    column = gtk_tree_view_column_new ();
-    gtk_tree_view_column_set_spacing (column, 2);
-    gtk_tree_view_column_set_expand (column, TRUE);
-    gtk_tree_view_column_set_resizable (column, FALSE);
-    gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED);
-    gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
-
-    /* renderer for the icon */
-    renderer = gtk_cell_renderer_pixbuf_new();
-    gtk_cell_renderer_set_fixed_size (renderer, XFCE_TRAY_DIALOG_ICON_SIZE, XFCE_TRAY_DIALOG_ICON_SIZE);
-    gtk_tree_view_column_pack_start (column, renderer, FALSE);
-    gtk_tree_view_column_set_attributes (column, renderer, "pixbuf", APPLICATION_ICON, NULL);
-
-    /* renderer for the name */
-    renderer = gtk_cell_renderer_text_new ();
-    gtk_tree_view_column_pack_start (column, renderer, TRUE);
-    gtk_tree_view_column_set_attributes (column, renderer, "text", APPLICATION_NAME, NULL);
-    g_object_set (G_OBJECT (renderer), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
-
-    /* renderer for the toggle button */
-    renderer = gtk_cell_renderer_toggle_new ();
-    gtk_tree_view_column_pack_start (column, renderer, FALSE);
-    gtk_tree_view_column_set_attributes (column, renderer, "active", APPLICATION_HIDDEN, NULL);
-    g_signal_connect (G_OBJECT (renderer), "toggled", G_CALLBACK(xfce_tray_dialogs_treeview_toggled), treeview);
-
-    /* get the icon theme */
-    if (G_LIKELY (gtk_widget_has_screen (dialog)))
-        icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (dialog));
-    else
-        icon_theme = gtk_icon_theme_get_default ();
-
-    /* get the sorted list of applications */
-    names = xfce_tray_widget_name_list (XFCE_TRAY_WIDGET (plugin->tray));
-
-    /* add all the application to the list */
-    for (li = names; li != NULL; li = li->next)
-    {
-        name = li->data;
-
-        /* create a camel case name of the application */
-        camelcase = xfce_tray_dialogs_camel_case (name);
-
-        /* whether this name is hidden */
-        hidden = xfce_tray_widget_name_hidden (XFCE_TRAY_WIDGET (plugin->tray), name);
-
-        /* append the application */
-        gtk_list_store_append (store, &iter);
-        gtk_list_store_set (store, &iter,
-                            APPLICATION_NAME, camelcase,
-                            APPLICATION_HIDDEN, hidden, -1);
-
-        /* cleanup */
-        g_free (camelcase);
-
-        /* get the application icon */
-        pixbuf = xfce_tray_dialogs_icon (icon_theme, name);
-
-        if (G_LIKELY (pixbuf))
-        {
-            /* set the icon */
-            gtk_list_store_set (store, &iter, APPLICATION_ICON, pixbuf, -1);
-
-            /* release */
-            g_object_unref (G_OBJECT (pixbuf));
-        }
-    }
-
-    /* cleanup */
-    g_list_free (names);
-
-    /* show the dialog */
-    gtk_widget_show (dialog);
-}
diff --git a/plugins/systray/.svn/text-base/xfce-tray-dialogs.h.svn-base b/plugins/systray/.svn/text-base/xfce-tray-dialogs.h.svn-base
deleted file mode 100644
index c43f497..0000000
--- a/plugins/systray/.svn/text-base/xfce-tray-dialogs.h.svn-base
+++ /dev/null
@@ -1,23 +0,0 @@
-/* $Id$ */
-/*
- * 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
- */
-
-#ifndef __XFCE_TRAY_DIALOGS_H__
-#define __XFCE_TRAY_DIALOGS_H__
-
-void xfce_tray_dialogs_configure (XfceTrayPlugin *plugin);
-
-#endif /* !__XFCE_TRAY_DIALOGS_H__ */
diff --git a/plugins/systray/.svn/text-base/xfce-tray-manager.c.svn-base b/plugins/systray/.svn/text-base/xfce-tray-manager.c.svn-base
deleted file mode 100644
index e3f7642..0000000
--- a/plugins/systray/.svn/text-base/xfce-tray-manager.c.svn-base
+++ /dev/null
@@ -1,913 +0,0 @@
-/* $Id$ */
-/*
- * Copyright (c) 2002      Anders Carlsson <andersca at gnu.org>
- * Copyright (c) 2003-2004 Benedikt Meurer <benny at xfce.org>
- * Copyright (c) 2003-2004 Olivier Fourdan <fourdan at xfce.org>
- * Copyright (c) 2003-2006 Vincent Untz
- * Copyright (c) 2007      Nick Schermer <nick at xfce.org>
- *
- * 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
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
-
-#include <gdk/gdk.h>
-#include <gdk/gdkx.h>
-#include <gtk/gtk.h>
-
-#include <libxfce4panel/xfce-panel-macros.h>
-#include <libxfce4util/libxfce4util.h>
-
-#include "xfce-tray-manager.h"
-#if XFCE_TRAY_MANAGER_ENABLE_MESSAGES
-#include "xfce-tray-marshal.h"
-#endif
-
-
-
-#define XFCE_TRAY_MANAGER_REQUEST_DOCK   0
-#define XFCE_TRAY_MANAGER_BEGIN_MESSAGE  1
-#define XFCE_TRAY_MANAGER_CANCEL_MESSAGE 2
-
-#define XFCE_TRAY_MANAGER_ORIENTATION_HORIZONTAL 0
-#define XFCE_TRAY_MANAGER_ORIENTATION_VERTICAL   1
-
-
-
-/* prototypes */
-static void                 xfce_tray_manager_class_init                         (XfceTrayManagerClass *klass);
-static void                 xfce_tray_manager_init                               (XfceTrayManager      *manager);
-static void                 xfce_tray_manager_finalize                           (GObject              *object);
-static void                 xfce_tray_manager_remove_socket                      (gpointer              key,
-                                                                                  gpointer              value,
-                                                                                  gpointer              user_data);
-static GdkFilterReturn      xfce_tray_manager_window_filter                      (GdkXEvent            *xev,
-                                                                                  GdkEvent             *event,
-                                                                                  gpointer              user_data);
-#if XFCE_TRAY_MANAGER_ENABLE_MESSAGES
-static GdkFilterReturn      xfce_tray_manager_handle_client_message_opcode       (GdkXEvent            *xevent,
-                                                                                  GdkEvent             *event,
-                                                                                  gpointer              user_data);
-static GdkFilterReturn      xfce_tray_manager_handle_client_message_message_data (GdkXEvent            *xevent,
-                                                                                  GdkEvent             *event,
-                                                                                  gpointer              user_data);
-static void                 xfce_tray_manager_handle_begin_message               (XfceTrayManager      *manager,
-                                                                                  XClientMessageEvent  *xevent);
-static void                 xfce_tray_manager_handle_cancel_message              (XfceTrayManager      *manager,
-                                                                                  XClientMessageEvent  *xevent);
-#endif
-static void                 xfce_tray_manager_handle_dock_request                (XfceTrayManager      *manager,
-                                                                                  XClientMessageEvent  *xevent);
-static gboolean             xfce_tray_manager_handle_undock_request              (GtkSocket            *socket,
-                                                                                  gpointer              user_data);
-#if XFCE_TRAY_MANAGER_ENABLE_MESSAGES
-static void                 xfce_tray_message_free                               (XfceTrayMessage      *message);
-static void                 xfce_tray_message_remove_from_list                   (XfceTrayManager      *manager,
-                                                                                  XClientMessageEvent  *xevent);
-#endif
-
-
-enum
-{
-  TRAY_ICON_ADDED,
-  TRAY_ICON_REMOVED,
-#if XFCE_TRAY_MANAGER_ENABLE_MESSAGES
-  TRAY_MESSAGE_SENT,
-  TRAY_MESSAGE_CANCELLED,
-#endif
-  TRAY_LOST_SELECTION,
-  LAST_SIGNAL
-};
-
-struct _XfceTrayManagerClass
-{
-    GObjectClass __parent__;
-};
-
-struct _XfceTrayManager
-{
-    GObject __parent__;
-
-    /* invisible window */
-    GtkWidget      *invisible;
-
-    /* list of client sockets */
-    GHashTable     *sockets;
-
-    /* orientation of the tray */
-    GtkOrientation  orientation;
-
-#if XFCE_TRAY_MANAGER_ENABLE_MESSAGES
-    /* list of pending messages */
-    GSList         *messages;
-#endif
-
-    /* _net_system_tray_opcode atom */
-    Atom            opcode_atom;
-
-    /* _net_system_tray_s%d atom */
-    GdkAtom         selection_atom;
-};
-
-#if XFCE_TRAY_MANAGER_ENABLE_MESSAGES
-struct _XfceTrayMessage
-{
-    /* message string */
-    gchar          *string;
-
-    /* message id */
-    glong           id;
-
-    /* x11 window */
-    Window          window;
-
-    /* numb3rs */
-    glong           length;
-    glong           remaining_length;
-    glong           timeout;
-};
-#endif
-
-
-
-static guint         xfce_tray_manager_signals[LAST_SIGNAL];
-static GObjectClass *xfce_tray_manager_parent_class;
-
-
-
-GType
-xfce_tray_manager_get_type (void)
-{
-    static GType type = G_TYPE_INVALID;
-
-    if (G_UNLIKELY (type == G_TYPE_INVALID))
-    {
-        type = g_type_register_static_simple (G_TYPE_OBJECT,
-                                              I_("XfceTrayManager"),
-                                              sizeof (XfceTrayManagerClass),
-                                              (GClassInitFunc) xfce_tray_manager_class_init,
-                                              sizeof (XfceTrayManager),
-                                              (GInstanceInitFunc) xfce_tray_manager_init,
-                                              0);
-    }
-
-    return type;
-}
-
-
-
-static void
-xfce_tray_manager_class_init (XfceTrayManagerClass *klass)
-{
-    GObjectClass *gobject_class;
-
-    /* determine the parent type class */
-    xfce_tray_manager_parent_class = g_type_class_peek_parent (klass);
-
-    gobject_class = (GObjectClass *)klass;
-    gobject_class->finalize = xfce_tray_manager_finalize;
-
-    xfce_tray_manager_signals[TRAY_ICON_ADDED] =
-        g_signal_new (I_("tray-icon-added"),
-                      G_OBJECT_CLASS_TYPE (klass),
-                      G_SIGNAL_RUN_LAST,
-                      0, NULL, NULL,
-                      g_cclosure_marshal_VOID__OBJECT,
-                      G_TYPE_NONE, 1,
-                      GTK_TYPE_SOCKET);
-
-    xfce_tray_manager_signals[TRAY_ICON_REMOVED] =
-        g_signal_new (I_("tray-icon-removed"),
-                      G_OBJECT_CLASS_TYPE (klass),
-                      G_SIGNAL_RUN_LAST,
-                      0, NULL, NULL,
-                      g_cclosure_marshal_VOID__OBJECT,
-                      G_TYPE_NONE, 1,
-                      GTK_TYPE_SOCKET);
-
-#if XFCE_TRAY_MANAGER_ENABLE_MESSAGES
-    xfce_tray_manager_signals[TRAY_MESSAGE_SENT] =
-        g_signal_new (I_("tray-message-sent"),
-                      G_OBJECT_CLASS_TYPE (klass),
-                      G_SIGNAL_RUN_LAST,
-                      0, NULL, NULL,
-                      _xfce_tray_marshal_VOID__OBJECT_STRING_LONG_LONG,
-                      G_TYPE_NONE, 4,
-                      GTK_TYPE_SOCKET,
-                      G_TYPE_STRING,
-                      G_TYPE_LONG,
-                      G_TYPE_LONG);
-
-    xfce_tray_manager_signals[TRAY_MESSAGE_CANCELLED] =
-        g_signal_new (I_("tray-message-cancelled"),
-                      G_OBJECT_CLASS_TYPE (klass),
-                      G_SIGNAL_RUN_LAST,
-                      0, NULL, NULL,
-                      _xfce_tray_marshal_VOID__OBJECT_LONG,
-                      G_TYPE_NONE, 2,
-                      GTK_TYPE_SOCKET,
-                      G_TYPE_LONG);
-#endif
-
-    xfce_tray_manager_signals[TRAY_LOST_SELECTION] =
-        g_signal_new (I_("tray-lost-selection"),
-                      G_OBJECT_CLASS_TYPE (klass),
-                      G_SIGNAL_RUN_LAST,
-                      0, NULL, NULL,
-                      g_cclosure_marshal_VOID__VOID,
-                      G_TYPE_NONE, 0);
-}
-
-
-
-static void
-xfce_tray_manager_init (XfceTrayManager *manager)
-{
-  /* initialize */
-  manager->invisible = NULL;
-  manager->orientation = GTK_ORIENTATION_HORIZONTAL;
-#if XFCE_TRAY_MANAGER_ENABLE_MESSAGES
-  manager->messages = NULL;
-#endif
-
-  /* create new sockets table */
-  manager->sockets = g_hash_table_new (NULL, NULL);
-}
-
-
-
-GQuark
-xfce_tray_manager_error_quark (void)
-{
-    static GQuark q = 0;
-
-    if (q == 0)
-    {
-        q = g_quark_from_static_string ("xfce-tray-manager-error-quark");
-    }
-
-    return q;
-}
-
-
-
-static void
-xfce_tray_manager_finalize (GObject *object)
-{
-    XfceTrayManager *manager = XFCE_TRAY_MANAGER (object);
-
-    /* destroy the hash table */
-    g_hash_table_destroy (manager->sockets);
-
-#if XFCE_TRAY_MANAGER_ENABLE_MESSAGES
-    if (manager->messages)
-    {
-        /* cleanup all pending messages */
-        g_slist_foreach (manager->messages, (GFunc) xfce_tray_message_free, NULL);
-
-        /* free the list */
-        g_slist_free (manager->messages);
-    }
-#endif
-
-    G_OBJECT_CLASS (xfce_tray_manager_parent_class)->finalize (object);
-}
-
-
-
-XfceTrayManager *
-xfce_tray_manager_new (void)
-{
-    return g_object_new (XFCE_TYPE_TRAY_MANAGER, NULL);
-}
-
-
-
-gboolean
-xfce_tray_manager_check_running (GdkScreen *screen)
-{
-    gchar      *selection_name;
-    GdkDisplay *display;
-    Atom        selection_atom;
-
-    _panel_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
-
-    /* get the display */
-    display = gdk_screen_get_display (screen);
-
-    /* create the selection atom name */
-    selection_name = g_strdup_printf ("_NET_SYSTEM_TRAY_S%d", gdk_screen_get_number (screen));
-
-    /* get the atom */
-    selection_atom = gdk_x11_get_xatom_by_name_for_display (display, selection_name);
-
-    /* cleanup */
-    g_free (selection_name);
-
-    /* return result */
-    return (XGetSelectionOwner (GDK_DISPLAY_XDISPLAY (display), selection_atom) != None);
-}
-
-
-
-gboolean
-xfce_tray_manager_register (XfceTrayManager  *manager,
-                            GdkScreen        *screen,
-                            GError          **error)
-{
-    GdkDisplay          *display;
-    gchar               *selection_name;
-    gboolean             succeed;
-    gint                 screen_number;
-    GtkWidget           *invisible;
-    guint32              timestamp;
-    GdkAtom              opcode_atom;
-    XClientMessageEvent  xevent;
-    Window               root_window;
-
-    _panel_return_val_if_fail (XFCE_IS_TRAY_MANAGER (manager), FALSE);
-    _panel_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
-    _panel_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-
-    /* create invisible window */
-    invisible = gtk_invisible_new_for_screen (screen);
-    gtk_widget_realize (invisible);
-
-    /* let the invisible window monitor property and configuration changes */
-    gtk_widget_add_events (invisible, GDK_PROPERTY_CHANGE_MASK | GDK_STRUCTURE_MASK);
-
-    /* get the screen number */
-    screen_number = gdk_screen_get_number (screen);
-
-    /* create the selection atom name */
-    selection_name = g_strdup_printf ("_NET_SYSTEM_TRAY_S%d", screen_number);
-
-    /* get the selection atom */
-    manager->selection_atom = gdk_atom_intern (selection_name, FALSE);
-
-    /* cleanup */
-    g_free (selection_name);
-
-    /* get the display */
-    display = gdk_screen_get_display (screen);
-
-    /* get the current x server time stamp */
-    timestamp = gdk_x11_get_server_time (invisible->window);
-
-    /* try to become the selection owner of this display */
-    succeed = gdk_selection_owner_set_for_display (display, invisible->window, manager->selection_atom, timestamp, TRUE);
-
-    if (G_LIKELY (succeed))
-    {
-        /* get the root window */
-        root_window = RootWindowOfScreen (GDK_SCREEN_XSCREEN (screen));
-
-        /* send a message to x11 that we're going to handle this display */
-        xevent.type         = ClientMessage;
-        xevent.window       = root_window;
-        xevent.message_type = gdk_x11_get_xatom_by_name_for_display (display, "MANAGER");
-        xevent.format       = 32;
-        xevent.data.l[0]    = timestamp;
-        xevent.data.l[1]    = gdk_x11_atom_to_xatom_for_display (display, manager->selection_atom);
-        xevent.data.l[2]    = GDK_WINDOW_XWINDOW (invisible->window);
-        xevent.data.l[3]    = 0;
-        xevent.data.l[4]    = 0;
-
-        /* send the message */
-        XSendEvent (GDK_DISPLAY_XDISPLAY (display), root_window, False, StructureNotifyMask, (XEvent *)&xevent);
-
-        /* set the invisible window and take a reference */
-        manager->invisible = g_object_ref (G_OBJECT (invisible));
-
-        /* system_tray_request_dock and selectionclear */
-        gdk_window_add_filter (invisible->window, xfce_tray_manager_window_filter, manager);
-
-        /* get the opcode atom (for both gdk and x11) */
-        opcode_atom = gdk_atom_intern ("_NET_SYSTEM_TRAY_OPCODE", FALSE);
-        manager->opcode_atom = gdk_x11_atom_to_xatom_for_display (display, opcode_atom);
-
-#if XFCE_TRAY_MANAGER_ENABLE_MESSAGES
-        /* system_tray_begin_message and system_tray_cancel_message */
-        gdk_display_add_client_message_filter (display,
-                                               opcode_atom,
-                                               xfce_tray_manager_handle_client_message_opcode,
-                                               manager);
-
-        /* _net_system_tray_message_data */
-        gdk_display_add_client_message_filter (display,
-                                               gdk_atom_intern ("_NET_SYSTEM_TRAY_MESSAGE_DATA", FALSE),
-                                               xfce_tray_manager_handle_client_message_message_data,
-                                               manager);
-#endif
-    }
-    else
-    {
-        /* desktroy the invisible window */
-        gtk_widget_destroy (invisible);
-
-        /* set an error */
-        g_set_error (error, XFCE_TRAY_MANAGER_ERROR, XFCE_TRAY_MANAGER_ERROR_SELECTION_FAILED,
-                     _("Failed to acquire manager selection for screen %d"), screen_number);
-    }
-
-    return succeed;
-}
-
-
-
-static void
-xfce_tray_manager_remove_socket (gpointer key,
-                                 gpointer value,
-                                 gpointer user_data)
-{
-    XfceTrayManager *manager = XFCE_TRAY_MANAGER (user_data);
-    GtkSocket       *socket = GTK_SOCKET (value);
-
-    _panel_return_if_fail (XFCE_IS_TRAY_MANAGER (manager));
-    _panel_return_if_fail (GTK_IS_SOCKET (socket));
-
-    /* properly undock from the tray */
-    g_signal_emit (manager, xfce_tray_manager_signals[TRAY_ICON_REMOVED], 0, socket);
-}
-
-
-
-void
-xfce_tray_manager_unregister (XfceTrayManager *manager)
-{
-    GdkDisplay *display;
-    GtkWidget  *invisible = manager->invisible;
-
-    /* leave when there is no invisible window */
-    if (invisible == NULL)
-        return;
-
-    _panel_return_if_fail (GTK_IS_INVISIBLE (invisible));
-    _panel_return_if_fail (GTK_WIDGET_REALIZED (invisible));
-    _panel_return_if_fail (GDK_IS_WINDOW (invisible->window));
-
-    /* get the display of the invisible window */
-    display = gtk_widget_get_display (invisible);
-
-    /* remove our handling of the selection if we're the owner */
-    if (gdk_selection_owner_get_for_display (display, manager->selection_atom) == invisible->window)
-    {
-        /* reset the selection owner */
-        gdk_selection_owner_set_for_display (display,
-                                             NULL,
-                                             manager->selection_atom,
-                                             gdk_x11_get_server_time (invisible->window),
-                                             TRUE);
-    }
-
-    /* remove window filter */
-    gdk_window_remove_filter (invisible->window, xfce_tray_manager_window_filter, manager);
-
-    /* remove all sockets from the hash table */
-    g_hash_table_foreach (manager->sockets, xfce_tray_manager_remove_socket, manager);
-
-    /* destroy and unref the invisible window */
-    manager->invisible = NULL;
-    gtk_widget_destroy (invisible);
-    g_object_unref (G_OBJECT (invisible));
-}
-
-
-
-static GdkFilterReturn
-xfce_tray_manager_window_filter (GdkXEvent *xev,
-                                 GdkEvent  *event,
-                                 gpointer   user_data)
-{
-    XEvent          *xevent = (XEvent *)xev;
-    XfceTrayManager *manager = XFCE_TRAY_MANAGER (user_data);
-
-    if (xevent->type == ClientMessage)
-    {
-        if (xevent->xclient.message_type == manager->opcode_atom
-            && xevent->xclient.data.l[1] == XFCE_TRAY_MANAGER_REQUEST_DOCK)
-        {
-            /* dock a tray icon */
-            xfce_tray_manager_handle_dock_request (manager, (XClientMessageEvent *) xevent);
-
-            return GDK_FILTER_REMOVE;
-        }
-    }
-    else if (xevent->type == SelectionClear)
-    {
-        /* emit the signal */
-        g_signal_emit (manager, xfce_tray_manager_signals[TRAY_LOST_SELECTION], 0);
-
-        /* unregister the manager */
-        xfce_tray_manager_unregister (manager);
-    }
-
-    return GDK_FILTER_CONTINUE;
-}
-
-
-
-#if XFCE_TRAY_MANAGER_ENABLE_MESSAGES
-static GdkFilterReturn
-xfce_tray_manager_handle_client_message_opcode (GdkXEvent *xevent,
-                                                GdkEvent  *event,
-                                                gpointer   user_data)
-{
-    XClientMessageEvent *xev;
-    XfceTrayManager     *manager = XFCE_TRAY_MANAGER (user_data);
-
-    _panel_return_val_if_fail (XFCE_IS_TRAY_MANAGER (manager), GDK_FILTER_REMOVE);
-
-    /* cast to x11 event */
-    xev = (XClientMessageEvent *) xevent;
-
-    switch (xev->data.l[1])
-    {
-        case XFCE_TRAY_MANAGER_REQUEST_DOCK:
-            /* handled in xfce_tray_manager_window_filter () */
-            break;
-
-        case XFCE_TRAY_MANAGER_BEGIN_MESSAGE:
-            xfce_tray_manager_handle_begin_message (manager, xev);
-            return GDK_FILTER_REMOVE;
-
-        case XFCE_TRAY_MANAGER_CANCEL_MESSAGE:
-            xfce_tray_manager_handle_cancel_message (manager, xev);
-            return GDK_FILTER_REMOVE;
-
-        default:
-            break;
-    }
-
-    return GDK_FILTER_CONTINUE;
-}
-
-
-
-static GdkFilterReturn
-xfce_tray_manager_handle_client_message_message_data (GdkXEvent *xevent,
-                                                      GdkEvent  *event,
-                                                      gpointer   user_data)
-{
-    XClientMessageEvent *xev;
-    XfceTrayManager     *manager = XFCE_TRAY_MANAGER (user_data);
-    GSList              *li;
-    XfceTrayMessage     *message;
-    glong                length;
-    GtkSocket           *socket;
-
-    _panel_return_val_if_fail (XFCE_IS_TRAY_MANAGER (manager), GDK_FILTER_REMOVE);
-
-    /* try to find the pending message in the list */
-    for (li = manager->messages; li != NULL; li = li->next)
-    {
-        message = li->data;
-
-        if (xev->window == message->window)
-        {
-            /* copy the data of this message */
-            length = MIN (message->remaining_length, 20);
-            memcpy ((message->string + message->length - message->remaining_length), &xev->data, length);
-            message->remaining_length -= length;
-
-            /* check if we have the complete message */
-            if (message->remaining_length == 0)
-            {
-                /* try to get the socket from the known tray icons */
-                socket = g_hash_table_lookup (manager->sockets, GUINT_TO_POINTER (message->window));
-
-                if (G_LIKELY (socket))
-                {
-                    /* known socket, send the signal */
-                    g_signal_emit (manager, xfce_tray_manager_signals[TRAY_MESSAGE_SENT], 0,
-                                   socket, message->string, message->id, message->timeout);
-                }
-
-                /* delete the message from the list */
-                manager->messages = g_slist_delete_link (manager->messages, li);
-
-                /* free the message */
-                xfce_tray_message_free (message);
-            }
-
-            /* stop searching */
-            break;
-        }
-    }
-
-    return GDK_FILTER_REMOVE;
-}
-
-
-
-static void
-xfce_tray_manager_handle_begin_message (XfceTrayManager     *manager,
-                                        XClientMessageEvent *xevent)
-{
-    GtkSocket       *socket;
-    XfceTrayMessage *message;
-    glong            length, timeout, id;
-
-    /* try to find the window in the list of known tray icons */
-    socket = g_hash_table_lookup (manager->sockets, GUINT_TO_POINTER (xevent->window));
-
-    /* unkown tray icon: ignore the message */
-    if (G_UNLIKELY (socket == NULL))
-       return;
-
-    /* remove the same message from the list */
-    xfce_tray_message_remove_from_list (manager, xevent);
-
-    /* get some message information */
-    timeout = xevent->data.l[2];
-    length  = xevent->data.l[3];
-    id      = xevent->data.l[4];
-
-    if (length == 0)
-    {
-        /* directly emit empty messages */
-        g_signal_emit (manager, xfce_tray_manager_signals[TRAY_MESSAGE_SENT], 0,
-                       socket, "", id, timeout);
-    }
-    else
-    {
-        /* create new structure */
-        message = panel_slice_new0 (XfceTrayMessage);
-
-        /* set message data */
-        message->window           = xevent->window;
-        message->timeout          = timeout;
-        message->length           = length;
-        message->id               = id;
-        message->remaining_length = length;
-        message->string           = g_malloc (length + 1);
-        message->string[length]   = '\0';
-
-        /* add this message to the list of pending messages */
-        manager->messages = g_slist_prepend (manager->messages, message);
-    }
-}
-
-
-
-static void
-xfce_tray_manager_handle_cancel_message (XfceTrayManager     *manager,
-                                         XClientMessageEvent *xevent)
-{
-    GtkSocket *socket;
-
-    /* remove the same message from the list */
-    xfce_tray_message_remove_from_list (manager, xevent);
-
-    /* try to find the window in the list of known tray icons */
-    socket = g_hash_table_lookup (manager->sockets, GUINT_TO_POINTER (xevent->window));
-
-    if (G_LIKELY (socket))
-    {
-        /* emit the cancelled signal */
-        g_signal_emit (manager, xfce_tray_manager_signals[TRAY_MESSAGE_CANCELLED], 0,
-                       socket, xevent->data.l[2]);
-    }
-}
-#endif
-
-
-
-static void
-xfce_tray_manager_handle_dock_request (XfceTrayManager     *manager,
-                                       XClientMessageEvent *xevent)
-{
-    GtkWidget *socket;
-    Window    *xwindow;
-
-    /* check if we already have this notification */
-    if (g_hash_table_lookup (manager->sockets, GUINT_TO_POINTER (xevent->data.l[2])))
-        return;
-
-    /* create a new socket */
-    socket = gtk_socket_new ();
-
-    /* allow applications to draw on this widget */
-    gtk_widget_set_app_paintable (socket, TRUE);
-    gtk_widget_set_double_buffered (socket, TRUE);
-
-    /* allocate and set the xwindow */
-    xwindow = g_new (Window, 1);
-    *xwindow = xevent->data.l[2];
-
-    /* connect the xwindow data to the socket */
-    g_object_set_data_full (G_OBJECT (socket), I_("xfce-tray-manager-xwindow"), xwindow, g_free);
-
-    /* add the icon to the tray */
-    g_signal_emit (manager, xfce_tray_manager_signals[TRAY_ICON_ADDED], 0, socket);
-
-    /* check if the widget has been attached. if the widget has no
-       toplevel window, we cannot set the socket id. */
-    if (G_LIKELY (GTK_IS_WINDOW (gtk_widget_get_toplevel (socket))))
-    {
-        /* signal to monitor if the client is removed from the socket */
-        g_signal_connect (G_OBJECT (socket), "plug-removed", G_CALLBACK (xfce_tray_manager_handle_undock_request), manager);
-
-        /* register the xembed client window id for this socket */
-        gtk_socket_add_id (GTK_SOCKET (socket), *xwindow);
-
-        /* add the socket to the list of known sockets */
-        g_hash_table_insert (manager->sockets, GUINT_TO_POINTER (*xwindow), socket);
-    }
-    else
-    {
-        /* warning */
-        g_warning ("No parent window set, destroying socket");
-
-        /* not attached successfully, destroy it */
-        gtk_widget_destroy (socket);
-    }
-}
-
-
-
-static gboolean
-xfce_tray_manager_handle_undock_request (GtkSocket *socket,
-                                         gpointer   user_data)
-{
-    XfceTrayManager *manager = XFCE_TRAY_MANAGER (user_data);
-    Window          *xwindow;
-
-    _panel_return_val_if_fail (XFCE_IS_TRAY_MANAGER (manager), FALSE);
-
-    /* emit signal that the socket will be removed */
-    g_signal_emit (manager, xfce_tray_manager_signals[TRAY_ICON_REMOVED], 0, socket);
-
-    /* get the xwindow */
-    xwindow = g_object_get_data (G_OBJECT (socket), I_("xfce-tray-manager-xwindow"));
-
-    /* remove the socket from the list */
-    g_hash_table_remove (manager->sockets, GUINT_TO_POINTER (*xwindow));
-
-    /* unset object data */
-    g_object_set_data (G_OBJECT (socket), I_("xfce-tray-manager-xwindow"), NULL);
-
-    /* destroy the socket */
-    return FALSE;
-}
-
-
-
-GtkOrientation
-xfce_tray_manager_get_orientation (XfceTrayManager *manager)
-{
-    _panel_return_val_if_fail (XFCE_IS_TRAY_MANAGER (manager), GTK_ORIENTATION_HORIZONTAL);
-
-    return manager->orientation;
-}
-
-
-
-void
-xfce_tray_manager_set_orientation (XfceTrayManager *manager,
-                                   GtkOrientation   orientation)
-{
-    GdkDisplay *display;
-    Atom        orientation_atom;
-    gulong      data[1];
-
-    _panel_return_if_fail (XFCE_IS_TRAY_MANAGER (manager));
-    _panel_return_if_fail (GTK_IS_INVISIBLE (manager->invisible));
-
-    if (G_LIKELY (manager->orientation != orientation))
-    {
-        /* set the new orientation */
-        manager->orientation = orientation;
-
-        /* get invisible display */
-        display = gtk_widget_get_display (manager->invisible);
-
-        /* get the xatom for the orientation property */
-        orientation_atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_XFCE_TRAY_MANAGER_ORIENTATION");
-
-        /* set the data we're going to send to x */
-        data[0] = (manager->orientation == GTK_ORIENTATION_HORIZONTAL ?
-                   XFCE_TRAY_MANAGER_ORIENTATION_HORIZONTAL : XFCE_TRAY_MANAGER_ORIENTATION_VERTICAL);
-
-        /* change the x property */
-        XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
-                         GDK_WINDOW_XWINDOW (manager->invisible->window),
-                         orientation_atom,
-                         XA_CARDINAL, 32,
-                         PropModeReplace,
-                         (guchar *) &data, 1);
-    }
-}
-
-
-
-gchar *
-xfce_tray_manager_get_application_name (GtkWidget *socket)
-{
-    gchar         *name = NULL;
-    GdkDisplay    *display;
-    gint           succeed;
-    XTextProperty  xprop;
-    Window        *xwindow;
-
-    /* get the xwindow */
-    xwindow = g_object_get_data (G_OBJECT (socket), I_("xfce-tray-manager-xwindow"));
-
-    if (G_LIKELY (xwindow))
-    {
-        /* get the display of the socket */
-        display = gtk_widget_get_display (socket);
-
-        /* avoid exiting the application on X errors */
-        gdk_error_trap_push ();
-
-        /* try to get the wm name (this is more relaiable with qt applications) */
-        succeed = XGetWMName (GDK_DISPLAY_XDISPLAY (display), *xwindow, &xprop);
-
-        /* check if everything went fine */
-        if (G_LIKELY (gdk_error_trap_pop () == 0 && succeed >= Success))
-        {
-            /* check the xprop content */
-            if (G_LIKELY (xprop.value && xprop.nitems > 0))
-            {
-                /* if the string is utf-8 valid, set the name */
-                if (G_LIKELY (g_utf8_validate ((const gchar *) xprop.value, xprop.nitems, NULL)))
-                {
-                    /* create the application name (lower case) */
-                    name = g_utf8_strdown ((const gchar *) xprop.value, xprop.nitems);
-                }
-
-                /* cleanup */
-                XFree (xprop.value);
-            }
-        }
-    }
-
-    return name;
-}
-
-
-
-/**
- * tray messages
- **/
-#if XFCE_TRAY_MANAGER_ENABLE_MESSAGES
-static void
-xfce_tray_message_free (XfceTrayMessage *message)
-{
-    /* cleanup */
-    g_free (message->string);
-
-    /* remove slice */
-    panel_slice_free (XfceTrayMessage, message);
-}
-
-
-
-static void
-xfce_tray_message_remove_from_list (XfceTrayManager     *manager,
-                                    XClientMessageEvent *xevent)
-{
-    GSList          *li;
-    XfceTrayMessage *message;
-
-    /* seach for the same message in the list of pending messages */
-    for (li = manager->messages; li != NULL; li = li->next)
-    {
-        message = li->data;
-
-        /* check if this is the same message */
-        if (xevent->window == message->window && xevent->data.l[4] == message->id)
-        {
-            /* delete the message from the list */
-            manager->messages = g_slist_delete_link (manager->messages, li);
-
-            /* free the message */
-            xfce_tray_message_free (message);
-
-            break;
-        }
-    }
-}
-#endif
diff --git a/plugins/systray/.svn/text-base/xfce-tray-manager.h.svn-base b/plugins/systray/.svn/text-base/xfce-tray-manager.h.svn-base
deleted file mode 100644
index f5a1d7e..0000000
--- a/plugins/systray/.svn/text-base/xfce-tray-manager.h.svn-base
+++ /dev/null
@@ -1,76 +0,0 @@
-/* $Id$ */
-/*
- * Copyright (c) 2002      Anders Carlsson <andersca at gnu.org>
- * Copyright (c) 2003-2004 Benedikt Meurer <benny at xfce.org>
- * Copyright (c) 2003-2004 Olivier Fourdan <fourdan at xfce.org>
- * Copyright (c) 2003-2006 Vincent Untz
- * Copyright (c) 2007      Nick Schermer <nick at xfce.org>
- *
- * 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
- */
-
-#ifndef __XFCE_TRAY_MANAGER_H__
-#define __XFCE_TRAY_MANAGER_H__
-
-#define XFCE_TRAY_MANAGER_ENABLE_MESSAGES 0
-
-
-
-typedef struct _XfceTrayManagerClass XfceTrayManagerClass;
-typedef struct _XfceTrayManager      XfceTrayManager;
-#if XFCE_TRAY_MANAGER_ENABLE_MESSAGES
-typedef struct _XfceTrayMessage      XfceTrayMessage;
-#endif
-
-enum
-{
-    XFCE_TRAY_MANAGER_ERROR_SELECTION_FAILED
-};
-
-
-
-#define XFCE_TYPE_TRAY_MANAGER            (xfce_tray_manager_get_type ())
-#define XFCE_TRAY_MANAGER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFCE_TYPE_TRAY_MANAGER, XfceTrayManager))
-#define XFCE_TRAY_MANAGER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), XFCE_TYPE_TRAY_MANAGER, XfceTrayManagerClass))
-#define XFCE_IS_TRAY_MANAGER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFCE_TYPE_TRAY_MANAGER))
-#define XFCE_IS_TRAY_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XFCE_TYPE_TRAY_MANAGER))
-#define XFCE_TRAY_MANAGER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), XFCE_TYPE_TRAY_MANAGER, XfceTrayManagerClass))
-#define XFCE_TRAY_MANAGER_ERROR           (xfce_tray_manager_error_quark())
-
-
-
-GType                xfce_tray_manager_get_type               (void) G_GNUC_CONST G_GNUC_INTERNAL;
-
-GQuark               xfce_tray_manager_error_quark            (void) G_GNUC_INTERNAL;
-
-XfceTrayManager     *xfce_tray_manager_new                    (void) G_GNUC_MALLOC G_GNUC_INTERNAL;
-
-gboolean             xfce_tray_manager_check_running          (GdkScreen        *screen) G_GNUC_INTERNAL;
-
-gboolean             xfce_tray_manager_register               (XfceTrayManager  *manager,
-                                                               GdkScreen        *screen,
-                                                               GError          **error) G_GNUC_INTERNAL;
-
-void                 xfce_tray_manager_unregister             (XfceTrayManager  *manager) G_GNUC_INTERNAL;
-
-GtkOrientation       xfce_tray_manager_get_orientation        (XfceTrayManager  *manager) G_GNUC_INTERNAL;
-
-void                 xfce_tray_manager_set_orientation        (XfceTrayManager  *manager,
-                                                               GtkOrientation    orientation) G_GNUC_INTERNAL;
-
-gchar               *xfce_tray_manager_get_application_name   (GtkWidget        *socket) G_GNUC_MALLOC G_GNUC_INTERNAL;
-
-
-#endif /* !__XFCE_TRAY_MANAGER_H__ */
diff --git a/plugins/systray/.svn/text-base/xfce-tray-marshal.list.svn-base b/plugins/systray/.svn/text-base/xfce-tray-marshal.list.svn-base
deleted file mode 100644
index 4ea485a..0000000
--- a/plugins/systray/.svn/text-base/xfce-tray-marshal.list.svn-base
+++ /dev/null
@@ -1,2 +0,0 @@
-VOID:OBJECT,STRING,LONG,LONG
-VOID:OBJECT,LONG
diff --git a/plugins/systray/.svn/text-base/xfce-tray-plugin.c.svn-base b/plugins/systray/.svn/text-base/xfce-tray-plugin.c.svn-base
deleted file mode 100644
index 7e133d0..0000000
--- a/plugins/systray/.svn/text-base/xfce-tray-plugin.c.svn-base
+++ /dev/null
@@ -1,498 +0,0 @@
-/* $Id$ */
-/*
- * Copyright (c) 2007 Nick Schermer <nick at xfce.org>
- *
- * 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
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#define SMALL_PANEL_SIZE (26)
-
-#include <gtk/gtk.h>
-#include <libxfce4util/libxfce4util.h>
-#include <libxfce4panel/xfce-panel-plugin.h>
-#include <libxfce4panel/xfce-panel-macros.h>
-
-#include "xfce-tray-manager.h"
-#include "xfce-tray-widget.h"
-#include "xfce-tray-plugin.h"
-#include "xfce-tray-dialogs.h"
-
-
-
-/* prototypes */
-static void            xfce_tray_plugin_message                 (GtkMessageType      type,
-                                                                 GdkScreen          *screen,
-                                                                 const gchar        *message);
-static gboolean        xfce_tray_plugin_check                   (GdkScreen          *screen);
-static void            xfce_tray_plugin_update_position         (XfceTrayPlugin     *plugin);
-static XfceTrayPlugin *xfce_tray_plugin_new                     (XfcePanelPlugin    *panel_plugin);
-static void            xfce_tray_plugin_screen_position_changed (XfceTrayPlugin     *plugin,
-                                                                 XfceScreenPosition  position);
-static void            xfce_tray_plugin_orientation_changed     (XfceTrayPlugin     *plugin,
-                                                                 GtkOrientation      orientation);
-static gboolean        xfce_tray_plugin_size_changed            (XfceTrayPlugin     *plugin,
-                                                                 guint               size);
-static void            xfce_tray_plugin_read                    (XfceTrayPlugin     *plugin);
-static void            xfce_tray_plugin_write                   (XfceTrayPlugin     *plugin);
-static void            xfce_tray_plugin_free                    (XfceTrayPlugin     *plugin);
-static void            xfce_tray_plugin_construct               (XfcePanelPlugin    *panel_plugin);
-
-
-
-/* register the plugin */
-XFCE_PANEL_PLUGIN_REGISTER_INTERNAL_WITH_CHECK (xfce_tray_plugin_construct, xfce_tray_plugin_check);
-
-
-
-static void
-xfce_tray_plugin_message (GtkMessageType  type,
-                          GdkScreen      *screen,
-                          const gchar    *message)
-{
-    GtkWidget *dialog;
-
-    /* create a dialog */
-    dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, type, GTK_BUTTONS_CLOSE, _("System Tray"));
-    gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), "%s.", message);
-    gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
-    gtk_window_set_screen (GTK_WINDOW (dialog), screen);
-
-    /* run the dialog */
-    gtk_dialog_run (GTK_DIALOG (dialog));
-
-    /* destroy */
-    gtk_widget_destroy (dialog);
-}
-
-
-
-static gboolean
-xfce_tray_plugin_check (GdkScreen *screen)
-{
-    gboolean   running;
-
-
-    /* check if there is already a tray running */
-    running = xfce_tray_manager_check_running (screen);
-
-    /* message */
-    if (running)
-    {
-        xfce_tray_plugin_message (GTK_MESSAGE_INFO, screen,
-                                  _("There is already a system tray running on this screen"));
-    }
-
-    return (!running);
-}
-
-
-
-static void
-xfce_tray_plugin_update_position (XfceTrayPlugin *plugin)
-{
-    XfceScreenPosition  position;
-    GdkScreen          *screen;
-    GdkRectangle        geom;
-    gint                mon, x, y;
-    GtkArrowType        arrow_type;
-
-    _panel_return_if_fail (GTK_WIDGET_REALIZED (plugin->panel_plugin));
-
-    /* get the plugin position */
-    position = xfce_panel_plugin_get_screen_position (plugin->panel_plugin);
-
-    /* get the button position */
-    switch (position)
-    {
-        /*    horizontal west */
-        case XFCE_SCREEN_POSITION_NW_H:
-        case XFCE_SCREEN_POSITION_SW_H:
-            arrow_type = GTK_ARROW_RIGHT;
-            break;
-
-        /* horizontal east */
-        case XFCE_SCREEN_POSITION_N:
-        case XFCE_SCREEN_POSITION_NE_H:
-        case XFCE_SCREEN_POSITION_S:
-        case XFCE_SCREEN_POSITION_SE_H:
-            arrow_type = GTK_ARROW_LEFT;
-            break;
-
-        /* vertical north */
-        case XFCE_SCREEN_POSITION_NW_V:
-        case XFCE_SCREEN_POSITION_NE_V:
-            arrow_type = GTK_ARROW_DOWN;
-            break;
-
-        /* vertical south */
-        case XFCE_SCREEN_POSITION_W:
-        case XFCE_SCREEN_POSITION_SW_V:
-        case XFCE_SCREEN_POSITION_E:
-        case XFCE_SCREEN_POSITION_SE_V:
-            arrow_type = GTK_ARROW_UP;
-            break;
-
-        /* floating */
-        default:
-            /* get the screen information */
-            screen = gtk_widget_get_screen (GTK_WIDGET (plugin->panel_plugin));
-            mon = gdk_screen_get_monitor_at_window (screen, GTK_WIDGET (plugin->panel_plugin)->window);
-            gdk_screen_get_monitor_geometry (screen, mon, &geom);
-            gdk_window_get_root_origin (GTK_WIDGET (plugin->panel_plugin)->window, &x, &y);
-
-            /* get the position based on the screen position */
-            if (position == XFCE_SCREEN_POSITION_FLOATING_H)
-                arrow_type = ((x < (geom.x + geom.width / 2)) ? GTK_ARROW_RIGHT : GTK_ARROW_LEFT);
-            else
-                arrow_type = ((y < (geom.y + geom.height / 2)) ? GTK_ARROW_DOWN : GTK_ARROW_UP);
-            break;
-    }
-
-    /* set the arrow type of the tray widget */
-    xfce_tray_widget_set_arrow_type (XFCE_TRAY_WIDGET (plugin->tray), arrow_type);
-
-    /* update the manager orientation */
-    xfce_tray_manager_set_orientation (plugin->manager, xfce_screen_position_get_orientation (position));
-}
-
-
-
-static void
-xfce_tray_plugin_icon_added (XfceTrayManager *manager,
-                             GtkWidget       *icon,
-                             XfceTrayPlugin  *plugin)
-{
-    gchar *name;
-
-    /* get the application name */
-    name = xfce_tray_manager_get_application_name (icon);
-
-    /* add the icon to the widget */
-    xfce_tray_widget_add_with_name (XFCE_TRAY_WIDGET (plugin->tray), icon, name);
-
-    /* cleanup */
-    g_free (name);
-
-    /* show icon */
-    gtk_widget_show (icon);
-}
-
-
-
-static void
-xfce_tray_plugin_icon_removed (XfceTrayManager *manager,
-                               GtkWidget       *icon,
-                               XfceTrayPlugin  *plugin)
-{
-    /* remove from the tray */
-    gtk_container_remove (GTK_CONTAINER (plugin->tray), icon);
-}
-
-
-
-static void
-xfce_tray_plugin_lost_selection (XfceTrayManager *manager,
-                                 XfceTrayPlugin  *plugin)
-{
-    GdkScreen *screen;
-
-    /* get screen */
-    screen = gtk_widget_get_screen (GTK_WIDGET (plugin->panel_plugin));
-
-    /* message */
-    xfce_tray_plugin_message (GTK_MESSAGE_WARNING, screen, _("The tray manager lost selection"));
-}
-
-
-
-static XfceTrayPlugin *
-xfce_tray_plugin_new (XfcePanelPlugin *panel_plugin)
-{
-    XfceTrayPlugin *plugin;
-    gboolean        result;
-    GError         *error = NULL;
-    GdkScreen      *screen;
-
-    /* create structure */
-    plugin = panel_slice_new0 (XfceTrayPlugin);
-
-    /* set some data */
-    plugin->panel_plugin = panel_plugin;
-    plugin->manager = NULL;
-    plugin->show_frame = TRUE;
-
-    /* create the frame */
-    plugin->frame = gtk_frame_new (NULL);
-    gtk_container_add (GTK_CONTAINER (panel_plugin), plugin->frame);
-    gtk_widget_show (plugin->frame);
-
-    /* create tray widget */
-    plugin->tray = xfce_tray_widget_new ();
-    gtk_container_add (GTK_CONTAINER (plugin->frame), plugin->tray);
-    gtk_widget_show (plugin->tray);
-
-    /* create a tray manager */
-    plugin->manager = xfce_tray_manager_new ();
-
-    /* read the plugin settings */
-    xfce_tray_plugin_read (plugin);
-
-    /* set frame shadow */
-    gtk_frame_set_shadow_type (GTK_FRAME (plugin->frame), plugin->show_frame ? GTK_SHADOW_IN : GTK_SHADOW_NONE);
-
-    /* get screen */
-    screen = gtk_widget_get_screen (GTK_WIDGET (panel_plugin));
-
-    /* register the tray */
-    result = xfce_tray_manager_register (plugin->manager, screen, &error);
-
-    /* check for problems */
-    if (G_LIKELY (result == TRUE))
-    {
-        /* connect signals */
-        g_signal_connect (G_OBJECT (plugin->manager), "tray-icon-added", G_CALLBACK (xfce_tray_plugin_icon_added), plugin);
-        g_signal_connect (G_OBJECT (plugin->manager), "tray-icon-removed", G_CALLBACK (xfce_tray_plugin_icon_removed), plugin);
-        g_signal_connect (G_OBJECT (plugin->manager), "tray-lost-selection", G_CALLBACK (xfce_tray_plugin_lost_selection), plugin);
-
-        /* update the plugin position */
-        xfce_tray_plugin_update_position (plugin);
-    }
-    else
-    {
-        /* show error */
-        xfce_tray_plugin_message (GTK_MESSAGE_ERROR, screen, error->message);
-
-        /* free error */
-        g_error_free (error);
-    }
-
-    return plugin;
-}
-
-
-
-static void
-xfce_tray_plugin_screen_position_changed (XfceTrayPlugin     *plugin,
-                                          XfceScreenPosition  position)
-{
-    /* update the plugin position */
-    xfce_tray_plugin_update_position (plugin);
-}
-
-
-
-static void
-xfce_tray_plugin_orientation_changed (XfceTrayPlugin *plugin,
-                                      GtkOrientation  orientation)
-{
-    /* update the plugin position */
-    xfce_tray_plugin_update_position (plugin);
-}
-
-
-
-static gboolean
-xfce_tray_plugin_size_changed (XfceTrayPlugin *plugin,
-                               guint           size)
-{
-    /* set the border sizes */
-    gtk_container_set_border_width (GTK_CONTAINER (plugin->frame), (size > SMALL_PANEL_SIZE && plugin->show_frame) ? 1 : 0);
-    gtk_container_set_border_width (GTK_CONTAINER (plugin->tray),  plugin->show_frame ? 1 : 0);
-
-    /* we handled the size of the plugin */
-    return TRUE;
-}
-
-
-
-static void
-xfce_tray_plugin_read (XfceTrayPlugin *plugin)
-{
-    gchar     *file;
-    gchar    **names;
-    gboolean   hidden;
-    XfceRc    *rc;
-    guint      i;
-
-    /* get rc file name */
-    file = xfce_panel_plugin_lookup_rc_file (plugin->panel_plugin);
-
-    if (G_LIKELY (file))
-    {
-        /* open the file, readonly */
-        rc = xfce_rc_simple_open (file, TRUE);
-
-        /* cleanup */
-        g_free (file);
-
-        if (G_LIKELY (rc))
-        {
-            /* save global plugin settings */
-            xfce_rc_set_group (rc, "Global");
-
-            /* frame setting */
-            plugin->show_frame = xfce_rc_read_bool_entry (rc, "ShowFrame", TRUE);
-
-            /* set number of rows */
-            xfce_tray_widget_set_rows (XFCE_TRAY_WIDGET (plugin->tray), xfce_rc_read_int_entry (rc, "Rows", 1));
-
-            if (G_LIKELY (plugin->manager))
-            {
-                /* list of known applications */
-                names = xfce_rc_get_entries (rc, "Applications");
-
-                if (G_LIKELY (names))
-                {
-                    /* set the group */
-                    xfce_rc_set_group (rc, "Applications");
-
-                    /* read their visibility */
-                    for (i = 0; names[i] != NULL; i++)
-                    {
-                        /* whether the application is hidden */
-                        hidden = xfce_rc_read_bool_entry (rc, names[i], FALSE);
-
-                        /* add the application name */
-                        xfce_tray_widget_name_add (XFCE_TRAY_WIDGET (plugin->tray), names[i], hidden);
-                    }
-
-                    /* cleanup */
-                    g_strfreev (names);
-                }
-            }
-
-            /* close the rc file */
-            xfce_rc_close (rc);
-        }
-    }
-}
-
-
-
-static void
-xfce_tray_plugin_write (XfceTrayPlugin *plugin)
-{
-    gchar       *file;
-    GList       *names, *li;
-    XfceRc      *rc;
-    const gchar *name;
-    gboolean     hidden;
-
-    /* get rc file name, create it if needed */
-    file = xfce_panel_plugin_save_location (plugin->panel_plugin, TRUE);
-
-    if (G_LIKELY (file))
-    {
-        /* open the file, writable */
-        rc = xfce_rc_simple_open (file, FALSE);
-
-        /* cleanup */
-        g_free (file);
-
-        if (G_LIKELY (rc))
-        {
-            /* save global plugin settings */
-            xfce_rc_set_group (rc, "Global");
-
-            /* write setting */
-            xfce_rc_write_bool_entry (rc, "ShowFrame", plugin->show_frame);
-            xfce_rc_write_int_entry (rc, "Rows", xfce_tray_widget_get_rows (XFCE_TRAY_WIDGET (plugin->tray)));
-
-            if (G_LIKELY (plugin->manager))
-            {
-                /* get the list of known applications */
-                names = xfce_tray_widget_name_list (XFCE_TRAY_WIDGET (plugin->tray));
-
-                if (names == NULL)
-                {
-                    /* delete group */
-                    if (xfce_rc_has_group (rc, "Applications"))
-                        xfce_rc_delete_group (rc, "Applications", FALSE);
-                }
-                else
-                {
-                    /* save the list of known applications and their visibility */
-                    xfce_rc_set_group (rc, "Applications");
-
-                    /* save their state */
-                    for (li = names; li != NULL; li = li->next)
-                    {
-                        /* get name and status */
-                        name = li->data;
-                        hidden = xfce_tray_widget_name_hidden (XFCE_TRAY_WIDGET (plugin->tray), name);
-
-                        /* write entry */
-                        xfce_rc_write_bool_entry (rc, name, hidden);
-                    }
-
-                    /* cleanup */
-                    g_list_free (names);
-                }
-            }
-
-            /* close the rc file */
-            xfce_rc_close (rc);
-        }
-    }
-}
-
-
-
-static void
-xfce_tray_plugin_free (XfceTrayPlugin *plugin)
-{
-    /* unregister manager */
-    xfce_tray_manager_unregister (plugin->manager);
-
-    /* release */
-    g_object_unref (G_OBJECT (plugin->manager));
-
-    /* free slice */
-    panel_slice_free (XfceTrayPlugin, plugin);
-}
-
-
-
-static void
-xfce_tray_plugin_construct (XfcePanelPlugin *panel_plugin)
-{
-    XfceTrayPlugin *plugin;
-
-    /* create the tray panel plugin */
-    plugin = xfce_tray_plugin_new (panel_plugin);
-
-    /* set the action widgets and show configure */
-    xfce_panel_plugin_add_action_widget (panel_plugin, plugin->frame);
-    xfce_panel_plugin_add_action_widget (panel_plugin, plugin->tray);
-    xfce_panel_plugin_menu_show_configure (panel_plugin);
-
-    /* connect signals */
-    g_signal_connect_swapped (G_OBJECT (panel_plugin), "screen-position-changed",
-                              G_CALLBACK (xfce_tray_plugin_screen_position_changed), plugin);
-    g_signal_connect_swapped (G_OBJECT (panel_plugin), "orientation-changed",
-                              G_CALLBACK (xfce_tray_plugin_orientation_changed), plugin);
-    g_signal_connect_swapped (G_OBJECT (panel_plugin), "size-changed",
-                              G_CALLBACK (xfce_tray_plugin_size_changed), plugin);
-    g_signal_connect_swapped (G_OBJECT (panel_plugin), "save",
-                              G_CALLBACK (xfce_tray_plugin_write), plugin);
-    g_signal_connect_swapped (G_OBJECT (panel_plugin), "free-data",
-                              G_CALLBACK (xfce_tray_plugin_free), plugin);
-    g_signal_connect_swapped (G_OBJECT (panel_plugin), "configure-plugin",
-                              G_CALLBACK (xfce_tray_dialogs_configure), plugin);
-}
diff --git a/plugins/systray/.svn/text-base/xfce-tray-plugin.h.svn-base b/plugins/systray/.svn/text-base/xfce-tray-plugin.h.svn-base
deleted file mode 100644
index 8a78389..0000000
--- a/plugins/systray/.svn/text-base/xfce-tray-plugin.h.svn-base
+++ /dev/null
@@ -1,42 +0,0 @@
-/* $Id$ */
-/*
- * Copyright (c) 2007 Nick Schermer <nick at xfce.org>
- *
- * 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
- */
-
-#ifndef __XFCE_TRAY_PLUGIN_H__
-#define __XFCE_TRAY_PLUGIN_H__
-
-typedef struct _XfceTrayPlugin XfceTrayPlugin;
-
-struct _XfceTrayPlugin
-{
-    /* panel plugin */
-    XfcePanelPlugin *panel_plugin;
-
-    /* tray manager */
-    XfceTrayManager *manager;
-
-    /* widgets */
-    GtkWidget       *frame;
-    GtkWidget       *tray;
-
-    /* properties */
-    guint            show_frame : 1;
-};
-
-
-#endif /* !__XFCE_TRAY_PLUGIN_H__ */
diff --git a/plugins/systray/.svn/text-base/xfce-tray-widget.c.svn-base b/plugins/systray/.svn/text-base/xfce-tray-widget.c.svn-base
deleted file mode 100644
index ae33bce..0000000
--- a/plugins/systray/.svn/text-base/xfce-tray-widget.c.svn-base
+++ /dev/null
@@ -1,870 +0,0 @@
-/* $Id$ */
-/*
- * Copyright (c) 2007 Nick Schermer <nick at xfce.org>
- *
- * 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
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include <gtk/gtk.h>
-#include <libxfce4panel/xfce-arrow-button.h>
-#include <libxfce4panel/xfce-panel-macros.h>
-#include <libxfce4panel/xfce-panel-plugin.h>
-#include <libxfce4util/libxfce4util.h>
-
-#include "xfce-tray-manager.h"
-#include "xfce-tray-widget.h"
-#include "xfce-tray-plugin.h"
-
-#define XFCE_TRAY_WIDGET_BUTTON_SIZE          (16)
-#define XFCE_TRAY_WIDGET_OFFSCREEN            (-9999)
-#define XFCE_TRAY_WIDGET_IS_HORIZONTAL(tray)  ((tray)->arrow_type == GTK_ARROW_LEFT || (tray)->arrow_type == GTK_ARROW_RIGHT)
-#define XFCE_TRAY_WIDGET_SWAP_INT(x,y)        G_STMT_START{ gint __v = (x); (x) = (y); (y) = __v; }G_STMT_END
-
-
-
-/* prototypes */
-static void     xfce_tray_widget_class_init         (XfceTrayWidgetClass *klass);
-static void     xfce_tray_widget_init               (XfceTrayWidget      *tray);
-static void     xfce_tray_widget_finalize           (GObject             *object);
-static void     xfce_tray_widget_size_request       (GtkWidget           *widget,
-                                                     GtkRequisition      *requisition);
-static void     xfce_tray_widget_size_allocate      (GtkWidget           *widget,
-                                                     GtkAllocation       *allocation);
-static void     xfce_tray_widget_add                (GtkContainer        *container,
-                                                     GtkWidget           *child);
-static void     xfce_tray_widget_remove             (GtkContainer        *container,
-                                                     GtkWidget           *child);
-static void     xfce_tray_widget_forall             (GtkContainer        *container,
-                                                     gboolean             include_internals,
-                                                     GtkCallback          callback,
-                                                     gpointer             callback_data);
-static GType    xfce_tray_widget_child_type         (GtkContainer        *container);
-static void     xfce_tray_widget_button_set_arrow   (XfceTrayWidget      *tray);
-static gboolean xfce_tray_widget_button_press_event (GtkWidget           *widget,
-                                                     GdkEventButton      *event,
-                                                     GtkWidget           *tray);
-static void     xfce_tray_widget_button_clicked     (GtkToggleButton     *button,
-                                                     XfceTrayWidget      *tray);
-
-
-
-struct _XfceTrayWidgetClass
-{
-    GtkContainerClass __parent__;
-};
-
-struct _XfceTrayWidget
-{
-    GtkContainer  __parent__;
-
-    /* all the icons packed in this box */
-    GSList       *childeren;
-
-    /* table with names, value contains an uint
-     * that represents the hidden bool */
-    GHashTable   *names;
-
-    /* expand button */
-    GtkWidget    *button;
-
-    /* position of the arrow button */
-    GtkArrowType  arrow_type;
-
-    /* hidden childeren counter */
-    gint          n_hidden_childeren;
-
-    /* last allocated child size, used to prevent icon overflow */
-    gint          last_alloc_child_size;
-
-    /* whether hidden icons are visible */
-    guint         show_hidden : 1;
-
-    /* number of rows */
-    gint          rows;
-};
-
-struct _XfceTrayWidgetChild
-{
-    /* the child widget */
-    GtkWidget    *widget;
-
-    /* whether it could be hidden */
-    guint         hidden : 1;
-
-    /* whether the icon is invisible */
-    guint         invisible : 1;
-
-    /* the name of the applcation */
-    gchar        *name;
-};
-
-
-
-static GObjectClass *xfce_tray_widget_parent_class;
-
-
-
-GType
-xfce_tray_widget_get_type (void)
-{
-    static GType type = G_TYPE_INVALID;
-
-    if (G_UNLIKELY (type == G_TYPE_INVALID))
-    {
-        type = g_type_register_static_simple (GTK_TYPE_CONTAINER,
-                                              I_("XfceTrayWidget"),
-                                              sizeof (XfceTrayWidgetClass),
-                                              (GClassInitFunc) xfce_tray_widget_class_init,
-                                              sizeof (XfceTrayWidget),
-                                              (GInstanceInitFunc) xfce_tray_widget_init,
-                                              0);
-    }
-
-    return type;
-}
-
-
-
-static void
-xfce_tray_widget_class_init (XfceTrayWidgetClass *klass)
-{
-    GObjectClass      *gobject_class;
-    GtkWidgetClass    *gtkwidget_class;
-    GtkContainerClass *gtkcontainer_class;
-
-    /* determine the parent type class */
-    xfce_tray_widget_parent_class = g_type_class_peek_parent (klass);
-
-    gobject_class = G_OBJECT_CLASS (klass);
-    gobject_class->finalize = xfce_tray_widget_finalize;
-
-    gtkwidget_class = GTK_WIDGET_CLASS (klass);
-    gtkwidget_class->size_request = xfce_tray_widget_size_request;
-    gtkwidget_class->size_allocate = xfce_tray_widget_size_allocate;
-
-    gtkcontainer_class = GTK_CONTAINER_CLASS (klass);
-    gtkcontainer_class->add = xfce_tray_widget_add;
-    gtkcontainer_class->remove = xfce_tray_widget_remove;
-    gtkcontainer_class->forall = xfce_tray_widget_forall;
-    gtkcontainer_class->child_type = xfce_tray_widget_child_type;
-}
-
-
-
-static void
-xfce_tray_widget_init (XfceTrayWidget *tray)
-{
-    /* initialize the widget */
-    GTK_WIDGET_SET_FLAGS (tray, GTK_NO_WINDOW);
-    gtk_widget_set_redraw_on_allocate (GTK_WIDGET (tray), FALSE);
-
-    /* initialize */
-    tray->childeren = NULL;
-    tray->button = NULL;
-    tray->rows = 1;
-    tray->n_hidden_childeren = 0;
-    tray->arrow_type = GTK_ARROW_LEFT;
-    tray->show_hidden = FALSE;
-    tray->last_alloc_child_size = -1;
-
-    /* create hash table */
-    tray->names = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
-
-    /* create tray button */
-    tray->button = xfce_arrow_button_new (tray->arrow_type);
-    GTK_WIDGET_UNSET_FLAGS (tray->button, GTK_CAN_DEFAULT | GTK_CAN_FOCUS);
-    gtk_button_set_focus_on_click (GTK_BUTTON (tray->button), FALSE);
-    g_signal_connect (G_OBJECT (tray->button), "clicked", G_CALLBACK (xfce_tray_widget_button_clicked), tray);
-    g_signal_connect (G_OBJECT (tray->button), "button-press-event", G_CALLBACK (xfce_tray_widget_button_press_event), tray);
-    gtk_widget_set_parent (tray->button, GTK_WIDGET (tray));
-}
-
-
-
-static void
-xfce_tray_widget_finalize (GObject *object)
-{
-    XfceTrayWidget *tray = XFCE_TRAY_WIDGET (object);
-
-    /* check if we're leaking */
-    if (G_UNLIKELY (tray->childeren != NULL))
-    {
-        g_message ("Leaking memory: Not all icons have been removed");
-
-        /* free the child list */
-        g_slist_free (tray->childeren);
-    }
-
-    /* destroy the hash table */
-    g_hash_table_destroy (tray->names);
-
-    G_OBJECT_CLASS (xfce_tray_widget_parent_class)->finalize (object);
-}
-
-
-
-static void
-xfce_tray_widget_size_request (GtkWidget      *widget,
-                               GtkRequisition *requisition)
-{
-    XfceTrayWidget      *tray = XFCE_TRAY_WIDGET (widget);
-    GSList              *li;
-    XfceTrayWidgetChild *child_info;
-    gint                 n_columns;
-    gint                 child_size = tray->last_alloc_child_size;
-    GtkRequisition       child_requisition;
-    gint                 n_visible_childeren = 0;
-
-    _panel_return_if_fail (XFCE_IS_TRAY_WIDGET (widget));
-    _panel_return_if_fail (requisition != NULL);
-
-    /* check if we need to hide or show any childeren */
-    for (li = tray->childeren; li != NULL; li = li->next)
-    {
-        child_info = li->data;
-
-        /* get the icons size request */
-        gtk_widget_size_request (child_info->widget, &child_requisition);
-
-        if (G_UNLIKELY (child_requisition.width == 1 || child_requisition.height == 1))
-        {
-            /* don't do anything with already invisible icons */
-            if (child_info->invisible == FALSE)
-            {
-                /* this icon should not be visible */
-                child_info->invisible = TRUE;
-
-                /* decrease the hidden counter if needed */
-                if (child_info->hidden)
-                    tray->n_hidden_childeren--;
-            }
-        }
-        else
-        {
-            /* restore icon if it was previously invisible */
-            if (G_UNLIKELY (child_info->invisible))
-            {
-               /* visible icon */
-               child_info->invisible = FALSE;
-
-               /* update counter */
-               if (child_info->hidden)
-                   tray->n_hidden_childeren++;
-            }
-
-            /* count the number of visible childeren */
-            if (child_info->hidden == FALSE || tray->show_hidden == TRUE)
-            {
-                /* don't use the allocate child size if it's not set yet */
-                if (G_UNLIKELY (tray->last_alloc_child_size == -1))
-                {
-                    /* pick largest icon */
-                    child_size = MAX (child_size, MAX (child_requisition.width, child_requisition.height));
-                }
-
-                /* increase number of visible childeren */
-                n_visible_childeren++;
-            }
-        }
-    }
-
-    /* number of columns */
-    n_columns = n_visible_childeren / tray->rows;
-    if (n_visible_childeren > (n_columns * tray->rows))
-        n_columns++;
-
-    /* set the width and height needed for the icons */
-    if (n_visible_childeren > 0)
-    {
-        requisition->width = ((child_size + XFCE_TRAY_WIDGET_SPACING) * n_columns) - XFCE_TRAY_WIDGET_SPACING;
-        requisition->height = ((child_size + XFCE_TRAY_WIDGET_SPACING) * tray->rows) - XFCE_TRAY_WIDGET_SPACING;
-    }
-    else
-    {
-        requisition->width = requisition->height = 0;
-    }
-
-    /* add the button size if there are hidden icons */
-    if (tray->n_hidden_childeren > 0)
-    {
-        /* add the button size */
-        requisition->width += XFCE_TRAY_WIDGET_BUTTON_SIZE;
-
-        /* add space */
-        if (n_visible_childeren > 0)
-             requisition->width += XFCE_TRAY_WIDGET_SPACING;
-    }
-
-    /* swap the sizes if the orientation is vertical */
-    if (!XFCE_TRAY_WIDGET_IS_HORIZONTAL (tray))
-        XFCE_TRAY_WIDGET_SWAP_INT (requisition->width, requisition->height);
-
-    /* add container border */
-    requisition->width += GTK_CONTAINER (widget)->border_width * 2;
-    requisition->height += GTK_CONTAINER (widget)->border_width * 2;
-}
-
-
-
-static void
-xfce_tray_widget_size_allocate (GtkWidget     *widget,
-                                GtkAllocation *allocation)
-{
-    XfceTrayWidget      *tray = XFCE_TRAY_WIDGET (widget);
-    XfceTrayWidgetChild *child_info;
-    GSList              *li;
-    gint                 n;
-    gint                 x, y;
-    gint                 width, height;
-    gint                 offset = 0;
-    gint                 child_size;
-    GtkAllocation        child_allocation;
-
-    _panel_return_if_fail (XFCE_IS_TRAY_WIDGET (widget));
-    _panel_return_if_fail (allocation != NULL);
-
-    /* set widget allocation */
-    widget->allocation = *allocation;
-
-    /* get root coordinates */
-    x = allocation->x + GTK_CONTAINER (widget)->border_width;
-    y = allocation->y + GTK_CONTAINER (widget)->border_width;
-
-    /* get real size */
-    width = allocation->width - 2 * GTK_CONTAINER (widget)->border_width;
-    height = allocation->height - 2 * GTK_CONTAINER (widget)->border_width;
-
-    /* child size */
-    child_size = XFCE_TRAY_WIDGET_IS_HORIZONTAL (tray) ? height : width;
-    child_size -= XFCE_TRAY_WIDGET_SPACING * (tray->rows - 1);
-    child_size /= tray->rows;
-
-    /* store or fix the calculated child size */
-    if (child_size > 0)
-    {
-        /* set last allocated child size */
-        tray->last_alloc_child_size = child_size;
-    }
-    else
-    {
-        /* child size is invalid (hidden panel), fall-back on old size */
-        child_size = MAX (1, tray->last_alloc_child_size);
-    }
-
-    /* position arrow button */
-    if (tray->n_hidden_childeren > 0)
-    {
-        /* initialize allocation */
-        child_allocation.x = x;
-        child_allocation.y = y;
-
-        /* set the width and height */
-        if (XFCE_TRAY_WIDGET_IS_HORIZONTAL (tray))
-        {
-            child_allocation.width = XFCE_TRAY_WIDGET_BUTTON_SIZE;
-            child_allocation.height = height;
-        }
-        else
-        {
-            child_allocation.width = width;
-            child_allocation.height = XFCE_TRAY_WIDGET_BUTTON_SIZE;
-        }
-
-        /* position the button on the other side of the tray */
-        if (tray->arrow_type == GTK_ARROW_RIGHT)
-            child_allocation.x += width - child_allocation.width;
-        else if (tray->arrow_type == GTK_ARROW_DOWN)
-            child_allocation.y += height - child_allocation.height;
-
-        /* set the offset for the icons */
-        offset = XFCE_TRAY_WIDGET_BUTTON_SIZE + XFCE_TRAY_WIDGET_SPACING;
-
-        /* position the arrow button */
-        gtk_widget_size_allocate (tray->button, &child_allocation);
-
-        /* show button if not already visible */
-        if (!GTK_WIDGET_VISIBLE (tray->button))
-            gtk_widget_show (tray->button);
-    }
-    else if (GTK_WIDGET_VISIBLE (tray->button))
-    {
-        /* hide the button */
-        gtk_widget_hide (tray->button);
-    }
-
-    /* position icons */
-    for (li = tray->childeren, n = 0; li != NULL; li = li->next)
-    {
-        child_info = li->data;
-
-        if (child_info->invisible || (child_info->hidden && !tray->show_hidden))
-        {
-            /* put icons offscreen */
-            child_allocation.x = child_allocation.y = XFCE_TRAY_WIDGET_OFFSCREEN;
-        }
-        else
-        {
-            /* set coordinates */
-            child_allocation.x = (child_size + XFCE_TRAY_WIDGET_SPACING) * (n / tray->rows) + offset;
-            child_allocation.y = (child_size + XFCE_TRAY_WIDGET_SPACING) * (n % tray->rows);
-
-            /* increase item counter */
-            n++;
-
-            /* swap coordinates on a vertical panel */
-            if (!XFCE_TRAY_WIDGET_IS_HORIZONTAL (tray))
-                XFCE_TRAY_WIDGET_SWAP_INT (child_allocation.x, child_allocation.y);
-
-            /* invert the icon order if the arrow button position is right or down */
-            if (tray->arrow_type == GTK_ARROW_RIGHT)
-                child_allocation.x = width - child_allocation.x - child_size;
-            else if (tray->arrow_type == GTK_ARROW_DOWN)
-                child_allocation.y = height - child_allocation.y - child_size;
-
-            /* add root */
-            child_allocation.x += x;
-            child_allocation.y += y;
-        }
-
-        /* set child width and height */
-        child_allocation.width = child_size;
-        child_allocation.height = child_size;
-
-        /* allocate widget size */
-        gtk_widget_size_allocate (child_info->widget, &child_allocation);
-    }
-}
-
-
-
-static void
-xfce_tray_widget_add (GtkContainer *container,
-                      GtkWidget    *child)
-{
-    XfceTrayWidget *tray = XFCE_TRAY_WIDGET (container);
-
-    _panel_return_if_fail (XFCE_IS_TRAY_WIDGET (container));
-
-    /* add the entry */
-    xfce_tray_widget_add_with_name (tray, child, NULL);
-}
-
-
-
-static void
-xfce_tray_widget_remove (GtkContainer *container,
-                         GtkWidget    *child)
-{
-    XfceTrayWidget      *tray = XFCE_TRAY_WIDGET (container);
-    XfceTrayWidgetChild *child_info;
-    gboolean             need_resize;
-    GSList              *li;
-
-    /* search the child */
-    for (li = tray->childeren; li != NULL; li = li->next)
-    {
-        child_info = li->data;
-
-        if (child_info->widget == child)
-        {
-            /* whether the need to redraw afterwards */
-            need_resize = !child_info->hidden;
-
-            /* update hidden counter */
-            if (child_info->hidden && !child_info->invisible)
-                tray->n_hidden_childeren--;
-
-            /* remove from list */
-            tray->childeren = g_slist_remove_link (tray->childeren, li);
-
-            /* free name */
-            g_free (child_info->name);
-
-            /* free child info */
-            panel_slice_free (XfceTrayWidgetChild, child_info);
-
-            /* unparent the widget */
-            gtk_widget_unparent (child);
-
-            /* resize when the child was visible */
-            if (need_resize)
-                gtk_widget_queue_resize (GTK_WIDGET (container));
-
-            break;
-        }
-    }
-}
-
-
-
-static void
-xfce_tray_widget_forall (GtkContainer *container,
-                         gboolean      include_internals,
-                         GtkCallback   callback,
-                         gpointer      callback_data)
-{
-    XfceTrayWidget      *tray = XFCE_TRAY_WIDGET (container);
-    XfceTrayWidgetChild *child_info;
-    GSList              *li;
-
-    /* for button */
-    (*callback) (GTK_WIDGET (tray->button), callback_data);
-
-    /* run callback for all childeren */
-    for (li = tray->childeren; li != NULL; li = li->next)
-    {
-        child_info = li->data;
-
-        (*callback) (GTK_WIDGET (child_info->widget), callback_data);
-    }
-}
-
-
-
-static GType
-xfce_tray_widget_child_type (GtkContainer *container)
-
-{
-    return GTK_TYPE_WIDGET;
-}
-
-
-
-static void
-xfce_tray_widget_button_set_arrow (XfceTrayWidget *tray)
-{
-    GtkArrowType arrow_type;
-
-    /* set arrow type */
-    arrow_type = tray->arrow_type;
-
-    /* invert the arrow direction when the button is toggled */
-    if (tray->show_hidden)
-    {
-        if (XFCE_TRAY_WIDGET_IS_HORIZONTAL (tray))
-            arrow_type = (arrow_type == GTK_ARROW_LEFT ? GTK_ARROW_RIGHT : GTK_ARROW_LEFT);
-        else
-            arrow_type = (arrow_type == GTK_ARROW_UP ? GTK_ARROW_DOWN : GTK_ARROW_UP);
-    }
-
-    /* set the arrow type */
-    xfce_arrow_button_set_arrow_type (XFCE_ARROW_BUTTON (tray->button), arrow_type);
-}
-
-
-
-static gboolean
-xfce_tray_widget_button_press_event (GtkWidget      *widget,
-                                     GdkEventButton *event,
-                                     GtkWidget      *tray)
-{
-    /* send the event to the tray for the panel menu */
-    gtk_widget_event (tray, (GdkEvent *) event);
-
-    return FALSE;
-}
-
-
-
-static void
-xfce_tray_widget_button_clicked (GtkToggleButton *button,
-                                 XfceTrayWidget  *tray)
-{
-    /* whether to show hidden icons */
-    tray->show_hidden = gtk_toggle_button_get_active (button);
-
-    /* update the arrow */
-    xfce_tray_widget_button_set_arrow (tray);
-
-    /* queue a resize */
-    gtk_widget_queue_resize (GTK_WIDGET (tray));
-}
-
-
-
-static gint
-xfce_tray_widget_compare_function (gconstpointer a,
-                                   gconstpointer b)
-{
-    const XfceTrayWidgetChild *child_a = a;
-    const XfceTrayWidgetChild *child_b = b;
-
-    /* sort hidden icons before visible ones */
-    if (child_a->hidden != child_b->hidden)
-        return (child_a->hidden ? -1 : 1);
-
-    /* put icons without name after the hidden icons */
-    if (G_UNLIKELY (child_a->name == NULL || child_b->name == NULL))
-        return (child_a->name == child_b->name ? 0 : (child_a->name == NULL ? -1 : 1));
-
-    /* sort by name */
-    return strcmp (child_a->name, child_b->name);
-}
-
-
-
-GtkWidget *
-xfce_tray_widget_new (void)
-{
-    return g_object_new (XFCE_TYPE_TRAY_WIDGET, NULL);
-}
-
-
-
-void
-xfce_tray_widget_add_with_name (XfceTrayWidget *tray,
-                                GtkWidget      *child,
-                                const gchar    *name)
-{
-    XfceTrayWidgetChild *child_info;
-
-    _panel_return_if_fail (XFCE_IS_TRAY_WIDGET (tray));
-    _panel_return_if_fail (GTK_IS_WIDGET (child));
-    _panel_return_if_fail (child->parent == NULL);
-    _panel_return_if_fail (name == NULL || g_utf8_validate (name, -1, NULL));
-
-    /* create child info */
-    child_info = panel_slice_new (XfceTrayWidgetChild);
-    child_info->widget = child;
-    child_info->invisible = FALSE;
-    child_info->name = g_strdup (name);
-    child_info->hidden = xfce_tray_widget_name_hidden (tray, child_info->name);
-
-    /* update hidden counter */
-    if (child_info->hidden)
-        tray->n_hidden_childeren++;
-
-    /* insert sorted */
-    tray->childeren = g_slist_insert_sorted (tray->childeren, child_info, xfce_tray_widget_compare_function);
-
-    /* set parent widget */
-    gtk_widget_set_parent (child, GTK_WIDGET (tray));
-}
-
-
-
-void
-xfce_tray_widget_set_arrow_type (XfceTrayWidget *tray,
-                                 GtkArrowType    arrow_type)
-{
-    _panel_return_if_fail (XFCE_IS_TRAY_WIDGET (tray));
-
-    if (G_LIKELY (arrow_type != tray->arrow_type))
-    {
-        /* set new setting */
-        tray->arrow_type = arrow_type;
-
-        /* update button arrow */
-        xfce_tray_widget_button_set_arrow (tray);
-
-        /* queue a resize */
-        if (tray->childeren != NULL)
-            gtk_widget_queue_resize (GTK_WIDGET (tray));
-    }
-}
-
-
-
-GtkArrowType
-xfce_tray_widget_get_arrow_type (XfceTrayWidget *tray)
-{
-    _panel_return_val_if_fail (XFCE_IS_TRAY_WIDGET (tray), GTK_ARROW_LEFT);
-
-    return tray->arrow_type;
-}
-
-
-
-void
-xfce_tray_widget_set_rows (XfceTrayWidget *tray,
-                           gint            rows)
-{
-    _panel_return_if_fail (XFCE_IS_TRAY_WIDGET (tray));
-
-    if (G_LIKELY (rows != tray->rows))
-    {
-        /* set new setting */
-        tray->rows = MAX (1, rows);
-
-        /* queue a resize */
-        if (tray->childeren != NULL)
-            gtk_widget_queue_resize (GTK_WIDGET (tray));
-    }
-}
-
-
-
-gint
-xfce_tray_widget_get_rows (XfceTrayWidget *tray)
-{
-    _panel_return_val_if_fail (XFCE_IS_TRAY_WIDGET (tray), 1);
-
-    return tray->rows;
-}
-
-
-
-void
-xfce_tray_widget_name_add (XfceTrayWidget *tray,
-                           const gchar    *name,
-                           gboolean        hidden)
-{
-    _panel_return_if_fail (XFCE_IS_TRAY_WIDGET (tray));
-    _panel_return_if_fail (name != NULL && *name != '\0');
-
-    /* insert the application */
-    g_hash_table_insert (tray->names, g_strdup (name), GUINT_TO_POINTER (hidden ? 1 : 0));
-}
-
-
-
-void
-xfce_tray_widget_name_update (XfceTrayWidget *tray,
-                              const gchar    *name,
-                              gboolean        hidden)
-{
-    XfceTrayWidgetChild *child_info;
-    GSList              *li;
-    gint                 n_hidden_childeren;
-
-    _panel_return_if_fail (XFCE_IS_TRAY_WIDGET (tray));
-    _panel_return_if_fail (name != NULL && *name != '\0');
-
-    /* replace the old name */
-    g_hash_table_replace (tray->names, g_strdup (name), GUINT_TO_POINTER (hidden ? 1 : 0));
-
-    /* reset counter */
-    n_hidden_childeren = 0;
-
-    /* update the icons */
-    for (li = tray->childeren; li != NULL; li = li->next)
-    {
-        child_info = li->data;
-
-        /* update the hidden state */
-        child_info->hidden = xfce_tray_widget_name_hidden (tray, child_info->name);
-
-        /* increase counter if needed */
-        if (child_info->hidden && !child_info->invisible)
-            n_hidden_childeren++;
-    }
-
-    if (tray->n_hidden_childeren != n_hidden_childeren)
-    {
-        /* set value */
-        tray->n_hidden_childeren = n_hidden_childeren;
-
-        /* sort the list again */
-        tray->childeren = g_slist_sort (tray->childeren, xfce_tray_widget_compare_function);
-
-        /* update the tray */
-        gtk_widget_queue_resize (GTK_WIDGET (tray));
-    }
-}
-
-
-
-gboolean
-xfce_tray_widget_name_hidden (XfceTrayWidget *tray,
-                              const gchar    *name)
-{
-    gpointer p;
-
-    /* do not hide icons without name */
-    if (G_UNLIKELY (name == NULL))
-        return FALSE;
-
-    /* lookup the name in the table */
-    p = g_hash_table_lookup (tray->names, name);
-
-    /* check the pointer */
-    if (G_UNLIKELY (p == NULL))
-    {
-        /* add the name */
-        xfce_tray_widget_name_add (tray, name, FALSE);
-
-        /* do not hide the icon */
-        return FALSE;
-    }
-    else
-    {
-        return (GPOINTER_TO_UINT (p) == 1 ? TRUE : FALSE);
-    }
-}
-
-
-
-GList *
-xfce_tray_widget_name_list (XfceTrayWidget *tray)
-{
-    GList *keys;
-
-    /* get the hash table keys */
-    keys = g_hash_table_get_keys (tray->names);
-
-    /* sort the list */
-    keys = g_list_sort (keys, (GCompareFunc) strcmp);
-
-    return keys;
-}
-
-
-
-void
-xfce_tray_widget_clear_name_list (XfceTrayWidget *tray)
-{
-    XfceTrayWidgetChild *child_info;
-    GSList              *li;
-    gint                 n_hidden_childeren = 0;
-
-    /* remove all the entries from the list */
-    g_hash_table_remove_all (tray->names);
-
-    /* remove hidden flags from all childeren */
-    for (li = tray->childeren; li != NULL; li = li->next)
-    {
-        child_info = li->data;
-
-        /* update the hidden state */
-        if (child_info->hidden)
-        {
-            n_hidden_childeren++;
-
-            child_info->hidden = FALSE;
-        }
-    }
-
-    /* reset */
-    tray->n_hidden_childeren = 0;
-
-    /* update tray if needed */
-    if (n_hidden_childeren > 0)
-    {
-        /* sort the list again */
-        tray->childeren = g_slist_sort (tray->childeren, xfce_tray_widget_compare_function);
-
-        /* update the tray */
-        gtk_widget_queue_resize (GTK_WIDGET (tray));
-    }
-}
-
diff --git a/plugins/systray/.svn/text-base/xfce-tray-widget.h.svn-base b/plugins/systray/.svn/text-base/xfce-tray-widget.h.svn-base
deleted file mode 100644
index 114c991..0000000
--- a/plugins/systray/.svn/text-base/xfce-tray-widget.h.svn-base
+++ /dev/null
@@ -1,69 +0,0 @@
-/* $Id$ */
-/*
- * Copyright (c) 2007 Nick Schermer <nick at xfce.org>
- *
- * 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
- */
-
-#ifndef __XFCE_TRAY_WIDGET_H__
-#define __XFCE_TRAY_WIDGET_H__
-
-typedef struct _XfceTrayWidgetClass XfceTrayWidgetClass;
-typedef struct _XfceTrayWidget      XfceTrayWidget;
-typedef struct _XfceTrayWidgetChild XfceTrayWidgetChild;
-
-#define XFCE_TRAY_WIDGET_SPACING (2)
-
-#define XFCE_TYPE_TRAY_WIDGET            (xfce_tray_widget_get_type ())
-#define XFCE_TRAY_WIDGET(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFCE_TYPE_TRAY_WIDGET, XfceTrayWidget))
-#define XFCE_TRAY_WIDGET_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), XFCE_TYPE_TRAY_WIDGET, XfceTrayWidgetClass))
-#define XFCE_IS_TRAY_WIDGET(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFCE_TYPE_TRAY_WIDGET))
-#define XFCE_IS_TRAY_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XFCE_TYPE_TRAY_WIDGET))
-#define XFCE_TRAY_WIDGET_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), XFCE_TYPE_TRAY_WIDGET, XfceTrayWidgetClass))
-
-GType            xfce_tray_widget_get_type           (void) G_GNUC_CONST G_GNUC_INTERNAL;
-
-GtkWidget       *xfce_tray_widget_new                (void) G_GNUC_MALLOC G_GNUC_INTERNAL;
-
-void             xfce_tray_widget_add_with_name      (XfceTrayWidget *tray,
-                                                      GtkWidget      *child,
-                                                      const gchar    *name) G_GNUC_INTERNAL;
-
-void             xfce_tray_widget_set_arrow_type     (XfceTrayWidget *tray,
-                                                      GtkArrowType    arrow_type) G_GNUC_INTERNAL;
-
-GtkArrowType     xfce_tray_widget_get_arrow_type     (XfceTrayWidget *tray) G_GNUC_INTERNAL;
-
-void             xfce_tray_widget_set_rows           (XfceTrayWidget *tray,
-                                                      gint            rows) G_GNUC_INTERNAL;
-
-gint             xfce_tray_widget_get_rows           (XfceTrayWidget *tray) G_GNUC_INTERNAL;
-
-void             xfce_tray_widget_name_add           (XfceTrayWidget *tray,
-                                                      const gchar    *name,
-                                                      gboolean        hidden) G_GNUC_INTERNAL;
-
-void             xfce_tray_widget_name_update        (XfceTrayWidget *tray,
-                                                      const gchar    *name,
-                                                      gboolean        hidden) G_GNUC_INTERNAL;
-
-gboolean         xfce_tray_widget_name_hidden        (XfceTrayWidget *tray,
-                                                      const gchar    *name) G_GNUC_INTERNAL;
-
-GList           *xfce_tray_widget_name_list          (XfceTrayWidget *tray) G_GNUC_MALLOC G_GNUC_INTERNAL;
-
-void             xfce_tray_widget_clear_name_list    (XfceTrayWidget *tray) G_GNUC_INTERNAL;
-
-#endif /* !__XFCE_TRAY_WIDGET_H__ */
diff --git a/plugins/systray/xfce-tray-manager.c b/plugins/systray/xfce-tray-manager.c
index b3d5a26..ca3ae36 100644
--- a/plugins/systray/xfce-tray-manager.c
+++ b/plugins/systray/xfce-tray-manager.c
@@ -692,6 +692,32 @@ xfce_tray_manager_handle_cancel_message (XfceTrayManager     *manager,
 }
 #endif
 
+void
+_set_source_rgba (cairo_t  *cr,
+                  GdkColor *color,
+                  gdouble   alpha)
+{
+  panel_return_if_fail (alpha >= 0.00 && alpha <= 1.00);
+
+  if (alpha == 1.00)
+    {
+      /* set normal source color */
+      cairo_set_source_rgb (cr,
+                            color->red / 65535.00,
+                            color->green / 65535.00,
+                            color->blue / 65535.00);
+    }
+  else
+    {
+      /* set source color with alpha */
+      cairo_set_source_rgba (cr,
+                             color->red / 65535.00,
+                             color->green / 65535.00,
+                             color->blue / 65535.00,
+                             alpha);
+    }
+}
+
 
 
 static void
@@ -710,7 +736,7 @@ xfce_tray_manager_handle_dock_request (XfceTrayManager     *manager,
 
     /* allow applications to draw on this widget */
     gtk_widget_set_app_paintable (socket, TRUE);
-    gtk_widget_set_double_buffered (socket, TRUE);
+    gtk_widget_set_double_buffered (socket, FALSE);
 
     /* allocate and set the xwindow */
     xwindow = g_new (Window, 1);



More information about the Xfce4-commits mailing list