Debian Codegraph @

src/af/xap/gtk/xap_UnixDlg_FontChooser.h

raw
1 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */
2
3 /* AbiSource Application Framework
4 * Copyright (C) 1998-2000 AbiSource, Inc.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 * 02110-1301 USA.
20 */
21
22 #ifndef XAP_UNIXDIALOG_FONTCHOOSER_H
23 #define XAP_UNIXDIALOG_FONTCHOOSER_H
24
25 #include "xap_App.h"
26 #include "xap_Dlg_FontChooser.h"
27 #include "ut_misc.h"
28
29 class XAP_Frame;
30 class GR_CairoGraphics;
31
32 /*****************************************************************/
33
34 class XAP_UnixDialog_FontChooser : public XAP_Dialog_FontChooser
35 {
36 public:
37 XAP_UnixDialog_FontChooser(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id);
38 virtual ~XAP_UnixDialog_FontChooser(void);
39
40 virtual void runModal(XAP_Frame * pFrame);
41
42 static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id id);
43 void underlineChanged(void);
44 void overlineChanged(void);
45 void subscriptChanged(void);
46 void superscriptChanged(void);
47 void strikeoutChanged(void);
48 void hiddenChanged(void);
49 void transparencyChanged(void);
50 void updatePreview(void);
51 void fontRowChanged(void);
52 void styleRowChanged(void);
53 void sizeRowChanged(void);
54 void fgColorChanged(void);
55 void bgColorChanged(void);
56 void textTransformChanged(void);
57
58 // the state of what data is hidden and what is public is
59 // pretty grave here.
60 GtkWidget * m_fontList;
61 GtkWidget * m_styleList;
62 GtkWidget * m_sizeList;
63 GtkWidget * m_checkStrikeOut;
64 GtkWidget * m_checkUnderline;
65 GtkWidget * m_checkOverline;
66 GtkWidget * m_checkHidden;
67 GtkWidget * m_checkTransparency;
68 GtkWidget * m_checkSubScript;
69 guint m_iSubScriptId;
70 GtkWidget * m_checkSuperScript;
71 guint m_iSuperScriptId;
72 GtkWidget * m_colorSelector;
73 GtkWidget * m_bgcolorSelector;
74 GtkWidget * m_preview;
75 bool getEntryString(char ** string);
76 GR_CairoGraphics * m_gc;
77
78 bool m_blockUpdate;
79 bool m_doneFirstFont;
80
81 protected:
82
83 // Gtk sets up escape key to close a GtkDialog only when
84 // the one of the button responses is GTK_RESPONSE_CANCEL
85 typedef enum
86 {
87 BUTTON_OK = GTK_RESPONSE_OK,
88 BUTTON_CANCEL = GTK_RESPONSE_CANCEL
89 } ResponseId ;
90
91 // careful, these must be in the order the
92 // list box will show them (Windows order)
93 typedef enum
94 {
95 LIST_STYLE_NONE = -1,
96 LIST_STYLE_NORMAL = 0,
97 LIST_STYLE_ITALIC,
98 LIST_STYLE_BOLD,
99 LIST_STYLE_BOLD_ITALIC
100 } listStyle;
101
102 virtual GtkWidget * constructWindow(void);
103 GtkWidget * constructWindowContents(GtkWidget *);
104
105 // parent frame
106 XAP_Frame * m_pFrame;
107 #if GTK_CHECK_VERSION(3,0,0)
108 GdkRGBA m_currentFGColor;
109 GdkRGBA m_currentBGColor;
110 GdkRGBA m_funkyColor;
111 #else
112 GdkColor m_currentFGColor;
113 GdkColor m_currentBGColor;
114 GdkColor m_funkyColor;
115 #endif
116 bool m_currentBGColorTransparent;
117 };
118
119 #endif /* XAP_UNIXDIALOG_FONTCHOOSER_H */