Remove. (gdk_device_get_type): Drop class init function. The X11 version

2007-02-19  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkinput.c
	(gdk_device_finalize, gdk_device_class_init): Remove.
	(gdk_device_get_type): Drop class init function. The X11 version
	doesn't have one either.
	(gdk_devices_list): Call gdk_display_list_devices() on _gdk_display.
	(gdk_display_list_devices): Check that the argument is
	_gdk_display.

	* gdk/win32/gdkinput-win32.h (GdkAxisInfo, GdkDevicePrivate):
	Cleanup: remove unused fields.
	* gdk/win32/gdkinput-win32.c: Corresponding changes. Fix function
	names in a few debugging printouts.


svn path=/trunk/; revision=17332
This commit is contained in:
Tor Lillqvist
2007-02-19 00:32:32 +00:00
committed by Tor Lillqvist
parent d7cc776d01
commit fcbf646cce
4 changed files with 50 additions and 86 deletions

View File

@@ -1,3 +1,18 @@
2007-02-19 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkinput.c
(gdk_device_finalize, gdk_device_class_init): Remove.
(gdk_device_get_type): Drop class init function. The X11 version
doesn't have one either.
(gdk_devices_list): Call gdk_display_list_devices() on _gdk_display.
(gdk_display_list_devices): Check that the argument is
_gdk_display.
* gdk/win32/gdkinput-win32.h (GdkAxisInfo, GdkDevicePrivate):
Cleanup: remove unused fields.
* gdk/win32/gdkinput-win32.c: Corresponding changes. Fix function
names in a few debugging printouts.
2007-02-18 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_visually):

View File

@@ -530,7 +530,7 @@ _gdk_input_wintab_init_check (void)
if (gdkdev->pktdata & PK_ORIENTATION)
gdkdev->info.num_axes += 2; /* x and y tilt */
(*p_WTInfoA) (WTI_CURSORS + cursorix, CSR_NPBTNMARKS, &gdkdev->npbtnmarks);
gdkdev->info.axes = g_new (GdkDeviceAxis, gdkdev->info.num_axes);
gdkdev->axes = g_new (GdkAxisInfo, gdkdev->info.num_axes);
gdkdev->last_axis_data = g_new (gint, gdkdev->info.num_axes);
@@ -538,12 +538,9 @@ _gdk_input_wintab_init_check (void)
k = 0;
if (gdkdev->pktdata & PK_X)
{
gdkdev->axes[k].xresolution =
gdkdev->axes[k].resolution = axis_x.axResolution / 65535.;
gdkdev->axes[k].xmin_value =
gdkdev->axes[k].min_value = axis_x.axMin;
gdkdev->axes[k].xmax_value =
gdkdev->axes[k].max_value = axis_x.axMax;
gdkdev->axes[k].resolution = axis_x.axResolution / 65535.;
gdkdev->axes[k].min_value = axis_x.axMin;
gdkdev->axes[k].max_value = axis_x.axMax;
gdkdev->info.axes[k].use = GDK_AXIS_X;
gdkdev->info.axes[k].min = axis_x.axMin;
gdkdev->info.axes[k].max = axis_x.axMax;
@@ -551,12 +548,9 @@ _gdk_input_wintab_init_check (void)
}
if (gdkdev->pktdata & PK_Y)
{
gdkdev->axes[k].xresolution =
gdkdev->axes[k].resolution = axis_y.axResolution / 65535.;
gdkdev->axes[k].xmin_value =
gdkdev->axes[k].min_value = axis_y.axMin;
gdkdev->axes[k].xmax_value =
gdkdev->axes[k].max_value = axis_y.axMax;
gdkdev->axes[k].resolution = axis_y.axResolution / 65535.;
gdkdev->axes[k].min_value = axis_y.axMin;
gdkdev->axes[k].max_value = axis_y.axMax;
gdkdev->info.axes[k].use = GDK_AXIS_Y;
gdkdev->info.axes[k].min = axis_y.axMin;
gdkdev->info.axes[k].max = axis_y.axMax;
@@ -564,12 +558,9 @@ _gdk_input_wintab_init_check (void)
}
if (gdkdev->pktdata & PK_NORMAL_PRESSURE)
{
gdkdev->axes[k].xresolution =
gdkdev->axes[k].resolution = axis_npressure.axResolution / 65535.;
gdkdev->axes[k].xmin_value =
gdkdev->axes[k].min_value = axis_npressure.axMin;
gdkdev->axes[k].xmax_value =
gdkdev->axes[k].max_value = axis_npressure.axMax;
gdkdev->axes[k].resolution = axis_npressure.axResolution / 65535.;
gdkdev->axes[k].min_value = axis_npressure.axMin;
gdkdev->axes[k].max_value = axis_npressure.axMax;
gdkdev->info.axes[k].use = GDK_AXIS_PRESSURE;
/* GIMP seems to expect values in the range 0-1 */
gdkdev->info.axes[k].min = 0.0; /*axis_npressure.axMin;*/
@@ -587,12 +578,9 @@ _gdk_input_wintab_init_check (void)
/* Wintab gives us aximuth and altitude, which
* we convert to x and y tilt in the -1000..1000 range
*/
gdkdev->axes[k].xresolution =
gdkdev->axes[k].resolution = 1000;
gdkdev->axes[k].xmin_value =
gdkdev->axes[k].min_value = -1000;
gdkdev->axes[k].xmax_value =
gdkdev->axes[k].max_value = 1000;
gdkdev->axes[k].resolution = 1000;
gdkdev->axes[k].min_value = -1000;
gdkdev->axes[k].max_value = 1000;
gdkdev->info.axes[k].use = axis;
gdkdev->info.axes[k].min = -1000;
gdkdev->info.axes[k].max = 1000;
@@ -606,11 +594,8 @@ _gdk_input_wintab_init_check (void)
gdkdev->info.name,
gdkdev->info.num_axes));
for (i = 0; i < gdkdev->info.num_axes; i++)
GDK_NOTE (INPUT, g_print ("... axis %d: %d--%d@%d (%d--%d@%d)\n",
GDK_NOTE (INPUT, g_print ("... axis %d: %d--%d@%d\n",
i,
gdkdev->axes[i].xmin_value,
gdkdev->axes[i].xmax_value,
gdkdev->axes[i].xresolution,
gdkdev->axes[i].min_value,
gdkdev->axes[i].max_value,
gdkdev->axes[i].resolution));
@@ -887,7 +872,7 @@ _gdk_input_other_event (GdkEvent *event,
display = gdk_drawable_get_display (window);
GDK_NOTE (EVENTS_OR_INPUT,
g_print ("gdk_input_win32_other_event: window=%p %+d%+d\n",
g_print ("_gdk_input_other_event: window=%p %+d%+d\n",
GDK_WINDOW_HWND (window), x, y));
if (msg->message == WT_PACKET)
@@ -1175,7 +1160,7 @@ _gdk_input_grab_pointer (GdkWindow *window,
new_window = NULL;
need_ungrab = FALSE;
GDK_NOTE (INPUT, g_print ("gdk_input_win32_grab_pointer: %p %d %p\n",
GDK_NOTE (INPUT, g_print ("_gdk_input_grab_pointer: %p %d %p\n",
GDK_WINDOW_HWND (window),
owner_events,
(confine_to ? GDK_WINDOW_HWND (confine_to) : 0)));
@@ -1263,7 +1248,7 @@ _gdk_input_ungrab_pointer (guint32 time)
GdkDevicePrivate *gdkdev;
GList *tmp_list;
GDK_NOTE (INPUT, g_print ("gdk_input_win32_ungrab_pointer\n"));
GDK_NOTE (INPUT, g_print ("_gdk_input_ungrab_pointer\n"));
tmp_list = _gdk_input_windows;
while (tmp_list)

View File

@@ -37,13 +37,7 @@ typedef struct _GdkInputWindow GdkInputWindow;
/* information about a device axis */
struct _GdkAxisInfo
{
/* reported x resolution */
gint xresolution;
/* reported x minimum/maximum values */
gint xmin_value, xmax_value;
/* calibrated resolution (for aspect ration) - only relative values
/* calibrated resolution (for aspect ratio) - only relative values
between axes used */
gint resolution;
@@ -56,8 +50,6 @@ struct _GdkDeviceClass
GObjectClass parent_class;
};
#define GDK_INPUT_NUM_EVENTC 6
struct _GdkDevicePrivate
{
GdkDevice info;
@@ -65,33 +57,16 @@ struct _GdkDevicePrivate
/* information about the axes */
GdkAxisInfo *axes;
/* minimum key code for device */
gint min_keycode;
int buttonpress_type, buttonrelease_type, keypress_type,
keyrelease_type, motionnotify_type, proximityin_type,
proximityout_type, changenotify_type;
/* true if we need to select a different set of events, but
can't because this is the core pointer */
gint needs_update;
/* Mask of buttons (used for button grabs) */
gint button_state;
/* true if we've claimed the device as active. (used only for XINPUT_GXI) */
gint claimed;
gint *last_axis_data;
gint last_buttons;
/* WINTAB stuff: */
HCTX hctx;
/* Cursor number */
UINT cursor;
/* The cursor's CSR_PKTDATA */
WTPKT pktdata;
/* CSR_NPBTNMARKS */
UINT npbtnmarks[2];
/* Azimuth and altitude axis */
AXIS orientation_axes[2];
};

View File

@@ -35,8 +35,8 @@
#include "gdkdisplay.h"
#include "gdkinput.h"
#include "gdkprivate.h"
#include "gdkprivate-win32.h"
#include "gdkinput-win32.h"
static GdkDeviceAxis gdk_input_core_axes[] = {
@@ -66,18 +66,6 @@ _gdk_init_input_core (GdkDisplay *display)
display->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)
{
@@ -86,20 +74,20 @@ gdk_device_get_type (void)
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,
};
{
sizeof (GdkDeviceClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) NULL,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GdkDevicePrivate),
0, /* n_preallocs */
(GInstanceInitFunc) NULL,
};
object_type = g_type_register_static (G_TYPE_OBJECT,
"GdkDevice",
g_intern_static_string ("GdkDevice"),
&object_info, 0);
}
@@ -109,13 +97,14 @@ gdk_device_get_type (void)
GList *
gdk_devices_list (void)
{
_gdk_input_wintab_init_check ();
return _gdk_input_devices;
return gdk_display_list_devices (_gdk_display);
}
GList *
gdk_display_list_devices (GdkDisplay *dpy)
{
g_return_val_if_fail (dpy == _gdk_display, NULL);
_gdk_input_wintab_init_check ();
return _gdk_input_devices;
}