reduce static data

2007-07-01  Jens Granseuer  <jensgr@gmx.net>

	* gnome-settings-accessibility-keyboard.c:
	(gnome_settings_module_accessibility_keyboard_get_type):
	* gnome-settings-background.c:
	(gnome_settings_module_background_get_type):
	* gnome-settings-clipboard.c:
	(gnome_settings_module_clipboard_get_type):
	* gnome-settings-default-editor.c:
	(gnome_settings_module_default_editor_get_type):
	* gnome-settings-font.c: (gnome_settings_module_font_get_type):
	* gnome-settings-gtk1theme.c:
	(gnome_settings_module_gtk1_get_type):
	* gnome-settings-keybindings.c:
	(gnome_settings_module_keybindings_get_type):
	* gnome-settings-keyboard.c:
	(gnome_settings_module_keyboard_get_type):
	* gnome-settings-module.c: (gnome_settings_module_get_type):
	* gnome-settings-mouse.c: (gnome_settings_module_mouse_get_type):
	* gnome-settings-multimedia-keys.c:
	(gnome_settings_module_multimedia_keys_get_type):
	* gnome-settings-screensaver.c:
	(gnome_settings_module_screensaver_get_type):
	* gnome-settings-sound.c: (gnome_settings_module_sound_get_type):
	* gnome-settings-typing-break.c:
	(gnome_settings_module_typing_break_get_type):
	* gnome-settings-xrdb.c: (gnome_settings_module_xrdb_get_type):
	* gnome-settings-xsettings.c:
	(gnome_settings_module_xsettings_get_type): reduce static data

svn path=/trunk/; revision=7813
This commit is contained in:
Jens Granseuer 2007-07-01 15:56:19 +00:00 committed by Jens Granseuer
parent d69ad6a3fc
commit e73cddb29f
17 changed files with 222 additions and 192 deletions

View file

@ -1,3 +1,33 @@
2007-07-01 Jens Granseuer <jensgr@gmx.net>
* gnome-settings-accessibility-keyboard.c:
(gnome_settings_module_accessibility_keyboard_get_type):
* gnome-settings-background.c:
(gnome_settings_module_background_get_type):
* gnome-settings-clipboard.c:
(gnome_settings_module_clipboard_get_type):
* gnome-settings-default-editor.c:
(gnome_settings_module_default_editor_get_type):
* gnome-settings-font.c: (gnome_settings_module_font_get_type):
* gnome-settings-gtk1theme.c:
(gnome_settings_module_gtk1_get_type):
* gnome-settings-keybindings.c:
(gnome_settings_module_keybindings_get_type):
* gnome-settings-keyboard.c:
(gnome_settings_module_keyboard_get_type):
* gnome-settings-module.c: (gnome_settings_module_get_type):
* gnome-settings-mouse.c: (gnome_settings_module_mouse_get_type):
* gnome-settings-multimedia-keys.c:
(gnome_settings_module_multimedia_keys_get_type):
* gnome-settings-screensaver.c:
(gnome_settings_module_screensaver_get_type):
* gnome-settings-sound.c: (gnome_settings_module_sound_get_type):
* gnome-settings-typing-break.c:
(gnome_settings_module_typing_break_get_type):
* gnome-settings-xrdb.c: (gnome_settings_module_xrdb_get_type):
* gnome-settings-xsettings.c:
(gnome_settings_module_xsettings_get_type): reduce static data
2007-07-01 Jens Granseuer <jensgr@gmx.net>
* factory.c: (main):

View file

@ -71,7 +71,7 @@ gnome_settings_module_accessibility_keyboard_get_type (void)
static GType module_type = 0;
if (!module_type) {
static const GTypeInfo module_info = {
const GTypeInfo module_info = {
sizeof (GnomeSettingsModuleAccessibilityKeyboardClass),
NULL, /* base_init */
NULL, /* base_finalize */
@ -176,7 +176,7 @@ set_int (GConfClient *client, GConfChangeSet *cs,
char const *key, int val)
{
gconf_change_set_set_int (cs, key, val);
#ifdef DEBUG_ACCESSIBILITY
#ifdef DEBUG_ACCESSIBILITY
if (val != gconf_client_get_int (client, key, NULL)) {
g_warning ("%s changed", key);
}
@ -366,7 +366,7 @@ ax_response_callback (gint response_id, guint revert_controls_mask, gboolean ena
d ("cancelling AccessX request");
if (revert_controls_mask == XkbStickyKeysMask) {
success = gconf_client_set_bool (client, CONFIG_ROOT "/stickykeys_enable", !enabled, &err);
if (err != NULL)
if (err != NULL)
g_error_free (err);
}
if (revert_controls_mask == XkbSlowKeysMask) {
@ -389,7 +389,7 @@ ax_response_callback (gint response_id, guint revert_controls_mask, gboolean ena
0,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
_("There was an error displaying help: %s"),
_("There was an error displaying help: %s"),
err->message);
g_signal_connect (G_OBJECT (error_dialog),
"response",
@ -465,7 +465,7 @@ ax_slowkeys_warning_dialog_post (gboolean enabled)
_("Slow Keys Alert"),
_("You just held down the Shift key for 8 seconds. This is the shortcut "
"for the Slow Keys feature, which affects the way your keyboard works."),
enabled ? _("Do you want to activate Slow Keys?") :
enabled ? _("Do you want to activate Slow Keys?") :
_("Do you want to deactivate Slow Keys?"),
enabled ? _("_Activate") : _("_Deactivate"),
enabled ? _("Do_n't activate") : _("Do_n't deactivate"));
@ -479,10 +479,10 @@ ax_stickykeys_warning_dialog_post (gboolean enabled)
&stickykeys_shortcut_val,
_("Sticky Keys Alert"),
enabled ? _("You just pressed the Shift key 5 times in a row. This is the shortcut "
"for the Sticky Keys feature, which affects the way your keyboard works.") :
"for the Sticky Keys feature, which affects the way your keyboard works.") :
_("You just pressed two keys at once, or pressed the Shift key 5 times in a row. "
"This turns off the Sticky Keys feature, which affects the way your keyboard works."),
enabled ? _("Do you want to activate Sticky Keys?") :
enabled ? _("Do you want to activate Sticky Keys?") :
_("Do you want to deactivate Sticky Keys?"),
enabled ? _("_Activate") : _("_Deactivate"),
enabled ? _("Do_n't activate") : _("Do_n't deactivate"));
@ -553,7 +553,7 @@ set_gconf_from_server (GConfEntry *ignored)
desc->ctrls->slow_keys_delay);
stickykeys_changed = set_bool (client, cs, in_gconf, CONFIG_ROOT "/stickykeys_enable",
desc->ctrls->enabled_ctrls & XkbStickyKeysMask);
desc->ctrls->enabled_ctrls & XkbStickyKeysMask);
changed |= set_bool (client, cs, TRUE, CONFIG_ROOT "/stickykeys_two_key_off",
desc->ctrls->ax_options & XkbAX_TwoKeysMask);
changed |= set_bool (client, cs, TRUE, CONFIG_ROOT "/stickykeys_modifier_beep",
@ -563,10 +563,10 @@ set_gconf_from_server (GConfEntry *ignored)
desc->ctrls->ax_options & XkbAX_IndicatorFBMask);
if (!changed && stickykeys_changed^slowkeys_changed) {
/*
/*
* sticky or slowkeys has changed, singly, without our intervention.
* 99% chance this is due to a keyboard shortcut being used.
* we need to detect via this hack until we get
* we need to detect via this hack until we get
* XkbAXN_AXKWarning notifications working (probable XKB bug),
* at which time we can directly intercept such shortcuts instead.
* See cb_xkb_event_filter () below.
@ -575,7 +575,7 @@ set_gconf_from_server (GConfEntry *ignored)
/* sanity check: are keyboard shortcuts available? */
if (desc->ctrls->enabled_ctrls & XkbAccessXKeysMask) {
if (slowkeys_changed)
ax_slowkeys_warning_dialog_post (desc->ctrls->enabled_ctrls & XkbSlowKeysMask);
ax_slowkeys_warning_dialog_post (desc->ctrls->enabled_ctrls & XkbSlowKeysMask);
else
ax_stickykeys_warning_dialog_post (desc->ctrls->enabled_ctrls & XkbStickyKeysMask);
}
@ -592,7 +592,7 @@ set_gconf_from_server (GConfEntry *ignored)
gconf_change_set_unref (cs);
}
static GdkFilterReturn
static GdkFilterReturn
cb_xkb_event_filter (GdkXEvent *xevent, GdkEvent *ignored1, gpointer ignored2)
{
XEvent *xev = (XEvent *) xevent;
@ -607,8 +607,8 @@ cb_xkb_event_filter (GdkXEvent *xevent, GdkEvent *ignored1, gpointer ignored2)
xkbEv->any.xkb_type == XkbAccessXNotify) {
if (xkbEv->accessx.detail == XkbAXN_AXKWarning) {
d ("About to turn on an AccessX feature from the keyboard!");
/*
* TODO: when XkbAXN_AXKWarnings start working, we need to
/*
* TODO: when XkbAXN_AXKWarnings start working, we need to
* invoke ax_keys_warning_dialog_run here instead of in
* set_gconf_from_server().
*/
@ -630,7 +630,7 @@ static gboolean
gnome_settings_module_accessibility_keyboard_start (GnomeSettingsModule *module)
{
guint event_mask = XkbControlsNotifyMask;
#ifdef DEBUG_ACCESSIBILITY
#ifdef DEBUG_ACCESSIBILITY
event_mask = XkbControlsNotifyMask | XkbAccessXNotifyMask; /* make default when AXN_AXKWarning works */
#endif

View file

@ -63,9 +63,9 @@ applier_idle (gpointer data)
{
GnomeSettingsModuleBackground *module;
int i;
module = (GnomeSettingsModuleBackground *) data;
for (i = 0; module->bg_appliers [i]; i++)
bg_applier_apply_prefs (module->bg_appliers [i], module->prefs);
module->applier_idle_id = 0;
@ -76,12 +76,12 @@ static void
background_callback (GConfClient *client,
guint cnxn_id,
GConfEntry *entry,
gpointer user_data)
gpointer user_data)
{
GnomeSettingsModuleBackground *module_bg;
module_bg = (GnomeSettingsModuleBackground *) user_data;
bg_preferences_merge_entry (module_bg->prefs, entry);
if (module_bg->applier_idle_id != 0) {
@ -95,7 +95,7 @@ static void
gnome_settings_module_background_class_init (GnomeSettingsModuleBackgroundClass *klass)
{
GnomeSettingsModuleClass *module_class;
module_class = (GnomeSettingsModuleClass *) klass;
module_class->get_runlevel = gnome_settings_module_background_get_runlevel;
module_class->initialize = gnome_settings_module_background_initialize;
@ -112,9 +112,9 @@ GType
gnome_settings_module_background_get_type (void)
{
static GType module_type = 0;
if (!module_type) {
static const GTypeInfo module_info = {
const GTypeInfo module_info = {
sizeof (GnomeSettingsModuleBackgroundClass),
NULL, /* base_init */
NULL, /* base_finalize */
@ -125,12 +125,12 @@ gnome_settings_module_background_get_type (void)
0, /* n_preallocs */
(GInstanceInitFunc) gnome_settings_module_background_init,
};
module_type = g_type_register_static (GNOME_SETTINGS_TYPE_MODULE,
"GnomeSettingsModuleBackground",
&module_info, 0);
}
return module_type;
}
@ -168,12 +168,12 @@ gnome_settings_module_background_initialize (GnomeSettingsModule *module,
bg_preferences_load (module_bg->prefs);
gconf_client_notify_add (config_client,
"/desktop/gnome/background",
"/desktop/gnome/background",
background_callback,
module,
NULL,
NULL);
return TRUE;
}
@ -184,7 +184,7 @@ gnome_settings_module_background_start (GnomeSettingsModule *module)
int i;
module_bg = (GnomeSettingsModuleBackground *) module;
/* If this is set, nautilus will draw the background and is
* almost definitely in our session. however, it may not be
* running yet (so is_nautilus_running() will fail). so, on
@ -199,6 +199,6 @@ gnome_settings_module_background_start (GnomeSettingsModule *module)
for (i = 0; module_bg->bg_appliers [i]; i++)
bg_applier_apply_prefs (module_bg->bg_appliers [i], module_bg->prefs);
return TRUE;
}

View file

@ -104,9 +104,9 @@ gnome_settings_module_clipboard_init (GnomeSettingsModuleClipboard *module)
module->display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
}
/* We need to use reference counting for the target data, since we may
/* We need to use reference counting for the target data, since we may
* need to keep the data around after loosing the CLIPBOARD ownership
* to complete incremental transfers.
* to complete incremental transfers.
*/
static TargetData *
target_data_ref (TargetData *data)
@ -153,7 +153,7 @@ send_selection_notify (GnomeSettingsModuleClipboard *module_cp, Bool success)
XSendEvent (module_cp->display, module_cp->requestor,
False, NoEventMask, (XEvent *)&notify);
XSync (module_cp->display, False);
gdk_error_trap_pop ();
}
@ -174,7 +174,7 @@ finish_selection_request (GnomeSettingsModuleClipboard *module_cp, XEvent *xev,
gdk_error_trap_push ();
XSendEvent (xev->xselectionrequest.display,
XSendEvent (xev->xselectionrequest.display,
xev->xselectionrequest.requestor,
False, NoEventMask, (XEvent *) &notify);
XSync (module_cp->display, False);
@ -182,7 +182,7 @@ finish_selection_request (GnomeSettingsModuleClipboard *module_cp, XEvent *xev,
gdk_error_trap_pop ();
}
static int
static int
clipboard_bytes_per_item (int format)
{
switch (format) {
@ -220,14 +220,14 @@ save_targets (GnomeSettingsModuleClipboard *module_cp, Atom *save_targets, int n
tdata->format = 0;
tdata->refcount = 1;
module_cp->contents = list_prepend (module_cp->contents, tdata);
multiple[nout++] = save_targets[i];
multiple[nout++] = save_targets[i];
}
}
XFree (save_targets);
XChangeProperty (module_cp->display, module_cp->window,
XA_MULTIPLE, XA_ATOM_PAIR,
32, PropModeReplace, (const unsigned char *) multiple, nout);
@ -268,12 +268,12 @@ get_property (TargetData *tdata, GnomeSettingsModuleClipboard *module_cp)
unsigned long length;
unsigned long remaining;
unsigned char *data;
XGetWindowProperty (module_cp->display,
XGetWindowProperty (module_cp->display,
module_cp->window,
tdata->target,
0, 0x1FFFFFFF, True, AnyPropertyType,
&type, &format, &length, &remaining,
&type, &format, &length, &remaining,
&data);
if (type == None) {
@ -306,10 +306,10 @@ receive_incrementally (GnomeSettingsModuleClipboard *module_cp, XEvent *xev)
list = list_find (module_cp->contents,
(ListFindFunc) find_content_target, (void *) xev->xproperty.atom);
if (!list)
return False;
tdata = (TargetData *) list->data;
if (tdata->type != XA_INCR)
@ -325,8 +325,8 @@ receive_incrementally (GnomeSettingsModuleClipboard *module_cp, XEvent *xev)
if (length == 0) {
tdata->type = type;
tdata->format = format;
if (!list_find (module_cp->contents,
if (!list_find (module_cp->contents,
(ListFindFunc) find_content_type, (void *)XA_INCR)) {
/* all incremental transfers done */
send_selection_notify (module_cp, True);
@ -356,27 +356,27 @@ send_incrementally (GnomeSettingsModuleClipboard *module_cp, XEvent *xev)
IncrConversion *rdata;
unsigned long length, items;
unsigned char *data;
list = list_find (module_cp->conversions,
list = list_find (module_cp->conversions,
(ListFindFunc) find_conversion_requestor, xev);
if (list == NULL)
if (list == NULL)
return False;
rdata = (IncrConversion *) list->data;
data = rdata->data->data + rdata->offset;
data = rdata->data->data + rdata->offset;
length = rdata->data->length - rdata->offset;
if (length > SELECTION_MAX_SIZE)
length = SELECTION_MAX_SIZE;
rdata->offset += length;
items = length / clipboard_bytes_per_item (rdata->data->format);
XChangeProperty (module_cp->display, rdata->requestor,
rdata->property, rdata->data->type,
rdata->data->format, PropModeAppend,
data, items);
if (length == 0) {
module_cp->conversions = list_remove (module_cp->conversions, rdata);
conversion_free (rdata);
@ -395,39 +395,39 @@ convert_clipboard_manager (GnomeSettingsModuleClipboard *module_cp, XEvent *xev)
if (xev->xselectionrequest.target == XA_SAVE_TARGETS) {
if (module_cp->requestor != None || module_cp->contents != NULL) {
/* We're in the middle of a conversion request, or own
* the CLIPBOARD already
/* We're in the middle of a conversion request, or own
* the CLIPBOARD already
*/
finish_selection_request (module_cp, xev, False);
} else {
gdk_error_trap_push ();
clipboard_manager_watch_cb (xev->xselectionrequest.requestor, True,
StructureNotifyMask, NULL);
XSelectInput (module_cp->display, xev->xselectionrequest.requestor,
StructureNotifyMask);
XSync (module_cp->display, False);
if (gdk_error_trap_pop () != Success)
return;
gdk_error_trap_push ();
if (xev->xselectionrequest.property != None) {
XGetWindowProperty (module_cp->display, xev->xselectionrequest.requestor,
xev->xselectionrequest.property,
0, 0x1FFFFFFF, False, XA_ATOM,
&type, &format, &nitems, &remaining,
(unsigned char **) &targets);
if (gdk_error_trap_pop () != Success) {
if (targets)
XFree (targets);
return;
}
}
module_cp->requestor = xev->xselectionrequest.requestor;
module_cp->property = xev->xselectionrequest.property;
module_cp->time = xev->xselectionrequest.time;
@ -445,22 +445,22 @@ convert_clipboard_manager (GnomeSettingsModuleClipboard *module_cp, XEvent *xev)
xev->xselectionrequest.property,
XA_INTEGER, 32, PropModeReplace,
(unsigned char *) &module_cp->timestamp, 1);
finish_selection_request (module_cp, xev, True);
} else if (xev->xselectionrequest.target == XA_TARGETS) {
int n_targets = 0;
Atom targets[3];
targets[n_targets++] = XA_TARGETS;
targets[n_targets++] = XA_TIMESTAMP;
targets[n_targets++] = XA_SAVE_TARGETS;
XChangeProperty (module_cp->display,
xev->xselectionrequest.requestor,
xev->xselectionrequest.property,
XA_ATOM, 32, PropModeReplace,
(unsigned char *) targets, n_targets);
finish_selection_request (module_cp, xev, True);
} else
finish_selection_request (module_cp, xev, False);
@ -474,22 +474,22 @@ convert_clipboard_target (IncrConversion *rdata, GnomeSettingsModuleClipboard *m
int n_targets;
List *list;
unsigned long items;
XWindowAttributes atts;
XWindowAttributes atts;
if (rdata->target == XA_TARGETS) {
n_targets = list_length (module_cp->contents) + 2;
targets = (Atom *) malloc (n_targets * sizeof (Atom));
n_targets = 0;
targets[n_targets++] = XA_TARGETS;
targets[n_targets++] = XA_MULTIPLE;
for (list = module_cp->contents; list; list = list->next) {
tdata = (TargetData *) list->data;
targets[n_targets++] = tdata->target;
}
XChangeProperty (module_cp->display, rdata->requestor,
rdata->property,
XA_ATOM, 32, PropModeReplace,
@ -497,13 +497,13 @@ convert_clipboard_target (IncrConversion *rdata, GnomeSettingsModuleClipboard *m
free (targets);
} else {
/* Convert from stored CLIPBOARD data */
list = list_find (module_cp->contents,
list = list_find (module_cp->contents,
(ListFindFunc) find_content_target, (void *) rdata->target);
/* We got a target that we don't support */
if (!list)
return;
tdata = (TargetData *)list->data;
if (tdata->type == XA_INCR) {
/* we haven't completely received this target yet */
@ -523,18 +523,18 @@ convert_clipboard_target (IncrConversion *rdata, GnomeSettingsModuleClipboard *m
rdata->offset = 0;
gdk_error_trap_push ();
XGetWindowAttributes (module_cp->display, rdata->requestor, &atts);
XSelectInput (module_cp->display, rdata->requestor,
XSelectInput (module_cp->display, rdata->requestor,
atts.your_event_mask | PropertyChangeMask);
XChangeProperty (module_cp->display, rdata->requestor,
rdata->property,
XA_INCR, 32, PropModeReplace,
(unsigned char *) &items, 1);
XSync (module_cp->display, False);
gdk_error_trap_pop ();
}
}
@ -563,10 +563,10 @@ convert_clipboard (GnomeSettingsModuleClipboard *module_cp, XEvent *xev)
int i, format;
unsigned long nitems, remaining;
Atom *multiple;
conversions = NULL;
type = None;
if (xev->xselectionrequest.target == XA_MULTIPLE) {
XGetWindowProperty (xev->xselectionrequest.display,
xev->xselectionrequest.requestor,
@ -574,10 +574,10 @@ convert_clipboard (GnomeSettingsModuleClipboard *module_cp, XEvent *xev)
0, 0x1FFFFFFF, False, XA_ATOM_PAIR,
&type, &format, &nitems, &remaining,
(unsigned char **) &multiple);
if (type != XA_ATOM_PAIR)
return;
for (i = 0; i < nitems; i += 2) {
rdata = (IncrConversion *) malloc (sizeof (IncrConversion));
rdata->requestor = xev->xselectionrequest.requestor;
@ -589,7 +589,7 @@ convert_clipboard (GnomeSettingsModuleClipboard *module_cp, XEvent *xev)
}
} else {
multiple = NULL;
rdata = (IncrConversion *) malloc (sizeof (IncrConversion));
rdata->requestor = xev->xselectionrequest.requestor;
rdata->target = xev->xselectionrequest.target;
@ -600,7 +600,7 @@ convert_clipboard (GnomeSettingsModuleClipboard *module_cp, XEvent *xev)
}
list_foreach (conversions, (Callback) convert_clipboard_target, module_cp);
if (conversions->next == NULL &&
((IncrConversion *) conversions->data)->property == None) {
finish_selection_request (module_cp, xev, False);
@ -620,10 +620,10 @@ convert_clipboard (GnomeSettingsModuleClipboard *module_cp, XEvent *xev)
}
finish_selection_request (module_cp, xev, True);
}
list_foreach (conversions, (Callback) collect_incremental, module_cp);
list_free (conversions);
if (multiple)
free (multiple);
}
@ -636,7 +636,7 @@ clipboard_manager_process_event (GnomeSettingsModuleClipboard *module_cp, XEvent
unsigned long nitems;
unsigned long remaining;
Atom *targets;
targets = NULL;
switch (xev->xany.type) {
@ -653,9 +653,9 @@ clipboard_manager_process_event (GnomeSettingsModuleClipboard *module_cp, XEvent
case PropertyNotify:
if (xev->xproperty.state == PropertyNewValue)
return receive_incrementally (module_cp, xev);
else
else
return send_incrementally (module_cp, xev);
case SelectionClear:
if (xev->xany.window != module_cp->window)
return False;
@ -666,8 +666,8 @@ clipboard_manager_process_event (GnomeSettingsModuleClipboard *module_cp, XEvent
list_foreach (module_cp->contents, (Callback)target_data_unref, NULL);
list_free (module_cp->contents);
module_cp->contents = NULL;
XSetSelectionOwner (module_cp->display,
XSetSelectionOwner (module_cp->display,
XA_CLIPBOARD,
None, module_cp->time);
}
@ -681,7 +681,7 @@ clipboard_manager_process_event (GnomeSettingsModuleClipboard *module_cp, XEvent
module_cp->contents = NULL;
clipboard_manager_watch_cb (module_cp->requestor, False, 0, NULL);
module_cp->requestor = None;
return True;
}
break;
@ -699,7 +699,7 @@ clipboard_manager_process_event (GnomeSettingsModuleClipboard *module_cp, XEvent
0, 0x1FFFFFFF, True, XA_ATOM,
&type, &format, &nitems, &remaining,
(unsigned char **) &targets);
save_targets (module_cp, targets, nitems);
}
else if (xev->xselection.property == XA_MULTIPLE) {
@ -708,7 +708,7 @@ clipboard_manager_process_event (GnomeSettingsModuleClipboard *module_cp, XEvent
tmp = list_copy (module_cp->contents);
list_foreach (tmp, (Callback) get_property, module_cp);
list_free (tmp);
module_cp->time = xev->xselection.time;
XSetSelectionOwner (module_cp->display, XA_CLIPBOARD,
module_cp->window, module_cp->time);
@ -719,7 +719,7 @@ clipboard_manager_process_event (GnomeSettingsModuleClipboard *module_cp, XEvent
XA_ATOM, 32, PropModeReplace,
(unsigned char *)&XA_NULL, 1);
if (!list_find (module_cp->contents,
if (!list_find (module_cp->contents,
(ListFindFunc)find_content_type, (void *)XA_INCR)) {
/* all transfers done */
send_selection_notify (module_cp, True);
@ -753,11 +753,11 @@ clipboard_manager_process_event (GnomeSettingsModuleClipboard *module_cp, XEvent
default: ;
}
return False;
}
static GdkFilterReturn
static GdkFilterReturn
clipboard_manager_event_filter (GdkXEvent *xevent,
GdkEvent *event,
gpointer data)
@ -786,7 +786,7 @@ clipboard_manager_watch_cb (Window window,
gdkwin = gdk_window_foreign_new_for_display (display, window);
else
g_object_ref (gdkwin);
gdk_window_add_filter (gdkwin, clipboard_manager_event_filter, NULL);
} else {
if (!gdkwin)
@ -800,9 +800,9 @@ GType
gnome_settings_module_clipboard_get_type (void)
{
static GType module_type = 0;
if (!module_type) {
static const GTypeInfo module_info = {
const GTypeInfo module_info = {
sizeof (GnomeSettingsModuleClipboardClass),
NULL, /* base_init */
NULL, /* base_finalize */
@ -813,12 +813,12 @@ gnome_settings_module_clipboard_get_type (void)
0, /* n_preallocs */
(GInstanceInitFunc) gnome_settings_module_clipboard_init,
};
module_type = g_type_register_static (GNOME_SETTINGS_TYPE_MODULE,
"GnomeSettingsModuleClipboard",
&module_info, 0);
}
return module_type;
}
@ -842,7 +842,7 @@ gnome_settings_module_clipboard_initialize (GnomeSettingsModule *module, GConfCl
module_cp->contents = NULL;
module_cp->conversions = NULL;
module_cp->requestor = None;
return TRUE;
}

View file

@ -67,9 +67,9 @@ GType
gnome_settings_module_default_editor_get_type (void)
{
static GType module_type = 0;
if (!module_type) {
static const GTypeInfo module_info = {
const GTypeInfo module_info = {
sizeof (GnomeSettingsModuleDefaultEditorClass),
NULL, /* base_init */
NULL, /* base_finalize */
@ -80,12 +80,12 @@ gnome_settings_module_default_editor_get_type (void)
0, /* n_preallocs */
(GInstanceInitFunc) gnome_settings_module_default_editor_init,
};
module_type = g_type_register_static (GNOME_SETTINGS_TYPE_MODULE,
"GnomeSettingsModuleDefaultEditor",
&module_info, 0);
}
return module_type;
}
@ -109,8 +109,8 @@ print_mime_app (const char *mime_type)
"\t command: %s\n"
"\tneeds term: %s\n",
mime_type, mime_app,
mime_app->id,
mime_app->name,
mime_app->id,
mime_app->name,
mime_app->command,
mime_app->requires_terminal ? "Yes" : "No");
}
@ -150,7 +150,7 @@ vfs_change_cb (GnomeVFSMIMEMonitor *monitor, GConfClient *client)
if (!sync_changes)
return;
star_app = gnome_vfs_mime_get_default_application ("text/*");
plain_app = gnome_vfs_mime_get_default_application ("text/plain");

View file

@ -65,9 +65,9 @@ GType
gnome_settings_module_font_get_type (void)
{
static GType module_type = 0;
if (!module_type) {
static const GTypeInfo module_info = {
const GTypeInfo module_info = {
sizeof (GnomeSettingsModuleFontClass),
NULL, /* base_init */
NULL, /* base_finalize */
@ -78,12 +78,12 @@ gnome_settings_module_font_get_type (void)
0, /* n_preallocs */
(GInstanceInitFunc) gnome_settings_module_font_init,
};
module_type = g_type_register_static (GNOME_SETTINGS_TYPE_MODULE,
"GnomeSettingsModuleFont",
&module_info, 0);
}
return module_type;
}
@ -181,7 +181,7 @@ load_cursor (GConfClient *client)
}
dir = opendir (dir_name);
while ((file_dirent = readdir (dir)) != NULL) {
struct stat st;
gchar *link_name;
@ -190,9 +190,9 @@ load_cursor (GConfClient *client)
if (lstat (link_name, &st)) {
g_free (link_name);
continue;
}
}
g_free (link_name);
if (S_ISLNK (st.st_mode))
unlink (link_name);
}
@ -252,7 +252,7 @@ load_cursor (GConfClient *client)
/* if there was an error setting the new path, revert */
if (gdk_error_trap_pop ())
XSetFontPath (gdk_display, font_path, n_fonts);
XSetFontPath (gdk_display, font_path, n_fonts);
XFreeFontPath (font_path);

View file

@ -67,9 +67,9 @@ GType
gnome_settings_module_gtk1_get_type (void)
{
static GType module_type = 0;
if (!module_type) {
static const GTypeInfo module_info = {
const GTypeInfo module_info = {
sizeof (GnomeSettingsModuleGtk1Class),
NULL, /* base_init */
NULL, /* base_finalize */
@ -80,12 +80,12 @@ gnome_settings_module_gtk1_get_type (void)
0, /* n_preallocs */
(GInstanceInitFunc) gnome_settings_module_gtk1_init,
};
module_type = g_type_register_static (GNOME_SETTINGS_TYPE_MODULE,
"GnomeSettingsModuleGtk1",
&module_info, 0);
}
return module_type;
}
@ -111,7 +111,7 @@ make_contents (const char *filename)
"include \"%s\"\n"
"\n",
filename);
g_string_append_printf (result,
g_string_append_printf (result,
"include \"%s/.gtkrc.mine\"\n",
g_get_home_dir ());
@ -153,11 +153,11 @@ write_contents (const char *rc_filename,
if (rename (tmp_filename, rc_filename) < 0) {
g_warning ("Cannot move %s to %s: %s", tmp_filename, rc_filename, g_strerror (errno));
goto bail1;
}
g_free (tmp_filename);
return TRUE;
bail0:
@ -178,13 +178,13 @@ send_change_message (void)
{
GdkEventClient sev;
int i;
for(i = 0; i < 5; i++)
sev.data.l[i] = 0;
sev.data_format = 32;
sev.message_type = gdk_atom_intern("_GTK_READ_RCFILES", FALSE);
gdk_event_send_clientmessage_toall ((GdkEvent *) &sev);
}
@ -195,7 +195,7 @@ check_filename (char *base_dir,
const char *theme)
{
char *theme_filename = g_build_filename (base_dir, theme, "gtk", "gtkrc", NULL);
if (!g_file_test (theme_filename, G_FILE_TEST_EXISTS)) {
g_free (theme_filename);
theme_filename = NULL;
@ -249,16 +249,16 @@ apply_settings (void)
}
rc_filename = g_build_filename (g_get_home_dir(), ".gtkrc-1.2-gnome2", NULL);
if (!g_file_get_contents (rc_filename, &current_contents, &current_length, &err) &&
!g_error_matches (err, G_FILE_ERROR, G_FILE_ERROR_NOENT)) {
g_warning ("Can't get contents of %s: %s", rc_filename, err->message);
g_clear_error (&err);
}
new_contents = make_contents (theme_filename);
g_free (theme_filename);
if (!current_contents ||
current_length != strlen (new_contents) ||
memcmp (current_contents, new_contents, current_length) != 0) {

View file

@ -74,7 +74,7 @@ gnome_settings_module_keybindings_get_type (void)
static GType module_type = 0;
if (!module_type) {
static const GTypeInfo module_info = {
const GTypeInfo module_info = {
sizeof (GnomeSettingsModuleKeybindingsClass),
NULL, /* base_init */
NULL, /* base_finalize */

View file

@ -81,7 +81,7 @@ gnome_settings_module_keyboard_get_type (void)
static GType module_type = 0;
if (!module_type) {
static const GTypeInfo module_info = {
const GTypeInfo module_info = {
sizeof (GnomeSettingsModuleKeyboardClass),
NULL, /* base_init */
NULL, /* base_finalize */
@ -153,7 +153,7 @@ gsd_keyboard_get_hostname_key (const char *subkey)
#else
char hostname[256];
#endif
if (gethostname (hostname, sizeof (hostname)) == 0 &&
strcmp (hostname, "localhost") != 0 &&
strcmp (hostname, "localhost.localdomain") != 0) {
@ -360,11 +360,11 @@ apply_settings (void)
kbdcontrol.bell_percent = bell_volume;
kbdcontrol.bell_pitch = bell_pitch;
kbdcontrol.bell_duration = bell_duration;
XChangeKeyboardControl (GDK_DISPLAY (),
KBKeyClickPercent | KBBellPercent | KBBellPitch | KBBellDuration,
XChangeKeyboardControl (GDK_DISPLAY (),
KBKeyClickPercent | KBBellPercent | KBBellPitch | KBBellDuration,
&kbdcontrol);
#ifdef HAVE_X11_EXTENSIONS_XKB_H
if (!numlock_setup_error && rnumlock)
numlock_set_xkb_state (numlock_get_gconf_state ());

View file

@ -77,9 +77,9 @@ GType
gnome_settings_module_get_type (void)
{
static GType module_type = 0;
if (!module_type) {
static const GTypeInfo module_info = {
const GTypeInfo module_info = {
sizeof (GnomeSettingsModuleClass),
NULL, /* base_init */
NULL, /* base_finalize */
@ -90,12 +90,12 @@ gnome_settings_module_get_type (void)
0, /* n_preallocs */
(GInstanceInitFunc) gnome_settings_module_init,
};
module_type = g_type_register_static (G_TYPE_OBJECT,
"GnomeSettingsModule",
&module_info, 0);
}
return module_type;
}
@ -151,7 +151,7 @@ gnome_settings_module_stop (GnomeSettingsModule *module)
{
g_return_val_if_fail (GNOME_SETTINGS_IS_MODULE (module), FALSE);
g_return_val_if_fail (module->priv->status == GNOME_SETTINGS_MODULE_STATUS_STARTED, FALSE);
if (!CLASS (module)->stop)
return TRUE;

View file

@ -54,7 +54,7 @@ gnome_settings_module_mouse_get_type (void)
static GType module_type = 0;
if (!module_type) {
static const GTypeInfo module_info = {
const GTypeInfo module_info = {
sizeof (GnomeSettingsModuleMouseClass),
NULL, /* base_init */
NULL, /* base_finalize */

View file

@ -17,7 +17,7 @@
*
* 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,
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
@ -103,7 +103,7 @@ gnome_settings_module_multimedia_keys_get_type (void)
static GType module_type = 0;
if (!module_type) {
static const GTypeInfo module_info = {
const GTypeInfo module_info = {
sizeof (GnomeSettingsModuleMultimediaKeysClass),
NULL, /* base_init */
NULL, /* base_finalize */
@ -164,9 +164,9 @@ get_term_command (Acme *acme)
cmd = g_strdup_printf ("%s %s -e", cmd_term, cmd_args);
else
cmd = g_strdup_printf ("%s -e", cmd_term);
g_free (cmd_args);
}
}
g_free (cmd_term);
return cmd;
}
@ -190,7 +190,7 @@ execute (Acme *acme, char *cmd, gboolean sync, gboolean need_term)
return;
}
}
if (term) {
exec = g_strdup_printf ("%s %s", term, cmd);
g_free (term);
@ -523,7 +523,7 @@ do_help_action (Acme *acme)
cmd = g_strdup_printf (string, "");
execute (acme, cmd, FALSE, FALSE);
g_free (cmd);
} else
} else
do_unknown_action (acme, "ghelp:");
g_free (string);

View file

@ -75,7 +75,7 @@ gnome_settings_module_screensaver_get_type (void)
static GType module_type = 0;
if (!module_type) {
static const GTypeInfo module_info = {
const GTypeInfo module_info = {
sizeof (GnomeSettingsModuleScreensaverClass),
NULL, /* base_init */
NULL, /* base_finalize */

View file

@ -79,9 +79,9 @@ GType
gnome_settings_module_sound_get_type (void)
{
static GType module_type = 0;
if (!module_type) {
static const GTypeInfo module_info = {
const GTypeInfo module_info = {
sizeof (GnomeSettingsModuleSoundClass),
NULL, /* base_init */
NULL, /* base_finalize */
@ -92,12 +92,12 @@ gnome_settings_module_sound_get_type (void)
0, /* n_preallocs */
(GInstanceInitFunc) gnome_settings_module_sound_init,
};
module_type = g_type_register_static (GNOME_SETTINGS_TYPE_MODULE,
"GnomeSettingsModuleSound",
&module_info, 0);
}
return module_type;
}
@ -109,10 +109,10 @@ gnome_settings_module_sound_get_runlevel (GnomeSettingsModule *module)
/* start_gnome_sound
*
* Start GNOME sound.
* Start GNOME sound.
*/
static void
start_gnome_sound (void)
start_gnome_sound (void)
{
gnome_sound_init (NULL);
if (gnome_sound_connection_get () < 0)
@ -125,10 +125,10 @@ static gboolean set_esd_standby = TRUE;
/* stop_gnome_sound
*
* Stop GNOME sound.
* Stop GNOME sound.
*/
static void
stop_gnome_sound (void)
stop_gnome_sound (void)
{
#ifdef HAVE_ESD
/* Can't think of a way to do this reliably, so we fake it for now */
@ -145,7 +145,7 @@ struct reload_foreach_closure {
/* reload_foreach_cb
*
* For a given SoundEvent, reload the sound file associate with the event.
* For a given SoundEvent, reload the sound file associate with the event.
*/
static void
reload_foreach_cb (SoundEvent *event, gpointer data)
@ -231,7 +231,7 @@ apply_settings (void)
closure.enable_system_sounds = event_sounds;
if (enable_sound) {
if (gnome_sound_connection_get () < 0)
if (gnome_sound_connection_get () < 0)
start_gnome_sound ();
#ifdef HAVE_ESD
else if (set_esd_standby) {
@ -249,11 +249,11 @@ apply_settings (void)
if (enable_sound &&
(!inited || event_changed_old != event_changed_new)) {
SoundProperties *props;
inited = TRUE;
event_changed_old = event_changed_new;
props = sound_properties_new ();
sound_properties_add_defaults (props, NULL);
sound_properties_foreach (props, reload_foreach_cb, &closure);

View file

@ -43,9 +43,9 @@ GType
gnome_settings_module_typing_break_get_type (void)
{
static GType module_type = 0;
if (!module_type) {
static const GTypeInfo module_info = {
const GTypeInfo module_info = {
sizeof (GnomeSettingsModuleTypingBreakClass),
NULL, /* base_init */
NULL, /* base_finalize */
@ -56,12 +56,12 @@ gnome_settings_module_typing_break_get_type (void)
0, /* n_preallocs */
(GInstanceInitFunc) gnome_settings_module_typing_break_init,
};
module_type = g_type_register_static (GNOME_SETTINGS_TYPE_MODULE,
"GnomeSettingsModuleTypingBreak",
&module_info, 0);
}
return module_type;
}
@ -123,7 +123,7 @@ child_exited_callback (VteReaper *reaper,
}
}
static void
static void
typing_break_callback (GConfEntry *entry)
{
if (! strcmp (entry->key, "/desktop/gnome/typing_break/enabled")) {

View file

@ -363,7 +363,7 @@ gnome_settings_module_xrdb_get_type (void)
static GType module_type = 0;
if (!module_type) {
static const GTypeInfo module_info = {
const GTypeInfo module_info = {
sizeof (GnomeSettingsModuleXrdbClass),
NULL, /* base_init */
NULL, /* base_finalize */

View file

@ -48,7 +48,7 @@ typedef void (* TranslationFunc) (TranslationEntry *trans,
struct _TranslationEntry {
const char *gconf_key;
const char *xsetting_name;
GConfValueType gconf_type;
TranslationFunc translate;
};
@ -66,7 +66,7 @@ static gboolean gnome_settings_module_xsettings_initialize (GnomeSettingsModule
static gboolean gnome_settings_module_xsettings_start (GnomeSettingsModule *module);
static gboolean gnome_settings_module_xsettings_stop (GnomeSettingsModule *module);
#ifdef HAVE_XFT2
#ifdef HAVE_XFT2
/* X servers sometimes lie about the screen's physical dimensions, so we cannot
* compute an accurate DPI value. When this happens, the user gets fonts that
* are too huge or too tiny. So, we see what the server returns: if it reports
@ -106,9 +106,9 @@ GType
gnome_settings_module_xsettings_get_type (void)
{
static GType module_type = 0;
if (!module_type) {
static const GTypeInfo module_info = {
const GTypeInfo module_info = {
sizeof (GnomeSettingsModuleXSettingsClass),
NULL, /* base_init */
NULL, /* base_finalize */
@ -119,12 +119,12 @@ gnome_settings_module_xsettings_get_type (void)
0, /* n_preallocs */
(GInstanceInitFunc) gnome_settings_module_xsettings_init,
};
module_type = g_type_register_static (GNOME_SETTINGS_TYPE_MODULE,
"GnomeSettingsModuleXSettings",
&module_info, 0);
}
return module_type;
}
@ -141,8 +141,8 @@ translate_bool_int (TranslationEntry *trans,
int i;
g_assert (value->type == trans->gconf_type);
for (i = 0; managers [i]; i++)
for (i = 0; managers [i]; i++)
xsettings_manager_set_int (managers [i], trans->xsetting_name,
gconf_value_get_bool (value));
}
@ -155,7 +155,7 @@ translate_int_int (TranslationEntry *trans,
g_assert (value->type == trans->gconf_type);
for (i = 0; managers [i]; i++)
for (i = 0; managers [i]; i++)
xsettings_manager_set_int (managers [i], trans->xsetting_name,
gconf_value_get_int (value));
}
@ -168,7 +168,7 @@ translate_string_string (TranslationEntry *trans,
g_assert (value->type == trans->gconf_type);
for (i = 0; managers [i]; i++)
for (i = 0; managers [i]; i++)
xsettings_manager_set_string (managers [i],
trans->xsetting_name,
gconf_value_get_string (value));
@ -180,7 +180,7 @@ translate_string_string_toolbar (TranslationEntry *trans,
{
int i;
const char *tmp;
g_assert (value->type == trans->gconf_type);
/* This is kind of a workaround since GNOME expects the key value to be
@ -190,7 +190,7 @@ translate_string_string_toolbar (TranslationEntry *trans,
if (tmp && strcmp (tmp, "both_horiz") == 0)
tmp = "both-horiz";
for (i = 0; managers [i]; i++)
for (i = 0; managers [i]; i++)
xsettings_manager_set_string (managers [i],
trans->xsetting_name,
tmp);
@ -259,7 +259,7 @@ find_translation_entry (const char *gconf_key)
return NULL;
}
static const gchar*
static const gchar*
type_to_string (GConfValueType type)
{
switch (type) {
@ -288,11 +288,11 @@ type_to_string (GConfValueType type)
static void
process_value (TranslationEntry *trans,
GConfValue *val)
{
{
if (val == NULL) {
int i;
for (i = 0; managers [i]; i++)
for (i = 0; managers [i]; i++)
xsettings_manager_delete_setting (managers [i], trans->xsetting_name);
} else {
if (val->type == trans->gconf_type)
@ -317,12 +317,12 @@ xsettings_callback (GConfEntry *entry)
return;
process_value (trans, entry->value);
for (i = 0; managers [i]; i++)
xsettings_manager_set_string (managers [i], "Net/FallbackIconTheme",
"gnome");
for (i = 0; managers [i]; i++)
for (i = 0; managers [i]; i++)
xsettings_manager_notify (managers [i]);
}
@ -335,9 +335,9 @@ gnome_settings_module_xsettings_initialize (GnomeSettingsModule *module, GConfCl
return TRUE;
#ifdef HAVE_XFT2
#ifdef HAVE_XFT2
gnome_settings_register_config_callback (FONT_RENDER_DIR, xft_callback);
#endif /* HAVE_XFT2 */
#endif /* HAVE_XFT2 */
}
#ifdef HAVE_XFT2
@ -351,7 +351,7 @@ xft_callback (GConfEntry *entry)
gnome_settings_update_xft (client);
for (i = 0; managers [i]; i++)
for (i = 0; managers [i]; i++)
xsettings_manager_notify (managers [i]);
}
@ -461,7 +461,7 @@ gnome_xft_settings_get (GConfClient *client,
g_warning ("Invalid value for " FONT_RGBA_ORDER_KEY ": '%s'",
rgba_order);
}
if (hinting) {
if (strcmp (hinting, "none") == 0) {
settings->hinting = 0;
@ -479,10 +479,10 @@ gnome_xft_settings_get (GConfClient *client,
g_warning ("Invalid value for " FONT_HINTING_KEY ": '%s'",
hinting);
}
if (antialiasing) {
gboolean use_rgba = FALSE;
if (strcmp (antialiasing, "none") == 0)
settings->antialias = 0;
else if (strcmp (antialiasing, "grayscale") == 0)
@ -581,11 +581,11 @@ gnome_settings_module_xsettings_start (GnomeSettingsModule *module)
if (val != NULL)
gconf_value_free (val);
}
++i;
}
#ifdef HAVE_XFT2
#ifdef HAVE_XFT2
gnome_settings_update_xft (client);
#endif /* HAVE_XFT */