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

events.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_EVENTS_HH 00025 #define GFC_GDK_EVENTS_HH 00026 00027 #ifndef GFC_G_BOXED_HH 00028 #include <gfc/glib/boxed.hh> 00029 #endif 00030 00031 #ifndef GFC_GDK_TYPES_HH 00032 #include <gfc/gdk/types.hh> 00033 #endif 00034 00035 namespace GFC { 00036 00037 namespace Gdk { 00038 00039 class Device; 00040 class Display; 00041 class DragContext; 00042 class EventAny; 00043 class EventExpose; 00044 class EventVisibility; 00045 class EventMotion; 00046 class EventButton; 00047 class EventScroll; 00048 class EventKey; 00049 class EventCrossing; 00050 class EventFocus; 00051 class EventConfigure; 00052 class EventProperty; 00053 class EventSelection; 00054 class EventProximity; 00055 class EventClient; 00056 class EventSetting; 00057 class EventWindowState; 00058 class EventDND; 00059 class Keyval; 00060 class Region; 00061 class Screen; 00062 class Window; 00063 00066 00067 enum EventType 00068 { 00069 NOTHING = GDK_NOTHING, 00071 00072 DELETE = GDK_DELETE, 00075 00076 DESTROY = GDK_DESTROY, 00078 00079 EXPOSE = GDK_EXPOSE, 00081 00082 MOTION_NOTIFY = GDK_MOTION_NOTIFY, 00084 00085 BUTTON_PRESS = GDK_BUTTON_PRESS, 00087 00088 TWO_BUTTON_PRESS = GDK_2BUTTON_PRESS, 00091 00092 THREE_BUTTON_PRESS = GDK_3BUTTON_PRESS, 00095 00096 BUTTON_RELEASE = GDK_BUTTON_RELEASE, 00098 00099 KEY_PRESS = GDK_KEY_PRESS, 00101 00102 KEY_RELEASE = GDK_KEY_RELEASE, 00104 00105 ENTER_NOTIFY = GDK_ENTER_NOTIFY, 00107 00108 LEAVE_NOTIFY = GDK_LEAVE_NOTIFY, 00110 00111 FOCUS_CHANGE = GDK_FOCUS_CHANGE, 00113 00114 CONFIGURE = GDK_CONFIGURE, 00117 00118 MAP = GDK_MAP, 00120 00121 UNMAP = GDK_UNMAP, 00123 00124 PROPERTY_NOTIFY = GDK_PROPERTY_NOTIFY, 00126 00127 SELECTION_CLEAR = GDK_SELECTION_CLEAR, 00129 00130 SELECTION_REQUEST = GDK_SELECTION_REQUEST, 00132 00133 SELECTION_NOTIFY = GDK_SELECTION_NOTIFY, 00135 00136 PROXIMITY_IN = GDK_PROXIMITY_IN, 00138 00139 PROXIMITY_OUT = GDK_PROXIMITY_OUT, 00141 00142 DRAG_ENTER = GDK_DRAG_ENTER, 00144 00145 DRAG_LEAVE = GDK_DRAG_LEAVE, 00147 00148 DRAG_MOTION = GDK_DRAG_MOTION, 00150 00151 DRAG_STATUS = GDK_DRAG_STATUS, 00153 00154 DROP_START = GDK_DROP_START, 00156 00157 DROP_FINISHED = GDK_DROP_FINISHED, 00159 00160 CLIENT_EVENT = GDK_CLIENT_EVENT, 00162 00163 VISIBILITY_NOTIFY = GDK_VISIBILITY_NOTIFY, 00165 00166 NO_EXPOSE = GDK_NO_EXPOSE, 00169 00170 SCROLL = GDK_SCROLL, 00172 00173 WINDOW_STATE = GDK_WINDOW_STATE, 00176 00177 SETTING = GDK_SETTING 00179 }; 00180 00192 00193 enum EventMask 00194 { 00195 EXPOSURE_MASK = GDK_EXPOSURE_MASK, 00196 POINTER_MOTION_MASK = GDK_POINTER_MOTION_MASK, 00197 POINTER_MOTION_HINT_MASK = GDK_POINTER_MOTION_HINT_MASK, 00198 BUTTON_MOTION_MASK = GDK_BUTTON_MOTION_MASK, 00199 BUTTON1_MOTION_MASK = GDK_BUTTON1_MOTION_MASK, 00200 BUTTON2_MOTION_MASK = GDK_BUTTON2_MOTION_MASK, 00201 BUTTON3_MOTION_MASK = GDK_BUTTON3_MOTION_MASK, 00202 BUTTON_PRESS_MASK = GDK_BUTTON_PRESS_MASK, 00203 BUTTON_RELEASE_MASK = GDK_BUTTON_RELEASE_MASK, 00204 KEY_PRESS_MASK = GDK_KEY_PRESS_MASK, 00205 KEY_RELEASE_MASK = GDK_KEY_RELEASE_MASK, 00206 ENTER_NOTIFY_MASK = GDK_ENTER_NOTIFY_MASK, 00207 LEAVE_NOTIFY_MASK = GDK_LEAVE_NOTIFY_MASK, 00208 FOCUS_CHANGE_MASK = GDK_FOCUS_CHANGE_MASK, 00209 STRUCTURE_MASK = GDK_STRUCTURE_MASK, 00210 PROPERTY_CHANGE_MASK = GDK_PROPERTY_CHANGE_MASK, 00211 VISIBILITY_NOTIFY_MASK = GDK_VISIBILITY_NOTIFY_MASK, 00212 PROXIMITY_IN_MASK = GDK_PROXIMITY_IN_MASK, 00213 PROXIMITY_OUT_MASK = GDK_PROXIMITY_OUT_MASK, 00214 SUBSTRUCTURE_MASK = GDK_SUBSTRUCTURE_MASK, 00215 SCROLL_MASK = GDK_SCROLL_MASK, 00216 ALL_EVENTS_MASK = GDK_ALL_EVENTS_MASK 00217 }; 00218 00220 00221 typedef unsigned int EventMaskField; 00222 00225 00226 enum VisibilityState 00227 { 00228 VISIBILITY_UNOBSCURED = GDK_VISIBILITY_UNOBSCURED, 00229 VISIBILITY_PARTIAL = GDK_VISIBILITY_PARTIAL, 00230 VISIBILITY_FULLY_OBSCURED = GDK_VISIBILITY_FULLY_OBSCURED 00231 }; 00232 00235 00236 enum ScrollDirection 00237 { 00238 SCROLL_UP = GDK_SCROLL_UP, 00239 SCROLL_DOWN = GDK_SCROLL_DOWN, 00240 SCROLL_LEFT = GDK_SCROLL_LEFT, 00241 SCROLL_RIGHT = GDK_SCROLL_RIGHT 00242 }; 00243 00247 00248 enum NotifyType 00249 { 00250 NOTIFY_ANCESTOR = GDK_NOTIFY_ANCESTOR, 00252 00253 NOTIFY_VIRTUAL = GDK_NOTIFY_VIRTUAL, 00255 00256 NOTIFY_INFERIOR = GDK_NOTIFY_INFERIOR, 00258 00259 NOTIFY_NONLINEAR = GDK_NOTIFY_NONLINEAR, 00261 00262 NOTIFY_NONLINEAR_VIRTUAL = GDK_NOTIFY_NONLINEAR_VIRTUAL, 00266 00267 NOTIFY_UNKNOWN = GDK_NOTIFY_UNKNOWN 00269 }; 00270 00273 00274 enum CrossingMode 00275 { 00276 CROSSING_NORMAL = GDK_CROSSING_NORMAL, 00277 CROSSING_GRAB = GDK_CROSSING_GRAB, 00278 CROSSING_UNGRAB = GDK_CROSSING_UNGRAB 00279 }; 00280 00283 00284 enum PropertyState 00285 { 00286 PROPERTY_NEW_VALUE = GDK_PROPERTY_NEW_VALUE, 00287 PROPERTY_DELETE = GDK_PROPERTY_DELETE 00288 }; 00289 00292 00293 enum WindowState 00294 { 00295 WINDOW_STATE_WITHDRAWN = GDK_WINDOW_STATE_WITHDRAWN, 00296 WINDOW_STATE_ICONIFIED = GDK_WINDOW_STATE_ICONIFIED, 00297 WINDOW_STATE_MAXIMIZED = GDK_WINDOW_STATE_MAXIMIZED, 00298 WINDOW_STATE_STICKY = GDK_WINDOW_STATE_STICKY, 00299 WINDOW_STATE_FULLSCREEN = GDK_WINDOW_STATE_FULLSCREEN, 00300 WINDOW_STATE_ABOVE = GDK_WINDOW_STATE_ABOVE, 00301 WINDOW_STATE_BELOW = GDK_WINDOW_STATE_BELOW 00302 }; 00303 00305 00306 typedef unsigned int WindowStateField; 00307 00310 00311 enum SettingAction 00312 { 00313 SETTING_ACTION_NEW = GDK_SETTING_ACTION_NEW, 00314 SETTING_ACTION_CHANGED = GDK_SETTING_ACTION_CHANGED, 00315 SETTING_ACTION_DELETED = GDK_SETTING_ACTION_DELETED 00316 }; 00317 00320 00321 bool get_show_events(); 00323 00324 bool events_pending(); 00327 00328 void set_show_events(bool show_events); 00334 00336 00343 00344 class Event : public G::Boxed 00345 { 00346 protected: 00347 Event(); 00348 00349 public: 00352 00353 explicit Event(EventType type); 00356 00357 explicit Event(GdkEvent* event); 00365 00366 Event(GdkEvent* event, bool copy); 00377 00378 Event(const Event& src); 00381 00382 ~Event(); 00384 00385 Event& operator=(const Event& src); 00388 00392 00393 GdkEvent* gdk_event() const; 00395 00396 operator GdkEvent* () const; 00398 00399 EventType type() const; 00401 00402 EventAny* any() const; 00404 00405 EventExpose* expose() const; 00407 00408 EventVisibility* visibility() const; 00411 00412 EventMotion* motion() const; 00415 00416 EventButton* button() const; 00419 00420 EventScroll* scroll() const; 00423 00424 EventKey* key() const; 00427 00428 EventCrossing* crossing() const; 00431 00432 EventFocus* focus_change() const; 00435 00436 EventConfigure* configure() const; 00439 00440 EventProperty* property() const; 00443 00444 EventSelection* selection() const; 00447 00448 EventProximity* proximity() const; 00451 00452 EventClient* client() const; 00455 00456 EventSetting* setting() const; 00459 00460 EventWindowState* window_state() const; 00463 00464 EventDND* dnd() const; 00467 00468 unsigned int get_time() const; 00473 00474 bool get_state(ModifierTypeField *state) const; 00482 00483 bool get_axis(AxisUse axis_use, double *value) const; 00488 00489 bool get_coords(double *x_win, double *y_win) const; 00494 00495 bool get_root_coords(double *x_root, double *y_root) const; 00500 00501 Screen* get_screen() const; 00508 00510 00511 static Pointer<Event> get(); 00515 00516 static Pointer<EventExpose> get_graphics_expose(const Window& window); 00522 00523 static Pointer<Event> peek(); 00527 00530 00531 void put(); 00534 00535 bool send_client_message(GdkNativeWindow winid, const Display *display = 0); 00544 00545 void send_clientmessage_toall(); 00553 00554 void set_screen(Screen& screen); 00557 00559 }; 00560 00566 00567 class EventAny : public Event 00568 { 00569 public: 00572 00573 GdkEventAny* gdk_event_any() const; 00575 00576 Window* window() const; 00578 00579 bool send_event() const; 00581 00583 }; 00584 00592 00593 class EventExpose : public EventAny 00594 { 00595 public: 00598 00599 GdkEventExpose* gdk_event_expose() const; 00601 00602 const Rectangle& area() const; 00604 00605 Pointer<Region> region() const; 00607 00608 int count() const; 00613 00615 }; 00616 00623 00624 class EventVisibility : public EventAny 00625 { 00626 public: 00629 00630 GdkEventVisibility* gdk_event_visibility() const; 00632 00633 VisibilityState state() const; 00635 00637 }; 00638 00645 00646 class EventMotion : public EventAny 00647 { 00648 public: 00651 00652 GdkEventMotion* gdk_event_motion() const; 00654 00655 unsigned int time() const; 00657 00658 double x() const; 00660 00661 double y() const; 00663 00664 int x_int() const; 00666 00667 int y_int() const; 00669 00670 double* axes() const; 00672 00673 ModifierTypeField state() const; 00676 00677 bool is_hint() const; 00679 00680 Device* device() const; 00682 00683 double x_root() const; 00685 00686 double y_root() const; 00688 00690 }; 00691 00724 00725 class EventButton : public EventAny 00726 { 00727 public: 00730 00731 GdkEventButton* gdk_event_button() const; 00733 00734 unsigned int time() const; 00736 00737 double x() const; 00739 00740 double y() const; 00742 00743 int x_int() const; 00745 00746 int y_int() const; 00748 00749 double* axes() const; 00751 00752 ModifierTypeField state() const; 00755 00756 unsigned int button() const; 00761 00762 Device* device() const; 00764 00765 double x_root() const; 00767 00768 double y_root() const; 00770 00772 }; 00773 00782 00783 class EventScroll : public EventAny 00784 { 00785 public: 00788 00789 GdkEventScroll* gdk_event_scroll() const; 00791 00792 unsigned int time() const; 00794 00795 double x() const; 00797 00798 double y() const; 00800 00801 int x_int() const; 00803 00804 int y_int() const; 00806 00807 ModifierTypeField state() const; 00810 00811 ScrollDirection direction() const; 00813 00814 Device* device() const; 00816 00817 double x_root() const; 00819 00820 double y_root() const; 00822 00824 }; 00825 00832 00833 class EventKey : public EventAny 00834 { 00835 public: 00838 00839 GdkEventKey* gdk_event_key() const; 00841 00842 unsigned int time() const; 00844 00845 ModifierTypeField state() const; 00848 00849 Keyval keyval() const; 00852 00853 unsigned short hardware_keycode() const; 00855 00856 unsigned char group() const; 00858 00860 }; 00861 00868 00869 class EventCrossing : public EventAny 00870 { 00871 public: 00874 00875 GdkEventCrossing* gdk_event_crossing() const; 00877 00878 Window* subwindow() const; 00880 00881 unsigned int time() const; 00883 00884 double x() const; 00886 00887 double y() const; 00889 00890 int x_int() const; 00892 00893 int y_int() const; 00895 00896 double x_root() const; 00898 00899 double y_root() const; 00901 00902 int x_root_int() const; 00904 00905 int y_root_int() const; 00907 00908 CrossingMode mode() const; 00910 00911 NotifyType detail() const; 00914 00915 bool focus() const; 00917 00918 ModifierTypeField state() const; 00921 00923 }; 00924 00931 00932 class EventFocus : public EventAny 00933 { 00934 public: 00937 00938 GdkEventFocus* gdk_event_focus() const; 00940 00941 bool in() const; 00943 00944 bool out() const; 00946 00948 }; 00949 00956 00957 class EventConfigure : public EventAny 00958 { 00959 public: 00962 00963 GdkEventConfigure* gdk_event_configure() const; 00965 00966 int x() const; 00968 00969 int y() const; 00971 00972 int width() const; 00974 00975 int height() const; 00977 00979 }; 00980 00987 00988 class EventProperty : public EventAny 00989 { 00990 public: 00993 00994 GdkEventProperty* gdk_event_property() const; 00996 00997 Atom atom() const; 00999 01000 unsigned int time() const; 01002 01003 PropertyState state() const; 01005 01007 }; 01008 01016 01017 class EventSelection : public EventAny 01018 { 01019 public: 01022 01023 GdkEventSelection* gdk_event_selection() const; 01025 01026 Atom selection() const; 01028 01029 Atom target() const; 01031 01032 Atom property() const; 01034 01035 unsigned int time() const; 01037 01038 GdkNativeWindow requestor() const; 01040 01042 }; 01043 01054 01055 class EventProximity : public EventAny 01056 { 01057 public: 01060 01061 GdkEventProximity* gdk_event_proximity() const; 01063 01064 unsigned int time() const; 01066 01067 Device* device() const; 01069 01071 }; 01072 01079 01080 class EventClient : public EventAny 01081 { 01082 public: 01085 01086 GdkEventClient* gdk_event_client() const; 01088 01089 Atom message_type() const; 01091 01092 unsigned short data_format() const; 01094 01095 const char* char_data() const; 01097 01098 const short* short_data() const; 01100 01101 const long* long_data() const; 01103 01105 }; 01106 01113 01114 class EventSetting : public EventAny 01115 { 01116 public: 01119 01120 GdkEventSetting* gdk_event_setting() const; 01122 01123 SettingAction action() const; 01125 01126 String name() const; 01128 01130 }; 01131 01138 01139 class EventWindowState : public EventAny 01140 { 01141 public: 01144 01145 GdkEventWindowState* gdk_event_window_state() const; 01147 01148 WindowStateField changed_mask() const; 01150 01151 WindowStateField new_window_state() const; 01153 01155 }; 01156 01163 01164 class EventDND : public EventAny 01165 { 01166 public: 01169 01170 GdkEventDND* gdk_event_dnd() const; 01172 01173 DragContext* context() const; 01175 01176 unsigned int time() const; 01178 01179 short x_root() const; 01182 01183 short y_root() const; 01186 01188 }; 01189 01190 } // namespace Gdk 01191 01192 } // namespace GFC 01193 01194 #include <gfc/gdk/inline/event.inl> 01195 01196 #endif // GFC_GDK_EVENTS_HH 01197

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