diff options
author | George Hazan <george.hazan@gmail.com> | 2016-08-03 09:55:35 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-08-03 09:55:35 +0000 |
commit | e5868034a9b3cefc7b3d785e97b40b5382108fc8 (patch) | |
tree | 1e94fd7faae5deba5a50af41db8c81f2949e9023 /include/m_fontservice.h | |
parent | 7ba9a0439558e45e45d176d790f6b35e80d51ad5 (diff) |
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@17158 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include/m_fontservice.h')
-rw-r--r-- | include/m_fontservice.h | 191 |
1 files changed, 95 insertions, 96 deletions
diff --git a/include/m_fontservice.h b/include/m_fontservice.h index 10fb006760..ad89aeab34 100644 --- a/include/m_fontservice.h +++ b/include/m_fontservice.h @@ -17,18 +17,18 @@ #define DBFONTF_STRIKEOUT 8
// flags for compatibility
-#define FIDF_APPENDNAME 1 // append 'Name' to the setting used to store font face (as CLC settings require)
-#define FIDF_NOAS 2 // disable the <prefix>As setting to prevent 'same as' behaviour
-#define FIDF_SAVEACTUALHEIGHT 4 // write the actual height of a test string to the db
-#define FIDF_SAVEPOINTSIZE 8 // write the font point size to the db
+#define FIDF_APPENDNAME 0x0001 // append 'Name' to the setting used to store font face (as CLC settings require)
+#define FIDF_NOAS 0x0002 // disable the <prefix>As setting to prevent 'same as' behaviour
+#define FIDF_SAVEACTUALHEIGHT 0x0004 // write the actual height of a test string to the db
+#define FIDF_SAVEPOINTSIZE 0x0008 // write the font point size to the db
// additional flags
-#define FIDF_DEFAULTVALID 32 // the default font settings are valid - else, just use generic default
-#define FIDF_NEEDRESTART 64 // setting changes will not take effect until miranda is restarted
-#define FIDF_ALLOWREREGISTER 128 // allow plugins to register this font again (i.e. override already registered settings such as flags)
-#define FIDF_ALLOWEFFECTS 256 // allow setting of font effects (i.e. underline and strikeout)
-#define FIDF_DISABLESTYLES 512 // don't allow to select font attributes (bold/underline/italics)
- // FIDF_ALLOWEFFECTS has priority and will override this flag!
+#define FIDF_DEFAULTVALID 0x0020 // the default font settings are valid - else, just use generic default
+#define FIDF_NEEDRESTART 0x0040 // setting changes will not take effect until miranda is restarted
+#define FIDF_ALLOWREREGISTER 0x0080 // allow plugins to register this font again (i.e. override already registered settings such as flags)
+#define FIDF_ALLOWEFFECTS 0x0100 // allow setting of font effects (i.e. underline and strikeout)
+#define FIDF_DISABLESTYLES 0x0200 // don't allow to select font attributes (bold/underline/italics)
+ // FIDF_ALLOWEFFECTS has priority and will override this flag!
// font class
#define FIDF_CLASSMASK 0x70000000
@@ -37,62 +37,60 @@ #define FIDF_CLASSSMALL 0x30000000
// settings to be used for the value of 'deffontsettings' in the FontID structure below - i.e. defaults
-typedef struct FontSettings_tag
+
+struct FontSettings
{
COLORREF colour;
- char size;
- BYTE style; // see the DBFONTF_* flags above
- BYTE charset;
- char szFace[LF_FACESIZE];
-}
- FontSettings;
+ char size;
+ BYTE style; // see the DBFONTF_* flags above
+ BYTE charset;
+ char szFace[LF_FACESIZE];
+};
-typedef struct FontSettingsW_tag
+struct FontSettingsW
{
COLORREF colour;
- char size;
- BYTE style; // see the DBFONTF_* flags above
- BYTE charset;
- wchar_t szFace[LF_FACESIZE];
-}
- FontSettingsW;
+ char size;
+ BYTE style; // see the DBFONTF_* flags above
+ BYTE charset;
+ wchar_t szFace[LF_FACESIZE];
+};
// a font identifier structure - used for registering a font, and getting one out again
// WARNING: do not use Translate(TS) for name or group as they
// are translated by the core, which may lead to double translation.
// Use LPGEN instead which are just dummy wrappers/markers for "lpgen.pl".
-typedef struct FontID_tag
+
+struct FontID
{
int cbSize;
- char group[64]; // [TRANSLATED-BY-CORE] group the font belongs to - this is the 'Font Group' list in the options page
- char name[64]; // [TRANSLATED-BY-CORE] this is the name of the font setting - e.g. 'contacts' in the 'contact list' group
- char dbSettingsGroup[32]; // the 'module' in the database where the font data is stored
- char prefix[32]; // this is prepended to the settings used to store this font's data in the db
- DWORD flags; // bitwise OR of the FIDF_* flags above
- FontSettings deffontsettings; // defaults, valid if flags & FIDF_DEFAULTVALID
- int order; // controls the order in the font group in which the fonts are listed in the UI (if order fields are equal,
- // they will be ordered alphabetically by name)
- char backgroundGroup[64];
- char backgroundName[64];
-}
- FontID;
-
-typedef struct FontIDW_tag
+ char group[64]; // [TRANSLATED-BY-CORE] group the font belongs to - this is the 'Font Group' list in the options page
+ char name[64]; // [TRANSLATED-BY-CORE] this is the name of the font setting - e.g. 'contacts' in the 'contact list' group
+ char dbSettingsGroup[32]; // the 'module' in the database where the font data is stored
+ char prefix[32]; // this is prepended to the settings used to store this font's data in the db
+ DWORD flags; // bitwise OR of the FIDF_* flags above
+ FontSettings deffontsettings; // defaults, valid if flags & FIDF_DEFAULTVALID
+ int order; // controls the order in the font group in which the fonts are listed in the UI (if order fields are equal,
+ // they will be ordered alphabetically by name)
+ char backgroundGroup[64];
+ char backgroundName[64];
+};
+
+struct FontIDW
{
- int cbSize;
- wchar_t group[64]; // [TRANSLATED-BY-CORE] group the font belongs to - this is the 'Font Group' list in the options page
- wchar_t name[64]; // [TRANSLATED-BY-CORE] this is the name of the font setting - e.g. 'contacts' in the 'contact list' group
- char dbSettingsGroup[32]; // the 'module' in the database where the font data is stored
- char prefix[32]; // this is prepended to the settings used to store this font's data in the db
- DWORD flags; // bitwise OR of the FIDF_* flags above
+ int cbSize;
+ wchar_t group[64]; // [TRANSLATED-BY-CORE] group the font belongs to - this is the 'Font Group' list in the options page
+ wchar_t name[64]; // [TRANSLATED-BY-CORE] this is the name of the font setting - e.g. 'contacts' in the 'contact list' group
+ char dbSettingsGroup[32]; // the 'module' in the database where the font data is stored
+ char prefix[32]; // this is prepended to the settings used to store this font's data in the db
+ DWORD flags; // bitwise OR of the FIDF_* flags above
FontSettingsW deffontsettings; // defaults, valid if flags & FIDF_DEFAULTVALID
- int order; // controls the order in the font group in which the fonts are listed in the UI (if order fields are equal,
- // they will be ordered alphabetically by name)
+ int order; // controls the order in the font group in which the fonts are listed in the UI (if order fields are equal,
+ // they will be ordered alphabetically by name)
wchar_t backgroundGroup[64];
wchar_t backgroundName[64];
-}
- FontIDW;
+};
// register a font
// wparam = (FontID *)&font_id
@@ -100,12 +98,14 @@ typedef struct FontIDW_tag extern int hLangpack;
-__forceinline void FontRegister( FontID* pFontID )
-{ CallService("Font/Register", (WPARAM)pFontID, hLangpack);
+__forceinline void FontRegister(FontID* pFontID)
+{
+ CallService("Font/Register", (WPARAM)pFontID, hLangpack);
}
-__forceinline void FontRegisterW( FontIDW* pFontID )
-{ CallService("Font/RegisterW", (WPARAM)pFontID, hLangpack);
+__forceinline void FontRegisterW(FontIDW* pFontID)
+{
+ CallService("Font/RegisterW", (WPARAM)pFontID, hLangpack);
}
// get a font
@@ -133,7 +133,8 @@ __forceinline void FontRegisterW( FontIDW* pFontID ) // WARNING: do not use Translate(TS) for name or group as they
// are translated by the core, which may lead to double translation.
// Use LPGEN instead which are just dummy wrappers/markers for "lpgen.pl".
-typedef struct ColourID_tag
+
+struct ColourID
{
int cbSize;
char group[64]; // [TRANSLATED-BY-CORE]
@@ -143,22 +144,20 @@ typedef struct ColourID_tag DWORD flags; // not used
COLORREF defcolour; // default value
int order;
-}
- ColourID;
+};
// a font identifier structure - used for registering a font, and getting one out again
-typedef struct ColourIDW_tag
+struct ColourIDW
{
- int cbSize;
- wchar_t group[64]; // [TRANSLATED-BY-CORE]
- wchar_t name[64]; // [TRANSLATED-BY-CORE]
- char dbSettingsGroup[32];
- char setting[32];
- DWORD flags; // not used
- COLORREF defcolour; // default value
- int order;
-}
- ColourIDW;
+ int cbSize;
+ wchar_t group[64]; // [TRANSLATED-BY-CORE]
+ wchar_t name[64]; // [TRANSLATED-BY-CORE]
+ char dbSettingsGroup[32];
+ char setting[32];
+ DWORD flags; // not used
+ COLORREF defcolour; // default value
+ int order;
+};
// register a colour (this should be used for everything except actual text colour for registered fonts)
// [note - a colour with name 'Background' [translated!] has special meaning and will be used as the background colour of
@@ -167,11 +166,13 @@ typedef struct ColourIDW_tag // lparam = hLangpack
__forceinline void ColourRegister(ColourID* pColorID)
-{ CallService("Colour/Register", (WPARAM)pColorID, hLangpack);
+{
+ CallService("Colour/Register", (WPARAM)pColorID, hLangpack);
}
__forceinline void ColourRegisterW(ColourIDW* pColorID)
-{ CallService("Colour/RegisterW", (WPARAM)pColorID, hLangpack);
+{
+ CallService("Colour/RegisterW", (WPARAM)pColorID, hLangpack);
}
// get a colour
@@ -191,54 +192,52 @@ __forceinline void ColourRegisterW(ColourIDW* pColorID) //
// EFFECTS
//
-typedef struct FONTEFFECT_tag
+
+struct FONTEFFECT
{
BYTE effectIndex;
DWORD baseColour; // ARGB
DWORD secondaryColour; // ARGB
-}
- FONTEFFECT;
+};
-typedef struct EffectID_tag
+struct EffectID
{
- int cbSize;
- char group[64];
- char name[64];
- char dbSettingsGroup[32];
- char setting[32];
- DWORD flags;
+ int cbSize;
+ char group[64];
+ char name[64];
+ char dbSettingsGroup[32];
+ char setting[32];
+ DWORD flags;
FONTEFFECT defeffect;
- int order;
-
+ int order;
FONTEFFECT value;
-}
- EffectID;
+};
-typedef struct EffectIDW_tag
+struct EffectIDW
{
- int cbSize;
- wchar_t group[64];
- wchar_t name[64];
- char dbSettingsGroup[32];
- char setting[32];
- DWORD flags;
+ int cbSize;
+ wchar_t group[64];
+ wchar_t name[64];
+ char dbSettingsGroup[32];
+ char setting[32];
+ DWORD flags;
FONTEFFECT defeffect;
- int order;
-
+ int order;
FONTEFFECT value;
-}
- EffectIDW;
+};
// register an effect
// wparam = (EffectID *)&effect_id
// lparam = 0
__forceinline void EffectRegister(EffectID* pEffectID)
-{ CallService("Effect/Register", (WPARAM)pEffectID, hLangpack);
+{
+ CallService("Effect/Register", (WPARAM)pEffectID, hLangpack);
}
__forceinline void EffectRegisterW(EffectIDW* pEffectID)
-{ CallService("Effect/RegisterW", (WPARAM)pEffectID, hLangpack);
+{
+ CallService("Effect/RegisterW", (WPARAM)pEffectID, hLangpack);
}
// get a effect
|