nux-1.14.0
|
00001 /* 00002 * Copyright 2010 Inalogic® Inc. 00003 * 00004 * This program is free software: you can redistribute it and/or modify it 00005 * under the terms of the GNU Lesser General Public License, as 00006 * published by the Free Software Foundation; either version 2.1 or 3.0 00007 * of the License. 00008 * 00009 * This program is distributed in the hope that it will be useful, but 00010 * WITHOUT ANY WARRANTY; without even the implied warranties of 00011 * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR 00012 * PURPOSE. See the applicable version of the GNU Lesser General Public 00013 * License for more details. 00014 * 00015 * You should have received a copy of both the GNU Lesser General Public 00016 * License along with this program. If not, see <http://www.gnu.org/licenses/> 00017 * 00018 * Authored by: Jay Taoko <jaytaoko@inalogic.com> 00019 * 00020 */ 00021 00022 00023 #ifndef NUX_H 00024 #define NUX_H 00025 00026 #include "NuxCore/NuxCore.h" 00027 00028 #include "NuxCore/SystemTypes.h" 00029 #include "NuxCore/Error.h" 00030 #include "NuxCore/FilePath.h" 00031 #include "NuxCore/Color.h" 00032 #include "NuxCore/Rect.h" 00033 #include "NuxCore/Point.h" 00034 #include "NuxCore/Size.h" 00035 00036 #include "NuxCore/ObjectPtr.h" 00037 00038 #include "NuxCore/Math/Constants.h" 00039 #include "NuxCore/Math/Vector3.h" 00040 #include "NuxCore/Math/Vector4.h" 00041 #include "NuxCore/Math/Matrix3.h" 00042 #include "NuxCore/Math/Matrix4.h" 00043 #include "NuxCore/Math/Spline.h" 00044 00045 #include <sigc++/trackable.h> 00046 #include <sigc++/signal.h> 00047 #include <sigc++/functors/ptr_fun.h> 00048 #include <sigc++/functors/mem_fun.h> 00049 #include <sigc++/adaptors/bind.h> 00050 #include <sigc++/functors/slot.h> 00051 00052 #include <glib.h> 00053 00054 #define NUX_USE_GLIB_LOOP_ON_WINDOWS 00055 //#define NUX_DISABLE_GLIB_LOOP 00056 00057 #include "Utils.h" 00058 #include "WidgetMetrics.h" 00059 #include "Area.h" 00060 #include "InputArea.h" 00061 #include "Theme.h" 00062 #include "Painter.h" 00063 #include "View.h" 00064 #include "AbstractThread.h" 00065 #include "WindowThread.h" 00066 #include "WindowCompositor.h" 00067 #include "Timeline.h" 00068 #include "SystemThread.h" 00069 00070 00071 00072 namespace nux 00073 { 00074 00075 class WindowThread; 00076 class SystemThread; 00077 //class BasePainter; 00078 class WindowCompositor; 00079 class TimerHandler; 00080 //class Theme; 00081 00082 void NuxInitialize (const TCHAR *CommandLine); 00083 00085 WindowThread *CreateGUIThread (const TCHAR *WindowTitle, 00086 t_u32 width, 00087 t_u32 height, 00088 WindowThread *Parent = NULL, 00089 ThreadUserInitFunc UserInitFunc = NULL, 00090 void *InitData = NULL); 00091 00092 #if defined(NUX_OS_WINDOWS) 00093 00094 WindowThread *CreateFromForeignWindow (HWND WindowHandle, HDC WindowDCHandle, HGLRC OpenGLRenderingContext, 00095 ThreadUserInitFunc UserInitFunc, 00096 void *InitData); 00097 #elif defined(NUX_OS_LINUX) 00098 00099 WindowThread *CreateFromForeignWindow (Window X11Window, GLXContext OpenGLContext, 00100 ThreadUserInitFunc UserInitFunc, 00101 void *InitData); 00102 #endif 00103 00104 // Create a window thread that is a child of the Parent. This thread has a window. 00105 WindowThread *CreateWindowThread (WindowStyle WndStyle, 00106 const TCHAR *WindowTitle, 00107 t_u32 width, 00108 t_u32 height, 00109 WindowThread *Parent, 00110 ThreadUserInitFunc UserInitFunc = NULL, 00111 void *InitData = NULL); 00112 00113 // Create a Modal window thread that is a child of the Parent. This thread has a window. 00114 WindowThread *CreateModalWindowThread (WindowStyle WndStyle, 00115 const TCHAR *WindowTitle, 00116 t_u32 width, 00117 t_u32 height, 00118 WindowThread *Parent, 00119 ThreadUserInitFunc UserInitFunc = NULL, 00120 void *InitData = NULL); 00121 00122 // Create a simple thread 00123 SystemThread *CreateSystemThread (AbstractThread *Parent = NULL, 00124 ThreadUserInitFunc UserInitFunc = NULL, void *InitData = NULL); 00125 00126 ThreadState GetThreadState (unsigned int ThreadID); 00127 00128 00129 ObjectPtr<FontTexture> GetSysFont(); 00130 ObjectPtr<FontTexture> GetSysBoldFont(); 00131 00132 NThread *GetThreadApplication (); // deprecated 00133 WindowThread *GetGraphicsThread (); // deprecated 00134 WindowThread *GetWindowThread (); 00135 GraphicsDisplay &GetWindow (); 00136 GraphicsEngine &GetGraphicsEngine (); 00137 WindowCompositor &GetWindowCompositor (); 00138 BasePainter &GetPainter (); 00139 UXTheme &GetTheme (); 00140 TimerHandler &GetTimer (); 00141 00142 #define gPainter nux::GetPainter () // deprecated 00143 #define gTheme nux::GetTheme () // deprecated 00144 00145 inlDeclareThreadLocalStorage (NThread *, 0, ThreadLocal_InalogicAppImpl); 00146 00147 } 00148 00149 #endif // NUX_H