xoblite™ / Blackbox for Windows bb5 | RC6 preview | 0.25.2.14
http://xoblite.net/
Settings Class Reference

#include <Settings.h>

Classes

struct  Statistics
 

Public Member Functions

 Settings ()
 
 ~Settings ()
 
void InitStyleItems ()
 
void InitStyleItem (StyleItem *styleItem)
 
void DestroyStyleItems ()
 
void DestroyStyleItem (StyleItem *styleItem)
 
LPSTR CreateFileCache (LPSTR path)
 
void DestroyFileCache (LPSTR cachedFilePtr)
 
void ReadConfiguration ()
 
void WriteDefaultRCSettings ()
 
void WriteDefaultMenu ()
 
void ReadStyle ()
 
bool ReadStyleElement (LPSTR styleBuffer, StyleItem *styleItem, LPSTR paramString, bool readFont)
 
void DeriveTaskbarStyle ()
 
COLORREF CreateShadowColor (StyleItem *styleItem, COLORREF color, COLORREF colorTo, COLORREF textColor)
 
COLORREF InvertColor (COLORREF color)
 
COLORREF MixColors (COLORREF colorA, COLORREF colorB)
 
void GetShellFolders ()
 
bool GetBool (LPCSTR fp, LPSTR buffer, LPCSTR szString, bool szDefault)
 
int GetInt (LPCSTR fp, LPSTR buffer, LPCSTR szString, int szDefault)
 
LPSTR GetString (LPCSTR fp, LPSTR buffer, LPCSTR szString, LPSTR szDefault)
 
COLORREF GetColor (LPCSTR fp, LPSTR buffer, LPCSTR szString, LPCSTR szDefault, COLORREF szDefaultRef, bool useDefaultRef)
 
LPSTR GetValueFromCache (LPSTR cachedFilePtr, LPCSTR szString)
 
bool CheckForComment (LPSTR cachedFilePtr, LPSTR ptr)
 
void UpdateAppearanceString (StyleItem *styleItem)
 
LPSTR GetAlignmentAsString (StyleItem *styleItem)
 
void ParsePlacement (LPSTR inputString, Placement *outputPlacement)
 
void PositionFromPlacement (Placement *inputPlacement)
 
void WritePlacement (Placement *inputPlacement)
 
void WriteStyle ()
 
void WriteStyleElement (HANDLE file, StyleItem *styleItem)
 

Public Attributes

char menuFile [MAX_LINE_LENGTH]
 
bool menuSeparators
 
bool menuRoundedCorners
 
BYTE menuTransparencyAlpha
 
BYTE menuTitleTransparencyAlpha
 
BYTE menuFrameTransparencyAlpha
 
BYTE menuGripTransparencyAlpha
 
BYTE menuActiveTransparencyAlpha
 
int submenuGap
 
int submenuDelay
 
bool toolbarHidden
 
Placement ToolbarPlacement
 
char toolbarPlacementString [MAX_LINE_LENGTH]
 
bool toolbarVertical
 
int toolbarHorizontalWidth
 
int toolbarVerticalWidth
 
bool toolbarSnapToEdges
 
BYTE toolbarTransparencyAlpha
 
BYTE toolbarLabelTransparencyAlpha
 
BYTE toolbarWindowLabelTransparencyAlpha
 
BYTE toolbarClockTransparencyAlpha
 
BYTE toolbarButtonTransparencyAlpha
 
bool toolbarRoundedCorners
 
bool toolbarOnTop
 
char toolbarClockFormat [MAX_LINE_LENGTH]
 
bool toolbarLabelHidden
 
bool toolbarDownUpButtonsHidden
 
bool toolbarLeftRightButtonsHidden
 
bool toolbarClockHidden
 
bool toolbarAllowAsymmetry
 
char toolbarDownButtonOverride [MAX_LINE_LENGTH]
 
char toolbarUpButtonOverride [MAX_LINE_LENGTH]
 
char toolbarLeftButtonOverride [MAX_LINE_LENGTH]
 
char toolbarRightButtonOverride [MAX_LINE_LENGTH]
 
int taskbarMode
 
int taskbarMaxItems
 
int taskbarSorting
 
bool taskbarShowTaskWorkspace
 
bool taskbarCurrentOnly
 
bool taskbarFlashing
 
unsigned int taskbarSaturationValue
 
unsigned int taskbarHueIntensity
 
bool taskbarActiveSatHue
 
BYTE taskbarActiveTransparencyAlpha
 
bool taskbarActiveLivePreview
 
bool taskbarInactiveBackground
 
bool taskbarTooltips
 
bool dockHidden
 
Placement DockPlacement
 
char dockPlacementString [MAX_LINE_LENGTH]
 
char dockDirection [MAX_LINE_LENGTH]
 
bool dockVertical
 
bool dockPuzzlePositioning
 
bool dockOnTop
 
bool dockSnapToEdges
 
BYTE dockTransparencyAlpha
 
bool consoleHidden
 
Placement ConsolePlacement
 
bool consoleMaximized
 
int consoleMaximizedWidth
 
int consoleMaximizedMessages
 
int consoleRestoredWidth
 
int consoleRestoredMessages
 
BYTE consoleTransparencyAlpha
 
bool consoleDesktopMode
 
bool consoleRoundedCorners
 
int consolePadding
 
bool desktopClockHidden
 
char desktopClockType [MAX_LINE_LENGTH]
 
Placement desktopClockPlacement
 
BYTE desktopClockTransparencyAlpha
 
bool desktopClockFontDefined
 
char desktopClockFont [128]
 
int desktopClockFontHeight
 
int desktopClockFontWeight
 
bool desktopWeekdayHidden
 
Placement desktopWeekdayPlacement
 
BYTE desktopWeekdayTransparencyAlpha
 
bool desktopWeekdayFontDefined
 
char desktopWeekdayFont [128]
 
int desktopWeekdayFontHeight
 
int desktopWeekdayFontWeight
 
bool desktopDateHidden
 
char desktopDateFormat [MAX_LINE_LENGTH]
 
Placement desktopDatePlacement
 
BYTE desktopDateTransparencyAlpha
 
bool desktopDateFontDefined
 
char desktopDateFont [128]
 
int desktopDateFontHeight
 
int desktopDateFontWeight
 
bool desktopGreetingHidden
 
Placement desktopGreetingPlacement
 
BYTE desktopGreetingTransparencyAlpha
 
bool desktopGreetingFontDefined
 
char desktopGreetingFont [128]
 
int desktopGreetingFontHeight
 
int desktopGreetingFontWeight
 
bool desktopWorkspaceIndicatorHidden
 
bool desktopBorderHidden
 
COLORREF desktopWidgetColor
 
char desktopRClickOverride [MAX_LINE_LENGTH]
 
char desktopMClickOverride [MAX_LINE_LENGTH]
 
char desktopX1ClickOverride [MAX_LINE_LENGTH]
 
char desktopX2ClickOverride [MAX_LINE_LENGTH]
 
char hotkeysFile [MAX_LINE_LENGTH]
 
int numberOfWorkspaces
 
char workspaceNames [MAX_LINE_LENGTH]
 
bool mousewheelChanging
 
bool followActive
 
bool wallpaperPerWorkspace
 
bool wallpaperPerWorkspaceSemaphore
 
char pluginsFile [MAX_LINE_LENGTH]
 
bool pluginsHidden
 
char pluginsRepository [MAX_LINE_LENGTH]
 
char themesFolder [MAX_PATH]
 
char stylesFolder [MAX_PATH]
 
char wallpapersFolder [MAX_PATH]
 
char soundsFolder [MAX_PATH]
 
char selectedTheme [MAX_PATH]
 
char styleFile [MAX_LINE_LENGTH]
 
bool doubleScaleHiDPI
 
int scalingFactorHiDPI
 
bool multimonPlacements
 
bool enableSoundFX
 
bool designerModeEnabled
 
bool writeProtection
 
bool disableRootCommands
 
bool disableThemeFonts
 
bool disableScriptSupport
 
bool disableUnicodeParsing
 
bool explorerHidden
 
char timeDateLocale [MAX_LINE_LENGTH]
 
char preferredEditor [MAX_LINE_LENGTH]
 
char checkedForUpdates [20]
 
int edgeSnapThreshold
 
bool debugLogging
 
USHORT machineArchitecture
 
int operatingSystemVersion
 
BOOL runningUnderWOW64
 
bool underExplorer
 
bool accessLock
 
int currentWorkspace
 
int lastWorkspace
 
char SF_blackboxPath [MAX_PATH]
 
char SF_startMenu [MAX_PATH]
 
char SF_commonStartMenu [MAX_PATH]
 
char SF_programFiles [MAX_PATH]
 
char SF_desktop [MAX_PATH]
 
char SF_userAppData [MAX_PATH]
 
char SF_userProfile [MAX_PATH]
 
char SF_currentThemePath [MAX_PATH]
 
bool usingDefaultTheme
 
bool menuEditboxAlreadyActive
 
MenuItemmenuEditboxStringItemPtr
 
bool checkingForUpdates
 
struct Settings::Statistics Statistics
 
char bbrcFile [MAX_LINE_LENGTH]
 
char xobrcFile [MAX_LINE_LENGTH]
 
char xobrcDefaultFile [MAX_LINE_LENGTH]
 
char * bbrcCache
 
char * xobrcCache
 
char * xobrcDefaultCache
 
char * styleCache
 
StyleItemWildcard
 
StyleItemToolbar
 
StyleItemToolbarLabel
 
StyleItemToolbarWindowLabel
 
StyleItemToolbarClock
 
StyleItemToolbarButton
 
StyleItemToolbarButtonPressed
 
StyleItemToolbarBorder
 
StyleItemMenuTitle
 
StyleItemMenuFrame
 
StyleItemMenuActive
 
StyleItemMenuGrip
 
StyleItemMenuFrameBullet
 
StyleItemMenuActiveBullet
 
StyleItemMenuIndicator
 
StyleItemMenuSeparator
 
StyleItemMenuFrameBorder
 
StyleItemDock
 
StyleItemDockBorder
 
StyleItemActiveTask
 
StyleItemInactiveTask
 
StyleItemFlashingTask
 
StyleItemConsole
 
StyleItemWindowTitleFocus
 
StyleItemWindowTitleUnfocus
 
StyleItemWindowLabelFocus
 
StyleItemWindowLabelUnfocus
 
StyleItemWindowButtonFocus
 
StyleItemWindowButtonUnfocus
 
StyleItemWindowButtonPressed
 
StyleItemWindowGripFocus
 
StyleItemWindowGripUnfocus
 
StyleItemWindowHandleFocus
 
StyleItemWindowHandleUnfocus
 
StyleItemExternalHardware
 
StyleItemselectedElement
 
char wildcardToolbarFont [255]
 
char wildcardMenuFont [255]
 
char wildcardWindowFont [255]
 
char wildcard [MAX_LINE_LENGTH]
 
char toolbar [MAX_LINE_LENGTH]
 
char toolbarLabel [MAX_LINE_LENGTH]
 
char toolbarWindowLabel [MAX_LINE_LENGTH]
 
char toolbarClock [MAX_LINE_LENGTH]
 
char toolbarButton [MAX_LINE_LENGTH]
 
char toolbarButtonPressed [MAX_LINE_LENGTH]
 
char toolbarBorder [MAX_LINE_LENGTH]
 
char menuTitle [MAX_LINE_LENGTH]
 
char menuFrame [MAX_LINE_LENGTH]
 
char menuActive [MAX_LINE_LENGTH]
 
char menuGrip [MAX_LINE_LENGTH]
 
char menuIndicator [MAX_LINE_LENGTH]
 
char menuSeparator [MAX_LINE_LENGTH]
 
char menuFrameBorder [MAX_LINE_LENGTH]
 
char dock [MAX_LINE_LENGTH]
 
char dockBorder [MAX_LINE_LENGTH]
 
char console [MAX_LINE_LENGTH]
 
char windowTitleFocus [MAX_LINE_LENGTH]
 
char windowTitleUnfocus [MAX_LINE_LENGTH]
 
char windowLabelFocus [MAX_LINE_LENGTH]
 
char windowLabelUnfocus [MAX_LINE_LENGTH]
 
char windowButtonFocus [MAX_LINE_LENGTH]
 
char windowButtonUnfocus [MAX_LINE_LENGTH]
 
char windowButtonPressed [MAX_LINE_LENGTH]
 
char windowGripFocus [MAX_LINE_LENGTH]
 
char windowGripUnfocus [MAX_LINE_LENGTH]
 
char windowHandleFocus [MAX_LINE_LENGTH]
 
char windowHandleUnfocus [MAX_LINE_LENGTH]
 
char externalHardware [MAX_LINE_LENGTH]
 
LPSTR appearancePointer
 
int menuBullet
 
char menuFrameBulletAsString [MAX_LINE_LENGTH]
 
char menuActiveBulletAsString [MAX_LINE_LENGTH]
 
char menuBulletPosition [MAX_LINE_LENGTH]
 
bool consoleFontDefined
 
char consoleFont [128]
 
int consoleFontHeight
 
int consoleFontWeight
 
bool globalFontOverride
 
char globalFont [128]
 
int globalFontHeight
 
int borderWidth
 
int menuBorderWidth
 
COLORREF borderColor
 
COLORREF menuBorderColor
 
int bevelWidth
 
int marginWidth
 
int handleHeight
 
int frameWidth
 
char rootCommand [MAX_LINE_LENGTH]
 
int ScreenWidth
 
int ScreenHeight
 
int ScreenX
 
int ScreenY
 
BYTE red
 
BYTE green
 
BYTE blue
 

Constructor & Destructor Documentation

◆ Settings()

Settings::Settings ( )
84{
85 Wildcard = new StyleItem;
86
87 Toolbar = new StyleItem;
94
95 MenuTitle = new StyleItem;
96 MenuFrame = new StyleItem;
98 MenuGrip = new StyleItem;
104
105 Dock = new StyleItem;
106 DockBorder = new StyleItem;
107
108 ActiveTask = new StyleItem;
111
112 Console = new StyleItem;
113
125
127
129
130 //====================
131
132 borderWidth = 0;
133 borderColor = 0;
134
135 bevelWidth = 0;
136 handleHeight = 0;
137 frameWidth = 0;
138
139 //====================
140
141 bbrcFile[0] = 0;
142 xobrcFile[0] = 0;
143 xobrcDefaultFile[0] = 0;
144
145 styleFile[0] = 0;
146 menuFile[0] = 0;
147 hotkeysFile[0] = 0;
148 pluginsFile[0] = 0;
149
150 //====================
151
152 designerModeEnabled = false;
155
157
158 //====================
159
160 ZeroMemory(&Statistics, sizeof(Statistics));
161}
struct StyleItem StyleItem
StyleItem * WindowGripUnfocus
Definition Settings.h:464
StyleItem * MenuSeparator
Definition Settings.h:440
int currentWorkspace
Definition Settings.h:372
StyleItem * WindowLabelUnfocus
Definition Settings.h:459
StyleItem * ToolbarWindowLabel
Definition Settings.h:426
StyleItem * ActiveTask
Definition Settings.h:448
StyleItem * Console
Definition Settings.h:453
StyleItem * WindowButtonUnfocus
Definition Settings.h:461
StyleItem * WindowTitleUnfocus
Definition Settings.h:457
bool wallpaperPerWorkspaceSemaphore
Definition Settings.h:311
StyleItem * MenuFrame
Definition Settings.h:434
char hotkeysFile[MAX_LINE_LENGTH]
Definition Settings.h:303
StyleItem * ToolbarBorder
Definition Settings.h:430
void InitStyleItems()
Definition Settings.cpp:175
StyleItem * MenuFrameBullet
Definition Settings.h:437
StyleItem * selectedElement
Definition Settings.h:471
StyleItem * WindowButtonPressed
Definition Settings.h:462
StyleItem * WindowGripFocus
Definition Settings.h:463
StyleItem * MenuActiveBullet
Definition Settings.h:438
char menuFile[MAX_LINE_LENGTH]
Definition Settings.h:174
StyleItem * Wildcard
Definition Settings.h:421
StyleItem * ToolbarButtonPressed
Definition Settings.h:429
StyleItem * WindowHandleFocus
Definition Settings.h:465
StyleItem * WindowLabelFocus
Definition Settings.h:458
int lastWorkspace
Definition Settings.h:373
StyleItem * MenuTitle
Definition Settings.h:433
StyleItem * ToolbarClock
Definition Settings.h:427
StyleItem * ToolbarButton
Definition Settings.h:428
int frameWidth
Definition Settings.h:568
StyleItem * Dock
Definition Settings.h:444
char xobrcDefaultFile[MAX_LINE_LENGTH]
Definition Settings.h:406
int borderWidth
Definition Settings.h:559
StyleItem * MenuFrameBorder
Definition Settings.h:441
int bevelWidth
Definition Settings.h:564
int handleHeight
Definition Settings.h:566
char bbrcFile[MAX_LINE_LENGTH]
Definition Settings.h:404
StyleItem * ToolbarLabel
Definition Settings.h:425
StyleItem * DockBorder
Definition Settings.h:445
StyleItem * MenuGrip
Definition Settings.h:436
StyleItem * MenuActive
Definition Settings.h:435
bool designerModeEnabled
Definition Settings.h:330
StyleItem * FlashingTask
Definition Settings.h:450
StyleItem * WindowTitleFocus
Definition Settings.h:456
StyleItem * WindowButtonFocus
Definition Settings.h:460
StyleItem * WindowHandleUnfocus
Definition Settings.h:466
StyleItem * InactiveTask
Definition Settings.h:449
char pluginsFile[MAX_LINE_LENGTH]
Definition Settings.h:314
StyleItem * Toolbar
Definition Settings.h:424
StyleItem * ExternalHardware
Definition Settings.h:469
COLORREF borderColor
Definition Settings.h:561
StyleItem * MenuIndicator
Definition Settings.h:439
char styleFile[MAX_LINE_LENGTH]
Definition Settings.h:324
char xobrcFile[MAX_LINE_LENGTH]
Definition Settings.h:405
Definition Settings.h:394

◆ ~Settings()

Settings::~Settings ( )
166{
168}
void DestroyStyleItems()
Definition Settings.cpp:279

Member Function Documentation

◆ InitStyleItems()

void Settings::InitStyleItems ( )

◆ InitStyleItem()

void Settings::InitStyleItem ( StyleItem * styleItem)
226{
227 // ##################################################################################
228 // Below: COLOR_UNDEFINED is later used e.g. by ReadStyleElement() to detect if
229 // these colours have been read or calculated before... (i.e. inherited or otherwise)
230 // ##################################################################################
231
232 if (styleItem->Image.bitmap)
233 {
234// if (debugLogging) SendMessage(GetBBWnd(), BB_CONSOLEMESSAGE, (WPARAM)CONSOLE_ERROR_MESSAGE, (LPARAM)styleItem->Image.path);
235 DeleteObject(styleItem->Image.bitmap); // Note: We need to do this *before* we ZeroMemory as part of a re-initialization... :)
236 }
237
238 ZeroMemory(styleItem, sizeof(StyleItem));
239
240 styleItem->parentRelative = false;
241 styleItem->type = B_SOLID;
242 styleItem->bevelstyle = BEVEL_FLAT;
243 styleItem->bevelposition = BEVEL1;
244 styleItem->interlaced = false;
245
246 styleItem->Color1 = styleItem->Color2 = 0x000000;
247 styleItem->Color3 = styleItem->Color4 = 0x000000;
248 styleItem->Color5 = styleItem->Color6 = styleItem->Color7 = styleItem->Color8 = 0x000000;
249
250 styleItem->TextColor = styleItem->foregroundColor = 0xffffff;
251 styleItem->disabledColor = 0x888888;
252
253 styleItem->ShadowColor = styleItem->OutlineColor = COLOR_UNDEFINED; // -> Not pre-defined, not yet calculated, not yet defined.
254 styleItem->FontOutline = styleItem->FontShadow = false;
255
256 strcpy(styleItem->Font, "Segoe UI");
257 styleItem->FontHeight = 15;
258 styleItem->FontWeight = FW_NORMAL;
259 styleItem->Justify = DT_CENTER;
260
261 styleItem->marginWidth = 0;
262
263 styleItem->borderColor = 0x000000;
264 styleItem->borderWidth = 0;
265 styleItem->bordered = false;
266
267 styleItem->Image.path[0] = '\0';
268 styleItem->Image.mode = 0;
269 styleItem->Image.width = styleItem->Image.height = styleItem->Image.left = styleItem->Image.top = styleItem->Image.right = styleItem->Image.bottom = 0;
270
271 styleItem->nVersion = CORE_SHELL_STYLEITEM; // -> "This StyleItem belongs to the core shell" (see also BBApi.cpp/h)
272}
#define BEVEL1
Definition BBApi.h:108
#define B_SOLID
Definition BBApi.h:80
#define BEVEL_FLAT
Definition BBApi.h:105
#define CORE_SHELL_STYLEITEM
Definition BBApi.h:453
#define COLOR_UNDEFINED
Definition Settings.h:38
int borderWidth
Definition BBApi.h:417
int nVersion
Definition BBApi.h:415
COLORREF Color5
Definition BBApi.h:436
COLORREF disabledColor
Definition BBApi.h:420
int bevelstyle
Definition BBApi.h:400
COLORREF Color4
Definition BBApi.h:434
bool parentRelative
Definition BBApi.h:403
COLORREF TextColor
Definition BBApi.h:408
bool FontOutline
Definition BBApi.h:430
COLORREF Color6
Definition BBApi.h:437
int type
Definition BBApi.h:402
int bevelposition
Definition BBApi.h:401
COLORREF Color7
Definition BBApi.h:438
COLORREF Color8
Definition BBApi.h:439
int Justify
Definition BBApi.h:411
StyleItemImage Image
Definition BBApi.h:441
COLORREF foregroundColor
Definition BBApi.h:419
COLORREF OutlineColor
Definition BBApi.h:431
bool FontShadow
Definition BBApi.h:423
bool interlaced
Definition BBApi.h:404
COLORREF ShadowColor
Definition BBApi.h:429
bool bordered
Definition BBApi.h:421
int FontWeight
Definition BBApi.h:410
COLORREF Color3
Definition BBApi.h:433
COLORREF borderColor
Definition BBApi.h:418
int marginWidth
Definition BBApi.h:416
int FontHeight
Definition BBApi.h:409
char Font[128]
Definition BBApi.h:413
HBITMAP bitmap
Definition BBApi.h:386
int width
Definition BBApi.h:389
char path[MAX_PATH]
Definition BBApi.h:385
int right
Definition BBApi.h:393
int bottom
Definition BBApi.h:394
int top
Definition BBApi.h:392
int height
Definition BBApi.h:390
int left
Definition BBApi.h:391
int mode
Definition BBApi.h:388

◆ DestroyStyleItems()

◆ DestroyStyleItem()

void Settings::DestroyStyleItem ( StyleItem * styleItem)
328{
329 if (styleItem)
330 {
331 if (styleItem->Image.bitmap) DeleteObject(styleItem->Image.bitmap);
332 delete styleItem;
333 }
334}

◆ CreateFileCache()

LPSTR Settings::CreateFileCache ( LPSTR path)
342{
343 char* cachedFilePtr;
344
345// FILE* f = fopen(path, "r");
346 FILE* f = NULL;
347 fopen_s(&f, path, "r");
348
349 if (f)
350 {
351 // Allocate memory for the file cache...
352 fseek(f, 0, SEEK_END);
353 long nLen = ftell(f);
354 cachedFilePtr = (char*)malloc(nLen+2);
355 if (cachedFilePtr != NULL)
356 {
357 // Copy the contents of the file to the file cache...
358 fseek (f, 0, SEEK_SET);
359 int readLen = fread (cachedFilePtr, 1, nLen, f);
360 cachedFilePtr[readLen] = '\0';
361 cachedFilePtr[readLen+1] = EOF;
362 }
363 fclose(f);
364 }
365 else
366 {
367 // Create a dummy cache if the requested file does not exist...
368 cachedFilePtr = (char*)malloc(2);
369 if (cachedFilePtr != NULL)
370 {
371 cachedFilePtr[0] = '\0';
372 cachedFilePtr[1] = EOF;
373 }
374 }
375
376 return cachedFilePtr;
377}

◆ DestroyFileCache()

void Settings::DestroyFileCache ( LPSTR cachedFilePtr)
382{
383 if (cachedFilePtr) free(cachedFilePtr);
384 cachedFilePtr = NULL;
385}

◆ ReadConfiguration()

void Settings::ReadConfiguration ( )
437{
438 char temp[MAX_LINE_LENGTH];
439
440 // ======================================================================
441 // First, let's read any *legacy* syntax blackbox.rc settings,
442 // so we can use them as possible fallbacks later...
443 // ======================================================================
444
446
447 strcpy(styleFile, GetString(NULL, bbrcCache, "session.styleFile:", ""));
448 strcpy(menuFile, GetString(NULL, bbrcCache, "session.menuFile:", "$Blackbox$\\menu.rc"));
449
450 strcpy(toolbarPlacementString, GetString(NULL, bbrcCache, "session.screen0.toolbar.placement:", "BottomCenter"));
451 toolbarHorizontalWidth = GetInt(NULL, bbrcCache, "session.screen0.toolbar.widthPercent:", 75);
452 toolbarOnTop = GetBool(NULL, bbrcCache, "session.screen0.toolbar.onTop:", true);
453 strcpy(toolbarClockFormat, GetString(NULL, bbrcCache, "session.screen0.strftimeFormat:", "%H:%M | %a %#d %b"));
454
455 strcpy(dockPlacementString, GetString(NULL, bbrcCache, "session.screen0.slit.placement:", "Manual xC y50"));
456 strcpy(dockDirection, GetString(NULL, bbrcCache, "session.screen0.slit.direction:", "Horizontal"));
457 dockOnTop = GetBool(NULL, bbrcCache, "session.screen0.slit.onTop:", false);
458
459 numberOfWorkspaces = GetInt(NULL, bbrcCache, "session.screen0.workspaces:", 4);
460 strcpy(workspaceNames, GetString(NULL, bbrcCache, "session.screen0.workspaceNames:", "")); // Nowadays automatically named "Workspace #1" etc if not specified (the old default used to be alpha,beta,gamma,delta)
461
462 // focusLastWindow = GetBool(NULL, bbrcCache, "session.screen0.focusLastWindow:", false);
463 // strcpy(windowPlacement, GetString(NULL, bbrcCache, "session.screen0.windowPlacement:", "ColSmartPlacement"));
464 // strcpy(colPlacementDirection, GetString(NULL, bbrcCache, "session.screen0.colPlacementDirection:", "TopToBottom"));
465 // focusNewWindows = GetBool(NULL, bbrcCache, "session.screen0.focusNewWindows:", false);
466 // strcpy(rowPlacementDirection, GetString(NULL, bbrcCache, "session.screen0.rowPlacementDirection:", "LeftToRight"));
467
468 // strcpy(focusModel, GetString(NULL, bbrcCache, "session.screen0.focusModel:", "ClickToFocus"));
469 // opaqueMove = GetBool(NULL, bbrcCache, "session.opaqueMove:", false);
470 // fullMaximization = GetBool(NULL, bbrcCache, "session.screen0.fullMaximization:", true);
471
472 edgeSnapThreshold = GetInt(NULL, bbrcCache, "session.screen0.edgeSnapThreshold:", 10);
473 // doubleClickInterval = GetInt(NULL, bbrcCache, "session.doubleClickInterval:", 250);
474 // autoRaiseDelay = GetInt(NULL, bbrcCache, "session.autoRaiseDelay:", 250);
475
477
478 // ======================================================================
479
480 // ##### Next, we read all xoblite syntax settings from xoblite.rc! #####
481 // Please note that a parameter may be read from the *default* xoblite.rc file
482 // (xobrcDefaultCache below) or the *current theme* xoblite.rc file (xobrcCache below)
483 // depending on the purpose of the parameter, i.e. theme related parameters are
484 // read from the current theme's xoblite.rc file while universal parameters
485 // (e.g. preferred editor) are read from the default theme's xoblite.rc file
486
487 // ======================================================================
488 //========== THEME SPECIFIC SETTINGS ====================================
489 // ======================================================================
490
491 xobrcCache = CreateFileCache(xobrcFile); // -> The current theme's xoblite.rc!
492
493 //====================
494
495 strcpy(styleFile, GetString(NULL, bbrcCache, "xoblite.styleFile:", styleFile));
496 if (strchr(styleFile, '\"')) StrRemoveEncap(styleFile);
497 if (strchr(styleFile, '$')) ReplaceShellFolders(styleFile);
498 if (strchr(styleFile, '%')) ReplaceEnvVars(styleFile);
499
500 //====================
501
502 menuSeparators = GetBool(NULL, xobrcCache, "xoblite.menu.separators:", true);
503 menuRoundedCorners = GetBool(NULL, xobrcCache, "xoblite.menu.rounded:", false);
504 menuTransparencyAlpha = (BYTE)GetInt(NULL, xobrcCache, "xoblite.menu.transparency.alpha:", 255);
505 menuTitleTransparencyAlpha = (BYTE)GetInt(NULL, xobrcCache, "xoblite.menu.title.transparency.alpha:", menuTransparencyAlpha);
506 menuFrameTransparencyAlpha = (BYTE)GetInt(NULL, xobrcCache, "xoblite.menu.frame.transparency.alpha:", menuTransparencyAlpha);
507 menuActiveTransparencyAlpha = (BYTE)GetInt(NULL, xobrcCache, "xoblite.menu.active.transparency.alpha:", menuTransparencyAlpha);
508 menuGripTransparencyAlpha = (BYTE)GetInt(NULL, xobrcCache, "xoblite.menu.grip.transparency.alpha:", menuTransparencyAlpha);
509
510 //====================
511
512 toolbarHidden = GetBool(NULL, xobrcCache, "xoblite.toolbar.hidden:", false);
513 strcpy(temp, GetString(NULL, xobrcCache, "xoblite.toolbar.placement:", toolbarPlacementString));
515 toolbarVertical = GetBool(NULL, xobrcCache, "xoblite.toolbar.vertical:", false);
516 toolbarHorizontalWidth = GetInt(NULL, xobrcCache, "xoblite.toolbar.widthPercent:", toolbarHorizontalWidth); // -> Used prior to xoblite bb5, cf. width only as percentage in legacy *box...
517 toolbarHorizontalWidth = GetInt(NULL, xobrcCache, "xoblite.toolbar.horizontal.width:", toolbarHorizontalWidth); // -> Used by xoblite bb5 onwards, cf. adaptive parsing of width <> 100 etc...
519 toolbarVerticalWidth = GetInt(NULL, xobrcCache, "xoblite.toolbar.vertical.width:", 0); // (If not specified, the vertical toolbar width is set automatically by xoblite.)
520 toolbarTransparencyAlpha = (BYTE)GetInt(NULL, xobrcCache, "xoblite.toolbar.transparency.alpha:", 255);
521 toolbarLabelTransparencyAlpha = (BYTE)GetInt(NULL, xobrcCache, "xoblite.toolbar.label.transparency.alpha:", toolbarTransparencyAlpha);
522 toolbarWindowLabelTransparencyAlpha = (BYTE)GetInt(NULL, xobrcCache, "xoblite.toolbar.windowlabel.transparency.alpha:", toolbarTransparencyAlpha);
523 toolbarClockTransparencyAlpha = (BYTE)GetInt(NULL, xobrcCache, "xoblite.toolbar.clock.transparency.alpha:", toolbarTransparencyAlpha);
524 toolbarButtonTransparencyAlpha = (BYTE)GetInt(NULL, xobrcCache, "xoblite.toolbar.button.transparency.alpha:", toolbarTransparencyAlpha);
525 toolbarRoundedCorners = GetBool(NULL, xobrcCache, "xoblite.toolbar.rounded:", false);
526 toolbarOnTop = GetBool(NULL, xobrcCache, "xoblite.toolbar.onTop:", toolbarOnTop);
527 toolbarSnapToEdges = GetBool(NULL, xobrcCache, "xoblite.toolbar.snapToEdges:", false);
528
529 toolbarLabelHidden = GetBool(NULL, xobrcCache, "xoblite.toolbar.label.hidden:", false);
530 toolbarDownUpButtonsHidden = GetBool(NULL, xobrcCache, "xoblite.toolbar.downup.buttons.hidden:", false);
531 toolbarLeftRightButtonsHidden = GetBool(NULL, xobrcCache, "xoblite.toolbar.leftright.buttons.hidden:", false);
532 toolbarClockHidden = GetBool(NULL, xobrcCache, "xoblite.toolbar.clock.hidden:", false);
533 toolbarAllowAsymmetry = GetBool(NULL, xobrcCache, "xoblite.toolbar.allow.asymmetry:", false);
534
535 strcpy(toolbarDownButtonOverride, GetString(NULL, xobrcCache, "xoblite.toolbar.downbutton.override:", ""));
536 strcpy(toolbarUpButtonOverride, GetString(NULL, xobrcCache, "xoblite.toolbar.upbutton.override:", ""));
537 strcpy(toolbarLeftButtonOverride, GetString(NULL, xobrcCache, "xoblite.toolbar.leftbutton.override:", ""));
538 strcpy(toolbarRightButtonOverride, GetString(NULL, xobrcCache, "xoblite.toolbar.rightbutton.override:", ""));
539
540 //====================
541
542 strcpy(temp, GetString(NULL, xobrcCache, "xoblite.taskbar.mode:", "Bars+Icons"));
543 {
544 if (!_stricmp(temp, "Bars")) taskbarMode = TASKBAR_MODE_BARS;
545 else if (!_stricmp(temp, "Bars+Icons")) taskbarMode = TASKBAR_MODE_BARSICONS;
546 else if (!_stricmp(temp, "Icons")) taskbarMode = TASKBAR_MODE_ICONS;
547 else taskbarMode = TASKBAR_MODE_HIDDEN; // -> Hide the taskbar, show the toolbar windowLabel instead...
548 }
549 taskbarMaxItems = GetInt(NULL, xobrcCache, "xoblite.taskbar.max.items:", 10); // ...no maximum if set to 0...
550 strcpy(temp, GetString(NULL, xobrcCache, "xoblite.taskbar.sorting:", "FollowActive"));
551 {
552 if (!_stricmp(temp, "LastUsed")) taskbarSorting = TASKBAR_SORT_BY_LAST_USED;
553 else if (!_stricmp(temp, "FollowActive")) taskbarSorting = TASKBAR_SORT_FOLLOW_ACTIVE;
555 }
556 taskbarShowTaskWorkspace = GetBool(NULL, xobrcCache, "xoblite.taskbar.show.task.workspace:", true);
557 taskbarCurrentOnly = GetBool(NULL, xobrcCache, "xoblite.taskbar.currentOnly:", false);
558 taskbarFlashing = GetBool(NULL, xobrcCache, "xoblite.taskbar.flashing:", true);
559 taskbarSaturationValue = GetInt(NULL, xobrcCache, "xoblite.taskbar.saturation:", 30);
560 taskbarHueIntensity = GetInt(NULL, xobrcCache, "xoblite.taskbar.hue:", 100);
561 taskbarActiveSatHue = GetBool(NULL, xobrcCache, "xoblite.taskbar.active.SatHue:", false);
562 taskbarActiveTransparencyAlpha = (BYTE)GetInt(NULL, xobrcCache, "xoblite.taskbar.active.transparency.alpha:", toolbarTransparencyAlpha);
563 taskbarActiveLivePreview = GetBool(NULL, xobrcCache, "xoblite.taskbar.active.live.preview:", true);
564 taskbarInactiveBackground = GetBool(NULL, xobrcCache, "xoblite.taskbar.inactive.background:", false);
565 bool tempTooltips = GetBool(NULL, xobrcCache, "xoblite.toolbar.tooltips.disable:", false); // -> Used prior to xoblite bb5, parsed for backwards compatibility only...
566 taskbarTooltips = GetBool(NULL, xobrcCache, "xoblite.taskbar.tooltips:", !tempTooltips); // -> Used by xoblite bb5 onwards (cf. now used only by the taskbar, the systray has been removed, etc)
567
568 //====================
569
570 dockHidden = GetBool(NULL, xobrcCache, "xoblite.dock.hidden:", false);
571 strcpy(temp, GetString(NULL, xobrcCache, "xoblite.dock.placement:", dockPlacementString));
573 strcpy(temp, GetString(NULL, xobrcCache, "xoblite.dock.direction:", dockDirection)); // -> Used prior to xoblite bb5, parsed for backwards compatibility only...
574 {
575 if (!_stricmp(temp, "Vertical")) dockVertical = true;
576 else dockVertical = false;
577 }
578 dockVertical = GetBool(NULL, xobrcCache, "xoblite.dock.vertical:", dockVertical);
579
580 dockSnapToEdges = GetBool(NULL, xobrcCache, "xoblite.dock.snapToEdges:", false);
581 dockTransparencyAlpha = (BYTE)GetInt(NULL, xobrcCache, "xoblite.dock.transparency.alpha:", 255);
582
583 strcpy(temp, GetString(NULL, xobrcCache, "xoblite.dock.positioning:", "")); // -> Used prior to xoblite bb5, parsed for backwards compatibility only...
584 if (!_stricmp(temp, "SideBySide")) dockPuzzlePositioning = false;
585 else dockPuzzlePositioning = true;
586 dockPuzzlePositioning = GetBool(NULL, xobrcCache, "xoblite.dock.puzzle.positioning:", dockPuzzlePositioning);
587
588 dockOnTop = GetBool(NULL, xobrcCache, "xoblite.dock.onTop:", dockOnTop);
589
590 //====================
591
592 consoleHidden = GetBool(NULL, xobrcCache, "xoblite.console.hidden:", true);
593 strcpy(temp, GetString(NULL, xobrcCache, "xoblite.console.placement:", "Default"));
595 consoleMaximized = GetBool(NULL, xobrcCache, "xoblite.console.maximized:", true);
596 consoleMaximizedWidth = GetInt(NULL, xobrcCache, "xoblite.console.maximized.width:", 0);
597 consoleMaximizedMessages = GetInt(NULL, xobrcCache, "xoblite.console.maximized.messages:", 10);
599 consoleRestoredWidth = GetInt(NULL, xobrcCache, "xoblite.console.restored.width:", 0);
600 consoleRestoredMessages = GetInt(NULL, xobrcCache, "xoblite.console.restored.messages:", 1);
602 consoleTransparencyAlpha = (BYTE)GetInt(NULL, xobrcCache, "xoblite.console.transparency.alpha:", 85);
603 consoleDesktopMode = GetBool(NULL, xobrcCache, "xoblite.console.desktop.mode:", false);
604 consoleRoundedCorners = GetBool(NULL, xobrcCache, "xoblite.console.rounded:", true);
605 consolePadding = GetInt(NULL, xobrcCache, "xoblite.console.padding:", 0);
606
607 StyleItem tempStyleItem;
608 ZeroMemory(&tempStyleItem, sizeof(StyleItem));
609 strcpy(temp, GetString(NULL, xobrcCache, "xoblite.console.font:", ""));
610 ParseFontString(temp, &tempStyleItem);
611 if (strlen(tempStyleItem.Font))
612 {
613 strcpy(consoleFont, tempStyleItem.Font);
614 consoleFontHeight = tempStyleItem.FontHeight;
615 consoleFontWeight = tempStyleItem.FontWeight;
616 consoleFontDefined = true;
617 }
618 else consoleFontDefined = false;
619
620 //====================
621
622 desktopClockHidden = GetBool(NULL, xobrcCache, "xoblite.desktop.clock.hidden:", true);
623 strcpy(desktopClockType, GetString(NULL, xobrcCache, "xoblite.desktop.clock.type:", "Regular"));
624 strcpy(temp, GetString(NULL, xobrcCache, "xoblite.desktop.clock.placement:", "Default"));
626 desktopClockTransparencyAlpha = (BYTE)GetInt(NULL, xobrcCache, "xoblite.desktop.clock.transparency.alpha:", 210);
627
628 desktopWeekdayHidden = GetBool(NULL, xobrcCache, "xoblite.desktop.weekday.hidden:", true);
629 strcpy(temp, GetString(NULL, xobrcCache, "xoblite.desktop.weekday.placement:", "Manual x-50 y-100"));
631 desktopWeekdayTransparencyAlpha = (BYTE)GetInt(NULL, xobrcCache, "xoblite.desktop.weekday.transparency.alpha:", 210);
632
633 desktopDateHidden = GetBool(NULL, xobrcCache, "xoblite.desktop.date.hidden:", true);
634 strcpy(desktopDateFormat, GetString(NULL, xobrcCache, "xoblite.desktop.date.format:", "%B %#d %Y"));
635 strcpy(temp, GetString(NULL, xobrcCache, "xoblite.desktop.date.placement:", "Manual x-50 y-50"));
637 desktopDateTransparencyAlpha = (BYTE)GetInt(NULL, xobrcCache, "xoblite.desktop.date.transparency.alpha:", 105);
638
639 desktopGreetingHidden = GetBool(NULL, xobrcCache, "xoblite.desktop.greeting.hidden:", true);
640 strcpy(temp, GetString(NULL, xobrcCache, "xoblite.desktop.greeting.placement:", "Manual x-50 y-50"));
642 desktopGreetingTransparencyAlpha = (BYTE)GetInt(NULL, xobrcCache, "xoblite.desktop.greeting.transparency.alpha:", 60);
643
644 desktopWorkspaceIndicatorHidden = GetBool(NULL, xobrcCache, "xoblite.desktop.indicator.hidden:", false);
645
646 desktopBorderHidden = GetBool(NULL, xobrcCache, "xoblite.desktop.border.hidden:", true);
647
648 strcpy(temp, GetString(NULL, xobrcCache, "xoblite.desktop.clock.font:", ""));
649 ParseFontString(temp, &tempStyleItem);
650 if (strlen(tempStyleItem.Font))
651 {
652 strcpy(desktopClockFont, tempStyleItem.Font);
653 desktopClockFontHeight = tempStyleItem.FontHeight;
654 desktopClockFontWeight = tempStyleItem.FontWeight;
656 }
657 else desktopClockFontDefined = false;
658 strcpy(temp, GetString(NULL, xobrcCache, "xoblite.desktop.weekday.font:", temp)); // -> Inherits desktop clock font if not specified
659 ParseFontString(temp, &tempStyleItem);
660 if (strlen(tempStyleItem.Font))
661 {
662 strcpy(desktopWeekdayFont, tempStyleItem.Font);
663 desktopWeekdayFontHeight = tempStyleItem.FontHeight;
664 desktopWeekdayFontWeight = tempStyleItem.FontWeight;
666 }
667 else desktopWeekdayFontDefined = false;
668 strcpy(temp, GetString(NULL, xobrcCache, "xoblite.desktop.date.font:", temp)); // -> Inherits desktop weekday font if not specified
669 ParseFontString(temp, &tempStyleItem);
670 if (strlen(tempStyleItem.Font))
671 {
672 strcpy(desktopDateFont, tempStyleItem.Font);
673 desktopDateFontHeight = tempStyleItem.FontHeight;
674 desktopDateFontWeight = tempStyleItem.FontWeight;
676 }
677 else desktopDateFontDefined = false;
678 strcpy(temp, GetString(NULL, xobrcCache, "xoblite.desktop.greeting.font:", temp)); // -> Inherits desktop date font if not specified
679 ParseFontString(temp, &tempStyleItem);
680 if (strlen(tempStyleItem.Font))
681 {
682 strcpy(desktopGreetingFont, tempStyleItem.Font);
686 }
687 else desktopGreetingFontDefined = false;
688
689 desktopWidgetColor = GetColor(NULL, xobrcCache, "xoblite.desktop.widget.color:", NULL, 0xffffff, true);
690
691 strcpy(desktopRClickOverride, GetString(NULL, xobrcCache, "xoblite.desktop.rclick.override:", ""));
692 strcpy(desktopMClickOverride, GetString(NULL, xobrcCache, "xoblite.desktop.mclick.override:", ""));
693 strcpy(desktopX1ClickOverride, GetString(NULL, xobrcCache, "xoblite.desktop.x1click.override:", ""));
694 strcpy(desktopX2ClickOverride, GetString(NULL, xobrcCache, "xoblite.desktop.x2click.override:", ""));
695/*
696 strcpy(temp, GetString(NULL, xobrcCache, "xoblite.desktop.area:", ""));
697 if (strlen(temp) > 0)
698 {
699 desktopAreaDefined = true;
700
701 char left[10], top[10], right[10], bottom[10];
702 LPSTR tokens[4];
703 tokens[0] = left;
704 tokens[1] = top;
705 tokens[2] = right;
706 tokens[3] = bottom;
707
708 left[0] = top[0] = right[0] = bottom[0] = '\0';
709 BBTokenize(temp, tokens, 3, bottom);
710
711 desktopArea.left = atoi(left);
712 desktopArea.top = atoi(top);
713 desktopArea.right = atoi(right);
714 desktopArea.bottom = atoi(bottom);
715 }
716 else desktopAreaDefined = false;
717*/
718 //====================
719
720 pluginsHidden = GetBool(NULL, xobrcCache, "xoblite.plugins.hidden:", false);
721
722 //====================
723
724 writeProtection = GetBool(NULL, xobrcCache, "xoblite.write.protection:", false);
725
726 //====================
727
729
730 // ======================================================================
731 //========== UNIVERSAL SETTINGS =========================================
732 // ======================================================================
733
734 xobrcDefaultCache = CreateFileCache(xobrcDefaultFile); // -> The default xoblite.rc!
735
736 //====================
737
738 strcpy(stylesFolder, GetString(NULL, xobrcDefaultCache, "xoblite.stylesFolder:", "$Blackbox$\\styles"));
739 if (strchr(stylesFolder, '\"')) StrRemoveEncap(stylesFolder);
741 if (strchr(stylesFolder, '%')) ReplaceEnvVars(stylesFolder);
742
743 strcpy(themesFolder, GetString(NULL, xobrcDefaultCache, "xoblite.themesFolder:", "$Blackbox$\\themes"));
744 if (strchr(themesFolder, '\"')) StrRemoveEncap(themesFolder);
746 if (strchr(themesFolder, '%')) ReplaceEnvVars(themesFolder);
747
748 strcpy(wallpapersFolder, GetString(NULL, xobrcDefaultCache, "xoblite.wallpapersFolder:", "$Blackbox$\\wallpapers"));
752
753 enableSoundFX = GetBool(NULL, xobrcDefaultCache, "xoblite.sound.effects:", true);
754 strcpy(soundsFolder, GetString(NULL, xobrcDefaultCache, "xoblite.soundsFolder:", "$Blackbox$\\sounds"));
755 if (strchr(soundsFolder, '\"')) StrRemoveEncap(soundsFolder);
757 if (strchr(soundsFolder, '%')) ReplaceEnvVars(soundsFolder);
758
759 strcpy(hotkeysFile, GetString(NULL, xobrcDefaultCache, "xoblite.hotkeysFile:", "$Blackbox$\\hotkeys.rc"));
760 if (strchr(hotkeysFile, '\"')) StrRemoveEncap(hotkeysFile);
762 if (strchr(hotkeysFile, '%')) ReplaceEnvVars(hotkeysFile);
763
764 strcpy(pluginsFile, GetString(NULL, xobrcDefaultCache, "xoblite.pluginsFile:", "$Blackbox$\\plugins.rc"));
765 if (strchr(pluginsFile, '\"')) StrRemoveEncap(pluginsFile);
767 if (strchr(pluginsFile, '%')) ReplaceEnvVars(pluginsFile);
768
769 strcpy(selectedTheme, GetString(NULL, xobrcDefaultCache, "xoblite.selected.theme:", "[Default]"));
770 if (!_stricmp(selectedTheme, "<Default>")) strcpy(selectedTheme, "[Default]"); // (changed to avoid similarity to editable string/integer menu items, as it is also shown in the Themes menu)
771
772 //====================
773
774 strcpy(toolbarClockFormat, GetString(NULL, xobrcDefaultCache, "xoblite.toolbar.strftimeFormat:", toolbarClockFormat));
775
776 strcpy(menuFile, GetString(NULL, xobrcDefaultCache, "xoblite.menuFile:", menuFile));
777 if (strchr(menuFile, '\"')) StrRemoveEncap(menuFile);
778 if (strchr(menuFile, '$')) ReplaceShellFolders(menuFile);
779 if (strchr(menuFile, '%')) ReplaceEnvVars(menuFile);
780 if (!FileExists(menuFile))
781 {
782 // Check for menu.rc in the Blackbox and $UserAppData$\Blackbox directories...
783 strcpy(menuFile, ConfigFileExists("menu.rc", NULL));
784 if (!_stricmp(menuFile, ""))
785 {
786 // If not found, check for menurc in the same directories...
787 strcpy(menuFile, ConfigFileExists("menurc", NULL));
788 if (!_stricmp(menuFile, ""))
789 {
790 // If still not found, create the default
791 // menu.rc in the Blackbox directory...
793 }
794 }
795
796 // Finally, we save the newly configured menu.rc path...
798 }
799 submenuDelay = GetInt(NULL, xobrcDefaultCache, "xoblite.submenu.delay:", 40);
800// scrollSpeed = GetInt(NULL, xobrcDefaultCache, "xoblite.menu.scrollSpeed:", 10);
801// wheelSpeed = GetInt(NULL, xobrcDefaultCache, "xoblite.menu.wheelSpeed:", 50);
802
803 //====================
804
805 numberOfWorkspaces = GetInt(NULL, xobrcDefaultCache, "xoblite.workspaces:", numberOfWorkspaces);
806 strcpy(workspaceNames, GetString(NULL, xobrcDefaultCache, "xoblite.workspaces.names:", workspaceNames));
807 mousewheelChanging = GetBool(NULL, xobrcDefaultCache, "xoblite.workspaces.mousewheel.changing:", false);
808 followActive = GetBool(NULL, xobrcDefaultCache, "xoblite.workspaces.followActive:", true);
809 wallpaperPerWorkspace = GetBool(NULL, xobrcDefaultCache, "xoblite.workspaces.wallpapers:", true);
810
811 //====================
812
813 strcpy(pluginsRepository, GetString(NULL, xobrcDefaultCache, "xoblite.plugins.repository:", "http://xoblite.net/plugins.txt"));
814
815 //====================
816
817 doubleScaleHiDPI = GetBool(NULL, xobrcDefaultCache, "xoblite.double.scale:", true); // <- Deprecated, kept for backwards compatibility only, remapped to new integer scaling factor.
818 int legacyScalingFactor = 1;
819 if (doubleScaleHiDPI) legacyScalingFactor = 2;
820 scalingFactorHiDPI = GetInt(NULL, xobrcDefaultCache, "xoblite.hidpi.scaling.factor:", legacyScalingFactor); // <- New integer HiDPI scaling factor (1x-6x) for further flexibililty wrt ultra-high res screens
821 if (scalingFactorHiDPI < 1) scalingFactorHiDPI = 1; // Safeguard
822 if (scalingFactorHiDPI > 4) scalingFactorHiDPI = 4; // Safeguard
823
824 multimonPlacements = GetBool(NULL, xobrcDefaultCache, "xoblite.multimonitor.placements:", false);
825
826 disableRootCommands = GetBool(NULL, xobrcDefaultCache, "xoblite.disable.rootCommands:", false);
827 disableThemeFonts = GetBool(NULL, xobrcDefaultCache, "xoblite.disable.theme.fonts:", true);
828 disableScriptSupport = GetBool(NULL, xobrcDefaultCache, "xoblite.disable.script.support:", false);
829
830 disableUnicodeParsing = GetBool(NULL, xobrcDefaultCache, "xoblite.disable.unicode.parsing:", false); // PRELIMINARY
831
832 explorerHidden = GetBool(NULL, xobrcDefaultCache, "xoblite.explorer.hidden:", false);
833
834 strcpy(timeDateLocale, GetString(NULL, xobrcDefaultCache, "xoblite.toolbar.locale:", "")); // Old syntax (when used by the toolbar only)
835 strcpy(timeDateLocale, GetString(NULL, xobrcDefaultCache, "xoblite.timedate.locale:", timeDateLocale)); // New syntax (when used by both toolbar and desktop)
836
837 strcpy(preferredEditor, GetString(NULL, xobrcDefaultCache, "xoblite.editor:", "\"notepad.exe\""));
840
841 strcpy(checkedForUpdates, GetString(NULL, xobrcDefaultCache, "xoblite.checked.for.updates:", "#001 / 2006-01-01"));
842
843 //====================
844
845 // fullMaximization = GetBool(NULL, xobrcDefaultCache, "xoblite.fullMaximization:", fullMaximization);
846 edgeSnapThreshold = GetInt(NULL, xobrcDefaultCache, "xoblite.edgeSnapThreshold:", edgeSnapThreshold);
847 // strcpy(focusModel, GetString(NULL, xobrcDefaultCache, "xoblite.focusModel:", focusModel));
848
849 // opaqueMove = GetBool(NULL, xobrcDefaultCache, "xoblite.opaqueMove:", opaqueMove);
850 // doubleClickInterval = GetInt(NULL, xobrcDefaultCache, "xoblite.doubleClickInterval:", doubleClickInterval);
851 // autoRaiseDelay = GetInt(NULL, xobrcDefaultCache, "xoblite.autoRaiseDelay:", autoRaiseDelay);
852
853 //====================
854
855 debugLogging = GetBool(NULL, xobrcDefaultCache, "xoblite.debug:", false);
856
857 //====================
858
860
861 // ======================================================================
862 // ======================================================================
863 // ======================================================================
864/*
865 // Apply a few settings directly... (read: no better place to do it so we might as well do it here... ;))
866 SystemParametersInfo(SPI_SETACTIVEWNDTRKTIMEOUT, 0, (PVOID)autoRaiseDelay, SPIF_SENDCHANGE);
867
868 if (!_stricmp(focusModel, "ClickToFocus"))
869 {
870 SystemParametersInfo(SPI_SETACTIVEWINDOWTRACKING, 0, (PVOID)false, SPIF_SENDCHANGE);
871 SystemParametersInfo(SPI_SETACTIVEWNDTRKZORDER, 0, (PVOID)false, SPIF_SENDCHANGE);
872 }
873 else if (!_stricmp(focusModel, "AutoRaiseSloppyFocus"))
874 {
875 SystemParametersInfo(SPI_SETACTIVEWINDOWTRACKING, 0, (PVOID)true, SPIF_SENDCHANGE);
876 SystemParametersInfo(SPI_SETACTIVEWNDTRKZORDER, 0, (PVOID)true, SPIF_SENDCHANGE);
877 }
878 else if (!_stricmp(focusModel, "SloppyFocus"))
879 {
880 SystemParametersInfo(SPI_SETACTIVEWINDOWTRACKING, 0, (PVOID)true, SPIF_SENDCHANGE);
881 SystemParametersInfo(SPI_SETACTIVEWNDTRKZORDER, 0, (PVOID)false, SPIF_SENDCHANGE);
882 }
883
884 SystemParametersInfo(SPI_SETDOUBLECLICKTIME, doubleClickInterval, NULL, SPIF_SENDCHANGE);
885 SystemParametersInfo(SPI_SETDRAGFULLWINDOWS, opaqueMove, NULL, SPIF_SENDCHANGE);
886*/
887}
void ParseFontString(LPSTR string, StyleItem *item)
Definition BBApi.cpp:2669
bool FileExists(LPCSTR szFileName)
Definition BBApi.cpp:819
LPCSTR ConfigFileExists(LPCSTR filename, LPCSTR pluginDir)
Definition BBApi.cpp:776
LPSTR StrRemoveEncap(LPSTR string)
Definition BBApi.cpp:406
void ReplaceEnvVars(LPSTR string)
Definition BBApi.cpp:2594
void ReplaceShellFolders(LPSTR string)
Definition BBApi.cpp:2633
LPCSTR menuPath(LPCSTR other)
Definition BBApi.cpp:920
#define MAX_LINE_LENGTH
Definition BBApi.h:64
#define TASKBAR_SORT_BY_LAST_USED
Definition Settings.h:49
#define TASKBAR_MODE_BARS
Definition Settings.h:43
#define TASKBAR_MODE_BARSICONS
Definition Settings.h:44
#define TASKBAR_MODE_HIDDEN
Definition Settings.h:42
#define TASKBAR_SORT_DISABLED
Definition Settings.h:47
#define TASKBAR_MODE_ICONS
Definition Settings.h:45
#define TASKBAR_SORT_FOLLOW_ACTIVE
Definition Settings.h:48
char desktopDateFormat[MAX_LINE_LENGTH]
Definition Settings.h:272
char desktopDateFont[128]
Definition Settings.h:276
int consoleFontHeight
Definition Settings.h:549
char consoleFont[128]
Definition Settings.h:548
char * xobrcCache
Definition Settings.h:409
BYTE toolbarWindowLabelTransparencyAlpha
Definition Settings.h:197
int scalingFactorHiDPI
Definition Settings.h:327
Placement desktopGreetingPlacement
Definition Settings.h:281
BYTE menuActiveTransparencyAlpha
Definition Settings.h:181
BYTE menuTitleTransparencyAlpha
Definition Settings.h:178
Placement desktopClockPlacement
Definition Settings.h:256
bool consoleDesktopMode
Definition Settings.h:249
char desktopX1ClickOverride[MAX_LINE_LENGTH]
Definition Settings.h:299
char toolbarUpButtonOverride[MAX_LINE_LENGTH]
Definition Settings.h:211
bool dockSnapToEdges
Definition Settings.h:237
BYTE taskbarActiveTransparencyAlpha
Definition Settings.h:224
bool dockOnTop
Definition Settings.h:236
char desktopClockType[MAX_LINE_LENGTH]
Definition Settings.h:255
bool taskbarTooltips
Definition Settings.h:227
int desktopDateFontHeight
Definition Settings.h:277
bool dockHidden
Definition Settings.h:230
void WriteDefaultMenu()
Definition Settings.cpp:894
char desktopRClickOverride[MAX_LINE_LENGTH]
Definition Settings.h:297
BYTE toolbarButtonTransparencyAlpha
Definition Settings.h:199
char desktopMClickOverride[MAX_LINE_LENGTH]
Definition Settings.h:298
int consoleMaximizedMessages
Definition Settings.h:245
int taskbarMaxItems
Definition Settings.h:216
bool toolbarLabelHidden
Definition Settings.h:204
BYTE desktopDateTransparencyAlpha
Definition Settings.h:274
char selectedTheme[MAX_PATH]
Definition Settings.h:323
int consoleRestoredMessages
Definition Settings.h:247
bool menuSeparators
Definition Settings.h:175
char * bbrcCache
Definition Settings.h:408
bool toolbarAllowAsymmetry
Definition Settings.h:208
bool desktopClockHidden
Definition Settings.h:254
bool doubleScaleHiDPI
Definition Settings.h:326
bool desktopWeekdayHidden
Definition Settings.h:263
int toolbarHorizontalWidth
Definition Settings.h:192
BYTE toolbarLabelTransparencyAlpha
Definition Settings.h:196
Placement desktopDatePlacement
Definition Settings.h:273
int desktopClockFontHeight
Definition Settings.h:260
bool disableRootCommands
Definition Settings.h:332
bool consoleFontDefined
Definition Settings.h:547
unsigned int taskbarSaturationValue
Definition Settings.h:221
char desktopGreetingFont[128]
Definition Settings.h:284
bool pluginsHidden
Definition Settings.h:315
BYTE menuFrameTransparencyAlpha
Definition Settings.h:179
BYTE consoleTransparencyAlpha
Definition Settings.h:248
bool taskbarFlashing
Definition Settings.h:220
bool toolbarHidden
Definition Settings.h:188
int desktopGreetingFontWeight
Definition Settings.h:286
char wallpapersFolder[MAX_PATH]
Definition Settings.h:321
int consolePadding
Definition Settings.h:251
bool explorerHidden
Definition Settings.h:337
bool consoleMaximized
Definition Settings.h:243
int GetInt(LPCSTR fp, LPSTR buffer, LPCSTR szString, int szDefault)
Definition Settings.cpp:2311
LPSTR GetString(LPCSTR fp, LPSTR buffer, LPCSTR szString, LPSTR szDefault)
Definition Settings.cpp:2503
bool GetBool(LPCSTR fp, LPSTR buffer, LPCSTR szString, bool szDefault)
Definition Settings.cpp:2278
bool taskbarInactiveBackground
Definition Settings.h:226
char preferredEditor[MAX_LINE_LENGTH]
Definition Settings.h:341
BYTE desktopClockTransparencyAlpha
Definition Settings.h:257
int desktopClockFontWeight
Definition Settings.h:261
LPSTR CreateFileCache(LPSTR path)
Definition Settings.cpp:341
int toolbarVerticalWidth
Definition Settings.h:193
BYTE toolbarTransparencyAlpha
Definition Settings.h:195
bool dockVertical
Definition Settings.h:234
bool desktopWeekdayFontDefined
Definition Settings.h:266
bool desktopClockFontDefined
Definition Settings.h:258
int desktopDateFontWeight
Definition Settings.h:278
bool consoleRoundedCorners
Definition Settings.h:250
char checkedForUpdates[20]
Definition Settings.h:342
bool toolbarDownUpButtonsHidden
Definition Settings.h:205
unsigned int taskbarHueIntensity
Definition Settings.h:222
bool debugLogging
Definition Settings.h:361
Placement ConsolePlacement
Definition Settings.h:242
BYTE menuGripTransparencyAlpha
Definition Settings.h:180
char pluginsRepository[MAX_LINE_LENGTH]
Definition Settings.h:316
char toolbarLeftButtonOverride[MAX_LINE_LENGTH]
Definition Settings.h:212
char desktopX2ClickOverride[MAX_LINE_LENGTH]
Definition Settings.h:300
Placement ToolbarPlacement
Definition Settings.h:189
bool menuRoundedCorners
Definition Settings.h:176
bool writeProtection
Definition Settings.h:331
bool multimonPlacements
Definition Settings.h:328
char toolbarRightButtonOverride[MAX_LINE_LENGTH]
Definition Settings.h:213
bool toolbarOnTop
Definition Settings.h:201
bool desktopGreetingFontDefined
Definition Settings.h:283
bool toolbarLeftRightButtonsHidden
Definition Settings.h:206
bool disableUnicodeParsing
Definition Settings.h:335
COLORREF GetColor(LPCSTR fp, LPSTR buffer, LPCSTR szString, LPCSTR szDefault, COLORREF szDefaultRef, bool useDefaultRef)
Definition Settings.cpp:2686
BYTE menuTransparencyAlpha
Definition Settings.h:177
char dockPlacementString[MAX_LINE_LENGTH]
Definition Settings.h:232
bool taskbarCurrentOnly
Definition Settings.h:219
bool desktopBorderHidden
Definition Settings.h:293
void DestroyFileCache(LPSTR cachedFilePtr)
Definition Settings.cpp:381
Placement DockPlacement
Definition Settings.h:231
char soundsFolder[MAX_PATH]
Definition Settings.h:322
char desktopClockFont[128]
Definition Settings.h:259
char stylesFolder[MAX_PATH]
Definition Settings.h:320
bool desktopWorkspaceIndicatorHidden
Definition Settings.h:292
COLORREF desktopWidgetColor
Definition Settings.h:295
bool enableSoundFX
Definition Settings.h:329
int desktopWeekdayFontWeight
Definition Settings.h:269
int consoleRestoredWidth
Definition Settings.h:246
BYTE dockTransparencyAlpha
Definition Settings.h:238
bool toolbarClockHidden
Definition Settings.h:207
char toolbarDownButtonOverride[MAX_LINE_LENGTH]
Definition Settings.h:210
bool taskbarShowTaskWorkspace
Definition Settings.h:218
char dockDirection[MAX_LINE_LENGTH]
Definition Settings.h:233
char timeDateLocale[MAX_LINE_LENGTH]
Definition Settings.h:339
void ParsePlacement(LPSTR inputString, Placement *outputPlacement)
Definition Settings.cpp:3121
bool desktopDateFontDefined
Definition Settings.h:275
bool desktopGreetingHidden
Definition Settings.h:280
bool mousewheelChanging
Definition Settings.h:308
bool taskbarActiveLivePreview
Definition Settings.h:225
int edgeSnapThreshold
Definition Settings.h:354
char toolbarClockFormat[MAX_LINE_LENGTH]
Definition Settings.h:202
int submenuDelay
Definition Settings.h:183
bool desktopDateHidden
Definition Settings.h:271
int consoleMaximizedWidth
Definition Settings.h:244
int numberOfWorkspaces
Definition Settings.h:306
int consoleFontWeight
Definition Settings.h:550
Placement desktopWeekdayPlacement
Definition Settings.h:264
bool followActive
Definition Settings.h:309
int taskbarSorting
Definition Settings.h:217
int desktopGreetingFontHeight
Definition Settings.h:285
BYTE desktopWeekdayTransparencyAlpha
Definition Settings.h:265
bool toolbarSnapToEdges
Definition Settings.h:194
bool toolbarVertical
Definition Settings.h:191
char toolbarPlacementString[MAX_LINE_LENGTH]
Definition Settings.h:190
char workspaceNames[MAX_LINE_LENGTH]
Definition Settings.h:307
int taskbarMode
Definition Settings.h:215
bool consoleHidden
Definition Settings.h:241
bool disableScriptSupport
Definition Settings.h:334
char * xobrcDefaultCache
Definition Settings.h:410
char themesFolder[MAX_PATH]
Definition Settings.h:319
bool taskbarActiveSatHue
Definition Settings.h:223
bool disableThemeFonts
Definition Settings.h:333
char desktopWeekdayFont[128]
Definition Settings.h:267
bool dockPuzzlePositioning
Definition Settings.h:235
BYTE toolbarClockTransparencyAlpha
Definition Settings.h:198
int desktopWeekdayFontHeight
Definition Settings.h:268
bool wallpaperPerWorkspace
Definition Settings.h:310
bool toolbarRoundedCorners
Definition Settings.h:200
BYTE desktopGreetingTransparencyAlpha
Definition Settings.h:282

◆ WriteDefaultRCSettings()

void Settings::WriteDefaultRCSettings ( )
393{
394 DWORD retLength=0;
395 char path[MAX_LINE_LENGTH], szTemp[MAX_LINE_LENGTH];
396 GetBlackboxPath(path, sizeof(path));
397 strcat(path, "xoblite.rc");
398
399 if (FileExists(path)) return;
400 else
401 {
402 // Try to download the latest default xoblite.rc available online...
403 bool downloadSuccessful = DownloadFile("http://xoblite.net/defaults/xoblite.rc", path);
404 if (downloadSuccessful)
405 {
406 // ...and double-check that the downloaded file wasn't actually a 404 message... :)
407 strcpy(szTemp, ReadString(path, "404 Not Found", ""));
408 if (strlen(szTemp) > 0) downloadSuccessful = false;
409 }
410
411 if (!downloadSuccessful)
412 {
413 // If the downloading above wasn't successful, we create a "fallback" non-populated xoblite.rc as a last resort...
414 HANDLE f = CreateFile(path, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
415 if (f)
416 {
417 strcpy(szTemp,
418 "! =========================================================================================\r\n"
419 "! Note: This \"fallback\" blank configuration file will be dynamically populated over time...\r\n"
420 "! =========================================================================================\r\n\r\n");
421 WriteFile(f, szTemp, strlen(szTemp), &retLength, NULL);
422 }
423 CloseHandle(f);
424 }
425
426 strcpy(bbrcFile, path); // Legacy blackbox.rc (for backwards compatibility)
427 strcpy(xobrcDefaultFile, path); // Default xoblite.rc (for universal settings)
428 }
429}
bool DownloadFile(LPCSTR url, LPCSTR path)
Definition BBApi.cpp:3296
LPSTR ReadString(LPCSTR fp, LPCSTR szString, LPSTR szDefault)
Definition BBApi.cpp:544
bool WINAPI GetBlackboxPath(LPSTR pszPath, int nMaxLen)
Definition BBApi.cpp:214

◆ WriteDefaultMenu()

void Settings::WriteDefaultMenu ( )
895{
896 DWORD retLength=0;
897 char temp[MAX_LINE_LENGTH];
898
899 HANDLE f = CreateFile(menuFile, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
900 if (f)
901 {
902 strcpy(temp,
903 "[begin] ()\r\n"
904 "\t[exec] (Explorer) {explorer.exe /e,%SystemDrive%}\r\n"
905 "\t[submenu] (Start menu)\r\n"
906 "\t\t[path] (Current user) {\"$StartMenu$\"}\r\n"
907 "\t\t[path] (All users) {\"$CommonStartMenu$\"}\r\n"
908 "\t[end]\r\n"
909 "\t[submenu] (Shutdown menu)\r\n"
910 "\t\t[lockworkstation] (Lock workstation)\r\n"
911 "\t\t[separator]\r\n"
912 "\t\t[standby] (Standby [sleep])\r\n"
913 "\t\t[hibernate] (Hibernate [suspend])\r\n"
914 "\t\t[separator]\r\n"
915 "\t\t[logoff] (Log off)\r\n"
916 "\t\t[reboot] (Restart [reboot])\r\n"
917 "\t\t[shutdown] (Shutdown)\r\n"
918 "\t[end]\r\n"
919 "\t[separator]\r\n"
920 "\t[configuration] (xoblite)\r\n"
921 "[end] ()\r\n");
922 WriteFile(f, temp, strlen(temp), &retLength, NULL);
923 }
924
925 CloseHandle(f);
926
928 strcat(menuFile, "menu.rc");
929}

◆ ReadStyle()

void Settings::ReadStyle ( )
937{
938 // ##################################################################################
939 // Sidenote: The ~messy inheritance between style elements, old wildcarding etc below
940 // is not an ideal situation, but legacy dependencies are tough to get rid of, so...
941 // ##################################################################################
942
944 if (styleCache == NULL) return;
945
946 //====================
947
948 char temp[MAX_LINE_LENGTH];
949 COLORREF tempColor;
950 bool bb4nix070syntax = false;
951 InitStyleItems(); // -> Resets all StyleItems back to a default state (including any applicable destroy/delete's)
952
953 //====================
954
955 // First, a few miscellaneous "style-wide" parameters...
956
957 borderWidth = GetInt(NULL, styleCache, "borderWidth:", 0); // "For all parent elements" [?]
958 borderColor = GetColor(NULL, styleCache, "borderColor:", NULL, 0x000000, true);
959
960 marginWidth = GetInt(NULL, styleCache, "marginWidth:", 0);
961 bevelWidth = GetInt(NULL, styleCache, "bevelWidth:", 1);
962
963 handleHeight = GetInt(NULL, styleCache, "handleWidth:", 5); // ...often used?...
964 handleHeight = GetInt(NULL, styleCache, "handleHeight:", handleHeight); // ...more recent?... (and makes more sense of course!)
965 handleHeight = GetInt(NULL, styleCache, "window.handleHeight:", handleHeight); // ...bb4nix 0.70 syntax... (see https://raw.githubusercontent.com/bradleythughes/blackbox/master/data/README.style )
966
967 // Width of the window frame (old parameter from bb4nix version 0.61+;
968 // when not specified, frameWidth defaults to the value of bevelWidth)
969 frameWidth = GetInt(NULL, styleCache, "frameWidth:", bevelWidth);
970
971 // The "rootCommand" is executed whenever the style is selected,
972 // typically setting a wallpaper... (e.g. using bsetbg or bsetroot)
973 strcpy(rootCommand, GetString(NULL, styleCache, "rootCommand:", ""));
975
976 //====================
977
978 // Wildcard settings... (nb. only a rudimentary top level implementation
979 // due to the fact I *really* dislike the use of wildcards in styles... <sigh>)
980 strcpy(wildcard, "Flat Solid");
982
983 // First we fetch a few of the more common "non-dot" wildcards, e.g. *textColor...
984 Wildcard->TextColor = GetColor(NULL, styleCache, "*textColor:", NULL, Wildcard->TextColor, true);
985
986 strcpy(Wildcard->Font, GetString(NULL, styleCache, "*font:", Wildcard->Font));
988 Wildcard->FontHeight = GetInt(NULL, styleCache, "*fontHeight:", Wildcard->FontHeight);
989
990 strcpy(temp, GetString(NULL, styleCache, "*alignment:", "Center"));
991 strcpy(temp, GetString(NULL, styleCache, "*justify:", temp));
992 if (IsInString(temp, "Left")) Wildcard->Justify = DT_LEFT;
993 else if (IsInString(temp, "Right")) Wildcard->Justify = DT_RIGHT;
994 else Wildcard->Justify = DT_CENTER;
995
996 Wildcard->borderWidth = GetInt(NULL, styleCache, "*borderWidth:", borderWidth); // "For all non-parent elements" [?]
997 Wildcard->borderColor = GetColor(NULL, styleCache, "*borderColor:", NULL, borderColor, true);
998 Wildcard->marginWidth = GetInt(NULL, styleCache, "*marginWidth:", marginWidth);
999
1000 // ...and use these as defaults for all "dotted" wildcards, e.g. *.textColor...
1002
1003 // Finally, a few odd birds thrown in just because I'm in a good mood... ;)
1004 strcpy(wildcardToolbarFont, GetString(NULL, styleCache, "toolbar*font:", Wildcard->Font));
1005 strcpy(wildcardMenuFont, GetString(NULL, styleCache, "menu*font:", Wildcard->Font));
1006 strcpy(wildcardWindowFont, GetString(NULL, styleCache, "window*font:", Wildcard->Font));
1007
1008 //====================
1009
1010 // Toolbar background
1011 strcpy(toolbar, "Flat Solid");
1013 CopyMemory(Toolbar, Wildcard, sizeof(StyleItem));
1014 Toolbar->Color = 0x000000;
1015 Toolbar->TextColor = 0xffffff;
1016 Toolbar->FontOutline = Toolbar->FontShadow = false;
1017 Toolbar->marginWidth = 1;
1018 Toolbar->borderWidth = borderWidth;
1019 strcpy(Toolbar->Font, wildcardToolbarFont);
1020 ReadStyleElement(styleCache, Toolbar, "toolbar", true);
1021
1022 // If a console font is not defined in xoblite.rc, use the toolbar font as default...
1023 if (!consoleFontDefined)
1024 {
1025 strcpy(consoleFont, Toolbar->Font);
1026 consoleFontHeight = Toolbar->FontHeight;
1027 consoleFontWeight = Toolbar->FontWeight;
1028 }
1029
1030 if (Toolbar->ShadowY > Toolbar->marginWidth) Toolbar->ShadowY = Toolbar->marginWidth;
1031
1032 //====================
1033
1034 // Toolbar workspace label
1035 strcpy(toolbarLabel, "ParentRelative");
1037 CopyMemory(ToolbarLabel, Toolbar, sizeof(StyleItem));
1038 ToolbarLabel->FontOutline = ToolbarLabel->FontShadow = false;
1039 ToolbarLabel->borderWidth = Wildcard->borderWidth;
1040 ReadStyleElement(styleCache, ToolbarLabel, "toolbar.label", true);
1041
1042 if (ToolbarLabel->ShadowY > ToolbarLabel->marginWidth) ToolbarLabel->ShadowY = ToolbarLabel->marginWidth;
1043
1044 //====================
1045
1046 // Toolbar window label
1047 strcpy(temp, GetString(NULL, styleCache, "toolbar.windowLabel.appearance:", ""));
1048 if (!strlen(temp)) strcpy(temp, GetString(NULL, styleCache, "toolbar.windowLabel:", ""));
1049
1050 if (strlen(temp))
1051 {
1052 strcpy(toolbarWindowLabel, "Flat Solid");
1054 CopyMemory(ToolbarWindowLabel, Toolbar, sizeof(StyleItem));
1055 ToolbarWindowLabel->FontOutline = ToolbarWindowLabel->FontShadow = false;
1056 ToolbarWindowLabel->borderWidth = Wildcard->borderWidth;
1057 ToolbarWindowLabel->marginWidth = ToolbarLabel->marginWidth;
1058 ReadStyleElement(styleCache, ToolbarWindowLabel, "toolbar.windowLabel", true);
1059 }
1060 else
1061 {
1062 // Use workspace label settings if window label isn't defined... (applicable to some old 0.5x styles)
1064 CopyMemory(ToolbarWindowLabel, ToolbarLabel, sizeof(StyleItem));
1065 }
1066
1067 if (ToolbarWindowLabel->ShadowY > ToolbarWindowLabel->marginWidth) ToolbarWindowLabel->ShadowY = ToolbarWindowLabel->marginWidth;
1068
1069 //====================
1070
1071 // Toolbar clock
1072 strcpy(toolbarClock, "ParentRelative");
1074 CopyMemory(ToolbarClock, Toolbar, sizeof(StyleItem));
1075 ToolbarClock->FontOutline = ToolbarClock->FontShadow = false;
1076 ToolbarClock->marginWidth = ToolbarLabel->marginWidth;
1077 ToolbarClock->borderWidth = Wildcard->borderWidth;
1078 ReadStyleElement(styleCache, ToolbarClock, "toolbar.clock", true);
1079
1080 if (ToolbarClock->ShadowY > ToolbarClock->marginWidth) ToolbarClock->ShadowY = ToolbarClock->marginWidth;
1081
1082 //====================
1083
1084 // Toolbar text
1085 if (!strlen(GetString(NULL, styleCache, "toolbar.textColor:", "")))
1086 {
1087 if (!strlen(GetString(NULL, styleCache, "*textColor:", "")))
1088 {
1089 if (ToolbarWindowLabel->parentRelative) Toolbar->TextColor = ToolbarWindowLabel->TextColor;
1090 else if (ToolbarLabel->parentRelative) Toolbar->TextColor = ToolbarLabel->TextColor;
1091 else if (ToolbarClock->parentRelative) Toolbar->TextColor = ToolbarClock->TextColor;
1092 else Toolbar->TextColor = ToolbarWindowLabel->TextColor;
1093 }
1094 else Toolbar->TextColor = GetColor(NULL, styleCache, "*textColor:", NULL, Wildcard->TextColor, true);
1095 }
1096 else Toolbar->TextColor = GetColor(NULL, styleCache, "toolbar.textColor:", NULL, Wildcard->TextColor, true);
1097
1098// if (toolbarFontHeight > 12) Toolbar->FontHeight = toolbarFontHeight = 12;
1099
1100 //====================
1101
1102 // Toolbar buttons in non-pressed state...
1103 strcpy(toolbarButton, "Flat Solid");
1105 ToolbarButton->Color = 0x444444;
1106 ToolbarButton->PicColor = Toolbar->TextColor;
1107 ToolbarButton->borderColor = Toolbar->borderColor;
1108 ToolbarButton->borderWidth = Wildcard->borderWidth;
1109 ToolbarButton->marginWidth = 2;
1110 bb4nix070syntax = ReadStyleElement(styleCache, ToolbarButton, "toolbar.button", false);
1111
1112// tempColor = GetColor(NULL, styleCache, "toolbar.button.foregroundColor:", NULL, Toolbar->TextColor, true);
1113// ToolbarButton->PicColor = GetColor(NULL, styleCache, "toolbar.button.picColor:", NULL, tempColor, true);
1114
1115 //====================
1116
1117 // Toolbar buttons in pressed state...
1118 strcpy(toolbarButtonPressed, "Flat Solid");
1120 CopyMemory(ToolbarButtonPressed, ToolbarButton, sizeof(StyleItem));
1121 ToolbarButtonPressed->Color = 0x222222;
1122 ToolbarButtonPressed->borderColor = Toolbar->borderColor;
1123 ToolbarButtonPressed->borderWidth = Wildcard->borderWidth;
1124 ToolbarButtonPressed->marginWidth = 2;
1125 bb4nix070syntax = ReadStyleElement(styleCache, ToolbarButtonPressed, "toolbar.button.pressed", false);
1126
1127// tempColor = GetColor(NULL, styleCache, "toolbar.button.pressed.foregroundColor:", NULL, ToolbarButton->PicColor, true);
1128// ToolbarButtonPressed->PicColor = GetColor(NULL, styleCache, "toolbar.button.pressed.picColor:", NULL, tempColor, true);
1129
1130 //====================
1131
1132 // Toolbar gradient-style borders... (experimental from xoblite bb5 RC4)
1133 if (strlen(GetString(NULL, styleCache, "toolbar.border.", ""))) // toolbar.border defined?
1134 {
1135 strcpy(toolbarBorder, "");
1137 ReadStyleElement(styleCache, ToolbarBorder, "toolbar.border", false);
1138 }
1139 else ToolbarBorder->parentRelative = true; // Disable toolbar gradient-style borders...
1140
1141 //====================
1142
1143 menuBorderColor = GetColor(NULL, styleCache, "menu.borderColor:", NULL, Wildcard->borderColor, true);
1144 menuBorderWidth = GetInt(NULL, styleCache, "menu.borderWidth:", borderWidth);
1145
1146 // Menu title...
1147 strcpy(menuTitle, "Flat Solid");
1149 CopyMemory(MenuTitle, Wildcard, sizeof(StyleItem));
1150 MenuTitle->Color = 0x000000;
1151 MenuTitle->TextColor = Wildcard->TextColor;
1152 MenuTitle->borderColor = menuBorderColor;
1153 MenuTitle->borderWidth = menuBorderWidth;
1154 MenuTitle->marginWidth = marginWidth;
1155 strcpy(MenuTitle->Font, wildcardMenuFont);
1156 MenuTitle->FontOutline = MenuTitle->FontShadow = false;
1157 ReadStyleElement(styleCache, MenuTitle, "menu.title", true);
1158
1159 if (MenuTitle->ShadowY > MenuTitle->marginWidth) MenuTitle->ShadowY = MenuTitle->marginWidth;
1160
1161 //====================
1162
1163 // Menu frame...
1164 strcpy(menuFrame, "Flat Solid");
1166 CopyMemory(MenuFrame, MenuTitle, sizeof(StyleItem));
1167 MenuFrame->Color = 0x000000;
1168 MenuFrame->TextColor = Wildcard->TextColor;
1169 MenuFrame->borderColor = menuBorderColor;
1170 MenuFrame->borderWidth = menuBorderWidth;
1171 MenuFrame->marginWidth = marginWidth;
1172 strcpy(MenuFrame->Font, wildcardMenuFont);
1173 MenuFrame->FontHeight = Wildcard->FontHeight;
1174 MenuFrame->Justify = Wildcard->Justify;
1175 MenuFrame->FontOutline = MenuFrame->FontShadow = false;
1176 ReadStyleElement(styleCache, MenuFrame, "menu.frame", true);
1177
1178 tempColor = GetColor(NULL, styleCache, "menu.frame.foregroundColor:", NULL, MenuFrame->TextColor, true);
1179 MenuFrame->BulletColor = GetColor(NULL, styleCache, "menu.frame.bulletColor:", NULL, tempColor, true);
1180
1181 // Optional menu frame gradient-style borders... (experimental from xoblite bb5 RC4)
1182 if (strlen(GetString(NULL, styleCache, "menu.frame.border.", ""))) // menu.border defined?
1183 {
1184 strcpy(menuFrameBorder, "");
1186 ReadStyleElement(styleCache, MenuFrameBorder, "menu.frame.border", false);
1187 }
1188 else MenuFrameBorder->parentRelative = true; // Disable menu gradient-style borders...
1189
1190 //====================
1191
1192 // Highlighted/active menu items
1193 // (first parse any menu.hilite [classic syntax] settings, then any menu.active [0.70 syntax] settings,
1194 // i.e. the latter having priority if a parameter has been defined twice using both syntaxes...)
1195 strcpy(menuActive, "Flat Solid");
1197 CopyMemory(MenuActive, MenuFrame, sizeof(StyleItem));
1198 MenuActive->Color = MenuFrame->TextColor;
1199 MenuActive->TextColor = MenuFrame->Color;
1200 MenuActive->borderWidth = Wildcard->borderWidth;
1201 MenuActive->marginWidth = marginWidth;
1202 MenuActive->FontOutline = MenuActive->FontShadow = false;
1203// strcpy(temp, GetString(NULL, styleCache, "menu.active", ""));
1204// if (strlen(temp)) bb4nix070syntax = ReadStyleElement(styleCache, MenuActive, "menu.active", true);
1205// else bb4nix070syntax = ReadStyleElement(styleCache, MenuActive, "menu.hilite", true);
1206 bb4nix070syntax = ReadStyleElement(styleCache, MenuActive, "menu.hilite", true); // Try looking for menu.hilite parameters first...
1207 bb4nix070syntax = ReadStyleElement(styleCache, MenuActive, "menu.active", true); // ...then overload menu.active on top of menu.hilite to allow for accidentally mixed syntax parameters... (yeah it does happen every now and then ;))
1208
1209 MenuActive->BulletColor = GetColor(NULL, styleCache, "menu.hilite.bulletColor:", NULL, MenuActive->TextColor, true);
1210 tempColor = GetColor(NULL, styleCache, "menu.active.foregroundColor:", NULL, MenuActive->BulletColor, true);
1211 MenuActive->BulletColor = GetColor(NULL, styleCache, "menu.active.bulletColor:", NULL, tempColor, true);
1212
1213 if (MenuActive->parentRelative)
1214 {
1216 MenuActive->Color = MenuFrame->Color;
1217 MenuActive->ColorTo = MenuFrame->ColorTo;
1218 }
1219
1220 if (MenuActive->ShadowY > MenuActive->marginWidth) MenuActive->ShadowY = MenuActive->marginWidth;
1221
1222 //====================
1223
1224 // Submenu bullet style+position for menu.frame and menu.active folder items... (nb. non-image bullet colours are parsed above for both of them)
1225 strcpy(temp, GetString(NULL, styleCache, "menu.bullet:", "Triangle")); // -> Legacy style syntax (for backwards compatibility)
1226 strcpy(menuFrameBulletAsString, GetString(NULL, styleCache, "menu.frame.bullet:", temp)); // -> Modern style syntax (for more flexibility)
1227
1228 if (strchr(menuFrameBulletAsString, '.') || strchr(menuFrameBulletAsString, '\\')) // -> We detect whether a menu bullet image path has been specified by checking for an "only-in-a-path" character (. or \‍) in the style parameter string...
1229 {
1231
1236 {
1237// strncpy(MenuFrameBullet->Image.path, menuFrameBulletAsString, MAX_PATH);
1238 strncpy_s(MenuFrameBullet->Image.path, sizeof(MenuFrameBullet->Image.path), menuFrameBulletAsString, _TRUNCATE);
1240 }
1241
1242 // Below: A separate menu.active bullet image is optional, i.e. if not defined
1243 // the menu.bullet/menu.frame.bullet one is used also for menu.active bullets...
1244 strcpy(menuActiveBulletAsString, GetString(NULL, styleCache, "menu.active.bullet:", menuFrameBulletAsString));
1249 {
1250// strncpy(MenuActiveBullet->Image.path, menuActiveBulletAsString, MAX_PATH);
1251 strncpy_s(MenuActiveBullet->Image.path, sizeof(MenuActiveBullet->Image.path), menuActiveBulletAsString, _TRUNCATE);
1253 }
1254 }
1255 else if ((!_stricmp(menuFrameBulletAsString, "triangle")) || (!_stricmp(temp, "arrow"))) menuBullet = MENU_BULLET_TRIANGLE;
1256 else if (!_stricmp(menuFrameBulletAsString, "square")) menuBullet = MENU_BULLET_SQUARE;
1257 else if (!_stricmp(menuFrameBulletAsString, "diamond")) menuBullet = MENU_BULLET_DIAMOND;
1258 else if (!_stricmp(menuFrameBulletAsString, "circle")) menuBullet = MENU_BULLET_CIRCLE;
1259 else if (!_stricmp(menuFrameBulletAsString, "triple")) menuBullet = MENU_BULLET_TRIPLE;
1260 else if (!_stricmp(menuFrameBulletAsString, "comment")) menuBullet = MENU_BULLET_COMMENT;
1261 else if (!_stricmp(menuFrameBulletAsString, "grid")) menuBullet = MENU_BULLET_GRID;
1262 else if (!_stricmp(menuFrameBulletAsString, "quad")) menuBullet = MENU_BULLET_QUAD;
1263 else if (!_stricmp(menuFrameBulletAsString, "bitmap"))
1264 {
1265 // Unsupported: bbLean used to allow small bitmaps to be used as simple one-colour menu bullet "masks",
1266 // while xoblite nowadays support much more flexible ARGB images as frame/active bullets, see above.
1267 menuBullet = MENU_BULLET_TRIANGLE; // -> Fallback to triangle bullets...
1268 }
1270
1271 strcpy(menuBulletPosition, GetString(NULL, styleCache, "menu.bullet.position:", "Right"));
1272
1273 // Menu "indicators" for boolean items... (introduced in xoblite bb1)
1274 if (MenuActive->parentRelative)
1275 {
1276 CopyMemory(MenuIndicator, MenuTitle, sizeof(StyleItem));
1277 strcpy(menuIndicator, menuTitle);
1278 }
1279 else
1280 {
1281 CopyMemory(MenuIndicator, MenuActive, sizeof(StyleItem));
1282 strcpy(menuIndicator, menuActive);
1283 }
1285 ReadStyleElement(styleCache, MenuIndicator, "menu.indicator", false);
1286
1287 // Menu separators... (originally introduced in xoblite bb2, later evolved further)
1288// tempColor = GetColor(NULL, styleCache, "menu.separator.foregroundColor:", NULL, MenuFrame->TextColor, true);
1289// MenuSeparator->Color = GetColor(NULL, styleCache, "menu.separator.color:", NULL, tempColor, true);
1290
1291 strcpy(menuSeparator, "Flat Gradient MirrorHorizontal");
1293 CopyMemory(MenuSeparator, MenuFrame, sizeof(StyleItem));
1295 MenuSeparator->bevelstyle = BEVEL_FLAT;
1296 MenuSeparator->marginWidth = 1;
1297
1298 if (!strlen(GetString(NULL, styleCache, "menu.separator.appearance:", ""))) // No separator appearance defined -> Legacy separators mode
1299 {
1300 if (strlen(GetString(NULL, styleCache, "menu.separator.shadowColor:", "")))
1301 {
1302 MenuSeparator->FontShadow = true;
1303 MenuSeparator->Color1 = MenuFrame->Color1;
1304 MenuSeparator->Color2 = GetColor(NULL, styleCache, "menu.separator.color:", NULL, MenuFrame->TextColor, true);
1305 MenuSeparator->ShadowColor = GetColor(NULL, styleCache, "menu.separator.shadowColor:", NULL, MenuFrame->Color, true);
1306 MenuSeparator->ShadowX = GetInt(NULL, styleCache, "menu.separator.shadowX:", 1);
1307 MenuSeparator->ShadowY = GetInt(NULL, styleCache, "menu.separator.shadowY:", 1);
1308 }
1309 else
1310 {
1311 MenuSeparator->Color1 = MenuFrame->Color1;
1312 tempColor = GetColor(NULL, styleCache, "menu.separator.foregroundColor:", NULL, MenuFrame->TextColor, true);
1313 MenuSeparator->Color2 = GetColor(NULL, styleCache, "menu.separator.color:", NULL, tempColor, true);
1314 }
1315 }
1316 else // Separator appearance defined -> Advanced separators mode (e.g. up to 8 colours etc)
1317 {
1318 MenuSeparator->Color1 = GetColor(NULL, styleCache, "menu.separator.foregroundColor:", NULL, MenuFrame->TextColor, true);
1319 MenuSeparator->Color2 = MenuSeparator->Color3 = MenuSeparator->Color4 = MenuSeparator->Color5 = MenuSeparator->Color6 = MenuSeparator->Color7 = MenuSeparator->Color8 = MenuSeparator->Color1;
1320// ReadStyleElement(styleCache, MenuSeparator, "menu.separator", false);
1321 ReadStyleElement(styleCache, MenuSeparator, "menu.separator", true); // Note: Boolean true only in order to read shadowColor etc (normally part of the font related parsing)
1322
1323 switch (MenuSeparator->type)
1324 {
1325 case B_SUPERHORIZONTAL:
1326 case B_SPLITHORIZONTAL:
1327 case B_MIRRORHORIZONTAL:
1328 case B_HORIZONTAL:
1329 case B_SOLID:
1330 case B_SPLITSOLID:
1331 {
1332 break;
1333 }
1334
1335 case B_SUPERVERTICAL: { MenuSeparator->type = B_SUPERHORIZONTAL; break; }
1336 case B_SPLITVERTICAL: { MenuSeparator->type = B_SPLITHORIZONTAL; break; }
1337 case B_VERTICAL: { MenuSeparator->type = B_HORIZONTAL; break; }
1338
1339 default: { MenuSeparator->type = B_MIRRORHORIZONTAL; break; }
1340 }
1341 }
1342
1343 if (MenuSeparator->ShadowX > 3) MenuSeparator->ShadowX = 3;
1344 else if (MenuSeparator->ShadowX < -3) MenuSeparator->ShadowX = -3;
1345 if (MenuSeparator->ShadowY > 3) MenuSeparator->ShadowY = 3;
1346 else if (MenuSeparator->ShadowY < -3) MenuSeparator->ShadowY = -3;
1347
1348 //====================
1349
1350 // Menu grip... (introduced in xoblite bb4 RC4)
1351 if (strlen(GetString(NULL, styleCache, "menu.grip", ""))) // menu.grip defined?
1352 {
1353 strcpy(menuGrip, "");
1355 CopyMemory(MenuGrip, MenuTitle, sizeof(StyleItem));
1356 MenuGrip->marginWidth = MenuGrip->FontHeight = 0;
1357 MenuGrip->FontOutline = MenuGrip->FontShadow = false;
1358 ReadStyleElement(styleCache, MenuGrip, "menu.grip", true);
1359
1360// MenuGrip->parentRelative = false; // Enable menu grips...
1361 if (MenuGrip->ShadowY > MenuGrip->marginWidth) MenuGrip->ShadowY = MenuGrip->marginWidth;
1362 }
1363 else MenuGrip->parentRelative = true; // Disable menu grips...
1364
1365 //====================
1366
1367 // Dock...
1368 strcpy(dock, toolbar); // Default dock styling == Inherit toolbar styling
1370 CopyMemory(Dock, Toolbar, sizeof(StyleItem));
1371 ReadStyleElement(styleCache, Dock, "slit", false); // -> Backwards compatible with old slit.* style entries
1372 ReadStyleElement(styleCache, Dock, "dock", false);
1373
1374 // Dock gradient-style borders... (experimental from xoblite bb5 RC4)
1375 if (strlen(GetString(NULL, styleCache, "dock.border.", ""))) // dock.border defined?
1376 {
1377 strcpy(dockBorder, "");
1379 ReadStyleElement(styleCache, DockBorder, "dock.border", false);
1380 }
1381 else DockBorder->parentRelative = true; // Disable dock gradient-style borders...
1382
1383 //====================
1384
1385 // Taskbar active, non-active and flashing task buttons... (-> derived from other style elements, so also need to be updated dynamically on Designer Mode changes, hence the separate function)
1387
1388 //====================
1389
1390 // Console...
1391 strcpy(console, toolbar);
1393 CopyMemory(Console, Toolbar, sizeof(StyleItem));
1394 Console->Color = 0x000000;
1395 Console->TextColor = 0xffffff;
1396 strcpy(Console->Font, consoleFont);
1398 Console->FontHeight = consoleFontHeight;
1399 Console->FontWeight = consoleFontWeight;
1400 Console->FontOutline = Console->FontShadow = false;
1401 ReadStyleElement(styleCache, Console, "console", true);
1402
1403 Console->PicColor = GetColor(NULL, styleCache, "console.buttonColor:", NULL, Console->TextColor, true);
1404
1405 //====================
1406
1407 // Window title...
1408 strcpy(windowTitleFocus, toolbar);
1410 CopyMemory(WindowTitleFocus, Toolbar, sizeof(StyleItem));
1411 if (!ToolbarBorder->parentRelative) WindowTitleFocus->borderColor = ToolbarBorder->Color1; // -> Toolbar uses gradient borders, which are not (yet?) supported for WindowTitles, so let's use an approximation as default-if-not-defined borderColor...
1412 ReadStyleElement(styleCache, WindowTitleFocus, "window.title.focus", false);
1413
1416 CopyMemory(WindowTitleUnfocus, WindowTitleFocus, sizeof(StyleItem));
1417 ReadStyleElement(styleCache, WindowTitleUnfocus, "window.title.unfocus", false);
1418
1419 // Window label...
1422 CopyMemory(WindowLabelFocus, ToolbarWindowLabel, sizeof(StyleItem));
1423 strcpy(WindowLabelFocus->Font, wildcardWindowFont);
1424 ReadStyleElement(styleCache, WindowLabelFocus, "window.label.focus", true);
1425
1428 CopyMemory(WindowLabelUnfocus, WindowLabelFocus, sizeof(StyleItem));
1429 ReadStyleElement(styleCache, WindowLabelUnfocus, "window.label.unfocus", true);
1430
1431 // Window buttons...
1434 CopyMemory(WindowButtonFocus, ToolbarButton, sizeof(StyleItem));
1435 strcpy(WindowButtonFocus->Font, WindowLabelFocus->Font); // Since it can be of interest to have further "window" options, we create a hybrid of WindowButtonFocus colours etc and WindowLabelFocus font settings here...
1436// CheckFontSubstitution(WindowButtonFocus->Font);
1437 WindowButtonFocus->FontHeight = WindowLabelFocus->FontHeight;
1438 WindowButtonFocus->FontWeight = WindowLabelFocus->FontWeight;
1439 WindowButtonFocus->TextColor = WindowButtonFocus->PicColor;
1440 WindowButtonFocus->FontOutline = WindowButtonFocus->FontShadow = false;
1441 ReadStyleElement(styleCache, WindowButtonFocus, "window.button.focus", false);
1442
1445 CopyMemory(WindowButtonUnfocus, WindowButtonFocus, sizeof(StyleItem));
1446 strcpy(WindowButtonUnfocus->Font, WindowLabelUnfocus->Font); // ...ditto above...
1447// CheckFontSubstitution(WindowButtonUnfocus->Font);
1448 WindowButtonUnfocus->FontHeight = WindowLabelUnfocus->FontHeight;
1449 WindowButtonUnfocus->FontWeight = WindowLabelUnfocus->FontWeight;
1450 WindowButtonUnfocus->TextColor = WindowButtonUnfocus->PicColor;
1451 WindowButtonUnfocus->FontOutline = WindowButtonUnfocus->FontShadow = false;
1452 ReadStyleElement(styleCache, WindowButtonUnfocus, "window.button.unfocus", false);
1453
1457 strcpy(WindowButtonPressed->Font, WindowButtonFocus->Font); // ...ditto above...
1458// CheckFontSubstitution(WindowButtonPressed->Font);
1459 WindowButtonPressed->FontHeight = WindowButtonFocus->FontHeight;
1460 WindowButtonPressed->FontWeight = WindowButtonFocus->FontWeight;
1461 WindowButtonPressed->TextColor = WindowButtonPressed->PicColor;
1462 WindowButtonPressed->FontOutline = WindowButtonPressed->FontShadow = false;
1463 ReadStyleElement(styleCache, WindowButtonPressed, "window.button.pressed", false);
1464
1465 // Window grips...
1468 CopyMemory(WindowGripFocus, WindowTitleFocus, sizeof(StyleItem));
1469 ReadStyleElement(styleCache, WindowGripFocus, "window.grip.focus", false);
1470
1473 CopyMemory(WindowGripUnfocus, WindowGripFocus, sizeof(StyleItem));
1474 ReadStyleElement(styleCache, WindowGripUnfocus, "window.grip.unfocus", false);
1475
1476 // Window handle...
1479 CopyMemory(WindowHandleFocus, WindowTitleFocus, sizeof(StyleItem));
1480 ReadStyleElement(styleCache, WindowHandleFocus, "window.handle.focus", false);
1481
1484 CopyMemory(WindowHandleUnfocus, WindowHandleFocus, sizeof(StyleItem));
1485 ReadStyleElement(styleCache, WindowHandleUnfocus, "window.handle.unfocus", false);
1486
1487 //====================
1488
1489 // External RGB hardware... (used e.g. by plugins like xControlRGB-Corsair, xControlRGB-LIFX, etc)
1492 CopyMemory(ExternalHardware, ToolbarWindowLabel, sizeof(StyleItem));
1493 ReadStyleElement(styleCache, ExternalHardware, "hardware", false);
1494
1495 //====================
1496
1497 // Text shadows (introduced in xoblite bb2)
1498/*
1499 if (ToolbarLabel->parentRelative) toolbarLabelShadowColor = CreateShadowColor(Toolbar, Toolbar->Color, Toolbar->ColorTo, ToolbarLabel->TextColor);
1500 else toolbarLabelShadowColor = CreateShadowColor(ToolbarLabel, ToolbarLabel->Color, ToolbarLabel->ColorTo, ToolbarLabel->TextColor);
1501 if (ToolbarWindowLabel->parentRelative) toolbarWindowLabelShadowColor = CreateShadowColor(Toolbar, Toolbar->Color, Toolbar->ColorTo, ToolbarWindowLabel->TextColor);
1502 else toolbarWindowLabelShadowColor = CreateShadowColor(ToolbarWindowLabel, ToolbarWindowLabel->Color, ToolbarWindowLabel->ColorTo, ToolbarWindowLabel->TextColor);
1503 if (ToolbarClock->parentRelative) toolbarClockShadowColor = CreateShadowColor(Toolbar, Toolbar->Color, Toolbar->ColorTo, ToolbarClock->TextColor);
1504 else toolbarClockShadowColor = CreateShadowColor(ToolbarClock, ToolbarClock->Color, ToolbarClock->ColorTo, ToolbarClock->TextColor);
1505
1506 menuTitleShadowColor = CreateShadowColor(MenuTitle, MenuTitle->Color, MenuTitle->ColorTo, MenuTitle->TextColor);
1507 menuFrameShadowColor = CreateShadowColor(MenuFrame, MenuFrame->Color, MenuFrame->ColorTo, MenuFrame->TextColor);
1508 if (MenuActive->parentRelative) menuActiveShadowColor = CreateShadowColor(MenuFrame, MenuFrame->Color, MenuFrame->ColorTo, MenuActive->TextColor);
1509 else menuActiveShadowColor = CreateShadowColor(MenuActive, MenuActive->Color, MenuActive->ColorTo, MenuActive->TextColor);
1510*/
1511 //====================
1512
1513 // Finally, a few really old style settings... (nb. for legacy compatibility only -> not intended for general use today -> "pending removal at any time")
1514
1515 if (strlen(GetString(NULL, styleCache, "titleFont:", "")))
1516 {
1517 strcpy(MenuTitle->Font, GetString(NULL, styleCache, "titleFont:", MenuTitle->Font));
1519 }
1520
1521 if (strlen(GetString(NULL, styleCache, "menuFont:", "")))
1522 {
1523 strcpy(MenuFrame->Font, GetString(NULL, styleCache, "menuFont:", MenuFrame->Font));
1525 }
1526
1527 if (strlen(GetString(NULL, styleCache, "titleJustify:", "")))
1528 {
1529 strcpy(temp, GetString(NULL, styleCache, "titleJustify:", ""));
1530 if (IsInString(temp, "Left")) MenuTitle->Justify = DT_LEFT;
1531 else if (IsInString(temp, "Right")) MenuTitle->Justify = DT_RIGHT;
1532 else if (IsInString(temp, "Center")) MenuTitle->Justify = DT_CENTER;
1533 }
1534
1535 if (strlen(GetString(NULL, styleCache, "menuJustify:", "")))
1536 {
1537 strcpy(temp, GetString(NULL, styleCache, "menuJustify:", ""));
1538 if (IsInString(temp, "Left")) MenuFrame->Justify = DT_LEFT;
1539 else if (IsInString(temp, "Right")) MenuFrame->Justify = DT_RIGHT;
1540 else if (IsInString(temp, "Center")) MenuFrame->Justify = DT_CENTER;
1541 }
1542
1543 if (strlen(GetString(NULL, styleCache, "menu.frame.highlightColor:", "")))
1544 {
1545 MenuActive->Color = GetColor(NULL, styleCache, "menu.frame.highlightColor:", "#303030", NULL, false);
1546 MenuActive->ColorTo = MenuActive->Color;
1547 }
1548
1549 if (strlen(GetString(NULL, styleCache, "menu.frame.hiTextColor:", "")))
1550 MenuActive->TextColor = GetColor(NULL, styleCache, "menu.frame.hiTextColor:", NULL, Wildcard->TextColor, true);
1551
1552 if (strlen(GetString(NULL, styleCache, "menu.bulletStyle:", "")))
1553 strcpy(menuFrameBulletAsString, GetString(NULL, styleCache, "menu.bulletStyle:", menuFrameBulletAsString));
1554
1555 if (strlen(GetString(NULL, styleCache, "menu.bulletPosition:", "")))
1556 strcpy(menuBulletPosition, GetString(NULL, styleCache, "menu.bulletPosition:", menuBulletPosition));
1557
1558 //====================
1559
1560 // ###########################################################################################
1561 // ##### Below: xoblite bb5 introduces support for UI scaling for *HiDPI* displays!!! :D #####
1562 // ##### (i.e. user configurable "Regular scale" Non-HiDPI 1x / "Double scale" HiDPI 2x) #####
1563 // ###########################################################################################
1564
1565 if (scalingFactorHiDPI > 1)
1566 {
1573
1574 if (MenuTitle->FontHeight >= 2) MenuTitle->FontHeight *= scalingFactorHiDPI;
1575 MenuFrame->FontHeight *= scalingFactorHiDPI;
1576 MenuActive->FontHeight *= scalingFactorHiDPI;
1577 if (MenuGrip->FontHeight >= 2) MenuGrip->FontHeight *= scalingFactorHiDPI;
1578 Toolbar->FontHeight *= scalingFactorHiDPI;
1579 ToolbarLabel->FontHeight *= scalingFactorHiDPI;
1581 ToolbarClock->FontHeight *= scalingFactorHiDPI;
1582 Console->FontHeight *= scalingFactorHiDPI;
1583 Dock->FontHeight *= scalingFactorHiDPI;
1584 WindowLabelFocus->FontHeight *= scalingFactorHiDPI;
1586
1587 if (MenuTitle->borderWidth > 0) MenuTitle->borderWidth *= scalingFactorHiDPI;
1588 if (MenuFrame->borderWidth > 0) MenuFrame->borderWidth *= scalingFactorHiDPI;
1589 if (MenuActive->borderWidth > 0) MenuActive->borderWidth *= scalingFactorHiDPI;
1590 if (MenuGrip->borderWidth > 0) MenuGrip->borderWidth *= scalingFactorHiDPI;
1591 if (MenuSeparator->borderWidth > 0) MenuSeparator->borderWidth *= scalingFactorHiDPI; // TBD
1592 if (Toolbar->borderWidth > 0) Toolbar->borderWidth *= scalingFactorHiDPI;
1593 if (ToolbarLabel->borderWidth > 0) ToolbarLabel->borderWidth *= scalingFactorHiDPI;
1594 if (ToolbarWindowLabel->borderWidth > 0) ToolbarWindowLabel->borderWidth *= scalingFactorHiDPI;
1595 if (ToolbarClock->borderWidth > 0) ToolbarClock->borderWidth *= scalingFactorHiDPI;
1596 if (ToolbarButton->borderWidth > 0) ToolbarButton->borderWidth *= scalingFactorHiDPI;
1597 if (ToolbarButtonPressed->borderWidth > 0) ToolbarButtonPressed->borderWidth *= scalingFactorHiDPI;
1598 if (Dock->borderWidth > 0) Dock->borderWidth *= scalingFactorHiDPI;
1599 if (WindowTitleFocus->borderWidth > 0) WindowTitleFocus->borderWidth *= scalingFactorHiDPI;
1600 if (WindowTitleUnfocus->borderWidth > 0) WindowTitleUnfocus->borderWidth *= scalingFactorHiDPI;
1601 if (WindowLabelFocus->borderWidth > 0) WindowLabelFocus->borderWidth *= scalingFactorHiDPI;
1602 if (WindowLabelUnfocus->borderWidth > 0) WindowLabelUnfocus->borderWidth *= scalingFactorHiDPI;
1603 if (WindowButtonFocus->borderWidth > 0) WindowButtonFocus->borderWidth *= scalingFactorHiDPI;
1604 if (WindowButtonUnfocus->borderWidth > 0) WindowButtonUnfocus->borderWidth *= scalingFactorHiDPI;
1605 if (WindowButtonPressed->borderWidth > 0) WindowButtonPressed->borderWidth *= scalingFactorHiDPI;
1606 if (WindowGripFocus->borderWidth > 0) WindowGripFocus->borderWidth *= scalingFactorHiDPI;
1607 if (WindowGripUnfocus->borderWidth > 0) WindowGripUnfocus->borderWidth *= scalingFactorHiDPI;
1608 if (WindowHandleFocus->borderWidth > 0) WindowHandleFocus->borderWidth *= scalingFactorHiDPI;
1609 if (WindowHandleUnfocus->borderWidth > 0) WindowHandleUnfocus->borderWidth *= scalingFactorHiDPI;
1610
1611 if (MenuTitle->marginWidth > 0) MenuTitle->marginWidth *= scalingFactorHiDPI;
1612 if (MenuFrame->marginWidth > 0) MenuFrame->marginWidth *= scalingFactorHiDPI;
1613 if (MenuActive->marginWidth > 0) MenuActive->marginWidth *= scalingFactorHiDPI;
1614 if (MenuGrip->marginWidth > 0) MenuGrip->marginWidth *= scalingFactorHiDPI;
1615 if (MenuSeparator->marginWidth > 0) MenuSeparator->marginWidth *= scalingFactorHiDPI; // TBD
1616 if (Toolbar->marginWidth > 0) Toolbar->marginWidth *= scalingFactorHiDPI;
1617 if (ToolbarLabel->marginWidth > 0) ToolbarLabel->marginWidth *= scalingFactorHiDPI;
1618 if (ToolbarWindowLabel->marginWidth > 0) ToolbarWindowLabel->marginWidth *= scalingFactorHiDPI;
1619 if (ToolbarClock->marginWidth > 0) ToolbarClock->marginWidth *= scalingFactorHiDPI;
1620 if (ToolbarButton->marginWidth > 0) ToolbarButton->marginWidth *= scalingFactorHiDPI;
1621 if (ToolbarButtonPressed->marginWidth > 0) ToolbarButtonPressed->marginWidth *= scalingFactorHiDPI;
1622 if (Dock->marginWidth > 0) Dock->marginWidth *= scalingFactorHiDPI;
1623 if (WindowTitleFocus->marginWidth > 0) WindowTitleFocus->marginWidth *= scalingFactorHiDPI;
1624 if (WindowTitleUnfocus->marginWidth > 0) WindowTitleUnfocus->marginWidth *= scalingFactorHiDPI;
1625 if (WindowLabelFocus->marginWidth > 0) WindowLabelFocus->marginWidth *= scalingFactorHiDPI;
1626 if (WindowLabelUnfocus->marginWidth > 0) WindowLabelUnfocus->marginWidth *= scalingFactorHiDPI;
1627 if (WindowButtonFocus->marginWidth > 0) WindowButtonFocus->marginWidth *= scalingFactorHiDPI;
1628 if (WindowButtonUnfocus->marginWidth > 0) WindowButtonUnfocus->marginWidth *= scalingFactorHiDPI;
1629 if (WindowButtonPressed->marginWidth > 0) WindowButtonPressed->marginWidth *= scalingFactorHiDPI;
1630 if (WindowGripFocus->marginWidth > 0) WindowGripFocus->marginWidth *= scalingFactorHiDPI;
1631 if (WindowGripUnfocus->marginWidth > 0) WindowGripUnfocus->marginWidth *= scalingFactorHiDPI;
1632 if (WindowHandleFocus->marginWidth > 0) WindowHandleFocus->marginWidth *= scalingFactorHiDPI;
1633 if (WindowHandleUnfocus->marginWidth > 0) WindowHandleUnfocus->marginWidth *= scalingFactorHiDPI;
1634
1635 // Note: ShadowX+ShadowY offsets are re-calculated adaptively in BBApi.cpp DrawTextWithEffects() instead!
1636 }
1637
1638 //====================
1639
1640 // ### 20210521: Moved to MenuCommon::Configure(), kept here just for short term reference... (to be deleted) ###
1641
1642 // Calculate submenu gap for rounded corner menus...
1643 // (nb. dependence toward the HiDPI adjustments calculated above, so order is important)
1644// if (MenuFrame->borderWidth > 0) submenuGap = (MenuFrame->borderWidth * 2); // Note: Use borderWidth*2 due to how menu borders overlap for non-rounded menus!
1645// else if (MenuFrame->marginWidth > 0) submenuGap = MenuFrame->marginWidth;
1646// else if (scalingFactorHiDPI > 1) submenuGap = scalingFactorHiDPI * 2;
1647// else submenuGap = 2;
1648
1649 //====================
1650/*
1651 if (debugLogging)
1652 {
1653 if (Toolbar->FontShadow) Log("Toolbar shadows enabled!", "");
1654 else if (ToolbarLabel->FontShadow) Log("ToolbarLabel shadows enabled!", "");
1655 else if (ToolbarWindowLabel->FontShadow) Log("ToolbarWindowLabel shadows enabled!", "");
1656 else if (ToolbarClock->FontShadow) Log("ToolbarClock shadows enabled!", "");
1657 else if (MenuTitle->FontShadow) Log("MenuTitle shadows enabled!", "");
1658
1659 if (Toolbar->FontOutline) Log("Toolbar outlines enabled!", "");
1660 else if (ToolbarLabel->FontOutline) Log("ToolbarLabel outlines enabled!", "");
1661 else if (ToolbarWindowLabel->FontOutline) Log("ToolbarWindowLabel outlines enabled!", "");
1662 else if (ToolbarClock->FontOutline) Log("ToolbarClock outlines enabled!", "");
1663 else if (MenuTitle->FontOutline) Log("MenuTitle outlines enabled!", "");
1664 }
1665*/
1666 //====================
1667
1668 // Free memory allocated for the style buffer...
1670}
bool IsInString(LPCSTR inputString, LPCSTR searchString)
Definition BBApi.cpp:2519
void CheckFontSubstitution(LPSTR font)
Definition BBApi.cpp:2706
void CreateElementImage(StyleItem *styleItem)
Definition BBApi.cpp:2303
#define B_VERTICAL
Definition BBApi.h:73
#define B_MIRRORHORIZONTAL
Definition BBApi.h:95
#define B_HORIZONTAL
Definition BBApi.h:72
#define B_SPLITSOLID
Definition BBApi.h:88
#define B_SPLITHORIZONTAL
Definition BBApi.h:86
#define B_SUPERVERTICAL
Definition BBApi.h:92
#define B_SPLITVERTICAL
Definition BBApi.h:87
#define B_PARENTRELATIVE
Definition BBApi.h:69
#define B_SUPERHORIZONTAL
Definition BBApi.h:91
#define MENU_BULLET_TRIPLE
Definition Settings.h:59
#define MENU_BULLET_COMMENT
Definition Settings.h:60
#define MENU_BULLET_SQUARE
Definition Settings.h:56
#define MENU_BULLET_QUAD
Definition Settings.h:62
#define MENU_BULLET_DIAMOND
Definition Settings.h:55
#define MENU_BULLET_CIRCLE
Definition Settings.h:58
#define MENU_BULLET_EMPTY
Definition Settings.h:54
#define MENU_BULLET_TRIANGLE
Definition Settings.h:57
#define MENU_BULLET_IMAGE
Definition Settings.h:63
#define MENU_BULLET_GRID
Definition Settings.h:61
char windowGripFocus[MAX_LINE_LENGTH]
Definition Settings.h:506
char toolbarButton[MAX_LINE_LENGTH]
Definition Settings.h:486
char wildcardWindowFont[255]
Definition Settings.h:478
char dock[MAX_LINE_LENGTH]
Definition Settings.h:496
char wildcard[MAX_LINE_LENGTH]
Definition Settings.h:481
char windowGripUnfocus[MAX_LINE_LENGTH]
Definition Settings.h:507
char rootCommand[MAX_LINE_LENGTH]
Definition Settings.h:570
char windowButtonUnfocus[MAX_LINE_LENGTH]
Definition Settings.h:504
char menuFrame[MAX_LINE_LENGTH]
Definition Settings.h:490
char externalHardware[MAX_LINE_LENGTH]
Definition Settings.h:510
char toolbar[MAX_LINE_LENGTH]
Definition Settings.h:482
char windowHandleUnfocus[MAX_LINE_LENGTH]
Definition Settings.h:509
char menuGrip[MAX_LINE_LENGTH]
Definition Settings.h:492
void DeriveTaskbarStyle()
Definition Settings.cpp:2101
char windowTitleUnfocus[MAX_LINE_LENGTH]
Definition Settings.h:500
char dockBorder[MAX_LINE_LENGTH]
Definition Settings.h:497
char menuActiveBulletAsString[MAX_LINE_LENGTH]
Definition Settings.h:541
char windowButtonPressed[MAX_LINE_LENGTH]
Definition Settings.h:505
char windowTitleFocus[MAX_LINE_LENGTH]
Definition Settings.h:499
char toolbarClock[MAX_LINE_LENGTH]
Definition Settings.h:485
char menuFrameBulletAsString[MAX_LINE_LENGTH]
Definition Settings.h:540
char console[MAX_LINE_LENGTH]
Definition Settings.h:498
int menuBorderWidth
Definition Settings.h:560
char wildcardMenuFont[255]
Definition Settings.h:477
char windowButtonFocus[MAX_LINE_LENGTH]
Definition Settings.h:503
int menuBullet
Definition Settings.h:539
char toolbarButtonPressed[MAX_LINE_LENGTH]
Definition Settings.h:487
bool ReadStyleElement(LPSTR styleBuffer, StyleItem *styleItem, LPSTR paramString, bool readFont)
Definition Settings.cpp:1677
char windowLabelUnfocus[MAX_LINE_LENGTH]
Definition Settings.h:502
char menuActive[MAX_LINE_LENGTH]
Definition Settings.h:491
char windowHandleFocus[MAX_LINE_LENGTH]
Definition Settings.h:508
char toolbarWindowLabel[MAX_LINE_LENGTH]
Definition Settings.h:484
char menuTitle[MAX_LINE_LENGTH]
Definition Settings.h:489
char menuIndicator[MAX_LINE_LENGTH]
Definition Settings.h:493
char wildcardToolbarFont[255]
Definition Settings.h:476
char toolbarLabel[MAX_LINE_LENGTH]
Definition Settings.h:483
COLORREF menuBorderColor
Definition Settings.h:562
LPSTR appearancePointer
Definition Settings.h:511
char * styleCache
Definition Settings.h:416
char windowLabelFocus[MAX_LINE_LENGTH]
Definition Settings.h:501
char toolbarBorder[MAX_LINE_LENGTH]
Definition Settings.h:488
int marginWidth
Definition Settings.h:565
char menuSeparator[MAX_LINE_LENGTH]
Definition Settings.h:494
char menuFrameBorder[MAX_LINE_LENGTH]
Definition Settings.h:495
char menuBulletPosition[MAX_LINE_LENGTH]
Definition Settings.h:542

◆ ReadStyleElement()

bool Settings::ReadStyleElement ( LPSTR styleBuffer,
StyleItem * styleItem,
LPSTR paramString,
bool readFont )
1678{
1679 char temp[MAX_LINE_LENGTH], param[MAX_LINE_LENGTH];
1680 bool bb4nix070syntax = false;
1681
1682 strcpy(param, paramString);
1683 int nLen = strlen(param);
1684
1685 //====================
1686
1687 // Appearance... (i.e. flat/raised/sunken, solid/gradient, bevel type, etc)
1688 // (Note: The appearance *string* is later used also by the style memory caching mechanism;
1689 // hence we need to save it for later here even if not further used by the StyleItem parser below.)
1690 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".appearance:");
1691 if (strlen(GetString(NULL, styleCache, param, ""))) bb4nix070syntax = true;
1692 strcpy(temp, GetString(NULL, styleCache, param, appearancePointer));
1693 strcpy_s(&param[nLen], (sizeof(param)-nLen), ":");
1694 strcpy_s(appearancePointer, MAX_LINE_LENGTH, GetString(NULL, styleCache, param, temp));
1695 ParseItem(appearancePointer, styleItem);
1696
1697 //====================
1698
1699 // Below: Any previously existing bitmap for this particular element have already been destroyed through a prior call to InitStyleItems() from ReadStyle() above,
1700 // but we may have inherited a pointer to another element's bitmap as part of a CopyMemory of its StyleItem information, and hence it's OK to set it back to NULL here.
1701 styleItem->Image.bitmap = NULL;
1702
1703 // Is an image to be used instead of a regular *box gradient? (nb. we perform this check first to be able to fallback to the latter if needed)
1704 if (styleItem->type == B_IMAGEFROMFILE)
1705 {
1706 if (strchr(appearancePointer, '\\'))
1707 {
1708 // -> Image path specified directly in .appearance... (nb. the backslash character is not otherwise used in regular *box style .appearance strings)
1709// strncpy(styleItem->Image.path, appearancePointer, MAX_PATH);
1710 strncpy_s(styleItem->Image.path, sizeof(styleItem->Image.path), appearancePointer, _TRUNCATE);
1711 }
1712 else
1713 {
1714 // -> Image path specified in separate .image parameter...
1715 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".image:");
1716// strncpy(styleItem->Image.path, GetString(NULL, styleCache, param, ""), MAX_PATH);
1717 strncpy_s(styleItem->Image.path, sizeof(styleItem->Image.path), GetString(NULL, styleCache, param, ""), _TRUNCATE);
1718
1719// if (strchr(appearancePointer, '/'))
1720// {
1721// SendMessage(GetBBWnd(), BB_CONSOLEMESSAGE, (WPARAM)CONSOLE_INFORMATION_MESSAGE, (LPARAM)strchr(appearancePointer, '/'));
1722// }
1723 }
1724 styleItem->Image.path[sizeof(styleItem->Image.path)-1] = '\0'; // Failsafe
1725
1726 if (strchr(styleItem->Image.path, '\"')) StrRemoveEncap((LPSTR)styleItem->Image.path);
1727 if (strchr(styleItem->Image.path, '$')) ReplaceShellFolders((LPSTR)styleItem->Image.path);
1728 if (strchr(styleItem->Image.path, '%')) ReplaceEnvVars((LPSTR)styleItem->Image.path);
1729
1730 styleItem->Image.width = styleItem->Image.height = styleItem->Image.left = styleItem->Image.top = styleItem->Image.right = styleItem->Image.bottom = 0; // ### TEMPORARY HERE, TO BE MOVED INTO IF() BELOW ###
1731
1732 // ...if so, let's check if the image file exists.. (and if not, fallback to a solid background)
1733 if (FileExists(styleItem->Image.path))
1734 {
1735// if (debugLogging) SendMessage(GetBBWnd(), BB_CONSOLEMESSAGE, (WPARAM)CONSOLE_WARNING_MESSAGE, (LPARAM)styleItem->Image.path);
1736 CreateElementImage(styleItem);
1737/*
1738 // Load the image using GDI+ to add support for JPG, PNG etc...
1739 // (nb. regular GDI LoadImage() only supports BMP images. GDI+ startup/shutdown is performed elsewhere here in MenuCommon.)
1740 wchar_t imagePathWC[MAX_PATH];
1741 MultiByteToWideChar(CP_ACP, 0, styleItem->Image.path, strlen(styleItem->Image.path)+1, imagePathWC, MAX_PATH);
1742 Bitmap* bitmap = new Bitmap(imagePathWC, FALSE);
1743 styleItem->Image.width = bitmap->GetWidth();
1744 styleItem->Image.height = bitmap->GetHeight();
1745// SetRect(&menuImage->edges, 0, 0, 0, 0);
1746 if ((pf == PixelFormat32bppARGB) || (pf == PixelFormat32bppPARGB) || (pf == PixelFormat64bppARGB) || (pf == PixelFormat64bppPARGB)) styleItem->Image.argb = true;
1747 else styleItem->Image.argb = false;
1748 bitmap->GetHBITMAP(0, &styleItem->Image.bitmap); // Create our target GDI HBITMAP from the loaded GDI+ Bitmap...
1749 delete bitmap;
1750*/
1751 }
1752 else styleItem->type = B_SOLID; // Fallback
1753 }
1754
1755 //====================
1756
1757 // Border...
1758 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".borderColor:");
1759 styleItem->borderColor = GetColor(NULL, styleCache, param, NULL, styleItem->borderColor, true);
1760 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".borderWidth:");
1761 styleItem->borderWidth = GetInt(NULL, styleCache, param, styleItem->borderWidth);
1762
1763 if (bb4nix070syntax)
1764 {
1765 if (IsInString(appearancePointer, "border")) // If the border tag is set we always draw the border, regardless of whether borderWidth was explicitly defined or inherited...
1766 {
1767 styleItem->bordered = true;
1768 }
1769 else
1770 {
1771 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".borderWidth:");
1772 if (strlen(GetString(NULL, styleCache, param, ""))) // If borderWidth was explicitly defined for this element we disregard the border tag... (i.e. "forgiving" parsing)
1773 {
1774 styleItem->bordered = true;
1775 }
1776// else // Do not draw the border if borderWidth was inherited and the border tag was not set...
1777// {
1778// styleItem->bordered = false;
1779// styleItem->borderWidth = 0;
1780// }
1781 }
1782 }
1783 else
1784 {
1785 if (styleItem->borderWidth > 0) styleItem->bordered = true;
1786// else styleItem->bordered = false;
1787 }
1788
1789// if (IsInString(appearancePointer, "border")) styleItem->bordered = true;
1790// else if (strlen(GetString(NULL, styleCache, param, ""))) styleItem->bordered = true;
1791
1792 //====================
1793
1794 // Margin...
1795 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".marginWidth:");
1796 styleItem->marginWidth = GetInt(NULL, styleCache, param, styleItem->marginWidth);
1797
1798 //====================
1799
1800 // Colours...
1801
1802 COLORREF tempColor;
1803
1804 if (!strchr(appearancePointer, '\\') && IsInString(appearancePointer, "auto"))
1805 {
1806 COLORREF colorAutoPicked;
1807 int randomPixelX, randomPixelY;
1808 // srand((unsigned int)time(NULL)); // Provide a seed for pseudorandom number generation... (nb. this is already done in Blackbox.cpp, so not needed here!)
1809
1810 RECT workArea;
1811 SystemParametersInfo(SPI_GETWORKAREA, 0, (PVOID)&workArea, SPIF_SENDCHANGE); // Get the dimensions of the screen's work area...
1812 int workAreaWidth = workArea.right - workArea.left;
1813 int workAreaHeight = workArea.bottom - workArea.top;
1814
1815 HDC hdc = GetDC(GetDesktopWindow()); // Get the HDC of the Windows desktop window...
1816
1817 for (int n = 1; n <= 8; n++)
1818 {
1819 randomPixelX = (rand() % workAreaWidth); // Select a random X position across the screen's work area width...
1820 randomPixelY = (rand() % workAreaHeight); // ..and a random Y position across the screen's work area height...
1821 colorAutoPicked = GetPixel(hdc, workArea.left+randomPixelX, workArea.top+randomPixelY); // Pick the colour of the pixel at the random X/Y position...
1822 if (colorAutoPicked == CLR_INVALID) continue; // Failsafe
1823
1824 switch (n)
1825 {
1826 // ...for each of the up to 8 colours per style element...
1827 case 1: {styleItem->Color1 = colorAutoPicked; break; }
1828 case 2: {styleItem->Color2 = colorAutoPicked; break; }
1829 case 3: {styleItem->Color3 = colorAutoPicked; break; }
1830 case 4: {styleItem->Color4 = colorAutoPicked; break; }
1831 case 5: {styleItem->Color5 = colorAutoPicked; break; }
1832 case 6: {styleItem->Color6 = colorAutoPicked; break; }
1833 case 7: {styleItem->Color7 = colorAutoPicked; break; }
1834 case 8: {styleItem->Color8 = colorAutoPicked; break; }
1835 }
1836 }
1837
1838 ReleaseDC(NULL, hdc);
1839 DeleteDC(hdc);
1840 }
1841 else
1842 {
1843 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".backgroundColor:");
1844 tempColor = GetColor(NULL, styleCache, param, NULL, styleItem->Color1, true);
1845 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".color1:");
1846 tempColor = GetColor(NULL, styleCache, param, NULL, tempColor, true);
1847 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".color:");
1848 styleItem->Color1 = GetColor(NULL, styleCache, param, NULL, tempColor, true);
1849
1850 if (styleItem->type == B_SOLID) styleItem->Color2 = styleItem->Color1; // (...just in case, cf. legacy 2-colour API aspects?)
1851 else
1852 {
1853 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".color2:");
1854 tempColor = GetColor(NULL, styleCache, param, NULL, styleItem->Color2, true);
1855 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".colorTo:");
1856 styleItem->Color2 = GetColor(NULL, styleCache, param, NULL, tempColor, true);
1857 }
1858
1859 if ((styleItem->type >= B_SPLITHORIZONTAL) && (styleItem->type < B_MIRRORHORIZONTAL)) // 4-colour split or 8-colour super gradient being used?
1860 {
1861 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".color.splitTo:");
1862 if (((styleItem->type == B_SPLITHORIZONTAL) || (styleItem->type == B_SPLITVERTICAL)) && strlen(GetString(NULL, styleCache, param, "")))
1863 {
1864 // -> The style is using the fugly old
1865 // 4-colour split gradient ".splitTo" syntax... :(
1866
1867 styleItem->Color3 = styleItem->Color2;
1868 styleItem->Color2 = styleItem->Color1;
1869
1870 int sr, sg, sb;
1871
1872 sr = GetRValue(styleItem->Color2);
1873 sg = GetGValue(styleItem->Color2);
1874 sb = GetBValue(styleItem->Color2);
1875 sr += sr >> 2;
1876 sg += sg >> 2;
1877 sb += sb >> 2;
1878 if (sr>0xff) sr = 0xff;
1879 if (sg>0xff) sg = 0xff;
1880 if (sb>0xff) sb = 0xff;
1881 styleItem->Color1 = RGB(sr,sg,sb);
1882
1883 sr = GetRValue(styleItem->Color3);
1884 sg = GetGValue(styleItem->Color3);
1885 sb = GetBValue(styleItem->Color3);
1886 sr += sr >> 4;
1887 sg += sg >> 4;
1888 sb += sb >> 4;
1889 if (sr>0xff) sr = 0xff;
1890 if (sg>0xff) sg = 0xff;
1891 if (sb>0xff) sb = 0xff;
1892 styleItem->Color4 = RGB(sr,sg,sb);
1893
1894 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".color.splitTo:");
1895 styleItem->Color1 = GetColor(NULL, styleCache, param, NULL, styleItem->Color1, true);
1896 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".colorTo.splitTo:");
1897 styleItem->Color4 = GetColor(NULL, styleCache, param, NULL, styleItem->Color4, true);
1898 }
1899 else
1900 {
1901 // -> The style is using the more flexible newer .color1-4/8 syntax... :D
1902
1903 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".color3:");
1904 styleItem->Color3 = GetColor(NULL, styleCache, param, NULL, styleItem->Color3, true);
1905 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".color4:");
1906 styleItem->Color4 = GetColor(NULL, styleCache, param, NULL, styleItem->Color4, true);
1907
1908 if (styleItem->type >= B_SUPERHORIZONTAL) // 8-colour super gradient being used...
1909 {
1910 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".color5:");
1911 styleItem->Color5 = GetColor(NULL, styleCache, param, NULL, styleItem->Color5, true);
1912 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".color6:");
1913 styleItem->Color6 = GetColor(NULL, styleCache, param, NULL, styleItem->Color6, true);
1914 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".color7:");
1915 styleItem->Color7 = GetColor(NULL, styleCache, param, NULL, styleItem->Color7, true);
1916 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".color8:");
1917 styleItem->Color8 = GetColor(NULL, styleCache, param, NULL, styleItem->Color8, true);
1918 }
1919 /*
1920 if (styleItem->type < B_SUPERHORIZONTAL) // 4-colour split gradient being used...
1921 {
1922 // Re-order the colours from "1234" to "2314"
1923 // to allow for limited forward compatibility
1924 // for MakeGradient (i.e. even if MakeGradient
1925 // does not support 4 input colours it will
1926 // fall back to a 2 input colour split gradient)
1927
1928 tempColor = styleItem->Color3;
1929 styleItem->Color3 = styleItem->Color1;
1930 styleItem->Color1 = styleItem->Color2;
1931 styleItem->Color2 = tempColor;
1932 }
1933 else // 8-colour super gradient being used...
1934 {
1935 // ...for now, I won't bother trying to squeeze forward compatibility
1936 // for MakeGradient into the mix in here as well... (at some point it just becomes ugly)
1937 }
1938 */
1939 }
1940 }
1941 }
1942
1943 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".textColor:");
1944 styleItem->TextColor = GetColor(NULL, styleCache, param, NULL, styleItem->TextColor, true);
1945
1946/*
1947 // #########################################################################
1948 // As the following colour parameters are (1) only used by a few StyleItems,
1949 // and (2) sometimes overloaded (menu.active/hilite), we do *not* parse them
1950 // here but manually in ReadStyle() for applicable items intstead, see above
1951 // #########################################################################
1952 // The following colour parameters are used interchangeably for similar things so let's parse them together...
1953 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".foregroundColor:");
1954 if (styleItem->foregroundColor == COLOR_UNDEFINED) tempColor = GetColor(NULL, styleCache, param, NULL, styleItem->TextColor, true); // First read: Default value -> Same as TextColor
1955 else tempColor = GetColor(NULL, styleCache, param, NULL, styleItem->foregroundColor, true); // Subsequent reads: Default value -> Inherited value from previous set/read action
1956 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".bulletColor:");
1957 tempColor = GetColor(NULL, styleCache, param, NULL, tempColor, true);
1958 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".picColor:");
1959 styleItem->foregroundColor = GetColor(NULL, styleCache, param, NULL, tempColor, true);
1960*/
1961 if (styleItem == MenuFrame)
1962 {
1963 // menu.frame.disabledColor -> Disabled text color (i.e. menu [nop] items)
1964 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".disabledColor:");
1965 styleItem->disabledColor = GetColor(NULL, styleCache, param, NULL, styleItem->TextColor, true);
1966 }
1967
1968 if ((styleItem == ToolbarButton) || (styleItem == ToolbarButtonPressed) ||
1969 (styleItem == WindowButtonFocus) || (styleItem == WindowButtonUnfocus) || (styleItem == WindowButtonPressed))
1970 {
1971 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".foregroundColor:");
1972 tempColor = GetColor(NULL, styleCache, param, NULL, styleItem->PicColor, true);
1973 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".picColor:");
1974 styleItem->PicColor = GetColor(NULL, styleCache, param, NULL, tempColor, true);
1975 }
1976
1977 //====================
1978
1979 // Font...
1980 if (readFont)
1981 {
1982 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".font:");
1983 strcpy(temp, GetString(NULL, styleCache, param, styleItem->Font));
1984
1985 if (strchr(temp, '/')) // -> The font was defined using a single .font: Font/Size/WeightFlags property, e.g. "Segoe UI/15/BoldShadow"
1986 {
1987 // ParseFontString(temp, styleItem); // Note: We can *not* use this BBAPI function here as it does not allow for the multi-pass parsing we may require here in Settings.
1988
1989 // Extract the font...
1990 strcpy(temp, Tokenize(temp, styleItem->Font, "/"));
1991 CheckFontSubstitution(styleItem->Font);
1992
1993 if (strlen(temp))
1994 {
1995 // Extract the font size...
1996 char height[MAX_LINE_LENGTH];
1997 strcpy(temp, Tokenize(temp, height, "/"));
1998 if (atoi(height) > 0) styleItem->FontHeight = atoi(height);
1999
2000 if (strlen(temp))
2001 {
2002 // Extract the font weight + any outline and/or shadow flags...
2003 if (IsInString(temp, "Normal")) styleItem->FontWeight = FW_NORMAL;
2004 if (IsInString(temp, "Bold")) styleItem->FontWeight = FW_BOLD;
2005 if (IsInString(temp, "Outline")) styleItem->FontOutline = true;
2006 if (IsInString(temp, "Shadow")) styleItem->FontShadow = true;
2007 }
2008 }
2009 }
2010 else // -> The font was defined using separate properties, i.e. .font, .fontHeight, .fontWeight
2011 {
2013 strcpy(styleItem->Font, temp);
2014
2015 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".fontHeight:");
2016 styleItem->FontHeight = GetInt(NULL, styleCache, param, styleItem->FontHeight);
2017
2018 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".fontWeight:");
2019 strcpy(temp, GetString(NULL, styleCache, param, "Normal"));
2020 if (IsInString(temp, "Bold")) styleItem->FontWeight = FW_BOLD;
2021 else styleItem->FontWeight = FW_NORMAL;
2022
2023 if (IsInString(temp, "Outline")) styleItem->FontOutline = true;
2024 if (IsInString(temp, "Shadow")) styleItem->FontShadow = true;
2025 }
2026/*
2027 if (globalFontOverride)
2028 {
2029 // ##### Q: SHOULD WE ALSO ADD THE OPTION OF HAVING A GLOBAL FONT OVERRIDE? (READ: JUST AN IDEA, TO BE DECIDED...) #####
2030 strcpy(styleItem->Font, globalFont);
2031 styleItem->FontHeight = globalFontHeight;
2032 // Note: We still allow style-defined font *weights* even if font+size override is used!
2033 }
2034*/
2035 //====================
2036
2037 // Text alignment/justify...
2038 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".alignment:");
2039 strcpy(temp, GetString(NULL, styleCache, param, ""));
2040 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".justify:");
2041 strcpy(temp, GetString(NULL, styleCache, param, temp));
2042
2043 if (IsInString(temp, "Left")) styleItem->Justify = DT_LEFT;
2044 else if (IsInString(temp, "Right")) styleItem->Justify = DT_RIGHT;
2045 else if (IsInString(temp, "Center")) styleItem->Justify = DT_CENTER;
2046 // -> else use inherited alignment...
2047
2048 //====================
2049
2050 // Note#1: Font outlines and shadows can be automatically enabled using either the "Outline" and "Shadow" font tags respectively (see above),
2051 // or manually enabled and configured by specifying .outlineColor and/or .shadowColor for the given element.
2052 // Note#2: ...and due to this dependency, we also need to check for the latter *AFTER* having parsed the font properties above!
2053
2054 // Font outlines...
2055 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".outlineColor:");
2056 if (strlen(GetString(NULL, styleCache, param, "")))
2057 {
2058 // An outline colour *has* been specified and outlines should therefore be enabled...
2059 styleItem->FontOutline = true;
2060 styleItem->OutlineColor = GetColor(NULL, styleCache, param, NULL, styleItem->OutlineColor, true);
2061 }
2062 else if (styleItem->FontOutline && (styleItem->OutlineColor == COLOR_UNDEFINED))
2063 {
2064 // An outline colour has *not* been specified but the "Outline" font tag has been set, so let's calculate a default outline colour instead...
2065 styleItem->OutlineColor = CreateShadowColor(styleItem, styleItem->Color1, styleItem->Color2, styleItem->TextColor);
2066 }
2067
2068 // Font shadows...
2069 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".shadowColor:");
2070 if (strlen(GetString(NULL, styleCache, param, "")))
2071 {
2072 // A shadow colour *has* been specified and shadows should therefore be enabled...
2073 styleItem->FontShadow = true;
2074 styleItem->ShadowColor = GetColor(NULL, styleCache, param, NULL, styleItem->ShadowColor, true);
2075 }
2076 else if (styleItem->FontShadow && (styleItem->ShadowColor == COLOR_UNDEFINED))
2077 {
2078 // A shadow colour has *not* been specified but the "Shadow" font tag has been set, so let's calculate a default shadow colour instead...
2079 if (styleItem->FontOutline) styleItem->ShadowColor = CreateShadowColor(styleItem, styleItem->Color1, styleItem->Color2, styleItem->OutlineColor);
2080 else styleItem->ShadowColor = CreateShadowColor(styleItem, styleItem->Color1, styleItem->Color2, styleItem->TextColor);
2081 }
2082
2083 // Default text shadow offsets at non-HiDPI is 1 pixels to the right and below the text itself...
2084 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".shadowX:");
2085 styleItem->ShadowX = GetInt(NULL, styleCache, param, 1);
2086// if (styleItem->ShadowX > 2) styleItem->ShadowX = 2;
2087// if (styleItem->ShadowX < -2) styleItem->ShadowX = -2;
2088 strcpy_s(&param[nLen], (sizeof(param)-nLen), ".shadowY:");
2089 styleItem->ShadowY = GetInt(NULL, styleCache, param, 1);
2090// if (styleItem->ShadowY > 2) styleItem->ShadowY = 2;
2091// if (styleItem->ShadowY < -2) styleItem->ShadowY = -2;
2092 }
2093
2094 //====================
2095
2096 return bb4nix070syntax;
2097}
LPSTR Tokenize(LPCSTR string, LPSTR buf, LPSTR delims)
Definition BBApi.cpp:273
void ParseItem(LPCSTR szItem, StyleItem *item)
Definition BBApi.cpp:2541
#define B_IMAGEFROMFILE
Definition BBApi.h:83
COLORREF CreateShadowColor(StyleItem *styleItem, COLORREF color, COLORREF colorTo, COLORREF textColor)
Definition Settings.cpp:2185
char ShadowX
Definition BBApi.h:426
char ShadowY
Definition BBApi.h:426

◆ DeriveTaskbarStyle()

void Settings::DeriveTaskbarStyle ( )
2102{
2103 // Taskbar active task button... (-> derived from other style elements)
2104
2105 if (!ToolbarWindowLabel->parentRelative)
2106 {
2107 CopyMemory(ActiveTask, ToolbarWindowLabel, sizeof(StyleItem));
2109// else ActiveTask->ShadowColor = CreateShadowColor(ToolbarWindowLabel, ToolbarWindowLabel->Color, ToolbarWindowLabel->ColorTo, ToolbarWindowLabel->TextColor);
2110 }
2111 else if (!ToolbarLabel->parentRelative)
2112 {
2113 CopyMemory(ActiveTask, ToolbarLabel, sizeof(StyleItem));
2114 if (ActiveTask->type == B_ELLIPTIC) ActiveTask->ShadowColor = CreateShadowColor(ToolbarLabel, ToolbarLabel->ColorTo, ToolbarLabel->Color, ToolbarLabel->TextColor);
2115// else ActiveTask->ShadowColor = CreateShadowColor(ToolbarLabel, ToolbarLabel->Color, ToolbarLabel->ColorTo, ToolbarLabel->TextColor);
2116 }
2117 else if (!ToolbarClock->parentRelative)
2118 {
2119 CopyMemory(ActiveTask, ToolbarClock, sizeof(StyleItem));
2120 if (ActiveTask->type == B_ELLIPTIC) ActiveTask->ShadowColor = CreateShadowColor(ToolbarClock, ToolbarClock->ColorTo, ToolbarClock->Color, ToolbarClock->TextColor);
2121// else ActiveTask->ShadowColor = CreateShadowColor(ToolbarClock, ToolbarClock->Color, ToolbarClock->ColorTo, ToolbarClock->TextColor);
2122 }
2123 else
2124 {
2125 CopyMemory(ActiveTask, Toolbar, sizeof(StyleItem));
2126 ActiveTask->TextColor = ToolbarWindowLabel->TextColor;
2127// ActiveTask->FontShadow = ToolbarWindowLabel->FontShadow;
2128 if (ActiveTask->type == B_ELLIPTIC) ActiveTask->ShadowColor = CreateShadowColor(Toolbar, Toolbar->ColorTo, Toolbar->Color, ToolbarWindowLabel->TextColor);
2129 else ActiveTask->ShadowColor = CreateShadowColor(Toolbar, Toolbar->Color, Toolbar->ColorTo, ToolbarWindowLabel->TextColor);
2130// ActiveTask->FontOutline = ToolbarWindowLabel->FontOutline;
2131// ActiveTask->OutlineColor = ToolbarWindowLabel->OutlineColor;
2132 }
2133
2134 if (ActiveTask->borderWidth > 1) ActiveTask->borderWidth = 1;
2135
2136 //====================
2137
2138 // Taskbar non-active task buttons... (-> derived from other style elements)
2139
2140 CopyMemory(InactiveTask, Toolbar, sizeof(StyleItem));
2141
2142 if (ToolbarWindowLabel->parentRelative)
2143 {
2144 InactiveTask->TextColor = ToolbarWindowLabel->TextColor;
2145 InactiveTask->ShadowColor = CreateShadowColor(Toolbar, Toolbar->Color, Toolbar->ColorTo, ToolbarWindowLabel->TextColor);
2146 }
2147 else if (ToolbarLabel->parentRelative)
2148 {
2149 InactiveTask->TextColor = ToolbarLabel->TextColor;
2150 InactiveTask->ShadowColor = CreateShadowColor(Toolbar, Toolbar->Color, Toolbar->ColorTo, ToolbarLabel->TextColor);
2151 }
2152 else if (ToolbarClock->parentRelative)
2153 {
2154 InactiveTask->TextColor = ToolbarClock->TextColor;
2155 InactiveTask->ShadowColor = CreateShadowColor(Toolbar, Toolbar->Color, Toolbar->ColorTo, ToolbarClock->TextColor);
2156 }
2157 else if (ToolbarButton->parentRelative)
2158 {
2159 InactiveTask->TextColor = ToolbarButton->PicColor;
2160 InactiveTask->ShadowColor = CreateShadowColor(Toolbar, Toolbar->Color, Toolbar->ColorTo, ToolbarButton->PicColor);
2161 }
2162 else
2163 {
2164 InactiveTask->TextColor = Toolbar->TextColor;
2165 InactiveTask->ShadowColor = CreateShadowColor(Toolbar, Toolbar->Color, Toolbar->ColorTo, Toolbar->TextColor);
2166 }
2167
2168 if (InactiveTask->borderWidth > 1) InactiveTask->borderWidth = 1;
2169
2170 //====================
2171
2172 // Flashing task buttons... (-> inverted variations of the active task button colours)
2173 FlashingTask->Color = InvertColor(ActiveTask->ColorTo);
2174 FlashingTask->ColorTo = InvertColor(ActiveTask->Color);
2175 FlashingTask->Color3 = InvertColor(ActiveTask->Color4);
2176 FlashingTask->Color4 = InvertColor(ActiveTask->Color3);
2177 FlashingTask->TextColor = InvertColor(ActiveTask->TextColor);
2178 FlashingTask->ShadowColor = InvertColor(ActiveTask->ShadowColor);
2179 FlashingTask->OutlineColor = InvertColor(ActiveTask->OutlineColor);
2180 FlashingTask->borderColor = InvertColor(ActiveTask->borderColor);
2181}
#define B_ELLIPTIC
Definition BBApi.h:77
COLORREF InvertColor(COLORREF color)
Definition Settings.cpp:2221

◆ CreateShadowColor()

COLORREF Settings::CreateShadowColor ( StyleItem * styleItem,
COLORREF color,
COLORREF colorTo,
COLORREF textColor )
2186{
2187 BYTE r = GetRValue(color);
2188 BYTE g = GetGValue(color);
2189 BYTE b = GetBValue(color);
2190 BYTE rto = GetRValue(colorTo);
2191 BYTE gto = GetGValue(colorTo);
2192 BYTE bto = GetBValue(colorTo);
2193
2194 int rav, gav, bav;
2195
2196 if (styleItem->type != B_SOLID)
2197 {
2198 rav = (r+rto) / 2;
2199 gav = (g+gto) / 2;
2200 bav = (b+bto) / 2;
2201 }
2202 else
2203 {
2204 rav = r;
2205 gav = g;
2206 bav = b;
2207 }
2208
2209 if (rav < 0x10) rav = 0;
2210 else rav -= 0x10;
2211 if (gav < 0x10) gav = 0;
2212 else gav -= 0x10;
2213 if (bav < 0x10) bav = 0;
2214 else bav -= 0x10;
2215
2216 return RGB((BYTE)rav, (BYTE)gav, (BYTE)bav);
2217}

◆ InvertColor()

COLORREF Settings::InvertColor ( COLORREF color)
2222{
2223 red = 0xff - GetRValue(color);
2224 green = 0xff - GetGValue(color);
2225 blue = 0xff - GetBValue(color);
2226 return RGB((BYTE)blue, (BYTE)green, (BYTE)red);
2227}
BYTE blue
Definition Settings.h:579
BYTE red
Definition Settings.h:579
BYTE green
Definition Settings.h:579

◆ MixColors()

COLORREF Settings::MixColors ( COLORREF colorA,
COLORREF colorB )
2232{
2233 BYTE rt = GetRValue(colorA);
2234 BYTE gt = GetGValue(colorA);
2235 BYTE bt = GetBValue(colorA);
2236 BYTE rb = GetRValue(colorB);
2237 BYTE gb = GetGValue(colorB);
2238 BYTE bb = GetBValue(colorB);
2239
2240 int rav = (rt + rb) / 2;
2241 int gav = (gt + gb) / 2;
2242 int bav = (bt + bb) / 2;
2243
2244 return RGB((BYTE)rav, (BYTE)gav, (BYTE)bav);
2245}

◆ GetShellFolders()

void Settings::GetShellFolders ( )
2250{
2251 // Get the Blackbox folder path...
2253 // ...and remove the "\" at the end to be consistent with what SHGetFolderPath returns...
2254 SF_blackboxPath[strlen(SF_blackboxPath)-1] = 0;
2255
2256 SHGetSpecialFolderPath(NULL, SF_startMenu, CSIDL_PROGRAMS, 0);
2257 SHGetSpecialFolderPath(NULL, SF_commonStartMenu, CSIDL_COMMON_PROGRAMS, 0);
2258 SHGetSpecialFolderPath(NULL, SF_programFiles, CSIDL_PROGRAM_FILES, 0);
2259 SHGetSpecialFolderPath(NULL, SF_desktop, CSIDL_DESKTOPDIRECTORY, 0);
2260 SHGetSpecialFolderPath(NULL, SF_userProfile, CSIDL_PROFILE, 0);
2261// SHGetSpecialFolderPath(NULL, SF_userAppData, CSIDL_APPDATA, 0);
2263 strcat(SF_userAppData, "\\AppData");
2264
2265 // Store the default theme path...
2266 strcpy(SF_currentThemePath, SF_blackboxPath); // Default theme
2267 usingDefaultTheme = true;
2268
2269 // Find and store the path to the default xoblite.rc file (some settings should always
2270 // be read from this file, e.g. preferred editor and AutoUpdate last checked date)
2271 bbrcPath();
2273 strcpy(xobrcDefaultFile, xobrcFile);
2274}
LPCSTR bbrcPath(LPCSTR other)
Definition BBApi.cpp:863
LPCSTR extensionsrcPath(LPCSTR other)
Definition BBApi.cpp:881
char SF_userProfile[MAX_PATH]
Definition Settings.h:383
bool usingDefaultTheme
Definition Settings.h:386
char SF_startMenu[MAX_PATH]
Definition Settings.h:378
char SF_currentThemePath[MAX_PATH]
Definition Settings.h:385
char SF_blackboxPath[MAX_PATH]
Definition Settings.h:377
char SF_desktop[MAX_PATH]
Definition Settings.h:381
char SF_commonStartMenu[MAX_PATH]
Definition Settings.h:379
char SF_userAppData[MAX_PATH]
Definition Settings.h:382
char SF_programFiles[MAX_PATH]
Definition Settings.h:380

◆ GetBool()

bool Settings::GetBool ( LPCSTR fp,
LPSTR buffer,
LPCSTR szString,
bool szDefault )
2279{
2280 // NULL/empty filepointers are not supported for ReadBool,
2281 // but since it is the only Read* function that does not
2282 // support them I have added a safeguard here to prevent
2283 // a borked plugin from crashing the core... <g>
2284 if (!cachedFilePtr && (!fp || !_stricmp(fp, ""))) return szDefault;
2285
2286 //====================
2287
2288 LPSTR buffer;
2289 if (cachedFilePtr && !fp)
2290 {
2291 // Look for the value in the file cache...
2292 buffer = GetValueFromCache(cachedFilePtr, szString);
2293 }
2294 else
2295 {
2296 // If we can not find the value in the cache, we fetch it from the file...
2297 buffer = ReadValue(fp, szString, 0);
2298 }
2299
2300 if (buffer)
2301 {
2302 if (!_stricmp(buffer, "true")) return true;
2303 else if (!_stricmp(buffer, "false")) return false;
2304 }
2305
2306 return szDefault;
2307}
LPSTR ReadValue(LPCSTR fp, LPCSTR keyword, LPLONG ptr)
Definition BBApi.cpp:433
LPSTR GetValueFromCache(LPSTR cachedFilePtr, LPCSTR szString)
Definition Settings.cpp:2961

◆ GetInt()

int Settings::GetInt ( LPCSTR fp,
LPSTR buffer,
LPCSTR szString,
int szDefault )
2312{
2313 if (!cachedFilePtr && (!fp || !_stricmp(fp, "") || !_stricmp(fp, styleFile)))
2314 {
2315 if (!_strnicmp(szString, "toolbar.", 8))
2316 {
2317 if (szString[8] == 'l') // toolbar label items
2318 {
2319 if (!_stricmp(&szString[13], ".borderWidth:")) return ToolbarLabel->borderWidth;
2320 else if (!_stricmp(&szString[13], ".marginWidth:")) return ToolbarLabel->marginWidth;
2321 else if (!_stricmp(&szString[13], ".fontHeight:")) return ToolbarLabel->FontHeight;
2322 }
2323 else if (szString[8] == 'w') // toolbar windowLabel items
2324 {
2325 if (!_stricmp(&szString[19], ".borderWidth:")) return ToolbarWindowLabel->borderWidth;
2326 else if (!_stricmp(&szString[19], ".marginWidth:")) return ToolbarWindowLabel->marginWidth;
2327 else if (!_stricmp(&szString[19], ".fontHeight:")) return ToolbarWindowLabel->FontHeight;
2328 }
2329 else if (szString[8] == 'c') // toolbar clock items
2330 {
2331 if (!_stricmp(&szString[13], ".borderWidth:")) return ToolbarClock->borderWidth;
2332 else if (!_stricmp(&szString[13], ".marginWidth:")) return ToolbarClock->marginWidth;
2333 else if (!_stricmp(&szString[13], ".fontHeight:")) return ToolbarClock->FontHeight;
2334 }
2335 else // toolbar main items
2336 {
2337 if (!_stricmp(&szString[7], ".borderWidth:")) return Toolbar->borderWidth;
2338 else if (!_stricmp(&szString[7], ".marginWidth:")) return Toolbar->marginWidth;
2339 else if (!_stricmp(&szString[7], ".fontHeight:")) return Toolbar->FontHeight;
2340 }
2341 }
2342
2343 //====================
2344
2345 else if (!_strnicmp(szString, "menu.", 5))
2346 {
2347 if (szString[5] == 't') // menu title items
2348 {
2349 if (!_stricmp(&szString[10], ".borderWidth:")) return MenuTitle->borderWidth;
2350 else if (!_stricmp(&szString[10], ".marginWidth:")) return MenuTitle->marginWidth;
2351 else if (!_stricmp(&szString[10], ".fontHeight:")) return MenuTitle->FontHeight;
2352 }
2353 else if (szString[5] == 'f') // menu frame items
2354 {
2355 if (!_stricmp(&szString[10], ".borderWidth:")) return MenuFrame->borderWidth;
2356 else if (!_stricmp(&szString[10], ".marginWidth:")) return MenuFrame->marginWidth;
2357 else if (!_stricmp(&szString[10], ".fontHeight:")) return MenuFrame->FontHeight;
2358 }
2359 else if (szString[5] == 'h' || szString[5] == 'a') // menu hilite/active items
2360 {
2361 if (!_stricmp(&szString[11], ".borderWidth:")) return MenuActive->borderWidth;
2362 else if (!_stricmp(&szString[11], ".marginWidth:")) return MenuActive->marginWidth;
2363 else if (!_stricmp(&szString[11], ".fontHeight:")) return MenuActive->FontHeight;
2364 }
2365 else if (szString[5] == 'g') // menu grip items
2366 {
2367 if (!_stricmp(&szString[9], ".borderWidth:")) return MenuGrip->borderWidth;
2368 else if (!_stricmp(&szString[9], ".marginWidth:")) return MenuGrip->marginWidth;
2369 else if (!_stricmp(&szString[9], ".fontHeight:")) return MenuGrip->FontHeight;
2370 }
2371 else if (!_stricmp(&szString[4], ".borderWidth:")) return menuBorderWidth;
2372 }
2373
2374 //====================
2375
2376 else if (!_strnicmp(szString, "dock.", 5) || !_strnicmp(szString, "slit.", 5))
2377 {
2378 if (!_stricmp(&szString[5], ".borderWidth:")) return Dock->borderWidth;
2379 else if (!_stricmp(&szString[5], ".marginWidth:")) return Dock->marginWidth;
2380 }
2381
2382 //====================
2383
2384 else if (!_strnicmp(szString, "window.", 7))
2385 {
2386 if (szString[7] == 't')
2387 {
2388 if (szString[13] == 'f') // window title focus items
2389 {
2390 if (!_stricmp(&szString[18], ".borderWidth:")) return WindowTitleFocus->borderWidth;
2391 else if (!_stricmp(&szString[18], ".marginWidth:")) return WindowTitleFocus->marginWidth;
2392 }
2393 else if (szString[13] == 'u') // window title unfocus items
2394 {
2395 if (!_stricmp(&szString[20], ".borderWidth:")) return WindowTitleUnfocus->borderWidth;
2396 else if (!_stricmp(&szString[20], ".marginWidth:")) return WindowTitleUnfocus->marginWidth;
2397 }
2398 }
2399 else if (szString[7] == 'l')
2400 {
2401 if (szString[13] == 'f') // window label focus items
2402 {
2403 if (!_stricmp(&szString[18], ".borderWidth:")) return WindowLabelFocus->borderWidth;
2404 else if (!_stricmp(&szString[18], ".marginWidth:")) return WindowLabelFocus->marginWidth;
2405 else if (!_stricmp(&szString[18], ".fontHeight:")) return WindowLabelFocus->FontHeight;
2406 }
2407 else if (szString[13] == 'u') // window label unfocus items
2408 {
2409 if (!_stricmp(&szString[20], ".borderWidth:")) return WindowLabelUnfocus->borderWidth;
2410 else if (!_stricmp(&szString[20], ".marginWidth:")) return WindowLabelUnfocus->marginWidth;
2411 else if (!_stricmp(&szString[20], ".fontHeight:")) return WindowLabelUnfocus->FontHeight;
2412 }
2413 }
2414 else if (szString[7] == 'b')
2415 {
2416 if (szString[14] == 'f') // window button focus items
2417 {
2418 if (!_stricmp(&szString[19], ".borderWidth:")) return WindowButtonFocus->borderWidth;
2419 else if (!_stricmp(&szString[19], ".marginWidth:")) return WindowButtonFocus->marginWidth;
2420 }
2421 else if (szString[14] == 'u') // window button unfocus items
2422 {
2423 if (!_stricmp(&szString[21], ".borderWidth:")) return WindowButtonUnfocus->borderWidth;
2424 else if (!_stricmp(&szString[21], ".marginWidth:")) return WindowButtonUnfocus->marginWidth;
2425 }
2426 else if (szString[14] == 'p') // window button pressed items
2427 {
2428 if (!_stricmp(&szString[21], ".borderWidth:")) return WindowButtonPressed->borderWidth;
2429 else if (!_stricmp(&szString[21], ".marginWidth:")) return WindowButtonPressed->marginWidth;
2430 }
2431 }
2432 else if (szString[7] == 'g')
2433 {
2434 if (szString[12] == 'f') // window grip focus items
2435 {
2436 if (!_stricmp(&szString[17], ".borderWidth:")) return WindowGripFocus->borderWidth;
2437 else if (!_stricmp(&szString[17], ".marginWidth:")) return WindowGripFocus->marginWidth;
2438 }
2439 else if (szString[12] == 'u') // window grip unfocus items
2440 {
2441 if (!_stricmp(&szString[19], ".borderWidth:")) return WindowGripUnfocus->borderWidth;
2442 else if (!_stricmp(&szString[19], ".marginWidth:")) return WindowGripUnfocus->marginWidth;
2443 }
2444 }
2445 else if (szString[7] == 'h')
2446 {
2447 if (!_stricmp(&szString[6], ".handleHeight:")) return handleHeight; // window handle height (special non-StyleItem parameter)
2448 else if (szString[14] == 'f') // window handle focus items
2449 {
2450 if (!_stricmp(&szString[19], ".borderWidth:")) return WindowHandleFocus->borderWidth;
2451 else if (!_stricmp(&szString[19], ".marginWidth:")) return WindowHandleFocus->marginWidth;
2452 }
2453 else if (szString[14] == 'u') // window handle unfocus items
2454 {
2455 if (!_stricmp(&szString[21], ".borderWidth:")) return WindowHandleUnfocus->borderWidth;
2456 else if (!_stricmp(&szString[21], ".marginWidth:")) return WindowHandleUnfocus->marginWidth;
2457 }
2458 }
2459 }
2460
2461 //====================
2462
2463 else if (!_stricmp(szString, "borderWidth:")) return borderWidth;
2464 else if (!_stricmp(szString, "bevelWidth:")) return bevelWidth;
2465 else if (!_stricmp(szString, "handleHeight:") || !_stricmp(szString, "handleWidth:")) return handleHeight;
2466 else if (!_stricmp(szString, "frameWidth:")) return frameWidth;
2467
2468 else if (!_stricmp(szString, "dpi.scaling.factor:") || !_stricmp(szString, "hidpi.scaling.factor:")) return scalingFactorHiDPI;
2469 }
2470
2471 //====================
2472
2473 LPSTR buffer;
2474 if (cachedFilePtr && !fp)
2475 {
2476 // Look for the value in the buffered style file...
2477 buffer = GetValueFromCache(cachedFilePtr, szString);
2478 }
2479// else if (!cachedFilePtr && !_stricmp(fp, "."))
2480// {
2481 // ##### PROOF OF CONCEPT ONLY, HAVE NOT YET DECIDED IF THIS REALLY A GOOD IDEA... (read: there's value in separation of concerns as well!) #####
2482// // Look for the value in the xoblite.rc file for the current theme... (== fp shortcut to allow plugins to read their settings from there for ease of use, easier portability, etc)
2483// buffer = ReadValue(xobrcFile, szString, 0);
2484// }
2485 else
2486 {
2487 // If we can not find the value in the buffer, we fetch it from the specified file... (== this could be any file)
2488 buffer = ReadValue(fp, szString, 0);
2489 }
2490
2491 if (buffer)
2492 {
2493 int value = 0;
2494 value = atoi(buffer);
2495 return value;
2496 }
2497
2498 return szDefault;
2499}

◆ GetString()

LPSTR Settings::GetString ( LPCSTR fp,
LPSTR buffer,
LPCSTR szString,
LPSTR szDefault )
2504{
2505 if (!cachedFilePtr && (!fp || !_stricmp(fp, "") || !_stricmp(fp, styleFile)))
2506 {
2507 //====================
2508
2509 if (strchr(szString, '*')) // wildcard items
2510 {
2511 if (!_stricmp(szString, "*font:")) return Wildcard->Font;
2512 else if (!_stricmp(szString, "toolbar*font:")) return wildcardToolbarFont;
2513 else if (!_stricmp(szString, "menu*font:")) return wildcardMenuFont;
2514 else if (!_stricmp(szString, "window*font:")) return wildcardWindowFont;
2515 else if (!_stricmp(szString, "*justify:") || !_stricmp(szString, "*alignment:")) return GetAlignmentAsString(Wildcard);
2516
2517 else if (!_stricmp(szString, "*.font:")) return Wildcard->Font;
2518 else if (!_stricmp(szString, "*.justify:") || !_stricmp(szString, "*.alignment:")) return GetAlignmentAsString(Wildcard);
2519 }
2520
2521 //====================
2522
2523 else if (!_strnicmp(szString, "toolbar", 7)) // toolbar items
2524 {
2525 if (IsInString(szString, ".appearance:"))
2526 {
2527 if (!_stricmp(&szString[7], ".appearance:")) return toolbar;
2528 else if (!_stricmp(&szString[7], ".label.appearance:")) return toolbarLabel;
2529 else if (!_stricmp(&szString[7], ".windowLabel.appearance:")) return toolbarWindowLabel;
2530 else if (!_stricmp(&szString[7], ".clock.appearance:")) return toolbarClock;
2531 else if (!_stricmp(&szString[7], ".button.appearance:")) return toolbarButton;
2532 else if (!_stricmp(&szString[7], ".button.pressed.appearance:")) return toolbarButtonPressed;
2533 }
2534 else
2535 {
2536 if (!_stricmp(&szString[7], ":")) return toolbar;
2537 else if (!_stricmp(&szString[7], ".label:")) return toolbarLabel;
2538 else if (!_stricmp(&szString[7], ".windowLabel:")) return toolbarWindowLabel;
2539 else if (!_stricmp(&szString[7], ".clock:")) return toolbarClock;
2540 else if (!_stricmp(&szString[7], ".button:")) return toolbarButton;
2541 else if (!_stricmp(&szString[7], ".button.pressed:")) return toolbarButtonPressed;
2542
2543 else if (!_stricmp(&szString[7], ".font:")) return Toolbar->Font;
2544 else if (!_stricmp(&szString[7], ".label.font:")) return ToolbarLabel->Font;
2545 else if (!_stricmp(&szString[7], ".windowLabel.font:")) return ToolbarWindowLabel->Font;
2546 else if (!_stricmp(&szString[7], ".clock.font:")) return ToolbarClock->Font;
2547
2548 else if (!_stricmp(&szString[7], ".alignment:") || !_stricmp(&szString[7], ".justify:")) return GetAlignmentAsString(Toolbar);
2549 else if (!_stricmp(&szString[7], ".label.alignment:") || !_stricmp(&szString[7], ".label.justify:")) return GetAlignmentAsString(ToolbarLabel);
2550 else if (!_stricmp(&szString[7], ".windowLabel.alignment:") || !_stricmp(&szString[7], ".windowLabel.justify:")) return GetAlignmentAsString(ToolbarWindowLabel);
2551 else if (!_stricmp(&szString[7], ".clock.alignment:") || !_stricmp(&szString[7], ".clock.justify:")) return GetAlignmentAsString(ToolbarClock);
2552 }
2553 }
2554
2555 //====================
2556
2557 else if (!_strnicmp(szString, "menu.", 5))
2558 {
2559 if (szString[5] == 't') // menu title items
2560 {
2561 if (!_stricmp(&szString[10], ":") || !_stricmp(&szString[10], ".appearance:")) return menuTitle;
2562 else if (!_stricmp(&szString[10], ".font:")) return MenuTitle->Font;
2563 else if (!_stricmp(&szString[10], ".alignment:") || !_stricmp(&szString[10], ".justify:")) return GetAlignmentAsString(MenuTitle);
2564 }
2565 else if (szString[5] == 'f') // menu frame items
2566 {
2567 if (!_stricmp(&szString[10], ":") || !_stricmp(&szString[10], ".appearance:")) return menuFrame;
2568 else if (!_stricmp(&szString[10], ".font:")) return MenuFrame->Font;
2569 else if (!_stricmp(&szString[10], ".alignment:") || !_stricmp(&szString[10], ".justify:")) return GetAlignmentAsString(MenuFrame);
2570 }
2571 else if (szString[5] == 'b') // menu bullet items
2572 {
2573 if (!_stricmp(&szString[11], ":") || !_stricmp(&szString[11], ".appearance:")) return menuFrameBulletAsString;
2574 else if (!_stricmp(&szString[11], ".position:")) return menuBulletPosition;
2575 }
2576 else if (!_stricmp(&szString[4], ".active.appearance:") || !_stricmp(&szString[4], ".hilite:") || !_stricmp(&szString[4], ".active:")) return menuActive; // menu active/hilite items
2577 else if (!_stricmp(&szString[4], ".grip.appearance:") || !_stricmp(&szString[4], ".grip:")) return menuGrip; // menu grip items
2578 else if (!_stricmp(&szString[4], ".indicator.appearance:") || !_stricmp(&szString[4], ".indicator:")) return menuIndicator; // menu indicator items
2579 }
2580
2581 //====================
2582
2583 else if (!_strnicmp(szString, "dock", 4) || !_strnicmp(szString, "slit", 4))
2584 {
2585 if (!_stricmp(&szString[4], ":") || !_stricmp(&szString[4], ".appearance:")) return dock;
2586 }
2587
2588 //====================
2589
2590 else if (!_strnicmp(szString, "window.", 7))
2591 {
2592 if (szString[7] == 't')
2593 {
2594 if (szString[13] == 'f') // window title focus items
2595 {
2596 if (!_stricmp(&szString[18], ":") || !_stricmp(&szString[18], ".appearance:")) return windowTitleFocus;
2597 }
2598 else if (szString[13] == 'u') // window title unfocus items
2599 {
2600 if (!_stricmp(&szString[20], ":") || !_stricmp(&szString[20], ".appearance:")) return windowTitleUnfocus;
2601 }
2602 }
2603 else if (szString[7] == 'l')
2604 {
2605 if (szString[13] == 'f') // window label focus items
2606 {
2607 if (!_stricmp(&szString[18], ":") || !_stricmp(&szString[18], ".appearance:")) return windowLabelFocus;
2608 else if (!_stricmp(&szString[18], ".font:")) return WindowLabelFocus->Font;
2609 else if (!_stricmp(&szString[18], ".alignment:") || !_stricmp(&szString[18], ".justify:")) return GetAlignmentAsString(WindowLabelFocus);
2610 }
2611 else if (szString[13] == 'u') // window label unfocus items
2612 {
2613 if (!_stricmp(&szString[20], ":") || !_stricmp(&szString[20], ".appearance:")) return windowLabelUnfocus;
2614 else if (!_stricmp(&szString[20], ".font:")) return WindowLabelUnfocus->Font;
2615 else if (!_stricmp(&szString[20], ".alignment:") || !_stricmp(&szString[20], ".justify:")) return GetAlignmentAsString(WindowLabelUnfocus);
2616 }
2617 }
2618 else if (szString[7] == 'b')
2619 {
2620 if (szString[14] == 'f') // window button focus items
2621 {
2622 if (!_stricmp(&szString[19], ":") || !_stricmp(&szString[19], ".appearance:")) return windowButtonFocus;
2623 }
2624 else if (szString[14] == 'u') // window button unfocus items
2625 {
2626 if (!_stricmp(&szString[21], ":") || !_stricmp(&szString[21], ".appearance:")) return windowButtonUnfocus;
2627 }
2628 else if (szString[14] == 'p') // window button pressed items
2629 {
2630 if (!_stricmp(&szString[21], ":") || !_stricmp(&szString[21], ".appearance:")) return windowButtonPressed;
2631 }
2632 }
2633 else if (szString[7] == 'g')
2634 {
2635 if (szString[12] == 'f') // window grip focus items
2636 {
2637 if (!_stricmp(&szString[17], ":") || !_stricmp(&szString[17], ".appearance:")) return windowGripFocus;
2638 }
2639 else if (szString[12] == 'u') // window grip unfocus items
2640 {
2641 if (!_stricmp(&szString[19], ":") || !_stricmp(&szString[19], ".appearance:")) return windowGripUnfocus;
2642 }
2643 }
2644 else if (szString[7] == 'h')
2645 {
2646 if (szString[14] == 'f') // window handle focus items
2647 {
2648 if (!_stricmp(&szString[19], ":") || !_stricmp(&szString[19], ".appearance:")) return windowHandleFocus;
2649 }
2650 else if (szString[14] == 'u') // window handle unfocus items
2651 {
2652 if (!_stricmp(&szString[21], ":") || !_stricmp(&szString[21], ".appearance:")) return windowHandleUnfocus;
2653 }
2654 }
2655 }
2656
2657 //====================
2658
2659 else if (!_strnicmp(szString, "hardware", 8))
2660 {
2661 if (!_stricmp(&szString[8], ":") || !_stricmp(&szString[8], ".appearance:")) return externalHardware;
2662 }
2663 }
2664
2665 //====================
2666
2667 LPSTR buffer;
2668 if (cachedFilePtr && !fp)
2669 {
2670 // Look for the value in the buffered style file...
2671 buffer = GetValueFromCache(cachedFilePtr, szString);
2672 }
2673 else
2674 {
2675 // If we can not find the value in the buffer, we fetch it from the file...
2676 buffer = ReadValue(fp, szString, 0);
2677 }
2678
2679 if (buffer) return buffer;
2680
2681 return szDefault;
2682}
LPSTR GetAlignmentAsString(StyleItem *styleItem)
Definition Settings.cpp:3112

◆ GetColor()

COLORREF Settings::GetColor ( LPCSTR fp,
LPSTR buffer,
LPCSTR szString,
LPCSTR szDefault,
COLORREF szDefaultRef,
bool useDefaultRef )
2687{
2688 if (!cachedFilePtr)
2689 {
2690 if (!fp || !_stricmp(fp, "") || !_stricmp(fp, styleFile))
2691 {
2692 char* ptr = NULL;
2693 StyleItem* si = NULL;
2694
2695 //====================
2696
2697 if (strchr(szString, '*')) // wildcard items
2698 {
2699 if (!_stricmp(szString, "*.textColor:") || !_stricmp(szString, "*textColor:")) return Wildcard->TextColor;
2700 }
2701
2702 //====================
2703
2704 else if (!_strnicmp(szString, "toolbar", 7))
2705 {
2706 if (!_strnicmp(&szString[7], ".clock", 6)) // toolbar clock items
2707 {
2708 ptr = (char*)&szString[13];
2709 si = ToolbarClock;
2710 }
2711 else if (!_strnicmp(&szString[7], ".label", 6)) // toolbar label items
2712 {
2713 ptr = (char*)&szString[13];
2714 si = ToolbarLabel;
2715 }
2716 else if (!_strnicmp(&szString[7], ".windowLabel", 12)) // toolbar windowLabel items
2717 {
2718 ptr = (char*)&szString[19];
2719 si = ToolbarWindowLabel;
2720 }
2721 else if (!_strnicmp(&szString[7], ".button.pressed", 15)) // toolbar pressed button items
2722 {
2723 ptr = (char*)&szString[22];
2725 }
2726 else if (!_strnicmp(&szString[7], ".button", 7)) // toolbar button items
2727 {
2728 ptr = (char*)&szString[14];
2729 si = ToolbarButton;
2730 }
2731 else // toolbar items
2732 {
2733 ptr = (char*)&szString[7];
2734 si = Toolbar;
2735 }
2736 }
2737
2738 //====================
2739
2740 else if (!_strnicmp(szString, "menu", 4))
2741 {
2742 if (!_strnicmp(&szString[4], ".title", 6)) // menu title items
2743 {
2744 ptr = (char*)&szString[10];
2745 si = MenuTitle;
2746 }
2747 else if (!_strnicmp(&szString[4], ".frame", 6)) // menu frame items
2748 {
2749 if (!_stricmp(&szString[10], ".bulletColor:")) return MenuFrame->BulletColor;
2750 else if (!_stricmp(&szString[10], ".disableColor:")) return MenuFrame->disabledColor;
2751 ptr = (char*)&szString[10];
2752 si = MenuFrame;
2753 }
2754 else if (!_strnicmp(&szString[4], ".hilite", 7) || !_strnicmp(&szString[4], ".active", 7)) // menu hilite/active items
2755 {
2756 if (!_stricmp(&szString[11], ".bulletColor:")) return MenuActive->BulletColor;
2757 ptr = (char*)&szString[11];
2758 si = MenuActive;
2759 }
2760 else if (!_strnicmp(&szString[4], ".indicator", 10)) // menu indicator
2761 {
2762 ptr = (char*)&szString[14];
2763 si = MenuIndicator;
2764 }
2765 // menu separator items + menu border
2766 else if (!_stricmp(&szString[4], ".separator.color:")) return MenuSeparator->Color;
2767 else if (!_stricmp(&szString[4], ".borderColor:")) return menuBorderColor;
2768 }
2769
2770 //====================
2771
2772 else if (!_strnicmp(szString, "dock", 4) || !_strnicmp(szString, "slit", 4)) // dock items
2773 {
2774 ptr = (char*)&szString[4];
2775 si = Dock;
2776 }
2777
2778 //====================
2779
2780 else if (!_strnicmp(szString, "window", 6))
2781 {
2782 if (!_strnicmp(&szString[6], ".title", 6))
2783 {
2784 if (!_strnicmp(&szString[12], ".focus", 6)) // window title focus items
2785 {
2786 ptr = (char*)&szString[18];
2787 si = WindowTitleFocus;
2788 }
2789 else if (!_strnicmp(&szString[12], ".unfocus", 8)) // window title unfocus items
2790 {
2791 ptr = (char*)&szString[20];
2792 si = WindowTitleUnfocus;
2793 }
2794 }
2795 else if (!_strnicmp(&szString[6], ".label", 6))
2796 {
2797 if (!_strnicmp(&szString[12], ".focus", 6)) // window label focus items
2798 {
2799 ptr = (char*)&szString[18];
2800 si = WindowLabelFocus;
2801 }
2802 else if (!_strnicmp(&szString[12], ".unfocus", 8)) // window label unfocus items
2803 {
2804 ptr = (char*)&szString[20];
2805 si = WindowLabelUnfocus;
2806 }
2807 }
2808 else if (!_strnicmp(&szString[6], ".button", 7))
2809 {
2810 if (!_strnicmp(&szString[13], ".focus", 6)) // window button focus items
2811 {
2812 ptr = (char*)&szString[19];
2813 si = WindowButtonFocus;
2814 }
2815 else if (!_strnicmp(&szString[13], ".unfocus", 8)) // window button unfocus items
2816 {
2817 ptr = (char*)&szString[21];
2819 }
2820 else if (!_strnicmp(&szString[13], ".pressed", 8)) // window button pressed items
2821 {
2822 ptr = (char*)&szString[21];
2824 }
2825 }
2826 else if (!_strnicmp(&szString[6], ".grip", 5))
2827 {
2828 if (!_strnicmp(&szString[11], ".focus", 6)) // window grip focus items
2829 {
2830 ptr = (char*)&szString[17];
2831 si = WindowGripFocus;
2832 }
2833 else if (!_strnicmp(&szString[11], ".unfocus", 8)) // window grip unfocus items
2834 {
2835 ptr = (char*)&szString[19];
2836 si = WindowGripUnfocus;
2837 }
2838 }
2839 else if (!_strnicmp(&szString[6], ".handle", 7))
2840 {
2841 if (!_strnicmp(&szString[13], ".focus", 6)) // window handle focus items
2842 {
2843 ptr = (char*)&szString[19];
2844 si = WindowHandleFocus;
2845 }
2846 else if (!_strnicmp(&szString[13], ".unfocus", 8)) // window handle unfocus items
2847 {
2848 ptr = (char*)&szString[21];
2850 }
2851 }
2852 }
2853
2854 //====================
2855
2856 else if (!_strnicmp(szString, "hardware", 8)) // hardware items
2857 {
2858 ptr = (char*)&szString[8];
2859 si = ExternalHardware;
2860 }
2861
2862 //====================
2863
2864 if (ptr != NULL)
2865 {
2866 if (!_stricmp(ptr, ".color:") || !_stricmp(ptr, ".color1:") || !_stricmp(ptr, ".backgroundColor:")) return si->Color;
2867 else if (!_stricmp(ptr, ".colorTo:") || !_stricmp(ptr, ".color2:")) return si->ColorTo;
2868 else if (!_stricmp(ptr, ".color3:")) return si->Color3;
2869 else if (!_stricmp(ptr, ".color4:")) return si->Color4;
2870 else if (!_stricmp(ptr, ".color5:")) return si->Color5;
2871 else if (!_stricmp(ptr, ".color6:")) return si->Color6;
2872 else if (!_stricmp(ptr, ".color7:")) return si->Color7;
2873 else if (!_stricmp(ptr, ".color8:")) return si->Color8;
2874// else if (!_stricmp(ptr, ".textColor:") || !_stricmp(ptr, ".foregroundColor:")) return si->TextColor;
2875 else if (!_stricmp(ptr, ".textColor:")) return si->TextColor;
2876 else if (!_stricmp(ptr, ".borderColor:")) return si->borderColor;
2877// else if (!_stricmp(ptr, ".picColor:")) return si->PicColor;
2878 else if (!_stricmp(ptr, ".picColor:") || !_stricmp(ptr, ".bulletColor:") || !_stricmp(ptr, ".foregroundColor:")) return si->foregroundColor;
2879 }
2880
2881 //====================
2882
2883 else if (!_stricmp(szString, "borderColor:")) return borderColor;
2884 }
2885 }
2886
2887 //====================
2888
2889 // If we could not find the value in
2890 // the buffer, we fetch it from the file...
2891 COLORREF value;
2892 char colorString[MAX_LINE_LENGTH];
2893 char tempString[MAX_LINE_LENGTH];
2894 char cr[4], cg[4], cb[4];
2895
2896 //====================
2897
2898 LPSTR buffer;
2899 if (cachedFilePtr && !fp)
2900 {
2901 // Look for the value in the buffered style file...
2902 buffer = GetValueFromCache(cachedFilePtr, szString);
2903 }
2904 else
2905 {
2906 // If we can not find the value in the buffer, we fetch it from the file...
2907 if (!fp || !_stricmp(fp, "")) buffer = ReadValue(styleFile, szString, 0);
2908 else buffer = ReadValue(fp, szString, 0);
2909 }
2910
2911 if (buffer) strcpy(colorString, buffer);
2912 else
2913 {
2914 // If the requested parameter could not be
2915 // found in the file we use the default value...
2916 if (useDefaultRef) return szDefaultRef;
2917 else strcpy(colorString, szDefault);
2918 }
2919
2920 //====================
2921
2922 // Check if its a #RRGGBB type string...
2923 if (*colorString == '#') memmove(colorString, colorString+1, strlen(colorString));
2924
2925 // Check if its an "rgb:12/ee/4c" type string...
2926 else if (colorString[3]== ':')
2927// else if (strchr(colorString, ':'))
2928 {
2929 strcpy(tempString, Tokenize(colorString, colorString, ":"));
2930 strcpy(tempString, Tokenize(tempString, cr, "/"));
2931 strcpy(tempString, Tokenize(tempString, cg, "/"));
2932 strcpy(cb, tempString);
2933
2934 strcpy(colorString, cr);
2935 if (strlen(cr)==1) strcat(colorString, cr);
2936 strcat(colorString, cg);
2937 if (strlen(cg)==1) strcat(colorString, cg);
2938 strcat(colorString, cb);
2939 if (strlen(cb)==1) strcat(colorString, cb);
2940 }
2941
2942 // Check if its a pre-defined colour (e.g. "black")...
2943 else if (isalpha(*colorString))
2944 {
2945 value = ParseLiteralColor(colorString);
2946 if (value) return value;
2947 }
2948
2949 //====================
2950
2951 value = strtol(colorString, NULL, 16);
2952 value = RGB(GetBValue(value), GetGValue(value), GetRValue(value));// Have to switch the R and B values around due to the anal way of handling #000000 colors (this is below near the RGB())
2953
2954 return value;
2955}
COLORREF ParseLiteralColor(LPCSTR color)
Definition BBApi.cpp:1013
COLORREF Color
Definition BBApi.h:406
COLORREF ColorTo
Definition BBApi.h:407

◆ GetValueFromCache()

LPSTR Settings::GetValueFromCache ( LPSTR cachedFilePtr,
LPCSTR szString )
2962{
2963 char* ptr = cachedFilePtr;
2964 char* ptr2 = cachedFilePtr;
2965
2966 // Look for the requested keyword in the memory cache...
2967 for (;;)
2968 {
2969 ptr = StrStrI(ptr2, szString); // -> Case insensitive strstr (Win32 shlwapi.lib)
2970 if (ptr == NULL) return NULL;
2971 else if (!CheckForComment(cachedFilePtr, ptr)) break;
2972 ptr2 = ptr+1;
2973 }
2974
2975 // We're only interested in the string after the keyword...
2976 ptr += strlen(szString);
2977 // Remove any initial space characters or tabs...
2978 ptr += strspn(ptr, " \t");
2979 // Copy the string while checking for end of line, end of file, or MS-DOS Ctrl-Z...
2980 ptr2 = ptr;
2981 for (int i=0; i<MAX_LINE_LENGTH; i++)
2982 {
2983 if ((ptr2[0] == '\n') || (ptr2[0] == EOF) || (ptr2[0] == 26))
2984 {
2985 valueFromCache[i] = '\0';
2986 break;
2987 }
2988 else
2989 {
2990 valueFromCache[i] = ptr2[0];
2991 ptr2++;
2992 }
2993 }
2994
2995 valueFromCache[MAX_LINE_LENGTH-1] = '\0'; // Failsafe (in case the line is longer than the allowed maximum 4096 bytes)
2996
2997 int nLen = strlen(valueFromCache);
2998 if (nLen == 0) return NULL;
2999
3000 // Remove any trailing space characters...
3001 while (nLen >0 && valueFromCache[nLen-1] == ' ') nLen--;
3002 valueFromCache[nLen] = '\0';
3003
3004 return valueFromCache;
3005}
static char valueFromCache[MAX_LINE_LENGTH+1]
Definition Settings.cpp:2959
bool CheckForComment(LPSTR cachedFilePtr, LPSTR ptr)
Definition Settings.cpp:3009

◆ CheckForComment()

bool Settings::CheckForComment ( LPSTR cachedFilePtr,
LPSTR ptr )
3010{
3011 LPSTR ptr2 = ptr - 1;
3012 if (ptr2[0] == '.') return true; // Safeguard for e.g. "borderColor:" vs "toolbar.borderColor:"
3013 for (;;)
3014 {
3015 if ((ptr2[0] == '\n') || (ptr2[0] == EOF) || (ptr2[0] == 26)) return false;
3016 else if ((ptr2[0] == '!') || (ptr2[0] == '#')) return true;
3017 else if (ptr2 == cachedFilePtr) return false;
3018 else ptr2--;
3019 }
3020}

◆ UpdateAppearanceString()

void Settings::UpdateAppearanceString ( StyleItem * styleItem)
3025{
3026 if (styleItem->type == B_IMAGEFROMFILE) return;
3027
3028 //====================
3029
3030 // Update the cached appearance *string* for the specified element...
3031 // (nb. not included in the StyleItem definition but potentially used by
3032 // e.g. plugins calling ReadString, so needs to reflect the latest changes
3033 // applied while using the style Designer Mode (see Broams.cpp)
3034
3035 if (styleItem == Toolbar) appearancePointer = toolbar;
3036 else if (styleItem == ToolbarLabel) appearancePointer = toolbarLabel;
3038 else if (styleItem == ToolbarClock) appearancePointer = toolbarClock;
3039 else if (styleItem == ToolbarButton) appearancePointer = toolbarButton;
3041 else if (styleItem == MenuTitle) appearancePointer = menuTitle;
3042 else if (styleItem == MenuFrame) appearancePointer = menuFrame;
3043 else if (styleItem == MenuActive) appearancePointer = menuActive;
3044 else if (styleItem == MenuGrip) appearancePointer = menuGrip;
3045 else if (styleItem == MenuIndicator) appearancePointer = menuIndicator;
3046 else if (styleItem == Dock) appearancePointer = dock;
3047 else if (styleItem == Console) appearancePointer = console;
3048 else if (styleItem == WindowTitleFocus) appearancePointer = windowTitleFocus;
3050 else if (styleItem == WindowLabelFocus) appearancePointer = windowLabelFocus;
3052 else if (styleItem == WindowButtonFocus) appearancePointer = windowButtonFocus;
3055 else if (styleItem == WindowGripFocus) appearancePointer = windowGripFocus;
3056 else if (styleItem == WindowGripUnfocus) appearancePointer = windowGripUnfocus;
3057 else if (styleItem == WindowHandleFocus) appearancePointer = windowHandleFocus;
3059 else if (styleItem == ExternalHardware) appearancePointer = externalHardware;
3060 else return; // Failsafe
3061
3062 //====================
3063
3064 appearancePointer[0] = '\0';
3065
3066 if (styleItem->type == B_PARENTRELATIVE || styleItem->parentRelative) strcat_s(appearancePointer, MAX_LINE_LENGTH, "ParentRelative");
3067 else
3068 {
3069 if (styleItem->bevelstyle == BEVEL_RAISED) strcat_s(appearancePointer, MAX_LINE_LENGTH, "Raised");
3070 else if (styleItem->bevelstyle == BEVEL_SUNKEN) strcat_s(appearancePointer, MAX_LINE_LENGTH, "Sunken");
3071 else strcat_s(appearancePointer, MAX_LINE_LENGTH, "Flat");
3072
3073 if (styleItem->type == B_SOLID) strcat_s(appearancePointer, MAX_LINE_LENGTH, " Solid");
3074 else
3075 {
3076 strcat_s(appearancePointer, MAX_LINE_LENGTH, " Gradient");
3077 switch (styleItem->type)
3078 {
3079 case B_HORIZONTAL: { strcat_s(appearancePointer, MAX_LINE_LENGTH, " Horizontal"); break; }
3080 case B_VERTICAL: { strcat_s(appearancePointer, MAX_LINE_LENGTH, " Vertical"); break; }
3081 case B_DIAGONAL: { strcat_s(appearancePointer, MAX_LINE_LENGTH, " Diagonal"); break; }
3082 case B_CROSSDIAGONAL: { strcat_s(appearancePointer, MAX_LINE_LENGTH, " CrossDiagonal"); break; }
3083 case B_PIPECROSS: { strcat_s(appearancePointer, MAX_LINE_LENGTH, " Pipecross"); break; }
3084 case B_ELLIPTIC: { strcat_s(appearancePointer, MAX_LINE_LENGTH, " Elliptic"); break; }
3085 case B_RECTANGLE: { strcat_s(appearancePointer, MAX_LINE_LENGTH, " Rectangle"); break; }
3086 case B_PYRAMID: { strcat_s(appearancePointer, MAX_LINE_LENGTH, " Pyramid"); break; }
3087 case B_MIRRORHORIZONTAL: { strcat_s(appearancePointer, MAX_LINE_LENGTH, " MirrorHorizontal"); break; }
3088 case B_MIRRORVERTICAL: { strcat_s(appearancePointer, MAX_LINE_LENGTH, " MirrorVertical"); break; }
3089 case B_SPLITSOLID: { strcat_s(appearancePointer, MAX_LINE_LENGTH, " SplitSolid"); break; }
3090 case B_SPLITHORIZONTAL: { strcat_s(appearancePointer, MAX_LINE_LENGTH, " SplitHorizontal"); break; }
3091 case B_SPLITVERTICAL: { strcat_s(appearancePointer, MAX_LINE_LENGTH, " SplitVertical"); break; }
3092 case B_SUPERHORIZONTAL: { strcat_s(appearancePointer, MAX_LINE_LENGTH, " SuperHorizontal"); break; }
3093 case B_SUPERVERTICAL: { strcat_s(appearancePointer, MAX_LINE_LENGTH, " SuperVertical"); break; }
3094 default: break;
3095 }
3096 }
3097
3098 if (styleItem->bevelstyle != BEVEL_FLAT)
3099 {
3100 if (styleItem->bevelposition == BEVEL2) strcat_s(appearancePointer, MAX_LINE_LENGTH, " Bevel2");
3101 else strcat_s(appearancePointer, MAX_LINE_LENGTH, " Bevel1");
3102 }
3103
3104 if (styleItem->interlaced) strcat_s(appearancePointer, MAX_LINE_LENGTH, " Interlaced");
3105 }
3106}
#define B_CROSSDIAGONAL
Definition BBApi.h:75
#define B_MIRRORVERTICAL
Definition BBApi.h:96
#define B_DIAGONAL
Definition BBApi.h:74
#define B_PIPECROSS
Definition BBApi.h:76
#define BEVEL_RAISED
Definition BBApi.h:106
#define BEVEL_SUNKEN
Definition BBApi.h:107
#define BEVEL2
Definition BBApi.h:109
#define B_PYRAMID
Definition BBApi.h:79
#define B_RECTANGLE
Definition BBApi.h:78

◆ GetAlignmentAsString()

LPSTR Settings::GetAlignmentAsString ( StyleItem * styleItem)
3113{
3114 if (styleItem->Justify == DT_LEFT) return justifyLeft;
3115 else if (styleItem->Justify == DT_RIGHT) return justifyRight;
3116 else return justifyCenter;
3117}
char justifyCenter[7]
Definition Settings.cpp:3110
char justifyRight[6]
Definition Settings.cpp:3110
char justifyLeft[5]
Definition Settings.cpp:3110

◆ ParsePlacement()

void Settings::ParsePlacement ( LPSTR inputString,
Placement * outputPlacement )
3122{
3123// strncpy(outputPlacement->rcString, inputString, sizeof(outputPlacement->rcString)); // Save the .rc placement string, we might need it later...
3124 strncpy_s(outputPlacement->rcString, sizeof(outputPlacement->rcString), inputString, _TRUNCATE); // Save the .rc placement string, we might need it later...
3125 outputPlacement->rcString[sizeof(outputPlacement->rcString)-1] = '\0';
3126
3127 //====================
3128
3129 if (inputString[0] == 'M' || inputString[0] == 'm') // Manual positioning
3130 {
3131 char tempPlacement[MAX_LINE_LENGTH];
3132 strcpy(tempPlacement, inputString);
3133
3134 char token1[MAX_LINE_LENGTH], token2[MAX_LINE_LENGTH], token3[MAX_LINE_LENGTH];
3135 LPSTR tokens[2];
3136 tokens[0] = token1;
3137 tokens[1] = token2;
3138
3139 token1[0] = token2[0] = token3[0] = '\0';
3140 BBTokenize (tempPlacement, tokens, 2, token3);
3141
3142 outputPlacement->placement = PLACEMENT_MANUAL;
3143
3144 if (token2[1] == 'C') // "xC" -> Use centered x positioning (nb. regardless of Manual y positioning, see below)
3145 {
3146 outputPlacement->centeredx = true;
3147 if (strlen(token2) > 2) outputPlacement->rcx = atoi(&token2[2]); // Any +/- offset from the centered position? (i.e. input string is longer than "xC")
3148 else outputPlacement->rcx = 0;
3149 }
3150 else
3151 {
3152 outputPlacement->centeredx = false;
3153 outputPlacement->rcx = atoi(&token2[1]); // E.g. "x10" (-> left relative positioning) or "x-10" (-> right relative positioning)
3154 }
3155
3156 if (token3[1] == 'C') // "yC" -> Use centered y positioning (nb. regardless of Manual x positioning, see above)
3157 {
3158 outputPlacement->centeredy = true;
3159 if (strlen(token3) > 2) outputPlacement->rcy = atoi(&token3[2]); // Any +/- offset from the centered position? (i.e. input string is longer than "yC")
3160 else outputPlacement->rcy = 0;
3161 }
3162 else
3163 {
3164 outputPlacement->centeredy = false;
3165 outputPlacement->rcy = atoi(&token3[1]); // E.g. "y10" (-> top relative positioning) or "y-10" (-> bottom relative positioning)
3166 }
3167
3168 return;
3169 }
3170
3171 //====================
3172
3173 if (inputString[0] == 'T' || inputString[0] == 't') // Vertical Top
3174 {
3175 if (inputString[3] == 'L') outputPlacement->placement = PLACEMENT_TOP_LEFT;
3176 else if (inputString[3] == 'C') outputPlacement->placement = PLACEMENT_TOP_CENTER;
3177 else if (inputString[3] == 'R') outputPlacement->placement = PLACEMENT_TOP_RIGHT;
3178 }
3179
3180 //====================
3181
3182 else if (inputString[0] == 'C' || inputString[0] == 'c') // Vertical Center
3183 {
3184 if (inputString[6] == 'L') outputPlacement->placement = PLACEMENT_CENTER_LEFT;
3185 if (inputString[6] == 'C') outputPlacement->placement = PLACEMENT_CENTER_CENTER;
3186 else if (inputString[6] == 'R') outputPlacement->placement = PLACEMENT_CENTER_RIGHT;
3187 }
3188
3189 //====================
3190
3191 else if (inputString[0] == 'B' || inputString[0] == 'b') // Vertical Bottom
3192 {
3193 if (inputString[6] == 'L') outputPlacement->placement = PLACEMENT_BOTTOM_LEFT;
3194 else if (inputString[6] == 'C') outputPlacement->placement = PLACEMENT_BOTTOM_CENTER;
3195 else if (inputString[6] == 'R') outputPlacement->placement = PLACEMENT_BOTTOM_RIGHT;
3196 }
3197
3198 //====================
3199
3200 else if (inputString[0] == 'D' || inputString[0] == 'd') // Default (used by the console)
3201 {
3202 outputPlacement->placement = PLACEMENT_DEFAULT;
3203 }
3204
3205 //====================
3206
3207 else if (inputString[0] == 'O' || inputString[0] == 'o') // OppositeToolbar (used by the dock)
3208 {
3209 outputPlacement->placement = PLACEMENT_OPPOSITE_TOOLBAR;
3210 }
3211
3212 //====================
3213
3214 else if (inputString[0] == 'N' || inputString[0] == 'n') // Next (used by e.g the toolbar broams)
3215 {
3216 if (outputPlacement->placement >= PLACEMENT_TOP_LEFT && outputPlacement->placement < PLACEMENT_BOTTOM_RIGHT) outputPlacement->placement++;
3217 else outputPlacement->placement = PLACEMENT_TOP_LEFT;
3218 }
3219 else if (inputString[0] == 'P' || inputString[0] == 'p') // Previous (used by e.g the toolbar broams)
3220 {
3221 if (outputPlacement->placement <= PLACEMENT_BOTTOM_RIGHT && outputPlacement->placement > PLACEMENT_TOP_LEFT) outputPlacement->placement--;
3222 else outputPlacement->placement = PLACEMENT_BOTTOM_RIGHT;
3223 }
3224
3225 //====================
3226
3227 else if (outputPlacement->placement < PLACEMENT_MANUAL || outputPlacement->placement > PLACEMENT_OPPOSITE_TOOLBAR)
3228 {
3229 // "Sanity check" failed, use default value...
3230 outputPlacement->placement = PLACEMENT_BOTTOM_CENTER;
3231 }
3232}
int BBTokenize(LPCSTR szString, char *lpszBuffers[], DWORD dwNumBuffers, LPSTR szExtraParameters)
Definition BBApi.cpp:316
#define PLACEMENT_CENTER_LEFT
Definition Settings.h:71
#define PLACEMENT_OPPOSITE_TOOLBAR
Definition Settings.h:78
#define PLACEMENT_TOP_CENTER
Definition Settings.h:69
#define PLACEMENT_BOTTOM_CENTER
Definition Settings.h:75
#define PLACEMENT_DEFAULT
Definition Settings.h:77
#define PLACEMENT_MANUAL
Definition Settings.h:67
#define PLACEMENT_BOTTOM_LEFT
Definition Settings.h:74
#define PLACEMENT_TOP_LEFT
Definition Settings.h:68
#define PLACEMENT_CENTER_CENTER
Definition Settings.h:72
#define PLACEMENT_TOP_RIGHT
Definition Settings.h:70
#define PLACEMENT_BOTTOM_RIGHT
Definition Settings.h:76
#define PLACEMENT_CENTER_RIGHT
Definition Settings.h:73
int placement
Definition Settings.h:89
bool centeredy
Definition Settings.h:93
int rcx
Definition Settings.h:90
bool centeredx
Definition Settings.h:92
char rcString[255]
Definition Settings.h:98
int rcy
Definition Settings.h:91

◆ PositionFromPlacement()

void Settings::PositionFromPlacement ( Placement * inputPlacement)
3237{
3238 if (!multimonPlacements || (GetSystemMetrics(SM_CMONITORS) == 1)) // -> Multi-monitor placements disabled, or only one display monitor connected...
3239 {
3240 if (explorerHidden)
3241 {
3242 ScreenWidth = GetSystemMetrics(SM_CXSCREEN);
3243 ScreenHeight = GetSystemMetrics(SM_CYSCREEN);
3244 ScreenX = 0; // GetSystemMetrics(SM_XVIRTUALSCREEN);
3245 ScreenY = 0; // GetSystemMetrics(SM_YVIRTUALSCREEN);
3246 }
3247 else
3248 {
3249 RECT workArea;
3250 SystemParametersInfo(SPI_GETWORKAREA, 0, (PVOID)&workArea, SPIF_SENDCHANGE);
3251 ScreenWidth = workArea.right - workArea.left;
3252 ScreenHeight = workArea.bottom - workArea.top;
3253 ScreenX = workArea.left;
3254 ScreenY = workArea.top;
3255 }
3256 }
3257 else // -> Multi-monitor placements enabled, and more than one display monitor connected...
3258 {
3259 ScreenWidth = GetSystemMetrics(SM_CXVIRTUALSCREEN);
3260 ScreenHeight = GetSystemMetrics(SM_CYVIRTUALSCREEN);
3261 ScreenX = GetSystemMetrics(SM_XVIRTUALSCREEN);
3262 ScreenY = GetSystemMetrics(SM_YVIRTUALSCREEN);
3263 }
3264
3265 //====================
3266
3267 int tempPlacement = inputPlacement->placement;
3268
3269 //====================
3270
3271 // OppositeToolbar placement?
3272
3273 if (tempPlacement == PLACEMENT_OPPOSITE_TOOLBAR)
3274 {
3275 switch (ToolbarPlacement.placement)
3276 {
3277 case PLACEMENT_TOP_LEFT:
3278 tempPlacement = PLACEMENT_BOTTOM_LEFT;
3279 break;
3281 tempPlacement = PLACEMENT_BOTTOM_CENTER;
3282 break;
3284 tempPlacement = PLACEMENT_BOTTOM_RIGHT;
3285 break;
3286
3288 tempPlacement = PLACEMENT_CENTER_RIGHT;
3289 break;
3291 tempPlacement = PLACEMENT_CENTER_LEFT;
3292 break;
3293
3295 tempPlacement = PLACEMENT_TOP_LEFT;
3296 break;
3298 tempPlacement = PLACEMENT_TOP_CENTER;
3299 break;
3301 tempPlacement = PLACEMENT_TOP_RIGHT;
3302 break;
3303
3304 default:
3305 tempPlacement = PLACEMENT_CENTER_RIGHT;
3306 }
3307 }
3308
3309 //====================
3310
3311 switch (tempPlacement)
3312 {
3313 //====================
3314
3315 case PLACEMENT_MANUAL:
3316 {
3317 // Centered placement for x or y requested?
3318 // (optionally with +/- offset from centered position through input rcx/rcy values, see ParsePlacement() above)
3319 if (inputPlacement->centeredx) inputPlacement->x = inputPlacement->rcx + (ScreenWidth - inputPlacement->width) / 2;
3320 else inputPlacement->x = inputPlacement->rcx;
3321 if (inputPlacement->centeredy) inputPlacement->y = inputPlacement->rcy + (ScreenHeight - inputPlacement->height) / 2;
3322 else inputPlacement->y = inputPlacement->rcy;
3323
3324 // Negative coordinates -> Offset from the bottom right corner of the screen,
3325 // relative to bottom right corner of the window...
3326 if (inputPlacement->x < 0) inputPlacement->x = ScreenWidth + inputPlacement->x - inputPlacement->width;
3327 if (inputPlacement->y < 0) inputPlacement->y = ScreenHeight + inputPlacement->y - inputPlacement->height;
3328
3329 // Make sure the window is inside the visible screen...
3330 int xmax = ScreenWidth - inputPlacement->width;
3331 int ymax = ScreenHeight - inputPlacement->height;
3332 if (inputPlacement->x < 0) inputPlacement->x = 0;
3333 if (inputPlacement->y < 0) inputPlacement->y = 0;
3334 if (inputPlacement->x > xmax) inputPlacement->x = xmax;
3335 if (inputPlacement->y > ymax) inputPlacement->y = ymax;
3336 }
3337 break;
3338
3339 //====================
3340
3341 case PLACEMENT_TOP_LEFT:
3342 {
3343 inputPlacement->x = 0;
3344 inputPlacement->y = 0;
3345 }
3346 break;
3347
3348 //====================
3349
3351 {
3352 inputPlacement->x = (ScreenWidth - inputPlacement->width) / 2;
3353 inputPlacement->y = 0;
3354 }
3355 break;
3356
3357 //====================
3358
3360 {
3361 inputPlacement->x = ScreenWidth - inputPlacement->width;
3362 inputPlacement->y = 0;
3363 }
3364 break;
3365
3366 //====================
3367
3369 {
3370 inputPlacement->x = 0;
3371 inputPlacement->y = ScreenHeight - inputPlacement->height;
3372 }
3373 break;
3374
3375 //====================
3376
3378 {
3379 inputPlacement->x = (ScreenWidth - inputPlacement->width) / 2;
3380 inputPlacement->y = ScreenHeight - inputPlacement->height;
3381 }
3382 break;
3383
3384 //====================
3385
3387 {
3388 inputPlacement->x = ScreenWidth - inputPlacement->width;
3389 inputPlacement->y = ScreenHeight - inputPlacement->height;
3390 }
3391 break;
3392
3393 //====================
3394
3396 {
3397 inputPlacement->x = 0;
3398 inputPlacement->y = (ScreenHeight - inputPlacement->height) / 2;
3399 }
3400 break;
3401
3402 //====================
3403
3405 {
3406 inputPlacement->x = (ScreenWidth - inputPlacement->width) / 2;
3407 inputPlacement->y = (ScreenHeight - inputPlacement->height) / 2;
3408 }
3409 break;
3410
3411 //====================
3412
3413 case PLACEMENT_DEFAULT: // (used by the console)
3414 {
3415 inputPlacement->x = (ScreenWidth - inputPlacement->width) / 2;
3416// inputPlacement->y = ScreenHeight - desktopArea.bottom - inputPlacement->height - inputPlacement->x;
3417 inputPlacement->y = ScreenHeight - inputPlacement->height - inputPlacement->x;
3418 }
3419 break;
3420
3421 //====================
3422
3423 default: // PLACEMENT_CENTER_RIGHT
3424 {
3425 inputPlacement->x = ScreenWidth - inputPlacement->width;
3426 inputPlacement->y = (ScreenHeight - inputPlacement->height) / 2;
3427 }
3428 }
3429
3430 inputPlacement->x += ScreenX;
3431 inputPlacement->y += ScreenY;
3432}
int ScreenHeight
Definition Settings.h:575
int ScreenWidth
Definition Settings.h:574
int ScreenY
Definition Settings.h:577
int ScreenX
Definition Settings.h:576
int height
Definition Settings.h:97
int width
Definition Settings.h:96
int x
Definition Settings.h:94
int y
Definition Settings.h:95

◆ WritePlacement()

void Settings::WritePlacement ( Placement * inputPlacement)
3437{
3438 char outputString[255], outputX[5], outputY[5];
3439
3440 switch (inputPlacement->placement)
3441 {
3442 //====================
3443
3444 case PLACEMENT_MANUAL:
3445 {
3446 if (inputPlacement->centeredx) // -> Center relative x positioning
3447 {
3448 if (inputPlacement->rcx != 0) sprintf(outputX, "xC%d", inputPlacement->rcx);
3449 else strcpy(outputX, "xC");
3450 }
3451 else sprintf(outputX, "x%d", inputPlacement->rcx); // -> Left/Right relative x positioning
3452
3453 if (inputPlacement->centeredy) // -> Center relative y positioning
3454 {
3455 if (inputPlacement->rcy != 0) sprintf(outputY, "yC%d", inputPlacement->rcy);
3456 else strcpy(outputY, "yC");
3457 }
3458 else sprintf(outputY, "y%d", inputPlacement->rcy); // -> Top/Bottom relative y positioning
3459
3460 sprintf(outputString, "Manual %s %s", outputX, outputY);
3461 break;
3462 }
3463
3464 //====================
3465
3466 case PLACEMENT_TOP_LEFT: { strcpy(outputString, "TopLeft"); break; }
3467 case PLACEMENT_TOP_CENTER: { strcpy(outputString, "TopCenter"); break; }
3468 case PLACEMENT_TOP_RIGHT: { strcpy(outputString, "TopRight"); break; }
3469
3470 case PLACEMENT_CENTER_LEFT: { strcpy(outputString, "CenterLeft"); break; }
3471 case PLACEMENT_CENTER_CENTER: { strcpy(outputString, "CenterCenter"); break; }
3472 case PLACEMENT_CENTER_RIGHT: { strcpy(outputString, "CenterRight"); break; }
3473
3474 case PLACEMENT_BOTTOM_LEFT: { strcpy(outputString, "BottomLeft"); break; }
3475 case PLACEMENT_BOTTOM_CENTER: { strcpy(outputString, "BottomCenter"); break; }
3476 case PLACEMENT_BOTTOM_RIGHT: { strcpy(outputString, "BottomRight"); break; }
3477
3478 case PLACEMENT_OPPOSITE_TOOLBAR: { strcpy(outputString, "OppositeToolbar"); break; }
3479
3480 case PLACEMENT_DEFAULT: { strcpy(outputString, "Default"); break; }
3481
3482 //====================
3483
3484 default:
3485 return;
3486 }
3487
3488// strncpy(inputPlacement->rcString, outputString, sizeof(inputPlacement->rcString)); // Save the new .rc placement string, we might need it later...
3489 strncpy_s(inputPlacement->rcString, sizeof(inputPlacement->rcString), outputString, _TRUNCATE); // Save the new .rc placement string, we might need it later...
3490
3491 if (inputPlacement == &ToolbarPlacement) WriteString(xobrcFile, "xoblite.toolbar.placement:", outputString);
3492 else if (inputPlacement == &DockPlacement) WriteString(xobrcFile, "xoblite.dock.placement:", outputString);
3493 else if (inputPlacement == &ConsolePlacement) WriteString(xobrcFile, "xoblite.console.placement:", outputString);
3494 else if (inputPlacement == &desktopClockPlacement) WriteString(xobrcFile, "xoblite.desktop.clock.placement:", outputString);
3495 else if (inputPlacement == &desktopWeekdayPlacement) WriteString(xobrcFile, "xoblite.desktop.weekday.placement:", outputString);
3496 else if (inputPlacement == &desktopDatePlacement) WriteString(xobrcFile, "xoblite.desktop.date.placement:", outputString);
3497 else if (inputPlacement == &desktopGreetingPlacement) WriteString(xobrcFile, "xoblite.desktop.greeting.placement:", outputString);
3498}
void WriteString(LPCSTR fp, LPCSTR keyword, LPSTR value)
Definition BBApi.cpp:3156

◆ WriteStyle()

void Settings::WriteStyle ( )
3503{
3504 time_t systemTime;
3505 struct tm localTime;
3506 time(&systemTime);
3507 localtime_s(&localTime, &systemTime);
3508
3509 char filename[MAX_PATH], path[MAX_PATH];
3510 _locale_t timestampLocale = _create_locale(LC_TIME, "en-US"); // -> Always use en-US format for the saved style filename timestamp...
3511 _strftime_l(filename, MAX_PATH, "\\xDesigner_%Y_%m_%d_%H%M%S.style", &localTime, timestampLocale);
3512 _free_locale(timestampLocale);
3513 strcpy(path, stylesFolder);
3514 strcat(path, filename);
3515
3516 if (FileExists(path)) return;
3517 else
3518 {
3519 HANDLE file = CreateFile(path, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
3520 if (file)
3521 {
3522 char szTemp[MAX_LINE_LENGTH];
3523 DWORD retLength = 0;
3524
3525 strcpy(szTemp, "! --------------------------------------------------\r\n\r\n");
3526 WriteFile(file, szTemp, strlen(szTemp), &retLength, NULL);
3527
3528 strcpy(szTemp, "style.name: <Auto-generated>\r\nstyle.author: <xoblite Designer mode>\r\nstyle.date: \r\nstyle.credits: \r\nstyle.comments: \r\nstyle.wallpaper: \r\n\r\n");
3529 WriteFile(file, szTemp, strlen(szTemp), &retLength, NULL);
3530
3531 strcpy(szTemp, "! ----------------------------- wallpaper ----------\r\n\r\n");
3532 WriteFile(file, szTemp, strlen(szTemp), &retLength, NULL);
3533
3534 sprintf(szTemp, "rootCommand: %s\r\n\r\n", rootCommand);
3535 WriteFile(file, szTemp, strlen(szTemp), &retLength, NULL);
3536
3537 strcpy(szTemp, "! ------------------------------- toolbar ----------\r\n\r\n");
3538 WriteFile(file, szTemp, strlen(szTemp), &retLength, NULL);
3539
3541 if (!ToolbarBorder->parentRelative) WriteStyleElement(file, ToolbarBorder);
3547
3548 strcpy(szTemp, "! ---------------------------------- menu ----------\r\n\r\n");
3549 WriteFile(file, szTemp, strlen(szTemp), &retLength, NULL);
3550
3553 if (!MenuFrameBorder->parentRelative) WriteStyleElement(file, MenuFrameBorder);
3558// sprintf(szTemp, "menu.separator.color: #%02x%02x%02x\r\n\r\n", GetRValue(MenuSeparator->Color), GetGValue(MenuSeparator->Color), GetBValue(MenuSeparator->Color));
3559 WriteFile(file, szTemp, strlen(szTemp), &retLength, NULL);
3560
3561 strcpy(szTemp, "menu.bullet: ");
3562 switch (menuBullet)
3563 {
3564 case MENU_BULLET_TRIANGLE: { strcat(szTemp, "Triangle\r\n"); break; }
3565 case MENU_BULLET_SQUARE: { strcat(szTemp, "Square\r\n"); break; }
3566 case MENU_BULLET_DIAMOND: { strcat(szTemp, "Diamond\r\n"); break; }
3567 case MENU_BULLET_CIRCLE: { strcat(szTemp, "Circle\r\n"); break; }
3568 case MENU_BULLET_TRIPLE: { strcat(szTemp, "Triple\r\n"); break; }
3569 case MENU_BULLET_COMMENT: { strcat(szTemp, "Comment\r\n"); break; }
3570 case MENU_BULLET_GRID: { strcat(szTemp, "Grid\r\n"); break; }
3571 case MENU_BULLET_QUAD: { strcat(szTemp, "Quad\r\n"); break; }
3572 default: { strcat(szTemp, "Empty\r\n"); break; }
3573 }
3574 WriteFile(file, szTemp, strlen(szTemp), &retLength, NULL);
3575
3576 if (!_stricmp(menuBulletPosition, "right")) strcpy(szTemp, "menu.bullet.position: Right\r\n\r\n");
3577 else strcpy(szTemp, "menu.bullet.position: Left\r\n\r\n");
3578 WriteFile(file, szTemp, strlen(szTemp), &retLength, NULL);
3579
3580 strcpy(szTemp, "! ---------------------------------- dock ----------\r\n\r\n");
3581 WriteFile(file, szTemp, strlen(szTemp), &retLength, NULL);
3582
3583 WriteStyleElement(file, Dock);
3584 if (!DockBorder->parentRelative) WriteStyleElement(file, DockBorder);
3585
3586 strcpy(szTemp, "! ------------------------------- console ----------\r\n\r\n");
3587 WriteFile(file, szTemp, strlen(szTemp), &retLength, NULL);
3588
3589 sprintf(szTemp, "console.color: #%02x%02x%02x\r\n", GetRValue(Console->Color), GetGValue(Console->Color), GetBValue(Console->Color));
3590 WriteFile(file, szTemp, strlen(szTemp), &retLength, NULL);
3591 sprintf(szTemp, "console.textColor: #%02x%02x%02x\r\n", GetRValue(Console->TextColor), GetGValue(Console->TextColor), GetBValue(Console->TextColor));
3592 WriteFile(file, szTemp, strlen(szTemp), &retLength, NULL);
3593 sprintf(szTemp, "console.buttonColor: #%02x%02x%02x\r\n", GetRValue(Console->PicColor), GetGValue(Console->PicColor), GetBValue(Console->PicColor));
3594 WriteFile(file, szTemp, strlen(szTemp), &retLength, NULL);
3595
3596 if ((scalingFactorHiDPI > 1) && (Console->FontHeight > 0)) sprintf(szTemp, "console.font: %s/%d/", Console->Font, (Console->FontHeight / scalingFactorHiDPI));
3597 else sprintf(szTemp, "console.font: %s/%d/", Console->Font, Console->FontHeight);
3598 if (Console->FontWeight == FW_BOLD) strcat(szTemp, "Bold\r\n\r\n");
3599 else strcat(szTemp, "Normal\r\n\r\n");
3600 WriteFile(file, szTemp, strlen(szTemp), &retLength, NULL);
3601
3602 strcpy(szTemp, "! -------------------------------- window ----------\r\n\r\n");
3603 WriteFile(file, szTemp, strlen(szTemp), &retLength, NULL);
3604
3616
3617// sprintf(szTemp, "window.handleHeight: %d\r\n\r\n", (handleHeight/2));
3618// WriteFile(file, szTemp, strlen(szTemp), &retLength, NULL);
3619
3620// strcpy(szTemp, "! --------------------------------------------------\r\n\r\n");
3621// WriteFile(file, szTemp, strlen(szTemp), &retLength, NULL);
3622
3623// WriteStyleElement(file, ExternalHardware);
3624
3625 strcpy(szTemp, "! --------------------------------------------------\r\n");
3626 WriteFile(file, szTemp, strlen(szTemp), &retLength, NULL);
3627 }
3628 CloseHandle(file);
3629 }
3630
3631 char msg[MAX_LINE_LENGTH];
3632 sprintf(msg, "... style settings saved to %s .", path);
3633 SendMessage(GetBBWnd(), BB_CONSOLEMESSAGE, (WPARAM)CONSOLE_REGULAR_MESSAGE, (LPARAM)msg);
3634}
HWND GetBBWnd()
Definition BBApi.cpp:128
#define BB_CONSOLEMESSAGE
Definition BBApi.h:165
#define CONSOLE_REGULAR_MESSAGE
Definition BBApi.h:297
void WriteStyleElement(HANDLE file, StyleItem *styleItem)
Definition Settings.cpp:3638

◆ WriteStyleElement()

void Settings::WriteStyleElement ( HANDLE file,
StyleItem * styleItem )
3639{
3640 char styleElement[32], writeBuffer[MAX_LINE_LENGTH];
3641 DWORD retLength = 0;
3642
3643 if (styleItem == Toolbar) strcpy(styleElement, "toolbar");
3644 else if (styleItem == ToolbarBorder) strcpy(styleElement, "toolbar.border");
3645 else if (styleItem == ToolbarLabel) strcpy(styleElement, "toolbar.label");
3646 else if (styleItem == ToolbarWindowLabel) strcpy(styleElement, "toolbar.windowLabel");
3647 else if (styleItem == ToolbarClock) strcpy(styleElement, "toolbar.clock");
3648 else if (styleItem == ToolbarButton) strcpy(styleElement, "toolbar.button");
3649 else if (styleItem == ToolbarButtonPressed) strcpy(styleElement, "toolbar.button.pressed");
3650 else if (styleItem == MenuTitle) strcpy(styleElement, "menu.title");
3651 else if (styleItem == MenuFrame) strcpy(styleElement, "menu.frame");
3652 else if (styleItem == MenuFrameBorder) strcpy(styleElement, "menu.frame.border");
3653 else if (styleItem == MenuActive) strcpy(styleElement, "menu.active");
3654 else if (styleItem == MenuGrip) strcpy(styleElement, "menu.grip");
3655 else if (styleItem == MenuIndicator) strcpy(styleElement, "menu.indicator");
3656 else if (styleItem == MenuSeparator) strcpy(styleElement, "menu.separator");
3657 // else if (styleItem == Dock) strcpy(styleElement, "slit");
3658 else if (styleItem == Dock) strcpy(styleElement, "dock");
3659 else if (styleItem == DockBorder) strcpy(styleElement, "dock.border");
3660 else if (styleItem == WindowTitleFocus) strcpy(styleElement, "window.title.focus");
3661 else if (styleItem == WindowTitleUnfocus) strcpy(styleElement, "window.title.unfocus");
3662 else if (styleItem == WindowLabelFocus) strcpy(styleElement, "window.label.focus");
3663 else if (styleItem == WindowLabelUnfocus) strcpy(styleElement, "window.label.unfocus");
3664 else if (styleItem == WindowButtonFocus) strcpy(styleElement, "window.button.focus");
3665 else if (styleItem == WindowButtonUnfocus) strcpy(styleElement, "window.button.unfocus");
3666 else if (styleItem == WindowButtonPressed) strcpy(styleElement, "window.button.pressed");
3667 else if (styleItem == WindowGripFocus) strcpy(styleElement, "window.grip.focus");
3668 else if (styleItem == WindowGripUnfocus) strcpy(styleElement, "window.grip.unfocus");
3669 else if (styleItem == WindowHandleFocus) strcpy(styleElement, "window.handle.focus");
3670 else if (styleItem == WindowHandleUnfocus) strcpy(styleElement, "window.handle.unfocus");
3671 else if (styleItem == ExternalHardware) strcpy(styleElement, "hardware");
3672 else return;
3673
3674 //====================
3675
3676 strcpy(writeBuffer, styleElement);
3677 strcat(writeBuffer, ".appearance:");
3678 if (styleItem->type == B_PARENTRELATIVE || styleItem->parentRelative) strcat(writeBuffer, " ParentRelative");
3679 else
3680 {
3681 if ((styleItem != ToolbarBorder) && (styleItem != MenuFrameBorder) && (styleItem != DockBorder) && (styleItem != ExternalHardware))
3682 {
3683 if (styleItem->bevelstyle == BEVEL_RAISED) strcat(writeBuffer, " Raised");
3684 else if (styleItem->bevelstyle == BEVEL_SUNKEN) strcat(writeBuffer, " Sunken");
3685 else strcat(writeBuffer, " Flat");
3686 }
3687
3688 if (styleItem->type == B_SOLID) strcat(writeBuffer, " Solid");
3689 else
3690 {
3691 if ((styleItem != ToolbarBorder) && (styleItem != MenuFrameBorder) && (styleItem != DockBorder) && (styleItem != ExternalHardware))
3692 {
3693 strcat(writeBuffer, " Gradient");
3694 }
3695
3696 switch (styleItem->type)
3697 {
3698 case B_HORIZONTAL: { strcat(writeBuffer, " Horizontal"); break; }
3699 case B_VERTICAL: { strcat(writeBuffer, " Vertical"); break; }
3700 case B_DIAGONAL: { strcat(writeBuffer, " Diagonal"); break; }
3701 case B_CROSSDIAGONAL: { strcat(writeBuffer, " CrossDiagonal"); break; }
3702 case B_PIPECROSS: { strcat(writeBuffer, " Pipecross"); break; }
3703 case B_ELLIPTIC: { strcat(writeBuffer, " Elliptic"); break; }
3704 case B_RECTANGLE: { strcat(writeBuffer, " Rectangle"); break; }
3705 case B_PYRAMID: { strcat(writeBuffer, " Pyramid"); break; }
3706 case B_MIRRORHORIZONTAL: { strcat(writeBuffer, " MirrorHorizontal"); break; }
3707 case B_MIRRORVERTICAL: { strcat(writeBuffer, " MirrorVertical"); break; }
3708 case B_SPLITSOLID: { strcat(writeBuffer, " SplitSolid"); break; }
3709 case B_SPLITHORIZONTAL: { strcat(writeBuffer, " SplitHorizontal"); break; }
3710 case B_SPLITVERTICAL: { strcat(writeBuffer, " SplitVertical"); break; }
3711 case B_SUPERHORIZONTAL: { strcat(writeBuffer, " SuperHorizontal"); break; }
3712 case B_SUPERVERTICAL: { strcat(writeBuffer, " SuperVertical"); break; }
3713 default: break;
3714 }
3715 }
3716
3717 if ((styleItem != ToolbarBorder) && (styleItem != MenuFrameBorder) && (styleItem != DockBorder) && (styleItem != ExternalHardware))
3718 {
3719 if (styleItem->bevelstyle != BEVEL_FLAT)
3720 {
3721 if (styleItem->bevelposition == BEVEL2) strcat(writeBuffer, " Bevel2");
3722 else strcat(writeBuffer, " Bevel1");
3723 }
3724
3725 if (styleItem->interlaced) strcat(writeBuffer, " Interlaced");
3726 }
3727 }
3728 strcat(writeBuffer, "\r\n");
3729 WriteFile(file, writeBuffer, strlen(writeBuffer), &retLength, NULL);
3730
3731 //====================
3732
3733 char colorString[10];
3734
3735 if (styleItem->type != B_PARENTRELATIVE && !styleItem->parentRelative)
3736 {
3737 strcpy(writeBuffer, styleElement);
3738 if (styleItem->type == B_SOLID) strcat(writeBuffer, ".color:");
3739 else strcat(writeBuffer, ".color1:");
3740 sprintf(colorString, " #%02x%02x%02x\r\n", GetRValue(styleItem->Color1), GetGValue(styleItem->Color1), GetBValue(styleItem->Color1));
3741 strcat(writeBuffer, colorString);
3742 WriteFile(file, writeBuffer, strlen(writeBuffer), &retLength, NULL);
3743
3744 if (styleItem->type != B_SOLID)
3745 {
3746 strcpy(writeBuffer, styleElement);
3747 strcat(writeBuffer, ".color2:");
3748 sprintf(colorString, " #%02x%02x%02x\r\n", GetRValue(styleItem->Color2), GetGValue(styleItem->Color2), GetBValue(styleItem->Color2));
3749 strcat(writeBuffer, colorString);
3750 WriteFile(file, writeBuffer, strlen(writeBuffer), &retLength, NULL);
3751
3752 if (styleItem->type == B_SPLITHORIZONTAL || styleItem->type == B_SPLITVERTICAL || styleItem->type == B_SUPERHORIZONTAL || styleItem->type == B_SUPERVERTICAL)
3753 {
3754 strcpy(writeBuffer, styleElement);
3755 strcat(writeBuffer, ".color3:");
3756 sprintf(colorString, " #%02x%02x%02x\r\n", GetRValue(styleItem->Color3), GetGValue(styleItem->Color3), GetBValue(styleItem->Color3));
3757 strcat(writeBuffer, colorString);
3758 WriteFile(file, writeBuffer, strlen(writeBuffer), &retLength, NULL);
3759
3760 strcpy(writeBuffer, styleElement);
3761 strcat(writeBuffer, ".color4:");
3762 sprintf(colorString, " #%02x%02x%02x\r\n", GetRValue(styleItem->Color4), GetGValue(styleItem->Color4), GetBValue(styleItem->Color4));
3763 strcat(writeBuffer, colorString);
3764 WriteFile(file, writeBuffer, strlen(writeBuffer), &retLength, NULL);
3765
3766 if (styleItem->type == B_SUPERHORIZONTAL || styleItem->type == B_SUPERVERTICAL)
3767 {
3768 strcpy(writeBuffer, styleElement);
3769 strcat(writeBuffer, ".color5:");
3770 sprintf(colorString, " #%02x%02x%02x\r\n", GetRValue(styleItem->Color5), GetGValue(styleItem->Color5), GetBValue(styleItem->Color5));
3771 strcat(writeBuffer, colorString);
3772 WriteFile(file, writeBuffer, strlen(writeBuffer), &retLength, NULL);
3773
3774 strcpy(writeBuffer, styleElement);
3775 strcat(writeBuffer, ".color6:");
3776 sprintf(colorString, " #%02x%02x%02x\r\n", GetRValue(styleItem->Color6), GetGValue(styleItem->Color6), GetBValue(styleItem->Color6));
3777 strcat(writeBuffer, colorString);
3778 WriteFile(file, writeBuffer, strlen(writeBuffer), &retLength, NULL);
3779
3780 strcpy(writeBuffer, styleElement);
3781 strcat(writeBuffer, ".color7:");
3782 sprintf(colorString, " #%02x%02x%02x\r\n", GetRValue(styleItem->Color7), GetGValue(styleItem->Color7), GetBValue(styleItem->Color7));
3783 strcat(writeBuffer, colorString);
3784 WriteFile(file, writeBuffer, strlen(writeBuffer), &retLength, NULL);
3785
3786 strcpy(writeBuffer, styleElement);
3787 strcat(writeBuffer, ".color8:");
3788 sprintf(colorString, " #%02x%02x%02x\r\n", GetRValue(styleItem->Color8), GetGValue(styleItem->Color8), GetBValue(styleItem->Color8));
3789 strcat(writeBuffer, colorString);
3790 WriteFile(file, writeBuffer, strlen(writeBuffer), &retLength, NULL);
3791 }
3792 }
3793 }
3794 }
3795
3796 //====================
3797
3798 if ((styleItem != ToolbarButton) && (styleItem != ToolbarButtonPressed) && (styleItem != MenuActive) && (styleItem != MenuIndicator) && (styleItem != MenuSeparator) && (styleItem != Dock) &&
3799 (styleItem != ToolbarBorder) && (styleItem != MenuFrameBorder) && (styleItem != DockBorder) &&
3800 (styleItem != WindowTitleFocus) && (styleItem != WindowButtonFocus) && (styleItem != WindowGripFocus) && (styleItem != WindowHandleFocus) && (styleItem != WindowButtonPressed) &&
3801 (styleItem != WindowTitleUnfocus) && (styleItem != WindowButtonUnfocus) && (styleItem != WindowGripUnfocus) && (styleItem != WindowHandleUnfocus) &&
3802 (styleItem != ExternalHardware))
3803 {
3804 if ((scalingFactorHiDPI > 1) && (styleItem->FontHeight > 0)) sprintf(writeBuffer, "%s.font: %s/%d/", styleElement, styleItem->Font, (styleItem->FontHeight / scalingFactorHiDPI));
3805 else sprintf(writeBuffer, "%s.font: %s/%d/", styleElement, styleItem->Font, styleItem->FontHeight);
3806 if (styleItem->FontWeight == FW_BOLD) strcat(writeBuffer, "Bold\r\n");
3807 else strcat(writeBuffer, "Normal\r\n");
3808 WriteFile(file, writeBuffer, strlen(writeBuffer), &retLength, NULL);
3809
3810 strcpy(writeBuffer, styleElement);
3811 strcat(writeBuffer, ".alignment: ");
3812 if (styleItem->Justify == DT_LEFT) strcat(writeBuffer, "Left\r\n");
3813 else if (styleItem->Justify == DT_RIGHT) strcat(writeBuffer, "Right\r\n");
3814 else strcat(writeBuffer, "Center\r\n");
3815 WriteFile(file, writeBuffer, strlen(writeBuffer), &retLength, NULL);
3816 }
3817
3818 if ((styleItem != ToolbarButton) && (styleItem != ToolbarButtonPressed) && (styleItem != MenuIndicator) && (styleItem != MenuSeparator) && (styleItem != Dock) &&
3819 (styleItem != ToolbarBorder) && (styleItem != MenuFrameBorder) && (styleItem != DockBorder) &&
3820 (styleItem != WindowTitleFocus) && (styleItem != WindowButtonFocus) && (styleItem != WindowGripFocus) && (styleItem != WindowHandleFocus) && (styleItem != WindowButtonPressed) &&
3821 (styleItem != WindowTitleUnfocus) && (styleItem != WindowButtonUnfocus) && (styleItem != WindowGripUnfocus) && (styleItem != WindowHandleUnfocus) &&
3822 (styleItem != ExternalHardware))
3823 {
3824 strcpy(writeBuffer, styleElement);
3825 strcat(writeBuffer, ".textColor:");
3826 sprintf(colorString, " #%02x%02x%02x\r\n", GetRValue(styleItem->TextColor), GetGValue(styleItem->TextColor), GetBValue(styleItem->TextColor));
3827 strcat(writeBuffer, colorString);
3828 WriteFile(file, writeBuffer, strlen(writeBuffer), &retLength, NULL);
3829
3830 if (styleItem->FontOutline)
3831 {
3832 strcpy(writeBuffer, styleElement);
3833 strcat(writeBuffer, ".outlineColor:");
3834 sprintf(colorString, " #%02x%02x%02x\r\n", GetRValue(styleItem->OutlineColor), GetGValue(styleItem->OutlineColor), GetBValue(styleItem->OutlineColor));
3835 strcat(writeBuffer, colorString);
3836 WriteFile(file, writeBuffer, strlen(writeBuffer), &retLength, NULL);
3837 }
3838
3839 if (styleItem->FontShadow)
3840 {
3841 strcpy(writeBuffer, styleElement);
3842 strcat(writeBuffer, ".shadowColor:");
3843 sprintf(colorString, " #%02x%02x%02x\r\n", GetRValue(styleItem->ShadowColor), GetGValue(styleItem->ShadowColor), GetBValue(styleItem->ShadowColor));
3844 strcat(writeBuffer, colorString);
3845 WriteFile(file, writeBuffer, strlen(writeBuffer), &retLength, NULL);
3846 }
3847 }
3848
3849// if ((styleItem == MenuFrame) || (styleItem == MenuActive))
3850 if (styleItem == MenuFrame)
3851 {
3852 strcpy(writeBuffer, styleElement);
3853 strcat(writeBuffer, ".disabledColor:");
3854 sprintf(colorString, " #%02x%02x%02x\r\n", GetRValue(styleItem->disabledColor), GetGValue(styleItem->disabledColor), GetBValue(styleItem->disabledColor));
3855 strcat(writeBuffer, colorString);
3856 WriteFile(file, writeBuffer, strlen(writeBuffer), &retLength, NULL);
3857 }
3858
3859 //====================
3860
3861 if ((styleItem == ToolbarButton) || (styleItem == ToolbarButtonPressed) || (styleItem == WindowButtonFocus) || (styleItem == WindowButtonUnfocus) || (styleItem == WindowButtonPressed))
3862 {
3863 strcpy(writeBuffer, styleElement);
3864 strcat(writeBuffer, ".picColor:");
3865 sprintf(colorString, " #%02x%02x%02x\r\n", GetRValue(styleItem->PicColor), GetGValue(styleItem->PicColor), GetBValue(styleItem->PicColor));
3866 strcat(writeBuffer, colorString);
3867 WriteFile(file, writeBuffer, strlen(writeBuffer), &retLength, NULL);
3868 }
3869
3870 if ((styleItem == MenuFrame) || (styleItem == MenuActive))
3871 {
3872 strcpy(writeBuffer, styleElement);
3873 strcat(writeBuffer, ".bulletColor:");
3874 sprintf(colorString, " #%02x%02x%02x\r\n", GetRValue(styleItem->BulletColor), GetGValue(styleItem->BulletColor), GetBValue(styleItem->BulletColor));
3875 strcat(writeBuffer, colorString);
3876 WriteFile(file, writeBuffer, strlen(writeBuffer), &retLength, NULL);
3877 }
3878
3879 //====================
3880
3881 if ((styleItem != MenuSeparator) && (styleItem != ToolbarBorder) && (styleItem != MenuFrameBorder) && (styleItem != DockBorder) && (styleItem != ExternalHardware))
3882 {
3883 if ((scalingFactorHiDPI > 1) && (styleItem->marginWidth > 0)) sprintf(writeBuffer, "%s.marginWidth: %d\r\n", styleElement, (styleItem->marginWidth / scalingFactorHiDPI));
3884 else sprintf(writeBuffer, "%s.marginWidth: %d\r\n", styleElement, styleItem->marginWidth);
3885 WriteFile(file, writeBuffer, strlen(writeBuffer), &retLength, NULL);
3886
3887 if (styleItem->type != B_PARENTRELATIVE && !styleItem->parentRelative)
3888 {
3889 if ((scalingFactorHiDPI > 1) && (styleItem->borderWidth > 0)) sprintf(writeBuffer, "%s.borderWidth: %d\r\n", styleElement, (styleItem->borderWidth / scalingFactorHiDPI));
3890 else sprintf(writeBuffer, "%s.borderWidth: %d\r\n", styleElement, styleItem->borderWidth);
3891 WriteFile(file, writeBuffer, strlen(writeBuffer), &retLength, NULL);
3892
3893 if (styleItem->borderWidth > 0)
3894 {
3895 strcpy(writeBuffer, styleElement);
3896 strcat(writeBuffer, ".borderColor:");
3897 sprintf(colorString, " #%02x%02x%02x\r\n", GetRValue(styleItem->borderColor), GetGValue(styleItem->borderColor), GetBValue(styleItem->borderColor));
3898 strcat(writeBuffer, colorString);
3899 WriteFile(file, writeBuffer, strlen(writeBuffer), &retLength, NULL);
3900 }
3901 }
3902 }
3903
3904 //====================
3905
3906 strcpy(writeBuffer, "\r\n");
3907 WriteFile(file, writeBuffer, strlen(writeBuffer), &retLength, NULL);
3908}

Member Data Documentation

◆ menuFile

char Settings::menuFile[MAX_LINE_LENGTH]

◆ menuSeparators

bool Settings::menuSeparators

◆ menuRoundedCorners

bool Settings::menuRoundedCorners

◆ menuTransparencyAlpha

BYTE Settings::menuTransparencyAlpha

◆ menuTitleTransparencyAlpha

BYTE Settings::menuTitleTransparencyAlpha

◆ menuFrameTransparencyAlpha

BYTE Settings::menuFrameTransparencyAlpha

◆ menuGripTransparencyAlpha

BYTE Settings::menuGripTransparencyAlpha

◆ menuActiveTransparencyAlpha

BYTE Settings::menuActiveTransparencyAlpha

◆ submenuGap

int Settings::submenuGap

◆ submenuDelay

int Settings::submenuDelay

◆ toolbarHidden

bool Settings::toolbarHidden

◆ ToolbarPlacement

Placement Settings::ToolbarPlacement

◆ toolbarPlacementString

char Settings::toolbarPlacementString[MAX_LINE_LENGTH]

◆ toolbarVertical

bool Settings::toolbarVertical

◆ toolbarHorizontalWidth

int Settings::toolbarHorizontalWidth

◆ toolbarVerticalWidth

int Settings::toolbarVerticalWidth

◆ toolbarSnapToEdges

bool Settings::toolbarSnapToEdges

◆ toolbarTransparencyAlpha

BYTE Settings::toolbarTransparencyAlpha

◆ toolbarLabelTransparencyAlpha

BYTE Settings::toolbarLabelTransparencyAlpha

◆ toolbarWindowLabelTransparencyAlpha

BYTE Settings::toolbarWindowLabelTransparencyAlpha

◆ toolbarClockTransparencyAlpha

BYTE Settings::toolbarClockTransparencyAlpha

◆ toolbarButtonTransparencyAlpha

BYTE Settings::toolbarButtonTransparencyAlpha

◆ toolbarRoundedCorners

bool Settings::toolbarRoundedCorners

◆ toolbarOnTop

bool Settings::toolbarOnTop

◆ toolbarClockFormat

char Settings::toolbarClockFormat[MAX_LINE_LENGTH]

◆ toolbarLabelHidden

bool Settings::toolbarLabelHidden

◆ toolbarDownUpButtonsHidden

bool Settings::toolbarDownUpButtonsHidden

◆ toolbarLeftRightButtonsHidden

bool Settings::toolbarLeftRightButtonsHidden

◆ toolbarClockHidden

bool Settings::toolbarClockHidden

◆ toolbarAllowAsymmetry

bool Settings::toolbarAllowAsymmetry

◆ toolbarDownButtonOverride

char Settings::toolbarDownButtonOverride[MAX_LINE_LENGTH]

◆ toolbarUpButtonOverride

char Settings::toolbarUpButtonOverride[MAX_LINE_LENGTH]

◆ toolbarLeftButtonOverride

char Settings::toolbarLeftButtonOverride[MAX_LINE_LENGTH]

◆ toolbarRightButtonOverride

char Settings::toolbarRightButtonOverride[MAX_LINE_LENGTH]

◆ taskbarMode

int Settings::taskbarMode

◆ taskbarMaxItems

int Settings::taskbarMaxItems

◆ taskbarSorting

int Settings::taskbarSorting

◆ taskbarShowTaskWorkspace

bool Settings::taskbarShowTaskWorkspace

◆ taskbarCurrentOnly

bool Settings::taskbarCurrentOnly

◆ taskbarFlashing

bool Settings::taskbarFlashing

◆ taskbarSaturationValue

unsigned int Settings::taskbarSaturationValue

◆ taskbarHueIntensity

unsigned int Settings::taskbarHueIntensity

◆ taskbarActiveSatHue

bool Settings::taskbarActiveSatHue

◆ taskbarActiveTransparencyAlpha

BYTE Settings::taskbarActiveTransparencyAlpha

◆ taskbarActiveLivePreview

bool Settings::taskbarActiveLivePreview

◆ taskbarInactiveBackground

bool Settings::taskbarInactiveBackground

◆ taskbarTooltips

bool Settings::taskbarTooltips

◆ dockHidden

bool Settings::dockHidden

◆ DockPlacement

Placement Settings::DockPlacement

◆ dockPlacementString

char Settings::dockPlacementString[MAX_LINE_LENGTH]

◆ dockDirection

char Settings::dockDirection[MAX_LINE_LENGTH]

◆ dockVertical

bool Settings::dockVertical

◆ dockPuzzlePositioning

bool Settings::dockPuzzlePositioning

◆ dockOnTop

bool Settings::dockOnTop

◆ dockSnapToEdges

bool Settings::dockSnapToEdges

◆ dockTransparencyAlpha

BYTE Settings::dockTransparencyAlpha

◆ consoleHidden

bool Settings::consoleHidden

◆ ConsolePlacement

Placement Settings::ConsolePlacement

◆ consoleMaximized

bool Settings::consoleMaximized

◆ consoleMaximizedWidth

int Settings::consoleMaximizedWidth

◆ consoleMaximizedMessages

int Settings::consoleMaximizedMessages

◆ consoleRestoredWidth

int Settings::consoleRestoredWidth

◆ consoleRestoredMessages

int Settings::consoleRestoredMessages

◆ consoleTransparencyAlpha

BYTE Settings::consoleTransparencyAlpha

◆ consoleDesktopMode

bool Settings::consoleDesktopMode

◆ consoleRoundedCorners

bool Settings::consoleRoundedCorners

◆ consolePadding

int Settings::consolePadding

◆ desktopClockHidden

bool Settings::desktopClockHidden

◆ desktopClockType

char Settings::desktopClockType[MAX_LINE_LENGTH]

◆ desktopClockPlacement

Placement Settings::desktopClockPlacement

◆ desktopClockTransparencyAlpha

BYTE Settings::desktopClockTransparencyAlpha

◆ desktopClockFontDefined

bool Settings::desktopClockFontDefined

◆ desktopClockFont

char Settings::desktopClockFont[128]

◆ desktopClockFontHeight

int Settings::desktopClockFontHeight

◆ desktopClockFontWeight

int Settings::desktopClockFontWeight

◆ desktopWeekdayHidden

bool Settings::desktopWeekdayHidden

◆ desktopWeekdayPlacement

Placement Settings::desktopWeekdayPlacement

◆ desktopWeekdayTransparencyAlpha

BYTE Settings::desktopWeekdayTransparencyAlpha

◆ desktopWeekdayFontDefined

bool Settings::desktopWeekdayFontDefined

◆ desktopWeekdayFont

char Settings::desktopWeekdayFont[128]

◆ desktopWeekdayFontHeight

int Settings::desktopWeekdayFontHeight

◆ desktopWeekdayFontWeight

int Settings::desktopWeekdayFontWeight

◆ desktopDateHidden

bool Settings::desktopDateHidden

◆ desktopDateFormat

char Settings::desktopDateFormat[MAX_LINE_LENGTH]

◆ desktopDatePlacement

Placement Settings::desktopDatePlacement

◆ desktopDateTransparencyAlpha

BYTE Settings::desktopDateTransparencyAlpha

◆ desktopDateFontDefined

bool Settings::desktopDateFontDefined

◆ desktopDateFont

char Settings::desktopDateFont[128]

◆ desktopDateFontHeight

int Settings::desktopDateFontHeight

◆ desktopDateFontWeight

int Settings::desktopDateFontWeight

◆ desktopGreetingHidden

bool Settings::desktopGreetingHidden

◆ desktopGreetingPlacement

Placement Settings::desktopGreetingPlacement

◆ desktopGreetingTransparencyAlpha

BYTE Settings::desktopGreetingTransparencyAlpha

◆ desktopGreetingFontDefined

bool Settings::desktopGreetingFontDefined

◆ desktopGreetingFont

char Settings::desktopGreetingFont[128]

◆ desktopGreetingFontHeight

int Settings::desktopGreetingFontHeight

◆ desktopGreetingFontWeight

int Settings::desktopGreetingFontWeight

◆ desktopWorkspaceIndicatorHidden

bool Settings::desktopWorkspaceIndicatorHidden

◆ desktopBorderHidden

bool Settings::desktopBorderHidden

◆ desktopWidgetColor

COLORREF Settings::desktopWidgetColor

◆ desktopRClickOverride

char Settings::desktopRClickOverride[MAX_LINE_LENGTH]

◆ desktopMClickOverride

char Settings::desktopMClickOverride[MAX_LINE_LENGTH]

◆ desktopX1ClickOverride

char Settings::desktopX1ClickOverride[MAX_LINE_LENGTH]

◆ desktopX2ClickOverride

char Settings::desktopX2ClickOverride[MAX_LINE_LENGTH]

◆ hotkeysFile

char Settings::hotkeysFile[MAX_LINE_LENGTH]

◆ numberOfWorkspaces

int Settings::numberOfWorkspaces

◆ workspaceNames

char Settings::workspaceNames[MAX_LINE_LENGTH]

◆ mousewheelChanging

bool Settings::mousewheelChanging

◆ followActive

bool Settings::followActive

◆ wallpaperPerWorkspace

bool Settings::wallpaperPerWorkspace

◆ wallpaperPerWorkspaceSemaphore

bool Settings::wallpaperPerWorkspaceSemaphore

◆ pluginsFile

char Settings::pluginsFile[MAX_LINE_LENGTH]

◆ pluginsHidden

bool Settings::pluginsHidden

◆ pluginsRepository

char Settings::pluginsRepository[MAX_LINE_LENGTH]

◆ themesFolder

char Settings::themesFolder[MAX_PATH]

◆ stylesFolder

char Settings::stylesFolder[MAX_PATH]

◆ wallpapersFolder

char Settings::wallpapersFolder[MAX_PATH]

◆ soundsFolder

char Settings::soundsFolder[MAX_PATH]

◆ selectedTheme

char Settings::selectedTheme[MAX_PATH]

◆ styleFile

char Settings::styleFile[MAX_LINE_LENGTH]

◆ doubleScaleHiDPI

bool Settings::doubleScaleHiDPI

◆ scalingFactorHiDPI

int Settings::scalingFactorHiDPI

◆ multimonPlacements

bool Settings::multimonPlacements

◆ enableSoundFX

bool Settings::enableSoundFX

◆ designerModeEnabled

bool Settings::designerModeEnabled

◆ writeProtection

bool Settings::writeProtection

◆ disableRootCommands

bool Settings::disableRootCommands

◆ disableThemeFonts

bool Settings::disableThemeFonts

◆ disableScriptSupport

bool Settings::disableScriptSupport

◆ disableUnicodeParsing

bool Settings::disableUnicodeParsing

◆ explorerHidden

bool Settings::explorerHidden

◆ timeDateLocale

char Settings::timeDateLocale[MAX_LINE_LENGTH]

◆ preferredEditor

char Settings::preferredEditor[MAX_LINE_LENGTH]

◆ checkedForUpdates

char Settings::checkedForUpdates[20]

◆ edgeSnapThreshold

int Settings::edgeSnapThreshold

◆ debugLogging

bool Settings::debugLogging

◆ machineArchitecture

USHORT Settings::machineArchitecture

◆ operatingSystemVersion

int Settings::operatingSystemVersion

◆ runningUnderWOW64

BOOL Settings::runningUnderWOW64

◆ underExplorer

bool Settings::underExplorer

◆ accessLock

bool Settings::accessLock

◆ currentWorkspace

int Settings::currentWorkspace

◆ lastWorkspace

int Settings::lastWorkspace

◆ SF_blackboxPath

char Settings::SF_blackboxPath[MAX_PATH]

◆ SF_startMenu

char Settings::SF_startMenu[MAX_PATH]

◆ SF_commonStartMenu

char Settings::SF_commonStartMenu[MAX_PATH]

◆ SF_programFiles

char Settings::SF_programFiles[MAX_PATH]

◆ SF_desktop

char Settings::SF_desktop[MAX_PATH]

◆ SF_userAppData

char Settings::SF_userAppData[MAX_PATH]

◆ SF_userProfile

char Settings::SF_userProfile[MAX_PATH]

◆ SF_currentThemePath

char Settings::SF_currentThemePath[MAX_PATH]

◆ usingDefaultTheme

bool Settings::usingDefaultTheme

◆ menuEditboxAlreadyActive

bool Settings::menuEditboxAlreadyActive

◆ menuEditboxStringItemPtr

MenuItem* Settings::menuEditboxStringItemPtr

◆ checkingForUpdates

bool Settings::checkingForUpdates

◆ Statistics

struct Settings::Statistics Settings::Statistics

◆ bbrcFile

char Settings::bbrcFile[MAX_LINE_LENGTH]

◆ xobrcFile

char Settings::xobrcFile[MAX_LINE_LENGTH]

◆ xobrcDefaultFile

char Settings::xobrcDefaultFile[MAX_LINE_LENGTH]

◆ bbrcCache

char* Settings::bbrcCache

◆ xobrcCache

char* Settings::xobrcCache

◆ xobrcDefaultCache

char* Settings::xobrcDefaultCache

◆ styleCache

char* Settings::styleCache

◆ Wildcard

StyleItem* Settings::Wildcard

◆ Toolbar

StyleItem* Settings::Toolbar

◆ ToolbarLabel

StyleItem* Settings::ToolbarLabel

◆ ToolbarWindowLabel

StyleItem* Settings::ToolbarWindowLabel

◆ ToolbarClock

StyleItem* Settings::ToolbarClock

◆ ToolbarButton

StyleItem* Settings::ToolbarButton

◆ ToolbarButtonPressed

StyleItem* Settings::ToolbarButtonPressed

◆ ToolbarBorder

StyleItem* Settings::ToolbarBorder

◆ MenuTitle

StyleItem* Settings::MenuTitle

◆ MenuFrame

StyleItem* Settings::MenuFrame

◆ MenuActive

StyleItem* Settings::MenuActive

◆ MenuGrip

StyleItem* Settings::MenuGrip

◆ MenuFrameBullet

StyleItem* Settings::MenuFrameBullet

◆ MenuActiveBullet

StyleItem* Settings::MenuActiveBullet

◆ MenuIndicator

StyleItem* Settings::MenuIndicator

◆ MenuSeparator

StyleItem* Settings::MenuSeparator

◆ MenuFrameBorder

StyleItem* Settings::MenuFrameBorder

◆ Dock

StyleItem* Settings::Dock

◆ DockBorder

StyleItem* Settings::DockBorder

◆ ActiveTask

StyleItem* Settings::ActiveTask

◆ InactiveTask

StyleItem* Settings::InactiveTask

◆ FlashingTask

StyleItem* Settings::FlashingTask

◆ Console

StyleItem* Settings::Console

◆ WindowTitleFocus

StyleItem* Settings::WindowTitleFocus

◆ WindowTitleUnfocus

StyleItem* Settings::WindowTitleUnfocus

◆ WindowLabelFocus

StyleItem* Settings::WindowLabelFocus

◆ WindowLabelUnfocus

StyleItem* Settings::WindowLabelUnfocus

◆ WindowButtonFocus

StyleItem* Settings::WindowButtonFocus

◆ WindowButtonUnfocus

StyleItem* Settings::WindowButtonUnfocus

◆ WindowButtonPressed

StyleItem* Settings::WindowButtonPressed

◆ WindowGripFocus

StyleItem* Settings::WindowGripFocus

◆ WindowGripUnfocus

StyleItem* Settings::WindowGripUnfocus

◆ WindowHandleFocus

StyleItem* Settings::WindowHandleFocus

◆ WindowHandleUnfocus

StyleItem* Settings::WindowHandleUnfocus

◆ ExternalHardware

StyleItem* Settings::ExternalHardware

◆ selectedElement

StyleItem* Settings::selectedElement

◆ wildcardToolbarFont

char Settings::wildcardToolbarFont[255]

◆ wildcardMenuFont

char Settings::wildcardMenuFont[255]

◆ wildcardWindowFont

char Settings::wildcardWindowFont[255]

◆ wildcard

char Settings::wildcard[MAX_LINE_LENGTH]

◆ toolbar

char Settings::toolbar[MAX_LINE_LENGTH]

◆ toolbarLabel

char Settings::toolbarLabel[MAX_LINE_LENGTH]

◆ toolbarWindowLabel

char Settings::toolbarWindowLabel[MAX_LINE_LENGTH]

◆ toolbarClock

char Settings::toolbarClock[MAX_LINE_LENGTH]

◆ toolbarButton

char Settings::toolbarButton[MAX_LINE_LENGTH]

◆ toolbarButtonPressed

char Settings::toolbarButtonPressed[MAX_LINE_LENGTH]

◆ toolbarBorder

char Settings::toolbarBorder[MAX_LINE_LENGTH]

◆ menuTitle

char Settings::menuTitle[MAX_LINE_LENGTH]

◆ menuFrame

char Settings::menuFrame[MAX_LINE_LENGTH]

◆ menuActive

char Settings::menuActive[MAX_LINE_LENGTH]

◆ menuGrip

char Settings::menuGrip[MAX_LINE_LENGTH]

◆ menuIndicator

char Settings::menuIndicator[MAX_LINE_LENGTH]

◆ menuSeparator

char Settings::menuSeparator[MAX_LINE_LENGTH]

◆ menuFrameBorder

char Settings::menuFrameBorder[MAX_LINE_LENGTH]

◆ dock

char Settings::dock[MAX_LINE_LENGTH]

◆ dockBorder

char Settings::dockBorder[MAX_LINE_LENGTH]

◆ console

char Settings::console[MAX_LINE_LENGTH]

◆ windowTitleFocus

char Settings::windowTitleFocus[MAX_LINE_LENGTH]

◆ windowTitleUnfocus

char Settings::windowTitleUnfocus[MAX_LINE_LENGTH]

◆ windowLabelFocus

char Settings::windowLabelFocus[MAX_LINE_LENGTH]

◆ windowLabelUnfocus

char Settings::windowLabelUnfocus[MAX_LINE_LENGTH]

◆ windowButtonFocus

char Settings::windowButtonFocus[MAX_LINE_LENGTH]

◆ windowButtonUnfocus

char Settings::windowButtonUnfocus[MAX_LINE_LENGTH]

◆ windowButtonPressed

char Settings::windowButtonPressed[MAX_LINE_LENGTH]

◆ windowGripFocus

char Settings::windowGripFocus[MAX_LINE_LENGTH]

◆ windowGripUnfocus

char Settings::windowGripUnfocus[MAX_LINE_LENGTH]

◆ windowHandleFocus

char Settings::windowHandleFocus[MAX_LINE_LENGTH]

◆ windowHandleUnfocus

char Settings::windowHandleUnfocus[MAX_LINE_LENGTH]

◆ externalHardware

char Settings::externalHardware[MAX_LINE_LENGTH]

◆ appearancePointer

LPSTR Settings::appearancePointer

◆ menuBullet

int Settings::menuBullet

◆ menuFrameBulletAsString

char Settings::menuFrameBulletAsString[MAX_LINE_LENGTH]

◆ menuActiveBulletAsString

char Settings::menuActiveBulletAsString[MAX_LINE_LENGTH]

◆ menuBulletPosition

char Settings::menuBulletPosition[MAX_LINE_LENGTH]

◆ consoleFontDefined

bool Settings::consoleFontDefined

◆ consoleFont

char Settings::consoleFont[128]

◆ consoleFontHeight

int Settings::consoleFontHeight

◆ consoleFontWeight

int Settings::consoleFontWeight

◆ globalFontOverride

bool Settings::globalFontOverride

◆ globalFont

char Settings::globalFont[128]

◆ globalFontHeight

int Settings::globalFontHeight

◆ borderWidth

int Settings::borderWidth

◆ menuBorderWidth

int Settings::menuBorderWidth

◆ borderColor

COLORREF Settings::borderColor

◆ menuBorderColor

COLORREF Settings::menuBorderColor

◆ bevelWidth

int Settings::bevelWidth

◆ marginWidth

int Settings::marginWidth

◆ handleHeight

int Settings::handleHeight

◆ frameWidth

int Settings::frameWidth

◆ rootCommand

char Settings::rootCommand[MAX_LINE_LENGTH]

◆ ScreenWidth

int Settings::ScreenWidth

◆ ScreenHeight

int Settings::ScreenHeight

◆ ScreenX

int Settings::ScreenX

◆ ScreenY

int Settings::ScreenY

◆ red

BYTE Settings::red

◆ green

BYTE Settings::green

◆ blue

BYTE Settings::blue