Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenuxthemep.h
Go to the documentation of this file.
00001 #include <windows.h> 00002 #include <windowsx.h> 00003 #include <undocuser.h> 00004 #include <uxtheme.h> 00005 #include <uxundoc.h> 00006 #include <vfwmsgs.h> 00007 #include <tmschema.h> 00008 #include <stdarg.h> 00009 #include <stdio.h> 00010 #include <stdlib.h> 00011 #include <assert.h> 00012 00013 #define TMT_ENUM 200 00014 00015 #define MAX_THEME_APP_NAME 60 00016 #define MAX_THEME_CLASS_NAME 60 00017 #define MAX_THEME_VALUE_NAME 60 00018 00019 typedef struct _THEME_PROPERTY { 00020 int iPrimitiveType; 00021 int iPropertyId; 00022 PROPERTYORIGIN origin; 00023 00024 LPCWSTR lpValue; 00025 DWORD dwValueLen; 00026 00027 struct _THEME_PROPERTY *next; 00028 } THEME_PROPERTY, *PTHEME_PROPERTY; 00029 00030 typedef struct _THEME_PARTSTATE { 00031 int iPartId; 00032 int iStateId; 00033 PTHEME_PROPERTY properties; 00034 00035 struct _THEME_PARTSTATE *next; 00036 } THEME_PARTSTATE, *PTHEME_PARTSTATE; 00037 00038 struct _THEME_FILE; 00039 00040 typedef struct _THEME_CLASS { 00041 HMODULE hTheme; 00042 struct _THEME_FILE* tf; 00043 WCHAR szAppName[MAX_THEME_APP_NAME]; 00044 WCHAR szClassName[MAX_THEME_CLASS_NAME]; 00045 PTHEME_PARTSTATE partstate; 00046 struct _THEME_CLASS *overrides; 00047 00048 struct _THEME_CLASS *next; 00049 } THEME_CLASS, *PTHEME_CLASS; 00050 00051 typedef struct _THEME_IMAGE { 00052 WCHAR name[MAX_PATH]; 00053 HBITMAP image; 00054 BOOL hasAlpha; 00055 00056 struct _THEME_IMAGE *next; 00057 } THEME_IMAGE, *PTHEME_IMAGE; 00058 00059 typedef struct _THEME_FILE { 00060 DWORD dwRefCount; 00061 HMODULE hTheme; 00062 WCHAR szThemeFile[MAX_PATH]; 00063 LPWSTR pszAvailColors; 00064 LPWSTR pszAvailSizes; 00065 00066 LPWSTR pszSelectedColor; 00067 LPWSTR pszSelectedSize; 00068 00069 PTHEME_CLASS classes; 00070 PTHEME_PROPERTY metrics; 00071 PTHEME_IMAGE images; 00072 } THEME_FILE, *PTHEME_FILE; 00073 00074 typedef struct _UXINI_FILE *PUXINI_FILE; 00075 00076 HRESULT MSSTYLES_OpenThemeFile(LPCWSTR lpThemeFile, LPCWSTR pszColorName, LPCWSTR pszSizeName, PTHEME_FILE *tf); 00077 void MSSTYLES_CloseThemeFile(PTHEME_FILE tf); 00078 HRESULT MSSTYLES_SetActiveTheme(PTHEME_FILE tf, BOOL setMetrics); 00079 PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszAppName, LPCWSTR pszClassList); 00080 HRESULT MSSTYLES_CloseThemeClass(PTHEME_CLASS tc); 00081 BOOL MSSTYLES_LookupProperty(LPCWSTR pszPropertyName, int *dwPrimitive, int *dwId); 00082 BOOL MSSTYLES_LookupEnum(LPCWSTR pszValueName, int dwEnum, int *dwValue); 00083 BOOL MSSTYLES_LookupPartState(LPCWSTR pszClass, LPCWSTR pszPart, LPCWSTR pszState, int *iPartId, int *iStateId); 00084 PUXINI_FILE MSSTYLES_GetThemeIni(PTHEME_FILE tf); 00085 PTHEME_PARTSTATE MSSTYLES_FindPartState(PTHEME_CLASS tc, int iPartId, int iStateId, PTHEME_CLASS *tcNext); 00086 PTHEME_PROPERTY MSSTYLES_FindProperty(PTHEME_CLASS tc, int iPartId, int iStateId, int iPropertyPrimitive, int iPropertyId); 00087 PTHEME_PROPERTY MSSTYLES_FindMetric(int iPropertyPrimitive, int iPropertyId); 00088 HBITMAP MSSTYLES_LoadBitmap(PTHEME_CLASS tc, LPCWSTR lpFilename, BOOL* hasAlpha); 00089 00090 HRESULT MSSTYLES_GetPropertyBool(PTHEME_PROPERTY tp, BOOL *pfVal); 00091 HRESULT MSSTYLES_GetPropertyColor(PTHEME_PROPERTY tp, COLORREF *pColor); 00092 HRESULT MSSTYLES_GetPropertyFont(PTHEME_PROPERTY tp, HDC hdc, LOGFONTW *pFont); 00093 HRESULT MSSTYLES_GetPropertyInt(PTHEME_PROPERTY tp, int *piVal); 00094 HRESULT MSSTYLES_GetPropertyIntList(PTHEME_PROPERTY tp, INTLIST *pIntList); 00095 HRESULT MSSTYLES_GetPropertyPosition(PTHEME_PROPERTY tp, POINT *pPoint); 00096 HRESULT MSSTYLES_GetPropertyString(PTHEME_PROPERTY tp, LPWSTR pszBuff, int cchMaxBuffChars); 00097 HRESULT MSSTYLES_GetPropertyRect(PTHEME_PROPERTY tp, RECT *pRect); 00098 HRESULT MSSTYLES_GetPropertyMargins(PTHEME_PROPERTY tp, RECT *prc, MARGINS *pMargins); 00099 00100 PUXINI_FILE UXINI_LoadINI(HMODULE hTheme, LPCWSTR lpName); 00101 void UXINI_CloseINI(PUXINI_FILE uf); 00102 LPCWSTR UXINI_GetNextSection(PUXINI_FILE uf, DWORD *dwLen); 00103 BOOL UXINI_FindSection(PUXINI_FILE uf, LPCWSTR lpName); 00104 LPCWSTR UXINI_GetNextValue(PUXINI_FILE uf, DWORD *dwNameLen, LPCWSTR *lpValue, DWORD *dwValueLen); 00105 BOOL UXINI_FindValue(PUXINI_FILE uf, LPCWSTR lpName, LPCWSTR *lpValue, DWORD *dwValueLen); 00106 00107 00108 00109 typedef struct _WND_CONTEXT 00110 { 00111 BOOL HasAppDefinedRgn; 00112 BOOL HasThemeRgn; 00113 BOOL UpdatingRgn; 00114 } WND_CONTEXT, *PWND_CONTEXT; 00115 00116 typedef struct _DRAW_CONTEXT 00117 { 00118 HWND hWnd; 00119 HDC hDC; 00120 HTHEME theme; 00121 HTHEME scrolltheme; 00122 HTHEME hPrevTheme; 00123 WINDOWINFO wi; 00124 BOOL Active; /* wi.dwWindowStatus isn't correct for mdi child windows */ 00125 HRGN hRgn; 00126 int CaptionHeight; 00127 00128 /* for double buffering */ 00129 HDC hDCScreen; 00130 HBITMAP hbmpOld; 00131 } DRAW_CONTEXT, *PDRAW_CONTEXT; 00132 00133 typedef enum 00134 { 00135 CLOSEBUTTON, 00136 MAXBUTTON, 00137 MINBUTTON, 00138 HELPBUTTON 00139 } CAPTIONBUTTON; 00140 00141 /* 00142 The following values specify all possible vutton states 00143 Note that not all of them are documented but it is easy to 00144 find them by opening a theme file 00145 */ 00146 typedef enum { 00147 BUTTON_NORMAL = 1 , 00148 BUTTON_HOT , 00149 BUTTON_PRESSED , 00150 BUTTON_DISABLED , 00151 BUTTON_INACTIVE 00152 } THEME_BUTTON_STATES; 00153 00154 /* Scroll-bar hit testing */ 00155 enum SCROLL_HITTEST 00156 { 00157 SCROLL_NOWHERE, /* Outside the scroll bar */ 00158 SCROLL_TOP_ARROW, /* Top or left arrow */ 00159 SCROLL_TOP_RECT, /* Rectangle between the top arrow and the thumb */ 00160 SCROLL_THUMB, /* Thumb rectangle */ 00161 SCROLL_BOTTOM_RECT, /* Rectangle between the thumb and the bottom arrow */ 00162 SCROLL_BOTTOM_ARROW /* Bottom or right arrow */ 00163 }; 00164 00165 #define HASSIZEGRIP(Style, ExStyle, ParentStyle, WindowRect, ParentClientRect) \ 00166 ((!(Style & WS_CHILD) && (Style & WS_THICKFRAME) && !(Style & WS_MAXIMIZE)) || \ 00167 ((Style & WS_CHILD) && (ParentStyle & WS_THICKFRAME) && !(ParentStyle & WS_MAXIMIZE) && \ 00168 (WindowRect.right - WindowRect.left == ParentClientRect.right) && \ 00169 (WindowRect.bottom - WindowRect.top == ParentClientRect.bottom))) 00170 00171 #define HAS_MENU(hwnd,style) ((((style) & (WS_CHILD | WS_POPUP)) != WS_CHILD) && GetMenu(hwnd)) 00172 00173 #define BUTTON_GAP_SIZE 2 00174 00175 #define MENU_BAR_ITEMS_SPACE (12) 00176 00177 #define SCROLL_TIMER 0 /* Scroll timer id */ 00178 00179 /* Overlap between arrows and thumb */ 00180 #define SCROLL_ARROW_THUMB_OVERLAP 0 00181 00182 /* Delay (in ms) before first repetition when holding the button down */ 00183 #define SCROLL_FIRST_DELAY 200 00184 00185 /* Delay (in ms) between scroll repetitions */ 00186 #define SCROLL_REPEAT_DELAY 50 00187 00188 /* Minimum size of the thumb in pixels */ 00189 #define SCROLL_MIN_THUMB 6 00190 00191 /* Minimum size of the rectangle between the arrows */ 00192 #define SCROLL_MIN_RECT 4 00193 00194 void ThemeDrawScrollBar(PDRAW_CONTEXT pcontext, INT Bar, POINT* pt); 00195 VOID NC_TrackScrollBar(HWND Wnd, WPARAM wParam, POINT Pt); 00196 void ThemeInitDrawContext(PDRAW_CONTEXT pcontext, HWND hWnd, HRGN hRgn); 00197 void ThemeCleanupDrawContext(PDRAW_CONTEXT pcontext); 00198 PWND_CONTEXT ThemeGetWndContext(HWND hWnd); 00199 00200 extern ATOM atWindowTheme; 00201 extern ATOM atWndContrext; 00202 00203 void UXTHEME_InitSystem(HINSTANCE hInst); 00204 void UXTHEME_LoadTheme(BOOL bLoad); 00205 BOOL CALLBACK UXTHEME_broadcast_msg (HWND hWnd, LPARAM msg); 00206 00207 /* No alpha blending */ 00208 #define ALPHABLEND_NONE 0 00209 /* "Cheap" binary alpha blending - but possibly faster */ 00210 #define ALPHABLEND_BINARY 1 00211 /* Full alpha blending */ 00212 #define ALPHABLEND_FULL 2 Generated on Fri May 25 2012 04:24:53 for ReactOS by
1.7.6.1
|