diff -rupN a/configure b/configure --- a/configure 2012-04-28 20:31:40.000000000 +0000 +++ b/configure 2012-06-20 23:17:30.000000000 +0000 @@ -18048,7 +18048,7 @@ $as_echo_n "checking PLATFORM_LDFLAGS... $as_echo "$PLATFORM_LDFLAGS" >&6; } -ac_config_files="$ac_config_files Makefile common/Makefile docs/Makefile docs/references/Makefile docs/references/version.xml icons/Makefile icons/16x16/Makefile icons/22x22/Makefile icons/24x24/Makefile icons/32x32/Makefile icons/48x48/Makefile icons/scalable/Makefile libxfce4panel/Makefile libxfce4panel/libxfce4panel-1.0.pc libxfce4panel/libxfce4panel-config.h migrate/Makefile migrate/default.xml panel/Makefile wrapper/Makefile plugins/Makefile plugins/actions/Makefile plugins/applicationsmenu/Makefile plugins/clock/Makefile plugins/directorymenu/Makefile plugins/launcher/Makefile plugins/pager/Makefile plugins/separator/Makefile plugins/showdesktop/Makefile plugins/systray/Makefile plugins/tasklist/Makefile plugins/windowmenu/Makefile po/Makefile.in" +ac_config_files="$ac_config_files Makefile common/Makefile docs/Makefile docs/references/Makefile docs/references/version.xml icons/Makefile icons/16x16/Makefile icons/22x22/Makefile icons/24x24/Makefile icons/32x32/Makefile icons/48x48/Makefile icons/scalable/Makefile libxfce4panel/Makefile libxfce4panel/libxfce4panel-1.0.pc libxfce4panel/libxfce4panel-config.h migrate/Makefile migrate/default.xml panel/Makefile wrapper/Makefile plugins/Makefile plugins/actions/Makefile plugins/applicationsmenu/Makefile plugins/clock/Makefile plugins/directorymenu/Makefile plugins/launcher/Makefile plugins/layout/Makefile plugins/pager/Makefile plugins/separator/Makefile plugins/showdesktop/Makefile plugins/systray/Makefile plugins/tasklist/Makefile plugins/windowmenu/Makefile po/Makefile.in" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -19114,6 +19114,7 @@ do "plugins/clock/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/clock/Makefile" ;; "plugins/directorymenu/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/directorymenu/Makefile" ;; "plugins/launcher/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/launcher/Makefile" ;; + "plugins/layout/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/layout/Makefile" ;; "plugins/pager/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/pager/Makefile" ;; "plugins/separator/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/separator/Makefile" ;; "plugins/showdesktop/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/showdesktop/Makefile" ;; diff -rupN a/plugins/Makefile.am b/plugins/Makefile.am --- a/plugins/Makefile.am 2012-04-28 20:31:35.000000000 +0000 +++ b/plugins/Makefile.am 2012-06-24 13:13:48.000000000 +0000 @@ -5,6 +5,7 @@ SUBDIRS = \ clock \ directorymenu \ launcher \ + layout \ pager \ separator \ showdesktop \ diff -rupN a/plugins/Makefile.in b/plugins/Makefile.in --- a/plugins/Makefile.in 2012-04-28 20:31:39.000000000 +0000 +++ b/plugins/Makefile.in 2012-06-20 23:12:06.000000000 +0000 @@ -347,6 +347,7 @@ SUBDIRS = \ clock \ directorymenu \ launcher \ + layout \ pager \ separator \ showdesktop \ diff -rupN a/plugins/layout/Makefile.am b/plugins/layout/Makefile.am --- a/plugins/layout/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ b/plugins/layout/Makefile.am 2012-06-20 22:18:40.000000000 +0000 @@ -0,0 +1,61 @@ + +INCLUDES = \ + -I$(top_srcdir) \ + -DG_LOG_DOMAIN=\"libpager\" \ + -DWNCK_I_KNOW_THIS_IS_UNSTABLE \ + $(PLATFORM_CPPFLAGS) + +plugindir = $(libdir)/xfce4/panel/plugins + +plugin_LTLIBRARIES = \ + liblayout.la + +liblayout_la_SOURCES = \ + layout.c \ + layout.h + +liblayout_la_CFLAGS = \ + $(GTK_CFLAGS) \ + $(XFCONF_CFLAGS) \ + $(LIBXFCE4UTIL_CFLAGS) \ + $(LIBWNCK_CFLAGS) \ + $(LIBXFCE4UI_CFLAGS) \ + $(EXO_CFLAGS) \ + $(PLATFORM_CFLAGS) + +liblayout_la_LDFLAGS = \ + -avoid-version \ + -module \ + -no-undefined \ + -export-symbols-regex '^xfce_panel_module_(preinit|init|construct)' \ + $(PLATFORM_LDFLAGS) + +liblayout_la_LIBADD = \ + $(top_builddir)/libxfce4panel/libxfce4panel-$(LIBXFCE4PANEL_VERSION_API).la \ + $(top_builddir)/common/libpanel-common.la \ + $(GTK_LIBS) \ + $(LIBXFCE4UTIL_LIBS) \ + $(LIBWNCK_LIBS) \ + $(EXO_LIBS) \ + $(LIBXFCE4UI_LIBS) \ + $(XFCONF_LIBS) + +liblayout_la_DEPENDENCIES = \ + $(top_builddir)/libxfce4panel/libxfce4panel-$(LIBXFCE4PANEL_VERSION_API).la \ + $(top_builddir)/common/libpanel-common.la + +# +# .desktop file +# +desktopdir = $(datadir)/xfce4/panel/plugins +desktop_in_files = layout.desktop.in +desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) +@INTLTOOL_DESKTOP_RULE@ + +EXTRA_DIST = \ + $(desktop_in_files) + +DISTCLEANFILES = \ + $(desktop_DATA) + +# vi:set ts=8 sw=8 noet ai nocindent syntax=automake: diff -rupN a/plugins/layout/Makefile.in b/plugins/layout/Makefile.in --- a/plugins/layout/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ b/plugins/layout/Makefile.in 2012-06-20 23:09:28.000000000 +0000 @@ -0,0 +1,765 @@ +# Makefile.in generated by automake 1.11.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = plugins/layout +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(desktopdir)" +LTLIBRARIES = $(plugin_LTLIBRARIES) +am__DEPENDENCIES_1 = +am_liblayout_la_OBJECTS = liblayout_la-layout.lo +liblayout_la_OBJECTS = $(am_liblayout_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +liblayout_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(liblayout_la_CFLAGS) $(CFLAGS) \ + $(liblayout_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(liblayout_la_SOURCES) +DIST_SOURCES = $(liblayout_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DATA = $(desktop_DATA) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_LIBS = @CAIRO_LIBS@ +CAIRO_REQUIRED_VERSION = @CAIRO_REQUIRED_VERSION@ +CAIRO_VERSION = @CAIRO_VERSION@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_REQUIRED_VERSION = @DBUS_REQUIRED_VERSION@ +DBUS_VERSION = @DBUS_VERSION@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +EXO_CFLAGS = @EXO_CFLAGS@ +EXO_LIBS = @EXO_LIBS@ +EXO_REQUIRED_VERSION = @EXO_REQUIRED_VERSION@ +EXO_VERSION = @EXO_VERSION@ +FGREP = @FGREP@ +GARCON_CFLAGS = @GARCON_CFLAGS@ +GARCON_LIBS = @GARCON_LIBS@ +GARCON_REQUIRED_VERSION = @GARCON_REQUIRED_VERSION@ +GARCON_VERSION = @GARCON_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GIO_REQUIRED_VERSION = @GIO_REQUIRED_VERSION@ +GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ +GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ +GIO_UNIX_REQUIRED_VERSION = @GIO_UNIX_REQUIRED_VERSION@ +GIO_UNIX_VERSION = @GIO_UNIX_VERSION@ +GIO_VERSION = @GIO_VERSION@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_REQUIRED_VERSION = @GLIB_REQUIRED_VERSION@ +GLIB_VERSION = @GLIB_VERSION@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMODULE_REQUIRED_VERSION = @GMODULE_REQUIRED_VERSION@ +GMODULE_VERSION = @GMODULE_VERSION@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_DOC_EXTRA_CFLAGS = @GTK_DOC_EXTRA_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GTK_REQUIRED_VERSION = @GTK_REQUIRED_VERSION@ +GTK_VERSION = @GTK_VERSION@ +HELPER_PATH_PREFIX = @HELPER_PATH_PREFIX@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ +INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ +INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ +INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBWNCK_CFLAGS = @LIBWNCK_CFLAGS@ +LIBWNCK_LIBS = @LIBWNCK_LIBS@ +LIBWNCK_REQUIRED_VERSION = @LIBWNCK_REQUIRED_VERSION@ +LIBWNCK_VERSION = @LIBWNCK_VERSION@ +LIBX11_CFLAGS = @LIBX11_CFLAGS@ +LIBX11_LDFLAGS = @LIBX11_LDFLAGS@ +LIBX11_LIBS = @LIBX11_LIBS@ +LIBXFCE4PANEL_VERINFO = @LIBXFCE4PANEL_VERINFO@ +LIBXFCE4PANEL_VERSION = @LIBXFCE4PANEL_VERSION@ +LIBXFCE4PANEL_VERSION_API = @LIBXFCE4PANEL_VERSION_API@ +LIBXFCE4PANEL_VERSION_MAJOR = @LIBXFCE4PANEL_VERSION_MAJOR@ +LIBXFCE4PANEL_VERSION_MICRO = @LIBXFCE4PANEL_VERSION_MICRO@ +LIBXFCE4PANEL_VERSION_MINOR = @LIBXFCE4PANEL_VERSION_MINOR@ +LIBXFCE4UI_CFLAGS = @LIBXFCE4UI_CFLAGS@ +LIBXFCE4UI_LIBS = @LIBXFCE4UI_LIBS@ +LIBXFCE4UI_REQUIRED_VERSION = @LIBXFCE4UI_REQUIRED_VERSION@ +LIBXFCE4UI_VERSION = @LIBXFCE4UI_VERSION@ +LIBXFCE4UTIL_CFLAGS = @LIBXFCE4UTIL_CFLAGS@ +LIBXFCE4UTIL_LIBS = @LIBXFCE4UTIL_LIBS@ +LIBXFCE4UTIL_REQUIRED_VERSION = @LIBXFCE4UTIL_REQUIRED_VERSION@ +LIBXFCE4UTIL_VERSION = @LIBXFCE4UTIL_VERSION@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PLATFORM_CFLAGS = @PLATFORM_CFLAGS@ +PLATFORM_CPPFLAGS = @PLATFORM_CPPFLAGS@ +PLATFORM_LDFLAGS = @PLATFORM_LDFLAGS@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XFCE4_PANEL_CONFIG_VERSION = @XFCE4_PANEL_CONFIG_VERSION@ +XFCONF_CFLAGS = @XFCONF_CFLAGS@ +XFCONF_LIBS = @XFCONF_LIBS@ +XFCONF_REQUIRED_VERSION = @XFCONF_REQUIRED_VERSION@ +XFCONF_VERSION = @XFCONF_VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_ARGS = @XGETTEXT_ARGS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +intltool__v_merge_options_ = @intltool__v_merge_options_@ +intltool__v_merge_options_0 = @intltool__v_merge_options_0@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = \ + -I$(top_srcdir) \ + -DG_LOG_DOMAIN=\"liblayout\" \ + -DWNCK_I_KNOW_THIS_IS_UNSTABLE \ + $(PLATFORM_CPPFLAGS) + +plugindir = $(libdir)/xfce4/panel/plugins +plugin_LTLIBRARIES = \ + liblayout.la + +liblayout_la_SOURCES = \ + layout.c \ + layout.h + +liblayout_la_CFLAGS = \ + $(GTK_CFLAGS) \ + $(LIBXFCE4UTIL_CFLAGS) \ + $(LIBWNCK_CFLAGS) \ + $(PLATFORM_CFLAGS) + +liblayout_la_LDFLAGS = \ + -avoid-version \ + -module \ + -no-undefined \ + -export-symbols-regex '^xfce_panel_module_(preinit|init|construct)' \ + $(PLATFORM_LDFLAGS) + +liblayout_la_LIBADD = \ + $(top_builddir)/libxfce4panel/libxfce4panel-$(LIBXFCE4PANEL_VERSION_API).la \ + $(top_builddir)/common/libpanel-common.la \ + $(GTK_LIBS) \ + $(LIBXFCE4UTIL_LIBS) \ + $(LIBWNCK_LIBS) + +liblayout_la_DEPENDENCIES = \ + $(top_builddir)/libxfce4panel/libxfce4panel-$(LIBXFCE4PANEL_VERSION_API).la \ + $(top_builddir)/common/libpanel-common.la + + +# +# .desktop file +# +desktopdir = $(datadir)/xfce4/panel/plugins +desktop_in_files = layout.desktop.in +desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) +EXTRA_DIST = \ + $(desktop_in_files) + +DISTCLEANFILES = \ + $(desktop_DATA) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/layout/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/layout/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(plugindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(plugindir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(plugindir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(plugindir)"; \ + } + +uninstall-pluginLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(plugindir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(plugindir)/$$f"; \ + done + +clean-pluginLTLIBRARIES: + -test -z "$(plugin_LTLIBRARIES)" || rm -f $(plugin_LTLIBRARIES) + @list='$(plugin_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +liblayout.la: $(liblayout_la_OBJECTS) $(liblayout_la_DEPENDENCIES) $(EXTRA_liblayout_la_DEPENDENCIES) + $(AM_V_CCLD)$(liblayout_la_LINK) -rpath $(plugindir) $(liblayout_la_OBJECTS) $(liblayout_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblayout_la-layout.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +liblayout_la-layout.lo: layout.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblayout_la_CFLAGS) $(CFLAGS) -MT liblayout_la-layout.lo -MD -MP -MF $(DEPDIR)/liblayout_la-layout.Tpo -c -o liblayout_la-layout.lo `test -f 'layout.c' || echo '$(srcdir)/'`layout.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblayout_la-layout.Tpo $(DEPDIR)/liblayout_la-layout.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='layout.c' object='liblayout_la-layout.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblayout_la_CFLAGS) $(CFLAGS) -c -o liblayout_la-layout.lo `test -f 'layout.c' || echo '$(srcdir)/'`layout.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-desktopDATA: $(desktop_DATA) + @$(NORMAL_INSTALL) + @list='$(desktop_DATA)'; test -n "$(desktopdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(desktopdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(desktopdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(desktopdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(desktopdir)" || exit $$?; \ + done + +uninstall-desktopDATA: + @$(NORMAL_UNINSTALL) + @list='$(desktop_DATA)'; test -n "$(desktopdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(desktopdir)'; $(am__uninstall_files_from_dir) + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(DATA) +installdirs: + for dir in "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(desktopdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-pluginLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-desktopDATA install-pluginLTLIBRARIES + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-desktopDATA uninstall-pluginLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pluginLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-desktopDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-pluginLTLIBRARIES install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-desktopDATA uninstall-pluginLTLIBRARIES + +@INTLTOOL_DESKTOP_RULE@ + +# vi:set ts=8 sw=8 noet ai nocindent syntax=automake: + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -rupN a/plugins/layout/layout.c b/plugins/layout/layout.c --- a/plugins/layout/layout.c 1970-01-01 00:00:00.000000000 +0000 +++ b/plugins/layout/layout.c 2012-06-24 17:34:51.000000000 +0000 @@ -0,0 +1,367 @@ +/* $Id$ + * + * Copyright (C) 2012 Alexsandr Sovenko + * + * 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., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include + +#include + +#include +#include + +#define HAVE_XFCONF +#ifdef HAVE_XFCONF +#include +#endif /* HAVE_XFCONF */ + +#define HAVE_DBUS +#ifdef HAVE_DBUS +#include +#include +#include +#endif /* HAVE_DBUS */ + +#define HAVE_LIBXKLAVIER +#ifdef HAVE_LIBXKLAVIER +#include +#endif /* HAVE_LIBXKLAVIER */ + +#include "layout.h" + +#define __(a) \ + g_strdup_printf ("%s", a) + +/* prototypes */ +static void +layout_construct (XfcePanelPlugin *plugin); + +/* register the plugin */ +XFCE_PANEL_PLUGIN_REGISTER (layout_construct); + +static gchar* +layout_current (LayoutPlugin *layout, + gint current_group) +{ + gint group_id; + gchar *name; + gchar *default_layouts; + gchar **layouts; + gchar **layout1; + +#ifdef HAVE_XFCONF + layout->layout_val = xfconf_channel_get_string (layout->channel, + "/Default/XkbLayout", default_layouts); +#endif /* HAVE_XFCONF */ + + layouts = g_strsplit (layout->layout_val, ",", 0); + + layout->layout_desc = NULL; + + for (layout1 = layouts, group_id = 0; *layout1 != NULL; ++layout1, ++group_id) + { + XklConfigItem *litem; + gchar *layout_desc; + + litem = xkl_config_item_new (); + + g_snprintf (litem->name, sizeof litem->name, "%s", *layout1); + + if (xkl_config_registry_find_layout (layout->registry, litem)) + layout_desc = litem->description; + else + layout_desc = *layout1; + + if(!layout->layout_desc) + layout->layout_desc = g_strdup (layout_desc); + else + layout->layout_desc = g_strjoin (",", layout->layout_desc, layout_desc, NULL); + + if(group_id == current_group) + name = g_strdup (litem->name); + + g_object_unref (litem); + } + + return name; +} + +static gboolean +layout_menu_item (GtkWidget *event_box, + GdkEventButton *event, + gpointer user_data) +{ + LayoutPlugin *layout = (LayoutPlugin *)user_data; +#ifdef HAVE_DBUS + if (layout->bus) + { + DBusMessage *message = dbus_message_new_signal ("/org/xfce/SettingsDaemon/KeyboardLayoutHelper/layoutset", + "org.xfce.SettingsDaemon.KeyboardLayoutHelper.Signal", "layoutset"); + gint e = (gint)g_object_get_data (G_OBJECT(event_box), "layoutset"); + + dbus_message_append_args (message, + DBUS_TYPE_INT32, &e, + DBUS_TYPE_INVALID); + dbus_connection_send (layout->bus, message, NULL); + dbus_message_unref (message); + } +#endif /* HAVE_DBUS */ + + return TRUE; +} + +static gboolean +layout_menu (GtkWidget *event_box, + GdkEventButton *event, + gpointer user_data) +{ + gint q = 0; + gchar *layout_val; + gchar *default_layouts; + gchar **str; + + + LayoutPlugin *layout = (LayoutPlugin *)user_data; + + if(event->button == 1) + { +#ifdef HAVE_XFCONF + layout_val = xfconf_channel_get_string (layout->channel, + "/Default/XkbLayout", default_layouts); +#endif /* HAVE_XFCONF */ + if (strcmp (layout_val, layout->layout_val)) + layout_current (layout, layout->group); + + layout->menu = gtk_menu_new (); + + gchar **split = g_strsplit (layout->layout_desc, ",", 0); + + for (str = split; *str != NULL; ++str, ++q) + { + GtkWidget *item = gtk_menu_item_new_with_label(*str); + if(q == layout->group) + gtk_widget_set_sensitive (item, FALSE); + gtk_menu_append(layout->menu, item); + g_object_set_data(G_OBJECT(item), "layoutset", (gpointer *)q); + g_signal_connect(G_OBJECT(item), "button-press-event", + G_CALLBACK(layout_menu_item), layout); + } + + gtk_widget_show_all(layout->menu); + gtk_menu_popup(GTK_MENU(layout->menu), NULL, NULL, NULL, NULL, + (event != NULL) ? event->button : 0, + gdk_event_get_time((GdkEvent*)event)); + } + + return TRUE; +} + +#ifdef HAVE_DBUS +static DBusHandlerResult +layout_signal_filter (DBusConnection *connection, + DBusMessage *message, + void *user_data) +{ + LayoutPlugin *layout = (LayoutPlugin *)user_data; + + if (dbus_message_is_signal + (message, DBUS_INTERFACE_LOCAL, "Disconnected")) + return DBUS_HANDLER_RESULT_HANDLED; + else if (dbus_message_is_signal (message, "org.xfce.SettingsDaemon.KeyboardLayoutHelper.Signal", "layoutget")) + { + DBusError error; + //gint current_group; + dbus_error_init (&error); + if (dbus_message_get_args(message, &error, + DBUS_TYPE_INT32, &layout->group, + DBUS_TYPE_INVALID)) { + gtk_label_set_markup(GTK_LABEL (layout->label), + __ (layout_current (layout, layout->group))); + //layout->group = current_group; + } else { + g_print("Ping received, but error getting message: %s\n", error.message); + dbus_error_free (&error); + } + return DBUS_HANDLER_RESULT_HANDLED; + } + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; +} +#endif /* HAVE_DBUS */ + +static LayoutPlugin * +layout_new (XfcePanelPlugin *plugin) +{ + LayoutPlugin *layout; + GtkOrientation orientation; + + /* allocate memory for the plugin structure */ + layout = panel_slice_new0 (LayoutPlugin); + + /* pointer to plugin */ + layout->plugin = plugin; + +#ifdef HAVE_LIBXKLAVIER + layout->display = XOpenDisplay(NULL); + layout->engine = xkl_engine_get_instance (layout->display); + layout->registry = + xkl_config_registry_get_instance (layout->engine); + xkl_config_registry_load (layout->registry, TRUE); +#endif /* HAVE_LIBXKLAVIER */ + +#ifdef HAVE_XFCONF + xfconf_init(NULL); + layout->channel = xfconf_channel_get ("keyboard-layout"); +#endif /* HAVE_XFCONF */ + + /* get the current orientation */ + orientation = xfce_panel_plugin_get_orientation (plugin); + + /* create some panel widgets */ + layout->ebox = gtk_event_box_new (); + gtk_widget_show (layout->ebox); + + layout->event = gtk_event_box_new (); + gtk_widget_show(layout->event); + + layout->label = gtk_label_new (""); + + gint width, height; + gtk_widget_get_size_request (layout->label, &width, &height); + gtk_widget_set_size_request (layout->label, width + 30, height); + gtk_container_add (GTK_CONTAINER(layout->event), layout->label); + gtk_container_add (GTK_CONTAINER (layout->ebox), layout->event); + + gtk_label_set_markup(GTK_LABEL (layout->label), + __ (layout_current (layout, 0))); + + gtk_widget_show (layout->label); + +#ifdef HAVE_DBUS + /* dbus init and listen */ + dbus_error_init (&layout->error); + layout->bus = dbus_bus_get (DBUS_BUS_SESSION, &layout->error); + if (!layout->bus) + { + g_warning ("Failed to connect to the D-BUS daemon: %s", + layout->error.message); + dbus_error_free (&layout->error); + } else + { + dbus_connection_setup_with_g_main (layout->bus, NULL); + dbus_bus_add_match (layout->bus, + "type='signal',interface='org.xfce.SettingsDaemon.KeyboardLayoutHelper.Signal'", NULL); + dbus_connection_add_filter (layout->bus, + layout_signal_filter, layout, NULL); + } +#endif /* HAVE_DBUS */ + + return layout; +} + +static void +layout_free (XfcePanelPlugin *plugin, + LayoutPlugin *layout) +{ +#ifdef HAVE_DBUS + dbus_connection_remove_filter (layout->bus, layout_signal_filter, layout); +#endif /* HAVE_DBUS */ + +#ifdef HAVE_XFCONF + xfconf_shutdown(); +#endif /* HAVE_XFCONF */ + +#ifdef HAVE_LIBXKLAVIER + g_object_unref (G_OBJECT (layout->registry)); + g_object_unref (G_OBJECT (layout->engine)); + + XCloseDisplay (layout->display); +#endif /* HAVE_LIBXKLAVIER */ + + panel_slice_free (LayoutPlugin, layout); +} + +static void +layout_orientation_changed (XfcePanelPlugin *plugin, + GtkOrientation orientation, + LayoutPlugin *layout) +{ + /* change the orienation of the box */ + xfce_hvbox_set_orientation (XFCE_HVBOX (layout->hvbox), orientation); +} + +static gboolean +layout_size_changed (XfcePanelPlugin *plugin, + gint size, + LayoutPlugin *layout) +{ + GtkOrientation orientation; + + /* get the orientation of the plugin */ + orientation = xfce_panel_plugin_get_orientation (plugin); + + /* set the widget size */ + if (orientation == GTK_ORIENTATION_HORIZONTAL) + gtk_widget_set_size_request (GTK_WIDGET (plugin), -1, size); + else + gtk_widget_set_size_request (GTK_WIDGET (plugin), size, -1); + /* we handled the orientation */ + + return TRUE; +} + +static void +layout_configure (XfcePanelPlugin *plugin, gpointer user_data) +{ + gchar *execute_argv[] = {"xfce4-keyboard-settings", NULL}; + gdk_spawn_on_screen (gdk_screen_get_default(), NULL, + execute_argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, + NULL, NULL); +} + +static void +layout_construct (XfcePanelPlugin *plugin) +{ + LayoutPlugin *layout; + + /* create the plugin */ + layout = layout_new (plugin); + + /* add the ebox to the panel */ + gtk_container_add (GTK_CONTAINER (plugin), layout->ebox); + + /* show the configure menu item and connect signal */ + xfce_panel_plugin_menu_show_configure (plugin); + + /* add action to widget event */ + xfce_panel_plugin_add_action_widget (layout->plugin, layout->event); + + /* connect plugin signals */ + g_signal_connect (G_OBJECT (plugin), "free-data", + G_CALLBACK (layout_free), layout); + + g_signal_connect (G_OBJECT (plugin), "size-changed", + G_CALLBACK (layout_size_changed), layout); + + g_signal_connect (G_OBJECT (plugin), "orientation-changed", + G_CALLBACK (layout_orientation_changed), layout); + + g_signal_connect (G_OBJECT(layout->event), "button_press_event", + G_CALLBACK (layout_menu), layout); + + g_signal_connect (G_OBJECT (plugin), "configure-plugin", + G_CALLBACK (layout_configure), layout); +} diff -rupN a/plugins/layout/layout.desktop.in b/plugins/layout/layout.desktop.in --- a/plugins/layout/layout.desktop.in 1970-01-01 00:00:00.000000000 +0000 +++ b/plugins/layout/layout.desktop.in 2012-06-24 00:01:18.000000000 +0000 @@ -0,0 +1,11 @@ +[Xfce Panel] +Type=X-XFCE-PanelPlugin +Name=Keyboard Layouts +Name[ru]=Раскладки клавиатуры +Name[uk]=Розкладки клавіатури +Comment=Allows you to switch between layouts +Comment[ru]=Позволяет переключаться между раскладками +Comment[uk]=Дозволяє перемикатися між розкладками +Icon=preferences-desktop-keyboard +X-XFCE-Module=layout +X-XFCE-Internal=FALSE diff -rupN a/plugins/layout/layout.h b/plugins/layout/layout.h --- a/plugins/layout/layout.h 1970-01-01 00:00:00.000000000 +0000 +++ b/plugins/layout/layout.h 2012-06-24 11:17:28.000000000 +0000 @@ -0,0 +1,66 @@ +/* $Id$ + * + * Copyright (C) 2012 Alexsandr Sovenko + * + * 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., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef __LAYOUT_H__ +#define __LAYOUT_H__ + +G_BEGIN_DECLS + +/* plugin structure */ +typedef struct +{ + XfcePanelPlugin *plugin; + + /* panel widgets */ + GtkWidget *ebox; + GtkWidget *hvbox; + GtkWidget *label; + GtkWidget *event; + GtkWidget *menu; + +#ifdef HAVE_DBUS + /* dbus */ + DBusConnection *bus; + DBusError error; +#endif /* HAVE_DBUS */ + +#ifdef HAVE_LIBXKLAVIER + Display *display; + + /* libxklavire */ + XklEngine *engine ; + XklConfigRegistry *registry; +#endif /* HAVE_LIBXKLAVIER */ + + /* */ + gchar *layout_val; /* deprecate */ + gchar *layout_desc; + gint group; + +#ifdef HAVE_XFCONF + /* */ + XfconfChannel *channel; +#endif /* HAVE_XFCONF */ +} +LayoutPlugin; + +G_END_DECLS + +#endif /* !__LAYOUT_H__ */ +