]> Pileus Git - ~andy/gtk/blob - gdk/gdkinputnone.h
Initial revision
[~andy/gtk] / gdk / gdkinputnone.h
1 /* GDK - The GIMP Drawing Kit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library 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 GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the Free
16  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17  */
18
19 #ifdef XINPUT_NONE
20
21 static void gdk_input_none_get_pointer (GdkWindow       *window,
22                                         guint32   deviceid,
23                                         gdouble         *x,
24                                         gdouble         *y,
25                                         gdouble         *pressure,
26                                         gdouble         *xtilt,
27                                         gdouble         *ytilt,
28                                         GdkModifierType *mask);
29
30 void
31 gdk_input_init ()
32 {
33   gdk_input_vtable.set_mode           = NULL;
34   gdk_input_vtable.set_axes           = NULL;
35   gdk_input_vtable.motion_events      = NULL;
36   gdk_input_vtable.get_pointer        = gdk_input_none_get_pointer;
37   gdk_input_vtable.grab_pointer       = NULL;
38   gdk_input_vtable.ungrab_pointer     = NULL;
39   gdk_input_vtable.configure_event    = NULL;
40   gdk_input_vtable.enter_event        = NULL;
41   gdk_input_vtable.other_event        = NULL;
42   gdk_input_vtable.window_none_event  = NULL;
43   gdk_input_vtable.enable_window      = NULL;
44   gdk_input_vtable.disable_window     = NULL;
45
46   gdk_input_devices = g_list_append (NULL, &gdk_input_core_info);
47
48   gdk_input_ignore_core = FALSE;
49 }
50
51 static void
52 gdk_input_none_get_pointer (GdkWindow       *window,
53                             guint32          deviceid,
54                             gdouble         *x,
55                             gdouble         *y,
56                             gdouble         *pressure,
57                             gdouble         *xtilt,
58                             gdouble         *ytilt,
59                             GdkModifierType *mask)
60 {
61   gint x_int, y_int;
62
63   gdk_window_get_pointer (window, &x_int, &y_int, mask);
64
65   if (x) *x = x_int;
66   if (y) *y = y_int;
67   if (pressure) *pressure = 0.5;
68   if (xtilt) *xtilt = 0;
69   if (ytilt) *ytilt = 0;
70 }
71
72 #endif /* XINPUT_NONE */