X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fui%2Fdialog%2Fsvg-fonts-dialog.h;h=e819187a1dceb2e61074fa18f931950a76049dc1;hb=5ef6cb9428f2e6f5457e890a1c3b37f53730c07a;hp=24da11f10760df258706fa22c1ecc1772306cdf1;hpb=22f081b4206e716c03c4ba740b499f20a568b163;p=inkscape.git diff --git a/src/ui/dialog/svg-fonts-dialog.h b/src/ui/dialog/svg-fonts-dialog.h index 24da11f10..e819187a1 100644 --- a/src/ui/dialog/svg-fonts-dialog.h +++ b/src/ui/dialog/svg-fonts-dialog.h @@ -1,11 +1,10 @@ -/** - * \brief SVG Fonts dialog - * - * Authors: - * Felipe Corrêa da Silva Sanches +/** @file + * @brief SVG Fonts dialog + */ +/* Authors: + * Felipe Corrêa da Silva Sanches * * Copyright (C) 2008 Authors - * * Released under GNU GPLv2 (or later). Read the file 'COPYING' for more information. */ @@ -14,6 +13,7 @@ #include "ui/widget/panel.h" #include "sp-font.h" +#include "sp-font-face.h" #include "verbs.h" #include "document.h" #include "desktop.h" @@ -26,6 +26,8 @@ #include #include "display/nr-svgfonts.h" +#include "attributes.h" +#include "xml/helper-observer.h" class SvgFontDrawingArea : Gtk::DrawingArea{ public: @@ -64,11 +66,74 @@ public: void update_fonts(); SvgFont* get_selected_svgfont(); SPFont* get_selected_spfont(); + SPGlyph* get_selected_glyph(); + SPGlyphKerning* get_selected_kerning_pair(); + + //TODO: these methods should be private, right?! void on_font_selection_changed(); + void on_kerning_pair_selection_changed(); void on_preview_text_changed(); - void on_glyphs_changed(); - void on_kerning_changed(); + void on_kerning_pair_changed(); + void on_kerning_value_changed(); + void on_setwidth_changed(); + void add_font(); + + //TODO: AttrEntry is currently unused. Should we remove it? + class AttrEntry : public Gtk::HBox + { + public: + AttrEntry(SvgFontsDialog* d, gchar* lbl, const SPAttributeEnum attr); + void set_text(char*); + private: + SvgFontsDialog* dialog; + void on_attr_changed(); + Gtk::Entry entry; + SPAttributeEnum attr; + }; + private: + void update_glyphs(); + void update_sensitiveness(); + void update_global_settings_tab(); + void populate_glyphs_box(); + void populate_kerning_pairs_box(); + void set_glyph_description_from_selected_path(); + void missing_glyph_description_from_selected_path(); + void reset_missing_glyph_description(); + void add_glyph(); + void glyph_unicode_edit(const Glib::ustring&, const Glib::ustring&); + void glyph_name_edit(const Glib::ustring&, const Glib::ustring&); + void remove_selected_glyph(); + void remove_selected_font(); + void remove_selected_kerning_pair(); + + void add_kerning_pair(); + + void create_glyphs_popup_menu(Gtk::Widget& parent, sigc::slot rem); + void glyphs_list_button_release(GdkEventButton* event); + + void create_fonts_popup_menu(Gtk::Widget& parent, sigc::slot rem); + void fonts_list_button_release(GdkEventButton* event); + + void create_kerning_pairs_popup_menu(Gtk::Widget& parent, sigc::slot rem); + void kerning_pairs_list_button_release(GdkEventButton* event); + + Inkscape::XML::SignalObserver _defs_observer; //in order to update fonts + Inkscape::XML::SignalObserver _glyphs_observer; + + Gtk::HBox* AttrCombo(gchar* lbl, const SPAttributeEnum attr); +// Gtk::HBox* AttrSpin(gchar* lbl, const SPAttributeEnum attr); + Gtk::VBox* global_settings_tab(); + AttrEntry* _familyname_entry; + + Gtk::VBox* kerning_tab(); + Gtk::VBox* glyphs_tab(); + Gtk::Button _add; + Gtk::Button add_glyph_button; + Gtk::Button glyph_from_path_button; + Gtk::Button missing_glyph_button; + Gtk::Button missing_glyph_reset_button; + class Columns : public Gtk::TreeModel::ColumnRecord { public: @@ -85,13 +150,64 @@ private: }; Glib::RefPtr _model; Columns _columns; - Gtk::TreeView _font_list; + Gtk::TreeView _FontsList; + + class GlyphsColumns : public Gtk::TreeModel::ColumnRecord + { + public: + GlyphsColumns() + { + add(glyph_node); + add(glyph_name); + add(unicode); + } + + Gtk::TreeModelColumn glyph_node; + Gtk::TreeModelColumn glyph_name; + Gtk::TreeModelColumn unicode; + }; + GlyphsColumns _GlyphsListColumns; + Glib::RefPtr _GlyphsListStore; + Gtk::TreeView _GlyphsList; + Gtk::ScrolledWindow _GlyphsListScroller; + + class KerningPairColumns : public Gtk::TreeModel::ColumnRecord + { + public: + KerningPairColumns() + { + add(first_glyph); + add(second_glyph); + add(kerning_value); + add(spnode); + } + + Gtk::TreeModelColumn first_glyph; + Gtk::TreeModelColumn second_glyph; + Gtk::TreeModelColumn kerning_value; + Gtk::TreeModelColumn spnode; + }; + KerningPairColumns _KerningPairsListColumns; + Glib::RefPtr _KerningPairsListStore; + Gtk::TreeView _KerningPairsList; + Gtk::ScrolledWindow _KerningPairsListScroller; + Gtk::Button add_kernpair_button; + Gtk::VBox _font_settings; + Gtk::VBox global_vbox; + Gtk::VBox glyphs_vbox; + Gtk::VBox kerning_vbox; Gtk::Entry _preview_entry; + + Gtk::Menu _FontsContextMenu; + Gtk::Menu _GlyphsContextMenu; + Gtk::Menu _KerningPairsContextMenu; + SvgFontDrawingArea _font_da, kerning_preview; GlyphComboBox first_glyph, second_glyph; SPGlyphKerning* kerning_pair; - Gtk::SpinButton kerning_spin; + Gtk::SpinButton setwidth_spin; + Gtk::HScale kerning_slider; class EntryWidget : public Gtk::HBox {