[uxtheme]
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Tue, 20 Sep 2011 13:08:36 +0000 (13:08 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Tue, 20 Sep 2011 13:08:36 +0000 (13:08 +0000)
- Use precompiled headers

svn path=/trunk/; revision=53771

17 files changed:
reactos/dll/win32/uxtheme/CMakeLists.txt
reactos/dll/win32/uxtheme/buffer.c
reactos/dll/win32/uxtheme/draw.c
reactos/dll/win32/uxtheme/main.c
reactos/dll/win32/uxtheme/metric.c
reactos/dll/win32/uxtheme/msstyles.c
reactos/dll/win32/uxtheme/ncscrollbar.c
reactos/dll/win32/uxtheme/ncthm.h [deleted file]
reactos/dll/win32/uxtheme/nonclient.c
reactos/dll/win32/uxtheme/property.c
reactos/dll/win32/uxtheme/stylemap.c
reactos/dll/win32/uxtheme/system.c
reactos/dll/win32/uxtheme/themehooks.c
reactos/dll/win32/uxtheme/uxini.c
reactos/dll/win32/uxtheme/uxtheme.rbuild
reactos/dll/win32/uxtheme/uxthemedll.h [deleted file]
reactos/dll/win32/uxtheme/uxthemep.h [moved from reactos/dll/win32/uxtheme/msstyles.h with 51% similarity]

index ff0b710..0d5a2e3 100644 (file)
@@ -27,5 +27,6 @@ set_module_type(uxtheme win32dll)
 target_link_libraries(uxtheme wine)
 add_delay_importlibs(uxtheme msimg32)
 add_importlibs(uxtheme user32 advapi32 gdi32 msvcrt kernel32 ntdll)
+add_pch(uxtheme uxthemep.h)
 add_cd_file(TARGET uxtheme DESTINATION reactos/system32 FOR all)
 add_importlib_target(uxtheme.spec)
index f4d8229..416a342 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "config.h"
-
-#include <stdlib.h>
-#include <stdarg.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "winuser.h"
-#include "wingdi.h"
-#include "vfwmsgs.h"
-#include "uxtheme.h"
+#include "uxthemep.h"
+#include "wine/debug.h"
 
 #include "wine/debug.h"
 
index 60b1e92..a248b24 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "config.h"
-
-#include <stdlib.h>
-#include <stdarg.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "winuser.h"
-#include "wingdi.h"
-#include "vfwmsgs.h"
-#include "uxtheme.h"
-#include "tmschema.h"
-
-#include "msstyles.h"
-#include "uxthemedll.h"
+#include "uxthemep.h"
+#include "wine/debug.h"
 
 #include "wine/debug.h"
 
@@ -1881,7 +1868,7 @@ HRESULT UXTHEME_GetImageBackBackgroundRegion(HTHEME hTheme, HDC hdc, int iPartId
     hbmp = UXTHEME_DrawThemePartToDib(hTheme, hdc, iPartId, iStateId, pRect);
 
     /* Retrieve the info of the dib section */
-    GetObject(hbmp, sizeof (DIBSECTION), &dib);
+    GetObjectW(hbmp, sizeof (DIBSECTION), &dib);
 
     /* Convert the bits of the dib section to a region */
     *pRegion = UXTHEME_RegionFromDibBits((RGBQUAD*)dib.dsBm.bmBits, &clrTransparent, pRect);
index 74444e9..749ff18 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "config.h"
-
-#include <stdarg.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "uxthemedll.h"
+#include "uxthemep.h"
+#include "wine/debug.h"
 
 #include "wine/debug.h"
 
index 6f8519e..5f6b8eb 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "config.h"
-
-#include <stdarg.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "wingdi.h"
-#include "winuser.h"
-#include "vfwmsgs.h"
-#include "uxtheme.h"
-#include "tmschema.h"
-
-#include "msstyles.h"
+#include "uxthemep.h"
+#include "wine/debug.h"
 
 #include "wine/debug.h"
 
index d21700a..e588bac 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "config.h"
-
-#include <stdarg.h>
-#include <stdlib.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "wingdi.h"
-#include "winuser.h"
-#include "winnls.h"
-#include "vfwmsgs.h"
-#include "uxtheme.h"
-#include "tmschema.h"
-
-#include "msstyles.h"
+#include "uxthemep.h"
+#include "wine/debug.h"
 
 #include "wine/unicode.h"
 #include "wine/debug.h"
index 5ce53c5..c882095 100644 (file)
@@ -9,14 +9,7 @@
  *                  Copyright 1994, 1996 Alexandre Julliard
  */
  
-#include <windows.h>
-#include "undocuser.h"
-#include "vfwmsgs.h"
-#include "uxtheme.h"
-#include <tmschema.h>
-#include <windowsx.h>
-#include "ncthm.h"
-#include <assert.h>
+#include "uxthemep.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(uxtheme);
diff --git a/reactos/dll/win32/uxtheme/ncthm.h b/reactos/dll/win32/uxtheme/ncthm.h
deleted file mode 100644 (file)
index 4b9e76b..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-
-typedef struct _WND_CONTEXT
-{
-    BOOL HasAppDefinedRgn;
-    BOOL HasThemeRgn;
-    BOOL UpdatingRgn;
-} WND_CONTEXT, *PWND_CONTEXT;
-
-typedef struct _DRAW_CONTEXT
-{
-    HWND hWnd;
-    HDC hDC;
-    HTHEME theme; 
-    HTHEME scrolltheme;
-    HTHEME hPrevTheme;
-    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;
-
-  /* Scroll-bar hit testing */
-enum SCROLL_HITTEST
-{
-    SCROLL_NOWHERE,      /* Outside the scroll bar */
-    SCROLL_TOP_ARROW,    /* Top or left arrow */
-    SCROLL_TOP_RECT,     /* Rectangle between the top arrow and the thumb */
-    SCROLL_THUMB,        /* Thumb rectangle */
-    SCROLL_BOTTOM_RECT,  /* Rectangle between the thumb and the bottom arrow */
-    SCROLL_BOTTOM_ARROW  /* Bottom or right arrow */
-};
-
-#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)
-
-#define SCROLL_TIMER   0                /* Scroll timer id */
-
-  /* Overlap between arrows and thumb */
-#define SCROLL_ARROW_THUMB_OVERLAP 0
-
-  /* Delay (in ms) before first repetition when holding the button down */
-#define SCROLL_FIRST_DELAY   200
-
-  /* Delay (in ms) between scroll repetitions */
-#define SCROLL_REPEAT_DELAY  50
-
-/* Minimum size of the thumb in pixels */
-#define SCROLL_MIN_THUMB 6
-
-/* Minimum size of the rectangle between the arrows */
-#define SCROLL_MIN_RECT  4
-
-void 
-ThemeDrawScrollBar(PDRAW_CONTEXT pcontext, INT Bar, POINT* pt);
-
-VOID
-NC_TrackScrollBar(HWND Wnd, WPARAM wParam, POINT Pt);
-
-void
-ThemeInitDrawContext(PDRAW_CONTEXT pcontext,
-                     HWND hWnd,
-                     HRGN hRgn);
-
-void
-ThemeCleanupDrawContext(PDRAW_CONTEXT pcontext);
-
-PWND_CONTEXT 
-ThemeGetWndContext(HWND hWnd);
-
-extern ATOM atWindowTheme;
-extern ATOM atWndContrext;
-
index ffcbb36..98008c4 100644 (file)
@@ -6,14 +6,7 @@
  * PROGRAMMER:      Giannis Adamopoulos
  */
  
-#include <windows.h>
-#include <windowsx.h>
-#include "undocuser.h"
-#include "vfwmsgs.h"
-#include "uxtheme.h"
-#include <tmschema.h>
-#include "ncthm.h"
-
+#include "uxthemep.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(uxtheme);
index 146649e..9c5faaf 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "config.h"
-
-#include <stdarg.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "winuser.h"
-#include "wingdi.h"
-#include "vfwmsgs.h"
-#include "uxtheme.h"
-#include "tmschema.h"
-
-#include "msstyles.h"
-
+#include "uxthemep.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(uxtheme);
index a310d40..eae20cf 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "config.h"
-
-#include <stdarg.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "winuser.h"
-#include "tmschema.h"
-
-#define TMT_ENUM 200
+#include "uxthemep.h"
+#include "wine/debug.h"
 
 typedef struct _MSSTYLES_PROPERTY_MAP {
     WORD dwPrimitiveType;
index 6cb934f..465af60 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "config.h"
-
-#include <stdarg.h>
-#include <stdio.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "wingdi.h"
-#include "winuser.h"
-#include "winreg.h"
-#include "vfwmsgs.h"
-#include "uxtheme.h"
-#include "tmschema.h"
-#include "uxundoc.h"
-
-#include "uxthemedll.h"
-#include "msstyles.h"
-#include "ncthm.h"
-
+#include "uxthemep.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(uxtheme);
index 94df23a..85bf1dc 100644 (file)
@@ -6,15 +6,7 @@
  * PROGRAMMER:      Giannis Adamopoulos
  */
  
-#include <windows.h>
-#include <undocuser.h>
-
-#include "vfwmsgs.h"
-#include "uxtheme.h"
-#include "uxthemedll.h"
-#include "ncthm.h"
-#include "tmschema.h"
-
+#include "uxthemep.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(uxtheme);
index a2dfabf..083fbed 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "config.h"
-
-#include <stdarg.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "winnls.h"
-
+#include "uxthemep.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(uxtheme);
@@ -42,7 +35,7 @@ typedef struct _UXINI_FILE {
     LPCWSTR lpIni;
     LPCWSTR lpCurLoc;
     LPCWSTR lpEnd;
-} UXINI_FILE, *PUXINI_FILE;
+} UXINI_FILE;
 
 /***********************************************************************/
 
index 723f14b..3ad9493 100644 (file)
@@ -6,6 +6,7 @@
        <include base="uxtheme">.</include>
        <include base="ReactOS">include/reactos/wine</include>
        <define name="__WINESRC__" />
+       <pch>uxthemep.h</pch>
        <file>buffer.c</file>
        <file>draw.c</file>
        <file>main.c</file>
diff --git a/reactos/dll/win32/uxtheme/uxthemedll.h b/reactos/dll/win32/uxtheme/uxthemedll.h
deleted file mode 100644 (file)
index e55d98f..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Internal uxtheme defines & declarations
- *
- * Copyright (C) 2003 Kevin Koltzau
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#ifndef __WINE_UXTHEMEDLL_H
-#define __WINE_UXTHEMEDLL_H
-
-extern void UXTHEME_InitSystem(HINSTANCE hInst);
-extern void UXTHEME_LoadTheme(BOOL bLoad);
-extern BOOL CALLBACK UXTHEME_broadcast_msg (HWND hWnd, LPARAM msg);
-
-/* No alpha blending */
-#define ALPHABLEND_NONE             0
-/* "Cheap" binary alpha blending - but possibly faster */
-#define ALPHABLEND_BINARY           1
-/* Full alpha blending */
-#define ALPHABLEND_FULL             2
-
-#endif /* __WINE_UXTHEMEDLL_H */
similarity index 51%
rename from reactos/dll/win32/uxtheme/msstyles.h
rename to reactos/dll/win32/uxtheme/uxthemep.h
index 6cd73ac..e8e0f5d 100644 (file)
@@ -1,25 +1,14 @@
-/*
- * Internal msstyles related defines & declarations
- *
- * Copyright (C) 2003 Kevin Koltzau
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#ifndef __WINE_MSSTYLES_H
-#define __WINE_MSSTYLES_H
+#include <windows.h>
+#include <windowsx.h>
+#include <undocuser.h>
+#include <uxtheme.h>
+#include <uxundoc.h>
+#include <vfwmsgs.h>
+#include <tmschema.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
 
 #define TMT_ENUM 200
 
@@ -115,4 +104,109 @@ BOOL UXINI_FindSection(PUXINI_FILE uf, LPCWSTR lpName);
 LPCWSTR UXINI_GetNextValue(PUXINI_FILE uf, DWORD *dwNameLen, LPCWSTR *lpValue, DWORD *dwValueLen);
 BOOL UXINI_FindValue(PUXINI_FILE uf, LPCWSTR lpName, LPCWSTR *lpValue, DWORD *dwValueLen);
 
-#endif
+
+
+typedef struct _WND_CONTEXT
+{
+    BOOL HasAppDefinedRgn;
+    BOOL HasThemeRgn;
+    BOOL UpdatingRgn;
+} WND_CONTEXT, *PWND_CONTEXT;
+
+typedef struct _DRAW_CONTEXT
+{
+    HWND hWnd;
+    HDC hDC;
+    HTHEME theme; 
+    HTHEME scrolltheme;
+    HTHEME hPrevTheme;
+    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;
+
+  /* Scroll-bar hit testing */
+enum SCROLL_HITTEST
+{
+    SCROLL_NOWHERE,      /* Outside the scroll bar */
+    SCROLL_TOP_ARROW,    /* Top or left arrow */
+    SCROLL_TOP_RECT,     /* Rectangle between the top arrow and the thumb */
+    SCROLL_THUMB,        /* Thumb rectangle */
+    SCROLL_BOTTOM_RECT,  /* Rectangle between the thumb and the bottom arrow */
+    SCROLL_BOTTOM_ARROW  /* Bottom or right arrow */
+};
+
+#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)
+
+#define SCROLL_TIMER   0                /* Scroll timer id */
+
+  /* Overlap between arrows and thumb */
+#define SCROLL_ARROW_THUMB_OVERLAP 0
+
+  /* Delay (in ms) before first repetition when holding the button down */
+#define SCROLL_FIRST_DELAY   200
+
+  /* Delay (in ms) between scroll repetitions */
+#define SCROLL_REPEAT_DELAY  50
+
+/* Minimum size of the thumb in pixels */
+#define SCROLL_MIN_THUMB 6
+
+/* Minimum size of the rectangle between the arrows */
+#define SCROLL_MIN_RECT  4
+
+void  ThemeDrawScrollBar(PDRAW_CONTEXT pcontext, INT Bar, POINT* pt);
+VOID NC_TrackScrollBar(HWND Wnd, WPARAM wParam, POINT Pt);
+void ThemeInitDrawContext(PDRAW_CONTEXT pcontext, HWND hWnd, HRGN hRgn);
+void ThemeCleanupDrawContext(PDRAW_CONTEXT pcontext);
+PWND_CONTEXT ThemeGetWndContext(HWND hWnd);
+
+extern ATOM atWindowTheme;
+extern ATOM atWndContrext;
+
+void UXTHEME_InitSystem(HINSTANCE hInst);
+void UXTHEME_LoadTheme(BOOL bLoad);
+BOOL CALLBACK UXTHEME_broadcast_msg (HWND hWnd, LPARAM msg);
+
+/* No alpha blending */
+#define ALPHABLEND_NONE             0
+/* "Cheap" binary alpha blending - but possibly faster */
+#define ALPHABLEND_BINARY           1
+/* Full alpha blending */
+#define ALPHABLEND_FULL             2