dillo  3.0.5
About: dillo is a small, fast, extensible Web browser particularly suitable for older or smaller computers and embedded systems (but only limited or no support for frames, CSS, JavaScript, Java).
  Fossies Dox: dillo-3.0.5.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

fltkviewport.cc
Go to the documentation of this file.
1 /*
2  * Dillo Widget
3  *
4  * Copyright 2005-2007 Sebastian Geerken <sgeerken@dillo.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 
21 
22 #include "fltkviewport.hh"
23 
24 #include <FL/Fl.H>
25 #include <FL/fl_draw.H>
26 #include <FL/names.h>
27 
28 #include <stdio.h>
29 #include "../lout/msg.h"
30 #include "../lout/debug.hh"
31 
32 using namespace lout;
33 using namespace lout::object;
34 using namespace lout::container::typed;
35 
36 namespace dw {
37 namespace fltk {
38 
39 /*
40  * Lets SHIFT+{Left,Right} go to the parent
41  */
42 class CustScrollbar : public Fl_Scrollbar
43 {
44 public:
45  CustScrollbar(int x, int y, int w, int h) : Fl_Scrollbar(x,y,w,h) {};
46  int handle(int e) {
47  if (e == FL_SHORTCUT && Fl::event_state() == FL_SHIFT &&
48  (Fl::event_key() == FL_Left || Fl::event_key() == FL_Right))
49  return 0;
50  return Fl_Scrollbar::handle(e);
51  }
52 };
53 
54 FltkViewport::FltkViewport (int X, int Y, int W, int H, const char *label):
55  FltkWidgetView (X, Y, W, H, label)
56 {
57  DBG_OBJ_CREATE ("dw::fltk::FltkViewport");
58 
59  hscrollbar = new CustScrollbar (x (), y (), 1, 1);
60  hscrollbar->type(FL_HORIZONTAL);
61  hscrollbar->callback (hscrollbarCallback, this);
62  hscrollbar->hide();
63  add (hscrollbar);
64 
65  vscrollbar = new Fl_Scrollbar (x (), y(), 1, 1);
66  vscrollbar->type(FL_VERTICAL);
67  vscrollbar->callback (vscrollbarCallback, this);
68  vscrollbar->hide();
69  add (vscrollbar);
70 
71  hasDragScroll = 1;
72  scrollX = scrollY = scrollDX = scrollDY = 0;
74 
79 
80  gadgets =
82  (true);
83 }
84 
86 {
87  delete gadgets;
88  DBG_OBJ_DELETE ();
89 }
90 
92 {
93  int hdiff = 0, vdiff = 0;
94  int visibility = 0;
95 
96  _MSG(" >>FltkViewport::adjustScrollbarsAndGadgetsAllocation\n");
97  if (hscrollbar->visible ())
98  visibility |= 1;
99  if (vscrollbar->visible ())
100  visibility |= 2;
101 
102  if (gadgets->size () > 0) {
103  switch (gadgetOrientation [visibility]) {
104  case GADGET_VERTICAL:
105  hdiff = SCROLLBAR_THICKNESS;
106  vdiff = SCROLLBAR_THICKNESS * gadgets->size ();
107  break;
108 
109  case GADGET_HORIZONTAL:
110  hdiff = SCROLLBAR_THICKNESS * gadgets->size ();
111  vdiff = SCROLLBAR_THICKNESS;
112  break;
113  }
114  } else {
115  hdiff = vscrollbar->visible () ? SCROLLBAR_THICKNESS : 0;
116  vdiff = hscrollbar->visible () ? SCROLLBAR_THICKNESS : 0;
117  }
118 
119  hscrollbar->resize(x (), y () + h () - SCROLLBAR_THICKNESS,
120  w () - hdiff, SCROLLBAR_THICKNESS);
121  vscrollbar->resize(x () + w () - SCROLLBAR_THICKNESS, y (),
122  SCROLLBAR_THICKNESS, h () - vdiff);
123 
124  int X = x () + w () - SCROLLBAR_THICKNESS;
125  int Y = y () + h () - SCROLLBAR_THICKNESS;
127  it.hasNext (); ) {
128  Fl_Widget *widget = it.getNext()->getTypedValue ();
129  widget->resize(x (), y (), SCROLLBAR_THICKNESS, SCROLLBAR_THICKNESS);
130 
131  switch (gadgetOrientation [visibility]) {
132  case GADGET_VERTICAL:
133  Y -= SCROLLBAR_THICKNESS;
134  break;
135 
136  case GADGET_HORIZONTAL:
137  X -= SCROLLBAR_THICKNESS;
138  break;
139  }
140  }
141 }
142 
144 {
145  hscrollbar->value (scrollX, hscrollbar->w (), 0, canvasWidth);
146  vscrollbar->value (scrollY, vscrollbar->h (), 0, canvasHeight);
147 }
148 
150 {
151  scroll (hscrollbar->value () - scrollX, 0);
152 }
153 
155 {
156  scroll (0, vscrollbar->value () - scrollY);
157 }
158 
159 void FltkViewport::vscrollbarCallback (Fl_Widget *vscrollbar,void *viewportPtr)
160 {
161  ((FltkViewport*)viewportPtr)->vscrollbarChanged ();
162 }
163 
164 void FltkViewport::hscrollbarCallback (Fl_Widget *hscrollbar,void *viewportPtr)
165 {
166  ((FltkViewport*)viewportPtr)->hscrollbarChanged ();
167 }
168 
169 // ----------------------------------------------------------------------
170 
171 void FltkViewport::resize(int X, int Y, int W, int H)
172 {
173  bool dimension_changed = W != w() || H != h();
174 
175  Fl_Group::resize(X, Y, W, H);
176  if (dimension_changed) {
177  theLayout->viewportSizeChanged (this, W, H);
179  }
180 }
181 
182 void FltkViewport::draw_area (void *data, int x, int y, int w, int h)
183 {
184  FltkViewport *vp = (FltkViewport*) data;
185  fl_push_clip(x, y, w, h);
186 
187  vp->FltkWidgetView::draw ();
188 
190  it.hasNext (); ) {
191  Fl_Widget *widget = it.getNext()->getTypedValue ();
192  vp->draw_child (*widget);
193  }
194 
195  fl_pop_clip();
196 
197 }
198 
200 {
201  int hdiff = vscrollbar->visible () ? SCROLLBAR_THICKNESS : 0;
202  int vdiff = hscrollbar->visible () ? SCROLLBAR_THICKNESS : 0;
203  int d = damage();
204 
205  if (d & FL_DAMAGE_SCROLL) {
206  clear_damage (FL_DAMAGE_SCROLL);
207  fl_scroll(x(), y(), w() - hdiff, h() - vdiff,
208  -scrollDX, -scrollDY, draw_area, this);
209  clear_damage (d & ~FL_DAMAGE_SCROLL);
210  }
211 
212  if (d) {
213  draw_area(this, x(), y(), w () - hdiff, h () - vdiff);
214 
215  if (d == FL_DAMAGE_ALL || hscrollbar->damage ())
216  draw_child (*hscrollbar);
217  if (d == FL_DAMAGE_ALL || vscrollbar->damage ())
218  draw_child (*vscrollbar);
219 
220  if (d == FL_DAMAGE_ALL && hdiff && vdiff) {
221  fl_color(FL_BACKGROUND_COLOR);
222  fl_rectf(x()+w()-hdiff, y()+h()-vdiff, hdiff, vdiff);
223  }
224  }
225 
226  scrollDX = 0;
227  scrollDY = 0;
228 }
229 
230 int FltkViewport::handle (int event)
231 {
232  _MSG("FltkViewport::handle %s\n", fl_eventnames[event]);
233 
234  switch(event) {
235  case FL_KEYBOARD:
236  /* When the viewport has focus (and not one of its children), FLTK
237  * sends the event here. Returning zero tells FLTK to resend the
238  * event as SHORTCUT, which we finally route to the parent. */
239 
240  /* As we don't know the exact keybindings set by the user, we ask for
241  * all of them (except for the minimum needed to keep form navigation).*/
242  if (Fl::event_key() != FL_Tab || Fl::event_ctrl())
243  return 0;
244  break;
245 
246  case FL_SHORTCUT:
247  /* send it to the parent (UI) */
248  return 0;
249 
250  case FL_FOCUS:
252  break;
253 
254  case FL_UNFOCUS:
256  break;
257 
258  case FL_PUSH:
259  if (vscrollbar->visible() && Fl::event_inside(vscrollbar)) {
260  if (vscrollbar->handle(event))
261  verScrolling = 1;
262  } else if (hscrollbar->visible() && Fl::event_inside(hscrollbar)) {
263  if (hscrollbar->handle(event))
264  horScrolling = 1;
265  } else if (FltkWidgetView::handle(event) == 0 &&
266  Fl::event_button() == FL_MIDDLE_MOUSE) {
267  if (!hasDragScroll) {
268  /* let the parent widget handle it... */
269  return 0;
270  } else {
271  /* receive FL_DRAG and FL_RELEASE */
272  dragScrolling = 1;
273  dragX = Fl::event_x();
274  dragY = Fl::event_y();
276  }
277  }
278  return 1;
279  break;
280 
281  case FL_DRAG:
282  if (Fl::event_inside(this))
283  Fl::remove_timeout(selectionScroll);
284  if (dragScrolling) {
285  scroll(dragX - Fl::event_x(), dragY - Fl::event_y());
286  dragX = Fl::event_x();
287  dragY = Fl::event_y();
288  return 1;
289  } else if (verScrolling) {
290  vscrollbar->handle(event);
291  return 1;
292  } else if (horScrolling) {
293  hscrollbar->handle(event);
294  return 1;
295  } else if (!Fl::event_inside(this)) {
296  mouse_x = Fl::event_x();
297  mouse_y = Fl::event_y();
298  if (!Fl::has_timeout(selectionScroll, this))
299  Fl::add_timeout(0.025, selectionScroll, this);
300  }
301  break;
302 
303  case FL_MOUSEWHEEL:
304  return (Fl::event_dx() ? hscrollbar : vscrollbar)->handle(event);
305  break;
306 
307  case FL_RELEASE:
308  Fl::remove_timeout(selectionScroll);
309  if (Fl::event_button() == FL_MIDDLE_MOUSE) {
311  } else if (verScrolling) {
312  vscrollbar->handle(event);
313  } else if (horScrolling) {
314  hscrollbar->handle(event);
315  }
317  break;
318 
319  case FL_ENTER:
320  /* could be the result of, e.g., closing another window. */
321  mouse_x = Fl::event_x();
322  mouse_y = Fl::event_y();
323  positionChanged();
324  break;
325 
326  case FL_LEAVE:
327  mouse_x = mouse_y = -1;
328  break;
329  }
330 
331  return FltkWidgetView::handle (event);
332 }
333 
334 // ----------------------------------------------------------------------
335 
336 void FltkViewport::setCanvasSize (int width, int ascent, int descent)
337 {
338  FltkWidgetView::setCanvasSize (width, ascent, descent);
340 }
341 
342 /*
343  * This is used to simulate mouse motion (e.g., when scrolling).
344  */
346 {
347  if (!dragScrolling && mouse_x >= x() && mouse_x < x()+w() && mouse_y >= y()
348  && mouse_y < y()+h())
349  (void)theLayout->motionNotify (this,
352  (core::ButtonState)0);
353 }
354 
355 /*
356  * For scrollbars, this currently sets the same step to both vertical and
357  * horizontal. It may be differentiated if necessary.
358  */
360 {
361  vscrollbar->linesize(step);
362  hscrollbar->linesize(step);
363 }
364 
366 {
367  return true;
368 }
369 
371 {
372  return SCROLLBAR_THICKNESS;
373 }
374 
376 {
377  return SCROLLBAR_THICKNESS;
378 }
379 
380 void FltkViewport::scrollTo (int x, int y)
381 {
382  int hdiff = vscrollbar->visible () ? SCROLLBAR_THICKNESS : 0;
383  int vdiff = hscrollbar->visible () ? SCROLLBAR_THICKNESS : 0;
384 
385  x = misc::min (x, canvasWidth - w() + hdiff);
386  x = misc::max (x, 0);
387 
388  y = misc::min (y, canvasHeight - h() + vdiff);
389  y = misc::max (y, 0);
390 
391  if (x == scrollX && y == scrollY) {
392  return;
393  }
394 
395  /* multiple calls to scroll can happen before a redraw occurs.
396  * scrollDX and scrollDY can therefore be non-zero here.
397  */
399  scrollDX += x - scrollX;
400  scrollDY += y - scrollY;
401 
402  scrollX = x;
403  scrollY = y;
404 
406  damage(FL_DAMAGE_SCROLL);
408  positionChanged();
409 }
410 
411 void FltkViewport::scroll (int dx, int dy)
412 {
413  scrollTo (scrollX + dx, scrollY + dy);
414 }
415 
417 {
418  if (cmd == core::SCREEN_UP_CMD) {
419  scroll (0, -h () + vscrollbar->linesize ());
420  } else if (cmd == core::SCREEN_DOWN_CMD) {
421  scroll (0, h () - vscrollbar->linesize ());
422  } else if (cmd == core::SCREEN_LEFT_CMD) {
423  scroll (-w() + hscrollbar->linesize (), 0);
424  } else if (cmd == core::SCREEN_RIGHT_CMD) {
425  scroll (w() - hscrollbar->linesize (), 0);
426  } else if (cmd == core::LINE_UP_CMD) {
427  scroll (0, (int) -vscrollbar->linesize ());
428  } else if (cmd == core::LINE_DOWN_CMD) {
429  scroll (0, (int) vscrollbar->linesize ());
430  } else if (cmd == core::LEFT_CMD) {
431  scroll ((int) -hscrollbar->linesize (), 0);
432  } else if (cmd == core::RIGHT_CMD) {
433  scroll ((int) hscrollbar->linesize (), 0);
434  } else if (cmd == core::TOP_CMD) {
435  scrollTo (scrollX, 0);
436  } else if (cmd == core::BOTTOM_CMD) {
437  scrollTo (scrollX, canvasHeight); /* gets adjusted in scrollTo () */
438  }
439 }
440 
441 /*
442  * Scrolling in response to selection where the cursor is outside the view.
443  */
445 {
446  int distance;
447  int dx = 0, dy = 0;
448 
449  if ((distance = x() - mouse_x) > 0)
450  dx = -distance * hscrollbar->linesize () / 48 - 1;
451  else if ((distance = mouse_x - (x() + w())) > 0)
452  dx = distance * hscrollbar->linesize () / 48 + 1;
453  if ((distance = y() - mouse_y) > 0)
454  dy = -distance * vscrollbar->linesize () / 48 - 1;
455  else if ((distance = mouse_y - (y() + h())) > 0)
456  dy = distance * vscrollbar->linesize () / 48 + 1;
457 
458  scroll (dx, dy);
459 }
460 
462 {
463  ((FltkViewport *)data)->selectionScroll ();
464  Fl::repeat_timeout(0.025, selectionScroll, data);
465 }
466 
467 void FltkViewport::setViewportSize (int width, int height,
468  int hScrollbarThickness,
469  int vScrollbarThickness)
470 {
471  int adjustReq =
472  (hscrollbar->visible() ? !hScrollbarThickness : hScrollbarThickness) ||
473  (vscrollbar->visible() ? !vScrollbarThickness : vScrollbarThickness);
474 
475  _MSG("FltkViewport::setViewportSize old_w,old_h=%dx%d -> w,h=%dx%d\n"
476  "\t hThick=%d hVis=%d, vThick=%d vVis=%d, adjustReq=%d\n",
477  w(),h(),width,height,
478  hScrollbarThickness,hscrollbar->visible(),
479  vScrollbarThickness,vscrollbar->visible(), adjustReq);
480 
481  (hScrollbarThickness > 0) ? hscrollbar->show () : hscrollbar->hide ();
482  (vScrollbarThickness > 0) ? vscrollbar->show () : vscrollbar->hide ();
483 
484  /* If no scrollbar, go to the beginning */
485  scroll(hScrollbarThickness ? 0 : -scrollX,
486  vScrollbarThickness ? 0 : -scrollY);
487 
488  /* Adjust when scrollbar visibility changes */
489  if (adjustReq)
491 }
492 
494 {
495  // scroll all child widgets except scroll bars
496  for (int i = children () - 1; i > 0; i--) {
497  Fl_Widget *widget = child (i);
498 
499  if (widget == hscrollbar || widget == vscrollbar)
500  continue;
501 
502  widget->position(widget->x () - dx, widget->y () - dy);
503  }
504 }
505 
507 {
508  return X - x () + scrollX;
509 }
510 
512 {
513  return Y - y () + scrollY;
514 }
515 
517 {
518  return X + x () - scrollX;
519 }
520 
522 {
523  return Y + y () - scrollY;
524 }
525 
526 // ----------------------------------------------------------------------
527 
528 void FltkViewport::setGadgetOrientation (bool hscrollbarVisible,
529  bool vscrollbarVisible,
531  gadgetOrientation)
532 {
533  this->gadgetOrientation[(hscrollbarVisible ? 0 : 1) |
534  (vscrollbarVisible ? 0 : 2)] = gadgetOrientation;
536 }
537 
538 void FltkViewport::addGadget (Fl_Widget *gadget)
539 {
542  gadgets->append (new TypedPointer < Fl_Widget> (gadget));
544 }
545 
546 
547 } // namespace fltk
548 } // namespace dw
dw::fltk::FltkViewBase::handle
int handle(int event)
Definition: fltkviewbase.cc:287
DBG_OBJ_DELETE
#define DBG_OBJ_DELETE()
Definition: debug.hh:176
dw::fltk::FltkViewBase::mouse_y
int mouse_y
Definition: fltkviewbase.hh:58
dw::fltk::FltkViewport::GADGET_HORIZONTAL
Definition: fltkviewport.hh:17
dw::fltk::FltkViewport::usesViewport
bool usesViewport()
Return, whether this view uses a viewport.
Definition: fltkviewport.cc:365
dw::fltk::FltkViewport::dragScrolling
int dragScrolling
Definition: fltkviewport.hh:24
dw::fltk::FltkViewBase::canvasHeight
int canvasHeight
Definition: fltkviewbase.hh:57
dw::fltk::FltkViewport::adjustScrollbarValues
void adjustScrollbarValues()
Definition: fltkviewport.cc:143
DBG_OBJ_CREATE
#define DBG_OBJ_CREATE(klass)
Definition: debug.hh:175
lout::object
Here, some common classes (or interfaces) are defined, to standardize the access to other classes.
Definition: object.cc:29
dw::fltk::FltkViewport::vscrollbarCallback
static void vscrollbarCallback(Fl_Widget *vscrollbar, void *viewportPtr)
Definition: fltkviewport.cc:159
dw::fltk::FltkViewport::setGadgetOrientation
void setGadgetOrientation(bool hscrollbarVisible, bool vscrollbarVisible, GadgetOrientation gadgetOrientation)
Definition: fltkviewport.cc:528
dw::fltk::FltkViewport::adjustScrollbarsAndGadgetsAllocation
void adjustScrollbarsAndGadgetsAllocation()
Definition: fltkviewport.cc:91
dw::fltk::FltkViewport::gadgets
lout::container::typed::List< lout::object::TypedPointer< Fl_Widget > > * gadgets
Definition: fltkviewport.hh:31
dw::fltk::FltkViewport::hscrollbarCallback
static void hscrollbarCallback(Fl_Widget *hscrollbar, void *viewportPtr)
Definition: fltkviewport.cc:164
dw::core::RIGHT_CMD
Definition: types.hh:37
dw::fltk::FltkViewport::scroll
void scroll(int dx, int dy)
Definition: fltkviewport.cc:411
dw::fltk::FltkViewport::positionChanged
void positionChanged()
Definition: fltkviewport.cc:345
dw::fltk::FltkViewBase::setCanvasSize
void setCanvasSize(int width, int ascent, int descent)
Set the canvas size.
Definition: fltkviewbase.cc:390
dw::fltk::FltkViewport::handle
int handle(int event)
Definition: fltkviewport.cc:230
dw::fltk::FltkViewport::setViewportSize
void setViewportSize(int width, int height, int hScrollbarThickness, int vScrollbarThickness)
Set the viewport size.
Definition: fltkviewport.cc:467
dw::fltk::CustScrollbar
Definition: fltkviewport.cc:42
dw::fltk::FltkViewport::scrollX
int scrollX
Definition: fltkviewport.hh:22
dw::fltk::FltkViewport::setScrollStep
void setScrollStep(int step)
Definition: fltkviewport.cc:359
dw::fltk::FltkViewport::addGadget
void addGadget(Fl_Widget *gadget)
Definition: fltkviewport.cc:538
dw::core::style::CURSOR_MOVE
Definition: style.hh:202
dw::fltk::FltkViewBase::mouse_x
int mouse_x
Definition: fltkviewbase.hh:58
dw::core::LINE_DOWN_CMD
Definition: types.hh:36
H
#define H(x, y, z)
dw::core::SCREEN_RIGHT_CMD
Definition: types.hh:36
dw::core::Layout::motionNotify
bool motionNotify(View *view, int x, int y, ButtonState state)
This function is called by a view, to delegate a motion notify event.
Definition: layout.cc:915
dw::fltk::FltkViewport::GADGET_VERTICAL
Definition: fltkviewport.hh:17
dw::fltk::FltkViewport::draw
void draw()
Definition: fltkviewport.cc:199
dw::fltk::FltkViewport::dragX
int dragX
Definition: fltkviewport.hh:24
dw::fltk::FltkViewBase::theLayout
core::Layout * theLayout
Definition: fltkviewbase.hh:56
dw::fltk::FltkViewport::verScrolling
int verScrolling
Definition: fltkviewport.hh:25
dw::fltk::FltkViewport::scrollDY
int scrollDY
Definition: fltkviewport.hh:23
dw::core::Layout::scrollPosChanged
void scrollPosChanged(View *view, int x, int y)
Definition: layout.cc:1140
dw::fltk::CustScrollbar::handle
int handle(int e)
Definition: fltkviewport.cc:46
lout::misc::max
T max(T a, T b)
Definition: misc.hh:20
lout::misc::min
T min(T a, T b)
Definition: misc.hh:19
lout::container::typed::Iterator
Typed version of container::untyped::Iterator.
Definition: container.hh:352
dw::fltk::FltkViewBase::setCursor
void setCursor(core::style::Cursor cursor)
Set the cursor appearance.
Definition: fltkviewbase.cc:396
dw::fltk::FltkWidgetView
Definition: fltkviewbase.hh:111
dw::fltk::FltkViewport::translateCanvasYToViewY
int translateCanvasYToViewY(int y)
Definition: fltkviewport.cc:521
dw::fltk::FltkViewport::~FltkViewport
~FltkViewport()
Definition: fltkviewport.cc:85
dw::core::SCREEN_DOWN_CMD
Definition: types.hh:35
lout
Definition: container.cc:26
dw::fltk::FltkViewport::hasDragScroll
int hasDragScroll
Definition: fltkviewport.hh:24
dw::fltk::CustScrollbar::CustScrollbar
CustScrollbar(int x, int y, int w, int h)
Definition: fltkviewport.cc:45
dw::fltk::FltkViewport::scrollDX
int scrollDX
Definition: fltkviewport.hh:23
dw::core::ScrollCommand
ScrollCommand
Definition: types.hh:35
dw::fltk::FltkViewBase::canvasWidth
int canvasWidth
Definition: fltkviewbase.hh:57
dw::fltk::FltkViewport::hscrollbar
Fl_Scrollbar * hscrollbar
Definition: fltkviewport.hh:27
dw::fltk::FltkViewport::vscrollbarChanged
void vscrollbarChanged()
Definition: fltkviewport.cc:154
dw::fltk::FltkViewport::translateViewYToCanvasY
int translateViewYToCanvasY(int y)
Definition: fltkviewport.cc:511
lout::container::typed::List
Typed version of container::untyped::List.
Definition: container.hh:425
dw::fltk::FltkViewport::scrollTo
void scrollTo(int x, int y)
Scroll the vieport to the given position.
Definition: fltkviewport.cc:380
lout::container::typed::List::append
void append(T *element)
Definition: container.hh:432
dw::fltk::FltkViewport::GadgetOrientation
GadgetOrientation
Definition: fltkviewport.hh:17
dw::core::BOTTOM_CMD
Definition: types.hh:37
lout::object::TypedPointer
A typed version of object::Pointer.
Definition: object.hh:81
dw::fltk::FltkViewport::draw_area
static void draw_area(void *data, int x, int y, int w, int h)
Definition: fltkviewport.cc:182
lout::container::typed::Collection::iterator
Iterator< T > iterator()
Definition: container.hh:391
fltkviewport.hh
dw::fltk::FltkViewport::getHScrollbarThickness
int getHScrollbarThickness()
Get the thickness of the horizontal scrollbar, when it is visible.
Definition: fltkviewport.cc:370
dw::fltk::FltkViewport::vscrollbar
Fl_Scrollbar * vscrollbar
Definition: fltkviewport.hh:27
dw::fltk::FltkViewport::resize
void resize(int x, int y, int w, int h)
Definition: fltkviewport.cc:171
dw::fltk::FltkViewport::getVScrollbarThickness
int getVScrollbarThickness()
Get the thickness of the vertical scrollbar, when it is visible.
Definition: fltkviewport.cc:375
_MSG
#define _MSG(...)
Definition: bookmarks.c:44
dw::fltk::FltkViewport::horScrolling
int horScrolling
Definition: fltkviewport.hh:25
dw::fltk::FltkViewport::selectionScroll
void selectionScroll()
Definition: fltkviewport.cc:444
dw::fltk::FltkViewport::updateCanvasWidgets
void updateCanvasWidgets(int oldScrollX, int oldScrollY)
Definition: fltkviewport.cc:493
dw::core::SCREEN_UP_CMD
Definition: types.hh:35
dw::core::ButtonState
ButtonState
Platform independent representation.
Definition: events.hh:14
dw::fltk::FltkViewport::gadgetOrientation
GadgetOrientation gadgetOrientation[4]
Definition: fltkviewport.hh:29
dw::fltk::FltkViewport
Definition: fltkviewport.hh:14
dw::fltk::FltkViewport::SCROLLBAR_THICKNESS
Definition: fltkviewport.hh:20
dw::fltk::FltkViewport::setCanvasSize
void setCanvasSize(int width, int ascent, int descent)
Set the canvas size.
Definition: fltkviewport.cc:336
lout::container::typed::List::size
int size() const
Definition: container.hh:441
dw
Dw is in this namespace, or sub namespaces of this one.
Definition: alignedtextblock.cc:26
dw::fltk::FltkViewport::dragY
int dragY
Definition: fltkviewport.hh:24
dw::core::LEFT_CMD
Definition: types.hh:37
dw::core::style::CURSOR_DEFAULT
Definition: style.hh:200
dw::core::SCREEN_LEFT_CMD
Definition: types.hh:35
lout::container::typed
This namespace provides thin wrappers, implemented as C++ templates, to gain type-safety.
Definition: container.hh:345
dw::core::Layout::viewportSizeChanged
void viewportSizeChanged(View *view, int width, int height)
Definition: layout.cc:1155
dw::core::TOP_CMD
Definition: types.hh:37
dw::fltk::FltkViewport::translateViewXToCanvasX
int translateViewXToCanvasX(int x)
Definition: fltkviewport.cc:506
dw::fltk::FltkViewport::scrollY
int scrollY
Definition: fltkviewport.hh:22
dw::fltk::FltkViewport::translateCanvasXToViewX
int translateCanvasXToViewX(int x)
Definition: fltkviewport.cc:516
dw::core::LINE_UP_CMD
Definition: types.hh:36
dw::fltk::FltkViewport::hscrollbarChanged
void hscrollbarChanged()
Definition: fltkviewport.cc:149