diff options
Diffstat (limited to 'src/modules/fonts/FontService.h')
-rw-r--r-- | src/modules/fonts/FontService.h | 83 |
1 files changed, 25 insertions, 58 deletions
diff --git a/src/modules/fonts/FontService.h b/src/modules/fonts/FontService.h index 92e62ba9df..8042d668bf 100644 --- a/src/modules/fonts/FontService.h +++ b/src/modules/fonts/FontService.h @@ -23,73 +23,40 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "m_fontservice.h"
+// a font identifier structure - used for registering a font, and getting one out again
-// settings to be used for the value of 'deffontsettings' in the FontID structure below - i.e. defaults
-typedef struct TFontSettings_tag
+struct FontInternal : public FontIDT
{
- COLORREF colour;
- char size;
- BYTE style; // see the DBFONTF_* flags above
- BYTE charset;
- TCHAR szFace[LF_FACESIZE];
-}
- TFontSettings;
+ FontSettingsT value;
+ int hLangpack;
-// a font identifier structure - used for registering a font, and getting one out again
+ __inline TCHAR* getName() const { return LangPackTranslateStringT(hLangpack, name); }
-struct TFontID
-{
- int cbSize;
- TCHAR group[64]; // group the font belongs to - this is the 'Font Group' list in the options page
- TCHAR name[64]; // 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
- TFontSettings 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)
- TCHAR backgroundGroup[64];
- TCHAR backgroundName[64];
- TFontSettings value;
+ __inline bool isHeader() const
+ {
+ if ((flags & FIDF_CLASSMASK) == FIDF_CLASSHEADER)
+ return true;
+
+ if ((flags & FIDF_CLASSMASK) == 0)
+ if (_tcsstr(name, _T("Incoming nick")) || _tcsstr(name, _T("Outgoing nick")) || _tcsstr(name, _T("Incoming timestamp")) || _tcsstr(name, _T("Outgoing timestamp")))
+ return true;
+ return false;
+ }
};
-struct TColourID
+struct ColourInternal : public ColourIDT
{
- int cbSize;
- TCHAR group[64];
- TCHAR name[64];
- char dbSettingsGroup[32];
- char setting[32];
- DWORD flags;
- COLORREF defcolour;
- int order;
+ __inline TCHAR* getName() const { return LangPackTranslateStringT(hLangpack, name); }
COLORREF value;
+ int hLangpack;
};
-// clist_modern related tune-up, adding clist_modern effects to FontService
-
-typedef struct TEffectSettings_tag
+struct EffectInternal : public EffectIDT
{
- BYTE effectIndex;
- DWORD baseColour; // ARGB
- DWORD secondaryColour; // ARGB
-}
-TEffectSettings;
+ __inline TCHAR* getName() const { return LangPackTranslateStringT(hLangpack, name); }
-
-struct TEffectID
-{
- int cbSize;
- TCHAR group[64];
- TCHAR name[64];
- char dbSettingsGroup[32];
- char setting[32];
- DWORD flags;
- TEffectSettings defeffect;
- int order;
-
- TEffectSettings value;
+ int hLangpack;
};
/////////////////////////////////////////////////////////////////////////////////////////
@@ -102,11 +69,11 @@ typedef struct }
TreeItem;
-extern OBJLIST<TFontID> font_id_list;
-extern OBJLIST<TColourID> colour_id_list;
-extern OBJLIST<TEffectID> effect_id_list;
+extern OBJLIST<FontInternal> font_id_list;
+extern OBJLIST<ColourInternal> colour_id_list;
+extern OBJLIST<EffectInternal> effect_id_list;
extern int code_page;
extern HANDLE hFontReloadEvent, hColourReloadEvent;
-int CreateFromFontSettings(TFontSettings *fs, LOGFONT *lf);
+int CreateFromFontSettings(FontSettingsT *fs, LOGFONT *lf);
|