]> Pileus Git - ~andy/gtk/blob - gdk/linux-fb/gdkinput-none.c
Fixes #136082 and #135265, patch by Morten Welinder.
[~andy/gtk] / gdk / linux-fb / gdkinput-none.c
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 Lesser 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  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #include <config.h>
21 #include "gdkinputprivate.h"
22
23 /*
24  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
25  * file for a list of people on the GTK+ Team.  See the ChangeLog
26  * files for a list of changes.  These files are distributed with
27  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
28  */
29
30 static void gdk_input_none_get_pointer (GdkWindow       *window,
31                                         guint32   deviceid,
32                                         gdouble         *x,
33                                         gdouble         *y,
34                                         gdouble         *pressure,
35                                         gdouble         *xtilt,
36                                         gdouble         *ytilt,
37                                         GdkModifierType *mask);
38
39 void
40 _gdk_input_init (void)
41 {
42   _gdk_init_input_core ();
43   gdk_input_vtable.set_mode           = NULL;
44   gdk_input_vtable.set_axes           = NULL;
45   gdk_input_vtable.set_key            = NULL;
46   gdk_input_vtable.motion_events      = NULL;
47   gdk_input_vtable.get_pointer        = gdk_input_none_get_pointer;
48   gdk_input_vtable.grab_pointer       = NULL;
49   gdk_input_vtable.ungrab_pointer     = NULL;
50   gdk_input_vtable.configure_event    = NULL;
51   gdk_input_vtable.enter_event        = NULL;
52   gdk_input_vtable.other_event        = NULL;
53   gdk_input_vtable.window_none_event  = NULL;
54   gdk_input_vtable.enable_window      = NULL;
55   gdk_input_vtable.disable_window     = NULL;
56
57   _gdk_input_devices = g_list_append (NULL, (GdkDeviceInfo *) &gdk_input_core_info);
58
59   _gdk_input_ignore_core = FALSE;
60 }
61
62 static void
63 gdk_input_none_get_pointer (GdkWindow       *window,
64                             guint32          deviceid,
65                             gdouble         *x,
66                             gdouble         *y,
67                             gdouble         *pressure,
68                             gdouble         *xtilt,
69                             gdouble         *ytilt,
70                             GdkModifierType *mask)
71 {
72   gint x_int, y_int;
73
74   gdk_window_get_pointer (window, &x_int, &y_int, mask);
75
76   if (x) *x = x_int;
77   if (y) *y = y_int;
78   if (pressure) *pressure = 0.5;
79   if (xtilt) *xtilt = 0;
80   if (ytilt) *ytilt = 0;
81 }