Main Page - Header
Author: The Inti Development Team

Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# input.h

Go to the documentation of this file.

    00001 /*  Inti: Integrated Foundation Classes
    00002  *  Copyright (C) 2002-2003 The Inti Development Team.
    00003  *
    00004  *  This program is free software; you can redistribute it and/or modify
    00005  *  it under the terms of the GNU General Public License as published by
    00006  *  the Free Software Foundation; either version 2 of the License, or
    00007  *  (at your option) any later version.
    00008  *
    00009  *  This program is distributed in the hope that it will be useful,
    00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012  *  GNU Library General Public License for more details.
    00013  *
    00014  *  You should have received a copy of the GNU Library General Public License
    00015  *  along with this program; if not, write to the Free Software
    00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00017  */
    00018
    00023
    00024 #ifndef INTI_GDK_INPUT_H
    00025 #define INTI_GDK_INPUT_H
    00026
    00027 #ifndef INTI_G_OBJECT_H
    00028 #include <inti/glib/object.h>
    00029 #endif
    00030
    00031 #ifndef INTI_GDK_TYPES
    00032 #include <inti/gdk/types.h>
    00033 #endif
    00034
    00035 #ifndef _CPP_VECTOR
    00036 #include <vector>
    00037 #endif
    00038
    00039 namespace Inti {
    00040
    00041 namespace Gdk {
    00042
    00043 class Device;
    00044 class Display;
    00045 class Window;
    00046
    00049
    00050 enum InputSource
    00051 {
    00052         SOURCE_MOUSE = GDK_SOURCE_MOUSE,
    00055
    00056         SOURCE_PEN = GDK_SOURCE_PEN,
    00058
    00059         SOURCE_ERASER = GDK_SOURCE_ERASER,
    00062
    00063         SOURCE_CURSOR = GDK_SOURCE_CURSOR
    00065 };
    00066
    00069
    00070 enum InputMode
    00071 {
    00072         MODE_DISABLED = GDK_MODE_DISABLED,
    00074
    00075         MODE_SCREEN = GDK_MODE_SCREEN,
    00077
    00078         MODE_WINDOW = GDK_MODE_WINDOW
    00082 };
    00083
    00086
    00087 bool devices_list(std::vector<Device*>& devices);
    00094
    00096
    00146
    00147 class Device : public G::Object
    00148 {
    00149         friend class G::Object;
    00150
    00151         Device(const Device&);
    00152         Device& operator=(const Device&);
    00153
    00154 protected:
    00157
    00158         explicit Device(GdkDevice *device, bool reference = true);
    00165
    00167
    00168 public:
    00171
    00172         virtual ~Device();
    00174
    00178
    00179         GdkDevice* gdk_device() const { return (GdkDevice*)instance; }
    00181
    00182         GdkDeviceClass* gdk_device_class() const;
    00184
    00185         operator GdkDevice* () const;
    00187
    00188         String name() const;
    00190
    00191         InputSource source() const;
    00193
    00194         InputMode mode() const;
    00196
    00197         bool has_cursor() const;
    00199
    00200         void get_state(Window& window, double *axes, ModifierTypeField *mask) const;
    00205
    00206         bool get_history(Window& window, unsigned long start, unsigned long stop, GdkTimeCoord ***events, int *n_events) const;
    00221
    00222         bool get_axis(double *axes, AxisUse use, double *value) const;
    00229
    00231
    00232         static void free_history(GdkTimeCoord **events, int n_events);
    00236
    00237         static Device* get_core_pointer(const Display *display = 0);
    00242
    00245
    00246         void set_source(InputSource source);
    00249
    00250         bool set_mode(InputMode mode);
    00257
    00258         void set_key(unsigned int index, unsigned int keyval, ModifierTypeField modifiers);
    00263
    00264         void set_axis_use(unsigned int index, AxisUse use);
    00268
    00270 };
    00271
    00272 } // namespace Gdk
    00273
    00274 } // namespace Inti
    00275
    00276 #endif // INTI_GDK_INPUT_H
    00277

Main Page - Footer