1a01aebcad5782f640bee36cc4c8239f46a834a8
1 /**
2 * Glyph selector dialog.
3 */
5 /* Authors:
6 * Jon A. Cruz
7 *
8 * Copyright (C) 2010 Jon A. Cruz
9 * Released under GNU GPL, read the file 'COPYING' for more information
10 */
11 #ifndef SEEN_DIALOGS_GLYPHS_H
12 #define SEEN_DIALOGS_GLYPHS_H
14 #include <gtkmm/treemodel.h>
15 #include "ui/widget/panel.h"
16 #include "ui/dialog/desktop-tracker.h"
19 namespace Gtk {
20 class ComboBoxText;
21 class Entry;
22 class IconView;
23 class Label;
24 class ListStore;
25 }
27 class SPFontSelector;
28 class font_instance;
31 namespace Inkscape {
32 namespace UI {
34 class PreviewHolder;
36 namespace Dialog {
38 class GlyphColumns;
40 /**
41 * A panel that displays character glyphs.
42 */
44 class GlyphsPanel : public Inkscape::UI::Widget::Panel
45 {
46 public:
47 GlyphsPanel(gchar const *prefsPath = "/dialogs/glyphs");
48 virtual ~GlyphsPanel();
50 static GlyphsPanel& getInstance();
52 virtual void setDesktop(SPDesktop *desktop);
54 protected:
56 private:
57 GlyphsPanel(GlyphsPanel const &); // no copy
58 GlyphsPanel &operator=(GlyphsPanel const &); // no assign
60 static GlyphColumns *getColumns();
62 static void fontChangeCB(SPFontSelector *fontsel, font_instance *font, GlyphsPanel *self);
64 void rebuild();
66 void glyphActivated(Gtk::TreeModel::Path const & path);
67 void glyphSelectionChanged();
68 void setTargetDesktop(SPDesktop *desktop);
69 void selectionModifiedCB(guint flags);
70 void readSelection( bool updateStyle, bool updateContent );
71 void calcCanInsert();
72 void insertText();
75 Glib::RefPtr<Gtk::ListStore> store;
76 Gtk::IconView *iconView;
77 Gtk::Entry *entry;
78 Gtk::Label *label;
79 Gtk::Button *insertBtn;
80 #if GLIB_CHECK_VERSION(2,14,0)
81 Gtk::ComboBoxText *scriptCombo;
82 #endif //GLIB_CHECK_VERSION(2,14,0)
83 Gtk::ComboBoxText *rangeCombo;
84 SPFontSelector *fsel;
85 SPDesktop *targetDesktop;
86 DesktopTracker deskTrack;
88 std::vector<sigc::connection> instanceConns;
89 std::vector<sigc::connection> desktopConns;
90 };
93 } // namespace Dialogs
94 } // namespace UI
95 } // namespace Inkscape
97 #endif // SEEN_DIALOGS_GLYPHS_H
98 /*
99 Local Variables:
100 mode:c++
101 c-file-style:"stroustrup"
102 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
103 indent-tabs-mode:nil
104 fill-column:99
105 End:
106 */
107 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :