Convert GdkVisual to a GObject.
2001-06-29 Alex Larsson <alexl@redhat.com> * gdk/gdkvisual.h: * gdk/gdkcolor.c: * gdk/x11/gdkx.h: * gdk/x11/gdkvisual-x11.c: Convert GdkVisual to a GObject. * gdk/gdkinput.h: * gdk/gdkevents.c: * gdk/x11/gdkinputprivate.h: * gdk/x11/gdkinput-gxi.c: * gdk/x11/gdkinput-none.c: * gdk/x11/gdkinput-x11.c: * gdk/x11/gdkinput-xfree.c: * gdk/x11/gdkinput.c: Convert GdkDevice to a GObject.
This commit is contained in:
		 Alex Larsson
					Alex Larsson
				
			
				
					committed by
					
						 Alexander Larsson
						Alexander Larsson
					
				
			
			
				
	
			
			
			 Alexander Larsson
						Alexander Larsson
					
				
			
						parent
						
							ee5ff7ddc2
						
					
				
				
					commit
					43696e841d
				
			| @ -39,21 +39,7 @@ static GdkDeviceAxis gdk_input_core_axes[] = { | ||||
|   { GDK_AXIS_Y, 0, 0 } | ||||
| }; | ||||
|  | ||||
| static const GdkDevice gdk_input_core_info = | ||||
| { | ||||
|   "Core Pointer", | ||||
|   GDK_SOURCE_MOUSE, | ||||
|   GDK_MODE_SCREEN, | ||||
|   TRUE, | ||||
|    | ||||
|   2, | ||||
|   gdk_input_core_axes, | ||||
|  | ||||
|   0, | ||||
|   NULL | ||||
| }; | ||||
|  | ||||
| GdkDevice *gdk_core_pointer = (GdkDevice *)&gdk_input_core_info; | ||||
| GdkDevice *gdk_core_pointer = NULL; | ||||
|   | ||||
| /* Global variables  */ | ||||
|  | ||||
| @ -65,6 +51,61 @@ gint              gdk_input_ignore_core; | ||||
| GList            *gdk_input_devices; | ||||
| GList            *gdk_input_windows; | ||||
|  | ||||
| void | ||||
| _gdk_init_input_core (void) | ||||
| { | ||||
|   gdk_core_pointer = g_object_new (GDK_TYPE_DEVICE, NULL); | ||||
|    | ||||
|   gdk_core_pointer->name = "Core Pointer"; | ||||
|   gdk_core_pointer->source = GDK_SOURCE_MOUSE; | ||||
|   gdk_core_pointer->mode = GDK_MODE_SCREEN; | ||||
|   gdk_core_pointer->has_cursor = TRUE; | ||||
|   gdk_core_pointer->num_axes = 2; | ||||
|   gdk_core_pointer->axes = gdk_input_core_axes; | ||||
|   gdk_core_pointer->num_keys = 0; | ||||
|   gdk_core_pointer->keys = NULL; | ||||
| } | ||||
|  | ||||
| static void | ||||
| gdk_device_finalize (GObject *object) | ||||
| { | ||||
|   g_error ("A GdkDevice object was finalized. This should not happen"); | ||||
| } | ||||
|  | ||||
| static void | ||||
| gdk_device_class_init (GObjectClass *class) | ||||
| { | ||||
|   class->finalize = gdk_device_finalize; | ||||
| } | ||||
|  | ||||
| GType | ||||
| gdk_device_get_type (void) | ||||
| { | ||||
|   static GType object_type = 0; | ||||
|  | ||||
|   if (!object_type) | ||||
|     { | ||||
|       static const GTypeInfo object_info = | ||||
|       { | ||||
|         sizeof (GdkDeviceClass), | ||||
|         (GBaseInitFunc) NULL, | ||||
|         (GBaseFinalizeFunc) NULL, | ||||
|         (GClassInitFunc) gdk_device_class_init, | ||||
|         NULL,           /* class_finalize */ | ||||
|         NULL,           /* class_data */ | ||||
|         sizeof (GdkDevicePrivate), | ||||
|         0,              /* n_preallocs */ | ||||
|         (GInstanceInitFunc) NULL, | ||||
|       }; | ||||
|        | ||||
|       object_type = g_type_register_static (G_TYPE_OBJECT, | ||||
|                                             "GdkDevice", | ||||
|                                             &object_info, 0); | ||||
|     } | ||||
|    | ||||
|   return object_type; | ||||
| } | ||||
|  | ||||
| GList * | ||||
| gdk_devices_list (void) | ||||
| { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user