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

« back to all changes in this revision

Viewing changes to src/Window/Widget/scroll_widget.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     : scroll_widget.hpp
4
 
* DESCRIPTION: Scrollable widgets
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 SCROLL_WIDGET_H
14
 
#define SCROLL_WIDGET_H
15
 
#include "Widget/attribute_widget.hpp"
16
 
#include "Event/scroll_event.hpp"
17
 
 
18
 
/******************************************************************************
19
 
* Scroll widgets
20
 
******************************************************************************/
21
 
 
22
 
class scroll_widget_rep: public attribute_widget_rep {
23
 
public:
24
 
  scroll_widget_rep (display dis, array<widget> a, gravity grav);
25
 
  virtual void handle_scroll (scroll_event ev) = 0;
26
 
  virtual bool handle (event ev);
27
 
};
28
 
 
29
 
/******************************************************************************
30
 
* Scrollable widgets
31
 
******************************************************************************/
32
 
 
33
 
class scrollable_widget_rep: public scroll_widget_rep {
34
 
  SI          scx, scy;    // scroll x,y position
35
 
  SI          ex1, ey1;    // extents of scrolled window lo-left
36
 
  SI          ex2, ey2;    // extents of scrolled window hi-right
37
 
  widget_rep* hor;         // the horizontal scroll bar
38
 
  widget_rep* ver;         // the vertical scroll bar
39
 
  gravity     backup;      // for a dirty bugfix
40
 
 
41
 
  void scroll_to (SI scx, SI scy);
42
 
  void set_extents (SI ex1, SI ey1, SI ex2, SI ey2);
43
 
  void scroll_event_hor (SI& x, SI& before, SI& after);
44
 
  void scroll_event_ver (SI& y, SI& before, SI& after);
45
 
 
46
 
public:
47
 
  scrollable_widget_rep (widget child, gravity grav);
48
 
  operator tree ();
49
 
 
50
 
  void handle_get_size   (get_size_event ev);
51
 
  void handle_position   (position_event ev);
52
 
  void handle_set_widget (set_widget_event ev);
53
 
  void handle_get_coord1 (get_coord1_event ev);
54
 
  void handle_get_coord2 (get_coord2_event ev);
55
 
  void handle_get_coord4 (get_coord4_event ev);
56
 
  void handle_set_coord2 (set_coord2_event ev);
57
 
  void handle_set_coord4 (set_coord4_event ev);
58
 
  void handle_scroll     (scroll_event ev);
59
 
};
60
 
 
61
 
/******************************************************************************
62
 
* Abstract scrollbars
63
 
******************************************************************************/
64
 
 
65
 
class scrollbar_rep: public scroll_widget_rep {
66
 
protected:
67
 
  widget_rep* ref;
68
 
  SI          sc_min, sc_max, sc_pos, before, after;
69
 
  double      factor;
70
 
  bool        gripped;
71
 
  bool        scrolling;
72
 
  int         increment;
73
 
 
74
 
public:
75
 
  scrollbar_rep (widget ref);
76
 
 
77
 
  void handle_set_coord1 (set_coord1_event ev);
78
 
  void handle_set_coord2 (set_coord2_event ev);
79
 
};
80
 
 
81
 
/******************************************************************************
82
 
* Horizontal scrollbars
83
 
******************************************************************************/
84
 
 
85
 
class hor_scrollbar_widget_rep: public scrollbar_rep {
86
 
  void decode_position (SI& x1, SI& x2);
87
 
  SI   encode_position (SI x);
88
 
 
89
 
public:
90
 
  hor_scrollbar_widget_rep (widget ref);
91
 
  operator tree ();
92
 
 
93
 
  void handle_get_size (get_size_event ev);
94
 
  void handle_repaint (repaint_event ev);
95
 
  void handle_mouse (mouse_event ev);
96
 
  void handle_scroll (scroll_event ev);
97
 
  void handle_alarm (alarm_event ev);
98
 
};
99
 
 
100
 
/******************************************************************************
101
 
* Vertical scrollbars
102
 
******************************************************************************/
103
 
 
104
 
class ver_scrollbar_widget_rep: public scrollbar_rep {
105
 
  void decode_position (SI& y1, SI& y2);
106
 
  SI   encode_position (SI y);
107
 
 
108
 
public:
109
 
  ver_scrollbar_widget_rep (widget ref);
110
 
  operator tree ();
111
 
 
112
 
  void handle_get_size (get_size_event ev);
113
 
  void handle_repaint (repaint_event ev);
114
 
  void handle_mouse (mouse_event ev);
115
 
  void handle_scroll (scroll_event ev);
116
 
  void handle_alarm (alarm_event ev);
117
 
};
118
 
 
119
 
#endif // defined SCROLL_WIDGET_H