Make sure panels do not need to link against libcommon.la

libcommon.la defines several new GTypes, so it cannot be loaded into the
same process multiple times.

Copy gconf-property-editor to libgnome-control-center as this is useful
for all panels. However, it will need to be converted to GSettings in the
near future.

Copy capplet-stock-icons to the mouse panel, as it is not used in any other
panels.

Remove references to functions not yet implemented for panels (help,
window icon, etc).
This commit is contained in:
Thomas Wood 2010-05-22 12:02:52 +01:00
parent 538670298e
commit ad938356da
11 changed files with 2195 additions and 15 deletions

View file

@ -11,6 +11,8 @@ lib_LTLIBRARIES = libgnome-control-center.la
libgnome_control_center_include_HEADERS = \
cc-panel.h \
cc-shell.h \
gconf-property-editor.h \
gconf-property-editor-marshal.h \
$(NULL)
libgnome_control_center_la_SOURCES = \
@ -18,6 +20,10 @@ libgnome_control_center_la_SOURCES = \
cc-panel.h \
cc-shell.c \
cc-shell.h \
gconf-property-editor-marshal.c \
gconf-property-editor-marshal.h \
gconf-property-editor.c \
gconf-property-editor.h \
$(NULL)
libgnome_control_center_la_LDFLAGS = \

View file

@ -0,0 +1,41 @@
#include <glib.h>
#include <glib-object.h>
#include "gconf-property-editor-marshal.h"
/* VOID:STRING,POINTER (peditor-marshal.list:25) */
void
gconf_property_editor_marshal_VOID__STRING_POINTER (GClosure *closure,
GValue *return_value,
guint n_param_values,
const GValue *param_values,
gpointer invocation_hint,
gpointer marshal_data)
{
typedef void (*GMarshalFunc_VOID__STRING_POINTER) (gpointer data1,
gpointer arg_1,
gpointer arg_2,
gpointer data2);
register GMarshalFunc_VOID__STRING_POINTER callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
g_return_if_fail (n_param_values == 3);
if (G_CCLOSURE_SWAP_DATA (closure))
{
data1 = closure->data;
data2 = g_value_peek_pointer (param_values + 0);
}
else
{
data1 = g_value_peek_pointer (param_values + 0);
data2 = closure->data;
}
callback = (GMarshalFunc_VOID__STRING_POINTER) (marshal_data ? marshal_data : cc->callback);
callback (data1,
(char*) g_value_get_string (param_values + 1),
g_value_get_pointer (param_values + 2),
data2);
}

View file

@ -0,0 +1,15 @@
#include <gobject/gmarshal.h>
G_BEGIN_DECLS
/* VOID:STRING,POINTER (peditor-marshal.list:25) */
extern void gconf_property_editor_marshal_VOID__STRING_POINTER (GClosure *closure,
GValue *return_value,
guint n_param_values,
const GValue *param_values,
gpointer invocation_hint,
gpointer marshal_data);
G_END_DECLS

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,158 @@
/* -*- mode: c; style: linux -*- */
/* gconf-property-editor.h
* Copyright (C) 2001 Ximian, Inc.
*
* Written by Bradford Hovinen <hovinen@ximian.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef __GCONF_PROPERTY_EDITOR_H
#define __GCONF_PROPERTY_EDITOR_H
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <gconf/gconf-client.h>
#include <gconf/gconf-changeset.h>
G_BEGIN_DECLS
#define GCONF_PROPERTY_EDITOR(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gconf_property_editor_get_type (), GConfPropertyEditor)
#define GCONF_PROPERTY_EDITOR_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gconf_property_editor_get_type (), GConfPropertyEditorClass)
#define IS_GCONF_PROPERTY_EDITOR(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gconf_property_editor_get_type ())
typedef struct _GConfPropertyEditor GConfPropertyEditor;
typedef struct _GConfPropertyEditorClass GConfPropertyEditorClass;
typedef struct _GConfPropertyEditorPrivate GConfPropertyEditorPrivate;
typedef GConfValue *(*GConfPEditorValueConvFn) (GConfPropertyEditor *peditor, const GConfValue *);
typedef int (*GConfPEditorGetValueFn) (GConfPropertyEditor *peditor, gpointer data);
struct _GConfPropertyEditor
{
GObject parent;
GConfPropertyEditorPrivate *p;
};
struct _GConfPropertyEditorClass
{
GObjectClass g_object_class;
void (*value_changed) (GConfPropertyEditor *peditor, gchar *key, const GConfValue *value);
};
GType gconf_property_editor_get_type (void);
const gchar *gconf_property_editor_get_key (GConfPropertyEditor *peditor);
GObject *gconf_property_editor_get_ui_control (GConfPropertyEditor *peditor);
GObject *gconf_peditor_new_boolean (GConfChangeSet *changeset,
const gchar *key,
GtkWidget *checkbox,
const gchar *first_property_name,
...);
GObject *gconf_peditor_new_enum_toggle (GConfChangeSet *changeset,
const gchar *key,
GtkWidget *checkbox,
GType enum_type,
GConfPEditorGetValueFn val_true_fn,
guint val_false,
gboolean use_nick,
gpointer data,
const gchar *first_property_name,
...);
GObject *gconf_peditor_new_integer (GConfChangeSet *changeset,
const gchar *key,
GtkWidget *entry,
const gchar *first_property_name,
...);
GObject *gconf_peditor_new_string (GConfChangeSet *changeset,
const gchar *key,
GtkWidget *entry,
const gchar *first_property_name,
...);
GObject *gconf_peditor_new_color (GConfChangeSet *changeset,
const gchar *key,
GtkWidget *color_entry,
const gchar *first_property_name,
...);
GObject *gconf_peditor_new_combo_box (GConfChangeSet *changeset,
const gchar *key,
GtkWidget *combo_box,
const gchar *first_property_name,
...);
GObject *gconf_peditor_new_combo_box_with_enum (GConfChangeSet *changeset,
const gchar *key,
GtkWidget *combo_box,
GType enum_type,
gboolean use_nick,
const gchar *first_property_name,
...);
GObject *gconf_peditor_new_select_radio (GConfChangeSet *changeset,
const gchar *key,
GSList *radio_group,
const gchar *first_property_name,
...);
GObject *gconf_peditor_new_select_radio_with_enum (GConfChangeSet *changeset,
const gchar *key,
GSList *radio_group,
GType enum_type,
gboolean use_nick,
const gchar *first_property_name,
...);
GObject *gconf_peditor_new_numeric_range (GConfChangeSet *changeset,
const gchar *key,
GtkWidget *range,
const gchar *first_property_name,
...);
GObject *gconf_peditor_new_font (GConfChangeSet *changeset,
const gchar *key,
GtkWidget *font_button,
const gchar *first_property_name,
...);
GObject *gconf_peditor_new_image (GConfChangeSet *changeset,
const gchar *key,
GtkWidget *button,
const gchar *first_property,
...);
GObject *gconf_peditor_new_tree_view (GConfChangeSet *changeset,
const gchar *key,
GtkWidget *tree_view,
const gchar *first_property_name,
...);
void gconf_peditor_widget_set_guard (GConfPropertyEditor *peditor,
GtkWidget *widget);
/* some convenience callbacks to map int <-> float */
GConfValue *gconf_value_int_to_float (GConfPropertyEditor *ignored, GConfValue const *value);
GConfValue *gconf_value_float_to_int (GConfPropertyEditor *ignored, GConfValue const *value);
G_END_DECLS
#endif /* __GCONF_PROPERTY_EDITOR_H */

View file

@ -27,8 +27,7 @@ libkeyboard_properties_la_SOURCES = \
gnome-keyboard-properties-xkbpv.c \
gnome-keyboard-properties-xkb.h
libkeyboard_properties_la_LIBADD = $(PANEL_LIBS) $(LIBGNOMEKBDUI_LIBS) \
$(top_builddir)/capplets/common/libcommon.la
libkeyboard_properties_la_LIBADD = $(PANEL_LIBS) $(LIBGNOMEKBDUI_LIBS)
libkeyboard_properties_la_LDFLAGS = $(PANEL_LDFLAGS)

View file

@ -32,8 +32,6 @@
#include "capplet-util.h"
#include "gconf-property-editor.h"
#include "activate-settings-daemon.h"
#include "capplet-stock-icons.h"
#include "gnome-keyboard-properties-a11y.h"
#include "gnome-keyboard-properties-xkb.h"
@ -109,10 +107,12 @@ static void
dialog_response (GtkWidget * widget,
gint response_id, GConfChangeSet * changeset)
{
/*
if (response_id == GTK_RESPONSE_HELP)
capplet_help (GTK_WINDOW (widget), "goscustperiph-2");
else
gtk_main_quit ();
*/
}
static void
@ -197,7 +197,6 @@ GtkWidget *
gnome_keyboard_properties_init (GConfClient * client, GtkBuilder * dialog)
{
GtkWidget *dialog_win = NULL;
activate_settings_daemon ();
gconf_client_add_dir (client,
"/desktop/gnome/peripherals/keyboard",
@ -210,8 +209,6 @@ gnome_keyboard_properties_init (GConfClient * client, GtkBuilder * dialog)
dialog_win = WID ("keyboard_dialog");
/* g_signal_connect (dialog_win, "response",
G_CALLBACK (dialog_response_cb), NULL); */
capplet_set_icon (dialog_win,
"preferences-desktop-keyboard");
}
return dialog_win;

View file

@ -6,7 +6,8 @@ INCLUDES = \
$(GNOMECC_CAPPLETS_CFLAGS) \
-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" \
-DGNOMECC_UI_DIR="\"$(uidir)\""
-DGNOMECC_UI_DIR="\"$(uidir)\"" \
-DPIXMAP_DIR=\""$(datadir)/gnome-control-center/pixmaps"\" \
$(NULL)
@ -19,10 +20,11 @@ libmouse_properties_la_SOURCES = \
cc-mouse-panel.h \
gnome-mouse-properties.c \
gnome-mouse-accessibility.c \
gnome-mouse-accessibility.h
gnome-mouse-accessibility.h \
capplet-stock-icons.c \
capplet-stock-icons.h
libmouse_properties_la_LIBADD = $(PANEL_LIBS) \
$(top_builddir)/capplets/common/libcommon.la
libmouse_properties_la_LIBADD = $(PANEL_LIBS)
libmouse_properties_la_LDFLAGS = $(PANEL_LDFLAGS)
@INTLTOOL_DESKTOP_RULE@

View file

@ -0,0 +1,101 @@
/*
* capplet-stock-icons.c
*
* Copyright (C) 2002 Sun Microsystems, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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 Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Authors:
* Rajkumar Sivasamy <rajkumar.siva@wipro.com>
* Taken bits of code from panel-stock-icons.c, Thanks Mark <mark@skynet.ie>
*/
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include "capplet-stock-icons.h"
static GtkIconSize mouse_capplet_dblclck_icon_size = 0;
GtkIconSize
mouse_capplet_dblclck_icon_get_size (void)
{
return mouse_capplet_dblclck_icon_size;
}
typedef struct
{
char *stock_id;
char *name;
} CappletStockIcon;
static CappletStockIcon items [] = {
{ MOUSE_DBLCLCK_MAYBE, "double-click-maybe.png"},
{ MOUSE_DBLCLCK_ON, "double-click-on.png"},
{ MOUSE_DBLCLCK_OFF, "double-click-off.png"}
};
static void
capplet_register_stock_icons (GtkIconFactory *factory)
{
gint i;
GtkIconSource *source;
source = gtk_icon_source_new ();
for (i = 0; i < G_N_ELEMENTS (items); ++i) {
GtkIconSet *icon_set;
char *filename;
filename = g_build_filename (PIXMAP_DIR, items[i].name, NULL);
if (!filename) {
g_warning (_("Unable to load stock icon '%s'\n"), items[i].name);
icon_set = gtk_icon_factory_lookup_default (GTK_STOCK_MISSING_IMAGE);
gtk_icon_factory_add (factory, items[i].stock_id, icon_set);
continue;
}
gtk_icon_source_set_filename (source, filename);
g_free (filename);
icon_set = gtk_icon_set_new ();
gtk_icon_set_add_source (icon_set, source);
gtk_icon_factory_add (factory, items[i].stock_id, icon_set);
gtk_icon_set_unref (icon_set);
}
gtk_icon_source_free (source);
}
void
capplet_init_stock_icons (void)
{
GtkIconFactory *factory;
static gboolean initialized = FALSE;
if (initialized)
return;
initialized = TRUE;
factory = gtk_icon_factory_new ();
gtk_icon_factory_add_default (factory);
capplet_register_stock_icons (factory);
mouse_capplet_dblclck_icon_size = gtk_icon_size_register ("mouse-capplet-dblclck-icon",
MOUSE_CAPPLET_DBLCLCK_ICON_SIZE,
MOUSE_CAPPLET_DBLCLCK_ICON_SIZE);
g_object_unref (factory);
}

View file

@ -0,0 +1,62 @@
/*
* capplet-stock-icons.h
*
* Copyright (C) 2002 Sun Microsystems, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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 Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Authors:
* Rajkumar Sivasamy <rajkumar.siva@wipro.com>
* Taken bits of code from panel-stock-icons.h, Thanks Mark <mark@skynet.ie>
*/
#ifndef __CAPPLET_STOCK_ICONS_H__
#define __CAPPLET_STOCK_ICONS_H__
#include <glib.h>
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define KEYBOARD_CAPPLET_DEFAULT_ICON_SIZE 48
#define MOUSE_CAPPLET_DEFAULT_WIDTH 120
#define MOUSE_CAPPLET_DEFAULT_HEIGHT 100
#define MOUSE_CAPPLET_DBLCLCK_ICON_SIZE 100
/* stock icons */
#define KEYBOARD_REPEAT "keyboard-repeat"
#define KEYBOARD_CURSOR "keyboard-cursor"
#define KEYBOARD_VOLUME "keyboard-volume"
#define KEYBOARD_BELL "keyboard-bell"
#define ACCESSX_KEYBOARD_BOUNCE "accessibility-keyboard-bouncekey"
#define ACCESSX_KEYBOARD_SLOW "accessibility-keyboard-slowkey"
#define ACCESSX_KEYBOARD_MOUSE "accessibility-keyboard-mousekey"
#define ACCESSX_KEYBOARD_STICK "accessibility-keyboard-stickykey"
#define ACCESSX_KEYBOARD_TOGGLE "accessibility-keyboard-togglekey"
#define MOUSE_DBLCLCK_MAYBE "mouse-dblclck-maybe"
#define MOUSE_DBLCLCK_ON "mouse-dblclck-on"
#define MOUSE_DBLCLCK_OFF "mouse-dblclck-off"
#define MOUSE_RIGHT_HANDED "mouse-right-handed"
#define MOUSE_LEFT_HANDED "mouse-left-handed"
void capplet_init_stock_icons (void);
GtkIconSize keyboard_capplet_icon_get_size (void);
GtkIconSize mouse_capplet_icon_get_size (void);
GtkIconSize mouse_capplet_dblclck_icon_get_size (void);
G_END_DECLS
#endif /* __CAPPLET_STOCK_ICONS_H__ */

View file

@ -33,7 +33,6 @@
#include "capplet-util.h"
#include "gconf-property-editor.h"
#include "activate-settings-daemon.h"
#include "gnome-mouse-accessibility.h"
#include "capplet-stock-icons.h"
@ -556,11 +555,13 @@ create_dialog (GtkBuilder *dialog)
static void
dialog_response_cb (GtkDialog *dialog, gint response_id, GConfChangeSet *changeset)
{
/*
if (response_id == GTK_RESPONSE_HELP)
capplet_help (GTK_WINDOW (dialog),
"goscustperiph-5");
else
gtk_main_quit ();
*/
}
GtkWidget *
@ -571,8 +572,6 @@ gnome_mouse_properties_init (GConfClient *client, GtkBuilder *dialog)
capplet_init_stock_icons ();
activate_settings_daemon ();
client = gconf_client_get_default ();
gconf_client_add_dir (client, "/desktop/gnome/peripherals/mouse", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
gconf_client_add_dir (client, "/desktop/gnome/peripherals/touchpad", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
@ -606,7 +605,6 @@ gnome_mouse_properties_init (GConfClient *client, GtkBuilder *dialog)
g_free (page_name);
}
capplet_set_icon (dialog_win, "input-mouse");
}
return dialog_win;