source: NonGTP/glut/FLTK/include/FL/Fl.H @ 814

Revision 814, 2.0 KB checked in by gumbau, 18 years ago (diff)

Glut initial import used by Geometry modules

Line 
1#ifndef Fl_H
2#  define Fl_H
3
4#include "Enumerations.H"
5#include <fltk/run.h>
6#include <fltk/events.h>
7#include <fltk/Color.h>
8#include <fltk/Font.h>
9#include <fltk/Box.h>
10#include <fltk/error.h>
11#include <fltk/visual.h>
12#include <fltk/Monitor.h>
13
14namespace Fl = fltk;
15
16typedef fltk::TimeoutHandler Fl_Timeout_Handler;
17
18namespace fltk {
19
20  class Widget;
21
22  // fltk2 does not keep track of selection owner:
23  inline fltk::Widget* selection_owner() {return 0;}
24  inline void selection_owner(fltk::Widget*) {}
25  inline void selection(fltk::Widget &owner, const char* b, int len) {copy(b,len,false);}
26
27  inline void visible_focus(int) {} // fltk2 always acts like this is off
28
29  inline int x() {return Monitor::all().x();}
30  inline int y() {return Monitor::all().y();}
31  inline int w() {return Monitor::all().w();}
32  inline int h() {return Monitor::all().h();}
33
34  inline void set_color(Color c, uchar r, uchar g, uchar b) {
35    set_color_index(c,color(r,g,b));
36  }
37  inline void set_color(Color c, Color d) {set_color_index(c,d);}
38  inline Color get_color(Color c) {return get_color_index(c);}
39  inline void get_color(Color c, uchar&r, uchar&g, uchar&b) {split_color(c,r,g,b);}
40  //inline void free_color(Color, bool overlay=false);
41
42  inline const char* get_font(Font* f) {return f->system_name();}
43  inline const char* get_font_name(Font* f, int* attributes = 0) {
44    if (attributes) return f->name(attributes);
45    else return f->name();
46  }
47  inline int get_font_sizes(Font* f, int*& sizep) {return f->sizes(sizep);}
48
49#if 0
50  // these could be emulated by making a 0x0 rectangle and calling b->inset
51  inline int box_dx(const Box* b) {return b->dx();}
52  inline int box_dy(const Box* b) {return b->dy();}
53  inline int box_dw(const Box* b) {return b->dw();}
54  inline int box_dh(const Box* b) {return b->dh();}
55#endif
56
57  inline int event_key(int k) {return event_key_state(k);}
58
59  inline void add_handler(int (*h)(int)) {
60    // rather unsafe typecast of function:
61    add_event_handler((int(*)(int,Window*))(h));
62  }
63
64}
65
66#endif
Note: See TracBrowser for help on using the repository browser.