GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

input.hh

Go to the documentation of this file.
00001 /* GFC-UI: GTK+ Foundation Classes (User Interface Library) 00002 * Copyright (C) 2002-2004 The GFC 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 GFC_GDK_INPUT_HH 00025 #define GFC_GDK_INPUT_HH 00026 00027 #ifndef GFC_G_OBJECT_HH 00028 #include <gfc/glib/object.hh> 00029 #endif 00030 00031 #ifndef GFC_GDK_TYPES_HH 00032 #include <gfc/gdk/types.hh> 00033 #endif 00034 00035 #ifndef _CPP_VECTOR 00036 #include <vector> 00037 #endif 00038 00039 namespace GFC { 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 owns_reference = true); 00165 00167 00168 public: 00171 00172 virtual ~Device(); 00174 00178 00179 GdkDevice* gdk_device() const; 00181 00182 operator GdkDevice* () const; 00184 00185 String name() const; 00187 00188 InputSource source() const; 00190 00191 InputMode mode() const; 00193 00194 bool has_cursor() const; 00196 00197 void get_state(Window& window, double *axes, ModifierTypeField *mask) const; 00202 00203 bool get_history(Window& window, unsigned long start, unsigned long stop, GdkTimeCoord ***events, int *n_events) const; 00218 00219 bool get_axis(double *axes, AxisUse use, double *value) const; 00226 00228 00229 static void free_history(GdkTimeCoord **events, int n_events); 00233 00234 static Device* get_core_pointer(const Display *display = 0); 00239 00242 00243 void set_source(InputSource source); 00246 00247 bool set_mode(InputMode mode); 00254 00255 void set_key(unsigned int index, unsigned int keyval, ModifierTypeField modifiers); 00260 00261 void set_axis_use(unsigned int index, AxisUse use); 00265 00267 }; 00268 00269 } // namespace Gdk 00270 00271 } // namespace GFC 00272 00273 #include <gfc/gdk/inline/input.inl> 00274 00275 #endif // GFC_GDK_INPUT_HH 00276

Generated on Tue Aug 24 00:34:31 2004 for GFC-UI by doxygen 1.3.8