00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef OMGUI_EXCEPTION_H
00024 #define OMGUI_EXCEPTION_H
00025
00026 #include <omgui/dllimpexp.h>
00027 #include <exception>
00028
00029 namespace omgui {
00030
00034 class OMGUI_EXCEPTION_API(OMGUI_API) Exception : public std::exception
00035 {
00036 public:
00037
00038
00039 enum error_codes {
00041 SYSTEM = 1,
00043 WIDGET_NO_PARENT,
00045 NATIVE_HANDLE,
00047 GUI_INIT_FAILED,
00049 PANEL_NO_LAYOUT_MANAGER,
00051 EXISTING_OBJECT_ID,
00052 };
00053
00054 protected:
00056 int m_code;
00058 int m_extra;
00060 int m_line;
00062 const char *m_file;
00063
00064 public:
00065 Exception(int code, int line, const char *file, int extra = 0) throw();
00066 virtual ~Exception() throw();
00067
00072 virtual const char *what() const throw();
00073
00077 const char *get_file() const throw();
00078
00082 int get_line() const throw();
00083
00087 int get_code() const throw();
00088
00092 int get_extra() const throw();
00093 };
00094
00095 class OMGUI_EXCEPTION_API(OMGUI_API) SystemError : public Exception
00096 {
00097 public:
00098 SystemError(int error, int line, char *file) throw()
00099 : Exception(SYSTEM, line, file, error)
00100 { }
00101 };
00102
00103 }
00104
00105 #endif