Debian Codegraph @

src/af/xap/gtk/xap_UnixDlg_Insert_Symbol.h

raw
1 /* AbiSource Application Framework
2 * Copyright (C) 1998 AbiSource, Inc.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301 USA.
18 */
19
20 #ifndef XAP_UNIXDIALOG_INSERT_SYMBOL_H
21 #define XAP_UNIXDIALOG_INSERT_SYMBOL_H
22
23 #include <list>
24 #include <string>
25
26 #include "xap_Dlg_Insert_Symbol.h"
27 #include <gdk/gdkkeysyms.h>
28
29 #define DEFAULT_UNIX_SYMBOL_FONT "Symbol"
30
31 class XAP_Frame;
32 class GR_CairoGraphics;
33
34 /*****************************************************************/
35
36 class XAP_UnixDialog_Insert_Symbol : public XAP_Dialog_Insert_Symbol
37 {
38 public:
39 XAP_UnixDialog_Insert_Symbol(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id);
40 virtual ~XAP_UnixDialog_Insert_Symbol(void);
41
42 virtual void runModal(XAP_Frame * pFrame);
43 virtual void runModeless(XAP_Frame * pFrame);
44 virtual void notifyActiveFrame(XAP_Frame *pFrame);
45 virtual void notifyCloseFrame(XAP_Frame * /*pFrame*/ ){};
46 virtual void destroy(void);
47 virtual void activate(void);
48
49 void event_Insert(void);
50 void event_WindowDelete(void);
51 void New_Font(void);
52 void New_Row(void);
53 void Scroll_Event (int direction);
54 void setSymbolMap_size (UT_uint32 width, UT_uint32 height);
55
56
57 static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id id);
58
59 typedef enum
60 {
61 BUTTON_INSERT,
62 BUTTON_CLOSE = GTK_RESPONSE_CLOSE
63 } ResponseId ;
64
65 // callbacks can fire these events
66 void SymbolMap_exposed( void);
67 void Symbolarea_exposed( void);
68 void SymbolMap_clicked(GdkEvent * event);
69 void CurrentSymbol_clicked(GdkEvent *event);
70 gboolean Key_Pressed(GdkEventKey * e);
71
72 private:
73
74 GtkWidget * _constructWindow(void);
75 void _getGlistFonts(std::list<std::string> & glFonts);
76 GtkWidget * _createComboboxWithFonts (void);
77 void _connectSignals (void);
78 void _setScrolledWindow (void);
79
80 // pointers to widgets we need to query/set
81 GtkWidget * m_windowMain;
82 GtkWidget * m_SymbolMap;
83 GtkWidget * m_fontcombo;
84 GtkAdjustment * m_vadjust;
85 std::list<std::string> m_InsertS_Font_list;
86
87 // private construction functions
88 GtkWidget * _previewNew(int w, int h);
89
90 GtkWidget * m_areaCurrentSym;
91 GR_CairoGraphics * m_unixGraphics;
92 GR_CairoGraphics * m_unixarea;
93 UT_uint32 m_ix;
94 UT_uint32 m_iy;
95 };
96
97 #endif /* XAP_UNIXDIALOG_INSERT_SYMBOL_H */