00001 00016 #include "ZincTypes.hpp" 00017 00018 #include <exception> 00019 #include <string> 00020 #include <tcl.h> 00021 00022 #ifndef ZINC_OBJECTS 00023 #define ZINC_OBJECTS 00024 00025 // Object representing a zinc item 00026 class ZincItem 00027 { 00028 protected: 00032 ZincItem (); 00033 00034 public: 00035 Tcl_Obj *object; //the object we are storing 00036 00042 ZincItem (Tcl_Obj *obj); 00043 00047 virtual ~ZincItem (); 00048 }; 00049 00050 // Object representing a zinc image 00051 class ZincImage : public ZincItem 00052 { 00056 ZincImage (); 00057 00058 bool madeFromInternal; 00059 00060 public: 00066 ZincImage (Tcl_Obj *obj); 00067 00073 ZincImage (Tcl_Obj *obj, bool internal); 00074 00078 virtual ~ZincImage (); 00079 }; 00080 00081 // Object representing a zinc bitmap 00082 class ZincBitmap : public ZincItem 00083 { 00087 ZincBitmap (); 00088 00089 bool madeFromInternal; 00090 00091 public: 00097 ZincBitmap (Tcl_Obj *obj); 00098 00104 ZincBitmap (Tcl_Obj *obj, bool internal); 00105 00111 ZincBitmap (String name); 00112 00116 virtual ~ZincBitmap (); 00117 }; 00118 00119 // Object representing a zinc font 00120 class ZincFont 00121 { 00125 ZincFont (); 00126 00127 public: 00128 String name; 00129 00133 ZincFont (const char *font); 00134 00135 }; 00136 00140 class ZincException : public std::exception 00141 { 00142 00143 private: 00144 String msg; // the exception message 00145 String file; // file where exception have been caught 00146 int line; // line where exception have been caught 00147 00148 public: 00154 ZincException (String msg, char *file, int lineNo); 00155 00161 ZincException (const ZincException &exception); 00162 00166 virtual ~ZincException () throw(); 00167 00173 const char* what () const throw (); 00174 }; 00175 00176 #endif