index 9f9f91bd1d83c0a92ec8737af675d5ccc8832e86..042acb6e1b3e16a4e22620d16115998f2b164d20 100644 (file)
*/
/* Authors:
* Felipe C. da S. Sanches <juca@members.fsf.org>
+ * Jon A. Cruz <jon@joncruz.org>
+ * Abhishek Sharma
*
* Copyright (C) 2008 Authors
* Released under GNU GPLv2 (or later). Read the file 'COPYING' for more information.
Glib::ustring undokey = "svgfonts:";
undokey += name;
- SPDocumentUndo::maybe_done(o->document, undokey.c_str(), SP_VERB_DIALOG_SVG_FONTS,
- _("Set SVG Font attribute"));
+ DocumentUndo::maybeDone(o->document, undokey.c_str(), SP_VERB_DIALOG_SVG_FONTS,
+ _("Set SVG Font attribute"));
}
}
//slider values increase from right to left so that they match the kerning pair preview
- //XML Tree being directly used here while it shouldn't be.
+ //XML Tree being directly used here while it shouldn't be.
this->kerning_pair->getRepr()->setAttribute("k", Glib::Ascii::dtostr(get_selected_spfont()->horiz_adv_x - kerning_slider.get_value()).c_str());
- SPDocumentUndo::maybe_done(document, undokey.c_str(), SP_VERB_DIALOG_SVG_FONTS, _("Adjust kerning value"));
+ DocumentUndo::maybeDone(document, undokey.c_str(), SP_VERB_DIALOG_SVG_FONTS, _("Adjust kerning value"));
//populate_kerning_pairs_box();
kerning_preview.redraw();
{
SPDesktop* desktop = this->getDesktop();
SPDocument* document = sp_desktop_document(desktop);
- const GSList* fonts = document->get_resource_list("font");
+ const GSList* fonts = document->getResourceList("font");
_model->clear();
for(const GSList *l = fonts; l; l = l->next) {
SPGlyph *new_glyph(SPDocument* document, SPFont *font, const int count)
{
g_return_val_if_fail(font != NULL, NULL);
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(document);
+ Inkscape::XML::Document *xml_doc = document->getReprDoc();
// create a new glyph
Inkscape::XML::Node *repr;
SPDocument* doc = sp_desktop_document(this->getDesktop());
/* SPGlyph* glyph =*/ new_glyph(doc, get_selected_spfont(), count+1);
- SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Add glyph"));
+ DocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Add glyph"));
update_glyphs();
}
}
//XML Tree being directly used here while it shouldn't be.
glyph->getRepr()->setAttribute("d", (char*) sp_svg_write_path (pathv));
- SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph curves"));
+ DocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph curves"));
update_glyphs();
}
for (obj = get_selected_spfont()->children; obj; obj=obj->next){
if (SP_IS_MISSING_GLYPH(obj)){
- //XML Tree being directly used here while it shouldn't be.
+ //XML Tree being directly used here while it shouldn't be.
obj->getRepr()->setAttribute("d", (char*) sp_svg_write_path (pathv));
- SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph curves"));
+ DocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph curves"));
}
}
SPObject* obj;
for (obj = get_selected_spfont()->children; obj; obj=obj->next){
if (SP_IS_MISSING_GLYPH(obj)){
- //XML Tree being directly used here while it shouldn't be.
+ //XML Tree being directly used here while it shouldn't be.
obj->getRepr()->setAttribute("d", (char*) "M0,0h1000v1024h-1000z");
- SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Reset missing-glyph"));
+ DocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Reset missing-glyph"));
}
}
@@ -585,11 +587,11 @@ void SvgFontsDialog::glyph_name_edit(const Glib::ustring&, const Glib::ustring&
if (!i) return;
SPGlyph* glyph = (*i)[_GlyphsListColumns.glyph_node];
- //XML Tree being directly used here while it shouldn't be.
+ //XML Tree being directly used here while it shouldn't be.
glyph->getRepr()->setAttribute("glyph-name", str.c_str());
SPDocument* doc = sp_desktop_document(this->getDesktop());
- SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Edit glyph name"));
+ DocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Edit glyph name"));
update_glyphs();
}
@@ -599,22 +601,23 @@ void SvgFontsDialog::glyph_unicode_edit(const Glib::ustring&, const Glib::ustrin
if (!i) return;
SPGlyph* glyph = (*i)[_GlyphsListColumns.glyph_node];
- //XML Tree being directly used here while it shouldn't be.
+ //XML Tree being directly used here while it shouldn't be.
glyph->getRepr()->setAttribute("unicode", str.c_str());
SPDocument* doc = sp_desktop_document(this->getDesktop());
- SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph unicode"));
+ DocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph unicode"));
update_glyphs();
}
void SvgFontsDialog::remove_selected_font(){
SPFont* font = get_selected_spfont();
+ if (!font) return;
- //XML Tree being directly used here while it shouldn't be.
+ //XML Tree being directly used here while it shouldn't be.
sp_repr_unparent(font->getRepr());
SPDocument* doc = sp_desktop_document(this->getDesktop());
- SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove font"));
+ DocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove font"));
update_fonts();
}
sp_repr_unparent(glyph->getRepr());
SPDocument* doc = sp_desktop_document(this->getDesktop());
- SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove glyph"));
+ DocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove glyph"));
update_glyphs();
}
sp_repr_unparent(pair->getRepr());
SPDocument* doc = sp_desktop_document(this->getDesktop());
- SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove kerning pair"));
+ DocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove kerning pair"));
update_glyphs();
}
if (this->kerning_pair) return; //We already have this kerning pair
SPDocument* document = sp_desktop_document(this->getDesktop());
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(document);
+ Inkscape::XML::Document *xml_doc = document->getReprDoc();
// create a new hkern node
- Inkscape::XML::Node *repr;
- repr = xml_doc->createElement("svg:hkern");
+ Inkscape::XML::Node *repr = xml_doc->createElement("svg:hkern");
repr->setAttribute("u1", first_glyph.get_active_text().c_str());
repr->setAttribute("u2", second_glyph.get_active_text().c_str());
// get corresponding object
this->kerning_pair = SP_HKERN( document->getObjectByRepr(repr) );
- SPDocumentUndo::done(document, SP_VERB_DIALOG_SVG_FONTS, _("Add kerning pair"));
+ DocumentUndo::done(document, SP_VERB_DIALOG_SVG_FONTS, _("Add kerning pair"));
}
Gtk::VBox* SvgFontsDialog::kerning_tab(){
create_kerning_pairs_popup_menu(_KerningPairsList, sigc::mem_fun(*this, &SvgFontsDialog::remove_selected_kerning_pair));
//Kerning Setup:
- kerning_vbox.add(*Gtk::manage(new Gtk::Label(_("Kerning Setup:"))));
+ kerning_vbox.add(*Gtk::manage(new Gtk::Label(_("Kerning Setup"))));
Gtk::HBox* kerning_selector = Gtk::manage(new Gtk::HBox());
kerning_selector->add(*Gtk::manage(new Gtk::Label(_("1st Glyph:"))));
kerning_selector->add(first_glyph);
SPDefs *defs = (SPDefs *) SP_DOCUMENT_DEFS(document);
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(document);
+ Inkscape::XML::Document *xml_doc = document->getReprDoc();
// create a new font
- Inkscape::XML::Node *repr;
- repr = xml_doc->createElement("svg:font");
+ Inkscape::XML::Node *repr = xml_doc->createElement("svg:font");
//By default, set the horizontal advance to 1024 units
repr->setAttribute("horiz-adv-x", "1024");
SPObject* obj;
for (obj=font->children; obj; obj=obj->next){
if (SP_IS_FONTFACE(obj)){
- //XML Tree being directly used here while it shouldn't be.
+ //XML Tree being directly used here while it shouldn't be.
obj->getRepr()->setAttribute("font-family", str);
}
}
- SPDocumentUndo::done(font->document, SP_VERB_DIALOG_SVG_FONTS, _("Set font family"));
+ DocumentUndo::done(font->document, SP_VERB_DIALOG_SVG_FONTS, _("Set font family"));
}
void SvgFontsDialog::add_font(){
SPObject* obj;
for (obj=font->children; obj; obj=obj->next){
if (SP_IS_FONTFACE(obj)){
- //XML Tree being directly used here while it shouldn't be.
+ //XML Tree being directly used here while it shouldn't be.
obj->getRepr()->setAttribute("font-family", os2.str().c_str());
}
}
update_fonts();
// select_font(font);
- SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Add font"));
+ DocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Add font"));
}
SvgFontsDialog::SvgFontsDialog()
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :