#ifndef __BBSETTINGS_H
#define __BBSETTINGS_H
#include "BBApi.h"
#include <stdlib.h>
#ifndef SHSTDAPI
#if defined(_SHELL32_)
#define SHSTDAPI STDAPI
#define SHSTDAPI_(type) STDAPI_(type)
#else
#define SHSTDAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
#define SHSTDAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
#endif
#endif
#ifndef SHGetSpecialFolderPath
SHSTDAPI_(BOOL) SHGetSpecialFolderPathA(HWND hwnd, LPSTR pszPath, int csidl, BOOL fCreate);
SHSTDAPI_(BOOL) SHGetSpecialFolderPathW(HWND hwnd, LPWSTR pszPath, int csidl, BOOL fCreate);
#ifdef UNICODE
#define SHGetSpecialFolderPath SHGetSpecialFolderPathW
#else
#define SHGetSpecialFolderPath SHGetSpecialFolderPathA
#endif
#endif
#ifndef CSIDL_PROGRAMS
#define CSIDL_PROGRAMS 0x0002
#endif
#ifndef CSIDL_DESKTOPDIRECTORY
#define CSIDL_DESKTOPDIRECTORY 0x0010
#endif
#ifndef CSIDL_COMMON_PROGRAMS
#define CSIDL_COMMON_PROGRAMS 0x0017
#endif
#ifndef CSIDL_APPDATA
#define CSIDL_APPDATA 0x001a
#endif
#ifndef CSIDL_PROGRAM_FILES
#define CSIDL_PROGRAM_FILES 0x0026
#endif
class Settings
{
public:
Settings();
~Settings();
void DeleteStyleItems();
void ReadRCSettings();
void WriteDefaultRCSettings();
void ReadExtensionsRCSettings();
void WriteDefaultMenu();
void ReadStyleSettings();
void ReadStyleElement(LPSTR styleFile, StyleItem* styleItem, LPSTR paramString, bool bb4nix070syntax, bool readFont);
COLORREF CreateShadowColor(StyleItem* styleItem, COLORREF color, COLORREF colorTo, COLORREF textColor);
void GetShellFolders();
int GetInt(LPCSTR fp, LPCSTR szString, int szDefault);
LPSTR GetString(LPCSTR fp, LPCSTR szString, LPSTR szDefault);
COLORREF GetColor(LPCSTR fp, LPCSTR szString, LPCSTR szDefault, COLORREF szDefaultRef, bool useDefaultRef);
int workspaces;
bool focusLastWindow;
char windowPlacement[MAX_LINE_LENGTH];
char colPlacementDirection[MAX_LINE_LENGTH];
char workspaceNames[MAX_LINE_LENGTH];
bool focusNewWindows;
char rowPlacementDirection[MAX_LINE_LENGTH];
bool fullMaximization;
char strftimeFormat[MAX_LINE_LENGTH];
int edgeSnapThreshold;
char focusModel[MAX_LINE_LENGTH];
bool intelliMouse;
char styleFile[MAX_LINE_LENGTH];
int cacheLife;
int cacheMax;
bool opaqueMove;
int doubleClickInterval;
int autoRaiseDelay;
char menuFile[MAX_LINE_LENGTH];
int colorsPerChannel;
bool imageDither;
bool toolbarOnTop;
bool toolbarAutoHide;
char toolbarPlacement[MAX_LINE_LENGTH];
int toolbarWidthPercent;
char slitPlacement[MAX_LINE_LENGTH];
char slitDirection[MAX_LINE_LENGTH];
bool slitOnTop;
bool slitAutoHide;
bool toolbarHidden;
bool toolbarSnapToEdges;
BYTE toolbarTransparencyAlpha;
bool systembarHidden;
char systembarPlacement[MAX_LINE_LENGTH];
bool systembarOnTop;
bool systembarSnapToEdges;
int systembarWidthPercent;
bool systembarTooltipsDisabled;
BYTE systembarTransparencyAlpha;
bool systembarFirstInSlit;
bool systembarXobloonNotifications;
bool systrayDisabled;
bool systrayHidden;
unsigned int systraySaturationValue;
unsigned int systrayHueIntensity;
bool taskbarHidden;
bool taskbarOnToolbar;
int taskbarMode;
bool taskbarCurrentOnly;
bool taskbarFlashing;
unsigned int taskbarSaturationValue;
unsigned int taskbarHueIntensity;
bool taskbarActiveSatHue;
bool taskbarInactiveBackground;
bool slitHidden;
bool slitSnapToEdges;
BYTE slitTransparencyAlpha;
char slitPositioning[MAX_LINE_LENGTH];
int submenuDelay;
int scrollSpeed;
int wheelSpeed;
BYTE menuTransparencyAlpha;
bool midclickStylesMenu;
char stylesFolder[MAX_PATH];
char themesFolder[MAX_PATH];
char selectedTheme[MAX_PATH];
bool menuSeparators;
bool pluginsHidden;
char pluginsRepository[MAX_LINE_LENGTH];
char checkedForUpdates[20];
int autohideSpeed;
bool followActive;
bool slimlineMetrics;
bool alternativeBullets;
bool forceFontShadows;
bool writeProtection;
bool disableRootCommands;
bool disableScriptSupport;
char preferredEditor[MAX_LINE_LENGTH];
bool runStartupApps;
RECT desktopArea;
bool desktopAreaNotDefined;
bool debugLogging;
bool underExplorer;
bool usingWin2kXP;
bool accessLock;
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_currentThemePath[MAX_PATH];
bool usingDefaultTheme;
bool menuEditboxAlreadyActive;
bool checkingForUpdates;
char bbrcFile[MAX_LINE_LENGTH];
char plugrcFile[MAX_LINE_LENGTH];
char extrcFile[MAX_LINE_LENGTH];
char extrcDefaultFile[MAX_LINE_LENGTH];
StyleItem *Toolbar;
StyleItem *ToolbarLabel;
StyleItem *ToolbarWindowLabel;
StyleItem *ToolbarClock;
StyleItem *ToolbarButton;
StyleItem *ToolbarButtonPressed;
StyleItem *MenuTitle;
StyleItem *MenuFrame;
StyleItem *MenuHilite;
StyleItem *MenuIndicator;
StyleItem *Slit;
StyleItem *ActiveTask;
StyleItem *InactiveTask;
StyleItem *FlashingTask;
char wildcardFont[255];
char wildcardToolbarFont[255];
char wildcardMenuFont[255];
char wildcardJustify[MAX_LINE_LENGTH];
COLORREF wildcardTextColor;
char wildcardTextColorString[MAX_LINE_LENGTH];
int wildcardBorderWidth;
COLORREF wildcardBorderColor;
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 menuTitle[MAX_LINE_LENGTH];
char menuFrame[MAX_LINE_LENGTH];
char menuHilite[MAX_LINE_LENGTH];
char menuIndicator[MAX_LINE_LENGTH];
char slit[MAX_LINE_LENGTH];
LPSTR appearancePointer;
char toolbarJustify[MAX_LINE_LENGTH];
char menuTitleJustify[MAX_LINE_LENGTH];
char menuFrameJustify[MAX_LINE_LENGTH];
COLORREF toolbarLabelShadowColor;
COLORREF toolbarWindowLabelShadowColor;
COLORREF toolbarClockShadowColor;
COLORREF menuTitleShadowColor;
COLORREF menuFrameShadowColor;
COLORREF menuHiliteShadowColor;
COLORREF activeTaskShadowColor;
COLORREF inactiveTaskShadowColor;
COLORREF flashingTaskShadowColor;
COLORREF menuFrameDisableColor;
char menuBullet[MAX_LINE_LENGTH];
char menuBulletPosition[MAX_LINE_LENGTH];
COLORREF menuFrameBulletColor;
COLORREF menuHiliteBulletColor;
COLORREF menuSeparatorColor;
int borderWidth;
int menuBorderWidth;
COLORREF borderColor;
COLORREF menuBorderColor;
int bevelWidth;
int marginWidth;
int handleWidth;
int frameWidth;
char rootCommand[MAX_LINE_LENGTH];
};
#endif
syntax highlighting by