From mmassonnet at xfce.org Tue Apr 1 09:11:50 2008 From: mmassonnet at xfce.org (Mike Massonnet) Date: Tue, 1 Apr 2008 07:11:50 +0000 (UTC) Subject: [Xfce4-commits] r26701 - mousepad/branches/nick_0_3/po Message-ID: <20080401071150.83DADF29D8@mocha.foo-projects.org> Author: mmassonnet Date: 2008-04-01 07:11:50 +0000 (Tue, 01 Apr 2008) New Revision: 26701 Added: mousepad/branches/nick_0_3/po/TRANSLATORS Removed: mousepad/branches/nick_0_3/po/fr.po Modified: mousepad/branches/nick_0_3/po/ChangeLog mousepad/branches/nick_0_3/po/LINGUAS Log: Revert French translation. Add a note inside TRANSLATORS Modified: mousepad/branches/nick_0_3/po/ChangeLog =================================================================== --- mousepad/branches/nick_0_3/po/ChangeLog 2008-03-31 11:46:16 UTC (rev 26700) +++ mousepad/branches/nick_0_3/po/ChangeLog 2008-04-01 07:11:50 UTC (rev 26701) @@ -1,5 +0,0 @@ -2008-03-31 Mike Massonnet - - * fr.po, LINGUAS: Add French translation from some guy who passed it to - another guy on IRC - Modified: mousepad/branches/nick_0_3/po/LINGUAS =================================================================== --- mousepad/branches/nick_0_3/po/LINGUAS 2008-03-31 11:46:16 UTC (rev 26700) +++ mousepad/branches/nick_0_3/po/LINGUAS 2008-04-01 07:11:50 UTC (rev 26701) @@ -1,2 +1 @@ # set of available languages (in alphabetic order) -fr Added: mousepad/branches/nick_0_3/po/TRANSLATORS =================================================================== --- mousepad/branches/nick_0_3/po/TRANSLATORS (rev 0) +++ mousepad/branches/nick_0_3/po/TRANSLATORS 2008-04-01 07:11:50 UTC (rev 26701) @@ -0,0 +1,4 @@ +Note to translators: +~~~~~~~~~~~~~~~~~~~ +Don't translate this branch until it gets moved to trunk. Thanks. + Deleted: mousepad/branches/nick_0_3/po/fr.po From kelnos at xfce.org Wed Apr 2 10:34:36 2008 From: kelnos at xfce.org (Brian Tarricone) Date: Wed, 2 Apr 2008 08:34:36 +0000 (UTC) Subject: [Xfce4-commits] r26777 - xfconf/trunk/xfconf Message-ID: <20080402083436.B47C9F29D8@mocha.foo-projects.org> Author: kelnos Date: 2008-04-02 08:34:36 +0000 (Wed, 02 Apr 2008) New Revision: 26777 Modified: xfconf/trunk/xfconf/xfconf.symbols Log: add new symbol to xfconf.symbols so 'make check' passes Modified: xfconf/trunk/xfconf/xfconf.symbols =================================================================== --- xfconf/trunk/xfconf/xfconf.symbols 2008-02-20 18:34:22 UTC (rev 26776) +++ xfconf/trunk/xfconf/xfconf.symbols 2008-04-02 08:34:36 UTC (rev 26777) @@ -28,6 +28,7 @@ xfconf_init xfconf_shutdown xfconf_named_struct_register +xfconf_array_free #endif #endif From denva at xfce.org Wed Apr 2 21:11:40 2008 From: denva at xfce.org (Brittany) Date: Thu, 03 Apr 2008 03:11:40 +0800 Subject: [Xfce4-commits] [SPAMKLASSAT av SU] Reproduction and ED problems Message-ID: <47F3DA6C.1080103@xfce.org> An HTML attachment was scrubbed... URL: http://foo-projects.org/pipermail/xfce4-commits/attachments/20080403/2b0837ce/attachment.html From stephan at xfce.org Thu Apr 3 00:25:36 2008 From: stephan at xfce.org (Stephan Arts) Date: Wed, 2 Apr 2008 22:25:36 +0000 (UTC) Subject: [Xfce4-commits] r26778 - in xfconf/trunk: . xfsettingsd Message-ID: <20080402222536.BAA4AF29D8@mocha.foo-projects.org> Author: stephan Date: 2008-04-02 22:25:36 +0000 (Wed, 02 Apr 2008) New Revision: 26778 Added: xfconf/trunk/xfsettingsd/ xfconf/trunk/xfsettingsd/Makefile.am xfconf/trunk/xfsettingsd/main.c xfconf/trunk/xfsettingsd/registry.c xfconf/trunk/xfsettingsd/registry.h Modified: xfconf/trunk/Makefile.am xfconf/trunk/TODO xfconf/trunk/configure.ac.in Log: Import xfsettingsd code, the xfce-xsettingsd Update TODO Modified: xfconf/trunk/Makefile.am =================================================================== --- xfconf/trunk/Makefile.am 2008-04-02 08:34:36 UTC (rev 26777) +++ xfconf/trunk/Makefile.am 2008-04-02 22:25:36 UTC (rev 26778) @@ -2,6 +2,7 @@ common \ xfconf \ xfconfd \ + xfsettingsd \ po \ docs \ tests Modified: xfconf/trunk/TODO =================================================================== --- xfconf/trunk/TODO 2008-04-02 08:34:36 UTC (rev 26777) +++ xfconf/trunk/TODO 2008-04-02 22:25:36 UTC (rev 26778) @@ -24,6 +24,7 @@ changes? load it and send PropertyChanged for all properties? that could be very bad. * separate XSETTINGS daemon that reads values from xfconfd + - add multi-screen support * libxfce4mcs-client dummy implementation that forwards to libxfconf * cmdline get/set/query tool so the config store can be scriptable Modified: xfconf/trunk/configure.ac.in =================================================================== --- xfconf/trunk/configure.ac.in 2008-04-02 08:34:36 UTC (rev 26777) +++ xfconf/trunk/configure.ac.in 2008-04-02 22:25:36 UTC (rev 26778) @@ -64,7 +64,7 @@ dnl required XDT_CHECK_PACKAGE([GLIB], [gobject-2.0], [2.8.0]) -dnl XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.10.0]) +XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.10.0]) XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.4.0]) dnl XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.4.0]) XDT_CHECK_PACKAGE([DBUS], [dbus-1], [1.0.0]) @@ -167,4 +167,5 @@ xfconf/Makefile xfconf/libxfconf-0.pc xfconfd/Makefile +xfsettingsd/Makefile ]) Added: xfconf/trunk/xfsettingsd/Makefile.am =================================================================== --- xfconf/trunk/xfsettingsd/Makefile.am (rev 0) +++ xfconf/trunk/xfsettingsd/Makefile.am 2008-04-02 22:25:36 UTC (rev 26778) @@ -0,0 +1,22 @@ +bin_PROGRAMS = xfsettingsd + +xfsettingsd_SOURCES = \ + main.c \ + registry.c registry.h + +xfsettingsd_CFLAGS = \ + $(GTK_CFLAGS) \ + $(GLIB_CFLAGS) \ + $(DBUS_GLIB_CFLAGS) \ + -DDATADIR=\"$(datadir)\" \ + -DSRCDIR=\"$(top_srcdir)\" \ + -DLOCALEDIR=\"$(localedir)\" + +xfsettingsd_LDADD = \ + $(top_builddir)/xfconf/libxfconf-0.la \ + $(GTK_LIBS) \ + $(GLIB_LIBS) \ + $(DBUS_GLIB_LIBS) + +INCLUDES = \ + -I${top_srcdir} Added: xfconf/trunk/xfsettingsd/main.c =================================================================== --- xfconf/trunk/xfsettingsd/main.c (rev 0) +++ xfconf/trunk/xfsettingsd/main.c 2008-04-02 22:25:36 UTC (rev 26778) @@ -0,0 +1,191 @@ +/* + * Copyright (c) 2008 Stephan Arts + * + * 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 Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include + +#include + +#if defined(GETTEXT_PACKAGE) +#include +#else +#include +#endif + +#include +#include + +#include + +#include "registry.h" + +#define XF_DEBUG(str) \ + if (debug) g_print (str) + +gboolean version = FALSE; +gboolean force_replace = FALSE; +gboolean running = FALSE; +gboolean debug = FALSE; + +static GOptionEntry entries[] = +{ + { "version", 'v', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &version, + N_("Version information"), + NULL + }, + { "verbose", 'V', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &version, + N_("Verbose output"), + NULL + }, + { "force", 'f', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &force_replace, + N_("Force replace existing any xsettings daemon"), + NULL + }, + { "debug", 'd', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &debug, + N_("Start in debug mode (don't fork to the background)"), + NULL + }, + { NULL } +}; + + +GdkFilterReturn +manager_event_filter (GdkXEvent *xevent, + GdkEvent *event, + gpointer data) +{ + if (FALSE) + { + return GDK_FILTER_REMOVE; + } + else + { + return GDK_FILTER_CONTINUE; + } +} + +/** + * settings_daemon_check_running: + * @display: X11 Display object + * @screen: X11 Screen number + * + * Return value: TRUE if an XSETTINGS daemon is already running + */ +gboolean +settings_daemon_check_running (Display *display, gint screen) +{ + Atom atom; + gchar buffer[256]; + + g_sprintf(buffer, "_XSETTINGS_S%d", screen); + atom = XInternAtom((Display *)display, buffer, False); + + if (XGetSelectionOwner((Display *)display, atom)) + { + return TRUE; + } + else + return FALSE; +} + +int +main(int argc, char **argv) +{ + Atom selection_atom; + Atom xsettings_atom; + Atom manager_atom; + + GError *cli_error = NULL; + + #ifdef ENABLE_NLS + bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); + #endif + + if(!gtk_init_with_args(&argc, &argv, _(""), entries, PACKAGE, &cli_error)) + { + if (cli_error != NULL) + { + g_print (_("%s: %s\nTry %s --help to see a full list of available command line options.\n"), PACKAGE, cli_error->message, PACKAGE_NAME); + g_error_free (cli_error); + return 1; + } + } + + if(version) + { + g_print("%s\n", PACKAGE_STRING); + return 0; + } + + xfconf_init(NULL); + + gint screen = DefaultScreen(gdk_display); + + Window window = 0; + + running = settings_daemon_check_running(GDK_DISPLAY(), DefaultScreen(GDK_DISPLAY())); + + if (running) + { + XF_DEBUG("XSETTINGS Daemon running\n"); + if (force_replace) + { + XF_DEBUG("Replacing XSETTINGS daemon\n"); + } + else + { + XF_DEBUG("Aborting...\n"); + return 1; + } + } + + if ((running && force_replace) || (!running)) + { + XF_DEBUG("Initializing...\n"); + + XfconfChannel *channel = xfconf_channel_new("xsettings"); + + XSettingsRegistry *registry = xsettings_registry_new(channel, gdk_display, screen); + + xsettings_registry_load(registry, debug); + + xsettings_registry_notify(registry); + } + + gdk_window_add_filter(NULL, manager_event_filter, NULL); + + if(!debug) /* If not in debug mode, fork to background */ + { + if(!fork()) + { + gtk_main(); + + XDestroyWindow (gdk_display, window); + xfconf_shutdown(); + } + } + else + { + gtk_main(); + + XDestroyWindow (gdk_display, window); + xfconf_shutdown(); + } +} Added: xfconf/trunk/xfsettingsd/registry.c =================================================================== --- xfconf/trunk/xfsettingsd/registry.c (rev 0) +++ xfconf/trunk/xfsettingsd/registry.c 2008-04-02 22:25:36 UTC (rev 26778) @@ -0,0 +1,582 @@ +/* + * Copyright (c) 2008 Stephan Arts + * + * 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 Library 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. + * + * + * Based on the XSETTINGS spec written by Owen Taylor + */ + +#include +#include +#include + +#include + +#if defined(GETTEXT_PACKAGE) +#include +#else +#include +#endif + +#include +#include + +#include + +#include + +#include "registry.h" + +#define XSETTINGS_PAD(n,m) ((n + m - 1) & (~(m-1))) + +#define XSETTINGS_DEBUG(str) \ + if (debug) g_print ("%s", str) +#define XSETTINGS_DEBUG_CREATE(str) \ + if (debug) g_print ("Creating Property: '%s'\n", str) +#define XSETTINGS_DEBUG_LOAD(str) \ + if (debug) g_print ("Loading Property: '%s'\n", str) + +G_DEFINE_TYPE(XSettingsRegistry, xsettings_registry, G_TYPE_OBJECT); + +struct _XSettingsRegistryPriv +{ + XSettingsRegistryEntry **properties; + + gint serial; + gint last_change_serial; + + /* props */ + XfconfChannel *channel; + gint screen; + Display *display; + Window window; + Atom xsettings_atom; +}; + +static void xsettings_registry_set_property(GObject*, guint, const GValue*, GParamSpec*); +static void xsettings_registry_get_property(GObject*, guint, GValue*, GParamSpec*); + +static void +cb_xsettings_registry_channel_property_changed(XfconfChannel *channel, const gchar *property_name, XSettingsRegistry *registry); +static Bool +timestamp_predicate (Display *display, XEvent *xevent, XPointer arg); + +static XSettingsRegistryEntry * +xsettings_registry_entry_new_string(const gchar *name, const gchar *value); +static XSettingsRegistryEntry * +xsettings_registry_entry_new_int(const gchar *name, gint value); +static XSettingsRegistryEntry * +xsettings_registry_entry_new_bool(const gchar *name, gboolean value); + +#define XSETTINGS_REGISTRY_SIZE 24 + +enum { + XSETTINGS_REGISTRY_PROPERTY_CHANNEL = 1, + XSETTINGS_REGISTRY_PROPERTY_DISPLAY, + XSETTINGS_REGISTRY_PROPERTY_SCREEN, + XSETTINGS_REGISTRY_PROPERTY_XSETTINGS_ATOM, + XSETTINGS_REGISTRY_PROPERTY_WINDOW +}; + +void +xsettings_registry_class_init(XSettingsRegistryClass *reg_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS(reg_class); + GParamSpec *pspec; + + object_class->set_property = xsettings_registry_set_property; + object_class->get_property = xsettings_registry_get_property; + + + pspec = g_param_spec_object("channel", NULL, NULL, XFCONF_TYPE_CHANNEL, G_PARAM_READABLE|G_PARAM_WRITABLE|G_PARAM_CONSTRUCT_ONLY); + g_object_class_install_property(object_class, XSETTINGS_REGISTRY_PROPERTY_CHANNEL, pspec); + + pspec = g_param_spec_int("screen", NULL, NULL, -1, 65535, -1, G_PARAM_READABLE|G_PARAM_WRITABLE|G_PARAM_CONSTRUCT_ONLY); + g_object_class_install_property(object_class, XSETTINGS_REGISTRY_PROPERTY_SCREEN, pspec); + + pspec = g_param_spec_pointer("display", NULL, NULL, G_PARAM_READABLE|G_PARAM_WRITABLE|G_PARAM_CONSTRUCT_ONLY); + g_object_class_install_property(object_class, XSETTINGS_REGISTRY_PROPERTY_DISPLAY, pspec); + + pspec = g_param_spec_long("xsettings_atom", NULL, NULL, G_MINLONG, G_MAXLONG, 0, G_PARAM_READABLE|G_PARAM_WRITABLE|G_PARAM_CONSTRUCT_ONLY); + g_object_class_install_property(object_class, XSETTINGS_REGISTRY_PROPERTY_XSETTINGS_ATOM, pspec); + + pspec = g_param_spec_long("window", NULL, NULL, G_MINLONG, G_MAXLONG, 0, G_PARAM_READABLE|G_PARAM_WRITABLE|G_PARAM_CONSTRUCT_ONLY); + g_object_class_install_property(object_class, XSETTINGS_REGISTRY_PROPERTY_WINDOW, pspec); + +} + +void +xsettings_registry_init(XSettingsRegistry *registry) +{ + registry->priv = g_new0(XSettingsRegistryPriv, 1); + registry->priv->properties = g_new0(XSettingsRegistryEntry *, XSETTINGS_REGISTRY_SIZE); + + gint i = XSETTINGS_REGISTRY_SIZE; + /* Net settings */ + registry->priv->properties[--i] = xsettings_registry_entry_new_int("Net/DoubleClickTime", 250); + registry->priv->properties[--i] = xsettings_registry_entry_new_int("Net/DoubleClickDistance", 5); + registry->priv->properties[--i] = xsettings_registry_entry_new_int("Net/DndDragThreshold", 8); + registry->priv->properties[--i] = xsettings_registry_entry_new_bool("Net/CursorBlink", TRUE); + registry->priv->properties[--i] = xsettings_registry_entry_new_int("Net/CursorBlinkTime", 1200); + registry->priv->properties[--i] = xsettings_registry_entry_new_string("Net/ThemeName", "Default"); + registry->priv->properties[--i] = xsettings_registry_entry_new_string("Net/IconThemeName", "hicolor"); + /* Xft settings */ + registry->priv->properties[--i] = xsettings_registry_entry_new_int("Xft/Antialias", -1); + registry->priv->properties[--i] = xsettings_registry_entry_new_int("Xft/Hinting", -1); + registry->priv->properties[--i] = xsettings_registry_entry_new_string("Xft/HintStyle", "hintnone"); + registry->priv->properties[--i] = xsettings_registry_entry_new_string("Xft/RGBA", "none"); + registry->priv->properties[--i] = xsettings_registry_entry_new_int("Xft/DPI", -1); + /* GTK settings */ + registry->priv->properties[--i] = xsettings_registry_entry_new_bool("Gtk/CanChangeAccels", FALSE); + registry->priv->properties[--i] = xsettings_registry_entry_new_string("Gtk/ColorPalette", + "black:white:gray50:red:purple:blue:light " + "blue:green:yellow:orange:lavender:brown:goldenrod4:dodger " + "blue:pink:light green:gray10:gray30:gray75:gray90"); + registry->priv->properties[--i] = xsettings_registry_entry_new_string("Gtk/FontName", "Sans 10"); + registry->priv->properties[--i] = xsettings_registry_entry_new_string("Gtk/IconSizes", NULL); + registry->priv->properties[--i] = xsettings_registry_entry_new_string("Gtk/KeyThemeName", NULL); + registry->priv->properties[--i] = xsettings_registry_entry_new_string("Gtk/ToolbarStyle", "Icons"); + registry->priv->properties[--i] = xsettings_registry_entry_new_string("Gtk/ToolbarIconSize", "LARGE_TOOLBAR"); + registry->priv->properties[--i] = xsettings_registry_entry_new_string("Gtk/IMPreeditStyle", ""); + registry->priv->properties[--i] = xsettings_registry_entry_new_string("Gtk/IMStatusStyle", ""); + registry->priv->properties[--i] = xsettings_registry_entry_new_bool("Gtk/MenuImages", TRUE); + registry->priv->properties[--i] = xsettings_registry_entry_new_bool("Gtk/ButtonImages", TRUE); + registry->priv->properties[--i] = xsettings_registry_entry_new_string("Gtk/MenuBarAccel", "F10"); + +#ifdef DEBUG + if (i != 0) + g_critical ("XSETTINGS_REGISTRY_SIZE != number of registry items"); +#endif + +} + +static void +cb_xsettings_registry_channel_property_changed(XfconfChannel *channel, const gchar *name, XSettingsRegistry *registry) +{ + gint i; + + for (i = 0; i < XSETTINGS_REGISTRY_SIZE; ++i) + { + XSettingsRegistryEntry *entry = registry->priv->properties[i]; + if (!strcmp(entry->name, &name[1])) + { + switch (G_VALUE_TYPE(entry->value)) + { + case G_TYPE_INT: + g_value_set_int(entry->value, xfconf_channel_get_int(channel, name, g_value_get_int(entry->value))); + break; + case G_TYPE_STRING: + g_value_set_string(entry->value, xfconf_channel_get_string(channel, name, g_value_get_string(entry->value))); + break; + case G_TYPE_BOOLEAN: + g_value_set_boolean(entry->value, xfconf_channel_get_bool(channel, name, g_value_get_boolean(entry->value))); + break; + } + } + } + xsettings_registry_notify(registry); +} + +void +xsettings_registry_notify(XSettingsRegistry *registry) +{ + registry->priv->last_change_serial = registry->priv->serial; + + XSettingsRegistryEntry *entry = NULL; + + gint buf_len = 12; + gint i; + + /** Calculate buffer size */ + for(i = 0; i < XSETTINGS_REGISTRY_SIZE; ++i) + { + entry = registry->priv->properties[i]; + buf_len += 8 + XSETTINGS_PAD(strlen(entry->name), 4); + switch (G_VALUE_TYPE(entry->value)) + { + case G_TYPE_INT: + case G_TYPE_BOOLEAN: + buf_len += 4; + break; + case G_TYPE_STRING: + { + buf_len += 4; + const gchar *value = g_value_get_string(entry->value); + if(value) + { + buf_len += XSETTINGS_PAD(strlen(value), 4); + } + + } + break; + case G_TYPE_UINT64: + buf_len += 8; + break; + } + } + + guchar *buffer = NULL; + guchar *pos = buffer = g_new0(guchar, buf_len); + + *(CARD32 *)pos = LSBFirst; + pos +=4; + + *(CARD32 *)pos = registry->priv->serial++; + pos += 4; + + *(CARD32 *)pos = XSETTINGS_REGISTRY_SIZE; + pos += 4; + + /** Fill the buffer */ + for(i = 0; i < XSETTINGS_REGISTRY_SIZE; ++i) + { + entry = registry->priv->properties[i]; + + gint name_len = XSETTINGS_PAD(strlen(entry->name), 4); + gint value_len; + + switch (G_VALUE_TYPE(entry->value)) + { + case G_TYPE_INT: + case G_TYPE_BOOLEAN: + *pos++ = 0; + break; + case G_TYPE_STRING: + *pos++ = 1; // String + { + const gchar *value = g_value_get_string(entry->value); + if(value) + { + value_len = XSETTINGS_PAD(strlen(value), 4); + } + else + { + value_len = 0; + } + } + break; + case G_TYPE_UINT64: /* Color is a 64-bits value */ + *pos++ = 2; + break; + } + *pos++ = 0; + + gint str_length = strlen(entry->name); + *(CARD16 *)pos = str_length; + pos += 2; + memcpy (pos, entry->name, str_length); + name_len -= str_length; + pos += str_length; + + while(name_len > 0) + { + *(pos++) = 0; + name_len--; + } + + *(CARD32 *)pos = registry->priv->last_change_serial; + pos+= 4; + + switch (G_VALUE_TYPE(entry->value)) + { + case G_TYPE_STRING: + { + const gchar *val = g_value_get_string(entry->value); + + if (val) + { + *(CARD32 *)pos = strlen(val); + pos += 4; + + memcpy (pos, val, strlen(val)); + pos += strlen(val); + value_len -= strlen(val); + } + else + { + *(CARD32 *)pos = 0; + pos += 4; + } + } + while(value_len > 0) + { + *(pos++) = 0; + value_len--; + } + break; + case G_TYPE_INT: + *(CARD32 *)pos = g_value_get_int(entry->value); + pos += 4; + break; + case G_TYPE_BOOLEAN: + *(CARD32 *)pos = g_value_get_boolean(entry->value); + pos += 4; + break; + case G_TYPE_UINT64: + + pos += 8; + break; + } + + } + + XChangeProperty(registry->priv->display, + registry->priv->window, + registry->priv->xsettings_atom, + registry->priv->xsettings_atom, + 8, PropModeReplace, buffer, buf_len); + + registry->priv->last_change_serial = registry->priv->serial; +} + +static XSettingsRegistryEntry * +xsettings_registry_entry_new_string(const gchar *name, const gchar *value) +{ + XSettingsRegistryEntry *entry = g_new0(XSettingsRegistryEntry, 1); + entry->name = g_strdup(name); + + entry->value = g_new0(GValue, 1); + entry->value = g_value_init(entry->value, G_TYPE_STRING); + g_value_set_string(entry->value, value); + + return entry; +} + +static XSettingsRegistryEntry * +xsettings_registry_entry_new_int(const gchar *name, gint value) +{ + XSettingsRegistryEntry *entry = g_new0(XSettingsRegistryEntry, 1); + entry->name = g_strdup(name); + entry->value = g_new0(GValue, 1); + entry->value = g_value_init(entry->value, G_TYPE_INT); + g_value_set_int(entry->value, value); + + return entry; +} + +static XSettingsRegistryEntry * +xsettings_registry_entry_new_bool(const gchar *name, gboolean value) +{ + XSettingsRegistryEntry *entry = g_new0(XSettingsRegistryEntry, 1); + entry->name = g_strdup(name); + + entry->value = g_new0(GValue, 1); + entry->value = g_value_init(entry->value, G_TYPE_BOOLEAN); + g_value_set_boolean(entry->value, value); + + return entry; +} + +XSettingsRegistry * +xsettings_registry_new (XfconfChannel *channel, Display *dpy, gint screen) +{ + Atom xsettings_atom = XInternAtom(dpy, "_XSETTINGS_SETTINGS", True); + + Window window = 0; + + window = XCreateSimpleWindow (dpy, + RootWindow (dpy, screen), + 0, 0, 10, 10, 0, + WhitePixel (dpy, screen), + WhitePixel (dpy, screen)); + if (!window) + { + g_critical( "no window"); + return NULL; + } + + GObject *object = g_object_new(XSETTINGS_REGISTRY_TYPE, + "channel", channel, + "display", dpy, + "screen", screen, + "xsettings_atom", xsettings_atom, + "window", window, + NULL); + gchar buffer[256]; + unsigned char c = 'a'; + TimeStampInfo info; + Atom timestamp_atom; + XEvent xevent; + + g_sprintf(buffer, "_XSETTINGS_S%d", screen); + Atom selection_atom = XInternAtom(dpy, buffer, True); + Atom manager_atom = XInternAtom(dpy, "MANAGER", True); + + info.timestamp_prop_atom = XInternAtom(dpy, "_TIMESTAMP_PROP", False); + info.window = window; + + XSelectInput (dpy, window, PropertyChangeMask); + + XChangeProperty (dpy, window, + info.timestamp_prop_atom, info.timestamp_prop_atom, + 8, PropModeReplace, &c, 1); + + XIfEvent (dpy, &xevent, + timestamp_predicate, (XPointer)&info); + + XSetSelectionOwner (dpy, selection_atom, + window, xevent.xproperty.time); + + if (XGetSelectionOwner (dpy, selection_atom) == + window) + { + XClientMessageEvent xev; + + xev.type = ClientMessage; + xev.window = RootWindow (dpy, screen); + xev.message_type = manager_atom; + xev.format = 32; + xev.data.l[0] = xevent.xproperty.time; + xev.data.l[1] = selection_atom; + xev.data.l[2] = window; + xev.data.l[3] = 0; /* manager specific data */ + xev.data.l[4] = 0; /* manager specific data */ + + XSendEvent (dpy, RootWindow (dpy, screen), + False, StructureNotifyMask, (XEvent *)&xev); + } + else + { + g_debug("fail"); + } + + return XSETTINGS_REGISTRY(object); +} + +static void +xsettings_registry_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *p_spec) +{ + switch(property_id) + { + case XSETTINGS_REGISTRY_PROPERTY_CHANNEL: + if (XSETTINGS_REGISTRY(object)->priv->channel) + { + XfconfChannel *channel = XSETTINGS_REGISTRY(object)->priv->channel; + + g_signal_handlers_disconnect_by_func(G_OBJECT(channel), (GCallback)cb_xsettings_registry_channel_property_changed, object); + XSETTINGS_REGISTRY(object)->priv->channel = NULL; + } + + XSETTINGS_REGISTRY(object)->priv->channel = g_value_get_object(value); + + if (XSETTINGS_REGISTRY(object)->priv->channel) + { + XfconfChannel *channel = XSETTINGS_REGISTRY(object)->priv->channel; + + g_signal_connect(G_OBJECT(channel), "property-changed", (GCallback)cb_xsettings_registry_channel_property_changed, object); + } + break; + case XSETTINGS_REGISTRY_PROPERTY_SCREEN: + XSETTINGS_REGISTRY(object)->priv->screen = g_value_get_int(value); + break; + case XSETTINGS_REGISTRY_PROPERTY_DISPLAY: + XSETTINGS_REGISTRY(object)->priv->display = g_value_get_pointer(value); + break; + case XSETTINGS_REGISTRY_PROPERTY_XSETTINGS_ATOM: + XSETTINGS_REGISTRY(object)->priv->xsettings_atom = g_value_get_long(value); + break; + case XSETTINGS_REGISTRY_PROPERTY_WINDOW: + XSETTINGS_REGISTRY(object)->priv->window = g_value_get_long(value); + break; + } + +} + +static void +xsettings_registry_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *p_spec) +{ + switch(property_id) + { + case XSETTINGS_REGISTRY_PROPERTY_CHANNEL: + g_value_set_object(value, XSETTINGS_REGISTRY(object)->priv->channel); + break; + case XSETTINGS_REGISTRY_PROPERTY_SCREEN: + g_value_set_int(value, XSETTINGS_REGISTRY(object)->priv->screen); + break; + case XSETTINGS_REGISTRY_PROPERTY_DISPLAY: + g_value_set_pointer(value, XSETTINGS_REGISTRY(object)->priv->display); + break; + case XSETTINGS_REGISTRY_PROPERTY_XSETTINGS_ATOM: + g_value_set_long(value, XSETTINGS_REGISTRY(object)->priv->xsettings_atom); + break; + case XSETTINGS_REGISTRY_PROPERTY_WINDOW: + g_value_set_long(value, XSETTINGS_REGISTRY(object)->priv->window); + break; + } + +} + +static Bool +timestamp_predicate (Display *display, + XEvent *xevent, + XPointer arg) +{ + TimeStampInfo *info = (TimeStampInfo *)arg; + + if (xevent->type == PropertyNotify && + xevent->xproperty.window == info->window && + xevent->xproperty.atom == info->timestamp_prop_atom) + return True; + + return False; +} + +gboolean +xsettings_registry_load(XSettingsRegistry *registry, gboolean debug) +{ + gint i; + XfconfChannel *channel = registry->priv->channel; + + for(i = 0; i < XSETTINGS_REGISTRY_SIZE ; ++i) + { + XSettingsRegistryEntry *entry = registry->priv->properties[i]; + + gchar *name = g_strconcat("/", entry->name, NULL); + + if (xfconf_channel_has_property(channel, name) == TRUE) + { + XSETTINGS_DEBUG_LOAD(entry->name); + switch (G_VALUE_TYPE(entry->value)) + { + case G_TYPE_INT: + g_value_set_int(entry->value, xfconf_channel_get_int(channel, name, g_value_get_int(entry->value))); + break; + case G_TYPE_STRING: + g_value_set_string(entry->value, xfconf_channel_get_string(channel, name, g_value_get_string(entry->value))); + break; + case G_TYPE_BOOLEAN: + g_value_set_boolean(entry->value, xfconf_channel_get_bool(channel, name, g_value_get_boolean(entry->value))); + break; + } + } + else + { + XSETTINGS_DEBUG_CREATE(entry->name); + + if(xfconf_channel_set_property(channel, name, entry->value)) + { + XSETTINGS_DEBUG("... OK\n"); + } + else + { + XSETTINGS_DEBUG("... FAIL\n"); + } + } + + g_free(name); + + } +} Added: xfconf/trunk/xfsettingsd/registry.h =================================================================== --- xfconf/trunk/xfsettingsd/registry.h (rev 0) +++ xfconf/trunk/xfsettingsd/registry.h 2008-04-02 22:25:36 UTC (rev 26778) @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2008 Stephan Arts + * + * 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 Library 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 __XSETTINGS_REGISTRY_H__ +#define __XSETTINGS_REGISTRY_H__ + +typedef struct _XSettingsRegistryEntry XSettingsRegistryEntry; + +struct _XSettingsRegistryEntry { + gchar *name; + GValue *value; + Atom atom; +}; + +#define XSETTINGS_REGISTRY_TYPE xsettings_registry_get_type() + +#define XSETTINGS_REGISTRY(obj) ( \ + G_TYPE_CHECK_INSTANCE_CAST ((obj), \ + XSETTINGS_REGISTRY_TYPE, \ + XSettingsRegistry)) + +#define XSETTINGS_IS_REGISTRY(obj) ( \ + G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ + XSETTINGS_REGISTRY_TYPE)) + +#define XSETTINGS_REGISTRY_CLASS(class) ( \ + G_TYPE_CHECK_CLASS_CAST ((class), \ + XSETTINGS_REGISTRY_TYPE, \ + XSettingsRegistryClass)) + +#define XSETTINGS_IS_REGISTRY_CLASS(class) ( \ + G_TYPE_CHECK_CLASS_TYPE ((class), \ + XSETTINGS_REGISTRY_TYPE)) + +#define XSETTINGS_REGISTRY_GET_CLASS(obj) ( \ + G_TYPE_INSTANCE_GET_CLASS ((obj), \ + XSETTINGS_REGISTRY_TYPE, \ + XSettingsRegistryClass)) + +typedef struct +{ + Window window; + Atom timestamp_prop_atom; +} TimeStampInfo; + + +typedef struct _XSettingsRegistryPriv XSettingsRegistryPriv; +typedef struct _XSettingsRegistry XSettingsRegistry; + +struct _XSettingsRegistry { + GObject parent; + XSettingsRegistryPriv *priv; +}; + +typedef struct _XSettingsRegistryClass XSettingsRegistryClass; + +struct _XSettingsRegistryClass { + GObjectClass parent_class; +}; + +GType xsettings_registry_get_type(); + +XSettingsRegistry * +xsettings_registry_new (XfconfChannel *channel, Display *dpy, gint screen); + +gboolean +xsettings_registry_load(XSettingsRegistry *registry, gboolean debug); +void +xsettings_registry_notify(XSettingsRegistry *registry); + +#endif /* __XSETTINGS_REGISTRY_H__ */ From stephan at xfce.org Thu Apr 3 00:37:45 2008 From: stephan at xfce.org (Stephan Arts) Date: Wed, 2 Apr 2008 22:37:45 +0000 (UTC) Subject: [Xfce4-commits] r26779 - xfconf/trunk/xfsettingsd Message-ID: <20080402223745.D0E4CF29D8@mocha.foo-projects.org> Author: stephan Date: 2008-04-02 22:37:45 +0000 (Wed, 02 Apr 2008) New Revision: 26779 Modified: xfconf/trunk/xfsettingsd/registry.c Log: Fixed the header information of the registry file. Modified: xfconf/trunk/xfsettingsd/registry.c =================================================================== --- xfconf/trunk/xfsettingsd/registry.c 2008-04-02 22:25:36 UTC (rev 26778) +++ xfconf/trunk/xfsettingsd/registry.c 2008-04-02 22:37:45 UTC (rev 26779) @@ -1,6 +1,25 @@ /* - * Copyright (c) 2008 Stephan Arts + * Copyright ? 2001 Red Hat, Inc. * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Red Hat not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. Red Hat makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT + * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Owen Taylor, Red Hat, Inc. + * * 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 @@ -15,8 +34,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * - * Based on the XSETTINGS spec written by Owen Taylor + * Stephan Arts : adapted to the "xfconf" concept */ #include From pollux at xfce.org Thu Apr 3 09:52:52 2008 From: pollux at xfce.org (Jean-François Wauthy) Date: Thu, 3 Apr 2008 07:52:52 +0000 (UTC) Subject: [Xfce4-commits] r26780 - in modules: trunk trunk-po Message-ID: <20080403075252.2FA40F29D8@mocha.foo-projects.org> Author: pollux Date: 2008-04-03 07:52:52 +0000 (Thu, 03 Apr 2008) New Revision: 26780 Modified: modules/trunk-po/ modules/trunk/ Log: fix svn:externals in modules/trunk and modules/trunk-po Property changes on: modules/trunk ___________________________________________________________________ Name: svn:externals - xfce4-dev-tools http://svn.xfce.org/svn/xfce/xfce4-dev-tools/trunk gtk-xfce-engine-2 http://svn.xfce.org/svn/xfce/gtk-xfce-engine-2/trunk libxfce4util http://svn.xfce.org/svn/xfce/libxfce4util/trunk libxfce4mcs http://svn.xfce.org/svn/xfce/libxfce4mcs/trunk libxfcegui4 http://svn.xfce.org/svn/xfce/libxfcegui4/trunk libxfce4ui http://svn.xfce.org/svn/xfce/libxfce4ui/trunk libexo http://svn.xfce.org/svn/xfce/libexo/trunk libxfce4menu http://svn.xfce.org/svn/xfce/libxfce4menu/trunk xfce-mcs-manager http://svn.xfce.org/svn/xfce/xfce-mcs-manager/trunk xfce-mcs-plugins http://svn.xfce.org/svn/xfce/xfce-mcs-plugins/trunk xfce4-panel http://svn.xfce.org/svn/xfce/xfce4-panel/trunk thunar http://svn.xfce.org/svn/xfce/thunar/trunk xfdesktop http://svn.xfce.org/svn/xfce/xfdesktop/trunk xfcalendar http://svn.xfce.org/svn/xfce/xfcalendar/trunk xfce-utils http://svn.xfce.org/svn/xfce/xfce-utils/trunk xfce4-appfinder http://svn.xfce.org/svn/xfce/xfce4-appfinder/trunk xfce4-mixer http://svn.xfce.org/svn/xfce/xfce4-mixer/trunk xfce4-session http://svn.xfce.org/svn/xfce/xfce4-session/trunk xfce4-terminal http://svn.xfce.org/svn/xfce/xfce4-terminal/trunk xfprint http://svn.xfce.org/svn/xfce/xfprint/trunk xfwm4 http://svn.xfce.org/svn/xfce/xfwm4/trunk xfwm4-themes http://svn.xfce.org/svn/xfce/xfwm4-themes/trunk mousepad http://svn.xfce.org/svn/xfce/mousepad/trunk squeeze/po http://svn.xfce.org/svn/xfce/squeeze/trunk/po xarchiver/po http://svn.xfce.org/svn/xfce/xarchiver/trunk/po terminal/po http://svn.xfce.org/svn/xfce/terminal/trunk/po xfburn/po http://svn.xfce.org/svn/xfce/xfburn/trunk/po xfmedia http://svn.xfce.org/svn/xfce/xfmedia/trunk xfce4-icon-theme http://svn.xfce.org/svn/xfce/xfce4-icon-theme/trunk xfce4-trigger-launcher http://svn.xfce.org/svn/xfce/xfce4-trigger-launcher/trunk + xfce4-dev-tools http://svn.xfce.org/svn/xfce/xfce4-dev-tools/trunk gtk-xfce-engine-2 http://svn.xfce.org/svn/xfce/gtk-xfce-engine-2/trunk libxfce4util http://svn.xfce.org/svn/xfce/libxfce4util/trunk libxfce4mcs http://svn.xfce.org/svn/xfce/libxfce4mcs/trunk libxfcegui4 http://svn.xfce.org/svn/xfce/libxfcegui4/trunk libxfce4ui http://svn.xfce.org/svn/xfce/libxfce4ui/trunk libexo http://svn.xfce.org/svn/xfce/libexo/trunk libxfce4menu http://svn.xfce.org/svn/xfce/libxfce4menu/trunk xfce-mcs-manager http://svn.xfce.org/svn/xfce/xfce-mcs-manager/trunk xfce-mcs-plugins http://svn.xfce.org/svn/xfce/xfce-mcs-plugins/trunk xfce4-panel http://svn.xfce.org/svn/xfce/xfce4-panel/trunk thunar http://svn.xfce.org/svn/xfce/thunar/trunk xfdesktop http://svn.xfce.org/svn/xfce/xfdesktop/trunk xfcalendar http://svn.xfce.org/svn/xfce/xfcalendar/trunk xfce-utils http://svn.xfce.org/svn/xfce/xfce-utils/trunk xfce4-appfinder http://svn.xfce.org/svn/xfce/xfce4-appfinder/trunk xfce4-mixer http://svn.xfce.org/svn/xfce/xfce4-mixer/trunk xfce4-session http://svn.xfce.org/svn/xfce/xfce4-session/trunk xfce4-terminal http://svn.xfce.org/svn/xfce/xfce4-terminal/trunk xfprint http://svn.xfce.org/svn/xfce/xfprint/trunk xfwm4 http://svn.xfce.org/svn/xfce/xfwm4/trunk xfwm4-themes http://svn.xfce.org/svn/xfce/xfwm4-themes/trunk mousepad http://svn.xfce.org/svn/xfce/mousepad/trunk squeeze http://svn.xfce.org/svn/xfce/squeeze/trunk xarchiver http://svn.xfce.org/svn/xfce/xarchiver/trunk terminal http://svn.xfce.org/svn/xfce/terminal/trunk xfmedia http://svn.xfce.org/svn/xfce/xfmedia/trunk xfce4-icon-theme http://svn.xfce.org/svn/xfce/xfce4-icon-theme/trunk xfce4-trigger-launcher http://svn.xfce.org/svn/xfce/xfce4-trigger-launcher/trunk Property changes on: modules/trunk-po ___________________________________________________________________ Name: svn:externals - libexo/po http://svn.xfce.org/svn/xfce/libexo/trunk/po libxfce4menu/po http://svn.xfce.org/svn/xfce/libxfce4menu/trunk/po libxfce4util/po http://svn.xfce.org/svn/xfce/libxfce4util/trunk/po libxfcegui4/po http://svn.xfce.org/svn/xfce/libxfcegui4/trunk/po libxfce4ui/po http://svn.xfce.org/svn/xfce/libxfce4ui/trunk/po mousepad/po http://svn.xfce.org/svn/xfce/mousepad/trunk/po squeeze/po http://svn.xfce.org/svn/xfce/squeeze/trunk/po terminal/po http://svn.xfce.org/svn/xfce/terminal/trunk/po thunar/po http://svn.xfce.org/svn/xfce/thunar/trunk/po xarchiver/po http://svn.xfce.org/svn/xfce/xarchiver/trunk/po xfburn/po http://svn.xfce.org/svn/xfce/xfburn/trunk/po xfcalendar/po http://svn.xfce.org/svn/xfce/xfcalendar/trunk/po xfce-mcs-manager/po http://svn.xfce.org/svn/xfce/xfce-mcs-manager/trunk/po xfce-mcs-plugins/po http://svn.xfce.org/svn/xfce/xfce-mcs-plugins/trunk/po xfce-utils/po http://svn.xfce.org/svn/xfce/xfce-utils/trunk/po xfce4-appfinder/po http://svn.xfce.org/svn/xfce/xfce4-appfinder/trunk/po xfce4-icon-theme/po http://svn.xfce.org/svn/xfce/xfce4-icon-theme/trunk/po xfce4-mixer/po http://svn.xfce.org/svn/xfce/xfce4-mixer/trunk/po xfce4-panel/po http://svn.xfce.org/svn/xfce/xfce4-panel/trunk/po xfce4-session/po http://svn.xfce.org/svn/xfce/xfce4-session/trunk/po xfdesktop/po http://svn.xfce.org/svn/xfce/xfdesktop/trunk/po xfmedia/po http://svn.xfce.org/svn/xfce/xfmedia/trunk/po xfprint/po http://svn.xfce.org/svn/xfce/xfprint/trunk/po xfwm4/po http://svn.xfce.org/svn/xfce/xfwm4/trunk/po xfce4-trigger-launcher/po http://svn.xfce.org/svn/xfce/xfce4-trigger-launcher/trunk/po + libexo/po http://svn.xfce.org/svn/xfce/libexo/trunk/po libxfce4menu/po http://svn.xfce.org/svn/xfce/libxfce4menu/trunk/po libxfce4util/po http://svn.xfce.org/svn/xfce/libxfce4util/trunk/po libxfcegui4/po http://svn.xfce.org/svn/xfce/libxfcegui4/trunk/po libxfce4ui/po http://svn.xfce.org/svn/xfce/libxfce4ui/trunk/po mousepad/po http://svn.xfce.org/svn/xfce/mousepad/trunk/po squeeze/po http://svn.xfce.org/svn/xfce/squeeze/trunk/po terminal/po http://svn.xfce.org/svn/xfce/terminal/trunk/po thunar/po http://svn.xfce.org/svn/xfce/thunar/trunk/po xarchiver/po http://svn.xfce.org/svn/xfce/xarchiver/trunk/po xfcalendar/po http://svn.xfce.org/svn/xfce/xfcalendar/trunk/po xfce-mcs-manager/po http://svn.xfce.org/svn/xfce/xfce-mcs-manager/trunk/po xfce-mcs-plugins/po http://svn.xfce.org/svn/xfce/xfce-mcs-plugins/trunk/po xfce-utils/po http://svn.xfce.org/svn/xfce/xfce-utils/trunk/po xfce4-appfinder/po http://svn.xfce.org/svn/xfce/xfce4-appfinder/trunk/po xfce4-icon-theme/po http://svn.xfce.org/svn/xfce/xfce4-icon-theme/trunk/po xfce4-mixer/po http://svn.xfce.org/svn/xfce/xfce4-mixer/trunk/po xfce4-panel/po http://svn.xfce.org/svn/xfce/xfce4-panel/trunk/po xfce4-session/po http://svn.xfce.org/svn/xfce/xfce4-session/trunk/po xfdesktop/po http://svn.xfce.org/svn/xfce/xfdesktop/trunk/po xfmedia/po http://svn.xfce.org/svn/xfce/xfmedia/trunk/po xfprint/po http://svn.xfce.org/svn/xfce/xfprint/trunk/po xfwm4/po http://svn.xfce.org/svn/xfce/xfwm4/trunk/po xfce4-trigger-launcher/po http://svn.xfce.org/svn/xfce/xfce4-trigger-launcher/trunk/po From kelnos at xfce.org Sat Apr 5 03:46:31 2008 From: kelnos at xfce.org (Brian Tarricone) Date: Sat, 5 Apr 2008 01:46:31 +0000 (UTC) Subject: [Xfce4-commits] r26781 - in xfconf/trunk: . xfsettingsd Message-ID: <20080405014631.9DA3DF29D8@mocha.foo-projects.org> Author: kelnos Date: 2008-04-05 01:46:31 +0000 (Sat, 05 Apr 2008) New Revision: 26781 Modified: xfconf/trunk/configure.ac.in xfconf/trunk/gtk-doc.make xfconf/trunk/xfsettingsd/Makefile.am xfconf/trunk/xfsettingsd/main.c xfconf/trunk/xfsettingsd/registry.c Log: make xfsettingsd build optional, clean up all warnings, xfce-ise it Modified: xfconf/trunk/configure.ac.in =================================================================== --- xfconf/trunk/configure.ac.in 2008-04-03 07:52:52 UTC (rev 26780) +++ xfconf/trunk/configure.ac.in 2008-04-05 01:46:31 UTC (rev 26781) @@ -64,12 +64,22 @@ dnl required XDT_CHECK_PACKAGE([GLIB], [gobject-2.0], [2.8.0]) -XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.10.0]) XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.4.0]) dnl XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.4.0]) XDT_CHECK_PACKAGE([DBUS], [dbus-1], [1.0.0]) XDT_CHECK_PACKAGE([DBUS_GLIB], [dbus-glib-1], [0.72]) +dnl make xsettings daemon optional (so gtk dep is optional) +AC_ARG_ENABLE([xsettings-daemon], + [AC_HELP_STRING([--disable-xsettings-daemon], + [Don't build the XSETTINGS daemon])], + [build_xfsettingsd=$enableval], + [build_xfsettingsd=yes]) +if test "x$build_xfsettingsd" = "xyes"; then + XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.10.0]) +fi +AM_CONDITIONAL([BUILD_XFSETTINGSD], [test "x$build_xfsettingsd" = "xyes"]) + dnl check alignment for struct returns AC_DEFUN([BT_GLIB_CHECK_ALIGNOF], [ Modified: xfconf/trunk/gtk-doc.make =================================================================== --- xfconf/trunk/gtk-doc.make 2008-04-03 07:52:52 UTC (rev 26780) +++ xfconf/trunk/gtk-doc.make 2008-04-05 01:46:31 UTC (rev 26781) @@ -5,11 +5,11 @@ #################################### if GTK_DOC_USE_LIBTOOL -GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS) -GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) +GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) else -GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS) -GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) +GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) endif # We set GPATH here; this gives us semantics for GNU make @@ -38,8 +38,13 @@ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals -CLEANFILES = $(SCANOBJ_FILES) $(DOC_MODULE)-unused.txt $(DOC_STAMPS) +REPORT_FILES = \ + $(DOC_MODULE)-undocumented.txt \ + $(DOC_MODULE)-undeclared.txt \ + $(DOC_MODULE)-unused.txt +CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) + if ENABLE_GTK_DOC all-local: html-build.stamp else @@ -79,6 +84,10 @@ tmpl.stamp: tmpl-build.stamp @true +tmpl/*.sgml: + @true + + #### xml #### sgml-build.stamp: tmpl.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) @@ -96,11 +105,11 @@ html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo 'gtk-doc: Building HTML' @-chmod -R u+w $(srcdir) - rm -rf $(srcdir)/html + rm -rf $(srcdir)/html mkdir $(srcdir)/html cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) - @echo 'gtk-doc: Fixing cross-references' + @echo 'gtk-doc: Fixing cross-references' cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) touch html-build.stamp @@ -110,11 +119,16 @@ rm -f *~ *.bak rm -rf .libs +distclean-local: + cd $(srcdir) && \ + rm -rf xml $(REPORT_FILES) \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + maintainer-clean-local: clean - cd $(srcdir) && rm -rf xml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + cd $(srcdir) && rm -rf xml html install-data-local: - installfiles=`echo $(srcdir)/html/*`; \ + -installfiles=`echo $(srcdir)/html/*`; \ if test "$$installfiles" = '$(srcdir)/html/*'; \ then echo '-- Nothing to install' ; \ else \ @@ -125,7 +139,10 @@ done; \ echo '-- Installing $(srcdir)/html/index.sgml' ; \ $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR) || :; \ + which gtkdoc-rebase >/dev/null && \ + gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) ; \ fi + uninstall-local: rm -f $(DESTDIR)$(TARGET_DIR)/* @@ -148,8 +165,9 @@ -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl -cp $(srcdir)/xml/*.xml $(distdir)/xml cp $(srcdir)/html/* $(distdir)/html - if test -f $(srcdir)/$(DOC_MODULE).types; then \ - cp $(srcdir)/$(DOC_MODULE).types $(distdir)/$(DOC_MODULE).types; \ - fi + -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ + -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ + cd $(distdir) && rm -f $(DISTCLEANFILES) + -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs Modified: xfconf/trunk/xfsettingsd/Makefile.am =================================================================== --- xfconf/trunk/xfsettingsd/Makefile.am 2008-04-03 07:52:52 UTC (rev 26780) +++ xfconf/trunk/xfsettingsd/Makefile.am 2008-04-05 01:46:31 UTC (rev 26781) @@ -1,3 +1,5 @@ +if BUILD_XFSETTINGSD + bin_PROGRAMS = xfsettingsd xfsettingsd_SOURCES = \ @@ -8,6 +10,7 @@ $(GTK_CFLAGS) \ $(GLIB_CFLAGS) \ $(DBUS_GLIB_CFLAGS) \ + $(LIBXFCE4UTIL_CFLAGS) \ -DDATADIR=\"$(datadir)\" \ -DSRCDIR=\"$(top_srcdir)\" \ -DLOCALEDIR=\"$(localedir)\" @@ -16,7 +19,10 @@ $(top_builddir)/xfconf/libxfconf-0.la \ $(GTK_LIBS) \ $(GLIB_LIBS) \ - $(DBUS_GLIB_LIBS) + $(DBUS_GLIB_LIBS) \ + $(LIBXFCE4UTIL_LIBS) INCLUDES = \ - -I${top_srcdir} + -I$(top_srcdir) + +endif Modified: xfconf/trunk/xfsettingsd/main.c =================================================================== --- xfconf/trunk/xfsettingsd/main.c 2008-04-03 07:52:52 UTC (rev 26780) +++ xfconf/trunk/xfsettingsd/main.c 2008-04-05 01:46:31 UTC (rev 26781) @@ -16,20 +16,22 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H #include +#endif + +#ifdef HAVE_UNISTD_H +#include +#endif + #include #include -#if defined(GETTEXT_PACKAGE) -#include -#else -#include -#endif - #include #include +#include #include #include "registry.h" @@ -92,7 +94,7 @@ Atom atom; gchar buffer[256]; - g_sprintf(buffer, "_XSETTINGS_S%d", screen); + g_snprintf(buffer, sizeof(buffer), "_XSETTINGS_S%d", screen); atom = XInternAtom((Display *)display, buffer, False); if (XGetSelectionOwner((Display *)display, atom)) @@ -106,17 +108,9 @@ int main(int argc, char **argv) { - Atom selection_atom; - Atom xsettings_atom; - Atom manager_atom; - GError *cli_error = NULL; - #ifdef ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); - textdomain (GETTEXT_PACKAGE); - #endif + xfce_textdomain(GETTEXT_PACKAGE, LOCALEDIR, "UTF-8"); if(!gtk_init_with_args(&argc, &argv, _(""), entries, PACKAGE, &cli_error)) { @@ -188,4 +182,6 @@ XDestroyWindow (gdk_display, window); xfconf_shutdown(); } + + return 0; } Modified: xfconf/trunk/xfsettingsd/registry.c =================================================================== --- xfconf/trunk/xfsettingsd/registry.c 2008-04-03 07:52:52 UTC (rev 26780) +++ xfconf/trunk/xfsettingsd/registry.c 2008-04-05 01:46:31 UTC (rev 26781) @@ -264,7 +264,7 @@ entry = registry->priv->properties[i]; gint name_len = XSETTINGS_PAD(strlen(entry->name), 4); - gint value_len; + gint value_len = 0; switch (G_VALUE_TYPE(entry->value)) { @@ -426,10 +426,9 @@ gchar buffer[256]; unsigned char c = 'a'; TimeStampInfo info; - Atom timestamp_atom; XEvent xevent; - g_sprintf(buffer, "_XSETTINGS_S%d", screen); + g_snprintf(buffer, sizeof(buffer), "_XSETTINGS_S%d", screen); Atom selection_atom = XInternAtom(dpy, buffer, True); Atom manager_atom = XInternAtom(dpy, "MANAGER", True); @@ -597,4 +596,6 @@ g_free(name); } + + return TRUE; } From olivier at xfce.org Sat Apr 5 11:56:37 2008 From: olivier at xfce.org (Olivier Fourdan) Date: Sat, 5 Apr 2008 09:56:37 +0000 (UTC) Subject: [Xfce4-commits] r26782 - xfwm4/trunk/src Message-ID: <20080405095637.E38C9F29D8@mocha.foo-projects.org> Author: olivier Date: 2008-04-05 09:56:37 +0000 (Sat, 05 Apr 2008) New Revision: 26782 Modified: xfwm4/trunk/src/client.c xfwm4/trunk/src/client.h xfwm4/trunk/src/compositor.c xfwm4/trunk/src/events.c xfwm4/trunk/src/focus.c xfwm4/trunk/src/frame.c xfwm4/trunk/src/frame.h xfwm4/trunk/src/netwm.c Log: Implements asynchronous frames update Modified: xfwm4/trunk/src/client.c =================================================================== --- xfwm4/trunk/src/client.c 2008-04-05 01:46:31 UTC (rev 26781) +++ xfwm4/trunk/src/client.c 2008-04-05 09:56:37 UTC (rev 26782) @@ -206,7 +206,7 @@ g_free (c->name); c->name = name; FLAG_SET (c->flags, CLIENT_FLAG_NAME_CHANGED); - frameQueueDraw (c); + frameQueueDraw (c, TRUE); } } } @@ -281,7 +281,7 @@ } if (mask & UPDATE_FRAME) { - frameDraw (c, TRUE); + frameQueueDraw (c, TRUE); } } @@ -325,7 +325,7 @@ if (c != clientGetFocus ()) { FLAG_TOGGLE (c->xfwm_flags, XFWM_FLAG_SEEN_ACTIVE); - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); } return (TRUE); } @@ -341,7 +341,7 @@ if (c->blink_timeout_id) { g_source_remove (c->blink_timeout_id); - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); } FLAG_UNSET (c->wm_flags, WM_FLAG_URGENT); @@ -363,7 +363,7 @@ && (c != clientGetFocus ())) { FLAG_UNSET (c->xfwm_flags, XFWM_FLAG_SEEN_ACTIVE); - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); } } @@ -663,7 +663,7 @@ if (WIN_RESIZED || (flags & CFG_FORCE_REDRAW)) { - frameDraw (c, (flags & CFG_FORCE_REDRAW)); + frameQueueDraw (c, (flags & CFG_FORCE_REDRAW)); } change_values.x = frameLeft (c); @@ -1106,7 +1106,7 @@ } else if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_IS_RESIZABLE) != previous_value) { - frameQueueDraw (c); + frameQueueDraw (c, FALSE); } } else @@ -1536,7 +1536,7 @@ { clientUnstick (c, TRUE); } - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); } } else if ((action & WIN_STATE_MAXIMIZED) @@ -1656,7 +1656,7 @@ clientUpdateIconPix (c); if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_VISIBLE)) { - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); } c->icon_timeout_id = 0; @@ -1770,7 +1770,7 @@ c->size = NULL; c->flags = 0L; c->wm_flags = 0L; - c->xfwm_flags = CLIENT_FLAG_INITIAL_VALUES; + c->xfwm_flags = XFWM_FLAG_INITIAL_VALUES; c->x = attr.x; c->y = attr.y; c->width = attr.width; @@ -1839,7 +1839,10 @@ c->opacity_applied = c->opacity; c->opacity_flags = 0; - c->opacity_locked = getOpacityLock (display_info, c->window); + if (getOpacityLock (display_info, c->window)) + { + FLAG_SET (c->xfwm_flags, XFWM_FLAG_OPACITY_LOCKED); + } /* Timout for asynchronous icon update */ c->icon_timeout_id = 0; @@ -3045,7 +3048,7 @@ c->win_state &= ~WIN_STATE_MAXIMIZED; FLAG_UNSET (c->flags, CLIENT_FLAG_MAXIMIZED); - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); clientSetNetState (c); } @@ -3498,7 +3501,7 @@ c->opacity_flags = (c->opacity_flags & ~clear) ^ xor; - if (c->opacity_locked) + if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_OPACITY_LOCKED)) { applied = c->opacity; } @@ -3548,7 +3551,7 @@ return; } - if ((c->opacity > OPACITY_SET_MIN) && !(c->opacity_locked )) + if ((c->opacity > OPACITY_SET_MIN) && !(FLAG_TEST (c->xfwm_flags, XFWM_FLAG_OPACITY_LOCKED))) { clientSetOpacity (c, c->opacity - OPACITY_SET_STEP, 0, 0); } @@ -3568,7 +3571,7 @@ return; } - if ((c->opacity < NET_WM_OPAQUE) && !(c->opacity_locked )) + if ((c->opacity < NET_WM_OPAQUE) && !(FLAG_TEST (c->xfwm_flags, XFWM_FLAG_OPACITY_LOCKED))) { guint opacity = c->opacity + OPACITY_SET_STEP; @@ -4342,7 +4345,9 @@ #endif /* SHOW_POSITION */ /* Set window translucent while moving, looks nice */ - if ((screen_info->params->move_opacity < 100) && !(screen_info->params->box_move) && !(c->opacity_locked)) + if ((screen_info->params->move_opacity < 100) && + !(screen_info->params->box_move) && + !FLAG_TEST (c->xfwm_flags, XFWM_FLAG_OPACITY_LOCKED)) { clientSetOpacity (c, c->opacity, OPACITY_MOVE, OPACITY_MOVE); } @@ -4906,7 +4911,9 @@ #endif /* HAVE_XSYNC */ /* Set window translucent while resizing, doesn't looks too nice :( */ - if ((screen_info->params->resize_opacity < 100) && !(screen_info->params->box_resize) && !(c->opacity_locked)) + if ((screen_info->params->resize_opacity < 100) && + !(screen_info->params->box_resize) && + !FLAG_TEST (c->xfwm_flags, XFWM_FLAG_OPACITY_LOCKED)) { clientSetOpacity (c, c->opacity, OPACITY_RESIZE, OPACITY_RESIZE); } @@ -5234,14 +5241,14 @@ if ((xevent->xcrossing.mode != NotifyGrab) && (xevent->xcrossing.mode != NotifyUngrab)) { c->button_status[b] = BUTTON_STATE_PRESSED; - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); } break; case LeaveNotify: if ((xevent->xcrossing.mode != NotifyGrab) && (xevent->xcrossing.mode != NotifyUngrab)) { c->button_status[b] = BUTTON_STATE_NORMAL; - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); } break; case ButtonRelease: @@ -5314,7 +5321,7 @@ passdata.b = b; c->button_status[b] = BUTTON_STATE_PRESSED; - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); TRACE ("entering button press loop"); eventFilterPush (display_info->xfilter, clientButtonPressEventFilter, &passdata); @@ -5376,7 +5383,7 @@ default: break; } - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); } } Modified: xfwm4/trunk/src/client.h =================================================================== --- xfwm4/trunk/src/client.h 2008-04-05 01:46:31 UTC (rev 26781) +++ xfwm4/trunk/src/client.h 2008-04-05 09:56:37 UTC (rev 26782) @@ -124,6 +124,8 @@ #define XFWM_FLAG_FIRST_MAP (1L<<19) #define XFWM_FLAG_LEGACY_FULLSCREEN (1L<<20) #define XFWM_FLAG_MOVING_RESIZING (1L<<21) +#define XFWM_FLAG_NEEDS_REDRAW (1L<<22) +#define XFWM_FLAG_OPACITY_LOCKED (1L<<23) #define CLIENT_FLAG_HAS_STRUT (1L<<0) #define CLIENT_FLAG_HAS_STRUT_PARTIAL (1L<<1) @@ -152,7 +154,7 @@ #define WM_FLAG_CONTEXT_HELP (1L<<3) #define WM_FLAG_URGENT (1L<<4) -#define CLIENT_FLAG_INITIAL_VALUES XFWM_FLAG_HAS_BORDER | \ +#define XFWM_FLAG_INITIAL_VALUES XFWM_FLAG_HAS_BORDER | \ XFWM_FLAG_HAS_MENU | \ XFWM_FLAG_HAS_MAXIMIZE | \ XFWM_FLAG_HAS_STICK | \ @@ -160,7 +162,8 @@ XFWM_FLAG_HAS_CLOSE | \ XFWM_FLAG_HAS_MOVE | \ XFWM_FLAG_HAS_RESIZE | \ - XFWM_FLAG_FIRST_MAP + XFWM_FLAG_FIRST_MAP | \ + XFWM_FLAG_NEEDS_REDRAW #define ALL_WORKSPACES (int) 0xFFFFFFFF @@ -292,7 +295,6 @@ guint opacity; guint opacity_applied; guint opacity_flags; - gboolean opacity_locked; #ifdef HAVE_LIBSTARTUP_NOTIFICATION /* Startup notification */ Modified: xfwm4/trunk/src/compositor.c =================================================================== --- xfwm4/trunk/src/compositor.c 2008-04-05 01:46:31 UTC (rev 26781) +++ xfwm4/trunk/src/compositor.c 2008-04-05 09:56:37 UTC (rev 26782) @@ -1869,7 +1869,7 @@ cw->native_opacity = FALSE; if (c) { - cw->opacity_locked = c->opacity_locked; + cw->opacity_locked = FLAG_TEST (c->xfwm_flags, XFWM_FLAG_OPACITY_LOCKED); cw->opacity = c->opacity_applied; cw->native_opacity = WIN_IS_OPAQUE(cw); } @@ -2269,7 +2269,14 @@ cw->opacity_locked = getOpacityLock (display_info, cw->id); if (cw->c) { - cw->c->opacity_locked = cw->opacity_locked; + if (cw->opacity_locked) + { + FLAG_SET (cw->c->xfwm_flags, XFWM_FLAG_OPACITY_LOCKED); + } + else + { + FLAG_UNSET (cw->c->xfwm_flags, XFWM_FLAG_OPACITY_LOCKED); + } } } } Modified: xfwm4/trunk/src/events.c =================================================================== --- xfwm4/trunk/src/events.c 2008-04-05 01:46:31 UTC (rev 26781) +++ xfwm4/trunk/src/events.c 2008-04-05 09:56:37 UTC (rev 26782) @@ -404,7 +404,7 @@ if (CLIENT_CAN_STICK_WINDOW(c)) { clientToggleSticky (c, TRUE); - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); } break; case KEY_RAISE_WINDOW: @@ -1528,7 +1528,7 @@ } if (need_redraw) { - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); } } /* No need to process the event any further */ @@ -1682,7 +1682,7 @@ } if (need_redraw) { - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); } /* No need to process the event any further */ @@ -1968,7 +1968,7 @@ { TRACE ("client \"%s\" (0x%lx) has received a NET_WM_WINDOW_TYPE notify", c->name, c->window); clientGetNetWmType (c); - frameQueueDraw (c); + frameQueueDraw (c, TRUE); } else if ((ev->atom == display_info->atoms[NET_WM_STRUT]) || (ev->atom == display_info->atoms[NET_WM_STRUT_PARTIAL])) @@ -2009,7 +2009,14 @@ else if (ev->atom == display_info->atoms[NET_WM_WINDOW_OPACITY_LOCKED]) { TRACE ("client \"%s\" (0x%lx) has received a NET_WM_OPACITY_LOCKED notify", c->name, c->window); - c->opacity_locked = getOpacityLock (display_info, c->window); + if (getOpacityLock (display_info, c->window)) + { + FLAG_SET (c->xfwm_flags, XFWM_FLAG_OPACITY_LOCKED); + } + else + { + FLAG_UNSET (c->xfwm_flags, XFWM_FLAG_OPACITY_LOCKED); + } } else if ((screen_info->params->show_app_icon) && ((ev->atom == display_info->atoms[NET_WM_ICON]) || @@ -2129,7 +2136,7 @@ if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_HAS_STICK) && !FLAG_TEST (c->flags, CLIENT_FLAG_STICKY)) { clientStick (c, TRUE); - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); } } else @@ -2137,7 +2144,7 @@ if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_HAS_STICK) && FLAG_TEST (c->flags, CLIENT_FLAG_STICKY)) { clientUnstick (c, TRUE); - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); } if (ev->data.l[0] != c->win_workspace) { @@ -2328,7 +2335,7 @@ } if (!update) { - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); } } @@ -2568,11 +2575,11 @@ { clientHide (c, c->win_workspace, TRUE); } - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); break; case MENU_OP_MINIMIZE_ALL: clientHideAll (c, c->win_workspace); - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); break; case MENU_OP_UNMINIMIZE: clientShow (c, TRUE); @@ -2585,26 +2592,26 @@ case MENU_OP_STICK: case MENU_OP_UNSTICK: clientToggleSticky (c, TRUE); - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); break; case MENU_OP_WORKSPACES: clientSetWorkspace (c, GPOINTER_TO_INT (item_data), TRUE); - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); break; case MENU_OP_DELETE: - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); clientClose (c); break; case MENU_OP_CONTEXT_HELP: clientEnterContextMenuState (c); - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); break; case MENU_OP_ABOVE: case MENU_OP_NORMAL: clientToggleAbove (c); /* Fall thru */ default: - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); break; } } @@ -2642,7 +2649,7 @@ y = py; c->button_status[MENU_BUTTON] = BUTTON_STATE_PRESSED; - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); y = (gdouble) c->y; ops = MENU_OP_DELETE | MENU_OP_MINIMIZE_ALL | MENU_OP_WORKSPACES; insensitive = 0; @@ -2789,7 +2796,7 @@ TRACE ("Cannot open menu"); gdk_beep (); c->button_status[MENU_BUTTON] = BUTTON_STATE_NORMAL; - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); xfwmWindowDelete (&menu_event_window); menu_free (menu); } Modified: xfwm4/trunk/src/focus.c =================================================================== --- xfwm4/trunk/src/focus.c 2008-04-05 01:46:31 UTC (rev 26781) +++ xfwm4/trunk/src/focus.c 2008-04-05 09:56:37 UTC (rev 26782) @@ -468,7 +468,7 @@ } data[0] = c->window; clientAdjustFullscreenLayer (c, TRUE); - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); } else { @@ -481,7 +481,7 @@ clientAdjustFullscreenLayer (c2, FALSE); /* clientRaise (c, None); */ } - frameDraw (c2, FALSE); + frameQueueDraw (c2, FALSE); } data[1] = None; XChangeProperty (display_info->dpy, screen_info->xroot, @@ -572,7 +572,7 @@ if (c2) { - frameDraw (c2, FALSE); + frameQueueDraw (c2, FALSE); XChangeProperty (clientGetXDisplay (c2), c2->screen_info->xroot, display_info->atoms[NET_ACTIVE_WINDOW], XA_WINDOW, 32, PropModeReplace, (unsigned char *) data, 2); } Modified: xfwm4/trunk/src/frame.c =================================================================== --- xfwm4/trunk/src/frame.c 2008-04-05 01:46:31 UTC (rev 26781) +++ xfwm4/trunk/src/frame.c 2008-04-05 09:56:37 UTC (rev 26782) @@ -831,7 +831,7 @@ } void -frameDraw (Client * c, gboolean clear_all) +frameDraw (Client * c) { ScreenInfo *screen_info; FramePixmap frame_pix; @@ -891,18 +891,12 @@ FLAG_UNSET (c->xfwm_flags, XFWM_FLAG_FIRST_MAP); /* Cache mgmt */ - if (clear_all) + if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_NEEDS_REDRAW)) { width_changed = TRUE; height_changed = TRUE; requires_clearing = TRUE; frameClearQueueDraw (c); - if (c->frame_timeout_id) - { - g_source_remove (c->frame_timeout_id); - c->frame_timeout_id = 0; - } - } else { @@ -917,6 +911,7 @@ c->previous_height = c->height; } } + FLAG_UNSET (c->xfwm_flags, XFWM_FLAG_NEEDS_REDRAW); if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_HAS_BORDER) && !FLAG_TEST (c->flags, CLIENT_FLAG_FULLSCREEN)) @@ -1185,7 +1180,7 @@ c = (Client *) data; g_return_val_if_fail (c, FALSE); - frameDraw (c, TRUE); + frameDraw (c); c->frame_timeout_id = 0; return FALSE; @@ -1206,12 +1201,22 @@ } void -frameQueueDraw (Client * c) +frameQueueDraw (Client * c, gboolean clear_all) { g_return_if_fail (c); TRACE ("entering frameQueueDraw for \"%s\" (0x%lx)", c->name, c->window); + /* Reschedule update */ + if (c->frame_timeout_id) + { + frameClearQueueDraw (c); + } + if (clear_all) + { + FLAG_SET (c->xfwm_flags, XFWM_FLAG_NEEDS_REDRAW); + } + /* Otherwise leave previous schedule */ if (c->frame_timeout_id == 0) { c->frame_timeout_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, Modified: xfwm4/trunk/src/frame.h =================================================================== --- xfwm4/trunk/src/frame.h 2008-04-05 01:46:31 UTC (rev 26781) +++ xfwm4/trunk/src/frame.h 2008-04-05 09:56:37 UTC (rev 26782) @@ -42,9 +42,9 @@ int frameY (Client *); int frameWidth (Client *); int frameHeight (Client *); -void frameDraw (Client *, +void frameDraw (Client *); +void frameClearQueueDraw (Client *); +void frameQueueDraw (Client *, gboolean); -void frameClearQueueDraw (Client *); -void frameQueueDraw (Client *); #endif /* INC_FRAME_H */ Modified: xfwm4/trunk/src/netwm.c =================================================================== --- xfwm4/trunk/src/netwm.c 2008-04-05 01:46:31 UTC (rev 26781) +++ xfwm4/trunk/src/netwm.c 2008-04-05 09:56:37 UTC (rev 26782) @@ -331,7 +331,7 @@ { clientToggleSticky (c, TRUE); } - frameDraw (c, FALSE); + frameQueueDraw (c, FALSE); } } @@ -411,7 +411,7 @@ clientSetNetState (c); clientWindowType (c); } - frameDraw (c, TRUE); + frameQueueDraw (c, TRUE); } if ((first == display_info->atoms[NET_WM_STATE_FULLSCREEN]) || @@ -524,7 +524,7 @@ FLAG_TOGGLE (c->flags, CLIENT_FLAG_SKIP_TASKBAR); clientSetNetState (c); } - frameDraw (c, TRUE); + frameQueueDraw (c, TRUE); } if ((first == display_info->atoms[NET_WM_STATE_DEMANDS_ATTENTION]) || From colossus at xfce.org Sat Apr 5 17:19:41 2008 From: colossus at xfce.org (Giuseppe Torelli) Date: Sat, 5 Apr 2008 15:19:41 +0000 (UTC) Subject: [Xfce4-commits] r26783 - in xarchiver/trunk: . src Message-ID: <20080405151941.8695FF29D8@mocha.foo-projects.org> Author: colossus Date: 2008-04-05 15:19:41 +0000 (Sat, 05 Apr 2008) New Revision: 26783 Modified: xarchiver/trunk/INSTALL xarchiver/trunk/configure.in.in xarchiver/trunk/depcomp xarchiver/trunk/install-sh xarchiver/trunk/missing xarchiver/trunk/src/Makefile.am xarchiver/trunk/src/main.c xarchiver/trunk/src/mime.c xarchiver/trunk/src/mime.h xarchiver/trunk/src/window.c Log: Applied big patch from PCMan for using its libmimetype. Made Xarchiver to extract rar archives containing filenames with spaces and #()[] chars. Modified: xarchiver/trunk/INSTALL =================================================================== --- xarchiver/trunk/INSTALL 2008-04-05 09:56:37 UTC (rev 26782) +++ xarchiver/trunk/INSTALL 2008-04-05 15:19:41 UTC (rev 26783) @@ -1,8 +1,8 @@ Installation Instructions ************************* -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free -Software Foundation, Inc. +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006, 2007 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. @@ -10,7 +10,10 @@ Basic Installation ================== -These are generic installation instructions. +Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses @@ -23,9 +26,9 @@ It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. (Caching is +the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale -cache files.) +cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail @@ -35,20 +38,17 @@ may remove or edit it. The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You only need -`configure.ac' if you want to change it or regenerate `configure' using -a newer version of `autoconf'. +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. + `./configure' to configure the package for your system. - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. 2. Type `make' to compile the package. @@ -67,6 +67,9 @@ all sorts of other programs in order to regenerate files that came with the distribution. + 6. Often, you can also type `make uninstall' to remove the installed + files again. + Compilers and Options ===================== @@ -78,7 +81,7 @@ by setting variables in the command line or in the environment. Here is an example: - ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. @@ -87,17 +90,15 @@ You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the +own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. - If you have to use a `make' that does not support the `VPATH' -variable, you have to compile the package for one architecture at a -time in the source code directory. After you have installed the -package for one architecture, use `make distclean' before reconfiguring -for another architecture. + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. Installation Names ================== @@ -190,12 +191,12 @@ ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). Here is a another example: +overridden in the site shell script). - /bin/bash ./configure CONFIG_SHELL=/bin/bash +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: -Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent -configuration-related scripts to be executed by `/bin/bash'. + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== Modified: xarchiver/trunk/configure.in.in =================================================================== --- xarchiver/trunk/configure.in.in 2008-04-05 09:56:37 UTC (rev 26782) +++ xarchiver/trunk/configure.in.in 2008-04-05 15:19:41 UTC (rev 26783) @@ -57,6 +57,21 @@ AC_DISABLE_STATIC() AC_PROG_LIBTOOL() + +dnl *********************************** +dnl *** Enable new features provided by libmime-type *** +dnl *********************************** +AC_ARG_ENABLE( + [libmimetype], + AS_HELP_STRING([--enable-libmimetype], + [use new libmimetype instead of xdgmime (default: yes)]), + use_libmimetype=$enableval, use_libmimetype="yes") + echo "CHECK!!! use_libmimetype" "$use_libmimetype" +if test x"$use_libmimetype" = x"yes"; then + AC_DEFINE([USE_MIMETYPE], [1], [Define to 1 if libmimetype is used.]) +fi +AM_CONDITIONAL(USE_LIBMIMETYPE, test x"$use_libmimetype" = x"yes") + dnl *********************************************** dnl *** Work-around system-specific limitations *** dnl *********************************************** @@ -93,6 +108,7 @@ po/Makefile.in src/Makefile src/xdgmime/Makefile +src/mime-type/Makefile doc/Makefile icons/Makefile icons/16x16/Makefile Modified: xarchiver/trunk/depcomp =================================================================== --- xarchiver/trunk/depcomp 2008-04-05 09:56:37 UTC (rev 26782) +++ xarchiver/trunk/depcomp 2008-04-05 15:19:41 UTC (rev 26783) @@ -1,9 +1,10 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2005-07-09.11 +scriptversion=2007-03-29.01 -# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software +# Foundation, Inc. # 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 @@ -91,7 +92,20 @@ ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. - "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" stat=$? if test $stat -eq 0; then : else @@ -201,34 +215,39 @@ # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. - stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` - tmpdepfile="$stripped.u" + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u "$@" -M fi stat=$? - if test -f "$tmpdepfile"; then : - else - stripped=`echo "$stripped" | sed 's,^.*/,,'` - tmpdepfile="$stripped.u" - fi - if test $stat -eq 0; then : else - rm -f "$tmpdepfile" + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done if test -f "$tmpdepfile"; then - outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" - sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile @@ -276,6 +295,46 @@ rm -f "$tmpdepfile" ;; +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. @@ -288,13 +347,13 @@ if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a - # static library. This mecanism is used in libtool 1.4 series to + # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in in $dir.libs/$base.o.d and + # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is Modified: xarchiver/trunk/install-sh =================================================================== --- xarchiver/trunk/install-sh 2008-04-05 09:56:37 UTC (rev 26782) +++ xarchiver/trunk/install-sh 2008-04-05 15:19:41 UTC (rev 26783) @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2005-05-14.22 +scriptversion=2006-12-25.00 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -39,38 +39,68 @@ # when there is no Makefile. # # This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. +# from scratch. +nl=' +' +IFS=" "" $nl" + # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi -# put in absolute paths if you don't have them in your path; or use env. vars. +# Put in absolute file names if you don't have them in your path; +# or use environment vars. -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} -chmodcmd="$chmodprog 0755" +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog chowncmd= -chgrpcmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" stripcmd= -rmcmd="$rmprog -f" -mvcmd="$mvprog" + src= dst= dir_arg= -dstarg= +dst_arg= + +copy_on_change=false no_target_directory= -usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... @@ -80,81 +110,86 @@ In the 4th, create DIRECTORIES. Options: --c (ignored) --d create directories instead of installing files. --g GROUP $chgrpprog installed files to GROUP. --m MODE $chmodprog installed files to MODE. --o USER $chownprog installed files to USER. --s $stripprog installed files. --t DIRECTORY install into DIRECTORY. --T report an error if DSTFILE is a directory. ---help display this help and exit. ---version display version info and exit. + --help display this help and exit. + --version display version info and exit. + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG " -while test -n "$1"; do +while test $# -ne 0; do case $1 in - -c) shift - continue;; + -c) ;; - -d) dir_arg=true - shift - continue;; + -C) copy_on_change=true;; + -d) dir_arg=true;; + -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; + shift;; --help) echo "$usage"; exit $?;; - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -o) chowncmd="$chownprog $2" - shift - shift - continue;; + shift;; - -s) stripcmd=$stripprog - shift - continue;; + -s) stripcmd=$stripprog;; - -t) dstarg=$2 - shift - shift - continue;; + -t) dst_arg=$2 + shift;; - -T) no_target_directory=true - shift - continue;; + -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; - *) # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - test -n "$dir_arg$dstarg" && break - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dstarg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dstarg" - shift # fnord - fi - shift # arg - dstarg=$arg - done + --) shift break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; esac + shift done -if test -z "$1"; then +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + done +fi + +if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 @@ -164,24 +199,47 @@ exit 0 fi +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + for src do # Protect names starting with `-'. case $src in - -*) src=./$src ;; + -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src - src= + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else - if test -d "$dst"; then - mkdircmd=: - chmodcmd= - else - mkdircmd=$mkdirprog - fi - else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. @@ -190,71 +248,199 @@ exit 1 fi - if test -z "$dstarg"; then + if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi - dst=$dstarg + dst=$dst_arg # Protect names starting with `-'. case $dst in - -*) dst=./$dst ;; + -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then - echo "$0: $dstarg: Is a directory" >&2 + echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi - dst=$dst/`basename "$src"` + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? fi fi - # This sed command emulates the dirname command. - dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` + obsolete_mkdir_used=false - # Make sure that the destination directory exists. + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - # Skip lots of stat calls in the usual case. - if test ! -d "$dstdir"; then - defaultIFS=' - ' - IFS="${IFS-$defaultIFS}" + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac - oIFS=$IFS - # Some sh's can't handle IFS=/ for some reason. - IFS='%' - set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` - shift - IFS=$oIFS + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi - pathcomp= + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - while test $# -ne 0 ; do - pathcomp=$pathcomp$1 + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + -*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir shift - if test ! -d "$pathcomp"; then - $mkdirprog "$pathcomp" - # mkdir can fail with a `File exist' error in case several - # install-sh are creating the directory concurrently. This - # is OK. - test -d "$pathcomp" || exit + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true fi - pathcomp=$pathcomp/ - done + fi fi if test -n "$dir_arg"; then - $doit $mkdircmd "$dst" \ - && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ - && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ - && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } - + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else - dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ @@ -262,10 +448,9 @@ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. - $doit $cpprog "$src" "$dsttmp" && + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # @@ -273,48 +458,59 @@ # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ - && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ - && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - # Now rename the file to the real destination. - { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ - || { - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - if test -f "$dstdir/$dstfile"; then - $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ - || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ - || { - echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 - (exit 1); exit 1 - } - else - : - fi - } && + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" - } - } - fi || { (exit 1); exit 1; } + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi done -# The final little trick to "correctly" pass the exit status to the exit trap. -{ - (exit 0); exit 0 -} - # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" Modified: xarchiver/trunk/missing =================================================================== --- xarchiver/trunk/missing 2008-04-05 09:56:37 UTC (rev 26782) +++ xarchiver/trunk/missing 2008-04-05 15:19:41 UTC (rev 26783) @@ -1,9 +1,9 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2005-06-08.21 +scriptversion=2006-05-10.23 -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. @@ -33,6 +33,8 @@ fi run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. @@ -44,7 +46,7 @@ msg="missing on your system" -case "$1" in +case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= @@ -77,6 +79,7 @@ aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c @@ -106,7 +109,7 @@ # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). -case "$1" in +case $1 in lex|yacc) # Not GNU programs, they don't have --version. ;; @@ -135,7 +138,7 @@ # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. -case "$1" in +case $1 in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if @@ -164,7 +167,7 @@ test -z "$files" && files="config.h" touch_files= for f in $files; do - case "$f" in + case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; @@ -192,8 +195,8 @@ You can get \`$1' as part of \`Autoconf' from any GNU archive site." - file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` - test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else @@ -214,25 +217,25 @@ in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h - if [ $# -ne 1 ]; then + if test $# -ne 1; then eval LASTARG="\${$#}" - case "$LASTARG" in + case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if [ -f "$SRCFILE" ]; then + if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if [ -f "$SRCFILE" ]; then + if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi - if [ ! -f y.tab.h ]; then + if test ! -f y.tab.h; then echo >y.tab.h fi - if [ ! -f y.tab.c ]; then + if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; @@ -244,18 +247,18 @@ in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c - if [ $# -ne 1 ]; then + if test $# -ne 1; then eval LASTARG="\${$#}" - case "$LASTARG" in + case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if [ -f "$SRCFILE" ]; then + if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi - if [ ! -f lex.yy.c ]; then + if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; @@ -267,11 +270,9 @@ \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` - fi - if [ -f "$file" ]; then + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then touch $file else test -z "$file" || exec >$file @@ -289,11 +290,17 @@ DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi @@ -317,13 +324,13 @@ fi firstarg="$1" if shift; then - case "$firstarg" in + case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac - case "$firstarg" in + case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 Modified: xarchiver/trunk/src/Makefile.am =================================================================== --- xarchiver/trunk/src/Makefile.am 2008-04-05 09:56:37 UTC (rev 26782) +++ xarchiver/trunk/src/Makefile.am 2008-04-05 15:19:41 UTC (rev 26783) @@ -1,7 +1,15 @@ bin_PROGRAMS = xarchiver -SUBDIRS = xdgmime +if USE_LIBMIMETYPE +MIME_TYPE_DIR = mime-type +MIME_LIB = $(top_builddir)/src/mime-type/libmimetype.la +else +MIME_TYPE_DIR = xdgmime +MIME_LIB = $(top_builddir)/src/xdgmime/libxdgmime.la +endif +SUBDIRS = $(MIME_TYPE_DIR) + xarchiver_SOURCES = \ socket.c socket.h \ main.c main.h \ @@ -24,7 +32,8 @@ extract_dialog.c extract_dialog.h \ add_dialog.c add_dialog.h \ new_dialog.c new_dialog.h \ - pref_dialog.c pref_dialog.h + pref_dialog.c pref_dialog.h \ + glib-mem.h xarchiver_CFLAGS = \ @GTK_CFLAGS@ \ @@ -34,7 +43,7 @@ -DLOCALEDIR=\"$(localedir)\" xarchiver_LDADD = \ - $(top_builddir)/src/xdgmime/libxdgmime.la \ + $(MIME_LIB) \ @GTK_LIBS@ \ @GLIB_LIBS@ Modified: xarchiver/trunk/src/main.c =================================================================== --- xarchiver/trunk/src/main.c 2008-04-05 09:56:37 UTC (rev 26782) +++ xarchiver/trunk/src/main.c 2008-04-05 15:19:41 UTC (rev 26783) @@ -19,6 +19,7 @@ #include "config.h" #include "main.h" #include "string_utils.h" +#include "mime.h" #ifdef HAVE_SOCKET #include "socket.h" @@ -92,6 +93,8 @@ if (ask_and_extract || ask_and_add || archive_name != NULL || extract_path != NULL) cli = TRUE; + xa_mime_type_init(); /* initialize mime-type cache */ + xa_get_available_archivers(); prefs_window = xa_create_prefs_dialog(); xa_prefs_load_options(prefs_window); Modified: xarchiver/trunk/src/mime.c =================================================================== --- xarchiver/trunk/src/mime.c 2008-04-05 09:56:37 UTC (rev 26782) +++ xarchiver/trunk/src/mime.c 2008-04-05 15:19:41 UTC (rev 26783) @@ -16,17 +16,86 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * */ +#ifdef HAVE_CONFIG_H +#include +#endif +#include "glib-mem.h" /* provide compatibility macros for g_slice */ #include "mime.h" -GSList *icon_cache = NULL; +typedef struct _XAMimeType +{ + char* name; + char* icon_name; + char* desc; + GdkPixbuf* icon; +}XAMimeType; +static GHashTable *mime_cache = NULL; +static GdkPixbuf *folder_icon = NULL; +static GdkPixbuf *lock_icon = NULL; + +static xa_mime_type_free( XAMimeType* type ) +{ + g_free( type->name ); + g_free( type->icon_name ); + g_free( type->desc ); + if( type->icon ) + g_object_unref( type->icon ); + g_slice_free( XAMimeType, type ); +} + +void xa_mime_type_init() +{ +#ifdef USE_MIMETYPE +/* + GtkIconTheme * theme; + MimeCache** caches; + int i, n_caches; +*/ + mime_type_init(); + +#if 0 + /* install file alteration monitor for mime-cache */ + caches = mime_type_get_caches( &n_caches ); + mime_caches_monitor = g_new0( VFSFileMonitor*, n_caches ); + for( i = 0; i < n_caches; ++i ) + { + VFSFileMonitor* fm = vfs_file_monitor_add_file( caches[i]->file_path, + on_mime_cache_changed, caches[i] ); + mime_caches_monitor[i] = fm; + } + theme = gtk_icon_theme_get_default(); + theme_change_notify = g_signal_connect( theme, "changed", + G_CALLBACK( on_icon_theme_changed ), + NULL ); +#endif + +#endif + + mime_cache = g_hash_table_new_full( g_str_hash, g_str_equal, + NULL, xa_mime_type_free ); + +} + +static XAMimeType* lookup_mime_type( const char* name ) +{ + XAMimeType* type; + type = (XAMimeType*)g_hash_table_lookup( mime_cache, name ); + if( G_UNLIKELY( ! type ) ) + { + type = g_slice_new0( XAMimeType ); + type->name = g_strdup( name ); + g_hash_table_insert( mime_cache, type->name, type); + } + return type; +} + const char *xa_get_stock_mime_icon(char *filename) { const char *mime; const char *icon_name = "binary"; - mime = xdg_mime_get_mime_type_from_file_name(filename); //g_print ("%s\t%s\n",filename,mime); if (strstr(filename,".ogg") || strstr(filename,".flac") ) icon_name = "sound"; @@ -67,58 +136,89 @@ GdkPixbuf *xa_get_pixbuf_icon_from_cache(gchar *filename) { - pixbuf_cache *tie = NULL; - const gchar *icon_name; - GSList *found = NULL; - GdkPixbuf *pixbuf = NULL; + char icon_name[ 100 ]; + const char* mime_type; + XAMimeType* mime; if (strcmp(filename,"folder") == 0) - icon_name = filename; + { + if( G_LIKELY( folder_icon ) ) + return (GdkPixbuf*)g_object_ref( folder_icon ); + folder_icon = gtk_icon_theme_load_icon(icon_theme,"folder", 20, 0, NULL); + if( G_UNLIKELY( ! folder_icon ) ) + folder_icon = gtk_icon_theme_load_icon(icon_theme,"gnome-fs-directory", 20, 0, NULL); + return folder_icon ? (GdkPixbuf*)g_object_ref( folder_icon ) : NULL; + } else if (strcmp(filename,"lock") == 0) - icon_name = "gtk-dialog-authentication"; + { + if( G_LIKELY( lock_icon ) ) + return (GdkPixbuf*)g_object_ref( lock_icon ); + lock_icon = gtk_icon_theme_load_icon(icon_theme,GTK_STOCK_DIALOG_AUTHENTICATION, 20, 0,NULL); + return lock_icon ? (GdkPixbuf*)g_object_ref( lock_icon ) : NULL; + } else - icon_name = xa_get_stock_mime_icon(filename); - - tie = g_new0(pixbuf_cache,1); - if (tie) { - tie->icon_name = g_strdup(icon_name); - found = g_slist_find_custom(icon_cache,tie,(GCompareFunc)xa_icon_name_compare_func); - if (found) + char* sep; + GdkPixbuf* icon = NULL; +#ifdef USE_MIMETYPE + mime_type = mime_type_get_by_filename(filename, NULL); +#else + mime_type = xdg_mime_get_mime_type_from_file_name(filename); +#endif + if( mime_type ) { - g_free (tie->icon_name); - g_free (tie); - return ((pixbuf_cache *)found->data)->pixbuf; + mime = lookup_mime_type( mime_type ); + + if( mime->icon ) + return (GdkPixbuf*)g_object_ref( mime->icon ); + + sep = strchr( mime->name, '/' ); + if ( sep ) + { + strcpy( icon_name, mime->name ); + icon_name[ (sep - mime->name) ] = '-'; + icon = gtk_icon_theme_load_icon ( icon_theme, icon_name, 20, 0, NULL ); + if ( ! icon ) + { + strcpy( icon_name, "gnome-mime-" ); + strncat( icon_name, mime->name, ( sep - mime->name ) ); + strcat( icon_name, "-" ); + strcat( icon_name, sep + 1 ); + icon = gtk_icon_theme_load_icon ( icon_theme, icon_name, 20, 0, NULL ); + } + if ( G_UNLIKELY( ! icon ) ) + { + icon_name[ 11 ] = 0; + strncat( icon_name, mime->name, ( sep - mime->name ) ); + icon = gtk_icon_theme_load_icon ( icon_theme, icon_name, 20, 0, NULL ); + } + } } - else + + if( G_UNLIKELY( !icon ) ) { - pixbuf = gtk_icon_theme_load_icon(icon_theme,icon_name,16,GTK_ICON_LOOKUP_FORCE_SVG,NULL); - if (pixbuf) + const char* fallback = xa_get_stock_mime_icon(filename); + icon = gtk_icon_theme_load_icon ( icon_theme, fallback, 20, 0, NULL ); + } + if( G_UNLIKELY( !icon ) ) + { + /* prevent endless recursion of XDG_MIME_TYPE_UNKNOWN */ + if( G_LIKELY( strcmp(mime->name, XDG_MIME_TYPE_UNKNOWN) ) ) { - tie->pixbuf = pixbuf; - icon_cache = g_slist_prepend(icon_cache,tie); + /* FIXME: fallback to icon of parent mime-type */ + icon = xa_get_pixbuf_icon_from_cache( XDG_MIME_TYPE_UNKNOWN ); } + else /* unknown */ + icon = gtk_icon_theme_load_icon ( icon_theme, "unknown", 20, 0, NULL ); } + + mime->icon = icon; + return (GdkPixbuf*)g_object_ref( icon ); } - return pixbuf; + return NULL; } -gint xa_icon_name_compare_func(pixbuf_cache *a, pixbuf_cache *b) -{ - return strcmp(a->icon_name, b->icon_name); -} - void xa_free_icon_cache() { - GSList *x = icon_cache; - - while (x) - { - pixbuf_cache *tie = x->data; - g_free (tie->icon_name); - g_object_unref (tie->pixbuf); - g_free(tie); - x = x->next; - } - g_slist_free(icon_cache); + g_hash_table_destroy( mime_cache ); } Modified: xarchiver/trunk/src/mime.h =================================================================== --- xarchiver/trunk/src/mime.h 2008-04-05 09:56:37 UTC (rev 26782) +++ xarchiver/trunk/src/mime.h 2008-04-05 15:19:41 UTC (rev 26783) @@ -38,4 +38,6 @@ GdkPixbuf *xa_get_pixbuf_icon_from_cache(gchar *filename); gint xa_icon_name_compare_func(pixbuf_cache *a, pixbuf_cache *b); void xa_free_icon_cache(); +void xa_mime_type_init(); + #endif Modified: xarchiver/trunk/src/window.c =================================================================== --- xarchiver/trunk/src/window.c 2008-04-05 09:56:37 UTC (rev 26782) +++ xarchiver/trunk/src/window.c 2008-04-05 15:19:41 UTC (rev 26783) @@ -1599,7 +1599,8 @@ quoted_filename = g_shell_quote(filename); if (archive->status != XA_ARCHIVESTATUS_ADD && archive->type != XARCHIVETYPE_TAR - && archive->type != XARCHIVETYPE_TAR_BZ2 && archive->type != XARCHIVETYPE_TAR_GZ) + && archive->type != XARCHIVETYPE_TAR_BZ2 && archive->type != XARCHIVETYPE_TAR_GZ + && archive->type != XARCHIVETYPE_RAR) { if (strstr(filename,"[") || strstr(filename,"]")) { @@ -1665,7 +1666,7 @@ { gtk_widget_set_sensitive (delete_menu,value); //TODO: disable the popupmenu entries - //gtk_widget_set_sensitive (ddelete,value); + //gtk_widget_set_sensitive (delete,value); gtk_widget_set_sensitive (View_button,value); gtk_widget_set_sensitive (view_menu,value); } From kelnos at xfce.org Sat Apr 5 17:58:37 2008 From: kelnos at xfce.org (Brian Tarricone) Date: Sat, 5 Apr 2008 15:58:37 +0000 (UTC) Subject: [Xfce4-commits] r26784 - xfconf/trunk/xfconf Message-ID: <20080405155837.0BB19F29D8@mocha.foo-projects.org> Author: kelnos Date: 2008-04-05 15:58:36 +0000 (Sat, 05 Apr 2008) New Revision: 26784 Modified: xfconf/trunk/xfconf/xfconf.h Log: add missing xfconf-types.h include to main header Modified: xfconf/trunk/xfconf/xfconf.h =================================================================== --- xfconf/trunk/xfconf/xfconf.h 2008-04-05 15:19:41 UTC (rev 26783) +++ xfconf/trunk/xfconf/xfconf.h 2008-04-05 15:58:36 UTC (rev 26784) @@ -26,6 +26,7 @@ #include #include +#include G_BEGIN_DECLS From kelnos at xfce.org Mon Apr 7 10:48:59 2008 From: kelnos at xfce.org (Brian Tarricone) Date: Mon, 7 Apr 2008 08:48:59 +0000 (UTC) Subject: [Xfce4-commits] r26785 - xfconf/trunk Message-ID: <20080407084859.2BCC6F29D8@mocha.foo-projects.org> Author: kelnos Date: 2008-04-07 08:48:58 +0000 (Mon, 07 Apr 2008) New Revision: 26785 Modified: xfconf/trunk/AUTHORS Log: add stephan to AUTHORS Modified: xfconf/trunk/AUTHORS =================================================================== --- xfconf/trunk/AUTHORS 2008-04-05 15:58:36 UTC (rev 26784) +++ xfconf/trunk/AUTHORS 2008-04-07 08:48:58 UTC (rev 26785) @@ -1 +1,2 @@ Brian J. Tarricone +Stephan Arts From kelnos at xfce.org Mon Apr 7 10:49:10 2008 From: kelnos at xfce.org (Brian Tarricone) Date: Mon, 7 Apr 2008 08:49:10 +0000 (UTC) Subject: [Xfce4-commits] r26786 - in xfconf/trunk: docs/reference/tmpl tests xfconfd Message-ID: <20080407084910.4995CF29D8@mocha.foo-projects.org> Author: kelnos Date: 2008-04-07 08:49:10 +0000 (Mon, 07 Apr 2008) New Revision: 26786 Added: xfconf/trunk/tests/t-property-changed-signal.c Modified: xfconf/trunk/docs/reference/tmpl/xfconf-backend.sgml xfconf/trunk/tests/Makefile.am xfconf/trunk/xfconfd/xfconf-backend-perchannel-xml.c xfconf/trunk/xfconfd/xfconf-backend.c xfconf/trunk/xfconfd/xfconf-backend.h xfconf/trunk/xfconfd/xfconf-daemon.c Log: make the PropertyChanged signal work Modified: xfconf/trunk/docs/reference/tmpl/xfconf-backend.sgml =================================================================== --- xfconf/trunk/docs/reference/tmpl/xfconf-backend.sgml 2008-04-07 08:48:58 UTC (rev 26785) +++ xfconf/trunk/docs/reference/tmpl/xfconf-backend.sgml 2008-04-07 08:49:10 UTC (rev 26786) @@ -34,6 +34,7 @@ @remove: See xfconf_backend_remove(). @remove_channel: See xfconf_backend_remove_channel(). @flush: See xfconf_backend_flush(). + at register_property_changed_func: See xfconf_backend_register_property_changed_func(). @_xb_reserved0: Reserved for future expansion. @_xb_reserved1: Reserved for future expansion. @_xb_reserved2: Reserved for future expansion. Modified: xfconf/trunk/tests/Makefile.am =================================================================== --- xfconf/trunk/tests/Makefile.am 2008-04-07 08:48:58 UTC (rev 26785) +++ xfconf/trunk/tests/Makefile.am 2008-04-07 08:49:10 UTC (rev 26786) @@ -2,13 +2,15 @@ t-set-properties.sh \ t-has-properties.sh \ t-get-properties.sh \ - t-remove-properties.sh + t-remove-properties.sh \ + t-property-changed-signal.sh check_PROGRAMS = \ t-set-properties \ t-has-properties \ t-get-properties \ - t-remove-properties + t-remove-properties \ + t-property-changed-signal check_SCRIPTS = $(test_scripts) @@ -26,6 +28,7 @@ t_has_properties_SOURCES = t-has-properties.c tests-common.h t_get_properties_SOURCES = t-get-properties.c tests-common.h t_remove_properties_SOURCES = t-remove-properties.c tests-common.h +t_property_changed_signal_SOURCES = t-property-changed-signal.c tests-common.h %.sh: test-template.sh.in Makefile sed -e 's/@TEST_NAME@/$@/; s/\.sh//;' <$(srcdir)/test-template.sh.in >$@ Added: xfconf/trunk/tests/t-property-changed-signal.c =================================================================== --- xfconf/trunk/tests/t-property-changed-signal.c (rev 0) +++ xfconf/trunk/tests/t-property-changed-signal.c 2008-04-07 08:49:10 UTC (rev 26786) @@ -0,0 +1,73 @@ +/* + * xfconf + * + * Copyright (c) 2007 Brian Tarricone + * + * 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; version 2 of the License ONLY. + * + * 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 Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "tests-common.h" + +typedef struct +{ + GMainLoop *mloop; + gboolean got_signal; +} SignalTestData; + +static void +test_signal_changed(XfconfChannel *channel, + const gchar *property, + gpointer user_data) +{ + SignalTestData *std = user_data; + std->got_signal = TRUE; + g_main_loop_quit(std->mloop); +} + +static gboolean +test_watchdog(gpointer data) +{ + SignalTestData *std = data; + g_main_loop_quit(std->mloop); + return FALSE; +} + +int +main(int argc, + char **argv) +{ + XfconfChannel *channel; + SignalTestData std = { NULL, FALSE }; + + std.mloop = g_main_loop_new(NULL, FALSE); + + if(!xfconf_tests_start()) + return 1; + + channel = xfconf_channel_new(TEST_CHANNEL_NAME); + g_signal_connect(G_OBJECT(channel), "property-changed", + G_CALLBACK(test_signal_changed), &std); + + TEST_OPERATION(xfconf_channel_set_string(channel, test_string_property, test_string)); + + g_timeout_add(1500, test_watchdog, &std); + g_main_loop_run(std.mloop); + + g_main_loop_unref(std.mloop); + g_object_unref(G_OBJECT(channel)); + + xfconf_tests_end(); + + return std.got_signal ? 0 : 1; +} Modified: xfconf/trunk/xfconfd/xfconf-backend-perchannel-xml.c =================================================================== --- xfconf/trunk/xfconfd/xfconf-backend-perchannel-xml.c 2008-04-07 08:48:58 UTC (rev 26785) +++ xfconf/trunk/xfconfd/xfconf-backend-perchannel-xml.c 2008-04-07 08:49:10 UTC (rev 26786) @@ -99,6 +99,9 @@ guint save_id; GList *dirty_channels; + + XfconfPropertyChangedFunc prop_changed_func; + gpointer prop_changed_data; }; typedef struct _XfconfBackendPerchannelXmlClass @@ -176,6 +179,9 @@ GError **error); static gboolean xfconf_backend_perchannel_xml_flush(XfconfBackend *backend, GError **error); +static void xfconf_backend_perchannel_xml_register_property_changed_func(XfconfBackend *backend, + XfconfPropertyChangedFunc func, + gpointer user_data); static void xfconf_backend_perchannel_xml_schedule_save(XfconfBackendPerchannelXml *xbpx, const gchar *channel); @@ -255,6 +261,7 @@ iface->remove = xfconf_backend_perchannel_xml_remove; iface->remove_channel = xfconf_backend_perchannel_xml_remove_channel; iface->flush = xfconf_backend_perchannel_xml_flush; + iface->register_property_changed_func = xfconf_backend_perchannel_xml_register_property_changed_func; } static gboolean @@ -327,8 +334,16 @@ g_value_unset(&cur_prop->value); g_value_copy(value, g_value_init(&cur_prop->value, G_VALUE_TYPE(value))); - } else + + /* FIXME: this will trigger if the value is replaced by the same + * value */ + if(xbpx->prop_changed_func) + xbpx->prop_changed_func(backend, channel, property, xbpx->prop_changed_data); + } else { xfconf_proptree_add_property(properties, property, value, FALSE); + if(xbpx->prop_changed_func) + xbpx->prop_changed_func(backend, channel, property, xbpx->prop_changed_data); + } xfconf_backend_perchannel_xml_schedule_save(xbpx, channel); @@ -499,6 +514,9 @@ } return FALSE; } + + if(xbpx->prop_changed_func) + xbpx->prop_changed_func(backend, channel, property, xbpx->prop_changed_data); xfconf_backend_perchannel_xml_schedule_save(xbpx, channel); @@ -538,6 +556,9 @@ return FALSE; } g_free(filename); + + /* FIXME: do we want to do a PropertyChanged for each property + * in the channel? or should we add a ChannelRemoved signal? */ return TRUE; } @@ -557,8 +578,19 @@ return TRUE; } +static void +xfconf_backend_perchannel_xml_register_property_changed_func(XfconfBackend *backend, + XfconfPropertyChangedFunc func, + gpointer user_data) +{ + XfconfBackendPerchannelXml *xbpx = XFCONF_BACKEND_PERCHANNEL_XML(backend); + xbpx->prop_changed_func = func; + xbpx->prop_changed_data = user_data; +} + + static GNode * xfconf_proptree_lookup_node(GNode *proptree, const gchar *name) Modified: xfconf/trunk/xfconfd/xfconf-backend.c =================================================================== --- xfconf/trunk/xfconfd/xfconf-backend.c 2008-04-07 08:48:58 UTC (rev 26785) +++ xfconf/trunk/xfconfd/xfconf-backend.c 2008-04-07 08:49:10 UTC (rev 26786) @@ -309,3 +309,27 @@ return iface->flush(backend, error); } + +/** + * xfconf_backend_register_property_changed_func: + * @backend: The #XfconfBackend. + * @func: A function of type #XfconfPropertyChangeFunc. + * @user_data: Arbitrary caller-supplied data. + * + * Registers a function to be called when a property changes. The + * backend implementation should keep a pointer to @func and @user_data + * and call @func when a property in the configuration store changes. + **/ +void +xfconf_backend_register_property_changed_func(XfconfBackend *backend, + XfconfPropertyChangedFunc func, + gpointer user_data) +{ + XfconfBackendInterface *iface = XFCONF_BACKEND_GET_INTERFACE(backend); + + g_return_if_fail(iface); + if(!iface->register_property_changed_func) + return; + + iface->register_property_changed_func(backend, func, user_data); +} Modified: xfconf/trunk/xfconfd/xfconf-backend.h =================================================================== --- xfconf/trunk/xfconfd/xfconf-backend.h 2008-04-07 08:48:58 UTC (rev 26785) +++ xfconf/trunk/xfconfd/xfconf-backend.h 2008-04-07 08:49:10 UTC (rev 26786) @@ -52,6 +52,11 @@ typedef struct _XfconfBackend XfconfBackend; typedef struct _XfconfBackendInterface XfconfBackendInterface; +typedef void (*XfconfPropertyChangedFunc)(XfconfBackend *backend, + const gchar *channel, + const gchar *property, + gpointer user_data); + struct _XfconfBackendInterface { GTypeInterface parent; @@ -93,6 +98,10 @@ gboolean (*flush)(XfconfBackend *backend, GError **error); + + void (*register_property_changed_func)(XfconfBackend *backend, + XfconfPropertyChangedFunc func, + gpointer user_data); /*< reserved