ReactOS  0.4.14-dev-49-gfb4591c
msstyles.c File Reference
#include "uxthemep.h"
#include <wine/unicode.h>
Include dependency graph for msstyles.c:

Go to the source code of this file.

Macros

#define MSSTYLES_VERSION   0x0003
 

Functions

HRESULT MSSTYLES_OpenThemeFile (LPCWSTR lpThemeFile, LPCWSTR pszColorName, LPCWSTR pszSizeName, PTHEME_FILE *tf)
 
void MSSTYLES_CloseThemeFile (PTHEME_FILE tf)
 
HRESULT MSSTYLES_ReferenceTheme (PTHEME_FILE tf)
 
PUXINI_FILE MSSTYLES_GetThemeIni (PTHEME_FILE tf)
 
static PUXINI_FILE MSSTYLES_GetActiveThemeIni (PTHEME_FILE tf)
 
static BOOL MSSTYLES_ParseIniSectionName (LPCWSTR lpSection, DWORD dwLen, LPWSTR szAppName, LPWSTR szClassName, int *iPartId, int *iStateId)
 
static PTHEME_CLASS MSSTYLES_FindClass (PTHEME_FILE tf, LPCWSTR pszAppName, LPCWSTR pszClassName)
 
static PTHEME_CLASS MSSTYLES_AddClass (PTHEME_FILE tf, LPCWSTR pszAppName, LPCWSTR pszClassName)
 
PTHEME_PARTSTATE MSSTYLES_FindPartState (PTHEME_CLASS tc, int iPartId, int iStateId, PTHEME_CLASS *tcNext)
 
static PTHEME_PARTSTATE MSSTYLES_AddPartState (PTHEME_CLASS tc, int iPartId, int iStateId)
 
static PTHEME_PROPERTY MSSTYLES_LFindProperty (PTHEME_PROPERTY tp, int iPropertyPrimitive, int iPropertyId)
 
static PTHEME_PROPERTY MSSTYLES_PSFindProperty (PTHEME_PARTSTATE ps, int iPropertyPrimitive, int iPropertyId)
 
PTHEME_PROPERTY MSSTYLES_FindMetric (PTHEME_FILE tf, int iPropertyPrimitive, int iPropertyId)
 
static PTHEME_PROPERTY MSSTYLES_AddProperty (PTHEME_PARTSTATE ps, int iPropertyPrimitive, int iPropertyId, LPCWSTR lpValue, DWORD dwValueLen, BOOL isGlobal)
 
static PTHEME_PROPERTY MSSTYLES_AddMetric (PTHEME_FILE tf, int iPropertyPrimitive, int iPropertyId, LPCWSTR lpValue, DWORD dwValueLen)
 
void MSSTYLES_ParseThemeIni (PTHEME_FILE tf)
 
PTHEME_CLASS MSSTYLES_OpenThemeClass (PTHEME_FILE tf, LPCWSTR pszAppName, LPCWSTR pszClassList)
 
HRESULT MSSTYLES_CloseThemeClass (PTHEME_CLASS tc)
 
PTHEME_PROPERTY MSSTYLES_FindProperty (PTHEME_CLASS tc, int iPartId, int iStateId, int iPropertyPrimitive, int iPropertyId)
 
static BOOL prepare_alpha (HBITMAP bmp, BOOL *hasAlpha)
 
HBITMAP MSSTYLES_LoadBitmap (PTHEME_CLASS tc, LPCWSTR lpFilename, BOOL *hasAlpha)
 
static BOOL MSSTYLES_GetNextInteger (LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, int *value)
 
static BOOL MSSTYLES_GetNextToken (LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, LPWSTR lpBuff, DWORD buffSize)
 
HRESULT MSSTYLES_GetPropertyBool (PTHEME_PROPERTY tp, BOOL *pfVal)
 
HRESULT MSSTYLES_GetPropertyColor (PTHEME_PROPERTY tp, COLORREF *pColor)
 
static HRESULT MSSTYLES_GetFont (LPCWSTR lpCur, LPCWSTR lpEnd, LPCWSTR *lpValEnd, LOGFONTW *pFont)
 
HRESULT MSSTYLES_GetPropertyFont (PTHEME_PROPERTY tp, HDC hdc, LOGFONTW *pFont)
 
HRESULT MSSTYLES_GetPropertyInt (PTHEME_PROPERTY tp, int *piVal)
 
HRESULT MSSTYLES_GetPropertyIntList (PTHEME_PROPERTY tp, INTLIST *pIntList)
 
HRESULT MSSTYLES_GetPropertyPosition (PTHEME_PROPERTY tp, POINT *pPoint)
 
HRESULT MSSTYLES_GetPropertyString (PTHEME_PROPERTY tp, LPWSTR pszBuff, int cchMaxBuffChars)
 
HRESULT MSSTYLES_GetPropertyRect (PTHEME_PROPERTY tp, RECT *pRect)
 
HRESULT MSSTYLES_GetPropertyMargins (PTHEME_PROPERTY tp, RECT *prc, MARGINS *pMargins)
 

Variables

int alphaBlendMode
 
static const WCHAR szThemesIniResource []
 

Macro Definition Documentation

◆ MSSTYLES_VERSION

#define MSSTYLES_VERSION   0x0003

Definition at line 31 of file msstyles.c.

Function Documentation

◆ MSSTYLES_AddClass()

static PTHEME_CLASS MSSTYLES_AddClass ( PTHEME_FILE  tf,
LPCWSTR  pszAppName,
LPCWSTR  pszClassName 
)
static

Definition at line 422 of file msstyles.c.

423 {
424  PTHEME_CLASS cur = MSSTYLES_FindClass(tf, pszAppName, pszClassName);
425  if(cur) return cur;
426 
427  cur = HeapAlloc(GetProcessHeap(), 0, sizeof(THEME_CLASS));
428  cur->hTheme = tf->hTheme;
429  lstrcpyW(cur->szAppName, pszAppName);
430  lstrcpyW(cur->szClassName, pszClassName);
431  cur->next = tf->classes;
432  cur->partstate = NULL;
433  cur->overrides = NULL;
434  tf->classes = cur;
435  return cur;
436 }
WCHAR szAppName[MAX_THEME_APP_NAME]
Definition: uxthemep.h:60
PTHEME_PARTSTATE partstate
Definition: uxthemep.h:62
struct _THEME_CLASS * overrides
Definition: uxthemep.h:63
HFONT tf
Definition: icontest.c:17
smooth NULL
Definition: ftsmooth.c:416
static PTHEME_CLASS MSSTYLES_FindClass(PTHEME_FILE tf, LPCWSTR pszAppName, LPCWSTR pszClassName)
Definition: msstyles.c:392
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
struct _THEME_CLASS * next
Definition: uxthemep.h:65
WCHAR szClassName[MAX_THEME_CLASS_NAME]
Definition: uxthemep.h:61
#define lstrcpyW
Definition: compat.h:406
HMODULE hTheme
Definition: uxthemep.h:58

Referenced by MSSTYLES_ParseThemeIni().

◆ MSSTYLES_AddMetric()

static PTHEME_PROPERTY MSSTYLES_AddMetric ( PTHEME_FILE  tf,
int  iPropertyPrimitive,
int  iPropertyId,
LPCWSTR  lpValue,
DWORD  dwValueLen 
)
static

Definition at line 617 of file msstyles.c.

618 {
619  PTHEME_PROPERTY cur = MSSTYLES_FindMetric(tf, iPropertyPrimitive, iPropertyId);
620  /* Should duplicate properties overwrite the original, or be ignored? */
621  if(cur) return cur;
622 
623  cur = HeapAlloc(GetProcessHeap(), 0, sizeof(THEME_PROPERTY));
624  cur->iPrimitiveType = iPropertyPrimitive;
625  cur->iPropertyId = iPropertyId;
626  cur->lpValue = lpValue;
627  cur->dwValueLen = dwValueLen;
628 
629  cur->origin = PO_GLOBAL;
630 
631  cur->next = tf->metrics;
632  tf->metrics = cur;
633  return cur;
634 }
PTHEME_PROPERTY MSSTYLES_FindMetric(PTHEME_FILE tf, int iPropertyPrimitive, int iPropertyId)
Definition: msstyles.c:556
PROPERTYORIGIN origin
Definition: uxthemep.h:39
HFONT tf
Definition: icontest.c:17
struct _THEME_PROPERTY * next
Definition: uxthemep.h:44
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LPCWSTR lpValue
Definition: uxthemep.h:41
int iPrimitiveType
Definition: uxthemep.h:37
DWORD dwValueLen
Definition: uxthemep.h:42

Referenced by MSSTYLES_ParseThemeIni().

◆ MSSTYLES_AddPartState()

static PTHEME_PARTSTATE MSSTYLES_AddPartState ( PTHEME_CLASS  tc,
int  iPartId,
int  iStateId 
)
static

Definition at line 479 of file msstyles.c.

480 {
481  PTHEME_PARTSTATE cur = MSSTYLES_FindPartState(tc, iPartId, iStateId, NULL);
482  if(cur) return cur;
483 
484  cur = HeapAlloc(GetProcessHeap(), 0, sizeof(THEME_PARTSTATE));
485  cur->iPartId = iPartId;
486  cur->iStateId = iStateId;
487  cur->properties = NULL;
488  cur->next = tc->partstate;
489  tc->partstate = cur;
490  return cur;
491 }
PTHEME_PROPERTY properties
Definition: uxthemep.h:50
struct _THEME_PARTSTATE * next
Definition: uxthemep.h:52
const GLfloat * tc
Definition: glext.h:8925
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
PTHEME_PARTSTATE MSSTYLES_FindPartState(PTHEME_CLASS tc, int iPartId, int iStateId, PTHEME_CLASS *tcNext)
Definition: msstyles.c:452

Referenced by MSSTYLES_ParseThemeIni().

◆ MSSTYLES_AddProperty()

static PTHEME_PROPERTY MSSTYLES_AddProperty ( PTHEME_PARTSTATE  ps,
int  iPropertyPrimitive,
int  iPropertyId,
LPCWSTR  lpValue,
DWORD  dwValueLen,
BOOL  isGlobal 
)
static

Definition at line 576 of file msstyles.c.

577 {
578  PTHEME_PROPERTY cur = MSSTYLES_PSFindProperty(ps, iPropertyPrimitive, iPropertyId);
579  /* Should duplicate properties overwrite the original, or be ignored? */
580  if(cur) return cur;
581 
582  cur = HeapAlloc(GetProcessHeap(), 0, sizeof(THEME_PROPERTY));
583  cur->iPrimitiveType = iPropertyPrimitive;
584  cur->iPropertyId = iPropertyId;
585  cur->lpValue = lpValue;
586  cur->dwValueLen = dwValueLen;
587 
588  if(ps->iStateId)
589  cur->origin = PO_STATE;
590  else if(ps->iPartId)
591  cur->origin = PO_PART;
592  else if(isGlobal)
593  cur->origin = PO_GLOBAL;
594  else
595  cur->origin = PO_CLASS;
596 
597  cur->next = ps->properties;
598  ps->properties = cur;
599  return cur;
600 }
PROPERTYORIGIN origin
Definition: uxthemep.h:39
PTHEME_PROPERTY properties
Definition: uxthemep.h:50
struct _THEME_PROPERTY * next
Definition: uxthemep.h:44
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LPCWSTR lpValue
Definition: uxthemep.h:41
int iPrimitiveType
Definition: uxthemep.h:37
static PTHEME_PROPERTY MSSTYLES_PSFindProperty(PTHEME_PARTSTATE ps, int iPropertyPrimitive, int iPropertyId)
Definition: msstyles.c:538
DWORD dwValueLen
Definition: uxthemep.h:42

Referenced by MSSTYLES_ParseThemeIni().

◆ MSSTYLES_CloseThemeClass()

HRESULT MSSTYLES_CloseThemeClass ( PTHEME_CLASS  tc)

Definition at line 822 of file msstyles.c.

823 {
825  return S_OK;
826 }
const GLfloat * tc
Definition: glext.h:8925
#define S_OK
Definition: intsafe.h:59
void MSSTYLES_CloseThemeFile(PTHEME_FILE tf)
Definition: msstyles.c:179

Referenced by CloseThemeData(), and OpenThemeDataInternal().

◆ MSSTYLES_CloseThemeFile()

void MSSTYLES_CloseThemeFile ( PTHEME_FILE  tf)

Definition at line 179 of file msstyles.c.

180 {
181  if(tf) {
182 
183  tf->dwRefCount--;
184  TRACE("Theme %p refcount: %d\n", tf, tf->dwRefCount);
185 
186  if(!tf->dwRefCount) {
187  if(tf->hTheme) FreeLibrary(tf->hTheme);
188  if(tf->classes) {
189  while(tf->classes) {
190  PTHEME_CLASS pcls = tf->classes;
191  tf->classes = pcls->next;
192  while(pcls->partstate) {
193  PTHEME_PARTSTATE ps = pcls->partstate;
194 
195  while(ps->properties) {
196  PTHEME_PROPERTY prop = ps->properties;
197  ps->properties = prop->next;
198  HeapFree(GetProcessHeap(), 0, prop);
199  }
200 
201  pcls->partstate = ps->next;
202  HeapFree(GetProcessHeap(), 0, ps);
203  }
204  HeapFree(GetProcessHeap(), 0, pcls);
205  }
206  }
207  while (tf->images)
208  {
209  PTHEME_IMAGE img = tf->images;
210  tf->images = img->next;
211  DeleteObject (img->image);
212  HeapFree (GetProcessHeap(), 0, img);
213  }
214  HeapFree(GetProcessHeap(), 0, tf);
215  }
216  }
217 }
PTHEME_PARTSTATE partstate
Definition: uxthemep.h:62
PTHEME_PROPERTY properties
Definition: uxthemep.h:50
HFONT tf
Definition: icontest.c:17
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
struct _THEME_PARTSTATE * next
Definition: uxthemep.h:52
struct _THEME_PROPERTY * next
Definition: uxthemep.h:44
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:405
#define GetProcessHeap()
Definition: compat.h:395
GLint GLvoid * img
Definition: gl.h:1956
struct _THEME_CLASS * next
Definition: uxthemep.h:65
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by CheckThemeSignature(), CloseThemeFile(), EnumThemeColors(), EnumThemeSizes(), GetThemeDefaults(), GetThemeDocumentationProperty(), MSSTYLES_CloseThemeClass(), UXTHEME_LoadTheme(), and UXTHEME_SetActiveTheme().

◆ MSSTYLES_FindClass()

static PTHEME_CLASS MSSTYLES_FindClass ( PTHEME_FILE  tf,
LPCWSTR  pszAppName,
LPCWSTR  pszClassName 
)
static

Definition at line 392 of file msstyles.c.

393 {
394  PTHEME_CLASS cur = tf->classes;
395  while(cur) {
396  if(!pszAppName) {
397  if(!*cur->szAppName && !lstrcmpiW(pszClassName, cur->szClassName))
398  return cur;
399  }
400  else {
401  if(!lstrcmpiW(pszAppName, cur->szAppName) && !lstrcmpiW(pszClassName, cur->szClassName))
402  return cur;
403  }
404  cur = cur->next;
405  }
406  return NULL;
407 }
WCHAR szAppName[MAX_THEME_APP_NAME]
Definition: uxthemep.h:60
HFONT tf
Definition: icontest.c:17
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
smooth NULL
Definition: ftsmooth.c:416
struct _THEME_CLASS * next
Definition: uxthemep.h:65
WCHAR szClassName[MAX_THEME_CLASS_NAME]
Definition: uxthemep.h:61

Referenced by MSSTYLES_AddClass(), MSSTYLES_OpenThemeClass(), and MSSTYLES_ParseThemeIni().

◆ MSSTYLES_FindMetric()

PTHEME_PROPERTY MSSTYLES_FindMetric ( PTHEME_FILE  tf,
int  iPropertyPrimitive,
int  iPropertyId 
)

Definition at line 556 of file msstyles.c.

557 {
558  return MSSTYLES_LFindProperty(tf->metrics, iPropertyPrimitive, iPropertyId);
559 }
HFONT tf
Definition: icontest.c:17
static PTHEME_PROPERTY MSSTYLES_LFindProperty(PTHEME_PROPERTY tp, int iPropertyPrimitive, int iPropertyId)
Definition: msstyles.c:506

Referenced by GetThemeSysBool(), GetThemeSysColor(), GetThemeSysFont(), GetThemeSysInt(), GetThemeSysSize(), GetThemeSysString(), and MSSTYLES_AddMetric().

◆ MSSTYLES_FindPartState()

PTHEME_PARTSTATE MSSTYLES_FindPartState ( PTHEME_CLASS  tc,
int  iPartId,
int  iStateId,
PTHEME_CLASS tcNext 
)

Definition at line 452 of file msstyles.c.

453 {
454  PTHEME_PARTSTATE cur = tc->partstate;
455  while(cur) {
456  if(cur->iPartId == iPartId && cur->iStateId == iStateId) {
457  if(tcNext) *tcNext = tc->overrides;
458  return cur;
459  }
460  cur = cur->next;
461  }
462  if(tc->overrides) return MSSTYLES_FindPartState(tc->overrides, iPartId, iStateId, tcNext);
463  return NULL;
464 }
struct _THEME_CLASS * overrides
Definition: uxthemep.h:63
struct _THEME_PARTSTATE * next
Definition: uxthemep.h:52
const GLfloat * tc
Definition: glext.h:8925
smooth NULL
Definition: ftsmooth.c:416
PTHEME_PARTSTATE MSSTYLES_FindPartState(PTHEME_CLASS tc, int iPartId, int iStateId, PTHEME_CLASS *tcNext)
Definition: msstyles.c:452

Referenced by IsThemePartDefined(), MSSTYLES_AddPartState(), MSSTYLES_FindPartState(), and MSSTYLES_FindProperty().

◆ MSSTYLES_FindProperty()

PTHEME_PROPERTY MSSTYLES_FindProperty ( PTHEME_CLASS  tc,
int  iPartId,
int  iStateId,
int  iPropertyPrimitive,
int  iPropertyId 
)

Definition at line 835 of file msstyles.c.

836 {
837  PTHEME_CLASS next = tc;
838  PTHEME_PARTSTATE ps;
840 
841  TRACE("(%p, %d, %d, %d)\n", tc, iPartId, iStateId, iPropertyId);
842  /* Try and find an exact match on part & state */
843  while(next && (ps = MSSTYLES_FindPartState(next, iPartId, iStateId, &next))) {
844  if((tp = MSSTYLES_PSFindProperty(ps, iPropertyPrimitive, iPropertyId))) {
845  return tp;
846  }
847  }
848  /* If that fails, and we didn't already try it, search for just part */
849  if(iStateId != 0)
850  iStateId = 0;
851  /* As a last ditch attempt..go for just class */
852  else if(iPartId != 0)
853  iPartId = 0;
854  else
855  return NULL;
856 
857  if((tp = MSSTYLES_FindProperty(tc, iPartId, iStateId, iPropertyPrimitive, iPropertyId)))
858  return tp;
859  return NULL;
860 }
PTHEME_PROPERTY MSSTYLES_FindProperty(PTHEME_CLASS tc, int iPartId, int iStateId, int iPropertyPrimitive, int iPropertyId)
Definition: msstyles.c:835
const GLfloat * tc
Definition: glext.h:8925
smooth NULL
Definition: ftsmooth.c:416
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2883
#define TRACE(s)
Definition: solgame.cpp:4
PTHEME_PARTSTATE MSSTYLES_FindPartState(PTHEME_CLASS tc, int iPartId, int iStateId, PTHEME_CLASS *tcNext)
Definition: msstyles.c:452
static unsigned __int64 next
Definition: rand_nt.c:6
static PTHEME_PROPERTY MSSTYLES_PSFindProperty(PTHEME_PARTSTATE ps, int iPropertyPrimitive, int iPropertyId)
Definition: msstyles.c:538

Referenced by GetThemeBool(), GetThemeColor(), GetThemeEnumValue(), GetThemeFilename(), GetThemeFont(), GetThemeInt(), GetThemeIntList(), GetThemeMargins(), GetThemeMetric(), GetThemePosition(), GetThemePropertyOrigin(), GetThemeRect(), GetThemeString(), MSSTYLES_FindProperty(), and UXTHEME_SelectImage().

◆ MSSTYLES_GetActiveThemeIni()

static PUXINI_FILE MSSTYLES_GetActiveThemeIni ( PTHEME_FILE  tf)
static

Definition at line 246 of file msstyles.c.

247 {
248  static const WCHAR szFileResNamesResource[] = {
249  'F','I','L','E','R','E','S','N','A','M','E','S','\0'
250  };
251  DWORD dwColorCount = 0;
252  DWORD dwSizeCount = 0;
253  DWORD dwColorNum = 0;
254  DWORD dwSizeNum = 0;
255  DWORD i;
256  DWORD dwResourceIndex;
257  LPWSTR tmp;
258  HRSRC hrsc;
259 
260  /* Count the number of available colors & styles, and determine the index number
261  of the color/style we are interested in
262  */
263  tmp = tf->pszAvailColors;
264  while(*tmp) {
265  if(!lstrcmpiW(tf->pszSelectedColor, tmp))
266  dwColorNum = dwColorCount;
267  tmp += lstrlenW(tmp)+1;
268  dwColorCount++;
269  }
270  tmp = tf->pszAvailSizes;
271  while(*tmp) {
272  if(!lstrcmpiW(tf->pszSelectedSize, tmp))
273  dwSizeNum = dwSizeCount;
274  tmp += lstrlenW(tmp)+1;
275  dwSizeCount++;
276  }
277 
278  if(!(hrsc = FindResourceW(tf->hTheme, MAKEINTRESOURCEW(1), szFileResNamesResource))) {
279  TRACE("FILERESNAMES map not found\n");
280  return NULL;
281  }
282  tmp = LoadResource(tf->hTheme, hrsc);
283  dwResourceIndex = (dwSizeCount * dwColorNum) + dwSizeNum;
284  for(i=0; i < dwResourceIndex; i++) {
285  tmp += lstrlenW(tmp)+1;
286  }
287  return UXINI_LoadINI(tf->hTheme, tmp);
288 }
HFONT tf
Definition: icontest.c:17
#define lstrlenW
Definition: compat.h:407
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
PUXINI_FILE UXINI_LoadINI(HMODULE hTheme, LPCWSTR lpName)
Definition: uxini.c:52
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by MSSTYLES_ParseThemeIni().

◆ MSSTYLES_GetFont()

static HRESULT MSSTYLES_GetFont ( LPCWSTR  lpCur,
LPCWSTR  lpEnd,
LPCWSTR lpValEnd,
LOGFONTW pFont 
)
static

Definition at line 1026 of file msstyles.c.

1028 {
1029  static const WCHAR szBold[] = {'b','o','l','d','\0'};
1030  static const WCHAR szItalic[] = {'i','t','a','l','i','c','\0'};
1031  static const WCHAR szUnderline[] = {'u','n','d','e','r','l','i','n','e','\0'};
1032  static const WCHAR szStrikeOut[] = {'s','t','r','i','k','e','o','u','t','\0'};
1033  int pointSize;
1034  WCHAR attr[32];
1035 
1036  if(!MSSTYLES_GetNextToken(lpCur, lpEnd, &lpCur, pFont->lfFaceName, LF_FACESIZE)) {
1037  TRACE("Property is there, but failed to get face name\n");
1038  *lpValEnd = lpCur;
1039  return E_PROP_ID_UNSUPPORTED;
1040  }
1041  if(!MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &pointSize)) {
1042  TRACE("Property is there, but failed to get point size\n");
1043  *lpValEnd = lpCur;
1044  return E_PROP_ID_UNSUPPORTED;
1045  }
1046  if(pointSize > 0)
1047  {
1048  HDC hdc = GetDC(0);
1049  pointSize = -MulDiv(pointSize, GetDeviceCaps(hdc, LOGPIXELSY), 72);
1050  ReleaseDC(0, hdc);
1051  }
1052 
1053  pFont->lfHeight = pointSize;
1054  pFont->lfWeight = FW_REGULAR;
1055  pFont->lfCharSet = DEFAULT_CHARSET;
1056  while(MSSTYLES_GetNextToken(lpCur, lpEnd, &lpCur, attr, sizeof(attr)/sizeof(attr[0]))) {
1057  if(!lstrcmpiW(szBold, attr)) pFont->lfWeight = FW_BOLD;
1058  else if(!lstrcmpiW(szItalic, attr)) pFont->lfItalic = TRUE;
1059  else if(!lstrcmpiW(szUnderline, attr)) pFont->lfUnderline = TRUE;
1060  else if(!lstrcmpiW(szStrikeOut, attr)) pFont->lfStrikeOut = TRUE;
1061  }
1062  *lpValEnd = lpCur;
1063  return S_OK;
1064 }
static BOOL MSSTYLES_GetNextToken(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, LPWSTR lpBuff, DWORD buffSize)
Definition: msstyles.c:958
#define TRUE
Definition: types.h:120
#define LF_FACESIZE
Definition: dimm.idl:39
HDC WINAPI GetDC(_In_opt_ HWND)
LONG lfHeight
Definition: dimm.idl:59
BYTE lfCharSet
Definition: dimm.idl:67
static HDC
Definition: imagelist.c:92
#define DEFAULT_CHARSET
Definition: wingdi.h:383
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
#define FW_REGULAR
Definition: wingdi.h:373
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define TRACE(s)
Definition: solgame.cpp:4
#define E_PROP_ID_UNSUPPORTED
Definition: vfwmsgs.h:173
__wchar_t WCHAR
Definition: xmlstorage.h:180
Definition: cookie.c:170
HDC hdc
Definition: main.c:9
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define S_OK
Definition: intsafe.h:59
#define FW_BOLD
Definition: wingdi.h:377
BYTE lfStrikeOut
Definition: dimm.idl:66
BYTE lfItalic
Definition: dimm.idl:64
static BOOL MSSTYLES_GetNextInteger(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, int *value)
Definition: msstyles.c:934
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
#define LOGPIXELSY
Definition: wingdi.h:718
LONG lfWeight
Definition: dimm.idl:63
BYTE lfUnderline
Definition: dimm.idl:65
#define MulDiv(x, y, z)
Definition: gdifloat.h:86

Referenced by MSSTYLES_GetPropertyFont().

◆ MSSTYLES_GetNextInteger()

static BOOL MSSTYLES_GetNextInteger ( LPCWSTR  lpStringStart,
LPCWSTR  lpStringEnd,
LPCWSTR lpValEnd,
int value 
)
static

Definition at line 934 of file msstyles.c.

935 {
936  LPCWSTR cur = lpStringStart;
937  int total = 0;
938  BOOL gotNeg = FALSE;
939 
940  while(cur < lpStringEnd && ((*cur < '0' || *cur > '9') && *cur != '-')) cur++;
941  if(cur >= lpStringEnd) {
942  return FALSE;
943  }
944  if(*cur == '-') {
945  cur++;
946  gotNeg = TRUE;
947  }
948  while(cur < lpStringEnd && (*cur >= '0' && *cur <= '9')) {
949  total = total * 10 + (*cur - '0');
950  cur++;
951  }
952  if(gotNeg) total = -total;
953  *value = total;
954  if(lpValEnd) *lpValEnd = cur;
955  return TRUE;
956 }
#define TRUE
Definition: types.h:120
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned int BOOL
Definition: ntddk_ex.h:94

Referenced by MSSTYLES_GetFont(), MSSTYLES_GetPropertyColor(), MSSTYLES_GetPropertyInt(), MSSTYLES_GetPropertyIntList(), MSSTYLES_GetPropertyMargins(), MSSTYLES_GetPropertyPosition(), and MSSTYLES_GetPropertyRect().

◆ MSSTYLES_GetNextToken()

static BOOL MSSTYLES_GetNextToken ( LPCWSTR  lpStringStart,
LPCWSTR  lpStringEnd,
LPCWSTR lpValEnd,
LPWSTR  lpBuff,
DWORD  buffSize 
)
static

Definition at line 958 of file msstyles.c.

958  {
959  LPCWSTR cur = lpStringStart;
960  LPCWSTR start;
961  LPCWSTR end;
962 
963  while(cur < lpStringEnd && (isspace(*cur) || *cur == ',')) cur++;
964  if(cur >= lpStringEnd) {
965  return FALSE;
966  }
967  start = cur;
968  while(cur < lpStringEnd && *cur != '\n'&& *cur != ',') cur++;
969  end = cur;
970  while(isspace(*(end-1))) end--;
971 
972  lstrcpynW(lpBuff, start, min(buffSize, end-start+1));
973 
974  if(lpValEnd) *lpValEnd = cur;
975  return TRUE;
976 }
#define isspace(c)
Definition: acclib.h:69
#define TRUE
Definition: types.h:120
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
GLuint GLuint end
Definition: gl.h:1545
#define lstrcpynW
Definition: compat.h:397
GLuint start
Definition: gl.h:1545
#define min(a, b)
Definition: monoChain.cc:55

Referenced by MSSTYLES_GetFont().

◆ MSSTYLES_GetPropertyBool()

HRESULT MSSTYLES_GetPropertyBool ( PTHEME_PROPERTY  tp,
BOOL pfVal 
)

Definition at line 983 of file msstyles.c.

984 {
985  *pfVal = FALSE;
986  if(*tp->lpValue == 't' || *tp->lpValue == 'T')
987  *pfVal = TRUE;
988  return S_OK;
989 }
#define TRUE
Definition: types.h:120
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2883
#define S_OK
Definition: intsafe.h:59

Referenced by GetThemeBool(), GetThemeMetric(), and GetThemeSysBool().

◆ MSSTYLES_GetPropertyColor()

HRESULT MSSTYLES_GetPropertyColor ( PTHEME_PROPERTY  tp,
COLORREF pColor 
)

Definition at line 996 of file msstyles.c.

997 {
998  LPCWSTR lpEnd;
999  LPCWSTR lpCur;
1000  int red, green, blue;
1001 
1002  lpCur = tp->lpValue;
1003  lpEnd = tp->lpValue + tp->dwValueLen;
1004 
1005  if(!MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &red)) {
1006  TRACE("Could not parse color property\n");
1007  return E_PROP_ID_UNSUPPORTED;
1008  }
1009  if(!MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &green)) {
1010  TRACE("Could not parse color property\n");
1011  return E_PROP_ID_UNSUPPORTED;
1012  }
1013  if(!MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &blue)) {
1014  TRACE("Could not parse color property\n");
1015  return E_PROP_ID_UNSUPPORTED;
1016  }
1017  *pColor = RGB(red,green,blue);
1018  return S_OK;
1019 }
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
GLclampf GLclampf blue
Definition: gl.h:1740
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2883
#define TRACE(s)
Definition: solgame.cpp:4
#define E_PROP_ID_UNSUPPORTED
Definition: vfwmsgs.h:173
#define RGB(r, g, b)
Definition: wingdi.h:2935
GLclampf green
Definition: gl.h:1740
#define red
Definition: linetest.c:67
#define S_OK
Definition: intsafe.h:59
static BOOL MSSTYLES_GetNextInteger(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, int *value)
Definition: msstyles.c:934

Referenced by GetThemeColor(), GetThemeMetric(), and GetThemeSysColor().

◆ MSSTYLES_GetPropertyFont()

HRESULT MSSTYLES_GetPropertyFont ( PTHEME_PROPERTY  tp,
HDC  hdc,
LOGFONTW pFont 
)

Definition at line 1066 of file msstyles.c.

1067 {
1068  LPCWSTR lpCur = tp->lpValue;
1069  LPCWSTR lpEnd = tp->lpValue + tp->dwValueLen;
1070  HRESULT hr;
1071 
1072  ZeroMemory(pFont, sizeof(LOGFONTW));
1073  hr = MSSTYLES_GetFont (lpCur, lpEnd, &lpCur, pFont);
1074 
1075  return hr;
1076 }
HRESULT hr
Definition: shlfolder.c:183
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define ZeroMemory
Definition: winbase.h:1635
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2883
LONG HRESULT
Definition: typedefs.h:77
static HRESULT MSSTYLES_GetFont(LPCWSTR lpCur, LPCWSTR lpEnd, LPCWSTR *lpValEnd, LOGFONTW *pFont)
Definition: msstyles.c:1026

Referenced by GetThemeFont(), and GetThemeSysFont().

◆ MSSTYLES_GetPropertyInt()

HRESULT MSSTYLES_GetPropertyInt ( PTHEME_PROPERTY  tp,
int piVal 
)

Definition at line 1083 of file msstyles.c.

1084 {
1085  if(!MSSTYLES_GetNextInteger(tp->lpValue, (tp->lpValue + tp->dwValueLen), NULL, piVal)) {
1086  TRACE("Could not parse int property\n");
1087  return E_PROP_ID_UNSUPPORTED;
1088  }
1089  return S_OK;
1090 }
smooth NULL
Definition: ftsmooth.c:416
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2883
#define TRACE(s)
Definition: solgame.cpp:4
#define E_PROP_ID_UNSUPPORTED
Definition: vfwmsgs.h:173
#define S_OK
Definition: intsafe.h:59
static BOOL MSSTYLES_GetNextInteger(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, int *value)
Definition: msstyles.c:934

Referenced by GetThemeInt(), GetThemeMetric(), GetThemeSysInt(), and GetThemeSysSize().

◆ MSSTYLES_GetPropertyIntList()

HRESULT MSSTYLES_GetPropertyIntList ( PTHEME_PROPERTY  tp,
INTLIST *  pIntList 
)

Definition at line 1097 of file msstyles.c.

1098 {
1099  int i;
1100  LPCWSTR lpCur = tp->lpValue;
1101  LPCWSTR lpEnd = tp->lpValue + tp->dwValueLen;
1102 
1103  for(i=0; i < MAX_INTLIST_COUNT; i++) {
1104  if(!MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &pIntList->iValues[i]))
1105  break;
1106  }
1107  pIntList->iValueCount = i;
1108  return S_OK;
1109 }
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2883
#define S_OK
Definition: intsafe.h:59
static BOOL MSSTYLES_GetNextInteger(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, int *value)
Definition: msstyles.c:934

Referenced by GetThemeIntList().

◆ MSSTYLES_GetPropertyMargins()

HRESULT MSSTYLES_GetPropertyMargins ( PTHEME_PROPERTY  tp,
RECT prc,
MARGINS pMargins 
)

Definition at line 1171 of file msstyles.c.

1172 {
1173  LPCWSTR lpCur = tp->lpValue;
1174  LPCWSTR lpEnd = tp->lpValue + tp->dwValueLen;
1175 
1176  MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &pMargins->cxLeftWidth);
1177  MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &pMargins->cxRightWidth);
1178  MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &pMargins->cyTopHeight);
1179  if(!MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &pMargins->cyBottomHeight)) {
1180  TRACE("Could not parse margins property\n");
1181  return E_PROP_ID_UNSUPPORTED;
1182  }
1183  return S_OK;
1184 }
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
int cyBottomHeight
Definition: misc.c:283
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2883
#define TRACE(s)
Definition: solgame.cpp:4
#define E_PROP_ID_UNSUPPORTED
Definition: vfwmsgs.h:173
int cyTopHeight
Definition: misc.c:282
int cxLeftWidth
Definition: misc.c:280
#define S_OK
Definition: intsafe.h:59
static BOOL MSSTYLES_GetNextInteger(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, int *value)
Definition: msstyles.c:934
int cxRightWidth
Definition: misc.c:281

Referenced by GetThemeMargins().

◆ MSSTYLES_GetPropertyPosition()

HRESULT MSSTYLES_GetPropertyPosition ( PTHEME_PROPERTY  tp,
POINT pPoint 
)

Definition at line 1116 of file msstyles.c.

1117 {
1118  int x,y;
1119  LPCWSTR lpCur = tp->lpValue;
1120  LPCWSTR lpEnd = tp->lpValue + tp->dwValueLen;
1121 
1122  if(!MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &x)) {
1123  TRACE("Could not parse position property\n");
1124  return E_PROP_ID_UNSUPPORTED;
1125  }
1126  if(!MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &y)) {
1127  TRACE("Could not parse position property\n");
1128  return E_PROP_ID_UNSUPPORTED;
1129  }
1130  pPoint->x = x;
1131  pPoint->y = y;
1132  return S_OK;
1133 }
long y
Definition: polytest.cpp:48
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
long x
Definition: polytest.cpp:48
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2883
#define TRACE(s)
Definition: solgame.cpp:4
#define E_PROP_ID_UNSUPPORTED
Definition: vfwmsgs.h:173
#define S_OK
Definition: intsafe.h:59
static BOOL MSSTYLES_GetNextInteger(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, int *value)
Definition: msstyles.c:934
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

Referenced by GetThemePosition().

◆ MSSTYLES_GetPropertyRect()

HRESULT MSSTYLES_GetPropertyRect ( PTHEME_PROPERTY  tp,
RECT pRect 
)

Definition at line 1151 of file msstyles.c.

1152 {
1153  LPCWSTR lpCur = tp->lpValue;
1154  LPCWSTR lpEnd = tp->lpValue + tp->dwValueLen;
1155 
1156  MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &pRect->left);
1157  MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &pRect->top);
1158  MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &pRect->right);
1159  if(!MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &pRect->bottom)) {
1160  TRACE("Could not parse rect property\n");
1161  return E_PROP_ID_UNSUPPORTED;
1162  }
1163  return S_OK;
1164 }
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2883
#define TRACE(s)
Definition: solgame.cpp:4
#define E_PROP_ID_UNSUPPORTED
Definition: vfwmsgs.h:173
#define S_OK
Definition: intsafe.h:59
static BOOL MSSTYLES_GetNextInteger(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, int *value)
Definition: msstyles.c:934
LONG bottom
Definition: windef.h:294

Referenced by GetThemeRect().

◆ MSSTYLES_GetPropertyString()

HRESULT MSSTYLES_GetPropertyString ( PTHEME_PROPERTY  tp,
LPWSTR  pszBuff,
int  cchMaxBuffChars 
)

Definition at line 1140 of file msstyles.c.

1141 {
1142  lstrcpynW(pszBuff, tp->lpValue, min(tp->dwValueLen+1, cchMaxBuffChars));
1143  return S_OK;
1144 }
#define lstrcpynW
Definition: compat.h:397
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2883
#define S_OK
Definition: intsafe.h:59
#define min(a, b)
Definition: monoChain.cc:55

Referenced by GetThemeEnumValue(), GetThemeFilename(), GetThemeMetric(), GetThemeString(), and GetThemeSysString().

◆ MSSTYLES_GetThemeIni()

PUXINI_FILE MSSTYLES_GetThemeIni ( PTHEME_FILE  tf)

Definition at line 236 of file msstyles.c.

237 {
238  return UXINI_LoadINI(tf->hTheme, szThemesIniResource);
239 }
HFONT tf
Definition: icontest.c:17
static const WCHAR szThemesIniResource[]
Definition: msstyles.c:33
PUXINI_FILE UXINI_LoadINI(HMODULE hTheme, LPCWSTR lpName)
Definition: uxini.c:52

Referenced by GetThemeDocumentationProperty().

◆ MSSTYLES_LFindProperty()

static PTHEME_PROPERTY MSSTYLES_LFindProperty ( PTHEME_PROPERTY  tp,
int  iPropertyPrimitive,
int  iPropertyId 
)
static

Definition at line 506 of file msstyles.c.

507 {
508  PTHEME_PROPERTY cur = tp;
509  while(cur) {
510  if(cur->iPropertyId == iPropertyId) {
511  if(cur->iPrimitiveType == iPropertyPrimitive) {
512  return cur;
513  }
514  else {
515  if(!iPropertyPrimitive)
516  return cur;
517  return NULL;
518  }
519  }
520  cur = cur->next;
521  }
522  return NULL;
523 }
struct _THEME_PROPERTY * next
Definition: uxthemep.h:44
smooth NULL
Definition: ftsmooth.c:416
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2883
int iPrimitiveType
Definition: uxthemep.h:37

Referenced by MSSTYLES_FindMetric(), and MSSTYLES_PSFindProperty().

◆ MSSTYLES_LoadBitmap()

HBITMAP MSSTYLES_LoadBitmap ( PTHEME_CLASS  tc,
LPCWSTR  lpFilename,
BOOL hasAlpha 
)

Definition at line 896 of file msstyles.c.

897 {
898  WCHAR szFile[MAX_PATH];
899  LPWSTR tmp;
901  lstrcpynW(szFile, lpFilename, sizeof(szFile)/sizeof(szFile[0]));
902  tmp = szFile;
903  do {
904  if(*tmp == '\\') *tmp = '_';
905  if(*tmp == '/') *tmp = '_';
906  if(*tmp == '.') *tmp = '_';
907  } while(*tmp++);
908 
909  /* Try to locate in list of loaded images */
910  img = tc->tf->images;
911  while (img)
912  {
913  if (lstrcmpiW (szFile, img->name) == 0)
914  {
915  TRACE ("found %p %s: %p\n", img, debugstr_w (img->name), img->image);
916  *hasAlpha = img->hasAlpha;
917  return img->image;
918  }
919  img = img->next;
920  }
921  /* Not found? Load from resources */
922  img = HeapAlloc (GetProcessHeap(), 0, sizeof (THEME_IMAGE));
923  img->image = LoadImageW(tc->hTheme, szFile, IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION);
924  prepare_alpha (img->image, hasAlpha);
925  img->hasAlpha = *hasAlpha;
926  /* ...and stow away for later reuse. */
927  lstrcpyW (img->name, szFile);
928  img->next = tc->tf->images;
929  tc->tf->images = img;
930  TRACE ("new %p %s: %p\n", img, debugstr_w (img->name), img->image);
931  return img->image;
932 }
#define lstrcpynW
Definition: compat.h:397
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
#define debugstr_w
Definition: kernel32.h:32
const GLfloat * tc
Definition: glext.h:8925
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLint GLvoid * img
Definition: gl.h:1956
#define MAX_PATH
Definition: compat.h:26
#define lstrcpyW
Definition: compat.h:406
#define LR_CREATEDIBSECTION
Definition: winuser.h:1088
#define IMAGE_BITMAP
Definition: winuser.h:211
static BOOL prepare_alpha(HBITMAP bmp, BOOL *hasAlpha)
Definition: msstyles.c:863
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by UXTHEME_LoadImage(), and UXTHEME_SelectImage().

◆ MSSTYLES_OpenThemeClass()

PTHEME_CLASS MSSTYLES_OpenThemeClass ( PTHEME_FILE  tf,
LPCWSTR  pszAppName,
LPCWSTR  pszClassList 
)

Definition at line 756 of file msstyles.c.

757 {
758  PTHEME_CLASS cls = NULL;
759 #ifdef __REACTOS__
760  PTHEME_CLASS defaultCls = NULL;
761 #endif
763  LPCWSTR start;
764  LPCWSTR end;
765  DWORD len;
766 
767  if(!tf->classes) {
768  return NULL;
769  }
770 
771  start = pszClassList;
772  while((end = strchrW(start, ';'))) {
773  len = end-start;
774  lstrcpynW(szClassName, start, min(len+1, sizeof(szClassName)/sizeof(szClassName[0])));
775  start = end+1;
776  cls = MSSTYLES_FindClass(tf, pszAppName, szClassName);
777  if(cls) break;
778 #ifdef __REACTOS__
779  if (!defaultCls)
780  defaultCls = MSSTYLES_FindClass(tf, NULL, szClassName);
781 #endif
782  }
783  if(!cls && *start) {
784  lstrcpynW(szClassName, start, sizeof(szClassName)/sizeof(szClassName[0]));
785  cls = MSSTYLES_FindClass(tf, pszAppName, szClassName);
786 #ifdef __REACTOS__
787  if (!defaultCls)
788  defaultCls = MSSTYLES_FindClass(tf, NULL, szClassName);
789 #endif
790  }
791  if(cls) {
792  TRACE("Opened app %s, class %s from list %s\n", debugstr_w(cls->szAppName), debugstr_w(cls->szClassName), debugstr_w(pszClassList));
793  cls->tf = tf;
794  cls->tf->dwRefCount++;
795  TRACE("Theme %p refcount: %d\n", tf, tf->dwRefCount);
796  }
797 #ifdef __REACTOS__
798  else if (defaultCls)
799  {
800  cls = defaultCls;
801  TRACE("Opened default class %s from list %s\n", debugstr_w(cls->szClassName), debugstr_w(pszClassList));
802  cls->tf = tf;
803  cls->tf->dwRefCount++;
804  TRACE("Theme %p refcount: %d\n", tf, tf->dwRefCount);
805  }
806 #endif
807  return cls;
808 }
WCHAR szAppName[MAX_THEME_APP_NAME]
Definition: uxthemep.h:60
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
WINE_UNICODE_INLINE WCHAR * strchrW(const WCHAR *str, WCHAR ch)
Definition: unicode.h:248
HFONT tf
Definition: icontest.c:17
GLuint GLuint end
Definition: gl.h:1545
#define lstrcpynW
Definition: compat.h:397
#define MAX_THEME_CLASS_NAME
Definition: uxthemep.h:33
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
static PTHEME_CLASS MSSTYLES_FindClass(PTHEME_FILE tf, LPCWSTR pszAppName, LPCWSTR pszClassName)
Definition: msstyles.c:392
#define TRACE(s)
Definition: solgame.cpp:4
static const WCHAR szClassName[]
Definition: clipbrd.c:11
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
WCHAR szClassName[MAX_THEME_CLASS_NAME]
Definition: uxthemep.h:61
GLuint start
Definition: gl.h:1545
#define min(a, b)
Definition: monoChain.cc:55
struct _THEME_FILE * tf
Definition: uxthemep.h:59

Referenced by OpenThemeDataInternal().

◆ MSSTYLES_OpenThemeFile()

HRESULT MSSTYLES_OpenThemeFile ( LPCWSTR  lpThemeFile,
LPCWSTR  pszColorName,
LPCWSTR  pszSizeName,
PTHEME_FILE tf 
)

Definition at line 54 of file msstyles.c.

55 {
56  HMODULE hTheme;
57  HRSRC hrsc;
58  HRESULT hr = S_OK;
59  static const WCHAR szPackThemVersionResource[] = {
60  'P','A','C','K','T','H','E','M','_','V','E','R','S','I','O','N', '\0'
61  };
62  static const WCHAR szColorNamesResource[] = {
63  'C','O','L','O','R','N','A','M','E','S','\0'
64  };
65  static const WCHAR szSizeNamesResource[] = {
66  'S','I','Z','E','N','A','M','E','S','\0'
67  };
68 
69  WORD version;
70  DWORD versize;
71  LPWSTR pszColors;
72  LPWSTR pszSelectedColor = NULL;
73  LPWSTR pszSizes;
74  LPWSTR pszSelectedSize = NULL;
75  LPWSTR tmp;
76 
77  TRACE("Opening %s\n", debugstr_w(lpThemeFile));
78 
79  hTheme = LoadLibraryExW(lpThemeFile, NULL, LOAD_LIBRARY_AS_DATAFILE);
80 
81  /* Validate that this is really a theme */
82  if(!hTheme) {
84  goto invalid_theme;
85  }
86  if(!(hrsc = FindResourceW(hTheme, MAKEINTRESOURCEW(1), szPackThemVersionResource))) {
87  TRACE("No version resource found\n");
89  goto invalid_theme;
90  }
91  if((versize = SizeofResource(hTheme, hrsc)) != 2)
92  {
93  TRACE("Version resource found, but wrong size: %d\n", versize);
95  goto invalid_theme;
96  }
97  version = *(WORD*)LoadResource(hTheme, hrsc);
99  {
100  TRACE("Version of theme file is unsupported: 0x%04x\n", version);
102  goto invalid_theme;
103  }
104 
105  if(!(hrsc = FindResourceW(hTheme, MAKEINTRESOURCEW(1), szColorNamesResource))) {
106  TRACE("Color names resource not found\n");
108  goto invalid_theme;
109  }
110  pszColors = LoadResource(hTheme, hrsc);
111 
112  if(!(hrsc = FindResourceW(hTheme, MAKEINTRESOURCEW(1), szSizeNamesResource))) {
113  TRACE("Size names resource not found\n");
115  goto invalid_theme;
116  }
117  pszSizes = LoadResource(hTheme, hrsc);
118 
119  /* Validate requested color against what's available from the theme */
120  if(pszColorName) {
121  tmp = pszColors;
122  while(*tmp) {
123  if(!lstrcmpiW(pszColorName, tmp)) {
124  pszSelectedColor = tmp;
125  break;
126  }
127  tmp += lstrlenW(tmp)+1;
128  }
129  }
130  else
131  pszSelectedColor = pszColors; /* Use the default color */
132 
133  /* Validate requested size against what's available from the theme */
134  if(pszSizeName) {
135  tmp = pszSizes;
136  while(*tmp) {
137  if(!lstrcmpiW(pszSizeName, tmp)) {
138  pszSelectedSize = tmp;
139  break;
140  }
141  tmp += lstrlenW(tmp)+1;
142  }
143  }
144  else
145  pszSelectedSize = pszSizes; /* Use the default size */
146 
147  if(!pszSelectedColor || !pszSelectedSize) {
148  TRACE("Requested color/size (%s/%s) not found in theme\n",
149  debugstr_w(pszColorName), debugstr_w(pszSizeName));
151  goto invalid_theme;
152  }
153 
155  (*tf)->hTheme = hTheme;
156 
157  GetFullPathNameW(lpThemeFile, MAX_PATH, (*tf)->szThemeFile, NULL);
158 
159  (*tf)->pszAvailColors = pszColors;
160  (*tf)->pszAvailSizes = pszSizes;
161  (*tf)->pszSelectedColor = pszSelectedColor;
162  (*tf)->pszSelectedSize = pszSelectedSize;
163  (*tf)->dwRefCount = 1;
164 
165  TRACE("Theme %p refcount: %d\n", *tf, (*tf)->dwRefCount);
166 
167  return S_OK;
168 
169 invalid_theme:
170  if(hTheme) FreeLibrary(hTheme);
171  return hr;
172 }
#define ERROR_BAD_FORMAT
Definition: winerror.h:114
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
HRESULT hr
Definition: shlfolder.c:183
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:288
HFONT tf
Definition: icontest.c:17
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1105
#define lstrlenW
Definition: compat.h:407
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
#define debugstr_w
Definition: kernel32.h:32
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR version[]
Definition: asmname.c:64
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:405
#define E_PROP_ID_UNSUPPORTED
Definition: vfwmsgs.h:173
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
#define LOAD_LIBRARY_AS_DATAFILE
Definition: winbase.h:338
#define S_OK
Definition: intsafe.h:59
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define MSSTYLES_VERSION
Definition: msstyles.c:31

Referenced by CheckThemeSignature(), EnumThemeColors(), EnumThemeSizes(), GetThemeDefaults(), GetThemeDocumentationProperty(), OpenThemeFile(), and UXTHEME_LoadTheme().

◆ MSSTYLES_ParseIniSectionName()

static BOOL MSSTYLES_ParseIniSectionName ( LPCWSTR  lpSection,
DWORD  dwLen,
LPWSTR  szAppName,
LPWSTR  szClassName,
int iPartId,
int iStateId 
)
static

Definition at line 313 of file msstyles.c.

314 {
315  WCHAR sec[255];
316  WCHAR part[60] = {'\0'};
317  WCHAR state[60] = {'\0'};
318  LPWSTR tmp;
319  LPWSTR comp;
320  lstrcpynW(sec, lpSection, min(dwLen+1, sizeof(sec)/sizeof(sec[0])));
321 
322  *szAppName = 0;
323  *szClassName = 0;
324  *iPartId = 0;
325  *iStateId = 0;
326  comp = sec;
327  /* Get the application name */
328  tmp = strchrW(comp, ':');
329  if(tmp) {
330  *tmp++ = 0;
331  tmp++;
333  comp = tmp;
334  }
335 
336  tmp = strchrW(comp, '.');
337  if(tmp) {
338  *tmp++ = 0;
340  comp = tmp;
341  /* now get the part & state */
342  tmp = strchrW(comp, '(');
343  if(tmp) {
344  *tmp++ = 0;
345  lstrcpynW(part, comp, sizeof(part)/sizeof(part[0]));
346  comp = tmp;
347  /* now get the state */
348  tmp = strchrW(comp, ')');
349  if (!tmp)
350  return FALSE;
351  *tmp = 0;
352  lstrcpynW(state, comp, sizeof(state)/sizeof(state[0]));
353  }
354  else {
355  lstrcpynW(part, comp, sizeof(part)/sizeof(part[0]));
356  }
357  }
358  else {
359  tmp = strchrW(comp, '(');
360  if(tmp) {
361  *tmp++ = 0;
363  comp = tmp;
364  /* now get the state */
365  tmp = strchrW(comp, ')');
366  if (!tmp)
367  return FALSE;
368  *tmp = 0;
369  lstrcpynW(state, comp, sizeof(state)/sizeof(state[0]));
370  }
371  else {
373  }
374  }
375  if(!*szClassName) return FALSE;
376  return MSSTYLES_LookupPartState(szClassName, part[0]?part:NULL, state[0]?state:NULL, iPartId, iStateId);
377 }
WINE_UNICODE_INLINE WCHAR * strchrW(const WCHAR *str, WCHAR ch)
Definition: unicode.h:248
#define lstrcpynW
Definition: compat.h:397
#define MAX_THEME_CLASS_NAME
Definition: uxthemep.h:33
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR szClassName[]
Definition: clipbrd.c:11
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_THEME_APP_NAME
Definition: uxthemep.h:32
static int state
Definition: maze.c:121
TCHAR szAppName[128]
Definition: solitaire.cpp:16
#define min(a, b)
Definition: monoChain.cc:55
BOOL MSSTYLES_LookupPartState(LPCWSTR pszClass, LPCWSTR pszPart, LPCWSTR pszState, int *iPartId, int *iStateId)
Definition: stylemap.c:1038
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by MSSTYLES_ParseThemeIni().

◆ MSSTYLES_ParseThemeIni()

void MSSTYLES_ParseThemeIni ( PTHEME_FILE  tf)

Definition at line 644 of file msstyles.c.

645 {
646  static const WCHAR szSysMetrics[] = {'S','y','s','M','e','t','r','i','c','s','\0'};
647  static const WCHAR szGlobals[] = {'g','l','o','b','a','l','s','\0'};
648  PTHEME_CLASS cls;
649  PTHEME_CLASS globals;
650  PTHEME_PARTSTATE ps;
654  WCHAR szPropertyName[MAX_THEME_VALUE_NAME];
655  int iPartId;
656  int iStateId;
657  int iPropertyPrimitive;
658  int iPropertyId;
659  DWORD dwLen;
660  LPCWSTR lpName;
661  DWORD dwValueLen;
662  LPCWSTR lpValue;
663 
664  if(tf->classes)
665  return;
666 
668 
669  while((lpName=UXINI_GetNextSection(ini, &dwLen)))
670  {
671  if(CompareStringW(LOCALE_SYSTEM_DEFAULT, NORM_IGNORECASE, lpName, dwLen, szSysMetrics, -1) == CSTR_EQUAL)
672  {
673  while((lpName=UXINI_GetNextValue(ini, &dwLen, &lpValue, &dwValueLen)))
674  {
675  lstrcpynW(szPropertyName, lpName, min(dwLen+1, sizeof(szPropertyName)/sizeof(szPropertyName[0])));
676  if(MSSTYLES_LookupProperty(szPropertyName, &iPropertyPrimitive, &iPropertyId))
677  {
678  /* Catch all metrics, including colors */
679  MSSTYLES_AddMetric(tf, iPropertyPrimitive, iPropertyId, lpValue, dwValueLen);
680  }
681  else
682  {
683  TRACE("Unknown system metric %s\n", debugstr_w(szPropertyName));
684  }
685  }
686  continue;
687  }
688 
689  if(MSSTYLES_ParseIniSectionName(lpName, dwLen, szAppName, szClassName, &iPartId, &iStateId))
690  {
691  BOOL isGlobal = FALSE;
692  if(!lstrcmpiW(szClassName, szGlobals))
693  {
694  isGlobal = TRUE;
695  }
697  ps = MSSTYLES_AddPartState(cls, iPartId, iStateId);
698 
699  while((lpName=UXINI_GetNextValue(ini, &dwLen, &lpValue, &dwValueLen)))
700  {
701  lstrcpynW(szPropertyName, lpName, min(dwLen+1, sizeof(szPropertyName)/sizeof(szPropertyName[0])));
702  if(MSSTYLES_LookupProperty(szPropertyName, &iPropertyPrimitive, &iPropertyId))
703  {
704  MSSTYLES_AddProperty(ps, iPropertyPrimitive, iPropertyId, lpValue, dwValueLen, isGlobal);
705  }
706  else
707  {
708  TRACE("Unknown property %s\n", debugstr_w(szPropertyName));
709  }
710  }
711  }
712  }
713 
714  /* App/Class combos override values defined by the base class, map these overrides */
715  globals = MSSTYLES_FindClass(tf, NULL, szGlobals);
716  cls = tf->classes;
717  while(cls)
718  {
719  if(*cls->szAppName)
720  {
722  if(!cls->overrides)
723  {
724  TRACE("No overrides found for app %s class %s\n", debugstr_w(cls->szAppName), debugstr_w(cls->szClassName));
725  }
726  else
727  {
728  cls->overrides = globals;
729  }
730  }
731  else
732  {
733  /* Everything overrides globals..except globals */
734  if(cls != globals)
735  cls->overrides = globals;
736  }
737  cls = cls->next;
738  }
740 
741  if(!tf->classes) {
742  ERR("Failed to parse theme ini\n");
743  }
744 }
WCHAR szAppName[MAX_THEME_APP_NAME]
Definition: uxthemep.h:60
#define TRUE
Definition: types.h:120
static BOOL MSSTYLES_ParseIniSectionName(LPCWSTR lpSection, DWORD dwLen, LPWSTR szAppName, LPWSTR szClassName, int *iPartId, int *iStateId)
Definition: msstyles.c:313
struct _THEME_CLASS * overrides
Definition: uxthemep.h:63
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
_In_ LPCSTR lpName
Definition: winbase.h:2729
static PTHEME_CLASS MSSTYLES_AddClass(PTHEME_FILE tf, LPCWSTR pszAppName, LPCWSTR pszClassName)
Definition: msstyles.c:422
HFONT tf
Definition: icontest.c:17
static PUXINI_FILE MSSTYLES_GetActiveThemeIni(PTHEME_FILE tf)
Definition: msstyles.c:246
#define NORM_IGNORECASE
Definition: winnls.h:173
#define lstrcpynW
Definition: compat.h:397
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
#define MAX_THEME_CLASS_NAME
Definition: uxthemep.h:33
unsigned int BOOL
Definition: ntddk_ex.h:94
LPCWSTR UXINI_GetNextSection(PUXINI_FILE uf, DWORD *dwLen)
Definition: uxini.c:173
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
BOOL MSSTYLES_LookupProperty(LPCWSTR pszPropertyName, int *dwPrimitive, int *dwId)
Definition: stylemap.c:1100
static PTHEME_PROPERTY MSSTYLES_AddProperty(PTHEME_PARTSTATE ps, int iPropertyPrimitive, int iPropertyId, LPCWSTR lpValue, DWORD dwValueLen, BOOL isGlobal)
Definition: msstyles.c:576
TConfig ini
Definition: tnconfig.cpp:45
INT WINAPI CompareStringW(LCID lcid, DWORD flags, LPCWSTR str1, INT len1, LPCWSTR str2, INT len2)
Definition: lang.c:2275
static PTHEME_CLASS MSSTYLES_FindClass(PTHEME_FILE tf, LPCWSTR pszAppName, LPCWSTR pszClassName)
Definition: msstyles.c:392
#define TRACE(s)
Definition: solgame.cpp:4
static const WCHAR szClassName[]
Definition: clipbrd.c:11
void UXINI_CloseINI(PUXINI_FILE uf)
Definition: uxini.c:83
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define LOCALE_SYSTEM_DEFAULT
unsigned long DWORD
Definition: ntddk_ex.h:95
struct _THEME_CLASS * next
Definition: uxthemep.h:65
#define MAX_THEME_APP_NAME
Definition: uxthemep.h:32
#define CSTR_EQUAL
Definition: winnls.h:453
#define MAX_THEME_VALUE_NAME
Definition: uxthemep.h:34
WCHAR szClassName[MAX_THEME_CLASS_NAME]
Definition: uxthemep.h:61
LPCWSTR UXINI_GetNextValue(PUXINI_FILE uf, DWORD *dwNameLen, LPCWSTR *lpValue, DWORD *dwValueLen)
Definition: uxini.c:226
TCHAR szAppName[128]
Definition: solitaire.cpp:16
#define ERR(fmt,...)
Definition: debug.h:109
static PTHEME_PARTSTATE MSSTYLES_AddPartState(PTHEME_CLASS tc, int iPartId, int iStateId)
Definition: msstyles.c:479
#define min(a, b)
Definition: monoChain.cc:55
static PTHEME_PROPERTY MSSTYLES_AddMetric(PTHEME_FILE tf, int iPropertyPrimitive, int iPropertyId, LPCWSTR lpValue, DWORD dwValueLen)
Definition: msstyles.c:617

Referenced by OpenThemeDataInternal(), and UXTHEME_SetActiveTheme().

◆ MSSTYLES_PSFindProperty()

static PTHEME_PROPERTY MSSTYLES_PSFindProperty ( PTHEME_PARTSTATE  ps,
int  iPropertyPrimitive,
int  iPropertyId 
)
inlinestatic

Definition at line 538 of file msstyles.c.

539 {
540  return MSSTYLES_LFindProperty(ps->properties, iPropertyPrimitive, iPropertyId);
541 }
PTHEME_PROPERTY properties
Definition: uxthemep.h:50
static PTHEME_PROPERTY MSSTYLES_LFindProperty(PTHEME_PROPERTY tp, int iPropertyPrimitive, int iPropertyId)
Definition: msstyles.c:506

Referenced by MSSTYLES_AddProperty(), and MSSTYLES_FindProperty().

◆ MSSTYLES_ReferenceTheme()

HRESULT MSSTYLES_ReferenceTheme ( PTHEME_FILE  tf)

Definition at line 224 of file msstyles.c.

225 {
226  tf->dwRefCount++;
227  TRACE("Theme %p refcount: %d\n", tf, tf->dwRefCount);
228  return S_OK;
229 }
HFONT tf
Definition: icontest.c:17
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

Referenced by UXTHEME_SetActiveTheme().

◆ prepare_alpha()

static BOOL prepare_alpha ( HBITMAP  bmp,
BOOL hasAlpha 
)
static

Definition at line 863 of file msstyles.c.

864 {
865  DIBSECTION dib;
866  int n;
867  BYTE* p;
868 
869  *hasAlpha = FALSE;
870 
871  if (!bmp || GetObjectW( bmp, sizeof(dib), &dib ) != sizeof(dib))
872  return FALSE;
873 
874  if(dib.dsBm.bmBitsPixel != 32)
875  /* nothing to do */
876  return TRUE;
877 
878  p = dib.dsBm.bmBits;
879  n = dib.dsBmih.biHeight * dib.dsBmih.biWidth;
880  /* AlphaBlend() wants premultiplied alpha, so do that now */
881  while (n-- > 0)
882  {
883  int a = p[3]+1;
884  p[0] = (p[0] * a) >> 8;
885  p[1] = (p[1] * a) >> 8;
886  p[2] = (p[2] * a) >> 8;
887  p += 4;
888 
889  if (a != 256)
890  *hasAlpha = TRUE;
891  }
892 
893  return TRUE;
894 }
#define TRUE
Definition: types.h:120
GLdouble n
Definition: glext.h:7729
#define a
Definition: ke_i.h:78
BITMAP bmp
Definition: alphablend.c:62
unsigned char BYTE
Definition: mem.h:68
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
static const BYTE dib[]
Definition: ole2.c:201
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by MSSTYLES_LoadBitmap().

Variable Documentation

◆ alphaBlendMode

int alphaBlendMode

◆ szThemesIniResource

const WCHAR szThemesIniResource[]
static
Initial value:
= {
't','h','e','m','e','s','_','i','n','i','\0'
}

Definition at line 33 of file msstyles.c.

Referenced by MSSTYLES_GetThemeIni().