2 // "$Id: Fl_Window.H,v 1.2 2002/12/01 15:38:37 neurosurg Exp $"
4 // Window header file for the Fast Light Tool Kit (FLTK).
6 // Copyright 1998-2002 by Bill Spitzak and others.
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.
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.
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
23 // Please report all bugs and problems to "fltk-bugs@fltk.org".
31 #define FL_WINDOW 0xF0 // all subclasses have type() >= this
35 class FL_EXPORT Fl_Window : public Fl_Group {
38 Fl_X *i; // points at the system-specific stuff
40 const char* iconlabel_;
44 short minw, minh, maxw, maxh;
45 uchar dw, dh, aspect, size_range_set;
47 Fl_Cursor cursor_default;
48 Fl_Color cursor_fg, cursor_bg;
50 // values for flags():
54 FL_FORCE_POSITION = 16,
58 void _Fl_Window(); // constructor innards
62 static Fl_Window *current_;
68 Fl_Window(int,int,int,int, const char* = 0);
69 Fl_Window(int,int, const char* = 0);
72 virtual int handle(int);
74 virtual void resize(int,int,int,int);
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);}
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_();}
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;}
102 int shown() {return i != 0;}
105 void show(int, char**);
107 void fullscreen_off(int,int,int,int);
113 static Fl_Window *current();
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);
126 // End of "$Id: Fl_Window.H,v 1.2 2002/12/01 15:38:37 neurosurg Exp $".