Back to index

texmacs  1.0.7.15
basic_event.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : basic_event.hpp
00004 * DESCRIPTION: The most common events
00005 * COPYRIGHT  : (C) 1999  Joris van der Hoeven
00006 *******************************************************************************
00007 * This software falls under the GNU general public license version 3 or later.
00008 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00009 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00010 ******************************************************************************/
00011 
00012 #ifndef BASIC_EVENT_H
00013 #define BASIC_EVENT_H
00014 #include "Widkit/event.hpp"
00015 #include "Widkit/wk_widget.hpp"
00016 #include "Widkit/Event/event_codes.hpp"
00017 
00018 /******************************************************************************
00019 * Attribute events
00020 ******************************************************************************/
00021 
00022 struct get_size_event_rep: public event_rep {
00023   SI& w; SI& h; int mode;
00024   get_size_event_rep (SI& w, SI& h, int mode);
00025   operator tree ();
00026 };
00027 EVENT(get_size_event);
00028 
00029 struct get_widget_event_rep: public event_rep {
00030   string which; wk_widget& w;
00031   get_widget_event_rep (string which, wk_widget& w);
00032   operator tree ();
00033 };
00034 EVENT(get_widget_event);
00035 
00036 struct set_widget_event_rep: public event_rep {
00037   string which; wk_widget w;
00038   set_widget_event_rep (string which, wk_widget w);
00039   operator tree ();
00040 };
00041 EVENT(set_widget_event);
00042 
00043 /******************************************************************************
00044 * Structure events
00045 ******************************************************************************/
00046 
00047 struct attach_window_event_rep: public event_rep {
00048   window win;
00049   attach_window_event_rep (window win);
00050   operator tree ();
00051 };
00052 EVENT(attach_window_event);
00053 
00054 struct position_event_rep: public event_rep {
00055   bool flag; SI ox, oy, w, h; gravity grav;
00056   position_event_rep ();
00057   position_event_rep (SI ox, SI oy, SI w, SI h, gravity grav);
00058   operator tree ();
00059 };
00060 tree as_tree (gravity grav);
00061 tm_ostream& operator << (tm_ostream& out, gravity grav);
00062 EVENT(position_event);
00063 
00064 struct move_event_rep: public event_rep {
00065   move_event_rep ();
00066   operator tree ();
00067 };
00068 EVENT(move_event);
00069 
00070 struct resize_event_rep: public event_rep {
00071   resize_event_rep ();
00072   operator tree ();
00073 };
00074 EVENT(resize_event);
00075 
00076 struct destroy_event_rep: public event_rep {
00077   destroy_event_rep ();
00078   operator tree ();
00079 };
00080 EVENT(destroy_event);
00081 
00082 /******************************************************************************
00083 * Input events
00084 ******************************************************************************/
00085 
00086 struct keypress_event_rep: public event_rep {
00087   string key; time_t t;
00088   keypress_event_rep (string key, time_t t);
00089   operator tree ();
00090 };
00091 EVENT(keypress_event);
00092 
00093 struct keyboard_focus_event_rep: public event_rep {
00094   bool flag; time_t t;
00095   keyboard_focus_event_rep (bool in_out_flag, time_t t);
00096   operator tree ();
00097 };
00098 EVENT(keyboard_focus_event);
00099 
00100 struct mouse_event_rep: public event_rep {
00101   string type; SI x, y; int mods; time_t t;
00102   mouse_event_rep (string type, SI x, SI y, int mods, time_t t);
00103   bool pressed (string which);
00104   operator tree ();
00105 };
00106 EVENT(mouse_event);
00107 
00108 struct alarm_event_rep: public event_rep {
00109   string message; time_t t;
00110   alarm_event_rep (string message, time_t t);
00111   operator tree ();
00112 };
00113 EVENT(alarm_event);
00114 
00115 /******************************************************************************
00116 * Output events
00117 ******************************************************************************/
00118 
00119 struct clear_event_rep: public event_rep {
00120   SI x1, y1, x2, y2;
00121   clear_event_rep (SI x1, SI y1, SI x2, SI y2);
00122   operator tree ();
00123 };
00124 EVENT(clear_event);
00125 
00126 struct repaint_event_rep: public event_rep {
00127   SI x1, y1, x2, y2; bool& stop;
00128   repaint_event_rep (SI x1, SI y1, SI x2, SI y2, bool& stop);
00129   operator tree ();
00130 };
00131 EVENT(repaint_event);
00132 
00133 /******************************************************************************
00134 * Request some action
00135 ******************************************************************************/
00136 
00137 struct update_event_rep: public event_rep {
00138   update_event_rep ();
00139   operator tree ();
00140 };
00141 EVENT(update_event);
00142 
00143 struct refresh_event_rep: public event_rep {
00144   refresh_event_rep ();
00145   operator tree ();
00146 };
00147 EVENT(refresh_event);
00148 
00149 struct invalidate_event_rep: public event_rep {
00150   bool all_flag;
00151   SI x1, y1, x2, y2;
00152   invalidate_event_rep ();
00153   invalidate_event_rep (SI x1, SI y1, SI x2, SI y2);
00154   operator tree ();
00155 };
00156 EVENT(invalidate_event);
00157 
00158 struct keyboard_grab_event_rep: public event_rep {
00159   bool flag; time_t t;
00160   keyboard_grab_event_rep (bool in_out_flag, time_t t);
00161   operator tree ();
00162 };
00163 EVENT(keyboard_grab_event);
00164 
00165 struct mouse_grab_event_rep: public event_rep {
00166   bool flag; time_t t;
00167   mouse_grab_event_rep (bool in_out_flag, time_t t);
00168   operator tree ();
00169 };
00170 EVENT(mouse_grab_event);
00171 
00172 struct request_alarm_event_rep: public event_rep {
00173   event ev; time_t delay;
00174   request_alarm_event_rep (event ev, time_t delay);
00175   operator tree ();
00176 };
00177 EVENT(request_alarm_event);
00178 
00179 /******************************************************************************
00180 * Miscellaneous events
00181 ******************************************************************************/
00182 
00183 struct find_child_event_rep: public event_rep {
00184   SI x, y; int& which;
00185   find_child_event_rep (SI x, SI y, int& which);
00186   operator tree ();
00187 };
00188 EVENT(find_child_event);
00189 
00190 /******************************************************************************
00191 * Modification of events
00192 ******************************************************************************/
00193 
00194 event emit_keypress (keypress_event ev, string key);
00195 event emit_mouse (mouse_event ev, string type, SI x, SI y);
00196 
00197 #endif // defined BASIC_EVENT_H