00001 //--- < SDXPSDL.H > -------------| ViewGraph - A Flexible Graph view Framework | 00002 // 00003 // And XpLib+SDL wrapper for ViewGraph 00004 // 00005 // Note: SDL supports monochrome cursors 00006 // only. 00007 // 00008 // $Author: botik32 $ 00009 // $Revision: 1.1.1.1 $ 00010 // $Date: 2004/03/26 10:50:27 $ 00011 //-----------------------------------------------------------------------------/ 00012 #ifndef SDXPSDL_H 00013 #define SDXPSDL_H 00014 00015 #include <cZUI/drivers/sdsdl.h> 00016 00017 class SDLXpSurfaceDriver : public SDLSurfaceDriver{ 00018 protected: 00019 XpWindow *xw; 00020 static Uint16 rgb216b( char, char, char ); 00021 public: 00022 void penstyle( const char * ); 00023 void line( double x1, double y1, double x2, double y2 ); 00024 void rectangle( double x1, double y1, double x2, double y2 ); 00025 void dot( double x1, double y1 ); 00026 void circle( double x1, double y1, int radius ); 00027 void bezier( double x1, double y1, double x2, double y2, 00028 double x3, double y3 ); 00029 virtual void fill_h_triangle( double x1, double y1, 00030 double x2, double y2, double x3 ); 00031 virtual void fill_v_triangle( double x1, double y1, 00032 double x2, double y2, double y3 ); 00033 00034 void repaint( void ); 00035 void clear( void ); 00036 void clear_rect( int, int, int, int ); 00037 void repaint_rect( int, int, int, int ); 00038 00039 virtual void textout( double x1, double y1, const char *text ); 00040 virtual void textrect( double x1, double y1, 00041 double x2, double y2, const char *text ); 00042 virtual void setfont( const char *font ); 00043 virtual void setfontsize( int ); 00044 virtual void setjustification( textjustify ); 00045 00046 bool rectfits( double, double, double, double ); 00047 00048 SDLXpSurfaceDriver( int, int ); 00049 SDLXpSurfaceDriver( SDL_Surface * ); 00050 // Override surface width 00051 SDLXpSurfaceDriver( SDL_Surface *, int, int ); 00052 00053 ~SDLXpSurfaceDriver(); 00054 }; 00055 00056 #endif 00057 00058 /// $Log: sdxpsdl.h,v $ 00059 /// Revision 1.1.1.1 2004/03/26 10:50:27 botik32 00060 /// Initial release 00061 /// 00062 /// Revision 1.1.1.1 2004/03/26 08:53:33 botik 00063 /// initial import 00064 /// 00065 /// 00066 /// Revision 1.22 2004/03/09 16:31:37 botik 00067 /// Split sdxpsdl into sdlsdl and sdlxpsdl parts. 00068 /// 00069 /// Revision 1.21 2004/03/09 14:17:27 botik 00070 /// Added SGE support 00071 /// 00072 /// Revision 1.20 2004/01/03 19:59:41 botik 00073 /// added text support via aedGUI 00074 /// 00075 /// Revision 1.19 2003/12/30 11:11:03 botik 00076 /// Fixed a few memory leak bugs (definitely lost memory) 00077 /// 00078 /// Revision 1.18 2003/12/12 11:32:33 botik 00079 /// Added drivers/mouse.h 00080 /// Moved msbutton definition to drivers/mouse.h 00081 /// Added get_mousestate to SurfaceDriver 00082 /// Added get_mousestate to ScrollableView 00083 /// Changed the zoom decorator to only receive events if 00084 /// the left mouse is pressed 00085 /// Moved scroll layer beneath the zoom decorator layer 00086 /// This hopefully fixes a segfault when zoomdecorator gets 00087 /// invalid position after scroll 00088 /// 00089 /// Revision 1.17 2003/12/04 01:02:14 botik 00090 /// Added Image class to framework 00091 /// Added SDLImage class to drivers/sdxpsdl 00092 /// Added load_image to surfacedriver class 00093 /// Added put_image to surfacedriver class 00094 /// Added load_image and put_image to scrollableview class 00095 /// 00096 /// Revision 1.16 2003/11/28 22:12:12 botik 00097 /// Added size storing for basescenenode so that 00098 /// hud nodes draw appropriately 00099 /// 00100 /// Revision 1.15 2003/11/28 20:16:35 botik 00101 /// fixed a problem with sdl includes under windows 00102 /// 00103 /// Revision 1.14 2003/11/18 17:47:20 botik 00104 /// Added triangle fill function to surface driver 00105 /// and views 00106 /// 00107 /// Revision 1.13 2003/11/18 13:54:06 botik 00108 /// Got the borderlayer to scroll well. 00109 /// 00110 /// Revision 1.12 2003/11/17 18:39:37 botik 00111 /// Added rectangle to surface driver. 00112 /// Sdxpsdl line and rectangle bugfixes 00113 /// 00114 /// Revision 1.11 2003/11/14 16:00:42 botik 00115 /// Got camerafocus to ignore cameras in 'Off' state 00116 /// Fixed camera to keep latest camera status change 00117 /// event as status. 00118 /// 00119 /// Revision 1.10 2003/11/13 18:50:18 botik 00120 /// Fixed (almost) clear and update rect behaviour. 00121 /// Added update_rect to framework and sdl wrapper. 00122 /// Added mouse_in/mouse_out handling 00123 /// Fixed message handling 00124 /// Many small bugfixes 00125 /// 00126 /// Revision 1.9 2003/11/13 12:50:51 botik 00127 /// Refined the event handling architecture 00128 /// Got the event handling to recognize and treat mouse 00129 /// events accordingly 00130 /// Important fixes to ./Makefile 00131 /// 00132 /// Revision 1.8 2003/11/12 12:04:27 botik 00133 /// Further refinements of contrib/borderlayer, 00134 /// added inner event generation to view and surface 00135 /// classes, 00136 /// a few minor bugfixes 00137 /// 00138 /// Revision 1.7 2003/11/12 00:47:31 botik 00139 /// Further work on getting repaints to work, tested with 00140 /// scrolling 00141 /// 00142 /// Revision 1.6 2003/11/11 23:18:31 botik 00143 /// Got sdlxp driver to work, fixed a few architecture 00144 /// errors and some bugs 00145 /// 00146 /// Revision 1.5 2003/11/08 23:45:54 botik 00147 /// Got the framework to compile, in order to do that 00148 /// filled in some functions and added some empty 00149 /// ones as well. 00150 /// 00151 /// Revision 1.4 2003/11/07 18:13:47 botik 00152 /// Added cursor switch and cursor query support. 00153 /// 00154 /// Revision 1.3 2003/11/07 17:51:32 botik 00155 /// Added cursor support to surfacedriver. 00156 /// SetCursor does not work yet but should be 00157 /// piece of cake 00158 /// 00159 /// Revision 1.2 2003/10/15 11:56:19 botik 00160 /// Added a new function called rectfits() that will 00161 /// check if a given rectangle fits the canvas. This 00162 /// function should be used to decide whether to draw 00163 /// an object or not. 00164 /// 00165 /// Revision 1.1 2003/10/13 16:36:04 botik 00166 /// Recovered from changes onto an exported version. Added display_framework 00167 /// directory and changed some files in graph_display (namely those related 00168 /// to the canvas) 00169 /// 00170 00171