/* Sun-$Revision: 23.2 $ */
/* Copyright 1998-9 Sun Microsystems, Inc.
See the LICENSE file for license information. */
# pragma interface
// An OS-specific basic window, specialized for the spy.
// Includes standard drawing API, and support for one font.
class PlatformWindow: public CHeapObj {
protected:
// State:
long int _red, _yellow, _black, _white;
int _min_w, _max_w, _min_h, _max_h; // these are for outer part of window
public:
// Creation/destruction:
PlatformWindow();
~PlatformWindow() {close(); }
// Opening/closing:
// There also may be a platform-specific open
// All positions & sizes include window frame as well as inner part.
virtual bool open( char* display_name,
int x, int y, int w, int h,
int min_w, int max_w, int min_h, int max_h, // -1 for don't care
char* window_name, char* icon_name,
char* font_name, int font_size );
virtual void close();
// Accessors:
bool is_open();
bool is_mono();
int left(), top(), width(), height();
int screen_width(), screen_height(), menubar_height();
int font_width(), font_height();
char* default_fixed_font_name();
int default_fixed_font_size();
// Handy operations:
// The parameters for the next two operations are for the OUTER part of the window.
// The inset... methods give the inset between the outer parts and the inner.
virtual bool change_extent(int left, int top, int w, int h);
virtual bool change_size_hints( int min_w, int max_w, int min_h, int max_h );
virtual int inset_left(), inset_top(), inset_right(), inset_bottom();
virtual void adjust_after_resize();
virtual void full_redraw();
// Drawing:
// Enclose a set of drawing commands in pre_ and post_:
virtual bool pre_draw(bool incr); // dont proceed if I return false
virtual void post_draw(bool incr);
void draw_text( char* text, int x, int y );
void draw_line(int x1, int y1, int x2, int y2);
void draw_rectangle_black(int x, int y, int w, int h);
void fill_rectangle_black(int x, int y, int w, int h);
void clear_rectangle(int x, int y, int w, int h);
void clear_square(int x, int y, int s) { clear_rectangle (x, y, s, s); }
void draw_square(int x, int y, int s) { draw_rectangle_black(x, y, s, s); }
void set_color(int c); // param is result of red()... below
void set_thickness(int t);
void set_grey();
void set_solid();
void set_xor();
void set_copy();
long int red() { return _red; }
long int yellow() { return _yellow; }
long int black() { return _black; }
long int white() { return _white; }
protected:
// Platform-specific fn:
bool tell_platform_size_hints();
# include "_platformWindow_pd.h.incl"
};