2
* Copyright (C) 2010 Intel, Inc
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
* Authors: Thomas Wood <thomas.wood@intel.com>
19
* Rodrigo Moya <rodrigo@gnome.org>
23
#include "cc-mouse-panel.h"
24
#include "gnome-mouse-properties.h"
27
G_DEFINE_DYNAMIC_TYPE (CcMousePanel, cc_mouse_panel, CC_TYPE_PANEL)
29
#define MOUSE_PANEL_PRIVATE(o) \
30
(G_TYPE_INSTANCE_GET_PRIVATE ((o), CC_TYPE_MOUSE_PANEL, CcMousePanelPrivate))
32
struct _CcMousePanelPrivate
40
cc_mouse_panel_get_property (GObject *object,
48
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
53
cc_mouse_panel_set_property (GObject *object,
61
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
66
cc_mouse_panel_dispose (GObject *object)
68
CcMousePanelPrivate *priv = CC_MOUSE_PANEL (object)->priv;
72
gnome_mouse_properties_dispose (priv->widget);
78
g_object_unref (priv->builder);
82
G_OBJECT_CLASS (cc_mouse_panel_parent_class)->dispose (object);
86
cc_mouse_panel_class_init (CcMousePanelClass *klass)
88
GObjectClass *object_class = G_OBJECT_CLASS (klass);
90
g_type_class_add_private (klass, sizeof (CcMousePanelPrivate));
92
object_class->get_property = cc_mouse_panel_get_property;
93
object_class->set_property = cc_mouse_panel_set_property;
94
object_class->dispose = cc_mouse_panel_dispose;
98
cc_mouse_panel_class_finalize (CcMousePanelClass *klass)
103
cc_mouse_panel_init (CcMousePanel *self)
105
CcMousePanelPrivate *priv;
106
GtkWidget *prefs_widget;
107
GError *error = NULL;
109
priv = self->priv = MOUSE_PANEL_PRIVATE (self);
111
priv->builder = gtk_builder_new ();
113
gtk_builder_add_from_file (priv->builder,
114
GNOMECC_UI_DIR "/gnome-mouse-properties.ui",
118
g_warning ("Error loading UI file: %s", error->message);
122
priv->widget = gnome_mouse_properties_init (priv->builder);
124
prefs_widget = (GtkWidget*) gtk_builder_get_object (priv->builder,
127
gtk_widget_reparent (prefs_widget, GTK_WIDGET (self));
131
cc_mouse_panel_register (GIOModule *module)
133
cc_mouse_panel_register_type (G_TYPE_MODULE (module));
134
g_io_extension_point_implement (CC_SHELL_PANEL_EXTENSION_POINT,