[gtk+/events-refactor: 735/1085] Implement gdk_device_set_mode().
- From: Carlos Garnacho <carlosg src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+/events-refactor: 735/1085] Implement gdk_device_set_mode().
- Date: Tue, 29 Sep 2009 10:47:21 +0000 (UTC)
commit 920b369d7ea6ccf524fd42b0bf17057fa8ef2a8b
Author: Carlos Garnacho <carlos lanedo com>
Date: Fri Aug 14 23:14:17 2009 +0200
Implement gdk_device_set_mode().
gdk/gdkdevice.c | 25 ++++++++++++++++++++++---
1 files changed, 22 insertions(+), 3 deletions(-)
---
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c
index 15a4c97..1051914 100644
--- a/gdk/gdkdevice.c
+++ b/gdk/gdkdevice.c
@@ -49,6 +49,7 @@ enum {
PROP_DISPLAY,
PROP_NAME,
PROP_INPUT_SOURCE,
+ PROP_INPUT_MODE,
PROP_HAS_CURSOR,
};
@@ -84,6 +85,14 @@ gdk_device_class_init (GdkDeviceClass *klass)
GDK_SOURCE_MOUSE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class,
+ PROP_INPUT_MODE,
+ g_param_spec_enum ("input-mode",
+ P_("Input mode for the device"),
+ P_("Input mode for the device"),
+ GDK_TYPE_INPUT_MODE,
+ GDK_MODE_DISABLED,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
PROP_HAS_CURSOR,
g_param_spec_boolean ("has-cursor",
P_("Whether the device has cursor"),
@@ -122,6 +131,9 @@ gdk_device_set_property (GObject *object,
case PROP_INPUT_SOURCE:
device->source = g_value_get_enum (value);
break;
+ case PROP_INPUT_MODE:
+ gdk_device_set_mode (device, g_value_get_enum (value));
+ break;
case PROP_HAS_CURSOR:
device->has_cursor = g_value_get_boolean (value);
break;
@@ -150,8 +162,10 @@ gdk_device_get_property (GObject *object,
device->name);
break;
case PROP_INPUT_SOURCE:
- g_value_set_enum (value,
- device->source);
+ g_value_set_enum (value, device->source);
+ break;
+ case PROP_INPUT_MODE:
+ g_value_set_enum (value, device->mode);
break;
case PROP_HAS_CURSOR:
g_value_set_boolean (value,
@@ -236,7 +250,12 @@ gboolean
gdk_device_set_mode (GdkDevice *device,
GdkInputMode mode)
{
- return FALSE;
+ g_return_val_if_fail (GDK_IS_DEVICE (device), FALSE);
+
+ device->mode = mode;
+ g_object_notify (G_OBJECT (device), "input-mode");
+
+ return TRUE;
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]