mirror of https://github.com/GNOME/gimp.git
made dynamically loadable using GTypeModule.
2007-02-13 Michael Natterer <mitch@gimp.org> * modules/gimpinputdevicestore.[ch]: made dynamically loadable using GTypeModule. * modules/controller_linux_input.c (gimp_module_register): register the new dynamic type. svn path=/trunk/; revision=21909
This commit is contained in:
parent
76a1869f01
commit
d6706ea9d2
|
@ -1,3 +1,11 @@
|
|||
2007-02-13 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* modules/gimpinputdevicestore.[ch]: made dynamically loadable
|
||||
using GTypeModule.
|
||||
|
||||
* modules/controller_linux_input.c (gimp_module_register):
|
||||
register the new dynamic type.
|
||||
|
||||
2007-02-13 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* modules/controller_linux_input.c (key_events): corrected string
|
||||
|
|
|
@ -197,6 +197,7 @@ gimp_module_query (GTypeModule *module)
|
|||
G_MODULE_EXPORT gboolean
|
||||
gimp_module_register (GTypeModule *module)
|
||||
{
|
||||
gimp_input_device_store_get_type (module);
|
||||
linux_input_get_type (module);
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -86,10 +86,37 @@ static void gimp_input_device_store_device_removed (LibHalContext *ctx,
|
|||
const char *udi);
|
||||
|
||||
|
||||
static guint store_signals[LAST_SIGNAL] = { 0 };
|
||||
GType gimp_input_device_store_type = 0;
|
||||
static GtkListStoreClass *parent_class = NULL;
|
||||
static guint store_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
G_DEFINE_TYPE (GimpInputDeviceStore,
|
||||
gimp_input_device_store, GTK_TYPE_LIST_STORE)
|
||||
|
||||
GType
|
||||
gimp_input_device_store_get_type (GTypeModule *module)
|
||||
{
|
||||
if (! gimp_input_device_store_type)
|
||||
{
|
||||
const GTypeInfo info =
|
||||
{
|
||||
sizeof (GimpInputDeviceStoreClass),
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) gimp_input_device_store_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GimpInputDeviceStore),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gimp_input_device_store_init
|
||||
};
|
||||
|
||||
gimp_input_device_store_type =
|
||||
g_type_module_register_type (module, GTK_TYPE_LIST_STORE,
|
||||
"GimpInputDeviceStore",
|
||||
&info, 0);
|
||||
}
|
||||
|
||||
return gimp_input_device_store_type;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
|
@ -97,6 +124,8 @@ gimp_input_device_store_class_init (GimpInputDeviceStoreClass *klass)
|
|||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
store_signals[DEVICE_ADDED] =
|
||||
g_signal_new ("device-added",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
|
@ -179,7 +208,7 @@ gimp_input_device_store_finalize (GObject *object)
|
|||
store->context = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (gimp_input_device_store_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
|
||||
|
@ -348,7 +377,7 @@ gimp_input_device_store_get_device_file (GimpInputDeviceStore *store,
|
|||
#else
|
||||
|
||||
GType
|
||||
gimp_input_device_store_get_type (void)
|
||||
gimp_input_device_store_get_type (GTypeModule *module)
|
||||
{
|
||||
return G_TYPE_NONE;
|
||||
}
|
||||
|
|
|
@ -23,14 +23,17 @@
|
|||
#define __GIMP_INPUT_DEVICE_STORE_H__
|
||||
|
||||
|
||||
#define GIMP_TYPE_INPUT_DEVICE_STORE (gimp_input_device_store_get_type ())
|
||||
#define GIMP_TYPE_INPUT_DEVICE_STORE (gimp_input_device_store_type)
|
||||
#define GIMP_INPUT_DEVICE_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_INPUT_DEVICE_STORE, GimpInputDeviceStore))
|
||||
#define GIMP_IS_INPUT_DEVICE_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_INPUT_DEVICE_STORE))
|
||||
|
||||
typedef struct _GimpInputDeviceStore GimpInputDeviceStore;
|
||||
|
||||
|
||||
GType gimp_input_device_store_get_type (void) G_GNUC_CONST;
|
||||
extern GType gimp_input_device_store_type;
|
||||
|
||||
GType gimp_input_device_store_get_type (GTypeModule *module);
|
||||
|
||||
|
||||
GimpInputDeviceStore * gimp_input_device_store_new (void);
|
||||
gchar * gimp_input_device_store_get_device_file (GimpInputDeviceStore *store,
|
||||
|
|
Loading…
Reference in New Issue