diff --git a/dll/win32/uxtheme/ncthm.h b/dll/win32/uxtheme/ncthm.h new file mode 100644 index 00000000000..4b199ee595a --- /dev/null +++ b/dll/win32/uxtheme/ncthm.h @@ -0,0 +1,48 @@ + +typedef struct _DRAW_CONTEXT +{ + HWND hWnd; + HDC hDC; + HTHEME theme; + WINDOWINFO wi; + BOOL Active; /* wi.dwWindowStatus isn't correct for mdi child windows */ + HRGN hRgn; + int CaptionHeight; + + /* for double buffering */ + HDC hDCScreen; + HBITMAP hbmpOld; +} DRAW_CONTEXT, *PDRAW_CONTEXT; + +typedef enum +{ + CLOSEBUTTON, + MAXBUTTON, + MINBUTTON, + HELPBUTTON +} CAPTIONBUTTON; + +/* +The following values specify all possible vutton states +Note that not all of them are documented but it is easy to +find them by opening a theme file +*/ +typedef enum { + BUTTON_NORMAL = 1 , + BUTTON_HOT , + BUTTON_PRESSED , + BUTTON_DISABLED , + BUTTON_INACTIVE +} THEME_BUTTON_STATES; + +#define HASSIZEGRIP(Style, ExStyle, ParentStyle, WindowRect, ParentClientRect) \ + ((!(Style & WS_CHILD) && (Style & WS_THICKFRAME) && !(Style & WS_MAXIMIZE)) || \ + ((Style & WS_CHILD) && (ParentStyle & WS_THICKFRAME) && !(ParentStyle & WS_MAXIMIZE) && \ + (WindowRect.right - WindowRect.left == ParentClientRect.right) && \ + (WindowRect.bottom - WindowRect.top == ParentClientRect.bottom))) + +#define HAS_MENU(hwnd,style) ((((style) & (WS_CHILD | WS_POPUP)) != WS_CHILD) && GetMenu(hwnd)) + +#define BUTTON_GAP_SIZE 2 + +#define MENU_BAR_ITEMS_SPACE (12) diff --git a/dll/win32/uxtheme/nonclient.c b/dll/win32/uxtheme/nonclient.c index fc85c834652..0ecfdc3c663 100644 --- a/dll/win32/uxtheme/nonclient.c +++ b/dll/win32/uxtheme/nonclient.c @@ -12,59 +12,12 @@ #include "vfwmsgs.h" #include "uxtheme.h" #include +#include "ncthm.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(uxtheme); -typedef struct _DRAW_CONTEXT -{ - HWND hWnd; - HDC hDC; - HTHEME theme; - WINDOWINFO wi; - BOOL Active; /* wi.dwWindowStatus isn't correct for mdi child windows */ - HRGN hRgn; - int CaptionHeight; - - /* for double buffering */ - HDC hDCScreen; - HBITMAP hbmpOld; -} DRAW_CONTEXT, *PDRAW_CONTEXT; - -typedef enum -{ - CLOSEBUTTON, - MAXBUTTON, - MINBUTTON, - HELPBUTTON -} CAPTIONBUTTON; - -/* -The following values specify all possible vutton states -Note that not all of them are documented but it is easy to -find them by opening a theme file -*/ -typedef enum { - BUTTON_NORMAL = 1 , - BUTTON_HOT , - BUTTON_PRESSED , - BUTTON_DISABLED , - BUTTON_INACTIVE -} THEME_BUTTON_STATES; - -#define HASSIZEGRIP(Style, ExStyle, ParentStyle, WindowRect, ParentClientRect) \ - ((!(Style & WS_CHILD) && (Style & WS_THICKFRAME) && !(Style & WS_MAXIMIZE)) || \ - ((Style & WS_CHILD) && (ParentStyle & WS_THICKFRAME) && !(ParentStyle & WS_MAXIMIZE) && \ - (WindowRect.right - WindowRect.left == ParentClientRect.right) && \ - (WindowRect.bottom - WindowRect.top == ParentClientRect.bottom))) - -#define HAS_MENU(hwnd,style) ((((style) & (WS_CHILD | WS_POPUP)) != WS_CHILD) && GetMenu(hwnd)) - -#define BUTTON_GAP_SIZE 2 - -#define MENU_BAR_ITEMS_SPACE (12) - HFONT hMenuFont = NULL; HFONT hMenuFontBold = NULL; @@ -1094,4 +1047,4 @@ ThemeWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, WNDPROC DefWndPr default: return DefWndProc(hWnd, Msg, wParam, lParam); } -} \ No newline at end of file +}