~ubuntu-branches/ubuntu/quantal/texmacs/quantal

« back to all changes in this revision

Viewing changes to src/Plugins/Widkit/event.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Atsuhito KOHDA, Kamaraju Kusumanchi, kohda
  • Date: 2008-04-06 15:11:41 UTC
  • mfrom: (1.1.7 upstream) (4.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080406151141-w0sg20jnv86mlt6f
Tags: 1:1.0.6.14-1
[Kamaraju Kusumanchi <kamaraju@gmail.com>]
* New upstream release
* 01_american.dpatch is updated
* Since thread support in guile-1.8 is now disabled, the segmentation faults
  should not arise anymore. More info at #439923. (Closes: #450499, #458685)
[kohda]
* This version fixed menu problem.  (Closes: #447083)
* Reverted orig.tar.gz to the upstream tarball.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/******************************************************************************
 
3
* MODULE     : event.hpp
 
4
* DESCRIPTION: Abstract events
 
5
* COPYRIGHT  : (C) 1999  Joris van der Hoeven
 
6
*******************************************************************************
 
7
* This software falls under the GNU general public license and comes WITHOUT
 
8
* ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for more details.
 
9
* If you don't have this file, write to the Free Software Foundation, Inc.,
 
10
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
11
******************************************************************************/
 
12
 
 
13
#ifndef EVENT_H
 
14
#define EVENT_H
 
15
#include "widget.hpp"
 
16
 
 
17
class wk_widget;
 
18
class rectangle;
 
19
template<class T> class list;
 
20
typedef list<rectangle> rectangles;
 
21
 
 
22
enum gravity { north_west, north,  north_east,
 
23
               west,       center, east,
 
24
               south_west, south,  south_east };
 
25
 
 
26
/******************************************************************************
 
27
* The event class
 
28
******************************************************************************/
 
29
 
 
30
#define __EVENT_CLASS_MASK 0xffff0000
 
31
 
 
32
extern int event_count;
 
33
struct event_rep: public abstract_struct {
 
34
  int     type;  // the event type
 
35
  inline  event_rep (int type2): type (type2) { DEBUG(event_count++); }
 
36
  inline  virtual ~event_rep () { DEBUG(event_count--); }
 
37
  virtual operator tree () = 0;   // for displaying events (debugging)
 
38
};
 
39
 
 
40
struct event {
 
41
ABSTRACT(event);            
 
42
  inline operator tree () { return (tree) (*rep); }
 
43
  friend class event_ptr_base;
 
44
};
 
45
ABSTRACT_CODE(event);
 
46
 
 
47
inline ostream& operator << (ostream& out, event ev) {
 
48
  return out << ((tree) ev); }
 
49
 
 
50
/******************************************************************************
 
51
* User interface
 
52
******************************************************************************/
 
53
 
 
54
/*** basic events ***/
 
55
event get_size (SI& w, SI& h, int mode=0);
 
56
event get_widget (string which, wk_widget& w);
 
57
event set_widget (string which, wk_widget w);
 
58
event emit_attach_window (window win);
 
59
event emit_reposition ();
 
60
event emit_position (SI ox, SI oy, SI w, SI h, gravity grav=north_west);
 
61
event emit_move ();
 
62
event emit_resize ();
 
63
event emit_destroy ();
 
64
event emit_keypress (string key, time_t t);
 
65
event emit_keyboard_focus (bool in_out_flag, time_t t=0);
 
66
event emit_mouse (string type, SI x, SI y, int mods, time_t t);
 
67
event emit_alarm (string message, time_t t);
 
68
event emit_clear (SI x1, SI y1, SI x2, SI y2);
 
69
event emit_repaint (SI x1, SI y1, SI x2, SI y2, bool& stop);
 
70
event emit_update ();
 
71
event emit_invalidate_all ();
 
72
event emit_invalidate (SI x1, SI y1, SI x2, SI y2);
 
73
event emit_keyboard_grab (bool in_out_flag, time_t t=0);
 
74
event emit_mouse_grab (bool in_out_flag, time_t t=0);
 
75
event emit_request_alarm (event ev, time_t delay);
 
76
event emit_find_child (SI x, SI y, int& which);
 
77
 
 
78
/*** composite events ***/
 
79
event emit_clean ();
 
80
event emit_insert (string where, wk_widget wid);
 
81
event emit_remove (string where);
 
82
 
 
83
/*** attribute events ***/
 
84
event get_integer (string which, int& i);
 
85
event get_double  (string which, double& d);
 
86
event get_string  (string which, string& s);
 
87
event get_coord1  (string which, SI& c1);
 
88
event get_coord2  (string which, SI& c1, SI& c2);
 
89
event get_coord3  (string which, SI& c1, SI& c2, SI& c3);
 
90
event get_coord4  (string which, SI& c1, SI& c2, SI& c3, SI& c4);
 
91
event set_integer (string which, int i);
 
92
event set_double  (string which, double d);
 
93
event set_string  (string which, string s);
 
94
event set_coord1  (string which, SI c1);
 
95
event set_coord2  (string which, SI c1, SI c2);
 
96
event set_coord3  (string which, SI c1, SI c2, SI c3);
 
97
event set_coord4  (string which, SI c1, SI c2, SI c3, SI c4);
 
98
 
 
99
/*** scroll events ***/
 
100
event set_scrollable (wk_widget w);
 
101
event set_extents    (SI x1, SI y1, SI x2, SI y2);
 
102
event set_scroll_pos (SI x, SI y);
 
103
event get_visible    (SI& x1, SI& y1, SI& x2, SI& y2);
 
104
event get_extents    (SI& x1, SI& y1, SI& x2, SI& y2);
 
105
event get_scroll_pos (SI& x, SI& y);
 
106
 
 
107
/*** user input events ***/
 
108
event set_input_string (string s);
 
109
event get_input_string (string& s);
 
110
 
 
111
#endif // defined EVENT_H