/* MUCC Group Chat GUI Plugin for Miranda IM Copyright (C) 2004 Piotr Piastucki This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "FontList.h" #include "Utils.h" #define FONTCOUNT 12 static Font defFonts[] = { Font("Timestamp","Verdana", DEFAULT_CHARSET, -9, Font::BOLD, 0x000000), // Font("Colon","Verdana", DEFAULT_CHARSET, -13, 0, 0x808080), Font("Others names","Verdana", DEFAULT_CHARSET, -13, 0, 0x723732), Font("Your name","Verdana", DEFAULT_CHARSET, -13, 0, 0x4453A4), Font("Incoming message","Verdana", DEFAULT_CHARSET, -13, 0, 0x000000), Font("Outgoing message","Verdana", DEFAULT_CHARSET, -13, 0, 0x505080), Font("User has joined","Verdana", DEFAULT_CHARSET, -11, Font::ITALIC, 0x0F880F), Font("User has left","Verdana", DEFAULT_CHARSET, -11, Font::ITALIC, 0x1313B9), Font("The topic is ...","Verdana", DEFAULT_CHARSET, -13, Font::ITALIC, 0x991A53), Font("Error","Verdana", DEFAULT_CHARSET, -13, Font::BOLD, 0x1010D0), Font("Message typing area","Verdana", DEFAULT_CHARSET, -13, 0, 0x000000), Font("User list","Tahoma", DEFAULT_CHARSET, -11, 0, 0x000000), Font("User list group","Tahoma", DEFAULT_CHARSET, -11, Font::BOLD, 0x000000) }; Font::Font() { name = NULL; face = NULL; size = 0; style = 0; color = 0; charSet = DEFAULT_CHARSET; } Font::Font(const char *n, const char *f, int cs, int s, int st, COLORREF c) { name = NULL; face = NULL; size = 0; style = 0; color = 0; setName(n); setFace(f); setCharSet(cs); setSize(s); setStyle(st); setColor(c); } COLORREF Font::getColor() { return color; } void Font::setColor(COLORREF c) { color = c; } int Font::getSize() { return size; } void Font::setSize(int s) { size = s; } int Font::getStyle() { return style; } void Font::setStyle(int s) { style = s; } int Font::getCharSet() { return charSet; } void Font::setCharSet(int s) { charSet = s; } void Font::setName(const char *s) { Utils::copyString(&name, s); } const char *Font::getName() { return name; } void Font::setFace(const char *s) { Utils::copyString(&face, s); } const char *Font::getFace() { return face; } Font *FontList::fonts = NULL; Font *FontList::fontsSettings = NULL; Font *FontList::getFont(int index) { if (index < FONTCOUNT) return &fonts[index]; else return NULL; } Font *FontList::getFontSettings(int index) { if (index < FONTCOUNT) return &fontsSettings[index]; else return NULL; } void FontList::loadSettings() { char fontParam[512]; for (int i=0;i