Move the sources to trunk
[opencv] / otherlibs / _fltk / include / FL / Fl_Window.H
1 //
2 // "$Id: Fl_Window.H,v 1.2 2002/12/01 15:38:37 neurosurg Exp $"
3 //
4 // Window header file for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2002 by Bill Spitzak and others.
7 //
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Library General Public
10 // License as published by the Free Software Foundation; either
11 // version 2 of the License, or (at your option) any later version.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 // Library General Public License for more details.
17 //
18 // You should have received a copy of the GNU Library General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21 // USA.
22 //
23 // Please report all bugs and problems to "fltk-bugs@fltk.org".
24 //
25
26 #ifndef Fl_Window_H
27 #define Fl_Window_H
28
29 #include "Fl_Group.H"
30
31 #define FL_WINDOW 0xF0  // all subclasses have type() >= this
32
33 class Fl_X;
34
35 class FL_EXPORT Fl_Window : public Fl_Group {
36
37   friend class Fl_X;
38   Fl_X *i; // points at the system-specific stuff
39
40   const char* iconlabel_;
41   const char* xclass_;
42   const void* icon_;
43   // size_range stuff:
44   short minw, minh, maxw, maxh;
45   uchar dw, dh, aspect, size_range_set;
46   // cursor stuff
47   Fl_Cursor cursor_default;
48   Fl_Color cursor_fg, cursor_bg;
49   void size_range_();
50   // values for flags():
51   enum {
52     FL_MODAL = 64,
53     FL_NOBORDER = 8,
54     FL_FORCE_POSITION = 16,
55     FL_NON_MODAL = 32,
56     FL_OVERRIDE = 256
57   };
58   void _Fl_Window(); // constructor innards
59
60 protected:
61
62   static Fl_Window *current_;
63   virtual void draw();
64   virtual void flush();
65
66 public:
67
68   Fl_Window(int,int,int,int, const char* = 0);
69   Fl_Window(int,int, const char* = 0);
70   virtual ~Fl_Window();
71
72   virtual int handle(int);
73
74   virtual void resize(int,int,int,int);
75   void border(int b);
76   void clear_border()   {set_flag(FL_NOBORDER);}
77   int border() const    {return !(flags() & FL_NOBORDER);}
78   void set_override()   {set_flag(FL_NOBORDER|FL_OVERRIDE);}
79   int override() const  { return flags()&FL_OVERRIDE; }
80   void set_modal()      {set_flag(FL_MODAL);}
81   int modal() const     {return flags() & FL_MODAL;}
82   void set_non_modal()  {set_flag(FL_NON_MODAL);}
83   int non_modal() const {return flags() & (FL_NON_MODAL|FL_MODAL);}
84
85   void hotspot(int x, int y, int offscreen = 0);
86   void hotspot(const Fl_Widget*, int offscreen = 0);
87   void hotspot(const Fl_Widget& p, int offscreen = 0) {hotspot(&p,offscreen);}
88   void free_position()  {clear_flag(FL_FORCE_POSITION);}
89   void size_range(int a, int b, int c=0, int d=0, int e=0, int f=0, int g=0) {
90     minw=a; minh=b; maxw=c; maxh=d; dw=e; dh=f; aspect=g; size_range_();}
91
92   const char* label() const     {return Fl_Widget::label();}
93   const char* iconlabel() const {return iconlabel_;}
94   void label(const char*);
95   void iconlabel(const char*);
96   void label(const char* label, const char* iconlabel);
97   const char* xclass() const    {return xclass_;}
98   void xclass(const char* c)    {xclass_ = c;}
99   const void* icon() const      {return icon_;}
100   void icon(const void * ic)    {icon_ = ic;}
101
102   int shown() {return i != 0;}
103   virtual void show();
104   virtual void hide();
105   void show(int, char**);
106   void fullscreen();
107   void fullscreen_off(int,int,int,int);
108   void iconize();
109
110   int x_root() const ;
111   int y_root() const ;
112
113   static Fl_Window *current();
114   void make_current();
115
116   // for back-compatability only:
117   void cursor(Fl_Cursor, Fl_Color=FL_BLACK, Fl_Color=FL_WHITE);
118   void default_cursor(Fl_Cursor, Fl_Color=FL_BLACK, Fl_Color=FL_WHITE);
119   static void default_callback(Fl_Window*, void* v);
120
121 };
122
123 #endif
124
125 //
126 // End of "$Id: Fl_Window.H,v 1.2 2002/12/01 15:38:37 neurosurg Exp $".
127 //