From 18632069f19fc1255f509bffb6077cf9d00455ac Mon Sep 17 00:00:00 2001 From: Christoffer Holmstedt Date: Mon, 17 Jun 2013 19:16:47 +0200 Subject: Removed hard coded keybinding from event-context.cpp and added the appropiate function call in verbs.cpp (bzr r12379.1.1) --- src/event-context.cpp | 7 ------- src/verbs.cpp | 3 ++- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/event-context.cpp b/src/event-context.cpp index 628380a2c..4bbb012e0 100644 --- a/src/event-context.cpp +++ b/src/event-context.cpp @@ -590,13 +590,6 @@ static gint sp_event_context_private_root_handler( ret = sp_shortcut_invoke(shortcut, desktop); break; - case GDK_KEY_D: - case GDK_KEY_d: - if (!MOD__SHIFT(event) && !MOD__CTRL(event) && !MOD__ALT(event)) { - sp_toggle_dropper(desktop); - ret = TRUE; - } - break; case GDK_KEY_Q: case GDK_KEY_q: if (desktop->quick_zoomed()) { diff --git a/src/verbs.cpp b/src/verbs.cpp index 6f83b3dfb..3fdb97365 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -47,6 +47,7 @@ #include "document.h" #include "draw-context.h" #include "extension/effect.h" +#include "event-context.h" #include "file.h" #include "gradient-drag.h" #include "helper/action.h" @@ -1560,7 +1561,7 @@ void ContextVerb::perform(SPAction *action, void *data) tools_switch(dt, TOOLS_MEASURE); break; case SP_VERB_CONTEXT_DROPPER: - tools_switch(dt, TOOLS_DROPPER); + sp_toggle_dropper(dt); // Functionality defined in event-context.cpp break; case SP_VERB_CONTEXT_CONNECTOR: tools_switch(dt, TOOLS_CONNECTOR); -- cgit v1.2.3 From 74651351d05898e961941e98ad68043028ce3a87 Mon Sep 17 00:00:00 2001 From: Slagvi Public Date: Tue, 18 Jun 2013 15:14:09 +0200 Subject: First newFromTemplate commit. Some basic widgets mechanics (bzr r12379.2.1) --- src/templates/main.cpp | 14 +++++ src/templates/newfromtemplate.cpp | 35 +++++++++++ src/templates/newfromtemplate.h | 25 ++++++++ src/templates/preview.png | Bin 0 -> 2426 bytes src/templates/statictemplateloadtab.cpp | 42 +++++++++++++ src/templates/statictemplateloadtab.h | 27 +++++++++ src/templates/templateloadtab.cpp | 101 ++++++++++++++++++++++++++++++++ src/templates/templateloadtab.h | 53 +++++++++++++++++ 8 files changed, 297 insertions(+) create mode 100644 src/templates/main.cpp create mode 100644 src/templates/newfromtemplate.cpp create mode 100644 src/templates/newfromtemplate.h create mode 100644 src/templates/preview.png create mode 100644 src/templates/statictemplateloadtab.cpp create mode 100644 src/templates/statictemplateloadtab.h create mode 100644 src/templates/templateloadtab.cpp create mode 100644 src/templates/templateloadtab.h (limited to 'src') diff --git a/src/templates/main.cpp b/src/templates/main.cpp new file mode 100644 index 000000000..1ff93822c --- /dev/null +++ b/src/templates/main.cpp @@ -0,0 +1,14 @@ +#include + +#include "newfromtemplate.h" + +int main (int argc, char *argv[]) +{ + Gtk::Main kit(argc, argv); + + NewFromTemplate dialog; + dialog.run(); + //Gtk::Main::run(dialog); + + return 0; +} \ No newline at end of file diff --git a/src/templates/newfromtemplate.cpp b/src/templates/newfromtemplate.cpp new file mode 100644 index 000000000..3a215889d --- /dev/null +++ b/src/templates/newfromtemplate.cpp @@ -0,0 +1,35 @@ +#include "newfromtemplate.h" +#include "gtkmm/alignment.h" + + +NewFromTemplate::NewFromTemplate() : + createButton("Create from template") +{ + set_title("New From Template"); + resize(400, 250); + + get_vbox()->pack_start(mainWidget); + mainWidget.append_page(tab1, "Static Templates"); + mainWidget.append_page(tab2, "Procedural Templates"); + + Gtk::Alignment *align; + align = manage(new Gtk::Alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER, 0.0, 0.0)); + get_vbox()->pack_end(*align, Gtk::PACK_SHRINK, 5); + align->add(createButton); + + createButton.signal_pressed().connect( + sigc::mem_fun(*this, &NewFromTemplate::createFromTemplate)); + + show_all(); +} + + +void NewFromTemplate::createFromTemplate() +{ + if (mainWidget.get_current_page() == 0) + tab1.createTemplate(); + else + tab2.createTemplate(); + + response(0); +} \ No newline at end of file diff --git a/src/templates/newfromtemplate.h b/src/templates/newfromtemplate.h new file mode 100644 index 000000000..1a6ce555d --- /dev/null +++ b/src/templates/newfromtemplate.h @@ -0,0 +1,25 @@ +#ifndef GTKMM_NEW_FROM_TEMPLATE_H +#define GTKMM_TNEW_FROM_TEMPLATE_H + +#include +#include +#include + +#include "templateloadtab.h" +#include "statictemplateloadtab.h" + + +class NewFromTemplate : public Gtk::Dialog +{ +public: + NewFromTemplate(); + +private: + Gtk::Notebook mainWidget; + Gtk::Button createButton; + StaticTemplateLoadTab tab1; + TemplateLoadTab tab2; + + void createFromTemplate(); +}; +#endif \ No newline at end of file diff --git a/src/templates/preview.png b/src/templates/preview.png new file mode 100644 index 000000000..c56a832a2 Binary files /dev/null and b/src/templates/preview.png differ diff --git a/src/templates/statictemplateloadtab.cpp b/src/templates/statictemplateloadtab.cpp new file mode 100644 index 000000000..b82338f16 --- /dev/null +++ b/src/templates/statictemplateloadtab.cpp @@ -0,0 +1,42 @@ +#include +#include +#include +#include + +#include "statictemplateloadtab.h" + + +StaticTemplateLoadTab::StaticTemplateLoadTab() : + moreInfoButton("More info"), + previewImage("preview.png"), + shortDescriptionLabel("Short description - I like trains. ad asda asd asdweqe gdfg"), + templateNameLabel("Template_name"), + templateAuthorLabel("by template_author") +{ + templateInfoColumn.pack_start(templateNameLabel, Gtk::PACK_SHRINK, 4); + templateInfoColumn.pack_start(templateAuthorLabel, Gtk::PACK_SHRINK, 0); + templateInfoColumn.pack_start(previewImage, Gtk::PACK_SHRINK, 15); + templateInfoColumn.pack_start(shortDescriptionLabel, Gtk::PACK_SHRINK, 4); + + shortDescriptionLabel.set_line_wrap(true); + shortDescriptionLabel.set_size_request(200); + + Gtk::Alignment *align; + align = manage(new Gtk::Alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER, 0.0, 0.0)); + templateInfoColumn.pack_start(*align, Gtk::PACK_SHRINK, 5); + align->add(moreInfoButton); +} + + +void StaticTemplateLoadTab::createTemplate() +{ + std::cout << "Static template\n"; +} + + +void StaticTemplateLoadTab::displayTemplateInfo() +{ + TemplateLoadTab::displayTemplateInfo(); + templateNameLabel.set_text(currentTemplate); +} + diff --git a/src/templates/statictemplateloadtab.h b/src/templates/statictemplateloadtab.h new file mode 100644 index 000000000..43d640b85 --- /dev/null +++ b/src/templates/statictemplateloadtab.h @@ -0,0 +1,27 @@ +#ifndef GTKMM_STATIC_TEMPLATE_LOAD_TAB_H +#define GTKMM_STATIC_TEMPLATE_LOAD_TAB_H + +#include +#include +#include + +#include "templateloadtab.h" + + +class StaticTemplateLoadTab : public TemplateLoadTab +{ +public: + StaticTemplateLoadTab(); + virtual void createTemplate(); + +protected: + virtual void displayTemplateInfo(); + + Gtk::Button moreInfoButton; + Gtk::Label shortDescriptionLabel; + Gtk::Label templateAuthorLabel; + Gtk::Label templateNameLabel; + Gtk::Image previewImage; +}; + +#endif \ No newline at end of file diff --git a/src/templates/templateloadtab.cpp b/src/templates/templateloadtab.cpp new file mode 100644 index 000000000..734ac3eec --- /dev/null +++ b/src/templates/templateloadtab.cpp @@ -0,0 +1,101 @@ +#include +#include + +#include "templateloadtab.h" + + +TemplateLoadTab::TemplateLoadTab() +{ + set_border_width(10); + + Gtk::Label *title; + title = manage(new Gtk::Label("Search Tags:")); + templatesColumn.pack_start(*title, Gtk::PACK_SHRINK, 10); + + templatesColumn.pack_start(keywordsCombo, Gtk::PACK_SHRINK, 0); + + title = manage(new Gtk::Label("Templates")); + templatesColumn.pack_start(*title, Gtk::PACK_SHRINK, 10); + + title = manage(new Gtk::Label("Selected template")); + templateInfoColumn.pack_start(*title, Gtk::PACK_SHRINK, 10); + + initLists(); + + add(mainBox); + mainBox.pack_start(templatesColumn, Gtk::PACK_SHRINK, 20); + mainBox.pack_start(templateInfoColumn, Gtk::PACK_EXPAND_WIDGET, 10); + + templatesColumn.pack_start(templatesView, Gtk::PACK_SHRINK, 5); + + Glib::RefPtr templateSelectionRef = + templatesView.get_selection(); + + templateSelectionRef->signal_changed().connect( + sigc::mem_fun(*this, &TemplateLoadTab::displayTemplateInfo)); + + keywordsCombo.signal_changed().connect( + sigc::mem_fun(*this, &TemplateLoadTab::keywordSelected)); + this->show_all(); +} + + +TemplateLoadTab::~TemplateLoadTab() +{ +} + + +void TemplateLoadTab::createTemplate() +{ + std::cout << "Default Template Tab" << std::endl; +} + + +void TemplateLoadTab::displayTemplateInfo() +{ + Glib::RefPtr templateSelectionRef = templatesView.get_selection(); + if (templateSelectionRef->get_selected()) + currentTemplate = (*templateSelectionRef->get_selected())[templatesColumns.textValue]; +} + + +void TemplateLoadTab::initKeywordsList() +{ + keywordsCombo.append_text("All"); + keywordsCombo.set_active_text("All"); + + for (int i=0; i<10; ++i){ + + keywordsCombo.append_text( "Keyword" + Glib::ustring::format(i)); + } +} + + +void TemplateLoadTab::initLists() +{ + templatesRef = Gtk::ListStore::create(templatesColumns); + templatesView.set_model(templatesRef); + templatesView.append_column("", templatesColumns.textValue); + templatesView.set_headers_visible(false); + + initKeywordsList(); + refreshTemplatesList(); +} + + +void TemplateLoadTab::keywordSelected() +{ + currentKeyword = keywordsCombo.get_active_text(); + refreshTemplatesList(); +} + + +void TemplateLoadTab::refreshTemplatesList() +{ + templatesRef->clear(); + for (int i=0; i<7; ++i){ + Gtk::TreeModel::iterator iter = templatesRef->append(); + Gtk::TreeModel::Row row = *iter; + row[templatesColumns.textValue] = "Template" + Glib::ustring::format(i); + } +} \ No newline at end of file diff --git a/src/templates/templateloadtab.h b/src/templates/templateloadtab.h new file mode 100644 index 000000000..3947e25fb --- /dev/null +++ b/src/templates/templateloadtab.h @@ -0,0 +1,53 @@ +#ifndef GTKMM_TEMPLATE_LOAD_TAB_H +#define GTKMM_TEMPLATE_LOAD_TAB_H + +#include +#include +#include +#include +#include + + +class TemplateLoadTab : public Gtk::Frame +{ + +public: + TemplateLoadTab(); + virtual ~TemplateLoadTab(); + virtual void createTemplate(); + +protected: + class StringModelColumns : public Gtk::TreeModelColumnRecord + { + public: + StringModelColumns() + { + add(textValue); + } + + Gtk::TreeModelColumn textValue; + }; + + Glib::ustring currentKeyword; + Glib::ustring currentTemplate; + + virtual void displayTemplateInfo(); + virtual void initKeywordsList(); + virtual void refreshTemplatesList(); + + void initLists(); + void keywordSelected(); + + Gtk::HBox mainBox; + Gtk::VBox templatesColumn; + Gtk::VBox templateInfoColumn; + + Gtk::ComboBoxText keywordsCombo; + + Gtk::TreeView templatesView; + Glib::RefPtr templatesRef; + StringModelColumns templatesColumns; + +}; + +#endif // GTKMM_TEMPLATE_LOAD_TAB_H \ No newline at end of file -- cgit v1.2.3 From 80174b60033b8439eb06256f7ce9a51a26c6f7ed Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Fri, 21 Jun 2013 22:44:07 +0200 Subject: cppcheck (bzr r12382) --- src/sp-string.cpp | 8 ++++---- src/ui/dialog/align-and-distribute.cpp | 4 ++-- src/ui/dialog/transformation.cpp | 4 ++-- src/unicoderange.cpp | 8 +++++--- src/widgets/sp-color-icc-selector.cpp | 6 ++++-- 5 files changed, 17 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/sp-string.cpp b/src/sp-string.cpp index 2fe84ac6a..457c248bc 100644 --- a/src/sp-string.cpp +++ b/src/sp-string.cpp @@ -132,10 +132,10 @@ sp_string_update(SPObject *object, SPCtx *ctx, unsigned flags) if (((SPObjectClass *) sp_string_parent_class)->update) ((SPObjectClass *) sp_string_parent_class)->update(object, ctx, flags); - if (flags & (SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_MODIFIED_FLAG)) { - /* Parent style or we ourselves changed, so recalculate */ - flags &= ~SP_OBJECT_USER_MODIFIED_FLAG_B; // won't be "just a transformation" anymore, we're going to recompute "x" and "y" attributes - } + // if (flags & (SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_MODIFIED_FLAG)) { + // /* Parent style or we ourselves changed, so recalculate */ + // flags &= ~SP_OBJECT_USER_MODIFIED_FLAG_B; // won't be "just a transformation" anymore, we're going to recompute "x" and "y" attributes + // } } diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp index dbd06d9e8..7f88824f7 100644 --- a/src/ui/dialog/align-and-distribute.cpp +++ b/src/ui/dialog/align-and-distribute.cpp @@ -195,7 +195,7 @@ void ActionAlign::do_action(SPDesktop *desktop, int index) { //Move each item in the selected list separately for (std::list::iterator it(selected.begin()); it != selected.end(); - it++) + ++it) { sp_desktop_document (desktop)->ensureUpToDate(); if (!sel_as_group) @@ -347,7 +347,7 @@ private : float pos = sorted.front().bbox.min()[_orientation]; for ( std::vector ::iterator it (sorted.begin()); it < sorted.end(); - it ++ ) + ++it ) { if (!Geom::are_near(pos, it->bbox.min()[_orientation], 1e-6)) { Geom::Point t(0.0, 0.0); diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp index 4aa972296..2ae98beda 100644 --- a/src/ui/dialog/transformation.cpp +++ b/src/ui/dialog/transformation.cpp @@ -762,7 +762,7 @@ void Transformation::applyPageMove(Inkscape::Selection *selection) double move = x; for ( std::vector ::iterator it (sorted.begin()); it < sorted.end(); - it ++ ) + ++it ) { sp_item_move_rel(it->item, Geom::Translate(move, 0)); // move each next object by x relative to previous @@ -786,7 +786,7 @@ void Transformation::applyPageMove(Inkscape::Selection *selection) double move = y; for ( std::vector ::iterator it (sorted.begin()); it < sorted.end(); - it ++ ) + ++it ) { sp_item_move_rel(it->item, Geom::Translate(0, move)); // move each next object by x relative to previous diff --git a/src/unicoderange.cpp b/src/unicoderange.cpp index dcf461214..67239d0d2 100644 --- a/src/unicoderange.cpp +++ b/src/unicoderange.cpp @@ -37,8 +37,10 @@ int UnicodeRange::add_range(gchar* val){ Urange r; int i=0, count=0; - while(val[i]!='\0' && val[i]!='-' && val[i]!=' ' && val[i]!=',') i++; - r.start = (gchar*) malloc((i+1)*sizeof(gchar*)); + while(val[i]!='\0' && val[i]!='-' && val[i]!=' ' && val[i]!=','){ + i++; + } + r.start = (gchar*) malloc((i+1)*sizeof(gchar*)); strncpy(r.start, val, i); r.start[i] = '\0'; val+=i; @@ -50,7 +52,7 @@ UnicodeRange::add_range(gchar* val){ r.end = (gchar*) malloc((i+1)*sizeof(gchar*)); strncpy(r.end, val, i); r.end[i] = '\0'; - val+=i; + // val+=i; count+=i; } else { r.end=NULL; diff --git a/src/widgets/sp-color-icc-selector.cpp b/src/widgets/sp-color-icc-selector.cpp index 00b00ce38..53e73dd57 100644 --- a/src/widgets/sp-color-icc-selector.cpp +++ b/src/widgets/sp-color-icc-selector.cpp @@ -272,7 +272,8 @@ static void sp_color_icc_selector_class_init(SPColorICCSelectorClass *klass) ColorICCSelector::ColorICCSelector( SPColorSelector* csel ) - : ColorSelector( csel ) + : ColorSelector( csel ), + _impl(NULL) { } @@ -429,7 +430,8 @@ ColorICCSelectorImpl::~ColorICCSelectorImpl() void ColorICCSelector::init() { - _impl = new ColorICCSelectorImpl(this); + if (_impl) delete(_impl); + _impl = new ColorICCSelectorImpl(this); gint row = 0; _impl->_updating = FALSE; -- cgit v1.2.3 From df46631f0e183b8e4cc6f87b45ae8a4cfcc33a78 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Fri, 21 Jun 2013 22:45:22 +0200 Subject: odf metadata - let's begin with a first step to full ODF compatibility (bzr r12383) --- src/extension/internal/odf.cpp | 44 ++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/extension/internal/odf.cpp b/src/extension/internal/odf.cpp index b23378fc3..9f745cdea 100644 --- a/src/extension/internal/odf.cpp +++ b/src/extension/internal/odf.cpp @@ -1191,16 +1191,29 @@ bool OdfOutput::writeMeta(ZipFile &zf) { creator = iter->second; } - Glib::ustring date = ""; + + Glib::ustring date; + Glib::ustring moddate; + char buf [80]; + time_t rawtime; + struct tm * timeinfo; + time (&rawtime); + timeinfo = localtime (&rawtime); + strftime (buf,80,"%Y-%m-%d %H:%M:%S",timeinfo); + moddate = Glib::ustring(buf); + iter = metadata.find("dc:date"); if (iter != metadata.end()) { date = iter->second; } + else + { + date = moddate; + } outs.writeString("\n"); outs.writeString("\n"); - outs.writeString("\n"); outs.writeString("\n"); outs.writeString("\n"); - outs.writeString("\n"); outs.writeString("\n"); outs.writeString("\n"); - Glib::ustring tmp = Glib::ustring(" ") + InkscapeVersion + "\n"; + Glib::ustring tmp = Glib::ustring::compose(" %1\n", InkscapeVersion); + tmp += Glib::ustring::compose(" %1\n", creator); + tmp += Glib::ustring::compose(" %1\n", date); + tmp += Glib::ustring::compose(" %1\n", moddate); outs.writeUString(tmp); - outs.printf(" %s\n", creator.c_str()); - outs.printf(" %s\n", date.c_str()); for (iter = metadata.begin() ; iter != metadata.end() ; ++iter) { Glib::ustring name = iter->first; @@ -1235,18 +1248,15 @@ bool OdfOutput::writeMeta(ZipFile &zf) outs.writeUString(tmp); } } - outs.writeString(" 2\n"); - outs.writeString(" PT56S\n"); - outs.writeString(" \n"); - outs.writeString(" \n"); - outs.writeString(" \n"); - outs.writeString(" \n"); - outs.writeString(" \n"); + // outs.writeString(" 2\n"); + // outs.writeString(" PT56S\n"); + // outs.writeString(" \n"); + // outs.writeString(" \n"); + // outs.writeString(" \n"); + // outs.writeString(" \n"); + // outs.writeString(" \n"); outs.writeString("\n"); outs.writeString("\n"); - outs.writeString("\n"); - outs.writeString("\n"); - outs.close(); //Make our entry @@ -1533,7 +1543,7 @@ bool OdfOutput::processGradient(SPItem *item, gradientTable.push_back(gi); gradientLookupTable[id] = gradientName; - int gradientCount = gradientTable.size(); + // int gradientCount = gradientTable.size(); char buf[128]; if (gi.style == "linear") { -- cgit v1.2.3 From 0d0e1eac78d0ae118041022c43e94901cef1b5e8 Mon Sep 17 00:00:00 2001 From: Slagvi Public Date: Sat, 22 Jun 2013 15:22:37 +0200 Subject: Coding style fixes (bzr r12379.2.2) --- src/templates/main.cpp | 6 +- src/templates/new-from-template.cpp | 42 +++++++++++ src/templates/new-from-template.h | 31 +++++++++ src/templates/newfromtemplate.cpp | 35 ---------- src/templates/newfromtemplate.h | 25 ------- src/templates/static-template-load-tab.cpp | 47 +++++++++++++ src/templates/static-template-load-tab.h | 33 +++++++++ src/templates/statictemplateloadtab.cpp | 42 ----------- src/templates/statictemplateloadtab.h | 27 -------- src/templates/template-load-tab.cpp | 107 +++++++++++++++++++++++++++++ src/templates/template-load-tab.h | 59 ++++++++++++++++ src/templates/templateloadtab.cpp | 101 --------------------------- src/templates/templateloadtab.h | 53 -------------- 13 files changed, 323 insertions(+), 285 deletions(-) create mode 100644 src/templates/new-from-template.cpp create mode 100644 src/templates/new-from-template.h delete mode 100644 src/templates/newfromtemplate.cpp delete mode 100644 src/templates/newfromtemplate.h create mode 100644 src/templates/static-template-load-tab.cpp create mode 100644 src/templates/static-template-load-tab.h delete mode 100644 src/templates/statictemplateloadtab.cpp delete mode 100644 src/templates/statictemplateloadtab.h create mode 100644 src/templates/template-load-tab.cpp create mode 100644 src/templates/template-load-tab.h delete mode 100644 src/templates/templateloadtab.cpp delete mode 100644 src/templates/templateloadtab.h (limited to 'src') diff --git a/src/templates/main.cpp b/src/templates/main.cpp index 1ff93822c..d7a3f40a4 100644 --- a/src/templates/main.cpp +++ b/src/templates/main.cpp @@ -1,6 +1,8 @@ #include -#include "newfromtemplate.h" +#include "new-from-template.h" + +using namespace Inkscape::UI; int main (int argc, char *argv[]) { @@ -11,4 +13,4 @@ int main (int argc, char *argv[]) //Gtk::Main::run(dialog); return 0; -} \ No newline at end of file +} diff --git a/src/templates/new-from-template.cpp b/src/templates/new-from-template.cpp new file mode 100644 index 000000000..450337aea --- /dev/null +++ b/src/templates/new-from-template.cpp @@ -0,0 +1,42 @@ +#include "new-from-template.h" +#include "gtkmm/alignment.h" + +namespace Inkscape { +namespace UI { + + +NewFromTemplate::NewFromTemplate() : + _createButton("Create from template") +{ + set_title("New From Template"); + resize(400, 250); + + get_vbox()->pack_start(_mainWidget); + _mainWidget.append_page(_tab1, "Static Templates"); + _mainWidget.append_page(_tab2, "Procedural Templates"); + + Gtk::Alignment *align; + align = manage(new Gtk::Alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER, 0.0, 0.0)); + get_vbox()->pack_end(*align, Gtk::PACK_SHRINK, 5); + align->add(_createButton); + + _createButton.signal_pressed().connect( + sigc::mem_fun(*this, &NewFromTemplate::_createFromTemplate)); + + show_all(); +} + + +void NewFromTemplate::_createFromTemplate() +{ + if ( _mainWidget.get_current_page() == 0 ) { + _tab1.createTemplate(); + } else { + _tab2.createTemplate(); + } + + response(0); +} + +} +} diff --git a/src/templates/new-from-template.h b/src/templates/new-from-template.h new file mode 100644 index 000000000..869680ae3 --- /dev/null +++ b/src/templates/new-from-template.h @@ -0,0 +1,31 @@ +#ifndef INKSCAPE_SEEN_UI_DIALOG_NEW_FROM_TEMPLATE_H +#define INKSCAPE_SEEN_UI_DIALOG_NEW_FROM_TEMPLATE_H + +#include +#include +#include + +#include "template-load-tab.h" +#include "static-template-load-tab.h" + +namespace Inkscape { +namespace UI { + + +class NewFromTemplate : public Gtk::Dialog +{ +public: + NewFromTemplate(); + +private: + Gtk::Notebook _mainWidget; + Gtk::Button _createButton; + StaticTemplateLoadTab _tab1; + TemplateLoadTab _tab2; + + void _createFromTemplate(); +}; + +} +} +#endif diff --git a/src/templates/newfromtemplate.cpp b/src/templates/newfromtemplate.cpp deleted file mode 100644 index 3a215889d..000000000 --- a/src/templates/newfromtemplate.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "newfromtemplate.h" -#include "gtkmm/alignment.h" - - -NewFromTemplate::NewFromTemplate() : - createButton("Create from template") -{ - set_title("New From Template"); - resize(400, 250); - - get_vbox()->pack_start(mainWidget); - mainWidget.append_page(tab1, "Static Templates"); - mainWidget.append_page(tab2, "Procedural Templates"); - - Gtk::Alignment *align; - align = manage(new Gtk::Alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER, 0.0, 0.0)); - get_vbox()->pack_end(*align, Gtk::PACK_SHRINK, 5); - align->add(createButton); - - createButton.signal_pressed().connect( - sigc::mem_fun(*this, &NewFromTemplate::createFromTemplate)); - - show_all(); -} - - -void NewFromTemplate::createFromTemplate() -{ - if (mainWidget.get_current_page() == 0) - tab1.createTemplate(); - else - tab2.createTemplate(); - - response(0); -} \ No newline at end of file diff --git a/src/templates/newfromtemplate.h b/src/templates/newfromtemplate.h deleted file mode 100644 index 1a6ce555d..000000000 --- a/src/templates/newfromtemplate.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef GTKMM_NEW_FROM_TEMPLATE_H -#define GTKMM_TNEW_FROM_TEMPLATE_H - -#include -#include -#include - -#include "templateloadtab.h" -#include "statictemplateloadtab.h" - - -class NewFromTemplate : public Gtk::Dialog -{ -public: - NewFromTemplate(); - -private: - Gtk::Notebook mainWidget; - Gtk::Button createButton; - StaticTemplateLoadTab tab1; - TemplateLoadTab tab2; - - void createFromTemplate(); -}; -#endif \ No newline at end of file diff --git a/src/templates/static-template-load-tab.cpp b/src/templates/static-template-load-tab.cpp new file mode 100644 index 000000000..e71b9dede --- /dev/null +++ b/src/templates/static-template-load-tab.cpp @@ -0,0 +1,47 @@ +#include +#include +#include +#include + +#include "static-template-load-tab.h" + +namespace Inkscape { +namespace UI { + + +StaticTemplateLoadTab::StaticTemplateLoadTab() : + _moreInfoButton("More info"), + _previewImage("preview.png"), + _shortDescriptionLabel("Short description - I like trains. ad asda asd asdweqe gdfg"), + _templateNameLabel("Template_name"), + _templateAuthorLabel("by template_author") +{ + _templateInfoColumn.pack_start(_templateNameLabel, Gtk::PACK_SHRINK, 4); + _templateInfoColumn.pack_start(_templateAuthorLabel, Gtk::PACK_SHRINK, 0); + _templateInfoColumn.pack_start(_previewImage, Gtk::PACK_SHRINK, 15); + _templateInfoColumn.pack_start(_shortDescriptionLabel, Gtk::PACK_SHRINK, 4); + + _shortDescriptionLabel.set_line_wrap(true); + _shortDescriptionLabel.set_size_request(200); + + Gtk::Alignment *align; + align = manage(new Gtk::Alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER, 0.0, 0.0)); + _templateInfoColumn.pack_start(*align, Gtk::PACK_SHRINK, 5); + align->add(_moreInfoButton); +} + + +void StaticTemplateLoadTab::createTemplate() +{ + std::cout << "Static template\n"; +} + + +void StaticTemplateLoadTab::_displayTemplateInfo() +{ + TemplateLoadTab::_displayTemplateInfo(); + _templateNameLabel.set_text(_currentTemplate); +} + +} +} diff --git a/src/templates/static-template-load-tab.h b/src/templates/static-template-load-tab.h new file mode 100644 index 000000000..e6ed17f4c --- /dev/null +++ b/src/templates/static-template-load-tab.h @@ -0,0 +1,33 @@ +#ifndef INKSCAPE_SEEN_UI_DIALOG_STATIC_TEMPLATE_LOAD_TAB_H +#define INKSCAPE_SEEN_UI_DIALOG_STATIC_TEMPLATE_LOAD_TAB_H + +#include +#include +#include + +#include "template-load-tab.h" + +namespace Inkscape { +namespace UI { + + +class StaticTemplateLoadTab : public TemplateLoadTab +{ +public: + StaticTemplateLoadTab(); + virtual void createTemplate(); + +protected: + virtual void _displayTemplateInfo(); + + Gtk::Button _moreInfoButton; + Gtk::Label _shortDescriptionLabel; + Gtk::Label _templateAuthorLabel; + Gtk::Label _templateNameLabel; + Gtk::Image _previewImage; +}; + +} +} + +#endif diff --git a/src/templates/statictemplateloadtab.cpp b/src/templates/statictemplateloadtab.cpp deleted file mode 100644 index b82338f16..000000000 --- a/src/templates/statictemplateloadtab.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include -#include -#include -#include - -#include "statictemplateloadtab.h" - - -StaticTemplateLoadTab::StaticTemplateLoadTab() : - moreInfoButton("More info"), - previewImage("preview.png"), - shortDescriptionLabel("Short description - I like trains. ad asda asd asdweqe gdfg"), - templateNameLabel("Template_name"), - templateAuthorLabel("by template_author") -{ - templateInfoColumn.pack_start(templateNameLabel, Gtk::PACK_SHRINK, 4); - templateInfoColumn.pack_start(templateAuthorLabel, Gtk::PACK_SHRINK, 0); - templateInfoColumn.pack_start(previewImage, Gtk::PACK_SHRINK, 15); - templateInfoColumn.pack_start(shortDescriptionLabel, Gtk::PACK_SHRINK, 4); - - shortDescriptionLabel.set_line_wrap(true); - shortDescriptionLabel.set_size_request(200); - - Gtk::Alignment *align; - align = manage(new Gtk::Alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER, 0.0, 0.0)); - templateInfoColumn.pack_start(*align, Gtk::PACK_SHRINK, 5); - align->add(moreInfoButton); -} - - -void StaticTemplateLoadTab::createTemplate() -{ - std::cout << "Static template\n"; -} - - -void StaticTemplateLoadTab::displayTemplateInfo() -{ - TemplateLoadTab::displayTemplateInfo(); - templateNameLabel.set_text(currentTemplate); -} - diff --git a/src/templates/statictemplateloadtab.h b/src/templates/statictemplateloadtab.h deleted file mode 100644 index 43d640b85..000000000 --- a/src/templates/statictemplateloadtab.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef GTKMM_STATIC_TEMPLATE_LOAD_TAB_H -#define GTKMM_STATIC_TEMPLATE_LOAD_TAB_H - -#include -#include -#include - -#include "templateloadtab.h" - - -class StaticTemplateLoadTab : public TemplateLoadTab -{ -public: - StaticTemplateLoadTab(); - virtual void createTemplate(); - -protected: - virtual void displayTemplateInfo(); - - Gtk::Button moreInfoButton; - Gtk::Label shortDescriptionLabel; - Gtk::Label templateAuthorLabel; - Gtk::Label templateNameLabel; - Gtk::Image previewImage; -}; - -#endif \ No newline at end of file diff --git a/src/templates/template-load-tab.cpp b/src/templates/template-load-tab.cpp new file mode 100644 index 000000000..d5fcd18ca --- /dev/null +++ b/src/templates/template-load-tab.cpp @@ -0,0 +1,107 @@ +#include +#include + +#include "template-load-tab.h" + +namespace Inkscape { +namespace UI { + + +TemplateLoadTab::TemplateLoadTab() +{ + set_border_width(10); + + Gtk::Label *title; + title = manage(new Gtk::Label("Search Tags:")); + _templatesColumn.pack_start(*title, Gtk::PACK_SHRINK, 10); + + _templatesColumn.pack_start(_keywordsCombo, Gtk::PACK_SHRINK, 0); + + title = manage(new Gtk::Label("Templates")); + _templatesColumn.pack_start(*title, Gtk::PACK_SHRINK, 10); + + title = manage(new Gtk::Label("Selected template")); + _templateInfoColumn.pack_start(*title, Gtk::PACK_SHRINK, 10); + + _initLists(); + + add(_mainBox); + _mainBox.pack_start(_templatesColumn, Gtk::PACK_SHRINK, 20); + _mainBox.pack_start(_templateInfoColumn, Gtk::PACK_EXPAND_WIDGET, 10); + + _templatesColumn.pack_start(_templatesView, Gtk::PACK_SHRINK, 5); + + Glib::RefPtr templateSelectionRef = + _templatesView.get_selection(); + + templateSelectionRef->signal_changed().connect( + sigc::mem_fun(*this, &TemplateLoadTab::_displayTemplateInfo)); + + _keywordsCombo.signal_changed().connect( + sigc::mem_fun(*this, &TemplateLoadTab::_keywordSelected)); + this->show_all(); +} + + +TemplateLoadTab::~TemplateLoadTab() +{ +} + + +void TemplateLoadTab::createTemplate() +{ + std::cout << "Default Template Tab" << std::endl; +} + + +void TemplateLoadTab::_displayTemplateInfo() +{ + Glib::RefPtr templateSelectionRef = _templatesView.get_selection(); + if (templateSelectionRef->get_selected()) { + _currentTemplate = (*templateSelectionRef->get_selected())[_templatesColumns.textValue]; + } +} + + +void TemplateLoadTab::_initKeywordsList() +{ + _keywordsCombo.append_text("All"); + _keywordsCombo.set_active_text("All"); + + for (int i = 0 ; i < 10 ; ++i) { + _keywordsCombo.append_text( "Keyword" + Glib::ustring::format(i)); + } +} + + +void TemplateLoadTab::_initLists() +{ + _templatesRef = Gtk::ListStore::create(_templatesColumns); + _templatesView.set_model(_templatesRef); + _templatesView.append_column("", _templatesColumns.textValue); + _templatesView.set_headers_visible(false); + + _initKeywordsList(); + _refreshTemplatesList(); +} + + +void TemplateLoadTab::_keywordSelected() +{ + _currentKeyword = _keywordsCombo.get_active_text(); + _refreshTemplatesList(); +} + + +void TemplateLoadTab::_refreshTemplatesList() +{ + _templatesRef->clear(); + for (int i = 0 ; i < 7 ; ++i) { + Gtk::TreeModel::iterator iter = _templatesRef->append(); + Gtk::TreeModel::Row row = *iter; + row[_templatesColumns.textValue] = "Template" + Glib::ustring::format(i); + } +} + +} +} diff --git a/src/templates/template-load-tab.h b/src/templates/template-load-tab.h new file mode 100644 index 000000000..bb55b384c --- /dev/null +++ b/src/templates/template-load-tab.h @@ -0,0 +1,59 @@ +#ifndef INKSCAPE_SEEN_UI_DIALOG_TEMPLATE_LOAD_TAB_H +#define INKSCAPE_SEEN_UI_DIALOG_TEMPLATE_LOAD_TAB_H + +#include +#include +#include +#include +#include + +namespace Inkscape { +namespace UI { + + +class TemplateLoadTab : public Gtk::Frame +{ + +public: + TemplateLoadTab(); + virtual ~TemplateLoadTab(); + virtual void createTemplate(); + +protected: + class StringModelColumns : public Gtk::TreeModelColumnRecord + { + public: + StringModelColumns() + { + add(textValue); + } + + Gtk::TreeModelColumn textValue; + }; + + Glib::ustring _currentKeyword; + Glib::ustring _currentTemplate; + + virtual void _displayTemplateInfo(); + virtual void _initKeywordsList(); + virtual void _refreshTemplatesList(); + + void _initLists(); + void _keywordSelected(); + + Gtk::HBox _mainBox; + Gtk::VBox _templatesColumn; + Gtk::VBox _templateInfoColumn; + + Gtk::ComboBoxText _keywordsCombo; + + Gtk::TreeView _templatesView; + Glib::RefPtr _templatesRef; + StringModelColumns _templatesColumns; + +}; + +} +} + +#endif diff --git a/src/templates/templateloadtab.cpp b/src/templates/templateloadtab.cpp deleted file mode 100644 index 734ac3eec..000000000 --- a/src/templates/templateloadtab.cpp +++ /dev/null @@ -1,101 +0,0 @@ -#include -#include - -#include "templateloadtab.h" - - -TemplateLoadTab::TemplateLoadTab() -{ - set_border_width(10); - - Gtk::Label *title; - title = manage(new Gtk::Label("Search Tags:")); - templatesColumn.pack_start(*title, Gtk::PACK_SHRINK, 10); - - templatesColumn.pack_start(keywordsCombo, Gtk::PACK_SHRINK, 0); - - title = manage(new Gtk::Label("Templates")); - templatesColumn.pack_start(*title, Gtk::PACK_SHRINK, 10); - - title = manage(new Gtk::Label("Selected template")); - templateInfoColumn.pack_start(*title, Gtk::PACK_SHRINK, 10); - - initLists(); - - add(mainBox); - mainBox.pack_start(templatesColumn, Gtk::PACK_SHRINK, 20); - mainBox.pack_start(templateInfoColumn, Gtk::PACK_EXPAND_WIDGET, 10); - - templatesColumn.pack_start(templatesView, Gtk::PACK_SHRINK, 5); - - Glib::RefPtr templateSelectionRef = - templatesView.get_selection(); - - templateSelectionRef->signal_changed().connect( - sigc::mem_fun(*this, &TemplateLoadTab::displayTemplateInfo)); - - keywordsCombo.signal_changed().connect( - sigc::mem_fun(*this, &TemplateLoadTab::keywordSelected)); - this->show_all(); -} - - -TemplateLoadTab::~TemplateLoadTab() -{ -} - - -void TemplateLoadTab::createTemplate() -{ - std::cout << "Default Template Tab" << std::endl; -} - - -void TemplateLoadTab::displayTemplateInfo() -{ - Glib::RefPtr templateSelectionRef = templatesView.get_selection(); - if (templateSelectionRef->get_selected()) - currentTemplate = (*templateSelectionRef->get_selected())[templatesColumns.textValue]; -} - - -void TemplateLoadTab::initKeywordsList() -{ - keywordsCombo.append_text("All"); - keywordsCombo.set_active_text("All"); - - for (int i=0; i<10; ++i){ - - keywordsCombo.append_text( "Keyword" + Glib::ustring::format(i)); - } -} - - -void TemplateLoadTab::initLists() -{ - templatesRef = Gtk::ListStore::create(templatesColumns); - templatesView.set_model(templatesRef); - templatesView.append_column("", templatesColumns.textValue); - templatesView.set_headers_visible(false); - - initKeywordsList(); - refreshTemplatesList(); -} - - -void TemplateLoadTab::keywordSelected() -{ - currentKeyword = keywordsCombo.get_active_text(); - refreshTemplatesList(); -} - - -void TemplateLoadTab::refreshTemplatesList() -{ - templatesRef->clear(); - for (int i=0; i<7; ++i){ - Gtk::TreeModel::iterator iter = templatesRef->append(); - Gtk::TreeModel::Row row = *iter; - row[templatesColumns.textValue] = "Template" + Glib::ustring::format(i); - } -} \ No newline at end of file diff --git a/src/templates/templateloadtab.h b/src/templates/templateloadtab.h deleted file mode 100644 index 3947e25fb..000000000 --- a/src/templates/templateloadtab.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef GTKMM_TEMPLATE_LOAD_TAB_H -#define GTKMM_TEMPLATE_LOAD_TAB_H - -#include -#include -#include -#include -#include - - -class TemplateLoadTab : public Gtk::Frame -{ - -public: - TemplateLoadTab(); - virtual ~TemplateLoadTab(); - virtual void createTemplate(); - -protected: - class StringModelColumns : public Gtk::TreeModelColumnRecord - { - public: - StringModelColumns() - { - add(textValue); - } - - Gtk::TreeModelColumn textValue; - }; - - Glib::ustring currentKeyword; - Glib::ustring currentTemplate; - - virtual void displayTemplateInfo(); - virtual void initKeywordsList(); - virtual void refreshTemplatesList(); - - void initLists(); - void keywordSelected(); - - Gtk::HBox mainBox; - Gtk::VBox templatesColumn; - Gtk::VBox templateInfoColumn; - - Gtk::ComboBoxText keywordsCombo; - - Gtk::TreeView templatesView; - Glib::RefPtr templatesRef; - StringModelColumns templatesColumns; - -}; - -#endif // GTKMM_TEMPLATE_LOAD_TAB_H \ No newline at end of file -- cgit v1.2.3 From b1f718bfec1daa260ea6417c85c5502954ad1e5e Mon Sep 17 00:00:00 2001 From: Slagvi Public Date: Sat, 22 Jun 2013 15:47:42 +0200 Subject: Changed comboBox into editable (bzr r12379.2.3) --- src/templates/template-load-tab.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/templates/template-load-tab.cpp b/src/templates/template-load-tab.cpp index d5fcd18ca..febbb3be6 100644 --- a/src/templates/template-load-tab.cpp +++ b/src/templates/template-load-tab.cpp @@ -7,7 +7,8 @@ namespace Inkscape { namespace UI { -TemplateLoadTab::TemplateLoadTab() +TemplateLoadTab::TemplateLoadTab() : + _keywordsCombo(true) { set_border_width(10); @@ -66,7 +67,6 @@ void TemplateLoadTab::_displayTemplateInfo() void TemplateLoadTab::_initKeywordsList() { _keywordsCombo.append_text("All"); - _keywordsCombo.set_active_text("All"); for (int i = 0 ; i < 10 ; ++i) { _keywordsCombo.append_text( "Keyword" + Glib::ustring::format(i)); -- cgit v1.2.3 From b70b0336a827e9db4c091a321b32add41dc22941 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sun, 23 Jun 2013 21:45:37 +0200 Subject: Remove unused file memeq.h (bzr r12385) --- src/CMakeLists.txt | 1 - src/Makefile_insert | 1 - src/doxygen-main.cpp | 2 +- src/memeq.h | 25 ------------------------- 4 files changed, 1 insertion(+), 28 deletions(-) delete mode 100644 src/memeq.h (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a8925e24f..49f32fdea 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -407,7 +407,6 @@ set(inkscape_SRC marker.h measure-context.h media.h - memeq.h menus-skeleton.h mesh-context.h message-context.h diff --git a/src/Makefile_insert b/src/Makefile_insert index c6955c92a..87b2545c8 100644 --- a/src/Makefile_insert +++ b/src/Makefile_insert @@ -99,7 +99,6 @@ ink_common_sources += \ main-cmdlineact.cpp main-cmdlineact.h \ marker.cpp marker.h \ media.cpp media.h \ - memeq.h \ menus-skeleton.h \ mesh-context.cpp mesh-context.h \ message-context.cpp message-context.h \ diff --git a/src/doxygen-main.cpp b/src/doxygen-main.cpp index 71cd49dae..04e5ab33e 100644 --- a/src/doxygen-main.cpp +++ b/src/doxygen-main.cpp @@ -303,7 +303,7 @@ namespace XML {} * SPGuide [\ref sp-guide.cpp, \ref sp-guide.h, \ref satisfied-guide-cns.cpp, \ref sp-guide-attachment.h, \ref sp-guide-constraint.h] * * [\ref help.cpp] [\ref inkscape.cpp] [\ref inkscape-stock.cpp] - * [\ref interface.cpp, \ref memeq.h] [\ref main.cpp, \ref winmain.cpp] + * [\ref interface.cpp] [\ref main.cpp, \ref winmain.cpp] * [\ref menus-skeleton.h, \ref preferences-skeleton.h] * [\ref select-toolbar.cpp] [\ref shortcuts.cpp] * [\ref sp-cursor.cpp] [\ref text-edit.cpp] [\ref toolbox.cpp] diff --git a/src/memeq.h b/src/memeq.h deleted file mode 100644 index ebccc3c9e..000000000 --- a/src/memeq.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef INKSCAPE_MEMEQ_H -#define INKSCAPE_MEMEQ_H - -#include - -/** Convenience/readability wrapper for memcmp(a,b,n)==0. */ -inline bool -memeq(void const *a, void const *b, size_t n) -{ - return std::memcmp(a, b, n) == 0; -} - - -#endif /* !INKSCAPE_MEMEQ_H */ - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : -- cgit v1.2.3 From e4bbe51f2155809c639e86d7b49b24165101638c Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sun, 23 Jun 2013 21:51:39 +0200 Subject: Documentation spelling fix (bzr r12386) --- src/winconsole.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/winconsole.cpp b/src/winconsole.cpp index 1515d2062..085fb441c 100644 --- a/src/winconsole.cpp +++ b/src/winconsole.cpp @@ -5,13 +5,13 @@ * Windows has two types of executables: GUI and console. * The GUI executables detach immediately when run from the command * prompt (cmd.exe), and whatever you write to standard output - * disappears into a black hole. Console executables handle + * disappears into a black hole. Console executables * do display standard output and take standard input from the console, * but when you run them from the GUI, an extra console window appears. - * It's possible to hide it, but it still flashes from a fraction + * It's possible to hide it, but it still flashes for a fraction * of a second. * - * To provide an Unix-like experienve, where the application will behave + * To provide an Unix-like experience, where the application will behave * correctly in command line mode and at the same time won't create * the ugly console window when run from the GUI, we have to have two * executables. The first one, inkscape.exe, is the GUI application. @@ -31,7 +31,7 @@ *//* * Authors: * Jos Hirth - * Krzysztof Kosiński + * Krzysztof Kosinski * * Copyright (C) 2008-2010 Authors * -- cgit v1.2.3 From ffc3caac52be3af14ab168ba63b3adeefe5d08ec Mon Sep 17 00:00:00 2001 From: Christoffer Holmstedt Date: Mon, 24 Jun 2013 08:28:46 +0200 Subject: Changed document properties - metadata tooltips to match the definition of dublin core terms. Fixed bugs: - https://launchpad.net/bugs/835849 (bzr r12387.2.1) --- src/rdf.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/rdf.cpp b/src/rdf.cpp index 017de42c1..1265928ea 100644 --- a/src/rdf.cpp +++ b/src/rdf.cpp @@ -230,56 +230,56 @@ struct rdf_license_t rdf_licenses [] = { // the localization functions when you use them! struct rdf_work_entity_t rdf_work_entities [] = { { "title", N_("Title:"), "dc:title", RDF_CONTENT, - N_("Name by which this document is formally known"), RDF_FORMAT_LINE, RDF_EDIT_GENERIC, + N_("A name given to the resource"), RDF_FORMAT_LINE, RDF_EDIT_GENERIC, }, { "date", N_("Date:"), "dc:date", RDF_CONTENT, - N_("Date associated with the creation of this document (YYYY-MM-DD)"), RDF_FORMAT_LINE, RDF_EDIT_GENERIC, + N_("A point or period of time associated with an event in the lifecycle of the resource"), RDF_FORMAT_LINE, RDF_EDIT_GENERIC, }, { "format", N_("Format:"), "dc:format", RDF_CONTENT, - N_("The physical or digital manifestation of this document (MIME type)"), RDF_FORMAT_LINE, RDF_EDIT_HARDCODED, + N_("The file format, physical medium, or dimensions of the resource"), RDF_FORMAT_LINE, RDF_EDIT_HARDCODED, }, { "type", N_("Type:"), "dc:type", RDF_RESOURCE, - N_("Type of document (DCMI Type)"), RDF_FORMAT_LINE, RDF_EDIT_HARDCODED, + N_("The nature or genre of the resource"), RDF_FORMAT_LINE, RDF_EDIT_HARDCODED, }, { "creator", N_("Creator:"), "dc:creator", RDF_AGENT, - N_("Name of entity primarily responsible for making the content of this document"), RDF_FORMAT_LINE, RDF_EDIT_GENERIC, + N_("An entity primarily responsible for making the resource"), RDF_FORMAT_LINE, RDF_EDIT_GENERIC, }, { "rights", N_("Rights:"), "dc:rights", RDF_AGENT, - N_("Name of entity with rights to the Intellectual Property of this document"), RDF_FORMAT_LINE, RDF_EDIT_GENERIC, + N_("Information about rights held in and over the resource"), RDF_FORMAT_LINE, RDF_EDIT_GENERIC, }, { "publisher", N_("Publisher:"), "dc:publisher", RDF_AGENT, - N_("Name of entity responsible for making this document available"), RDF_FORMAT_LINE, RDF_EDIT_GENERIC, + N_("An entity responsible for making the resource available"), RDF_FORMAT_LINE, RDF_EDIT_GENERIC, }, { "identifier", N_("Identifier:"), "dc:identifier", RDF_CONTENT, - N_("Unique URI to reference this document"), RDF_FORMAT_LINE, RDF_EDIT_GENERIC, + N_("An unambiguous reference to the resource within a given context"), RDF_FORMAT_LINE, RDF_EDIT_GENERIC, }, { "source", N_("Source:"), "dc:source", RDF_CONTENT, - N_("Unique URI to reference the source of this document"), RDF_FORMAT_LINE, RDF_EDIT_GENERIC, + N_("A related resource from which the described resource is derived"), RDF_FORMAT_LINE, RDF_EDIT_GENERIC, }, { "relation", N_("Relation:"), "dc:relation", RDF_CONTENT, - N_("Unique URI to a related document"), RDF_FORMAT_LINE, RDF_EDIT_GENERIC, + N_("A related resource"), RDF_FORMAT_LINE, RDF_EDIT_GENERIC, }, { "language", N_("Language:"), "dc:language", RDF_CONTENT, - N_("Two-letter language tag with optional subtags for the language of this document (e.g. 'en-GB')"), RDF_FORMAT_LINE, RDF_EDIT_GENERIC, + N_("A language of the resource"), RDF_FORMAT_LINE, RDF_EDIT_GENERIC, }, { "subject", N_("Keywords:"), "dc:subject", RDF_BAG, - N_("The topic of this document as comma-separated key words, phrases, or classifications"), RDF_FORMAT_LINE, RDF_EDIT_GENERIC, + N_("The topic of the resource"), RDF_FORMAT_LINE, RDF_EDIT_GENERIC, }, // TRANSLATORS: "Coverage": the spatial or temporal characteristics of the content. // For info, see Appendix D of http://www.w3.org/TR/1998/WD-rdf-schema-19980409/ { "coverage", N_("Coverage:"), "dc:coverage", RDF_CONTENT, - N_("Extent or scope of this document"), RDF_FORMAT_LINE, RDF_EDIT_GENERIC, + N_("The spatial or temporal topic of the resource, the spatial applicability of the resource, or the jurisdiction under which the resource is relevant"), RDF_FORMAT_LINE, RDF_EDIT_GENERIC, }, { "description", N_("Description:"), "dc:description", RDF_CONTENT, - N_("A short account of the content of this document"), RDF_FORMAT_MULTILINE, RDF_EDIT_GENERIC, + N_("An account of the resource"), RDF_FORMAT_MULTILINE, RDF_EDIT_GENERIC, }, // FIXME: need to handle 1 agent per line of input { "contributor", N_("Contributors:"), "dc:contributor", RDF_AGENT, - N_("Names of entities responsible for making contributions to the content of this document"), RDF_FORMAT_MULTILINE, RDF_EDIT_GENERIC, + N_("An entity responsible for making contributions to the resource"), RDF_FORMAT_MULTILINE, RDF_EDIT_GENERIC, }, // TRANSLATORS: URL to a page that defines the license for the document @@ -292,7 +292,7 @@ struct rdf_work_entity_t rdf_work_entities [] = { { "license_fragment", N_("Fragment:"), "License", RDF_XML, N_("XML fragment for the RDF 'License' section"), RDF_FORMAT_MULTILINE, RDF_EDIT_SPECIAL, }, - + { NULL, NULL, NULL, RDF_CONTENT, NULL, RDF_FORMAT_LINE, RDF_EDIT_HARDCODED, } -- cgit v1.2.3 From 1c06fa5e2552b291534f0b96542070f00fd0778b Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Mon, 24 Jun 2013 20:47:57 -0400 Subject: Added length class. (bzr r12380.1.1) --- src/util/units.cpp | 39 ++++++++++++++++++++++++++++++++++++++- src/util/units.h | 12 ++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/util/units.cpp b/src/util/units.cpp index f822d01de..3bcbabf89 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -334,10 +334,47 @@ void UnitsSAXHandler::_endElement(xmlChar const *xname) } } +/** Initialize a length. */ +Length::Length(Unit *u, double l) { + unit = u; + length = l; +} + +/** Checks if a length is compatible with the specified unit. */ +bool Length::compatibleWith(Unit *u) { + // Percentages + if (unit->type == UNIT_TYPE_DIMENSIONLESS || u->type == UNIT_TYPE_DIMENSIONLESS) { + return true; + } + + // Other units with same type + if (unit->type == u->type) { + return true; + } + + // Different, incompatible types + return false; +} + +/** Return the length's value in the specified unit. */ +double Length::value(Unit *u) { + return convert(length, unit, u); +} + +/** Convert distances. */ +double Length::convert(double from_dist, Unit *from, Unit *to) const { + // Incompatible units + if (from->type != to->type) { + return -1; + } + + // Compatible units + return from_dist / from->factor * to->factor; +} + } // namespace Util } // namespace Inkscape - /* Local Variables: mode:c++ diff --git a/src/util/units.h b/src/util/units.h index b22bdb1f2..46680bf35 100644 --- a/src/util/units.h +++ b/src/util/units.h @@ -84,6 +84,18 @@ class UnitTable { }; +class Length { +public: + Unit *unit; + double length; + + Length(Unit *u, double l); // constructor + bool compatibleWith(Unit *u); + double value(Unit *u); + + double convert(double from_dist, Unit *from, Unit *to) const; +}; + } // namespace Util } // namespace Inkscape -- cgit v1.2.3 From 6a68e8a63540ffda15050908d80f776d94b43b41 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Wed, 26 Jun 2013 07:55:59 -0400 Subject: Using CC0 link instead of old Public Domain link Fixed bugs: - https://launchpad.net/bugs/1194372 (bzr r12389) --- src/rdf.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/rdf.cpp b/src/rdf.cpp index 017de42c1..72aea4898 100644 --- a/src/rdf.cpp +++ b/src/rdf.cpp @@ -202,8 +202,8 @@ struct rdf_license_t rdf_licenses [] = { rdf_license_cc_a_nc_nd, }, - { N_("Public Domain"), - "http://creativecommons.org/licenses/publicdomain/", + { N_("CC0 Public Domain Dedication"), + "http://creativecommons.org/publicdomain/zero/1.0/", rdf_license_pd, }, -- cgit v1.2.3 From 1fa9ac15ea93f1ba4017d17d1950c0e3ae5c4fb8 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Wed, 26 Jun 2013 09:44:37 -0400 Subject: Fix Gtk3 build by including togglebutton header (bzr r12390) --- src/ui/dialog/symbols.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index 5eb7084d6..b71686a17 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -26,6 +26,7 @@ #include #if WITH_GTKMM_3_0 +# include # include #else # include -- cgit v1.2.3 From 9c54e4ae9e74a13735989977a477141c7a5535cf Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Wed, 26 Jun 2013 11:18:52 -0400 Subject: Add render rack gear extension from bug#1174800, modify gears location to render sub-menu Fixed bugs: - https://launchpad.net/bugs/1174800 (bzr r12391) --- src/libavoid/makefile | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 src/libavoid/makefile (limited to 'src') diff --git a/src/libavoid/makefile b/src/libavoid/makefile deleted file mode 100644 index e4f83a52d..000000000 --- a/src/libavoid/makefile +++ /dev/null @@ -1,17 +0,0 @@ -# Convenience stub makefile to call the real Makefile. - - - -OBJEXT = o - -# Explicit so that it's the default rule. -all: - cd .. && $(MAKE) libavoid/all - -clean %.a %.$(OBJEXT): - cd .. && $(MAKE) libavoid/$@ - -.PHONY: all clean - -.SUFFIXES: -.SUFFIXES: .a .$(OBJEXT) -- cgit v1.2.3 From 0b13569c400bb2976c5f71cbac687b5e96c2e7a0 Mon Sep 17 00:00:00 2001 From: Slagvi Public Date: Thu, 27 Jun 2013 11:43:19 +0200 Subject: Coding style fixes (bzr r12379.2.4) --- src/templates/new-from-template.cpp | 16 +++++----- src/templates/new-from-template.h | 4 +-- src/templates/static-template-load-tab.cpp | 30 +++++++++---------- src/templates/static-template-load-tab.h | 10 +++---- src/templates/template-load-tab.cpp | 48 +++++++++++++++--------------- src/templates/template-load-tab.h | 18 +++++------ 6 files changed, 63 insertions(+), 63 deletions(-) (limited to 'src') diff --git a/src/templates/new-from-template.cpp b/src/templates/new-from-template.cpp index 450337aea..fc590d199 100644 --- a/src/templates/new-from-template.cpp +++ b/src/templates/new-from-template.cpp @@ -5,22 +5,22 @@ namespace Inkscape { namespace UI { -NewFromTemplate::NewFromTemplate() : - _createButton("Create from template") +NewFromTemplate::NewFromTemplate() + : _create_template_button("Create from template") { set_title("New From Template"); resize(400, 250); - get_vbox()->pack_start(_mainWidget); - _mainWidget.append_page(_tab1, "Static Templates"); - _mainWidget.append_page(_tab2, "Procedural Templates"); + get_vbox()->pack_start(_main_widget); + _main_widget.append_page(_tab1, "Static Templates"); + _main_widget.append_page(_tab2, "Procedural Templates"); Gtk::Alignment *align; align = manage(new Gtk::Alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER, 0.0, 0.0)); get_vbox()->pack_end(*align, Gtk::PACK_SHRINK, 5); - align->add(_createButton); + align->add(_create_template_button); - _createButton.signal_pressed().connect( + _create_template_button.signal_pressed().connect( sigc::mem_fun(*this, &NewFromTemplate::_createFromTemplate)); show_all(); @@ -29,7 +29,7 @@ NewFromTemplate::NewFromTemplate() : void NewFromTemplate::_createFromTemplate() { - if ( _mainWidget.get_current_page() == 0 ) { + if ( _main_widget.get_current_page() == 0 ) { _tab1.createTemplate(); } else { _tab2.createTemplate(); diff --git a/src/templates/new-from-template.h b/src/templates/new-from-template.h index 869680ae3..ef3cbce18 100644 --- a/src/templates/new-from-template.h +++ b/src/templates/new-from-template.h @@ -18,8 +18,8 @@ public: NewFromTemplate(); private: - Gtk::Notebook _mainWidget; - Gtk::Button _createButton; + Gtk::Notebook _main_widget; + Gtk::Button _create_template_button; StaticTemplateLoadTab _tab1; TemplateLoadTab _tab2; diff --git a/src/templates/static-template-load-tab.cpp b/src/templates/static-template-load-tab.cpp index e71b9dede..83ff32e52 100644 --- a/src/templates/static-template-load-tab.cpp +++ b/src/templates/static-template-load-tab.cpp @@ -9,25 +9,25 @@ namespace Inkscape { namespace UI { -StaticTemplateLoadTab::StaticTemplateLoadTab() : - _moreInfoButton("More info"), - _previewImage("preview.png"), - _shortDescriptionLabel("Short description - I like trains. ad asda asd asdweqe gdfg"), - _templateNameLabel("Template_name"), - _templateAuthorLabel("by template_author") +StaticTemplateLoadTab::StaticTemplateLoadTab() + : _more_info_button("More info") + , _preview_image("preview.png") + , _short_description_label("Short description - I like trains. ad asda asd asdweqe gdfg") + , _template_name_label("Template_name") + , _template_author_label("by template_author") { - _templateInfoColumn.pack_start(_templateNameLabel, Gtk::PACK_SHRINK, 4); - _templateInfoColumn.pack_start(_templateAuthorLabel, Gtk::PACK_SHRINK, 0); - _templateInfoColumn.pack_start(_previewImage, Gtk::PACK_SHRINK, 15); - _templateInfoColumn.pack_start(_shortDescriptionLabel, Gtk::PACK_SHRINK, 4); + _template_info_column.pack_start(_template_name_label, Gtk::PACK_SHRINK, 4); + _template_info_column.pack_start(_template_author_label, Gtk::PACK_SHRINK, 0); + _template_info_column.pack_start(_preview_image, Gtk::PACK_SHRINK, 15); + _template_info_column.pack_start(_short_description_label, Gtk::PACK_SHRINK, 4); - _shortDescriptionLabel.set_line_wrap(true); - _shortDescriptionLabel.set_size_request(200); + _short_description_label.set_line_wrap(true); + _short_description_label.set_size_request(200); Gtk::Alignment *align; align = manage(new Gtk::Alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER, 0.0, 0.0)); - _templateInfoColumn.pack_start(*align, Gtk::PACK_SHRINK, 5); - align->add(_moreInfoButton); + _template_info_column.pack_start(*align, Gtk::PACK_SHRINK, 5); + align->add(_more_info_button); } @@ -40,7 +40,7 @@ void StaticTemplateLoadTab::createTemplate() void StaticTemplateLoadTab::_displayTemplateInfo() { TemplateLoadTab::_displayTemplateInfo(); - _templateNameLabel.set_text(_currentTemplate); + _template_name_label.set_text(_current_template); } } diff --git a/src/templates/static-template-load-tab.h b/src/templates/static-template-load-tab.h index e6ed17f4c..651f146a0 100644 --- a/src/templates/static-template-load-tab.h +++ b/src/templates/static-template-load-tab.h @@ -20,11 +20,11 @@ public: protected: virtual void _displayTemplateInfo(); - Gtk::Button _moreInfoButton; - Gtk::Label _shortDescriptionLabel; - Gtk::Label _templateAuthorLabel; - Gtk::Label _templateNameLabel; - Gtk::Image _previewImage; + Gtk::Button _more_info_button; + Gtk::Label _short_description_label; + Gtk::Label _template_author_label; + Gtk::Label _template_name_label; + Gtk::Image _preview_image; }; } diff --git a/src/templates/template-load-tab.cpp b/src/templates/template-load-tab.cpp index febbb3be6..a7b5e63f3 100644 --- a/src/templates/template-load-tab.cpp +++ b/src/templates/template-load-tab.cpp @@ -7,38 +7,38 @@ namespace Inkscape { namespace UI { -TemplateLoadTab::TemplateLoadTab() : - _keywordsCombo(true) +TemplateLoadTab::TemplateLoadTab() + : _keywords_combo(true) { set_border_width(10); Gtk::Label *title; title = manage(new Gtk::Label("Search Tags:")); - _templatesColumn.pack_start(*title, Gtk::PACK_SHRINK, 10); + _templates_column.pack_start(*title, Gtk::PACK_SHRINK, 10); - _templatesColumn.pack_start(_keywordsCombo, Gtk::PACK_SHRINK, 0); + _templates_column.pack_start(_keywords_combo, Gtk::PACK_SHRINK, 0); title = manage(new Gtk::Label("Templates")); - _templatesColumn.pack_start(*title, Gtk::PACK_SHRINK, 10); + _templates_column.pack_start(*title, Gtk::PACK_SHRINK, 10); title = manage(new Gtk::Label("Selected template")); - _templateInfoColumn.pack_start(*title, Gtk::PACK_SHRINK, 10); + _template_info_column.pack_start(*title, Gtk::PACK_SHRINK, 10); _initLists(); - add(_mainBox); - _mainBox.pack_start(_templatesColumn, Gtk::PACK_SHRINK, 20); - _mainBox.pack_start(_templateInfoColumn, Gtk::PACK_EXPAND_WIDGET, 10); + add(_main_box); + _main_box.pack_start(_templates_column, Gtk::PACK_SHRINK, 20); + _main_box.pack_start(_template_info_column, Gtk::PACK_EXPAND_WIDGET, 10); - _templatesColumn.pack_start(_templatesView, Gtk::PACK_SHRINK, 5); + _templates_column.pack_start(_templates_view, Gtk::PACK_SHRINK, 5); Glib::RefPtr templateSelectionRef = - _templatesView.get_selection(); + _templates_view.get_selection(); templateSelectionRef->signal_changed().connect( sigc::mem_fun(*this, &TemplateLoadTab::_displayTemplateInfo)); - _keywordsCombo.signal_changed().connect( + _keywords_combo.signal_changed().connect( sigc::mem_fun(*this, &TemplateLoadTab::_keywordSelected)); this->show_all(); } @@ -57,29 +57,29 @@ void TemplateLoadTab::createTemplate() void TemplateLoadTab::_displayTemplateInfo() { - Glib::RefPtr templateSelectionRef = _templatesView.get_selection(); + Glib::RefPtr templateSelectionRef = _templates_view.get_selection(); if (templateSelectionRef->get_selected()) { - _currentTemplate = (*templateSelectionRef->get_selected())[_templatesColumns.textValue]; + _current_template = (*templateSelectionRef->get_selected())[_templates_columns.textValue]; } } void TemplateLoadTab::_initKeywordsList() { - _keywordsCombo.append_text("All"); + _keywords_combo.append_text("All"); for (int i = 0 ; i < 10 ; ++i) { - _keywordsCombo.append_text( "Keyword" + Glib::ustring::format(i)); + _keywords_combo.append_text( "Keyword" + Glib::ustring::format(i)); } } void TemplateLoadTab::_initLists() { - _templatesRef = Gtk::ListStore::create(_templatesColumns); - _templatesView.set_model(_templatesRef); - _templatesView.append_column("", _templatesColumns.textValue); - _templatesView.set_headers_visible(false); + _templates_ref = Gtk::ListStore::create(_templates_columns); + _templates_view.set_model(_templates_ref); + _templates_view.append_column("", _templates_columns.textValue); + _templates_view.set_headers_visible(false); _initKeywordsList(); _refreshTemplatesList(); @@ -88,18 +88,18 @@ void TemplateLoadTab::_initLists() void TemplateLoadTab::_keywordSelected() { - _currentKeyword = _keywordsCombo.get_active_text(); + _current_keyword = _keywords_combo.get_active_text(); _refreshTemplatesList(); } void TemplateLoadTab::_refreshTemplatesList() { - _templatesRef->clear(); + _templates_ref->clear(); for (int i = 0 ; i < 7 ; ++i) { - Gtk::TreeModel::iterator iter = _templatesRef->append(); + Gtk::TreeModel::iterator iter = _templates_ref->append(); Gtk::TreeModel::Row row = *iter; - row[_templatesColumns.textValue] = "Template" + Glib::ustring::format(i); + row[_templates_columns.textValue] = "Template" + Glib::ustring::format(i); } } diff --git a/src/templates/template-load-tab.h b/src/templates/template-load-tab.h index bb55b384c..a9fa7c313 100644 --- a/src/templates/template-load-tab.h +++ b/src/templates/template-load-tab.h @@ -31,8 +31,8 @@ protected: Gtk::TreeModelColumn textValue; }; - Glib::ustring _currentKeyword; - Glib::ustring _currentTemplate; + Glib::ustring _current_keyword; + Glib::ustring _current_template; virtual void _displayTemplateInfo(); virtual void _initKeywordsList(); @@ -41,15 +41,15 @@ protected: void _initLists(); void _keywordSelected(); - Gtk::HBox _mainBox; - Gtk::VBox _templatesColumn; - Gtk::VBox _templateInfoColumn; + Gtk::HBox _main_box; + Gtk::VBox _templates_column; + Gtk::VBox _template_info_column; - Gtk::ComboBoxText _keywordsCombo; + Gtk::ComboBoxText _keywords_combo; - Gtk::TreeView _templatesView; - Glib::RefPtr _templatesRef; - StringModelColumns _templatesColumns; + Gtk::TreeView _templates_view; + Glib::RefPtr _templates_ref; + StringModelColumns _templates_columns; }; -- cgit v1.2.3 From 092b5a984f57e348a9dba7afa731ca0109be9b79 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Thu, 27 Jun 2013 23:28:22 -0400 Subject: Add the ability to reorder filters using drag-drop in the gtklist Fixed bugs: - https://launchpad.net/bugs/1168814 (bzr r12394) --- src/ui/dialog/filter-effects-dialog.cpp | 15 ++++++++++++++- src/ui/dialog/filter-effects-dialog.h | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp index 4c289d54e..4401d5658 100644 --- a/src/ui/dialog/filter-effects-dialog.cpp +++ b/src/ui/dialog/filter-effects-dialog.cpp @@ -1155,7 +1155,13 @@ FilterEffectsDialog::FilterModifier::FilterModifier(FilterEffectsDialog& d) sw->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); _list.get_column(1)->set_resizable(true); - + _list.set_reorderable(true); + + // We can track the drag/drop reordering from the row_delete (occurs after + // row_inserted and may occur many times when adding a new item) + _model->signal_row_deleted().connect( + sigc::mem_fun(*this, &FilterModifier::on_filter_reorder)); + sw->set_shadow_type(Gtk::SHADOW_IN); show_all_children(); _add.signal_clicked().connect(sigc::mem_fun(*this, &FilterModifier::add_filter)); @@ -1301,6 +1307,13 @@ void FilterEffectsDialog::FilterModifier::on_name_edited(const Glib::ustring& pa } } +void FilterEffectsDialog::FilterModifier::on_filter_reorder(const Gtk::TreeModel::Path& path) { + for(Gtk::TreeModel::iterator i = _model->children().begin(); i != _model->children().end(); ++i) { + SPObject* object = (*i)[_columns.filter]; + object->getRepr()->setPosition(0); + } +} + void FilterEffectsDialog::FilterModifier::on_selection_toggled(const Glib::ustring& path) { Gtk::TreeIter iter = _model->get_iter(path); diff --git a/src/ui/dialog/filter-effects-dialog.h b/src/ui/dialog/filter-effects-dialog.h index 658aac790..a2a2a3c6e 100644 --- a/src/ui/dialog/filter-effects-dialog.h +++ b/src/ui/dialog/filter-effects-dialog.h @@ -86,6 +86,7 @@ private: void on_filter_selection_changed(); void on_name_edited(const Glib::ustring&, const Glib::ustring&); + void on_filter_reorder(const Gtk::TreeModel::Path& path); void on_selection_toggled(const Glib::ustring&); void update_filters(); -- cgit v1.2.3 From 6ba58cf2eb05a8e44f21f853dc638a41b6cc59b2 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Fri, 28 Jun 2013 00:45:10 -0400 Subject: Fix crash when undoing/redoing a duplicate layer. Fixed bugs: - https://launchpad.net/bugs/1183206 (bzr r12395) --- src/ui/dialog/layers.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp index 5cc9578f1..ce923f6b4 100644 --- a/src/ui/dialog/layers.cpp +++ b/src/ui/dialog/layers.cpp @@ -404,13 +404,13 @@ void LayersPanel::_addLayer( SPDocument* doc, SPObject* layer, Gtk::TreeModel::R SPObject *child = _desktop->layer_manager->nthChildOf(layer, i); if ( child ) { #if DUMP_LAYERS - g_message(" %3d layer:%p {%s} [%s]", level, child, child->id, child->label() ); + g_message(" %3d layer:%p {%s} [%s]", level, child, child->getId(), child->label() ); #endif // DUMP_LAYERS Gtk::TreeModel::iterator iter = parentRow ? _store->prepend(parentRow->children()) : _store->prepend(); Gtk::TreeModel::Row row = *iter; row[_model->_colObject] = child; - row[_model->_colLabel] = child->label() ? child->label() : child->getId(); + row[_model->_colLabel] = child->defaultLabel(); row[_model->_colVisible] = SP_IS_ITEM(child) ? !SP_ITEM(child)->isHidden() : false; row[_model->_colLocked] = SP_IS_ITEM(child) ? SP_ITEM(child)->isLocked() : false; -- cgit v1.2.3 From fefbd8cbb7c09c8c6241c7ef52413e37d4d5e6eb Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Sat, 29 Jun 2013 11:43:12 -0400 Subject: Make DAMN sure paths with zero nodes do not cause a crash. Fixed bugs: - https://launchpad.net/bugs/710637 (bzr r12396) --- src/ui/tool/multi-path-manipulator.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp index 70bd0e859..5d5ea2adc 100644 --- a/src/ui/tool/multi-path-manipulator.cpp +++ b/src/ui/tool/multi-path-manipulator.cpp @@ -224,10 +224,12 @@ void MultiPathManipulator::shiftSelection(int dir) SubpathList::iterator last_j; NodeList::iterator last_k; bool anything_found = false; + bool anynode_found = false; for (MapType::iterator i = _mmap.begin(); i != _mmap.end(); ++i) { SubpathList &sp = i->second->subpathList(); for (SubpathList::iterator j = sp.begin(); j != sp.end(); ++j) { + anynode_found = true; for (NodeList::iterator k = (*j)->begin(); k != (*j)->end(); ++k) { if (k->selected()) { last_i = i; @@ -249,10 +251,12 @@ void MultiPathManipulator::shiftSelection(int dir) if (!anything_found) { // select first / last node // this should never fail because there must be at least 1 non-empty manipulator - if (dir == 1) { + if (anynode_found) { + if (dir == 1) { _selection.insert((*_mmap.begin()->second->subpathList().begin())->begin().ptr()); - } else { + } else { _selection.insert((--(*--(--_mmap.end())->second->subpathList().end())->end()).ptr()); + } } return; } -- cgit v1.2.3 From 4638e6b967c2ab156602847ff50e0e0ff09b76c2 Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Sat, 29 Jun 2013 15:22:01 -0400 Subject: Transform dialog. do not use singular transforms. (Bug 1189446) Fixed bugs: - https://launchpad.net/bugs/1189446 (bzr r12397) --- src/ui/dialog/transformation.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'src') diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp index 2ae98beda..ce8af3f1f 100644 --- a/src/ui/dialog/transformation.cpp +++ b/src/ui/dialog/transformation.cpp @@ -31,6 +31,7 @@ #include "inkscape.h" #include "selection.h" #include "selection-chemistry.h" +#include "message-stack.h" #include "verbs.h" #include "preferences.h" #include "sp-namedview.h" @@ -902,10 +903,21 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection) if (!_units_skew.isAbsolute()) { // percentage double skewX = _scalar_skew_horizontal.getValue("%"); double skewY = _scalar_skew_vertical.getValue("%"); + if (fabs(0.01*skewX*0.01*skewY - 1.0) < Geom::EPSILON) { + sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, not used.")); + return; + } sp_item_skew_rel (item, 0.01*skewX, 0.01*skewY); } else if (_units_skew.isRadial()) { //deg or rad double angleX = _scalar_skew_horizontal.getValue("rad"); double angleY = _scalar_skew_vertical.getValue("rad"); + if ((fabs(angleX - angleY + M_PI/2) < Geom::EPSILON) + || (fabs(angleX - angleY - M_PI/2) < Geom::EPSILON) + || (fabs((angleX - angleY)/3 + M_PI/2) < Geom::EPSILON) + || (fabs((angleX - angleY)/3 - M_PI/2) < Geom::EPSILON)) { + sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, not used.")); + return; + } double skewX = tan(-angleX); double skewY = tan(angleY); sp_item_skew_rel (item, skewX, skewY); @@ -916,6 +928,10 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection) if (bbox) { double width = bbox->dimensions()[Geom::X]; double height = bbox->dimensions()[Geom::Y]; + if (fabs(skewX*skewY - width*height) < Geom::EPSILON) { + sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, not used.")); + return; + } sp_item_skew_rel (item, skewX/height, skewY/width); } } @@ -931,16 +947,31 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection) if (!_units_skew.isAbsolute()) { // percentage double skewX = _scalar_skew_horizontal.getValue("%"); double skewY = _scalar_skew_vertical.getValue("%"); + if (fabs(0.01*skewX*0.01*skewY - 1.0) < Geom::EPSILON) { + sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, not used.")); + return; + } sp_selection_skew_relative(selection, *center, 0.01*skewX, 0.01*skewY); } else if (_units_skew.isRadial()) { //deg or rad double angleX = _scalar_skew_horizontal.getValue("rad"); double angleY = _scalar_skew_vertical.getValue("rad"); + if ((fabs(angleX - angleY + M_PI/2) < Geom::EPSILON) + || (fabs(angleX - angleY - M_PI/2) < Geom::EPSILON) + || (fabs((angleX - angleY)/3 + M_PI/2) < Geom::EPSILON) + || (fabs((angleX - angleY)/3 - M_PI/2) < Geom::EPSILON)) { + sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, not used.")); + return; + } double skewX = tan(-angleX); double skewY = tan(angleY); sp_selection_skew_relative(selection, *center, skewX, skewY); } else { // absolute displacement double skewX = _scalar_skew_horizontal.getValue("px"); double skewY = _scalar_skew_vertical.getValue("px"); + if (fabs(skewX*skewY - width*height) < Geom::EPSILON) { + sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, not used.")); + return; + } sp_selection_skew_relative(selection, *center, skewX/height, skewY/width); } } @@ -961,6 +992,10 @@ void Transformation::applyPageTransform(Inkscape::Selection *selection) double f = _scalar_transform_f.getValue(); Geom::Affine displayed(a, b, c, d, e, f); + if (displayed.isSingular()) { + sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, not used.")); + return; + } if (_check_replace_matrix.get_active()) { for (GSList const *l = selection->itemList(); l != NULL; l = l->next) { -- cgit v1.2.3 From c3a160589a9cb41c70a56e5e7b66a65857a0d10e Mon Sep 17 00:00:00 2001 From: Eric Greveson Date: Mon, 1 Jul 2013 21:04:32 +0100 Subject: Factored layer model out into new Inkscape::LayerModel class. This allows Inkscape::Selection to use a LayerModel that is not associated with a UI. Changed the interface of verbs (SPAction) to use a new ActionContext rather than UI::View::View, again so that verbs may be used in a console mode. Modified boolean operation verbs to work in console-only mode. Fixed up DESKTOP_IS_ACTIVE macro to work in the case of no desktops. Modified main.cpp to process selections and verbs in no-GUI mode. Other changes are all consequences of the SPDesktop, Selection and LayerModel interface changes. (bzr r12387.1.1) --- src/CMakeLists.txt | 2 + src/Makefile_insert | 1 + src/desktop.cpp | 172 ++++++------------------ src/desktop.h | 10 +- src/dyna-draw-context.cpp | 4 +- src/eraser-context.cpp | 2 +- src/extension/dbus/document-interface.cpp | 5 +- src/extension/effect.cpp | 4 +- src/extension/effect.h | 2 +- src/extension/internal/bluredge.cpp | 5 +- src/extension/internal/filter/filter-all.cpp | 0 src/flood-context.cpp | 2 +- src/helper/CMakeLists.txt | 2 + src/helper/Makefile_insert | 2 + src/helper/action.cpp | 36 +++-- src/helper/action.h | 11 +- src/inkscape.cpp | 2 +- src/interface.cpp | 23 ++-- src/main-cmdlineact.cpp | 24 ++-- src/main-cmdlineact.h | 7 +- src/main.cpp | 18 ++- src/selection-describer.cpp | 5 +- src/selection.cpp | 16 +-- src/selection.h | 23 +++- src/shortcuts.cpp | 3 +- src/splivarot.cpp | 81 ++++++----- src/splivarot.h | 25 ++-- src/spray-context.cpp | 2 +- src/ui/dialog/layers.cpp | 7 +- src/ui/dialog/swatches.cpp | 3 +- src/ui/dialog/symbols.cpp | 5 +- src/ui/widget/page-sizer.cpp | 3 +- src/ui/widget/style-swatch.cpp | 3 +- src/verbs.cpp | 193 ++++++++++++++------------- src/verbs.h | 9 +- src/widgets/button.cpp | 3 +- src/widgets/desktop-widget.cpp | 6 +- src/widgets/gradient-selector.cpp | 3 +- src/widgets/lpe-toolbar.cpp | 4 +- src/widgets/select-toolbar.cpp | 4 +- src/widgets/toolbox.cpp | 14 +- 41 files changed, 384 insertions(+), 362 deletions(-) mode change 100755 => 100644 src/extension/internal/filter/filter-all.cpp (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 49f32fdea..fa54940db 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -239,6 +239,7 @@ set(inkscape_SRC knotholder.cpp layer-fns.cpp layer-manager.cpp + layer-model.cpp line-geometry.cpp line-snapper.cpp lpe-tool-context.cpp @@ -398,6 +399,7 @@ set(inkscape_SRC knotholder.h layer-fns.h layer-manager.h + layer-model.h line-geometry.h line-snapper.h lpe-tool-context.h diff --git a/src/Makefile_insert b/src/Makefile_insert index 87b2545c8..023d640ca 100644 --- a/src/Makefile_insert +++ b/src/Makefile_insert @@ -92,6 +92,7 @@ ink_common_sources += \ knot-holder-entity.h knot-holder-entity.cpp \ layer-fns.cpp layer-fns.h \ layer-manager.cpp layer-manager.h \ + layer-model.cpp layer-model.h \ line-geometry.cpp line-geometry.h \ line-snapper.cpp line-snapper.h \ lpe-tool-context.cpp lpe-tool-context.h \ diff --git a/src/desktop.cpp b/src/desktop.cpp index 17548ee56..485fcfcc4 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -53,15 +53,16 @@ #include "display/sp-canvas-util.h" #include "document.h" #include "event-log.h" +#include "helper/action-context.h" #include "helper/units.h" #include "interface.h" #include "inkscape-private.h" #include "layer-fns.h" #include "layer-manager.h" +#include "layer-model.h" #include "macros.h" #include "message-context.h" #include "message-stack.h" -#include "object-hierarchy.h" #include "preferences.h" #include "resource-manager.h" #include "select-context.h" @@ -95,6 +96,7 @@ SPDesktop::SPDesktop() : _dlg_mgr( 0 ), namedview( 0 ), canvas( 0 ), + layer_model( 0 ), selection( 0 ), event_context( 0 ), layer_manager( 0 ), @@ -125,7 +127,6 @@ SPDesktop::SPDesktop() : gr_point_type( POINT_LG_BEGIN ), gr_point_i( 0 ), gr_fill_or_stroke( Inkscape::FOR_FILL ), - _layer_hierarchy( 0 ), _reconstruction_old_layer_id(), // an id attribute is not allowed to be the empty string _display_mode(Inkscape::RENDERMODE_NORMAL), _display_color_mode(Inkscape::COLORMODE_NORMAL), @@ -140,8 +141,12 @@ SPDesktop::SPDesktop() : { _d2w.setIdentity(); _w2d.setIdentity(); - - selection = Inkscape::GC::release( new Inkscape::Selection(this) ); + + layer_model = new Inkscape::LayerModel(); + layer_model->_layer_activated_signal.connect(sigc::bind(sigc::ptr_fun(_layer_activated), this)); + layer_model->_layer_deactivated_signal.connect(sigc::bind(sigc::ptr_fun(_layer_deactivated), this)); + layer_model->_layer_changed_signal.connect(sigc::bind(sigc::ptr_fun(_layer_hierarchy_changed), this)); + selection = Inkscape::GC::release( new Inkscape::Selection(layer_model, this) ); } void @@ -170,6 +175,9 @@ SPDesktop::init (SPNamedView *nv, SPCanvas *aCanvas, Inkscape::UI::View::EditWid dkey = SPItem::display_key_new(1); + /* Connect display key to layer model */ + layer_model->setDisplayKey(dkey); + /* Connect document */ setDocument (document); @@ -359,10 +367,7 @@ void SPDesktop::destroy() g_object_unref (G_OBJECT (ec)); } - if (_layer_hierarchy) { - delete _layer_hierarchy; -// _layer_hierarchy = NULL; //this should be here, but commented to find other bug somewhere else. - } + delete layer_model; if (layer_manager) { delete layer_manager; @@ -483,134 +488,45 @@ void SPDesktop::displayColorModeToggle() { } } -/** - * Returns current root (=bottom) layer. - */ +// Pass-through LayerModel functions SPObject *SPDesktop::currentRoot() const { - return _layer_hierarchy ? _layer_hierarchy->top() : NULL; + return layer_model->currentRoot(); } -/** - * Returns current top layer. - */ SPObject *SPDesktop::currentLayer() const { - return _layer_hierarchy ? _layer_hierarchy->bottom() : NULL; -} - -/** - * Sets the current layer of the desktop. - * - * Make \a object the top layer. - */ -void SPDesktop::setCurrentLayer(SPObject *object) { - g_return_if_fail(SP_IS_GROUP(object)); - g_return_if_fail( currentRoot() == object || (currentRoot() && currentRoot()->isAncestorOf(object)) ); - // printf("Set Layer to ID: %s\n", object->getId()); - _layer_hierarchy->setBottom(object); + return layer_model->currentLayer(); } -void SPDesktop::toggleHideAllLayers(bool hide) { - - for ( SPObject* obj = Inkscape::previous_layer(currentRoot(), currentRoot()); obj; obj = Inkscape::previous_layer(currentRoot(), obj) ) { - SP_ITEM(obj)->setHidden(hide); - } +void SPDesktop::setCurrentLayer(SPObject *object) +{ + layer_model->setCurrentLayer(object); } -void SPDesktop::toggleLockAllLayers(bool lock) { - - for ( SPObject* obj = Inkscape::previous_layer(currentRoot(), currentRoot()); obj; obj = Inkscape::previous_layer(currentRoot(), obj) ) { - SP_ITEM(obj)->setLocked(lock); - } +void SPDesktop::toggleLayerSolo(SPObject *object) +{ + layer_model->toggleLayerSolo(object); } -void SPDesktop::toggleLockOtherLayers(SPObject *object) { - g_return_if_fail(SP_IS_GROUP(object)); - g_return_if_fail( currentRoot() == object || (currentRoot() && currentRoot()->isAncestorOf(object)) ); - - bool othersLocked = false; - std::vector layers; - for ( SPObject* obj = Inkscape::next_layer(currentRoot(), object); obj; obj = Inkscape::next_layer(currentRoot(), obj) ) { - // Dont lock any ancestors, since that would in turn lock the layer as well - if (!obj->isAncestorOf(object)) { - layers.push_back(obj); - othersLocked |= !SP_ITEM(obj)->isLocked(); - } - } - for ( SPObject* obj = Inkscape::previous_layer(currentRoot(), object); obj; obj = Inkscape::previous_layer(currentRoot(), obj) ) { - if (!obj->isAncestorOf(object)) { - layers.push_back(obj); - othersLocked |= !SP_ITEM(obj)->isLocked(); - } - } - - SPItem *item = SP_ITEM(object); - if ( item->isLocked() ) { - item->setLocked(false); - } - - for ( std::vector::iterator it = layers.begin(); it != layers.end(); ++it ) { - SP_ITEM(*it)->setLocked(othersLocked); - } +void SPDesktop::toggleHideAllLayers(bool hide) +{ + layer_model->toggleHideAllLayers(hide); } - -void SPDesktop::toggleLayerSolo(SPObject *object) { - g_return_if_fail(SP_IS_GROUP(object)); - g_return_if_fail( currentRoot() == object || (currentRoot() && currentRoot()->isAncestorOf(object)) ); - - bool othersShowing = false; - std::vector layers; - for ( SPObject* obj = Inkscape::next_layer(currentRoot(), object); obj; obj = Inkscape::next_layer(currentRoot(), obj) ) { - // Don't hide ancestors, since that would in turn hide the layer as well - if (!obj->isAncestorOf(object)) { - layers.push_back(obj); - othersShowing |= !SP_ITEM(obj)->isHidden(); - } - } - for ( SPObject* obj = Inkscape::previous_layer(currentRoot(), object); obj; obj = Inkscape::previous_layer(currentRoot(), obj) ) { - if (!obj->isAncestorOf(object)) { - layers.push_back(obj); - othersShowing |= !SP_ITEM(obj)->isHidden(); - } - } - - - SPItem *item = SP_ITEM(object); - if ( item->isHidden() ) { - item->setHidden(false); - } - - for ( std::vector::iterator it = layers.begin(); it != layers.end(); ++it ) { - SP_ITEM(*it)->setHidden(othersShowing); - } +void SPDesktop::toggleLockAllLayers(bool lock) +{ + layer_model->toggleLockAllLayers(lock); } -/** - * Return layer that contains \a object. - */ -SPObject *SPDesktop::layerForObject(SPObject *object) { - g_return_val_if_fail(object != NULL, NULL); - - SPObject *root=currentRoot(); - object = object->parent; - while ( object && object != root && !isLayer(object) ) { - // Objects in defs have no layer and are NOT in the root layer - if(SP_IS_DEFS(object)) - return NULL; - object = object->parent; - } - return object; +void SPDesktop::toggleLockOtherLayers(SPObject *object) +{ + layer_model->toggleLockOtherLayers(object); } -/** - * True if object is a layer. - */ -bool SPDesktop::isLayer(SPObject *object) const { - return ( SP_IS_GROUP(object) - && ( SP_GROUP(object)->effectiveLayerMode(this->dkey) - == SPGroup::LAYER ) ); +bool SPDesktop::isLayer(SPObject *object) const +{ + return layer_model->isLayer(object); } /** @@ -1575,15 +1491,7 @@ SPDesktop::setDocument (SPDocument *doc) this->doc()->getRoot()->invoke_hide(dkey); } - if (_layer_hierarchy) { - _layer_hierarchy->clear(); - delete _layer_hierarchy; - } - _layer_hierarchy = new Inkscape::ObjectHierarchy(NULL); - _layer_hierarchy->connectAdded(sigc::bind(sigc::ptr_fun(_layer_activated), this)); - _layer_hierarchy->connectRemoved(sigc::bind(sigc::ptr_fun(_layer_deactivated), this)); - _layer_hierarchy->connectChanged(sigc::bind(sigc::ptr_fun(_layer_hierarchy_changed), this)); - _layer_hierarchy->setTop(doc->getRoot()); + layer_model->setDocument(doc); // remove old EventLog if it exists (see also: bug #1071082) if (event_log) { @@ -1691,9 +1599,9 @@ _onSelectionChanged */ SPItem *item=selection->singleItem(); if (item) { - SPObject *layer=desktop->layerForObject(item); + SPObject *layer=desktop->layer_model->layerForObject(item); if ( layer && layer != desktop->currentLayer() ) { - desktop->setCurrentLayer(layer); + desktop->layer_model->setCurrentLayer(layer); } } } @@ -1740,7 +1648,7 @@ static void _reconstruction_start(SPDesktop * desktop) { // printf("Desktop, starting reconstruction\n"); desktop->_reconstruction_old_layer_id = desktop->currentLayer()->getId() ? desktop->currentLayer()->getId() : ""; - desktop->_layer_hierarchy->setBottom(desktop->currentRoot()); + desktop->layer_model->reset(); /* GSList const * selection_objs = desktop->selection->list(); @@ -1760,7 +1668,7 @@ static void _reconstruction_finish(SPDesktop * desktop) if ( !desktop->_reconstruction_old_layer_id.empty() ) { SPObject * newLayer = desktop->namedview->document->getObjectById(desktop->_reconstruction_old_layer_id); if (newLayer != NULL) { - desktop->setCurrentLayer(newLayer); + desktop->layer_model->setCurrentLayer(newLayer); } desktop->_reconstruction_old_layer_id.clear(); @@ -1931,7 +1839,7 @@ SPDesktop::show_dialogs() if (visible) { Inkscape::Verb *verb = Inkscape::Verb::get(verbId); if (verb) { - SPAction *action = verb->get_action(this); + SPAction *action = verb->get_action(Inkscape::ActionContext(this)); if (action) { sp_action_perform(action, NULL); } diff --git a/src/desktop.h b/src/desktop.h index 56de56c65..661470ded 100644 --- a/src/desktop.h +++ b/src/desktop.h @@ -62,9 +62,9 @@ typedef struct _GdkEventWindowState GdkEventWindowState; namespace Inkscape { struct Application; + class LayerModel; class MessageContext; class Selection; - class ObjectHierarchy; class LayerManager; class EventLog; namespace UI { @@ -125,6 +125,7 @@ public: Inkscape::UI::Dialog::DialogManager *_dlg_mgr; SPNamedView *namedview; SPCanvas *canvas; + Inkscape::LayerModel *layer_model; /// current selection; will never generally be NULL Inkscape::Selection *selection; SPEventContext *event_context; @@ -170,8 +171,6 @@ public: guint gr_point_i; Inkscape::PaintTarget gr_fill_or_stroke; - - Inkscape::ObjectHierarchy *_layer_hierarchy; Glib::ustring _reconstruction_old_layer_id; sigc::signal _tool_changed; @@ -264,17 +263,16 @@ public: void set_active (bool new_active); - // TODO look into making these return a more specific subclass: + // Could make all callers use layer_model instead of passing calls through? SPObject *currentRoot() const; SPObject *currentLayer() const; - void setCurrentLayer(SPObject *object); void toggleLayerSolo(SPObject *object); void toggleHideAllLayers(bool hide); void toggleLockAllLayers(bool lock); void toggleLockOtherLayers(SPObject *object); - SPObject *layerForObject(SPObject *object); bool isLayer(SPObject *object) const; + bool isWithinViewport(SPItem *item) const; bool itemIsHidden(SPItem const *item) const; diff --git a/src/dyna-draw-context.cpp b/src/dyna-draw-context.cpp index 605e487ab..c37f9cb4b 100644 --- a/src/dyna-draw-context.cpp +++ b/src/dyna-draw-context.cpp @@ -999,10 +999,10 @@ set_to_accumulated(SPDynaDrawContext *dc, bool unionize, bool subtract) if (unionize) { sp_desktop_selection(desktop)->add(dc->repr); - sp_selected_path_union_skip_undo(desktop); + sp_selected_path_union_skip_undo(sp_desktop_selection(desktop), desktop); } else if (subtract) { sp_desktop_selection(desktop)->add(dc->repr); - sp_selected_path_diff_skip_undo(desktop); + sp_selected_path_diff_skip_undo(sp_desktop_selection(desktop), desktop); } else { if (dc->keep_selected) { sp_desktop_selection(desktop)->set(dc->repr); diff --git a/src/eraser-context.cpp b/src/eraser-context.cpp index b34e3352c..a337f941b 100644 --- a/src/eraser-context.cpp +++ b/src/eraser-context.cpp @@ -751,7 +751,7 @@ set_to_accumulated(SPEraserContext *dc) selection->set(item); selection->add(dup); - sp_selected_path_diff_skip_undo(desktop); + sp_selected_path_diff_skip_undo(selection, desktop); workDone = true; // TODO set this only if something was cut. if ( !selection->isEmpty() ) { // If the item was not completely erased, track the new remainder. diff --git a/src/extension/dbus/document-interface.cpp b/src/extension/dbus/document-interface.cpp index 56d1dfdbd..bdf1fa98c 100644 --- a/src/extension/dbus/document-interface.cpp +++ b/src/extension/dbus/document-interface.cpp @@ -30,6 +30,7 @@ #include "extension/system.h" //IO #include "file.h" //IO #include "helper/action.h" //sp_action_perform +#include "helper/action-context.h" #include "inkscape.h" //inkscape_find_desktop_by_dkey, activate desktops #include "layer-fns.h" //LPOS_BELOW #include "live_effects/parameter/text.h" //text @@ -263,7 +264,7 @@ dbus_call_verb (DocumentInterface *object, int verbid, GError **error) if ( desk2 ) { Inkscape::Verb *verb = Inkscape::Verb::get( verbid ); if ( verb ) { - SPAction *action = verb->get_action(desk2); + SPAction *action = verb->get_action(Inkscape::ActionContext(desk2)); if ( action ) { //if (!object->updates) //document_interface_pause_updates (object, error); @@ -342,7 +343,7 @@ document_interface_call_verb (DocumentInterface *object, gchar *verbid, GError * if ( desk2 ) { Inkscape::Verb *verb = Inkscape::Verb::getbyid( verbid ); if ( verb ) { - SPAction *action = verb->get_action(desk2); + SPAction *action = verb->get_action(Inkscape::ActionContext(desk2)); if ( action ) { sp_action_perform( action, NULL ); if (object->updates) { diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp index 1df8002ad..22c5e4989 100644 --- a/src/extension/effect.cpp +++ b/src/extension/effect.cpp @@ -359,9 +359,9 @@ Effect::set_pref_dialog (PrefDialog * prefdialog) } SPAction * -Effect::EffectVerb::make_action (Inkscape::UI::View::View * view) +Effect::EffectVerb::make_action (Inkscape::ActionContext const & context) { - return make_action_helper(view, &perform, static_cast(this)); + return make_action_helper(context, &perform, static_cast(this)); } /** \brief Decode the verb code and take appropriate action */ diff --git a/src/extension/effect.h b/src/extension/effect.h index 193b90a97..a14cc6e7d 100644 --- a/src/extension/effect.h +++ b/src/extension/effect.h @@ -58,7 +58,7 @@ class Effect : public Extension { /** \brief Name with elipses if that makes sense */ gchar * _elip_name; protected: - virtual SPAction * make_action (Inkscape::UI::View::View * view); + virtual SPAction * make_action (Inkscape::ActionContext const & context); public: /** \brief Use the Verb initializer with the same parameters. */ EffectVerb(gchar const * id, diff --git a/src/extension/internal/bluredge.cpp b/src/extension/internal/bluredge.cpp index 8f1e07211..a3d2fd6e5 100644 --- a/src/extension/internal/bluredge.cpp +++ b/src/extension/internal/bluredge.cpp @@ -17,6 +17,7 @@ #include "document.h" #include "selection.h" #include "helper/action.h" +#include "helper/action-context.h" #include "preferences.h" #include "path-chemistry.h" #include "sp-item.h" @@ -99,10 +100,10 @@ BlurEdge::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View /* Doing an inset here folks */ offset *= -1.0; prefs->setDoubleUnit("/options/defaultoffsetwidth/value", offset, "px"); - sp_action_perform(Inkscape::Verb::get(SP_VERB_SELECTION_INSET)->get_action(desktop), NULL); + sp_action_perform(Inkscape::Verb::get(SP_VERB_SELECTION_INSET)->get_action(Inkscape::ActionContext(desktop)), NULL); } else if (offset > 0.0) { prefs->setDoubleUnit("/options/defaultoffsetwidth/value", offset, "px"); - sp_action_perform(Inkscape::Verb::get(SP_VERB_SELECTION_OFFSET)->get_action(desktop), NULL); + sp_action_perform(Inkscape::Verb::get(SP_VERB_SELECTION_OFFSET)->get_action(Inkscape::ActionContext(desktop)), NULL); } selection->clear(); diff --git a/src/extension/internal/filter/filter-all.cpp b/src/extension/internal/filter/filter-all.cpp old mode 100755 new mode 100644 diff --git a/src/flood-context.cpp b/src/flood-context.cpp index bb6864f7e..8fde11f88 100644 --- a/src/flood-context.cpp +++ b/src/flood-context.cpp @@ -511,7 +511,7 @@ static void do_trace(bitmap_coords_info bci, guchar *trace_px, SPDesktop *deskto ngettext("Area filled, path with %d node created and unioned with selection.","Area filled, path with %d nodes created and unioned with selection.", SP_PATH(reprobj)->nodesInPath()), SP_PATH(reprobj)->nodesInPath() ); selection->add(reprobj); - sp_selected_path_union_skip_undo(desktop); + sp_selected_path_union_skip_undo(sp_desktop_selection(desktop), desktop); } else { desktop->messageStack()->flashF( Inkscape::WARNING_MESSAGE, ngettext("Area filled, path with %d node created.","Area filled, path with %d nodes created.", diff --git a/src/helper/CMakeLists.txt b/src/helper/CMakeLists.txt index f709c7386..2e1e724f5 100644 --- a/src/helper/CMakeLists.txt +++ b/src/helper/CMakeLists.txt @@ -10,6 +10,7 @@ set(sp_marshal_SRC set(helper_SRC action.cpp + action-context.cpp geom.cpp geom-nodetype.cpp gnome-utils.cpp @@ -29,6 +30,7 @@ set(helper_SRC # ------- # Headers action.h + action-context.h geom-curves.h geom-nodetype.h geom.h diff --git a/src/helper/Makefile_insert b/src/helper/Makefile_insert index 2be40e0e0..790d87b14 100644 --- a/src/helper/Makefile_insert +++ b/src/helper/Makefile_insert @@ -5,6 +5,8 @@ helper/unit-menu.$(OBJEXT): helper/sp-marshal.h ink_common_sources += \ helper/action.cpp \ helper/action.h \ + helper/action-context.cpp \ + helper/action-context.h \ helper/geom.cpp \ helper/geom.h \ helper/geom-curves.h \ diff --git a/src/helper/action.cpp b/src/helper/action.cpp index 0e9957ca3..107d0179b 100644 --- a/src/helper/action.cpp +++ b/src/helper/action.cpp @@ -41,7 +41,7 @@ sp_action_init (SPAction *action) { action->sensitive = 0; action->active = 0; - action->view = NULL; + action->context = Inkscape::ActionContext(); action->id = action->name = action->tip = NULL; action->image = NULL; @@ -76,7 +76,7 @@ sp_action_finalize (GObject *object) * Create new SPAction object and set its properties. */ SPAction * -sp_action_new(Inkscape::UI::View::View *view, +sp_action_new(Inkscape::ActionContext const &context, const gchar *id, const gchar *name, const gchar *tip, @@ -85,7 +85,7 @@ sp_action_new(Inkscape::UI::View::View *view, { SPAction *action = (SPAction *)g_object_new(SP_TYPE_ACTION, NULL); - action->view = view; + action->context = context; action->sensitive = TRUE; action->id = g_strdup (id); action->name = g_strdup (name); @@ -111,11 +111,9 @@ public: : ActionEventBase(share_static_string("action")) { _addProperty(share_static_string("timestamp"), timestamp()); - if (action->view) { - SPDocument *document = action->view->doc(); - if (document) { - _addProperty(share_static_string("document"), document->serial()); - } + SPDocument *document = action->context.getDocument(); + if (document) { + _addProperty(share_static_string("document"), document->serial()); } _addProperty(share_static_string("verb"), action->id); } @@ -169,6 +167,26 @@ sp_action_set_name (SPAction *action, Glib::ustring const &name) action->signal_set_name.emit(name); } +/** + * Return Document associated with the action. + */ +SPDocument * +sp_action_get_document (SPAction *action) +{ + g_return_val_if_fail (SP_IS_ACTION (action), NULL); + return action->context.getDocument(); +} + +/** + * Return Selection associated with the action + */ +Inkscape::Selection * +sp_action_get_selection (SPAction *action) +{ + g_return_val_if_fail (SP_IS_ACTION (action), NULL); + return action->context.getSelection(); +} + /** * Return View associated with the action. */ @@ -176,7 +194,7 @@ Inkscape::UI::View::View * sp_action_get_view (SPAction *action) { g_return_val_if_fail (SP_IS_ACTION (action), NULL); - return action->view; + return action->context.getView(); } /* diff --git a/src/helper/action.h b/src/helper/action.h index 0cd010b34..49816e3c9 100644 --- a/src/helper/action.h +++ b/src/helper/action.h @@ -12,6 +12,7 @@ #ifndef SEEN_INKSCAPE_SP_ACTION_H #define SEEN_INKSCAPE_SP_ACTION_H +#include "helper/action-context.h" #include #include #include @@ -24,8 +25,12 @@ struct SPActionClass; #define SP_ACTION_CLASS(o) (G_TYPE_CHECK_CLASS_CAST((o), SP_TYPE_ACTION, SPActionClass)) #define SP_IS_ACTION(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), SP_TYPE_ACTION)) +class SPDocument; namespace Inkscape { + +class Selection; class Verb; + namespace UI { namespace View { class View; @@ -39,7 +44,7 @@ class View; struct SPAction : public GObject { unsigned sensitive : 1; /**< Value to track whether the action is sensitive */ unsigned active : 1; /**< Value to track whether the action is active */ - Inkscape::UI::View::View *view; /**< The View to which this action is attached */ + Inkscape::ActionContext context; /**< The context (doc/view) to which this action is attached */ gchar *id; /**< The identifier for the action */ gchar *name; /**< Full text name of the action */ gchar *tip; /**< A tooltip to describe the action */ @@ -59,7 +64,7 @@ struct SPActionClass { GType sp_action_get_type(); -SPAction *sp_action_new(Inkscape::UI::View::View *view, +SPAction *sp_action_new(Inkscape::ActionContext const &context, gchar const *id, gchar const *name, gchar const *tip, @@ -70,6 +75,8 @@ void sp_action_perform(SPAction *action, void *data); void sp_action_set_active(SPAction *action, unsigned active); void sp_action_set_sensitive(SPAction *action, unsigned sensitive); void sp_action_set_name(SPAction *action, Glib::ustring const &name); +SPDocument *sp_action_get_document(SPAction *action); +Inkscape::Selection *sp_action_get_selection(SPAction *action); Inkscape::UI::View::View *sp_action_get_view(SPAction *action); #endif diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 7e570deb7..125a7176a 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -87,7 +87,7 @@ enum { LAST_SIGNAL }; -#define DESKTOP_IS_ACTIVE(d) ((d) == inkscape->desktops->data) +#define DESKTOP_IS_ACTIVE(d) (inkscape->desktops && ((d) == inkscape->desktops->data)) /*################################ diff --git a/src/interface.cpp b/src/interface.cpp index 986d3107f..e3036afdd 100644 --- a/src/interface.cpp +++ b/src/interface.cpp @@ -53,6 +53,7 @@ #include "sp-namedview.h" #include "ui/view/view.h" #include "helper/action.h" +#include "helper/action-context.h" #include "helper/gnome-utils.h" #include "helper/window.h" #include "io/sys.h" @@ -370,13 +371,13 @@ sp_ui_menu_activate(void */*object*/, SPAction *action) static void sp_ui_menu_select_action(void */*object*/, SPAction *action) { - action->view->tipsMessageContext()->set(Inkscape::NORMAL_MESSAGE, action->tip); + sp_action_get_view(action)->tipsMessageContext()->set(Inkscape::NORMAL_MESSAGE, action->tip); } static void sp_ui_menu_deselect_action(void */*object*/, SPAction *action) { - action->view->tipsMessageContext()->clear(); + sp_action_get_view(action)->tipsMessageContext()->clear(); } static void @@ -419,7 +420,7 @@ sp_ui_dialog_title_string(Inkscape::Verb *verb, gchar *c) gchar *s; gchar *atitle; - action = verb->get_action(NULL); + action = verb->get_action(Inkscape::ActionContext()); if (!action) return; @@ -456,7 +457,7 @@ static GtkWidget *sp_ui_menu_append_item_from_verb(GtkMenu *menu, Inkscape::Verb } else { - action = verb->get_action(view); + action = verb->get_action(Inkscape::ActionContext(view)); if (!action) return NULL; if (radio) { @@ -670,7 +671,7 @@ sp_ui_menu_append_check_item_from_verb(GtkMenu *menu, Inkscape::UI::View::View * Inkscape::Verb *verb) { unsigned int shortcut = (verb) ? sp_shortcut_get_primary(verb) : 0; - SPAction *action = (verb) ? verb->get_action(view) : 0; + SPAction *action = (verb) ? verb->get_action(Inkscape::ActionContext(view)) : 0; GtkWidget *item = gtk_check_menu_item_new_with_mnemonic(action ? action->name : label); #if 0 @@ -955,7 +956,7 @@ static void sp_ui_build_dyn_menus(Inkscape::XML::Node *menus, GtkWidget *menu, I gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); } if (verb->get_code() != SP_VERB_NONE) { - SPAction *action = verb->get_action(view); + SPAction *action = verb->get_action(Inkscape::ActionContext(view)); #if GTK_CHECK_VERSION(3,0,0) g_signal_connect( G_OBJECT(item), "draw", (GCallback) update_view_menu, (void *) action); #else @@ -965,7 +966,7 @@ static void sp_ui_build_dyn_menus(Inkscape::XML::Node *menus, GtkWidget *menu, I } else if (menu_pntr->attribute("check") != NULL) { SPAction *action = NULL; if (verb->get_code() != SP_VERB_NONE) { - action = verb->get_action(view); + action = verb->get_action(Inkscape::ActionContext(view)); } sp_ui_menu_append_check_item_from_verb(GTK_MENU(menu), view, action->name, action->tip, NULL, checkitem_toggled, checkitem_update, verb); @@ -1671,7 +1672,7 @@ void ContextMenu::AppendItemFromVerb(Inkscape::Verb *verb)//, SPDesktop *view)// item->show(); append(*item); } else { - action = verb->get_action(view); + action = verb->get_action(Inkscape::ActionContext(view)); if (!action) { return; } @@ -2035,7 +2036,7 @@ void ContextMenu::AnchorLinkFollow(void) // Opening the selected links with a python extension Inkscape::Verb *verb = Inkscape::Verb::getbyid( "org.inkscape.followlink" ); if (verb) { - SPAction *action = verb->get_action(_desktop); + SPAction *action = verb->get_action(Inkscape::ActionContext(_desktop)); if (action) { sp_action_perform(action, NULL); } @@ -2205,7 +2206,7 @@ void ContextMenu::ImageEmbed(void) Inkscape::Verb *verb = Inkscape::Verb::getbyid( "org.ekips.filter.embedselectedimages" ); if (verb) { - SPAction *action = verb->get_action(_desktop); + SPAction *action = verb->get_action(Inkscape::ActionContext(_desktop)); if (action) { sp_action_perform(action, NULL); } @@ -2220,7 +2221,7 @@ void ContextMenu::ImageExtract(void) Inkscape::Verb *verb = Inkscape::Verb::getbyid( "org.ekips.filter.extractimage" ); if (verb) { - SPAction *action = verb->get_action(_desktop); + SPAction *action = verb->get_action(Inkscape::ActionContext(_desktop)); if (action) { sp_action_perform(action, NULL); } diff --git a/src/main-cmdlineact.cpp b/src/main-cmdlineact.cpp index 9f700292e..6af616e34 100644 --- a/src/main-cmdlineact.cpp +++ b/src/main-cmdlineact.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -41,7 +42,7 @@ CmdLineAction::~CmdLineAction () { } void -CmdLineAction::doIt (Inkscape::UI::View::View * view) { +CmdLineAction::doIt (ActionContext const & context) { //printf("Doing: %s\n", _arg); if (_isVerb) { Inkscape::Verb * verb = Inkscape::Verb::getbyid(_arg); @@ -49,32 +50,33 @@ CmdLineAction::doIt (Inkscape::UI::View::View * view) { printf(_("Unable to find verb ID '%s' specified on the command line.\n"), _arg); return; } - SPAction * action = verb->get_action(view); + SPAction * action = verb->get_action(context); sp_action_perform(action, NULL); } else { - SPDesktop * desktop = dynamic_cast(view); - if (desktop == NULL) { return; } + if (context.getDocument() == NULL || context.getSelection() == NULL) { return; } - SPDocument * doc = view->doc(); + SPDocument * doc = context.getDocument(); SPObject * obj = doc->getObjectById(_arg); if (obj == NULL) { printf(_("Unable to find node ID: '%s'\n"), _arg); return; } - Inkscape::Selection * selection = sp_desktop_selection(desktop); + Inkscape::Selection * selection = context.getSelection(); selection->add(obj, false); } return; } -void -CmdLineAction::doList (Inkscape::UI::View::View * view) { +bool +CmdLineAction::doList (ActionContext const & context) { + bool hasActions = !_list.empty(); for (std::list::iterator i = _list.begin(); i != _list.end(); ++i) { CmdLineAction * entry = *i; - entry->doIt(view); + entry->doIt(context); } + return hasActions; } bool @@ -87,8 +89,8 @@ CmdLineAction::idle (void) { for (std::list::iterator i = desktops.begin(); i != desktops.end(); ++i) { SPDesktop * desktop = *i; - //Inkscape::UI::View::View * view = dynamic_cast(desktop); - doList(desktop); + //Inkscape::UI::View::View * view = dynamic_cast(desktop); + doList(ActionContext(desktop)); } return false; } diff --git a/src/main-cmdlineact.h b/src/main-cmdlineact.h index 03f0eb0fc..fe11357fa 100644 --- a/src/main-cmdlineact.h +++ b/src/main-cmdlineact.h @@ -19,6 +19,8 @@ namespace Inkscape { +class ActionContext; + class CmdLineAction { bool _isVerb; gchar * _arg; @@ -29,8 +31,9 @@ public: CmdLineAction (bool isVerb, gchar const * arg); virtual ~CmdLineAction (); - void doIt (Inkscape::UI::View::View * view); - static void doList (Inkscape::UI::View::View * view); + void doIt (ActionContext const & context); + /** Return true if any actions were performed */ + static bool doList (ActionContext const & context); static bool idle (void); }; diff --git a/src/main.cpp b/src/main.cpp index 19ea3f181..49ef33fc9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -60,6 +60,8 @@ #include "macros.h" #include "file.h" #include "document.h" +#include "layer-model.h" +#include "selection.h" #include "sp-object.h" #include "interface.h" #include "print.h" @@ -85,6 +87,7 @@ #include "debug/logger.h" #include "debug/log-display-config.h" +#include "helper/action-context.h" #include "helper/png-write.h" #include "helper/geom.h" @@ -1066,7 +1069,20 @@ static int sp_process_file_list(GSList *fl) if (sp_vacuum_defs) { doc->vacuumDocument(); } - if (sp_vacuum_defs && !sp_export_svg) { + + bool has_performed_actions = false; + { + // Create layer model and selection model so we can run some verbs without a GUI + Inkscape::LayerModel layer_model; + layer_model.setDocument(doc); + Inkscape::Selection *selection = Inkscape::GC::release(new Inkscape::Selection(&layer_model, NULL)); + + // Execute command-line actions (selections and verbs) using our local models + Inkscape::ActionContext context(selection); + has_performed_actions = Inkscape::CmdLineAction::doList(context); + } + + if (!sp_export_svg && (sp_vacuum_defs || has_performed_actions)) { // save under the name given in the command line sp_repr_save_file(doc->rdoc, filename, SP_SVG_NS_URI); } diff --git a/src/selection-describer.cpp b/src/selection-describer.cpp index 72467c187..ce2d1c90b 100644 --- a/src/selection-describer.cpp +++ b/src/selection-describer.cpp @@ -17,6 +17,7 @@ #include #include "xml/quote.h" +#include "layer-model.h" #include "selection.h" #include "selection-describer.h" #include "desktop.h" @@ -144,8 +145,8 @@ void SelectionDescriber::_updateMessageFromSelection(Inkscape::Selection *select _context.set(Inkscape::NORMAL_MESSAGE, _when_nothing); } else { SPItem *item = SP_ITEM(items->data); - SPObject *layer = selection->desktop()->layerForObject(item); - SPObject *root = selection->desktop()->currentRoot(); + SPObject *layer = selection->layerModel()->layerForObject(item); + SPObject *root = selection->layerModel()->currentRoot(); // Layer name gchar *layer_name; diff --git a/src/selection.cpp b/src/selection.cpp index 564f1fdd3..76f49f544 100644 --- a/src/selection.cpp +++ b/src/selection.cpp @@ -21,9 +21,8 @@ #endif #include "macros.h" #include "inkscape-private.h" -#include "desktop.h" -#include "desktop-handles.h" #include "document.h" +#include "layer-model.h" #include "selection.h" #include <2geom/rect.h> #include "xml/repr.h" @@ -42,10 +41,11 @@ namespace Inkscape { -Selection::Selection(SPDesktop *desktop) : +Selection::Selection(LayerModel *layer_model, SPDesktop *desktop) : _objs(NULL), _reprs(NULL), _items(NULL), + _layer_model(layer_model), _desktop(desktop), _selection_context(NULL), _flags(0), @@ -55,7 +55,7 @@ Selection::Selection(SPDesktop *desktop) : Selection::~Selection() { _clear(); - _desktop = NULL; + _layer_model = NULL; if (_idle) { g_source_remove(_idle); _idle = 0; @@ -96,7 +96,7 @@ void Selection::_emitModified(guint flags) { void Selection::_emitChanged(bool persist_selection_context/* = false */) { if (persist_selection_context) { if (NULL == _selection_context) { - _selection_context = desktop()->currentLayer(); + _selection_context = _layer_model->currentLayer(); sp_object_ref(_selection_context, NULL); _context_release_connection = _selection_context->connectRelease(sigc::mem_fun(*this, &Selection::_releaseContext)); } @@ -139,7 +139,7 @@ void Selection::_clear() { SPObject *Selection::activeContext() { if (NULL != _selection_context) return _selection_context; - return desktop()->currentLayer(); + return _layer_model->currentLayer(); } bool Selection::includes(SPObject *obj) const { @@ -487,7 +487,7 @@ SPObject *Selection::_objectForXMLNode(Inkscape::XML::Node *repr) const { g_return_val_if_fail(repr != NULL, NULL); gchar const *id = repr->attribute("id"); g_return_val_if_fail(id != NULL, NULL); - SPObject *object=sp_desktop_document(_desktop)->getObjectById(id); + SPObject *object=_layer_model->getDocument()->getObjectById(id); g_return_val_if_fail(object != NULL, NULL); return object; } @@ -496,7 +496,7 @@ guint Selection::numberOfLayers() { GSList const *items = const_cast(this)->itemList(); GSList *layers = NULL; for (GSList const *iter = items; iter != NULL; iter = iter->next) { - SPObject *layer = desktop()->layerForObject(SP_OBJECT(iter->data)); + SPObject *layer = _layer_model->layerForObject(SP_OBJECT(iter->data)); if (g_slist_find (layers, layer) == NULL) { layers = g_slist_prepend (layers, layer); } diff --git a/src/selection.h b/src/selection.h index 10775dcb5..65a6c5140 100644 --- a/src/selection.h +++ b/src/selection.h @@ -33,6 +33,7 @@ class SPBox3D; struct Persp3D; namespace Inkscape { +class LayerModel; namespace XML { class Node; } @@ -41,10 +42,10 @@ class Node; namespace Inkscape { /** - * The set of selected SPObjects for a given desktop. + * The set of selected SPObjects for a given document and layer model. * * This class represents the set of selected SPItems for a given - * SPDesktop. + * document (referenced in LayerModel). * * An SPObject and its parent cannot be simultaneously selected; * selecting an SPObjects has the side-effect of unselecting any of @@ -64,17 +65,26 @@ class Selection : public Inkscape::GC::Managed<>, public: /** * Constructs an selection object, bound to a particular - * SPDesktop + * layer model * - * @param desktop the desktop in question + * @param layer_model the layer model (for the SPDesktop, if GUI) + * @param desktop the desktop associated with the layer model, or NULL if in console mode */ - Selection(SPDesktop *desktop); + Selection(LayerModel *layer_model, SPDesktop *desktop); ~Selection(); + /** + * Returns the layer model the selection is bound to (works in console or GUI mode) + * + * @return the layer model the selection is bound to, which is the same as the desktop + * layer model for GUI mode + */ + LayerModel *layerModel() { return _layer_model; } + /** * Returns the desktop the selection is bound to * - * @return the desktop the selection is bound to + * @return the desktop the selection is bound to, or NULL if in console mode */ SPDesktop *desktop() { return _desktop; } @@ -342,6 +352,7 @@ private: std::list _3dboxes; + LayerModel *_layer_model; GC::soft_ptr _desktop; SPObject* _selection_context; guint _flags; diff --git a/src/shortcuts.cpp b/src/shortcuts.cpp index 2af04929e..231e33e4a 100644 --- a/src/shortcuts.cpp +++ b/src/shortcuts.cpp @@ -35,6 +35,7 @@ #include #include "helper/action.h" +#include "helper/action-context.h" #include "io/sys.h" #include "io/resource.h" #include "verbs.h" @@ -68,7 +69,7 @@ sp_shortcut_invoke(unsigned int shortcut, Inkscape::UI::View::View *view) { Inkscape::Verb *verb = sp_shortcut_get_verb(shortcut); if (verb) { - SPAction *action = verb->get_action(view); + SPAction *action = verb->get_action(Inkscape::ActionContext(view)); if (action) { sp_action_perform(action, NULL); return true; diff --git a/src/splivarot.cpp b/src/splivarot.cpp index e45712134..0ec9da2a7 100644 --- a/src/splivarot.cpp +++ b/src/splivarot.cpp @@ -34,6 +34,7 @@ #include "style.h" #include "document.h" #include "document-undo.h" +#include "layer-model.h" #include "message-stack.h" #include "selection.h" #include "desktop-handles.h" @@ -58,79 +59,89 @@ using Inkscape::DocumentUndo; bool Ancetre(Inkscape::XML::Node *a, Inkscape::XML::Node *who); -void sp_selected_path_boolop(SPDesktop *desktop, bool_op bop, const unsigned int verb=SP_VERB_NONE, const Glib::ustring description=""); +void sp_selected_path_boolop(Inkscape::Selection *selection, SPDesktop *desktop, bool_op bop, const unsigned int verb=SP_VERB_NONE, const Glib::ustring description=""); void sp_selected_path_do_offset(SPDesktop *desktop, bool expand, double prefOffset); void sp_selected_path_create_offset_object(SPDesktop *desktop, int expand, bool updating); void -sp_selected_path_union(SPDesktop *desktop) +sp_selected_path_union(Inkscape::Selection *selection, SPDesktop *desktop) { - sp_selected_path_boolop(desktop, bool_op_union, SP_VERB_SELECTION_UNION, _("Union")); + sp_selected_path_boolop(selection, desktop, bool_op_union, SP_VERB_SELECTION_UNION, _("Union")); } void -sp_selected_path_union_skip_undo(SPDesktop *desktop) +sp_selected_path_union_skip_undo(Inkscape::Selection *selection, SPDesktop *desktop) { - sp_selected_path_boolop(desktop, bool_op_union, SP_VERB_NONE, _("Union")); + sp_selected_path_boolop(selection, desktop, bool_op_union, SP_VERB_NONE, _("Union")); } void -sp_selected_path_intersect(SPDesktop *desktop) +sp_selected_path_intersect(Inkscape::Selection *selection, SPDesktop *desktop) { - sp_selected_path_boolop(desktop, bool_op_inters, SP_VERB_SELECTION_INTERSECT, _("Intersection")); + sp_selected_path_boolop(selection, desktop, bool_op_inters, SP_VERB_SELECTION_INTERSECT, _("Intersection")); } void -sp_selected_path_diff(SPDesktop *desktop) +sp_selected_path_diff(Inkscape::Selection *selection, SPDesktop *desktop) { - sp_selected_path_boolop(desktop, bool_op_diff, SP_VERB_SELECTION_DIFF, _("Difference")); + sp_selected_path_boolop(selection, desktop, bool_op_diff, SP_VERB_SELECTION_DIFF, _("Difference")); } void -sp_selected_path_diff_skip_undo(SPDesktop *desktop) +sp_selected_path_diff_skip_undo(Inkscape::Selection *selection, SPDesktop *desktop) { - sp_selected_path_boolop(desktop, bool_op_diff, SP_VERB_NONE, _("Difference")); + sp_selected_path_boolop(selection, desktop, bool_op_diff, SP_VERB_NONE, _("Difference")); } void -sp_selected_path_symdiff(SPDesktop *desktop) +sp_selected_path_symdiff(Inkscape::Selection *selection, SPDesktop *desktop) { - sp_selected_path_boolop(desktop, bool_op_symdiff, SP_VERB_SELECTION_SYMDIFF, _("Exclusion")); + sp_selected_path_boolop(selection, desktop, bool_op_symdiff, SP_VERB_SELECTION_SYMDIFF, _("Exclusion")); } void -sp_selected_path_cut(SPDesktop *desktop) +sp_selected_path_cut(Inkscape::Selection *selection, SPDesktop *desktop) { - sp_selected_path_boolop(desktop, bool_op_cut, SP_VERB_SELECTION_CUT, _("Division")); + sp_selected_path_boolop(selection, desktop, bool_op_cut, SP_VERB_SELECTION_CUT, _("Division")); } void -sp_selected_path_slice(SPDesktop *desktop) +sp_selected_path_slice(Inkscape::Selection *selection, SPDesktop *desktop) { - sp_selected_path_boolop(desktop, bool_op_slice, SP_VERB_SELECTION_SLICE, _("Cut path")); + sp_selected_path_boolop(selection, desktop, bool_op_slice, SP_VERB_SELECTION_SLICE, _("Cut path")); } +// helper for printing error messages, regardless of whether we have a GUI or not +// If desktop == NULL, errors will be shown on stderr +static void +boolop_display_error_message(SPDesktop *desktop, Glib::ustring const &msg) +{ + if (desktop) { + desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, msg); + } else { + g_printerr("%s\n", msg.c_str()); + } +} // boolean operations // take the source paths from the file, do the operation, delete the originals and add the results void -sp_selected_path_boolop(SPDesktop *desktop, bool_op bop, const unsigned int verb, const Glib::ustring description) +sp_selected_path_boolop(Inkscape::Selection *selection, SPDesktop *desktop, bool_op bop, const unsigned int verb, const Glib::ustring description) { - Inkscape::Selection *selection = sp_desktop_selection(desktop); - + SPDocument *doc = selection->layerModel()->getDocument(); GSList *il = (GSList *) selection->itemList(); // allow union on a single object for the purpose of removing self overlapse (svn log, revision 13334) if ( (g_slist_length(il) < 2) && (bop != bool_op_union)) { - desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("Select at least 2 paths to perform a boolean operation.")); + boolop_display_error_message(desktop, _("Select at least 2 paths to perform a boolean operation.")); return; } else if ( g_slist_length(il) < 1 ) { - desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("Select at least 1 path to perform a boolean union.")); + boolop_display_error_message(desktop, _("Select at least 1 path to perform a boolean union.")); return; } if (g_slist_length(il) > 2) { if (bop == bool_op_diff || bop == bool_op_cut || bop == bool_op_slice ) { - desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("Select exactly 2 paths to perform difference, division, or path cut.")); + boolop_display_error_message(desktop, _("Select exactly 2 paths to perform difference, division, or path cut.")); return; } } @@ -146,7 +157,7 @@ sp_selected_path_boolop(SPDesktop *desktop, bool_op bop, const unsigned int verb Inkscape::XML::Node *b = reinterpret_cast(il->next->data)->getRepr(); if (a == NULL || b == NULL) { - desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("Unable to determine the z-order of the objects selected for difference, XOR, division, or path cut.")); + boolop_display_error_message(desktop, _("Unable to determine the z-order of the objects selected for difference, XOR, division, or path cut.")); return; } @@ -161,7 +172,7 @@ sp_selected_path_boolop(SPDesktop *desktop, bool_op bop, const unsigned int verb // find their lowest common ancestor Inkscape::XML::Node *dad = LCA(a, b); if (dad == NULL) { - desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("Unable to determine the z-order of the objects selected for difference, XOR, division, or path cut.")); + boolop_display_error_message(desktop, _("Unable to determine the z-order of the objects selected for difference, XOR, division, or path cut.")); return; } @@ -191,7 +202,7 @@ sp_selected_path_boolop(SPDesktop *desktop, bool_op bop, const unsigned int verb SPItem *item = SP_ITEM(l->data); if (!SP_IS_SHAPE(item) && !SP_IS_TEXT(item) && !SP_IS_FLOWTEXT(item)) { - desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("One of the objects is not a path, cannot perform boolean operation.")); + boolop_display_error_message(desktop, _("One of the objects is not a path, cannot perform boolean operation.")); g_slist_free(il); return; } @@ -432,8 +443,7 @@ sp_selected_path_boolop(SPDesktop *desktop, bool_op bop, const unsigned int verb { SP_OBJECT(l->data)->deleteObject(); } - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_NONE, - description); + DocumentUndo::done(doc, SP_VERB_NONE, description); selection->clear(); delete res; @@ -455,8 +465,7 @@ sp_selected_path_boolop(SPDesktop *desktop, bool_op bop, const unsigned int verb sorted = g_slist_sort(sorted, (GCompareFunc) sp_repr_compare_position); - source = sp_desktop_document(desktop)-> - getObjectByRepr((Inkscape::XML::Node *)sorted->data); + source = doc->getObjectByRepr((Inkscape::XML::Node *)sorted->data); g_slist_free(sorted); } @@ -496,7 +505,7 @@ sp_selected_path_boolop(SPDesktop *desktop, bool_op bop, const unsigned int verb g_slist_free(il); // premultiply by the inverse of parent's repr - SPItem *parent_item = SP_ITEM(sp_desktop_document(desktop)->getObjectByRepr(parent)); + SPItem *parent_item = SP_ITEM(doc->getObjectByRepr(parent)); Geom::Affine local (parent_item->i2doc_affine()); gchar *transform = sp_svg_transform_write(local.inverse()); @@ -526,7 +535,7 @@ sp_selected_path_boolop(SPDesktop *desktop, bool_op bop, const unsigned int verb for (int i=0;isvg_dump_path(); - Inkscape::XML::Document *xml_doc = desktop->doc()->getReprDoc(); + Inkscape::XML::Document *xml_doc = doc->getReprDoc(); Inkscape::XML::Node *repr = xml_doc->createElement("svg:path"); repr->setAttribute("style", style); if (mask) @@ -572,7 +581,7 @@ sp_selected_path_boolop(SPDesktop *desktop, bool_op bop, const unsigned int verb } else { gchar *d = res->svg_dump_path(); - Inkscape::XML::Document *xml_doc = desktop->doc()->getReprDoc(); + Inkscape::XML::Document *xml_doc = doc->getReprDoc(); Inkscape::XML::Node *repr = xml_doc->createElement("svg:path"); repr->setAttribute("style", style); @@ -590,10 +599,10 @@ sp_selected_path_boolop(SPDesktop *desktop, bool_op bop, const unsigned int verb repr->setAttribute("id", id); parent->appendChild(repr); if (title) { - sp_desktop_document(desktop)->getObjectByRepr(repr)->setTitle(title); + doc->getObjectByRepr(repr)->setTitle(title); } if (desc) { - sp_desktop_document(desktop)->getObjectByRepr(repr)->setDesc(desc); + doc->getObjectByRepr(repr)->setDesc(desc); } repr->setPosition(pos > 0 ? pos : 0); @@ -606,7 +615,7 @@ sp_selected_path_boolop(SPDesktop *desktop, bool_op bop, const unsigned int verb if (desc) g_free(desc); if (verb != SP_VERB_NONE) { - DocumentUndo::done(sp_desktop_document(desktop), verb, description); + DocumentUndo::done(doc, verb, description); } delete res; diff --git a/src/splivarot.h b/src/splivarot.h index 3d2a1ee58..0cefed3c2 100644 --- a/src/splivarot.h +++ b/src/splivarot.h @@ -11,19 +11,28 @@ #include <2geom/forward.h> #include <2geom/path.h> class SPCurve; +class SPDesktop; class SPItem; +namespace Inkscape { + class Selection; +} + // boolean operations // work on the current selection // selection has 2 contain exactly 2 items -void sp_selected_path_union (SPDesktop *desktop); -void sp_selected_path_union_skip_undo (SPDesktop *desktop); -void sp_selected_path_intersect (SPDesktop *desktop); -void sp_selected_path_diff (SPDesktop *desktop); -void sp_selected_path_diff_skip_undo (SPDesktop *desktop); -void sp_selected_path_symdiff (SPDesktop *desktop); -void sp_selected_path_cut (SPDesktop *desktop); -void sp_selected_path_slice (SPDesktop *desktop); + +// UPDATE: these signatures have been modified so they may work in +// command-line mode, i.e. without a desktop. If a desktop is not +// provided (desktop == NULL), error messages will be shown on stderr. +void sp_selected_path_union (Inkscape::Selection *selection, SPDesktop *desktop); +void sp_selected_path_union_skip_undo (Inkscape::Selection *selection, SPDesktop *desktop); +void sp_selected_path_intersect (Inkscape::Selection *selection, SPDesktop *desktop); +void sp_selected_path_diff (Inkscape::Selection *selection, SPDesktop *desktop); +void sp_selected_path_diff_skip_undo (Inkscape::Selection *selection, SPDesktop *desktop); +void sp_selected_path_symdiff (Inkscape::Selection *selection, SPDesktop *desktop); +void sp_selected_path_cut (Inkscape::Selection *selection, SPDesktop *desktop); +void sp_selected_path_slice (Inkscape::Selection *selection, SPDesktop *desktop); // offset/inset of a curve // takes the fill-rule in consideration diff --git a/src/spray-context.cpp b/src/spray-context.cpp index b8172fa4c..7690d0373 100644 --- a/src/spray-context.cpp +++ b/src/spray-context.cpp @@ -505,7 +505,7 @@ static bool sp_spray_recursive(SPDesktop *desktop, selection->clear(); selection->add(item_copied); selection->add(unionResult); - sp_selected_path_union_skip_undo(selection->desktop()); + sp_selected_path_union_skip_undo(selection, selection->desktop()); selection->add(father); Inkscape::GC::release(copy2); did = true; diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp index 5cc9578f1..32d85574d 100644 --- a/src/ui/dialog/layers.cpp +++ b/src/ui/dialog/layers.cpp @@ -27,6 +27,7 @@ #include "document.h" #include "document-undo.h" #include "helper/action.h" +#include "helper/action-context.h" #include "inkscape.h" #include "layer-fns.h" #include "layer-manager.h" @@ -99,7 +100,7 @@ void LayersPanel::_styleButton( Gtk::Button& btn, SPDesktop *desktop, unsigned i if ( desktop ) { Verb *verb = Verb::get( code ); if ( verb ) { - SPAction *action = verb->get_action(desktop); + SPAction *action = verb->get_action(Inkscape::ActionContext(desktop)); if ( !set && action && action->image ) { GtkWidget *child = sp_icon_new( Inkscape::ICON_SIZE_SMALL_TOOLBAR, action->image ); gtk_widget_show( child ); @@ -131,7 +132,7 @@ Gtk::MenuItem& LayersPanel::_addPopupItem( SPDesktop *desktop, unsigned int code if ( desktop ) { Verb *verb = Verb::get( code ); if ( verb ) { - SPAction *action = verb->get_action(desktop); + SPAction *action = verb->get_action(Inkscape::ActionContext(desktop)); if ( !iconWidget && action && action->image ) { iconWidget = sp_icon_new( Inkscape::ICON_SIZE_MENU, action->image ); } @@ -172,7 +173,7 @@ void LayersPanel::_fireAction( unsigned int code ) if ( _desktop ) { Verb *verb = Verb::get( code ); if ( verb ) { - SPAction *action = verb->get_action(_desktop); + SPAction *action = verb->get_action(Inkscape::ActionContext(_desktop)); if ( action ) { sp_action_perform( action, NULL ); // } else { diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp index 90cb1cdc9..094a6fa6a 100644 --- a/src/ui/dialog/swatches.cpp +++ b/src/ui/dialog/swatches.cpp @@ -57,6 +57,7 @@ #include "verbs.h" #include "gradient-chemistry.h" #include "helper/action.h" +#include "helper/action-context.h" namespace Inkscape { namespace UI { @@ -154,7 +155,7 @@ static void editGradientImpl( SPDesktop* desktop, SPGradient* gr ) // Invoke the gradient tool Inkscape::Verb *verb = Inkscape::Verb::get( SP_VERB_CONTEXT_GRADIENT ); if ( verb ) { - SPAction *action = verb->get_action( ( Inkscape::UI::View::View * ) SP_ACTIVE_DESKTOP); + SPAction *action = verb->get_action( Inkscape::ActionContext( ( Inkscape::UI::View::View * ) SP_ACTIVE_DESKTOP ) ); if ( action ) { sp_action_perform( action, NULL ); } diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index 5eb7084d6..09bf1a863 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -66,6 +66,7 @@ #include "verbs.h" #include "helper/action.h" +#include "helper/action-context.h" #include "xml/repr.h" namespace Inkscape { @@ -328,13 +329,13 @@ void SymbolsDialog::rebuild() { void SymbolsDialog::insertSymbol() { Inkscape::Verb *verb = Inkscape::Verb::get( SP_VERB_EDIT_SYMBOL ); - SPAction *action = verb->get_action((Inkscape::UI::View::View *) this->currentDesktop); + SPAction *action = verb->get_action(Inkscape::ActionContext( (Inkscape::UI::View::View *) this->currentDesktop) ); sp_action_perform (action, NULL); } void SymbolsDialog::revertSymbol() { Inkscape::Verb *verb = Inkscape::Verb::get( SP_VERB_EDIT_UNSYMBOL ); - SPAction *action = verb->get_action((Inkscape::UI::View::View *) this->currentDesktop); + SPAction *action = verb->get_action(Inkscape::ActionContext( (Inkscape::UI::View::View *) this->currentDesktop ) ); sp_action_perform (action, NULL); } diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp index fa3f8e3a1..988c4e5de 100644 --- a/src/ui/widget/page-sizer.cpp +++ b/src/ui/widget/page-sizer.cpp @@ -36,6 +36,7 @@ #include "document.h" #include "desktop.h" #include "helper/action.h" +#include "helper/action-context.h" #include "helper/units.h" #include "inkscape.h" #include "sp-namedview.h" @@ -619,7 +620,7 @@ PageSizer::fire_fit_canvas_to_selection_or_drawing() Verb *verb = Verb::get( SP_VERB_FIT_CANVAS_TO_SELECTION_OR_DRAWING ); if (verb) { - SPAction *action = verb->get_action(dt); + SPAction *action = verb->get_action(Inkscape::ActionContext(dt)); if (action) { sp_action_perform(action, NULL); } diff --git a/src/ui/widget/style-swatch.cpp b/src/ui/widget/style-swatch.cpp index a89f42575..aedab3fa5 100644 --- a/src/ui/widget/style-swatch.cpp +++ b/src/ui/widget/style-swatch.cpp @@ -28,6 +28,7 @@ #include "widgets/widget-sizes.h" #include "helper/units.h" #include "helper/action.h" +#include "helper/action-context.h" #include "preferences.h" #include "inkscape.h" #include "verbs.h" @@ -200,7 +201,7 @@ StyleSwatch::on_click(GdkEventButton */*event*/) { if (this->_desktop && this->_verb_t != SP_VERB_NONE) { Inkscape::Verb *verb = Inkscape::Verb::get(this->_verb_t); - SPAction *action = verb->get_action((Inkscape::UI::View::View *) this->_desktop); + SPAction *action = verb->get_action(Inkscape::ActionContext((Inkscape::UI::View::View *) this->_desktop)); sp_action_perform (action, NULL); return true; } diff --git a/src/verbs.cpp b/src/verbs.cpp index 6f83b3dfb..4bbd3f9df 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -50,6 +50,7 @@ #include "file.h" #include "gradient-drag.h" #include "helper/action.h" +#include "helper/action-context.h" #include "help.h" #include "inkscape-private.h" #include "interface.h" @@ -124,7 +125,7 @@ class FileVerb : public Verb { private: static void perform(SPAction *action, void *mydata); protected: - virtual SPAction *make_action(Inkscape::UI::View::View *view); + virtual SPAction *make_action(Inkscape::ActionContext const & context); public: /** Use the Verb initializer with the same parameters. */ FileVerb(unsigned int const code, @@ -143,7 +144,7 @@ class EditVerb : public Verb { private: static void perform(SPAction *action, void *mydata); protected: - virtual SPAction *make_action(Inkscape::UI::View::View *view); + virtual SPAction *make_action(Inkscape::ActionContext const & context); public: /** Use the Verb initializer with the same parameters. */ EditVerb(unsigned int const code, @@ -162,7 +163,7 @@ class SelectionVerb : public Verb { private: static void perform(SPAction *action, void *mydata); protected: - virtual SPAction *make_action(Inkscape::UI::View::View *view); + virtual SPAction *make_action(Inkscape::ActionContext const & context); public: /** Use the Verb initializer with the same parameters. */ SelectionVerb(unsigned int const code, @@ -181,7 +182,7 @@ class LayerVerb : public Verb { private: static void perform(SPAction *action, void *mydata); protected: - virtual SPAction *make_action(Inkscape::UI::View::View *view); + virtual SPAction *make_action(Inkscape::ActionContext const & context); public: /** Use the Verb initializer with the same parameters. */ LayerVerb(unsigned int const code, @@ -200,7 +201,7 @@ class ObjectVerb : public Verb { private: static void perform(SPAction *action, void *mydata); protected: - virtual SPAction *make_action(Inkscape::UI::View::View *view); + virtual SPAction *make_action(Inkscape::ActionContext const & context); public: /** Use the Verb initializer with the same parameters. */ ObjectVerb(unsigned int const code, @@ -219,7 +220,7 @@ class ContextVerb : public Verb { private: static void perform(SPAction *action, void *mydata); protected: - virtual SPAction *make_action(Inkscape::UI::View::View *view); + virtual SPAction *make_action(Inkscape::ActionContext const & context); public: /** Use the Verb initializer with the same parameters. */ ContextVerb(unsigned int const code, @@ -238,7 +239,7 @@ class ZoomVerb : public Verb { private: static void perform(SPAction *action, void *mydata); protected: - virtual SPAction *make_action(Inkscape::UI::View::View *view); + virtual SPAction *make_action(Inkscape::ActionContext const & context); public: /** Use the Verb initializer with the same parameters. */ ZoomVerb(unsigned int const code, @@ -258,7 +259,7 @@ class DialogVerb : public Verb { private: static void perform(SPAction *action, void *mydata); protected: - virtual SPAction *make_action(Inkscape::UI::View::View *view); + virtual SPAction *make_action(Inkscape::ActionContext const & context); public: /** Use the Verb initializer with the same parameters. */ DialogVerb(unsigned int const code, @@ -277,7 +278,7 @@ class HelpVerb : public Verb { private: static void perform(SPAction *action, void *mydata); protected: - virtual SPAction *make_action(Inkscape::UI::View::View *view); + virtual SPAction *make_action(Inkscape::ActionContext const & context); public: /** Use the Verb initializer with the same parameters. */ HelpVerb(unsigned int const code, @@ -296,7 +297,7 @@ class TutorialVerb : public Verb { private: static void perform(SPAction *action, void *mydata); protected: - virtual SPAction *make_action(Inkscape::UI::View::View *view); + virtual SPAction *make_action(Inkscape::ActionContext const & context); public: /** Use the Verb initializer with the same parameters. */ TutorialVerb(unsigned int const code, @@ -315,7 +316,7 @@ class TextVerb : public Verb { private: static void perform(SPAction *action, void *mydata); protected: - virtual SPAction *make_action(Inkscape::UI::View::View *view); + virtual SPAction *make_action(Inkscape::ActionContext const & context); public: /** Use the Verb initializer with the same parameters. */ TextVerb(unsigned int const code, @@ -382,10 +383,10 @@ Verb::~Verb(void) * for a function that every subclass should write. Most * can be written using \c make_action_helper. * - * @param view Which view the action should be created for. + * @param context Which context the action should be created for. * @return NULL to represent error (this function shouldn't ever be called) */ -SPAction *Verb::make_action(Inkscape::UI::View::View */*view*/) +SPAction *Verb::make_action(Inkscape::ActionContext const & /*context*/) { //std::cout << "make_action" << std::endl; return NULL; @@ -395,13 +396,13 @@ SPAction *Verb::make_action(Inkscape::UI::View::View */*view*/) * Create an action for a \c FileVerb. * Calls \c make_action_helper with the \c vector. * - * @param view Which view the action should be created for. + * @param context Which context the action should be created for. * @return The built action. */ -SPAction *FileVerb::make_action(Inkscape::UI::View::View *view) +SPAction *FileVerb::make_action(Inkscape::ActionContext const & context) { //std::cout << "fileverb: make_action: " << &perform << std::endl; - return make_action_helper(view, &perform); + return make_action_helper(context, &perform); } /** @@ -409,13 +410,13 @@ SPAction *FileVerb::make_action(Inkscape::UI::View::View *view) * * Calls \c make_action_helper with the \c vector. * - * @param view Which view the action should be created for. + * @param context Which context the action should be created for. * @return The built action. */ -SPAction *EditVerb::make_action(Inkscape::UI::View::View *view) +SPAction *EditVerb::make_action(Inkscape::ActionContext const & context) { //std::cout << "editverb: make_action: " << &perform << std::endl; - return make_action_helper(view, &perform); + return make_action_helper(context, &perform); } /** @@ -423,12 +424,12 @@ SPAction *EditVerb::make_action(Inkscape::UI::View::View *view) * * Calls \c make_action_helper with the \c vector. * - * @param view Which view the action should be created for. + * @param context Which context the action should be created for. * @return The built action. */ -SPAction *SelectionVerb::make_action(Inkscape::UI::View::View *view) +SPAction *SelectionVerb::make_action(Inkscape::ActionContext const & context) { - return make_action_helper(view, &perform); + return make_action_helper(context, &perform); } /** @@ -436,12 +437,12 @@ SPAction *SelectionVerb::make_action(Inkscape::UI::View::View *view) * * Calls \c make_action_helper with the \c vector. * - * @param view Which view the action should be created for. + * @param context Which context the action should be created for. * @return The built action. */ -SPAction *LayerVerb::make_action(Inkscape::UI::View::View *view) +SPAction *LayerVerb::make_action(Inkscape::ActionContext const & context) { - return make_action_helper(view, &perform); + return make_action_helper(context, &perform); } /** @@ -449,12 +450,12 @@ SPAction *LayerVerb::make_action(Inkscape::UI::View::View *view) * * Calls \c make_action_helper with the \c vector. * - * @param view Which view the action should be created for. + * @param context Which context the action should be created for. * @return The built action. */ -SPAction *ObjectVerb::make_action(Inkscape::UI::View::View *view) +SPAction *ObjectVerb::make_action(Inkscape::ActionContext const & context) { - return make_action_helper(view, &perform); + return make_action_helper(context, &perform); } /** @@ -462,12 +463,12 @@ SPAction *ObjectVerb::make_action(Inkscape::UI::View::View *view) * * Calls \c make_action_helper with the \c vector. * - * @param view Which view the action should be created for. + * @param context Which context the action should be created for. * @return The built action. */ -SPAction *ContextVerb::make_action(Inkscape::UI::View::View *view) +SPAction *ContextVerb::make_action(Inkscape::ActionContext const & context) { - return make_action_helper(view, &perform); + return make_action_helper(context, &perform); } /** @@ -475,12 +476,12 @@ SPAction *ContextVerb::make_action(Inkscape::UI::View::View *view) * * Calls \c make_action_helper with the \c vector. * - * @param view Which view the action should be created for. + * @param context Which context the action should be created for. * @return The built action. */ -SPAction *ZoomVerb::make_action(Inkscape::UI::View::View *view) +SPAction *ZoomVerb::make_action(Inkscape::ActionContext const & context) { - return make_action_helper(view, &perform); + return make_action_helper(context, &perform); } /** @@ -488,12 +489,12 @@ SPAction *ZoomVerb::make_action(Inkscape::UI::View::View *view) * * Calls \c make_action_helper with the \c vector. * - * @param view Which view the action should be created for. + * @param context Which context the action should be created for. * @return The built action. */ -SPAction *DialogVerb::make_action(Inkscape::UI::View::View *view) +SPAction *DialogVerb::make_action(Inkscape::ActionContext const & context) { - return make_action_helper(view, &perform); + return make_action_helper(context, &perform); } /** @@ -501,12 +502,12 @@ SPAction *DialogVerb::make_action(Inkscape::UI::View::View *view) * * Calls \c make_action_helper with the \c vector. * - * @param view Which view the action should be created for. + * @param context Which context the action should be created for. * @return The built action. */ -SPAction *HelpVerb::make_action(Inkscape::UI::View::View *view) +SPAction *HelpVerb::make_action(Inkscape::ActionContext const & context) { - return make_action_helper(view, &perform); + return make_action_helper(context, &perform); } /** @@ -514,12 +515,12 @@ SPAction *HelpVerb::make_action(Inkscape::UI::View::View *view) * * Calls \c make_action_helper with the \c vector. * - * @param view Which view the action should be created for. + * @param context Which context the action should be created for. * @return The built action. */ -SPAction *TutorialVerb::make_action(Inkscape::UI::View::View *view) +SPAction *TutorialVerb::make_action(Inkscape::ActionContext const & context) { - return make_action_helper(view, &perform); + return make_action_helper(context, &perform); } /** @@ -527,12 +528,12 @@ SPAction *TutorialVerb::make_action(Inkscape::UI::View::View *view) * * Calls \c make_action_helper with the \c vector. * - * @param view Which view the action should be created for. + * @param context Which context the action should be created for. * @return The built action. */ -SPAction *TextVerb::make_action(Inkscape::UI::View::View *view) +SPAction *TextVerb::make_action(Inkscape::ActionContext const & context) { - return make_action_helper(view, &perform); + return make_action_helper(context, &perform); } /** @@ -546,16 +547,16 @@ SPAction *TextVerb::make_action(Inkscape::UI::View::View *view) * if the action gets crated, a listener is added to the action with * the vector that is passed in. * - * @param view Which view the action should be created for. + * @param context Which context the action should be created for. * @param vector The function vector for the verb. * @return The created action. */ -SPAction *Verb::make_action_helper(Inkscape::UI::View::View *view, void (*perform_fun)(SPAction *, void *), void *in_pntr) +SPAction *Verb::make_action_helper(Inkscape::ActionContext const & context, void (*perform_fun)(SPAction *, void *), void *in_pntr) { SPAction *action; //std::cout << "Adding action: " << _code << std::endl; - action = sp_action_new(view, _id, _(_name), + action = sp_action_new(context, _id, _(_name), _(_tip), _image, this); if (action == NULL) return NULL; @@ -587,22 +588,22 @@ SPAction *Verb::make_action_helper(Inkscape::UI::View::View *view, void (*perfor * looked for, and the sensitivity is matched. Unfortunately, this is * currently a linear search. * - * @param view The view which this action would relate to. + * @param context The action context which this action relates to. * @return The action, or NULL if there is an error. */ -SPAction *Verb::get_action(Inkscape::UI::View::View *view) +SPAction *Verb::get_action(Inkscape::ActionContext const & context) { SPAction *action = NULL; if ( _actions == NULL ) { _actions = new ActionTable; } - ActionTable::iterator action_found = _actions->find(view); + ActionTable::iterator action_found = _actions->find(context.getView()); if (action_found != _actions->end()) { action = action_found->second; } else { - action = this->make_action(view); + action = this->make_action(context); // if (action == NULL) printf("Hmm, NULL in %s\n", _name); if (action == NULL) printf("Hmm, NULL in %s\n", _name); @@ -610,16 +611,16 @@ SPAction *Verb::get_action(Inkscape::UI::View::View *view) sp_action_set_sensitive(action, 0); } else { for (ActionTable::iterator cur_action = _actions->begin(); - cur_action != _actions->end() && view != NULL; + cur_action != _actions->end() && context.getView() != NULL; ++cur_action) { - if (cur_action->first != NULL && cur_action->first->doc() == view->doc()) { + if (cur_action->first != NULL && cur_action->first->doc() == context.getDocument()) { sp_action_set_sensitive(action, cur_action->second->sensitive); break; } } } - _actions->insert(ActionTable::value_type(view, action)); + _actions->insert(ActionTable::value_type(context.getView(), action)); } return action; @@ -802,8 +803,7 @@ void FileVerb::perform(SPAction *action, void *data) #if 0 // These aren't used, but are here to remind people not to use // the CURRENT_DOCUMENT macros unless they really have to. - Inkscape::UI::View::View *current_view = sp_action_get_view(action); - SPDocument *current_document = current_view->doc(); + SPDocument *current_document = sp_action_get_document(action); #endif SPDesktop *desktop = dynamic_cast(sp_action_get_view(action)); @@ -1028,8 +1028,39 @@ void EditVerb::perform(SPAction *action, void *data) */ void SelectionVerb::perform(SPAction *action, void *data) { + Inkscape::Selection *selection = sp_action_get_selection(action); SPDesktop *dt = static_cast(sp_action_get_view(action)); + // Some of these operations have been modified so they work in command-line mode! + // In this case, all we need is a selection + if (!selection) { + return; + } + + switch (reinterpret_cast(data)) { + case SP_VERB_SELECTION_UNION: + sp_selected_path_union(selection, dt); + break; + case SP_VERB_SELECTION_INTERSECT: + sp_selected_path_intersect(selection, dt); + break; + case SP_VERB_SELECTION_DIFF: + sp_selected_path_diff(selection, dt); + break; + case SP_VERB_SELECTION_SYMDIFF: + sp_selected_path_symdiff(selection, dt); + break; + case SP_VERB_SELECTION_CUT: + sp_selected_path_cut(selection, dt); + break; + case SP_VERB_SELECTION_SLICE: + sp_selected_path_slice(selection, dt); + break; + default: + break; + } + + // The remaining operations require a desktop if (!dt) return; @@ -1065,26 +1096,6 @@ void SelectionVerb::perform(SPAction *action, void *data) text_remove_all_kerns(); break; - case SP_VERB_SELECTION_UNION: - sp_selected_path_union(dt); - break; - case SP_VERB_SELECTION_INTERSECT: - sp_selected_path_intersect(dt); - break; - case SP_VERB_SELECTION_DIFF: - sp_selected_path_diff(dt); - break; - case SP_VERB_SELECTION_SYMDIFF: - sp_selected_path_symdiff(dt); - break; - - case SP_VERB_SELECTION_CUT: - sp_selected_path_cut(dt); - break; - case SP_VERB_SELECTION_SLICE: - sp_selected_path_slice(dt); - break; - case SP_VERB_SELECTION_OFFSET: sp_selected_path_offset(dt); break; @@ -1500,7 +1511,7 @@ void ContextVerb::perform(SPAction *action, void *data) */ for (vidx = SP_VERB_CONTEXT_SELECT; vidx <= SP_VERB_CONTEXT_PAINTBUCKET_PREFS; vidx++) { - SPAction *tool_action= get((sp_verb_t)vidx)->get_action(dt); + SPAction *tool_action= get((sp_verb_t)vidx)->get_action(action->context); if (tool_action) { sp_action_set_active(tool_action, vidx == (int)verb); } @@ -2090,7 +2101,7 @@ class EffectLastVerb : public Verb { private: static void perform(SPAction *action, void *mydata); protected: - virtual SPAction *make_action(Inkscape::UI::View::View *view); + virtual SPAction *make_action(Inkscape::ActionContext const & context); public: /** Use the Verb initializer with the same parameters. */ EffectLastVerb(unsigned int const code, @@ -2109,12 +2120,12 @@ public: * * Calls \c make_action_helper with the \c vector. * - * @param view Which view the action should be created for. + * @param context Which context the action should be created for. * @return The built action. */ -SPAction *EffectLastVerb::make_action(Inkscape::UI::View::View *view) +SPAction *EffectLastVerb::make_action(Inkscape::ActionContext const & context) { - return make_action_helper(view, &perform); + return make_action_helper(context, &perform); } /** @@ -2155,7 +2166,7 @@ class FitCanvasVerb : public Verb { private: static void perform(SPAction *action, void *mydata); protected: - virtual SPAction *make_action(Inkscape::UI::View::View *view); + virtual SPAction *make_action(Inkscape::ActionContext const & context); public: /** Use the Verb initializer with the same parameters. */ FitCanvasVerb(unsigned int const code, @@ -2174,12 +2185,12 @@ public: * * Calls \c make_action_helper with the \c vector. * - * @param view Which view the action should be created for. + * @param context Which context the action should be created for. * @return The built action. */ -SPAction *FitCanvasVerb::make_action(Inkscape::UI::View::View *view) +SPAction *FitCanvasVerb::make_action(Inkscape::ActionContext const & context) { - SPAction *action = make_action_helper(view, &perform); + SPAction *action = make_action_helper(context, &perform); return action; } @@ -2221,7 +2232,7 @@ class LockAndHideVerb : public Verb { private: static void perform(SPAction *action, void *mydata); protected: - virtual SPAction *make_action(Inkscape::UI::View::View *view); + virtual SPAction *make_action(Inkscape::ActionContext const & context); public: /** Use the Verb initializer with the same parameters. */ LockAndHideVerb(unsigned int const code, @@ -2240,12 +2251,12 @@ public: * * Calls \c make_action_helper with the \c vector. * - * @param view Which view the action should be created for. + * @param context Which context the action should be created for. * @return The built action. */ -SPAction *LockAndHideVerb::make_action(Inkscape::UI::View::View *view) +SPAction *LockAndHideVerb::make_action(Inkscape::ActionContext const & context) { - SPAction *action = make_action_helper(view, &perform); + SPAction *action = make_action_helper(context, &perform); return action; } diff --git a/src/verbs.h b/src/verbs.h index dab524d7a..35165822a 100644 --- a/src/verbs.h +++ b/src/verbs.h @@ -23,6 +23,9 @@ struct SPAction; class SPDocument; namespace Inkscape { + +class ActionContext; + namespace UI { namespace View { class View; @@ -472,8 +475,8 @@ public: protected: - SPAction *make_action_helper (Inkscape::UI::View::View *view, void (*perform_fun)(SPAction *, void *), void *in_pntr = NULL); - virtual SPAction *make_action (Inkscape::UI::View::View *view); + SPAction *make_action_helper (Inkscape::ActionContext const & context, void (*perform_fun)(SPAction *, void *), void *in_pntr = NULL); + virtual SPAction *make_action (Inkscape::ActionContext const & context); public: @@ -521,7 +524,7 @@ public: Verb (gchar const * id, gchar const * name, gchar const * tip, gchar const * image, gchar const * group); virtual ~Verb (void); - SPAction * get_action(Inkscape::UI::View::View * view); + SPAction * get_action(Inkscape::ActionContext const & context); private: static Verb * get_search (unsigned int code); diff --git a/src/widgets/button.cpp b/src/widgets/button.cpp index 467f0d70e..a1bd9b792 100644 --- a/src/widgets/button.cpp +++ b/src/widgets/button.cpp @@ -20,6 +20,7 @@ #include "icon.h" #include "shortcuts.h" #include "interface.h" +#include "helper/action-context.h" #include @@ -309,7 +310,7 @@ sp_button_new_from_data( Inkscape::IconSize size, const gchar *tip ) { GtkWidget *button; - SPAction *action=sp_action_new(view, name, name, tip, name, 0); + SPAction *action=sp_action_new(Inkscape::ActionContext(view), name, name, tip, name, 0); button = sp_button_new (size, type, action, NULL); g_object_unref(action); return button; diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 814298041..c1214c1a4 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -41,6 +41,8 @@ #include "ege-select-one-action.h" #include #include "file.h" +#include "helper/action.h" +#include "helper/action-context.h" #include "helper/units.h" #include "helper/unit-tracker.h" #include "inkscape-private.h" @@ -485,7 +487,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw ) gchar const* tip = ""; Inkscape::Verb* verb = Inkscape::Verb::get( SP_VERB_VIEW_CMS_TOGGLE ); if ( verb ) { - SPAction *act = verb->get_action( dtw->viewwidget.view ); + SPAction *act = verb->get_action( Inkscape::ActionContext( dtw->viewwidget.view ) ); if ( act && act->tip ) { tip = act->tip; } @@ -1060,7 +1062,7 @@ void cms_adjust_set_sensitive( SPDesktopWidget *dtw, bool enabled ) { Inkscape::Verb* verb = Inkscape::Verb::get( SP_VERB_VIEW_CMS_TOGGLE ); if ( verb ) { - SPAction *act = verb->get_action( dtw->viewwidget.view ); + SPAction *act = verb->get_action( Inkscape::ActionContext( dtw->viewwidget.view ) ); if ( act ) { sp_action_set_sensitive( act, enabled ); } diff --git a/src/widgets/gradient-selector.cpp b/src/widgets/gradient-selector.cpp index 7a7f0d8ff..5ac994509 100644 --- a/src/widgets/gradient-selector.cpp +++ b/src/widgets/gradient-selector.cpp @@ -26,6 +26,7 @@ #include "inkscape.h" #include "verbs.h" #include "helper/action.h" +#include "helper/action-context.h" #include "preferences.h" #include @@ -535,7 +536,7 @@ sp_gradient_selector_edit_vector_clicked (GtkWidget */*w*/, SPGradientSelector * // Invoke the gradient tool Inkscape::Verb *verb = Inkscape::Verb::get( SP_VERB_CONTEXT_GRADIENT ); if ( verb ) { - SPAction *action = verb->get_action( ( Inkscape::UI::View::View * ) SP_ACTIVE_DESKTOP); + SPAction *action = verb->get_action( Inkscape::ActionContext( ( Inkscape::UI::View::View * ) SP_ACTIVE_DESKTOP ) ); if ( action ) { sp_action_perform( action, NULL ); } diff --git a/src/widgets/lpe-toolbar.cpp b/src/widgets/lpe-toolbar.cpp index 3126175b3..c7659ab42 100644 --- a/src/widgets/lpe-toolbar.cpp +++ b/src/widgets/lpe-toolbar.cpp @@ -55,6 +55,8 @@ #include "../xml/repr.h" #include "ui/uxmanager.h" #include "../ui/icon-names.h" +#include "../helper/action.h" +#include "../helper/action-context.h" #include "../helper/unit-menu.h" #include "../helper/units.h" #include "../helper/unit-tracker.h" @@ -286,7 +288,7 @@ static void lpetool_open_lpe_dialog(GtkToggleAction *act, gpointer data) SPDesktop *desktop = static_cast(data); if (tools_isactive(desktop, TOOLS_LPETOOL)) { - sp_action_perform(Inkscape::Verb::get(SP_VERB_DIALOG_LIVE_PATH_EFFECT)->get_action(desktop), NULL); + sp_action_perform(Inkscape::Verb::get(SP_VERB_DIALOG_LIVE_PATH_EFFECT)->get_action(Inkscape::ActionContext(desktop)), NULL); } gtk_toggle_action_set_active(act, false); } diff --git a/src/widgets/select-toolbar.cpp b/src/widgets/select-toolbar.cpp index 549581610..1bfc841e3 100644 --- a/src/widgets/select-toolbar.cpp +++ b/src/widgets/select-toolbar.cpp @@ -37,6 +37,8 @@ #include "sp-namedview.h" #include "toolbox.h" #include +#include "helper/action.h" +#include "helper/action-context.h" #include "helper/unit-menu.h" #include "helper/units.h" #include "inkscape.h" @@ -413,7 +415,7 @@ static GtkAction* create_action_for_verb( Inkscape::Verb* verb, Inkscape::UI::Vi { GtkAction* act = 0; - SPAction* targetAction = verb->get_action(view); + SPAction* targetAction = verb->get_action(Inkscape::ActionContext(view)); InkAction* inky = ink_action_new( verb->get_id(), verb->get_name(), verb->get_tip(), verb->get_image(), size ); act = GTK_ACTION(inky); diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 0fdf36d5f..ca593976f 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -47,6 +47,8 @@ #include "../ege-output-action.h" #include "../ege-select-one-action.h" #include "../graphlayout.h" +#include "../helper/action.h" +#include "../helper/action-context.h" #include "../helper/unit-menu.h" #include "../helper/units.h" #include "../helper/unit-tracker.h" @@ -591,9 +593,9 @@ private: Glib::RefPtr VerbAction::create(Inkscape::Verb* verb, Inkscape::Verb* verb2, Inkscape::UI::View::View *view) { Glib::RefPtr result; - SPAction *action = verb->get_action(view); + SPAction *action = verb->get_action(Inkscape::ActionContext(view)); if ( action ) { - //SPAction* action2 = verb2 ? verb2->get_action(view) : 0; + //SPAction* action2 = verb2 ? verb2->get_action(Inkscape::ActionContext(view)) : 0; result = Glib::RefPtr(new VerbAction(verb, verb2, view)); } @@ -680,7 +682,7 @@ void VerbAction::set_active(bool active) void VerbAction::on_activate() { if ( verb ) { - SPAction *action = verb->get_action(view); + SPAction *action = verb->get_action(Inkscape::ActionContext(view)); if ( action ) { sp_action_perform(action, 0); } @@ -770,14 +772,14 @@ GtkToolItem * sp_toolbox_button_item_new_from_verb_with_doubleclick(GtkWidget *t Inkscape::Verb *verb, Inkscape::Verb *doubleclick_verb, Inkscape::UI::View::View *view) { - SPAction *action = verb->get_action(view); + SPAction *action = verb->get_action(Inkscape::ActionContext(view)); if (!action) { return NULL; } SPAction *doubleclick_action; if (doubleclick_verb) { - doubleclick_action = doubleclick_verb->get_action(view); + doubleclick_action = doubleclick_verb->get_action(Inkscape::ActionContext(view)); } else { doubleclick_action = NULL; } @@ -822,7 +824,7 @@ static GtkAction* create_action_for_verb( Inkscape::Verb* verb, Inkscape::UI::Vi { GtkAction* act = 0; - SPAction* targetAction = verb->get_action(view); + SPAction* targetAction = verb->get_action(Inkscape::ActionContext(view)); InkAction* inky = ink_action_new( verb->get_id(), _(verb->get_name()), verb->get_tip(), verb->get_image(), size ); act = GTK_ACTION(inky); gtk_action_set_sensitive( act, targetAction->sensitive ); -- cgit v1.2.3 From 6fe6a37589cbd6e53bf763879503ace16260e7a2 Mon Sep 17 00:00:00 2001 From: Eric Greveson Date: Mon, 1 Jul 2013 21:09:53 +0100 Subject: Added new files referenced in previous commit message (forgot to add!) (bzr r12387.1.2) --- src/helper/action-context.cpp | 74 ++++++++++++ src/helper/action-context.h | 78 +++++++++++++ src/layer-model.cpp | 259 ++++++++++++++++++++++++++++++++++++++++++ src/layer-model.h | 104 +++++++++++++++++ 4 files changed, 515 insertions(+) create mode 100644 src/helper/action-context.cpp create mode 100644 src/helper/action-context.h create mode 100644 src/layer-model.cpp create mode 100644 src/layer-model.h (limited to 'src') diff --git a/src/helper/action-context.cpp b/src/helper/action-context.cpp new file mode 100644 index 000000000..c88086f7f --- /dev/null +++ b/src/helper/action-context.cpp @@ -0,0 +1,74 @@ +/* + * ActionContext implementation. + * + * Author: + * Eric Greveson + * + * Copyright (C) 2013 Eric Greveson + * + * This code is in public domain + */ + +#include "desktop.h" +#include "document.h" +#include "layer-model.h" +#include "selection.h" +#include "helper/action-context.h" +#include "ui/view/view.h" + +namespace Inkscape { + +ActionContext::ActionContext() + : _selection(NULL) + , _view(NULL) +{ +} + +ActionContext::ActionContext(Selection *selection) + : _selection(selection) + , _view(NULL) +{ +} + +ActionContext::ActionContext(UI::View::View *view) + : _selection(NULL) + , _view(view) +{ + SPDesktop *desktop = static_cast(view); + if (desktop) { + _selection = desktop->selection; + } +} + +SPDocument *ActionContext::getDocument() const +{ + if (_selection == NULL) { + return NULL; + } + + // Should be the same as the view's document, if view is non-NULL + return _selection->layerModel()->getDocument(); +} + +Selection *ActionContext::getSelection() const +{ + return _selection; +} + +UI::View::View *ActionContext::getView() const +{ + return _view; +} + +} // namespace Inkscape + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : diff --git a/src/helper/action-context.h b/src/helper/action-context.h new file mode 100644 index 000000000..de09f94f4 --- /dev/null +++ b/src/helper/action-context.h @@ -0,0 +1,78 @@ +/** \file + * Inkscape UI action context implementation + *//* + * Author: + * Eric Greveson + * + * Copyright (C) 2013 Eric Greveson + * + * This code is in public domain + */ + +#ifndef SEEN_INKSCAPE_ACTION_CONTEXT_H +#define SEEN_INKSCAPE_ACTION_CONTEXT_H + +class SPDocument; + +namespace Inkscape { + +class Selection; + +namespace UI { +namespace View { +class View; +} // namespace View +} // namespace UI + +/** This structure contains all the document/view context required + for an action. Some actions may be executed on a document without + requiring a GUI, hence not providing the info directly through + Inkscape::UI::View::View. Actions that do require GUI objects should + check to see if the relevant pointers are NULL before attempting to + use them. + + ActionContext is designed to be copyable, so it may be used with stack + storage if required. */ +class ActionContext { + // NB: Only one of these is typically set - selection model if in console mode, view if in GUI mode + Selection *_selection; /**< The selection model to which this action applies, if running in console mode. May be NULL. */ + UI::View::View *_view; /**< The view to which this action applies. May be NULL (e.g. if running in console mode). */ + +public: + /** Construct without any document or GUI */ + ActionContext(); + + /** Construct an action context for when the app is being run without + any GUI, i.e. in console mode */ + ActionContext(Selection *selection); + + /** Construct an action context for when the app is being run in GUI mode */ + ActionContext(UI::View::View *view); + + /** Get the document for the action context. May be NULL. Prefer this + function to getView()->doc() if the action doesn't require a GUI. */ + SPDocument *getDocument() const; + + /** Get the selection for the action context. May be NULL. Should be + non-NULL if getDocument() is non-NULL. */ + Selection *getSelection() const; + + /** Get the view for the action context. May be NULL. Guaranteed to be + NULL if running in console mode. */ + UI::View::View *getView() const; +}; + +} // namespace Inkscape + +#endif + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/layer-model.cpp b/src/layer-model.cpp new file mode 100644 index 000000000..6833852ad --- /dev/null +++ b/src/layer-model.cpp @@ -0,0 +1,259 @@ +/* + * Editable view implementation + * + * Authors: + * Lauris Kaplinski + * MenTaLguY + * bulia byak + * Ralf Stephan + * John Bintz + * Johan Engelen + * Jon A. Cruz + * Abhishek Sharma + * + * Copyright (C) 2007 Jon A. Cruz + * Copyright (C) 2006-2008 Johan Engelen + * Copyright (C) 2006 John Bintz + * Copyright (C) 2004 MenTaLguY + * Copyright (C) 1999-2002 Lauris Kaplinski + * Copyright (C) 2000-2001 Ximian, Inc. + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "document.h" +#include "layer-fns.h" +#include "layer-model.h" +#include "object-hierarchy.h" +#include "sp-defs.h" +#include "sp-item.h" +#include "sp-item-group.h" +#include "sp-object.h" +#include "sp-root.h" +#include +#include +#include + +// Callbacks +static void _layer_activated(SPObject *layer, Inkscape::LayerModel *layer_model); +static void _layer_deactivated(SPObject *layer, Inkscape::LayerModel *layer_model); +static void _layer_changed(SPObject *top, SPObject *bottom, Inkscape::LayerModel *layer_model); + +namespace Inkscape { + +LayerModel::LayerModel() + : _doc( 0 ) + , _layer_hierarchy( 0 ) + , _display_key( 0 ) +{ +} + +LayerModel::~LayerModel() +{ + if (_layer_hierarchy) { + delete _layer_hierarchy; +// _layer_hierarchy = NULL; //this should be here, but commented to find other bug somewhere else. + } +} + +void LayerModel::setDocument(SPDocument *doc) +{ + _doc = doc; + if (_layer_hierarchy) { + _layer_hierarchy->clear(); + delete _layer_hierarchy; + } + _layer_hierarchy = new Inkscape::ObjectHierarchy(NULL); + _layer_hierarchy->connectAdded(sigc::bind(sigc::ptr_fun(_layer_activated), this)); + _layer_hierarchy->connectRemoved(sigc::bind(sigc::ptr_fun(_layer_deactivated), this)); + _layer_hierarchy->connectChanged(sigc::bind(sigc::ptr_fun(_layer_changed), this)); + _layer_hierarchy->setTop(doc->getRoot()); +} + +void LayerModel::setDisplayKey(unsigned int display_key) +{ + _display_key = display_key; +} + +SPDocument *LayerModel::getDocument() +{ + return _doc; +} + +/** + * Returns current root (=bottom) layer. + */ +SPObject *LayerModel::currentRoot() const +{ + return _layer_hierarchy ? _layer_hierarchy->top() : NULL; +} + +/** + * Returns current top layer. + */ +SPObject *LayerModel::currentLayer() const +{ + return _layer_hierarchy ? _layer_hierarchy->bottom() : NULL; +} + +/** + * Resets the bottom layer to the current root + */ +void LayerModel::reset() { + if (_layer_hierarchy) { + _layer_hierarchy->setBottom(currentRoot()); + } +} + +/** + * Sets the current layer of the desktop. + * + * Make \a object the top layer. + */ +void LayerModel::setCurrentLayer(SPObject *object) { + g_return_if_fail(SP_IS_GROUP(object)); + g_return_if_fail( currentRoot() == object || (currentRoot() && currentRoot()->isAncestorOf(object)) ); + // printf("Set Layer to ID: %s\n", object->getId()); + _layer_hierarchy->setBottom(object); +} + +void LayerModel::toggleHideAllLayers(bool hide) { + + for ( SPObject* obj = Inkscape::previous_layer(currentRoot(), currentRoot()); obj; obj = Inkscape::previous_layer(currentRoot(), obj) ) { + SP_ITEM(obj)->setHidden(hide); + } +} + +void LayerModel::toggleLockAllLayers(bool lock) { + + for ( SPObject* obj = Inkscape::previous_layer(currentRoot(), currentRoot()); obj; obj = Inkscape::previous_layer(currentRoot(), obj) ) { + SP_ITEM(obj)->setLocked(lock); + } +} + +void LayerModel::toggleLockOtherLayers(SPObject *object) { + g_return_if_fail(SP_IS_GROUP(object)); + g_return_if_fail( currentRoot() == object || (currentRoot() && currentRoot()->isAncestorOf(object)) ); + + bool othersLocked = false; + std::vector layers; + for ( SPObject* obj = Inkscape::next_layer(currentRoot(), object); obj; obj = Inkscape::next_layer(currentRoot(), obj) ) { + // Dont lock any ancestors, since that would in turn lock the layer as well + if (!obj->isAncestorOf(object)) { + layers.push_back(obj); + othersLocked |= !SP_ITEM(obj)->isLocked(); + } + } + for ( SPObject* obj = Inkscape::previous_layer(currentRoot(), object); obj; obj = Inkscape::previous_layer(currentRoot(), obj) ) { + if (!obj->isAncestorOf(object)) { + layers.push_back(obj); + othersLocked |= !SP_ITEM(obj)->isLocked(); + } + } + + SPItem *item = SP_ITEM(object); + if ( item->isLocked() ) { + item->setLocked(false); + } + + for ( std::vector::iterator it = layers.begin(); it != layers.end(); ++it ) { + SP_ITEM(*it)->setLocked(othersLocked); + } +} + + +void LayerModel::toggleLayerSolo(SPObject *object) { + g_return_if_fail(SP_IS_GROUP(object)); + g_return_if_fail( currentRoot() == object || (currentRoot() && currentRoot()->isAncestorOf(object)) ); + + bool othersShowing = false; + std::vector layers; + for ( SPObject* obj = Inkscape::next_layer(currentRoot(), object); obj; obj = Inkscape::next_layer(currentRoot(), obj) ) { + // Don't hide ancestors, since that would in turn hide the layer as well + if (!obj->isAncestorOf(object)) { + layers.push_back(obj); + othersShowing |= !SP_ITEM(obj)->isHidden(); + } + } + for ( SPObject* obj = Inkscape::previous_layer(currentRoot(), object); obj; obj = Inkscape::previous_layer(currentRoot(), obj) ) { + if (!obj->isAncestorOf(object)) { + layers.push_back(obj); + othersShowing |= !SP_ITEM(obj)->isHidden(); + } + } + + + SPItem *item = SP_ITEM(object); + if ( item->isHidden() ) { + item->setHidden(false); + } + + for ( std::vector::iterator it = layers.begin(); it != layers.end(); ++it ) { + SP_ITEM(*it)->setHidden(othersShowing); + } +} + +/** + * Return layer that contains \a object. + */ +SPObject *LayerModel::layerForObject(SPObject *object) { + g_return_val_if_fail(object != NULL, NULL); + + SPObject *root=currentRoot(); + object = object->parent; + while ( object && object != root && !isLayer(object) ) { + // Objects in defs have no layer and are NOT in the root layer + if(SP_IS_DEFS(object)) + return NULL; + object = object->parent; + } + return object; +} + +/** + * True if object is a layer. + */ +bool LayerModel::isLayer(SPObject *object) const { + return ( SP_IS_GROUP(object) + && ( SP_GROUP(object)->effectiveLayerMode(_display_key) + == SPGroup::LAYER ) ); +} + +} // namespace Inkscape + + +/// Callback +static void +_layer_activated(SPObject *layer, Inkscape::LayerModel *layer_model) { + g_return_if_fail(SP_IS_GROUP(layer)); + layer_model->_layer_activated_signal.emit(layer); +} + +/// Callback +static void +_layer_deactivated(SPObject *layer, Inkscape::LayerModel *layer_model) { + g_return_if_fail(SP_IS_GROUP(layer)); + layer_model->_layer_deactivated_signal.emit(layer); +} + +/// Callback +static void +_layer_changed(SPObject *top, SPObject *bottom, Inkscape::LayerModel *layer_model) +{ + layer_model->_layer_changed_signal.emit (top, bottom); +} + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/layer-model.h b/src/layer-model.h new file mode 100644 index 000000000..79b7fbe44 --- /dev/null +++ b/src/layer-model.h @@ -0,0 +1,104 @@ +#ifndef SEEN_INKSCAPE_LAYER_MODEL_H +#define SEEN_INKSCAPE_LAYER_MODEL_H + +/* + * Authors: + * Lauris Kaplinski + * Frank Felfe + * bulia byak + * Ralf Stephan + * John Bintz + * Johan Engelen + * Jon A. Cruz get + * Abhishek Sharma + * Eric Greveson + * + * Copyright (C) 2007 Johan Engelen + * Copyright (C) 2006 John Bintz + * Copyright (C) 1999-2013 authors + * Copyright (C) 2000-2001 Ximian, Inc. + * + * Released under GNU GPL, read the file 'COPYING' for more information + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +class SPDocument; +class SPObject; + +namespace Inkscape { + +class ObjectHierarchy; + +namespace XML { + class Node; +} + +/** + * The layer model for a document. + * + * This class represents the layer model for a document, typically (but + * not necessarily) displayed in an SPDesktop. + * + * It also implements its own asynchronous notification signals that + * UI elements can listen to. + */ +class LayerModel +{ + SPDocument *_doc; + Inkscape::ObjectHierarchy *_layer_hierarchy; + unsigned int _display_key; + +public: + /** Construct a layer model */ + LayerModel(); + + /** Destructor */ + ~LayerModel(); + + // Set document + void setDocument(SPDocument *doc); + + // Set display key. For GUI apps. + void setDisplayKey(unsigned int display_key); + + // Get the document that this layer model refers to. May be NULL. + SPDocument *getDocument(); + + // TODO look into making these return a more specific subclass: + SPObject *currentRoot() const; + SPObject *currentLayer() const; + + void reset(); + void setCurrentLayer(SPObject *object); + void toggleLayerSolo(SPObject *object); + void toggleHideAllLayers(bool hide); + void toggleLockAllLayers(bool lock); + void toggleLockOtherLayers(SPObject *object); + SPObject *layerForObject(SPObject *object); + bool isLayer(SPObject *object) const; + + sigc::signal _layer_activated_signal; + sigc::signal _layer_deactivated_signal; + sigc::signal _layer_changed_signal; +}; + +} // namespace Inkscape + +#endif +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : -- cgit v1.2.3 From 4847a7f261731ebbd9396d56c12244f721b006d7 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 1 Jul 2013 23:05:45 +0200 Subject: LPE bend path: fix crash on "uskeleton.cuts.back()" because of empty uskeleton. Fixed bugs: - https://launchpad.net/bugs/616198 (bzr r12398) --- src/live_effects/lpe-bendpath.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/live_effects/lpe-bendpath.cpp b/src/live_effects/lpe-bendpath.cpp index 49660c91b..eaf9fe4a6 100644 --- a/src/live_effects/lpe-bendpath.cpp +++ b/src/live_effects/lpe-bendpath.cpp @@ -94,6 +94,10 @@ LPEBendPath::doEffect_pwd2 (Geom::Piecewise > const & pwd bend_path.changed = false; } + if (uskeleton.empty()) { + return pwd2_in; /// \todo or throw an exception instead? might be better to throw an exception so that the UI can display an error message or smth + } + D2 > patternd2 = make_cuts_independent(pwd2_in); Piecewise x = vertical_pattern.get_value() ? Piecewise(patternd2[1]) : Piecewise(patternd2[0]); Piecewise y = vertical_pattern.get_value() ? Piecewise(patternd2[0]) : Piecewise(patternd2[1]); @@ -105,9 +109,9 @@ LPEBendPath::doEffect_pwd2 (Geom::Piecewise > const & pwd x-= bboxHorizontal.min(); y-= bboxVertical.middle(); - double scaling = uskeleton.cuts.back()/bboxHorizontal.extent(); + double scaling = uskeleton.cuts.back()/bboxHorizontal.extent(); - if (scaling != 1.0) { + if (scaling != 1.0) { x*=scaling; } @@ -117,7 +121,6 @@ LPEBendPath::doEffect_pwd2 (Geom::Piecewise > const & pwd if (prop_scale != 1.0) y *= prop_scale; } - Piecewise > output = compose(uskeleton,x) + y*compose(n,x); return output; } -- cgit v1.2.3 From 2a53d44964f9105ce0f9c8725853150dc5360096 Mon Sep 17 00:00:00 2001 From: Eric Greveson Date: Mon, 1 Jul 2013 22:27:23 +0100 Subject: Added error messages when attempting to use verbs requiring GUI in console (--without-gui) mode. (bzr r12387.1.3) --- src/extension/effect.cpp | 5 ++- src/verbs.cpp | 83 ++++++++++++++++++++++++++++++++++++++++-------- src/verbs.h | 5 +++ 3 files changed, 78 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp index 22c5e4989..93b1bb91d 100644 --- a/src/extension/effect.cpp +++ b/src/extension/effect.cpp @@ -369,12 +369,15 @@ void Effect::EffectVerb::perform( SPAction *action, void * data ) { Inkscape::UI::View::View * current_view = sp_action_get_view(action); + if (current_view == NULL) { + show_gui_required_message(action); + return; + } // SPDocument * current_document = current_view->doc; Effect::EffectVerb * ev = reinterpret_cast(data); Effect * effect = ev->_effect; if (effect == NULL) return; - if (current_view == NULL) return; if (ev->_showPrefs) { effect->prefs(current_view); diff --git a/src/verbs.cpp b/src/verbs.cpp index 4bbd3f9df..979267215 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -626,6 +626,12 @@ SPAction *Verb::get_action(Inkscape::ActionContext const & context) return action; } +/* static */ +void Verb::show_gui_required_message(SPAction *action) +{ + g_printerr("WARNING: ignoring verb %s - GUI required for this verb.\n", action->id); +} + void Verb::sensitive(SPDocument *in_doc, bool in_sensitive) { // printf("Setting sensitivity of \"%s\" to %d\n", _name, in_sensitive); @@ -807,7 +813,11 @@ void FileVerb::perform(SPAction *action, void *data) #endif SPDesktop *desktop = dynamic_cast(sp_action_get_view(action)); - g_assert(desktop != NULL); + if (desktop == NULL) { + show_gui_required_message(action); + return; + } + Gtk::Window *parent = desktop->getToplevel(); g_assert(parent != NULL); @@ -873,8 +883,10 @@ void FileVerb::perform(SPAction *action, void *data) void EditVerb::perform(SPAction *action, void *data) { SPDesktop *dt = static_cast(sp_action_get_view(action)); - if (!dt) + if (dt == NULL) { + show_gui_required_message(action); return; + } switch (reinterpret_cast(data)) { case SP_VERB_EDIT_UNDO: @@ -1037,6 +1049,7 @@ void SelectionVerb::perform(SPAction *action, void *data) return; } + bool handled = true; switch (reinterpret_cast(data)) { case SP_VERB_SELECTION_UNION: sp_selected_path_union(selection, dt); @@ -1057,12 +1070,19 @@ void SelectionVerb::perform(SPAction *action, void *data) sp_selected_path_slice(selection, dt); break; default: + handled = false; break; } + if (handled) { + return; + } + // The remaining operations require a desktop - if (!dt) + if (dt == NULL) { + show_gui_required_message(action); return; + } g_assert(dt->_dlg_mgr != NULL); @@ -1162,8 +1182,12 @@ void LayerVerb::perform(SPAction *action, void *data) { SPDesktop *dt = static_cast(sp_action_get_view(action)); size_t verb = reinterpret_cast(data); - - if ( !dt || !dt->currentLayer() ) { + + if (dt == NULL) { + show_gui_required_message(action); + return; + } + if ( !dt->currentLayer() ) { return; } @@ -1412,8 +1436,10 @@ void LayerVerb::perform(SPAction *action, void *data) void ObjectVerb::perform( SPAction *action, void *data) { SPDesktop *dt = static_cast(sp_action_get_view(action)); - if (!dt) + if (dt == NULL) { + show_gui_required_message(action); return; + } SPEventContext *ec = dt->event_context; @@ -1500,9 +1526,11 @@ void ContextVerb::perform(SPAction *action, void *data) int vidx; dt = static_cast(sp_action_get_view(action)); - - if (!dt) + + if (dt == NULL) { + show_gui_required_message(action); return; + } verb = (sp_verb_t)GPOINTER_TO_INT((gpointer)data); @@ -1701,8 +1729,10 @@ void ContextVerb::perform(SPAction *action, void *data) void TextVerb::perform(SPAction *action, void */*data*/) { SPDesktop *dt = static_cast(sp_action_get_view(action)); - if (!dt) + if (dt == NULL) { + show_gui_required_message(action); return; + } SPDocument *doc = sp_desktop_document(dt); (void)doc; @@ -1716,8 +1746,10 @@ void TextVerb::perform(SPAction *action, void */*data*/) void ZoomVerb::perform(SPAction *action, void *data) { SPDesktop *dt = static_cast(sp_action_get_view(action)); - if (!dt) + if (dt == NULL) { + show_gui_required_message(action); return; + } SPEventContext *ec = dt->event_context; SPDocument *doc = sp_desktop_document(dt); @@ -1906,6 +1938,10 @@ void DialogVerb::perform(SPAction *action, void *data) } SPDesktop *dt = static_cast(sp_action_get_view(action)); + if (dt == NULL) { + show_gui_required_message(action); + return; + } g_assert(dt->_dlg_mgr != NULL); switch (reinterpret_cast(data)) { @@ -2018,6 +2054,10 @@ void DialogVerb::perform(SPAction *action, void *data) void HelpVerb::perform(SPAction *action, void *data) { SPDesktop *dt = static_cast(sp_action_get_view(action)); + if (dt == NULL) { + show_gui_required_message(action); + return; + } g_assert(dt->_dlg_mgr != NULL); switch (reinterpret_cast(data)) { @@ -2050,8 +2090,12 @@ void HelpVerb::perform(SPAction *action, void *data) /** * Decode the verb code and take appropriate action. */ -void TutorialVerb::perform(SPAction */*action*/, void *data) +void TutorialVerb::perform(SPAction *action, void *data) { + if (sp_action_get_view(action) == NULL) { + show_gui_required_message(action); + return; + } switch (reinterpret_cast(data)) { case SP_VERB_TUTORIAL_BASIC: // TRANSLATORS: If you have translated the tutorial-basic.en.svgz file to your language, @@ -2136,11 +2180,14 @@ void EffectLastVerb::perform(SPAction *action, void *data) // These aren't used, but are here to remind people not to use // the CURRENT_DOCUMENT macros unless they really have to. Inkscape::UI::View::View *current_view = sp_action_get_view(action); + if (current_view == NULL) { + show_gui_required_message(action); + return; + } // SPDocument *current_document = SP_VIEW_DOCUMENT(current_view); Inkscape::Extension::Effect *effect = Inkscape::Extension::Effect::get_last_effect(); if (effect == NULL) return; - if (current_view == NULL) return; switch (reinterpret_cast(data)) { case SP_VERB_EFFECT_LAST_PREF: @@ -2200,7 +2247,11 @@ SPAction *FitCanvasVerb::make_action(Inkscape::ActionContext const & context) void FitCanvasVerb::perform(SPAction *action, void *data) { SPDesktop *dt = static_cast(sp_action_get_view(action)); - if (!dt) return; + if (dt == NULL) { + show_gui_required_message(action); + return; + } + SPDocument *doc = sp_desktop_document(dt); if (!doc) return; @@ -2266,7 +2317,11 @@ SPAction *LockAndHideVerb::make_action(Inkscape::ActionContext const & context) void LockAndHideVerb::perform(SPAction *action, void *data) { SPDesktop *dt = static_cast(sp_action_get_view(action)); - if (!dt) return; + if (dt == NULL) { + show_gui_required_message(action); + return; + } + SPDocument *doc = sp_desktop_document(dt); if (!doc) return; diff --git a/src/verbs.h b/src/verbs.h index 35165822a..dd58134dd 100644 --- a/src/verbs.h +++ b/src/verbs.h @@ -550,6 +550,11 @@ public: } } static Verb * getbyid (gchar const * id); + + /** + * Print a message to stderr indicating that this verb needs a GUI to run + */ + static void show_gui_required_message(SPAction *action); static void delete_all_view (Inkscape::UI::View::View * view); void delete_view (Inkscape::UI::View::View * view); -- cgit v1.2.3 From ced7761e69301a40944684fd295a04ea9e736c24 Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Mon, 1 Jul 2013 17:51:53 -0400 Subject: Shape calculations. do not quantize the coordinates. (Bug 168158) Fixed bugs: - https://launchpad.net/bugs/168158 (bzr r12399) --- src/livarot/Shape.cpp | 8 ++++---- src/livarot/Shape.h | 8 ++++---- src/livarot/ShapeMisc.cpp | 12 ++++++------ src/livarot/ShapeSweep.cpp | 8 ++++---- 4 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/livarot/Shape.cpp b/src/livarot/Shape.cpp index c29444a33..130b1b03a 100644 --- a/src/livarot/Shape.cpp +++ b/src/livarot/Shape.cpp @@ -334,8 +334,8 @@ Shape::AddPoint (const Geom::Point x) pData[n].nextLinkedPoint = -1; pData[n].askForWindingS = NULL; pData[n].askForWindingB = -1; - pData[n].rx[0] = Round(p.x[0]); - pData[n].rx[1] = Round(p.x[1]); + pData[n].rx[0] = /*Round*/ (p.x[0]); + pData[n].rx[1] = /*Round*/ (p.x[1]); } if (_has_voronoi_data) { @@ -2116,8 +2116,8 @@ void Shape::initialisePointData() pData[i].pending = 0; pData[i].edgeOnLeft = -1; pData[i].nextLinkedPoint = -1; - pData[i].rx[0] = Round(getPoint(i).x[0]); - pData[i].rx[1] = Round(getPoint(i).x[1]); + pData[i].rx[0] = /*Round*/ (getPoint(i).x[0]); + pData[i].rx[1] = /*Round*/ (getPoint(i).x[1]); } _point_data_initialised = true; diff --git a/src/livarot/Shape.h b/src/livarot/Shape.h index dcd172da2..b999b9dca 100644 --- a/src/livarot/Shape.h +++ b/src/livarot/Shape.h @@ -266,10 +266,10 @@ public: // be careful when using this function // the coordinate rounding function - inline static double Round(double x) - { - return ldexp(rint(ldexp(x, 5)), -5); - } +// inline static double Round(double x) +// { +// return ldexp(rint(ldexp(x, 5)), -5); +// } // 2 miscannellous variations on it, to scale to and back the rounding grid inline static double HalfRound(double x) diff --git a/src/livarot/ShapeMisc.cpp b/src/livarot/ShapeMisc.cpp index 6fd40790f..5bb8a25ef 100644 --- a/src/livarot/ShapeMisc.cpp +++ b/src/livarot/ShapeMisc.cpp @@ -49,8 +49,8 @@ Shape::ConvertToForme (Path * dest) for (int i = 0; i < numberOfPoints(); i++) { - pData[i].rx[0] = Round (getPoint(i).x[0]); - pData[i].rx[1] = Round (getPoint(i).x[1]); + pData[i].rx[0] = /*Round*/ (getPoint(i).x[0]); + pData[i].rx[1] = /*Round*/ (getPoint(i).x[1]); } for (int i = 0; i < numberOfEdges(); i++) { @@ -199,8 +199,8 @@ Shape::ConvertToForme (Path * dest, int nbP, Path * *orig, bool splitWhenForced) for (int i = 0; i < numberOfPoints(); i++) { - pData[i].rx[0] = Round (getPoint(i).x[0]); - pData[i].rx[1] = Round (getPoint(i).x[1]); + pData[i].rx[0] = /*Round*/ (getPoint(i).x[0]); + pData[i].rx[1] = /*Round*/ (getPoint(i).x[1]); } for (int i = 0; i < numberOfEdges(); i++) { @@ -352,8 +352,8 @@ Shape::ConvertToFormeNested (Path * dest, int nbP, Path * *orig, int wildPath,in for (int i = 0; i < numberOfPoints(); i++) { - pData[i].rx[0] = Round (getPoint(i).x[0]); - pData[i].rx[1] = Round (getPoint(i).x[1]); + pData[i].rx[0] = /*Round*/ (getPoint(i).x[0]); + pData[i].rx[1] = /*Round*/ (getPoint(i).x[1]); } for (int i = 0; i < numberOfEdges(); i++) { diff --git a/src/livarot/ShapeSweep.cpp b/src/livarot/ShapeSweep.cpp index c2fd83e31..ffe5a9d73 100644 --- a/src/livarot/ShapeSweep.cpp +++ b/src/livarot/ShapeSweep.cpp @@ -250,8 +250,8 @@ Shape::ConvertToShape (Shape * a, FillRule directed, bool invert) } Geom::Point rPtX; - rPtX[0]= Round (ptX[0]); - rPtX[1]= Round (ptX[1]); + rPtX[0]= /*Round*/ (ptX[0]); + rPtX[1]= /*Round*/ (ptX[1]); int lastPointNo = -1; lastPointNo = AddPoint (rPtX); pData[lastPointNo].rx = rPtX; @@ -1051,8 +1051,8 @@ Shape::Booleen (Shape * a, Shape * b, BooleanOp mod,int cutPathID) } Geom::Point rPtX; - rPtX[0]= Round (ptX[0]); - rPtX[1]= Round (ptX[1]); + rPtX[0]= /*Round*/ (ptX[0]); + rPtX[1]= /*Round*/ (ptX[1]); int lastPointNo = -1; lastPointNo = AddPoint (rPtX); pData[lastPointNo].rx = rPtX; -- cgit v1.2.3 From 4d9cb756267d624666ae792d621a255f4b209657 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Mon, 1 Jul 2013 22:23:13 -0400 Subject: Refactor resize, rotate, skew handle code (bzr r12400) --- src/seltrans-handles.cpp | 52 +++++---- src/seltrans-handles.h | 42 +++---- src/seltrans.cpp | 287 +++++++++++++++++------------------------------ src/seltrans.h | 13 ++- 4 files changed, 157 insertions(+), 237 deletions(-) (limited to 'src') diff --git a/src/seltrans-handles.cpp b/src/seltrans-handles.cpp index fc03789d6..cc11125f6 100644 --- a/src/seltrans-handles.cpp +++ b/src/seltrans-handles.cpp @@ -1,33 +1,39 @@ #include "seltrans-handles.h" +#ifdef __cplusplus +#undef N_ +#define N_(x) x +#endif -SPSelTransHandle const handles_scale[] = { -//anchor cursor control action request x y - {SP_ANCHOR_SE, GDK_TOP_LEFT_CORNER, 0, sp_sel_trans_scale, sp_sel_trans_scale_request, 0, 1}, - {SP_ANCHOR_S, GDK_TOP_SIDE, 3, sp_sel_trans_stretch, sp_sel_trans_stretch_request, 0.5, 1}, - {SP_ANCHOR_SW, GDK_TOP_RIGHT_CORNER, 1, sp_sel_trans_scale, sp_sel_trans_scale_request, 1, 1}, - {SP_ANCHOR_W, GDK_RIGHT_SIDE, 2, sp_sel_trans_stretch, sp_sel_trans_stretch_request, 1, 0.5}, - {SP_ANCHOR_NW, GDK_BOTTOM_RIGHT_CORNER, 0, sp_sel_trans_scale, sp_sel_trans_scale_request, 1, 0}, - {SP_ANCHOR_N, GDK_BOTTOM_SIDE, 3, sp_sel_trans_stretch, sp_sel_trans_stretch_request, 0.5, 0}, - {SP_ANCHOR_NE, GDK_BOTTOM_LEFT_CORNER, 1, sp_sel_trans_scale, sp_sel_trans_scale_request, 0, 0}, - {SP_ANCHOR_E, GDK_LEFT_SIDE, 2, sp_sel_trans_stretch, sp_sel_trans_stretch_request, 0, 0.5} +SPSelTransTypeInfo const handtypes[] = { + {N_("Squeeze or stretch selection; with Ctrl to scale uniformly; with Shift to scale around rotation center") }, + {N_("Scale selection; with Ctrl to scale uniformly; with Shift to scale around rotation center") }, + {N_("Skew selection; with Ctrl to snap angle; with Shift to skew around the opposite side") }, + {N_("Rotate selection; with Ctrl to snap angle; with Shift to rotate around the opposite corner") }, + {N_("Center of rotation and skewing: drag to reposition; scaling with Shift also uses this center") } }; -SPSelTransHandle const handles_rotate[] = { - {SP_ANCHOR_SE, GDK_EXCHANGE, 4, sp_sel_trans_rotate, sp_sel_trans_rotate_request, 0, 1}, - {SP_ANCHOR_S, GDK_SB_H_DOUBLE_ARROW, 5, sp_sel_trans_skew, sp_sel_trans_skew_request, 0.5, 1}, - {SP_ANCHOR_SW, GDK_EXCHANGE, 6, sp_sel_trans_rotate, sp_sel_trans_rotate_request, 1, 1}, - {SP_ANCHOR_W, GDK_SB_V_DOUBLE_ARROW, 7, sp_sel_trans_skew, sp_sel_trans_skew_request, 1, 0.5}, - {SP_ANCHOR_NW, GDK_EXCHANGE, 8, sp_sel_trans_rotate, sp_sel_trans_rotate_request, 1, 0}, - {SP_ANCHOR_N, GDK_SB_H_DOUBLE_ARROW, 9, sp_sel_trans_skew, sp_sel_trans_skew_request, 0.5, 0}, - {SP_ANCHOR_NE, GDK_EXCHANGE, 10, sp_sel_trans_rotate, sp_sel_trans_rotate_request, 0, 0}, - {SP_ANCHOR_E, GDK_SB_V_DOUBLE_ARROW, 11, sp_sel_trans_skew, sp_sel_trans_skew_request, 0, 0.5} +SPSelTransHandle const hands[] = { +//handle-type anchor cursor control x y + {HANDLE_STRETCH, SP_ANCHOR_S, GDK_TOP_SIDE, 3, 0.5, 1}, + {HANDLE_STRETCH, SP_ANCHOR_W, GDK_RIGHT_SIDE, 2, 1, 0.5}, + {HANDLE_STRETCH, SP_ANCHOR_N, GDK_BOTTOM_SIDE, 3, 0.5, 0}, + {HANDLE_STRETCH, SP_ANCHOR_E, GDK_LEFT_SIDE, 2, 0, 0.5}, + {HANDLE_SCALE, SP_ANCHOR_SE, GDK_TOP_LEFT_CORNER, 0, 0, 1}, + {HANDLE_SCALE, SP_ANCHOR_SW, GDK_TOP_RIGHT_CORNER, 1, 1, 1}, + {HANDLE_SCALE, SP_ANCHOR_NW, GDK_BOTTOM_RIGHT_CORNER, 0, 1, 0}, + {HANDLE_SCALE, SP_ANCHOR_NE, GDK_BOTTOM_LEFT_CORNER, 1, 0, 0}, + {HANDLE_SKEW, SP_ANCHOR_S, GDK_SB_H_DOUBLE_ARROW, 5, 0.5, 1}, + {HANDLE_SKEW, SP_ANCHOR_W, GDK_SB_V_DOUBLE_ARROW, 7, 1, 0.5}, + {HANDLE_SKEW, SP_ANCHOR_N, GDK_SB_H_DOUBLE_ARROW, 9, 0.5, 0}, + {HANDLE_SKEW, SP_ANCHOR_E, GDK_SB_V_DOUBLE_ARROW, 11, 0, 0.5}, + {HANDLE_ROTATE, SP_ANCHOR_SE, GDK_EXCHANGE, 4, 0, 1}, + {HANDLE_ROTATE, SP_ANCHOR_SW, GDK_EXCHANGE, 6, 1, 1}, + {HANDLE_ROTATE, SP_ANCHOR_NW, GDK_EXCHANGE, 8, 1, 0}, + {HANDLE_ROTATE, SP_ANCHOR_NE, GDK_EXCHANGE, 10, 0, 0}, + {HANDLE_CENTER, SP_ANCHOR_CENTER, GDK_CROSSHAIR, 12, 0.5, 0.5} }; -SPSelTransHandle const handle_center = - {SP_ANCHOR_CENTER, GDK_CROSSHAIR, 12, sp_sel_trans_center, sp_sel_trans_center_request, 0.5, 0.5}; - - /* Local Variables: mode:c++ diff --git a/src/seltrans-handles.h b/src/seltrans-handles.h index 14f50d784..ef285392b 100644 --- a/src/seltrans-handles.h +++ b/src/seltrans-handles.h @@ -21,40 +21,32 @@ namespace Inkscape class SelTrans; } -struct SPSelTransHandle; +enum SPSelTransType { + HANDLE_STRETCH, + HANDLE_SCALE, + HANDLE_SKEW, + HANDLE_ROTATE, + HANDLE_CENTER +}; -// request handlers -gboolean sp_sel_trans_scale_request(Inkscape::SelTrans *seltrans, - SPSelTransHandle const &handle, Geom::Point &p, guint state); -gboolean sp_sel_trans_stretch_request(Inkscape::SelTrans *seltrans, - SPSelTransHandle const &handle, Geom::Point &p, guint state); -gboolean sp_sel_trans_skew_request(Inkscape::SelTrans *seltrans, - SPSelTransHandle const &handle, Geom::Point &p, guint state); -gboolean sp_sel_trans_rotate_request(Inkscape::SelTrans *seltrans, - SPSelTransHandle const &handle, Geom::Point &p, guint state); -gboolean sp_sel_trans_center_request(Inkscape::SelTrans *seltrans, - SPSelTransHandle const &handle, Geom::Point &p, guint state); +struct SPSelTransTypeInfo { + gchar const *tip; +}; +// One per handle type in order +extern SPSelTransTypeInfo const handtypes[5]; -// action handlers -void sp_sel_trans_scale(Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, Geom::Point &p, guint state); -void sp_sel_trans_stretch(Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, Geom::Point &p, guint state); -void sp_sel_trans_skew(Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, Geom::Point &p, guint state); -void sp_sel_trans_rotate(Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, Geom::Point &p, guint state); -void sp_sel_trans_center(Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, Geom::Point &p, guint state); +struct SPSelTransHandle; struct SPSelTransHandle { + SPSelTransType type; SPAnchorType anchor; GdkCursorType cursor; guint control; - void (* action) (Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, Geom::Point &p, guint state); - gboolean (* request) (Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, Geom::Point &p, guint state); gdouble x, y; }; - -// TODO these must be purged: -extern SPSelTransHandle const handles_scale[8]; -extern SPSelTransHandle const handles_rotate[8]; -extern SPSelTransHandle const handle_center; +// These are 4 * each handle type + 1 for center +int const NUMHANDS = 17; +extern SPSelTransHandle const hands[17]; #endif // SEEN_SP_SELTRANS_HANDLES_H diff --git a/src/seltrans.cpp b/src/seltrans.cpp index 84c73e452..016eba816 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -48,12 +48,11 @@ #include <2geom/angle.h> #include "display/snap-indicator.h" #include "ui/control-manager.h" +#include "seltrans-handles.h" using Inkscape::ControlManager; using Inkscape::DocumentUndo; -static void sp_remove_handles(SPKnot *knot[], gint num); - static void sp_sel_trans_handle_grab(SPKnot *knot, guint state, gpointer data); static void sp_sel_trans_handle_ungrab(SPKnot *knot, guint state, gpointer data); static void sp_sel_trans_handle_click(SPKnot *knot, guint state, gpointer data); @@ -62,7 +61,7 @@ static gboolean sp_sel_trans_handle_request(SPKnot *knot, Geom::Point *p, guint extern GdkPixbuf *handles[]; -static gboolean sp_seltrans_handle_event(SPKnot *knot, GdkEvent *event, gpointer) +static gboolean sp_sel_trans_handle_event(SPKnot *knot, GdkEvent *event, gpointer) { switch (event->type) { case GDK_MOTION_NOTIFY: @@ -112,7 +111,6 @@ Inkscape::SelTrans::SelTrans(SPDesktop *desktop) : _opposite_for_bboxpoints(Geom::Point(0,0)), _origin_for_specpoints(Geom::Point(0,0)), _origin_for_bboxpoints(Geom::Point(0,0)), - _chandle(NULL), _stamp_cache(NULL), _message_context(desktop->messageStack()), _bounding_box_prefs_observer(*this) @@ -124,16 +122,12 @@ Inkscape::SelTrans::SelTrans(SPDesktop *desktop) : g_return_if_fail(desktop != NULL); - for (int i = 0; i < 8; i++) { - _shandle[i] = NULL; - _rhandle[i] = NULL; - } - _updateVolatileState(); _current_relative_affine.setIdentity(); _center_is_set = false; // reread _center from items, or set to bbox midpoint + _makeHandles(); _updateHandles(); _selection = sp_desktop_selection(desktop); @@ -190,19 +184,9 @@ Inkscape::SelTrans::~SelTrans() _sel_changed_connection.disconnect(); _sel_modified_connection.disconnect(); - for (unsigned int i = 0; i < 8; i++) { - if (_shandle[i]) { - g_object_unref(G_OBJECT(_shandle[i])); - _shandle[i] = NULL; - } - if (_rhandle[i]) { - g_object_unref(G_OBJECT(_rhandle[i])); - _rhandle[i] = NULL; - } - } - if (_chandle) { - g_object_unref(G_OBJECT(_chandle)); - _chandle = NULL; + for (int i = 0; i < NUMHANDS; i++) { + g_object_unref(G_OBJECT(knots[i])); + knots[i] = NULL; } if (_norm) { @@ -584,13 +568,11 @@ void Inkscape::SelTrans::stamp() void Inkscape::SelTrans::_updateHandles() { + for (int i = 0; i < NUMHANDS; i++) + sp_knot_hide(knots[i]); + if ( !_show_handles || _empty ) - { - sp_remove_handles(_shandle, 8); - sp_remove_handles(_rhandle, 8); - sp_remove_handles(&_chandle, 1); return; - } if (!_center_is_set) { _center = _desktop->selection->center(); @@ -598,57 +580,12 @@ void Inkscape::SelTrans::_updateHandles() } if ( _state == STATE_SCALE ) { - sp_remove_handles(_rhandle, 8); - sp_remove_handles(&_chandle, 1); - _showHandles(_shandle, handles_scale, 8, - _("Squeeze or stretch selection; with Ctrl to scale uniformly; with Shift to scale around rotation center"), - _("Scale selection; with Ctrl to scale uniformly; with Shift to scale around rotation center")); + _showHandles(HANDLE_STRETCH); + _showHandles(HANDLE_SCALE); } else { - sp_remove_handles(_shandle, 8); - _showHandles(_rhandle, handles_rotate, 8, - _("Skew selection; with Ctrl to snap angle; with Shift to skew around the opposite side"), - _("Rotate selection; with Ctrl to snap angle; with Shift to rotate around the opposite corner")); - // center handle - /* Assuming that the center handle is in its default position, ie. in the center: - * Multiple handles will be shown, for rotating, skewing and the center handle. For straight lines, the bounding box of the center handle will be - * fully overlapped by bounding boxes of two of the skew handles. Due to the internals of sp_canvas_group_point, the center handle must be the - * last handle in the SPCanvasGroup if it is to be selectable in such a case. So we have made sure here that the center handle is added to the - * group after the rotation handles (determined by the chronological order of sp_knot_new() calls) - * Now when the center handle is in still in the center, the skew handles can be selected because because the bounding box of the - * center handle does not fully overlap the bounding box of either of the skew handles. However, if the center handle has been moved such that it - * covers one of the other eight handles, then either the opposite handle has to be used (in case of rotating), or the center handle has to be moved. - * Although this is annoying, this is still better than not being able to select the center handle at all - */ - if ( _chandle == NULL ) { - _chandle = sp_knot_new(_desktop, _("Center of rotation and skewing: drag to reposition; scaling with Shift also uses this center")); - - _chandle->setShape (SP_CTRL_SHAPE_BITMAP); - _chandle->setSize (13); - _chandle->setAnchor (handle_center.anchor); - _chandle->setMode (SP_CTRL_MODE_XOR); - _chandle->setFill(0x00000000, 0x00000000, 0x00000000); - _chandle->setStroke(0x000000ff, 0xff0000b0, 0xff0000b0); - _chandle->setPixbuf(handles[handle_center.control]); - sp_knot_update_ctrl(_chandle); - - g_signal_connect(G_OBJECT(_chandle), "request", - G_CALLBACK(sp_sel_trans_handle_request), (gpointer) &handle_center); - g_signal_connect(G_OBJECT(_chandle), "moved", - G_CALLBACK(sp_sel_trans_handle_new_event), (gpointer) &handle_center); - g_signal_connect(G_OBJECT(_chandle), "grabbed", - G_CALLBACK(sp_sel_trans_handle_grab), (gpointer) &handle_center); - g_signal_connect(G_OBJECT(_chandle), "ungrabbed", - G_CALLBACK(sp_sel_trans_handle_ungrab), (gpointer) &handle_center); - g_signal_connect(G_OBJECT(_chandle), "clicked", - G_CALLBACK(sp_sel_trans_handle_click), (gpointer) &handle_center); - } - - if ( _center ) { - sp_knot_show(_chandle); - sp_knot_moveto(_chandle, *_center); - } else { - sp_remove_handles(&_chandle, 1); - } + _showHandles(HANDLE_SKEW); + _showHandles(HANDLE_ROTATE); + _showHandles(HANDLE_CENTER); } } @@ -673,53 +610,60 @@ void Inkscape::SelTrans::_updateVolatileState() _strokewidth = stroke_average_width (selection->itemList()); } -static void sp_remove_handles(SPKnot *knot[], gint num) +void Inkscape::SelTrans::_showHandles(SPSelTransType type) { - for (int i = 0; i < num; i++) { - if (knot[i] != NULL) { - sp_knot_hide(knot[i]); - } + // shouldn't have nullary bbox, but knots + g_assert(_bbox); + + for (int i = 0; i < NUMHANDS; i++) { + if (hands[i].type != type) + continue; + + // Position knots to scale the selection bbox + Geom::Point const bpos(hands[i].x, hands[i].y); + Geom::Point p(_bbox->min() + (_bbox->dimensions() * Geom::Scale(bpos))); + sp_knot_moveto(knots[i], p); + sp_knot_show(knots[i]); + + // This controls the center handle's position, because the default can + // be moved and needs to be remembered. + if( type == HANDLE_CENTER && _center ) + sp_knot_moveto(knots[i], *_center); } } -void Inkscape::SelTrans::_showHandles(SPKnot *knot[], SPSelTransHandle const handle[], gint num, - gchar const *even_tip, gchar const *odd_tip) +void Inkscape::SelTrans::_makeHandles() { - g_return_if_fail( !_empty ); - - for (int i = 0; i < num; i++) { - if (knot[i] == NULL) { - knot[i] = sp_knot_new(_desktop, i % 2 ? even_tip : odd_tip); - - knot[i]->setShape (SP_CTRL_SHAPE_BITMAP); - knot[i]->setSize (13); - knot[i]->setAnchor (handle[i].anchor); - knot[i]->setMode (SP_CTRL_MODE_XOR); - knot[i]->setFill(0x000000ff, 0x00ff6600, 0x00ff6600); // inversion, green, green - knot[i]->setStroke(0x000000ff, 0x000000ff, 0x000000ff); // inversion - knot[i]->setPixbuf(handles[handle[i].control]); - sp_knot_update_ctrl(knot[i]); - - g_signal_connect(G_OBJECT(knot[i]), "request", - G_CALLBACK(sp_sel_trans_handle_request), (gpointer) &handle[i]); - g_signal_connect(G_OBJECT(knot[i]), "moved", - G_CALLBACK(sp_sel_trans_handle_new_event), (gpointer) &handle[i]); - g_signal_connect(G_OBJECT(knot[i]), "grabbed", - G_CALLBACK(sp_sel_trans_handle_grab), (gpointer) &handle[i]); - g_signal_connect(G_OBJECT(knot[i]), "ungrabbed", - G_CALLBACK(sp_sel_trans_handle_ungrab), (gpointer) &handle[i]); - g_signal_connect(G_OBJECT(knot[i]), "event", G_CALLBACK(sp_seltrans_handle_event), (gpointer) &handle[i]); + for (int i = 0; i < NUMHANDS; i++) { + knots[i] = sp_knot_new(_desktop, handtypes[hands[i].type].tip); + + knots[i]->setShape(SP_CTRL_SHAPE_BITMAP); + knots[i]->setSize(13); + knots[i]->setAnchor(hands[i].anchor); + knots[i]->setMode(SP_CTRL_MODE_XOR); + knots[i]->setFill(0x000000ff, 0x00ff6600, 0x00ff6600); // invert+2*green + knots[i]->setStroke(0x000000ff, 0x000000ff, 0x000000ff); // 3*invert + knots[i]->setPixbuf(handles[hands[i].control]); + sp_knot_update_ctrl(knots[i]); + + if( hands[i].type == HANDLE_CENTER ) { + _center_handle = i; + knots[i]->setFill(0x00000000, 0x00000000, 0x00000000); + knots[i]->setStroke(0x000000ff, 0xff0000b0, 0xff0000b0); } - sp_knot_show(knot[i]); - - Geom::Point const handle_pt(handle[i].x, handle[i].y); - // shouldn't have nullary bbox, but knots - g_assert(_bbox); - Geom::Point p( _bbox->min() - + ( _bbox->dimensions() - * Geom::Scale(handle_pt) ) ); - sp_knot_moveto(knot[i], p); + g_signal_connect(G_OBJECT(knots[i]), "request", + G_CALLBACK(sp_sel_trans_handle_request), (gpointer) &hands[i]); + g_signal_connect(G_OBJECT(knots[i]), "moved", + G_CALLBACK(sp_sel_trans_handle_new_event), (gpointer) &hands[i]); + g_signal_connect(G_OBJECT(knots[i]), "grabbed", + G_CALLBACK(sp_sel_trans_handle_grab), (gpointer) &hands[i]); + g_signal_connect(G_OBJECT(knots[i]), "ungrabbed", + G_CALLBACK(sp_sel_trans_handle_ungrab), (gpointer) &hands[i]); + g_signal_connect(G_OBJECT(knots[i]), "clicked", + G_CALLBACK(sp_sel_trans_handle_click), (gpointer) &hands[i]); + g_signal_connect(G_OBJECT(knots[i]), "event", + G_CALLBACK(sp_sel_trans_handle_event), (gpointer) &hands[i]); } } @@ -758,8 +702,8 @@ static void sp_sel_trans_handle_click(SPKnot *knot, guint state, gpointer data) void Inkscape::SelTrans::handleClick(SPKnot */*knot*/, guint state, SPSelTransHandle const &handle) { - switch (handle.anchor) { - case SP_ANCHOR_CENTER: + switch (handle.type) { + case HANDLE_CENTER: if (state & GDK_SHIFT_MASK) { // Unset the center position for all selected items for (GSList const *l = _desktop->selection->itemList(); l; l = l->next) { @@ -780,8 +724,8 @@ void Inkscape::SelTrans::handleClick(SPKnot */*knot*/, guint state, SPSelTransHa void Inkscape::SelTrans::handleGrab(SPKnot *knot, guint /*state*/, SPSelTransHandle const &handle) { - switch (handle.anchor) { - case SP_ANCHOR_CENTER: + switch (handle.type) { + case HANDLE_CENTER: g_object_set(G_OBJECT(_grip), "shape", SP_CTRL_SHAPE_BITMAP, "size", 13.0, @@ -795,7 +739,6 @@ void Inkscape::SelTrans::handleGrab(SPKnot *knot, guint /*state*/, SPSelTransHan NULL); sp_canvas_item_show(_norm); sp_canvas_item_show(_grip); - break; } @@ -816,21 +759,35 @@ void Inkscape::SelTrans::handleNewEvent(SPKnot *knot, Geom::Point *position, gui return; } } - - handle.action(this, handle, *position, state); + switch (handle.type) { + case HANDLE_SCALE: + scale(*position, state); + break; + case HANDLE_STRETCH: + stretch(handle, *position, state); + break; + case HANDLE_SKEW: + skew(handle, *position, state); + break; + case HANDLE_ROTATE: + rotate(*position, state); + break; + case HANDLE_CENTER: + setCenter(*position); + break; + } } gboolean Inkscape::SelTrans::handleRequest(SPKnot *knot, Geom::Point *position, guint state, SPSelTransHandle const &handle) { - if (!SP_KNOT_IS_GRABBED(knot)) { + if (!SP_KNOT_IS_GRABBED(knot)) return TRUE; - } // When holding shift while rotating or skewing, the transformation will be // relative to the point opposite of the handle; otherwise it will be relative // to the center as set for the selection - if ((!(state & GDK_SHIFT_MASK) == !(_state == STATE_ROTATE)) && (&handle != &handle_center)) { + if ((!(state & GDK_SHIFT_MASK) == !(_state == STATE_ROTATE)) && (handle.type != HANDLE_CENTER)) { _origin = _opposite; _origin_for_bboxpoints = _opposite_for_bboxpoints; _origin_for_specpoints = _opposite_for_specpoints; @@ -842,10 +799,10 @@ gboolean Inkscape::SelTrans::handleRequest(SPKnot *knot, Geom::Point *position, // FIXME return TRUE; } - if (handle.request(this, handle, *position, state)) { + if (request(handle, *position, state)) { sp_knot_set_position(knot, *position, state); SP_CTRL(_grip)->moveto(*position); - if (&handle == &handle_center) { + if (handle.type == HANDLE_CENTER) { SP_CTRL(_norm)->moveto(*position); } else { SP_CTRL(_norm)->moveto(_origin); @@ -908,36 +865,6 @@ static double sign(double const x) : 1 ); } -gboolean sp_sel_trans_scale_request(Inkscape::SelTrans *seltrans, - SPSelTransHandle const &, Geom::Point &pt, guint state) -{ - return seltrans->scaleRequest(pt, state); -} - -gboolean sp_sel_trans_stretch_request(Inkscape::SelTrans *seltrans, - SPSelTransHandle const &handle, Geom::Point &pt, guint state) -{ - return seltrans->stretchRequest(handle, pt, state); -} - -gboolean sp_sel_trans_skew_request(Inkscape::SelTrans *seltrans, - SPSelTransHandle const &handle, Geom::Point &pt, guint state) -{ - return seltrans->skewRequest(handle, pt, state); -} - -gboolean sp_sel_trans_rotate_request(Inkscape::SelTrans *seltrans, - SPSelTransHandle const &, Geom::Point &pt, guint state) -{ - return seltrans->rotateRequest(pt, state); -} - -gboolean sp_sel_trans_center_request(Inkscape::SelTrans *seltrans, - SPSelTransHandle const &, Geom::Point &pt, guint state) -{ - return seltrans->centerRequest(pt, state); -} - gboolean Inkscape::SelTrans::scaleRequest(Geom::Point &pt, guint state) { @@ -1117,6 +1044,24 @@ gboolean Inkscape::SelTrans::stretchRequest(SPSelTransHandle const &handle, Geom return TRUE; } +gboolean Inkscape::SelTrans::request(SPSelTransHandle const &handle, Geom::Point &pt, guint state) +{ + // These _should_ be in the handstype somewhere instead + switch (handle.type) { + case HANDLE_SCALE: + return scaleRequest(pt, state); + case HANDLE_STRETCH: + return stretchRequest(handle, pt, state); + case HANDLE_SKEW: + return skewRequest(handle, pt, state); + case HANDLE_ROTATE: + return rotateRequest(pt, state); + case HANDLE_CENTER: + return centerRequest(pt, state); + } + return FALSE; +} + gboolean Inkscape::SelTrans::skewRequest(SPSelTransHandle const &handle, Geom::Point &pt, guint state) { /* When skewing (or rotating): @@ -1347,25 +1292,7 @@ gboolean Inkscape::SelTrans::centerRequest(Geom::Point &pt, guint state) * */ -void sp_sel_trans_stretch(Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, Geom::Point &pt, guint state) -{ - seltrans->stretch(handle, pt, state); -} - -void sp_sel_trans_scale(Inkscape::SelTrans *seltrans, SPSelTransHandle const &, Geom::Point &pt, guint state) -{ - seltrans->scale(pt, state); -} -void sp_sel_trans_skew(Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, Geom::Point &pt, guint state) -{ - seltrans->skew(handle, pt, state); -} - -void sp_sel_trans_rotate(Inkscape::SelTrans *seltrans, SPSelTransHandle const &, Geom::Point &pt, guint state) -{ - seltrans->rotate(pt, state); -} void Inkscape::SelTrans::stretch(SPSelTransHandle const &/*handle*/, Geom::Point &/*pt*/, guint /*state*/) { @@ -1387,12 +1314,6 @@ void Inkscape::SelTrans::rotate(Geom::Point &/*pt*/, guint /*state*/) transform(_relative_affine, _origin); } -void sp_sel_trans_center(Inkscape::SelTrans *seltrans, SPSelTransHandle const &, Geom::Point &pt, guint /*state*/) -{ - seltrans->setCenter(pt); -} - - void Inkscape::SelTrans::moveTo(Geom::Point const &xy, guint state) { SnapManager &m = _desktop->namedview->snap_manager; diff --git a/src/seltrans.h b/src/seltrans.h index 10860f58f..9cf4a7aaf 100644 --- a/src/seltrans.h +++ b/src/seltrans.h @@ -25,6 +25,7 @@ #include "message-context.h" #include #include "sp-item.h" +#include "seltrans-handles.h" struct SPKnot; class SPDesktop; @@ -64,6 +65,7 @@ public: void scale(Geom::Point &pt, guint state); void skew(SPSelTransHandle const &handle, Geom::Point &pt, guint state); void rotate(Geom::Point &pt, guint state); + gboolean request(SPSelTransHandle const &handle, Geom::Point &pt, guint state); gboolean scaleRequest(Geom::Point &pt, guint state); gboolean stretchRequest(SPSelTransHandle const &handle, Geom::Point &pt, guint state); gboolean skewRequest(SPSelTransHandle const &handle, Geom::Point &pt, guint state); @@ -91,7 +93,7 @@ public: return _grabbed; } bool centerIsVisible() { - return ( _chandle && SP_KNOT_IS_VISIBLE (_chandle) ); + return ( _center_handle && SP_KNOT_IS_VISIBLE (knots[_center_handle]) ); } void getNextClosestPoint(bool reverse); @@ -115,8 +117,8 @@ private: void _selChanged(Inkscape::Selection *selection); void _selModified(Inkscape::Selection *selection, guint flags); void _boundingBoxPrefsChanged(int prefs_bbox); - void _showHandles(SPKnot *knot[], SPSelTransHandle const handle[], gint num, - gchar const *even_tip, gchar const *odd_tip); + void _makeHandles(); + void _showHandles(SPSelTransType type); Geom::Point _getGeomHandlePos(Geom::Point const &visual_handle_pos); Geom::Point _calcAbsAffineDefault(Geom::Scale const default_scale); Geom::Point _calcAbsAffineGeom(Geom::Scale const geom_scale); @@ -176,10 +178,9 @@ private: boost::optional _center; bool _center_is_set; ///< we've already set _center, no need to reread it from items + int _center_handle; - SPKnot *_shandle[8]; - SPKnot *_rhandle[8]; - SPKnot *_chandle; + SPKnot *knots[27]; // Only some as shown at any time SPCanvasItem *_norm; SPCanvasItem *_grip; SPCtrlLine *_l[4]; -- cgit v1.2.3 From e921e43e62cc68aaf29079b26392b17208689568 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Mon, 1 Jul 2013 23:39:15 -0400 Subject: Renamed Length class to Quantity class, fixed bugs, and added functions. (bzr r12380.1.3) --- src/util/units.cpp | 84 ++++++++++++++++++++++++++++++++++++++++-------------- src/util/units.h | 19 ++++++++---- 2 files changed, 75 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/util/units.cpp b/src/util/units.cpp index 3bcbabf89..d0e4e7941 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -55,6 +55,57 @@ int Unit::defaultDigits() const { } } +/** Checks if a unit is compatible with the specified unit. */ +bool Unit::compatibleWith(const Unit *u) const { + // Percentages + if (type == UNIT_TYPE_DIMENSIONLESS || u->type == UNIT_TYPE_DIMENSIONLESS) { + return true; + } + + // Other units with same type + if (type == u->type) { + return true; + } + + // Different, incompatible types + return false; +} + +/** Check if units are equal. */ +bool operator== (const Unit &u1, const Unit &u2) { + return (u1.type == u2.type && u1.name.compare(u2.name) == 0); +} + +/** Check if units are not equal. */ +bool operator!= (const Unit &u1, const Unit &u2) { + return !(u1 == u2); +} + +/** Temporary - get SVG unit. */ +int Unit::svgUnit() const { + if (!abbr.compare("px")) + return 1; + if (!abbr.compare("pt")) + return 2; + if (!abbr.compare("pc")) + return 3; + if (!abbr.compare("mm")) + return 4; + if (!abbr.compare("cm")) + return 5; + if (!abbr.compare("in")) + return 6; + if (!abbr.compare("ft")) + return 7; + if (!abbr.compare("em")) + return 8; + if (!abbr.compare("ex")) + return 9; + if (!abbr.compare("%")) + return 10; + return 0; +} + /** * Initializes the unit tables and identifies the primary unit types. * @@ -334,42 +385,31 @@ void UnitsSAXHandler::_endElement(xmlChar const *xname) } } -/** Initialize a length. */ -Length::Length(Unit *u, double l) { +/** Initialize a quantity. */ +Quantity::Quantity(Unit *u, double q) { unit = u; - length = l; + quantity = q; } -/** Checks if a length is compatible with the specified unit. */ -bool Length::compatibleWith(Unit *u) { - // Percentages - if (unit->type == UNIT_TYPE_DIMENSIONLESS || u->type == UNIT_TYPE_DIMENSIONLESS) { - return true; - } - - // Other units with same type - if (unit->type == u->type) { - return true; - } - - // Different, incompatible types - return false; +/** Checks if a quantity is compatible with the specified unit. */ +bool Quantity::compatibleWith(const Unit *u) const { + return unit->compatibleWith(u); } -/** Return the length's value in the specified unit. */ -double Length::value(Unit *u) { - return convert(length, unit, u); +/** Return the quantity's value in the specified unit. */ +double Quantity::value(Unit *u) const { + return convert(quantity, unit, u); } /** Convert distances. */ -double Length::convert(double from_dist, Unit *from, Unit *to) const { +double Quantity::convert(const double from_dist, const Unit *from, const Unit *to) { // Incompatible units if (from->type != to->type) { return -1; } // Compatible units - return from_dist / from->factor * to->factor; + return from_dist * from->factor / to->factor; } } // namespace Util diff --git a/src/util/units.h b/src/util/units.h index 46680bf35..7ef7001bb 100644 --- a/src/util/units.h +++ b/src/util/units.h @@ -47,6 +47,13 @@ class Unit { bool isAbsolute() const { return type != UNIT_TYPE_DIMENSIONLESS; } int defaultDigits() const; + bool compatibleWith(const Unit *u) const; + + friend bool operator== (const Unit &u1, const Unit &u2); + friend bool operator!= (const Unit &u1, const Unit &u2); + + // temporary + int svgUnit() const; }; class UnitTable { @@ -84,16 +91,16 @@ class UnitTable { }; -class Length { +class Quantity { public: Unit *unit; - double length; + double quantity; - Length(Unit *u, double l); // constructor - bool compatibleWith(Unit *u); - double value(Unit *u); + Quantity(Unit *u, double q); // constructor + bool compatibleWith(const Unit *u) const; + double value(Unit *u) const; - double convert(double from_dist, Unit *from, Unit *to) const; + static double convert(const double from_dist, const Unit *from, const Unit *to); }; } // namespace Util -- cgit v1.2.3 From bd77ef25e9161acb007323f851ba77e106036939 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Mon, 1 Jul 2013 23:40:52 -0400 Subject: Ported "ui/widget/page-sizer.cpp" and "document.cpp" to "Util::Unit" class. (bzr r12380.1.4) --- src/document.cpp | 32 +++++---- src/document.h | 8 +-- src/measure-context.cpp | 2 +- src/sp-namedview.cpp | 11 +-- src/sp-namedview.h | 3 +- src/ui/widget/page-sizer.cpp | 159 +++++++++++++++++++++---------------------- src/ui/widget/page-sizer.h | 9 +-- 7 files changed, 114 insertions(+), 110 deletions(-) (limited to 'src') diff --git a/src/document.cpp b/src/document.cpp index 706710cfc..cc1c519fc 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -49,7 +49,6 @@ #include "display/drawing-item.h" #include "document-private.h" #include "document-undo.h" -#include "helper/units.h" #include "id-clash.h" #include "inkscape-private.h" #include "inkscape-version.h" @@ -87,6 +86,8 @@ static gint doc_count = 0; static unsigned long next_serial = 0; +static Inkscape::Util::UnitTable unit_table; + SPDocument::SPDocument() : keepalive(FALSE), virgin(TRUE), @@ -546,21 +547,22 @@ gdouble SPDocument::getWidth() const return result; } -void SPDocument::setWidth(gdouble width, const SPUnit *unit) +void SPDocument::setWidth(gdouble width, const Inkscape::Util::Unit *unit) { + Inkscape::Util::Unit px = unit_table.getUnit("px"); if (root->width.unit == SVGLength::PERCENT && root->viewBox_set) { // set to viewBox= - root->viewBox.setMax(Geom::Point(root->viewBox.left() + sp_units_get_pixels (width, *unit), root->viewBox.bottom())); + root->viewBox.setMax(Geom::Point(root->viewBox.left() + Inkscape::Util::Quantity::convert(width, unit, &px), root->viewBox.bottom())); } else { // set to width= gdouble old_computed = root->width.computed; - root->width.computed = sp_units_get_pixels (width, *unit); + root->width.computed = Inkscape::Util::Quantity::convert(width, unit, &px); /* SVG does not support meters as a unit, so we must translate meters to * cm when writing */ - if (!strcmp(unit->abbr, "m")) { + if (*unit == unit_table.getUnit("m")) { root->width.value = 100*width; root->width.unit = SVGLength::CM; } else { root->width.value = width; - root->width.unit = (SVGLength::Unit) sp_unit_get_svg_unit(unit); + root->width.unit = (SVGLength::Unit) unit->svgUnit(); } if (root->viewBox_set) @@ -582,21 +584,22 @@ gdouble SPDocument::getHeight() const return result; } -void SPDocument::setHeight(gdouble height, const SPUnit *unit) +void SPDocument::setHeight(gdouble height, const Inkscape::Util::Unit *unit) { + Inkscape::Util::Unit px = unit_table.getUnit("px"); if (root->height.unit == SVGLength::PERCENT && root->viewBox_set) { // set to viewBox= - root->viewBox.setMax(Geom::Point(root->viewBox.right(), root->viewBox.top() + sp_units_get_pixels (height, *unit))); + root->viewBox.setMax(Geom::Point(root->viewBox.right(), root->viewBox.top() + Inkscape::Util::Quantity::convert(height, unit, &px))); } else { // set to height= gdouble old_computed = root->height.computed; - root->height.computed = sp_units_get_pixels (height, *unit); + root->height.computed = Inkscape::Util::Quantity::convert(height, unit, &px); /* SVG does not support meters as a unit, so we must translate meters to * cm when writing */ - if (!strcmp(unit->abbr, "m")) { + if (*unit == unit_table.getUnit("m")) { root->height.value = 100*height; root->height.unit = SVGLength::CM; } else { root->height.value = height; - root->height.unit = (SVGLength::Unit) sp_unit_get_svg_unit(unit); + root->height.unit = (SVGLength::Unit) unit->svgUnit(); } if (root->viewBox_set) @@ -626,7 +629,7 @@ void SPDocument::fitToRect(Geom::Rect const &rect, bool with_margins) double const h = rect.height(); double const old_height = getHeight(); - SPUnit const &px(sp_unit_get_by_id(SP_UNIT_PX)); + Inkscape::Util::Unit const px = unit_table.getUnit("px"); /* in px */ double margin_top = 0.0; @@ -639,9 +642,10 @@ void SPDocument::fitToRect(Geom::Rect const &rect, bool with_margins) if (with_margins && nv) { if (nv != NULL) { gchar const * const units_abbr = nv->getAttribute("units"); - SPUnit const *margin_units = NULL; + Inkscape::Util::Unit const *margin_units = NULL; if (units_abbr != NULL) { - margin_units = sp_unit_get_by_abbreviation(units_abbr); + Inkscape::Util::Unit mu = unit_table.getUnit(units_abbr); + margin_units = μ } if (margin_units == NULL) { margin_units = &px; diff --git a/src/document.h b/src/document.h index 606a83be8..c2334bbc3 100644 --- a/src/document.h +++ b/src/document.h @@ -26,6 +26,7 @@ #include "gc-anchored.h" #include #include +#include "util/units.h" namespace Avoid { class Router; @@ -35,7 +36,6 @@ class SPItem; class SPObject; struct SPGroup; struct SPRoot; -struct SPUnit; namespace Inkscape { struct Application; @@ -228,8 +228,8 @@ public: gdouble getWidth() const; gdouble getHeight() const; Geom::Point getDimensions() const; - void setWidth(gdouble width, const SPUnit *unit); - void setHeight(gdouble height, const SPUnit *unit); + void setWidth(gdouble width, const Inkscape::Util::Unit *unit); + void setHeight(gdouble height, const Inkscape::Util::Unit *unit); void requestModified(); gint ensureUpToDate(); bool addResource(const gchar *key, SPObject *object); @@ -253,8 +253,6 @@ private: void setupViewport(SPItemCtx *ctx); }; -struct SPUnit; - /* * Ideas: How to overcome style invalidation nightmare * diff --git a/src/measure-context.cpp b/src/measure-context.cpp index dc23cf5c6..9d60d38e8 100644 --- a/src/measure-context.cpp +++ b/src/measure-context.cpp @@ -13,7 +13,7 @@ #include #include -#include "helper/units.h" +#include "util/units.h" #include "macros.h" #include "display/curve.h" #include "sp-shape.h" diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp index 452f57425..5184d37a9 100644 --- a/src/sp-namedview.cpp +++ b/src/sp-namedview.cpp @@ -1101,20 +1101,23 @@ bool SPNamedView::getGuides() * \return the margin size in px, else 0.0 if anything is invalid. */ double SPNamedView::getMarginLength(gchar const * const key, - SPUnit const * const margin_units, - SPUnit const * const return_units, + Inkscape::Util::Unit const * const margin_units, + Inkscape::Util::Unit const * const return_units, double const width, double const height, bool const use_width) { double value; + static Inkscape::Util::UnitTable unit_table; + Inkscape::Util::Unit percent = unit_table.getUnit("%"); if(!this->storeAsDouble(key,&value)) { return 0.0; } - if (margin_units == &sp_unit_get_by_id (SP_UNIT_PERCENT)) { + if (*margin_units == percent) { return (use_width)? width * value : height * value; } - if (!sp_convert_distance (&value, margin_units, return_units)) { +// if (!sp_convert_distance (&value, margin_units, return_units)) { + if (!margin_units->compatibleWith(return_units)) { return 0.0; } return value; diff --git a/src/sp-namedview.h b/src/sp-namedview.h index 8191ef6d6..a84368c86 100644 --- a/src/sp-namedview.h +++ b/src/sp-namedview.h @@ -24,6 +24,7 @@ #include "sp-metric.h" #include "snap.h" #include "document.h" +#include "util/units.h" G_BEGIN_DECLS @@ -94,7 +95,7 @@ struct SPNamedView : public SPObjectGroup { bool getGuides(); private: - double getMarginLength(gchar const * const key,SPUnit const * const margin_units,SPUnit const * const return_units,double const width,double const height,bool const use_width); + double getMarginLength(gchar const * const key,Inkscape::Util::Unit const * const margin_units,Inkscape::Util::Unit const * const return_units,double const width,double const height,bool const use_width); friend class SPDocument; }; diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp index fa3f8e3a1..cceb3f600 100644 --- a/src/ui/widget/page-sizer.cpp +++ b/src/ui/widget/page-sizer.cpp @@ -36,7 +36,7 @@ #include "document.h" #include "desktop.h" #include "helper/action.h" -#include "helper/units.h" +#include "util/units.h" #include "inkscape.h" #include "sp-namedview.h" #include "sp-root.h" @@ -46,6 +46,8 @@ #include "xml/node.h" #include "xml/repr.h" +static Inkscape::Util::UnitTable unit_table; + using std::pair; namespace Inkscape { @@ -95,7 +97,7 @@ struct PaperSizeRec { char const * const name; //name double const smaller; //lesser dimension double const larger; //greater dimension - SPUnitId const unit; //units + Inkscape::Util::Unit const unit; //units }; // list of page formats that should be in landscape automatically @@ -113,31 +115,31 @@ fill_landscape_papers() { } static PaperSizeRec const inkscape_papers[] = { - { "A4", 210, 297, SP_UNIT_MM }, - { "US Letter", 8.5, 11, SP_UNIT_IN }, - { "US Legal", 8.5, 14, SP_UNIT_IN }, - { "US Executive", 7.25, 10.5, SP_UNIT_IN }, - { "A0", 841, 1189, SP_UNIT_MM }, - { "A1", 594, 841, SP_UNIT_MM }, - { "A2", 420, 594, SP_UNIT_MM }, - { "A3", 297, 420, SP_UNIT_MM }, - { "A5", 148, 210, SP_UNIT_MM }, - { "A6", 105, 148, SP_UNIT_MM }, - { "A7", 74, 105, SP_UNIT_MM }, - { "A8", 52, 74, SP_UNIT_MM }, - { "A9", 37, 52, SP_UNIT_MM }, - { "A10", 26, 37, SP_UNIT_MM }, - { "B0", 1000, 1414, SP_UNIT_MM }, - { "B1", 707, 1000, SP_UNIT_MM }, - { "B2", 500, 707, SP_UNIT_MM }, - { "B3", 353, 500, SP_UNIT_MM }, - { "B4", 250, 353, SP_UNIT_MM }, - { "B5", 176, 250, SP_UNIT_MM }, - { "B6", 125, 176, SP_UNIT_MM }, - { "B7", 88, 125, SP_UNIT_MM }, - { "B8", 62, 88, SP_UNIT_MM }, - { "B9", 44, 62, SP_UNIT_MM }, - { "B10", 31, 44, SP_UNIT_MM }, + { "A4", 210, 297, unit_table.getUnit("mm") }, + { "US Letter", 8.5, 11, unit_table.getUnit("in") }, + { "US Legal", 8.5, 14, unit_table.getUnit("in") }, + { "US Executive", 7.25, 10.5, unit_table.getUnit("in") }, + { "A0", 841, 1189, unit_table.getUnit("mm") }, + { "A1", 594, 841, unit_table.getUnit("mm") }, + { "A2", 420, 594, unit_table.getUnit("mm") }, + { "A3", 297, 420, unit_table.getUnit("mm") }, + { "A5", 148, 210, unit_table.getUnit("mm") }, + { "A6", 105, 148, unit_table.getUnit("mm") }, + { "A7", 74, 105, unit_table.getUnit("mm") }, + { "A8", 52, 74, unit_table.getUnit("mm") }, + { "A9", 37, 52, unit_table.getUnit("mm") }, + { "A10", 26, 37, unit_table.getUnit("mm") }, + { "B0", 1000, 1414, unit_table.getUnit("mm") }, + { "B1", 707, 1000, unit_table.getUnit("mm") }, + { "B2", 500, 707, unit_table.getUnit("mm") }, + { "B3", 353, 500, unit_table.getUnit("mm") }, + { "B4", 250, 353, unit_table.getUnit("mm") }, + { "B5", 176, 250, unit_table.getUnit("mm") }, + { "B6", 125, 176, unit_table.getUnit("mm") }, + { "B7", 88, 125, unit_table.getUnit("mm") }, + { "B8", 62, 88, unit_table.getUnit("mm") }, + { "B9", 44, 62, unit_table.getUnit("mm") }, + { "B10", 31, 44, unit_table.getUnit("mm") }, @@ -149,63 +151,63 @@ static PaperSizeRec const inkscape_papers[] = { don't know what D and E series are used for. */ - { "C0", 917, 1297, SP_UNIT_MM }, - { "C1", 648, 917, SP_UNIT_MM }, - { "C2", 458, 648, SP_UNIT_MM }, - { "C3", 324, 458, SP_UNIT_MM }, - { "C4", 229, 324, SP_UNIT_MM }, - { "C5", 162, 229, SP_UNIT_MM }, - { "C6", 114, 162, SP_UNIT_MM }, - { "C7", 81, 114, SP_UNIT_MM }, - { "C8", 57, 81, SP_UNIT_MM }, - { "C9", 40, 57, SP_UNIT_MM }, - { "C10", 28, 40, SP_UNIT_MM }, - { "D1", 545, 771, SP_UNIT_MM }, - { "D2", 385, 545, SP_UNIT_MM }, - { "D3", 272, 385, SP_UNIT_MM }, - { "D4", 192, 272, SP_UNIT_MM }, - { "D5", 136, 192, SP_UNIT_MM }, - { "D6", 96, 136, SP_UNIT_MM }, - { "D7", 68, 96, SP_UNIT_MM }, - { "E3", 400, 560, SP_UNIT_MM }, - { "E4", 280, 400, SP_UNIT_MM }, - { "E5", 200, 280, SP_UNIT_MM }, - { "E6", 140, 200, SP_UNIT_MM }, + { "C0", 917, 1297, unit_table.getUnit("mm") }, + { "C1", 648, 917, unit_table.getUnit("mm") }, + { "C2", 458, 648, unit_table.getUnit("mm") }, + { "C3", 324, 458, unit_table.getUnit("mm") }, + { "C4", 229, 324, unit_table.getUnit("mm") }, + { "C5", 162, 229, unit_table.getUnit("mm") }, + { "C6", 114, 162, unit_table.getUnit("mm") }, + { "C7", 81, 114, unit_table.getUnit("mm") }, + { "C8", 57, 81, unit_table.getUnit("mm") }, + { "C9", 40, 57, unit_table.getUnit("mm") }, + { "C10", 28, 40, unit_table.getUnit("mm") }, + { "D1", 545, 771, unit_table.getUnit("mm") }, + { "D2", 385, 545, unit_table.getUnit("mm") }, + { "D3", 272, 385, unit_table.getUnit("mm") }, + { "D4", 192, 272, unit_table.getUnit("mm") }, + { "D5", 136, 192, unit_table.getUnit("mm") }, + { "D6", 96, 136, unit_table.getUnit("mm") }, + { "D7", 68, 96, unit_table.getUnit("mm") }, + { "E3", 400, 560, unit_table.getUnit("mm") }, + { "E4", 280, 400, unit_table.getUnit("mm") }, + { "E5", 200, 280, unit_table.getUnit("mm") }, + { "E6", 140, 200, unit_table.getUnit("mm") }, //#endif - { "CSE", 462, 649, SP_UNIT_PT }, - { "US #10 Envelope", 4.125, 9.5, SP_UNIT_IN }, + { "CSE", 462, 649, unit_table.getUnit("pt") }, + { "US #10 Envelope", 4.125, 9.5, unit_table.getUnit("in") }, /* See http://www.hbp.com/content/PCR_envelopes.cfm for a much larger list of US envelope sizes. */ - { "DL Envelope", 110, 220, SP_UNIT_MM }, - { "Ledger/Tabloid", 11, 17, SP_UNIT_IN }, + { "DL Envelope", 110, 220, unit_table.getUnit("mm") }, + { "Ledger/Tabloid", 11, 17, unit_table.getUnit("in") }, /* Note that `Folio' (used in QPrinter/KPrinter) is deliberately absent from this list, as it means different sizes to different people: different people may expect the width to be either 8, 8.25 or 8.5 inches, and the height to be either 13 or 13.5 inches, even restricting our interpretation to foolscap folio. If you wish to introduce a folio-like page size to the list, then please consider using a name more specific than just `Folio' or `Foolscap Folio'. */ - { "Banner 468x60", 60, 468, SP_UNIT_PX }, - { "Icon 16x16", 16, 16, SP_UNIT_PX }, - { "Icon 32x32", 32, 32, SP_UNIT_PX }, - { "Icon 48x48", 48, 48, SP_UNIT_PX }, + { "Banner 468x60", 60, 468, unit_table.getUnit("px") }, + { "Icon 16x16", 16, 16, unit_table.getUnit("px") }, + { "Icon 32x32", 32, 32, unit_table.getUnit("px") }, + { "Icon 48x48", 48, 48, unit_table.getUnit("px") }, /* business cards */ - { "Business Card (ISO 7810)", 53.98, 85.60, SP_UNIT_MM }, - { "Business Card (US)", 2, 3.5, SP_UNIT_IN }, - { "Business Card (Europe)", 55, 85, SP_UNIT_MM }, - { "Business Card (Aus/NZ)", 55, 90, SP_UNIT_MM }, + { "Business Card (ISO 7810)", 53.98, 85.60, unit_table.getUnit("mm") }, + { "Business Card (US)", 2, 3.5, unit_table.getUnit("in") }, + { "Business Card (Europe)", 55, 85, unit_table.getUnit("mm") }, + { "Business Card (Aus/NZ)", 55, 90, unit_table.getUnit("mm") }, // Start Arch Series List - { "Arch A", 9, 12, SP_UNIT_IN }, // 229 x 305 mm - { "Arch B", 12, 18, SP_UNIT_IN }, // 305 x 457 mm - { "Arch C", 18, 24, SP_UNIT_IN }, // 457 x 610 mm - { "Arch D", 24, 36, SP_UNIT_IN }, // 610 x 914 mm - { "Arch E", 36, 48, SP_UNIT_IN }, // 914 x 1219 mm - { "Arch E1", 30, 42, SP_UNIT_IN }, // 762 x 1067 mm + { "Arch A", 9, 12, unit_table.getUnit("in") }, // 229 x 305 mm + { "Arch B", 12, 18, unit_table.getUnit("in") }, // 305 x 457 mm + { "Arch C", 18, 24, unit_table.getUnit("in") }, // 457 x 610 mm + { "Arch D", 24, 36, unit_table.getUnit("in") }, // 610 x 914 mm + { "Arch E", 36, 48, unit_table.getUnit("in") }, // 914 x 1219 mm + { "Arch E1", 30, 42, unit_table.getUnit("in") }, // 762 x 1067 mm /* * The above list of Arch sizes were taken from the following site: @@ -216,7 +218,7 @@ static PaperSizeRec const inkscape_papers[] = { * September 2009 - DAK */ - { NULL, 0, 0, SP_UNIT_PX }, + { NULL, 0, 0, unit_table.getUnit("px") }, }; @@ -226,7 +228,7 @@ static PaperSizeRec const inkscape_papers[] = { //######################################################################## //The default unit for this widget and its calculations -static const SPUnit _px_unit = sp_unit_get_by_id (SP_UNIT_PX); +static Inkscape::Util::Unit _px_unit = unit_table.getUnit("px"); /** @@ -279,12 +281,7 @@ PageSizer::PageSizer(Registry & _wr) char formatBuf[80]; snprintf(formatBuf, 79, "%0.1f x %0.1f", p->smaller, p->larger); Glib::ustring desc = formatBuf; - if (p->unit == SP_UNIT_IN) - desc.append(" in"); - else if (p->unit == SP_UNIT_MM) - desc.append(" mm"); - else if (p->unit == SP_UNIT_PX) - desc.append(" px"); + desc.append(" " + p->unit.abbr); PaperSize paper(name, p->smaller, p->larger, p->unit); _paperSizeTable[name] = paper; Gtk::TreeModel::Row row = *(_paperSizeListStore->append()); @@ -568,9 +565,9 @@ PageSizer::find_paper_size (double w, double h) const for (iter = _paperSizeTable.begin() ; iter != _paperSizeTable.end() ; ++iter) { PaperSize paper = iter->second; - SPUnit const &i_unit = sp_unit_get_by_id(paper.unit); - double smallX = sp_units_get_pixels(paper.smaller, i_unit); - double largeX = sp_units_get_pixels(paper.larger, i_unit); + Inkscape::Util::Unit const &i_unit = paper.unit; + double smallX = Inkscape::Util::Quantity::convert(paper.smaller, &i_unit, &_px_unit); + double largeX = Inkscape::Util::Quantity::convert(paper.larger, &i_unit, &_px_unit); g_return_val_if_fail(smallX <= largeX, _paperSizeListStore->children().end()); @@ -661,9 +658,9 @@ PageSizer::on_paper_size_list_changed() _landscape = _landscapeButton.get_active(); } - SPUnit const &src_unit = sp_unit_get_by_id (paper.unit); - sp_convert_distance (&w, &src_unit, &_px_unit); - sp_convert_distance (&h, &src_unit, &_px_unit); + Inkscape::Util::Unit const &src_unit = paper.unit; + w = Inkscape::Util::Quantity::convert(w, &src_unit, &_px_unit); + h = Inkscape::Util::Quantity::convert(h, &src_unit, &_px_unit); if (_landscape) setDim (h, w, false); diff --git a/src/ui/widget/page-sizer.h b/src/ui/widget/page-sizer.h index d1fbb56e0..fc8edeeac 100644 --- a/src/ui/widget/page-sizer.h +++ b/src/ui/widget/page-sizer.h @@ -18,7 +18,7 @@ #include "ui/widget/registered-widget.h" #include -#include "helper/units.h" +#include "util/units.h" #include #include @@ -64,7 +64,7 @@ public: PaperSize(const Glib::ustring &nameArg, double smallerArg, double largerArg, - SPUnitId unitArg) + Inkscape::Util::Unit unitArg) { name = nameArg; smaller = smallerArg; @@ -108,7 +108,7 @@ public: /** * The units (px, pt, mm, etc) of this specification */ - SPUnitId unit; + Inkscape::Util::Unit unit; private: @@ -117,7 +117,8 @@ private: name = ""; smaller = 0.0; larger = 0.0; - unit = SP_UNIT_PX; + static Inkscape::Util::UnitTable unit_table; + unit = unit_table.getUnit("px"); } void assign(const PaperSize &other) -- cgit v1.2.3 From fdb68963cec5ddbd3eef111f4c95b7e049aa839c Mon Sep 17 00:00:00 2001 From: Slagvi Public Date: Tue, 2 Jul 2013 17:37:42 +0200 Subject: Adding NewFromTemplate to the Inkscape menu (bzr r12379.2.5) --- src/file.h | 1 + src/menus-skeleton.h | 1 + src/templates/new-from-template.cpp | 42 ----------- src/templates/new-from-template.h | 31 --------- src/templates/static-template-load-tab.cpp | 47 ------------- src/templates/static-template-load-tab.h | 33 --------- src/templates/template-load-tab.cpp | 107 ----------------------------- src/templates/template-load-tab.h | 59 ---------------- src/ui/dialog/Makefile_insert | 6 ++ src/ui/dialog/new-from-template.cpp | 42 +++++++++++ src/ui/dialog/new-from-template.h | 31 +++++++++ src/ui/dialog/static-template-load-tab.cpp | 47 +++++++++++++ src/ui/dialog/static-template-load-tab.h | 33 +++++++++ src/ui/dialog/template-load-tab.cpp | 107 +++++++++++++++++++++++++++++ src/ui/dialog/template-load-tab.h | 59 ++++++++++++++++ src/verbs.cpp | 6 ++ src/verbs.h | 1 + 17 files changed, 334 insertions(+), 319 deletions(-) delete mode 100644 src/templates/new-from-template.cpp delete mode 100644 src/templates/new-from-template.h delete mode 100644 src/templates/static-template-load-tab.cpp delete mode 100644 src/templates/static-template-load-tab.h delete mode 100644 src/templates/template-load-tab.cpp delete mode 100644 src/templates/template-load-tab.h create mode 100644 src/ui/dialog/new-from-template.cpp create mode 100644 src/ui/dialog/new-from-template.h create mode 100644 src/ui/dialog/static-template-load-tab.cpp create mode 100644 src/ui/dialog/static-template-load-tab.h create mode 100644 src/ui/dialog/template-load-tab.cpp create mode 100644 src/ui/dialog/template-load-tab.h (limited to 'src') diff --git a/src/file.h b/src/file.h index fe8ad9af3..acc6c5c7c 100644 --- a/src/file.h +++ b/src/file.h @@ -45,6 +45,7 @@ Glib::ustring sp_file_default_template_uri(); */ SPDesktop* sp_file_new (const Glib::ustring &templ); SPDesktop* sp_file_new_default (void); +SPDesktop* sp_file_new_from_templatee (); /*###################### ## D E L E T E diff --git a/src/menus-skeleton.h b/src/menus-skeleton.h index 77e781763..7c412b605 100644 --- a/src/menus-skeleton.h +++ b/src/menus-skeleton.h @@ -17,6 +17,7 @@ static char const menus_skeleton[] = " \n" " \n" " \n" +" \n" " \n" " \n" " \n" diff --git a/src/templates/new-from-template.cpp b/src/templates/new-from-template.cpp deleted file mode 100644 index fc590d199..000000000 --- a/src/templates/new-from-template.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "new-from-template.h" -#include "gtkmm/alignment.h" - -namespace Inkscape { -namespace UI { - - -NewFromTemplate::NewFromTemplate() - : _create_template_button("Create from template") -{ - set_title("New From Template"); - resize(400, 250); - - get_vbox()->pack_start(_main_widget); - _main_widget.append_page(_tab1, "Static Templates"); - _main_widget.append_page(_tab2, "Procedural Templates"); - - Gtk::Alignment *align; - align = manage(new Gtk::Alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER, 0.0, 0.0)); - get_vbox()->pack_end(*align, Gtk::PACK_SHRINK, 5); - align->add(_create_template_button); - - _create_template_button.signal_pressed().connect( - sigc::mem_fun(*this, &NewFromTemplate::_createFromTemplate)); - - show_all(); -} - - -void NewFromTemplate::_createFromTemplate() -{ - if ( _main_widget.get_current_page() == 0 ) { - _tab1.createTemplate(); - } else { - _tab2.createTemplate(); - } - - response(0); -} - -} -} diff --git a/src/templates/new-from-template.h b/src/templates/new-from-template.h deleted file mode 100644 index ef3cbce18..000000000 --- a/src/templates/new-from-template.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef INKSCAPE_SEEN_UI_DIALOG_NEW_FROM_TEMPLATE_H -#define INKSCAPE_SEEN_UI_DIALOG_NEW_FROM_TEMPLATE_H - -#include -#include -#include - -#include "template-load-tab.h" -#include "static-template-load-tab.h" - -namespace Inkscape { -namespace UI { - - -class NewFromTemplate : public Gtk::Dialog -{ -public: - NewFromTemplate(); - -private: - Gtk::Notebook _main_widget; - Gtk::Button _create_template_button; - StaticTemplateLoadTab _tab1; - TemplateLoadTab _tab2; - - void _createFromTemplate(); -}; - -} -} -#endif diff --git a/src/templates/static-template-load-tab.cpp b/src/templates/static-template-load-tab.cpp deleted file mode 100644 index 83ff32e52..000000000 --- a/src/templates/static-template-load-tab.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include -#include -#include -#include - -#include "static-template-load-tab.h" - -namespace Inkscape { -namespace UI { - - -StaticTemplateLoadTab::StaticTemplateLoadTab() - : _more_info_button("More info") - , _preview_image("preview.png") - , _short_description_label("Short description - I like trains. ad asda asd asdweqe gdfg") - , _template_name_label("Template_name") - , _template_author_label("by template_author") -{ - _template_info_column.pack_start(_template_name_label, Gtk::PACK_SHRINK, 4); - _template_info_column.pack_start(_template_author_label, Gtk::PACK_SHRINK, 0); - _template_info_column.pack_start(_preview_image, Gtk::PACK_SHRINK, 15); - _template_info_column.pack_start(_short_description_label, Gtk::PACK_SHRINK, 4); - - _short_description_label.set_line_wrap(true); - _short_description_label.set_size_request(200); - - Gtk::Alignment *align; - align = manage(new Gtk::Alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER, 0.0, 0.0)); - _template_info_column.pack_start(*align, Gtk::PACK_SHRINK, 5); - align->add(_more_info_button); -} - - -void StaticTemplateLoadTab::createTemplate() -{ - std::cout << "Static template\n"; -} - - -void StaticTemplateLoadTab::_displayTemplateInfo() -{ - TemplateLoadTab::_displayTemplateInfo(); - _template_name_label.set_text(_current_template); -} - -} -} diff --git a/src/templates/static-template-load-tab.h b/src/templates/static-template-load-tab.h deleted file mode 100644 index 651f146a0..000000000 --- a/src/templates/static-template-load-tab.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef INKSCAPE_SEEN_UI_DIALOG_STATIC_TEMPLATE_LOAD_TAB_H -#define INKSCAPE_SEEN_UI_DIALOG_STATIC_TEMPLATE_LOAD_TAB_H - -#include -#include -#include - -#include "template-load-tab.h" - -namespace Inkscape { -namespace UI { - - -class StaticTemplateLoadTab : public TemplateLoadTab -{ -public: - StaticTemplateLoadTab(); - virtual void createTemplate(); - -protected: - virtual void _displayTemplateInfo(); - - Gtk::Button _more_info_button; - Gtk::Label _short_description_label; - Gtk::Label _template_author_label; - Gtk::Label _template_name_label; - Gtk::Image _preview_image; -}; - -} -} - -#endif diff --git a/src/templates/template-load-tab.cpp b/src/templates/template-load-tab.cpp deleted file mode 100644 index a7b5e63f3..000000000 --- a/src/templates/template-load-tab.cpp +++ /dev/null @@ -1,107 +0,0 @@ -#include -#include - -#include "template-load-tab.h" - -namespace Inkscape { -namespace UI { - - -TemplateLoadTab::TemplateLoadTab() - : _keywords_combo(true) -{ - set_border_width(10); - - Gtk::Label *title; - title = manage(new Gtk::Label("Search Tags:")); - _templates_column.pack_start(*title, Gtk::PACK_SHRINK, 10); - - _templates_column.pack_start(_keywords_combo, Gtk::PACK_SHRINK, 0); - - title = manage(new Gtk::Label("Templates")); - _templates_column.pack_start(*title, Gtk::PACK_SHRINK, 10); - - title = manage(new Gtk::Label("Selected template")); - _template_info_column.pack_start(*title, Gtk::PACK_SHRINK, 10); - - _initLists(); - - add(_main_box); - _main_box.pack_start(_templates_column, Gtk::PACK_SHRINK, 20); - _main_box.pack_start(_template_info_column, Gtk::PACK_EXPAND_WIDGET, 10); - - _templates_column.pack_start(_templates_view, Gtk::PACK_SHRINK, 5); - - Glib::RefPtr templateSelectionRef = - _templates_view.get_selection(); - - templateSelectionRef->signal_changed().connect( - sigc::mem_fun(*this, &TemplateLoadTab::_displayTemplateInfo)); - - _keywords_combo.signal_changed().connect( - sigc::mem_fun(*this, &TemplateLoadTab::_keywordSelected)); - this->show_all(); -} - - -TemplateLoadTab::~TemplateLoadTab() -{ -} - - -void TemplateLoadTab::createTemplate() -{ - std::cout << "Default Template Tab" << std::endl; -} - - -void TemplateLoadTab::_displayTemplateInfo() -{ - Glib::RefPtr templateSelectionRef = _templates_view.get_selection(); - if (templateSelectionRef->get_selected()) { - _current_template = (*templateSelectionRef->get_selected())[_templates_columns.textValue]; - } -} - - -void TemplateLoadTab::_initKeywordsList() -{ - _keywords_combo.append_text("All"); - - for (int i = 0 ; i < 10 ; ++i) { - _keywords_combo.append_text( "Keyword" + Glib::ustring::format(i)); - } -} - - -void TemplateLoadTab::_initLists() -{ - _templates_ref = Gtk::ListStore::create(_templates_columns); - _templates_view.set_model(_templates_ref); - _templates_view.append_column("", _templates_columns.textValue); - _templates_view.set_headers_visible(false); - - _initKeywordsList(); - _refreshTemplatesList(); -} - - -void TemplateLoadTab::_keywordSelected() -{ - _current_keyword = _keywords_combo.get_active_text(); - _refreshTemplatesList(); -} - - -void TemplateLoadTab::_refreshTemplatesList() -{ - _templates_ref->clear(); - for (int i = 0 ; i < 7 ; ++i) { - Gtk::TreeModel::iterator iter = _templates_ref->append(); - Gtk::TreeModel::Row row = *iter; - row[_templates_columns.textValue] = "Template" + Glib::ustring::format(i); - } -} - -} -} diff --git a/src/templates/template-load-tab.h b/src/templates/template-load-tab.h deleted file mode 100644 index a9fa7c313..000000000 --- a/src/templates/template-load-tab.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef INKSCAPE_SEEN_UI_DIALOG_TEMPLATE_LOAD_TAB_H -#define INKSCAPE_SEEN_UI_DIALOG_TEMPLATE_LOAD_TAB_H - -#include -#include -#include -#include -#include - -namespace Inkscape { -namespace UI { - - -class TemplateLoadTab : public Gtk::Frame -{ - -public: - TemplateLoadTab(); - virtual ~TemplateLoadTab(); - virtual void createTemplate(); - -protected: - class StringModelColumns : public Gtk::TreeModelColumnRecord - { - public: - StringModelColumns() - { - add(textValue); - } - - Gtk::TreeModelColumn textValue; - }; - - Glib::ustring _current_keyword; - Glib::ustring _current_template; - - virtual void _displayTemplateInfo(); - virtual void _initKeywordsList(); - virtual void _refreshTemplatesList(); - - void _initLists(); - void _keywordSelected(); - - Gtk::HBox _main_box; - Gtk::VBox _templates_column; - Gtk::VBox _template_info_column; - - Gtk::ComboBoxText _keywords_combo; - - Gtk::TreeView _templates_view; - Glib::RefPtr _templates_ref; - StringModelColumns _templates_columns; - -}; - -} -} - -#endif diff --git a/src/ui/dialog/Makefile_insert b/src/ui/dialog/Makefile_insert index 580b47522..4a34cc71c 100644 --- a/src/ui/dialog/Makefile_insert +++ b/src/ui/dialog/Makefile_insert @@ -70,6 +70,8 @@ ink_common_sources += \ ui/dialog/memory.h \ ui/dialog/messages.cpp \ ui/dialog/messages.h \ + ui/dialog/new-from-template.cpp \ + ui/dialog/new-from-template.h \ ui/dialog/ocaldialogs.cpp \ ui/dialog/ocaldialogs.h \ ui/dialog/object-attributes.cpp \ @@ -85,12 +87,16 @@ ink_common_sources += \ ui/dialog/scriptdialog.h \ ui/dialog/spellcheck.cpp \ ui/dialog/spellcheck.h \ + ui/dialog/static-template-load-tab.cpp \ + ui/dialog/static-template-load-tab.h \ ui/dialog/svg-fonts-dialog.cpp \ ui/dialog/svg-fonts-dialog.h \ ui/dialog/swatches.cpp \ ui/dialog/swatches.h \ ui/dialog/symbols.cpp \ ui/dialog/symbols.h \ + ui/dialog/template-load-tab.cpp \ + ui/dialog/template-load-tab.h \ ui/dialog/text-edit.cpp \ ui/dialog/text-edit.h \ ui/dialog/tile.cpp \ diff --git a/src/ui/dialog/new-from-template.cpp b/src/ui/dialog/new-from-template.cpp new file mode 100644 index 000000000..fc590d199 --- /dev/null +++ b/src/ui/dialog/new-from-template.cpp @@ -0,0 +1,42 @@ +#include "new-from-template.h" +#include "gtkmm/alignment.h" + +namespace Inkscape { +namespace UI { + + +NewFromTemplate::NewFromTemplate() + : _create_template_button("Create from template") +{ + set_title("New From Template"); + resize(400, 250); + + get_vbox()->pack_start(_main_widget); + _main_widget.append_page(_tab1, "Static Templates"); + _main_widget.append_page(_tab2, "Procedural Templates"); + + Gtk::Alignment *align; + align = manage(new Gtk::Alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER, 0.0, 0.0)); + get_vbox()->pack_end(*align, Gtk::PACK_SHRINK, 5); + align->add(_create_template_button); + + _create_template_button.signal_pressed().connect( + sigc::mem_fun(*this, &NewFromTemplate::_createFromTemplate)); + + show_all(); +} + + +void NewFromTemplate::_createFromTemplate() +{ + if ( _main_widget.get_current_page() == 0 ) { + _tab1.createTemplate(); + } else { + _tab2.createTemplate(); + } + + response(0); +} + +} +} diff --git a/src/ui/dialog/new-from-template.h b/src/ui/dialog/new-from-template.h new file mode 100644 index 000000000..ef3cbce18 --- /dev/null +++ b/src/ui/dialog/new-from-template.h @@ -0,0 +1,31 @@ +#ifndef INKSCAPE_SEEN_UI_DIALOG_NEW_FROM_TEMPLATE_H +#define INKSCAPE_SEEN_UI_DIALOG_NEW_FROM_TEMPLATE_H + +#include +#include +#include + +#include "template-load-tab.h" +#include "static-template-load-tab.h" + +namespace Inkscape { +namespace UI { + + +class NewFromTemplate : public Gtk::Dialog +{ +public: + NewFromTemplate(); + +private: + Gtk::Notebook _main_widget; + Gtk::Button _create_template_button; + StaticTemplateLoadTab _tab1; + TemplateLoadTab _tab2; + + void _createFromTemplate(); +}; + +} +} +#endif diff --git a/src/ui/dialog/static-template-load-tab.cpp b/src/ui/dialog/static-template-load-tab.cpp new file mode 100644 index 000000000..83ff32e52 --- /dev/null +++ b/src/ui/dialog/static-template-load-tab.cpp @@ -0,0 +1,47 @@ +#include +#include +#include +#include + +#include "static-template-load-tab.h" + +namespace Inkscape { +namespace UI { + + +StaticTemplateLoadTab::StaticTemplateLoadTab() + : _more_info_button("More info") + , _preview_image("preview.png") + , _short_description_label("Short description - I like trains. ad asda asd asdweqe gdfg") + , _template_name_label("Template_name") + , _template_author_label("by template_author") +{ + _template_info_column.pack_start(_template_name_label, Gtk::PACK_SHRINK, 4); + _template_info_column.pack_start(_template_author_label, Gtk::PACK_SHRINK, 0); + _template_info_column.pack_start(_preview_image, Gtk::PACK_SHRINK, 15); + _template_info_column.pack_start(_short_description_label, Gtk::PACK_SHRINK, 4); + + _short_description_label.set_line_wrap(true); + _short_description_label.set_size_request(200); + + Gtk::Alignment *align; + align = manage(new Gtk::Alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER, 0.0, 0.0)); + _template_info_column.pack_start(*align, Gtk::PACK_SHRINK, 5); + align->add(_more_info_button); +} + + +void StaticTemplateLoadTab::createTemplate() +{ + std::cout << "Static template\n"; +} + + +void StaticTemplateLoadTab::_displayTemplateInfo() +{ + TemplateLoadTab::_displayTemplateInfo(); + _template_name_label.set_text(_current_template); +} + +} +} diff --git a/src/ui/dialog/static-template-load-tab.h b/src/ui/dialog/static-template-load-tab.h new file mode 100644 index 000000000..651f146a0 --- /dev/null +++ b/src/ui/dialog/static-template-load-tab.h @@ -0,0 +1,33 @@ +#ifndef INKSCAPE_SEEN_UI_DIALOG_STATIC_TEMPLATE_LOAD_TAB_H +#define INKSCAPE_SEEN_UI_DIALOG_STATIC_TEMPLATE_LOAD_TAB_H + +#include +#include +#include + +#include "template-load-tab.h" + +namespace Inkscape { +namespace UI { + + +class StaticTemplateLoadTab : public TemplateLoadTab +{ +public: + StaticTemplateLoadTab(); + virtual void createTemplate(); + +protected: + virtual void _displayTemplateInfo(); + + Gtk::Button _more_info_button; + Gtk::Label _short_description_label; + Gtk::Label _template_author_label; + Gtk::Label _template_name_label; + Gtk::Image _preview_image; +}; + +} +} + +#endif diff --git a/src/ui/dialog/template-load-tab.cpp b/src/ui/dialog/template-load-tab.cpp new file mode 100644 index 000000000..a7b5e63f3 --- /dev/null +++ b/src/ui/dialog/template-load-tab.cpp @@ -0,0 +1,107 @@ +#include +#include + +#include "template-load-tab.h" + +namespace Inkscape { +namespace UI { + + +TemplateLoadTab::TemplateLoadTab() + : _keywords_combo(true) +{ + set_border_width(10); + + Gtk::Label *title; + title = manage(new Gtk::Label("Search Tags:")); + _templates_column.pack_start(*title, Gtk::PACK_SHRINK, 10); + + _templates_column.pack_start(_keywords_combo, Gtk::PACK_SHRINK, 0); + + title = manage(new Gtk::Label("Templates")); + _templates_column.pack_start(*title, Gtk::PACK_SHRINK, 10); + + title = manage(new Gtk::Label("Selected template")); + _template_info_column.pack_start(*title, Gtk::PACK_SHRINK, 10); + + _initLists(); + + add(_main_box); + _main_box.pack_start(_templates_column, Gtk::PACK_SHRINK, 20); + _main_box.pack_start(_template_info_column, Gtk::PACK_EXPAND_WIDGET, 10); + + _templates_column.pack_start(_templates_view, Gtk::PACK_SHRINK, 5); + + Glib::RefPtr templateSelectionRef = + _templates_view.get_selection(); + + templateSelectionRef->signal_changed().connect( + sigc::mem_fun(*this, &TemplateLoadTab::_displayTemplateInfo)); + + _keywords_combo.signal_changed().connect( + sigc::mem_fun(*this, &TemplateLoadTab::_keywordSelected)); + this->show_all(); +} + + +TemplateLoadTab::~TemplateLoadTab() +{ +} + + +void TemplateLoadTab::createTemplate() +{ + std::cout << "Default Template Tab" << std::endl; +} + + +void TemplateLoadTab::_displayTemplateInfo() +{ + Glib::RefPtr templateSelectionRef = _templates_view.get_selection(); + if (templateSelectionRef->get_selected()) { + _current_template = (*templateSelectionRef->get_selected())[_templates_columns.textValue]; + } +} + + +void TemplateLoadTab::_initKeywordsList() +{ + _keywords_combo.append_text("All"); + + for (int i = 0 ; i < 10 ; ++i) { + _keywords_combo.append_text( "Keyword" + Glib::ustring::format(i)); + } +} + + +void TemplateLoadTab::_initLists() +{ + _templates_ref = Gtk::ListStore::create(_templates_columns); + _templates_view.set_model(_templates_ref); + _templates_view.append_column("", _templates_columns.textValue); + _templates_view.set_headers_visible(false); + + _initKeywordsList(); + _refreshTemplatesList(); +} + + +void TemplateLoadTab::_keywordSelected() +{ + _current_keyword = _keywords_combo.get_active_text(); + _refreshTemplatesList(); +} + + +void TemplateLoadTab::_refreshTemplatesList() +{ + _templates_ref->clear(); + for (int i = 0 ; i < 7 ; ++i) { + Gtk::TreeModel::iterator iter = _templates_ref->append(); + Gtk::TreeModel::Row row = *iter; + row[_templates_columns.textValue] = "Template" + Glib::ustring::format(i); + } +} + +} +} diff --git a/src/ui/dialog/template-load-tab.h b/src/ui/dialog/template-load-tab.h new file mode 100644 index 000000000..a9fa7c313 --- /dev/null +++ b/src/ui/dialog/template-load-tab.h @@ -0,0 +1,59 @@ +#ifndef INKSCAPE_SEEN_UI_DIALOG_TEMPLATE_LOAD_TAB_H +#define INKSCAPE_SEEN_UI_DIALOG_TEMPLATE_LOAD_TAB_H + +#include +#include +#include +#include +#include + +namespace Inkscape { +namespace UI { + + +class TemplateLoadTab : public Gtk::Frame +{ + +public: + TemplateLoadTab(); + virtual ~TemplateLoadTab(); + virtual void createTemplate(); + +protected: + class StringModelColumns : public Gtk::TreeModelColumnRecord + { + public: + StringModelColumns() + { + add(textValue); + } + + Gtk::TreeModelColumn textValue; + }; + + Glib::ustring _current_keyword; + Glib::ustring _current_template; + + virtual void _displayTemplateInfo(); + virtual void _initKeywordsList(); + virtual void _refreshTemplatesList(); + + void _initLists(); + void _keywordSelected(); + + Gtk::HBox _main_box; + Gtk::VBox _templates_column; + Gtk::VBox _template_info_column; + + Gtk::ComboBoxText _keywords_combo; + + Gtk::TreeView _templates_view; + Glib::RefPtr _templates_ref; + StringModelColumns _templates_columns; + +}; + +} +} + +#endif diff --git a/src/verbs.cpp b/src/verbs.cpp index 6f83b3dfb..a3d8b07a2 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -79,6 +79,7 @@ #include "ui/dialog/inkscape-preferences.h" #include "ui/dialog/layer-properties.h" #include "ui/dialog/layers.h" +#include "ui/dialog/new-from-template.h" #include "ui/dialog/object-properties.h" #include "ui/dialog/swatches.h" #include "ui/dialog/symbols.h" @@ -860,6 +861,9 @@ void FileVerb::perform(SPAction *action, void *data) case SP_VERB_FILE_QUIT: sp_file_exit(); break; + case SP_VERB_FILE_TEMPLATES: + sp_file_new_from_templatee(); + break; default: break; } @@ -2323,6 +2327,8 @@ Verb *Verb::_base_verbs[] = { new FileVerb(SP_VERB_FILE_CLOSE_VIEW, "FileClose", N_("_Close"), N_("Close this document window"), GTK_STOCK_CLOSE), new FileVerb(SP_VERB_FILE_QUIT, "FileQuit", N_("_Quit"), N_("Quit Inkscape"), GTK_STOCK_QUIT), + new FileVerb(SP_VERB_FILE_TEMPLATES, "FileTemplates", N_("_Templates..."), + N_("Create new project from template"), INKSCAPE_ICON("dialog-templates")), // Edit new EditVerb(SP_VERB_EDIT_UNDO, "EditUndo", N_("_Undo"), N_("Undo last action"), diff --git a/src/verbs.h b/src/verbs.h index dab524d7a..3c1625c84 100644 --- a/src/verbs.h +++ b/src/verbs.h @@ -56,6 +56,7 @@ enum { SP_VERB_FILE_PREV_DESKTOP, SP_VERB_FILE_CLOSE_VIEW, SP_VERB_FILE_QUIT, + SP_VERB_FILE_TEMPLATES, /* Edit */ SP_VERB_EDIT_UNDO, SP_VERB_EDIT_REDO, -- cgit v1.2.3 From ec3d3965f0aa7444d42fc8765abbc9c3ed0916ce Mon Sep 17 00:00:00 2001 From: Slagvi Public Date: Wed, 3 Jul 2013 13:35:06 +0200 Subject: Templates menu item fixed (bzr r12379.2.6) --- src/file.cpp | 8 ++++++++ src/ui/dialog/new-from-template.h | 2 +- src/ui/dialog/static-template-load-tab.cpp | 3 ++- src/ui/dialog/static-template-load-tab.h | 3 +-- src/ui/dialog/template-load-tab.cpp | 7 ++++--- 5 files changed, 16 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/file.cpp b/src/file.cpp index 5b4110253..7f8bfc8bf 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -66,6 +66,7 @@ #include "verbs.h" #include "event-log.h" #include "ui/dialog/font-substitution.h" +#include "ui/dialog/new-from-template.h" #include @@ -199,6 +200,13 @@ SPDesktop* sp_file_new_default() return desk; } +SPDesktop* sp_file_new_from_templatee() +{ + Inkscape::UI::NewFromTemplate dl; + dl.run(); + return sp_file_new_default(); +} + /*###################### ## D E L E T E ######################*/ diff --git a/src/ui/dialog/new-from-template.h b/src/ui/dialog/new-from-template.h index ef3cbce18..f8c4bbb37 100644 --- a/src/ui/dialog/new-from-template.h +++ b/src/ui/dialog/new-from-template.h @@ -1,8 +1,8 @@ #ifndef INKSCAPE_SEEN_UI_DIALOG_NEW_FROM_TEMPLATE_H #define INKSCAPE_SEEN_UI_DIALOG_NEW_FROM_TEMPLATE_H -#include #include +#include #include #include "template-load-tab.h" diff --git a/src/ui/dialog/static-template-load-tab.cpp b/src/ui/dialog/static-template-load-tab.cpp index 83ff32e52..94298bf1d 100644 --- a/src/ui/dialog/static-template-load-tab.cpp +++ b/src/ui/dialog/static-template-load-tab.cpp @@ -1,9 +1,10 @@ +#include "static-template-load-tab.h" + #include #include #include #include -#include "static-template-load-tab.h" namespace Inkscape { namespace UI { diff --git a/src/ui/dialog/static-template-load-tab.h b/src/ui/dialog/static-template-load-tab.h index 651f146a0..a1a3adf7b 100644 --- a/src/ui/dialog/static-template-load-tab.h +++ b/src/ui/dialog/static-template-load-tab.h @@ -1,12 +1,11 @@ #ifndef INKSCAPE_SEEN_UI_DIALOG_STATIC_TEMPLATE_LOAD_TAB_H #define INKSCAPE_SEEN_UI_DIALOG_STATIC_TEMPLATE_LOAD_TAB_H +#include "template-load-tab.h" #include #include #include -#include "template-load-tab.h" - namespace Inkscape { namespace UI { diff --git a/src/ui/dialog/template-load-tab.cpp b/src/ui/dialog/template-load-tab.cpp index a7b5e63f3..5d4c3a364 100644 --- a/src/ui/dialog/template-load-tab.cpp +++ b/src/ui/dialog/template-load-tab.cpp @@ -1,7 +1,7 @@ +#include "template-load-tab.h" #include #include -#include "template-load-tab.h" namespace Inkscape { namespace UI { @@ -66,10 +66,11 @@ void TemplateLoadTab::_displayTemplateInfo() void TemplateLoadTab::_initKeywordsList() { - _keywords_combo.append_text("All"); + _keywords_combo.append("All"); + // _keywords_combo for (int i = 0 ; i < 10 ; ++i) { - _keywords_combo.append_text( "Keyword" + Glib::ustring::format(i)); + _keywords_combo.append( "Keyword" + Glib::ustring::format(i)); } } -- cgit v1.2.3 From 419d9398abf7b8bae74548d5b2bbd8554b36a9b3 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Wed, 3 Jul 2013 12:59:04 -0400 Subject: Make handle colour a configurable property. (bzr r12401) --- src/seltrans-handles.cpp | 13 +++++++------ src/seltrans-handles.h | 4 ++++ src/seltrans.cpp | 13 ++++--------- src/seltrans.h | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/seltrans-handles.cpp b/src/seltrans-handles.cpp index cc11125f6..bacb1301e 100644 --- a/src/seltrans-handles.cpp +++ b/src/seltrans-handles.cpp @@ -6,14 +6,16 @@ #endif SPSelTransTypeInfo const handtypes[] = { - {N_("Squeeze or stretch selection; with Ctrl to scale uniformly; with Shift to scale around rotation center") }, - {N_("Scale selection; with Ctrl to scale uniformly; with Shift to scale around rotation center") }, - {N_("Skew selection; with Ctrl to snap angle; with Shift to skew around the opposite side") }, - {N_("Rotate selection; with Ctrl to snap angle; with Shift to rotate around the opposite corner") }, - {N_("Center of rotation and skewing: drag to reposition; scaling with Shift also uses this center") } + { DEF_COLOR, N_("Squeeze or stretch selection; with Ctrl to scale uniformly; with Shift to scale around rotation center") }, + { DEF_COLOR, N_("Scale selection; with Ctrl to scale uniformly; with Shift to scale around rotation center") }, + { DEF_COLOR, N_("Skew selection; with Ctrl to snap angle; with Shift to skew around the opposite side") }, + { DEF_COLOR, N_("Rotate selection; with Ctrl to snap angle; with Shift to rotate around the opposite corner") }, + { CEN_COLOR, N_("Center of rotation and skewing: drag to reposition; scaling with Shift also uses this center") } }; SPSelTransHandle const hands[] = { +//center handle will be 0 so we can reference it quickly. + {HANDLE_CENTER, SP_ANCHOR_CENTER, GDK_CROSSHAIR, 12, 0.5, 0.5}, //handle-type anchor cursor control x y {HANDLE_STRETCH, SP_ANCHOR_S, GDK_TOP_SIDE, 3, 0.5, 1}, {HANDLE_STRETCH, SP_ANCHOR_W, GDK_RIGHT_SIDE, 2, 1, 0.5}, @@ -31,7 +33,6 @@ SPSelTransHandle const hands[] = { {HANDLE_ROTATE, SP_ANCHOR_SW, GDK_EXCHANGE, 6, 1, 1}, {HANDLE_ROTATE, SP_ANCHOR_NW, GDK_EXCHANGE, 8, 1, 0}, {HANDLE_ROTATE, SP_ANCHOR_NE, GDK_EXCHANGE, 10, 0, 0}, - {HANDLE_CENTER, SP_ANCHOR_CENTER, GDK_CROSSHAIR, 12, 0.5, 0.5} }; /* diff --git a/src/seltrans-handles.h b/src/seltrans-handles.h index ef285392b..5c3fdd269 100644 --- a/src/seltrans-handles.h +++ b/src/seltrans-handles.h @@ -21,6 +21,9 @@ namespace Inkscape class SelTrans; } +guint32 const DEF_COLOR[] = { 0xff, 0xff6600, 0xff6600, 0xff, 0xff, 0xff }; +guint32 const CEN_COLOR[] = { 0x0, 0x0, 0x0, 0xff, 0xff0000b0, 0xff0000b0 }; + enum SPSelTransType { HANDLE_STRETCH, HANDLE_SCALE, @@ -30,6 +33,7 @@ enum SPSelTransType { }; struct SPSelTransTypeInfo { + uint const *color; gchar const *tip; }; // One per handle type in order diff --git a/src/seltrans.cpp b/src/seltrans.cpp index 016eba816..33bfe3e4a 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -635,23 +635,18 @@ void Inkscape::SelTrans::_showHandles(SPSelTransType type) void Inkscape::SelTrans::_makeHandles() { for (int i = 0; i < NUMHANDS; i++) { - knots[i] = sp_knot_new(_desktop, handtypes[hands[i].type].tip); + SPSelTransTypeInfo info = handtypes[hands[i].type]; + knots[i] = sp_knot_new(_desktop, info.tip); knots[i]->setShape(SP_CTRL_SHAPE_BITMAP); knots[i]->setSize(13); knots[i]->setAnchor(hands[i].anchor); knots[i]->setMode(SP_CTRL_MODE_XOR); - knots[i]->setFill(0x000000ff, 0x00ff6600, 0x00ff6600); // invert+2*green - knots[i]->setStroke(0x000000ff, 0x000000ff, 0x000000ff); // 3*invert + knots[i]->setFill(info.color[0], info.color[1], info.color[2]); + knots[i]->setStroke(info.color[3], info.color[4], info.color[5]); knots[i]->setPixbuf(handles[hands[i].control]); sp_knot_update_ctrl(knots[i]); - if( hands[i].type == HANDLE_CENTER ) { - _center_handle = i; - knots[i]->setFill(0x00000000, 0x00000000, 0x00000000); - knots[i]->setStroke(0x000000ff, 0xff0000b0, 0xff0000b0); - } - g_signal_connect(G_OBJECT(knots[i]), "request", G_CALLBACK(sp_sel_trans_handle_request), (gpointer) &hands[i]); g_signal_connect(G_OBJECT(knots[i]), "moved", diff --git a/src/seltrans.h b/src/seltrans.h index 9cf4a7aaf..667dedaf0 100644 --- a/src/seltrans.h +++ b/src/seltrans.h @@ -93,7 +93,7 @@ public: return _grabbed; } bool centerIsVisible() { - return ( _center_handle && SP_KNOT_IS_VISIBLE (knots[_center_handle]) ); + return ( SP_KNOT_IS_VISIBLE (knots[0]) ); } void getNextClosestPoint(bool reverse); -- cgit v1.2.3 From 09ce234c1fc367a2607936e6cf106cb24c60e94f Mon Sep 17 00:00:00 2001 From: Eric Greveson Date: Wed, 3 Jul 2013 20:06:11 +0100 Subject: Modified dbus interface so that it works in console mode (--dbus-listen) Modified action context setup so that in console mode, when a document is added to the main inkscape app instance, it gets a selection model and layer model automatically set up for it Made a couple more verbs work in console mode (bzr r12387.1.4) --- src/extension/dbus/application-interface.cpp | 9 + src/extension/dbus/application-interface.h | 4 + src/extension/dbus/application-interface.xml | 18 +- src/extension/dbus/dbus-init.cpp | 40 ++- src/extension/dbus/dbus-init.h | 5 +- src/extension/dbus/document-interface.cpp | 361 +++++++++++++++------------ src/extension/dbus/document-interface.h | 10 +- src/file.cpp | 33 ++- src/file.h | 2 +- src/helper/action-context.cpp | 10 + src/helper/action-context.h | 11 + src/helper/action.cpp | 17 +- src/helper/action.h | 2 + src/inkscape.cpp | 54 ++++ src/inkscape.h | 11 + src/main.cpp | 53 +++- src/select-context.cpp | 32 +-- src/selection-chemistry.cpp | 37 +-- src/selection-chemistry.h | 6 +- src/verbs.cpp | 74 ++++-- 20 files changed, 536 insertions(+), 253 deletions(-) (limited to 'src') diff --git a/src/extension/dbus/application-interface.cpp b/src/extension/dbus/application-interface.cpp index 8ee7bd12f..399e1b244 100644 --- a/src/extension/dbus/application-interface.cpp +++ b/src/extension/dbus/application-interface.cpp @@ -18,6 +18,7 @@ #include "application-interface.h" #include #include "dbus-init.h" +#include "file.h" G_DEFINE_TYPE(ApplicationInterface, application_interface, G_TYPE_OBJECT) @@ -131,6 +132,7 @@ application_interface_desktop_close_all (ApplicationInterface *object, gboolean application_interface_exit (ApplicationInterface *object, GError **error) { + sp_file_exit(); return TRUE; } @@ -144,6 +146,13 @@ gchar* application_interface_document_new (ApplicationInterface *object, return (gchar*)Inkscape::Extension::Dbus::init_document(); } +gchar* +application_interface_get_active_document(ApplicationInterface *object, + GError **error) +{ + return (gchar*)Inkscape::Extension::Dbus::init_active_document(); +} + gchar** application_interface_get_document_list (ApplicationInterface *object) { diff --git a/src/extension/dbus/application-interface.h b/src/extension/dbus/application-interface.h index 88219a6b0..b01fee912 100644 --- a/src/extension/dbus/application-interface.h +++ b/src/extension/dbus/application-interface.h @@ -97,6 +97,10 @@ gchar* application_interface_document_new (ApplicationInterface *object, GError **error); +gchar* +application_interface_get_active_document(ApplicationInterface *object, + GError **error); + gchar** application_interface_get_document_list (ApplicationInterface *object); diff --git a/src/extension/dbus/application-interface.xml b/src/extension/dbus/application-interface.xml index ee2c4837b..4185c7e53 100644 --- a/src/extension/dbus/application-interface.xml +++ b/src/extension/dbus/application-interface.xml @@ -32,7 +32,7 @@ - Create a new document interface and return it's location. + Create a new document interface and return its location. @@ -59,7 +59,7 @@ - Exit Inkscape without saving. Fairly straightforward. + Exit Inkscape without saving (in GUI mode). Fairly straightforward. @@ -76,6 +76,20 @@ Originally, there were going to be two interfaces. A desktop and a document. Desktops would be used when the user wanted to see the result of their code and documents would be used when less overhead was desired. Unfortunately as more and more of the code can to rely on the desktop and it's associated support code (including selections and verbs) the document interface was looking more and more limited. Ultimately I decided to just go with the desktop interface since I didn't have a compelling reason for keeping the other one and having two similar interfaces could be very confusing. The desktop interface inherited the document name because I believe it's more familiar to people. Perhaps it would be best to have an option as to whether or not to create a window and fail with a good error message when they call a function that requires one. Or have a second interface for different use cases but have it be completely different, rather than a subset of the first if there are use cases that support it. + UPDATE: 3rd July 2013, Eric Greveson: After having done some initial work to attempt to decouple Inkscape "verbs" from desktops, it is now possible to run a limited subset of actions in command-line mode (with a selection model and document, but no desktop). I believe that the "single document interface" approach, with some functions that may require a GUI, is the better path, and so document interfaces without a desktop are now possible. Most functions still require the desktop to work, though, with the notable exception of selection methods and Boolean operations. + + + + + + + + This string can be used to connect to the current active document. + + + + + Get the location of the current active document (e.g. when running in console mode, when desktops are not available). diff --git a/src/extension/dbus/dbus-init.cpp b/src/extension/dbus/dbus-init.cpp index 9ff6897e5..96d72c0f6 100644 --- a/src/extension/dbus/dbus-init.cpp +++ b/src/extension/dbus/dbus-init.cpp @@ -108,7 +108,11 @@ init_document (void) { doc = SPDocument::createNewDoc(NULL, 1, TRUE); std::string name("/org/inkscape/"); - name.append(doc->getName()); + // This only works because a new document's name happens to contain + // only valid DBus characters [A-Z][a-z][0-9]_ + // TODO: use the document->serial() instead, like below, and similar to + // how desktops work? + name.append(doc->getName()); std::replace(name.begin(), name.end(), ' ', '_'); connection = dbus_get_connection(); @@ -122,6 +126,38 @@ init_document (void) { return strdup(name.c_str()); } //init_document +gchar * +init_active_document() +{ + SPDocument *doc = inkscape_active_document(); + if (!doc) { + return NULL; + } + + // Document name is not suitable for DBus name, as it might contain invalid chars + std::string name("/org/inkscape/document_"); + std::stringstream ss; + ss << doc->serial(); + name.append(ss.str()); + + DBusGConnection *connection = dbus_get_connection(); + DBusGProxy *proxy = dbus_get_proxy(connection); + + // Has the active document already been registered? + if (!dbus_g_connection_lookup_g_object(connection, name.c_str())) { + // No - register it + DocumentInterface *obj = (DocumentInterface*) dbus_register_object (connection, + proxy, + TYPE_DOCUMENT_INTERFACE, + &dbus_glib_document_interface_object_info, + name.c_str()); + + // Set the document info for this interface + obj->context = inkscape_active_action_context(); + } + return strdup(name.c_str()); +} + gchar * dbus_init_desktop_interface (SPDesktop * dt) { @@ -142,7 +178,7 @@ dbus_init_desktop_interface (SPDesktop * dt) obj = (DocumentInterface*) dbus_register_object (connection, proxy, TYPE_DOCUMENT_INTERFACE, &dbus_glib_document_interface_object_info, name.c_str()); - obj->desk = dt; + obj->context = Inkscape::ActionContext(dt); obj->updates = TRUE; dt->dbus_document_interface=obj; return strdup(name.c_str()); diff --git a/src/extension/dbus/dbus-init.h b/src/extension/dbus/dbus-init.h index 025011f28..486e55b86 100644 --- a/src/extension/dbus/dbus-init.h +++ b/src/extension/dbus/dbus-init.h @@ -10,8 +10,7 @@ #ifndef INKSCAPE_EXTENSION_DBUS_INIT_H__ #define INKSCAPE_EXTENSION_DBUS_INIT_H__ -#include "desktop.h" - +class SPDesktop; namespace Inkscape { namespace Extension { @@ -23,6 +22,8 @@ void init (void); gchar * init_document (void); +gchar * init_active_document (); + gchar * init_desktop (void); gchar * dbus_init_desktop_interface (SPDesktop * dt); diff --git a/src/extension/dbus/document-interface.cpp b/src/extension/dbus/document-interface.cpp index bdf1fa98c..f0cc71de1 100644 --- a/src/extension/dbus/document-interface.cpp +++ b/src/extension/dbus/document-interface.cpp @@ -20,6 +20,7 @@ #include "application-interface.h" #include #include +#include "desktop.h" #include "desktop-handles.h" //sp_desktop_document() #include "desktop-style.h" //sp_desktop_get_style #include "display/canvas-text.h" //text @@ -33,6 +34,7 @@ #include "helper/action-context.h" #include "inkscape.h" //inkscape_find_desktop_by_dkey, activate desktops #include "layer-fns.h" //LPOS_BELOW +#include "layer-model.h" #include "live_effects/parameter/text.h" //text #include "print.h" //IO #include "selection-chemistry.h"// lots of selection functions @@ -92,12 +94,12 @@ * place to adjust things. */ Inkscape::XML::Node * -get_repr_by_name (SPDesktop *desk, gchar *name, GError **error) +get_repr_by_name (SPDocument *doc, gchar *name, GError **error) { /* ALTERNATIVE (is this faster if only repr is needed?) Inkscape::XML::Node *node = sp_repr_lookup_name((doc->root)->repr, name); */ - SPObject * obj = sp_desktop_document(desk)->getObjectById(name); + SPObject * obj = doc->getObjectById(name); if (!obj) { g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OBJECT, "Object '%s' not found in document.", name); @@ -110,9 +112,9 @@ get_repr_by_name (SPDesktop *desk, gchar *name, GError **error) * See comment for get_repr_by_name, above. */ SPObject * -get_object_by_name (SPDesktop *desk, gchar *name, GError **error) +get_object_by_name (SPDocument *doc, gchar *name, GError **error) { - SPObject * obj = sp_desktop_document(desk)->getObjectById(name); + SPObject * obj = doc->getObjectById(name); if (!obj) { g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OBJECT, "Object '%s' not found in document.", name); @@ -184,12 +186,11 @@ selection_get_center_y (Inkscape::Selection *sel){ * they might see the selection box flicker if used in a loop. */ const GSList * -selection_swap(SPDesktop *desk, gchar *name, GError **error) +selection_swap(Inkscape::Selection *sel, gchar *name, GError **error) { - Inkscape::Selection *sel = sp_desktop_selection(desk); const GSList *oldsel = g_slist_copy((GSList *)sel->list()); - sel->set(get_object_by_name(desk, name, error)); + sel->set(get_object_by_name(sel->layerModel()->getDocument(), name, error)); return oldsel; } @@ -197,9 +198,8 @@ selection_swap(SPDesktop *desk, gchar *name, GError **error) * See selection_swap, above */ void -selection_restore(SPDesktop *desk, const GSList * oldsel) +selection_restore(Inkscape::Selection *sel, const GSList * oldsel) { - Inkscape::Selection *sel = sp_desktop_selection(desk); sel->setList(oldsel); } @@ -207,9 +207,8 @@ selection_restore(SPDesktop *desk, const GSList * oldsel) * Shortcut for creating a Node. */ Inkscape::XML::Node * -dbus_create_node (SPDesktop *desk, const gchar *type) +dbus_create_node (SPDocument *doc, const gchar *type) { - SPDocument * doc = sp_desktop_document (desk); Inkscape::XML::Document *xml_doc = doc->getReprDoc(); return xml_doc->createElement(type); @@ -224,8 +223,10 @@ dbus_create_node (SPDesktop *desk, const gchar *type) */ gchar *finish_create_shape (DocumentInterface *object, GError ** /*error*/, Inkscape::XML::Node *newNode, gchar *desc) { - SPCSSAttr *style = sp_desktop_get_style(object->desk, TRUE); - + SPCSSAttr *style = NULL; + if (object->context.getDesktop()) { + style = sp_desktop_get_style(object->context.getDesktop(), TRUE); + } if (style) { Glib::ustring str; sp_repr_css_write_string(style, str); @@ -235,11 +236,11 @@ gchar *finish_create_shape (DocumentInterface *object, GError ** /*error*/, Inks newNode->setAttribute("style", "fill:#0000ff;fill-opacity:1;stroke:#c900b9;stroke-width:0;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none", TRUE); } - object->desk->currentLayer()->appendChildRepr(newNode); - object->desk->currentLayer()->updateRepr(); + object->context.getSelection()->layerModel()->currentLayer()->appendChildRepr(newNode); + object->context.getSelection()->layerModel()->currentLayer()->updateRepr(); if (object->updates) { - Inkscape::DocumentUndo::done(sp_desktop_document(object->desk), 0, (gchar *)desc); + Inkscape::DocumentUndo::done(object->context.getDocument(), 0, (gchar *)desc); //} else { //document_interface_pause_updates(object, error); } @@ -258,23 +259,22 @@ gchar *finish_create_shape (DocumentInterface *object, GError ** /*error*/, Inks gboolean dbus_call_verb (DocumentInterface *object, int verbid, GError **error) { - SPDesktop *desk2 = object->desk; - desktop_ensure_active (desk2); - - if ( desk2 ) { - Inkscape::Verb *verb = Inkscape::Verb::get( verbid ); - if ( verb ) { - SPAction *action = verb->get_action(Inkscape::ActionContext(desk2)); - if ( action ) { - //if (!object->updates) - //document_interface_pause_updates (object, error); - sp_action_perform( action, NULL ); - if (object->updates) - Inkscape::DocumentUndo::done(sp_desktop_document(desk2), verb->get_code(), g_strdup(verb->get_tip())); - //if (!object->updates) - //document_interface_pause_updates (object, error); - return TRUE; - } + SPDesktop *desk = object->context.getDesktop(); + if ( desk ) { + desktop_ensure_active (desk); + } + Inkscape::Verb *verb = Inkscape::Verb::get( verbid ); + if ( verb ) { + SPAction *action = verb->get_action(object->context); + if ( action ) { + //if (!object->updates) + //document_interface_pause_updates (object, error); + sp_action_perform( action, NULL ); + if (object->updates) + Inkscape::DocumentUndo::done(object->context.getDocument(), verb->get_code(), g_strdup(verb->get_tip())); + //if (!object->updates) + //document_interface_pause_updates (object, error); + return TRUE; } } g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_VERB, "Verb failed to execute"); @@ -313,7 +313,7 @@ document_interface_class_init (DocumentInterfaceClass *klass) static void document_interface_init (DocumentInterface *object) { - object->desk = NULL; + object->context = Inkscape::ActionContext(); } @@ -331,26 +331,26 @@ document_interface_new (void) gboolean document_interface_delete_all(DocumentInterface *object, GError ** /*error*/) { - sp_edit_clear_all(object->desk); + sp_edit_clear_all(object->context.getSelection()); return TRUE; } gboolean document_interface_call_verb (DocumentInterface *object, gchar *verbid, GError **error) { - SPDesktop *desk2 = object->desk; - desktop_ensure_active (object->desk); - if ( desk2 ) { - Inkscape::Verb *verb = Inkscape::Verb::getbyid( verbid ); - if ( verb ) { - SPAction *action = verb->get_action(Inkscape::ActionContext(desk2)); - if ( action ) { - sp_action_perform( action, NULL ); - if (object->updates) { - Inkscape::DocumentUndo::done(sp_desktop_document(desk2), verb->get_code(), g_strdup(verb->get_tip())); - } - return TRUE; + SPDesktop *desk = object->context.getDesktop(); + if ( desk ) { + desktop_ensure_active (desk); + } + Inkscape::Verb *verb = Inkscape::Verb::getbyid( verbid ); + if ( verb ) { + SPAction *action = verb->get_action(object->context); + if ( action ) { + sp_action_perform( action, NULL ); + if (object->updates) { + Inkscape::DocumentUndo::done(object->context.getDocument(), verb->get_code(), g_strdup(verb->get_tip())); } + return TRUE; } } g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_VERB, "Verb '%s' failed to execute or was not found.", verbid); @@ -368,7 +368,7 @@ document_interface_rectangle (DocumentInterface *object, int x, int y, { - Inkscape::XML::Node *newNode = dbus_create_node(object->desk, "svg:rect"); + Inkscape::XML::Node *newNode = dbus_create_node(object->context.getDocument(), "svg:rect"); sp_repr_set_int(newNode, "x", x); //could also use newNode->setAttribute() sp_repr_set_int(newNode, "y", y); sp_repr_set_int(newNode, "width", width); @@ -380,7 +380,7 @@ gchar* document_interface_ellipse_center (DocumentInterface *object, int cx, int cy, int rx, int ry, GError **error) { - Inkscape::XML::Node *newNode = dbus_create_node(object->desk, "svg:path"); + Inkscape::XML::Node *newNode = dbus_create_node(object->context.getDocument(), "svg:path"); newNode->setAttribute("sodipodi:type", "arc"); sp_repr_set_int(newNode, "sodipodi:cx", cx); sp_repr_set_int(newNode, "sodipodi:cy", cy); @@ -395,7 +395,7 @@ document_interface_polygon (DocumentInterface *object, int cx, int cy, GError **error) { gdouble rot = ((rotation / 180.0) * 3.14159265) - ( 3.14159265 / 2.0); - Inkscape::XML::Node *newNode = dbus_create_node(object->desk, "svg:path"); + Inkscape::XML::Node *newNode = dbus_create_node(object->context.getDocument(), "svg:path"); newNode->setAttribute("inkscape:flatsided", "true"); newNode->setAttribute("sodipodi:type", "star"); sp_repr_set_int(newNode, "sodipodi:cx", cx); @@ -416,7 +416,7 @@ document_interface_star (DocumentInterface *object, int cx, int cy, int r1, int r2, int sides, gdouble rounded, gdouble arg1, gdouble arg2, GError **error) { - Inkscape::XML::Node *newNode = dbus_create_node(object->desk, "svg:path"); + Inkscape::XML::Node *newNode = dbus_create_node(object->context.getDocument(), "svg:path"); newNode->setAttribute("inkscape:flatsided", "false"); newNode->setAttribute("sodipodi:type", "star"); sp_repr_set_int(newNode, "sodipodi:cx", cx); @@ -445,7 +445,7 @@ gchar* document_interface_line (DocumentInterface *object, int x, int y, int x2, int y2, GError **error) { - Inkscape::XML::Node *newNode = dbus_create_node(object->desk, "svg:path"); + Inkscape::XML::Node *newNode = dbus_create_node(object->context.getDocument(), "svg:path"); std::stringstream out; // Not sure why this works. out << "m " << x << "," << y << " " << x2 - x << "," << y2 - y; @@ -457,7 +457,7 @@ gchar* document_interface_spiral (DocumentInterface *object, int cx, int cy, int r, int revolutions, GError **error) { - Inkscape::XML::Node *newNode = dbus_create_node(object->desk, "svg:path"); + Inkscape::XML::Node *newNode = dbus_create_node(object->context.getDocument(), "svg:path"); newNode->setAttribute("sodipodi:type", "spiral"); sp_repr_set_int(newNode, "sodipodi:cx", cx); sp_repr_set_int(newNode, "sodipodi:cy", cy); @@ -478,13 +478,13 @@ gchar* document_interface_text (DocumentInterface *object, int x, int y, gchar *text, GError **error) { - Inkscape::XML::Node *text_node = dbus_create_node(object->desk, "svg:text"); + Inkscape::XML::Node *text_node = dbus_create_node(object->context.getDocument(), "svg:text"); sp_repr_set_int(text_node, "x", x); sp_repr_set_int(text_node, "y", y); //just a workaround so i can get an spitem from the name gchar *name = finish_create_shape (object, error, text_node, (gchar *)"create text"); - SPItem* text_obj=(SPItem* )get_object_by_name(object->desk, name, error); + SPItem* text_obj=(SPItem* )get_object_by_name(object->context.getDocument(), name, error); sp_te_set_repr_text_multiline(text_obj, text); return name; @@ -497,16 +497,16 @@ document_interface_image (DocumentInterface *object, int x, int y, gchar *filena if (!uri) return FALSE; - Inkscape::XML::Node *newNode = dbus_create_node(object->desk, "svg:image"); + Inkscape::XML::Node *newNode = dbus_create_node(object->context.getDocument(), "svg:image"); sp_repr_set_int(newNode, "x", x); sp_repr_set_int(newNode, "y", y); newNode->setAttribute("xlink:href", uri); - object->desk->currentLayer()->appendChildRepr(newNode); - object->desk->currentLayer()->updateRepr(); + object->context.getSelection()->layerModel()->currentLayer()->appendChildRepr(newNode); + object->context.getSelection()->layerModel()->currentLayer()->updateRepr(); if (object->updates) - Inkscape::DocumentUndo::done(sp_desktop_document(object->desk), 0, "Imported bitmap."); + Inkscape::DocumentUndo::done(object->context.getDocument(), 0, "Imported bitmap."); //g_free(uri); return strdup(newNode->attribute("id")); @@ -514,16 +514,16 @@ document_interface_image (DocumentInterface *object, int x, int y, gchar *filena gchar *document_interface_node(DocumentInterface *object, gchar *type, GError ** /*error*/) { - SPDocument * doc = sp_desktop_document (object->desk); + SPDocument * doc = object->context.getDocument(); Inkscape::XML::Document *xml_doc = doc->getReprDoc(); Inkscape::XML::Node *newNode = xml_doc->createElement(type); - object->desk->currentLayer()->appendChildRepr(newNode); - object->desk->currentLayer()->updateRepr(); + object->context.getSelection()->layerModel()->currentLayer()->appendChildRepr(newNode); + object->context.getSelection()->layerModel()->currentLayer()->updateRepr(); if (object->updates) { - Inkscape::DocumentUndo::done(sp_desktop_document(object->desk), 0, (gchar *)"created empty node"); + Inkscape::DocumentUndo::done(doc, 0, (gchar *)"created empty node"); //} else { //document_interface_pause_updates(object, error); } @@ -537,39 +537,54 @@ gchar *document_interface_node(DocumentInterface *object, gchar *type, GError ** gdouble document_interface_document_get_width (DocumentInterface *object) { - return sp_desktop_document(object->desk)->getWidth(); + return object->context.getDocument()->getWidth(); } gdouble document_interface_document_get_height (DocumentInterface *object) { - return sp_desktop_document(object->desk)->getHeight(); + return object->context.getDocument()->getHeight(); } -gchar *document_interface_document_get_css(DocumentInterface *object, GError ** /*error*/) +gchar *document_interface_document_get_css(DocumentInterface *object, GError ** error) { - SPCSSAttr *current = (object->desk)->current; + SPDesktop *desk = object->context.getDesktop(); + if (!desk) { + g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Document get CSS requires a GUI"); + return NULL; + } + SPCSSAttr *current = desk->current; Glib::ustring str; sp_repr_css_write_string(current, str); return (str.empty() ? NULL : g_strdup (str.c_str())); } gboolean document_interface_document_merge_css(DocumentInterface *object, - gchar *stylestring, GError ** /*error*/) + gchar *stylestring, GError ** error) { + SPDesktop *desk = object->context.getDesktop(); + if (!desk) { + g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Document merge CSS requires a GUI"); + return FALSE; + } SPCSSAttr * style = sp_repr_css_attr_new(); sp_repr_css_attr_add_from_string(style, stylestring); - sp_desktop_set_style(object->desk, style); + sp_desktop_set_style(desk, style); return TRUE; } gboolean document_interface_document_set_css(DocumentInterface *object, - gchar *stylestring, GError ** /*error*/) + gchar *stylestring, GError ** error) { + SPDesktop *desk = object->context.getDesktop(); + if (!desk) { + g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Document set CSS requires a GUI"); + return FALSE; + } SPCSSAttr * style = sp_repr_css_attr_new(); sp_repr_css_attr_add_from_string (style, stylestring); //Memory leak? - object->desk->current = style; + desk->current = style; return TRUE; } @@ -589,19 +604,28 @@ document_interface_document_set_display_area (DocumentInterface *object, double border, GError **error) { - object->desk->set_display_area (x0, + SPDesktop *desk = object->context.getDesktop(); + if (!desk) { + g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Document set display area requires a GUI"); + return FALSE; + } + desk->set_display_area (x0, y0, x1, y1, border, false); - return TRUE; + return TRUE; } GArray * document_interface_document_get_display_area (DocumentInterface *object) { - Geom::Rect const d = object->desk->get_display_area(); + SPDesktop *desk = object->context.getDesktop(); + if (!desk) { + return NULL; + } + Geom::Rect const d = desk->get_display_area(); GArray * dArr = g_array_new (TRUE, TRUE, sizeof(double)); @@ -626,7 +650,7 @@ gboolean document_interface_set_attribute (DocumentInterface *object, char *shape, char *attribute, char *newval, GError **error) { - Inkscape::XML::Node *newNode = get_repr_by_name(object->desk, shape, error); + Inkscape::XML::Node *newNode = get_repr_by_name(object->context.getDocument(), shape, error); /* ALTERNATIVE (is this faster?) Inkscape::XML::Node *newnode = sp_repr_lookup_name((doc->root)->repr, name); @@ -646,7 +670,7 @@ document_interface_set_int_attribute (DocumentInterface *object, char *shape, char *attribute, int newval, GError **error) { - Inkscape::XML::Node *newNode = get_repr_by_name (object->desk, shape, error); + Inkscape::XML::Node *newNode = get_repr_by_name (object->context.getDocument(), shape, error); if (!newNode) return FALSE; @@ -660,7 +684,7 @@ document_interface_set_double_attribute (DocumentInterface *object, char *shape, char *attribute, double newval, GError **error) { - Inkscape::XML::Node *newNode = get_repr_by_name (object->desk, shape, error); + Inkscape::XML::Node *newNode = get_repr_by_name (object->context.getDocument(), shape, error); if (!dbus_check_string (attribute, error, "New value string was empty.")) return FALSE; @@ -675,7 +699,7 @@ gchar * document_interface_get_attribute (DocumentInterface *object, char *shape, char *attribute, GError **error) { - Inkscape::XML::Node *newNode = get_repr_by_name(object->desk, shape, error); + Inkscape::XML::Node *newNode = get_repr_by_name(object->context.getDocument(), shape, error); if (!dbus_check_string (attribute, error, "Attribute name empty.")) return NULL; @@ -689,11 +713,11 @@ gboolean document_interface_move (DocumentInterface *object, gchar *name, gdouble x, gdouble y, GError **error) { - const GSList *oldsel = selection_swap(object->desk, name, error); + const GSList *oldsel = selection_swap(object->context.getSelection(), name, error); if (!oldsel) return FALSE; - sp_selection_move (object->desk, x, 0 - y); - selection_restore(object->desk, oldsel); + sp_selection_move (object->context.getSelection(), x, 0 - y); + selection_restore(object->context.getSelection(), oldsel); return TRUE; } @@ -701,13 +725,13 @@ gboolean document_interface_move_to (DocumentInterface *object, gchar *name, gdouble x, gdouble y, GError **error) { - const GSList *oldsel = selection_swap(object->desk, name, error); + const GSList *oldsel = selection_swap(object->context.getSelection(), name, error); if (!oldsel) return FALSE; - Inkscape::Selection * sel = sp_desktop_selection(object->desk); - sp_selection_move (object->desk, x - selection_get_center_x(sel), + Inkscape::Selection * sel = object->context.getSelection(); + sp_selection_move (object->context.getSelection(), x - selection_get_center_x(sel), 0 - (y - selection_get_center_y(sel))); - selection_restore(object->desk, oldsel); + selection_restore(object->context.getSelection(), oldsel); return TRUE; } @@ -715,18 +739,18 @@ gboolean document_interface_object_to_path (DocumentInterface *object, char *shape, GError **error) { - const GSList *oldsel = selection_swap(object->desk, shape, error); + const GSList *oldsel = selection_swap(object->context.getSelection(), shape, error); if (!oldsel) return FALSE; dbus_call_verb (object, SP_VERB_OBJECT_TO_CURVE, error); - selection_restore(object->desk, oldsel); + selection_restore(object->context.getSelection(), oldsel); return TRUE; } gchar * document_interface_get_path (DocumentInterface *object, char *pathname, GError **error) { - Inkscape::XML::Node *node = get_repr_by_name(object->desk, pathname, error); + Inkscape::XML::Node *node = get_repr_by_name(object->context.getDocument(), pathname, error); if (!node) return NULL; @@ -763,7 +787,7 @@ document_interface_modify_css (DocumentInterface *object, gchar *shape, { // Doesn't like non-variable strings for some reason. gchar style[] = "style"; - Inkscape::XML::Node *node = get_repr_by_name(object->desk, shape, error); + Inkscape::XML::Node *node = get_repr_by_name(object->context.getDocument(), shape, error); if (!dbus_check_string (cssattrb, error, "Attribute string empty.")) return FALSE; @@ -784,7 +808,7 @@ document_interface_merge_css (DocumentInterface *object, gchar *shape, { gchar style[] = "style"; - Inkscape::XML::Node *node = get_repr_by_name(object->desk, shape, error); + Inkscape::XML::Node *node = get_repr_by_name(object->context.getDocument(), shape, error); if (!dbus_check_string (stylestring, error, "Style string empty.")) return FALSE; @@ -830,12 +854,12 @@ gboolean document_interface_move_to_layer (DocumentInterface *object, gchar *shape, gchar *layerstr, GError **error) { - const GSList *oldsel = selection_swap(object->desk, shape, error); + const GSList *oldsel = selection_swap(object->context.getSelection(), shape, error); if (!oldsel) return FALSE; document_interface_selection_move_to_layer(object, layerstr, error); - selection_restore(object->desk, oldsel); + selection_restore(object->context.getSelection(), oldsel); return TRUE; } @@ -843,7 +867,7 @@ GArray *document_interface_get_node_coordinates(DocumentInterface * /*object*/, { //FIXME: Needs lot's of work. /* - Inkscape::XML::Node *shapenode = get_repr_by_name (object->desk, shape, error); + Inkscape::XML::Node *shapenode = get_repr_by_name (object->context.getDocument(), shape, error); if (shapenode == NULL || shapenode->attribute("d") == NULL) { return FALSE; } @@ -861,7 +885,7 @@ gboolean document_interface_set_text (DocumentInterface *object, gchar *name, gchar *text, GError **error) { - SPItem* text_obj=(SPItem* )get_object_by_name(object->desk, name, error); + SPItem* text_obj=(SPItem* )get_object_by_name(object->context.getDocument(), name, error); //TODO verify object type if (!text_obj) return FALSE; @@ -878,7 +902,7 @@ document_interface_text_apply_style (DocumentInterface *object, gchar *name, GError **error) { - SPItem* text_obj=(SPItem* )get_object_by_name(object->desk, name, error); + SPItem* text_obj=(SPItem* )get_object_by_name(object->context.getDocument(), name, error); //void sp_te_apply_style(SPItem *text, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPCSSAttr const *css) //TODO verify object type @@ -907,7 +931,7 @@ document_interface_text_apply_style (DocumentInterface *object, gchar *name, gboolean document_interface_save (DocumentInterface *object, GError **error) { - SPDocument * doc = sp_desktop_document(object->desk); + SPDocument * doc = object->context.getDocument(); printf("1: %s\n2: %s\n3: %s\n", doc->getURI(), doc->getBase(), doc->getName()); if (doc->getURI()) return document_interface_save_as (object, doc->getURI(), error); @@ -917,11 +941,14 @@ document_interface_save (DocumentInterface *object, GError **error) gboolean document_interface_load(DocumentInterface *object, gchar *filename, GError ** /*error*/) { - desktop_ensure_active(object->desk); + SPDesktop *desk = object->context.getDesktop(); + if (desk) { + desktop_ensure_active(desk); + } const Glib::ustring file(filename); sp_file_open(file, NULL, TRUE, TRUE); if (object->updates) { - Inkscape::DocumentUndo::done(sp_desktop_document(object->desk), SP_VERB_FILE_OPEN, "Opened File"); + Inkscape::DocumentUndo::done(object->context.getDocument(), SP_VERB_FILE_OPEN, "Opened File"); } return TRUE; } @@ -930,9 +957,12 @@ gchar * document_interface_import (DocumentInterface *object, gchar *filename, GError **error) { - desktop_ensure_active (object->desk); + SPDesktop *desk = object->context.getDesktop(); + if (desk) { + desktop_ensure_active(desk); + } const Glib::ustring file(filename); - SPDocument * doc = sp_desktop_document(object->desk); + SPDocument * doc = object->context.getDocument(); SPObject *new_obj = NULL; new_obj = file_import(doc, file, NULL); @@ -943,7 +973,7 @@ gboolean document_interface_save_as (DocumentInterface *object, const gchar *filename, GError **error) { - SPDocument * doc = sp_desktop_document(object->desk); + SPDocument * doc = object->context.getDocument(); #ifdef WITH_GNOME_VFS const Glib::ustring file(filename); return file_save_remote(doc, file, NULL, TRUE, TRUE); @@ -967,7 +997,7 @@ document_interface_save_as (DocumentInterface *object, gboolean document_interface_mark_as_unmodified(DocumentInterface *object, GError ** /*error*/) { - SPDocument * doc = sp_desktop_document(object->desk); + SPDocument * doc = object->context.getDocument(); if (doc) { doc->modified_since_save = FALSE; } @@ -978,7 +1008,7 @@ gboolean document_interface_mark_as_unmodified(DocumentInterface *object, GError gboolean document_interface_print_to_file (DocumentInterface *object, GError **error) { - SPDocument * doc = sp_desktop_document(object->desk); + SPDocument * doc = object->context.getDocument(); sp_print_document_to_file (doc, g_strdup("/home/soren/test.pdf")); return TRUE; @@ -1021,39 +1051,55 @@ document_interface_redo (DocumentInterface *object, GError **error) Need to make sure it plays well with verbs because they are used so much. ****************************************************************************/ -void document_interface_pause_updates(DocumentInterface *object, GError ** /*error*/) +void document_interface_pause_updates(DocumentInterface *object, GError ** error) { + SPDesktop *desk = object->context.getDesktop(); + if (!desk) { + g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Document pause updates requires a GUI"); + return; + } object->updates = FALSE; - object->desk->canvas->drawing_disabled = 1; - //object->desk->canvas->need_redraw = 0; - //object->desk->canvas->need_repick = 0; - //sp_desktop_document(object->desk)->root->uflags = FALSE; - //sp_desktop_document(object->desk)->root->mflags = FALSE; + desk->canvas->drawing_disabled = 1; + //desk->canvas->need_redraw = 0; + //desk->canvas->need_repick = 0; + //object->context.getDocument()->root->uflags = FALSE; + //object->context.getDocument()->root->mflags = FALSE; } -void document_interface_resume_updates(DocumentInterface *object, GError ** /*error*/) +void document_interface_resume_updates(DocumentInterface *object, GError ** error) { + SPDesktop *desk = object->context.getDesktop(); + if (!desk) { + g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Document resume updates requires a GUI"); + return; + } object->updates = TRUE; - object->desk->canvas->drawing_disabled = 0; - //object->desk->canvas->need_redraw = 1; - //object->desk->canvas->need_repick = 1; - //sp_desktop_document(object->desk)->root->uflags = TRUE; - //sp_desktop_document(object->desk)->root->mflags = TRUE; - //sp_desktop_document(object->desk)->_updateDocument(); + desk->canvas->drawing_disabled = 0; + //desk->canvas->need_redraw = 1; + //desk->canvas->need_repick = 1; + //object->context.getDocument()->root->uflags = TRUE; + //object->context.getDocument()->root->mflags = TRUE; + //object->context.getDocument()->_updateDocument(); //FIXME: use better verb than rect. - Inkscape::DocumentUndo::done(sp_desktop_document(object->desk), SP_VERB_CONTEXT_RECT, "Multiple actions"); + Inkscape::DocumentUndo::done(object->context.getDocument(), SP_VERB_CONTEXT_RECT, "Multiple actions"); } -void document_interface_update(DocumentInterface *object, GError ** /*error*/) +void document_interface_update(DocumentInterface *object, GError ** error) { - sp_desktop_document(object->desk)->getRoot()->uflags = TRUE; - sp_desktop_document(object->desk)->getRoot()->mflags = TRUE; - object->desk->enableInteraction(); - sp_desktop_document(object->desk)->_updateDocument(); - object->desk->disableInteraction(); - sp_desktop_document(object->desk)->getRoot()->uflags = FALSE; - sp_desktop_document(object->desk)->getRoot()->mflags = FALSE; - //Inkscape::DocumentUndo::done(sp_desktop_document(object->desk), SP_VERB_CONTEXT_RECT, "Multiple actions"); + SPDesktop *desk = object->context.getDesktop(); + if (!desk) { + g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Document update requires a GUI"); + return; + } + SPDocument *doc = object->context.getDocument(); + doc->getRoot()->uflags = TRUE; + doc->getRoot()->mflags = TRUE; + desk->enableInteraction(); + doc->_updateDocument(); + desk->disableInteraction(); + doc->getRoot()->uflags = FALSE; + doc->getRoot()->mflags = FALSE; + //Inkscape::DocumentUndo::done(doc, SP_VERB_CONTEXT_RECT, "Multiple actions"); } /**************************************************************************** @@ -1062,7 +1108,7 @@ void document_interface_update(DocumentInterface *object, GError ** /*error*/) gboolean document_interface_selection_get(DocumentInterface *object, char ***out, GError ** /*error*/) { - Inkscape::Selection * sel = sp_desktop_selection(object->desk); + Inkscape::Selection * sel = object->context.getSelection(); GSList const *oldsel = sel->list(); int size = g_slist_length((GSList *) oldsel); @@ -1082,11 +1128,11 @@ gboolean document_interface_selection_get(DocumentInterface *object, char ***out gboolean document_interface_selection_add (DocumentInterface *object, char *name, GError **error) { - SPObject * obj = get_object_by_name(object->desk, name, error); + SPObject * obj = get_object_by_name(object->context.getDocument(), name, error); if (!obj) return FALSE; - Inkscape::Selection *selection = sp_desktop_selection(object->desk); + Inkscape::Selection *selection = object->context.getSelection(); selection->add(obj); return TRUE; @@ -1105,8 +1151,8 @@ document_interface_selection_add_list (DocumentInterface *object, gboolean document_interface_selection_set(DocumentInterface *object, char *name, GError ** /*error*/) { - SPDocument * doc = sp_desktop_document(object->desk); - Inkscape::Selection *selection = sp_desktop_selection(object->desk); + SPDocument * doc = object->context.getDocument(); + Inkscape::Selection *selection = object->context.getSelection(); selection->set(doc->getObjectById(name)); return TRUE; } @@ -1115,7 +1161,7 @@ gboolean document_interface_selection_set_list (DocumentInterface *object, gchar **names, GError **error) { - sp_desktop_selection(object->desk)->clear(); + object->context.getSelection()->clear(); int i; for (i=0;names[i] != NULL;i++) { document_interface_selection_add(object, names[i], error); @@ -1125,7 +1171,7 @@ document_interface_selection_set_list (DocumentInterface *object, gboolean document_interface_selection_rotate(DocumentInterface *object, int angle, GError ** /*error*/) { - Inkscape::Selection *selection = sp_desktop_selection(object->desk); + Inkscape::Selection *selection = object->context.getSelection(); sp_selection_rotate(selection, angle); return TRUE; } @@ -1139,7 +1185,7 @@ document_interface_selection_delete (DocumentInterface *object, GError **error) gboolean document_interface_selection_clear(DocumentInterface *object, GError ** /*error*/) { - sp_desktop_selection(object->desk)->clear(); + object->context.getSelection()->clear(); return TRUE; } @@ -1205,7 +1251,12 @@ document_interface_selection_copy (DocumentInterface *object, GError **error) gboolean document_interface_selection_paste (DocumentInterface *object, GError **error) { - desktop_ensure_active (object->desk); + SPDesktop *desk = object->context.getDesktop(); + if (!desk) { + g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Document selection paste requires a GUI"); + return FALSE; + } + desktop_ensure_active (desk); if (!object->updates) document_interface_pause_updates (object, error); sp_selection_paste (object->desk, TRUE); @@ -1223,7 +1274,7 @@ document_interface_selection_paste (DocumentInterface *object, GError **error) gboolean document_interface_selection_scale(DocumentInterface *object, gdouble grow, GError ** /*error*/) { - Inkscape::Selection *selection = sp_desktop_selection(object->desk); + Inkscape::Selection *selection = object->context.getSelection(); if (!selection) { return FALSE; @@ -1234,13 +1285,13 @@ gboolean document_interface_selection_scale(DocumentInterface *object, gdouble g gboolean document_interface_selection_move(DocumentInterface *object, gdouble x, gdouble y, GError ** /*error*/) { - sp_selection_move(object->desk, x, 0 - y); //switching coordinate systems. + sp_selection_move(object->context.getSelection(), x, 0 - y); //switching coordinate systems. return TRUE; } gboolean document_interface_selection_move_to(DocumentInterface *object, gdouble x, gdouble y, GError ** /*error*/) { - Inkscape::Selection * sel = sp_desktop_selection(object->desk); + Inkscape::Selection * sel = object->context.getSelection(); Geom::OptRect sel_bbox = sel->visualBounds(); if (sel_bbox) { @@ -1257,15 +1308,19 @@ gboolean document_interface_selection_move_to_layer (DocumentInterface *object, gchar *layerstr, GError **error) { - SPDesktop * dt = object->desk; + SPDesktop *dt = object->context.getDesktop(); + if (!dt) { + g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Document selection move to layer requires a GUI"); + return FALSE; + } - Inkscape::Selection *selection = sp_desktop_selection(dt); + Inkscape::Selection *selection = object->context.getSelection(); // check if something is selected if (selection->isEmpty()) return FALSE; - SPObject *next = get_object_by_name(object->desk, layerstr, error); + SPObject *next = get_object_by_name(object->context.getDocument(), layerstr, error); if (!next) return FALSE; @@ -1274,7 +1329,7 @@ document_interface_selection_move_to_layer (DocumentInterface *object, sp_selection_cut(dt); - dt->setCurrentLayer(next); + object->context.getSelection()->layerModel()->setCurrentLayer(next); sp_selection_paste(dt, TRUE); } @@ -1284,7 +1339,7 @@ document_interface_selection_move_to_layer (DocumentInterface *object, GArray * document_interface_selection_get_center (DocumentInterface *object) { - Inkscape::Selection * sel = sp_desktop_selection(object->desk); + Inkscape::Selection * sel = object->context.getSelection(); if (sel) { @@ -1322,8 +1377,8 @@ document_interface_selection_combine (DocumentInterface *object, gchar *cmd, else return NULL; - if (sp_desktop_selection(object->desk)->singleRepr() != NULL) - return g_strdup((sp_desktop_selection(object->desk)->singleRepr())->attribute("id")); + if (object->context.getSelection()->singleRepr() != NULL) + return g_strdup(object->context.getSelection()->singleRepr()->attribute("id")); return NULL; } @@ -1356,9 +1411,9 @@ document_interface_selection_change_level (DocumentInterface *object, gchar *cmd gchar *document_interface_layer_new(DocumentInterface *object, GError ** /*error*/) { - SPDesktop * dt = object->desk; - SPObject *new_layer = Inkscape::create_layer(dt->currentRoot(), dt->currentLayer(), Inkscape::LPOS_BELOW); - dt->setCurrentLayer(new_layer); + Inkscape::LayerModel * layerModel = object->context.getSelection()->layerModel(); + SPObject *new_layer = Inkscape::create_layer(layerModel->currentRoot(), layerModel->currentLayer(), Inkscape::LPOS_BELOW); + layerModel->setCurrentLayer(new_layer); return g_strdup(get_name_from_object(new_layer)); } @@ -1366,12 +1421,12 @@ gboolean document_interface_layer_set (DocumentInterface *object, gchar *layerstr, GError **error) { - SPObject * obj = get_object_by_name (object->desk, layerstr, error); + SPObject * obj = get_object_by_name (object->context.getDocument(), layerstr, error); if (!obj) return FALSE; - object->desk->setCurrentLayer (obj); + object->context.getSelection()->layerModel()->setCurrentLayer (obj); return TRUE; } @@ -1427,7 +1482,7 @@ gboolean dbus_send_ping (SPDesktop* desk, SPItem *item) gboolean document_interface_get_children (DocumentInterface *object, char *name, char ***out, GError **error) { - SPItem* parent=(SPItem* )get_object_by_name(object->desk, name, error); + SPItem* parent=(SPItem* )get_object_by_name(object->context.getDocument(), name, error); GSList const *children = parent->childList(false); @@ -1450,7 +1505,7 @@ document_interface_get_children (DocumentInterface *object, char *name, char ** gchar* document_interface_get_parent (DocumentInterface *object, char *name, GError **error) { - SPItem* node=(SPItem* )get_object_by_name(object->desk, name, error); + SPItem* node=(SPItem* )get_object_by_name(object->context.getDocument(), name, error); SPObject* parent=node->parent; @@ -1462,7 +1517,7 @@ document_interface_get_parent (DocumentInterface *object, char *name, GError ** //just pseudo code gboolean document_interface_get_xpath (DocumentInterface *object, char *xpath_expression, char ***out, GError **error){ - SPDocument * doc = sp_desktop_document (object->desk); + SPDocument * doc = object->context.getDocument(); Inkscape::XML::Document *repr = doc->getReprDoc(); xmlXPathObjectPtr xpathObj; diff --git a/src/extension/dbus/document-interface.h b/src/extension/dbus/document-interface.h index 5fcbb919b..9b8d34dd3 100644 --- a/src/extension/dbus/document-interface.h +++ b/src/extension/dbus/document-interface.h @@ -30,8 +30,12 @@ #undef DBUS_MESSAGE_TYPE_ERROR #undef DBUS_MESSAGE_TYPE_SIGNAL -#include "desktop.h" +#include "helper/action-context.h" +class SPDesktop; +class SPItem; + +// TODO: this define doesn't seem to be used... although the path itself is also hardcoded in dbus-init.cpp #define DBUS_DOCUMENT_INTERFACE_PATH "/org/inkscape/document" #define TYPE_DOCUMENT_INTERFACE (document_interface_get_type ()) @@ -47,8 +51,8 @@ typedef struct _DocumentInterface DocumentInterface; typedef struct _DocumentInterfaceClass DocumentInterfaceClass; struct _DocumentInterface { - GObject parent; - SPDesktop *desk; + GObject parent; + Inkscape::ActionContext context; gboolean updates; }; diff --git a/src/file.cpp b/src/file.cpp index 5b4110253..5007cd901 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -68,6 +68,7 @@ #include "ui/dialog/font-substitution.h" #include +#include #include #include @@ -209,8 +210,13 @@ SPDesktop* sp_file_new_default() void sp_file_exit() { - sp_ui_close_all(); - // no need to call inkscape_exit here; last document being closed will take care of that + if (SP_ACTIVE_DESKTOP == NULL) { + // We must be in console mode + Gtk::Main::quit(); + } else { + sp_ui_close_all(); + // no need to call inkscape_exit here; last document being closed will take care of that + } } @@ -582,24 +588,25 @@ sp_file_open_dialog(Gtk::Window &parentWindow, gpointer /*object*/, gpointer /*d /** * Remove unreferenced defs from the defs section of the document. */ -void sp_file_vacuum() +void sp_file_vacuum(SPDocument *doc) { - SPDocument *doc = SP_ACTIVE_DOCUMENT; - unsigned int diff = doc->vacuumDocument(); DocumentUndo::done(doc, SP_VERB_FILE_VACUUM, _("Clean up document")); SPDesktop *dt = SP_ACTIVE_DESKTOP; - if (diff > 0) { - dt->messageStack()->flashF(Inkscape::NORMAL_MESSAGE, - ngettext("Removed %i unused definition in <defs>.", - "Removed %i unused definitions in <defs>.", - diff), - diff); - } else { - dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("No unused definitions in <defs>.")); + if (dt != NULL) { + // Show status messages when in GUI mode + if (diff > 0) { + dt->messageStack()->flashF(Inkscape::NORMAL_MESSAGE, + ngettext("Removed %i unused definition in <defs>.", + "Removed %i unused definitions in <defs>.", + diff), + diff); + } else { + dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("No unused definitions in <defs>.")); + } } } diff --git a/src/file.h b/src/file.h index fe8ad9af3..eeb4c6fc5 100644 --- a/src/file.h +++ b/src/file.h @@ -200,7 +200,7 @@ void sp_file_print (Gtk::Window& parentWindow); /** * clean unused defs out of file */ -void sp_file_vacuum (); +void sp_file_vacuum (SPDocument *doc); #endif // SEEN_SP_FILE_H diff --git a/src/helper/action-context.cpp b/src/helper/action-context.cpp index c88086f7f..f211d775d 100644 --- a/src/helper/action-context.cpp +++ b/src/helper/action-context.cpp @@ -60,6 +60,16 @@ UI::View::View *ActionContext::getView() const return _view; } +SPDesktop *ActionContext::getDesktop() const +{ + // TODO: this slightly horrible storage of a UI::View::View*, and + // casting to an SPDesktop*, is only done because that's what was + // already the norm in the Inkscape codebase. This seems wrong. Surely + // we should store an SPDesktop* in the first place? Is there a case + // of actions being carried out on a View that is not an SPDesktop? + return static_cast(_view); +} + } // namespace Inkscape /* diff --git a/src/helper/action-context.h b/src/helper/action-context.h index de09f94f4..3a7a19112 100644 --- a/src/helper/action-context.h +++ b/src/helper/action-context.h @@ -12,6 +12,7 @@ #ifndef SEEN_INKSCAPE_ACTION_CONTEXT_H #define SEEN_INKSCAPE_ACTION_CONTEXT_H +class SPDesktop; class SPDocument; namespace Inkscape { @@ -30,6 +31,12 @@ class View; Inkscape::UI::View::View. Actions that do require GUI objects should check to see if the relevant pointers are NULL before attempting to use them. + + TODO: we store a UI::View::View* because that's what the actions and verbs + used to take as parameters in their methods. Why is this? They almost + always seemed to cast straight to an SPDesktop* - so shouldn't we actually + be storing an SPDesktop*? Is there a case where a non-SPDesktop + UI::View::View is used by the actions? ActionContext is designed to be copyable, so it may be used with stack storage if required. */ @@ -60,6 +67,10 @@ public: /** Get the view for the action context. May be NULL. Guaranteed to be NULL if running in console mode. */ UI::View::View *getView() const; + + /** Get the desktop for the action context. May be NULL. Guaranteed to be + NULL if running in console mode. */ + SPDesktop *getDesktop() const; }; } // namespace Inkscape diff --git a/src/helper/action.cpp b/src/helper/action.cpp index 107d0179b..28cb40334 100644 --- a/src/helper/action.cpp +++ b/src/helper/action.cpp @@ -16,6 +16,7 @@ #include "debug/simple-event.h" #include "debug/event-tracker.h" #include "ui/view/view.h" +#include "desktop.h" #include "document.h" #include "helper/action.h" @@ -188,7 +189,7 @@ sp_action_get_selection (SPAction *action) } /** - * Return View associated with the action. + * Return View associated with the action, if any. */ Inkscape::UI::View::View * sp_action_get_view (SPAction *action) @@ -197,6 +198,20 @@ sp_action_get_view (SPAction *action) return action->context.getView(); } +/** + * Return Desktop associated with the action, if any. + */ +SPDesktop * +sp_action_get_desktop (SPAction *action) +{ + // TODO: this slightly horrible storage of a UI::View::View*, and + // casting to an SPDesktop*, is only done because that's what was + // already the norm in the Inkscape codebase. This seems wrong. Surely + // we should store an SPDesktop* in the first place? Is there a case + // of actions being carried out on a View that is not an SPDesktop? + return static_cast(sp_action_get_view(action)); +} + /* Local Variables: mode:c++ diff --git a/src/helper/action.h b/src/helper/action.h index 49816e3c9..1f2de87b4 100644 --- a/src/helper/action.h +++ b/src/helper/action.h @@ -25,6 +25,7 @@ struct SPActionClass; #define SP_ACTION_CLASS(o) (G_TYPE_CHECK_CLASS_CAST((o), SP_TYPE_ACTION, SPActionClass)) #define SP_IS_ACTION(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), SP_TYPE_ACTION)) +class SPDesktop; class SPDocument; namespace Inkscape { @@ -78,6 +79,7 @@ void sp_action_set_name(SPAction *action, Glib::ustring const &name); SPDocument *sp_action_get_document(SPAction *action); Inkscape::Selection *sp_action_get_selection(SPAction *action); Inkscape::UI::View::View *sp_action_get_view(SPAction *action); +SPDesktop *sp_action_get_desktop(SPAction *action); #endif diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 125a7176a..2e60ee5ea 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -58,12 +58,14 @@ #include "extension/system.h" #include "inkscape-private.h" #include "io/sys.h" +#include "layer-model.h" #include "message-stack.h" #include "preferences.h" #include "resource-manager.h" #include "selection.h" #include "ui/dialog/debug.h" #include "xml/repr.h" +#include "helper/action-context.h" #include "helper/sp-marshal.h" static Inkscape::Application *inkscape = NULL; @@ -105,10 +107,27 @@ static void inkscape_dispose (GObject *object); static void inkscape_activate_desktop_private (Inkscape::Application *inkscape, SPDesktop *desktop); static void inkscape_deactivate_desktop_private (Inkscape::Application *inkscape, SPDesktop *desktop); +class AppSelectionModel { + Inkscape::LayerModel _layer_model; + Inkscape::Selection *_selection; + +public: + AppSelectionModel(SPDocument *doc) { + _layer_model.setDocument(doc); + // TODO: is this really how we should manage the lifetime of the selection? + // I just copied this from the initialization of the Selection in SPDesktop. + // When and how is it actually released? + _selection = Inkscape::GC::release(new Inkscape::Selection(&_layer_model, NULL)); + } + + Inkscape::Selection *getSelection() const { return _selection; } +}; + struct Inkscape::Application { GObject object; Inkscape::XML::Document *menus; std::map document_set; + std::map selection_models; GSList *desktops; gchar *argv0; gboolean dialogs_toggle; @@ -481,6 +500,7 @@ inkscape_init (SPObject * object) } new (&inkscape->document_set) std::map(); + new (&inkscape->selection_models) std::map(); inkscape->menus = sp_repr_read_mem (_(menus_skeleton), MENUS_SKELETON_SIZE, NULL); inkscape->desktops = NULL; @@ -504,6 +524,7 @@ inkscape_dispose (GObject *object) inkscape->menus = NULL; } + inkscape->selection_models.~map(); inkscape->document_set.~map(); G_OBJECT_CLASS (parent_class)->dispose (object); @@ -1234,6 +1255,14 @@ inkscape_add_document (SPDocument *document) iter->second ++; } } + } else { + // insert succeeded, this document is new. Do we need to create a + // selection model for it, i.e. are we running without a desktop? + if (!inkscape->use_gui) { + // Create layer model and selection model so we can run some verbs without a GUI + g_assert(inkscape->selection_models.find(document) == inkscape->selection_models.end()); + inkscape->selection_models[document] = new AppSelectionModel(document); + } } } @@ -1253,6 +1282,13 @@ inkscape_remove_document (SPDocument *document) if (iter->second < 1) { // this was the last one, remove the pair from list inkscape->document_set.erase (iter); + + // also remove the selection model + std::map::iterator sel_iter = inkscape->selection_models.find(document); + if (sel_iter != inkscape->selection_models.end()) { + inkscape->selection_models.erase(sel_iter); + } + return true; } else { return false; @@ -1312,6 +1348,24 @@ inkscape_active_event_context (void) return NULL; } +Inkscape::ActionContext +inkscape_active_action_context() +{ + if (SP_ACTIVE_DESKTOP) { + return Inkscape::ActionContext(SP_ACTIVE_DESKTOP); + } + + SPDocument *doc = inkscape_active_document(); + if (!doc) { + return Inkscape::ActionContext(); + } + + std::map::iterator sel_iter = inkscape->selection_models.find(doc); + if (sel_iter == inkscape->selection_models.end()) { + return Inkscape::ActionContext(); + } + return Inkscape::ActionContext(sel_iter->second->getSelection()); +} /*##################### diff --git a/src/inkscape.h b/src/inkscape.h index 368c7fa60..cb6ba6a0f 100644 --- a/src/inkscape.h +++ b/src/inkscape.h @@ -20,6 +20,7 @@ class SPDocument; struct SPEventContext; namespace Inkscape { + class ActionContext; struct Application; namespace XML { class Node; @@ -56,6 +57,16 @@ SPDocument * inkscape_active_document (void); #define SP_ACTIVE_DESKTOP inkscape_active_desktop () SPDesktop * inkscape_active_desktop (void); +// More horrible static cling... sorry about this. Should really replace all of +// the static stuff with a single instance of some kind of engine class holding +// all the document / non-GUI stuff, and an optional GUI class that behaves a +// bit like SPDesktop does currently. Then it will be easier to write good code +// that doesn't just expect a GUI all the time (like lots of the app currently +// does). +// Also, while the "active" document / desktop concepts are convenient, they +// appear to have been abused somewhat, further increasing static cling. +Inkscape::ActionContext inkscape_active_action_context(); + bool inkscape_is_sole_desktop_for_document(SPDesktop const &desktop); gchar *homedir_path(const char *filename); diff --git a/src/main.cpp b/src/main.cpp index 49ef33fc9..630411dde 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -169,6 +169,9 @@ enum { SP_ARG_SHELL, SP_ARG_VERSION, SP_ARG_VACUUM_DEFS, +#ifdef WITH_DBUS + SP_ARG_DBUS_LISTEN, +#endif // WITH_DBUS SP_ARG_VERB_LIST, SP_ARG_VERB, SP_ARG_SELECT, @@ -222,7 +225,9 @@ static gboolean sp_query_all = FALSE; static gchar *sp_query_id = NULL; static gboolean sp_shell = FALSE; static gboolean sp_vacuum_defs = FALSE; - +#ifdef WITH_DBUS +static gboolean sp_dbus_listen = FALSE; +#endif // WITH_DBUS static gchar *sp_export_png_utf8 = NULL; static gchar *sp_export_svg_utf8 = NULL; static gchar *sp_global_printer_utf8 = NULL; @@ -267,6 +272,9 @@ static void resetCommandlineGlobals() { sp_query_all = FALSE; sp_query_id = NULL; sp_vacuum_defs = FALSE; +#ifdef WITH_DBUS + sp_dbus_listen = FALSE; +#endif // WITH_DBUS sp_export_png_utf8 = NULL; sp_export_svg_utf8 = NULL; @@ -473,6 +481,13 @@ struct poptOption options[] = { POPT_ARG_NONE, &sp_vacuum_defs, SP_ARG_VACUUM_DEFS, N_("Remove unused definitions from the defs section(s) of the document"), NULL}, + +#ifdef WITH_DBUS + {"dbus-listen", 0, + POPT_ARG_NONE, &sp_dbus_listen, SP_ARG_DBUS_LISTEN, + N_("Enter a listening loop for D-Bus messages in console mode"), + NULL}, +#endif // WITH_DBUS {"verb-list", 0, POPT_ARG_NONE, NULL, SP_ARG_VERB_LIST, @@ -731,6 +746,9 @@ main(int argc, char **argv) || !strcmp(argv[i], "-Y") || !strncmp(argv[i], "--query-y", 9) || !strcmp(argv[i], "--vacuum-defs") +#ifdef WITH_DBUS + || !strcmp(argv[i], "--dbus-listen") +#endif // WITH_DBUS || !strcmp(argv[i], "--shell") ) { @@ -1038,6 +1056,17 @@ sp_main_gui(int argc, char const **argv) static int sp_process_file_list(GSList *fl) { int retVal = 0; +#ifdef WITH_DBUS + if (!fl) { + // If we've been asked to listen for D-Bus messages, enter a main loop here + // The main loop may be exited by calling "exit" on the D-Bus application interface. + if (sp_dbus_listen) { + Gtk::Main main_dbus_loop(0, NULL); + main_dbus_loop.run(); + } + } +#endif // WITH_DBUS + while (fl) { const gchar *filename = (gchar *)fl->data; @@ -1070,17 +1099,17 @@ static int sp_process_file_list(GSList *fl) doc->vacuumDocument(); } - bool has_performed_actions = false; - { - // Create layer model and selection model so we can run some verbs without a GUI - Inkscape::LayerModel layer_model; - layer_model.setDocument(doc); - Inkscape::Selection *selection = Inkscape::GC::release(new Inkscape::Selection(&layer_model, NULL)); - - // Execute command-line actions (selections and verbs) using our local models - Inkscape::ActionContext context(selection); - has_performed_actions = Inkscape::CmdLineAction::doList(context); + // Execute command-line actions (selections and verbs) using our local models + bool has_performed_actions = Inkscape::CmdLineAction::doList(inkscape_active_action_context()); + +#ifdef WITH_DBUS + // If we've been asked to listen for D-Bus messages, enter a main loop here + // The main loop may be exited by calling "exit" on the D-Bus application interface. + if (sp_dbus_listen) { + Gtk::Main main_dbus_loop(0, NULL); + main_dbus_loop.run(); } +#endif // WITH_DBUS if (!sp_export_svg && (sp_vacuum_defs || has_performed_actions)) { // save under the name given in the command line @@ -1248,7 +1277,7 @@ int sp_main_console(int argc, char const **argv) int retVal = sp_common_main( argc, argv, &fl ); g_return_val_if_fail(retVal == 0, 1); - if (fl == NULL && !sp_shell) { + if (fl == NULL && !sp_shell && !sp_dbus_listen) { g_print("Nothing to do!\n"); exit(0); } diff --git a/src/select-context.cpp b/src/select-context.cpp index 1dd3b08d7..3df047368 100644 --- a/src/select-context.cpp +++ b/src/select-context.cpp @@ -921,12 +921,12 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) gint mul = 1 + gobble_key_events( get_group0_keyval(&event->key), 0); // with any mask if (MOD__ALT(event)) { // alt - if (MOD__SHIFT(event)) sp_selection_move_screen(desktop, mul*-10, 0); // shift - else sp_selection_move_screen(desktop, mul*-1, 0); // no shift + if (MOD__SHIFT(event)) sp_selection_move_screen(sp_desktop_selection(desktop), mul*-10, 0); // shift + else sp_selection_move_screen(sp_desktop_selection(desktop), mul*-1, 0); // no shift } else { // no alt - if (MOD__SHIFT(event)) sp_selection_move(desktop, mul*-10*nudge, 0); // shift - else sp_selection_move(desktop, mul*-nudge, 0); // no shift + if (MOD__SHIFT(event)) sp_selection_move(sp_desktop_selection(desktop), mul*-10*nudge, 0); // shift + else sp_selection_move(sp_desktop_selection(desktop), mul*-nudge, 0); // no shift } ret = TRUE; } @@ -937,12 +937,12 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) gint mul = 1 + gobble_key_events( get_group0_keyval(&event->key), 0); // with any mask if (MOD__ALT(event)) { // alt - if (MOD__SHIFT(event)) sp_selection_move_screen(desktop, 0, mul*10); // shift - else sp_selection_move_screen(desktop, 0, mul*1); // no shift + if (MOD__SHIFT(event)) sp_selection_move_screen(sp_desktop_selection(desktop), 0, mul*10); // shift + else sp_selection_move_screen(sp_desktop_selection(desktop), 0, mul*1); // no shift } else { // no alt - if (MOD__SHIFT(event)) sp_selection_move(desktop, 0, mul*10*nudge); // shift - else sp_selection_move(desktop, 0, mul*nudge); // no shift + if (MOD__SHIFT(event)) sp_selection_move(sp_desktop_selection(desktop), 0, mul*10*nudge); // shift + else sp_selection_move(sp_desktop_selection(desktop), 0, mul*nudge); // no shift } ret = TRUE; } @@ -953,12 +953,12 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) gint mul = 1 + gobble_key_events( get_group0_keyval(&event->key), 0); // with any mask if (MOD__ALT(event)) { // alt - if (MOD__SHIFT(event)) sp_selection_move_screen(desktop, mul*10, 0); // shift - else sp_selection_move_screen(desktop, mul*1, 0); // no shift + if (MOD__SHIFT(event)) sp_selection_move_screen(sp_desktop_selection(desktop), mul*10, 0); // shift + else sp_selection_move_screen(sp_desktop_selection(desktop), mul*1, 0); // no shift } else { // no alt - if (MOD__SHIFT(event)) sp_selection_move(desktop, mul*10*nudge, 0); // shift - else sp_selection_move(desktop, mul*nudge, 0); // no shift + if (MOD__SHIFT(event)) sp_selection_move(sp_desktop_selection(desktop), mul*10*nudge, 0); // shift + else sp_selection_move(sp_desktop_selection(desktop), mul*nudge, 0); // no shift } ret = TRUE; } @@ -969,12 +969,12 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) gint mul = 1 + gobble_key_events( get_group0_keyval(&event->key), 0); // with any mask if (MOD__ALT(event)) { // alt - if (MOD__SHIFT(event)) sp_selection_move_screen(desktop, 0, mul*-10); // shift - else sp_selection_move_screen(desktop, 0, mul*-1); // no shift + if (MOD__SHIFT(event)) sp_selection_move_screen(sp_desktop_selection(desktop), 0, mul*-10); // shift + else sp_selection_move_screen(sp_desktop_selection(desktop), 0, mul*-1); // no shift } else { // no alt - if (MOD__SHIFT(event)) sp_selection_move(desktop, 0, mul*-10*nudge); // shift - else sp_selection_move(desktop, 0, mul*-nudge); // no shift + if (MOD__SHIFT(event)) sp_selection_move(sp_desktop_selection(desktop), 0, mul*-10*nudge); // shift + else sp_selection_move(sp_desktop_selection(desktop), 0, mul*-nudge); // no shift } ret = TRUE; } diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 56923859b..591f9d68d 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -35,6 +35,7 @@ SPCycleType SP_CYCLING = SP_CYCLE_FOCUS; #include "desktop.h" #include "desktop-style.h" #include "dir-util.h" +#include "layer-model.h" #include "selection.h" #include "tools-switch.h" #include "desktop-handles.h" @@ -521,16 +522,16 @@ void sp_selection_duplicate(SPDesktop *desktop, bool suppressDone) g_slist_free(newsel); } -void sp_edit_clear_all(SPDesktop *dt) +void sp_edit_clear_all(Inkscape::Selection *selection) { - if (!dt) + if (!selection) return; - SPDocument *doc = sp_desktop_document(dt); - sp_desktop_selection(dt)->clear(); + SPDocument *doc = selection->layerModel()->getDocument(); + selection->clear(); - g_return_if_fail(SP_IS_GROUP(dt->currentLayer())); - GSList *items = sp_item_group_item_list(SP_GROUP(dt->currentLayer())); + g_return_if_fail(SP_IS_GROUP(selection->layerModel()->currentLayer())); + GSList *items = sp_item_group_item_list(SP_GROUP(selection->layerModel()->currentLayer())); while (items) { reinterpret_cast(items->data)->deleteObject(); @@ -2157,49 +2158,49 @@ sp_selection_scale_times(Inkscape::Selection *selection, gdouble times) } void -sp_selection_move(SPDesktop *desktop, gdouble dx, gdouble dy) +sp_selection_move(Inkscape::Selection *selection, gdouble dx, gdouble dy) { - Inkscape::Selection *selection = sp_desktop_selection(desktop); if (selection->isEmpty()) { return; } sp_selection_move_relative(selection, dx, dy); + SPDocument *doc = selection->layerModel()->getDocument(); if (dx == 0) { - DocumentUndo::maybeDone(sp_desktop_document(desktop), "selector:move:vertical", SP_VERB_CONTEXT_SELECT, + DocumentUndo::maybeDone(doc, "selector:move:vertical", SP_VERB_CONTEXT_SELECT, _("Move vertically")); } else if (dy == 0) { - DocumentUndo::maybeDone(sp_desktop_document(desktop), "selector:move:horizontal", SP_VERB_CONTEXT_SELECT, + DocumentUndo::maybeDone(doc, "selector:move:horizontal", SP_VERB_CONTEXT_SELECT, _("Move horizontally")); } else { - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_SELECT, + DocumentUndo::done(doc, SP_VERB_CONTEXT_SELECT, _("Move")); } } void -sp_selection_move_screen(SPDesktop *desktop, gdouble dx, gdouble dy) +sp_selection_move_screen(Inkscape::Selection *selection, gdouble dx, gdouble dy) { - Inkscape::Selection *selection = sp_desktop_selection(desktop); - if (selection->isEmpty()) { + if (selection->isEmpty() || !selection->desktop()) { return; } // same as sp_selection_move but divide deltas by zoom factor - gdouble const zoom = desktop->current_zoom(); + gdouble const zoom = selection->desktop()->current_zoom(); gdouble const zdx = dx / zoom; gdouble const zdy = dy / zoom; sp_selection_move_relative(selection, zdx, zdy); + SPDocument *doc = selection->layerModel()->getDocument(); if (dx == 0) { - DocumentUndo::maybeDone(sp_desktop_document(desktop), "selector:move:vertical", SP_VERB_CONTEXT_SELECT, + DocumentUndo::maybeDone(doc, "selector:move:vertical", SP_VERB_CONTEXT_SELECT, _("Move vertically by pixels")); } else if (dy == 0) { - DocumentUndo::maybeDone(sp_desktop_document(desktop), "selector:move:horizontal", SP_VERB_CONTEXT_SELECT, + DocumentUndo::maybeDone(doc, "selector:move:horizontal", SP_VERB_CONTEXT_SELECT, _("Move horizontally by pixels")); } else { - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_SELECT, + DocumentUndo::done(doc, SP_VERB_CONTEXT_SELECT, _("Move")); } } diff --git a/src/selection-chemistry.h b/src/selection-chemistry.h index 8711a6cdf..f58ede21a 100644 --- a/src/selection-chemistry.h +++ b/src/selection-chemistry.h @@ -53,7 +53,7 @@ namespace Inkscape { void sp_selection_delete(SPDesktop *desktop); void sp_selection_duplicate(SPDesktop *desktop, bool suppressDone = false); -void sp_edit_clear_all(SPDesktop *desktop); +void sp_edit_clear_all(Inkscape::Selection *selection); void sp_edit_select_all(SPDesktop *desktop); void sp_edit_select_all_in_all_layers (SPDesktop *desktop); @@ -122,8 +122,8 @@ void sp_selection_scale (Inkscape::Selection *selection, gdouble grow); void sp_selection_scale_screen (Inkscape::Selection *selection, gdouble grow_pixels); void sp_selection_scale_times (Inkscape::Selection *selection, gdouble times); -void sp_selection_move (SPDesktop *desktop, gdouble dx, gdouble dy); -void sp_selection_move_screen (SPDesktop *desktop, gdouble dx, gdouble dy); +void sp_selection_move (Inkscape::Selection *selection, gdouble dx, gdouble dy); +void sp_selection_move_screen (Inkscape::Selection *selection, gdouble dx, gdouble dy); void sp_selection_item_next (SPDesktop *desktop); void sp_selection_item_prev (SPDesktop *desktop); diff --git a/src/verbs.cpp b/src/verbs.cpp index 979267215..6187cfb4c 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -806,13 +806,28 @@ Verb *Verb::getbyid(gchar const *id) */ void FileVerb::perform(SPAction *action, void *data) { -#if 0 - // These aren't used, but are here to remind people not to use - // the CURRENT_DOCUMENT macros unless they really have to. - SPDocument *current_document = sp_action_get_document(action); -#endif + // Convert verb impls to use this where possible, to reduce static cling + // to macros like SP_ACTIVE_DOCUMENT, which end up enforcing GUI-mode operation + SPDocument *doc = sp_action_get_document(action); + + // We can vacuum defs, or exit, without needing a desktop! + bool handled = true; + switch (reinterpret_cast(data)) { + case SP_VERB_FILE_VACUUM: + sp_file_vacuum(doc); + break; + case SP_VERB_FILE_QUIT: + sp_file_exit(); + break; + default: + handled = false; + break; + } + if (handled) { + return; + } - SPDesktop *desktop = dynamic_cast(sp_action_get_view(action)); + SPDesktop *desktop = sp_action_get_desktop(action); if (desktop == NULL) { show_gui_required_message(action); return; @@ -843,9 +858,6 @@ void FileVerb::perform(SPAction *action, void *data) case SP_VERB_FILE_PRINT: sp_file_print(*parent); break; - case SP_VERB_FILE_VACUUM: - sp_file_vacuum(); - break; case SP_VERB_FILE_IMPORT: sp_file_import(*parent); break; @@ -867,9 +879,6 @@ void FileVerb::perform(SPAction *action, void *data) case SP_VERB_FILE_CLOSE_VIEW: sp_ui_close_view(NULL); break; - case SP_VERB_FILE_QUIT: - sp_file_exit(); - break; default: break; } @@ -882,7 +891,21 @@ void FileVerb::perform(SPAction *action, void *data) */ void EditVerb::perform(SPAction *action, void *data) { - SPDesktop *dt = static_cast(sp_action_get_view(action)); + // We can clear all without a desktop + bool handled = true; + switch (reinterpret_cast(data)) { + case SP_VERB_EDIT_CLEAR_ALL: + sp_edit_clear_all(sp_action_get_selection(action)); + break; + default: + handled = false; + break; + } + if (handled) { + return; + } + + SPDesktop *dt = sp_action_get_desktop(action); if (dt == NULL) { show_gui_required_message(action); return; @@ -976,9 +999,6 @@ void EditVerb::perform(SPAction *action, void *data) case SP_VERB_EDIT_UNSYMBOL: sp_selection_unsymbol(dt); break; - case SP_VERB_EDIT_CLEAR_ALL: - sp_edit_clear_all(dt); - break; case SP_VERB_EDIT_SELECT_ALL: SelectionHelper::selectAll(dt); break; @@ -1041,7 +1061,7 @@ void EditVerb::perform(SPAction *action, void *data) void SelectionVerb::perform(SPAction *action, void *data) { Inkscape::Selection *selection = sp_action_get_selection(action); - SPDesktop *dt = static_cast(sp_action_get_view(action)); + SPDesktop *dt = sp_action_get_desktop(action); // Some of these operations have been modified so they work in command-line mode! // In this case, all we need is a selection @@ -1180,7 +1200,7 @@ void SelectionVerb::perform(SPAction *action, void *data) */ void LayerVerb::perform(SPAction *action, void *data) { - SPDesktop *dt = static_cast(sp_action_get_view(action)); + SPDesktop *dt = sp_action_get_desktop(action); size_t verb = reinterpret_cast(data); if (dt == NULL) { @@ -1435,7 +1455,7 @@ void LayerVerb::perform(SPAction *action, void *data) */ void ObjectVerb::perform( SPAction *action, void *data) { - SPDesktop *dt = static_cast(sp_action_get_view(action)); + SPDesktop *dt = sp_action_get_desktop(action); if (dt == NULL) { show_gui_required_message(action); return; @@ -1525,7 +1545,7 @@ void ContextVerb::perform(SPAction *action, void *data) sp_verb_t verb; int vidx; - dt = static_cast(sp_action_get_view(action)); + dt = sp_action_get_desktop(action); if (dt == NULL) { show_gui_required_message(action); @@ -1728,7 +1748,7 @@ void ContextVerb::perform(SPAction *action, void *data) */ void TextVerb::perform(SPAction *action, void */*data*/) { - SPDesktop *dt = static_cast(sp_action_get_view(action)); + SPDesktop *dt = sp_action_get_desktop(action); if (dt == NULL) { show_gui_required_message(action); return; @@ -1745,7 +1765,7 @@ void TextVerb::perform(SPAction *action, void */*data*/) */ void ZoomVerb::perform(SPAction *action, void *data) { - SPDesktop *dt = static_cast(sp_action_get_view(action)); + SPDesktop *dt = sp_action_get_desktop(action); if (dt == NULL) { show_gui_required_message(action); return; @@ -1937,7 +1957,7 @@ void DialogVerb::perform(SPAction *action, void *data) inkscape_dialogs_unhide(); } - SPDesktop *dt = static_cast(sp_action_get_view(action)); + SPDesktop *dt = sp_action_get_desktop(action); if (dt == NULL) { show_gui_required_message(action); return; @@ -2053,7 +2073,7 @@ void DialogVerb::perform(SPAction *action, void *data) */ void HelpVerb::perform(SPAction *action, void *data) { - SPDesktop *dt = static_cast(sp_action_get_view(action)); + SPDesktop *dt = sp_action_get_desktop(action); if (dt == NULL) { show_gui_required_message(action); return; @@ -2092,7 +2112,7 @@ void HelpVerb::perform(SPAction *action, void *data) */ void TutorialVerb::perform(SPAction *action, void *data) { - if (sp_action_get_view(action) == NULL) { + if (sp_action_get_desktop(action) == NULL) { show_gui_required_message(action); return; } @@ -2246,7 +2266,7 @@ SPAction *FitCanvasVerb::make_action(Inkscape::ActionContext const & context) */ void FitCanvasVerb::perform(SPAction *action, void *data) { - SPDesktop *dt = static_cast(sp_action_get_view(action)); + SPDesktop *dt = sp_action_get_desktop(action); if (dt == NULL) { show_gui_required_message(action); return; @@ -2316,7 +2336,7 @@ SPAction *LockAndHideVerb::make_action(Inkscape::ActionContext const & context) */ void LockAndHideVerb::perform(SPAction *action, void *data) { - SPDesktop *dt = static_cast(sp_action_get_view(action)); + SPDesktop *dt = sp_action_get_desktop(action); if (dt == NULL) { show_gui_required_message(action); return; -- cgit v1.2.3 From 1c75594f5c37e86dec195ec1975254315ef180e9 Mon Sep 17 00:00:00 2001 From: Eric Greveson Date: Wed, 3 Jul 2013 23:00:06 +0100 Subject: Changed dbus interface to treat 'division' like other boolops, with a new return type for selection_combine to support this (array of string). This also fixes a bug with not setting the error flag when returning NULL from this method. Refactored some more selection verbs to allow use in no-GUI mode. (bzr r12387.1.5) --- src/extension/dbus/application-interface.cpp | 6 +- src/extension/dbus/document-interface.cpp | 26 +++--- src/extension/dbus/document-interface.h | 9 +-- src/extension/dbus/document-interface.xml | 32 ++------ src/extension/dbus/wrapper/inkscape-dbus-wrapper.c | 18 +---- src/extension/dbus/wrapper/inkscape-dbus-wrapper.h | 6 +- src/interface.cpp | 2 +- src/selection-chemistry.cpp | 94 +++++++++------------- src/selection-chemistry.h | 12 +-- src/verbs.cpp | 37 +++++---- 10 files changed, 94 insertions(+), 148 deletions(-) (limited to 'src') diff --git a/src/extension/dbus/application-interface.cpp b/src/extension/dbus/application-interface.cpp index 399e1b244..1b1dbf0f5 100644 --- a/src/extension/dbus/application-interface.cpp +++ b/src/extension/dbus/application-interface.cpp @@ -150,7 +150,11 @@ gchar* application_interface_get_active_document(ApplicationInterface *object, GError **error) { - return (gchar*)Inkscape::Extension::Dbus::init_active_document(); + gchar *result = (gchar*)Inkscape::Extension::Dbus::init_active_document(); + if (!result) { + g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "No active document"); + } + return result; } gchar** diff --git a/src/extension/dbus/document-interface.cpp b/src/extension/dbus/document-interface.cpp index f0cc71de1..87b769e26 100644 --- a/src/extension/dbus/document-interface.cpp +++ b/src/extension/dbus/document-interface.cpp @@ -1222,13 +1222,11 @@ document_interface_selection_invert (DocumentInterface *object, GError **error) gboolean document_interface_selection_group (DocumentInterface *object, GError **error) { - //sp_selection_group (object->desk); return dbus_call_verb (object, SP_VERB_SELECTION_GROUP, error); } gboolean document_interface_selection_ungroup (DocumentInterface *object, GError **error) { - //sp_selection_ungroup (object->desk); return dbus_call_verb (object, SP_VERB_SELECTION_UNGROUP, error); } @@ -1362,8 +1360,8 @@ document_interface_selection_to_path (DocumentInterface *object, GError **error) } -gchar * -document_interface_selection_combine (DocumentInterface *object, gchar *cmd, +gboolean +document_interface_selection_combine (DocumentInterface *object, gchar *cmd, char ***newpaths, GError **error) { if (strcmp(cmd, "union") == 0) @@ -1374,20 +1372,14 @@ document_interface_selection_combine (DocumentInterface *object, gchar *cmd, dbus_call_verb (object, SP_VERB_SELECTION_DIFF, error); else if (strcmp(cmd, "exclusion") == 0) dbus_call_verb (object, SP_VERB_SELECTION_SYMDIFF, error); - else - return NULL; - - if (object->context.getSelection()->singleRepr() != NULL) - return g_strdup(object->context.getSelection()->singleRepr()->attribute("id")); - return NULL; -} - -gboolean -document_interface_selection_divide (DocumentInterface *object, char ***out, GError **error) -{ - dbus_call_verb (object, SP_VERB_SELECTION_CUT, error); + else if (strcmp(cmd, "division") == 0) + dbus_call_verb (object, SP_VERB_SELECTION_CUT, error); + else { + g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Operation command not recognised"); + return FALSE; + } - return document_interface_selection_get (object, out, error); + return document_interface_selection_get (object, newpaths, error); } gboolean diff --git a/src/extension/dbus/document-interface.h b/src/extension/dbus/document-interface.h index 9b8d34dd3..5eef3d0c0 100644 --- a/src/extension/dbus/document-interface.h +++ b/src/extension/dbus/document-interface.h @@ -363,14 +363,9 @@ document_interface_selection_get_center (DocumentInterface *object); gboolean document_interface_selection_to_path (DocumentInterface *object, GError **error); -gchar * -document_interface_selection_combine (DocumentInterface *object, gchar *cmd, - GError **error); - gboolean -document_interface_selection_divide (DocumentInterface *object, - char ***out, GError **error); - +document_interface_selection_combine (DocumentInterface *object, gchar *cmd, char ***newpaths, + GError **error); gboolean document_interface_selection_change_level (DocumentInterface *object, gchar *cmd, diff --git a/src/extension/dbus/document-interface.xml b/src/extension/dbus/document-interface.xml index aeacfae44..7481c0893 100644 --- a/src/extension/dbus/document-interface.xml +++ b/src/extension/dbus/document-interface.xml @@ -21,7 +21,7 @@ - +c @@ -1348,36 +1348,20 @@ Type of combination. - - + - The new path created, if there is one. NULL otherwise. + List of the ids of resulting paths after applying the operation. Will erase all objects in the selection and replace with a single aggregate path. There are 5 types that can be passed in: - Union: The new shape is all of the other shapes put together, even if they don't overlap (paths can have multiple non-contiguous areas.) - Intersection: The new shape is composed of the area where ALL the objects in the selection overlap. If there is no area where all shapes overlap the new shape will be empty. - Difference: The area of the second shape is subtracted from the first, only works with two objects. - Exclusion: The new shape is the area(s) where none of the objects in the selection overlaped. Only works with two objects. - Division: the first object is split into multiple segments by the second object. Only works with two objects and if multiple paths result they are grouped and the group id is returned. - - - - - - - - - List of the ids of resulting paths. - - - - - Returns the result of cutting the bottom object by all other intersecting paths. - This may make many seperate layers. + 'union': The new shape is all of the other shapes put together, even if they don't overlap (paths can have multiple non-contiguous areas.) + 'intersection': The new shape is composed of the area where ALL the objects in the selection overlap. If there is no area where all shapes overlap the new shape will be empty. + 'difference': The area of the second shape is subtracted from the first, only works with two objects. + 'exclusion': The new shape is the area(s) where none of the objects in the selection overlaped. Only works with two objects. + 'division': the first object is split into multiple segments by the second object. Only works with two objects. diff --git a/src/extension/dbus/wrapper/inkscape-dbus-wrapper.c b/src/extension/dbus/wrapper/inkscape-dbus-wrapper.c index 0be1be42e..c7e453593 100644 --- a/src/extension/dbus/wrapper/inkscape-dbus-wrapper.c +++ b/src/extension/dbus/wrapper/inkscape-dbus-wrapper.c @@ -687,24 +687,14 @@ inkscape_selection_to_path (DocumentInterface *doc, GError **error) return org_inkscape_document_selection_to_path (proxy, error); } -//static -char * -inkscape_selection_combine (DocumentInterface *doc, const char * IN_type, GError **error) -{ - char * OUT_newpath; - DBusGProxy *proxy = doc->proxy; - org_inkscape_document_selection_combine (proxy, IN_type, &OUT_newpath, error); - return OUT_newpath; -} - //static char ** -inkscape_selection_divide (DocumentInterface *doc, GError **error) +inkscape_selection_combine (DocumentInterface *doc, const char * IN_type, GError **error) { - char ** OUT_pieces; + char ** OUT_newpaths; DBusGProxy *proxy = doc->proxy; - org_inkscape_document_selection_divide (proxy, &OUT_pieces, error); - return OUT_pieces; + org_inkscape_document_selection_combine (proxy, IN_type, &OUT_newpaths, error); + return OUT_newpaths; } //static diff --git a/src/extension/dbus/wrapper/inkscape-dbus-wrapper.h b/src/extension/dbus/wrapper/inkscape-dbus-wrapper.h index 684f1b142..79f8188d4 100644 --- a/src/extension/dbus/wrapper/inkscape-dbus-wrapper.h +++ b/src/extension/dbus/wrapper/inkscape-dbus-wrapper.h @@ -303,13 +303,9 @@ inkscape_selection_get_center (DocumentInterface *doc, GError **error); gboolean inkscape_selection_to_path (DocumentInterface *doc, GError **error); -//static -char * -inkscape_selection_combine (DocumentInterface *doc, const char * IN_type, GError **error); - //static char ** -inkscape_selection_divide (DocumentInterface *doc, GError **error); +inkscape_selection_combine (DocumentInterface *doc, const char * IN_type, GError **error); //static gboolean diff --git a/src/interface.cpp b/src/interface.cpp index e3036afdd..98c30bf3c 100644 --- a/src/interface.cpp +++ b/src/interface.cpp @@ -1987,7 +1987,7 @@ void ContextMenu::MakeGroupMenu(void) void ContextMenu::ActivateGroup(void) { - sp_selection_group(_desktop); + sp_selection_group(_desktop->selection, _desktop); } void ContextMenu::ActivateUngroup(void) diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 591f9d68d..9f8dd984a 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -125,6 +125,21 @@ because the layer manipulation code uses them. It should be rewritten specifical for that purpose. */ +// helper for printing error messages, regardless of whether we have a GUI or not +// If desktop == NULL, errors will be shown on stderr +static void +selection_display_message(SPDesktop *desktop, Inkscape::MessageType msgType, Glib::ustring const &msg) +{ + if (desktop) { + desktop->messageStack()->flash(msgType, msg); + } else { + if (msgType == Inkscape::IMMEDIATE_MESSAGE || + msgType == Inkscape::WARNING_MESSAGE || + msgType == Inkscape::ERROR_MESSAGE) { + g_printerr("%s\n", msg.c_str()); + } + } +} namespace Inkscape { @@ -722,20 +737,14 @@ static void sp_selection_group_impl(GSList *p, Inkscape::XML::Node *group, Inksc group->setPosition(topmost + 1); } -void sp_selection_group(SPDesktop *desktop) +void sp_selection_group(Inkscape::Selection *selection, SPDesktop *desktop) { - if (desktop == NULL) { - return; - } - - SPDocument *doc = sp_desktop_document(desktop); + SPDocument *doc = selection->layerModel()->getDocument(); Inkscape::XML::Document *xml_doc = doc->getReprDoc(); - Inkscape::Selection *selection = sp_desktop_selection(desktop); - // Check if something is selected. if (selection->isEmpty()) { - desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select some objects to group.")); + selection_display_message(desktop, Inkscape::WARNING_MESSAGE, _("Select some objects to group.")); return; } @@ -749,22 +758,17 @@ void sp_selection_group(SPDesktop *desktop) sp_selection_group_impl(p, group, xml_doc, doc); - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_SELECTION_GROUP, + DocumentUndo::done(doc, SP_VERB_SELECTION_GROUP, _("Group")); selection->set(group); Inkscape::GC::release(group); } -void sp_selection_ungroup(SPDesktop *desktop) +void sp_selection_ungroup(Inkscape::Selection *selection, SPDesktop *desktop) { - if (desktop == NULL) - return; - - Inkscape::Selection *selection = sp_desktop_selection(desktop); - if (selection->isEmpty()) { - desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select a group to ungroup.")); + selection_display_message(desktop, Inkscape::WARNING_MESSAGE, _("Select a group to ungroup.")); return; } @@ -807,12 +811,12 @@ void sp_selection_ungroup(SPDesktop *desktop) g_slist_free(new_select); } if (!ungrouped) { - desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No groups to ungroup in the selection.")); + selection_display_message(desktop, Inkscape::ERROR_MESSAGE, _("No groups to ungroup in the selection.")); } g_slist_free(items); - - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_SELECTION_UNGROUP, + + DocumentUndo::done(selection->layerModel()->getDocument(), SP_VERB_SELECTION_UNGROUP, _("Ungroup")); } @@ -890,22 +894,17 @@ static SPObject *prev_sibling(SPObject *child) } void -sp_selection_raise(SPDesktop *desktop) +sp_selection_raise(Inkscape::Selection *selection, SPDesktop *desktop) { - if (!desktop) - return; - - Inkscape::Selection *selection = sp_desktop_selection(desktop); - GSList const *items = const_cast(selection->itemList()); if (!items) { - desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select object(s) to raise.")); + selection_display_message(desktop, Inkscape::WARNING_MESSAGE, _("Select object(s) to raise.")); return; } SPGroup const *group = sp_item_list_common_parent_group(items); if (!group) { - desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("You cannot raise/lower objects from different groups or layers.")); + selection_display_message(desktop, Inkscape::ERROR_MESSAGE, _("You cannot raise/lower objects from different groups or layers.")); return; } @@ -943,21 +942,17 @@ sp_selection_raise(SPDesktop *desktop) g_slist_free(rev); } - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_SELECTION_RAISE, + DocumentUndo::done(selection->layerModel()->getDocument(), SP_VERB_SELECTION_RAISE, //TRANSLATORS: "Raise" means "to raise an object" in the undo history C_("Undo action", "Raise")); } -void sp_selection_raise_to_top(SPDesktop *desktop) +void sp_selection_raise_to_top(Inkscape::Selection *selection, SPDesktop *desktop) { - if (desktop == NULL) - return; - - SPDocument *document = sp_desktop_document(desktop); - Inkscape::Selection *selection = sp_desktop_selection(desktop); + SPDocument *document = selection->layerModel()->getDocument(); if (selection->isEmpty()) { - desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select object(s) to raise to top.")); + selection_display_message(desktop, Inkscape::WARNING_MESSAGE, _("Select object(s) to raise to top.")); return; } @@ -965,7 +960,7 @@ void sp_selection_raise_to_top(SPDesktop *desktop) SPGroup const *group = sp_item_list_common_parent_group(items); if (!group) { - desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("You cannot raise/lower objects from different groups or layers.")); + selection_display_message(desktop, Inkscape::ERROR_MESSAGE, _("You cannot raise/lower objects from different groups or layers.")); return; } @@ -983,22 +978,17 @@ void sp_selection_raise_to_top(SPDesktop *desktop) _("Raise to top")); } -void sp_selection_lower(SPDesktop *desktop) +void sp_selection_lower(Inkscape::Selection *selection, SPDesktop *desktop) { - if (desktop == NULL) - return; - - Inkscape::Selection *selection = sp_desktop_selection(desktop); - GSList const *items = const_cast(selection->itemList()); if (!items) { - desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select object(s) to lower.")); + selection_display_message(desktop, Inkscape::WARNING_MESSAGE, _("Select object(s) to lower.")); return; } SPGroup const *group = sp_item_list_common_parent_group(items); if (!group) { - desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("You cannot raise/lower objects from different groups or layers.")); + selection_display_message(desktop, Inkscape::ERROR_MESSAGE, _("You cannot raise/lower objects from different groups or layers.")); return; } @@ -1041,20 +1031,16 @@ void sp_selection_lower(SPDesktop *desktop) g_slist_free(rev); } - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_SELECTION_LOWER, + DocumentUndo::done(selection->layerModel()->getDocument(), SP_VERB_SELECTION_LOWER, _("Lower")); } -void sp_selection_lower_to_bottom(SPDesktop *desktop) +void sp_selection_lower_to_bottom(Inkscape::Selection *selection, SPDesktop *desktop) { - if (desktop == NULL) - return; - - SPDocument *document = sp_desktop_document(desktop); - Inkscape::Selection *selection = sp_desktop_selection(desktop); + SPDocument *document = selection->layerModel()->getDocument(); if (selection->isEmpty()) { - desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select object(s) to lower to bottom.")); + selection_display_message(desktop, Inkscape::WARNING_MESSAGE, _("Select object(s) to lower to bottom.")); return; } @@ -1062,7 +1048,7 @@ void sp_selection_lower_to_bottom(SPDesktop *desktop) SPGroup const *group = sp_item_list_common_parent_group(items); if (!group) { - desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("You cannot raise/lower objects from different groups or layers.")); + selection_display_message(desktop, Inkscape::ERROR_MESSAGE, _("You cannot raise/lower objects from different groups or layers.")); return; } diff --git a/src/selection-chemistry.h b/src/selection-chemistry.h index f58ede21a..f7a4f928c 100644 --- a/src/selection-chemistry.h +++ b/src/selection-chemistry.h @@ -77,13 +77,13 @@ void sp_selection_tile(SPDesktop *desktop, bool apply = true); void sp_selection_untile(SPDesktop *desktop); //void sp_selection_group_impl(GSList const *reprs_to_group, Inkscape::XML::Node *group, Inkscape::XML::Document *xml_doc, SPDocument *doc); -void sp_selection_group(SPDesktop *desktop); -void sp_selection_ungroup(SPDesktop *desktop); +void sp_selection_group(Inkscape::Selection *selection, SPDesktop *desktop); +void sp_selection_ungroup(Inkscape::Selection *selection, SPDesktop *desktop); -void sp_selection_raise(SPDesktop *desktop); -void sp_selection_raise_to_top(SPDesktop *desktop); -void sp_selection_lower(SPDesktop *desktop); -void sp_selection_lower_to_bottom(SPDesktop *desktop); +void sp_selection_raise(Inkscape::Selection *selection, SPDesktop *desktop); +void sp_selection_raise_to_top(Inkscape::Selection *selection, SPDesktop *desktop); +void sp_selection_lower(Inkscape::Selection *selection, SPDesktop *desktop); +void sp_selection_lower_to_bottom(Inkscape::Selection *selection, SPDesktop *desktop); SPCSSAttr *take_style_from_item (SPItem *item); diff --git a/src/verbs.cpp b/src/verbs.cpp index 6187cfb4c..fed9622fb 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1089,6 +1089,24 @@ void SelectionVerb::perform(SPAction *action, void *data) case SP_VERB_SELECTION_SLICE: sp_selected_path_slice(selection, dt); break; + case SP_VERB_SELECTION_TO_FRONT: + sp_selection_raise_to_top(selection, dt); + break; + case SP_VERB_SELECTION_TO_BACK: + sp_selection_lower_to_bottom(selection, dt); + break; + case SP_VERB_SELECTION_RAISE: + sp_selection_raise(selection, dt); + break; + case SP_VERB_SELECTION_LOWER: + sp_selection_lower(selection, dt); + break; + case SP_VERB_SELECTION_GROUP: + sp_selection_group(selection, dt); + break; + case SP_VERB_SELECTION_UNGROUP: + sp_selection_ungroup(selection, dt); + break; default: handled = false; break; @@ -1107,25 +1125,6 @@ void SelectionVerb::perform(SPAction *action, void *data) g_assert(dt->_dlg_mgr != NULL); switch (reinterpret_cast(data)) { - case SP_VERB_SELECTION_TO_FRONT: - sp_selection_raise_to_top(dt); - break; - case SP_VERB_SELECTION_TO_BACK: - sp_selection_lower_to_bottom(dt); - break; - case SP_VERB_SELECTION_RAISE: - sp_selection_raise(dt); - break; - case SP_VERB_SELECTION_LOWER: - sp_selection_lower(dt); - break; - case SP_VERB_SELECTION_GROUP: - sp_selection_group(dt); - break; - case SP_VERB_SELECTION_UNGROUP: - sp_selection_ungroup(dt); - break; - case SP_VERB_SELECTION_TEXTTOPATH: text_put_on_path(); break; -- cgit v1.2.3 From 104efe4e3ecadc975ab76748c66f041abf8ee7b1 Mon Sep 17 00:00:00 2001 From: Eric Greveson Date: Thu, 4 Jul 2013 15:01:44 +0100 Subject: Code readability improvements and licence changes for action-context.* based on merge request code review and feedback (bzr r12387.1.7) --- src/desktop.cpp | 50 ++--- src/desktop.h | 4 +- src/extension/dbus/dbus-init.cpp | 4 +- src/extension/dbus/document-interface.cpp | 299 +++++++++++++----------------- src/extension/dbus/document-interface.h | 2 +- src/extension/effect.cpp | 7 +- src/helper/action-context.cpp | 4 +- src/helper/action-context.h | 2 +- src/selection-chemistry.cpp | 22 +-- src/selection-describer.cpp | 4 +- src/selection.cpp | 14 +- src/selection.h | 8 +- src/splivarot.cpp | 2 +- src/verbs.cpp | 91 +++------ src/verbs.h | 2 +- 15 files changed, 210 insertions(+), 305 deletions(-) (limited to 'src') diff --git a/src/desktop.cpp b/src/desktop.cpp index 485fcfcc4..ce740f76f 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -96,7 +96,7 @@ SPDesktop::SPDesktop() : _dlg_mgr( 0 ), namedview( 0 ), canvas( 0 ), - layer_model( 0 ), + layers( 0 ), selection( 0 ), event_context( 0 ), layer_manager( 0 ), @@ -142,11 +142,11 @@ SPDesktop::SPDesktop() : _d2w.setIdentity(); _w2d.setIdentity(); - layer_model = new Inkscape::LayerModel(); - layer_model->_layer_activated_signal.connect(sigc::bind(sigc::ptr_fun(_layer_activated), this)); - layer_model->_layer_deactivated_signal.connect(sigc::bind(sigc::ptr_fun(_layer_deactivated), this)); - layer_model->_layer_changed_signal.connect(sigc::bind(sigc::ptr_fun(_layer_hierarchy_changed), this)); - selection = Inkscape::GC::release( new Inkscape::Selection(layer_model, this) ); + layers = new Inkscape::LayerModel(); + layers->_layer_activated_signal.connect(sigc::bind(sigc::ptr_fun(_layer_activated), this)); + layers->_layer_deactivated_signal.connect(sigc::bind(sigc::ptr_fun(_layer_deactivated), this)); + layers->_layer_changed_signal.connect(sigc::bind(sigc::ptr_fun(_layer_hierarchy_changed), this)); + selection = Inkscape::GC::release( new Inkscape::Selection(layers, this) ); } void @@ -176,7 +176,7 @@ SPDesktop::init (SPNamedView *nv, SPCanvas *aCanvas, Inkscape::UI::View::EditWid dkey = SPItem::display_key_new(1); /* Connect display key to layer model */ - layer_model->setDisplayKey(dkey); + layers->setDisplayKey(dkey); /* Connect document */ setDocument (document); @@ -367,7 +367,7 @@ void SPDesktop::destroy() g_object_unref (G_OBJECT (ec)); } - delete layer_model; + delete layers; if (layer_manager) { delete layer_manager; @@ -491,42 +491,42 @@ void SPDesktop::displayColorModeToggle() { // Pass-through LayerModel functions SPObject *SPDesktop::currentRoot() const { - return layer_model->currentRoot(); + return layers->currentRoot(); } SPObject *SPDesktop::currentLayer() const { - return layer_model->currentLayer(); + return layers->currentLayer(); } void SPDesktop::setCurrentLayer(SPObject *object) { - layer_model->setCurrentLayer(object); + layers->setCurrentLayer(object); } void SPDesktop::toggleLayerSolo(SPObject *object) { - layer_model->toggleLayerSolo(object); + layers->toggleLayerSolo(object); } void SPDesktop::toggleHideAllLayers(bool hide) { - layer_model->toggleHideAllLayers(hide); + layers->toggleHideAllLayers(hide); } void SPDesktop::toggleLockAllLayers(bool lock) { - layer_model->toggleLockAllLayers(lock); + layers->toggleLockAllLayers(lock); } void SPDesktop::toggleLockOtherLayers(SPObject *object) { - layer_model->toggleLockOtherLayers(object); + layers->toggleLockOtherLayers(object); } bool SPDesktop::isLayer(SPObject *object) const { - return layer_model->isLayer(object); + return layers->isLayer(object); } /** @@ -1491,7 +1491,7 @@ SPDesktop::setDocument (SPDocument *doc) this->doc()->getRoot()->invoke_hide(dkey); } - layer_model->setDocument(doc); + layers->setDocument(doc); // remove old EventLog if it exists (see also: bug #1071082) if (event_log) { @@ -1599,9 +1599,9 @@ _onSelectionChanged */ SPItem *item=selection->singleItem(); if (item) { - SPObject *layer=desktop->layer_model->layerForObject(item); + SPObject *layer=desktop->layers->layerForObject(item); if ( layer && layer != desktop->currentLayer() ) { - desktop->layer_model->setCurrentLayer(layer); + desktop->layers->setCurrentLayer(layer); } } } @@ -1646,9 +1646,9 @@ _layer_hierarchy_changed(SPObject */*top*/, SPObject *bottom, /// Called when document is starting to be rebuilt. static void _reconstruction_start(SPDesktop * desktop) { - // printf("Desktop, starting reconstruction\n"); + g_debug("Desktop, starting reconstruction\n"); desktop->_reconstruction_old_layer_id = desktop->currentLayer()->getId() ? desktop->currentLayer()->getId() : ""; - desktop->layer_model->reset(); + desktop->layers->reset(); /* GSList const * selection_objs = desktop->selection->list(); @@ -1658,22 +1658,22 @@ static void _reconstruction_start(SPDesktop * desktop) */ desktop->selection->clear(); - // printf("Desktop, starting reconstruction end\n"); + g_debug("Desktop, starting reconstruction end\n"); } /// Called when document rebuild is finished. static void _reconstruction_finish(SPDesktop * desktop) { - // printf("Desktop, finishing reconstruction\n"); + g_debug("Desktop, finishing reconstruction\n"); if ( !desktop->_reconstruction_old_layer_id.empty() ) { SPObject * newLayer = desktop->namedview->document->getObjectById(desktop->_reconstruction_old_layer_id); if (newLayer != NULL) { - desktop->layer_model->setCurrentLayer(newLayer); + desktop->layers->setCurrentLayer(newLayer); } desktop->_reconstruction_old_layer_id.clear(); - // printf("Desktop, finishing reconstruction end\n"); } + g_debug("Desktop, finishing reconstruction end\n"); } /** diff --git a/src/desktop.h b/src/desktop.h index 661470ded..9a3c609d0 100644 --- a/src/desktop.h +++ b/src/desktop.h @@ -125,7 +125,7 @@ public: Inkscape::UI::Dialog::DialogManager *_dlg_mgr; SPNamedView *namedview; SPCanvas *canvas; - Inkscape::LayerModel *layer_model; + Inkscape::LayerModel *layers; /// current selection; will never generally be NULL Inkscape::Selection *selection; SPEventContext *event_context; @@ -263,7 +263,7 @@ public: void set_active (bool new_active); - // Could make all callers use layer_model instead of passing calls through? + // Could make all callers use this->layers instead of passing calls through? SPObject *currentRoot() const; SPObject *currentLayer() const; void setCurrentLayer(SPObject *object); diff --git a/src/extension/dbus/dbus-init.cpp b/src/extension/dbus/dbus-init.cpp index 96d72c0f6..fe59fc154 100644 --- a/src/extension/dbus/dbus-init.cpp +++ b/src/extension/dbus/dbus-init.cpp @@ -153,7 +153,7 @@ init_active_document() name.c_str()); // Set the document info for this interface - obj->context = inkscape_active_action_context(); + obj->doc_context = inkscape_active_action_context(); } return strdup(name.c_str()); } @@ -178,7 +178,7 @@ dbus_init_desktop_interface (SPDesktop * dt) obj = (DocumentInterface*) dbus_register_object (connection, proxy, TYPE_DOCUMENT_INTERFACE, &dbus_glib_document_interface_object_info, name.c_str()); - obj->context = Inkscape::ActionContext(dt); + obj->doc_context = Inkscape::ActionContext(dt); obj->updates = TRUE; dt->dbus_document_interface=obj; return strdup(name.c_str()); diff --git a/src/extension/dbus/document-interface.cpp b/src/extension/dbus/document-interface.cpp index 87b769e26..6d6f983c5 100644 --- a/src/extension/dbus/document-interface.cpp +++ b/src/extension/dbus/document-interface.cpp @@ -190,7 +190,7 @@ selection_swap(Inkscape::Selection *sel, gchar *name, GError **error) { const GSList *oldsel = g_slist_copy((GSList *)sel->list()); - sel->set(get_object_by_name(sel->layerModel()->getDocument(), name, error)); + sel->set(get_object_by_name(sel->layers()->getDocument(), name, error)); return oldsel; } @@ -224,8 +224,8 @@ dbus_create_node (SPDocument *doc, const gchar *type) gchar *finish_create_shape (DocumentInterface *object, GError ** /*error*/, Inkscape::XML::Node *newNode, gchar *desc) { SPCSSAttr *style = NULL; - if (object->context.getDesktop()) { - style = sp_desktop_get_style(object->context.getDesktop(), TRUE); + if (object->doc_context.getDesktop()) { + style = sp_desktop_get_style(object->doc_context.getDesktop(), TRUE); } if (style) { Glib::ustring str; @@ -236,13 +236,11 @@ gchar *finish_create_shape (DocumentInterface *object, GError ** /*error*/, Inks newNode->setAttribute("style", "fill:#0000ff;fill-opacity:1;stroke:#c900b9;stroke-width:0;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none", TRUE); } - object->context.getSelection()->layerModel()->currentLayer()->appendChildRepr(newNode); - object->context.getSelection()->layerModel()->currentLayer()->updateRepr(); + object->doc_context.getSelection()->layers()->currentLayer()->appendChildRepr(newNode); + object->doc_context.getSelection()->layers()->currentLayer()->updateRepr(); if (object->updates) { - Inkscape::DocumentUndo::done(object->context.getDocument(), 0, (gchar *)desc); - //} else { - //document_interface_pause_updates(object, error); + Inkscape::DocumentUndo::done(object->doc_context.getDocument(), 0, (gchar *)desc); } return strdup(newNode->attribute("id")); @@ -259,21 +257,17 @@ gchar *finish_create_shape (DocumentInterface *object, GError ** /*error*/, Inks gboolean dbus_call_verb (DocumentInterface *object, int verbid, GError **error) { - SPDesktop *desk = object->context.getDesktop(); + SPDesktop *desk = object->doc_context.getDesktop(); if ( desk ) { desktop_ensure_active (desk); } Inkscape::Verb *verb = Inkscape::Verb::get( verbid ); if ( verb ) { - SPAction *action = verb->get_action(object->context); + SPAction *action = verb->get_action(object->doc_context); if ( action ) { - //if (!object->updates) - //document_interface_pause_updates (object, error); sp_action_perform( action, NULL ); if (object->updates) - Inkscape::DocumentUndo::done(object->context.getDocument(), verb->get_code(), g_strdup(verb->get_tip())); - //if (!object->updates) - //document_interface_pause_updates (object, error); + Inkscape::DocumentUndo::done(object->doc_context.getDocument(), verb->get_code(), g_strdup(verb->get_tip())); return TRUE; } } @@ -281,6 +275,20 @@ dbus_call_verb (DocumentInterface *object, int verbid, GError **error) return FALSE; } +/* + * Check that the desktop is not NULL. If it is NULL, set the error to a useful message. + */ +bool +ensure_desktop_valid(SPDesktop* desk, GError **error) +{ + if (desk) { + return true; + } + + g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Document interface action requires a GUI"); + return false; +} + /**************************************************************************** DOCUMENT INTERFACE CLASS STUFF ****************************************************************************/ @@ -313,7 +321,7 @@ document_interface_class_init (DocumentInterfaceClass *klass) static void document_interface_init (DocumentInterface *object) { - object->context = Inkscape::ActionContext(); + object->doc_context = Inkscape::ActionContext(); } @@ -331,24 +339,24 @@ document_interface_new (void) gboolean document_interface_delete_all(DocumentInterface *object, GError ** /*error*/) { - sp_edit_clear_all(object->context.getSelection()); + sp_edit_clear_all(object->doc_context.getSelection()); return TRUE; } gboolean document_interface_call_verb (DocumentInterface *object, gchar *verbid, GError **error) { - SPDesktop *desk = object->context.getDesktop(); + SPDesktop *desk = object->doc_context.getDesktop(); if ( desk ) { desktop_ensure_active (desk); } Inkscape::Verb *verb = Inkscape::Verb::getbyid( verbid ); if ( verb ) { - SPAction *action = verb->get_action(object->context); + SPAction *action = verb->get_action(object->doc_context); if ( action ) { sp_action_perform( action, NULL ); if (object->updates) { - Inkscape::DocumentUndo::done(object->context.getDocument(), verb->get_code(), g_strdup(verb->get_tip())); + Inkscape::DocumentUndo::done(object->doc_context.getDocument(), verb->get_code(), g_strdup(verb->get_tip())); } return TRUE; } @@ -368,7 +376,7 @@ document_interface_rectangle (DocumentInterface *object, int x, int y, { - Inkscape::XML::Node *newNode = dbus_create_node(object->context.getDocument(), "svg:rect"); + Inkscape::XML::Node *newNode = dbus_create_node(object->doc_context.getDocument(), "svg:rect"); sp_repr_set_int(newNode, "x", x); //could also use newNode->setAttribute() sp_repr_set_int(newNode, "y", y); sp_repr_set_int(newNode, "width", width); @@ -380,7 +388,7 @@ gchar* document_interface_ellipse_center (DocumentInterface *object, int cx, int cy, int rx, int ry, GError **error) { - Inkscape::XML::Node *newNode = dbus_create_node(object->context.getDocument(), "svg:path"); + Inkscape::XML::Node *newNode = dbus_create_node(object->doc_context.getDocument(), "svg:path"); newNode->setAttribute("sodipodi:type", "arc"); sp_repr_set_int(newNode, "sodipodi:cx", cx); sp_repr_set_int(newNode, "sodipodi:cy", cy); @@ -395,7 +403,7 @@ document_interface_polygon (DocumentInterface *object, int cx, int cy, GError **error) { gdouble rot = ((rotation / 180.0) * 3.14159265) - ( 3.14159265 / 2.0); - Inkscape::XML::Node *newNode = dbus_create_node(object->context.getDocument(), "svg:path"); + Inkscape::XML::Node *newNode = dbus_create_node(object->doc_context.getDocument(), "svg:path"); newNode->setAttribute("inkscape:flatsided", "true"); newNode->setAttribute("sodipodi:type", "star"); sp_repr_set_int(newNode, "sodipodi:cx", cx); @@ -416,7 +424,7 @@ document_interface_star (DocumentInterface *object, int cx, int cy, int r1, int r2, int sides, gdouble rounded, gdouble arg1, gdouble arg2, GError **error) { - Inkscape::XML::Node *newNode = dbus_create_node(object->context.getDocument(), "svg:path"); + Inkscape::XML::Node *newNode = dbus_create_node(object->doc_context.getDocument(), "svg:path"); newNode->setAttribute("inkscape:flatsided", "false"); newNode->setAttribute("sodipodi:type", "star"); sp_repr_set_int(newNode, "sodipodi:cx", cx); @@ -445,7 +453,7 @@ gchar* document_interface_line (DocumentInterface *object, int x, int y, int x2, int y2, GError **error) { - Inkscape::XML::Node *newNode = dbus_create_node(object->context.getDocument(), "svg:path"); + Inkscape::XML::Node *newNode = dbus_create_node(object->doc_context.getDocument(), "svg:path"); std::stringstream out; // Not sure why this works. out << "m " << x << "," << y << " " << x2 - x << "," << y2 - y; @@ -457,7 +465,7 @@ gchar* document_interface_spiral (DocumentInterface *object, int cx, int cy, int r, int revolutions, GError **error) { - Inkscape::XML::Node *newNode = dbus_create_node(object->context.getDocument(), "svg:path"); + Inkscape::XML::Node *newNode = dbus_create_node(object->doc_context.getDocument(), "svg:path"); newNode->setAttribute("sodipodi:type", "spiral"); sp_repr_set_int(newNode, "sodipodi:cx", cx); sp_repr_set_int(newNode, "sodipodi:cy", cy); @@ -478,13 +486,13 @@ gchar* document_interface_text (DocumentInterface *object, int x, int y, gchar *text, GError **error) { - Inkscape::XML::Node *text_node = dbus_create_node(object->context.getDocument(), "svg:text"); + Inkscape::XML::Node *text_node = dbus_create_node(object->doc_context.getDocument(), "svg:text"); sp_repr_set_int(text_node, "x", x); sp_repr_set_int(text_node, "y", y); //just a workaround so i can get an spitem from the name gchar *name = finish_create_shape (object, error, text_node, (gchar *)"create text"); - SPItem* text_obj=(SPItem* )get_object_by_name(object->context.getDocument(), name, error); + SPItem* text_obj=(SPItem* )get_object_by_name(object->doc_context.getDocument(), name, error); sp_te_set_repr_text_multiline(text_obj, text); return name; @@ -497,16 +505,16 @@ document_interface_image (DocumentInterface *object, int x, int y, gchar *filena if (!uri) return FALSE; - Inkscape::XML::Node *newNode = dbus_create_node(object->context.getDocument(), "svg:image"); + Inkscape::XML::Node *newNode = dbus_create_node(object->doc_context.getDocument(), "svg:image"); sp_repr_set_int(newNode, "x", x); sp_repr_set_int(newNode, "y", y); newNode->setAttribute("xlink:href", uri); - object->context.getSelection()->layerModel()->currentLayer()->appendChildRepr(newNode); - object->context.getSelection()->layerModel()->currentLayer()->updateRepr(); + object->doc_context.getSelection()->layers()->currentLayer()->appendChildRepr(newNode); + object->doc_context.getSelection()->layers()->currentLayer()->updateRepr(); if (object->updates) - Inkscape::DocumentUndo::done(object->context.getDocument(), 0, "Imported bitmap."); + Inkscape::DocumentUndo::done(object->doc_context.getDocument(), 0, "Imported bitmap."); //g_free(uri); return strdup(newNode->attribute("id")); @@ -514,18 +522,16 @@ document_interface_image (DocumentInterface *object, int x, int y, gchar *filena gchar *document_interface_node(DocumentInterface *object, gchar *type, GError ** /*error*/) { - SPDocument * doc = object->context.getDocument(); + SPDocument * doc = object->doc_context.getDocument(); Inkscape::XML::Document *xml_doc = doc->getReprDoc(); Inkscape::XML::Node *newNode = xml_doc->createElement(type); - object->context.getSelection()->layerModel()->currentLayer()->appendChildRepr(newNode); - object->context.getSelection()->layerModel()->currentLayer()->updateRepr(); + object->doc_context.getSelection()->layers()->currentLayer()->appendChildRepr(newNode); + object->doc_context.getSelection()->layers()->currentLayer()->updateRepr(); if (object->updates) { Inkscape::DocumentUndo::done(doc, 0, (gchar *)"created empty node"); - //} else { - //document_interface_pause_updates(object, error); } return strdup(newNode->attribute("id")); @@ -537,22 +543,19 @@ gchar *document_interface_node(DocumentInterface *object, gchar *type, GError ** gdouble document_interface_document_get_width (DocumentInterface *object) { - return object->context.getDocument()->getWidth(); + return object->doc_context.getDocument()->getWidth(); } gdouble document_interface_document_get_height (DocumentInterface *object) { - return object->context.getDocument()->getHeight(); + return object->doc_context.getDocument()->getHeight(); } gchar *document_interface_document_get_css(DocumentInterface *object, GError ** error) { - SPDesktop *desk = object->context.getDesktop(); - if (!desk) { - g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Document get CSS requires a GUI"); - return NULL; - } + SPDesktop *desk = object->doc_context.getDesktop(); + g_return_val_if_fail(ensure_desktop_valid(desk, error), NULL); SPCSSAttr *current = desk->current; Glib::ustring str; sp_repr_css_write_string(current, str); @@ -562,11 +565,8 @@ gchar *document_interface_document_get_css(DocumentInterface *object, GError ** gboolean document_interface_document_merge_css(DocumentInterface *object, gchar *stylestring, GError ** error) { - SPDesktop *desk = object->context.getDesktop(); - if (!desk) { - g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Document merge CSS requires a GUI"); - return FALSE; - } + SPDesktop *desk = object->doc_context.getDesktop(); + g_return_val_if_fail(ensure_desktop_valid(desk, error), FALSE); SPCSSAttr * style = sp_repr_css_attr_new(); sp_repr_css_attr_add_from_string(style, stylestring); sp_desktop_set_style(desk, style); @@ -576,11 +576,8 @@ gboolean document_interface_document_merge_css(DocumentInterface *object, gboolean document_interface_document_set_css(DocumentInterface *object, gchar *stylestring, GError ** error) { - SPDesktop *desk = object->context.getDesktop(); - if (!desk) { - g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Document set CSS requires a GUI"); - return FALSE; - } + SPDesktop *desk = object->doc_context.getDesktop(); + g_return_val_if_fail(ensure_desktop_valid(desk, error), FALSE); SPCSSAttr * style = sp_repr_css_attr_new(); sp_repr_css_attr_add_from_string (style, stylestring); //Memory leak? @@ -604,11 +601,8 @@ document_interface_document_set_display_area (DocumentInterface *object, double border, GError **error) { - SPDesktop *desk = object->context.getDesktop(); - if (!desk) { - g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Document set display area requires a GUI"); - return FALSE; - } + SPDesktop *desk = object->doc_context.getDesktop(); + g_return_val_if_fail(ensure_desktop_valid(desk, error), FALSE); desk->set_display_area (x0, y0, x1, @@ -621,7 +615,7 @@ document_interface_document_set_display_area (DocumentInterface *object, GArray * document_interface_document_get_display_area (DocumentInterface *object) { - SPDesktop *desk = object->context.getDesktop(); + SPDesktop *desk = object->doc_context.getDesktop(); if (!desk) { return NULL; } @@ -650,7 +644,7 @@ gboolean document_interface_set_attribute (DocumentInterface *object, char *shape, char *attribute, char *newval, GError **error) { - Inkscape::XML::Node *newNode = get_repr_by_name(object->context.getDocument(), shape, error); + Inkscape::XML::Node *newNode = get_repr_by_name(object->doc_context.getDocument(), shape, error); /* ALTERNATIVE (is this faster?) Inkscape::XML::Node *newnode = sp_repr_lookup_name((doc->root)->repr, name); @@ -670,7 +664,7 @@ document_interface_set_int_attribute (DocumentInterface *object, char *shape, char *attribute, int newval, GError **error) { - Inkscape::XML::Node *newNode = get_repr_by_name (object->context.getDocument(), shape, error); + Inkscape::XML::Node *newNode = get_repr_by_name (object->doc_context.getDocument(), shape, error); if (!newNode) return FALSE; @@ -684,7 +678,7 @@ document_interface_set_double_attribute (DocumentInterface *object, char *shape, char *attribute, double newval, GError **error) { - Inkscape::XML::Node *newNode = get_repr_by_name (object->context.getDocument(), shape, error); + Inkscape::XML::Node *newNode = get_repr_by_name (object->doc_context.getDocument(), shape, error); if (!dbus_check_string (attribute, error, "New value string was empty.")) return FALSE; @@ -699,7 +693,7 @@ gchar * document_interface_get_attribute (DocumentInterface *object, char *shape, char *attribute, GError **error) { - Inkscape::XML::Node *newNode = get_repr_by_name(object->context.getDocument(), shape, error); + Inkscape::XML::Node *newNode = get_repr_by_name(object->doc_context.getDocument(), shape, error); if (!dbus_check_string (attribute, error, "Attribute name empty.")) return NULL; @@ -713,11 +707,11 @@ gboolean document_interface_move (DocumentInterface *object, gchar *name, gdouble x, gdouble y, GError **error) { - const GSList *oldsel = selection_swap(object->context.getSelection(), name, error); + const GSList *oldsel = selection_swap(object->doc_context.getSelection(), name, error); if (!oldsel) return FALSE; - sp_selection_move (object->context.getSelection(), x, 0 - y); - selection_restore(object->context.getSelection(), oldsel); + sp_selection_move (object->doc_context.getSelection(), x, 0 - y); + selection_restore(object->doc_context.getSelection(), oldsel); return TRUE; } @@ -725,13 +719,13 @@ gboolean document_interface_move_to (DocumentInterface *object, gchar *name, gdouble x, gdouble y, GError **error) { - const GSList *oldsel = selection_swap(object->context.getSelection(), name, error); + const GSList *oldsel = selection_swap(object->doc_context.getSelection(), name, error); if (!oldsel) return FALSE; - Inkscape::Selection * sel = object->context.getSelection(); - sp_selection_move (object->context.getSelection(), x - selection_get_center_x(sel), + Inkscape::Selection * sel = object->doc_context.getSelection(); + sp_selection_move (object->doc_context.getSelection(), x - selection_get_center_x(sel), 0 - (y - selection_get_center_y(sel))); - selection_restore(object->context.getSelection(), oldsel); + selection_restore(object->doc_context.getSelection(), oldsel); return TRUE; } @@ -739,18 +733,18 @@ gboolean document_interface_object_to_path (DocumentInterface *object, char *shape, GError **error) { - const GSList *oldsel = selection_swap(object->context.getSelection(), shape, error); + const GSList *oldsel = selection_swap(object->doc_context.getSelection(), shape, error); if (!oldsel) return FALSE; dbus_call_verb (object, SP_VERB_OBJECT_TO_CURVE, error); - selection_restore(object->context.getSelection(), oldsel); + selection_restore(object->doc_context.getSelection(), oldsel); return TRUE; } gchar * document_interface_get_path (DocumentInterface *object, char *pathname, GError **error) { - Inkscape::XML::Node *node = get_repr_by_name(object->context.getDocument(), pathname, error); + Inkscape::XML::Node *node = get_repr_by_name(object->doc_context.getDocument(), pathname, error); if (!node) return NULL; @@ -787,7 +781,7 @@ document_interface_modify_css (DocumentInterface *object, gchar *shape, { // Doesn't like non-variable strings for some reason. gchar style[] = "style"; - Inkscape::XML::Node *node = get_repr_by_name(object->context.getDocument(), shape, error); + Inkscape::XML::Node *node = get_repr_by_name(object->doc_context.getDocument(), shape, error); if (!dbus_check_string (cssattrb, error, "Attribute string empty.")) return FALSE; @@ -808,7 +802,7 @@ document_interface_merge_css (DocumentInterface *object, gchar *shape, { gchar style[] = "style"; - Inkscape::XML::Node *node = get_repr_by_name(object->context.getDocument(), shape, error); + Inkscape::XML::Node *node = get_repr_by_name(object->doc_context.getDocument(), shape, error); if (!dbus_check_string (stylestring, error, "Style string empty.")) return FALSE; @@ -854,12 +848,12 @@ gboolean document_interface_move_to_layer (DocumentInterface *object, gchar *shape, gchar *layerstr, GError **error) { - const GSList *oldsel = selection_swap(object->context.getSelection(), shape, error); + const GSList *oldsel = selection_swap(object->doc_context.getSelection(), shape, error); if (!oldsel) return FALSE; document_interface_selection_move_to_layer(object, layerstr, error); - selection_restore(object->context.getSelection(), oldsel); + selection_restore(object->doc_context.getSelection(), oldsel); return TRUE; } @@ -867,7 +861,7 @@ GArray *document_interface_get_node_coordinates(DocumentInterface * /*object*/, { //FIXME: Needs lot's of work. /* - Inkscape::XML::Node *shapenode = get_repr_by_name (object->context.getDocument(), shape, error); + Inkscape::XML::Node *shapenode = get_repr_by_name (object->doc_context.getDocument(), shape, error); if (shapenode == NULL || shapenode->attribute("d") == NULL) { return FALSE; } @@ -885,7 +879,7 @@ gboolean document_interface_set_text (DocumentInterface *object, gchar *name, gchar *text, GError **error) { - SPItem* text_obj=(SPItem* )get_object_by_name(object->context.getDocument(), name, error); + SPItem* text_obj=(SPItem* )get_object_by_name(object->doc_context.getDocument(), name, error); //TODO verify object type if (!text_obj) return FALSE; @@ -902,7 +896,7 @@ document_interface_text_apply_style (DocumentInterface *object, gchar *name, GError **error) { - SPItem* text_obj=(SPItem* )get_object_by_name(object->context.getDocument(), name, error); + SPItem* text_obj=(SPItem* )get_object_by_name(object->doc_context.getDocument(), name, error); //void sp_te_apply_style(SPItem *text, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPCSSAttr const *css) //TODO verify object type @@ -931,7 +925,7 @@ document_interface_text_apply_style (DocumentInterface *object, gchar *name, gboolean document_interface_save (DocumentInterface *object, GError **error) { - SPDocument * doc = object->context.getDocument(); + SPDocument * doc = object->doc_context.getDocument(); printf("1: %s\n2: %s\n3: %s\n", doc->getURI(), doc->getBase(), doc->getName()); if (doc->getURI()) return document_interface_save_as (object, doc->getURI(), error); @@ -941,14 +935,14 @@ document_interface_save (DocumentInterface *object, GError **error) gboolean document_interface_load(DocumentInterface *object, gchar *filename, GError ** /*error*/) { - SPDesktop *desk = object->context.getDesktop(); + SPDesktop *desk = object->doc_context.getDesktop(); if (desk) { desktop_ensure_active(desk); } const Glib::ustring file(filename); sp_file_open(file, NULL, TRUE, TRUE); if (object->updates) { - Inkscape::DocumentUndo::done(object->context.getDocument(), SP_VERB_FILE_OPEN, "Opened File"); + Inkscape::DocumentUndo::done(object->doc_context.getDocument(), SP_VERB_FILE_OPEN, "Opened File"); } return TRUE; } @@ -957,12 +951,12 @@ gchar * document_interface_import (DocumentInterface *object, gchar *filename, GError **error) { - SPDesktop *desk = object->context.getDesktop(); + SPDesktop *desk = object->doc_context.getDesktop(); if (desk) { desktop_ensure_active(desk); } const Glib::ustring file(filename); - SPDocument * doc = object->context.getDocument(); + SPDocument * doc = object->doc_context.getDocument(); SPObject *new_obj = NULL; new_obj = file_import(doc, file, NULL); @@ -973,7 +967,8 @@ gboolean document_interface_save_as (DocumentInterface *object, const gchar *filename, GError **error) { - SPDocument * doc = object->context.getDocument(); + // FIXME: Isn't there a verb we can use for this instead? + SPDocument * doc = object->doc_context.getDocument(); #ifdef WITH_GNOME_VFS const Glib::ustring file(filename); return file_save_remote(doc, file, NULL, TRUE, TRUE); @@ -986,18 +981,16 @@ document_interface_save_as (DocumentInterface *object, Inkscape::Extension::save(NULL, doc, filename, false, false, true, Inkscape::Extension::FILE_SAVE_METHOD_SAVE_AS); } catch (...) { - //SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("Document not saved.")); + // FIXME: catch ... is not usually a great idea, why is it needed here? return false; } - //SP_ACTIVE_DESKTOP->event_log->rememberFileSave(); - //SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::NORMAL_MESSAGE, "Document saved."); return true; } gboolean document_interface_mark_as_unmodified(DocumentInterface *object, GError ** /*error*/) { - SPDocument * doc = object->context.getDocument(); + SPDocument * doc = object->doc_context.getDocument(); if (doc) { doc->modified_since_save = FALSE; } @@ -1008,7 +1001,7 @@ gboolean document_interface_mark_as_unmodified(DocumentInterface *object, GError gboolean document_interface_print_to_file (DocumentInterface *object, GError **error) { - SPDocument * doc = object->context.getDocument(); + SPDocument * doc = object->doc_context.getDocument(); sp_print_document_to_file (doc, g_strdup("/home/soren/test.pdf")); return TRUE; @@ -1053,45 +1046,27 @@ document_interface_redo (DocumentInterface *object, GError **error) void document_interface_pause_updates(DocumentInterface *object, GError ** error) { - SPDesktop *desk = object->context.getDesktop(); - if (!desk) { - g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Document pause updates requires a GUI"); - return; - } + SPDesktop *desk = object->doc_context.getDesktop(); + g_return_if_fail(ensure_desktop_valid(desk, error)); object->updates = FALSE; desk->canvas->drawing_disabled = 1; - //desk->canvas->need_redraw = 0; - //desk->canvas->need_repick = 0; - //object->context.getDocument()->root->uflags = FALSE; - //object->context.getDocument()->root->mflags = FALSE; } void document_interface_resume_updates(DocumentInterface *object, GError ** error) { - SPDesktop *desk = object->context.getDesktop(); - if (!desk) { - g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Document resume updates requires a GUI"); - return; - } + SPDesktop *desk = object->doc_context.getDesktop(); + g_return_if_fail(ensure_desktop_valid(desk, error)); object->updates = TRUE; desk->canvas->drawing_disabled = 0; - //desk->canvas->need_redraw = 1; - //desk->canvas->need_repick = 1; - //object->context.getDocument()->root->uflags = TRUE; - //object->context.getDocument()->root->mflags = TRUE; - //object->context.getDocument()->_updateDocument(); //FIXME: use better verb than rect. - Inkscape::DocumentUndo::done(object->context.getDocument(), SP_VERB_CONTEXT_RECT, "Multiple actions"); + Inkscape::DocumentUndo::done(object->doc_context.getDocument(), SP_VERB_CONTEXT_RECT, "Multiple actions"); } void document_interface_update(DocumentInterface *object, GError ** error) { - SPDesktop *desk = object->context.getDesktop(); - if (!desk) { - g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Document update requires a GUI"); - return; - } - SPDocument *doc = object->context.getDocument(); + SPDesktop *desk = object->doc_context.getDesktop(); + g_return_if_fail(ensure_desktop_valid(desk, error)); + SPDocument *doc = object->doc_context.getDocument(); doc->getRoot()->uflags = TRUE; doc->getRoot()->mflags = TRUE; desk->enableInteraction(); @@ -1108,7 +1083,7 @@ void document_interface_update(DocumentInterface *object, GError ** error) gboolean document_interface_selection_get(DocumentInterface *object, char ***out, GError ** /*error*/) { - Inkscape::Selection * sel = object->context.getSelection(); + Inkscape::Selection * sel = object->doc_context.getSelection(); GSList const *oldsel = sel->list(); int size = g_slist_length((GSList *) oldsel); @@ -1128,11 +1103,11 @@ gboolean document_interface_selection_get(DocumentInterface *object, char ***out gboolean document_interface_selection_add (DocumentInterface *object, char *name, GError **error) { - SPObject * obj = get_object_by_name(object->context.getDocument(), name, error); + SPObject * obj = get_object_by_name(object->doc_context.getDocument(), name, error); if (!obj) return FALSE; - Inkscape::Selection *selection = object->context.getSelection(); + Inkscape::Selection *selection = object->doc_context.getSelection(); selection->add(obj); return TRUE; @@ -1151,8 +1126,8 @@ document_interface_selection_add_list (DocumentInterface *object, gboolean document_interface_selection_set(DocumentInterface *object, char *name, GError ** /*error*/) { - SPDocument * doc = object->context.getDocument(); - Inkscape::Selection *selection = object->context.getSelection(); + SPDocument * doc = object->doc_context.getDocument(); + Inkscape::Selection *selection = object->doc_context.getSelection(); selection->set(doc->getObjectById(name)); return TRUE; } @@ -1161,7 +1136,7 @@ gboolean document_interface_selection_set_list (DocumentInterface *object, gchar **names, GError **error) { - object->context.getSelection()->clear(); + object->doc_context.getSelection()->clear(); int i; for (i=0;names[i] != NULL;i++) { document_interface_selection_add(object, names[i], error); @@ -1171,7 +1146,7 @@ document_interface_selection_set_list (DocumentInterface *object, gboolean document_interface_selection_rotate(DocumentInterface *object, int angle, GError ** /*error*/) { - Inkscape::Selection *selection = object->context.getSelection(); + Inkscape::Selection *selection = object->doc_context.getSelection(); sp_selection_rotate(selection, angle); return TRUE; } @@ -1179,20 +1154,18 @@ gboolean document_interface_selection_rotate(DocumentInterface *object, int angl gboolean document_interface_selection_delete (DocumentInterface *object, GError **error) { - //sp_selection_delete (object->desk); return dbus_call_verb (object, SP_VERB_EDIT_DELETE, error); } gboolean document_interface_selection_clear(DocumentInterface *object, GError ** /*error*/) { - object->context.getSelection()->clear(); + object->doc_context.getSelection()->clear(); return TRUE; } gboolean document_interface_select_all (DocumentInterface *object, GError **error) { - //sp_edit_select_all (object->desk); return dbus_call_verb (object, SP_VERB_EDIT_SELECT_ALL, error); } @@ -1200,7 +1173,6 @@ gboolean document_interface_select_all_in_all_layers(DocumentInterface *object, GError **error) { - //sp_edit_select_all_in_all_layers (object->desk); return dbus_call_verb (object, SP_VERB_EDIT_SELECT_ALL_IN_ALL_LAYERS, error); } @@ -1215,7 +1187,6 @@ gboolean document_interface_selection_box(DocumentInterface * /*object*/, int /* gboolean document_interface_selection_invert (DocumentInterface *object, GError **error) { - //sp_edit_invert (object->desk); return dbus_call_verb (object, SP_VERB_EDIT_INVERT, error); } @@ -1233,46 +1204,30 @@ document_interface_selection_ungroup (DocumentInterface *object, GError **error) gboolean document_interface_selection_cut (DocumentInterface *object, GError **error) { - //desktop_ensure_active (object->desk); - //sp_selection_cut (object->desk); + SPDesktop *desk = object->doc_context.getDesktop(); + g_return_val_if_fail(ensure_desktop_valid(desk, error), FALSE); return dbus_call_verb (object, SP_VERB_EDIT_CUT, error); } gboolean document_interface_selection_copy (DocumentInterface *object, GError **error) { - //desktop_ensure_active (object->desk); - //sp_selection_copy (); + SPDesktop *desk = object->doc_context.getDesktop(); + g_return_val_if_fail(ensure_desktop_valid(desk, error), FALSE); return dbus_call_verb (object, SP_VERB_EDIT_COPY, error); } -/* -gboolean -document_interface_selection_paste (DocumentInterface *object, GError **error) -{ - SPDesktop *desk = object->context.getDesktop(); - if (!desk) { - g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Document selection paste requires a GUI"); - return FALSE; - } - desktop_ensure_active (desk); - if (!object->updates) - document_interface_pause_updates (object, error); - sp_selection_paste (object->desk, TRUE); - if (!object->updates) - document_interface_pause_updates (object, error); - return TRUE; - //return dbus_call_verb (object, SP_VERB_EDIT_PASTE, error); -} -*/ + gboolean document_interface_selection_paste (DocumentInterface *object, GError **error) { + SPDesktop *desk = object->doc_context.getDesktop(); + g_return_val_if_fail(ensure_desktop_valid(desk, error), FALSE); return dbus_call_verb (object, SP_VERB_EDIT_PASTE, error); } gboolean document_interface_selection_scale(DocumentInterface *object, gdouble grow, GError ** /*error*/) { - Inkscape::Selection *selection = object->context.getSelection(); + Inkscape::Selection *selection = object->doc_context.getSelection(); if (!selection) { return FALSE; @@ -1283,13 +1238,13 @@ gboolean document_interface_selection_scale(DocumentInterface *object, gdouble g gboolean document_interface_selection_move(DocumentInterface *object, gdouble x, gdouble y, GError ** /*error*/) { - sp_selection_move(object->context.getSelection(), x, 0 - y); //switching coordinate systems. + sp_selection_move(object->doc_context.getSelection(), x, 0 - y); //switching coordinate systems. return TRUE; } gboolean document_interface_selection_move_to(DocumentInterface *object, gdouble x, gdouble y, GError ** /*error*/) { - Inkscape::Selection * sel = object->context.getSelection(); + Inkscape::Selection * sel = object->doc_context.getSelection(); Geom::OptRect sel_bbox = sel->visualBounds(); if (sel_bbox) { @@ -1306,19 +1261,16 @@ gboolean document_interface_selection_move_to_layer (DocumentInterface *object, gchar *layerstr, GError **error) { - SPDesktop *dt = object->context.getDesktop(); - if (!dt) { - g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Document selection move to layer requires a GUI"); - return FALSE; - } + SPDesktop *dt = object->doc_context.getDesktop(); + g_return_val_if_fail(ensure_desktop_valid(dt, error), FALSE); - Inkscape::Selection *selection = object->context.getSelection(); + Inkscape::Selection *selection = object->doc_context.getSelection(); // check if something is selected if (selection->isEmpty()) return FALSE; - SPObject *next = get_object_by_name(object->context.getDocument(), layerstr, error); + SPObject *next = get_object_by_name(object->doc_context.getDocument(), layerstr, error); if (!next) return FALSE; @@ -1327,7 +1279,7 @@ document_interface_selection_move_to_layer (DocumentInterface *object, sp_selection_cut(dt); - object->context.getSelection()->layerModel()->setCurrentLayer(next); + object->doc_context.getSelection()->layers()->setCurrentLayer(next); sp_selection_paste(dt, TRUE); } @@ -1337,7 +1289,7 @@ document_interface_selection_move_to_layer (DocumentInterface *object, GArray * document_interface_selection_get_center (DocumentInterface *object) { - Inkscape::Selection * sel = object->context.getSelection(); + Inkscape::Selection * sel = object->doc_context.getSelection(); if (sel) { @@ -1403,9 +1355,9 @@ document_interface_selection_change_level (DocumentInterface *object, gchar *cmd gchar *document_interface_layer_new(DocumentInterface *object, GError ** /*error*/) { - Inkscape::LayerModel * layerModel = object->context.getSelection()->layerModel(); - SPObject *new_layer = Inkscape::create_layer(layerModel->currentRoot(), layerModel->currentLayer(), Inkscape::LPOS_BELOW); - layerModel->setCurrentLayer(new_layer); + Inkscape::LayerModel * layers = object->doc_context.getSelection()->layers(); + SPObject *new_layer = Inkscape::create_layer(layers->currentRoot(), layers->currentLayer(), Inkscape::LPOS_BELOW); + layers->setCurrentLayer(new_layer); return g_strdup(get_name_from_object(new_layer)); } @@ -1413,12 +1365,12 @@ gboolean document_interface_layer_set (DocumentInterface *object, gchar *layerstr, GError **error) { - SPObject * obj = get_object_by_name (object->context.getDocument(), layerstr, error); + SPObject * obj = get_object_by_name (object->doc_context.getDocument(), layerstr, error); if (!obj) return FALSE; - object->context.getSelection()->layerModel()->setCurrentLayer (obj); + object->doc_context.getSelection()->layers()->setCurrentLayer (obj); return TRUE; } @@ -1462,7 +1414,6 @@ document_interface_layer_previous (DocumentInterface *object, GError **error) DocumentInterface *fugly; gboolean dbus_send_ping (SPDesktop* desk, SPItem *item) { - //DocumentInterface *obj; if (!item) return TRUE; g_signal_emit (desk->dbus_document_interface, signals[OBJECT_MOVED_SIGNAL], 0, item->getId()); return TRUE; @@ -1474,7 +1425,7 @@ gboolean dbus_send_ping (SPDesktop* desk, SPItem *item) gboolean document_interface_get_children (DocumentInterface *object, char *name, char ***out, GError **error) { - SPItem* parent=(SPItem* )get_object_by_name(object->context.getDocument(), name, error); + SPItem* parent=(SPItem* )get_object_by_name(object->doc_context.getDocument(), name, error); GSList const *children = parent->childList(false); @@ -1497,7 +1448,7 @@ document_interface_get_children (DocumentInterface *object, char *name, char ** gchar* document_interface_get_parent (DocumentInterface *object, char *name, GError **error) { - SPItem* node=(SPItem* )get_object_by_name(object->context.getDocument(), name, error); + SPItem* node=(SPItem* )get_object_by_name(object->doc_context.getDocument(), name, error); SPObject* parent=node->parent; @@ -1509,7 +1460,7 @@ document_interface_get_parent (DocumentInterface *object, char *name, GError ** //just pseudo code gboolean document_interface_get_xpath (DocumentInterface *object, char *xpath_expression, char ***out, GError **error){ - SPDocument * doc = object->context.getDocument(); + SPDocument * doc = object->doc_context.getDocument(); Inkscape::XML::Document *repr = doc->getReprDoc(); xmlXPathObjectPtr xpathObj; diff --git a/src/extension/dbus/document-interface.h b/src/extension/dbus/document-interface.h index 5eef3d0c0..f90fe7c80 100644 --- a/src/extension/dbus/document-interface.h +++ b/src/extension/dbus/document-interface.h @@ -52,7 +52,7 @@ typedef struct _DocumentInterfaceClass DocumentInterfaceClass; struct _DocumentInterface { GObject parent; - Inkscape::ActionContext context; + Inkscape::ActionContext doc_context; ///< stores information about which document, selection, desktop etc this interface is linked to gboolean updates; }; diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp index 93b1bb91d..dcccf3d7d 100644 --- a/src/extension/effect.cpp +++ b/src/extension/effect.cpp @@ -368,12 +368,9 @@ Effect::EffectVerb::make_action (Inkscape::ActionContext const & context) void Effect::EffectVerb::perform( SPAction *action, void * data ) { + g_return_if_fail(ensure_desktop_valid(action)); Inkscape::UI::View::View * current_view = sp_action_get_view(action); - if (current_view == NULL) { - show_gui_required_message(action); - return; - } -// SPDocument * current_document = current_view->doc; + Effect::EffectVerb * ev = reinterpret_cast(data); Effect * effect = ev->_effect; diff --git a/src/helper/action-context.cpp b/src/helper/action-context.cpp index f211d775d..d52e43d96 100644 --- a/src/helper/action-context.cpp +++ b/src/helper/action-context.cpp @@ -6,7 +6,7 @@ * * Copyright (C) 2013 Eric Greveson * - * This code is in public domain + * Released under GNU GPL, read the file 'COPYING' for more information */ #include "desktop.h" @@ -47,7 +47,7 @@ SPDocument *ActionContext::getDocument() const } // Should be the same as the view's document, if view is non-NULL - return _selection->layerModel()->getDocument(); + return _selection->layers()->getDocument(); } Selection *ActionContext::getSelection() const diff --git a/src/helper/action-context.h b/src/helper/action-context.h index 3a7a19112..bb538f413 100644 --- a/src/helper/action-context.h +++ b/src/helper/action-context.h @@ -6,7 +6,7 @@ * * Copyright (C) 2013 Eric Greveson * - * This code is in public domain + * Released under GNU GPL, read the file 'COPYING' for more information */ #ifndef SEEN_INKSCAPE_ACTION_CONTEXT_H diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 9f8dd984a..29cb208d9 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -542,11 +542,11 @@ void sp_edit_clear_all(Inkscape::Selection *selection) if (!selection) return; - SPDocument *doc = selection->layerModel()->getDocument(); + SPDocument *doc = selection->layers()->getDocument(); selection->clear(); - g_return_if_fail(SP_IS_GROUP(selection->layerModel()->currentLayer())); - GSList *items = sp_item_group_item_list(SP_GROUP(selection->layerModel()->currentLayer())); + g_return_if_fail(SP_IS_GROUP(selection->layers()->currentLayer())); + GSList *items = sp_item_group_item_list(SP_GROUP(selection->layers()->currentLayer())); while (items) { reinterpret_cast(items->data)->deleteObject(); @@ -739,7 +739,7 @@ static void sp_selection_group_impl(GSList *p, Inkscape::XML::Node *group, Inksc void sp_selection_group(Inkscape::Selection *selection, SPDesktop *desktop) { - SPDocument *doc = selection->layerModel()->getDocument(); + SPDocument *doc = selection->layers()->getDocument(); Inkscape::XML::Document *xml_doc = doc->getReprDoc(); // Check if something is selected. @@ -816,7 +816,7 @@ void sp_selection_ungroup(Inkscape::Selection *selection, SPDesktop *desktop) g_slist_free(items); - DocumentUndo::done(selection->layerModel()->getDocument(), SP_VERB_SELECTION_UNGROUP, + DocumentUndo::done(selection->layers()->getDocument(), SP_VERB_SELECTION_UNGROUP, _("Ungroup")); } @@ -942,14 +942,14 @@ sp_selection_raise(Inkscape::Selection *selection, SPDesktop *desktop) g_slist_free(rev); } - DocumentUndo::done(selection->layerModel()->getDocument(), SP_VERB_SELECTION_RAISE, + DocumentUndo::done(selection->layers()->getDocument(), SP_VERB_SELECTION_RAISE, //TRANSLATORS: "Raise" means "to raise an object" in the undo history C_("Undo action", "Raise")); } void sp_selection_raise_to_top(Inkscape::Selection *selection, SPDesktop *desktop) { - SPDocument *document = selection->layerModel()->getDocument(); + SPDocument *document = selection->layers()->getDocument(); if (selection->isEmpty()) { selection_display_message(desktop, Inkscape::WARNING_MESSAGE, _("Select object(s) to raise to top.")); @@ -1031,13 +1031,13 @@ void sp_selection_lower(Inkscape::Selection *selection, SPDesktop *desktop) g_slist_free(rev); } - DocumentUndo::done(selection->layerModel()->getDocument(), SP_VERB_SELECTION_LOWER, + DocumentUndo::done(selection->layers()->getDocument(), SP_VERB_SELECTION_LOWER, _("Lower")); } void sp_selection_lower_to_bottom(Inkscape::Selection *selection, SPDesktop *desktop) { - SPDocument *document = selection->layerModel()->getDocument(); + SPDocument *document = selection->layers()->getDocument(); if (selection->isEmpty()) { selection_display_message(desktop, Inkscape::WARNING_MESSAGE, _("Select object(s) to lower to bottom.")); @@ -2152,7 +2152,7 @@ sp_selection_move(Inkscape::Selection *selection, gdouble dx, gdouble dy) sp_selection_move_relative(selection, dx, dy); - SPDocument *doc = selection->layerModel()->getDocument(); + SPDocument *doc = selection->layers()->getDocument(); if (dx == 0) { DocumentUndo::maybeDone(doc, "selector:move:vertical", SP_VERB_CONTEXT_SELECT, _("Move vertically")); @@ -2178,7 +2178,7 @@ sp_selection_move_screen(Inkscape::Selection *selection, gdouble dx, gdouble dy) gdouble const zdy = dy / zoom; sp_selection_move_relative(selection, zdx, zdy); - SPDocument *doc = selection->layerModel()->getDocument(); + SPDocument *doc = selection->layers()->getDocument(); if (dx == 0) { DocumentUndo::maybeDone(doc, "selector:move:vertical", SP_VERB_CONTEXT_SELECT, _("Move vertically by pixels")); diff --git a/src/selection-describer.cpp b/src/selection-describer.cpp index ce2d1c90b..6ed8ca584 100644 --- a/src/selection-describer.cpp +++ b/src/selection-describer.cpp @@ -145,8 +145,8 @@ void SelectionDescriber::_updateMessageFromSelection(Inkscape::Selection *select _context.set(Inkscape::NORMAL_MESSAGE, _when_nothing); } else { SPItem *item = SP_ITEM(items->data); - SPObject *layer = selection->layerModel()->layerForObject(item); - SPObject *root = selection->layerModel()->currentRoot(); + SPObject *layer = selection->layers()->layerForObject(item); + SPObject *root = selection->layers()->currentRoot(); // Layer name gchar *layer_name; diff --git a/src/selection.cpp b/src/selection.cpp index 76f49f544..d018aba0c 100644 --- a/src/selection.cpp +++ b/src/selection.cpp @@ -41,11 +41,11 @@ namespace Inkscape { -Selection::Selection(LayerModel *layer_model, SPDesktop *desktop) : +Selection::Selection(LayerModel *layers, SPDesktop *desktop) : _objs(NULL), _reprs(NULL), _items(NULL), - _layer_model(layer_model), + _layers(layers), _desktop(desktop), _selection_context(NULL), _flags(0), @@ -55,7 +55,7 @@ Selection::Selection(LayerModel *layer_model, SPDesktop *desktop) : Selection::~Selection() { _clear(); - _layer_model = NULL; + _layers = NULL; if (_idle) { g_source_remove(_idle); _idle = 0; @@ -96,7 +96,7 @@ void Selection::_emitModified(guint flags) { void Selection::_emitChanged(bool persist_selection_context/* = false */) { if (persist_selection_context) { if (NULL == _selection_context) { - _selection_context = _layer_model->currentLayer(); + _selection_context = _layers->currentLayer(); sp_object_ref(_selection_context, NULL); _context_release_connection = _selection_context->connectRelease(sigc::mem_fun(*this, &Selection::_releaseContext)); } @@ -139,7 +139,7 @@ void Selection::_clear() { SPObject *Selection::activeContext() { if (NULL != _selection_context) return _selection_context; - return _layer_model->currentLayer(); + return _layers->currentLayer(); } bool Selection::includes(SPObject *obj) const { @@ -487,7 +487,7 @@ SPObject *Selection::_objectForXMLNode(Inkscape::XML::Node *repr) const { g_return_val_if_fail(repr != NULL, NULL); gchar const *id = repr->attribute("id"); g_return_val_if_fail(id != NULL, NULL); - SPObject *object=_layer_model->getDocument()->getObjectById(id); + SPObject *object=_layers->getDocument()->getObjectById(id); g_return_val_if_fail(object != NULL, NULL); return object; } @@ -496,7 +496,7 @@ guint Selection::numberOfLayers() { GSList const *items = const_cast(this)->itemList(); GSList *layers = NULL; for (GSList const *iter = items; iter != NULL; iter = iter->next) { - SPObject *layer = _layer_model->layerForObject(SP_OBJECT(iter->data)); + SPObject *layer = _layers->layerForObject(SP_OBJECT(iter->data)); if (g_slist_find (layers, layer) == NULL) { layers = g_slist_prepend (layers, layer); } diff --git a/src/selection.h b/src/selection.h index 65a6c5140..f076cf7aa 100644 --- a/src/selection.h +++ b/src/selection.h @@ -67,10 +67,10 @@ public: * Constructs an selection object, bound to a particular * layer model * - * @param layer_model the layer model (for the SPDesktop, if GUI) + * @param layers the layer model (for the SPDesktop, if GUI) * @param desktop the desktop associated with the layer model, or NULL if in console mode */ - Selection(LayerModel *layer_model, SPDesktop *desktop); + Selection(LayerModel *layers, SPDesktop *desktop); ~Selection(); /** @@ -79,7 +79,7 @@ public: * @return the layer model the selection is bound to, which is the same as the desktop * layer model for GUI mode */ - LayerModel *layerModel() { return _layer_model; } + LayerModel *layers() { return _layers; } /** * Returns the desktop the selection is bound to @@ -352,7 +352,7 @@ private: std::list _3dboxes; - LayerModel *_layer_model; + LayerModel *_layers; GC::soft_ptr _desktop; SPObject* _selection_context; guint _flags; diff --git a/src/splivarot.cpp b/src/splivarot.cpp index 0ec9da2a7..356cf0161 100644 --- a/src/splivarot.cpp +++ b/src/splivarot.cpp @@ -126,7 +126,7 @@ boolop_display_error_message(SPDesktop *desktop, Glib::ustring const &msg) void sp_selected_path_boolop(Inkscape::Selection *selection, SPDesktop *desktop, bool_op bop, const unsigned int verb, const Glib::ustring description) { - SPDocument *doc = selection->layerModel()->getDocument(); + SPDocument *doc = selection->layers()->getDocument(); GSList *il = (GSList *) selection->itemList(); // allow union on a single object for the purpose of removing self overlapse (svn log, revision 13334) diff --git a/src/verbs.cpp b/src/verbs.cpp index 2e6417ce1..1dae8bcf0 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -628,9 +628,13 @@ SPAction *Verb::get_action(Inkscape::ActionContext const & context) } /* static */ -void Verb::show_gui_required_message(SPAction *action) +bool Verb::ensure_desktop_valid(SPAction *action) { + if (sp_action_get_desktop(action) != NULL) { + return true; + } g_printerr("WARNING: ignoring verb %s - GUI required for this verb.\n", action->id); + return false; } void Verb::sensitive(SPDocument *in_doc, bool in_sensitive) @@ -827,12 +831,9 @@ void FileVerb::perform(SPAction *action, void *data) if (handled) { return; } - + + g_return_if_fail(ensure_desktop_valid(action)); SPDesktop *desktop = sp_action_get_desktop(action); - if (desktop == NULL) { - show_gui_required_message(action); - return; - } Gtk::Window *parent = desktop->getToplevel(); g_assert(parent != NULL); @@ -905,12 +906,9 @@ void EditVerb::perform(SPAction *action, void *data) if (handled) { return; } - + + g_return_if_fail(ensure_desktop_valid(action)); SPDesktop *dt = sp_action_get_desktop(action); - if (dt == NULL) { - show_gui_required_message(action); - return; - } switch (reinterpret_cast(data)) { case SP_VERB_EDIT_UNDO: @@ -1118,10 +1116,7 @@ void SelectionVerb::perform(SPAction *action, void *data) } // The remaining operations require a desktop - if (dt == NULL) { - show_gui_required_message(action); - return; - } + g_return_if_fail(ensure_desktop_valid(action)); g_assert(dt->_dlg_mgr != NULL); @@ -1200,13 +1195,10 @@ void SelectionVerb::perform(SPAction *action, void *data) */ void LayerVerb::perform(SPAction *action, void *data) { + g_return_if_fail(ensure_desktop_valid(action)); SPDesktop *dt = sp_action_get_desktop(action); size_t verb = reinterpret_cast(data); - if (dt == NULL) { - show_gui_required_message(action); - return; - } if ( !dt->currentLayer() ) { return; } @@ -1455,11 +1447,8 @@ void LayerVerb::perform(SPAction *action, void *data) */ void ObjectVerb::perform( SPAction *action, void *data) { + g_return_if_fail(ensure_desktop_valid(action)); SPDesktop *dt = sp_action_get_desktop(action); - if (dt == NULL) { - show_gui_required_message(action); - return; - } SPEventContext *ec = dt->event_context; @@ -1544,13 +1533,9 @@ void ContextVerb::perform(SPAction *action, void *data) SPDesktop *dt; sp_verb_t verb; int vidx; - - dt = sp_action_get_desktop(action); - if (dt == NULL) { - show_gui_required_message(action); - return; - } + g_return_if_fail(ensure_desktop_valid(action)); + dt = sp_action_get_desktop(action); verb = (sp_verb_t)GPOINTER_TO_INT((gpointer)data); @@ -1748,11 +1733,8 @@ void ContextVerb::perform(SPAction *action, void *data) */ void TextVerb::perform(SPAction *action, void */*data*/) { + g_return_if_fail(ensure_desktop_valid(action)); SPDesktop *dt = sp_action_get_desktop(action); - if (dt == NULL) { - show_gui_required_message(action); - return; - } SPDocument *doc = sp_desktop_document(dt); (void)doc; @@ -1765,11 +1747,8 @@ void TextVerb::perform(SPAction *action, void */*data*/) */ void ZoomVerb::perform(SPAction *action, void *data) { + g_return_if_fail(ensure_desktop_valid(action)); SPDesktop *dt = sp_action_get_desktop(action); - if (dt == NULL) { - show_gui_required_message(action); - return; - } SPEventContext *ec = dt->event_context; SPDocument *doc = sp_desktop_document(dt); @@ -1956,12 +1935,9 @@ void DialogVerb::perform(SPAction *action, void *data) // unhide all when opening a new dialog inkscape_dialogs_unhide(); } - + + g_return_if_fail(ensure_desktop_valid(action)); SPDesktop *dt = sp_action_get_desktop(action); - if (dt == NULL) { - show_gui_required_message(action); - return; - } g_assert(dt->_dlg_mgr != NULL); switch (reinterpret_cast(data)) { @@ -2073,11 +2049,8 @@ void DialogVerb::perform(SPAction *action, void *data) */ void HelpVerb::perform(SPAction *action, void *data) { + g_return_if_fail(ensure_desktop_valid(action)); SPDesktop *dt = sp_action_get_desktop(action); - if (dt == NULL) { - show_gui_required_message(action); - return; - } g_assert(dt->_dlg_mgr != NULL); switch (reinterpret_cast(data)) { @@ -2112,10 +2085,7 @@ void HelpVerb::perform(SPAction *action, void *data) */ void TutorialVerb::perform(SPAction *action, void *data) { - if (sp_action_get_desktop(action) == NULL) { - show_gui_required_message(action); - return; - } + g_return_if_fail(ensure_desktop_valid(action)); switch (reinterpret_cast(data)) { case SP_VERB_TUTORIAL_BASIC: // TRANSLATORS: If you have translated the tutorial-basic.en.svgz file to your language, @@ -2197,14 +2167,9 @@ SPAction *EffectLastVerb::make_action(Inkscape::ActionContext const & context) */ void EffectLastVerb::perform(SPAction *action, void *data) { - // These aren't used, but are here to remind people not to use - // the CURRENT_DOCUMENT macros unless they really have to. + g_return_if_fail(ensure_desktop_valid(action)); Inkscape::UI::View::View *current_view = sp_action_get_view(action); - if (current_view == NULL) { - show_gui_required_message(action); - return; - } - // SPDocument *current_document = SP_VIEW_DOCUMENT(current_view); + Inkscape::Extension::Effect *effect = Inkscape::Extension::Effect::get_last_effect(); if (effect == NULL) return; @@ -2266,12 +2231,8 @@ SPAction *FitCanvasVerb::make_action(Inkscape::ActionContext const & context) */ void FitCanvasVerb::perform(SPAction *action, void *data) { + g_return_if_fail(ensure_desktop_valid(action)); SPDesktop *dt = sp_action_get_desktop(action); - if (dt == NULL) { - show_gui_required_message(action); - return; - } - SPDocument *doc = sp_desktop_document(dt); if (!doc) return; @@ -2336,12 +2297,8 @@ SPAction *LockAndHideVerb::make_action(Inkscape::ActionContext const & context) */ void LockAndHideVerb::perform(SPAction *action, void *data) { + g_return_if_fail(ensure_desktop_valid(action)); SPDesktop *dt = sp_action_get_desktop(action); - if (dt == NULL) { - show_gui_required_message(action); - return; - } - SPDocument *doc = sp_desktop_document(dt); if (!doc) return; diff --git a/src/verbs.h b/src/verbs.h index dd58134dd..053441b89 100644 --- a/src/verbs.h +++ b/src/verbs.h @@ -554,7 +554,7 @@ public: /** * Print a message to stderr indicating that this verb needs a GUI to run */ - static void show_gui_required_message(SPAction *action); + static bool ensure_desktop_valid(SPAction *action); static void delete_all_view (Inkscape::UI::View::View * view); void delete_view (Inkscape::UI::View::View * view); -- cgit v1.2.3 From 46211dc227f62c2e71b3edfa1ffb508c9fe8e0ac Mon Sep 17 00:00:00 2001 From: Slagvi Public Date: Thu, 4 Jul 2013 16:19:38 +0200 Subject: Added loading templates into NewFromTemplate dialog. (bzr r12379.2.7) --- src/file.cpp | 7 ---- src/file.h | 1 - src/ui/dialog/new-from-template.cpp | 12 ++++++- src/ui/dialog/new-from-template.h | 4 ++- src/ui/dialog/static-template-load-tab.cpp | 20 +++++++++-- src/ui/dialog/static-template-load-tab.h | 2 ++ src/ui/dialog/template-load-tab.cpp | 57 +++++++++++++++++++++++++++--- src/ui/dialog/template-load-tab.h | 25 +++++++++++-- src/verbs.cpp | 2 +- 9 files changed, 109 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/file.cpp b/src/file.cpp index 7f8bfc8bf..9d3c513ab 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -66,7 +66,6 @@ #include "verbs.h" #include "event-log.h" #include "ui/dialog/font-substitution.h" -#include "ui/dialog/new-from-template.h" #include @@ -200,12 +199,6 @@ SPDesktop* sp_file_new_default() return desk; } -SPDesktop* sp_file_new_from_templatee() -{ - Inkscape::UI::NewFromTemplate dl; - dl.run(); - return sp_file_new_default(); -} /*###################### ## D E L E T E diff --git a/src/file.h b/src/file.h index acc6c5c7c..fe8ad9af3 100644 --- a/src/file.h +++ b/src/file.h @@ -45,7 +45,6 @@ Glib::ustring sp_file_default_template_uri(); */ SPDesktop* sp_file_new (const Glib::ustring &templ); SPDesktop* sp_file_new_default (void); -SPDesktop* sp_file_new_from_templatee (); /*###################### ## D E L E T E diff --git a/src/ui/dialog/new-from-template.cpp b/src/ui/dialog/new-from-template.cpp index fc590d199..b210545d1 100644 --- a/src/ui/dialog/new-from-template.cpp +++ b/src/ui/dialog/new-from-template.cpp @@ -1,5 +1,9 @@ #include "new-from-template.h" -#include "gtkmm/alignment.h" + +#include + +#include "src/file.h" + namespace Inkscape { namespace UI { @@ -38,5 +42,11 @@ void NewFromTemplate::_createFromTemplate() response(0); } +void NewFromTemplate::load_new_from_template() +{ + NewFromTemplate dl; + dl.run(); +} + } } diff --git a/src/ui/dialog/new-from-template.h b/src/ui/dialog/new-from-template.h index f8c4bbb37..e7976d685 100644 --- a/src/ui/dialog/new-from-template.h +++ b/src/ui/dialog/new-from-template.h @@ -8,6 +8,7 @@ #include "template-load-tab.h" #include "static-template-load-tab.h" + namespace Inkscape { namespace UI { @@ -15,9 +16,10 @@ namespace UI { class NewFromTemplate : public Gtk::Dialog { public: - NewFromTemplate(); + static void load_new_from_template(); private: + NewFromTemplate(); Gtk::Notebook _main_widget; Gtk::Button _create_template_button; StaticTemplateLoadTab _tab1; diff --git a/src/ui/dialog/static-template-load-tab.cpp b/src/ui/dialog/static-template-load-tab.cpp index 94298bf1d..47c7c00b9 100644 --- a/src/ui/dialog/static-template-load-tab.cpp +++ b/src/ui/dialog/static-template-load-tab.cpp @@ -5,18 +5,25 @@ #include #include +#include "src/file.h" + namespace Inkscape { namespace UI { StaticTemplateLoadTab::StaticTemplateLoadTab() - : _more_info_button("More info") + : TemplateLoadTab() + , _more_info_button("More info") , _preview_image("preview.png") , _short_description_label("Short description - I like trains. ad asda asd asdweqe gdfg") , _template_name_label("Template_name") , _template_author_label("by template_author") { + _loading_path = "/static"; + _loadTemplates(); + _initLists(); + _template_info_column.pack_start(_template_name_label, Gtk::PACK_SHRINK, 4); _template_info_column.pack_start(_template_author_label, Gtk::PACK_SHRINK, 0); _template_info_column.pack_start(_preview_image, Gtk::PACK_SHRINK, 15); @@ -34,7 +41,14 @@ StaticTemplateLoadTab::StaticTemplateLoadTab() void StaticTemplateLoadTab::createTemplate() { - std::cout << "Static template\n"; + Glib::ustring path; + if (_templates.find(_current_template) != _templates.end()){ + path = _templates[_current_template].path; + } + else + path = ""; + + sp_file_new(path); } @@ -42,6 +56,8 @@ void StaticTemplateLoadTab::_displayTemplateInfo() { TemplateLoadTab::_displayTemplateInfo(); _template_name_label.set_text(_current_template); + _template_author_label.set_text(_templates[_current_template].author); + _short_description_label.set_text(_templates[_current_template].short_description); } } diff --git a/src/ui/dialog/static-template-load-tab.h b/src/ui/dialog/static-template-load-tab.h index a1a3adf7b..a5411296d 100644 --- a/src/ui/dialog/static-template-load-tab.h +++ b/src/ui/dialog/static-template-load-tab.h @@ -2,10 +2,12 @@ #define INKSCAPE_SEEN_UI_DIALOG_STATIC_TEMPLATE_LOAD_TAB_H #include "template-load-tab.h" + #include #include #include + namespace Inkscape { namespace UI { diff --git a/src/ui/dialog/template-load-tab.cpp b/src/ui/dialog/template-load-tab.cpp index 5d4c3a364..5e3a16a3f 100644 --- a/src/ui/dialog/template-load-tab.cpp +++ b/src/ui/dialog/template-load-tab.cpp @@ -1,7 +1,14 @@ #include "template-load-tab.h" + #include #include +#include "src/interface.h" +#include "src/file.h" +#include "src/path-prefix.h" +#include "src/preferences.h" +#include "src/inkscape.h" + namespace Inkscape { namespace UI { @@ -9,6 +16,7 @@ namespace UI { TemplateLoadTab::TemplateLoadTab() : _keywords_combo(true) + , _current_keyword("") { set_border_width(10); @@ -24,8 +32,6 @@ TemplateLoadTab::TemplateLoadTab() title = manage(new Gtk::Label("Selected template")); _template_info_column.pack_start(*title, Gtk::PACK_SHRINK, 10); - _initLists(); - add(_main_box); _main_box.pack_start(_templates_column, Gtk::PACK_SHRINK, 20); _main_box.pack_start(_template_info_column, Gtk::PACK_EXPAND_WIDGET, 10); @@ -67,7 +73,6 @@ void TemplateLoadTab::_displayTemplateInfo() void TemplateLoadTab::_initKeywordsList() { _keywords_combo.append("All"); - // _keywords_combo for (int i = 0 ; i < 10 ; ++i) { _keywords_combo.append( "Keyword" + Glib::ustring::format(i)); @@ -97,12 +102,54 @@ void TemplateLoadTab::_keywordSelected() void TemplateLoadTab::_refreshTemplatesList() { _templates_ref->clear(); - for (int i = 0 ; i < 7 ; ++i) { + + for (std::map::iterator it = _templates.begin() ; it != _templates.end() ; ++it) { Gtk::TreeModel::iterator iter = _templates_ref->append(); Gtk::TreeModel::Row row = *iter; - row[_templates_columns.textValue] = "Template" + Glib::ustring::format(i); + row[_templates_columns.textValue] = it->first; } } + +void TemplateLoadTab::_loadTemplates() +{ + // user's local dir + _getTemplatesFromDir(profile_path("templates") + _loading_path); + + // system templates dir + _getTemplatesFromDir(INKSCAPE_TEMPLATESDIR + _loading_path); +} + + +TemplateLoadTab::TemplateData TemplateLoadTab::_processTemplateFile(Glib::ustring path) +{ + TemplateData result; + result.path = path; + result.display_name = Glib::path_get_basename(path); + result.short_description = "LaLaLaLa"; + result.author = "JAASDASD"; + + return result; +} + + +void TemplateLoadTab::_getTemplatesFromDir(Glib::ustring path) +{ + if ( !Glib::file_test(path, Glib::FILE_TEST_EXISTS) || + !Glib::file_test(path, Glib::FILE_TEST_IS_DIR)) + return; + + Glib::Dir dir(path); + path += "/"; + Glib::ustring file = path + dir.read_name(); + while (file != path){ + if (Glib::str_has_suffix(file, ".svg")){ + TemplateData tmp = _processTemplateFile(file); + _templates[Glib::path_get_basename(file)] = tmp; + } + file = path + dir.read_name(); + } +} + } } diff --git a/src/ui/dialog/template-load-tab.h b/src/ui/dialog/template-load-tab.h index a9fa7c313..3edcf15eb 100644 --- a/src/ui/dialog/template-load-tab.h +++ b/src/ui/dialog/template-load-tab.h @@ -6,6 +6,9 @@ #include #include #include +#include +#include + namespace Inkscape { namespace UI { @@ -20,6 +23,15 @@ public: virtual void createTemplate(); protected: + struct TemplateData + { + Glib::ustring path; + Glib::ustring display_name; + Glib::ustring author; + Glib::ustring short_description; + std::set keywords; + }; + class StringModelColumns : public Gtk::TreeModelColumnRecord { public: @@ -33,14 +45,16 @@ protected: Glib::ustring _current_keyword; Glib::ustring _current_template; + Glib::ustring _loading_path; + std::map _templates; + virtual void _displayTemplateInfo(); virtual void _initKeywordsList(); virtual void _refreshTemplatesList(); - + void _loadTemplates(); void _initLists(); - void _keywordSelected(); - + Gtk::HBox _main_box; Gtk::VBox _templates_column; Gtk::VBox _template_info_column; @@ -50,6 +64,11 @@ protected: Gtk::TreeView _templates_view; Glib::RefPtr _templates_ref; StringModelColumns _templates_columns; + +private: + void _getTemplatesFromDir(Glib::ustring); + void _keywordSelected(); + TemplateData _processTemplateFile(Glib::ustring); }; diff --git a/src/verbs.cpp b/src/verbs.cpp index a3d8b07a2..8b8a7e6af 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -862,7 +862,7 @@ void FileVerb::perform(SPAction *action, void *data) sp_file_exit(); break; case SP_VERB_FILE_TEMPLATES: - sp_file_new_from_templatee(); + Inkscape::UI::NewFromTemplate::load_new_from_template(); break; default: break; -- cgit v1.2.3 From 036013caefc09f34ef9b418e1ca148a821c777d6 Mon Sep 17 00:00:00 2001 From: Eric Greveson Date: Thu, 4 Jul 2013 23:51:56 +0100 Subject: Further renaming of DBus variables (object -> app_interface/doc_interface and doc_context -> target) Fixes to application interface for document_new (now only works in console mode, and behaves as expected) (bzr r12387.1.8) --- src/extension/dbus/application-interface.cpp | 48 ++- src/extension/dbus/application-interface.h | 20 +- src/extension/dbus/application-interface.xml | 9 +- src/extension/dbus/dbus-init.cpp | 107 +++--- src/extension/dbus/document-interface.cpp | 474 +++++++++++++-------------- src/extension/dbus/document-interface.h | 166 +++++----- src/inkscape-private.h | 2 - src/inkscape.cpp | 17 +- src/inkscape.h | 10 + 9 files changed, 450 insertions(+), 403 deletions(-) (limited to 'src') diff --git a/src/extension/dbus/application-interface.cpp b/src/extension/dbus/application-interface.cpp index 1b1dbf0f5..c0bc19d90 100644 --- a/src/extension/dbus/application-interface.cpp +++ b/src/extension/dbus/application-interface.cpp @@ -19,6 +19,7 @@ #include #include "dbus-init.h" #include "file.h" +#include "inkscape.h" G_DEFINE_TYPE(ApplicationInterface, application_interface, G_TYPE_OBJECT) @@ -38,13 +39,32 @@ application_interface_class_init (ApplicationInterfaceClass *klass) } static void -application_interface_init (ApplicationInterface *object) +application_interface_init (ApplicationInterface *app_interface) { dbus_g_error_domain_register (INKSCAPE_ERROR, NULL, INKSCAPE_TYPE_ERROR); } +static bool +ensure_desktop_valid(GError **error) +{ + if (!inkscape_use_gui()) { + g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Application interface action requires a GUI"); + return false; + } + return true; +} + +static bool +ensure_desktop_not_present(GError **error) +{ + if (inkscape_use_gui()) { + g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Application interface action requires non-GUI (command line) mode"); + return false; + } + return true; +} ApplicationInterface * application_interface_new (void) @@ -95,27 +115,28 @@ GType inkscape_error_get_type(void) ****************************************************************************/ gchar* -application_interface_desktop_new (ApplicationInterface *object, +application_interface_desktop_new (ApplicationInterface *app_interface, GError **error) { - return (gchar*)Inkscape::Extension::Dbus::init_desktop(); + g_return_val_if_fail(ensure_desktop_valid(error), NULL); + return (gchar*)Inkscape::Extension::Dbus::init_desktop(); } gchar** -application_interface_get_desktop_list (ApplicationInterface *object) +application_interface_get_desktop_list (ApplicationInterface *app_interface) { return NULL; } gchar* -application_interface_get_active_desktop (ApplicationInterface *object, +application_interface_get_active_desktop (ApplicationInterface *app_interface, GError **error) { return NULL; } gboolean -application_interface_set_active_desktop (ApplicationInterface *object, +application_interface_set_active_desktop (ApplicationInterface *app_interface, gchar* document_name, GError **error) { @@ -123,14 +144,14 @@ application_interface_set_active_desktop (ApplicationInterface *object, } gboolean -application_interface_desktop_close_all (ApplicationInterface *object, +application_interface_desktop_close_all (ApplicationInterface *app_interface, GError **error) { return TRUE; } gboolean -application_interface_exit (ApplicationInterface *object, GError **error) +application_interface_exit (ApplicationInterface *app_interface, GError **error) { sp_file_exit(); return TRUE; @@ -140,14 +161,15 @@ application_interface_exit (ApplicationInterface *object, GError **error) DOCUMENT FUNCTIONS ****************************************************************************/ -gchar* application_interface_document_new (ApplicationInterface *object, +gchar* application_interface_document_new (ApplicationInterface *app_interface, GError **error) { - return (gchar*)Inkscape::Extension::Dbus::init_document(); + g_return_val_if_fail(ensure_desktop_not_present(error), NULL); + return (gchar*)Inkscape::Extension::Dbus::init_document(); } gchar* -application_interface_get_active_document(ApplicationInterface *object, +application_interface_get_active_document(ApplicationInterface *app_interface, GError **error) { gchar *result = (gchar*)Inkscape::Extension::Dbus::init_active_document(); @@ -158,13 +180,13 @@ application_interface_get_active_document(ApplicationInterface *object, } gchar** -application_interface_get_document_list (ApplicationInterface *object) +application_interface_get_document_list (ApplicationInterface *app_interface) { return NULL; } gboolean -application_interface_document_close_all (ApplicationInterface *object, +application_interface_document_close_all (ApplicationInterface *app_interface, GError **error) { return TRUE; diff --git a/src/extension/dbus/application-interface.h b/src/extension/dbus/application-interface.h index b01fee912..c108402cb 100644 --- a/src/extension/dbus/application-interface.h +++ b/src/extension/dbus/application-interface.h @@ -67,45 +67,45 @@ GType inkscape_error_get_type (void); ****************************************************************************/ gchar* -application_interface_desktop_new (ApplicationInterface *object, +application_interface_desktop_new (ApplicationInterface *app_interface, GError **error); gchar** -application_interface_get_desktop_list (ApplicationInterface *object); +application_interface_get_desktop_list (ApplicationInterface *app_interface); gchar* -application_interface_get_active_desktop (ApplicationInterface *object, +application_interface_get_active_desktop (ApplicationInterface *app_interface, GError **error); gboolean -application_interface_set_active_desktop (ApplicationInterface *object, +application_interface_set_active_desktop (ApplicationInterface *app_interface, gchar* document_name, GError **error); gboolean -application_interface_desktop_close_all (ApplicationInterface *object, +application_interface_desktop_close_all (ApplicationInterface *app_interface, GError **error); gboolean -application_interface_exit (ApplicationInterface *object, GError **error); +application_interface_exit (ApplicationInterface *app_interface, GError **error); /**************************************************************************** DOCUMENT FUNCTIONS ****************************************************************************/ gchar* -application_interface_document_new (ApplicationInterface *object, +application_interface_document_new (ApplicationInterface *app_interface, GError **error); gchar* -application_interface_get_active_document(ApplicationInterface *object, +application_interface_get_active_document(ApplicationInterface *app_interface, GError **error); gchar** -application_interface_get_document_list (ApplicationInterface *object); +application_interface_get_document_list (ApplicationInterface *app_interface); gboolean -application_interface_document_close_all (ApplicationInterface *object, +application_interface_document_close_all (ApplicationInterface *app_interface, GError **error); diff --git a/src/extension/dbus/application-interface.xml b/src/extension/dbus/application-interface.xml index 4185c7e53..1553971cc 100644 --- a/src/extension/dbus/application-interface.xml +++ b/src/extension/dbus/application-interface.xml @@ -32,7 +32,7 @@ - Create a new document interface and return its location. + Create a new document interface and return its location. Only call this when Inkscape is running in GUI mode. @@ -45,21 +45,21 @@ - List all the interfaces that it is possible to connect to. + List all the interfaces that it is possible to connect to. TODO: not implemented. - Close all document interfaces without saving. + Close all document interfaces without saving. TODO: not implemented. - Exit Inkscape without saving (in GUI mode). Fairly straightforward. + Exit Inkscape without saving. Fairly straightforward. @@ -77,6 +77,7 @@ Originally, there were going to be two interfaces. A desktop and a document. Desktops would be used when the user wanted to see the result of their code and documents would be used when less overhead was desired. Unfortunately as more and more of the code can to rely on the desktop and it's associated support code (including selections and verbs) the document interface was looking more and more limited. Ultimately I decided to just go with the desktop interface since I didn't have a compelling reason for keeping the other one and having two similar interfaces could be very confusing. The desktop interface inherited the document name because I believe it's more familiar to people. Perhaps it would be best to have an option as to whether or not to create a window and fail with a good error message when they call a function that requires one. Or have a second interface for different use cases but have it be completely different, rather than a subset of the first if there are use cases that support it. UPDATE: 3rd July 2013, Eric Greveson: After having done some initial work to attempt to decouple Inkscape "verbs" from desktops, it is now possible to run a limited subset of actions in command-line mode (with a selection model and document, but no desktop). I believe that the "single document interface" approach, with some functions that may require a GUI, is the better path, and so document interfaces without a desktop are now possible. Most functions still require the desktop to work, though, with the notable exception of selection methods and Boolean operations. + As a result, this function should ONLY be called when using Inkscape in command-line mode. Use "desktop_new" instead if running in GUI mode. diff --git a/src/extension/dbus/dbus-init.cpp b/src/extension/dbus/dbus-init.cpp index fe59fc154..eb62f4b3a 100644 --- a/src/extension/dbus/dbus-init.cpp +++ b/src/extension/dbus/dbus-init.cpp @@ -78,6 +78,44 @@ dbus_register_object (DBusGConnection *connection, return object; } +/* + * PRIVATE register a document interface for the document in the given ActionContext, if none exists. + * Return the DBus path to the interface (something like /org/inkscape/document_0). + * Note that while a DocumentInterface could be used either for a document with no desktop, or a + * document with a desktop, this function is only used for creating interfaces in the former case. + * Desktop-associated DocumentInterfaces are named /org/inkscape/desktop_0, etc. + * FIXME: This state of affairs probably needs tidying up at some point in the future. + */ +static gchar * +dbus_register_document(Inkscape::ActionContext const & target) +{ + SPDocument *doc = target.getDocument(); + g_assert(doc != NULL); + + // Document name is not suitable for DBus name, as it might contain invalid chars + std::string name("/org/inkscape/document_"); + std::stringstream ss; + ss << doc->serial(); + name.append(ss.str()); + + DBusGConnection *connection = dbus_get_connection(); + DBusGProxy *proxy = dbus_get_proxy(connection); + + // Has the document already been registered? + if (!dbus_g_connection_lookup_g_object(connection, name.c_str())) { + // No - register it + DocumentInterface *doc_interface = (DocumentInterface*) dbus_register_object (connection, + proxy, + TYPE_DOCUMENT_INTERFACE, + &dbus_glib_document_interface_object_info, + name.c_str()); + + // Set the document info for this interface + doc_interface->target = target; + } + return strdup(name.c_str()); +} + /* Initialize a Dbus service */ void init (void) @@ -97,34 +135,19 @@ init (void) TYPE_APPLICATION_INTERFACE, &dbus_glib_application_interface_object_info, DBUS_APPLICATION_INTERFACE_PATH); -} //init +} gchar * -init_document (void) { - DBusGConnection *connection; - DBusGProxy *proxy; - SPDocument *doc; - - doc = SPDocument::createNewDoc(NULL, 1, TRUE); - - std::string name("/org/inkscape/"); - // This only works because a new document's name happens to contain - // only valid DBus characters [A-Z][a-z][0-9]_ - // TODO: use the document->serial() instead, like below, and similar to - // how desktops work? - name.append(doc->getName()); - std::replace(name.begin(), name.end(), ' ', '_'); - - connection = dbus_get_connection(); - proxy = dbus_get_proxy(connection); +init_document (void) +{ + // This is for command-line use only + g_assert(!inkscape_use_gui()); - dbus_register_object (connection, - proxy, - TYPE_DOCUMENT_INTERFACE, - &dbus_glib_document_interface_object_info, - name.c_str()); - return strdup(name.c_str()); -} //init_document + // Create a blank document and get its selection model etc in an ActionContext + SPDocument *doc = SPDocument::createNewDoc(NULL, 1, TRUE); + inkscape_add_document(doc); + return dbus_register_document(inkscape_action_context_for_document(doc)); +} gchar * init_active_document() @@ -134,28 +157,7 @@ init_active_document() return NULL; } - // Document name is not suitable for DBus name, as it might contain invalid chars - std::string name("/org/inkscape/document_"); - std::stringstream ss; - ss << doc->serial(); - name.append(ss.str()); - - DBusGConnection *connection = dbus_get_connection(); - DBusGProxy *proxy = dbus_get_proxy(connection); - - // Has the active document already been registered? - if (!dbus_g_connection_lookup_g_object(connection, name.c_str())) { - // No - register it - DocumentInterface *obj = (DocumentInterface*) dbus_register_object (connection, - proxy, - TYPE_DOCUMENT_INTERFACE, - &dbus_glib_document_interface_object_info, - name.c_str()); - - // Set the document info for this interface - obj->doc_context = inkscape_active_action_context(); - } - return strdup(name.c_str()); + return dbus_register_document(inkscape_active_action_context()); } gchar * @@ -163,7 +165,6 @@ dbus_init_desktop_interface (SPDesktop * dt) { DBusGConnection *connection; DBusGProxy *proxy; - DocumentInterface *obj; std::string name("/org/inkscape/desktop_"); std::stringstream out; @@ -175,12 +176,12 @@ dbus_init_desktop_interface (SPDesktop * dt) connection = dbus_get_connection(); proxy = dbus_get_proxy(connection); - obj = (DocumentInterface*) dbus_register_object (connection, + DocumentInterface *doc_interface = (DocumentInterface*) dbus_register_object (connection, proxy, TYPE_DOCUMENT_INTERFACE, &dbus_glib_document_interface_object_info, name.c_str()); - obj->doc_context = Inkscape::ActionContext(dt); - obj->updates = TRUE; - dt->dbus_document_interface=obj; + doc_interface->target = Inkscape::ActionContext(dt); + doc_interface->updates = TRUE; + dt->dbus_document_interface=doc_interface; return strdup(name.c_str()); } @@ -195,7 +196,7 @@ init_desktop (void) { out << dt->dkey; name.append(out.str()); return strdup(name.c_str()); -} //init_desktop +} diff --git a/src/extension/dbus/document-interface.cpp b/src/extension/dbus/document-interface.cpp index 6d6f983c5..3cb03646a 100644 --- a/src/extension/dbus/document-interface.cpp +++ b/src/extension/dbus/document-interface.cpp @@ -221,11 +221,11 @@ dbus_create_node (SPDocument *doc, const gchar *type) * There is probably a better way to do this (use the shape tools default styles) * but I'm not sure how. */ -gchar *finish_create_shape (DocumentInterface *object, GError ** /*error*/, Inkscape::XML::Node *newNode, gchar *desc) +gchar *finish_create_shape (DocumentInterface *doc_interface, GError ** /*error*/, Inkscape::XML::Node *newNode, gchar *desc) { SPCSSAttr *style = NULL; - if (object->doc_context.getDesktop()) { - style = sp_desktop_get_style(object->doc_context.getDesktop(), TRUE); + if (doc_interface->target.getDesktop()) { + style = sp_desktop_get_style(doc_interface->target.getDesktop(), TRUE); } if (style) { Glib::ustring str; @@ -236,11 +236,11 @@ gchar *finish_create_shape (DocumentInterface *object, GError ** /*error*/, Inks newNode->setAttribute("style", "fill:#0000ff;fill-opacity:1;stroke:#c900b9;stroke-width:0;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none", TRUE); } - object->doc_context.getSelection()->layers()->currentLayer()->appendChildRepr(newNode); - object->doc_context.getSelection()->layers()->currentLayer()->updateRepr(); + doc_interface->target.getSelection()->layers()->currentLayer()->appendChildRepr(newNode); + doc_interface->target.getSelection()->layers()->currentLayer()->updateRepr(); - if (object->updates) { - Inkscape::DocumentUndo::done(object->doc_context.getDocument(), 0, (gchar *)desc); + if (doc_interface->updates) { + Inkscape::DocumentUndo::done(doc_interface->target.getDocument(), 0, (gchar *)desc); } return strdup(newNode->attribute("id")); @@ -255,19 +255,19 @@ gchar *finish_create_shape (DocumentInterface *object, GError ** /*error*/, Inks * document_interface_call_verb is similar but is called by the user. */ gboolean -dbus_call_verb (DocumentInterface *object, int verbid, GError **error) +dbus_call_verb (DocumentInterface *doc_interface, int verbid, GError **error) { - SPDesktop *desk = object->doc_context.getDesktop(); + SPDesktop *desk = doc_interface->target.getDesktop(); if ( desk ) { desktop_ensure_active (desk); } Inkscape::Verb *verb = Inkscape::Verb::get( verbid ); if ( verb ) { - SPAction *action = verb->get_action(object->doc_context); + SPAction *action = verb->get_action(doc_interface->target); if ( action ) { sp_action_perform( action, NULL ); - if (object->updates) - Inkscape::DocumentUndo::done(object->doc_context.getDocument(), verb->get_code(), g_strdup(verb->get_tip())); + if (doc_interface->updates) + Inkscape::DocumentUndo::done(doc_interface->target.getDocument(), verb->get_code(), g_strdup(verb->get_tip())); return TRUE; } } @@ -319,9 +319,9 @@ document_interface_class_init (DocumentInterfaceClass *klass) } static void -document_interface_init (DocumentInterface *object) +document_interface_init (DocumentInterface *doc_interface) { - object->doc_context = Inkscape::ActionContext(); + doc_interface->target = Inkscape::ActionContext(); } @@ -337,26 +337,26 @@ document_interface_new (void) MISC FUNCTIONS ****************************************************************************/ -gboolean document_interface_delete_all(DocumentInterface *object, GError ** /*error*/) +gboolean document_interface_delete_all(DocumentInterface *doc_interface, GError ** /*error*/) { - sp_edit_clear_all(object->doc_context.getSelection()); + sp_edit_clear_all(doc_interface->target.getSelection()); return TRUE; } gboolean -document_interface_call_verb (DocumentInterface *object, gchar *verbid, GError **error) +document_interface_call_verb (DocumentInterface *doc_interface, gchar *verbid, GError **error) { - SPDesktop *desk = object->doc_context.getDesktop(); + SPDesktop *desk = doc_interface->target.getDesktop(); if ( desk ) { desktop_ensure_active (desk); } Inkscape::Verb *verb = Inkscape::Verb::getbyid( verbid ); if ( verb ) { - SPAction *action = verb->get_action(object->doc_context); + SPAction *action = verb->get_action(doc_interface->target); if ( action ) { sp_action_perform( action, NULL ); - if (object->updates) { - Inkscape::DocumentUndo::done(object->doc_context.getDocument(), verb->get_code(), g_strdup(verb->get_tip())); + if (doc_interface->updates) { + Inkscape::DocumentUndo::done(doc_interface->target.getDocument(), verb->get_code(), g_strdup(verb->get_tip())); } return TRUE; } @@ -371,39 +371,39 @@ document_interface_call_verb (DocumentInterface *object, gchar *verbid, GError * ****************************************************************************/ gchar* -document_interface_rectangle (DocumentInterface *object, int x, int y, +document_interface_rectangle (DocumentInterface *doc_interface, int x, int y, int width, int height, GError **error) { - Inkscape::XML::Node *newNode = dbus_create_node(object->doc_context.getDocument(), "svg:rect"); + Inkscape::XML::Node *newNode = dbus_create_node(doc_interface->target.getDocument(), "svg:rect"); sp_repr_set_int(newNode, "x", x); //could also use newNode->setAttribute() sp_repr_set_int(newNode, "y", y); sp_repr_set_int(newNode, "width", width); sp_repr_set_int(newNode, "height", height); - return finish_create_shape (object, error, newNode, (gchar *)"create rectangle"); + return finish_create_shape (doc_interface, error, newNode, (gchar *)"create rectangle"); } gchar* -document_interface_ellipse_center (DocumentInterface *object, int cx, int cy, +document_interface_ellipse_center (DocumentInterface *doc_interface, int cx, int cy, int rx, int ry, GError **error) { - Inkscape::XML::Node *newNode = dbus_create_node(object->doc_context.getDocument(), "svg:path"); + Inkscape::XML::Node *newNode = dbus_create_node(doc_interface->target.getDocument(), "svg:path"); newNode->setAttribute("sodipodi:type", "arc"); sp_repr_set_int(newNode, "sodipodi:cx", cx); sp_repr_set_int(newNode, "sodipodi:cy", cy); sp_repr_set_int(newNode, "sodipodi:rx", rx); sp_repr_set_int(newNode, "sodipodi:ry", ry); - return finish_create_shape (object, error, newNode, (gchar *)"create circle"); + return finish_create_shape (doc_interface, error, newNode, (gchar *)"create circle"); } gchar* -document_interface_polygon (DocumentInterface *object, int cx, int cy, +document_interface_polygon (DocumentInterface *doc_interface, int cx, int cy, int radius, int rotation, int sides, GError **error) { gdouble rot = ((rotation / 180.0) * 3.14159265) - ( 3.14159265 / 2.0); - Inkscape::XML::Node *newNode = dbus_create_node(object->doc_context.getDocument(), "svg:path"); + Inkscape::XML::Node *newNode = dbus_create_node(doc_interface->target.getDocument(), "svg:path"); newNode->setAttribute("inkscape:flatsided", "true"); newNode->setAttribute("sodipodi:type", "star"); sp_repr_set_int(newNode, "sodipodi:cx", cx); @@ -416,15 +416,15 @@ document_interface_polygon (DocumentInterface *object, int cx, int cy, sp_repr_set_svg_double(newNode, "sodipodi:arg2", rot); sp_repr_set_svg_double(newNode, "inkscape:rounded", 0); - return finish_create_shape (object, error, newNode, (gchar *)"create polygon"); + return finish_create_shape (doc_interface, error, newNode, (gchar *)"create polygon"); } gchar* -document_interface_star (DocumentInterface *object, int cx, int cy, +document_interface_star (DocumentInterface *doc_interface, int cx, int cy, int r1, int r2, int sides, gdouble rounded, gdouble arg1, gdouble arg2, GError **error) { - Inkscape::XML::Node *newNode = dbus_create_node(object->doc_context.getDocument(), "svg:path"); + Inkscape::XML::Node *newNode = dbus_create_node(doc_interface->target.getDocument(), "svg:path"); newNode->setAttribute("inkscape:flatsided", "false"); newNode->setAttribute("sodipodi:type", "star"); sp_repr_set_int(newNode, "sodipodi:cx", cx); @@ -437,35 +437,35 @@ document_interface_star (DocumentInterface *object, int cx, int cy, sp_repr_set_svg_double(newNode, "sodipodi:arg2", arg2); sp_repr_set_svg_double(newNode, "inkscape:rounded", rounded); - return finish_create_shape (object, error, newNode, (gchar *)"create star"); + return finish_create_shape (doc_interface, error, newNode, (gchar *)"create star"); } gchar* -document_interface_ellipse (DocumentInterface *object, int x, int y, +document_interface_ellipse (DocumentInterface *doc_interface, int x, int y, int width, int height, GError **error) { int rx = width/2; int ry = height/2; - return document_interface_ellipse_center (object, x+rx, y+ry, rx, ry, error); + return document_interface_ellipse_center (doc_interface, x+rx, y+ry, rx, ry, error); } gchar* -document_interface_line (DocumentInterface *object, int x, int y, +document_interface_line (DocumentInterface *doc_interface, int x, int y, int x2, int y2, GError **error) { - Inkscape::XML::Node *newNode = dbus_create_node(object->doc_context.getDocument(), "svg:path"); + Inkscape::XML::Node *newNode = dbus_create_node(doc_interface->target.getDocument(), "svg:path"); std::stringstream out; // Not sure why this works. out << "m " << x << "," << y << " " << x2 - x << "," << y2 - y; newNode->setAttribute("d", out.str().c_str()); - return finish_create_shape (object, error, newNode, (gchar *)"create line"); + return finish_create_shape (doc_interface, error, newNode, (gchar *)"create line"); } gchar* -document_interface_spiral (DocumentInterface *object, int cx, int cy, +document_interface_spiral (DocumentInterface *doc_interface, int cx, int cy, int r, int revolutions, GError **error) { - Inkscape::XML::Node *newNode = dbus_create_node(object->doc_context.getDocument(), "svg:path"); + Inkscape::XML::Node *newNode = dbus_create_node(doc_interface->target.getDocument(), "svg:path"); newNode->setAttribute("sodipodi:type", "spiral"); sp_repr_set_int(newNode, "sodipodi:cx", cx); sp_repr_set_int(newNode, "sodipodi:cy", cy); @@ -474,7 +474,7 @@ document_interface_spiral (DocumentInterface *object, int cx, int cy, sp_repr_set_int(newNode, "sodipodi:t0", 0); sp_repr_set_int(newNode, "sodipodi:argument", 0); sp_repr_set_int(newNode, "sodipodi:expansion", 1); - gchar * retval = finish_create_shape (object, error, newNode, (gchar *)"create spiral"); + gchar * retval = finish_create_shape (doc_interface, error, newNode, (gchar *)"create spiral"); //Makes sure there is no fill for spirals by default. gchar* newString = g_strconcat(newNode->attribute("style"), ";fill:none", NULL); newNode->setAttribute("style", newString); @@ -483,54 +483,54 @@ document_interface_spiral (DocumentInterface *object, int cx, int cy, } gchar* -document_interface_text (DocumentInterface *object, int x, int y, gchar *text, GError **error) +document_interface_text (DocumentInterface *doc_interface, int x, int y, gchar *text, GError **error) { - Inkscape::XML::Node *text_node = dbus_create_node(object->doc_context.getDocument(), "svg:text"); + Inkscape::XML::Node *text_node = dbus_create_node(doc_interface->target.getDocument(), "svg:text"); sp_repr_set_int(text_node, "x", x); sp_repr_set_int(text_node, "y", y); //just a workaround so i can get an spitem from the name - gchar *name = finish_create_shape (object, error, text_node, (gchar *)"create text"); + gchar *name = finish_create_shape (doc_interface, error, text_node, (gchar *)"create text"); - SPItem* text_obj=(SPItem* )get_object_by_name(object->doc_context.getDocument(), name, error); + SPItem* text_obj=(SPItem* )get_object_by_name(doc_interface->target.getDocument(), name, error); sp_te_set_repr_text_multiline(text_obj, text); return name; } gchar * -document_interface_image (DocumentInterface *object, int x, int y, gchar *filename, GError **error) +document_interface_image (DocumentInterface *doc_interface, int x, int y, gchar *filename, GError **error) { gchar * uri = g_filename_to_uri (filename, FALSE, error); if (!uri) return FALSE; - Inkscape::XML::Node *newNode = dbus_create_node(object->doc_context.getDocument(), "svg:image"); + Inkscape::XML::Node *newNode = dbus_create_node(doc_interface->target.getDocument(), "svg:image"); sp_repr_set_int(newNode, "x", x); sp_repr_set_int(newNode, "y", y); newNode->setAttribute("xlink:href", uri); - object->doc_context.getSelection()->layers()->currentLayer()->appendChildRepr(newNode); - object->doc_context.getSelection()->layers()->currentLayer()->updateRepr(); + doc_interface->target.getSelection()->layers()->currentLayer()->appendChildRepr(newNode); + doc_interface->target.getSelection()->layers()->currentLayer()->updateRepr(); - if (object->updates) - Inkscape::DocumentUndo::done(object->doc_context.getDocument(), 0, "Imported bitmap."); + if (doc_interface->updates) + Inkscape::DocumentUndo::done(doc_interface->target.getDocument(), 0, "Imported bitmap."); //g_free(uri); return strdup(newNode->attribute("id")); } -gchar *document_interface_node(DocumentInterface *object, gchar *type, GError ** /*error*/) +gchar *document_interface_node(DocumentInterface *doc_interface, gchar *type, GError ** /*error*/) { - SPDocument * doc = object->doc_context.getDocument(); + SPDocument * doc = doc_interface->target.getDocument(); Inkscape::XML::Document *xml_doc = doc->getReprDoc(); Inkscape::XML::Node *newNode = xml_doc->createElement(type); - object->doc_context.getSelection()->layers()->currentLayer()->appendChildRepr(newNode); - object->doc_context.getSelection()->layers()->currentLayer()->updateRepr(); + doc_interface->target.getSelection()->layers()->currentLayer()->appendChildRepr(newNode); + doc_interface->target.getSelection()->layers()->currentLayer()->updateRepr(); - if (object->updates) { + if (doc_interface->updates) { Inkscape::DocumentUndo::done(doc, 0, (gchar *)"created empty node"); } @@ -541,20 +541,20 @@ gchar *document_interface_node(DocumentInterface *object, gchar *type, GError ** ENVIRONMENT FUNCTIONS ****************************************************************************/ gdouble -document_interface_document_get_width (DocumentInterface *object) +document_interface_document_get_width (DocumentInterface *doc_interface) { - return object->doc_context.getDocument()->getWidth(); + return doc_interface->target.getDocument()->getWidth(); } gdouble -document_interface_document_get_height (DocumentInterface *object) +document_interface_document_get_height (DocumentInterface *doc_interface) { - return object->doc_context.getDocument()->getHeight(); + return doc_interface->target.getDocument()->getHeight(); } -gchar *document_interface_document_get_css(DocumentInterface *object, GError ** error) +gchar *document_interface_document_get_css(DocumentInterface *doc_interface, GError ** error) { - SPDesktop *desk = object->doc_context.getDesktop(); + SPDesktop *desk = doc_interface->target.getDesktop(); g_return_val_if_fail(ensure_desktop_valid(desk, error), NULL); SPCSSAttr *current = desk->current; Glib::ustring str; @@ -562,10 +562,10 @@ gchar *document_interface_document_get_css(DocumentInterface *object, GError ** return (str.empty() ? NULL : g_strdup (str.c_str())); } -gboolean document_interface_document_merge_css(DocumentInterface *object, +gboolean document_interface_document_merge_css(DocumentInterface *doc_interface, gchar *stylestring, GError ** error) { - SPDesktop *desk = object->doc_context.getDesktop(); + SPDesktop *desk = doc_interface->target.getDesktop(); g_return_val_if_fail(ensure_desktop_valid(desk, error), FALSE); SPCSSAttr * style = sp_repr_css_attr_new(); sp_repr_css_attr_add_from_string(style, stylestring); @@ -573,10 +573,10 @@ gboolean document_interface_document_merge_css(DocumentInterface *object, return TRUE; } -gboolean document_interface_document_set_css(DocumentInterface *object, +gboolean document_interface_document_set_css(DocumentInterface *doc_interface, gchar *stylestring, GError ** error) { - SPDesktop *desk = object->doc_context.getDesktop(); + SPDesktop *desk = doc_interface->target.getDesktop(); g_return_val_if_fail(ensure_desktop_valid(desk, error), FALSE); SPCSSAttr * style = sp_repr_css_attr_new(); sp_repr_css_attr_add_from_string (style, stylestring); @@ -586,14 +586,14 @@ gboolean document_interface_document_set_css(DocumentInterface *object, } gboolean -document_interface_document_resize_to_fit_selection (DocumentInterface *object, +document_interface_document_resize_to_fit_selection (DocumentInterface *doc_interface, GError **error) { - return dbus_call_verb (object, SP_VERB_FIT_CANVAS_TO_SELECTION, error); + return dbus_call_verb (doc_interface, SP_VERB_FIT_CANVAS_TO_SELECTION, error); } gboolean -document_interface_document_set_display_area (DocumentInterface *object, +document_interface_document_set_display_area (DocumentInterface *doc_interface, double x0, double y0, double x1, @@ -601,7 +601,7 @@ document_interface_document_set_display_area (DocumentInterface *object, double border, GError **error) { - SPDesktop *desk = object->doc_context.getDesktop(); + SPDesktop *desk = doc_interface->target.getDesktop(); g_return_val_if_fail(ensure_desktop_valid(desk, error), FALSE); desk->set_display_area (x0, y0, @@ -613,9 +613,9 @@ document_interface_document_set_display_area (DocumentInterface *object, GArray * -document_interface_document_get_display_area (DocumentInterface *object) +document_interface_document_get_display_area (DocumentInterface *doc_interface) { - SPDesktop *desk = object->doc_context.getDesktop(); + SPDesktop *desk = doc_interface->target.getDesktop(); if (!desk) { return NULL; } @@ -641,10 +641,10 @@ document_interface_document_get_display_area (DocumentInterface *object) ****************************************************************************/ gboolean -document_interface_set_attribute (DocumentInterface *object, char *shape, +document_interface_set_attribute (DocumentInterface *doc_interface, char *shape, char *attribute, char *newval, GError **error) { - Inkscape::XML::Node *newNode = get_repr_by_name(object->doc_context.getDocument(), shape, error); + Inkscape::XML::Node *newNode = get_repr_by_name(doc_interface->target.getDocument(), shape, error); /* ALTERNATIVE (is this faster?) Inkscape::XML::Node *newnode = sp_repr_lookup_name((doc->root)->repr, name); @@ -660,11 +660,11 @@ document_interface_set_attribute (DocumentInterface *object, char *shape, } gboolean -document_interface_set_int_attribute (DocumentInterface *object, +document_interface_set_int_attribute (DocumentInterface *doc_interface, char *shape, char *attribute, int newval, GError **error) { - Inkscape::XML::Node *newNode = get_repr_by_name (object->doc_context.getDocument(), shape, error); + Inkscape::XML::Node *newNode = get_repr_by_name (doc_interface->target.getDocument(), shape, error); if (!newNode) return FALSE; @@ -674,11 +674,11 @@ document_interface_set_int_attribute (DocumentInterface *object, gboolean -document_interface_set_double_attribute (DocumentInterface *object, +document_interface_set_double_attribute (DocumentInterface *doc_interface, char *shape, char *attribute, double newval, GError **error) { - Inkscape::XML::Node *newNode = get_repr_by_name (object->doc_context.getDocument(), shape, error); + Inkscape::XML::Node *newNode = get_repr_by_name (doc_interface->target.getDocument(), shape, error); if (!dbus_check_string (attribute, error, "New value string was empty.")) return FALSE; @@ -690,10 +690,10 @@ document_interface_set_double_attribute (DocumentInterface *object, } gchar * -document_interface_get_attribute (DocumentInterface *object, char *shape, +document_interface_get_attribute (DocumentInterface *doc_interface, char *shape, char *attribute, GError **error) { - Inkscape::XML::Node *newNode = get_repr_by_name(object->doc_context.getDocument(), shape, error); + Inkscape::XML::Node *newNode = get_repr_by_name(doc_interface->target.getDocument(), shape, error); if (!dbus_check_string (attribute, error, "Attribute name empty.")) return NULL; @@ -704,47 +704,47 @@ document_interface_get_attribute (DocumentInterface *object, char *shape, } gboolean -document_interface_move (DocumentInterface *object, gchar *name, gdouble x, +document_interface_move (DocumentInterface *doc_interface, gchar *name, gdouble x, gdouble y, GError **error) { - const GSList *oldsel = selection_swap(object->doc_context.getSelection(), name, error); + const GSList *oldsel = selection_swap(doc_interface->target.getSelection(), name, error); if (!oldsel) return FALSE; - sp_selection_move (object->doc_context.getSelection(), x, 0 - y); - selection_restore(object->doc_context.getSelection(), oldsel); + sp_selection_move (doc_interface->target.getSelection(), x, 0 - y); + selection_restore(doc_interface->target.getSelection(), oldsel); return TRUE; } gboolean -document_interface_move_to (DocumentInterface *object, gchar *name, gdouble x, +document_interface_move_to (DocumentInterface *doc_interface, gchar *name, gdouble x, gdouble y, GError **error) { - const GSList *oldsel = selection_swap(object->doc_context.getSelection(), name, error); + const GSList *oldsel = selection_swap(doc_interface->target.getSelection(), name, error); if (!oldsel) return FALSE; - Inkscape::Selection * sel = object->doc_context.getSelection(); - sp_selection_move (object->doc_context.getSelection(), x - selection_get_center_x(sel), + Inkscape::Selection * sel = doc_interface->target.getSelection(); + sp_selection_move (doc_interface->target.getSelection(), x - selection_get_center_x(sel), 0 - (y - selection_get_center_y(sel))); - selection_restore(object->doc_context.getSelection(), oldsel); + selection_restore(doc_interface->target.getSelection(), oldsel); return TRUE; } gboolean -document_interface_object_to_path (DocumentInterface *object, +document_interface_object_to_path (DocumentInterface *doc_interface, char *shape, GError **error) { - const GSList *oldsel = selection_swap(object->doc_context.getSelection(), shape, error); + const GSList *oldsel = selection_swap(doc_interface->target.getSelection(), shape, error); if (!oldsel) return FALSE; - dbus_call_verb (object, SP_VERB_OBJECT_TO_CURVE, error); - selection_restore(object->doc_context.getSelection(), oldsel); + dbus_call_verb (doc_interface, SP_VERB_OBJECT_TO_CURVE, error); + selection_restore(doc_interface->target.getSelection(), oldsel); return TRUE; } gchar * -document_interface_get_path (DocumentInterface *object, char *pathname, GError **error) +document_interface_get_path (DocumentInterface *doc_interface, char *pathname, GError **error) { - Inkscape::XML::Node *node = get_repr_by_name(object->doc_context.getDocument(), pathname, error); + Inkscape::XML::Node *node = get_repr_by_name(doc_interface->target.getDocument(), pathname, error); if (!node) return NULL; @@ -758,30 +758,30 @@ document_interface_get_path (DocumentInterface *object, char *pathname, GError * } gboolean -document_interface_transform (DocumentInterface *object, gchar *shape, +document_interface_transform (DocumentInterface *doc_interface, gchar *shape, gchar *transformstr, GError **error) { //FIXME: This should merge transformations. gchar trans[] = "transform"; - document_interface_set_attribute (object, shape, trans, transformstr, error); + document_interface_set_attribute (doc_interface, shape, trans, transformstr, error); return TRUE; } gchar * -document_interface_get_css (DocumentInterface *object, gchar *shape, +document_interface_get_css (DocumentInterface *doc_interface, gchar *shape, GError **error) { gchar style[] = "style"; - return document_interface_get_attribute (object, shape, style, error); + return document_interface_get_attribute (doc_interface, shape, style, error); } gboolean -document_interface_modify_css (DocumentInterface *object, gchar *shape, +document_interface_modify_css (DocumentInterface *doc_interface, gchar *shape, gchar *cssattrb, gchar *newval, GError **error) { // Doesn't like non-variable strings for some reason. gchar style[] = "style"; - Inkscape::XML::Node *node = get_repr_by_name(object->doc_context.getDocument(), shape, error); + Inkscape::XML::Node *node = get_repr_by_name(doc_interface->target.getDocument(), shape, error); if (!dbus_check_string (cssattrb, error, "Attribute string empty.")) return FALSE; @@ -797,12 +797,12 @@ document_interface_modify_css (DocumentInterface *object, gchar *shape, } gboolean -document_interface_merge_css (DocumentInterface *object, gchar *shape, +document_interface_merge_css (DocumentInterface *doc_interface, gchar *shape, gchar *stylestring, GError **error) { gchar style[] = "style"; - Inkscape::XML::Node *node = get_repr_by_name(object->doc_context.getDocument(), shape, error); + Inkscape::XML::Node *node = get_repr_by_name(doc_interface->target.getDocument(), shape, error); if (!dbus_check_string (stylestring, error, "Style string empty.")) return FALSE; @@ -823,7 +823,7 @@ document_interface_merge_css (DocumentInterface *object, gchar *shape, } gboolean -document_interface_set_color (DocumentInterface *object, gchar *shape, +document_interface_set_color (DocumentInterface *doc_interface, gchar *shape, int r, int g, int b, gboolean fill, GError **error) { gchar style[15]; @@ -839,29 +839,29 @@ document_interface_set_color (DocumentInterface *object, gchar *shape, snprintf(style, 15, "stroke:#%.2x%.2x%.2x", r, g, b); if (strcmp(shape, "document") == 0) - return document_interface_document_merge_css (object, style, error); + return document_interface_document_merge_css (doc_interface, style, error); - return document_interface_merge_css (object, shape, style, error); + return document_interface_merge_css (doc_interface, shape, style, error); } gboolean -document_interface_move_to_layer (DocumentInterface *object, gchar *shape, +document_interface_move_to_layer (DocumentInterface *doc_interface, gchar *shape, gchar *layerstr, GError **error) { - const GSList *oldsel = selection_swap(object->doc_context.getSelection(), shape, error); + const GSList *oldsel = selection_swap(doc_interface->target.getSelection(), shape, error); if (!oldsel) return FALSE; - document_interface_selection_move_to_layer(object, layerstr, error); - selection_restore(object->doc_context.getSelection(), oldsel); + document_interface_selection_move_to_layer(doc_interface, layerstr, error); + selection_restore(doc_interface->target.getSelection(), oldsel); return TRUE; } -GArray *document_interface_get_node_coordinates(DocumentInterface * /*object*/, gchar * /*shape*/) +GArray *document_interface_get_node_coordinates(DocumentInterface * /*doc_interface*/, gchar * /*shape*/) { //FIXME: Needs lot's of work. /* - Inkscape::XML::Node *shapenode = get_repr_by_name (object->doc_context.getDocument(), shape, error); + Inkscape::XML::Node *shapenode = get_repr_by_name (doc_interface->target.getDocument(), shape, error); if (shapenode == NULL || shapenode->attribute("d") == NULL) { return FALSE; } @@ -876,10 +876,10 @@ GArray *document_interface_get_node_coordinates(DocumentInterface * /*object*/, gboolean -document_interface_set_text (DocumentInterface *object, gchar *name, gchar *text, GError **error) +document_interface_set_text (DocumentInterface *doc_interface, gchar *name, gchar *text, GError **error) { - SPItem* text_obj=(SPItem* )get_object_by_name(object->doc_context.getDocument(), name, error); + SPItem* text_obj=(SPItem* )get_object_by_name(doc_interface->target.getDocument(), name, error); //TODO verify object type if (!text_obj) return FALSE; @@ -891,12 +891,12 @@ document_interface_set_text (DocumentInterface *object, gchar *name, gchar *text gboolean -document_interface_text_apply_style (DocumentInterface *object, gchar *name, +document_interface_text_apply_style (DocumentInterface *doc_interface, gchar *name, int start_pos, int end_pos, gchar *style, gchar *styleval, GError **error) { - SPItem* text_obj=(SPItem* )get_object_by_name(object->doc_context.getDocument(), name, error); + SPItem* text_obj=(SPItem* )get_object_by_name(doc_interface->target.getDocument(), name, error); //void sp_te_apply_style(SPItem *text, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPCSSAttr const *css) //TODO verify object type @@ -923,40 +923,40 @@ document_interface_text_apply_style (DocumentInterface *object, gchar *name, ****************************************************************************/ gboolean -document_interface_save (DocumentInterface *object, GError **error) +document_interface_save (DocumentInterface *doc_interface, GError **error) { - SPDocument * doc = object->doc_context.getDocument(); + SPDocument * doc = doc_interface->target.getDocument(); printf("1: %s\n2: %s\n3: %s\n", doc->getURI(), doc->getBase(), doc->getName()); if (doc->getURI()) - return document_interface_save_as (object, doc->getURI(), error); + return document_interface_save_as (doc_interface, doc->getURI(), error); return FALSE; } -gboolean document_interface_load(DocumentInterface *object, +gboolean document_interface_load(DocumentInterface *doc_interface, gchar *filename, GError ** /*error*/) { - SPDesktop *desk = object->doc_context.getDesktop(); + SPDesktop *desk = doc_interface->target.getDesktop(); if (desk) { desktop_ensure_active(desk); } const Glib::ustring file(filename); sp_file_open(file, NULL, TRUE, TRUE); - if (object->updates) { - Inkscape::DocumentUndo::done(object->doc_context.getDocument(), SP_VERB_FILE_OPEN, "Opened File"); + if (doc_interface->updates) { + Inkscape::DocumentUndo::done(doc_interface->target.getDocument(), SP_VERB_FILE_OPEN, "Opened File"); } return TRUE; } gchar * -document_interface_import (DocumentInterface *object, +document_interface_import (DocumentInterface *doc_interface, gchar *filename, GError **error) { - SPDesktop *desk = object->doc_context.getDesktop(); + SPDesktop *desk = doc_interface->target.getDesktop(); if (desk) { desktop_ensure_active(desk); } const Glib::ustring file(filename); - SPDocument * doc = object->doc_context.getDocument(); + SPDocument * doc = doc_interface->target.getDocument(); SPObject *new_obj = NULL; new_obj = file_import(doc, file, NULL); @@ -964,11 +964,11 @@ document_interface_import (DocumentInterface *object, } gboolean -document_interface_save_as (DocumentInterface *object, +document_interface_save_as (DocumentInterface *doc_interface, const gchar *filename, GError **error) { // FIXME: Isn't there a verb we can use for this instead? - SPDocument * doc = object->doc_context.getDocument(); + SPDocument * doc = doc_interface->target.getDocument(); #ifdef WITH_GNOME_VFS const Glib::ustring file(filename); return file_save_remote(doc, file, NULL, TRUE, TRUE); @@ -988,9 +988,9 @@ document_interface_save_as (DocumentInterface *object, return true; } -gboolean document_interface_mark_as_unmodified(DocumentInterface *object, GError ** /*error*/) +gboolean document_interface_mark_as_unmodified(DocumentInterface *doc_interface, GError ** /*error*/) { - SPDocument * doc = object->doc_context.getDocument(); + SPDocument * doc = doc_interface->target.getDocument(); if (doc) { doc->modified_since_save = FALSE; } @@ -999,9 +999,9 @@ gboolean document_interface_mark_as_unmodified(DocumentInterface *object, GError /* gboolean -document_interface_print_to_file (DocumentInterface *object, GError **error) +document_interface_print_to_file (DocumentInterface *doc_interface, GError **error) { - SPDocument * doc = object->doc_context.getDocument(); + SPDocument * doc = doc_interface->target.getDocument(); sp_print_document_to_file (doc, g_strdup("/home/soren/test.pdf")); return TRUE; @@ -1012,27 +1012,27 @@ document_interface_print_to_file (DocumentInterface *object, GError **error) ****************************************************************************/ gboolean -document_interface_close (DocumentInterface *object, GError **error) +document_interface_close (DocumentInterface *doc_interface, GError **error) { - return dbus_call_verb (object, SP_VERB_FILE_CLOSE_VIEW, error); + return dbus_call_verb (doc_interface, SP_VERB_FILE_CLOSE_VIEW, error); } gboolean -document_interface_exit (DocumentInterface *object, GError **error) +document_interface_exit (DocumentInterface *doc_interface, GError **error) { - return dbus_call_verb (object, SP_VERB_FILE_QUIT, error); + return dbus_call_verb (doc_interface, SP_VERB_FILE_QUIT, error); } gboolean -document_interface_undo (DocumentInterface *object, GError **error) +document_interface_undo (DocumentInterface *doc_interface, GError **error) { - return dbus_call_verb (object, SP_VERB_EDIT_UNDO, error); + return dbus_call_verb (doc_interface, SP_VERB_EDIT_UNDO, error); } gboolean -document_interface_redo (DocumentInterface *object, GError **error) +document_interface_redo (DocumentInterface *doc_interface, GError **error) { - return dbus_call_verb (object, SP_VERB_EDIT_REDO, error); + return dbus_call_verb (doc_interface, SP_VERB_EDIT_REDO, error); } @@ -1044,29 +1044,29 @@ document_interface_redo (DocumentInterface *object, GError **error) Need to make sure it plays well with verbs because they are used so much. ****************************************************************************/ -void document_interface_pause_updates(DocumentInterface *object, GError ** error) +void document_interface_pause_updates(DocumentInterface *doc_interface, GError ** error) { - SPDesktop *desk = object->doc_context.getDesktop(); + SPDesktop *desk = doc_interface->target.getDesktop(); g_return_if_fail(ensure_desktop_valid(desk, error)); - object->updates = FALSE; + doc_interface->updates = FALSE; desk->canvas->drawing_disabled = 1; } -void document_interface_resume_updates(DocumentInterface *object, GError ** error) +void document_interface_resume_updates(DocumentInterface *doc_interface, GError ** error) { - SPDesktop *desk = object->doc_context.getDesktop(); + SPDesktop *desk = doc_interface->target.getDesktop(); g_return_if_fail(ensure_desktop_valid(desk, error)); - object->updates = TRUE; + doc_interface->updates = TRUE; desk->canvas->drawing_disabled = 0; //FIXME: use better verb than rect. - Inkscape::DocumentUndo::done(object->doc_context.getDocument(), SP_VERB_CONTEXT_RECT, "Multiple actions"); + Inkscape::DocumentUndo::done(doc_interface->target.getDocument(), SP_VERB_CONTEXT_RECT, "Multiple actions"); } -void document_interface_update(DocumentInterface *object, GError ** error) +void document_interface_update(DocumentInterface *doc_interface, GError ** error) { - SPDesktop *desk = object->doc_context.getDesktop(); + SPDesktop *desk = doc_interface->target.getDesktop(); g_return_if_fail(ensure_desktop_valid(desk, error)); - SPDocument *doc = object->doc_context.getDocument(); + SPDocument *doc = doc_interface->target.getDocument(); doc->getRoot()->uflags = TRUE; doc->getRoot()->mflags = TRUE; desk->enableInteraction(); @@ -1081,9 +1081,9 @@ void document_interface_update(DocumentInterface *object, GError ** error) SELECTION FUNCTIONS FIXME: use call_verb where appropriate (once update system is tested.) ****************************************************************************/ -gboolean document_interface_selection_get(DocumentInterface *object, char ***out, GError ** /*error*/) +gboolean document_interface_selection_get(DocumentInterface *doc_interface, char ***out, GError ** /*error*/) { - Inkscape::Selection * sel = object->doc_context.getSelection(); + Inkscape::Selection * sel = doc_interface->target.getSelection(); GSList const *oldsel = sel->list(); int size = g_slist_length((GSList *) oldsel); @@ -1101,82 +1101,82 @@ gboolean document_interface_selection_get(DocumentInterface *object, char ***out } gboolean -document_interface_selection_add (DocumentInterface *object, char *name, GError **error) +document_interface_selection_add (DocumentInterface *doc_interface, char *name, GError **error) { - SPObject * obj = get_object_by_name(object->doc_context.getDocument(), name, error); + SPObject * obj = get_object_by_name(doc_interface->target.getDocument(), name, error); if (!obj) return FALSE; - Inkscape::Selection *selection = object->doc_context.getSelection(); + Inkscape::Selection *selection = doc_interface->target.getSelection(); selection->add(obj); return TRUE; } gboolean -document_interface_selection_add_list (DocumentInterface *object, +document_interface_selection_add_list (DocumentInterface *doc_interface, char **names, GError **error) { int i; for (i=0;names[i] != NULL;i++) { - document_interface_selection_add(object, names[i], error); + document_interface_selection_add(doc_interface, names[i], error); } return TRUE; } -gboolean document_interface_selection_set(DocumentInterface *object, char *name, GError ** /*error*/) +gboolean document_interface_selection_set(DocumentInterface *doc_interface, char *name, GError ** /*error*/) { - SPDocument * doc = object->doc_context.getDocument(); - Inkscape::Selection *selection = object->doc_context.getSelection(); + SPDocument * doc = doc_interface->target.getDocument(); + Inkscape::Selection *selection = doc_interface->target.getSelection(); selection->set(doc->getObjectById(name)); return TRUE; } gboolean -document_interface_selection_set_list (DocumentInterface *object, +document_interface_selection_set_list (DocumentInterface *doc_interface, gchar **names, GError **error) { - object->doc_context.getSelection()->clear(); + doc_interface->target.getSelection()->clear(); int i; for (i=0;names[i] != NULL;i++) { - document_interface_selection_add(object, names[i], error); + document_interface_selection_add(doc_interface, names[i], error); } return TRUE; } -gboolean document_interface_selection_rotate(DocumentInterface *object, int angle, GError ** /*error*/) +gboolean document_interface_selection_rotate(DocumentInterface *doc_interface, int angle, GError ** /*error*/) { - Inkscape::Selection *selection = object->doc_context.getSelection(); + Inkscape::Selection *selection = doc_interface->target.getSelection(); sp_selection_rotate(selection, angle); return TRUE; } gboolean -document_interface_selection_delete (DocumentInterface *object, GError **error) +document_interface_selection_delete (DocumentInterface *doc_interface, GError **error) { - return dbus_call_verb (object, SP_VERB_EDIT_DELETE, error); + return dbus_call_verb (doc_interface, SP_VERB_EDIT_DELETE, error); } -gboolean document_interface_selection_clear(DocumentInterface *object, GError ** /*error*/) +gboolean document_interface_selection_clear(DocumentInterface *doc_interface, GError ** /*error*/) { - object->doc_context.getSelection()->clear(); + doc_interface->target.getSelection()->clear(); return TRUE; } gboolean -document_interface_select_all (DocumentInterface *object, GError **error) +document_interface_select_all (DocumentInterface *doc_interface, GError **error) { - return dbus_call_verb (object, SP_VERB_EDIT_SELECT_ALL, error); + return dbus_call_verb (doc_interface, SP_VERB_EDIT_SELECT_ALL, error); } gboolean -document_interface_select_all_in_all_layers(DocumentInterface *object, +document_interface_select_all_in_all_layers(DocumentInterface *doc_interface, GError **error) { - return dbus_call_verb (object, SP_VERB_EDIT_SELECT_ALL_IN_ALL_LAYERS, error); + return dbus_call_verb (doc_interface, SP_VERB_EDIT_SELECT_ALL_IN_ALL_LAYERS, error); } -gboolean document_interface_selection_box(DocumentInterface * /*object*/, int /*x*/, int /*y*/, +gboolean document_interface_selection_box(DocumentInterface * /*doc_interface*/, int /*x*/, int /*y*/, int /*x2*/, int /*y2*/, gboolean /*replace*/, GError ** /*error*/) { @@ -1185,49 +1185,49 @@ gboolean document_interface_selection_box(DocumentInterface * /*object*/, int /* } gboolean -document_interface_selection_invert (DocumentInterface *object, GError **error) +document_interface_selection_invert (DocumentInterface *doc_interface, GError **error) { - return dbus_call_verb (object, SP_VERB_EDIT_INVERT, error); + return dbus_call_verb (doc_interface, SP_VERB_EDIT_INVERT, error); } gboolean -document_interface_selection_group (DocumentInterface *object, GError **error) +document_interface_selection_group (DocumentInterface *doc_interface, GError **error) { - return dbus_call_verb (object, SP_VERB_SELECTION_GROUP, error); + return dbus_call_verb (doc_interface, SP_VERB_SELECTION_GROUP, error); } gboolean -document_interface_selection_ungroup (DocumentInterface *object, GError **error) +document_interface_selection_ungroup (DocumentInterface *doc_interface, GError **error) { - return dbus_call_verb (object, SP_VERB_SELECTION_UNGROUP, error); + return dbus_call_verb (doc_interface, SP_VERB_SELECTION_UNGROUP, error); } gboolean -document_interface_selection_cut (DocumentInterface *object, GError **error) +document_interface_selection_cut (DocumentInterface *doc_interface, GError **error) { - SPDesktop *desk = object->doc_context.getDesktop(); + SPDesktop *desk = doc_interface->target.getDesktop(); g_return_val_if_fail(ensure_desktop_valid(desk, error), FALSE); - return dbus_call_verb (object, SP_VERB_EDIT_CUT, error); + return dbus_call_verb (doc_interface, SP_VERB_EDIT_CUT, error); } gboolean -document_interface_selection_copy (DocumentInterface *object, GError **error) +document_interface_selection_copy (DocumentInterface *doc_interface, GError **error) { - SPDesktop *desk = object->doc_context.getDesktop(); + SPDesktop *desk = doc_interface->target.getDesktop(); g_return_val_if_fail(ensure_desktop_valid(desk, error), FALSE); - return dbus_call_verb (object, SP_VERB_EDIT_COPY, error); + return dbus_call_verb (doc_interface, SP_VERB_EDIT_COPY, error); } gboolean -document_interface_selection_paste (DocumentInterface *object, GError **error) +document_interface_selection_paste (DocumentInterface *doc_interface, GError **error) { - SPDesktop *desk = object->doc_context.getDesktop(); + SPDesktop *desk = doc_interface->target.getDesktop(); g_return_val_if_fail(ensure_desktop_valid(desk, error), FALSE); - return dbus_call_verb (object, SP_VERB_EDIT_PASTE, error); + return dbus_call_verb (doc_interface, SP_VERB_EDIT_PASTE, error); } -gboolean document_interface_selection_scale(DocumentInterface *object, gdouble grow, GError ** /*error*/) +gboolean document_interface_selection_scale(DocumentInterface *doc_interface, gdouble grow, GError ** /*error*/) { - Inkscape::Selection *selection = object->doc_context.getSelection(); + Inkscape::Selection *selection = doc_interface->target.getSelection(); if (!selection) { return FALSE; @@ -1236,15 +1236,15 @@ gboolean document_interface_selection_scale(DocumentInterface *object, gdouble g return TRUE; } -gboolean document_interface_selection_move(DocumentInterface *object, gdouble x, gdouble y, GError ** /*error*/) +gboolean document_interface_selection_move(DocumentInterface *doc_interface, gdouble x, gdouble y, GError ** /*error*/) { - sp_selection_move(object->doc_context.getSelection(), x, 0 - y); //switching coordinate systems. + sp_selection_move(doc_interface->target.getSelection(), x, 0 - y); //switching coordinate systems. return TRUE; } -gboolean document_interface_selection_move_to(DocumentInterface *object, gdouble x, gdouble y, GError ** /*error*/) +gboolean document_interface_selection_move_to(DocumentInterface *doc_interface, gdouble x, gdouble y, GError ** /*error*/) { - Inkscape::Selection * sel = object->doc_context.getSelection(); + Inkscape::Selection * sel = doc_interface->target.getSelection(); Geom::OptRect sel_bbox = sel->visualBounds(); if (sel_bbox) { @@ -1258,19 +1258,19 @@ gboolean document_interface_selection_move_to(DocumentInterface *object, gdouble // This needs to use lower level cut_impl and paste_impl (messy) // See the built-in sp_selection_to_next_layer and duplicate. gboolean -document_interface_selection_move_to_layer (DocumentInterface *object, +document_interface_selection_move_to_layer (DocumentInterface *doc_interface, gchar *layerstr, GError **error) { - SPDesktop *dt = object->doc_context.getDesktop(); + SPDesktop *dt = doc_interface->target.getDesktop(); g_return_val_if_fail(ensure_desktop_valid(dt, error), FALSE); - Inkscape::Selection *selection = object->doc_context.getSelection(); + Inkscape::Selection *selection = doc_interface->target.getSelection(); // check if something is selected if (selection->isEmpty()) return FALSE; - SPObject *next = get_object_by_name(object->doc_context.getDocument(), layerstr, error); + SPObject *next = get_object_by_name(doc_interface->target.getDocument(), layerstr, error); if (!next) return FALSE; @@ -1279,7 +1279,7 @@ document_interface_selection_move_to_layer (DocumentInterface *object, sp_selection_cut(dt); - object->doc_context.getSelection()->layers()->setCurrentLayer(next); + doc_interface->target.getSelection()->layers()->setCurrentLayer(next); sp_selection_paste(dt, TRUE); } @@ -1287,9 +1287,9 @@ document_interface_selection_move_to_layer (DocumentInterface *object, } GArray * -document_interface_selection_get_center (DocumentInterface *object) +document_interface_selection_get_center (DocumentInterface *doc_interface) { - Inkscape::Selection * sel = object->doc_context.getSelection(); + Inkscape::Selection * sel = doc_interface->target.getSelection(); if (sel) { @@ -1306,46 +1306,46 @@ document_interface_selection_get_center (DocumentInterface *object) } gboolean -document_interface_selection_to_path (DocumentInterface *object, GError **error) +document_interface_selection_to_path (DocumentInterface *doc_interface, GError **error) { - return dbus_call_verb (object, SP_VERB_OBJECT_TO_CURVE, error); + return dbus_call_verb (doc_interface, SP_VERB_OBJECT_TO_CURVE, error); } gboolean -document_interface_selection_combine (DocumentInterface *object, gchar *cmd, char ***newpaths, +document_interface_selection_combine (DocumentInterface *doc_interface, gchar *cmd, char ***newpaths, GError **error) { if (strcmp(cmd, "union") == 0) - dbus_call_verb (object, SP_VERB_SELECTION_UNION, error); + dbus_call_verb (doc_interface, SP_VERB_SELECTION_UNION, error); else if (strcmp(cmd, "intersection") == 0) - dbus_call_verb (object, SP_VERB_SELECTION_INTERSECT, error); + dbus_call_verb (doc_interface, SP_VERB_SELECTION_INTERSECT, error); else if (strcmp(cmd, "difference") == 0) - dbus_call_verb (object, SP_VERB_SELECTION_DIFF, error); + dbus_call_verb (doc_interface, SP_VERB_SELECTION_DIFF, error); else if (strcmp(cmd, "exclusion") == 0) - dbus_call_verb (object, SP_VERB_SELECTION_SYMDIFF, error); + dbus_call_verb (doc_interface, SP_VERB_SELECTION_SYMDIFF, error); else if (strcmp(cmd, "division") == 0) - dbus_call_verb (object, SP_VERB_SELECTION_CUT, error); + dbus_call_verb (doc_interface, SP_VERB_SELECTION_CUT, error); else { g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Operation command not recognised"); return FALSE; } - return document_interface_selection_get (object, newpaths, error); + return document_interface_selection_get (doc_interface, newpaths, error); } gboolean -document_interface_selection_change_level (DocumentInterface *object, gchar *cmd, +document_interface_selection_change_level (DocumentInterface *doc_interface, gchar *cmd, GError **error) { if (strcmp(cmd, "raise") == 0) - return dbus_call_verb (object, SP_VERB_SELECTION_RAISE, error); + return dbus_call_verb (doc_interface, SP_VERB_SELECTION_RAISE, error); if (strcmp(cmd, "lower") == 0) - return dbus_call_verb (object, SP_VERB_SELECTION_LOWER, error); + return dbus_call_verb (doc_interface, SP_VERB_SELECTION_LOWER, error); if ((strcmp(cmd, "to_top") == 0) || (strcmp(cmd, "to_front") == 0)) - return dbus_call_verb (object, SP_VERB_SELECTION_TO_FRONT, error); + return dbus_call_verb (doc_interface, SP_VERB_SELECTION_TO_FRONT, error); if ((strcmp(cmd, "to_bottom") == 0) || (strcmp(cmd, "to_back") == 0)) - return dbus_call_verb (object, SP_VERB_SELECTION_TO_BACK, error); + return dbus_call_verb (doc_interface, SP_VERB_SELECTION_TO_BACK, error); return TRUE; } @@ -1353,58 +1353,58 @@ document_interface_selection_change_level (DocumentInterface *object, gchar *cmd LAYER FUNCTIONS ****************************************************************************/ -gchar *document_interface_layer_new(DocumentInterface *object, GError ** /*error*/) +gchar *document_interface_layer_new(DocumentInterface *doc_interface, GError ** /*error*/) { - Inkscape::LayerModel * layers = object->doc_context.getSelection()->layers(); + Inkscape::LayerModel * layers = doc_interface->target.getSelection()->layers(); SPObject *new_layer = Inkscape::create_layer(layers->currentRoot(), layers->currentLayer(), Inkscape::LPOS_BELOW); layers->setCurrentLayer(new_layer); return g_strdup(get_name_from_object(new_layer)); } gboolean -document_interface_layer_set (DocumentInterface *object, +document_interface_layer_set (DocumentInterface *doc_interface, gchar *layerstr, GError **error) { - SPObject * obj = get_object_by_name (object->doc_context.getDocument(), layerstr, error); + SPObject * obj = get_object_by_name (doc_interface->target.getDocument(), layerstr, error); if (!obj) return FALSE; - object->doc_context.getSelection()->layers()->setCurrentLayer (obj); + doc_interface->target.getSelection()->layers()->setCurrentLayer (obj); return TRUE; } -gchar **document_interface_layer_get_all(DocumentInterface * /*object*/) +gchar **document_interface_layer_get_all(DocumentInterface * /*doc_interface*/) { //FIXME: implement. return NULL; } gboolean -document_interface_layer_change_level (DocumentInterface *object, +document_interface_layer_change_level (DocumentInterface *doc_interface, gchar *cmd, GError **error) { if (strcmp(cmd, "raise") == 0) - return dbus_call_verb (object, SP_VERB_LAYER_RAISE, error); + return dbus_call_verb (doc_interface, SP_VERB_LAYER_RAISE, error); if (strcmp(cmd, "lower") == 0) - return dbus_call_verb (object, SP_VERB_LAYER_LOWER, error); + return dbus_call_verb (doc_interface, SP_VERB_LAYER_LOWER, error); if ((strcmp(cmd, "to_top") == 0) || (strcmp(cmd, "to_front") == 0)) - return dbus_call_verb (object, SP_VERB_LAYER_TO_TOP, error); + return dbus_call_verb (doc_interface, SP_VERB_LAYER_TO_TOP, error); if ((strcmp(cmd, "to_bottom") == 0) || (strcmp(cmd, "to_back") == 0)) - return dbus_call_verb (object, SP_VERB_LAYER_TO_BOTTOM, error); + return dbus_call_verb (doc_interface, SP_VERB_LAYER_TO_BOTTOM, error); return TRUE; } gboolean -document_interface_layer_next (DocumentInterface *object, GError **error) +document_interface_layer_next (DocumentInterface *doc_interface, GError **error) { - return dbus_call_verb (object, SP_VERB_LAYER_NEXT, error); + return dbus_call_verb (doc_interface, SP_VERB_LAYER_NEXT, error); } gboolean -document_interface_layer_previous (DocumentInterface *object, GError **error) +document_interface_layer_previous (DocumentInterface *doc_interface, GError **error) { - return dbus_call_verb (object, SP_VERB_LAYER_PREV, error); + return dbus_call_verb (doc_interface, SP_VERB_LAYER_PREV, error); } @@ -1423,9 +1423,9 @@ gboolean dbus_send_ping (SPDesktop* desk, SPItem *item) gboolean -document_interface_get_children (DocumentInterface *object, char *name, char ***out, GError **error) +document_interface_get_children (DocumentInterface *doc_interface, char *name, char ***out, GError **error) { - SPItem* parent=(SPItem* )get_object_by_name(object->doc_context.getDocument(), name, error); + SPItem* parent=(SPItem* )get_object_by_name(doc_interface->target.getDocument(), name, error); GSList const *children = parent->childList(false); @@ -1446,9 +1446,9 @@ document_interface_get_children (DocumentInterface *object, char *name, char ** gchar* -document_interface_get_parent (DocumentInterface *object, char *name, GError **error) +document_interface_get_parent (DocumentInterface *doc_interface, char *name, GError **error) { - SPItem* node=(SPItem* )get_object_by_name(object->doc_context.getDocument(), name, error); + SPItem* node=(SPItem* )get_object_by_name(doc_interface->target.getDocument(), name, error); SPObject* parent=node->parent; @@ -1459,8 +1459,8 @@ document_interface_get_parent (DocumentInterface *object, char *name, GError ** #if 0 //just pseudo code gboolean -document_interface_get_xpath (DocumentInterface *object, char *xpath_expression, char ***out, GError **error){ - SPDocument * doc = object->doc_context.getDocument(); +document_interface_get_xpath (DocumentInterface *doc_interface, char *xpath_expression, char ***out, GError **error){ + SPDocument * doc = doc_interface->target.getDocument(); Inkscape::XML::Document *repr = doc->getReprDoc(); xmlXPathObjectPtr xpathObj; diff --git a/src/extension/dbus/document-interface.h b/src/extension/dbus/document-interface.h index f90fe7c80..00d964f36 100644 --- a/src/extension/dbus/document-interface.h +++ b/src/extension/dbus/document-interface.h @@ -52,7 +52,7 @@ typedef struct _DocumentInterfaceClass DocumentInterfaceClass; struct _DocumentInterface { GObject parent; - Inkscape::ActionContext doc_context; ///< stores information about which document, selection, desktop etc this interface is linked to + Inkscape::ActionContext target; ///< stores information about which document, selection, desktop etc this interface is linked to gboolean updates; }; @@ -71,10 +71,10 @@ struct DBUSPoint { ****************************************************************************/ gboolean -document_interface_delete_all (DocumentInterface *object, GError **error); +document_interface_delete_all (DocumentInterface *doc_interface, GError **error); gboolean -document_interface_call_verb (DocumentInterface *object, +document_interface_call_verb (DocumentInterface *doc_interface, gchar *verbid, GError **error); /**************************************************************************** @@ -82,48 +82,48 @@ document_interface_call_verb (DocumentInterface *object, ****************************************************************************/ gchar* -document_interface_rectangle (DocumentInterface *object, int x, int y, +document_interface_rectangle (DocumentInterface *doc_interface, int x, int y, int width, int height, GError **error); gchar* -document_interface_ellipse (DocumentInterface *object, int x, int y, +document_interface_ellipse (DocumentInterface *doc_interface, int x, int y, int width, int height, GError **error); gchar* -document_interface_polygon (DocumentInterface *object, int cx, int cy, +document_interface_polygon (DocumentInterface *doc_interface, int cx, int cy, int radius, int rotation, int sides, GError **error); gchar* -document_interface_star (DocumentInterface *object, int cx, int cy, +document_interface_star (DocumentInterface *doc_interface, int cx, int cy, int r1, int r2, int sides, gdouble rounded, gdouble arg1, gdouble arg2, GError **error); gchar* -document_interface_spiral (DocumentInterface *object, int cx, int cy, +document_interface_spiral (DocumentInterface *doc_interface, int cx, int cy, int r, int revolutions, GError **error); gchar* -document_interface_line (DocumentInterface *object, int x, int y, +document_interface_line (DocumentInterface *doc_interface, int x, int y, int x2, int y2, GError **error); gchar* -document_interface_text (DocumentInterface *object, int x, int y, +document_interface_text (DocumentInterface *doc_interface, int x, int y, gchar *text, GError **error); gboolean -document_interface_set_text (DocumentInterface *object, gchar *name, +document_interface_set_text (DocumentInterface *doc_interface, gchar *name, gchar *text, GError **error); gboolean -document_interface_text_apply_style (DocumentInterface *object, gchar *name, +document_interface_text_apply_style (DocumentInterface *doc_interface, gchar *name, int start_pos, int end_pos, gchar *style, gchar *styleval, GError **error); gchar * -document_interface_image (DocumentInterface *object, int x, int y, +document_interface_image (DocumentInterface *doc_interface, int x, int y, gchar *filename, GError **error); gchar* -document_interface_node (DocumentInterface *object, gchar *svgtype, +document_interface_node (DocumentInterface *doc_interface, gchar *svgtype, GError **error); @@ -131,27 +131,27 @@ document_interface_node (DocumentInterface *object, gchar *svgtype, ENVIORNMENT FUNCTIONS ****************************************************************************/ gdouble -document_interface_document_get_width (DocumentInterface *object); +document_interface_document_get_width (DocumentInterface *doc_interface); gdouble -document_interface_document_get_height (DocumentInterface *object); +document_interface_document_get_height (DocumentInterface *doc_interface); gchar * -document_interface_document_get_css (DocumentInterface *object, GError **error); +document_interface_document_get_css (DocumentInterface *doc_interface, GError **error); gboolean -document_interface_document_merge_css (DocumentInterface *object, +document_interface_document_merge_css (DocumentInterface *doc_interface, gchar *stylestring, GError **error); gboolean -document_interface_document_set_css (DocumentInterface *object, +document_interface_document_set_css (DocumentInterface *doc_interface, gchar *stylestring, GError **error); gboolean -document_interface_document_resize_to_fit_selection (DocumentInterface *object, +document_interface_document_resize_to_fit_selection (DocumentInterface *doc_interface, GError **error); gboolean -document_interface_document_set_display_area (DocumentInterface *object, +document_interface_document_set_display_area (DocumentInterface *doc_interface, double x0, double y0, double x1, @@ -159,95 +159,95 @@ document_interface_document_set_display_area (DocumentInterface *object, double border, GError **error); GArray * -document_interface_document_get_display_area (DocumentInterface *object); +document_interface_document_get_display_area (DocumentInterface *doc_interface); /**************************************************************************** OBJECT FUNCTIONS ****************************************************************************/ gboolean -document_interface_set_attribute (DocumentInterface *object, +document_interface_set_attribute (DocumentInterface *doc_interface, char *shape, char *attribute, char *newval, GError **error); gboolean -document_interface_set_int_attribute (DocumentInterface *object, +document_interface_set_int_attribute (DocumentInterface *doc_interface, char *shape, char *attribute, int newval, GError **error); gboolean -document_interface_set_double_attribute (DocumentInterface *object, +document_interface_set_double_attribute (DocumentInterface *doc_interface, char *shape, char *attribute, double newval, GError **error); gchar * -document_interface_get_attribute (DocumentInterface *object, +document_interface_get_attribute (DocumentInterface *doc_interface, char *shape, char *attribute, GError **error); gboolean -document_interface_move (DocumentInterface *object, gchar *name, +document_interface_move (DocumentInterface *doc_interface, gchar *name, gdouble x, gdouble y, GError **error); gboolean -document_interface_move_to (DocumentInterface *object, gchar *name, +document_interface_move_to (DocumentInterface *doc_interface, gchar *name, gdouble x, gdouble y, GError **error); gboolean -document_interface_object_to_path (DocumentInterface *object, +document_interface_object_to_path (DocumentInterface *doc_interface, char *shape, GError **error); gchar * -document_interface_get_path (DocumentInterface *object, +document_interface_get_path (DocumentInterface *doc_interface, char *pathname, GError **error); gboolean -document_interface_transform (DocumentInterface *object, gchar *shape, +document_interface_transform (DocumentInterface *doc_interface, gchar *shape, gchar *transformstr, GError **error); gchar * -document_interface_get_css (DocumentInterface *object, gchar *shape, +document_interface_get_css (DocumentInterface *doc_interface, gchar *shape, GError **error); gboolean -document_interface_modify_css (DocumentInterface *object, gchar *shape, +document_interface_modify_css (DocumentInterface *doc_interface, gchar *shape, gchar *cssattrb, gchar *newval, GError **error); gboolean -document_interface_merge_css (DocumentInterface *object, gchar *shape, +document_interface_merge_css (DocumentInterface *doc_interface, gchar *shape, gchar *stylestring, GError **error); gboolean -document_interface_set_color (DocumentInterface *object, gchar *shape, +document_interface_set_color (DocumentInterface *doc_interface, gchar *shape, int r, int g, int b, gboolean fill, GError **error); gboolean -document_interface_move_to_layer (DocumentInterface *object, gchar *shape, +document_interface_move_to_layer (DocumentInterface *doc_interface, gchar *shape, gchar *layerstr, GError **error); GArray * -document_interface_get_node_coordinates (DocumentInterface *object, gchar *shape); +document_interface_get_node_coordinates (DocumentInterface *doc_interface, gchar *shape); /**************************************************************************** FILE I/O FUNCTIONS ****************************************************************************/ gboolean -document_interface_save (DocumentInterface *object, GError **error); +document_interface_save (DocumentInterface *doc_interface, GError **error); gboolean -document_interface_load (DocumentInterface *object, +document_interface_load (DocumentInterface *doc_interface, gchar *filename, GError **error); gboolean -document_interface_save_as (DocumentInterface *object, +document_interface_save_as (DocumentInterface *doc_interface, const gchar *filename, GError **error); gboolean -document_interface_mark_as_unmodified (DocumentInterface *object, GError **error); +document_interface_mark_as_unmodified (DocumentInterface *doc_interface, GError **error); /* gboolean -document_interface_print_to_file (DocumentInterface *object, GError **error); +document_interface_print_to_file (DocumentInterface *doc_interface, GError **error); */ /**************************************************************************** @@ -255,120 +255,120 @@ document_interface_print_to_file (DocumentInterface *object, GError **error); ****************************************************************************/ gboolean -document_interface_close (DocumentInterface *object, GError **error); +document_interface_close (DocumentInterface *doc_interface, GError **error); gboolean -document_interface_exit (DocumentInterface *object, GError **error); +document_interface_exit (DocumentInterface *doc_interface, GError **error); gboolean -document_interface_undo (DocumentInterface *object, GError **error); +document_interface_undo (DocumentInterface *doc_interface, GError **error); gboolean -document_interface_redo (DocumentInterface *object, GError **error); +document_interface_redo (DocumentInterface *doc_interface, GError **error); /**************************************************************************** UPDATE FUNCTIONS ****************************************************************************/ void -document_interface_pause_updates (DocumentInterface *object, GError **error); +document_interface_pause_updates (DocumentInterface *doc_interface, GError **error); void -document_interface_resume_updates (DocumentInterface *object, GError **error); +document_interface_resume_updates (DocumentInterface *doc_interface, GError **error); void -document_interface_update (DocumentInterface *object, GError **error); +document_interface_update (DocumentInterface *doc_interface, GError **error); /**************************************************************************** SELECTION FUNCTIONS ****************************************************************************/ gboolean -document_interface_selection_get (DocumentInterface *object, char ***out, GError **error); +document_interface_selection_get (DocumentInterface *doc_interface, char ***out, GError **error); gboolean -document_interface_selection_add (DocumentInterface *object, +document_interface_selection_add (DocumentInterface *doc_interface, char *name, GError **error); gboolean -document_interface_selection_add_list (DocumentInterface *object, +document_interface_selection_add_list (DocumentInterface *doc_interface, char **names, GError **error); gboolean -document_interface_selection_set (DocumentInterface *object, +document_interface_selection_set (DocumentInterface *doc_interface, char *name, GError **error); gboolean -document_interface_selection_set_list (DocumentInterface *object, +document_interface_selection_set_list (DocumentInterface *doc_interface, gchar **names, GError **error); gboolean -document_interface_selection_rotate (DocumentInterface *object, +document_interface_selection_rotate (DocumentInterface *doc_interface, int angle, GError **error); gboolean -document_interface_selection_delete(DocumentInterface *object, GError **error); +document_interface_selection_delete(DocumentInterface *doc_interface, GError **error); gboolean -document_interface_selection_clear(DocumentInterface *object, GError **error); +document_interface_selection_clear(DocumentInterface *doc_interface, GError **error); gboolean -document_interface_select_all(DocumentInterface *object, GError **error); +document_interface_select_all(DocumentInterface *doc_interface, GError **error); gboolean -document_interface_select_all_in_all_layers(DocumentInterface *object, +document_interface_select_all_in_all_layers(DocumentInterface *doc_interface, GError **error); gboolean -document_interface_selection_box (DocumentInterface *object, int x, int y, +document_interface_selection_box (DocumentInterface *doc_interface, int x, int y, int x2, int y2, gboolean replace, GError **error); gboolean -document_interface_selection_invert (DocumentInterface *object, GError **error); +document_interface_selection_invert (DocumentInterface *doc_interface, GError **error); gboolean -document_interface_selection_group(DocumentInterface *object, GError **error); +document_interface_selection_group(DocumentInterface *doc_interface, GError **error); gboolean -document_interface_selection_ungroup(DocumentInterface *object, GError **error); +document_interface_selection_ungroup(DocumentInterface *doc_interface, GError **error); gboolean -document_interface_selection_cut(DocumentInterface *object, GError **error); +document_interface_selection_cut(DocumentInterface *doc_interface, GError **error); gboolean -document_interface_selection_copy(DocumentInterface *object, GError **error); +document_interface_selection_copy(DocumentInterface *doc_interface, GError **error); gboolean -document_interface_selection_paste(DocumentInterface *object, GError **error); +document_interface_selection_paste(DocumentInterface *doc_interface, GError **error); gboolean -document_interface_selection_scale (DocumentInterface *object, +document_interface_selection_scale (DocumentInterface *doc_interface, gdouble grow, GError **error); gboolean -document_interface_selection_move (DocumentInterface *object, gdouble x, +document_interface_selection_move (DocumentInterface *doc_interface, gdouble x, gdouble y, GError **error); gboolean -document_interface_selection_move_to (DocumentInterface *object, gdouble x, +document_interface_selection_move_to (DocumentInterface *doc_interface, gdouble x, gdouble y, GError **error); gboolean -document_interface_selection_move_to_layer (DocumentInterface *object, +document_interface_selection_move_to_layer (DocumentInterface *doc_interface, gchar *layerstr, GError **error); GArray * -document_interface_selection_get_center (DocumentInterface *object); +document_interface_selection_get_center (DocumentInterface *doc_interface); gboolean -document_interface_selection_to_path (DocumentInterface *object, GError **error); +document_interface_selection_to_path (DocumentInterface *doc_interface, GError **error); gboolean -document_interface_selection_combine (DocumentInterface *object, gchar *cmd, char ***newpaths, +document_interface_selection_combine (DocumentInterface *doc_interface, gchar *cmd, char ***newpaths, GError **error); gboolean -document_interface_selection_change_level (DocumentInterface *object, gchar *cmd, +document_interface_selection_change_level (DocumentInterface *doc_interface, gchar *cmd, GError **error); /**************************************************************************** @@ -376,24 +376,24 @@ document_interface_selection_change_level (DocumentInterface *object, gchar *cmd ****************************************************************************/ gchar * -document_interface_layer_new (DocumentInterface *object, GError **error); +document_interface_layer_new (DocumentInterface *doc_interface, GError **error); gboolean -document_interface_layer_set (DocumentInterface *object, +document_interface_layer_set (DocumentInterface *doc_interface, gchar *layerstr, GError **error); gchar ** -document_interface_layer_get_all (DocumentInterface *object); +document_interface_layer_get_all (DocumentInterface *doc_interface); gboolean -document_interface_layer_change_level (DocumentInterface *object, +document_interface_layer_change_level (DocumentInterface *doc_interface, gchar *cmd, GError **error); gboolean -document_interface_layer_next (DocumentInterface *object, GError **error); +document_interface_layer_next (DocumentInterface *doc_interface, GError **error); gboolean -document_interface_layer_previous (DocumentInterface *object, GError **error); +document_interface_layer_previous (DocumentInterface *doc_interface, GError **error); @@ -409,13 +409,13 @@ extern DocumentInterface *fugly; gboolean dbus_send_ping (SPDesktop* desk, SPItem *item); gboolean -document_interface_get_children (DocumentInterface *object, char *name, char ***out, GError **error); +document_interface_get_children (DocumentInterface *doc_interface, char *name, char ***out, GError **error); gchar* -document_interface_get_parent (DocumentInterface *object, char *name, GError **error); +document_interface_get_parent (DocumentInterface *doc_interface, char *name, GError **error); gchar* -document_interface_import (DocumentInterface *object, +document_interface_import (DocumentInterface *doc_interface, gchar *filename, GError **error); G_END_DECLS diff --git a/src/inkscape-private.h b/src/inkscape-private.h index 09bcef12b..364e3dab6 100644 --- a/src/inkscape-private.h +++ b/src/inkscape-private.h @@ -48,8 +48,6 @@ void inkscape_add_desktop (SPDesktop * desktop); void inkscape_remove_desktop (SPDesktop * desktop); void inkscape_activate_desktop (SPDesktop * desktop); void inkscape_reactivate_desktop (SPDesktop * desktop); -void inkscape_add_document (SPDocument *document); -bool inkscape_remove_document (SPDocument *document); void inkscape_set_color (SPColor *color, float opacity); diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 2e60ee5ea..a24bd2b8a 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -1359,7 +1359,22 @@ inkscape_active_action_context() if (!doc) { return Inkscape::ActionContext(); } - + + return inkscape_action_context_for_document(doc); +} + +Inkscape::ActionContext +inkscape_action_context_for_document(SPDocument *doc) +{ + // If there are desktops, check them first to see if the document is bound to one of them + for (GSList *iter = inkscape->desktops ; iter ; iter = iter->next) { + SPDesktop *desktop=static_cast(iter->data); + if (desktop->doc() == doc) { + return Inkscape::ActionContext(desktop); + } + } + + // Document is not associated with any desktops - maybe we're in command-line mode std::map::iterator sel_iter = inkscape->selection_models.find(doc); if (sel_iter == inkscape->selection_models.end()) { return Inkscape::ActionContext(); diff --git a/src/inkscape.h b/src/inkscape.h index cb6ba6a0f..234b98d2c 100644 --- a/src/inkscape.h +++ b/src/inkscape.h @@ -57,6 +57,11 @@ SPDocument * inkscape_active_document (void); #define SP_ACTIVE_DESKTOP inkscape_active_desktop () SPDesktop * inkscape_active_desktop (void); +// Use this function to get selection model etc for a document, if possible! +// The "active" alternative below has all the horrible static cling of a singleton. +Inkscape::ActionContext +inkscape_action_context_for_document(SPDocument *doc); + // More horrible static cling... sorry about this. Should really replace all of // the static stuff with a single instance of some kind of engine class holding // all the document / non-GUI stuff, and an optional GUI class that behaves a @@ -85,6 +90,11 @@ void inkscape_dialogs_toggle (); void inkscape_external_change (); void inkscape_subselection_changed (SPDesktop *desktop); +/* Moved document add/remove functions into public inkscape.h as they are used + (rightly or wrongly) by console-mode functions */ +void inkscape_add_document (SPDocument *document); +bool inkscape_remove_document (SPDocument *document); + /* * fixme: This has to be rethought */ -- cgit v1.2.3 From c165601973334cdb21088219a3cb9d0a20abb181 Mon Sep 17 00:00:00 2001 From: Eric Greveson Date: Thu, 4 Jul 2013 23:57:15 +0100 Subject: Fix for builds without --enable-dbusapi (missing #ifdef) (bzr r12387.1.9) --- src/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 630411dde..ba51951da 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1277,7 +1277,11 @@ int sp_main_console(int argc, char const **argv) int retVal = sp_common_main( argc, argv, &fl ); g_return_val_if_fail(retVal == 0, 1); - if (fl == NULL && !sp_shell && !sp_dbus_listen) { + if (fl == NULL && !sp_shell +#ifdef WITH_DBUS + && !sp_dbus_listen +#endif // WITH_DBUS + ) { g_print("Nothing to do!\n"); exit(0); } -- cgit v1.2.3 From 6c31882fb2319fcbfbc3e17ac368deac2edd2e79 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Thu, 4 Jul 2013 18:58:42 -0400 Subject: Improve handle xpm loading using rotate (bzr r12401.1.1) --- src/pixmaps/handles.xpm | 178 ++--------------------------------- src/select-context.cpp | 30 +++--- src/seltrans-handles.cpp | 14 +-- src/ui/tool/transform-handle-set.cpp | 12 +-- 4 files changed, 38 insertions(+), 196 deletions(-) (limited to 'src') diff --git a/src/pixmaps/handles.xpm b/src/pixmaps/handles.xpm index f2afa026b..b61ad377c 100644 --- a/src/pixmaps/handles.xpm +++ b/src/pixmaps/handles.xpm @@ -1,5 +1,5 @@ -/* XPM */ -static char const *handle_scale_nw_xpm[] = { +/* XPM North-West */ +static char const *handle_scale_xpm[] = { "13 13 3 1", " c None", ". c #000000", @@ -18,28 +18,8 @@ static char const *handle_scale_nw_xpm[] = { " ....... ", " "}; -/* XPM */ -static char const *handle_scale_ne_xpm[] = { -"13 13 3 1", -" c None", -". c #000000", -"+ c #FFFFFF", -" ", -" ....... ", -" ..+++. ", -" .++++. ", -" .+++++. ", -" . .+++++.. ", -" ...+++++... ", -" ..+++++. . ", -" .+++++. ", -" .++++. ", -" .+++.. ", -" ....... ", -" "}; - -/* XPM */ -static char const *handle_scale_h_xpm[] = { +/* XPM Vertical */ +static char const *handle_stretch_xpm[] = { "13 13 3 1", " c None", ". c #000000", @@ -58,28 +38,8 @@ static char const *handle_scale_h_xpm[] = { " ", " "}; -/* XPM */ -static char const *handle_scale_v_xpm[] = { -"13 13 3 1", -" c None", -". c #000000", -"+ c #FFFFFF", -" . ", -" ... ", -" ..+.. ", -" ..+++.. ", -" ..+++++.. ", -" .+++. ", -" .+++. ", -" .+++. ", -" ..+++++.. ", -" ..+++.. ", -" ..+.. ", -" ... ", -" . "}; - -/* XPM */ -static char const *handle_rotate_nw_xpm[] = { +/* XPM North-West */ +static char const *handle_rotate_xpm[] = { "13 13 3 1", " c None", ". c #000000", @@ -98,8 +58,8 @@ static char const *handle_rotate_nw_xpm[] = { " ... ", " . "}; -/* XPM */ -static char const *handle_rotate_n_xpm[] = { +/* XPM North */ +static char const *handle_skew_xpm[] = { "13 13 3 1", " c None", ". c #000000", @@ -118,127 +78,6 @@ static char const *handle_rotate_n_xpm[] = { " ", " "}; -/* XPM */ -static char const *handle_rotate_ne_xpm[] = { -"13 13 3 1", -" c None", -". c #000000", -"+ c #FFFFFF", -" . ", -" .. ", -" .... ", -" ..++... ", -"..++++++. ", -" .+++++++. ", -" .+..++++. ", -" . .+++. ", -" .+++...", -" .++++.. ", -" .++.. ", -" ... ", -" . "}; - -/* XPM */ -static char const *handle_rotate_e_xpm[] = { -"13 13 3 1", -" c None", -". c #000000", -"+ c #FFFFFF", -" . ", -" ... ", -" ..+.. ", -" ..+++.. ", -" ...+++...", -" .+++. ", -" .+++. ", -" .+++. ", -" ...+++...", -" ..+++.. ", -" ..+.. ", -" ... ", -" . "}; - -/* XPM */ -static char const *handle_rotate_se_xpm[] = { -"13 13 3 1", -" c None", -". c #000000", -"+ c #FFFFFF", -" . ", -" ... ", -" .++.. ", -" .++++.. ", -" .+++...", -" . .+++. ", -" .+..++++. ", -" .+++++++. ", -"..++++++. ", -" ..++... ", -" .... ", -" .. ", -" . "}; - - -/* XPM */ -static char const *handle_rotate_s_xpm[] = { -"13 13 3 1", -" c None", -". c #000000", -"+ c #FFFFFF", -" ", -" ", -" ", -" ", -" . . ", -" .. .. ", -" ......... ", -" ..+++++++.. ", -"..+++++++++..", -" ..+++++++.. ", -" ......... ", -" .. .. ", -" . . "}; - -/* XPM */ -static char const *handle_rotate_sw_xpm[] = { -"13 13 3 1", -" c None", -". c #000000", -"+ c #FFFFFF", -" . ", -" ... ", -" ..++. ", -" ..++++. ", -"...+++. ", -" .+++. . ", -" .++++..+. ", -" .+++++++. ", -" .++++++..", -" ...++.. ", -" .... ", -" .. ", -" . "}; - -/* XPM */ -static char const *handle_rotate_w_xpm[] = { -"13 13 3 1", -" c None", -". c #000000", -"+ c #FFFFFF", -" . ", -" ... ", -" ..+.. ", -" ..+++.. ", -"...+++... ", -" .+++. ", -" .+++. ", -" .+++. ", -"...+++. . ", -" ..+++.. ", -" ..+.. ", -" ... ", -" . "}; - /* XPM */ static char const *handle_center_xpm[] = { "13 13 3 1", @@ -258,3 +97,4 @@ static char const *handle_center_xpm[] = { " . ", " . ", " "}; + diff --git a/src/select-context.cpp b/src/select-context.cpp index 1dd3b08d7..6c130ec96 100644 --- a/src/select-context.cpp +++ b/src/select-context.cpp @@ -62,7 +62,7 @@ static void sp_select_context_reset_opacities(SPEventContext *event_context); static GdkCursor *CursorSelectMouseover = NULL; static GdkCursor *CursorSelectDragging = NULL; -GdkPixbuf *handles[13]; +GdkPixbuf *handles[18]; static gint rb_escaped = 0; // if non-zero, rubberband was canceled by esc, so the next button release should not deselect static gint drag_escaped = 0; // if non-zero, drag was canceled by esc @@ -91,6 +91,16 @@ sp_select_context_class_init(SPSelectContextClass *klass) event_context_class->item_handler = sp_select_context_item_handler; } +//Creates rotated variations for handles +static void +sp_load_handles(int start, int count, char const **xpm) { + handles[start] = gdk_pixbuf_new_from_xpm_data((gchar const **)xpm); + for(int i = start + 1; i < start + count; i++) { + // We use either the original at *start or previous loop item to rotate + handles[i] = gdk_pixbuf_rotate_simple(handles[i-1], GDK_PIXBUF_ROTATE_CLOCKWISE); + } +} + static void sp_select_context_init(SPSelectContext *sc) { @@ -111,19 +121,11 @@ sp_select_context_init(SPSelectContext *sc) CursorSelectMouseover = sp_cursor_new_from_xpm(cursor_select_m_xpm , 1, 1); CursorSelectDragging = sp_cursor_new_from_xpm(cursor_select_d_xpm , 1, 1); // selection handles - handles[0] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_scale_nw_xpm); - handles[1] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_scale_ne_xpm); - handles[2] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_scale_h_xpm); - handles[3] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_scale_v_xpm); - handles[4] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_nw_xpm); - handles[5] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_n_xpm); - handles[6] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_ne_xpm); - handles[7] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_e_xpm); - handles[8] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_se_xpm); - handles[9] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_s_xpm); - handles[10] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_sw_xpm); - handles[11] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_w_xpm); - handles[12] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_center_xpm); + sp_load_handles(0, 2, handle_scale_xpm); + sp_load_handles(2, 2, handle_stretch_xpm); + sp_load_handles(4, 4, handle_rotate_xpm); + sp_load_handles(8, 4, handle_skew_xpm); + sp_load_handles(12, 1, handle_center_xpm); } static void diff --git a/src/seltrans-handles.cpp b/src/seltrans-handles.cpp index bacb1301e..6dd94d297 100644 --- a/src/seltrans-handles.cpp +++ b/src/seltrans-handles.cpp @@ -16,7 +16,7 @@ SPSelTransTypeInfo const handtypes[] = { SPSelTransHandle const hands[] = { //center handle will be 0 so we can reference it quickly. {HANDLE_CENTER, SP_ANCHOR_CENTER, GDK_CROSSHAIR, 12, 0.5, 0.5}, -//handle-type anchor cursor control x y +//handle-type anchor-nudge cursor image x y {HANDLE_STRETCH, SP_ANCHOR_S, GDK_TOP_SIDE, 3, 0.5, 1}, {HANDLE_STRETCH, SP_ANCHOR_W, GDK_RIGHT_SIDE, 2, 1, 0.5}, {HANDLE_STRETCH, SP_ANCHOR_N, GDK_BOTTOM_SIDE, 3, 0.5, 0}, @@ -25,14 +25,14 @@ SPSelTransHandle const hands[] = { {HANDLE_SCALE, SP_ANCHOR_SW, GDK_TOP_RIGHT_CORNER, 1, 1, 1}, {HANDLE_SCALE, SP_ANCHOR_NW, GDK_BOTTOM_RIGHT_CORNER, 0, 1, 0}, {HANDLE_SCALE, SP_ANCHOR_NE, GDK_BOTTOM_LEFT_CORNER, 1, 0, 0}, - {HANDLE_SKEW, SP_ANCHOR_S, GDK_SB_H_DOUBLE_ARROW, 5, 0.5, 1}, - {HANDLE_SKEW, SP_ANCHOR_W, GDK_SB_V_DOUBLE_ARROW, 7, 1, 0.5}, - {HANDLE_SKEW, SP_ANCHOR_N, GDK_SB_H_DOUBLE_ARROW, 9, 0.5, 0}, + {HANDLE_SKEW, SP_ANCHOR_S, GDK_SB_H_DOUBLE_ARROW, 8, 0.5, 1}, + {HANDLE_SKEW, SP_ANCHOR_W, GDK_SB_V_DOUBLE_ARROW, 9, 1, 0.5}, + {HANDLE_SKEW, SP_ANCHOR_N, GDK_SB_H_DOUBLE_ARROW, 10, 0.5, 0}, {HANDLE_SKEW, SP_ANCHOR_E, GDK_SB_V_DOUBLE_ARROW, 11, 0, 0.5}, {HANDLE_ROTATE, SP_ANCHOR_SE, GDK_EXCHANGE, 4, 0, 1}, - {HANDLE_ROTATE, SP_ANCHOR_SW, GDK_EXCHANGE, 6, 1, 1}, - {HANDLE_ROTATE, SP_ANCHOR_NW, GDK_EXCHANGE, 8, 1, 0}, - {HANDLE_ROTATE, SP_ANCHOR_NE, GDK_EXCHANGE, 10, 0, 0}, + {HANDLE_ROTATE, SP_ANCHOR_SW, GDK_EXCHANGE, 5, 1, 1}, + {HANDLE_ROTATE, SP_ANCHOR_NW, GDK_EXCHANGE, 6, 1, 0}, + {HANDLE_ROTATE, SP_ANCHOR_NE, GDK_EXCHANGE, 7, 0, 0}, }; /* diff --git a/src/ui/tool/transform-handle-set.cpp b/src/ui/tool/transform-handle-set.cpp index f0bf149f4..30963cabd 100644 --- a/src/ui/tool/transform-handle-set.cpp +++ b/src/ui/tool/transform-handle-set.cpp @@ -458,9 +458,9 @@ private: static Glib::RefPtr _corner_to_pixbuf(unsigned c) { sp_select_context_get_type(); switch (c % 4) { - case 0: return Glib::wrap(handles[10], true); - case 1: return Glib::wrap(handles[8], true); - case 2: return Glib::wrap(handles[6], true); + case 0: return Glib::wrap(handles[7], true); + case 1: return Glib::wrap(handles[6], true); + case 2: return Glib::wrap(handles[5], true); default: return Glib::wrap(handles[4], true); } } @@ -605,9 +605,9 @@ private: static Glib::RefPtr _side_to_pixbuf(unsigned s) { sp_select_context_get_type(); switch (s % 4) { - case 0: return Glib::wrap(handles[9], true); - case 1: return Glib::wrap(handles[7], true); - case 2: return Glib::wrap(handles[5], true); + case 0: return Glib::wrap(handles[10], true); + case 1: return Glib::wrap(handles[9], true); + case 2: return Glib::wrap(handles[8], true); default: return Glib::wrap(handles[11], true); } } -- cgit v1.2.3 From c09c9da090325f4f639843510635b1d8f6b39494 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Fri, 5 Jul 2013 08:21:03 -0400 Subject: Adjust sizes of lists (bzr r12401.1.2) --- src/select-context.cpp | 2 +- src/seltrans.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/select-context.cpp b/src/select-context.cpp index 6c130ec96..27667d639 100644 --- a/src/select-context.cpp +++ b/src/select-context.cpp @@ -62,7 +62,7 @@ static void sp_select_context_reset_opacities(SPEventContext *event_context); static GdkCursor *CursorSelectMouseover = NULL; static GdkCursor *CursorSelectDragging = NULL; -GdkPixbuf *handles[18]; +GdkPixbuf *handles[13]; static gint rb_escaped = 0; // if non-zero, rubberband was canceled by esc, so the next button release should not deselect static gint drag_escaped = 0; // if non-zero, drag was canceled by esc diff --git a/src/seltrans.h b/src/seltrans.h index 667dedaf0..880f30c94 100644 --- a/src/seltrans.h +++ b/src/seltrans.h @@ -180,7 +180,7 @@ private: bool _center_is_set; ///< we've already set _center, no need to reread it from items int _center_handle; - SPKnot *knots[27]; // Only some as shown at any time + SPKnot *knots[17]; SPCanvasItem *_norm; SPCanvasItem *_grip; SPCtrlLine *_l[4]; -- cgit v1.2.3 From 4d9dc443915f588d2e3de8dbc9b61ba1cf2e6dee Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Sat, 6 Jul 2013 02:09:21 -0400 Subject: Fix verbs that were out by 5 because of missing script verbs (broken between r7137-r11611) (bzr r12406) --- src/verbs.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/verbs.cpp b/src/verbs.cpp index 1dae8bcf0..d0396155c 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -2903,7 +2903,17 @@ Verb *Verb::_base_verbs[] = { N_("Link an ICC color profile"), NULL), new EditVerb(SP_VERB_EDIT_REMOVE_COLOR_PROFILE, "RemoveColorProfile", N_("Remove Color Profile"), N_("Remove a linked ICC color profile"), NULL), - + // Scripting + new ContextVerb(SP_VERB_EDIT_ADD_EXTERNAL_SCRIPT, "AddExternalScript", + N_("Add External Script"), N_("Add an external script"), NULL), + new ContextVerb(SP_VERB_EDIT_ADD_EMBEDDED_SCRIPT, "AddEmbeddedScript", + N_("Add Embedded Script"), N_("Add an embedded script"), NULL), + new ContextVerb(SP_VERB_EDIT_EMBEDDED_SCRIPT, "EditEmbeddedScript", + N_("Edit Embedded Script"), N_("Edit an embedded script"), NULL), + new ContextVerb(SP_VERB_EDIT_REMOVE_EXTERNAL_SCRIPT, "RemoveExternalScript", + N_("Remove External Script"), N_("Remove an external script"), NULL), + new ContextVerb(SP_VERB_EDIT_REMOVE_EMBEDDED_SCRIPT, "RemoveEmbeddedScript", + N_("Remove Embedded Script"), N_("Remove an embedded script"), NULL), // Align new ContextVerb(SP_VERB_ALIGN_HORIZONTAL_RIGHT_TO_ANCHOR, "AlignHorizontalRightToAnchor", N_("Align right edges of objects to the left edge of the anchor"), N_("Align right edges of objects to the left edge of the anchor"), INKSCAPE_ICON("align-horizontal-right-to-anchor")), -- cgit v1.2.3 From 2a5484afeb64207849e1dcdd9336fd4b0aaab06b Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Sat, 6 Jul 2013 11:19:17 +0100 Subject: Fix build failure with GDL >= 3.6 Fixed bugs: - https://launchpad.net/bugs/1196070 (bzr r12407) --- src/ui/widget/dock.cpp | 20 ++++++++++++++++---- src/ui/widget/dock.h | 10 +++++----- 2 files changed, 21 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/ui/widget/dock.cpp b/src/ui/widget/dock.cpp index 2bfc7e0df..52e9ea605 100644 --- a/src/ui/widget/dock.cpp +++ b/src/ui/widget/dock.cpp @@ -48,11 +48,21 @@ const int Dock::_default_dock_bar_width = 36; Dock::Dock(Gtk::Orientation orientation) - : _gdl_dock (GDL_DOCK (gdl_dock_new())), - _gdl_dock_bar (GDL_DOCK_BAR (gdl_dock_bar_new(GDL_DOCK(_gdl_dock)))), + : _gdl_dock(gdl_dock_new()), +#if WITH_GDL_3_6 + _gdl_dock_bar(GDL_DOCK_BAR(gdl_dock_bar_new(G_OBJECT(_gdl_dock)))), +#else + _gdl_dock_bar(GDL_DOCK_BAR(gdl_dock_bar_new(GDL_DOCK(_gdl_dock)))), +#endif _scrolled_window (Gtk::manage(new Gtk::ScrolledWindow)) { - gdl_dock_bar_set_orientation(_gdl_dock_bar, static_cast(orientation)); +#if WITH_GDL_3_6 + gtk_orientable_set_orientation(GTK_ORIENTABLE(_gdl_dock_bar), + static_cast(orientation)); +#else + gdl_dock_bar_set_orientation(_gdl_dock_bar, + static_cast(orientation)); +#endif #if WITH_GTKMM_3_0 switch(orientation) { @@ -127,7 +137,9 @@ Dock::~Dock() void Dock::addItem(DockItem& item, DockItem::Placement placement) { _dock_items.push_back(&item); - gdl_dock_add_item(_gdl_dock, GDL_DOCK_ITEM(item.gobj()), (GdlDockPlacement)placement); + gdl_dock_add_item(GDL_DOCK(_gdl_dock), + GDL_DOCK_ITEM(item.gobj()), + (GdlDockPlacement)placement); // FIXME: This is a hack to prevent the dock from expanding the main window, this can't be done // initially as the paned doesn't exist. diff --git a/src/ui/widget/dock.h b/src/ui/widget/dock.h index 611c10f46..33e60b836 100644 --- a/src/ui/widget/dock.h +++ b/src/ui/widget/dock.h @@ -74,11 +74,11 @@ protected: /** Interface widgets, will be packed like * _scrolled_window -> (_dock_box -> (_paned -> (_dock -> _filler) | _dock_bar)) */ - Gtk::Box *_dock_box; - Gtk::Paned* _paned; - GdlDock *_gdl_dock; - GdlDockBar *_gdl_dock_bar; - Gtk::VBox _filler; + Gtk::Box *_dock_box; + Gtk::Paned *_paned; + GtkWidget *_gdl_dock; + GdlDockBar *_gdl_dock_bar; + Gtk::VBox _filler; Gtk::ScrolledWindow *_scrolled_window; /** Internal signal handlers */ -- cgit v1.2.3 From dd961a4de274306767c27756e80630d57f75ee0c Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Sat, 6 Jul 2013 10:03:42 -0400 Subject: Ported measure-context.cpp (to do: port widgets/measure-toolbar.cpp so unit selector works again). (bzr r12380.1.6) --- src/measure-context.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/measure-context.cpp b/src/measure-context.cpp index 9d60d38e8..6e7709d56 100644 --- a/src/measure-context.cpp +++ b/src/measure-context.cpp @@ -515,8 +515,13 @@ static gint sp_measure_context_root_handler(SPEventContext *event_context, GdkEv std::sort(intersections.begin(), intersections.end(), GeomPointSortPredicate); } - SPUnitId unitid = static_cast(prefs->getInt("/tools/measure/unitid", SP_UNIT_PX)); - SPUnit unit = sp_unit_get_by_id(unitid); + Inkscape::Util::UnitTable unit_table; + Glib::ustring unit_name = prefs->getString("/tools/measure/unit"); + if (!unit_name.compare("")) { + unit_name = "px"; + } + Inkscape::Util::Unit unit = unit_table.getUnit(unit_name); + Inkscape::Util::Unit px = unit_table.getUnit("px"); double fontsize = prefs->getInt("/tools/measure/fontsize"); @@ -527,7 +532,7 @@ static gint sp_measure_context_root_handler(SPEventContext *event_context, GdkEv for (size_t idx = 1; idx < intersections.size(); ++idx) { LabelPlacement placement; placement.lengthVal = (intersections[idx] - intersections[idx - 1]).length(); - sp_convert_distance(&placement.lengthVal, &sp_unit_get_by_id(SP_UNIT_PX), &unit); + placement.lengthVal = Inkscape::Util::Quantity::convert(placement.lengthVal, &px, &unit); placement.offset = DIMENSION_OFFSET; placement.start = desktop->doc2dt( (intersections[idx - 1] + intersections[idx]) / 2 ); placement.end = placement.start - (normal * placement.offset); @@ -543,7 +548,7 @@ static gint sp_measure_context_root_handler(SPEventContext *event_context, GdkEv LabelPlacement &place = *it; // TODO cleanup memory, Glib::ustring, etc.: - gchar *measure_str = g_strdup_printf("%.2f %s", place.lengthVal, unit.abbr); + gchar *measure_str = g_strdup_printf("%.2f %s", place.lengthVal, unit.abbr.c_str()); SPCanvasText *canvas_tooltip = sp_canvastext_new(sp_desktop_tempgroup(desktop), desktop, place.end, @@ -584,10 +589,10 @@ static gint sp_measure_context_root_handler(SPEventContext *event_context, GdkEv { double totallengthval = (end_point - start_point).length(); - sp_convert_distance(&totallengthval, &sp_unit_get_by_id(SP_UNIT_PX), &unit); + totallengthval = Inkscape::Util::Quantity::convert(totallengthval, &px, &unit); // TODO cleanup memory, Glib::ustring, etc.: - gchar *totallength_str = g_strdup_printf("%.2f %s", totallengthval, unit.abbr); + gchar *totallength_str = g_strdup_printf("%.2f %s", totallengthval, unit.abbr.c_str()); SPCanvasText *canvas_tooltip = sp_canvastext_new(sp_desktop_tempgroup(desktop), desktop, end_point + desktop->w2d(Geom::Point(3*fontsize, -fontsize)), @@ -605,10 +610,10 @@ static gint sp_measure_context_root_handler(SPEventContext *event_context, GdkEv if (intersections.size() > 2) { double totallengthval = (intersections[intersections.size()-1] - intersections[0]).length(); - sp_convert_distance(&totallengthval, &sp_unit_get_by_id(SP_UNIT_PX), &unit); + totallengthval = Inkscape::Util::Quantity::convert(totallengthval, &px, &unit); // TODO cleanup memory, Glib::ustring, etc.: - gchar *total_str = g_strdup_printf("%.2f %s", totallengthval, unit.abbr); + gchar *total_str = g_strdup_printf("%.2f %s", totallengthval, unit.abbr.c_str()); SPCanvasText *canvas_tooltip = sp_canvastext_new(sp_desktop_tempgroup(desktop), desktop, desktop->doc2dt((intersections[0] + intersections[intersections.size()-1])/2) + normal * 60, -- cgit v1.2.3 From d04405f745da587b2a3ccca8d2ca7bf49edf2d4d Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Sat, 6 Jul 2013 11:01:59 -0400 Subject: Switch setWidth and setHeight to use Quantity and switch to forward declaration of Inkscape::Util::Quantity in document.h. (bzr r12380.1.7) --- src/document.cpp | 34 ++++++++++++++++++---------------- src/document.h | 8 +++++--- src/ui/widget/page-sizer.cpp | 4 ++-- src/util/units.cpp | 2 +- src/util/units.h | 4 ++-- 5 files changed, 28 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/document.cpp b/src/document.cpp index cc1c519fc..ed3d8e21b 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -547,22 +547,23 @@ gdouble SPDocument::getWidth() const return result; } -void SPDocument::setWidth(gdouble width, const Inkscape::Util::Unit *unit) +void SPDocument::setWidth(const Inkscape::Util::Quantity &width) { Inkscape::Util::Unit px = unit_table.getUnit("px"); if (root->width.unit == SVGLength::PERCENT && root->viewBox_set) { // set to viewBox= - root->viewBox.setMax(Geom::Point(root->viewBox.left() + Inkscape::Util::Quantity::convert(width, unit, &px), root->viewBox.bottom())); + root->viewBox.setMax(Geom::Point(root->viewBox.left() + width.value(&px), root->viewBox.bottom())); } else { // set to width= gdouble old_computed = root->width.computed; - root->width.computed = Inkscape::Util::Quantity::convert(width, unit, &px); + root->width.computed = width.value(&px); /* SVG does not support meters as a unit, so we must translate meters to * cm when writing */ - if (*unit == unit_table.getUnit("m")) { - root->width.value = 100*width; + if (*width.unit == unit_table.getUnit("m")) { + Inkscape::Util::Unit cm = unit_table.getUnit("cm"); + root->width.value = width.value(&cm); root->width.unit = SVGLength::CM; } else { - root->width.value = width; - root->width.unit = (SVGLength::Unit) unit->svgUnit(); + root->width.value = width.quantity; + root->width.unit = (SVGLength::Unit) width.unit->svgUnit(); } if (root->viewBox_set) @@ -584,22 +585,23 @@ gdouble SPDocument::getHeight() const return result; } -void SPDocument::setHeight(gdouble height, const Inkscape::Util::Unit *unit) +void SPDocument::setHeight(const Inkscape::Util::Quantity &height) { Inkscape::Util::Unit px = unit_table.getUnit("px"); if (root->height.unit == SVGLength::PERCENT && root->viewBox_set) { // set to viewBox= - root->viewBox.setMax(Geom::Point(root->viewBox.right(), root->viewBox.top() + Inkscape::Util::Quantity::convert(height, unit, &px))); + root->viewBox.setMax(Geom::Point(root->viewBox.right(), root->viewBox.top() + height.value(&px))); } else { // set to height= gdouble old_computed = root->height.computed; - root->height.computed = Inkscape::Util::Quantity::convert(height, unit, &px); + root->height.computed = height.value(&px); /* SVG does not support meters as a unit, so we must translate meters to * cm when writing */ - if (*unit == unit_table.getUnit("m")) { - root->height.value = 100*height; + if (*height.unit == unit_table.getUnit("m")) { + Inkscape::Util::Unit cm = unit_table.getUnit("cm"); + root->height.value = height.value(&cm); root->height.unit = SVGLength::CM; } else { - root->height.value = height; - root->height.unit = (SVGLength::Unit) unit->svgUnit(); + root->height.value = height.quantity; + root->height.unit = (SVGLength::Unit) height.unit->svgUnit(); } if (root->viewBox_set) @@ -662,8 +664,8 @@ void SPDocument::fitToRect(Geom::Rect const &rect, bool with_margins) rect.max() + Geom::Point(margin_right, margin_top)); - setWidth(rect_with_margins.width(), &px); - setHeight(rect_with_margins.height(), &px); + setWidth(Inkscape::Util::Quantity(rect_with_margins.width(), &px)); + setHeight(Inkscape::Util::Quantity(rect_with_margins.height(), &px)); Geom::Translate const tr( Geom::Point(0, old_height - rect_with_margins.height()) diff --git a/src/document.h b/src/document.h index c2334bbc3..c584c3beb 100644 --- a/src/document.h +++ b/src/document.h @@ -26,7 +26,6 @@ #include "gc-anchored.h" #include #include -#include "util/units.h" namespace Avoid { class Router; @@ -47,6 +46,9 @@ namespace Inkscape { struct Document; class Node; } + namespace Util { + class Quantity; + } } class SPDefs; @@ -228,8 +230,8 @@ public: gdouble getWidth() const; gdouble getHeight() const; Geom::Point getDimensions() const; - void setWidth(gdouble width, const Inkscape::Util::Unit *unit); - void setHeight(gdouble height, const Inkscape::Util::Unit *unit); + void setWidth(const Inkscape::Util::Quantity &width); + void setHeight(const Inkscape::Util::Quantity &height); void requestModified(); gint ensureUpToDate(); bool addResource(const gchar *key, SPObject *object); diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp index cceb3f600..884f9ea0a 100644 --- a/src/ui/widget/page-sizer.cpp +++ b/src/ui/widget/page-sizer.cpp @@ -480,8 +480,8 @@ PageSizer::setDim (double w, double h, bool changeList) if (SP_ACTIVE_DESKTOP && !_widgetRegistry->isUpdating()) { SPDocument *doc = sp_desktop_document(SP_ACTIVE_DESKTOP); double const old_height = doc->getHeight(); - doc->setWidth (w, &_px_unit); - doc->setHeight (h, &_px_unit); + doc->setWidth (Inkscape::Util::Quantity(w, &_px_unit)); + doc->setHeight (Inkscape::Util::Quantity(h, &_px_unit)); // The origin for the user is in the lower left corner; this point should remain stationary when // changing the page size. The SVG's origin however is in the upper left corner, so we must compensate for this Geom::Translate const vert_offset(Geom::Point(0, (old_height - h))); diff --git a/src/util/units.cpp b/src/util/units.cpp index d0e4e7941..a51eb2570 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -386,7 +386,7 @@ void UnitsSAXHandler::_endElement(xmlChar const *xname) } /** Initialize a quantity. */ -Quantity::Quantity(Unit *u, double q) { +Quantity::Quantity(double q, const Unit *u) { unit = u; quantity = q; } diff --git a/src/util/units.h b/src/util/units.h index 7ef7001bb..0ea84bfbb 100644 --- a/src/util/units.h +++ b/src/util/units.h @@ -93,10 +93,10 @@ class UnitTable { class Quantity { public: - Unit *unit; + const Unit *unit; double quantity; - Quantity(Unit *u, double q); // constructor + Quantity(double q, const Unit *u); // constructor bool compatibleWith(const Unit *u) const; double value(Unit *u) const; -- cgit v1.2.3 From c2476065a96485c282da32a8859ef8c5617b5b7d Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Sun, 7 Jul 2013 10:12:44 -0400 Subject: Make colour a guint instead of a uint. bug 1198501 Fixed bugs: - https://launchpad.net/bugs/1198501 (bzr r12408) --- src/seltrans.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/seltrans.h b/src/seltrans.h index 880f30c94..67d581471 100644 --- a/src/seltrans.h +++ b/src/seltrans.h @@ -71,6 +71,7 @@ public: gboolean skewRequest(SPSelTransHandle const &handle, Geom::Point &pt, guint state); gboolean rotateRequest(Geom::Point &pt, guint state); gboolean centerRequest(Geom::Point &pt, guint state); + void alignClick(SPSelTransHandle const &handle); gboolean handleRequest(SPKnot *knot, Geom::Point *position, guint state, SPSelTransHandle const &handle); void handleGrab(SPKnot *knot, guint state, SPSelTransHandle const &handle); @@ -130,6 +131,7 @@ private: }; SPDesktop *_desktop; + SPCanvasItem *aguide; std::vector _items; std::vector _items_const; @@ -180,7 +182,7 @@ private: bool _center_is_set; ///< we've already set _center, no need to reread it from items int _center_handle; - SPKnot *knots[17]; + SPKnot *knots[NUMHANDS]; SPCanvasItem *_norm; SPCanvasItem *_grip; SPCtrlLine *_l[4]; -- cgit v1.2.3 From a48ec17933088b745b16a0903ef00bd5a9366a71 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Mon, 8 Jul 2013 07:40:48 -0400 Subject: Revert wrong changes and apply right fixes from prev-commit (bzr r12409) --- src/seltrans-handles.h | 2 +- src/seltrans.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/seltrans-handles.h b/src/seltrans-handles.h index 5c3fdd269..740729a6e 100644 --- a/src/seltrans-handles.h +++ b/src/seltrans-handles.h @@ -33,7 +33,7 @@ enum SPSelTransType { }; struct SPSelTransTypeInfo { - uint const *color; + guint32 const *color; gchar const *tip; }; // One per handle type in order diff --git a/src/seltrans.h b/src/seltrans.h index 67d581471..d97375520 100644 --- a/src/seltrans.h +++ b/src/seltrans.h @@ -71,7 +71,6 @@ public: gboolean skewRequest(SPSelTransHandle const &handle, Geom::Point &pt, guint state); gboolean rotateRequest(Geom::Point &pt, guint state); gboolean centerRequest(Geom::Point &pt, guint state); - void alignClick(SPSelTransHandle const &handle); gboolean handleRequest(SPKnot *knot, Geom::Point *position, guint state, SPSelTransHandle const &handle); void handleGrab(SPKnot *knot, guint state, SPSelTransHandle const &handle); @@ -131,7 +130,6 @@ private: }; SPDesktop *_desktop; - SPCanvasItem *aguide; std::vector _items; std::vector _items_const; -- cgit v1.2.3 From cbdafaae927348aa8ef5396474535571fe989bf8 Mon Sep 17 00:00:00 2001 From: Slagvi Public Date: Mon, 8 Jul 2013 18:02:38 +0200 Subject: Coding style improvements and display bug fixes (bzr r12379.2.8) --- src/ui/dialog/new-from-template.cpp | 15 ++++- src/ui/dialog/new-from-template.h | 10 ++++ src/ui/dialog/static-template-load-tab.cpp | 36 +++++++----- src/ui/dialog/static-template-load-tab.h | 10 ++++ src/ui/dialog/template-load-tab.cpp | 91 +++++++++++++++++------------- src/ui/dialog/template-load-tab.h | 26 ++++++--- 6 files changed, 126 insertions(+), 62 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/new-from-template.cpp b/src/ui/dialog/new-from-template.cpp index b210545d1..765ec0bce 100644 --- a/src/ui/dialog/new-from-template.cpp +++ b/src/ui/dialog/new-from-template.cpp @@ -1,8 +1,19 @@ +/** @file + * @brief New From Template main dialog - implementation + */ +/* Authors: + * Jan Darowski , supervised by Krzysztof KosiĹ„ski + * + * Copyright (C) 2013 Authors + * Released under GNU GPL, read the file 'COPYING' for more information + */ + + #include "new-from-template.h" #include -#include "src/file.h" +#include "file.h" namespace Inkscape { @@ -13,7 +24,7 @@ NewFromTemplate::NewFromTemplate() : _create_template_button("Create from template") { set_title("New From Template"); - resize(400, 250); + resize(400, 400); get_vbox()->pack_start(_main_widget); _main_widget.append_page(_tab1, "Static Templates"); diff --git a/src/ui/dialog/new-from-template.h b/src/ui/dialog/new-from-template.h index e7976d685..59b61a015 100644 --- a/src/ui/dialog/new-from-template.h +++ b/src/ui/dialog/new-from-template.h @@ -1,3 +1,13 @@ +/** @file + * @brief New From Template main dialog + */ +/* Authors: + * Jan Darowski , supervised by Krzysztof KosiĹ„ski + * + * Copyright (C) 2013 Authors + * Released under GNU GPL, read the file 'COPYING' for more information + */ + #ifndef INKSCAPE_SEEN_UI_DIALOG_NEW_FROM_TEMPLATE_H #define INKSCAPE_SEEN_UI_DIALOG_NEW_FROM_TEMPLATE_H diff --git a/src/ui/dialog/static-template-load-tab.cpp b/src/ui/dialog/static-template-load-tab.cpp index 47c7c00b9..26b999aec 100644 --- a/src/ui/dialog/static-template-load-tab.cpp +++ b/src/ui/dialog/static-template-load-tab.cpp @@ -1,3 +1,13 @@ +/** @file + * @brief New From Template static templates tab - implementation + */ +/* Authors: + * Jan Darowski , supervised by Krzysztof KosiĹ„ski + * + * Copyright (C) 2013 Authors + * Released under GNU GPL, read the file 'COPYING' for more information + */ + #include "static-template-load-tab.h" #include @@ -5,7 +15,7 @@ #include #include -#include "src/file.h" +#include "file.h" namespace Inkscape { @@ -15,26 +25,26 @@ namespace UI { StaticTemplateLoadTab::StaticTemplateLoadTab() : TemplateLoadTab() , _more_info_button("More info") - , _preview_image("preview.png") , _short_description_label("Short description - I like trains. ad asda asd asdweqe gdfg") - , _template_name_label("Template_name") , _template_author_label("by template_author") + , _template_name_label("Template_name") + , _preview_image("preview.png") { - _loading_path = "/static"; + _loading_path = ""; _loadTemplates(); _initLists(); - _template_info_column.pack_start(_template_name_label, Gtk::PACK_SHRINK, 4); - _template_info_column.pack_start(_template_author_label, Gtk::PACK_SHRINK, 0); - _template_info_column.pack_start(_preview_image, Gtk::PACK_SHRINK, 15); - _template_info_column.pack_start(_short_description_label, Gtk::PACK_SHRINK, 4); + _info_box.pack_start(_template_name_label, Gtk::PACK_SHRINK, 4); + _info_box.pack_start(_template_author_label, Gtk::PACK_SHRINK, 0); + _info_box.pack_start(_preview_image, Gtk::PACK_SHRINK, 15); + _info_box.pack_start(_short_description_label, Gtk::PACK_SHRINK, 4); _short_description_label.set_line_wrap(true); _short_description_label.set_size_request(200); Gtk::Alignment *align; align = manage(new Gtk::Alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER, 0.0, 0.0)); - _template_info_column.pack_start(*align, Gtk::PACK_SHRINK, 5); + _info_box.pack_start(*align, Gtk::PACK_SHRINK, 5); align->add(_more_info_button); } @@ -42,8 +52,8 @@ StaticTemplateLoadTab::StaticTemplateLoadTab() void StaticTemplateLoadTab::createTemplate() { Glib::ustring path; - if (_templates.find(_current_template) != _templates.end()){ - path = _templates[_current_template].path; + if (_tdata.find(_current_template) != _tdata.end()){ + path = _tdata[_current_template].path; } else path = ""; @@ -56,8 +66,8 @@ void StaticTemplateLoadTab::_displayTemplateInfo() { TemplateLoadTab::_displayTemplateInfo(); _template_name_label.set_text(_current_template); - _template_author_label.set_text(_templates[_current_template].author); - _short_description_label.set_text(_templates[_current_template].short_description); + _template_author_label.set_text(_tdata[_current_template].author); + _short_description_label.set_text(_tdata[_current_template].short_description); } } diff --git a/src/ui/dialog/static-template-load-tab.h b/src/ui/dialog/static-template-load-tab.h index a5411296d..9b19c495a 100644 --- a/src/ui/dialog/static-template-load-tab.h +++ b/src/ui/dialog/static-template-load-tab.h @@ -1,3 +1,13 @@ +/** @file + * @brief New From Template static templates tab + */ +/* Authors: + * Jan Darowski , supervised by Krzysztof KosiĹ„ski + * + * Copyright (C) 2013 Authors + * Released under GNU GPL, read the file 'COPYING' for more information + */ + #ifndef INKSCAPE_SEEN_UI_DIALOG_STATIC_TEMPLATE_LOAD_TAB_H #define INKSCAPE_SEEN_UI_DIALOG_STATIC_TEMPLATE_LOAD_TAB_H diff --git a/src/ui/dialog/template-load-tab.cpp b/src/ui/dialog/template-load-tab.cpp index 5e3a16a3f..95baccc75 100644 --- a/src/ui/dialog/template-load-tab.cpp +++ b/src/ui/dialog/template-load-tab.cpp @@ -1,13 +1,23 @@ +/** @file + * @brief New From Template abstract tab implementation + */ +/* Authors: + * Jan Darowski , supervised by Krzysztof KosiĹ„ski + * + * Copyright (C) 2013 Authors + * Released under GNU GPL, read the file 'COPYING' for more information + */ + #include "template-load-tab.h" -#include +#include #include -#include "src/interface.h" -#include "src/file.h" -#include "src/path-prefix.h" -#include "src/preferences.h" -#include "src/inkscape.h" +#include "interface.h" +#include "file.h" +#include "path-prefix.h" +#include "preferences.h" +#include "inkscape.h" namespace Inkscape { @@ -15,34 +25,32 @@ namespace UI { TemplateLoadTab::TemplateLoadTab() - : _keywords_combo(true) - , _current_keyword("") + : _current_keyword("") + , _keywords_combo(true) { set_border_width(10); Gtk::Label *title; - title = manage(new Gtk::Label("Search Tags:")); - _templates_column.pack_start(*title, Gtk::PACK_SHRINK, 10); + title = manage(new Gtk::Label("Search:")); + _tlist_box.pack_start(*title, Gtk::PACK_SHRINK, 10); - _templates_column.pack_start(_keywords_combo, Gtk::PACK_SHRINK, 0); + _tlist_box.pack_start(_keywords_combo, Gtk::PACK_SHRINK, 0); title = manage(new Gtk::Label("Templates")); - _templates_column.pack_start(*title, Gtk::PACK_SHRINK, 10); + _tlist_box.pack_start(*title, Gtk::PACK_SHRINK, 10); title = manage(new Gtk::Label("Selected template")); - _template_info_column.pack_start(*title, Gtk::PACK_SHRINK, 10); + _info_box.pack_start(*title, Gtk::PACK_SHRINK, 10); add(_main_box); - _main_box.pack_start(_templates_column, Gtk::PACK_SHRINK, 20); - _main_box.pack_start(_template_info_column, Gtk::PACK_EXPAND_WIDGET, 10); + _main_box.pack_start(_tlist_box, Gtk::PACK_SHRINK, 20); + _main_box.pack_start(_info_box, Gtk::PACK_EXPAND_WIDGET, 10); - _templates_column.pack_start(_templates_view, Gtk::PACK_SHRINK, 5); - - Glib::RefPtr templateSelectionRef = - _templates_view.get_selection(); - - templateSelectionRef->signal_changed().connect( - sigc::mem_fun(*this, &TemplateLoadTab::_displayTemplateInfo)); + Gtk::ScrolledWindow *scrolled; + scrolled = manage(new Gtk::ScrolledWindow()); + scrolled->set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); + scrolled->add(_tlist_view); + _tlist_box.pack_start(*scrolled, Gtk::PACK_EXPAND_WIDGET, 5); _keywords_combo.signal_changed().connect( sigc::mem_fun(*this, &TemplateLoadTab::_keywordSelected)); @@ -63,9 +71,9 @@ void TemplateLoadTab::createTemplate() void TemplateLoadTab::_displayTemplateInfo() { - Glib::RefPtr templateSelectionRef = _templates_view.get_selection(); + Glib::RefPtr templateSelectionRef = _tlist_view.get_selection(); if (templateSelectionRef->get_selected()) { - _current_template = (*templateSelectionRef->get_selected())[_templates_columns.textValue]; + _current_template = (*templateSelectionRef->get_selected())[_columns.textValue]; } } @@ -82,13 +90,18 @@ void TemplateLoadTab::_initKeywordsList() void TemplateLoadTab::_initLists() { - _templates_ref = Gtk::ListStore::create(_templates_columns); - _templates_view.set_model(_templates_ref); - _templates_view.append_column("", _templates_columns.textValue); - _templates_view.set_headers_visible(false); + _tlist_store = Gtk::ListStore::create(_columns); + _tlist_view.set_model(_tlist_store); + _tlist_view.append_column("", _columns.textValue); + _tlist_view.set_headers_visible(false); _initKeywordsList(); _refreshTemplatesList(); + + Glib::RefPtr templateSelectionRef = + _tlist_view.get_selection(); + templateSelectionRef->signal_changed().connect( + sigc::mem_fun(*this, &TemplateLoadTab::_displayTemplateInfo)); } @@ -101,12 +114,12 @@ void TemplateLoadTab::_keywordSelected() void TemplateLoadTab::_refreshTemplatesList() { - _templates_ref->clear(); + _tlist_store->clear(); - for (std::map::iterator it = _templates.begin() ; it != _templates.end() ; ++it) { - Gtk::TreeModel::iterator iter = _templates_ref->append(); + for (std::map::iterator it = _tdata.begin() ; it != _tdata.end() ; ++it) { + Gtk::TreeModel::iterator iter = _tlist_store->append(); Gtk::TreeModel::Row row = *iter; - row[_templates_columns.textValue] = it->first; + row[_columns.textValue] = it->first; } } @@ -121,7 +134,7 @@ void TemplateLoadTab::_loadTemplates() } -TemplateLoadTab::TemplateData TemplateLoadTab::_processTemplateFile(Glib::ustring path) +TemplateLoadTab::TemplateData TemplateLoadTab::_processTemplateFile(const Glib::ustring &path) { TemplateData result; result.path = path; @@ -133,21 +146,21 @@ TemplateLoadTab::TemplateData TemplateLoadTab::_processTemplateFile(Glib::ustrin } -void TemplateLoadTab::_getTemplatesFromDir(Glib::ustring path) +void TemplateLoadTab::_getTemplatesFromDir(const Glib::ustring &path) { if ( !Glib::file_test(path, Glib::FILE_TEST_EXISTS) || !Glib::file_test(path, Glib::FILE_TEST_IS_DIR)) return; Glib::Dir dir(path); - path += "/"; - Glib::ustring file = path + dir.read_name(); + + Glib::ustring file = Glib::build_filename(path, dir.read_name()); while (file != path){ - if (Glib::str_has_suffix(file, ".svg")){ + if (Glib::str_has_suffix(file, ".svg") && !Glib::str_has_prefix(Glib::path_get_basename(file), "default")){ TemplateData tmp = _processTemplateFile(file); - _templates[Glib::path_get_basename(file)] = tmp; + _tdata[Glib::path_get_basename(file)] = tmp; } - file = path + dir.read_name(); + file = Glib::build_filename(path, dir.read_name()); } } diff --git a/src/ui/dialog/template-load-tab.h b/src/ui/dialog/template-load-tab.h index 3edcf15eb..7d1e25d6d 100644 --- a/src/ui/dialog/template-load-tab.h +++ b/src/ui/dialog/template-load-tab.h @@ -1,3 +1,13 @@ +/** @file + * @brief New From Template abstract tab class + */ +/* Authors: + * Jan Darowski , supervised by Krzysztof KosiĹ„ski + * + * Copyright (C) 2013 Authors + * Released under GNU GPL, read the file 'COPYING' for more information + */ + #ifndef INKSCAPE_SEEN_UI_DIALOG_TEMPLATE_LOAD_TAB_H #define INKSCAPE_SEEN_UI_DIALOG_TEMPLATE_LOAD_TAB_H @@ -46,7 +56,7 @@ protected: Glib::ustring _current_keyword; Glib::ustring _current_template; Glib::ustring _loading_path; - std::map _templates; + std::map _tdata; virtual void _displayTemplateInfo(); @@ -56,19 +66,19 @@ protected: void _initLists(); Gtk::HBox _main_box; - Gtk::VBox _templates_column; - Gtk::VBox _template_info_column; + Gtk::VBox _tlist_box; + Gtk::VBox _info_box; Gtk::ComboBoxText _keywords_combo; - Gtk::TreeView _templates_view; - Glib::RefPtr _templates_ref; - StringModelColumns _templates_columns; + Gtk::TreeView _tlist_view; + Glib::RefPtr _tlist_store; + StringModelColumns _columns; private: - void _getTemplatesFromDir(Glib::ustring); + void _getTemplatesFromDir(const Glib::ustring &); void _keywordSelected(); - TemplateData _processTemplateFile(Glib::ustring); + TemplateData _processTemplateFile(const Glib::ustring &); }; -- cgit v1.2.3 From c56584bdf7c95b528d1b8016a0b4009f8b829dab Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Tue, 9 Jul 2013 21:34:33 +0200 Subject: Fix for Bug #1185132 (colorspace.h not included in the tarball when doing a make dist) by Ryan Lerch. Fixed bugs: - https://launchpad.net/bugs/1185132 (bzr r12410) --- src/Makefile_insert | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/Makefile_insert b/src/Makefile_insert index 023d640ca..88f809b52 100644 --- a/src/Makefile_insert +++ b/src/Makefile_insert @@ -21,6 +21,7 @@ ink_common_sources += \ color-profile.cpp color-profile.h \ color-profile-cms-fns.h \ color-rgba.h \ + colorspace.h \ common-context.cpp common-context.h \ composite-undo-stack-observer.cpp \ composite-undo-stack-observer.h \ -- cgit v1.2.3 From 9dc7b786c9ef31060012ea4ae13a8188548b4f62 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Tue, 9 Jul 2013 16:42:04 -0400 Subject: Ported sp-namedview.cpp (todo: fix a bunch of things). (bzr r12380.1.8) --- src/sp-namedview.cpp | 27 +++++++++++++++------------ src/sp-namedview.h | 11 ++++++----- src/ui/dialog/clonetiler.cpp | 2 +- src/ui/dialog/document-properties.cpp | 4 ++-- src/ui/dialog/export.cpp | 4 ++-- src/ui/dialog/guides.cpp | 2 +- src/ui/widget/page-sizer.cpp | 4 ++-- src/ui/widget/selected-style.cpp | 2 +- src/util/units.cpp | 21 +++++++++++++++++++++ src/util/units.h | 1 + src/widgets/desktop-widget.cpp | 10 +++++----- src/widgets/lpe-toolbar.cpp | 2 +- src/widgets/measure-toolbar.cpp | 2 +- src/widgets/node-toolbar.cpp | 2 +- src/widgets/rect-toolbar.cpp | 2 +- src/widgets/select-toolbar.cpp | 2 +- src/widgets/stroke-style.cpp | 6 +++--- src/widgets/text-toolbar.cpp | 2 +- 18 files changed, 66 insertions(+), 40 deletions(-) (limited to 'src') diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp index 5184d37a9..c7301f9bd 100644 --- a/src/sp-namedview.cpp +++ b/src/sp-namedview.cpp @@ -22,7 +22,7 @@ #include "display/canvas-grid.h" #include "display/guideline.h" -#include "helper/units.h" +#include "util/units.h" #include "svg/svg-color.h" #include "xml/repr.h" #include "attributes.h" @@ -287,6 +287,8 @@ static void sp_namedview_set(SPObject *object, unsigned int key, const gchar *va { SPNamedView *nv = SP_NAMEDVIEW(object); + static Inkscape::Util::UnitTable unit_table; + switch (key) { case SP_ATTR_VIEWONLY: nv->editable = (!value); @@ -549,18 +551,19 @@ static void sp_namedview_set(SPObject *object, unsigned int key, const gchar *va * in that they aren't in general absolute units as currently required by * doc_units. */ - SPUnit const *new_unit = &sp_unit_get_by_id(SP_UNIT_PX); + static Inkscape::Util::Unit px = unit_table.getUnit("px"); + Inkscape::Util::Unit const *new_unit = &px; if (value) { - SPUnit const *const req_unit = sp_unit_get_by_abbreviation(value); - if ( req_unit == NULL ) { + Inkscape::Util::Unit u = unit_table.getUnit(value); + Inkscape::Util::Unit const *const req_unit = &u; + if ( !unit_table.hasUnit(value) ) { g_warning("Unrecognized unit `%s'", value); /* fixme: Document errors should be reported in the status bar or * the like (e.g. as per * http://www.w3.org/TR/SVG11/implnote.html#ErrorProcessing); g_log * should be only for programmer errors. */ - } else if ( req_unit->base == SP_UNIT_ABSOLUTE || - req_unit->base == SP_UNIT_DEVICE ) { + } else if ( req_unit->isAbsolute() ) { new_unit = req_unit; } else { g_warning("Document units must be absolute like `mm', `pt' or `px', but found `%s'", @@ -573,18 +576,18 @@ static void sp_namedview_set(SPObject *object, unsigned int key, const gchar *va break; } case SP_ATTR_UNITS: { - SPUnit const *new_unit = NULL; + Inkscape::Util::Unit const *new_unit = NULL; if (value) { - SPUnit const *const req_unit = sp_unit_get_by_abbreviation(value); - if ( req_unit == NULL ) { + Inkscape::Util::Unit u = unit_table.getUnit(value); + Inkscape::Util::Unit const *const req_unit = &u; + if ( !unit_table.hasUnit(value) ) { g_warning("Unrecognized unit `%s'", value); /* fixme: Document errors should be reported in the status bar or * the like (e.g. as per * http://www.w3.org/TR/SVG11/implnote.html#ErrorProcessing); g_log * should be only for programmer errors. */ - } else if ( req_unit->base == SP_UNIT_ABSOLUTE || - req_unit->base == SP_UNIT_DEVICE ) { + } else if ( req_unit->isAbsolute() ) { new_unit = req_unit; } else { g_warning("Document units must be absolute like `mm', `pt' or `px', but found `%s'", @@ -1130,7 +1133,7 @@ double SPNamedView::getMarginLength(gchar const * const key, SPMetric SPNamedView::getDefaultMetric() const { if (doc_units) { - return sp_unit_get_metric(doc_units); + return (SPMetric) doc_units->metric(); } else { return SP_PT; } diff --git a/src/sp-namedview.h b/src/sp-namedview.h index a84368c86..f9629f0c6 100644 --- a/src/sp-namedview.h +++ b/src/sp-namedview.h @@ -28,10 +28,11 @@ G_BEGIN_DECLS -struct SPUnit; - namespace Inkscape { -class CanvasGrid; + class CanvasGrid; + namespace Util { + class Unit; + } } enum { @@ -59,8 +60,8 @@ struct SPNamedView : public SPObjectGroup { GSList * grids; bool grids_visible; - SPUnit const *doc_units; - SPUnit const *units; + Inkscape::Util::Unit const *doc_units; + Inkscape::Util::Unit const *units; GQuark default_layer_id; diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp index 753320ab9..00bb6f0e2 100644 --- a/src/ui/dialog/clonetiler.cpp +++ b/src/ui/dialog/clonetiler.cpp @@ -1093,7 +1093,7 @@ CloneTiler::CloneTiler (void) : // unitmenu GtkWidget *u = sp_unit_selector_new (SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE); - sp_unit_selector_set_unit (SP_UNIT_SELECTOR(u), sp_desktop_namedview(SP_ACTIVE_DESKTOP)->doc_units); + //sp_unit_selector_set_unit (SP_UNIT_SELECTOR(u), sp_desktop_namedview(SP_ACTIVE_DESKTOP)->doc_units); { // Width spinbutton diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index d335fb303..af462a1df 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -1431,8 +1431,8 @@ void DocumentProperties::update() _rcp_bord.setRgba32 (nv->bordercolor); _rcb_shad.setActive (nv->showpageshadow); - if (nv->doc_units) - _rum_deflt.setUnit (nv->doc_units); + //if (nv->doc_units) + // _rum_deflt.setUnit (nv->doc_units); double const doc_w_px = sp_desktop_document(dt)->getWidth(); double const doc_h_px = sp_desktop_document(dt)->getHeight(); diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index a851503fe..25300cfc0 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -200,8 +200,8 @@ Export::Export (void) : earlier than that */ unit_selector = Glib::wrap(sp_unit_selector_new (SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE)); SPDesktop *desktop = SP_ACTIVE_DESKTOP; - if (desktop) - sp_unit_selector_set_unit (SP_UNIT_SELECTOR(unit_selector->gobj()), sp_desktop_namedview(desktop)->doc_units); + //if (desktop) + // sp_unit_selector_set_unit (SP_UNIT_SELECTOR(unit_selector->gobj()), sp_desktop_namedview(desktop)->doc_units); unitbox.pack_end(*unit_selector, false, false, 0); unitbox.pack_end(units_label, false, false, 3); diff --git a/src/ui/dialog/guides.cpp b/src/ui/dialog/guides.cpp index 51bbc7d9a..9a7b19c35 100644 --- a/src/ui/dialog/guides.cpp +++ b/src/ui/dialog/guides.cpp @@ -230,7 +230,7 @@ void GuidelinePropertiesDialog::_setup() { _unit_menu.setUnitType(UNIT_TYPE_LINEAR); _unit_menu.setUnit("px"); if (_desktop->namedview->doc_units) { - _unit_menu.setUnit( sp_unit_get_abbreviation(_desktop->namedview->doc_units) ); + //_unit_menu.setUnit( sp_unit_get_abbreviation(_desktop->namedview->doc_units) ); } _spin_angle.setUnit(_angle_unit_status); diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp index 884f9ea0a..14e280f6d 100644 --- a/src/ui/widget/page-sizer.cpp +++ b/src/ui/widget/page-sizer.cpp @@ -316,9 +316,9 @@ PageSizer::PageSizer(Registry & _wr) SPNamedView *nv = sp_desktop_namedview(dt); _wr.setUpdating (true); if (nv->units) { - _dimensionUnits.setUnit(nv->units); + //_dimensionUnits.setUnit(nv->units); } else if (nv->doc_units) { - _dimensionUnits.setUnit(nv->doc_units); + //_dimensionUnits.setUnit(nv->doc_units); } _wr.setUpdating (false); diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index 18dbb984b..d6e2406c9 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -476,7 +476,7 @@ SelectedStyle::setDesktop(SPDesktop *desktop) this ) )); - _sw_unit = const_cast(sp_desktop_namedview(desktop)->doc_units); + //_sw_unit = const_cast(sp_desktop_namedview(desktop)->doc_units); // Set the doc default unit active in the units list gint length = g_slist_length(_unit_mis); diff --git a/src/util/units.cpp b/src/util/units.cpp index a51eb2570..6c225f717 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -106,6 +106,27 @@ int Unit::svgUnit() const { return 0; } +/** Temporary - get metric. */ +int Unit::metric() const { + if (!abbr.compare("mm")) + return 1; + if (!abbr.compare("cm")) + return 2; + if (!abbr.compare("in")) + return 3; + if (!abbr.compare("ft")) + return 4; + if (!abbr.compare("pt")) + return 5; + if (!abbr.compare("pc")) + return 6; + if (!abbr.compare("px")) + return 7; + if (!abbr.compare("m")) + return 8; + return 0; +} + /** * Initializes the unit tables and identifies the primary unit types. * diff --git a/src/util/units.h b/src/util/units.h index 0ea84bfbb..64eb4a665 100644 --- a/src/util/units.h +++ b/src/util/units.h @@ -54,6 +54,7 @@ class Unit { // temporary int svgUnit() const; + int metric() const; }; class UnitTable { diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 814298041..7d3bbc44a 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -1672,7 +1672,7 @@ SPDesktopWidget* SPDesktopWidget::createInstance(SPNamedView *namedview) { SPDesktopWidget *dtw = static_cast(g_object_new(SP_TYPE_DESKTOP_WIDGET, NULL)); - dtw->dt2r = 1.0 / namedview->doc_units->unittobase; + dtw->dt2r = 1.0 / namedview->doc_units->factor; dtw->ruler_origin = Geom::Point(0,0); //namedview->gridorigin; Why was the grid origin used here? @@ -1744,7 +1744,7 @@ void SPDesktopWidget::namedviewModified(SPObject *obj, guint flags) SPNamedView *nv=SP_NAMEDVIEW(obj); if (flags & SP_OBJECT_MODIFIED_FLAG) { - this->dt2r = 1.0 / nv->doc_units->unittobase; + this->dt2r = 1.0 / nv->doc_units->factor; this->ruler_origin = Geom::Point(0,0); //nv->gridorigin; Why was the grid origin used here? sp_ruler_set_unit(SP_RULER (this->vruler), nv->getDefaultMetric()); @@ -1778,14 +1778,14 @@ void SPDesktopWidget::namedviewModified(SPObject *obj, guint flags) if (tracker == NULL) // it's null when inkscape is first opened continue; - tracker->setActiveUnit( nv->doc_units ); + // tracker->setActiveUnit( nv->doc_units ); } // grandchildren } // if child is a container } // children } // if aux_toolbox is a container - gtk_widget_set_tooltip_text(this->hruler_box, gettext(sp_unit_get_plural (nv->doc_units))); - gtk_widget_set_tooltip_text(this->vruler_box, gettext(sp_unit_get_plural (nv->doc_units))); + gtk_widget_set_tooltip_text(this->hruler_box, gettext(nv->doc_units->name_plural.c_str())); + gtk_widget_set_tooltip_text(this->vruler_box, gettext(nv->doc_units->name_plural.c_str())); sp_desktop_widget_update_rulers(this); ToolboxFactory::updateSnapToolbox(this->desktop, 0, this->snap_toolbox); diff --git a/src/widgets/lpe-toolbar.cpp b/src/widgets/lpe-toolbar.cpp index 3126175b3..8c481d2f1 100644 --- a/src/widgets/lpe-toolbar.cpp +++ b/src/widgets/lpe-toolbar.cpp @@ -294,7 +294,7 @@ static void lpetool_open_lpe_dialog(GtkToggleAction *act, gpointer data) void sp_lpetool_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder) { UnitTracker* tracker = new UnitTracker(SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE); - tracker->setActiveUnit(sp_desktop_namedview(desktop)->doc_units); + //tracker->setActiveUnit(sp_desktop_namedview(desktop)->doc_units); g_object_set_data(holder, "tracker", tracker); SPUnit const *unit = tracker->getActiveUnit(); diff --git a/src/widgets/measure-toolbar.cpp b/src/widgets/measure-toolbar.cpp index 21df4c6d9..387dbbeae 100644 --- a/src/widgets/measure-toolbar.cpp +++ b/src/widgets/measure-toolbar.cpp @@ -91,7 +91,7 @@ static void measure_unit_changed(GtkAction* /*act*/, GObject* tbl) void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, GObject* holder) { UnitTracker* tracker = new UnitTracker( SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE ); - tracker->setActiveUnit( sp_desktop_namedview(desktop)->doc_units ); + //tracker->setActiveUnit( sp_desktop_namedview(desktop)->doc_units ); g_object_set_data( holder, "tracker", tracker ); EgeAdjustmentAction *eact = 0; diff --git a/src/widgets/node-toolbar.cpp b/src/widgets/node-toolbar.cpp index 849de874d..d6de74817 100644 --- a/src/widgets/node-toolbar.cpp +++ b/src/widgets/node-toolbar.cpp @@ -340,7 +340,7 @@ static void sp_node_toolbox_sel_modified(Inkscape::Selection *selection, guint / void sp_node_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder) { UnitTracker* tracker = new UnitTracker( SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE ); - tracker->setActiveUnit( sp_desktop_namedview(desktop)->doc_units ); + //tracker->setActiveUnit( sp_desktop_namedview(desktop)->doc_units ); g_object_set_data( holder, "tracker", tracker ); Inkscape::IconSize secondarySize = ToolboxFactory::prefToSize("/toolbox/secondary", 1); diff --git a/src/widgets/rect-toolbar.cpp b/src/widgets/rect-toolbar.cpp index 8c1a735c5..5fa96289f 100644 --- a/src/widgets/rect-toolbar.cpp +++ b/src/widgets/rect-toolbar.cpp @@ -304,7 +304,7 @@ void sp_rect_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje UnitTracker* tracker = new UnitTracker( SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE ); //tracker->addUnit( SP_UNIT_PERCENT, 0 ); // fixme: add % meaning per cent of the width/height - tracker->setActiveUnit( sp_desktop_namedview(desktop)->doc_units ); + //tracker->setActiveUnit( sp_desktop_namedview(desktop)->doc_units ); g_object_set_data( holder, "tracker", tracker ); /* W */ diff --git a/src/widgets/select-toolbar.cpp b/src/widgets/select-toolbar.cpp index 549581610..693fc870b 100644 --- a/src/widgets/select-toolbar.cpp +++ b/src/widgets/select-toolbar.cpp @@ -488,7 +488,7 @@ void sp_select_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GOb // Create the units menu. UnitTracker* tracker = new UnitTracker( SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE ); tracker->addUnit( SP_UNIT_PERCENT, 0 ); - tracker->setActiveUnit( sp_desktop_namedview(desktop)->doc_units ); + //tracker->setActiveUnit( sp_desktop_namedview(desktop)->doc_units ); g_object_set_data( G_OBJECT(spw), "tracker", tracker ); g_signal_connect( G_OBJECT(spw), "destroy", G_CALLBACK(destroy_tracker), spw ); diff --git a/src/widgets/stroke-style.cpp b/src/widgets/stroke-style.cpp index 0a5b3781b..17e3984bb 100644 --- a/src/widgets/stroke-style.cpp +++ b/src/widgets/stroke-style.cpp @@ -193,8 +193,8 @@ StrokeStyle::StrokeStyle() : Gtk::Widget *us = manage(Glib::wrap(unitSelector)); SPDesktop *desktop = SP_ACTIVE_DESKTOP; - if (desktop) - sp_unit_selector_set_unit (SP_UNIT_SELECTOR(unitSelector), sp_desktop_namedview(desktop)->doc_units); + //if (desktop) + // sp_unit_selector_set_unit (SP_UNIT_SELECTOR(unitSelector), sp_desktop_namedview(desktop)->doc_units); sp_unit_selector_add_unit(SP_UNIT_SELECTOR(unitSelector), &sp_unit_get_by_id(SP_UNIT_PERCENT), 0); g_signal_connect ( G_OBJECT (unitSelector), "set_unit", G_CALLBACK (StrokeStyle::setStrokeWidthUnit), this ); us->show(); @@ -884,7 +884,7 @@ StrokeStyle::updateLine() } else { // same width, or only one object; no sense to keep percent, switch to absolute if (unit->base != SP_UNIT_ABSOLUTE && unit->base != SP_UNIT_DEVICE) { - sp_unit_selector_set_unit(SP_UNIT_SELECTOR(unitSelector), sp_desktop_namedview(SP_ACTIVE_DESKTOP)->doc_units); + //sp_unit_selector_set_unit(SP_UNIT_SELECTOR(unitSelector), sp_desktop_namedview(SP_ACTIVE_DESKTOP)->doc_units); } } diff --git a/src/widgets/text-toolbar.cpp b/src/widgets/text-toolbar.cpp index 87cb54d10..144a2a3e8 100644 --- a/src/widgets/text-toolbar.cpp +++ b/src/widgets/text-toolbar.cpp @@ -1219,7 +1219,7 @@ void sp_text_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje // Is this used? UnitTracker* tracker = new UnitTracker( SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE ); - tracker->setActiveUnit( sp_desktop_namedview(desktop)->doc_units ); + //tracker->setActiveUnit( sp_desktop_namedview(desktop)->doc_units ); g_object_set_data( holder, "tracker", tracker ); /* Font family */ -- cgit v1.2.3 From 4d232a223d1dcb7b2381615de1a64b20b2fb6165 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Tue, 9 Jul 2013 20:46:51 -0400 Subject: Small refactor of align and distribute to reduce complexity. (bzr r12411) --- src/document.cpp | 5 +++ src/document.h | 1 + src/ui/dialog/align-and-distribute.cpp | 59 ++++++++++------------------------ 3 files changed, 23 insertions(+), 42 deletions(-) (limited to 'src') diff --git a/src/document.cpp b/src/document.cpp index 706710cfc..0e9c43fe4 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -611,6 +611,11 @@ Geom::Point SPDocument::getDimensions() const return Geom::Point(getWidth(), getHeight()); } +Geom::OptRect SPDocument::preferredBounds() const +{ + return Geom::OptRect( Geom::Point(0, 0), getDimensions() ); +} + /** * Given a Geom::Rect that may, for example, correspond to the bbox of an object, * this function fits the canvas to that rect by resizing the canvas diff --git a/src/document.h b/src/document.h index 606a83be8..d49067250 100644 --- a/src/document.h +++ b/src/document.h @@ -228,6 +228,7 @@ public: gdouble getWidth() const; gdouble getHeight() const; Geom::Point getDimensions() const; + Geom::OptRect preferredBounds() const; void setWidth(gdouble width, const SPUnit *unit); void setHeight(gdouble height, const SPUnit *unit); void requestModified(); diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp index 7f88824f7..6a1cfc0ba 100644 --- a/src/ui/dialog/align-and-distribute.cpp +++ b/src/ui/dialog/align-and-distribute.cpp @@ -88,23 +88,23 @@ Action::Action(const Glib::ustring &id, } -void ActionAlign::do_action(SPDesktop *desktop, int index) { - +void ActionAlign::do_action(SPDesktop *desktop, int index) +{ Inkscape::Selection *selection = sp_desktop_selection(desktop); if (!selection) return; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); bool sel_as_group = prefs->getBool("/dialogs/align/sel-as-groups"); - int prefs_bbox = prefs->getBool("/tools/bounding_box"); using Inkscape::Util::GSListConstIterator; std::list selected; selected.insert >(selected.end(), selection->itemList(), NULL); if (selected.empty()) return; - Geom::Point mp; //Anchor point + const Coeffs &a = _allCoeffs[index]; + Geom::OptRect b = Geom::OptRect(); AlignAndDistribute::AlignTarget target = AlignAndDistribute::getAlignTarget(); - const Coeffs &a= _allCoeffs[index]; + switch (target) { case AlignAndDistribute::LAST: @@ -132,51 +132,27 @@ void ActionAlign::do_action(SPDesktop *desktop, int index) { /*if (!sel_as_group) { */ selected.erase(master); /*}*/ - //Compute the anchor point - Geom::OptRect b = !prefs_bbox ? thing->desktopVisualBounds() : thing->desktopGeometricBounds(); - if (b) { - mp = Geom::Point(a.mx0 * b->min()[Geom::X] + a.mx1 * b->max()[Geom::X], - a.my0 * b->min()[Geom::Y] + a.my1 * b->max()[Geom::Y]); - } else { - return; - } + b = thing->desktopPreferredBounds(); break; } - case AlignAndDistribute::PAGE: - mp = Geom::Point(a.mx1 * sp_desktop_document(desktop)->getWidth(), - a.my1 * sp_desktop_document(desktop)->getHeight()); + b = sp_desktop_document(desktop)->preferredBounds(); break; - case AlignAndDistribute::DRAWING: - { - Geom::OptRect b = !prefs_bbox ? sp_desktop_document(desktop)->getRoot()->desktopVisualBounds() - : sp_desktop_document(desktop)->getRoot()->desktopGeometricBounds(); - if (b) { - mp = Geom::Point(a.mx0 * b->min()[Geom::X] + a.mx1 * b->max()[Geom::X], - a.my0 * b->min()[Geom::Y] + a.my1 * b->max()[Geom::Y]); - } else { - return; - } + b = sp_desktop_document(desktop)->getRoot()->desktopPreferredBounds(); break; - } - case AlignAndDistribute::SELECTION: - { - Geom::OptRect b = !prefs_bbox ? selection->visualBounds() : selection->geometricBounds(); - if (b) { - mp = Geom::Point(a.mx0 * b->min()[Geom::X] + a.mx1 * b->max()[Geom::X], - a.my0 * b->min()[Geom::Y] + a.my1 * b->max()[Geom::Y]); - } else { - return; - } + b = selection->preferredBounds(); break; - } - default: g_assert_not_reached (); break; - }; // end of switch + }; + + g_return_if_fail(b); + + Geom::Point mp = Geom::Point(a.mx0 * b->min()[Geom::X] + a.mx1 * b->max()[Geom::X], + a.my0 * b->min()[Geom::Y] + a.my1 * b->max()[Geom::Y]); // Top hack: temporarily set clone compensation to unmoved, so that we can align/distribute // clones with their original (and the move of the original does not disturb the @@ -188,9 +164,8 @@ void ActionAlign::do_action(SPDesktop *desktop, int index) { prefs->setInt("/options/clonecompensation/value", SP_CLONE_COMPENSATION_UNMOVED); bool changed = false; - Geom::OptRect b; if (sel_as_group) - b = !prefs_bbox ? selection->visualBounds() : selection->geometricBounds(); + b = selection->preferredBounds(); //Move each item in the selected list separately for (std::list::iterator it(selected.begin()); @@ -199,7 +174,7 @@ void ActionAlign::do_action(SPDesktop *desktop, int index) { { sp_desktop_document (desktop)->ensureUpToDate(); if (!sel_as_group) - b = !prefs_bbox ? (*it)->desktopVisualBounds() : (*it)->desktopGeometricBounds(); + b = (*it)->desktopPreferredBounds(); if (b) { Geom::Point const sp(a.sx0 * b->min()[Geom::X] + a.sx1 * b->max()[Geom::X], a.sy0 * b->min()[Geom::Y] + a.sy1 * b->max()[Geom::Y]); -- cgit v1.2.3 From bea3d29ac007d6c8faca786538fafb0d7d789ffc Mon Sep 17 00:00:00 2001 From: Eric Greveson Date: Wed, 10 Jul 2013 11:50:45 +0100 Subject: Added "dbus-name" command line option to allow a D-Bus bus name other than "org.inkscape" to be specified. This allows multiple Inkscape instances to be controlled over D-Bus in a single user session. (bzr r12402.1.1) --- src/extension/dbus/dbus-init.cpp | 29 ++++++++++++++++++++-- src/extension/dbus/dbus-init.h | 10 ++++++++ src/extension/dbus/document-interface.h | 3 --- src/extension/dbus/wrapper/inkscape-dbus-wrapper.h | 2 -- src/main.cpp | 20 +++++++++++++++ 5 files changed, 57 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/extension/dbus/dbus-init.cpp b/src/extension/dbus/dbus-init.cpp index eb62f4b3a..19b48e10d 100644 --- a/src/extension/dbus/dbus-init.cpp +++ b/src/extension/dbus/dbus-init.cpp @@ -36,7 +36,14 @@ #include - +namespace +{ + // This stores the bus name to use for this app instance. By default, it + // will be set to org.inkscape. However, users may provide other names by + // setting command-line parameters when starting Inkscape, so that more + // than one instance of Inkscape may be used by external scripts. + gchar *instance_bus_name = NULL; +} namespace Inkscape { namespace Extension { @@ -120,6 +127,11 @@ dbus_register_document(Inkscape::ActionContext const & target) void init (void) { + if (instance_bus_name == NULL) { + // Set the bus name to the default + instance_bus_name = strdup("org.inkscape"); + } + guint result; GError *error = NULL; DBusGConnection *connection; @@ -127,7 +139,7 @@ init (void) connection = dbus_get_connection(); proxy = dbus_get_proxy(connection); org_freedesktop_DBus_request_name (proxy, - "org.inkscape", + instance_bus_name, DBUS_NAME_FLAG_DO_NOT_QUEUE, &result, &error); //create interface for application dbus_register_object (connection, @@ -198,6 +210,19 @@ init_desktop (void) { return strdup(name.c_str()); } +void +dbus_set_bus_name(gchar * bus_name) +{ + g_assert(bus_name != NULL); + g_assert(instance_bus_name == NULL); + instance_bus_name = strdup(bus_name); +} +gchar * +dbus_get_bus_name() +{ + g_assert(instance_bus_name != NULL); + return instance_bus_name; +} } } } /* namespace Inkscape::Extension::Dbus */ diff --git a/src/extension/dbus/dbus-init.h b/src/extension/dbus/dbus-init.h index 486e55b86..7862ad3c3 100644 --- a/src/extension/dbus/dbus-init.h +++ b/src/extension/dbus/dbus-init.h @@ -28,6 +28,16 @@ gchar * init_desktop (void); gchar * dbus_init_desktop_interface (SPDesktop * dt); +/** Set the bus name to use. Default is "org.inkscape". + This function should only be called once, before init(), if a non-default + bus name is required. */ +void dbus_set_bus_name(gchar * bus_name); + +/** Get the bus name for this instance. Default is "org.inkscape". + This function should only be called after init(). + The returned gchar * is owned by this module and should not be freed. */ +gchar * dbus_get_bus_name(); + } } } /* namespace Dbus, Extension, Inkscape */ #endif /* INKSCAPE_EXTENSION_DBUS_INIT_H__ */ diff --git a/src/extension/dbus/document-interface.h b/src/extension/dbus/document-interface.h index 00d964f36..27460de52 100644 --- a/src/extension/dbus/document-interface.h +++ b/src/extension/dbus/document-interface.h @@ -34,9 +34,6 @@ class SPDesktop; class SPItem; - -// TODO: this define doesn't seem to be used... although the path itself is also hardcoded in dbus-init.cpp -#define DBUS_DOCUMENT_INTERFACE_PATH "/org/inkscape/document" #define TYPE_DOCUMENT_INTERFACE (document_interface_get_type ()) #define DOCUMENT_INTERFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TYPE_DOCUMENT_INTERFACE, DocumentInterface)) diff --git a/src/extension/dbus/wrapper/inkscape-dbus-wrapper.h b/src/extension/dbus/wrapper/inkscape-dbus-wrapper.h index 79f8188d4..20830bd65 100644 --- a/src/extension/dbus/wrapper/inkscape-dbus-wrapper.h +++ b/src/extension/dbus/wrapper/inkscape-dbus-wrapper.h @@ -8,8 +8,6 @@ //#include //#include - -#define DBUS_DOCUMENT_INTERFACE_PATH "/org/inkscape/document" #define TYPE_DOCUMENT_INTERFACE (document_interface_get_type ()) #define DOCUMENT_INTERFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TYPE_DOCUMENT_INTERFACE, DocumentInterface)) diff --git a/src/main.cpp b/src/main.cpp index ba51951da..4e2f2fd2b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -103,6 +103,11 @@ #endif // WIN32 #include "extension/init.h" +// Not ideal, but there doesn't appear to be a nicer system in place for +// passing command-line parameters to extensions before initialization... +#ifdef WITH_DBUS +#include "extension/dbus/dbus-init.h" +#endif // WITH_DBUS #include #include @@ -171,6 +176,7 @@ enum { SP_ARG_VACUUM_DEFS, #ifdef WITH_DBUS SP_ARG_DBUS_LISTEN, + SP_ARG_DBUS_NAME, #endif // WITH_DBUS SP_ARG_VERB_LIST, SP_ARG_VERB, @@ -227,6 +233,7 @@ static gboolean sp_shell = FALSE; static gboolean sp_vacuum_defs = FALSE; #ifdef WITH_DBUS static gboolean sp_dbus_listen = FALSE; +static gchar *sp_dbus_name = NULL; #endif // WITH_DBUS static gchar *sp_export_png_utf8 = NULL; static gchar *sp_export_svg_utf8 = NULL; @@ -274,6 +281,7 @@ static void resetCommandlineGlobals() { sp_vacuum_defs = FALSE; #ifdef WITH_DBUS sp_dbus_listen = FALSE; + sp_dbus_name = NULL; #endif // WITH_DBUS sp_export_png_utf8 = NULL; @@ -487,6 +495,11 @@ struct poptOption options[] = { POPT_ARG_NONE, &sp_dbus_listen, SP_ARG_DBUS_LISTEN, N_("Enter a listening loop for D-Bus messages in console mode"), NULL}, + + {"dbus-name", 0, + POPT_ARG_STRING, &sp_dbus_name, SP_ARG_DBUS_NAME, + N_("Specify the D-Bus bus name to listen for messages on (default is org.inkscape)"), + N_("BUS-NAME")}, #endif // WITH_DBUS {"verb-list", 0, @@ -885,6 +898,13 @@ static int sp_common_main( int argc, char const **argv, GSList **flDest ) if ( sp_global_printer ) sp_global_printer_utf8 = g_strdup( sp_global_printer ); } + +#ifdef WITH_DBUS + // Before initializing extensions, we must set the DBus bus name if required + if (sp_dbus_name != NULL) { + Inkscape::Extension::Dbus::dbus_set_bus_name(sp_dbus_name); + } +#endif // Return the list if wanted, else free it up. if ( flDest ) { -- cgit v1.2.3 From 80a911db81b651f38205c1eb926af4986bc033e8 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Wed, 10 Jul 2013 22:24:38 -0400 Subject: Step 2 refactoring the align functions, added some functionality to selection. (bzr r12413) --- src/selection.cpp | 30 ++++++++ src/selection.h | 18 +++++ src/ui/dialog/align-and-distribute.cpp | 127 +++++---------------------------- src/ui/dialog/align-and-distribute.h | 10 +-- 4 files changed, 68 insertions(+), 117 deletions(-) (limited to 'src') diff --git a/src/selection.cpp b/src/selection.cpp index d018aba0c..83caaf459 100644 --- a/src/selection.cpp +++ b/src/selection.cpp @@ -42,6 +42,7 @@ namespace Inkscape { Selection::Selection(LayerModel *layers, SPDesktop *desktop) : + align_point(NULL), _objs(NULL), _reprs(NULL), _items(NULL), @@ -358,6 +359,35 @@ SPItem *Selection::singleItem() { } } +SPItem *Selection::smallestItem(Selection::CompareSize compare) { + return _sizeistItem(true, compare); +} + +SPItem *Selection::largestItem(Selection::CompareSize compare) { + return _sizeistItem(false, compare); +} + +SPItem *Selection::_sizeistItem(bool small, Selection::CompareSize compare) { + GSList const *items = const_cast(this)->itemList(); + gdouble max = small ? 1e18 : 0; + SPItem *ist = NULL; + + for ( GSList const *i = items; i != NULL ; i = i->next ) { + Geom::OptRect bbox = SP_ITEM(i->data)->desktopPreferredBounds(); + if (!bbox) continue; + + gdouble size = compare == 2 ? + (*bbox)[Geom::X].extent() * (*bbox)[Geom::Y].extent() : + (*bbox)[compare == 1 ? Geom::X : Geom::Y].extent(); + size = small ? size : size * -1; + if (size < max) { + max = size; + ist = SP_ITEM(i->data); + } + } + return ist; +} + Inkscape::XML::Node *Selection::singleRepr() { SPObject *obj=single(); return obj ? obj->getRepr() : NULL; diff --git a/src/selection.h b/src/selection.h index f076cf7aa..25c018f7b 100644 --- a/src/selection.h +++ b/src/selection.h @@ -27,6 +27,7 @@ #include "sp-item.h" #include "snapped-point.h" + class SPDesktop; class SPItem; class SPBox3D; @@ -63,6 +64,7 @@ class Selection : public Inkscape::GC::Managed<>, public Inkscape::GC::Anchored { public: + enum CompareSize { HORIZONTAL, VERTICAL, AREA }; /** * Constructs an selection object, bound to a particular * layer model @@ -219,6 +221,16 @@ public: */ SPItem *singleItem(); + /** + * Returns the smallest item from this selection. + */ + SPItem *smallestItem(CompareSize compare); + + /** + * Returns the largest item from this selection. + */ + SPItem *largestItem(CompareSize compare); + /** * Returns a single selected object's xml node. * @@ -308,6 +320,11 @@ public: return _modified_signal.connect(slot); } + /** + * Selection wants to be aligned to this point, not bbox + */ + Geom::Point *align_point; + private: /** no copy. */ Selection(Selection const &); @@ -349,6 +366,7 @@ private: void add_3D_boxes_recursively(SPObject *obj); void remove_box_perspective(SPBox3D *box); void remove_3D_boxes_recursively(SPObject *obj); + SPItem *_sizeistItem(bool small, CompareSize compare); std::list _3dboxes; diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp index 6a1cfc0ba..ed3f3adce 100644 --- a/src/ui/dialog/align-and-distribute.cpp +++ b/src/ui/dialog/align-and-distribute.cpp @@ -103,45 +103,30 @@ void ActionAlign::do_action(SPDesktop *desktop, int index) const Coeffs &a = _allCoeffs[index]; Geom::OptRect b = Geom::OptRect(); - AlignAndDistribute::AlignTarget target = AlignAndDistribute::getAlignTarget(); + Selection::CompareSize horiz = (a.mx0 != 0.0) || (a.mx1 != 0.0) + ? Selection::HORIZONTAL : Selection::VERTICAL; - switch (target) + switch (AlignTarget(prefs->getInt("/dialogs/align/align-to", 6))) { - case AlignAndDistribute::LAST: - case AlignAndDistribute::FIRST: - case AlignAndDistribute::BIGGEST: - case AlignAndDistribute::SMALLEST: - { - //Check 2 or more selected objects - std::list::iterator second(selected.begin()); - ++second; - if (second == selected.end()) - return; - //Find the master (anchor on which the other objects are aligned) - std::list::iterator master( - AlignAndDistribute::find_master ( - selected, - (a.mx0 != 0.0) || - (a.mx1 != 0.0) ) - ); - //remove the master from the selection - SPItem * thing = *master; - // TODO: either uncomment or remove the following commented lines, depending on which - // behaviour of moving objects makes most sense; also cf. discussion at - // https://bugs.launchpad.net/inkscape/+bug/255933 - /*if (!sel_as_group) { */ - selected.erase(master); - /*}*/ - b = thing->desktopPreferredBounds(); + case LAST: + b = SP_ITEM(*selected.begin())->desktopPreferredBounds(); break; - } - case AlignAndDistribute::PAGE: + case FIRST: + b = SP_ITEM(*--(selected.end()))->desktopPreferredBounds(); + break; + case BIGGEST: + b = selection->largestItem(horiz)->desktopPreferredBounds(); + break; + case SMALLEST: + b = selection->smallestItem(horiz)->desktopPreferredBounds(); + break; + case PAGE: b = sp_desktop_document(desktop)->preferredBounds(); break; - case AlignAndDistribute::DRAWING: + case DRAWING: b = sp_desktop_document(desktop)->getRoot()->desktopPreferredBounds(); break; - case AlignAndDistribute::SELECTION: + case SELECTION: b = selection->preferredBounds(); break; default: @@ -151,18 +136,10 @@ void ActionAlign::do_action(SPDesktop *desktop, int index) g_return_if_fail(b); + // Generate the move point from the selected bounding box Geom::Point mp = Geom::Point(a.mx0 * b->min()[Geom::X] + a.mx1 * b->max()[Geom::X], a.my0 * b->min()[Geom::Y] + a.my1 * b->max()[Geom::Y]); - // Top hack: temporarily set clone compensation to unmoved, so that we can align/distribute - // clones with their original (and the move of the original does not disturb the - // clones). The only problem with this is that if there are outside-of-selection clones of - // a selected original, they will be unmoved too, possibly contrary to user's - // expecation. However this is a minor point compared to making align/distribute always - // work as expected, and "unmoved" is the default option anyway. - int saved_compensation = prefs->getInt("/options/clonecompensation/value", SP_CLONE_COMPENSATION_UNMOVED); - prefs->setInt("/options/clonecompensation/value", SP_CLONE_COMPENSATION_UNMOVED); - bool changed = false; if (sel_as_group) b = selection->preferredBounds(); @@ -186,15 +163,10 @@ void ActionAlign::do_action(SPDesktop *desktop, int index) } } - // restore compensation setting - prefs->setInt("/options/clonecompensation/value", saved_compensation); - if (changed) { DocumentUndo::done( sp_desktop_document(desktop) , SP_VERB_DIALOG_ALIGN_DISTRIBUTE, _("Align")); } - - } @@ -1240,69 +1212,6 @@ void AlignAndDistribute::addBaselineButton(const Glib::ustring &id, const Glib:: *this, table, orientation, distribute)); } - - - -std::list::iterator AlignAndDistribute::find_master( std::list &list, bool horizontal){ - std::list::iterator master = list.end(); - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - int prefs_bbox = prefs->getBool("/tools/bounding_box"); - switch (getAlignTarget()) { - case LAST: - return list.begin(); - break; - - case FIRST: - return --(list.end()); - break; - - case BIGGEST: - { - gdouble max = -1e18; - for (std::list::iterator it = list.begin(); it != list.end(); ++it) { - Geom::OptRect b = !prefs_bbox ? (*it)->desktopVisualBounds() : (*it)->desktopGeometricBounds(); - if (b) { - gdouble dim = (*b)[horizontal ? Geom::X : Geom::Y].extent(); - if (dim > max) { - max = dim; - master = it; - } - } - } - return master; - } - - case SMALLEST: - { - gdouble max = 1e18; - for (std::list::iterator it = list.begin(); it != list.end(); ++it) { - Geom::OptRect b = !prefs_bbox ? (*it)->desktopVisualBounds() : (*it)->desktopGeometricBounds(); - if (b) { - gdouble dim = (*b)[horizontal ? Geom::X : Geom::Y].extent(); - if (dim < max) { - max = dim; - master = it; - } - } - } - return master; - } - - default: - g_assert_not_reached (); - break; - - } // end of switch statement - return master; -} - -AlignAndDistribute::AlignTarget AlignAndDistribute::getAlignTarget() { - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - return AlignTarget(prefs->getInt("/dialogs/align/align-to", 6)); -} - - - } // namespace Dialog } // namespace UI } // namespace Inkscape diff --git a/src/ui/dialog/align-and-distribute.h b/src/ui/dialog/align-and-distribute.h index c9165a83e..dfd84535b 100644 --- a/src/ui/dialog/align-and-distribute.h +++ b/src/ui/dialog/align-and-distribute.h @@ -47,12 +47,6 @@ public: static AlignAndDistribute &getInstance() { return *new AlignAndDistribute(); } - enum AlignTarget { LAST=0, FIRST, BIGGEST, SMALLEST, PAGE, DRAWING, SELECTION }; - - - - static AlignTarget getAlignTarget(); - #if WITH_GTKMM_3_0 Gtk::Grid &align_table(){return _alignTable;} Gtk::Grid &distribute_table(){return _distributeTable;} @@ -67,7 +61,6 @@ public: Gtk::Table &nodes_table(){return _nodesTable;} #endif - static std::list::iterator find_master(std::list &list, bool horizontal); void setMode(bool nodeEdit); Geom::OptRect randomize_bbox; @@ -189,6 +182,7 @@ public : double sx0, sx1, sy0, sy1; int verb_id; }; + enum AlignTarget { LAST=0, FIRST, BIGGEST, SMALLEST, PAGE, DRAWING, SELECTION }; ActionAlign(const Glib::ustring &id, const Glib::ustring &tiptext, guint row, guint column, @@ -204,6 +198,7 @@ public : * Static function called to align from a keyboard shortcut */ static void do_verb_action(SPDesktop *desktop, int verb); + static int verb_to_coeff(int verb); private : @@ -217,7 +212,6 @@ private : } static void do_action(SPDesktop *desktop, int index); - static int verb_to_coeff(int verb); guint _index; AlignAndDistribute &_dialog; -- cgit v1.2.3 From c3074d380bbdbd8ec8f17b9cfb3059119005a30b Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Wed, 10 Jul 2013 23:08:15 -0400 Subject: Remove align point, not required any more (bzr r12414) --- src/selection.cpp | 1 - src/selection.h | 5 ----- 2 files changed, 6 deletions(-) (limited to 'src') diff --git a/src/selection.cpp b/src/selection.cpp index 83caaf459..e66137f65 100644 --- a/src/selection.cpp +++ b/src/selection.cpp @@ -42,7 +42,6 @@ namespace Inkscape { Selection::Selection(LayerModel *layers, SPDesktop *desktop) : - align_point(NULL), _objs(NULL), _reprs(NULL), _items(NULL), diff --git a/src/selection.h b/src/selection.h index 25c018f7b..75351a4ff 100644 --- a/src/selection.h +++ b/src/selection.h @@ -320,11 +320,6 @@ public: return _modified_signal.connect(slot); } - /** - * Selection wants to be aligned to this point, not bbox - */ - Geom::Point *align_point; - private: /** no copy. */ Selection(Selection const &); -- cgit v1.2.3 From df87c3c1c14f2483a9dbfc8bf2ac69e9834a42bf Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Thu, 11 Jul 2013 06:41:25 -0400 Subject: Change small to sml to fix windows compile problem (bzr r12415) --- src/selection.cpp | 6 +++--- src/selection.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/selection.cpp b/src/selection.cpp index e66137f65..8f43d8e70 100644 --- a/src/selection.cpp +++ b/src/selection.cpp @@ -366,9 +366,9 @@ SPItem *Selection::largestItem(Selection::CompareSize compare) { return _sizeistItem(false, compare); } -SPItem *Selection::_sizeistItem(bool small, Selection::CompareSize compare) { +SPItem *Selection::_sizeistItem(bool sml, Selection::CompareSize compare) { GSList const *items = const_cast(this)->itemList(); - gdouble max = small ? 1e18 : 0; + gdouble max = sml ? 1e18 : 0; SPItem *ist = NULL; for ( GSList const *i = items; i != NULL ; i = i->next ) { @@ -378,7 +378,7 @@ SPItem *Selection::_sizeistItem(bool small, Selection::CompareSize compare) { gdouble size = compare == 2 ? (*bbox)[Geom::X].extent() * (*bbox)[Geom::Y].extent() : (*bbox)[compare == 1 ? Geom::X : Geom::Y].extent(); - size = small ? size : size * -1; + size = sml ? size : size * -1; if (size < max) { max = size; ist = SP_ITEM(i->data); diff --git a/src/selection.h b/src/selection.h index 75351a4ff..32eade21f 100644 --- a/src/selection.h +++ b/src/selection.h @@ -361,7 +361,7 @@ private: void add_3D_boxes_recursively(SPObject *obj); void remove_box_perspective(SPBox3D *box); void remove_3D_boxes_recursively(SPObject *obj); - SPItem *_sizeistItem(bool small, CompareSize compare); + SPItem *_sizeistItem(bool sml, CompareSize compare); std::list _3dboxes; -- cgit v1.2.3 From f5692180123a550cfd6d1b8780ee23096418dd79 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Fri, 12 Jul 2013 12:08:13 -0400 Subject: Do not effect the focus in align computation Fixed bugs: - https://launchpad.net/bugs/1200649 (bzr r12416) --- src/ui/dialog/align-and-distribute.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp index ed3f3adce..8845b60e5 100644 --- a/src/ui/dialog/align-and-distribute.cpp +++ b/src/ui/dialog/align-and-distribute.cpp @@ -102,6 +102,7 @@ void ActionAlign::do_action(SPDesktop *desktop, int index) if (selected.empty()) return; const Coeffs &a = _allCoeffs[index]; + SPItem *focus = NULL; Geom::OptRect b = Geom::OptRect(); Selection::CompareSize horiz = (a.mx0 != 0.0) || (a.mx1 != 0.0) ? Selection::HORIZONTAL : Selection::VERTICAL; @@ -109,16 +110,16 @@ void ActionAlign::do_action(SPDesktop *desktop, int index) switch (AlignTarget(prefs->getInt("/dialogs/align/align-to", 6))) { case LAST: - b = SP_ITEM(*selected.begin())->desktopPreferredBounds(); + focus = SP_ITEM(*selected.begin()); break; case FIRST: - b = SP_ITEM(*--(selected.end()))->desktopPreferredBounds(); + focus = SP_ITEM(*--(selected.end())); break; case BIGGEST: - b = selection->largestItem(horiz)->desktopPreferredBounds(); + focus = selection->largestItem(horiz); break; case SMALLEST: - b = selection->smallestItem(horiz)->desktopPreferredBounds(); + focus = selection->smallestItem(horiz); break; case PAGE: b = sp_desktop_document(desktop)->preferredBounds(); @@ -134,6 +135,8 @@ void ActionAlign::do_action(SPDesktop *desktop, int index) break; }; + if(focus) + b = focus->desktopPreferredBounds(); g_return_if_fail(b); // Generate the move point from the selected bounding box @@ -146,13 +149,12 @@ void ActionAlign::do_action(SPDesktop *desktop, int index) //Move each item in the selected list separately for (std::list::iterator it(selected.begin()); - it != selected.end(); - ++it) + it != selected.end(); ++it) { sp_desktop_document (desktop)->ensureUpToDate(); if (!sel_as_group) b = (*it)->desktopPreferredBounds(); - if (b) { + if (b && (!focus || (*it) != focus)) { Geom::Point const sp(a.sx0 * b->min()[Geom::X] + a.sx1 * b->max()[Geom::X], a.sy0 * b->min()[Geom::Y] + a.sy1 * b->max()[Geom::Y]); Geom::Point const mp_rel( mp - sp ); -- cgit v1.2.3 From ed6229c5b41b72df6c59878aaae328cb2b6e3559 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Fri, 12 Jul 2013 13:06:09 -0400 Subject: Use Jon Cruz info about OptRect to correctly get area height and width (bzr r12417) --- src/selection.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/selection.cpp b/src/selection.cpp index 8f43d8e70..784219c88 100644 --- a/src/selection.cpp +++ b/src/selection.cpp @@ -372,12 +372,12 @@ SPItem *Selection::_sizeistItem(bool sml, Selection::CompareSize compare) { SPItem *ist = NULL; for ( GSList const *i = items; i != NULL ; i = i->next ) { - Geom::OptRect bbox = SP_ITEM(i->data)->desktopPreferredBounds(); - if (!bbox) continue; + Geom::OptRect obox = SP_ITEM(i->data)->desktopPreferredBounds(); + if (!obox || obox.isEmpty()) continue; + Geom::Rect bbox = *obox; - gdouble size = compare == 2 ? - (*bbox)[Geom::X].extent() * (*bbox)[Geom::Y].extent() : - (*bbox)[compare == 1 ? Geom::X : Geom::Y].extent(); + gdouble size = compare == 2 ? bbox.area() : + (compare == 1 ? bbox.width() : bbox.height()); size = sml ? size : size * -1; if (size < max) { max = size; -- cgit v1.2.3 From 5977386b97689dfd12335f7444217634c66b5930 Mon Sep 17 00:00:00 2001 From: Slagvi Public Date: Sat, 13 Jul 2013 00:24:56 +0200 Subject: Template info loading + searching by keywords added. (bzr r12379.2.9) --- src/ui/dialog/static-template-load-tab.cpp | 6 ++ src/ui/dialog/template-load-tab.cpp | 108 ++++++++++++++++++++++++++--- src/ui/dialog/template-load-tab.h | 5 ++ 3 files changed, 109 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/static-template-load-tab.cpp b/src/ui/dialog/static-template-load-tab.cpp index 26b999aec..35f3430fb 100644 --- a/src/ui/dialog/static-template-load-tab.cpp +++ b/src/ui/dialog/static-template-load-tab.cpp @@ -46,6 +46,9 @@ StaticTemplateLoadTab::StaticTemplateLoadTab() align = manage(new Gtk::Alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER, 0.0, 0.0)); _info_box.pack_start(*align, Gtk::PACK_SHRINK, 5); align->add(_more_info_button); + + _more_info_button.signal_pressed().connect( + sigc::mem_fun(*this, &StaticTemplateLoadTab::_displayTemplateDetails)); } @@ -68,6 +71,9 @@ void StaticTemplateLoadTab::_displayTemplateInfo() _template_name_label.set_text(_current_template); _template_author_label.set_text(_tdata[_current_template].author); _short_description_label.set_text(_tdata[_current_template].short_description); + + Glib::ustring imagePath = Glib::build_filename(Glib::path_get_dirname(_tdata[_current_template].path), _tdata[_current_template].preview_name); + _preview_image.set(imagePath); } } diff --git a/src/ui/dialog/template-load-tab.cpp b/src/ui/dialog/template-load-tab.cpp index 95baccc75..6d9c61078 100644 --- a/src/ui/dialog/template-load-tab.cpp +++ b/src/ui/dialog/template-load-tab.cpp @@ -10,6 +10,7 @@ #include "template-load-tab.h" +#include #include #include @@ -18,6 +19,17 @@ #include "path-prefix.h" #include "preferences.h" #include "inkscape.h" +#include "xml/repr.h" +#include "xml/document.h" +#include "xml/node.h" + +// +#include + +#include +#include +#include +// namespace Inkscape { @@ -80,10 +92,10 @@ void TemplateLoadTab::_displayTemplateInfo() void TemplateLoadTab::_initKeywordsList() { - _keywords_combo.append("All"); + _keywords_combo.append(_("All")); - for (int i = 0 ; i < 10 ; ++i) { - _keywords_combo.append( "Keyword" + Glib::ustring::format(i)); + for (std::set::iterator it = _keywords.begin() ; it != _keywords.end() ; ++it){ + _keywords_combo.append(*it); } } @@ -108,6 +120,8 @@ void TemplateLoadTab::_initLists() void TemplateLoadTab::_keywordSelected() { _current_keyword = _keywords_combo.get_active_text(); + if (_current_keyword == "" && _keywords_combo.get_entry_text().size() > 0) + _current_keyword = _keywords_combo.get_entry_text(); _refreshTemplatesList(); } @@ -117,9 +131,11 @@ void TemplateLoadTab::_refreshTemplatesList() _tlist_store->clear(); for (std::map::iterator it = _tdata.begin() ; it != _tdata.end() ; ++it) { - Gtk::TreeModel::iterator iter = _tlist_store->append(); - Gtk::TreeModel::Row row = *iter; - row[_columns.textValue] = it->first; + if (it->second.keywords.count(_current_keyword) > 0 || _current_keyword == _("All") || _current_keyword == ""){ + Gtk::TreeModel::iterator iter = _tlist_store->append(); + Gtk::TreeModel::Row row = *iter; + row[_columns.textValue] = it->first; + } } } @@ -130,7 +146,7 @@ void TemplateLoadTab::_loadTemplates() _getTemplatesFromDir(profile_path("templates") + _loading_path); // system templates dir - _getTemplatesFromDir(INKSCAPE_TEMPLATESDIR + _loading_path); + // _getTemplatesFromDir(INKSCAPE_TEMPLATESDIR + _loading_path); } @@ -138,9 +154,54 @@ TemplateLoadTab::TemplateData TemplateLoadTab::_processTemplateFile(const Glib:: { TemplateData result; result.path = path; - result.display_name = Glib::path_get_basename(path); + result.display_name = Glib::path_get_basename(path);/* result.short_description = "LaLaLaLa"; - result.author = "JAASDASD"; + result.author = "JAASDASD";*/ + + Inkscape::XML::Document *rdoc; + rdoc = sp_repr_read_file(path.data(), SP_SVG_NS_URI); + Inkscape::XML::Node *myRoot; + Inkscape::XML::Node *dataNode; + if (rdoc){ + myRoot = rdoc->root(); + if (strcmp(myRoot->name(), "svg:svg") != 0){ // Wrong file format + return result; + } + + myRoot = sp_repr_lookup_name(myRoot, "inkscape:_templateinfo"); + + if (myRoot == NULL) // No template info + return result; + + if ((dataNode = sp_repr_lookup_name(myRoot, "inkscape:_name")) != NULL) + result.display_name = dgettext(NULL, dataNode->firstChild()->content()); + if ((dataNode = sp_repr_lookup_name(myRoot, "inkscape:author")) != NULL) + result.author = dataNode->firstChild()->content(); + if ((dataNode = sp_repr_lookup_name(myRoot, "inkscape:_short")) != NULL) + result.short_description = dgettext(NULL, dataNode->firstChild()->content()); + if ((dataNode = sp_repr_lookup_name(myRoot, "inkscape:_long") )!= NULL) + result.long_description = dgettext(NULL, dataNode->firstChild()->content()); + if ((dataNode = sp_repr_lookup_name(myRoot, "inkscape:preview")) != NULL) + result.preview_name = dataNode->firstChild()->content(); + if ((dataNode = sp_repr_lookup_name(myRoot, "inkscape:date")) != NULL){ + result.creation_date = dataNode->firstChild()->content(); + } + + if ((dataNode = sp_repr_lookup_name(myRoot, "inkscape:_keywords")) != NULL){ + Glib::ustring data = dataNode->firstChild()->content(); + while (!data.empty()){ + int pos = data.find_first_of(" "); + Glib::ustring keyword = dgettext(NULL, data.substr(0, pos).data()); + result.keywords.insert(keyword); + std::cout< 0){ + message += "Keywords: "; + for (std::set::iterator it = tmpl.keywords.begin(); it != tmpl.keywords.end(); ++it) + message += *it + " "; + message += "\n\n"; + } + + if (tmpl.author != "") + message += "By: " + _tdata[_current_template].author + " " + tmpl.creation_date + "\n\n"; + + Gtk::MessageDialog dl(message, false, Gtk::MESSAGE_OTHER); + dl.run(); +} + } } diff --git a/src/ui/dialog/template-load-tab.h b/src/ui/dialog/template-load-tab.h index 7d1e25d6d..55893eed0 100644 --- a/src/ui/dialog/template-load-tab.h +++ b/src/ui/dialog/template-load-tab.h @@ -39,6 +39,9 @@ protected: Glib::ustring display_name; Glib::ustring author; Glib::ustring short_description; + Glib::ustring long_description; + Glib::ustring preview_name; + Glib::ustring creation_date; std::set keywords; }; @@ -57,6 +60,7 @@ protected: Glib::ustring _current_template; Glib::ustring _loading_path; std::map _tdata; + std::set _keywords; virtual void _displayTemplateInfo(); @@ -64,6 +68,7 @@ protected: virtual void _refreshTemplatesList(); void _loadTemplates(); void _initLists(); + void _displayTemplateDetails(); Gtk::HBox _main_box; Gtk::VBox _tlist_box; -- cgit v1.2.3 From 44431062712056a395e0708b89f600a1ffb78343 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sat, 13 Jul 2013 14:10:01 -0700 Subject: Whitespace cleanup. (bzr r12418) --- src/util/units.cpp | 158 ++++++++++++++++++++++++++--------------------------- 1 file changed, 79 insertions(+), 79 deletions(-) (limited to 'src') diff --git a/src/util/units.cpp b/src/util/units.cpp index f822d01de..002bf3b07 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -60,10 +60,10 @@ int Unit::defaultDigits() const { * * The primary unit's conversion factor is required to be 1.00 */ -UnitTable::UnitTable() +UnitTable::UnitTable() { // if we swich to the xml file, don't forget to force locale to 'C' - // load("share/ui/units.xml"); // <-- Buggy + // load("share/ui/units.xml"); // <-- Buggy gchar *filename = g_build_filename(INKSCAPE_UIDIR, "units.txt", NULL); loadText(filename); g_free(filename); @@ -72,8 +72,8 @@ UnitTable::UnitTable() UnitTable::~UnitTable() { UnitMap::iterator iter = _unit_map.begin(); while (iter != _unit_map.end()) { - delete (*iter).second; - ++iter; + delete (*iter).second; + ++iter; } } @@ -81,7 +81,7 @@ UnitTable::~UnitTable() { void UnitTable::addUnit(Unit const &u, bool primary) { _unit_map[u.abbr] = new Unit(u); if (primary) { - _primary_unit[u.type] = u.abbr; + _primary_unit[u.type] = u.abbr; } } @@ -89,26 +89,26 @@ void UnitTable::addUnit(Unit const &u, bool primary) { Unit UnitTable::getUnit(Glib::ustring const &unit_abbr) const { UnitMap::const_iterator iter = _unit_map.find(unit_abbr); if (iter != _unit_map.end()) { - return *((*iter).second); + return *((*iter).second); } else { - return Unit(); + return Unit(); } } /** Remove a unit definition from the given unit type table */ bool UnitTable::deleteUnit(Unit const &u) { if (u.abbr == _primary_unit[u.type]) { - // Cannot delete the primary unit type since it's - // used for conversions - return false; + // Cannot delete the primary unit type since it's + // used for conversions + return false; } UnitMap::iterator iter = _unit_map.find(u.abbr); if (iter != _unit_map.end()) { - delete (*iter).second; - _unit_map.erase(iter); - return true; + delete (*iter).second; + _unit_map.erase(iter); + return true; } else { - return false; + return false; } } @@ -125,9 +125,9 @@ UnitTable::UnitMap UnitTable::units(UnitType type) const UnitMap submap; for (UnitMap::const_iterator iter = _unit_map.begin(); iter != _unit_map.end(); ++iter) { - if (((*iter).second)->type == type) { - submap.insert(UnitMap::value_type((*iter).first, new Unit(*((*iter).second)))); - } + if (((*iter).second)->type == type) { + submap.insert(UnitMap::value_type((*iter).first, new Unit(*((*iter).second)))); + } } return submap; @@ -140,10 +140,10 @@ Glib::ustring UnitTable::primary(UnitType type) const } /** Loads units from a text file. - + loadText loads and merges the contents of the given file into the UnitTable, possibly overwriting existing unit definitions. - + @param filename: file to be loaded*/ bool UnitTable::loadText(Glib::ustring const &filename) { @@ -152,11 +152,11 @@ bool UnitTable::loadText(Glib::ustring const &filename) // Open file for reading FILE * f = fopen(filename.c_str(), "r"); if (f == NULL) { - g_warning("Could not open units file '%s': %s\n", - filename.c_str(), strerror(errno)); + g_warning("Could not open units file '%s': %s\n", + filename.c_str(), strerror(errno)); g_warning("* INKSCAPE_DATADIR is: '%s'\n", INKSCAPE_DATADIR); g_warning("* INKSCAPE_UIDIR is: '%s'\n", INKSCAPE_UIDIR); - return false; + return false; } // bypass current locale in order to make @@ -167,51 +167,51 @@ bool UnitTable::loadText(Glib::ustring const &filename) setlocale (LC_NUMERIC, "C"); while (fgets(buf, BUFSIZE, f) != NULL) { - char name[BUFSIZE]; - char plural[BUFSIZE]; - char abbr[BUFSIZE]; - char type[BUFSIZE]; - double factor; - char primary[BUFSIZE]; - - int nchars = 0; - // locale is set to C, scanning %lf should work _everywhere_ - if (sscanf(buf, "%15s %15s %15s %15s %8lf %1s %15n", - name, plural, abbr, type, &factor, primary, &nchars) != 6) - { - // Skip the line - doesn't appear to be valid - continue; - } - - g_assert(nchars < BUFSIZE); - - char *desc = buf; - desc += nchars; // buf is now only the description - - // insert into _unit_map - Unit u; - u.name = name; - u.name_plural = plural; - u.abbr = abbr; - u.description = desc; - u.factor = factor; - - if (streq(type, "DIMENSIONLESS")) { - u.type = UNIT_TYPE_DIMENSIONLESS; - } else if (streq(type, "LINEAR")) { - u.type = UNIT_TYPE_LINEAR; - } else if (streq(type, "RADIAL")) { - u.type = UNIT_TYPE_RADIAL; - } else if (streq(type, "FONT_HEIGHT")) { - u.type = UNIT_TYPE_FONT_HEIGHT; - } else { - g_warning("Skipping unknown unit type '%s' for %s.\n", - type, name); - continue; - } - - // if primary is 'Y', list this unit as a primary - addUnit(u, (primary[0]=='Y' || primary[0]=='y')); + char name[BUFSIZE]; + char plural[BUFSIZE]; + char abbr[BUFSIZE]; + char type[BUFSIZE]; + double factor; + char primary[BUFSIZE]; + + int nchars = 0; + // locale is set to C, scanning %lf should work _everywhere_ + if (sscanf(buf, "%15s %15s %15s %15s %8lf %1s %15n", + name, plural, abbr, type, &factor, primary, &nchars) != 6) + { + // Skip the line - doesn't appear to be valid + continue; + } + + g_assert(nchars < BUFSIZE); + + char *desc = buf; + desc += nchars; // buf is now only the description + + // insert into _unit_map + Unit u; + u.name = name; + u.name_plural = plural; + u.abbr = abbr; + u.description = desc; + u.factor = factor; + + if (streq(type, "DIMENSIONLESS")) { + u.type = UNIT_TYPE_DIMENSIONLESS; + } else if (streq(type, "LINEAR")) { + u.type = UNIT_TYPE_LINEAR; + } else if (streq(type, "RADIAL")) { + u.type = UNIT_TYPE_RADIAL; + } else if (streq(type, "FONT_HEIGHT")) { + u.type = UNIT_TYPE_FONT_HEIGHT; + } else { + g_warning("Skipping unknown unit type '%s' for %s.\n", + type, name); + continue; + } + + // if primary is 'Y', list this unit as a primary + addUnit(u, (primary[0]=='Y' || primary[0]=='y')); } @@ -221,9 +221,9 @@ bool UnitTable::loadText(Glib::ustring const &filename) // close file if (fclose(f) != 0) { - g_warning("Error closing units file '%s': %s\n", - filename.c_str(), strerror(errno)); - return false; + g_warning("Error closing units file '%s': %s\n", + filename.c_str(), strerror(errno)); + return false; } return true; @@ -235,9 +235,9 @@ bool UnitTable::load(Glib::ustring const &filename) { int result = handler.parseFile( filename.c_str() ); if ( result != 0 ) { // perhaps - g_warning("Problem loading units file '%s': %d\n", - filename.c_str(), result); - return false; + g_warning("Problem loading units file '%s': %d\n", + filename.c_str(), result); + return false; } return true; @@ -249,9 +249,9 @@ bool UnitTable::save(Glib::ustring const &filename) { // open file for writing FILE *f = fopen(filename.c_str(), "w"); if (f == NULL) { - g_warning("Could not open units file '%s': %s\n", - filename.c_str(), strerror(errno)); - return false; + g_warning("Could not open units file '%s': %s\n", + filename.c_str(), strerror(errno)); + return false; } // write out header @@ -268,9 +268,9 @@ bool UnitTable::save(Glib::ustring const &filename) { // close file if (fclose(f) != 0) { - g_warning("Error closing units file '%s': %s\n", - filename.c_str(), strerror(errno)); - return false; + g_warning("Error closing units file '%s': %s\n", + filename.c_str(), strerror(errno)); + return false; } return true; -- cgit v1.2.3 From 8f989e27529c399b7bc23eed49c88df42f42ff1c Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sat, 13 Jul 2013 15:06:55 -0700 Subject: Minor C++ish refactoring pass. (bzr r12419) --- src/util/units.cpp | 195 ++++++++++++++++++++++++++++------------------------- src/util/units.h | 62 +++++++++++++++-- 2 files changed, 158 insertions(+), 99 deletions(-) (limited to 'src') diff --git a/src/util/units.cpp b/src/util/units.cpp index 002bf3b07..d1275b082 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -11,6 +11,39 @@ #include "path-prefix.h" #include "streq.h" +using Inkscape::Util::UNIT_TYPE_DIMENSIONLESS; +using Inkscape::Util::UNIT_TYPE_LINEAR; +using Inkscape::Util::UNIT_TYPE_RADIAL; +using Inkscape::Util::UNIT_TYPE_FONT_HEIGHT; + +namespace +{ + +/** + * A std::map that gives the data type value for the string version. + * + * Note that we'd normally not return a reference to an internal version, but + * for this constant case it allows us to check against getTypeMappings().end(). + */ +/** @todo consider hiding map behind hasFoo() and getFoo() type functions.*/ +std::map &getTypeMappings() +{ + static bool init = false; + static std::map typeMap; + if (!init) + { + init = true; + typeMap["DIMENSIONLESS"] = UNIT_TYPE_DIMENSIONLESS; + typeMap["LINEAR"] = UNIT_TYPE_LINEAR; + typeMap["RADIAL"] = UNIT_TYPE_RADIAL; + typeMap["FONT_HEIGHT"] = UNIT_TYPE_FONT_HEIGHT; + // Note that code was not yet handling LINEAR_SCALED, TIME, QTY and NONE + } + return typeMap; +} + +} // namespace + namespace Inkscape { namespace Util { @@ -40,26 +73,46 @@ UnitsSAXHandler::UnitsSAXHandler(UnitTable *table) : #define BUFSIZE (255) -/** - * Returns the suggested precision to use for displaying numbers - * of this unit. - */ +Unit::Unit() : + type(UNIT_TYPE_DIMENSIONLESS), // should this or NONE be the default? + factor(1.0), + name(), + name_plural(), + abbr(), + description() +{ +} + +Unit::Unit(UnitType type, + double factor, + Glib::ustring const &name, + Glib::ustring const &name_plural, + Glib::ustring const &abbr, + Glib::ustring const &description) : + type(type), + factor(factor), + name(name), + name_plural(name_plural), + abbr(abbr), + description(description) +{ +} + +void Unit::clear() +{ + *this = Unit(); +} + int Unit::defaultDigits() const { int factor_digits = int(log10(factor)); if (factor_digits < 0) { g_warning("factor = %f, factor_digits = %d", factor, factor_digits); g_warning("factor_digits < 0 - returning 0"); - return 0; - } else { - return factor_digits; + factor_digits = 0; } + return factor_digits; } -/** - * Initializes the unit tables and identifies the primary unit types. - * - * The primary unit's conversion factor is required to be 1.00 - */ UnitTable::UnitTable() { // if we swich to the xml file, don't forget to force locale to 'C' @@ -70,14 +123,12 @@ UnitTable::UnitTable() } UnitTable::~UnitTable() { - UnitMap::iterator iter = _unit_map.begin(); - while (iter != _unit_map.end()) { + for (UnitMap::iterator iter = _unit_map.begin(); iter != _unit_map.end(); ++iter) + { delete (*iter).second; - ++iter; } } -/** Add a new unit to the table */ void UnitTable::addUnit(Unit const &u, bool primary) { _unit_map[u.abbr] = new Unit(u); if (primary) { @@ -85,7 +136,6 @@ void UnitTable::addUnit(Unit const &u, bool primary) { } } -/** Retrieve a given unit based on its string identifier */ Unit UnitTable::getUnit(Glib::ustring const &unit_abbr) const { UnitMap::const_iterator iter = _unit_map.find(unit_abbr); if (iter != _unit_map.end()) { @@ -95,36 +145,31 @@ Unit UnitTable::getUnit(Glib::ustring const &unit_abbr) const { } } -/** Remove a unit definition from the given unit type table */ bool UnitTable::deleteUnit(Unit const &u) { - if (u.abbr == _primary_unit[u.type]) { - // Cannot delete the primary unit type since it's - // used for conversions - return false; - } - UnitMap::iterator iter = _unit_map.find(u.abbr); - if (iter != _unit_map.end()) { - delete (*iter).second; - _unit_map.erase(iter); - return true; - } else { - return false; + bool deleted = false; + // Cannot delete the primary unit type since it's + // used for conversions + if (u.abbr != _primary_unit[u.type]) { + UnitMap::iterator iter = _unit_map.find(u.abbr); + if (iter != _unit_map.end()) { + delete (*iter).second; + _unit_map.erase(iter); + deleted = true; + } } + return deleted; } -/** Returns true if the given string 'name' is a valid unit in the table */ bool UnitTable::hasUnit(Glib::ustring const &unit) const { UnitMap::const_iterator iter = _unit_map.find(unit); return (iter != _unit_map.end()); } -/** Provides an iteratable list of items in the given unit table */ UnitTable::UnitMap UnitTable::units(UnitType type) const { UnitMap submap; - for (UnitMap::const_iterator iter = _unit_map.begin(); - iter != _unit_map.end(); ++iter) { + for (UnitMap::const_iterator iter = _unit_map.begin(); iter != _unit_map.end(); ++iter) { if (((*iter).second)->type == type) { submap.insert(UnitMap::value_type((*iter).first, new Unit(*((*iter).second)))); } @@ -133,21 +178,14 @@ UnitTable::UnitMap UnitTable::units(UnitType type) const return submap; } -/** Returns the default unit abbr for the given type */ Glib::ustring UnitTable::primary(UnitType type) const { return _primary_unit[type]; } -/** Loads units from a text file. - - loadText loads and merges the contents of the given file into the UnitTable, - possibly overwriting existing unit definitions. - - @param filename: file to be loaded*/ bool UnitTable::loadText(Glib::ustring const &filename) { - char buf[BUFSIZE]; + char buf[BUFSIZE] = {0}; // Open file for reading FILE * f = fopen(filename.c_str(), "r"); @@ -159,23 +197,24 @@ bool UnitTable::loadText(Glib::ustring const &filename) return false; } + /** @todo fix this to use C++ means and explicit locale to avoid need to change. */ // bypass current locale in order to make // sscanf read floats with '.' as a separator // set locale to 'C' and keep old locale - char *old_locale; - old_locale = g_strdup (setlocale (LC_NUMERIC, NULL)); + char *old_locale = g_strdup(setlocale(LC_NUMERIC, NULL)); setlocale (LC_NUMERIC, "C"); while (fgets(buf, BUFSIZE, f) != NULL) { - char name[BUFSIZE]; - char plural[BUFSIZE]; - char abbr[BUFSIZE]; - char type[BUFSIZE]; - double factor; - char primary[BUFSIZE]; + char name[BUFSIZE] = {0}; + char plural[BUFSIZE] = {0}; + char abbr[BUFSIZE] = {0}; + char type[BUFSIZE] = {0}; + double factor = 0.0; + char primary[BUFSIZE] = {0}; int nchars = 0; // locale is set to C, scanning %lf should work _everywhere_ + /** @todo address %15n, which causes a warning: */ if (sscanf(buf, "%15s %15s %15s %15s %8lf %1s %15n", name, plural, abbr, type, &factor, primary, &nchars) != 6) { @@ -189,30 +228,17 @@ bool UnitTable::loadText(Glib::ustring const &filename) desc += nchars; // buf is now only the description // insert into _unit_map - Unit u; - u.name = name; - u.name_plural = plural; - u.abbr = abbr; - u.description = desc; - u.factor = factor; - - if (streq(type, "DIMENSIONLESS")) { - u.type = UNIT_TYPE_DIMENSIONLESS; - } else if (streq(type, "LINEAR")) { - u.type = UNIT_TYPE_LINEAR; - } else if (streq(type, "RADIAL")) { - u.type = UNIT_TYPE_RADIAL; - } else if (streq(type, "FONT_HEIGHT")) { - u.type = UNIT_TYPE_FONT_HEIGHT; - } else { - g_warning("Skipping unknown unit type '%s' for %s.\n", - type, name); + if (getTypeMappings().find(type) == getTypeMappings().end()) + { + g_warning("Skipping unknown unit type '%s' for %s.\n", type, name); continue; } + UnitType utype = getTypeMappings()[type]; + + Unit u(utype, factor, name, plural, abbr, desc); // if primary is 'Y', list this unit as a primary addUnit(u, (primary[0]=='Y' || primary[0]=='y')); - } // set back the saved locale @@ -221,8 +247,7 @@ bool UnitTable::loadText(Glib::ustring const &filename) // close file if (fclose(f) != 0) { - g_warning("Error closing units file '%s': %s\n", - filename.c_str(), strerror(errno)); + g_warning("Error closing units file '%s': %s\n", filename.c_str(), strerror(errno)); return false; } @@ -235,22 +260,19 @@ bool UnitTable::load(Glib::ustring const &filename) { int result = handler.parseFile( filename.c_str() ); if ( result != 0 ) { // perhaps - g_warning("Problem loading units file '%s': %d\n", - filename.c_str(), result); + g_warning("Problem loading units file '%s': %d\n", filename.c_str(), result); return false; } return true; } -/** Saves the current UnitTable to the given file. */ bool UnitTable::save(Glib::ustring const &filename) { // open file for writing FILE *f = fopen(filename.c_str(), "w"); if (f == NULL) { - g_warning("Could not open units file '%s': %s\n", - filename.c_str(), strerror(errno)); + g_warning("Could not open units file '%s': %s\n", filename.c_str(), strerror(errno)); return false; } @@ -268,8 +290,7 @@ bool UnitTable::save(Glib::ustring const &filename) { // close file if (fclose(f) != 0) { - g_warning("Error closing units file '%s': %s\n", - filename.c_str(), strerror(errno)); + g_warning("Error closing units file '%s': %s\n", filename.c_str(), strerror(errno)); return false; } @@ -281,12 +302,7 @@ void UnitsSAXHandler::_startElement(xmlChar const *name, xmlChar const **attrs) { if (streq("unit", (char const *)name)) { // reset for next use - unit.name.clear(); - unit.name_plural.clear(); - unit.abbr.clear(); - unit.description.clear(); - unit.type = UNIT_TYPE_DIMENSIONLESS; - unit.factor = 1.0; + unit.clear(); primary = false; skip = false; @@ -294,14 +310,9 @@ void UnitsSAXHandler::_startElement(xmlChar const *name, xmlChar const **attrs) char const *const key = (char const *)attrs[i]; if (streq("type", key)) { char const *type = (char const*)attrs[i+1]; - if (streq(type, "DIMENSIONLESS")) { - unit.type = UNIT_TYPE_DIMENSIONLESS; - } else if (streq(type, "LINEAR")) { - unit.type = UNIT_TYPE_LINEAR; - } else if (streq(type, "RADIAL")) { - unit.type = UNIT_TYPE_RADIAL; - } else if (streq(type, "FONT_HEIGHT")) { - unit.type = UNIT_TYPE_FONT_HEIGHT; + if (getTypeMappings().find(type) != getTypeMappings().end()) + { + unit.type = getTypeMappings()[type]; } else { g_warning("Skipping unknown unit type '%s' for %s.\n", type, name); skip = true; diff --git a/src/util/units.h b/src/util/units.h index b22bdb1f2..40c89a4a0 100644 --- a/src/util/units.h +++ b/src/util/units.h @@ -36,40 +36,78 @@ const char DEG[] = "°"; class Unit { public: - Glib::ustring name; - Glib::ustring name_plural; - Glib::ustring abbr; - Glib::ustring description; - - UnitType type; + Unit(); + Unit(UnitType type, + double factor, + Glib::ustring const &name, + Glib::ustring const &name_plural, + Glib::ustring const &abbr, + Glib::ustring const &description); - double factor; + void clear(); bool isAbsolute() const { return type != UNIT_TYPE_DIMENSIONLESS; } + + /** + * Returns the suggested precision to use for displaying numbers + * of this unit. + */ int defaultDigits() const; + + UnitType type; + double factor; + Glib::ustring name; + Glib::ustring name_plural; + Glib::ustring abbr; + Glib::ustring description; }; class UnitTable { public: + /** + * Initializes the unit tables and identifies the primary unit types. + * + * The primary unit's conversion factor is required to be 1.00 + */ UnitTable(); virtual ~UnitTable(); typedef std::map UnitMap; + /** Add a new unit to the table */ void addUnit(Unit const& u, bool primary); + + /** Retrieve a given unit based on its string identifier */ Unit getUnit(Glib::ustring const& name) const; + + /** Remove a unit definition from the given unit type table */ bool deleteUnit(Unit const& u); + + /** Returns true if the given string 'name' is a valid unit in the table */ bool hasUnit(Glib::ustring const &name) const; + /** Provides an iteratable list of items in the given unit table */ UnitTable::UnitMap units(UnitType type) const; + /** Returns the default unit abbr for the given type */ Glib::ustring primary(UnitType type) const; double getScale() const; + void setScale(); bool load(Glib::ustring const &filename); + + /** Loads units from a text file. + * + * loadText loads and merges the contents of the given file into the UnitTable, + * possibly overwriting existing unit definitions. + * + * @param filename file to be loaded + */ bool loadText(Glib::ustring const &filename); + + /** Saves the current UnitTable to the given file. */ bool save(Glib::ustring const &filename); protected: @@ -88,3 +126,13 @@ class UnitTable { } // namespace Inkscape #endif // define INKSCAPE_UTIL_UNITS_H +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : -- cgit v1.2.3 From 5dfee0e64ecd76e42e15e4538dc742da19528997 Mon Sep 17 00:00:00 2001 From: Christoffer Holmstedt Date: Tue, 16 Jul 2013 10:13:07 +0200 Subject: Merging patch from Peter Liljenberg. License comparison is now done by comparing license URI and nothing else. (bzr r12419.1.1) --- src/rdf.cpp | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++------ src/rdf.h | 2 +- 2 files changed, 86 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/rdf.cpp b/src/rdf.cpp index 72aea4898..4094ece5e 100644 --- a/src/rdf.cpp +++ b/src/rdf.cpp @@ -225,6 +225,9 @@ struct rdf_license_t rdf_licenses [] = { #define XML_TAG_NAME_RDF "rdf:RDF" #define XML_TAG_NAME_WORK "cc:Work" #define XML_TAG_NAME_LICENSE "cc:License" +// Note the lowercase L! +#define XML_TAG_NAME_LICENSE_PROP "cc:license" + // Remember when using the "title" and "tip" elements to pass them through // the localization functions when you use them! @@ -338,7 +341,7 @@ public: struct rdf_work_entity_t const & entity, gchar const * text ); - static struct rdf_license_t *getLicense(SPDocument const * document); + static struct rdf_license_t *getLicense(SPDocument *document); static void setLicense(SPDocument * doc, struct rdf_license_t const * license); }; @@ -1028,26 +1031,95 @@ rdf_match_license(Inkscape::XML::Node const *repr, struct rdf_license_t const *l } // Public API: -struct rdf_license_t *rdf_get_license(SPDocument const * document) +struct rdf_license_t *rdf_get_license(SPDocument *document) { return RDFImpl::getLicense(document); } -struct rdf_license_t *RDFImpl::getLicense(SPDocument const *document) +struct rdf_license_t *RDFImpl::getLicense(SPDocument *document) { + // Base license lookup on the URI of cc:license rather than the license + // properties, per instructions from the ccREL gurus. + // (Fixes https://bugs.launchpad.net/inkscape/+bug/372427) + + struct rdf_work_entity_t *entity = rdf_find_entity("license_uri"); + if (entity == NULL) { + g_critical("Can't find internal entity structure for 'license_uri'"); + return NULL; + } + + const gchar *uri = getWorkEntity(document, *entity); + struct rdf_license_t * license_by_uri = NULL; + + if (uri != NULL) { + for (struct rdf_license_t * license = rdf_licenses; license->name; license++) { + if (g_strcmp0(uri, license->uri) == 0) { + license_by_uri = license; + break; + } + } + } + + // To improve backward compatibility, the old license matching code is + // kept as fallback and to warn about and fix discrepancies. + + // TODO: would it be better to do this code on document load? Is + // sp_metadata_build() then the right place to put the call to sort out + // any RDF mess? + + struct rdf_license_t * license_by_properties = NULL; + Inkscape::XML::Node const *repr = getXmlRepr( document, XML_TAG_NAME_LICENSE ); if (repr) { for ( struct rdf_license_t * license = rdf_licenses; license->name; license++ ) { if ( rdf_match_license( repr, license ) ) { - return license; + license_by_properties = license; + break; } } } -#ifdef DEBUG_MATCH - else { - printf("no license XML\n"); + + if (license_by_uri != NULL && license_by_properties != NULL) { + // Both property and structure, use property + if (license_by_uri != license_by_properties) { + // TODO: this should be a user-visible warning, but how? + g_warning("Mismatch between %s and %s metadata:\n" + "%s value URI: %s (using this one!)\n" + "%s derived URI: %s", + XML_TAG_NAME_LICENSE_PROP, + XML_TAG_NAME_LICENSE, + XML_TAG_NAME_LICENSE_PROP, + license_by_uri->uri, + XML_TAG_NAME_LICENSE, + license_by_properties->uri); + } + + // Reset license structure to match so the document is consistent + // (and this will also silence the warning above on repeated calls). + setLicense(document, license_by_uri); + + return license_by_uri; } -#endif + else if (license_by_uri != NULL) { + // Only cc:license property, set structure for backward compatiblity + setLicense(document, license_by_uri); + + return license_by_uri; + } + else if (license_by_properties != NULL) { + // Only cc:License structure + // TODO: this could be a user-visible warning too + g_warning("No %s metadata found, derived license URI from %s: %s", + XML_TAG_NAME_LICENSE_PROP, XML_TAG_NAME_LICENSE, + license_by_properties->uri); + + // Set license property to match + setWorkEntity(document, *entity, license_by_properties->uri); + + return license_by_properties; + } + + // No license info at all return NULL; } @@ -1059,6 +1131,11 @@ void rdf_set_license(SPDocument * doc, struct rdf_license_t const * license) void RDFImpl::setLicense(SPDocument * doc, struct rdf_license_t const * license) { + // When basing license check on only the license URI (see fix for + // https://bugs.launchpad.net/inkscape/+bug/372427 above) we should + // really drop this license section, but keep writing it for a while for + // compatibility with older versions. + // drop old license section Inkscape::XML::Node * repr = getXmlRepr( doc, XML_TAG_NAME_LICENSE ); if (repr) { diff --git a/src/rdf.h b/src/rdf.h index aa742bb62..3dde1cb48 100644 --- a/src/rdf.h +++ b/src/rdf.h @@ -121,7 +121,7 @@ unsigned int rdf_set_work_entity(SPDocument * doc, * \return A pointer to the static RDF license structure * */ -struct rdf_license_t * rdf_get_license(SPDocument const * doc); +struct rdf_license_t * rdf_get_license(SPDocument *doc); /** * \brief Stores an RDF/License XML in the document XML -- cgit v1.2.3 From 4e088d33c04329fe57ef987d577f5aa57f83b644 Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Tue, 16 Jul 2013 15:46:56 -0400 Subject: Shape calculations. re-introduce grid of a smaller size. (http://article.gmane.org/gmane.comp.graphics.inkscape.devel/40786) (bzr r12420) --- src/livarot/Shape.cpp | 8 ++++---- src/livarot/Shape.h | 12 ++++++------ src/livarot/ShapeMisc.cpp | 12 ++++++------ src/livarot/ShapeSweep.cpp | 8 ++++---- 4 files changed, 20 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/livarot/Shape.cpp b/src/livarot/Shape.cpp index 130b1b03a..c29444a33 100644 --- a/src/livarot/Shape.cpp +++ b/src/livarot/Shape.cpp @@ -334,8 +334,8 @@ Shape::AddPoint (const Geom::Point x) pData[n].nextLinkedPoint = -1; pData[n].askForWindingS = NULL; pData[n].askForWindingB = -1; - pData[n].rx[0] = /*Round*/ (p.x[0]); - pData[n].rx[1] = /*Round*/ (p.x[1]); + pData[n].rx[0] = Round(p.x[0]); + pData[n].rx[1] = Round(p.x[1]); } if (_has_voronoi_data) { @@ -2116,8 +2116,8 @@ void Shape::initialisePointData() pData[i].pending = 0; pData[i].edgeOnLeft = -1; pData[i].nextLinkedPoint = -1; - pData[i].rx[0] = /*Round*/ (getPoint(i).x[0]); - pData[i].rx[1] = /*Round*/ (getPoint(i).x[1]); + pData[i].rx[0] = Round(getPoint(i).x[0]); + pData[i].rx[1] = Round(getPoint(i).x[1]); } _point_data_initialised = true; diff --git a/src/livarot/Shape.h b/src/livarot/Shape.h index b999b9dca..98fc2d7bf 100644 --- a/src/livarot/Shape.h +++ b/src/livarot/Shape.h @@ -266,20 +266,20 @@ public: // be careful when using this function // the coordinate rounding function -// inline static double Round(double x) -// { -// return ldexp(rint(ldexp(x, 5)), -5); -// } + inline static double Round(double x) + { + return ldexp(rint(ldexp(x, 9)), -9); + } // 2 miscannellous variations on it, to scale to and back the rounding grid inline static double HalfRound(double x) { - return ldexp(x, -5); + return ldexp(x, -9); } inline static double IHalfRound(double x) { - return ldexp(x, 5); + return ldexp(x, 9); } // boolean operations on polygons (requests intersection-free poylygons) diff --git a/src/livarot/ShapeMisc.cpp b/src/livarot/ShapeMisc.cpp index 5bb8a25ef..6fd40790f 100644 --- a/src/livarot/ShapeMisc.cpp +++ b/src/livarot/ShapeMisc.cpp @@ -49,8 +49,8 @@ Shape::ConvertToForme (Path * dest) for (int i = 0; i < numberOfPoints(); i++) { - pData[i].rx[0] = /*Round*/ (getPoint(i).x[0]); - pData[i].rx[1] = /*Round*/ (getPoint(i).x[1]); + pData[i].rx[0] = Round (getPoint(i).x[0]); + pData[i].rx[1] = Round (getPoint(i).x[1]); } for (int i = 0; i < numberOfEdges(); i++) { @@ -199,8 +199,8 @@ Shape::ConvertToForme (Path * dest, int nbP, Path * *orig, bool splitWhenForced) for (int i = 0; i < numberOfPoints(); i++) { - pData[i].rx[0] = /*Round*/ (getPoint(i).x[0]); - pData[i].rx[1] = /*Round*/ (getPoint(i).x[1]); + pData[i].rx[0] = Round (getPoint(i).x[0]); + pData[i].rx[1] = Round (getPoint(i).x[1]); } for (int i = 0; i < numberOfEdges(); i++) { @@ -352,8 +352,8 @@ Shape::ConvertToFormeNested (Path * dest, int nbP, Path * *orig, int wildPath,in for (int i = 0; i < numberOfPoints(); i++) { - pData[i].rx[0] = /*Round*/ (getPoint(i).x[0]); - pData[i].rx[1] = /*Round*/ (getPoint(i).x[1]); + pData[i].rx[0] = Round (getPoint(i).x[0]); + pData[i].rx[1] = Round (getPoint(i).x[1]); } for (int i = 0; i < numberOfEdges(); i++) { diff --git a/src/livarot/ShapeSweep.cpp b/src/livarot/ShapeSweep.cpp index ffe5a9d73..c2fd83e31 100644 --- a/src/livarot/ShapeSweep.cpp +++ b/src/livarot/ShapeSweep.cpp @@ -250,8 +250,8 @@ Shape::ConvertToShape (Shape * a, FillRule directed, bool invert) } Geom::Point rPtX; - rPtX[0]= /*Round*/ (ptX[0]); - rPtX[1]= /*Round*/ (ptX[1]); + rPtX[0]= Round (ptX[0]); + rPtX[1]= Round (ptX[1]); int lastPointNo = -1; lastPointNo = AddPoint (rPtX); pData[lastPointNo].rx = rPtX; @@ -1051,8 +1051,8 @@ Shape::Booleen (Shape * a, Shape * b, BooleanOp mod,int cutPathID) } Geom::Point rPtX; - rPtX[0]= /*Round*/ (ptX[0]); - rPtX[1]= /*Round*/ (ptX[1]); + rPtX[0]= Round (ptX[0]); + rPtX[1]= Round (ptX[1]); int lastPointNo = -1; lastPointNo = AddPoint (rPtX); pData[lastPointNo].rx = rPtX; -- cgit v1.2.3 From 3174f1abec451e06ff36bf8f4d9a1e5992ee0382 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Tue, 16 Jul 2013 20:10:36 -0400 Subject: Added new UnitTracker class. (bzr r12380.1.9) --- src/ui/widget/Makefile_insert | 4 +- src/ui/widget/unit-tracker.cpp | 255 +++++++++++++++++++++++++++++++++++++++++ src/ui/widget/unit-tracker.h | 75 ++++++++++++ 3 files changed, 333 insertions(+), 1 deletion(-) create mode 100644 src/ui/widget/unit-tracker.cpp create mode 100644 src/ui/widget/unit-tracker.h (limited to 'src') diff --git a/src/ui/widget/Makefile_insert b/src/ui/widget/Makefile_insert index 2de954674..710b95c2b 100644 --- a/src/ui/widget/Makefile_insert +++ b/src/ui/widget/Makefile_insert @@ -79,5 +79,7 @@ ink_common_sources += \ ui/widget/tolerance-slider.cpp \ ui/widget/tolerance-slider.h \ ui/widget/unit-menu.cpp \ - ui/widget/unit-menu.h + ui/widget/unit-menu.h \ + ui/widget/unit-tracker.h \ + ui/widget/unit-tracker.cpp diff --git a/src/ui/widget/unit-tracker.cpp b/src/ui/widget/unit-tracker.cpp new file mode 100644 index 000000000..b701c785e --- /dev/null +++ b/src/ui/widget/unit-tracker.cpp @@ -0,0 +1,255 @@ +/* + * Inkscape::UI::Widget::UnitTracker + * Simple mediator to synchronize changes to unit menus + * + * Authors: + * Jon A. Cruz + * Matthew Petroff + * + * Copyright (C) 2007 Jon A. Cruz + * Copyright (C) 2013 Matthew Petroff + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#include "unit-tracker.h" +#include "ege-select-one-action.h" + +#define COLUMN_STRING 0 + +namespace Inkscape { +namespace UI { +namespace Widget { + +UnitTracker::UnitTracker(UnitType unit_type) : + _active(0), + _isUpdating(false), + _activeUnitInitialized(false), + _store(0), + _unitList(0), + _actionList(0), + _adjList(0), + _priorValues() +{ + _store = gtk_list_store_new(1, G_TYPE_STRING); + static Inkscape::Util::UnitTable unit_table; + + GtkTreeIter iter; + UnitTable::UnitMap m = _unit_table.units(unit_type); + UnitTable::UnitMap::iterator m_iter = m.begin(); + while(m_iter != m.end()) { + Glib::ustring text = (*m_iter).first; + m_iter++; + gtk_list_store_append(_store, &iter); + gtk_list_store_set(_store, &iter, COLUMN_STRING, text.c_str(), -1); + } + gint count = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(_store), 0); + if ((count > 0) && (_active > count)) { + _setActive(--count); + } else { + _setActive(_active); + } +} + +UnitTracker::~UnitTracker() +{ + // Unhook weak references to GtkActions + while (_actionList) { + g_signal_handlers_disconnect_by_func(G_OBJECT(_actionList->data), (gpointer) _unitChangedCB, this); + g_object_weak_unref(G_OBJECT(_actionList->data), _actionFinalizedCB, this); + _actionList = g_slist_delete_link(_actionList, _actionList); + } + + // Unhook weak references to GtkAdjustments + while (_adjList) { + g_object_weak_unref(G_OBJECT(_adjList->data), _adjustmentFinalizedCB, this); + _adjList = g_slist_delete_link(_adjList, _adjList); + } +} + +bool UnitTracker::isUpdating() const +{ + return _isUpdating; +} + +Inkscape::Util::Unit UnitTracker::getActiveUnit() const +{ + return _activeUnit; +} + +void UnitTracker::setActiveUnit(Inkscape::Util::Unit const *unit) +{ + if (unit) { + GtkTreeIter iter; + int index = 0; + gboolean found = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(_store), &iter); + while (found) { + gchar *storedUnit = 0; + gtk_tree_model_get(GTK_TREE_MODEL(_store), &iter, COLUMN_STRING, &storedUnit, -1); + if (storedUnit && (!unit->abbr.compare(storedUnit))) { + _setActive(index); + break; + } + + found = gtk_tree_model_iter_next(GTK_TREE_MODEL(_store), &iter); + index++; + } + } +} + +void UnitTracker::setActiveUnitByAbbr(gchar const *abbr) +{ + Inkscape::Util::Unit u = _unit_table.getUnit(abbr); + setActiveUnit(&u); +} + +void UnitTracker::addAdjustment(GtkAdjustment *adj) +{ + if (!g_slist_find(_adjList, adj)) { + g_object_weak_ref(G_OBJECT(adj), _adjustmentFinalizedCB, this); + _adjList = g_slist_append(_adjList, adj); + } +} + +void UnitTracker::setFullVal(GtkAdjustment *adj, gdouble val) +{ + _priorValues[adj] = val; +} + +GtkAction *UnitTracker::createAction(gchar const *name, gchar const *label, gchar const *tooltip) +{ + EgeSelectOneAction *act1 = ege_select_one_action_new(name, label, tooltip, NULL, GTK_TREE_MODEL(_store)); + ege_select_one_action_set_label_column(act1, COLUMN_STRING); + if (_active) { + ege_select_one_action_set_active(act1, _active); + } + + ege_select_one_action_set_appearance(act1, "minimal"); + g_object_weak_ref(G_OBJECT(act1), _actionFinalizedCB, this); + g_signal_connect(G_OBJECT(act1), "changed", G_CALLBACK(_unitChangedCB), this); + _actionList = g_slist_append(_actionList, act1); + + return GTK_ACTION(act1); +} + +void UnitTracker::_unitChangedCB(GtkAction *action, gpointer data) +{ + if (action && data) { + EgeSelectOneAction *act = EGE_SELECT_ONE_ACTION(action); + gint active = ege_select_one_action_get_active(act); + UnitTracker *self = reinterpret_cast(data); + self->_setActive(active); + } +} + +void UnitTracker::_actionFinalizedCB(gpointer data, GObject *where_the_object_was) +{ + if (data && where_the_object_was) { + UnitTracker *self = reinterpret_cast(data); + self->_actionFinalized(where_the_object_was); + } +} + +void UnitTracker::_adjustmentFinalizedCB(gpointer data, GObject *where_the_object_was) +{ + if (data && where_the_object_was) { + UnitTracker *self = reinterpret_cast(data); + self->_adjustmentFinalized(where_the_object_was); + } +} + +void UnitTracker::_actionFinalized(GObject *where_the_object_was) +{ + GSList *target = g_slist_find(_actionList, where_the_object_was); + if (target) { + _actionList = g_slist_remove(_actionList, where_the_object_was); + } else { + g_warning("Received a finalization callback for unknown object %p", where_the_object_was); + } +} + +void UnitTracker::_adjustmentFinalized(GObject *where_the_object_was) +{ + GSList *target = g_slist_find(_adjList, where_the_object_was); + if (target) { + _adjList = g_slist_remove(_adjList, where_the_object_was); + } else { + g_warning("Received a finalization callback for unknown object %p", where_the_object_was); + } +} + +void UnitTracker::_setActive(gint active) +{ + if ( active != _active || !_activeUnitInitialized ) { + gint oldActive = _active; + + GtkTreeIter iter; + gboolean found = gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(_store), &iter, NULL, oldActive); + if (found) { + gchar *abbr; + gtk_tree_model_get(GTK_TREE_MODEL(_store), &iter, COLUMN_STRING, &abbr, -1); + Inkscape::Util::Unit unit = _unit_table.getUnit(abbr); + + found = gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(_store), &iter, NULL, active); + if (found) { + gchar *newAbbr; + gtk_tree_model_get(GTK_TREE_MODEL(_store), &iter, COLUMN_STRING, &newAbbr, -1); + Inkscape::Util::Unit newUnit = _unit_table.getUnit(newAbbr); + _activeUnit = newUnit; + + if (_adjList) { + _fixupAdjustments(unit, newUnit); + } + + } else { + g_warning("Did not find new unit"); + } + } else { + g_warning("Did not find old unit"); + } + + _active = active; + + for ( GSList *cur = _actionList ; cur ; cur = g_slist_next(cur) ) { + if (IS_EGE_SELECT_ONE_ACTION(cur->data)) { + EgeSelectOneAction *act = EGE_SELECT_ONE_ACTION(cur->data); + ege_select_one_action_set_active(act, active); + } + } + + _activeUnitInitialized = true; + } +} + +void UnitTracker::_fixupAdjustments(Inkscape::Util::Unit const oldUnit, Inkscape::Util::Unit const newUnit) +{ + _isUpdating = true; + Inkscape::Util::Unit px = _unit_table.getUnit("px"); + for ( GSList *cur = _adjList ; cur ; cur = g_slist_next(cur) ) { + GtkAdjustment *adj = GTK_ADJUSTMENT(cur->data); + gdouble oldVal = gtk_adjustment_get_value(adj); + gdouble val = oldVal; + + if ( (oldUnit.type != Inkscape::Util::UNIT_TYPE_DIMENSIONLESS) + && (newUnit.type == Inkscape::Util::UNIT_TYPE_DIMENSIONLESS) ) + { + val = 1.0 / newUnit.factor; + _priorValues[adj] = Inkscape::Util::Quantity::convert(oldVal, &oldUnit, &px); + } else if ( (oldUnit.type == Inkscape::Util::UNIT_TYPE_DIMENSIONLESS) + && (newUnit.type != Inkscape::Util::UNIT_TYPE_DIMENSIONLESS) ) + { + if (_priorValues.find(adj) != _priorValues.end()) { + val = Inkscape::Util::Quantity::convert(_priorValues[adj], &newUnit, &px); + } + } else { + val = Inkscape::Util::Quantity::convert(oldVal, &oldUnit, &newUnit); + } + + gtk_adjustment_set_value(adj, val); + } + _isUpdating = false; +} + +} // namespace Widget +} // namespace UI +} // namespace Inkscape diff --git a/src/ui/widget/unit-tracker.h b/src/ui/widget/unit-tracker.h new file mode 100644 index 000000000..521fe50c8 --- /dev/null +++ b/src/ui/widget/unit-tracker.h @@ -0,0 +1,75 @@ +/* + * Inkscape::UI::Widget::UnitTracker + * Simple mediator to synchronize changes to unit menus + * + * Authors: + * Jon A. Cruz + * Matthew Petroff + * + * Copyright (C) 2007 Jon A. Cruz + * Copyright (C) 2013 Matthew Petroff + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#ifndef INKSCAPE_UI_WIDGET_UNIT_TRACKER_H +#define INKSCAPE_UI_WIDGET_UNIT_TRACKER_H + +#include +#include + +#include "util/units.h" + +using Inkscape::Util::Unit; +using Inkscape::Util::UnitTable; +using Inkscape::Util::UnitType; + +namespace Inkscape { +namespace UI { +namespace Widget { + +class UnitTracker { +public: + UnitTracker(UnitType unit_type); + virtual ~UnitTracker(); + + bool isUpdating() const; + + void setActiveUnit(Inkscape::Util::Unit const *unit); + void setActiveUnitByAbbr(gchar const *abbr); + Inkscape::Util::Unit getActiveUnit() const; + + void addAdjustment(GtkAdjustment *adj); + void setFullVal(GtkAdjustment *adj, gdouble val); + + GtkAction *createAction(gchar const *name, gchar const *label, gchar const *tooltip); + +protected: + UnitTable _unit_table; + UnitType _type; + +private: + static void _unitChangedCB(GtkAction *action, gpointer data); + static void _actionFinalizedCB(gpointer data, GObject *where_the_object_was); + static void _adjustmentFinalizedCB(gpointer data, GObject *where_the_object_was); + void _setActive(gint index); + void _fixupAdjustments(Inkscape::Util::Unit const oldUnit, Inkscape::Util::Unit const newUnit); + void _actionFinalized(GObject *where_the_object_was); + void _adjustmentFinalized(GObject *where_the_object_was); + + gint _active; + bool _isUpdating; + Inkscape::Util::Unit _activeUnit; + bool _activeUnitInitialized; + GtkListStore *_store; + GSList *_unitList; + GSList *_actionList; + GSList *_adjList; + std::map _priorValues; +}; + +} // namespace Widget +} // namespace UI +} // namespace Inkscape + +#endif // INKSCAPE_UI_WIDGET_UNIT_TRACKER_H -- cgit v1.2.3 From 64bc8cf145b55d33469ef1b84e18ca8df580eda8 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Tue, 16 Jul 2013 20:42:12 -0400 Subject: Removed unused unit includes. (bzr r12380.1.10) --- src/widgets/arc-toolbar.cpp | 4 ---- src/widgets/calligraphy-toolbar.cpp | 4 ---- src/widgets/connector-toolbar.cpp | 4 ---- src/widgets/dropper-toolbar.cpp | 4 ---- src/widgets/erasor-toolbar.cpp | 4 ---- src/widgets/measure-toolbar.cpp | 22 ++++++++++++++-------- src/widgets/pencil-toolbar.cpp | 5 ----- src/widgets/spiral-toolbar.cpp | 4 ---- src/widgets/spray-toolbar.cpp | 4 ---- src/widgets/star-toolbar.cpp | 4 ---- src/widgets/tweak-toolbar.cpp | 4 ---- src/widgets/zoom-toolbar.cpp | 4 ---- 12 files changed, 14 insertions(+), 53 deletions(-) (limited to 'src') diff --git a/src/widgets/arc-toolbar.cpp b/src/widgets/arc-toolbar.cpp index 809050ad9..e3f3a8c79 100644 --- a/src/widgets/arc-toolbar.cpp +++ b/src/widgets/arc-toolbar.cpp @@ -56,14 +56,10 @@ #include "../xml/repr.h" #include "ui/uxmanager.h" #include "../ui/icon-names.h" -#include "../helper/unit-menu.h" -#include "../helper/units.h" -#include "../helper/unit-tracker.h" #include "../pen-context.h" #include "../sp-ellipse.h" #include "../mod360.h" -using Inkscape::UnitTracker; using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; diff --git a/src/widgets/calligraphy-toolbar.cpp b/src/widgets/calligraphy-toolbar.cpp index 4cb4813b5..7c2d6bf19 100644 --- a/src/widgets/calligraphy-toolbar.cpp +++ b/src/widgets/calligraphy-toolbar.cpp @@ -56,13 +56,9 @@ #include "../xml/repr.h" #include "ui/uxmanager.h" #include "../ui/icon-names.h" -#include "../helper/unit-menu.h" -#include "../helper/units.h" -#include "../helper/unit-tracker.h" #include "../pen-context.h" -using Inkscape::UnitTracker; using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; diff --git a/src/widgets/connector-toolbar.cpp b/src/widgets/connector-toolbar.cpp index 7c72f8e0c..293f1184d 100644 --- a/src/widgets/connector-toolbar.cpp +++ b/src/widgets/connector-toolbar.cpp @@ -55,9 +55,6 @@ #include "../xml/repr.h" #include "ui/uxmanager.h" #include "../ui/icon-names.h" -#include "../helper/unit-menu.h" -#include "../helper/units.h" -#include "../helper/unit-tracker.h" #include "../pen-context.h" #include "../sp-namedview.h" #include "../conn-avoid-ref.h" @@ -66,7 +63,6 @@ #include "../sp-path.h" -using Inkscape::UnitTracker; using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; diff --git a/src/widgets/dropper-toolbar.cpp b/src/widgets/dropper-toolbar.cpp index cf58aa507..054955d8f 100644 --- a/src/widgets/dropper-toolbar.cpp +++ b/src/widgets/dropper-toolbar.cpp @@ -54,13 +54,9 @@ #include "../xml/repr.h" #include "ui/uxmanager.h" #include "../ui/icon-names.h" -#include "../helper/unit-menu.h" -#include "../helper/units.h" -#include "../helper/unit-tracker.h" #include "../pen-context.h" #include "../tools-switch.h" -using Inkscape::UnitTracker; using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; diff --git a/src/widgets/erasor-toolbar.cpp b/src/widgets/erasor-toolbar.cpp index 2e074490d..44c79d5f3 100644 --- a/src/widgets/erasor-toolbar.cpp +++ b/src/widgets/erasor-toolbar.cpp @@ -55,13 +55,9 @@ #include "../xml/repr.h" #include "ui/uxmanager.h" #include "../ui/icon-names.h" -#include "../helper/unit-menu.h" -#include "../helper/units.h" -#include "../helper/unit-tracker.h" #include "../pen-context.h" -using Inkscape::UnitTracker; using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; diff --git a/src/widgets/measure-toolbar.cpp b/src/widgets/measure-toolbar.cpp index 387dbbeae..c72cb8fa3 100644 --- a/src/widgets/measure-toolbar.cpp +++ b/src/widgets/measure-toolbar.cpp @@ -52,13 +52,12 @@ #include "../xml/repr.h" #include "ui/uxmanager.h" #include "../ui/icon-names.h" -#include "../helper/unit-menu.h" -#include "../helper/units.h" -#include "../helper/unit-tracker.h" #include "../pen-context.h" #include "../sp-namedview.h" +#include "ui/widget/unit-tracker.h" -using Inkscape::UnitTracker; +using Inkscape::UI::Widget::UnitTracker; +using Inkscape::Util::Unit; using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; @@ -83,15 +82,20 @@ sp_measure_fontsize_value_changed(GtkAdjustment *adj, GObject *tbl) static void measure_unit_changed(GtkAction* /*act*/, GObject* tbl) { UnitTracker* tracker = reinterpret_cast(g_object_get_data(tbl, "tracker")); - SPUnit const *unit = tracker->getActiveUnit(); + Glib::ustring const unit = tracker->getActiveUnit().abbr; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - prefs->setInt("/tools/measure/unitid", unit->unit_id); + prefs->setString("/tools/measure/unit", unit); } void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, GObject* holder) { - UnitTracker* tracker = new UnitTracker( SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE ); - //tracker->setActiveUnit( sp_desktop_namedview(desktop)->doc_units ); + UnitTracker* tracker = new UnitTracker(Inkscape::Util::UNIT_TYPE_LINEAR); + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + tracker->setActiveUnitByAbbr(prefs->getString("/tools/measure/unit").c_str()); + + //tracker->setUnitType(UNIT_TYPE_LINEAR); + //tracker->setUnit("px"); + g_object_set_data( holder, "tracker", tracker ); EgeAdjustmentAction *eact = 0; @@ -121,8 +125,10 @@ void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, G // units menu { GtkAction* act = tracker->createAction( "MeasureUnitsAction", _("Units:"), _("The units to be used for the measurements") ); + //EgeOutputAction* act = ege_output_action_new( "MeasureUnitsAction", _("Units:"), _("The units to be used for the measurements"), 0 ); g_signal_connect_after( G_OBJECT(act), "changed", G_CALLBACK(measure_unit_changed), holder ); gtk_action_group_add_action( mainActions, act ); + //gtk_action_group_add_action( mainActions, GTK_ACTION( act ) ); } } // end of sp_measure_toolbox_prep() diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp index e0cf67bd0..e38b54b5d 100644 --- a/src/widgets/pencil-toolbar.cpp +++ b/src/widgets/pencil-toolbar.cpp @@ -67,15 +67,10 @@ //#include "../ui/tool/multi-path-manipulator.h" #include "../ui/icon-names.h" -#include "../helper/unit-menu.h" -#include "../helper/units.h" -#include "../helper/unit-tracker.h" - #include "../pen-context.h" //#include "../sp-namedview.h" #include "../tools-switch.h" -using Inkscape::UnitTracker; using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; diff --git a/src/widgets/spiral-toolbar.cpp b/src/widgets/spiral-toolbar.cpp index 08d26f3d1..48b509acc 100644 --- a/src/widgets/spiral-toolbar.cpp +++ b/src/widgets/spiral-toolbar.cpp @@ -53,13 +53,9 @@ #include "../xml/repr.h" #include "ui/uxmanager.h" #include "../ui/icon-names.h" -#include "../helper/unit-menu.h" -#include "../helper/units.h" -#include "../helper/unit-tracker.h" #include "../pen-context.h" #include "../sp-spiral.h" -using Inkscape::UnitTracker; using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; diff --git a/src/widgets/spray-toolbar.cpp b/src/widgets/spray-toolbar.cpp index 06850d261..bdc700aa8 100644 --- a/src/widgets/spray-toolbar.cpp +++ b/src/widgets/spray-toolbar.cpp @@ -52,13 +52,9 @@ #include "../xml/repr.h" #include "ui/uxmanager.h" #include "../ui/icon-names.h" -#include "../helper/unit-menu.h" -#include "../helper/units.h" -#include "../helper/unit-tracker.h" #include "../pen-context.h" #include "../spray-context.h" -using Inkscape::UnitTracker; using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; diff --git a/src/widgets/star-toolbar.cpp b/src/widgets/star-toolbar.cpp index 8c07c6473..545256061 100644 --- a/src/widgets/star-toolbar.cpp +++ b/src/widgets/star-toolbar.cpp @@ -53,14 +53,10 @@ #include "../xml/repr.h" #include "ui/uxmanager.h" #include "../ui/icon-names.h" -#include "../helper/unit-menu.h" -#include "../helper/units.h" -#include "../helper/unit-tracker.h" #include "../pen-context.h" #include "../sp-star.h" -using Inkscape::UnitTracker; using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; diff --git a/src/widgets/tweak-toolbar.cpp b/src/widgets/tweak-toolbar.cpp index beb527a17..e96418957 100644 --- a/src/widgets/tweak-toolbar.cpp +++ b/src/widgets/tweak-toolbar.cpp @@ -52,13 +52,9 @@ #include "../xml/repr.h" #include "ui/uxmanager.h" #include "../ui/icon-names.h" -#include "../helper/unit-menu.h" -#include "../helper/units.h" -#include "../helper/unit-tracker.h" #include "../pen-context.h" #include "../tweak-context.h" -using Inkscape::UnitTracker; using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; diff --git a/src/widgets/zoom-toolbar.cpp b/src/widgets/zoom-toolbar.cpp index 7d7f2c774..9cdbc3d6a 100644 --- a/src/widgets/zoom-toolbar.cpp +++ b/src/widgets/zoom-toolbar.cpp @@ -51,14 +51,10 @@ #include "../xml/repr.h" #include "ui/uxmanager.h" #include "../ui/icon-names.h" -#include "../helper/unit-menu.h" -#include "../helper/units.h" -#include "../helper/unit-tracker.h" #include "../pen-context.h" #include "../tweak-context.h" -using Inkscape::UnitTracker; using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; -- cgit v1.2.3 From a2b755108f544e938705a364d2573b049e21f26f Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Wed, 17 Jul 2013 00:15:06 -0400 Subject: Ported "widgets/text-toolbar.cpp" and "widgets/paintbucket.cpp" (bzr r12380.1.11) --- src/widgets/paintbucket-toolbar.cpp | 17 +++++++++-------- src/widgets/text-toolbar.cpp | 9 +++------ 2 files changed, 12 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/widgets/paintbucket-toolbar.cpp b/src/widgets/paintbucket-toolbar.cpp index 73815b86d..2c782da70 100644 --- a/src/widgets/paintbucket-toolbar.cpp +++ b/src/widgets/paintbucket-toolbar.cpp @@ -54,9 +54,8 @@ #include "../xml/repr.h" #include "ui/uxmanager.h" #include "../ui/icon-names.h" -#include "../helper/unit-menu.h" -#include "../helper/units.h" -#include "../helper/unit-tracker.h" +#include "util/units.h" +#include "ui/widget/unit-tracker.h" #include "../pen-context.h" #include "../sp-namedview.h" #include "../flood-context.h" @@ -64,7 +63,7 @@ #include -using Inkscape::UnitTracker; +using Inkscape::UI::Widget::UnitTracker; using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; @@ -97,13 +96,13 @@ static void paintbucket_autogap_changed(EgeSelectOneAction* act, GObject * /*tbl static void paintbucket_offset_changed(GtkAdjustment *adj, GObject *tbl) { UnitTracker* tracker = static_cast(g_object_get_data( tbl, "tracker" )); - SPUnit const *unit = tracker->getActiveUnit(); + Unit const unit = tracker->getActiveUnit(); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); // Don't adjust the offset value because we're saving the // unit and it'll be correctly handled on load. prefs->setDouble("/tools/paintbucket/offset", (gdouble)gtk_adjustment_get_value(adj)); - prefs->setString("/tools/paintbucket/offsetunits", sp_unit_get_abbreviation(unit)); + prefs->setString("/tools/paintbucket/offsetunits", unit.abbr); } static void paintbucket_defaults(GtkWidget *, GObject *tbl) @@ -175,10 +174,12 @@ void sp_paintbucket_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions } // Create the units menu. - UnitTracker* tracker = new UnitTracker( SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE ); + UnitTracker* tracker = new UnitTracker(Inkscape::Util::UNIT_TYPE_LINEAR); + Inkscape::Util::UnitTable unit_table; Glib::ustring stored_unit = prefs->getString("/tools/paintbucket/offsetunits"); if (!stored_unit.empty()) { - tracker->setActiveUnit(sp_unit_get_by_abbreviation(stored_unit.data())); + Unit u = unit_table.getUnit(stored_unit); + tracker->setActiveUnit(&u); } g_object_set_data( holder, "tracker", tracker ); { diff --git a/src/widgets/text-toolbar.cpp b/src/widgets/text-toolbar.cpp index 144a2a3e8..4dd44bb8d 100644 --- a/src/widgets/text-toolbar.cpp +++ b/src/widgets/text-toolbar.cpp @@ -56,9 +56,6 @@ #include "../xml/repr.h" #include "ui/uxmanager.h" #include "../ui/icon-names.h" -#include "../helper/unit-menu.h" -#include "../helper/units.h" -#include "../helper/unit-tracker.h" #include "../pen-context.h" #include "../sp-namedview.h" #include "../svg/css-ostringstream.h" @@ -72,7 +69,6 @@ #include "widgets/font-selector.h" -using Inkscape::UnitTracker; using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; @@ -1218,9 +1214,10 @@ void sp_text_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje Inkscape::IconSize secondarySize = ToolboxFactory::prefToSize("/toolbox/secondary", 1); // Is this used? - UnitTracker* tracker = new UnitTracker( SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE ); + /*UnitTracker* tracker = new UnitTracker( SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE ); //tracker->setActiveUnit( sp_desktop_namedview(desktop)->doc_units ); - g_object_set_data( holder, "tracker", tracker ); + tracker->setActiveUnit(&sp_unit_get_by_id(SP_UNIT_PX)); + g_object_set_data( holder, "tracker", tracker );*/ /* Font family */ { -- cgit v1.2.3 From c28e6d2bdeb2983698a4e4789de15570e0f3d161 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Wed, 17 Jul 2013 00:25:40 -0400 Subject: Fixed conversion factors and missed unit include removal. (bzr r12380.1.12) --- src/ui/widget/unit-tracker.cpp | 2 +- src/widgets/box3d-toolbar.cpp | 5 ----- src/widgets/desktop-widget.cpp | 4 ++-- 3 files changed, 3 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/ui/widget/unit-tracker.cpp b/src/ui/widget/unit-tracker.cpp index b701c785e..df78e21dd 100644 --- a/src/ui/widget/unit-tracker.cpp +++ b/src/ui/widget/unit-tracker.cpp @@ -233,7 +233,7 @@ void UnitTracker::_fixupAdjustments(Inkscape::Util::Unit const oldUnit, Inkscape if ( (oldUnit.type != Inkscape::Util::UNIT_TYPE_DIMENSIONLESS) && (newUnit.type == Inkscape::Util::UNIT_TYPE_DIMENSIONLESS) ) { - val = 1.0 / newUnit.factor; + val = newUnit.factor; _priorValues[adj] = Inkscape::Util::Quantity::convert(oldVal, &oldUnit, &px); } else if ( (oldUnit.type == Inkscape::Util::UNIT_TYPE_DIMENSIONLESS) && (newUnit.type != Inkscape::Util::UNIT_TYPE_DIMENSIONLESS) ) diff --git a/src/widgets/box3d-toolbar.cpp b/src/widgets/box3d-toolbar.cpp index e8b330375..2d40b996b 100644 --- a/src/widgets/box3d-toolbar.cpp +++ b/src/widgets/box3d-toolbar.cpp @@ -58,16 +58,11 @@ #include "../ui/icon-names.h" -#include "../helper/unit-menu.h" -#include "../helper/units.h" -#include "../helper/unit-tracker.h" - #include "../pen-context.h" #include "../box3d-context.h" #include "../box3d.h" -using Inkscape::UnitTracker; using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 7d3bbc44a..57f655033 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -1672,7 +1672,7 @@ SPDesktopWidget* SPDesktopWidget::createInstance(SPNamedView *namedview) { SPDesktopWidget *dtw = static_cast(g_object_new(SP_TYPE_DESKTOP_WIDGET, NULL)); - dtw->dt2r = 1.0 / namedview->doc_units->factor; + dtw->dt2r = namedview->doc_units.factor; dtw->ruler_origin = Geom::Point(0,0); //namedview->gridorigin; Why was the grid origin used here? @@ -1744,7 +1744,7 @@ void SPDesktopWidget::namedviewModified(SPObject *obj, guint flags) SPNamedView *nv=SP_NAMEDVIEW(obj); if (flags & SP_OBJECT_MODIFIED_FLAG) { - this->dt2r = 1.0 / nv->doc_units->factor; + this->dt2r = nv->doc_units.factor; this->ruler_origin = Geom::Point(0,0); //nv->gridorigin; Why was the grid origin used here? sp_ruler_set_unit(SP_RULER (this->vruler), nv->getDefaultMetric()); -- cgit v1.2.3 From ed0b9d91e08cf55287745636608bddd5ebd5ea34 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Wed, 17 Jul 2013 00:29:41 -0400 Subject: Added copyright header and name to AUTHORS. (bzr r12380.1.13) --- src/util/units.cpp | 11 +++++++++++ src/util/units.h | 11 +++++++++++ 2 files changed, 22 insertions(+) (limited to 'src') diff --git a/src/util/units.cpp b/src/util/units.cpp index 6c225f717..e120207c9 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -1,3 +1,14 @@ +/* + * Inkscape Units + * + * Authors: + * Matthew Petroff + * + * Copyright (C) 2013 Matthew Petroff + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + #ifdef HAVE_CONFIG_H # include #endif diff --git a/src/util/units.h b/src/util/units.h index 64eb4a665..f275d7c3a 100644 --- a/src/util/units.h +++ b/src/util/units.h @@ -1,3 +1,14 @@ +/* + * Inkscape Units + * + * Authors: + * Matthew Petroff + * + * Copyright (C) 2013 Matthew Petroff + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + /* This is a rough draft of a global 'units' thingee, to allow dialogs and the ruler to share info about unit systems... Dunno if this is the -- cgit v1.2.3 From c99f5b02fce8b98463d7868c61bc77f8bf675665 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Wed, 17 Jul 2013 00:48:43 -0400 Subject: Fixed memory corruption introduced in a previous commit. (bzr r12380.1.14) --- src/sp-namedview.cpp | 6 +++--- src/widgets/desktop-widget.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp index c7301f9bd..0833d93bf 100644 --- a/src/sp-namedview.cpp +++ b/src/sp-namedview.cpp @@ -552,11 +552,11 @@ static void sp_namedview_set(SPObject *object, unsigned int key, const gchar *va * doc_units. */ static Inkscape::Util::Unit px = unit_table.getUnit("px"); - Inkscape::Util::Unit const *new_unit = &px; + Inkscape::Util::Unit const *new_unit = new Inkscape::Util::Unit(px); if (value) { Inkscape::Util::Unit u = unit_table.getUnit(value); - Inkscape::Util::Unit const *const req_unit = &u; + Inkscape::Util::Unit const *const req_unit = new Inkscape::Util::Unit(u); if ( !unit_table.hasUnit(value) ) { g_warning("Unrecognized unit `%s'", value); /* fixme: Document errors should be reported in the status bar or @@ -580,7 +580,7 @@ static void sp_namedview_set(SPObject *object, unsigned int key, const gchar *va if (value) { Inkscape::Util::Unit u = unit_table.getUnit(value); - Inkscape::Util::Unit const *const req_unit = &u; + Inkscape::Util::Unit const *const req_unit = new Inkscape::Util::Unit(u); if ( !unit_table.hasUnit(value) ) { g_warning("Unrecognized unit `%s'", value); /* fixme: Document errors should be reported in the status bar or diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 57f655033..f1e4458ff 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -1672,7 +1672,7 @@ SPDesktopWidget* SPDesktopWidget::createInstance(SPNamedView *namedview) { SPDesktopWidget *dtw = static_cast(g_object_new(SP_TYPE_DESKTOP_WIDGET, NULL)); - dtw->dt2r = namedview->doc_units.factor; + dtw->dt2r = namedview->doc_units->factor; dtw->ruler_origin = Geom::Point(0,0); //namedview->gridorigin; Why was the grid origin used here? @@ -1744,7 +1744,7 @@ void SPDesktopWidget::namedviewModified(SPObject *obj, guint flags) SPNamedView *nv=SP_NAMEDVIEW(obj); if (flags & SP_OBJECT_MODIFIED_FLAG) { - this->dt2r = nv->doc_units.factor; + this->dt2r = nv->doc_units->factor; this->ruler_origin = Geom::Point(0,0); //nv->gridorigin; Why was the grid origin used here? sp_ruler_set_unit(SP_RULER (this->vruler), nv->getDefaultMetric()); -- cgit v1.2.3 From 9711852491cd6eb2992039f286ce3ced50b83d06 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Wed, 17 Jul 2013 00:53:51 -0400 Subject: Ported "widgets/node-toolbar.cpp". (bzr r12380.1.15) --- src/widgets/node-toolbar.cpp | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/widgets/node-toolbar.cpp b/src/widgets/node-toolbar.cpp index d6de74817..50880f481 100644 --- a/src/widgets/node-toolbar.cpp +++ b/src/widgets/node-toolbar.cpp @@ -58,13 +58,14 @@ #include "../ui/tool/node-tool.h" #include "../ui/tool/multi-path-manipulator.h" #include "../ui/icon-names.h" -#include "../helper/unit-menu.h" -#include "../helper/units.h" -#include "../helper/unit-tracker.h" +#include "util/units.h" +#include "ui/widget/unit-tracker.h" #include "../lpe-tool-context.h" #include "../sp-namedview.h" -using Inkscape::UnitTracker; +using Inkscape::UI::Widget::UnitTracker; +using Inkscape::Util::Unit; +using Inkscape::Util::Quantity; using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; @@ -238,7 +239,7 @@ static void sp_node_toolbox_coord_changed(gpointer /*shape_editor*/, GObject *tb if (!tracker) { return; } - SPUnit const *unit = tracker->getActiveUnit(); + Unit const unit = tracker->getActiveUnit(); InkNodeTool *nt = get_node_tool(); if (!nt || nt->_selected_nodes->empty()) { @@ -248,15 +249,17 @@ static void sp_node_toolbox_coord_changed(gpointer /*shape_editor*/, GObject *tb } else { gtk_action_set_sensitive(xact, TRUE); gtk_action_set_sensitive(yact, TRUE); - Geom::Coord oldx = sp_units_get_pixels(gtk_adjustment_get_value(xadj), *unit); - Geom::Coord oldy = sp_units_get_pixels(gtk_adjustment_get_value(xadj), *unit); + Inkscape::Util::UnitTable unit_table; + Unit px = unit_table.getUnit("px"); + Geom::Coord oldx = Quantity::convert(gtk_adjustment_get_value(xadj), &unit, &px); + Geom::Coord oldy = Quantity::convert(gtk_adjustment_get_value(yadj), &unit, &px); Geom::Point mid = nt->_selected_nodes->pointwiseBounds()->midpoint(); if (oldx != mid[Geom::X]) { - gtk_adjustment_set_value(xadj, sp_pixels_get_units(mid[Geom::X], *unit)); + gtk_adjustment_set_value(xadj, Quantity::convert(mid[Geom::X], &px, &unit)); } if (oldy != mid[Geom::Y]) { - gtk_adjustment_set_value(yadj, sp_pixels_get_units(mid[Geom::Y], *unit)); + gtk_adjustment_set_value(yadj, Quantity::convert(mid[Geom::Y], &px, &unit)); } } @@ -272,11 +275,14 @@ static void sp_node_path_value_changed(GtkAdjustment *adj, GObject *tbl, Geom::D if (!tracker) { return; } - SPUnit const *unit = tracker->getActiveUnit(); + Unit const unit = tracker->getActiveUnit(); + + Inkscape::Util::UnitTable unit_table; + Unit px = unit_table.getUnit("px"); if (DocumentUndo::getUndoSensitive(sp_desktop_document(desktop))) { prefs->setDouble(Glib::ustring("/tools/nodes/") + (d == Geom::X ? "x" : "y"), - sp_units_get_pixels(gtk_adjustment_get_value(adj), *unit)); + Quantity::convert(gtk_adjustment_get_value(adj), &unit, &px)); } // quit if run by the attr_changed listener @@ -289,7 +295,7 @@ static void sp_node_path_value_changed(GtkAdjustment *adj, GObject *tbl, Geom::D InkNodeTool *nt = get_node_tool(); if (nt && !nt->_selected_nodes->empty()) { - double val = sp_units_get_pixels(gtk_adjustment_get_value(adj), *unit); + double val = Quantity::convert(gtk_adjustment_get_value(adj), &unit, &px); double oldval = nt->_selected_nodes->pointwiseBounds()->midpoint()[d]; Geom::Point delta(0,0); delta[d] = val - oldval; @@ -339,8 +345,9 @@ static void sp_node_toolbox_sel_modified(Inkscape::Selection *selection, guint / void sp_node_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder) { - UnitTracker* tracker = new UnitTracker( SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE ); - //tracker->setActiveUnit( sp_desktop_namedview(desktop)->doc_units ); + UnitTracker* tracker = new UnitTracker(Inkscape::Util::UNIT_TYPE_LINEAR); + Unit doc_units = *sp_desktop_namedview(desktop)->doc_units; + tracker->setActiveUnit(&doc_units); g_object_set_data( holder, "tracker", tracker ); Inkscape::IconSize secondarySize = ToolboxFactory::prefToSize("/toolbox/secondary", 1); -- cgit v1.2.3 From 7af2b98550f3389d08773addca07cd943ec6e2bb Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Wed, 17 Jul 2013 01:00:49 -0400 Subject: Temporary fixes/kludges. (bzr r12380.1.16) --- src/helper/unit-tracker.cpp | 4 ++-- src/ui/widget/selected-style.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/helper/unit-tracker.cpp b/src/helper/unit-tracker.cpp index 609c2f292..7345660e6 100644 --- a/src/helper/unit-tracker.cpp +++ b/src/helper/unit-tracker.cpp @@ -94,7 +94,7 @@ SPUnit const* UnitTracker::getActiveUnit() const void UnitTracker::setActiveUnit( SPUnit const *unit ) { - if ( unit ) { + /*if ( unit ) { GtkTreeIter iter; int index = 0; gboolean found = gtk_tree_model_get_iter_first( GTK_TREE_MODEL(_store), &iter ); @@ -109,7 +109,7 @@ void UnitTracker::setActiveUnit( SPUnit const *unit ) found = gtk_tree_model_iter_next( GTK_TREE_MODEL(_store), &iter ); index++; } - } + }*/ } void UnitTracker::addAdjustment( GtkAdjustment* adj ) diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index d6e2406c9..102132158 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -477,6 +477,7 @@ SelectedStyle::setDesktop(SPDesktop *desktop) )); //_sw_unit = const_cast(sp_desktop_namedview(desktop)->doc_units); + _sw_unit = const_cast(&sp_unit_get_by_id(SP_UNIT_PX)); // Set the doc default unit active in the units list gint length = g_slist_length(_unit_mis); -- cgit v1.2.3 From 63071dedd65d63cfac2041399dab0191e3753b42 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Wed, 17 Jul 2013 01:31:18 -0400 Subject: Fixed botched merge. (bzr r12380.1.18) --- src/util/units.cpp | 5 ----- src/util/units.h | 10 ++-------- 2 files changed, 2 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/util/units.cpp b/src/util/units.cpp index f6350d569..d485f6aef 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -196,11 +196,6 @@ int Unit::metric() const { return 0; } -/** - * Initializes the unit tables and identifies the primary unit types. - * - * The primary unit's conversion factor is required to be 1.00 - */ UnitTable::UnitTable() { // if we swich to the xml file, don't forget to force locale to 'C' diff --git a/src/util/units.h b/src/util/units.h index ead49d3b4..c6f124203 100644 --- a/src/util/units.h +++ b/src/util/units.h @@ -65,20 +65,14 @@ class Unit { */ int defaultDigits() const; + bool compatibleWith(const Unit *u) const; + UnitType type; double factor; Glib::ustring name; Glib::ustring name_plural; Glib::ustring abbr; Glib::ustring description; - - UnitType type; - - double factor; - - bool isAbsolute() const { return type != UNIT_TYPE_DIMENSIONLESS; } - int defaultDigits() const; - bool compatibleWith(const Unit *u) const; friend bool operator== (const Unit &u1, const Unit &u2); friend bool operator!= (const Unit &u1, const Unit &u2); -- cgit v1.2.3 From 76ce8f0dae07598af9b0369473db64c38fa309a4 Mon Sep 17 00:00:00 2001 From: Slagvi Public Date: Wed, 17 Jul 2013 12:17:23 +0200 Subject: Searching by words in descriptions, titles etc. Translation support improved (bzr r12379.2.10) --- src/ui/dialog/template-load-tab.cpp | 64 +++++++++++++++++++++++++++++-------- src/ui/dialog/template-load-tab.h | 9 ++++++ 2 files changed, 60 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/template-load-tab.cpp b/src/ui/dialog/template-load-tab.cpp index 6d9c61078..90980dc39 100644 --- a/src/ui/dialog/template-load-tab.cpp +++ b/src/ui/dialog/template-load-tab.cpp @@ -39,6 +39,7 @@ namespace UI { TemplateLoadTab::TemplateLoadTab() : _current_keyword("") , _keywords_combo(true) + ,_current_search_type(ALL) { set_border_width(10); @@ -120,8 +121,16 @@ void TemplateLoadTab::_initLists() void TemplateLoadTab::_keywordSelected() { _current_keyword = _keywords_combo.get_active_text(); - if (_current_keyword == "" && _keywords_combo.get_entry_text().size() > 0) + if (_current_keyword == ""){ _current_keyword = _keywords_combo.get_entry_text(); + _current_search_type = USER_SPECIFIED; + } + else + _current_search_type = LIST_KEYWORD; + + if (_current_keyword == "" || _current_keyword == "All") + _current_search_type = ALL; + _refreshTemplatesList(); } @@ -130,12 +139,43 @@ void TemplateLoadTab::_refreshTemplatesList() { _tlist_store->clear(); - for (std::map::iterator it = _tdata.begin() ; it != _tdata.end() ; ++it) { - if (it->second.keywords.count(_current_keyword) > 0 || _current_keyword == _("All") || _current_keyword == ""){ + switch (_current_search_type){ + case ALL :{ + + for (std::map::iterator it = _tdata.begin() ; it != _tdata.end() ; ++it) { Gtk::TreeModel::iterator iter = _tlist_store->append(); Gtk::TreeModel::Row row = *iter; row[_columns.textValue] = it->first; } + break; + } + + case LIST_KEYWORD: { + for (std::map::iterator it = _tdata.begin() ; it != _tdata.end() ; ++it) { + if (it->second.keywords.count(_current_keyword) != 0){ + Gtk::TreeModel::iterator iter = _tlist_store->append(); + Gtk::TreeModel::Row row = *iter; + row[_columns.textValue] = it->first; + } + } + break; + } + + case USER_SPECIFIED : { + for (std::map::iterator it = _tdata.begin() ; it != _tdata.end() ; ++it) { + if (it->second.keywords.count(_current_keyword) != 0 || + it->second.display_name.find(_current_keyword) != Glib::ustring::npos || + it->second.author.find(_current_keyword) != Glib::ustring::npos || + it->second.short_description.find(_current_keyword) != Glib::ustring::npos || + it->second.long_description.find(_current_keyword) != Glib::ustring::npos ) + { + Gtk::TreeModel::iterator iter = _tlist_store->append(); + Gtk::TreeModel::Row row = *iter; + row[_columns.textValue] = it->first; + } + } + break; + } } } @@ -174,13 +214,13 @@ TemplateLoadTab::TemplateData TemplateLoadTab::_processTemplateFile(const Glib:: return result; if ((dataNode = sp_repr_lookup_name(myRoot, "inkscape:_name")) != NULL) - result.display_name = dgettext(NULL, dataNode->firstChild()->content()); + result.display_name = dgettext("Document template name", dataNode->firstChild()->content()); if ((dataNode = sp_repr_lookup_name(myRoot, "inkscape:author")) != NULL) result.author = dataNode->firstChild()->content(); if ((dataNode = sp_repr_lookup_name(myRoot, "inkscape:_short")) != NULL) - result.short_description = dgettext(NULL, dataNode->firstChild()->content()); + result.short_description = dgettext("Document template short description", dataNode->firstChild()->content()); if ((dataNode = sp_repr_lookup_name(myRoot, "inkscape:_long") )!= NULL) - result.long_description = dgettext(NULL, dataNode->firstChild()->content()); + result.long_description = dgettext("Document template long description", dataNode->firstChild()->content()); if ((dataNode = sp_repr_lookup_name(myRoot, "inkscape:preview")) != NULL) result.preview_name = dataNode->firstChild()->content(); if ((dataNode = sp_repr_lookup_name(myRoot, "inkscape:date")) != NULL){ @@ -191,10 +231,8 @@ TemplateLoadTab::TemplateData TemplateLoadTab::_processTemplateFile(const Glib:: Glib::ustring data = dataNode->firstChild()->content(); while (!data.empty()){ int pos = data.find_first_of(" "); - Glib::ustring keyword = dgettext(NULL, data.substr(0, pos).data()); + Glib::ustring keyword = dgettext("Document template keyword", data.substr(0, pos).data()); result.keywords.insert(keyword); - std::cout< 0){ - message += "Keywords: "; + message += _("Keywords: "); for (std::set::iterator it = tmpl.keywords.begin(); it != tmpl.keywords.end(); ++it) message += *it + " "; message += "\n\n"; } if (tmpl.author != "") - message += "By: " + _tdata[_current_template].author + " " + tmpl.creation_date + "\n\n"; + message += _("By: ") + _tdata[_current_template].author + " " + tmpl.creation_date + "\n\n"; Gtk::MessageDialog dl(message, false, Gtk::MESSAGE_OTHER); dl.run(); diff --git a/src/ui/dialog/template-load-tab.h b/src/ui/dialog/template-load-tab.h index 55893eed0..8290f1b3f 100644 --- a/src/ui/dialog/template-load-tab.h +++ b/src/ui/dialog/template-load-tab.h @@ -81,6 +81,15 @@ protected: StringModelColumns _columns; private: + enum SearchType + { + LIST_KEYWORD, + USER_SPECIFIED, + ALL + }; + + SearchType _current_search_type; + void _getTemplatesFromDir(const Glib::ustring &); void _keywordSelected(); TemplateData _processTemplateFile(const Glib::ustring &); -- cgit v1.2.3 From f5023f704fb05b25d5fa6c78e0faefd93ef044ae Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Wed, 17 Jul 2013 12:42:40 +0100 Subject: Fix remaining g_type_init deprecation issues (bzr r12421) --- src/main.cpp | 3 +++ src/test-helpers.h | 3 +++ 2 files changed, 6 insertions(+) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 4e2f2fd2b..d425b88bb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1283,12 +1283,15 @@ int sp_main_console(int argc, char const **argv) { /* We are started in text mode */ +#if !GLIB_CHECK_VERSION(2,36,0) /* Do this g_type_init(), so that we can use Xft/Freetype2 (Pango) * in a non-Gtk environment. Used in libnrtype's * FontInstance.cpp and FontFactory.cpp. * http://mail.gnome.org/archives/gtk-list/2003-December/msg00063.html */ g_type_init(); +#endif + char **argv2 = const_cast(argv); gtk_init_check( &argc, &argv2 ); //setlocale(LC_ALL, ""); diff --git a/src/test-helpers.h b/src/test-helpers.h index bda48599e..001356e65 100644 --- a/src/test-helpers.h +++ b/src/test-helpers.h @@ -23,7 +23,10 @@ T* createSuiteAndDocument( void (*fun)(T*&) ) { T* suite = 0; +#if !GLIB_CHECK_VERSION(2,36,0) g_type_init(); +#endif + Inkscape::GC::init(); if ( !inkscape_get_instance() ) { -- cgit v1.2.3 From 0ae1b56c3420006295bdd1cafe3b0fc57f2f89be Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Wed, 17 Jul 2013 13:16:27 +0100 Subject: Fix ordering of verbs (bzr r12423) --- src/verbs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/verbs.cpp b/src/verbs.cpp index d0396155c..a085e841f 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -2452,10 +2452,10 @@ Verb *Verb::_base_verbs[] = { N_("Select previous object or node"), NULL), new EditVerb(SP_VERB_EDIT_DESELECT, "EditDeselect", N_("D_eselect"), N_("Deselect any selected objects or nodes"), INKSCAPE_ICON("edit-select-none")), - new EditVerb(SP_VERB_EDIT_GUIDES_AROUND_PAGE, "EditGuidesAroundPage", N_("Create _Guides Around the Page"), - N_("Create four guides aligned with the page borders"), NULL), new EditVerb(SP_VERB_EDIT_DELETE_ALL_GUIDES, "EditRemoveAllGuides", N_("Delete All Guides"), N_("Create four guides aligned with the page borders"), NULL), + new EditVerb(SP_VERB_EDIT_GUIDES_AROUND_PAGE, "EditGuidesAroundPage", N_("Create _Guides Around the Page"), + N_("Create four guides aligned with the page borders"), NULL), new EditVerb(SP_VERB_EDIT_NEXT_PATHEFFECT_PARAMETER, "EditNextPathEffectParameter", N_("Next path effect parameter"), N_("Show next editable path effect parameter"), INKSCAPE_ICON("path-effect-parameter-next")), -- cgit v1.2.3 From 10067e713619333f20201c7d01c99e302464f6b2 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Wed, 17 Jul 2013 09:53:18 -0400 Subject: Port remaining files away from "helper/unit-tracker.h". (bzr r12380.1.19) --- src/widgets/desktop-widget.cpp | 8 +++--- src/widgets/lpe-toolbar.cpp | 21 +++++++------- src/widgets/rect-toolbar.cpp | 32 +++++++++++++--------- src/widgets/select-toolbar.cpp | 62 +++++++++++++++++++++++------------------- src/widgets/toolbox.cpp | 3 -- 5 files changed, 68 insertions(+), 58 deletions(-) (limited to 'src') diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index fbef9bbce..1c6852f35 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -43,8 +43,8 @@ #include "file.h" #include "helper/action.h" #include "helper/action-context.h" -#include "helper/units.h" -#include "helper/unit-tracker.h" +#include "util/units.h" +#include "ui/widget/unit-tracker.h" #include "inkscape-private.h" #include "interface.h" #include "macros.h" @@ -79,7 +79,7 @@ using Inkscape::round; #endif -using Inkscape::UnitTracker; +using Inkscape::UI::Widget::UnitTracker; using Inkscape::UI::UXManager; using Inkscape::UI::ToolboxFactory; using ege::AppearTimeTracker; @@ -1780,7 +1780,7 @@ void SPDesktopWidget::namedviewModified(SPObject *obj, guint flags) if (tracker == NULL) // it's null when inkscape is first opened continue; - // tracker->setActiveUnit( nv->doc_units ); + tracker->setActiveUnit( nv->doc_units ); } // grandchildren } // if child is a container } // children diff --git a/src/widgets/lpe-toolbar.cpp b/src/widgets/lpe-toolbar.cpp index 65bb46e32..55cce90cd 100644 --- a/src/widgets/lpe-toolbar.cpp +++ b/src/widgets/lpe-toolbar.cpp @@ -57,9 +57,8 @@ #include "../ui/icon-names.h" #include "../helper/action.h" #include "../helper/action-context.h" -#include "../helper/unit-menu.h" -#include "../helper/units.h" -#include "../helper/unit-tracker.h" +#include "util/units.h" +#include "ui/widget/unit-tracker.h" #include "../pen-context.h" #include "../sp-namedview.h" #include "../tools-switch.h" @@ -67,7 +66,9 @@ #include "../live_effects/lpe-angle_bisector.h" #include "../lpe-tool-context.h" -using Inkscape::UnitTracker; +using Inkscape::UI::Widget::UnitTracker; +using Inkscape::Util::Unit; +using Inkscape::Util::Quantity; using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; @@ -197,9 +198,9 @@ static void lpetool_toggle_show_measuring_info(GtkToggleAction *act, GObject *tb static void lpetool_unit_changed(GtkAction* /*act*/, GObject* tbl) { UnitTracker* tracker = reinterpret_cast(g_object_get_data(tbl, "tracker")); - SPUnit const *unit = tracker->getActiveUnit(); + Unit const unit = tracker->getActiveUnit(); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - prefs->setInt("/tools/lpetool/unitid", unit->unit_id); + prefs->setString("/tools/lpetool/unit", unit.abbr); SPDesktop *desktop = static_cast(g_object_get_data( tbl, "desktop" )); if (SP_IS_LPETOOL_CONTEXT(desktop->event_context)) { @@ -295,13 +296,13 @@ static void lpetool_open_lpe_dialog(GtkToggleAction *act, gpointer data) void sp_lpetool_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder) { - UnitTracker* tracker = new UnitTracker(SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE); - //tracker->setActiveUnit(sp_desktop_namedview(desktop)->doc_units); + UnitTracker* tracker = new UnitTracker(Inkscape::Util::UNIT_TYPE_LINEAR); + tracker->setActiveUnit(sp_desktop_namedview(desktop)->doc_units); g_object_set_data(holder, "tracker", tracker); - SPUnit const *unit = tracker->getActiveUnit(); + Unit const unit = tracker->getActiveUnit(); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - prefs->setInt("/tools/lpetool/unitid", unit->unit_id); + prefs->setString("/tools/lpetool/unit", unit.abbr); /** Automatically create a list of LPEs that get added to the toolbar **/ { diff --git a/src/widgets/rect-toolbar.cpp b/src/widgets/rect-toolbar.cpp index 5fa96289f..359bc48e0 100644 --- a/src/widgets/rect-toolbar.cpp +++ b/src/widgets/rect-toolbar.cpp @@ -54,17 +54,19 @@ #include "ui/uxmanager.h" #include "../ui/icon-names.h" #include "../helper/unit-menu.h" -#include "../helper/units.h" -#include "../helper/unit-tracker.h" +#include "util/units.h" +#include "ui/widget/unit-tracker.h" #include "../pen-context.h" #include "../sp-namedview.h" #include "../sp-rect.h" -using Inkscape::UnitTracker; +using Inkscape::UI::Widget::UnitTracker; using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; using Inkscape::UI::PrefPusher; +using Inkscape::Util::Unit; +using Inkscape::Util::Quantity; //######################## @@ -91,12 +93,14 @@ static void sp_rtb_value_changed(GtkAdjustment *adj, GObject *tbl, gchar const * SPDesktop *desktop = static_cast(g_object_get_data( tbl, "desktop" )); UnitTracker* tracker = reinterpret_cast(g_object_get_data( tbl, "tracker" )); - SPUnit const *unit = tracker->getActiveUnit(); + Unit const unit = tracker->getActiveUnit(); + Inkscape::Util::UnitTable unit_table; + Unit const px = unit_table.getUnit("px"); if (DocumentUndo::getUndoSensitive(sp_desktop_document(desktop))) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); prefs->setDouble(Glib::ustring("/tools/shapes/rect/") + value_name, - sp_units_get_pixels(gtk_adjustment_get_value(adj), *unit)); + Quantity::convert(gtk_adjustment_get_value(adj), &unit, &px)); } // quit if run by the attr_changed listener @@ -113,7 +117,7 @@ static void sp_rtb_value_changed(GtkAdjustment *adj, GObject *tbl, gchar const * if (SP_IS_RECT(items->data)) { if (gtk_adjustment_get_value(adj) != 0) { setter(SP_RECT(items->data), - sp_units_get_pixels(gtk_adjustment_get_value(adj), *unit)); + Quantity::convert(gtk_adjustment_get_value(adj), &unit, &px)); } else { SP_OBJECT(items->data)->getRepr()->setAttribute(value_name, NULL); } @@ -184,32 +188,34 @@ static void rect_tb_event_attr_changed(Inkscape::XML::Node * /*repr*/, gchar con g_object_set_data( tbl, "freeze", GINT_TO_POINTER(TRUE) ); UnitTracker* tracker = reinterpret_cast( g_object_get_data( tbl, "tracker" ) ); - SPUnit const *unit = tracker->getActiveUnit(); + Unit const unit = tracker->getActiveUnit(); + Inkscape::Util::UnitTable unit_table; + Unit const px = unit_table.getUnit("px"); gpointer item = g_object_get_data( tbl, "item" ); if (item && SP_IS_RECT(item)) { { GtkAdjustment *adj = GTK_ADJUSTMENT( g_object_get_data( tbl, "rx" ) ); gdouble rx = sp_rect_get_visible_rx(SP_RECT(item)); - gtk_adjustment_set_value(adj, sp_pixels_get_units(rx, *unit)); + gtk_adjustment_set_value(adj, Quantity::convert(rx, &px, &unit)); } { GtkAdjustment *adj = GTK_ADJUSTMENT( g_object_get_data( tbl, "ry" ) ); gdouble ry = sp_rect_get_visible_ry(SP_RECT(item)); - gtk_adjustment_set_value(adj, sp_pixels_get_units(ry, *unit)); + gtk_adjustment_set_value(adj, Quantity::convert(ry, &px, &unit)); } { GtkAdjustment *adj = GTK_ADJUSTMENT( g_object_get_data( tbl, "width" ) ); gdouble width = sp_rect_get_visible_width (SP_RECT(item)); - gtk_adjustment_set_value(adj, sp_pixels_get_units(width, *unit)); + gtk_adjustment_set_value(adj, Quantity::convert(width, &px, &unit)); } { GtkAdjustment *adj = GTK_ADJUSTMENT( g_object_get_data( tbl, "height" ) ); gdouble height = sp_rect_get_visible_height (SP_RECT(item)); - gtk_adjustment_set_value(adj, sp_pixels_get_units(height, *unit)); + gtk_adjustment_set_value(adj, Quantity::convert(height, &px, &unit)); } } @@ -301,10 +307,10 @@ void sp_rect_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje } // rx/ry units menu: create - UnitTracker* tracker = new UnitTracker( SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE ); + UnitTracker* tracker = new UnitTracker(Inkscape::Util::UNIT_TYPE_LINEAR); //tracker->addUnit( SP_UNIT_PERCENT, 0 ); // fixme: add % meaning per cent of the width/height - //tracker->setActiveUnit( sp_desktop_namedview(desktop)->doc_units ); + tracker->setActiveUnit( sp_desktop_namedview(desktop)->doc_units ); g_object_set_data( holder, "tracker", tracker ); /* W */ diff --git a/src/widgets/select-toolbar.cpp b/src/widgets/select-toolbar.cpp index c0018751c..ffab3deab 100644 --- a/src/widgets/select-toolbar.cpp +++ b/src/widgets/select-toolbar.cpp @@ -39,8 +39,7 @@ #include #include "helper/action.h" #include "helper/action-context.h" -#include "helper/unit-menu.h" -#include "helper/units.h" +#include "util/units.h" #include "inkscape.h" #include "verbs.h" #include "selection.h" @@ -48,7 +47,7 @@ #include "sp-item-transform.h" #include "message-stack.h" #include "display/sp-canvas.h" -#include "helper/unit-tracker.h" +#include "ui/widget/unit-tracker.h" #include "ege-adjustment-action.h" #include "ege-output-action.h" #include "ink-action.h" @@ -56,7 +55,9 @@ #include "ui/icon-names.h" #include "select-toolbar.h" -using Inkscape::UnitTracker; +using Inkscape::UI::Widget::UnitTracker; +using Inkscape::Util::Unit; +using Inkscape::Util::Quantity; using Inkscape::DocumentUndo; static void @@ -78,7 +79,7 @@ sp_selection_layout_widget_update(SPWidget *spw, Inkscape::Selection *sel) Geom::OptRect const bbox(sel->bounds(bbox_type)); if ( bbox ) { UnitTracker *tracker = reinterpret_cast(g_object_get_data(G_OBJECT(spw), "tracker")); - SPUnit const &unit = *tracker->getActiveUnit(); + Unit const unit = tracker->getActiveUnit(); struct { char const *key; double val; } const keyval[] = { { "X", bbox->min()[X] }, @@ -87,17 +88,19 @@ sp_selection_layout_widget_update(SPWidget *spw, Inkscape::Selection *sel) { "height", bbox->dimensions()[Y] } }; - if (unit.base == SP_UNIT_DIMENSIONLESS) { - double const val = 1. / unit.unittobase; + if (unit.type == Inkscape::Util::UNIT_TYPE_DIMENSIONLESS) { + double const val = unit.factor; for (unsigned i = 0; i < G_N_ELEMENTS(keyval); ++i) { GtkAdjustment *a = GTK_ADJUSTMENT(g_object_get_data(G_OBJECT(spw), keyval[i].key)); gtk_adjustment_set_value(a, val); tracker->setFullVal( a, keyval[i].val ); } } else { + Inkscape::Util::UnitTable unit_table; + Unit px = unit_table.getUnit("px"); for (unsigned i = 0; i < G_N_ELEMENTS(keyval); ++i) { GtkAdjustment *a = GTK_ADJUSTMENT(g_object_get_data(G_OBJECT(spw), keyval[i].key)); - gtk_adjustment_set_value(a, sp_pixels_get_units(keyval[i].val, unit)); + gtk_adjustment_set_value(a, Quantity::convert(keyval[i].val, &px, &unit)); } } } @@ -183,28 +186,31 @@ sp_object_layout_any_value_changed(GtkAdjustment *adj, SPWidget *spw) gdouble y1 = 0; gdouble xrel = 0; gdouble yrel = 0; - SPUnit const &unit = *tracker->getActiveUnit(); + Unit const unit = tracker->getActiveUnit(); GtkAdjustment* a_x = GTK_ADJUSTMENT( g_object_get_data( G_OBJECT(spw), "X" ) ); GtkAdjustment* a_y = GTK_ADJUSTMENT( g_object_get_data( G_OBJECT(spw), "Y" ) ); GtkAdjustment* a_w = GTK_ADJUSTMENT( g_object_get_data( G_OBJECT(spw), "width" ) ); GtkAdjustment* a_h = GTK_ADJUSTMENT( g_object_get_data( G_OBJECT(spw), "height" ) ); - if (unit.base == SP_UNIT_ABSOLUTE || unit.base == SP_UNIT_DEVICE) { - x0 = sp_units_get_pixels (gtk_adjustment_get_value (a_x), unit); - y0 = sp_units_get_pixels (gtk_adjustment_get_value (a_y), unit); - x1 = x0 + sp_units_get_pixels (gtk_adjustment_get_value (a_w), unit); - xrel = sp_units_get_pixels (gtk_adjustment_get_value (a_w), unit) / bbox_user->dimensions()[Geom::X]; - y1 = y0 + sp_units_get_pixels (gtk_adjustment_get_value (a_h), unit); - yrel = sp_units_get_pixels (gtk_adjustment_get_value (a_h), unit) / bbox_user->dimensions()[Geom::Y]; + Inkscape::Util::UnitTable unit_table; + Unit px = unit_table.getUnit("px"); + + if (unit.type == Inkscape::Util::UNIT_TYPE_LINEAR) { + x0 = Quantity::convert(gtk_adjustment_get_value(a_x), &unit, &px); + y0 = Quantity::convert(gtk_adjustment_get_value(a_y), &unit, &px); + x1 = x0 + Quantity::convert(gtk_adjustment_get_value(a_w), &unit, &px); + xrel = Quantity::convert(gtk_adjustment_get_value(a_w), &unit, &px) / bbox_user->dimensions()[Geom::X]; + y1 = y0 + Quantity::convert(gtk_adjustment_get_value(a_h), &unit, &px);; + yrel = Quantity::convert(gtk_adjustment_get_value(a_h), &unit, &px) / bbox_user->dimensions()[Geom::Y]; } else { - double const x0_propn = gtk_adjustment_get_value (a_x) * unit.unittobase; + double const x0_propn = gtk_adjustment_get_value (a_x) * unit.factor; x0 = bbox_user->min()[Geom::X] * x0_propn; - double const y0_propn = gtk_adjustment_get_value (a_y) * unit.unittobase; + double const y0_propn = gtk_adjustment_get_value (a_y) * unit.factor; y0 = y0_propn * bbox_user->min()[Geom::Y]; - xrel = gtk_adjustment_get_value (a_w) * unit.unittobase; + xrel = gtk_adjustment_get_value (a_w) * unit.factor; x1 = x0 + xrel * bbox_user->dimensions()[Geom::X]; - yrel = gtk_adjustment_get_value (a_h) * unit.unittobase; + yrel = gtk_adjustment_get_value (a_h) * unit.factor; y1 = y0 + yrel * bbox_user->dimensions()[Geom::Y]; } @@ -225,11 +231,11 @@ sp_object_layout_any_value_changed(GtkAdjustment *adj, SPWidget *spw) double sv = fabs(y1 - bbox_user->max()[Geom::Y]); // unless the unit is %, convert the scales and moves to the unit - if (unit.base == SP_UNIT_ABSOLUTE || unit.base == SP_UNIT_DEVICE) { - mh = sp_pixels_get_units (mh, unit); - sh = sp_pixels_get_units (sh, unit); - mv = sp_pixels_get_units (mv, unit); - sv = sp_pixels_get_units (sv, unit); + if (unit.type == Inkscape::Util::UNIT_TYPE_LINEAR) { + mh = Quantity::convert(mh, &px, &unit); + sh = Quantity::convert(sh, &px, &unit); + mv = Quantity::convert(mv, &px, &unit); + sv = Quantity::convert(sv, &px, &unit); } // do the action only if one of the scales/moves is greater than half the last significant @@ -488,9 +494,9 @@ void sp_select_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GOb gtk_container_add(GTK_CONTAINER(spw), vb); // Create the units menu. - UnitTracker* tracker = new UnitTracker( SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE ); - tracker->addUnit( SP_UNIT_PERCENT, 0 ); - //tracker->setActiveUnit( sp_desktop_namedview(desktop)->doc_units ); + UnitTracker* tracker = new UnitTracker(Inkscape::Util::UNIT_TYPE_LINEAR); + //tracker->addUnit( SP_UNIT_PERCENT, 0 ); + tracker->setActiveUnit( sp_desktop_namedview(desktop)->doc_units ); g_object_set_data( G_OBJECT(spw), "tracker", tracker ); g_signal_connect( G_OBJECT(spw), "destroy", G_CALLBACK(destroy_tracker), spw ); diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index ca593976f..687f62420 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -50,8 +50,6 @@ #include "../helper/action.h" #include "../helper/action-context.h" #include "../helper/unit-menu.h" -#include "../helper/units.h" -#include "../helper/unit-tracker.h" #include "icon.h" #include "../ink-action.h" #include "../ink-comboboxentry-action.h" @@ -101,7 +99,6 @@ //#define DEBUG_TEXT -using Inkscape::UnitTracker; using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::PrefPusher; -- cgit v1.2.3 From 2a882b8a362a56dc24f94b00d2034e9abc848585 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Wed, 17 Jul 2013 10:02:56 -0400 Subject: Removed "helper/unit-tracker.*". (bzr r12380.1.20) --- src/helper/Makefile_insert | 2 - src/helper/unit-tracker.cpp | 267 -------------------------------------------- src/helper/unit-tracker.h | 75 ------------- 3 files changed, 344 deletions(-) delete mode 100644 src/helper/unit-tracker.cpp delete mode 100644 src/helper/unit-tracker.h (limited to 'src') diff --git a/src/helper/Makefile_insert b/src/helper/Makefile_insert index 790d87b14..0008936dd 100644 --- a/src/helper/Makefile_insert +++ b/src/helper/Makefile_insert @@ -20,8 +20,6 @@ ink_common_sources += \ helper/sp-marshal.h \ helper/unit-menu.cpp \ helper/unit-menu.h \ - helper/unit-tracker.cpp \ - helper/unit-tracker.h \ helper/units.cpp \ helper/units.h \ helper/window.cpp \ diff --git a/src/helper/unit-tracker.cpp b/src/helper/unit-tracker.cpp deleted file mode 100644 index 7345660e6..000000000 --- a/src/helper/unit-tracker.cpp +++ /dev/null @@ -1,267 +0,0 @@ -/* - * Inkscape::UnitTracker - Simple mediator to synchronize changes to a set - * of possible units - * - * Authors: - * Jon A. Cruz - * - * Copyright (C) 2007 Jon A. Cruz - * - * Released under GNU GPL, read the file 'COPYING' for more information - */ - -#include - -#include "unit-tracker.h" -#include "ege-select-one-action.h" - -namespace Inkscape { - -enum { - COLUMN_STRING, - COLUMN_SPUNIT, - N_COLUMNS -}; - -UnitTracker::UnitTracker( guint bases ) : - _active(0), - _isUpdating(false), - _activeUnit(0), - _store(0), - _unitList(0), - _actionList(0), - _adjList(0), - _priorValues() -{ - _store = gtk_list_store_new( N_COLUMNS, G_TYPE_STRING, G_TYPE_POINTER ); - setBase( bases ); -} - -UnitTracker::~UnitTracker() -{ - if ( _unitList ) { - sp_unit_free_list( _unitList ); - } - - // Unhook weak references to GtkActions - while ( _actionList ) { - g_signal_handlers_disconnect_by_func( G_OBJECT(_actionList->data), (gpointer)_unitChangedCB, this ); - g_object_weak_unref( G_OBJECT(_actionList->data), _actionFinalizedCB, this ); - _actionList = g_slist_delete_link( _actionList, _actionList ); - } - - // Unhook wek references to GtkAdjustments - while ( _adjList ) { - g_object_weak_unref( G_OBJECT(_adjList->data), _adjustmentFinalizedCB, this ); - _adjList = g_slist_delete_link( _adjList, _adjList ); - } -} - -void UnitTracker::setBase( guint bases ) -{ - GtkTreeIter iter; - _unitList = sp_unit_get_list( bases ); - for ( GSList* cur = _unitList; cur; cur = g_slist_next(cur) ) { - SPUnit* unit = static_cast(cur->data); - gtk_list_store_append( _store, &iter ); - gtk_list_store_set( _store, &iter, COLUMN_STRING, unit->abbr, COLUMN_SPUNIT, unit, -1 ); - } - gint count = gtk_tree_model_iter_n_children( GTK_TREE_MODEL(_store), 0 ); - if ( (count > 0) && (_active > count) ) { - _setActive( count - 1 ); - } else { - _setActive( _active ); - } -} - -void UnitTracker::addUnit( SPUnitId id, gint index ) -{ - GtkTreeIter iter; - const SPUnit* percentUnit = &sp_unit_get_by_id( id ); - gtk_list_store_insert( _store, &iter, index ); - gtk_list_store_set( _store, &iter, COLUMN_STRING, percentUnit->abbr, COLUMN_SPUNIT, percentUnit, -1 ); -} - -bool UnitTracker::isUpdating() const -{ - return _isUpdating; -} - -SPUnit const* UnitTracker::getActiveUnit() const -{ - return _activeUnit; -} - -void UnitTracker::setActiveUnit( SPUnit const *unit ) -{ - /*if ( unit ) { - GtkTreeIter iter; - int index = 0; - gboolean found = gtk_tree_model_get_iter_first( GTK_TREE_MODEL(_store), &iter ); - while ( found ) { - SPUnit* storedUnit = 0; - gtk_tree_model_get( GTK_TREE_MODEL(_store), &iter, COLUMN_SPUNIT, &storedUnit, -1 ); - if ( storedUnit && (storedUnit->unit_id == unit->unit_id) ) { - _setActive(index); - break; - } - - found = gtk_tree_model_iter_next( GTK_TREE_MODEL(_store), &iter ); - index++; - } - }*/ -} - -void UnitTracker::addAdjustment( GtkAdjustment* adj ) -{ - if ( !g_slist_find( _adjList, adj ) ) { - g_object_weak_ref( G_OBJECT(adj), _adjustmentFinalizedCB, this ); - _adjList = g_slist_append( _adjList, adj ); - } -} - -void UnitTracker::setFullVal( GtkAdjustment* adj, gdouble val ) -{ - _priorValues[adj] = val; -} - -GtkAction* UnitTracker::createAction( gchar const* name, gchar const* label, gchar const* tooltip ) -{ - EgeSelectOneAction* act1 = ege_select_one_action_new( name, label, tooltip, NULL, GTK_TREE_MODEL(_store) ); - ege_select_one_action_set_label_column( act1, COLUMN_STRING ); - if ( _active ) { - ege_select_one_action_set_active( act1, _active ); - } - - ege_select_one_action_set_appearance( act1, "minimal" ); - g_object_weak_ref( G_OBJECT(act1), _actionFinalizedCB, this ); - g_signal_connect( G_OBJECT(act1), "changed", G_CALLBACK( _unitChangedCB ), this ); - _actionList = g_slist_append( _actionList, act1 ); - - return GTK_ACTION(act1); -} - -void UnitTracker::_unitChangedCB( GtkAction* action, gpointer data ) -{ - if ( action && data ) { - EgeSelectOneAction* act = EGE_SELECT_ONE_ACTION(action); - gint active = ege_select_one_action_get_active( act ); - UnitTracker* self = reinterpret_cast(data); - self->_setActive(active); - } -} - -void UnitTracker::_actionFinalizedCB( gpointer data, GObject *where_the_object_was ) -{ - if ( data && where_the_object_was ) { - UnitTracker* self = reinterpret_cast(data); - self->_actionFinalized( where_the_object_was ); - } -} - -void UnitTracker::_adjustmentFinalizedCB( gpointer data, GObject *where_the_object_was ) -{ - if ( data && where_the_object_was ) { - UnitTracker* self = reinterpret_cast(data); - self->_adjustmentFinalized( where_the_object_was ); - } -} - -void UnitTracker::_actionFinalized( GObject *where_the_object_was ) -{ - GSList* target = g_slist_find( _actionList, where_the_object_was ); - if ( target ) { - _actionList = g_slist_remove( _actionList, where_the_object_was ); - } else { - g_warning("Received a finalization callback for unknown object %p", where_the_object_was ); - } -} - -void UnitTracker::_adjustmentFinalized( GObject *where_the_object_was ) -{ - GSList* target = g_slist_find( _adjList, where_the_object_was ); - if ( target ) { - _adjList = g_slist_remove( _adjList, where_the_object_was ); - } else { - g_warning("Received a finalization callback for unknown object %p", where_the_object_was ); - } -} - -void UnitTracker::_setActive( gint active ) -{ - if ( active != _active || (_activeUnit == 0) ) { - gint oldActive = _active; - - GtkTreeIter iter; - gboolean found = gtk_tree_model_iter_nth_child( GTK_TREE_MODEL(_store), &iter, NULL, oldActive ); - if ( found ) { - SPUnit* unit = 0; - gtk_tree_model_get( GTK_TREE_MODEL(_store), &iter, COLUMN_SPUNIT, &unit, -1 ); - - found = gtk_tree_model_iter_nth_child( GTK_TREE_MODEL(_store), &iter, NULL, active ); - if ( found ) { - SPUnit* newUnit = 0; - gtk_tree_model_get( GTK_TREE_MODEL(_store), &iter, COLUMN_SPUNIT, &newUnit, -1 ); - _activeUnit = newUnit; - - if ( _adjList ) { - _fixupAdjustments( unit, newUnit ); - } - - } else { - g_warning("Did not find new unit"); - } - } else { - g_warning("Did not find old unit"); - } - - _active = active; - - for ( GSList* cur = _actionList; cur; cur = g_slist_next(cur) ) { - if ( IS_EGE_SELECT_ONE_ACTION( cur->data ) ) { - EgeSelectOneAction* act = EGE_SELECT_ONE_ACTION( cur->data ); - ege_select_one_action_set_active( act, active ); - } - } - } -} - -void UnitTracker::_fixupAdjustments( SPUnit const* oldUnit, SPUnit const *newUnit ) -{ - _isUpdating = true; - for ( GSList* cur = _adjList; cur; cur = g_slist_next(cur) ) { - GtkAdjustment* adj = GTK_ADJUSTMENT(cur->data); - gdouble oldVal = gtk_adjustment_get_value(adj); - gdouble val = oldVal; - - if ((oldUnit->base == SP_UNIT_ABSOLUTE || oldUnit->base == SP_UNIT_DEVICE) - && (newUnit->base == SP_UNIT_DIMENSIONLESS)) - { - val = 1.0 / newUnit->unittobase; - _priorValues[adj] = sp_units_get_pixels( oldVal, *oldUnit ); - } else if ((oldUnit->base == SP_UNIT_DIMENSIONLESS) - && (newUnit->base == SP_UNIT_ABSOLUTE || newUnit->base == SP_UNIT_DEVICE)) { - if ( _priorValues.find(adj) != _priorValues.end() ) { - val = sp_pixels_get_units( _priorValues[adj], *newUnit ); - } - } else { - val = sp_convert_distance_full( oldVal, *oldUnit, *newUnit ); - } - - gtk_adjustment_set_value( adj, val ); - } - _isUpdating = false; -} - -} - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/helper/unit-tracker.h b/src/helper/unit-tracker.h deleted file mode 100644 index a15a0a6ca..000000000 --- a/src/helper/unit-tracker.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Inkscape::UnitTracker - Simple mediator to synchronize changes to a set - * of possible units - * - * Authors: - * Jon A. Cruz - * - * Copyright (C) 2007 Jon A. Cruz - * - * Released under GNU GPL, read the file 'COPYING' for more information - */ - -#ifndef SEEN_INKSCAPE_UNIT_TRACKER_H -#define SEEN_INKSCAPE_UNIT_TRACKER_H - -#include - -#include - -#include "helper/units.h" - -namespace Inkscape { - -class UnitTracker -{ -public: - UnitTracker( guint bases = (SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE) ); - virtual ~UnitTracker(); - - void setBase( guint bases ); // SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE - void addUnit( SPUnitId id, gint index ); - - bool isUpdating() const; - - void setActiveUnit( SPUnit const *unit ); - SPUnit const* getActiveUnit() const; - - void addAdjustment( GtkAdjustment* adj ); - void setFullVal( GtkAdjustment* adj, gdouble val ); - - GtkAction* createAction( gchar const* name, gchar const* label, gchar const* tooltip ); - -private: - static void _unitChangedCB( GtkAction* action, gpointer data ); - static void _actionFinalizedCB( gpointer data, GObject *where_the_object_was ); - static void _adjustmentFinalizedCB( gpointer data, GObject *where_the_object_was ); - void _setActive( gint index ); - void _fixupAdjustments( SPUnit const* oldUnit, SPUnit const *newUnit ); - void _actionFinalized( GObject *where_the_object_was ); - void _adjustmentFinalized( GObject *where_the_object_was ); - - gint _active; - bool _isUpdating; - SPUnit* _activeUnit; - GtkListStore* _store; - GSList* _unitList; - GSList* _actionList; - GSList* _adjList; - std::map _priorValues; -}; - -} - -#endif // SEEN_INKSCAPE_UNIT_TRACKER_H - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : -- cgit v1.2.3 From c60177d361dd435e58caa902a395fa21c9415f51 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Wed, 17 Jul 2013 18:12:31 -0400 Subject: Removed "helper/unit.*" dependency from "ui/widget/registered-widget.*". (bzr r12380.1.21) --- src/display/canvas-axonomgrid.cpp | 2 +- src/display/canvas-grid.cpp | 2 +- src/live_effects/parameter/unit.cpp | 2 +- src/ui/widget/registered-widget.cpp | 5 ++--- src/ui/widget/registered-widget.h | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/display/canvas-axonomgrid.cpp b/src/display/canvas-axonomgrid.cpp index 1eadd3fd2..59d2bb36d 100644 --- a/src/display/canvas-axonomgrid.cpp +++ b/src/display/canvas-axonomgrid.cpp @@ -419,7 +419,7 @@ _wr.setUpdating (false); attach_all (*table, widget_array, sizeof(widget_array)); // set widget values - _rumg->setUnit (gridunit); + _rumg->setUnit (gridunit->abbr); gdouble val; val = origin[Geom::X]; diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp index ee5ad0945..9fbb5f907 100644 --- a/src/display/canvas-grid.cpp +++ b/src/display/canvas-grid.cpp @@ -802,7 +802,7 @@ CanvasXYGrid::newSpecificWidget() attach_all (*table, widget_array, sizeof(widget_array)); // set widget values - _rumg->setUnit (gridunit); + _rumg->setUnit (gridunit->abbr); gdouble val; val = origin[Geom::X]; diff --git a/src/live_effects/parameter/unit.cpp b/src/live_effects/parameter/unit.cpp index 602d806a0..fffbabb1d 100644 --- a/src/live_effects/parameter/unit.cpp +++ b/src/live_effects/parameter/unit.cpp @@ -74,7 +74,7 @@ UnitParam::param_newWidget() param_effect->getRepr(), param_effect->getSPDoc())); - unit_menu->setUnit(unit); + unit_menu->setUnit(unit->abbr); unit_menu->set_undo_parameters(SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Change unit parameter")); return dynamic_cast (unit_menu); diff --git a/src/ui/widget/registered-widget.cpp b/src/ui/widget/registered-widget.cpp index ea2bac867..ae6a7d1e0 100644 --- a/src/ui/widget/registered-widget.cpp +++ b/src/ui/widget/registered-widget.cpp @@ -27,7 +27,6 @@ #include "ui/widget/random.h" #include "widgets/spinbutton-events.h" -#include "helper/units.h" #include "xml/repr.h" #include "svg/svg-color.h" #include "svg/stringstream.h" @@ -118,9 +117,9 @@ RegisteredUnitMenu::RegisteredUnitMenu (const Glib::ustring& label, const Glib:: } void -RegisteredUnitMenu::setUnit (const SPUnit* unit) +RegisteredUnitMenu::setUnit (Glib::ustring unit) { - getUnitMenu()->setUnit (sp_unit_get_abbreviation (unit)); + getUnitMenu()->setUnit(unit); } void diff --git a/src/ui/widget/registered-widget.h b/src/ui/widget/registered-widget.h index fa35b815e..491ca6050 100644 --- a/src/ui/widget/registered-widget.h +++ b/src/ui/widget/registered-widget.h @@ -166,7 +166,7 @@ public: Inkscape::XML::Node* repr_in = NULL, SPDocument *doc_in = NULL ); - void setUnit (const SPUnit*); + void setUnit (const Glib::ustring); Unit getUnit() const { return static_cast(_widget)->getUnit(); }; UnitMenu* getUnitMenu() const { return static_cast(_widget); }; sigc::connection _changed_connection; -- cgit v1.2.3 From 64e66e01886be870fc9615e65416097e64ad544b Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Wed, 17 Jul 2013 18:13:19 -0400 Subject: Ported "ui/dialog/export.*". (bzr r12380.1.22) --- src/ui/dialog/export.cpp | 74 ++++++++++++++++++------------------------------ src/ui/dialog/export.h | 8 +++++- 2 files changed, 35 insertions(+), 47 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index 25300cfc0..61fb6e4ee 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -48,8 +48,8 @@ #include #include -#include "helper/unit-menu.h" -#include "helper/units.h" +#include "ui/widget/unit-menu.h" +#include "util/units.h" #include "unit-constants.h" #include "helper/window.h" #include "inkscape-private.h" @@ -198,10 +198,13 @@ Export::Export (void) : /* Units box */ /* gets added to the vbox later, but the unit selector is needed earlier than that */ - unit_selector = Glib::wrap(sp_unit_selector_new (SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE)); + unit_selector = new Inkscape::UI::Widget::UnitMenu(); + unit_selector->setUnitType(Inkscape::Util::UNIT_TYPE_LINEAR); + unitChangedConn = unit_selector->signal_changed().connect(sigc::mem_fun(*this, &Export::onUnitChanged)); + SPDesktop *desktop = SP_ACTIVE_DESKTOP; - //if (desktop) - // sp_unit_selector_set_unit (SP_UNIT_SELECTOR(unit_selector->gobj()), sp_desktop_namedview(desktop)->doc_units); + if (desktop) + unit_selector->setUnit(sp_desktop_namedview(desktop)->doc_units->abbr); unitbox.pack_end(*unit_selector, false, false, 0); unitbox.pack_end(units_label, false, false, 3); @@ -226,28 +229,28 @@ Export::Export (void) : t->set_col_spacings (4); #endif - x0_adj = createSpinbutton ( "x0", 0.0, -1000000.0, 1000000.0, 0.1, 1.0, unit_selector->gobj(), + x0_adj = createSpinbutton ( "x0", 0.0, -1000000.0, 1000000.0, 0.1, 1.0, ((Gtk::Widget*) unit_selector)->gobj(), t, 0, 0, _("_x0:"), "", EXPORT_COORD_PRECISION, 1, &Export::onAreaX0Change); - x1_adj = createSpinbutton ( "x1", 0.0, -1000000.0, 1000000.0, 0.1, 1.0, unit_selector->gobj(), + x1_adj = createSpinbutton ( "x1", 0.0, -1000000.0, 1000000.0, 0.1, 1.0, ((Gtk::Widget*) unit_selector)->gobj(), t, 0, 1, _("x_1:"), "", EXPORT_COORD_PRECISION, 1, &Export::onAreaX1Change); width_adj = createSpinbutton ( "width", 0.0, 0.0, PNG_UINT_31_MAX, 0.1, 1.0, - unit_selector->gobj(), t, 0, 2, _("Wid_th:"), "", EXPORT_COORD_PRECISION, 1, + ((Gtk::Widget*) unit_selector)->gobj(), t, 0, 2, _("Wid_th:"), "", EXPORT_COORD_PRECISION, 1, &Export::onAreaWidthChange); - y0_adj = createSpinbutton ( "y0", 0.0, -1000000.0, 1000000.0, 0.1, 1.0, unit_selector->gobj(), + y0_adj = createSpinbutton ( "y0", 0.0, -1000000.0, 1000000.0, 0.1, 1.0, ((Gtk::Widget*) unit_selector)->gobj(), t, 2, 0, _("_y0:"), "", EXPORT_COORD_PRECISION, 1, &Export::onAreaY0Change); - y1_adj = createSpinbutton ( "y1", 0.0, -1000000.0, 1000000.0, 0.1, 1.0, unit_selector->gobj(), + y1_adj = createSpinbutton ( "y1", 0.0, -1000000.0, 1000000.0, 0.1, 1.0, ((Gtk::Widget*) unit_selector)->gobj(), t, 2, 1, _("y_1:"), "", EXPORT_COORD_PRECISION, 1, &Export::onAreaY1Change); height_adj = createSpinbutton ( "height", 0.0, 0.0, PNG_UINT_31_MAX, 0.1, 1.0, - unit_selector->gobj(), t, 2, 2, _("Hei_ght:"), "", EXPORT_COORD_PRECISION, 1, + ((Gtk::Widget*) unit_selector)->gobj(), t, 2, 2, _("Hei_ght:"), "", EXPORT_COORD_PRECISION, 1, &Export::onAreaHeightChange); area_box.pack_start(togglebox, false, false, 3); @@ -496,9 +499,6 @@ Gtk::Adjustment * Export::createSpinbutton( gchar const * /*key*/, float val, fl #else Gtk::Adjustment *adj = new Gtk::Adjustment ( val, min, max, step, page, 0 ); #endif - if (us) { - sp_unit_selector_add_adjustment ( SP_UNIT_SELECTOR (us), GTK_ADJUSTMENT (adj->gobj()) ); - } int pos = 0; Gtk::Label *l = NULL; @@ -979,6 +979,12 @@ Glib::ustring Export::absolutize_path_from_document_location (SPDocument *doc, c return path; } +// Called when unit is changed +void Export::onUnitChanged() +{ + onAreaToggled(); +} + void Export::onHideExceptSelected () { prefs->setBool("/dialogs/export/hideexceptselected/value", hide_export.get_active()); @@ -1507,10 +1513,6 @@ void Export::areaXChange (Gtk::Adjustment *adj) return; } - if (sp_unit_selector_update_test(SP_UNIT_SELECTOR(unit_selector->gobj()))) { - return; - } - update = true; x0 = getValuePx(x0_adj); @@ -1554,10 +1556,6 @@ void Export::areaYChange (Gtk::Adjustment *adj) return; } - if (sp_unit_selector_update_test (SP_UNIT_SELECTOR(unit_selector->gobj()))) { - return; - } - update = true; y0 = getValuePx(y0_adj); @@ -1597,10 +1595,6 @@ void Export::onAreaWidthChange() return; } - if (sp_unit_selector_update_test(reinterpret_cast(unit_selector->gobj()))) { - return; - } - update = true; float x0 = getValuePx(x0_adj); @@ -1630,10 +1624,6 @@ void Export::onAreaHeightChange() return; } - if (sp_unit_selector_update_test(reinterpret_cast(unit_selector->gobj()))) { - return; - } - update = true; float y0 = getValuePx(y0_adj); @@ -1709,10 +1699,6 @@ void Export::onBitmapWidthChange () return; } - if (sp_unit_selector_update_test(SP_UNIT_SELECTOR(unit_selector->gobj()))) { - return; - } - update = true; x0 = getValuePx(x0_adj); @@ -1743,10 +1729,6 @@ void Export::onBitmapHeightChange () return; } - if (sp_unit_selector_update_test(SP_UNIT_SELECTOR(unit_selector->gobj()))) { - return; - } - update = true; y0 = getValuePx(y0_adj); @@ -1803,10 +1785,6 @@ void Export::onExportXdpiChange() return; } - if (sp_unit_selector_update_test(SP_UNIT_SELECTOR(unit_selector->gobj()))) { - return; - } - update = true; x0 = getValuePx(x0_adj); @@ -1905,9 +1883,11 @@ void Export::setValuePx(Glib::RefPtr& adj, double val) void Export::setValuePx( Gtk::Adjustment *adj, double val) #endif { - const SPUnit *unit = sp_unit_selector_get_unit(SP_UNIT_SELECTOR(unit_selector->gobj()) ); + const Unit unit = unit_selector->getUnit(); + Inkscape::Util::UnitTable unit_table; + Inkscape::Util::Unit px = unit_table.getUnit("px"); - setValue(adj, sp_pixels_get_units (val, *unit)); + setValue(adj, Inkscape::Util::Quantity::convert(val, &px, &unit)); return; } @@ -1955,9 +1935,11 @@ float Export::getValuePx( Gtk::Adjustment *adj ) #endif { float value = getValue( adj); - const SPUnit *unit = sp_unit_selector_get_unit(SP_UNIT_SELECTOR(unit_selector->gobj())); + const Unit unit = unit_selector->getUnit(); + Inkscape::Util::UnitTable unit_table; + Inkscape::Util::Unit px = unit_table.getUnit("px"); - return sp_units_get_pixels (value, *unit); + return Inkscape::Util::Quantity::convert(value, &unit, &px); } // end of sp_export_value_get_px() /** diff --git a/src/ui/dialog/export.h b/src/ui/dialog/export.h index b10c98fd2..f324f5dc5 100644 --- a/src/ui/dialog/export.h +++ b/src/ui/dialog/export.h @@ -171,6 +171,11 @@ private: void areaYChange ( Gtk::Adjustment *adj); #endif + /** + * Unit changed callback + */ + void onUnitChanged(); + /** * Hide except selected callback */ @@ -330,7 +335,7 @@ private: /* Unit selector widgets */ Gtk::HBox unitbox; - Gtk::Widget* unit_selector; + Inkscape::UI::Widget::UnitMenu *unit_selector; Gtk::Label units_label; /* Filename widgets */ @@ -365,6 +370,7 @@ private: sigc::connection selectChangedConn; sigc::connection subselChangedConn; sigc::connection selectModifiedConn; + sigc::connection unitChangedConn; }; -- cgit v1.2.3 From ce25410db81c6a22a6b841efdb4790f7f19319ec Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Thu, 18 Jul 2013 10:39:48 -0400 Subject: Ported "ui/dialog/clonetiler.*". (bzr r12380.1.23) --- src/ui/dialog/clonetiler.cpp | 86 +++++++++++++++++++++++++++----------------- src/ui/dialog/clonetiler.h | 20 +++++++++-- 2 files changed, 72 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp index 00bb6f0e2..d270afc3f 100644 --- a/src/ui/dialog/clonetiler.cpp +++ b/src/ui/dialog/clonetiler.cpp @@ -34,8 +34,8 @@ #include "document.h" #include "document-undo.h" #include "filter-chemistry.h" -#include "helper/unit-menu.h" -#include "helper/units.h" +#include "ui/widget/unit-menu.h" +#include "util/units.h" #include "helper/window.h" #include "inkscape.h" #include "interface.h" @@ -1092,35 +1092,38 @@ CloneTiler::CloneTiler (void) : g_object_set_data (G_OBJECT(dlg), "widthheight", (gpointer) hb); // unitmenu - GtkWidget *u = sp_unit_selector_new (SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE); - //sp_unit_selector_set_unit (SP_UNIT_SELECTOR(u), sp_desktop_namedview(SP_ACTIVE_DESKTOP)->doc_units); + unit_menu = new Inkscape::UI::Widget::UnitMenu(); + unit_menu->setUnitType(Inkscape::Util::UNIT_TYPE_LINEAR); + unit_menu->setUnit(sp_desktop_namedview(SP_ACTIVE_DESKTOP)->doc_units->abbr); + unitChangedConn = unit_menu->signal_changed().connect(sigc::mem_fun(*this, &CloneTiler::clonetiler_unit_changed)); { // Width spinbutton #if WITH_GTKMM_3_0 - Glib::RefPtr a = Gtk::Adjustment::create(0.0, -1e6, 1e6, 1.0, 10.0, 0); + fill_width = Gtk::Adjustment::create(0.0, -1e6, 1e6, 1.0, 10.0, 0); #else - Gtk::Adjustment *a = new Gtk::Adjustment (0.0, -1e6, 1e6, 1.0, 10.0, 0); + fill_width = new Gtk::Adjustment (0.0, -1e6, 1e6, 1.0, 10.0, 0); #endif - sp_unit_selector_add_adjustment (SP_UNIT_SELECTOR (u), GTK_ADJUSTMENT (a->gobj())); double value = prefs->getDouble(prefs_path + "fillwidth", 50.0); - SPUnit const &unit = *sp_unit_selector_get_unit(SP_UNIT_SELECTOR(u)); - gdouble const units = sp_pixels_get_units (value, unit); - a->set_value (units); + Inkscape::Util::Unit const unit = unit_menu->getUnit(); + Inkscape::Util::UnitTable unit_table; + Inkscape::Util::Unit const px = unit_table.getUnit("px"); + gdouble const units = Inkscape::Util::Quantity::convert(value, &px, &unit); + fill_width->set_value (units); #if WITH_GTKMM_3_0 - Inkscape::UI::Widget::SpinButton *e = new Inkscape::UI::Widget::SpinButton(a, 1.0, 2); + Inkscape::UI::Widget::SpinButton *e = new Inkscape::UI::Widget::SpinButton(fill_width, 1.0, 2); #else - Inkscape::UI::Widget::SpinButton *e = new Inkscape::UI::Widget::SpinButton (*a, 1.0, 2); + Inkscape::UI::Widget::SpinButton *e = new Inkscape::UI::Widget::SpinButton (*fill_width, 1.0, 2); #endif e->set_tooltip_text (_("Width of the rectangle to be filled")); e->set_width_chars (7); e->set_digits (4); gtk_box_pack_start (GTK_BOX (hb), GTK_WIDGET(e->gobj()), TRUE, TRUE, 0); // TODO: C++ification - g_signal_connect(G_OBJECT(a->gobj()), "value_changed", - G_CALLBACK(clonetiler_fill_width_changed), u); + g_signal_connect(G_OBJECT(fill_width->gobj()), "value_changed", + G_CALLBACK(clonetiler_fill_width_changed), unit_menu); } { GtkWidget *l = gtk_label_new (""); @@ -1132,32 +1135,33 @@ CloneTiler::CloneTiler (void) : { // Height spinbutton #if WITH_GTKMM_3_0 - Glib::RefPtr a = Gtk::Adjustment::create(0.0, -1e6, 1e6, 1.0, 10.0, 0); + fill_height = Gtk::Adjustment::create(0.0, -1e6, 1e6, 1.0, 10.0, 0); #else - Gtk::Adjustment *a = new Gtk::Adjustment (0.0, -1e6, 1e6, 1.0, 10.0, 0); + fill_height = new Gtk::Adjustment (0.0, -1e6, 1e6, 1.0, 10.0, 0); #endif - sp_unit_selector_add_adjustment (SP_UNIT_SELECTOR (u), GTK_ADJUSTMENT (a->gobj())); double value = prefs->getDouble(prefs_path + "fillheight", 50.0); - SPUnit const &unit = *sp_unit_selector_get_unit(SP_UNIT_SELECTOR(u)); - gdouble const units = sp_pixels_get_units (value, unit); - a->set_value (units); + Inkscape::Util::Unit const unit = unit_menu->getUnit(); + Inkscape::Util::UnitTable unit_table; + Inkscape::Util::Unit const px = unit_table.getUnit("px"); + gdouble const units = Inkscape::Util::Quantity::convert(value, &px, &unit); + fill_height->set_value (units); #if WITH_GTKMM_3_0 - Inkscape::UI::Widget::SpinButton *e = new Inkscape::UI::Widget::SpinButton(a, 1.0, 2); + Inkscape::UI::Widget::SpinButton *e = new Inkscape::UI::Widget::SpinButton(fill_height, 1.0, 2); #else - Inkscape::UI::Widget::SpinButton *e = new Inkscape::UI::Widget::SpinButton (*a, 1.0, 2); + Inkscape::UI::Widget::SpinButton *e = new Inkscape::UI::Widget::SpinButton (*fill_height, 1.0, 2); #endif e->set_tooltip_text (_("Height of the rectangle to be filled")); e->set_width_chars (7); e->set_digits (4); gtk_box_pack_start (GTK_BOX (hb), GTK_WIDGET(e->gobj()), TRUE, TRUE, 0); // TODO: C++ification - g_signal_connect(G_OBJECT(a->gobj()), "value_changed", - G_CALLBACK(clonetiler_fill_height_changed), u); + g_signal_connect(G_OBJECT(fill_height->gobj()), "value_changed", + G_CALLBACK(clonetiler_fill_height_changed), unit_menu); } - gtk_box_pack_start (GTK_BOX (hb), u, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (hb), (GtkWidget*) unit_menu->gobj(), TRUE, TRUE, 0); clonetiler_table_attach (table, hb, 0.0, 2, 2); } @@ -2944,26 +2948,45 @@ void CloneTiler::clonetiler_switch_to_fill(GtkToggleButton * /*tb*/, GtkWidget * -void CloneTiler::clonetiler_fill_width_changed(GtkAdjustment *adj, GtkWidget *u) +void CloneTiler::clonetiler_fill_width_changed(GtkAdjustment *adj, Inkscape::UI::Widget::UnitMenu *u) { gdouble const raw_dist = gtk_adjustment_get_value (adj); - SPUnit const &unit = *sp_unit_selector_get_unit(SP_UNIT_SELECTOR(u)); - gdouble const pixels = sp_units_get_pixels (raw_dist, unit); + Inkscape::Util::Unit const unit = u->getUnit(); + Inkscape::Util::UnitTable unit_table; + Inkscape::Util::Unit const px = unit_table.getUnit("px"); + gdouble const pixels = Inkscape::Util::Quantity::convert(raw_dist, &unit, &px); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); prefs->setDouble(prefs_path + "fillwidth", pixels); } -void CloneTiler::clonetiler_fill_height_changed(GtkAdjustment *adj, GtkWidget *u) +void CloneTiler::clonetiler_fill_height_changed(GtkAdjustment *adj, Inkscape::UI::Widget::UnitMenu *u) { gdouble const raw_dist = gtk_adjustment_get_value (adj); - SPUnit const &unit = *sp_unit_selector_get_unit(SP_UNIT_SELECTOR(u)); - gdouble const pixels = sp_units_get_pixels (raw_dist, unit); + Inkscape::Util::Unit const unit = u->getUnit(); + Inkscape::Util::UnitTable unit_table; + Inkscape::Util::Unit const px = unit_table.getUnit("px"); + gdouble const pixels = Inkscape::Util::Quantity::convert(raw_dist, &unit, &px); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); prefs->setDouble(prefs_path + "fillheight", pixels); } +void CloneTiler::clonetiler_unit_changed() +{ + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + gdouble width_pixels = prefs->getDouble(prefs_path + "fillwidth"); + gdouble height_pixels = prefs->getDouble(prefs_path + "fillheight"); + + Inkscape::Util::Unit unit = unit_menu->getUnit(); + Inkscape::Util::UnitTable unit_table; + Inkscape::Util::Unit px = unit_table.getUnit("px"); + + gdouble width_value = Inkscape::Util::Quantity::convert(width_pixels, &px, &unit); + gdouble height_value = Inkscape::Util::Quantity::convert(height_pixels, &px, &unit); + gtk_adjustment_set_value(fill_width->gobj(), width_value); + gtk_adjustment_set_value(fill_height->gobj(), height_value); +} void CloneTiler::clonetiler_do_pick_toggled(GtkToggleButton *tb, GtkWidget *dlg) { @@ -2977,7 +3000,6 @@ void CloneTiler::clonetiler_do_pick_toggled(GtkToggleButton *tb, GtkWidget *dlg) } } - } } } diff --git a/src/ui/dialog/clonetiler.h b/src/ui/dialog/clonetiler.h index 7ec30cfaa..e2a0240ee 100644 --- a/src/ui/dialog/clonetiler.h +++ b/src/ui/dialog/clonetiler.h @@ -19,6 +19,11 @@ namespace Inkscape { namespace UI { + +namespace Widget { + class UnitMenu; +} + namespace Dialog { class CloneTiler : public Widget::Panel { @@ -45,8 +50,9 @@ protected: static void clonetiler_do_pick_toggled(GtkToggleButton *tb, GtkWidget *dlg); static void clonetiler_pick_to(GtkToggleButton *tb, gpointer data); static void clonetiler_xy_changed(GtkAdjustment *adj, gpointer data); - static void clonetiler_fill_width_changed(GtkAdjustment *adj, GtkWidget *u); - static void clonetiler_fill_height_changed(GtkAdjustment *adj, GtkWidget *u); + static void clonetiler_fill_width_changed(GtkAdjustment *adj, Inkscape::UI::Widget::UnitMenu *u); + static void clonetiler_fill_height_changed(GtkAdjustment *adj, Inkscape::UI::Widget::UnitMenu *u); + void clonetiler_unit_changed(); static void clonetiler_switch_to_create(GtkToggleButton */*tb*/, GtkWidget *dlg); static void clonetiler_switch_to_fill(GtkToggleButton */*tb*/, GtkWidget *dlg); static void clonetiler_keep_bbox_toggled(GtkToggleButton *tb, gpointer /*data*/); @@ -112,12 +118,22 @@ private: DesktopTracker deskTrack; Inkscape::UI::Widget::ColorPicker *color_picker; GtkSizeGroup* table_row_labels; + Inkscape::UI::Widget::UnitMenu *unit_menu; + +#if WITH_GTKMM_3_0 + Glib::RefPtr fill_width; + Glib::RefPtr fill_height; +#else + Gtk::Adjustment *fill_width; + Gtk::Adjustment *fill_height; +#endif sigc::connection desktopChangeConn; sigc::connection selectChangedConn; sigc::connection subselChangedConn; sigc::connection selectModifiedConn; sigc::connection color_changed_connection; + sigc::connection unitChangedConn; /** * Can be invoked for setting the desktop. Currently not used. -- cgit v1.2.3 From 65e3eb1a68581bede3788501a3052e97df16c91a Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Thu, 18 Jul 2013 15:00:03 -0400 Subject: Added quantity string parsing. (bzr r12380.1.24) --- src/util/units.cpp | 22 ++++++++++++++++++++++ src/util/units.h | 27 +++++++++++++++------------ 2 files changed, 37 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/util/units.cpp b/src/util/units.cpp index d485f6aef..705fc850c 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include "io/simple-sax.h" #include "util/units.h" @@ -228,6 +229,27 @@ Unit UnitTable::getUnit(Glib::ustring const &unit_abbr) const { } } +Quantity UnitTable::getQuantity(Glib::ustring const& q) const { + Glib::MatchInfo match_info; + + // Extract value + double value = 0; + Glib::RefPtr value_regex = Glib::Regex::create("\\d+\\.?\\d"); + if (value_regex->match(q, match_info)) { + value = atof(match_info.fetch(0).c_str()); + } + + // Extract unit abbreviation + Glib::ustring abbr; + Glib::RefPtr unit_regex = Glib::Regex::create("[A-z]+"); + if (unit_regex->match(q, match_info)) { + abbr = match_info.fetch(0); + } + Unit *u = new Inkscape::Util::Unit(getUnit(abbr)); + + return Quantity(value, u); +} + bool UnitTable::deleteUnit(Unit const &u) { bool deleted = false; // Cannot delete the primary unit type since it's diff --git a/src/util/units.h b/src/util/units.h index c6f124203..5d7bfaeaa 100644 --- a/src/util/units.h +++ b/src/util/units.h @@ -82,6 +82,18 @@ class Unit { int metric() const; }; +class Quantity { +public: + const Unit *unit; + double quantity; + + Quantity(double q, const Unit *u); // constructor + bool compatibleWith(const Unit *u) const; + double value(Unit *u) const; + + static double convert(const double from_dist, const Unit *from, const Unit *to); +}; + class UnitTable { public: /** @@ -99,6 +111,9 @@ class UnitTable { /** Retrieve a given unit based on its string identifier */ Unit getUnit(Glib::ustring const& name) const; + + /** Retrieve a quantity based on its string identifier */ + Quantity getQuantity(Glib::ustring const& q) const; /** Remove a unit definition from the given unit type table */ bool deleteUnit(Unit const& u); @@ -142,18 +157,6 @@ class UnitTable { }; -class Quantity { -public: - const Unit *unit; - double quantity; - - Quantity(double q, const Unit *u); // constructor - bool compatibleWith(const Unit *u) const; - double value(Unit *u) const; - - static double convert(const double from_dist, const Unit *from, const Unit *to); -}; - } // namespace Util } // namespace Inkscape -- cgit v1.2.3 From e641b84738df214c63ff67ce1bd2d0b8f6449c2e Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Thu, 18 Jul 2013 15:02:24 -0400 Subject: Ported "display/canvas-grid.*" and "display/canvas-axonomgrid.*". (bzr r12380.1.25) --- src/display/canvas-axonomgrid.cpp | 104 ++++++++--------------------- src/display/canvas-grid.cpp | 134 +++++++++++++------------------------- src/display/canvas-grid.h | 6 +- 3 files changed, 78 insertions(+), 166 deletions(-) (limited to 'src') diff --git a/src/display/canvas-axonomgrid.cpp b/src/display/canvas-axonomgrid.cpp index 59d2bb36d..5d6efb18e 100644 --- a/src/display/canvas-axonomgrid.cpp +++ b/src/display/canvas-axonomgrid.cpp @@ -51,7 +51,7 @@ #include "2geom/angle.h" #include "util/mathfns.h" #include "round.h" -#include "helper/units.h" +#include "util/units.h" enum Dim3 { X=0, Y, Z }; @@ -160,15 +160,17 @@ CanvasAxonomGrid::CanvasAxonomGrid (SPNamedView * nv, Inkscape::XML::Node * in_r : CanvasGrid(nv, in_repr, in_doc, GRID_AXONOMETRIC) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - gridunit = sp_unit_get_by_abbreviation( prefs->getString("/options/grids/axonom/units").data() ); + Inkscape::Util::UnitTable unit_table; + Inkscape::Util::Unit px = unit_table.getUnit("px"); + gridunit = new Inkscape::Util::Unit(unit_table.getUnit(prefs->getString("/options/grids/axonom/units"))); if (!gridunit) - gridunit = &sp_unit_get_by_id(SP_UNIT_PX); - origin[Geom::X] = sp_units_get_pixels( prefs->getDouble("/options/grids/axonom/origin_x", 0.0), *gridunit ); - origin[Geom::Y] = sp_units_get_pixels( prefs->getDouble("/options/grids/axonom/origin_y", 0.0), *gridunit ); + gridunit = new Inkscape::Util::Unit(unit_table.getUnit("px")); + origin[Geom::X] = Inkscape::Util::Quantity::convert(prefs->getDouble("/options/grids/axonom/origin_x", 0.0), gridunit, &px); + origin[Geom::Y] = Inkscape::Util::Quantity::convert(prefs->getDouble("/options/grids/axonom/origin_y", 0.0), gridunit, &px); color = prefs->getInt("/options/grids/axonom/color", 0x0000ff20); empcolor = prefs->getInt("/options/grids/axonom/empcolor", 0x0000ff40); empspacing = prefs->getInt("/options/grids/axonom/empspacing", 5); - lengthy = sp_units_get_pixels( prefs->getDouble("/options/grids/axonom/spacing_y", 1.0), *gridunit ); + lengthy = Inkscape::Util::Quantity::convert(prefs->getDouble("/options/grids/axonom/spacing_y", 1.0), gridunit, &px); angle_deg[X] = prefs->getDouble("/options/grids/axonom/angle_x", 30.0); angle_deg[Z] = prefs->getDouble("/options/grids/axonom/angle_z", 30.0); angle_deg[Y] = 0; @@ -188,63 +190,6 @@ CanvasAxonomGrid::~CanvasAxonomGrid () if (snapper) delete snapper; } - -/* fixme: Collect all these length parsing methods and think common sane API */ - -static gboolean sp_nv_read_length(gchar const *str, guint base, gdouble *val, SPUnit const **unit) -{ - if (!str) { - return FALSE; - } - - gchar *u; - gdouble v = g_ascii_strtod(str, &u); - if (!u) { - return FALSE; - } - while (isspace(*u)) { - u += 1; - } - - if (!*u) { - /* No unit specified - keep default */ - *val = v; - return TRUE; - } - - if (base & SP_UNIT_DEVICE) { - if (u[0] && u[1] && !isalnum(u[2]) && !strncmp(u, "px", 2)) { - *unit = &sp_unit_get_by_id(SP_UNIT_PX); - *val = v; - return TRUE; - } - } - - if (base & SP_UNIT_ABSOLUTE) { - if (!strncmp(u, "pt", 2)) { - *unit = &sp_unit_get_by_id(SP_UNIT_PT); - } else if (!strncmp(u, "mm", 2)) { - *unit = &sp_unit_get_by_id(SP_UNIT_MM); - } else if (!strncmp(u, "cm", 2)) { - *unit = &sp_unit_get_by_id(SP_UNIT_CM); - } else if (!strncmp(u, "m", 1)) { - *unit = &sp_unit_get_by_id(SP_UNIT_M); - } else if (!strncmp(u, "in", 2)) { - *unit = &sp_unit_get_by_id(SP_UNIT_IN); - } else if (!strncmp(u, "ft", 2)) { - *unit = &sp_unit_get_by_id(SP_UNIT_FT); - } else if (!strncmp(u, "pc", 2)) { - *unit = &sp_unit_get_by_id(SP_UNIT_PC); - } else { - return FALSE; - } - *val = v; - return TRUE; - } - - return FALSE; -} - static gboolean sp_nv_read_opacity(gchar const *str, guint32 *color) { if (!str) { @@ -269,18 +214,23 @@ void CanvasAxonomGrid::readRepr() { gchar const *value; + Inkscape::Util::UnitTable unit_table; + Inkscape::Util::Unit px = unit_table.getUnit("px"); if ( (value = repr->attribute("originx")) ) { - sp_nv_read_length(value, SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE, &origin[Geom::X], &gridunit); - origin[Geom::X] = sp_units_get_pixels(origin[Geom::X], *(gridunit)); + Inkscape::Util::Quantity q = unit_table.getQuantity(value); + gridunit = q.unit; + origin[Geom::X] = unit_table.getQuantity(value).value(&px); } if ( (value = repr->attribute("originy")) ) { - sp_nv_read_length(value, SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE, &origin[Geom::Y], &gridunit); - origin[Geom::Y] = sp_units_get_pixels(origin[Geom::Y], *(gridunit)); + Inkscape::Util::Quantity q = unit_table.getQuantity(value); + gridunit = q.unit; + origin[Geom::Y] = unit_table.getQuantity(value).value(&px); } if ( (value = repr->attribute("spacingy")) ) { - sp_nv_read_length(value, SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE, &lengthy, &gridunit); - lengthy = sp_units_get_pixels(lengthy, *(gridunit)); + Inkscape::Util::Quantity q = unit_table.getQuantity(value); + gridunit = q.unit; + lengthy = q.value(&px); if (lengthy < 0.0500) lengthy = 0.0500; } @@ -422,14 +372,16 @@ _wr.setUpdating (false); _rumg->setUnit (gridunit->abbr); gdouble val; + Inkscape::Util::UnitTable unit_table; + Inkscape::Util::Unit px = unit_table.getUnit("px"); val = origin[Geom::X]; - val = sp_pixels_get_units (val, *(gridunit)); + val = Inkscape::Util::Quantity::convert(val, &px, gridunit); _rsu_ox->setValue (val); val = origin[Geom::Y]; - val = sp_pixels_get_units (val, *(gridunit)); + val = Inkscape::Util::Quantity::convert(val, &px, gridunit); _rsu_oy->setValue (val); val = lengthy; - double gridy = sp_pixels_get_units (val, *(gridunit)); + double gridy = Inkscape::Util::Quantity::convert(val, &px, gridunit); _rsu_sy->setValue (gridy); _rsu_ax->setValue(angle_deg[X]); @@ -458,17 +410,17 @@ CanvasAxonomGrid::updateWidgets() _rcb_enabled.setActive(snapper->getEnabled()); } - _rumg.setUnit (gridunit); + _rumg.setUnit (gridunit->abbr); gdouble val; val = origin[Geom::X]; - val = sp_pixels_get_units (val, *(gridunit)); + val = Inkscape::Util::Quantity::convert(val, &px, gridunit); _rsu_ox.setValue (val); val = origin[Geom::Y]; - val = sp_pixels_get_units (val, *(gridunit)); + val = Inkscape::Util::Quantity::convert(val, &px, gridunit); _rsu_oy.setValue (val); val = lengthy; - double gridy = sp_pixels_get_units (val, *(gridunit)); + double gridy = Inkscape::Util::Quantity::convert(val, &px, gridunit); _rsu_sy.setValue (gridy); _rsu_ax.setValue(angle_deg[X]); diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp index 9fbb5f907..fdf156262 100644 --- a/src/display/canvas-grid.cpp +++ b/src/display/canvas-grid.cpp @@ -397,12 +397,15 @@ void CanvasGrid::setOrigin(Geom::Point const &origin_px) Inkscape::SVGOStringStream os_x, os_y; gdouble val; + Inkscape::Util::UnitTable unit_table; + Inkscape::Util::Unit px = unit_table.getUnit("px"); + val = origin_px[Geom::X]; - val = sp_pixels_get_units (val, *gridunit); - os_x << val << sp_unit_get_abbreviation(gridunit); + val = Inkscape::Util::Quantity::convert(val, &px, gridunit); + os_x << val << gridunit->abbr; val = origin_px[Geom::Y]; - val = sp_pixels_get_units (val, *gridunit); - os_y << val << sp_unit_get_abbreviation(gridunit); + val = Inkscape::Util::Quantity::convert(val, &px, gridunit); + os_y << val << gridunit->abbr; repr->setAttribute("originx", os_x.str().c_str()); repr->setAttribute("originy", os_y.str().c_str()); } @@ -488,17 +491,19 @@ CanvasXYGrid::CanvasXYGrid (SPNamedView * nv, Inkscape::XML::Node * in_repr, SPD : CanvasGrid(nv, in_repr, in_doc, GRID_RECTANGULAR) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - gridunit = sp_unit_get_by_abbreviation( prefs->getString("/options/grids/xy/units").data() ); + Inkscape::Util::UnitTable unit_table; + gridunit = new Inkscape::Util::Unit(unit_table.getUnit(prefs->getString("/options/grids/xy/units"))); if (!gridunit) { - gridunit = &sp_unit_get_by_id(SP_UNIT_PX); + gridunit = new Inkscape::Util::Unit(unit_table.getUnit("px")); } - origin[Geom::X] = sp_units_get_pixels(prefs->getDouble("/options/grids/xy/origin_x", 0.0), *gridunit); - origin[Geom::Y] = sp_units_get_pixels(prefs->getDouble("/options/grids/xy/origin_y", 0.0), *gridunit); + Inkscape::Util::Unit px = unit_table.getUnit("px"); + origin[Geom::X] = Inkscape::Util::Quantity::convert(prefs->getDouble("/options/grids/xy/origin_x", 0.0), gridunit, &px); + origin[Geom::Y] = Inkscape::Util::Quantity::convert(prefs->getDouble("/options/grids/xy/origin_y", 0.0), gridunit, &px); color = prefs->getInt("/options/grids/xy/color", 0x0000ff20); empcolor = prefs->getInt("/options/grids/xy/empcolor", 0x0000ff40); empspacing = prefs->getInt("/options/grids/xy/empspacing", 5); - spacing[Geom::X] = sp_units_get_pixels(prefs->getDouble("/options/grids/xy/spacing_x", 0.0), *gridunit); - spacing[Geom::Y] = sp_units_get_pixels(prefs->getDouble("/options/grids/xy/spacing_y", 0.0), *gridunit); + spacing[Geom::X] = Inkscape::Util::Quantity::convert(prefs->getDouble("/options/grids/xy/spacing_x", 0.0), gridunit, &px); + spacing[Geom::Y] = Inkscape::Util::Quantity::convert(prefs->getDouble("/options/grids/xy/spacing_y", 0.0), gridunit, &px); render_dotted = prefs->getBool("/options/grids/xy/dotted", false); snapper = new CanvasXYGridSnapper(this, &namedview->snap_manager, 0); @@ -511,64 +516,6 @@ CanvasXYGrid::~CanvasXYGrid () if (snapper) delete snapper; } - -/* fixme: Collect all these length parsing methods and think common sane API */ - -static gboolean -sp_nv_read_length(gchar const *str, guint base, gdouble *val, SPUnit const **unit) -{ - if (!str) { - return FALSE; - } - - gchar *u; - gdouble v = g_ascii_strtod(str, &u); - if (!u) { - return FALSE; - } - while (isspace(*u)) { - u += 1; - } - - if (!*u) { - /* No unit specified - keep default */ - *val = v; - return TRUE; - } - - if (base & SP_UNIT_DEVICE) { - if (u[0] && u[1] && !isalnum(u[2]) && !strncmp(u, "px", 2)) { - *unit = &sp_unit_get_by_id(SP_UNIT_PX); - *val = v; - return TRUE; - } - } - - if (base & SP_UNIT_ABSOLUTE) { - if (!strncmp(u, "pt", 2)) { - *unit = &sp_unit_get_by_id(SP_UNIT_PT); - } else if (!strncmp(u, "mm", 2)) { - *unit = &sp_unit_get_by_id(SP_UNIT_MM); - } else if (!strncmp(u, "cm", 2)) { - *unit = &sp_unit_get_by_id(SP_UNIT_CM); - } else if (!strncmp(u, "m", 1)) { - *unit = &sp_unit_get_by_id(SP_UNIT_M); - } else if (!strncmp(u, "in", 2)) { - *unit = &sp_unit_get_by_id(SP_UNIT_IN); - } else if (!strncmp(u, "ft", 2)) { - *unit = &sp_unit_get_by_id(SP_UNIT_FT); - } else if (!strncmp(u, "pc", 2)) { - *unit = &sp_unit_get_by_id(SP_UNIT_PC); - } else { - return FALSE; - } - *val = v; - return TRUE; - } - - return FALSE; -} - static gboolean sp_nv_read_opacity(gchar const *str, guint32 *color) { if (!str) { @@ -643,30 +590,37 @@ static void validateInt(gint oldVal, void CanvasXYGrid::readRepr() { + Inkscape::Util::UnitTable unit_table; + Inkscape::Util::Unit px = unit_table.getUnit("px"); + gchar const *value; if ( (value = repr->attribute("originx")) ) { - sp_nv_read_length(value, SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE, &origin[Geom::X], &gridunit); - origin[Geom::X] = sp_units_get_pixels(origin[Geom::X], *(gridunit)); + Inkscape::Util::Quantity q = unit_table.getQuantity(value); + gridunit = q.unit; + origin[Geom::X] = unit_table.getQuantity(value).value(&px); } if ( (value = repr->attribute("originy")) ) { - sp_nv_read_length(value, SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE, &origin[Geom::Y], &gridunit); - origin[Geom::Y] = sp_units_get_pixels(origin[Geom::Y], *(gridunit)); + Inkscape::Util::Quantity q = unit_table.getQuantity(value); + gridunit = q.unit; + origin[Geom::Y] = unit_table.getQuantity(value).value(&px); } if ( (value = repr->attribute("spacingx")) ) { double oldVal = spacing[Geom::X]; - sp_nv_read_length(value, SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE, &spacing[Geom::X], &gridunit); - validateScalar( oldVal, &spacing[Geom::X]); - spacing[Geom::X] = sp_units_get_pixels(spacing[Geom::X], *(gridunit)); - + Inkscape::Util::Quantity q = unit_table.getQuantity(value); + gridunit = q.unit; + spacing[Geom::X] = q.quantity; + validateScalar(oldVal, &spacing[Geom::X]); + spacing[Geom::X] = Inkscape::Util::Quantity::convert(spacing[Geom::X], gridunit, &px); } if ( (value = repr->attribute("spacingy")) ) { double oldVal = spacing[Geom::Y]; - sp_nv_read_length(value, SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE, &spacing[Geom::Y], &gridunit); - validateScalar( oldVal, &spacing[Geom::Y]); - spacing[Geom::Y] = sp_units_get_pixels(spacing[Geom::Y], *(gridunit)); - + Inkscape::Util::Quantity q = unit_table.getQuantity(value); + gridunit = q.unit; + spacing[Geom::Y] = q.quantity; + validateScalar(oldVal, &spacing[Geom::Y]); + spacing[Geom::Y] = Inkscape::Util::Quantity::convert(spacing[Geom::Y], gridunit, &px); } if ( (value = repr->attribute("color")) ) { @@ -805,17 +759,19 @@ CanvasXYGrid::newSpecificWidget() _rumg->setUnit (gridunit->abbr); gdouble val; + Inkscape::Util::UnitTable unit_table; + Inkscape::Util::Unit px = unit_table.getUnit("px"); val = origin[Geom::X]; - val = sp_pixels_get_units (val, *(gridunit)); + val = Inkscape::Util::Quantity::convert(val, &px, gridunit); _rsu_ox->setValue (val); val = origin[Geom::Y]; - val = sp_pixels_get_units (val, *(gridunit)); + val = Inkscape::Util::Quantity::convert(val, &px, gridunit); _rsu_oy->setValue (val); val = spacing[Geom::X]; - double gridx = sp_pixels_get_units (val, *(gridunit)); + double gridx = Inkscape::Util::Quantity::convert(val, &px, gridunit); _rsu_sx->setValue (gridx); val = spacing[Geom::Y]; - double gridy = sp_pixels_get_units (val, *(gridunit)); + double gridy = Inkscape::Util::Quantity::convert(val, &px, gridunit); _rsu_sy->setValue (gridy); _rcp_gcol->setRgba32 (color); @@ -851,20 +807,20 @@ CanvasXYGrid::updateWidgets() _rcb_enabled.setActive(snapper->getEnabled()); } - _rumg.setUnit (gridunit); + _rumg.setUnit (gridunit->abbr); gdouble val; val = origin[Geom::X]; - val = sp_pixels_get_units (val, *(gridunit)); + val = Inkscape::Quantity::convert(val, &px, gridunit); _rsu_ox.setValue (val); val = origin[Geom::Y]; - val = sp_pixels_get_units (val, *(gridunit)); + val = Inkscape::Quantity::convert(val, &px, gridunit); _rsu_oy.setValue (val); val = spacing[Geom::X]; - double gridx = sp_pixels_get_units (val, *(gridunit)); + double gridx = Inkscape::Quantity::convert(val, &px, gridunit); _rsu_sx.setValue (gridx); val = spacing[Geom::Y]; - double gridy = sp_pixels_get_units (val, *(gridunit)); + double gridy = Inkscape::Quantity::convert(val, &px, gridunit); _rsu_sy.setValue (gridy); _rcp_gcol.setRgba32 (color); diff --git a/src/display/canvas-grid.h b/src/display/canvas-grid.h index 7eaef407f..70b4bf744 100644 --- a/src/display/canvas-grid.h +++ b/src/display/canvas-grid.h @@ -28,6 +28,10 @@ namespace XML { class Node; } +namespace Util { +class Unit; +} + enum GridType { GRID_RECTANGULAR = 0, GRID_AXONOMETRIC = 1 @@ -88,7 +92,7 @@ public: guint32 empcolor; /**< Color for emphasis lines */ gint empspacing; /**< Spacing between emphasis lines */ - SPUnit const* gridunit; + Inkscape::Util::Unit const* gridunit; Inkscape::XML::Node * repr; SPDocument *doc; -- cgit v1.2.3 From 286ea5f976f27f7fdfec5859b08bcb31e53e6728 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Thu, 18 Jul 2013 16:13:16 -0400 Subject: Added more convienient unit conversion functions. (bzr r12380.1.26) --- src/util/units.cpp | 26 +++++++++++++++++++++++++- src/util/units.h | 6 +++++- 2 files changed, 30 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/util/units.cpp b/src/util/units.cpp index 705fc850c..ed8fbfa34 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -462,9 +462,14 @@ bool Quantity::compatibleWith(const Unit *u) const { } /** Return the quantity's value in the specified unit. */ -double Quantity::value(Unit *u) const { +double Quantity::value(const Unit *u) const { return convert(quantity, unit, u); } +double Quantity::value(const Glib::ustring u) const { + static UnitTable unit_table; + Unit to_unit = unit_table.getUnit(u); + return value(&to_unit); +} /** Convert distances. */ double Quantity::convert(const double from_dist, const Unit *from, const Unit *to) { @@ -476,6 +481,25 @@ double Quantity::convert(const double from_dist, const Unit *from, const Unit *t // Compatible units return from_dist * from->factor / to->factor; } +double Quantity::convert(const double from_dist, const Glib::ustring from, const Unit &to) +{ + static UnitTable unit_table; + Unit from_unit = unit_table.getUnit(from); + return convert(from_dist, &from_unit, &to); +} +double Quantity::convert(const double from_dist, const Unit &from, const Glib::ustring to) +{ + static UnitTable unit_table; + Unit to_unit = unit_table.getUnit(to); + return convert(from_dist, &from, &to_unit); +} +double Quantity::convert(const double from_dist, const Glib::ustring from, const Glib::ustring to) +{ + static UnitTable unit_table; + Unit from_unit = unit_table.getUnit(from); + Unit to_unit = unit_table.getUnit(to); + return convert(from_dist, &from_unit, &to_unit); +} } // namespace Util } // namespace Inkscape diff --git a/src/util/units.h b/src/util/units.h index 5d7bfaeaa..f1a5f1e95 100644 --- a/src/util/units.h +++ b/src/util/units.h @@ -89,9 +89,13 @@ public: Quantity(double q, const Unit *u); // constructor bool compatibleWith(const Unit *u) const; - double value(Unit *u) const; + double value(const Unit *u) const; + double value(const Glib::ustring u) const; static double convert(const double from_dist, const Unit *from, const Unit *to); + static double convert(const double from_dist, const Glib::ustring from, const Unit &to); + static double convert(const double from_dist, const Unit &from, const Glib::ustring to); + static double convert(const double from_dist, const Glib::ustring from, const Glib::ustring to); }; class UnitTable { -- cgit v1.2.3 From 51ffb1d56821be424fc50c91e486d6143976ba30 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Thu, 18 Jul 2013 16:40:36 -0400 Subject: Added more more convientent unit functions. (bzr r12380.1.27) --- src/util/units.cpp | 17 +++++++++++++++++ src/util/units.h | 5 ++++- 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/util/units.cpp b/src/util/units.cpp index ed8fbfa34..ffbd74fdd 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -140,6 +140,12 @@ bool Unit::compatibleWith(const Unit *u) const { // Different, incompatible types return false; } +bool Unit::compatibleWith(const Glib::ustring u) const +{ + static UnitTable unit_table; + Unit compatible_unit = unit_table.getUnit(u); + return compatibleWith(&compatible_unit); +} /** Check if units are equal. */ bool operator== (const Unit &u1, const Unit &u2) { @@ -455,11 +461,22 @@ Quantity::Quantity(double q, const Unit *u) { unit = u; quantity = q; } +Quantity::Quantity(double q, const Glib::ustring u) { + UnitTable unit_table; + unit = new Unit(unit_table.getUnit(u)); + quantity = q; +} /** Checks if a quantity is compatible with the specified unit. */ bool Quantity::compatibleWith(const Unit *u) const { return unit->compatibleWith(u); } +bool Quantity::compatibleWith(const Glib::ustring u) const +{ + static UnitTable unit_table; + Unit other_unit = unit_table.getUnit(u); + return compatibleWith(&other_unit); +} /** Return the quantity's value in the specified unit. */ double Quantity::value(const Unit *u) const { diff --git a/src/util/units.h b/src/util/units.h index f1a5f1e95..ec9435647 100644 --- a/src/util/units.h +++ b/src/util/units.h @@ -66,6 +66,7 @@ class Unit { int defaultDigits() const; bool compatibleWith(const Unit *u) const; + bool compatibleWith(const Glib::ustring) const; UnitType type; double factor; @@ -87,8 +88,10 @@ public: const Unit *unit; double quantity; - Quantity(double q, const Unit *u); // constructor + Quantity(double q, const Unit *u); // constructor + Quantity(double q, const Glib::ustring u); // constructor bool compatibleWith(const Unit *u) const; + bool compatibleWith(const Glib::ustring u) const; double value(const Unit *u) const; double value(const Glib::ustring u) const; -- cgit v1.2.3 From 3772fc428950b2b946a1bd7c7c97e06219c3165f Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Thu, 18 Jul 2013 17:21:24 -0400 Subject: Switch unit functions from using pointer arguements to reference arguements. (bzr r12380.1.28) --- src/display/canvas-axonomgrid.cpp | 21 ++++----- src/display/canvas-grid.cpp | 40 ++++++++--------- src/document.cpp | 20 ++++----- src/measure-context.cpp | 14 +++--- src/sp-namedview.cpp | 3 +- src/ui/dialog/clonetiler.cpp | 17 +++----- src/ui/dialog/export.cpp | 6 +-- src/ui/widget/page-sizer.cpp | 17 +++----- src/ui/widget/unit-tracker.cpp | 7 ++- src/util/units.cpp | 92 ++++++++++++++++++++++----------------- src/util/units.h | 22 +++++----- src/widgets/node-toolbar.cpp | 14 +++--- src/widgets/rect-toolbar.cpp | 14 +++--- src/widgets/select-toolbar.cpp | 24 +++++----- 14 files changed, 144 insertions(+), 167 deletions(-) (limited to 'src') diff --git a/src/display/canvas-axonomgrid.cpp b/src/display/canvas-axonomgrid.cpp index 5d6efb18e..d3db94975 100644 --- a/src/display/canvas-axonomgrid.cpp +++ b/src/display/canvas-axonomgrid.cpp @@ -161,16 +161,15 @@ CanvasAxonomGrid::CanvasAxonomGrid (SPNamedView * nv, Inkscape::XML::Node * in_r { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); Inkscape::Util::UnitTable unit_table; - Inkscape::Util::Unit px = unit_table.getUnit("px"); gridunit = new Inkscape::Util::Unit(unit_table.getUnit(prefs->getString("/options/grids/axonom/units"))); if (!gridunit) gridunit = new Inkscape::Util::Unit(unit_table.getUnit("px")); - origin[Geom::X] = Inkscape::Util::Quantity::convert(prefs->getDouble("/options/grids/axonom/origin_x", 0.0), gridunit, &px); - origin[Geom::Y] = Inkscape::Util::Quantity::convert(prefs->getDouble("/options/grids/axonom/origin_y", 0.0), gridunit, &px); + origin[Geom::X] = Inkscape::Util::Quantity::convert(prefs->getDouble("/options/grids/axonom/origin_x", 0.0), *gridunit, "px"); + origin[Geom::Y] = Inkscape::Util::Quantity::convert(prefs->getDouble("/options/grids/axonom/origin_y", 0.0), *gridunit, "px"); color = prefs->getInt("/options/grids/axonom/color", 0x0000ff20); empcolor = prefs->getInt("/options/grids/axonom/empcolor", 0x0000ff40); empspacing = prefs->getInt("/options/grids/axonom/empspacing", 5); - lengthy = Inkscape::Util::Quantity::convert(prefs->getDouble("/options/grids/axonom/spacing_y", 1.0), gridunit, &px); + lengthy = Inkscape::Util::Quantity::convert(prefs->getDouble("/options/grids/axonom/spacing_y", 1.0), *gridunit, "px"); angle_deg[X] = prefs->getDouble("/options/grids/axonom/angle_x", 30.0); angle_deg[Z] = prefs->getDouble("/options/grids/axonom/angle_z", 30.0); angle_deg[Y] = 0; @@ -215,22 +214,21 @@ CanvasAxonomGrid::readRepr() { gchar const *value; Inkscape::Util::UnitTable unit_table; - Inkscape::Util::Unit px = unit_table.getUnit("px"); if ( (value = repr->attribute("originx")) ) { Inkscape::Util::Quantity q = unit_table.getQuantity(value); gridunit = q.unit; - origin[Geom::X] = unit_table.getQuantity(value).value(&px); + origin[Geom::X] = unit_table.getQuantity(value).value("px"); } if ( (value = repr->attribute("originy")) ) { Inkscape::Util::Quantity q = unit_table.getQuantity(value); gridunit = q.unit; - origin[Geom::Y] = unit_table.getQuantity(value).value(&px); + origin[Geom::Y] = unit_table.getQuantity(value).value("px"); } if ( (value = repr->attribute("spacingy")) ) { Inkscape::Util::Quantity q = unit_table.getQuantity(value); gridunit = q.unit; - lengthy = q.value(&px); + lengthy = q.value("px"); if (lengthy < 0.0500) lengthy = 0.0500; } @@ -373,15 +371,14 @@ _wr.setUpdating (false); gdouble val; Inkscape::Util::UnitTable unit_table; - Inkscape::Util::Unit px = unit_table.getUnit("px"); val = origin[Geom::X]; - val = Inkscape::Util::Quantity::convert(val, &px, gridunit); + val = Inkscape::Util::Quantity::convert(val, "px", *gridunit); _rsu_ox->setValue (val); val = origin[Geom::Y]; - val = Inkscape::Util::Quantity::convert(val, &px, gridunit); + val = Inkscape::Util::Quantity::convert(val, "px", *gridunit); _rsu_oy->setValue (val); val = lengthy; - double gridy = Inkscape::Util::Quantity::convert(val, &px, gridunit); + double gridy = Inkscape::Util::Quantity::convert(val, "px", *gridunit); _rsu_sy->setValue (gridy); _rsu_ax->setValue(angle_deg[X]); diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp index fdf156262..e72e01dbc 100644 --- a/src/display/canvas-grid.cpp +++ b/src/display/canvas-grid.cpp @@ -398,13 +398,12 @@ void CanvasGrid::setOrigin(Geom::Point const &origin_px) gdouble val; Inkscape::Util::UnitTable unit_table; - Inkscape::Util::Unit px = unit_table.getUnit("px"); val = origin_px[Geom::X]; - val = Inkscape::Util::Quantity::convert(val, &px, gridunit); + val = Inkscape::Util::Quantity::convert(val, "px", *gridunit); os_x << val << gridunit->abbr; val = origin_px[Geom::Y]; - val = Inkscape::Util::Quantity::convert(val, &px, gridunit); + val = Inkscape::Util::Quantity::convert(val, "px", *gridunit); os_y << val << gridunit->abbr; repr->setAttribute("originx", os_x.str().c_str()); repr->setAttribute("originy", os_y.str().c_str()); @@ -496,14 +495,13 @@ CanvasXYGrid::CanvasXYGrid (SPNamedView * nv, Inkscape::XML::Node * in_repr, SPD if (!gridunit) { gridunit = new Inkscape::Util::Unit(unit_table.getUnit("px")); } - Inkscape::Util::Unit px = unit_table.getUnit("px"); - origin[Geom::X] = Inkscape::Util::Quantity::convert(prefs->getDouble("/options/grids/xy/origin_x", 0.0), gridunit, &px); - origin[Geom::Y] = Inkscape::Util::Quantity::convert(prefs->getDouble("/options/grids/xy/origin_y", 0.0), gridunit, &px); + origin[Geom::X] = Inkscape::Util::Quantity::convert(prefs->getDouble("/options/grids/xy/origin_x", 0.0), *gridunit, "px"); + origin[Geom::Y] = Inkscape::Util::Quantity::convert(prefs->getDouble("/options/grids/xy/origin_y", 0.0), *gridunit, "px"); color = prefs->getInt("/options/grids/xy/color", 0x0000ff20); empcolor = prefs->getInt("/options/grids/xy/empcolor", 0x0000ff40); empspacing = prefs->getInt("/options/grids/xy/empspacing", 5); - spacing[Geom::X] = Inkscape::Util::Quantity::convert(prefs->getDouble("/options/grids/xy/spacing_x", 0.0), gridunit, &px); - spacing[Geom::Y] = Inkscape::Util::Quantity::convert(prefs->getDouble("/options/grids/xy/spacing_y", 0.0), gridunit, &px); + spacing[Geom::X] = Inkscape::Util::Quantity::convert(prefs->getDouble("/options/grids/xy/spacing_x", 0.0), *gridunit, "px"); + spacing[Geom::Y] = Inkscape::Util::Quantity::convert(prefs->getDouble("/options/grids/xy/spacing_y", 0.0), *gridunit, "px"); render_dotted = prefs->getBool("/options/grids/xy/dotted", false); snapper = new CanvasXYGridSnapper(this, &namedview->snap_manager, 0); @@ -591,19 +589,18 @@ void CanvasXYGrid::readRepr() { Inkscape::Util::UnitTable unit_table; - Inkscape::Util::Unit px = unit_table.getUnit("px"); gchar const *value; if ( (value = repr->attribute("originx")) ) { Inkscape::Util::Quantity q = unit_table.getQuantity(value); gridunit = q.unit; - origin[Geom::X] = unit_table.getQuantity(value).value(&px); + origin[Geom::X] = unit_table.getQuantity(value).value("px"); } if ( (value = repr->attribute("originy")) ) { Inkscape::Util::Quantity q = unit_table.getQuantity(value); gridunit = q.unit; - origin[Geom::Y] = unit_table.getQuantity(value).value(&px); + origin[Geom::Y] = unit_table.getQuantity(value).value("px"); } if ( (value = repr->attribute("spacingx")) ) { @@ -612,7 +609,7 @@ CanvasXYGrid::readRepr() gridunit = q.unit; spacing[Geom::X] = q.quantity; validateScalar(oldVal, &spacing[Geom::X]); - spacing[Geom::X] = Inkscape::Util::Quantity::convert(spacing[Geom::X], gridunit, &px); + spacing[Geom::X] = Inkscape::Util::Quantity::convert(spacing[Geom::X], *gridunit, "px"); } if ( (value = repr->attribute("spacingy")) ) { double oldVal = spacing[Geom::Y]; @@ -620,7 +617,7 @@ CanvasXYGrid::readRepr() gridunit = q.unit; spacing[Geom::Y] = q.quantity; validateScalar(oldVal, &spacing[Geom::Y]); - spacing[Geom::Y] = Inkscape::Util::Quantity::convert(spacing[Geom::Y], gridunit, &px); + spacing[Geom::Y] = Inkscape::Util::Quantity::convert(spacing[Geom::Y], *gridunit, "px"); } if ( (value = repr->attribute("color")) ) { @@ -760,18 +757,17 @@ CanvasXYGrid::newSpecificWidget() gdouble val; Inkscape::Util::UnitTable unit_table; - Inkscape::Util::Unit px = unit_table.getUnit("px"); val = origin[Geom::X]; - val = Inkscape::Util::Quantity::convert(val, &px, gridunit); + val = Inkscape::Util::Quantity::convert(val, "px", *gridunit); _rsu_ox->setValue (val); val = origin[Geom::Y]; - val = Inkscape::Util::Quantity::convert(val, &px, gridunit); + val = Inkscape::Util::Quantity::convert(val, "px", *gridunit); _rsu_oy->setValue (val); val = spacing[Geom::X]; - double gridx = Inkscape::Util::Quantity::convert(val, &px, gridunit); + double gridx = Inkscape::Util::Quantity::convert(val, "px", *gridunit); _rsu_sx->setValue (gridx); val = spacing[Geom::Y]; - double gridy = Inkscape::Util::Quantity::convert(val, &px, gridunit); + double gridy = Inkscape::Util::Quantity::convert(val, "px", *gridunit); _rsu_sy->setValue (gridy); _rcp_gcol->setRgba32 (color); @@ -811,16 +807,16 @@ CanvasXYGrid::updateWidgets() gdouble val; val = origin[Geom::X]; - val = Inkscape::Quantity::convert(val, &px, gridunit); + val = Inkscape::Quantity::convert(val, "px", *gridunit); _rsu_ox.setValue (val); val = origin[Geom::Y]; - val = Inkscape::Quantity::convert(val, &px, gridunit); + val = Inkscape::Quantity::convert(val, "px", *gridunit); _rsu_oy.setValue (val); val = spacing[Geom::X]; - double gridx = Inkscape::Quantity::convert(val, &px, gridunit); + double gridx = Inkscape::Quantity::convert(val, "px", *gridunit); _rsu_sx.setValue (gridx); val = spacing[Geom::Y]; - double gridy = Inkscape::Quantity::convert(val, &px, gridunit); + double gridy = Inkscape::Quantity::convert(val, "px", *gridunit); _rsu_sy.setValue (gridy); _rcp_gcol.setRgba32 (color); diff --git a/src/document.cpp b/src/document.cpp index 78d7018bb..a024cc790 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -549,17 +549,15 @@ gdouble SPDocument::getWidth() const void SPDocument::setWidth(const Inkscape::Util::Quantity &width) { - Inkscape::Util::Unit px = unit_table.getUnit("px"); if (root->width.unit == SVGLength::PERCENT && root->viewBox_set) { // set to viewBox= - root->viewBox.setMax(Geom::Point(root->viewBox.left() + width.value(&px), root->viewBox.bottom())); + root->viewBox.setMax(Geom::Point(root->viewBox.left() + width.value("px"), root->viewBox.bottom())); } else { // set to width= gdouble old_computed = root->width.computed; - root->width.computed = width.value(&px); + root->width.computed = width.value("px"); /* SVG does not support meters as a unit, so we must translate meters to * cm when writing */ if (*width.unit == unit_table.getUnit("m")) { - Inkscape::Util::Unit cm = unit_table.getUnit("cm"); - root->width.value = width.value(&cm); + root->width.value = width.value("cm"); root->width.unit = SVGLength::CM; } else { root->width.value = width.quantity; @@ -587,17 +585,15 @@ gdouble SPDocument::getHeight() const void SPDocument::setHeight(const Inkscape::Util::Quantity &height) { - Inkscape::Util::Unit px = unit_table.getUnit("px"); if (root->height.unit == SVGLength::PERCENT && root->viewBox_set) { // set to viewBox= - root->viewBox.setMax(Geom::Point(root->viewBox.right(), root->viewBox.top() + height.value(&px))); + root->viewBox.setMax(Geom::Point(root->viewBox.right(), root->viewBox.top() + height.value("px"))); } else { // set to height= gdouble old_computed = root->height.computed; - root->height.computed = height.value(&px); + root->height.computed = height.value("px"); /* SVG does not support meters as a unit, so we must translate meters to * cm when writing */ if (*height.unit == unit_table.getUnit("m")) { - Inkscape::Util::Unit cm = unit_table.getUnit("cm"); - root->height.value = height.value(&cm); + root->height.value = height.value("cm"); root->height.unit = SVGLength::CM; } else { root->height.value = height.quantity; @@ -669,8 +665,8 @@ void SPDocument::fitToRect(Geom::Rect const &rect, bool with_margins) rect.max() + Geom::Point(margin_right, margin_top)); - setWidth(Inkscape::Util::Quantity(rect_with_margins.width(), &px)); - setHeight(Inkscape::Util::Quantity(rect_with_margins.height(), &px)); + setWidth(Inkscape::Util::Quantity(rect_with_margins.width(), "px")); + setHeight(Inkscape::Util::Quantity(rect_with_margins.height(), "px")); Geom::Translate const tr( Geom::Point(0, old_height - rect_with_margins.height()) diff --git a/src/measure-context.cpp b/src/measure-context.cpp index 6e7709d56..465b1da80 100644 --- a/src/measure-context.cpp +++ b/src/measure-context.cpp @@ -520,8 +520,6 @@ static gint sp_measure_context_root_handler(SPEventContext *event_context, GdkEv if (!unit_name.compare("")) { unit_name = "px"; } - Inkscape::Util::Unit unit = unit_table.getUnit(unit_name); - Inkscape::Util::Unit px = unit_table.getUnit("px"); double fontsize = prefs->getInt("/tools/measure/fontsize"); @@ -532,7 +530,7 @@ static gint sp_measure_context_root_handler(SPEventContext *event_context, GdkEv for (size_t idx = 1; idx < intersections.size(); ++idx) { LabelPlacement placement; placement.lengthVal = (intersections[idx] - intersections[idx - 1]).length(); - placement.lengthVal = Inkscape::Util::Quantity::convert(placement.lengthVal, &px, &unit); + placement.lengthVal = Inkscape::Util::Quantity::convert(placement.lengthVal, "px", unit_name); placement.offset = DIMENSION_OFFSET; placement.start = desktop->doc2dt( (intersections[idx - 1] + intersections[idx]) / 2 ); placement.end = placement.start - (normal * placement.offset); @@ -548,7 +546,7 @@ static gint sp_measure_context_root_handler(SPEventContext *event_context, GdkEv LabelPlacement &place = *it; // TODO cleanup memory, Glib::ustring, etc.: - gchar *measure_str = g_strdup_printf("%.2f %s", place.lengthVal, unit.abbr.c_str()); + gchar *measure_str = g_strdup_printf("%.2f %s", place.lengthVal, unit_name.c_str()); SPCanvasText *canvas_tooltip = sp_canvastext_new(sp_desktop_tempgroup(desktop), desktop, place.end, @@ -589,10 +587,10 @@ static gint sp_measure_context_root_handler(SPEventContext *event_context, GdkEv { double totallengthval = (end_point - start_point).length(); - totallengthval = Inkscape::Util::Quantity::convert(totallengthval, &px, &unit); + totallengthval = Inkscape::Util::Quantity::convert(totallengthval, "px", unit_name); // TODO cleanup memory, Glib::ustring, etc.: - gchar *totallength_str = g_strdup_printf("%.2f %s", totallengthval, unit.abbr.c_str()); + gchar *totallength_str = g_strdup_printf("%.2f %s", totallengthval, unit_name.c_str()); SPCanvasText *canvas_tooltip = sp_canvastext_new(sp_desktop_tempgroup(desktop), desktop, end_point + desktop->w2d(Geom::Point(3*fontsize, -fontsize)), @@ -610,10 +608,10 @@ static gint sp_measure_context_root_handler(SPEventContext *event_context, GdkEv if (intersections.size() > 2) { double totallengthval = (intersections[intersections.size()-1] - intersections[0]).length(); - totallengthval = Inkscape::Util::Quantity::convert(totallengthval, &px, &unit); + totallengthval = Inkscape::Util::Quantity::convert(totallengthval, "px", unit_name); // TODO cleanup memory, Glib::ustring, etc.: - gchar *total_str = g_strdup_printf("%.2f %s", totallengthval, unit.abbr.c_str()); + gchar *total_str = g_strdup_printf("%.2f %s", totallengthval, unit_name.c_str()); SPCanvasText *canvas_tooltip = sp_canvastext_new(sp_desktop_tempgroup(desktop), desktop, desktop->doc2dt((intersections[0] + intersections[intersections.size()-1])/2) + normal * 60, diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp index 0833d93bf..bf3adf816 100644 --- a/src/sp-namedview.cpp +++ b/src/sp-namedview.cpp @@ -1119,8 +1119,7 @@ double SPNamedView::getMarginLength(gchar const * const key, if (*margin_units == percent) { return (use_width)? width * value : height * value; } -// if (!sp_convert_distance (&value, margin_units, return_units)) { - if (!margin_units->compatibleWith(return_units)) { + if (!margin_units->compatibleWith(*return_units)) { return 0.0; } return value; diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp index d270afc3f..abb2512f7 100644 --- a/src/ui/dialog/clonetiler.cpp +++ b/src/ui/dialog/clonetiler.cpp @@ -1108,8 +1108,7 @@ CloneTiler::CloneTiler (void) : double value = prefs->getDouble(prefs_path + "fillwidth", 50.0); Inkscape::Util::Unit const unit = unit_menu->getUnit(); Inkscape::Util::UnitTable unit_table; - Inkscape::Util::Unit const px = unit_table.getUnit("px"); - gdouble const units = Inkscape::Util::Quantity::convert(value, &px, &unit); + gdouble const units = Inkscape::Util::Quantity::convert(value, "px", unit); fill_width->set_value (units); #if WITH_GTKMM_3_0 @@ -1143,8 +1142,7 @@ CloneTiler::CloneTiler (void) : double value = prefs->getDouble(prefs_path + "fillheight", 50.0); Inkscape::Util::Unit const unit = unit_menu->getUnit(); Inkscape::Util::UnitTable unit_table; - Inkscape::Util::Unit const px = unit_table.getUnit("px"); - gdouble const units = Inkscape::Util::Quantity::convert(value, &px, &unit); + gdouble const units = Inkscape::Util::Quantity::convert(value, "px", unit); fill_height->set_value (units); #if WITH_GTKMM_3_0 @@ -2953,8 +2951,7 @@ void CloneTiler::clonetiler_fill_width_changed(GtkAdjustment *adj, Inkscape::UI: gdouble const raw_dist = gtk_adjustment_get_value (adj); Inkscape::Util::Unit const unit = u->getUnit(); Inkscape::Util::UnitTable unit_table; - Inkscape::Util::Unit const px = unit_table.getUnit("px"); - gdouble const pixels = Inkscape::Util::Quantity::convert(raw_dist, &unit, &px); + gdouble const pixels = Inkscape::Util::Quantity::convert(raw_dist, unit, "px"); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); prefs->setDouble(prefs_path + "fillwidth", pixels); @@ -2965,8 +2962,7 @@ void CloneTiler::clonetiler_fill_height_changed(GtkAdjustment *adj, Inkscape::UI gdouble const raw_dist = gtk_adjustment_get_value (adj); Inkscape::Util::Unit const unit = u->getUnit(); Inkscape::Util::UnitTable unit_table; - Inkscape::Util::Unit const px = unit_table.getUnit("px"); - gdouble const pixels = Inkscape::Util::Quantity::convert(raw_dist, &unit, &px); + gdouble const pixels = Inkscape::Util::Quantity::convert(raw_dist, unit, "px"); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); prefs->setDouble(prefs_path + "fillheight", pixels); @@ -2980,10 +2976,9 @@ void CloneTiler::clonetiler_unit_changed() Inkscape::Util::Unit unit = unit_menu->getUnit(); Inkscape::Util::UnitTable unit_table; - Inkscape::Util::Unit px = unit_table.getUnit("px"); - gdouble width_value = Inkscape::Util::Quantity::convert(width_pixels, &px, &unit); - gdouble height_value = Inkscape::Util::Quantity::convert(height_pixels, &px, &unit); + gdouble width_value = Inkscape::Util::Quantity::convert(width_pixels, "px", unit); + gdouble height_value = Inkscape::Util::Quantity::convert(height_pixels, "px", unit); gtk_adjustment_set_value(fill_width->gobj(), width_value); gtk_adjustment_set_value(fill_height->gobj(), height_value); } diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index 61fb6e4ee..5cb9357c3 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -1885,9 +1885,8 @@ void Export::setValuePx( Gtk::Adjustment *adj, double val) { const Unit unit = unit_selector->getUnit(); Inkscape::Util::UnitTable unit_table; - Inkscape::Util::Unit px = unit_table.getUnit("px"); - setValue(adj, Inkscape::Util::Quantity::convert(val, &px, &unit)); + setValue(adj, Inkscape::Util::Quantity::convert(val, "px", unit)); return; } @@ -1937,9 +1936,8 @@ float Export::getValuePx( Gtk::Adjustment *adj ) float value = getValue( adj); const Unit unit = unit_selector->getUnit(); Inkscape::Util::UnitTable unit_table; - Inkscape::Util::Unit px = unit_table.getUnit("px"); - return Inkscape::Util::Quantity::convert(value, &unit, &px); + return Inkscape::Util::Quantity::convert(value, unit, "px"); } // end of sp_export_value_get_px() /** diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp index 73b75090b..f6392cfd8 100644 --- a/src/ui/widget/page-sizer.cpp +++ b/src/ui/widget/page-sizer.cpp @@ -228,10 +228,6 @@ static PaperSizeRec const inkscape_papers[] = { //# P A G E S I Z E R //######################################################################## -//The default unit for this widget and its calculations -static Inkscape::Util::Unit _px_unit = unit_table.getUnit("px"); - - /** * Constructor */ @@ -481,8 +477,8 @@ PageSizer::setDim (double w, double h, bool changeList) if (SP_ACTIVE_DESKTOP && !_widgetRegistry->isUpdating()) { SPDocument *doc = sp_desktop_document(SP_ACTIVE_DESKTOP); double const old_height = doc->getHeight(); - doc->setWidth (Inkscape::Util::Quantity(w, &_px_unit)); - doc->setHeight (Inkscape::Util::Quantity(h, &_px_unit)); + doc->setWidth (Inkscape::Util::Quantity(w, "px")); + doc->setHeight (Inkscape::Util::Quantity(h, "px")); // The origin for the user is in the lower left corner; this point should remain stationary when // changing the page size. The SVG's origin however is in the upper left corner, so we must compensate for this Geom::Translate const vert_offset(Geom::Point(0, (old_height - h))); @@ -567,8 +563,8 @@ PageSizer::find_paper_size (double w, double h) const iter != _paperSizeTable.end() ; ++iter) { PaperSize paper = iter->second; Inkscape::Util::Unit const &i_unit = paper.unit; - double smallX = Inkscape::Util::Quantity::convert(paper.smaller, &i_unit, &_px_unit); - double largeX = Inkscape::Util::Quantity::convert(paper.larger, &i_unit, &_px_unit); + double smallX = Inkscape::Util::Quantity::convert(paper.smaller, i_unit, "px"); + double largeX = Inkscape::Util::Quantity::convert(paper.larger, i_unit, "px"); g_return_val_if_fail(smallX <= largeX, _paperSizeListStore->children().end()); @@ -659,9 +655,8 @@ PageSizer::on_paper_size_list_changed() _landscape = _landscapeButton.get_active(); } - Inkscape::Util::Unit const &src_unit = paper.unit; - w = Inkscape::Util::Quantity::convert(w, &src_unit, &_px_unit); - h = Inkscape::Util::Quantity::convert(h, &src_unit, &_px_unit); + w = Inkscape::Util::Quantity::convert(w, paper.unit, "px"); + h = Inkscape::Util::Quantity::convert(h, paper.unit, "px"); if (_landscape) setDim (h, w, false); diff --git a/src/ui/widget/unit-tracker.cpp b/src/ui/widget/unit-tracker.cpp index df78e21dd..372419c3b 100644 --- a/src/ui/widget/unit-tracker.cpp +++ b/src/ui/widget/unit-tracker.cpp @@ -224,7 +224,6 @@ void UnitTracker::_setActive(gint active) void UnitTracker::_fixupAdjustments(Inkscape::Util::Unit const oldUnit, Inkscape::Util::Unit const newUnit) { _isUpdating = true; - Inkscape::Util::Unit px = _unit_table.getUnit("px"); for ( GSList *cur = _adjList ; cur ; cur = g_slist_next(cur) ) { GtkAdjustment *adj = GTK_ADJUSTMENT(cur->data); gdouble oldVal = gtk_adjustment_get_value(adj); @@ -234,15 +233,15 @@ void UnitTracker::_fixupAdjustments(Inkscape::Util::Unit const oldUnit, Inkscape && (newUnit.type == Inkscape::Util::UNIT_TYPE_DIMENSIONLESS) ) { val = newUnit.factor; - _priorValues[adj] = Inkscape::Util::Quantity::convert(oldVal, &oldUnit, &px); + _priorValues[adj] = Inkscape::Util::Quantity::convert(oldVal, oldUnit, "px"); } else if ( (oldUnit.type == Inkscape::Util::UNIT_TYPE_DIMENSIONLESS) && (newUnit.type != Inkscape::Util::UNIT_TYPE_DIMENSIONLESS) ) { if (_priorValues.find(adj) != _priorValues.end()) { - val = Inkscape::Util::Quantity::convert(_priorValues[adj], &newUnit, &px); + val = Inkscape::Util::Quantity::convert(_priorValues[adj], newUnit, "px"); } } else { - val = Inkscape::Util::Quantity::convert(oldVal, &oldUnit, &newUnit); + val = Inkscape::Util::Quantity::convert(oldVal, oldUnit, newUnit); } gtk_adjustment_set_value(adj, val); diff --git a/src/util/units.cpp b/src/util/units.cpp index ffbd74fdd..78531bfaf 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -115,7 +115,8 @@ void Unit::clear() *this = Unit(); } -int Unit::defaultDigits() const { +int Unit::defaultDigits() const +{ int factor_digits = int(log10(factor)); if (factor_digits < 0) { g_warning("factor = %f, factor_digits = %d", factor, factor_digits); @@ -126,14 +127,15 @@ int Unit::defaultDigits() const { } /** Checks if a unit is compatible with the specified unit. */ -bool Unit::compatibleWith(const Unit *u) const { +bool Unit::compatibleWith(const Unit &u) const +{ // Percentages - if (type == UNIT_TYPE_DIMENSIONLESS || u->type == UNIT_TYPE_DIMENSIONLESS) { + if (type == UNIT_TYPE_DIMENSIONLESS || u.type == UNIT_TYPE_DIMENSIONLESS) { return true; } // Other units with same type - if (type == u->type) { + if (type == u.type) { return true; } @@ -143,22 +145,24 @@ bool Unit::compatibleWith(const Unit *u) const { bool Unit::compatibleWith(const Glib::ustring u) const { static UnitTable unit_table; - Unit compatible_unit = unit_table.getUnit(u); - return compatibleWith(&compatible_unit); + return compatibleWith(unit_table.getUnit(u)); } /** Check if units are equal. */ -bool operator== (const Unit &u1, const Unit &u2) { +bool operator== (const Unit &u1, const Unit &u2) +{ return (u1.type == u2.type && u1.name.compare(u2.name) == 0); } /** Check if units are not equal. */ -bool operator!= (const Unit &u1, const Unit &u2) { +bool operator!= (const Unit &u1, const Unit &u2) +{ return !(u1 == u2); } /** Temporary - get SVG unit. */ -int Unit::svgUnit() const { +int Unit::svgUnit() const +{ if (!abbr.compare("px")) return 1; if (!abbr.compare("pt")) @@ -183,7 +187,8 @@ int Unit::svgUnit() const { } /** Temporary - get metric. */ -int Unit::metric() const { +int Unit::metric() const +{ if (!abbr.compare("mm")) return 1; if (!abbr.compare("cm")) @@ -212,21 +217,24 @@ UnitTable::UnitTable() g_free(filename); } -UnitTable::~UnitTable() { +UnitTable::~UnitTable() +{ for (UnitMap::iterator iter = _unit_map.begin(); iter != _unit_map.end(); ++iter) { delete (*iter).second; } } -void UnitTable::addUnit(Unit const &u, bool primary) { +void UnitTable::addUnit(Unit const &u, bool primary) +{ _unit_map[u.abbr] = new Unit(u); if (primary) { _primary_unit[u.type] = u.abbr; } } -Unit UnitTable::getUnit(Glib::ustring const &unit_abbr) const { +Unit UnitTable::getUnit(Glib::ustring const &unit_abbr) const +{ UnitMap::const_iterator iter = _unit_map.find(unit_abbr); if (iter != _unit_map.end()) { return *((*iter).second); @@ -235,7 +243,8 @@ Unit UnitTable::getUnit(Glib::ustring const &unit_abbr) const { } } -Quantity UnitTable::getQuantity(Glib::ustring const& q) const { +Quantity UnitTable::getQuantity(Glib::ustring const& q) const +{ Glib::MatchInfo match_info; // Extract value @@ -251,12 +260,12 @@ Quantity UnitTable::getQuantity(Glib::ustring const& q) const { if (unit_regex->match(q, match_info)) { abbr = match_info.fetch(0); } - Unit *u = new Inkscape::Util::Unit(getUnit(abbr)); - return Quantity(value, u); + return Quantity(value, abbr); } -bool UnitTable::deleteUnit(Unit const &u) { +bool UnitTable::deleteUnit(Unit const &u) +{ bool deleted = false; // Cannot delete the primary unit type since it's // used for conversions @@ -365,7 +374,8 @@ bool UnitTable::loadText(Glib::ustring const &filename) return true; } -bool UnitTable::load(Glib::ustring const &filename) { +bool UnitTable::load(Glib::ustring const &filename) +{ UnitsSAXHandler handler(this); int result = handler.parseFile( filename.c_str() ); @@ -378,8 +388,8 @@ bool UnitTable::load(Glib::ustring const &filename) { return true; } -bool UnitTable::save(Glib::ustring const &filename) { - +bool UnitTable::save(Glib::ustring const &filename) +{ // open file for writing FILE *f = fopen(filename.c_str(), "w"); if (f == NULL) { @@ -457,65 +467,65 @@ void UnitsSAXHandler::_endElement(xmlChar const *xname) } /** Initialize a quantity. */ -Quantity::Quantity(double q, const Unit *u) { - unit = u; +Quantity::Quantity(double q, const Unit &u) +{ + unit = new Unit(u); quantity = q; } -Quantity::Quantity(double q, const Glib::ustring u) { +Quantity::Quantity(double q, const Glib::ustring u) +{ UnitTable unit_table; unit = new Unit(unit_table.getUnit(u)); quantity = q; } /** Checks if a quantity is compatible with the specified unit. */ -bool Quantity::compatibleWith(const Unit *u) const { +bool Quantity::compatibleWith(const Unit &u) const +{ return unit->compatibleWith(u); } bool Quantity::compatibleWith(const Glib::ustring u) const { static UnitTable unit_table; - Unit other_unit = unit_table.getUnit(u); - return compatibleWith(&other_unit); + return compatibleWith(unit_table.getUnit(u)); } /** Return the quantity's value in the specified unit. */ -double Quantity::value(const Unit *u) const { - return convert(quantity, unit, u); +double Quantity::value(const Unit &u) const +{ + return convert(quantity, *unit, u); } -double Quantity::value(const Glib::ustring u) const { +double Quantity::value(const Glib::ustring u) const +{ static UnitTable unit_table; - Unit to_unit = unit_table.getUnit(u); - return value(&to_unit); + return value(unit_table.getUnit(u)); } /** Convert distances. */ -double Quantity::convert(const double from_dist, const Unit *from, const Unit *to) { +double Quantity::convert(const double from_dist, const Unit &from, const Unit &to) +{ // Incompatible units - if (from->type != to->type) { + if (from.type != to.type) { return -1; } // Compatible units - return from_dist * from->factor / to->factor; + return from_dist * from.factor / to.factor; } double Quantity::convert(const double from_dist, const Glib::ustring from, const Unit &to) { static UnitTable unit_table; - Unit from_unit = unit_table.getUnit(from); - return convert(from_dist, &from_unit, &to); + return convert(from_dist, unit_table.getUnit(from), to); } double Quantity::convert(const double from_dist, const Unit &from, const Glib::ustring to) { static UnitTable unit_table; - Unit to_unit = unit_table.getUnit(to); - return convert(from_dist, &from, &to_unit); + return convert(from_dist, from, unit_table.getUnit(to)); } double Quantity::convert(const double from_dist, const Glib::ustring from, const Glib::ustring to) { static UnitTable unit_table; - Unit from_unit = unit_table.getUnit(from); - Unit to_unit = unit_table.getUnit(to); - return convert(from_dist, &from_unit, &to_unit); + return convert(from_dist, unit_table.getUnit(from), unit_table.getUnit(to)); } } // namespace Util diff --git a/src/util/units.h b/src/util/units.h index ec9435647..392e51e7a 100644 --- a/src/util/units.h +++ b/src/util/units.h @@ -65,7 +65,7 @@ class Unit { */ int defaultDigits() const; - bool compatibleWith(const Unit *u) const; + bool compatibleWith(const Unit &u) const; bool compatibleWith(const Glib::ustring) const; UnitType type; @@ -88,14 +88,14 @@ public: const Unit *unit; double quantity; - Quantity(double q, const Unit *u); // constructor + Quantity(double q, const Unit &u); // constructor Quantity(double q, const Glib::ustring u); // constructor - bool compatibleWith(const Unit *u) const; + bool compatibleWith(const Unit &u) const; bool compatibleWith(const Glib::ustring u) const; - double value(const Unit *u) const; + double value(const Unit &u) const; double value(const Glib::ustring u) const; - static double convert(const double from_dist, const Unit *from, const Unit *to); + static double convert(const double from_dist, const Unit &from, const Unit &to); static double convert(const double from_dist, const Glib::ustring from, const Unit &to); static double convert(const double from_dist, const Unit &from, const Glib::ustring to); static double convert(const double from_dist, const Glib::ustring from, const Glib::ustring to); @@ -114,16 +114,16 @@ class UnitTable { typedef std::map UnitMap; /** Add a new unit to the table */ - void addUnit(Unit const& u, bool primary); + void addUnit(Unit const &u, bool primary); /** Retrieve a given unit based on its string identifier */ - Unit getUnit(Glib::ustring const& name) const; + Unit getUnit(Glib::ustring const &name) const; /** Retrieve a quantity based on its string identifier */ - Quantity getQuantity(Glib::ustring const& q) const; + Quantity getQuantity(Glib::ustring const &q) const; /** Remove a unit definition from the given unit type table */ - bool deleteUnit(Unit const& u); + bool deleteUnit(Unit const &u); /** Returns true if the given string 'name' is a valid unit in the table */ bool hasUnit(Glib::ustring const &name) const; @@ -159,8 +159,8 @@ class UnitTable { double _linear_scale; private: - UnitTable(UnitTable const& t); - UnitTable operator=(UnitTable const& t); + UnitTable(UnitTable const &t); + UnitTable operator=(UnitTable const &t); }; diff --git a/src/widgets/node-toolbar.cpp b/src/widgets/node-toolbar.cpp index 50880f481..d60b58886 100644 --- a/src/widgets/node-toolbar.cpp +++ b/src/widgets/node-toolbar.cpp @@ -250,16 +250,15 @@ static void sp_node_toolbox_coord_changed(gpointer /*shape_editor*/, GObject *tb gtk_action_set_sensitive(xact, TRUE); gtk_action_set_sensitive(yact, TRUE); Inkscape::Util::UnitTable unit_table; - Unit px = unit_table.getUnit("px"); - Geom::Coord oldx = Quantity::convert(gtk_adjustment_get_value(xadj), &unit, &px); - Geom::Coord oldy = Quantity::convert(gtk_adjustment_get_value(yadj), &unit, &px); + Geom::Coord oldx = Quantity::convert(gtk_adjustment_get_value(xadj), unit, "px"); + Geom::Coord oldy = Quantity::convert(gtk_adjustment_get_value(yadj), unit, "px"); Geom::Point mid = nt->_selected_nodes->pointwiseBounds()->midpoint(); if (oldx != mid[Geom::X]) { - gtk_adjustment_set_value(xadj, Quantity::convert(mid[Geom::X], &px, &unit)); + gtk_adjustment_set_value(xadj, Quantity::convert(mid[Geom::X], "px", unit)); } if (oldy != mid[Geom::Y]) { - gtk_adjustment_set_value(yadj, Quantity::convert(mid[Geom::Y], &px, &unit)); + gtk_adjustment_set_value(yadj, Quantity::convert(mid[Geom::Y], "px", unit)); } } @@ -278,11 +277,10 @@ static void sp_node_path_value_changed(GtkAdjustment *adj, GObject *tbl, Geom::D Unit const unit = tracker->getActiveUnit(); Inkscape::Util::UnitTable unit_table; - Unit px = unit_table.getUnit("px"); if (DocumentUndo::getUndoSensitive(sp_desktop_document(desktop))) { prefs->setDouble(Glib::ustring("/tools/nodes/") + (d == Geom::X ? "x" : "y"), - Quantity::convert(gtk_adjustment_get_value(adj), &unit, &px)); + Quantity::convert(gtk_adjustment_get_value(adj), unit, "px")); } // quit if run by the attr_changed listener @@ -295,7 +293,7 @@ static void sp_node_path_value_changed(GtkAdjustment *adj, GObject *tbl, Geom::D InkNodeTool *nt = get_node_tool(); if (nt && !nt->_selected_nodes->empty()) { - double val = Quantity::convert(gtk_adjustment_get_value(adj), &unit, &px); + double val = Quantity::convert(gtk_adjustment_get_value(adj), unit, "px"); double oldval = nt->_selected_nodes->pointwiseBounds()->midpoint()[d]; Geom::Point delta(0,0); delta[d] = val - oldval; diff --git a/src/widgets/rect-toolbar.cpp b/src/widgets/rect-toolbar.cpp index 359bc48e0..d91b08273 100644 --- a/src/widgets/rect-toolbar.cpp +++ b/src/widgets/rect-toolbar.cpp @@ -95,12 +95,11 @@ static void sp_rtb_value_changed(GtkAdjustment *adj, GObject *tbl, gchar const * UnitTracker* tracker = reinterpret_cast(g_object_get_data( tbl, "tracker" )); Unit const unit = tracker->getActiveUnit(); Inkscape::Util::UnitTable unit_table; - Unit const px = unit_table.getUnit("px"); if (DocumentUndo::getUndoSensitive(sp_desktop_document(desktop))) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); prefs->setDouble(Glib::ustring("/tools/shapes/rect/") + value_name, - Quantity::convert(gtk_adjustment_get_value(adj), &unit, &px)); + Quantity::convert(gtk_adjustment_get_value(adj), unit, "px")); } // quit if run by the attr_changed listener @@ -117,7 +116,7 @@ static void sp_rtb_value_changed(GtkAdjustment *adj, GObject *tbl, gchar const * if (SP_IS_RECT(items->data)) { if (gtk_adjustment_get_value(adj) != 0) { setter(SP_RECT(items->data), - Quantity::convert(gtk_adjustment_get_value(adj), &unit, &px)); + Quantity::convert(gtk_adjustment_get_value(adj), unit, "px")); } else { SP_OBJECT(items->data)->getRepr()->setAttribute(value_name, NULL); } @@ -190,32 +189,31 @@ static void rect_tb_event_attr_changed(Inkscape::XML::Node * /*repr*/, gchar con UnitTracker* tracker = reinterpret_cast( g_object_get_data( tbl, "tracker" ) ); Unit const unit = tracker->getActiveUnit(); Inkscape::Util::UnitTable unit_table; - Unit const px = unit_table.getUnit("px"); gpointer item = g_object_get_data( tbl, "item" ); if (item && SP_IS_RECT(item)) { { GtkAdjustment *adj = GTK_ADJUSTMENT( g_object_get_data( tbl, "rx" ) ); gdouble rx = sp_rect_get_visible_rx(SP_RECT(item)); - gtk_adjustment_set_value(adj, Quantity::convert(rx, &px, &unit)); + gtk_adjustment_set_value(adj, Quantity::convert(rx, "px", unit)); } { GtkAdjustment *adj = GTK_ADJUSTMENT( g_object_get_data( tbl, "ry" ) ); gdouble ry = sp_rect_get_visible_ry(SP_RECT(item)); - gtk_adjustment_set_value(adj, Quantity::convert(ry, &px, &unit)); + gtk_adjustment_set_value(adj, Quantity::convert(ry, "px", unit)); } { GtkAdjustment *adj = GTK_ADJUSTMENT( g_object_get_data( tbl, "width" ) ); gdouble width = sp_rect_get_visible_width (SP_RECT(item)); - gtk_adjustment_set_value(adj, Quantity::convert(width, &px, &unit)); + gtk_adjustment_set_value(adj, Quantity::convert(width, "px", unit)); } { GtkAdjustment *adj = GTK_ADJUSTMENT( g_object_get_data( tbl, "height" ) ); gdouble height = sp_rect_get_visible_height (SP_RECT(item)); - gtk_adjustment_set_value(adj, Quantity::convert(height, &px, &unit)); + gtk_adjustment_set_value(adj, Quantity::convert(height, "px", unit)); } } diff --git a/src/widgets/select-toolbar.cpp b/src/widgets/select-toolbar.cpp index ffab3deab..617757845 100644 --- a/src/widgets/select-toolbar.cpp +++ b/src/widgets/select-toolbar.cpp @@ -97,10 +97,9 @@ sp_selection_layout_widget_update(SPWidget *spw, Inkscape::Selection *sel) } } else { Inkscape::Util::UnitTable unit_table; - Unit px = unit_table.getUnit("px"); for (unsigned i = 0; i < G_N_ELEMENTS(keyval); ++i) { GtkAdjustment *a = GTK_ADJUSTMENT(g_object_get_data(G_OBJECT(spw), keyval[i].key)); - gtk_adjustment_set_value(a, Quantity::convert(keyval[i].val, &px, &unit)); + gtk_adjustment_set_value(a, Quantity::convert(keyval[i].val, "px", unit)); } } } @@ -194,15 +193,14 @@ sp_object_layout_any_value_changed(GtkAdjustment *adj, SPWidget *spw) GtkAdjustment* a_h = GTK_ADJUSTMENT( g_object_get_data( G_OBJECT(spw), "height" ) ); Inkscape::Util::UnitTable unit_table; - Unit px = unit_table.getUnit("px"); if (unit.type == Inkscape::Util::UNIT_TYPE_LINEAR) { - x0 = Quantity::convert(gtk_adjustment_get_value(a_x), &unit, &px); - y0 = Quantity::convert(gtk_adjustment_get_value(a_y), &unit, &px); - x1 = x0 + Quantity::convert(gtk_adjustment_get_value(a_w), &unit, &px); - xrel = Quantity::convert(gtk_adjustment_get_value(a_w), &unit, &px) / bbox_user->dimensions()[Geom::X]; - y1 = y0 + Quantity::convert(gtk_adjustment_get_value(a_h), &unit, &px);; - yrel = Quantity::convert(gtk_adjustment_get_value(a_h), &unit, &px) / bbox_user->dimensions()[Geom::Y]; + x0 = Quantity::convert(gtk_adjustment_get_value(a_x), unit, "px"); + y0 = Quantity::convert(gtk_adjustment_get_value(a_y), unit, "px"); + x1 = x0 + Quantity::convert(gtk_adjustment_get_value(a_w), unit, "px"); + xrel = Quantity::convert(gtk_adjustment_get_value(a_w), unit, "px") / bbox_user->dimensions()[Geom::X]; + y1 = y0 + Quantity::convert(gtk_adjustment_get_value(a_h), unit, "px");; + yrel = Quantity::convert(gtk_adjustment_get_value(a_h), unit, "px") / bbox_user->dimensions()[Geom::Y]; } else { double const x0_propn = gtk_adjustment_get_value (a_x) * unit.factor; x0 = bbox_user->min()[Geom::X] * x0_propn; @@ -232,10 +230,10 @@ sp_object_layout_any_value_changed(GtkAdjustment *adj, SPWidget *spw) // unless the unit is %, convert the scales and moves to the unit if (unit.type == Inkscape::Util::UNIT_TYPE_LINEAR) { - mh = Quantity::convert(mh, &px, &unit); - sh = Quantity::convert(sh, &px, &unit); - mv = Quantity::convert(mv, &px, &unit); - sv = Quantity::convert(sv, &px, &unit); + mh = Quantity::convert(mh, "px", unit); + sh = Quantity::convert(sh, "px", unit); + mv = Quantity::convert(mv, "px", unit); + sv = Quantity::convert(sv, "px", unit); } // do the action only if one of the scales/moves is greater than half the last significant -- cgit v1.2.3 From 5ce7ccd3fb416c686f570e86295c5f619bd86973 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Fri, 19 Jul 2013 14:02:26 -0400 Subject: Removed "helper/unit-menu.h" from "widgets/rect-toolbar.*" and "widgets/spw-utilities.h". (bzr r12380.1.29) --- src/widgets/rect-toolbar.cpp | 1 - src/widgets/spw-utilities.cpp | 46 ------------------------------------------- src/widgets/spw-utilities.h | 5 ----- 3 files changed, 52 deletions(-) (limited to 'src') diff --git a/src/widgets/rect-toolbar.cpp b/src/widgets/rect-toolbar.cpp index d91b08273..e54a2df07 100644 --- a/src/widgets/rect-toolbar.cpp +++ b/src/widgets/rect-toolbar.cpp @@ -53,7 +53,6 @@ #include "../xml/repr.h" #include "ui/uxmanager.h" #include "../ui/icon-names.h" -#include "../helper/unit-menu.h" #include "util/units.h" #include "ui/widget/unit-tracker.h" #include "../pen-context.h" diff --git a/src/widgets/spw-utilities.cpp b/src/widgets/spw-utilities.cpp index 87ca80f2f..d0a3ed1c5 100644 --- a/src/widgets/spw-utilities.cpp +++ b/src/widgets/spw-utilities.cpp @@ -32,7 +32,6 @@ #include "selection.h" -#include "helper/unit-menu.h" #include "spw-utilities.h" #include @@ -231,51 +230,6 @@ spw_dropdown(GtkWidget * dialog, GtkWidget * table, return selector; } -/** - * Creates a unit selector widget, used for selecting whether one wishes - * to measure screen elements in millimeters, points, etc. This is a - * compound unit that includes a label as well as the dropdown selector. - */ -GtkWidget * -spw_unit_selector(GtkWidget * dialog, GtkWidget * table, - const gchar * label_text, gchar * key, int row, - GtkWidget * us, GCallback cb, bool can_be_negative) -{ - g_assert(dialog != NULL); - g_assert(table != NULL); - g_assert(us != NULL); - - spw_label_old(table, label_text, 0, row); - -#if GTK_CHECK_VERSION(3,0,0) - GtkAdjustment * a = gtk_adjustment_new(0.0, can_be_negative?-1e6:0, 1e6, 1.0, 10.0, 10.0); -#else - GtkObject * a = gtk_adjustment_new(0.0, can_be_negative?-1e6:0, 1e6, 1.0, 10.0, 10.0); -#endif - - g_assert(a != NULL); - g_object_set_data (G_OBJECT (a), "key", key); - g_object_set_data (G_OBJECT (a), "unit_selector", us); - g_object_set_data (G_OBJECT (dialog), key, a); - sp_unit_selector_add_adjustment (SP_UNIT_SELECTOR (us), GTK_ADJUSTMENT (a)); - GtkWidget * sb = gtk_spin_button_new (GTK_ADJUSTMENT (a), 1.0, 4); - g_assert(sb != NULL); - gtk_widget_show (sb); - -#if GTK_CHECK_VERSION(3,0,0) - gtk_widget_set_halign(sb, GTK_ALIGN_FILL); - gtk_widget_set_hexpand(sb, TRUE); - gtk_widget_set_valign(sb, GTK_ALIGN_CENTER); - gtk_grid_attach(GTK_GRID(table), sb, 1, row, 1, 1); -#else - gtk_table_attach (GTK_TABLE (table), sb, 1, 2, row, row+1, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)0, 0, 0); -#endif - - g_signal_connect (G_OBJECT (a), "value_changed", cb, dialog); - return sb; -} - static void sp_set_font_size_recursive (GtkWidget *w, gpointer font) { diff --git a/src/widgets/spw-utilities.h b/src/widgets/spw-utilities.h index fb8c04ebf..d52cbd888 100644 --- a/src/widgets/spw-utilities.h +++ b/src/widgets/spw-utilities.h @@ -56,11 +56,6 @@ spw_dropdown(GtkWidget *dialog, GtkWidget *table, GtkWidget *selector ); -GtkWidget * -spw_unit_selector(GtkWidget *dialog, GtkWidget *table, - gchar const *label, gchar *key, int row, - GtkWidget *us, GCallback cb, bool can_be_negative = false); - void sp_set_font_size (GtkWidget *w, guint font); void sp_set_font_size_smaller (GtkWidget *w); -- cgit v1.2.3 From ef3bfa7e8bb2996c4042314accc34f6a72f072e1 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Fri, 19 Jul 2013 14:19:03 -0400 Subject: Removed "helper/unit-menu.h" from "widgest/toolbar.*" and associated files. (bzr r12380.1.30) --- src/widgets/arc-toolbar.cpp | 4 ++-- src/widgets/box3d-toolbar.cpp | 6 +++--- src/widgets/calligraphy-toolbar.cpp | 16 ++++++++-------- src/widgets/connector-toolbar.cpp | 6 +++--- src/widgets/erasor-toolbar.cpp | 2 +- src/widgets/gradient-toolbar.cpp | 2 +- src/widgets/measure-toolbar.cpp | 2 +- src/widgets/mesh-toolbar.cpp | 4 ++-- src/widgets/node-toolbar.cpp | 4 ++-- src/widgets/paintbucket-toolbar.cpp | 4 ++-- src/widgets/pencil-toolbar.cpp | 2 +- src/widgets/rect-toolbar.cpp | 8 ++++---- src/widgets/spiral-toolbar.cpp | 6 +++--- src/widgets/spray-toolbar.cpp | 12 ++++++------ src/widgets/star-toolbar.cpp | 8 ++++---- src/widgets/text-toolbar.cpp | 6 ------ src/widgets/toolbox.cpp | 5 ----- src/widgets/toolbox.h | 1 - src/widgets/tweak-toolbar.cpp | 6 +++--- 19 files changed, 46 insertions(+), 58 deletions(-) (limited to 'src') diff --git a/src/widgets/arc-toolbar.cpp b/src/widgets/arc-toolbar.cpp index e3f3a8c79..42f696bec 100644 --- a/src/widgets/arc-toolbar.cpp +++ b/src/widgets/arc-toolbar.cpp @@ -337,7 +337,7 @@ void sp_arc_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObjec _("Start"), _("Start:"), _("The angle (in degrees) from the horizontal to the arc's start point"), "/tools/shapes/arc/start", 0.0, - GTK_WIDGET(desktop->canvas), NULL/*us*/, holder, TRUE, "altx-arc", + GTK_WIDGET(desktop->canvas), holder, TRUE, "altx-arc", -360.0, 360.0, 1.0, 10.0, 0, 0, 0, sp_arctb_start_value_changed); @@ -350,7 +350,7 @@ void sp_arc_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObjec _("End"), _("End:"), _("The angle (in degrees) from the horizontal to the arc's end point"), "/tools/shapes/arc/end", 0.0, - GTK_WIDGET(desktop->canvas), NULL/*us*/, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), holder, FALSE, NULL, -360.0, 360.0, 1.0, 10.0, 0, 0, 0, sp_arctb_end_value_changed); diff --git a/src/widgets/box3d-toolbar.cpp b/src/widgets/box3d-toolbar.cpp index 2d40b996b..91d4ebdec 100644 --- a/src/widgets/box3d-toolbar.cpp +++ b/src/widgets/box3d-toolbar.cpp @@ -316,7 +316,7 @@ void box3d_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject // Translators: PL is short for 'perspective line' _("Angle of PLs in X direction"), "/tools/shapes/3dbox/box3d_angle_x", 30, - GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "altx-box3d", + GTK_WIDGET(desktop->canvas), holder, TRUE, "altx-box3d", -360.0, 360.0, 1.0, 10.0, labels, values, G_N_ELEMENTS(labels), box3d_angle_x_value_changed ); @@ -356,7 +356,7 @@ void box3d_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject // Translators: PL is short for 'perspective line' _("Angle of PLs in Y direction"), "/tools/shapes/3dbox/box3d_angle_y", 30, - GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), holder, FALSE, NULL, -360.0, 360.0, 1.0, 10.0, labels, values, G_N_ELEMENTS(labels), box3d_angle_y_value_changed ); @@ -395,7 +395,7 @@ void box3d_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject // Translators: PL is short for 'perspective line' _("Angle of PLs in Z direction"), "/tools/shapes/3dbox/box3d_angle_z", 30, - GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), holder, FALSE, NULL, -360.0, 360.0, 1.0, 10.0, labels, values, G_N_ELEMENTS(labels), box3d_angle_z_value_changed ); diff --git a/src/widgets/calligraphy-toolbar.cpp b/src/widgets/calligraphy-toolbar.cpp index 7c2d6bf19..1f91b9fe2 100644 --- a/src/widgets/calligraphy-toolbar.cpp +++ b/src/widgets/calligraphy-toolbar.cpp @@ -447,7 +447,7 @@ void sp_calligraphy_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions _("Pen Width"), _("Width:"), _("The width of the calligraphic pen (relative to the visible canvas area)"), "/tools/calligraphic/width", 15, - GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "altx-calligraphy", + GTK_WIDGET(desktop->canvas), holder, TRUE, "altx-calligraphy", 1, 100, 1.0, 10.0, labels, values, G_N_ELEMENTS(labels), sp_ddc_width_value_changed, 1, 0 ); @@ -464,7 +464,7 @@ void sp_calligraphy_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions _("Stroke Thinning"), _("Thinning:"), _("How much velocity thins the stroke (> 0 makes fast strokes thinner, < 0 makes them broader, 0 makes width independent of velocity)"), "/tools/calligraphic/thinning", 10, - GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), holder, FALSE, NULL, -100, 100, 1, 10.0, labels, values, G_N_ELEMENTS(labels), sp_ddc_velthin_value_changed, 1, 0); @@ -480,7 +480,7 @@ void sp_calligraphy_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions _("Pen Angle"), _("Angle:"), _("The angle of the pen's nib (in degrees; 0 = horizontal; has no effect if fixation = 0)"), "/tools/calligraphic/angle", 30, - GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "calligraphy-angle", + GTK_WIDGET(desktop->canvas), holder, TRUE, "calligraphy-angle", -90.0, 90.0, 1.0, 10.0, labels, values, G_N_ELEMENTS(labels), sp_ddc_angle_value_changed, 1, 0 ); @@ -498,7 +498,7 @@ void sp_calligraphy_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions _("Fixation"), _("Fixation:"), _("Angle behavior (0 = nib always perpendicular to stroke direction, 100 = fixed angle)"), "/tools/calligraphic/flatness", 90, - GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), holder, FALSE, NULL, 0.0, 100, 1.0, 10.0, labels, values, G_N_ELEMENTS(labels), sp_ddc_flatness_value_changed, 1, 0); @@ -515,7 +515,7 @@ void sp_calligraphy_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions _("Cap rounding"), _("Caps:"), _("Increase to make caps at the ends of strokes protrude more (0 = no caps, 1 = round caps)"), "/tools/calligraphic/cap_rounding", 0.0, - GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), holder, FALSE, NULL, 0.0, 5.0, 0.01, 0.1, labels, values, G_N_ELEMENTS(labels), sp_ddc_cap_rounding_value_changed, 0.01, 2 ); @@ -531,7 +531,7 @@ void sp_calligraphy_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions _("Stroke Tremor"), _("Tremor:"), _("Increase to make strokes rugged and trembling"), "/tools/calligraphic/tremor", 0.0, - GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), holder, FALSE, NULL, 0.0, 100, 1, 10.0, labels, values, G_N_ELEMENTS(labels), sp_ddc_tremor_value_changed, 1, 0); @@ -549,7 +549,7 @@ void sp_calligraphy_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions _("Pen Wiggle"), _("Wiggle:"), _("Increase to make the pen waver and wiggle"), "/tools/calligraphic/wiggle", 0.0, - GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), holder, FALSE, NULL, 0.0, 100, 1, 10.0, labels, values, G_N_ELEMENTS(labels), sp_ddc_wiggle_value_changed, 1, 0); @@ -566,7 +566,7 @@ void sp_calligraphy_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions _("Pen Mass"), _("Mass:"), _("Increase to make the pen drag behind, as if slowed by inertia"), "/tools/calligraphic/mass", 2.0, - GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), holder, FALSE, NULL, 0.0, 100, 1, 10.0, labels, values, G_N_ELEMENTS(labels), sp_ddc_mass_value_changed, 1, 0); diff --git a/src/widgets/connector-toolbar.cpp b/src/widgets/connector-toolbar.cpp index 293f1184d..54344e446 100644 --- a/src/widgets/connector-toolbar.cpp +++ b/src/widgets/connector-toolbar.cpp @@ -361,7 +361,7 @@ void sp_connector_toolbox_prep( SPDesktop *desktop, GtkActionGroup* mainActions, _("Connector Curvature"), _("Curvature:"), _("The amount of connectors curvature"), "/tools/connector/curvature", defaultConnCurvature, - GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "inkscape:connector-curvature", + GTK_WIDGET(desktop->canvas), holder, TRUE, "inkscape:connector-curvature", 0, 100, 1.0, 10.0, 0, 0, 0, connector_curvature_changed, 1, 0 ); @@ -372,7 +372,7 @@ void sp_connector_toolbox_prep( SPDesktop *desktop, GtkActionGroup* mainActions, _("Connector Spacing"), _("Spacing:"), _("The amount of space left around objects by auto-routing connectors"), "/tools/connector/spacing", defaultConnSpacing, - GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "inkscape:connector-spacing", + GTK_WIDGET(desktop->canvas), holder, TRUE, "inkscape:connector-spacing", 0, 100, 1.0, 10.0, 0, 0, 0, connector_spacing_changed, 1, 0 ); @@ -394,7 +394,7 @@ void sp_connector_toolbox_prep( SPDesktop *desktop, GtkActionGroup* mainActions, _("Connector Length"), _("Length:"), _("Ideal length for connectors when layout is applied"), "/tools/connector/length", 100, - GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "inkscape:connector-length", + GTK_WIDGET(desktop->canvas), holder, TRUE, "inkscape:connector-length", 10, 1000, 10.0, 100.0, 0, 0, 0, connector_length_changed, 1, 0 ); diff --git a/src/widgets/erasor-toolbar.cpp b/src/widgets/erasor-toolbar.cpp index 44c79d5f3..8ad376edb 100644 --- a/src/widgets/erasor-toolbar.cpp +++ b/src/widgets/erasor-toolbar.cpp @@ -145,7 +145,7 @@ void sp_eraser_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GOb _("Pen Width"), _("Width:"), _("The width of the eraser pen (relative to the visible canvas area)"), "/tools/eraser/width", 15, - GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "altx-eraser", + GTK_WIDGET(desktop->canvas), holder, TRUE, "altx-eraser", 1, 100, 1.0, 10.0, labels, values, G_N_ELEMENTS(labels), sp_erc_width_value_changed, 1, 0); diff --git a/src/widgets/gradient-toolbar.cpp b/src/widgets/gradient-toolbar.cpp index ea125a380..c1eb13ceb 100644 --- a/src/widgets/gradient-toolbar.cpp +++ b/src/widgets/gradient-toolbar.cpp @@ -1171,7 +1171,7 @@ void sp_gradient_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, eact = create_adjustment_action( "GradientEditOffsetAction", _("Offset"), _("Offset:"), _("Offset of selected stop"), "/tools/gradient/stopoffset", 0, - GTK_WIDGET(desktop->canvas), NULL/*us*/, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), holder, FALSE, NULL, 0.0, 1.0, 0.01, 0.1, 0, 0, 0, gr_stop_offset_adjustment_changed diff --git a/src/widgets/measure-toolbar.cpp b/src/widgets/measure-toolbar.cpp index c72cb8fa3..d51a81457 100644 --- a/src/widgets/measure-toolbar.cpp +++ b/src/widgets/measure-toolbar.cpp @@ -106,7 +106,7 @@ void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, G _("Font Size"), _("Font Size:"), _("The font size to be used in the measurement labels"), "/tools/measure/fontsize", 0.0, - GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), holder, FALSE, NULL, 10, 36, 1.0, 4.0, 0, 0, 0, sp_measure_fontsize_value_changed); diff --git a/src/widgets/mesh-toolbar.cpp b/src/widgets/mesh-toolbar.cpp index 99a34fbda..37763ab34 100644 --- a/src/widgets/mesh-toolbar.cpp +++ b/src/widgets/mesh-toolbar.cpp @@ -262,7 +262,7 @@ void sp_mesh_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, GObj eact = create_adjustment_action( "MeshRowAction", _("Rows"), _("Rows:"), _("Number of rows in new mesh"), "/tools/mesh/mesh_rows", 1, - GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), holder, FALSE, NULL, 1, 20, 1, 1, labels, values, G_N_ELEMENTS(labels), ms_row_changed, @@ -278,7 +278,7 @@ void sp_mesh_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, GObj eact = create_adjustment_action( "MeshColumnAction", _("Columns"), _("Columns:"), _("Number of columns in new mesh"), "/tools/mesh/mesh_cols", 1, - GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), holder, FALSE, NULL, 1, 20, 1, 1, labels, values, G_N_ELEMENTS(labels), ms_col_changed, diff --git a/src/widgets/node-toolbar.cpp b/src/widgets/node-toolbar.cpp index d60b58886..65e42a60b 100644 --- a/src/widgets/node-toolbar.cpp +++ b/src/widgets/node-toolbar.cpp @@ -594,7 +594,7 @@ void sp_node_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje eact = create_adjustment_action( "NodeXAction", _("X coordinate:"), _("X:"), _("X coordinate of selected node(s)"), "/tools/nodes/Xcoord", 0, - GTK_WIDGET(desktop->canvas), NULL/*us*/, holder, TRUE, "altx-nodes", + GTK_WIDGET(desktop->canvas), holder, TRUE, "altx-nodes", -1e6, 1e6, SPIN_STEP, SPIN_PAGE_STEP, labels, values, G_N_ELEMENTS(labels), sp_node_path_x_value_changed ); @@ -612,7 +612,7 @@ void sp_node_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje eact = create_adjustment_action( "NodeYAction", _("Y coordinate:"), _("Y:"), _("Y coordinate of selected node(s)"), "/tools/nodes/Ycoord", 0, - GTK_WIDGET(desktop->canvas), NULL/*us*/, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), holder, FALSE, NULL, -1e6, 1e6, SPIN_STEP, SPIN_PAGE_STEP, labels, values, G_N_ELEMENTS(labels), sp_node_path_y_value_changed ); diff --git a/src/widgets/paintbucket-toolbar.cpp b/src/widgets/paintbucket-toolbar.cpp index 2c782da70..3bb1fa24a 100644 --- a/src/widgets/paintbucket-toolbar.cpp +++ b/src/widgets/paintbucket-toolbar.cpp @@ -164,7 +164,7 @@ void sp_paintbucket_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions "ThresholdAction", _("Fill Threshold"), _("Threshold:"), _("The maximum allowed difference between the clicked pixel and the neighboring pixels to be counted in the fill"), - "/tools/paintbucket/threshold", 5, GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, + "/tools/paintbucket/threshold", 5, GTK_WIDGET(desktop->canvas), holder, TRUE, "inkscape:paintbucket-threshold", 0, 100.0, 1.0, 10.0, 0, 0, 0, paintbucket_threshold_changed, 1, 0 ); @@ -193,7 +193,7 @@ void sp_paintbucket_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions "OffsetAction", _("Grow/shrink by"), _("Grow/shrink by:"), _("The amount to grow (positive) or shrink (negative) the created fill path"), - "/tools/paintbucket/offset", 0, GTK_WIDGET(desktop->canvas), NULL/*us*/, holder, TRUE, + "/tools/paintbucket/offset", 0, GTK_WIDGET(desktop->canvas), holder, TRUE, "inkscape:paintbucket-offset", -1e4, 1e4, 0.1, 0.5, 0, 0, 0, paintbucket_offset_changed, 1, 2); diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp index e38b54b5d..851ad7134 100644 --- a/src/widgets/pencil-toolbar.cpp +++ b/src/widgets/pencil-toolbar.cpp @@ -302,7 +302,7 @@ void sp_pencil_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GOb _("How much smoothing (simplifying) is applied to the line"), "/tools/freehand/pencil/tolerance", 3.0, - GTK_WIDGET(desktop->canvas), NULL, + GTK_WIDGET(desktop->canvas), holder, TRUE, "altx-pencil", 1, 100.0, 0.5, 1.0, labels, values, G_N_ELEMENTS(labels), diff --git a/src/widgets/rect-toolbar.cpp b/src/widgets/rect-toolbar.cpp index e54a2df07..29488031f 100644 --- a/src/widgets/rect-toolbar.cpp +++ b/src/widgets/rect-toolbar.cpp @@ -317,7 +317,7 @@ void sp_rect_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje eact = create_adjustment_action( "RectWidthAction", _("Width"), _("W:"), _("Width of rectangle"), "/tools/shapes/rect/width", 0, - GTK_WIDGET(desktop->canvas), NULL/*us*/, holder, TRUE, "altx-rect", + GTK_WIDGET(desktop->canvas), holder, TRUE, "altx-rect", 0, 1e6, SPIN_STEP, SPIN_PAGE_STEP, labels, values, G_N_ELEMENTS(labels), sp_rtb_width_value_changed ); @@ -334,7 +334,7 @@ void sp_rect_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje eact = create_adjustment_action( "RectHeightAction", _("Height"), _("H:"), _("Height of rectangle"), "/tools/shapes/rect/height", 0, - GTK_WIDGET(desktop->canvas), NULL/*us*/, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), holder, FALSE, NULL, 0, 1e6, SPIN_STEP, SPIN_PAGE_STEP, labels, values, G_N_ELEMENTS(labels), sp_rtb_height_value_changed ); @@ -351,7 +351,7 @@ void sp_rect_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje eact = create_adjustment_action( "RadiusXAction", _("Horizontal radius"), _("Rx:"), _("Horizontal radius of rounded corners"), "/tools/shapes/rect/rx", 0, - GTK_WIDGET(desktop->canvas), NULL/*us*/, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), holder, FALSE, NULL, 0, 1e6, SPIN_STEP, SPIN_PAGE_STEP, labels, values, G_N_ELEMENTS(labels), sp_rtb_rx_value_changed); @@ -366,7 +366,7 @@ void sp_rect_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje eact = create_adjustment_action( "RadiusYAction", _("Vertical radius"), _("Ry:"), _("Vertical radius of rounded corners"), "/tools/shapes/rect/ry", 0, - GTK_WIDGET(desktop->canvas), NULL/*us*/, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), holder, FALSE, NULL, 0, 1e6, SPIN_STEP, SPIN_PAGE_STEP, labels, values, G_N_ELEMENTS(labels), sp_rtb_ry_value_changed); diff --git a/src/widgets/spiral-toolbar.cpp b/src/widgets/spiral-toolbar.cpp index 48b509acc..cccaf5154 100644 --- a/src/widgets/spiral-toolbar.cpp +++ b/src/widgets/spiral-toolbar.cpp @@ -259,7 +259,7 @@ void sp_spiral_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GOb eact = create_adjustment_action( "SpiralRevolutionAction", _("Number of turns"), _("Turns:"), _("Number of revolutions"), "/tools/shapes/spiral/revolution", 3.0, - GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "altx-spiral", + GTK_WIDGET(desktop->canvas), holder, TRUE, "altx-spiral", 0.01, 1024.0, 0.1, 1.0, labels, values, G_N_ELEMENTS(labels), sp_spl_tb_revolution_value_changed, 1, 2); @@ -273,7 +273,7 @@ void sp_spiral_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GOb eact = create_adjustment_action( "SpiralExpansionAction", _("Divergence"), _("Divergence:"), _("How much denser/sparser are outer revolutions; 1 = uniform"), "/tools/shapes/spiral/expansion", 1.0, - GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), holder, FALSE, NULL, 0.0, 1000.0, 0.01, 1.0, labels, values, G_N_ELEMENTS(labels), sp_spl_tb_expansion_value_changed); @@ -287,7 +287,7 @@ void sp_spiral_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GOb eact = create_adjustment_action( "SpiralT0Action", _("Inner radius"), _("Inner radius:"), _("Radius of the innermost revolution (relative to the spiral size)"), "/tools/shapes/spiral/t0", 0.0, - GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), holder, FALSE, NULL, 0.0, 0.999, 0.01, 1.0, labels, values, G_N_ELEMENTS(labels), sp_spl_tb_t0_value_changed); diff --git a/src/widgets/spray-toolbar.cpp b/src/widgets/spray-toolbar.cpp index bdc700aa8..fe221f695 100644 --- a/src/widgets/spray-toolbar.cpp +++ b/src/widgets/spray-toolbar.cpp @@ -127,7 +127,7 @@ void sp_spray_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObj EgeAdjustmentAction *eact = create_adjustment_action( "SprayWidthAction", _("Width"), _("Width:"), _("The width of the spray area (relative to the visible canvas area)"), "/tools/spray/width", 15, - GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "altx-spray", + GTK_WIDGET(desktop->canvas), holder, TRUE, "altx-spray", 1, 100, 1.0, 10.0, labels, values, G_N_ELEMENTS(labels), sp_spray_width_value_changed, 1, 0 ); @@ -143,7 +143,7 @@ void sp_spray_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObj EgeAdjustmentAction *eact = create_adjustment_action( "SprayMeanAction", _("Focus"), _("Focus:"), _("0 to spray a spot; increase to enlarge the ring radius"), "/tools/spray/mean", 0, - GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "spray-mean", + GTK_WIDGET(desktop->canvas), holder, TRUE, "spray-mean", 0, 100, 1.0, 10.0, labels, values, G_N_ELEMENTS(labels), sp_spray_mean_value_changed, 1, 0 ); @@ -159,7 +159,7 @@ void sp_spray_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObj EgeAdjustmentAction *eact = create_adjustment_action( "SprayStandard_deviationAction", C_("Spray tool", "Scatter"), C_("Spray tool", "Scatter:"), _("Increase to scatter sprayed objects"), "/tools/spray/standard_deviation", 70, - GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "spray-standard_deviation", + GTK_WIDGET(desktop->canvas), holder, TRUE, "spray-standard_deviation", 1, 100, 1.0, 10.0, labels, values, G_N_ELEMENTS(labels), sp_spray_standard_deviation_value_changed, 1, 0 ); @@ -220,7 +220,7 @@ void sp_spray_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObj _("Amount"), _("Amount:"), _("Adjusts the number of items sprayed per click"), "/tools/spray/population", 70, - GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "spray-population", + GTK_WIDGET(desktop->canvas), holder, TRUE, "spray-population", 1, 100, 1.0, 10.0, labels, values, G_N_ELEMENTS(labels), sp_spray_population_value_changed, 1, 0 ); @@ -251,7 +251,7 @@ void sp_spray_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObj // xgettext:no-c-format _("Variation of the rotation of the sprayed objects; 0% for the same rotation than the original object"), "/tools/spray/rotation_variation", 0, - GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "spray-rotation", + GTK_WIDGET(desktop->canvas), holder, TRUE, "spray-rotation", 0, 100, 1.0, 10.0, labels, values, G_N_ELEMENTS(labels), sp_spray_rotation_value_changed, 1, 0 ); @@ -269,7 +269,7 @@ void sp_spray_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObj // xgettext:no-c-format _("Variation in the scale of the sprayed objects; 0% for the same scale than the original object"), "/tools/spray/scale_variation", 0, - GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "spray-scale", + GTK_WIDGET(desktop->canvas), holder, TRUE, "spray-scale", 0, 100, 1.0, 10.0, labels, values, G_N_ELEMENTS(labels), sp_spray_scale_value_changed, 1, 0 ); diff --git a/src/widgets/star-toolbar.cpp b/src/widgets/star-toolbar.cpp index 545256061..9f7dd95e0 100644 --- a/src/widgets/star-toolbar.cpp +++ b/src/widgets/star-toolbar.cpp @@ -501,7 +501,7 @@ void sp_star_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje eact = create_adjustment_action( "MagnitudeAction", _("Corners"), _("Corners:"), _("Number of corners of a polygon or star"), "/tools/shapes/star/magnitude", 3, - GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), holder, FALSE, NULL, 3, 1024, 1, 5, labels, values, G_N_ELEMENTS(labels), sp_stb_magnitude_value_changed, @@ -520,7 +520,7 @@ void sp_star_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje // Base radius is the same for the closest handle. _("Base radius to tip radius ratio"), "/tools/shapes/star/proportion", 0.5, - GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), holder, FALSE, NULL, 0.01, 1.0, 0.01, 0.1, labels, values, G_N_ELEMENTS(labels), sp_stb_proportion_value_changed ); @@ -541,7 +541,7 @@ void sp_star_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje eact = create_adjustment_action( "RoundednessAction", _("Rounded"), _("Rounded:"), _("How much rounded are the corners (0 for sharp)"), "/tools/shapes/star/rounded", 0.0, - GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), holder, FALSE, NULL, -10.0, 10.0, 0.01, 0.1, labels, values, G_N_ELEMENTS(labels), sp_stb_rounded_value_changed ); @@ -556,7 +556,7 @@ void sp_star_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje eact = create_adjustment_action( "RandomizationAction", _("Randomized"), _("Randomized:"), _("Scatter randomly the corners and angles"), "/tools/shapes/star/randomized", 0.0, - GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), holder, FALSE, NULL, -10.0, 10.0, 0.001, 0.01, labels, values, G_N_ELEMENTS(labels), sp_stb_randomized_value_changed, 0.1, 3 ); diff --git a/src/widgets/text-toolbar.cpp b/src/widgets/text-toolbar.cpp index 4dd44bb8d..a7bd25b2c 100644 --- a/src/widgets/text-toolbar.cpp +++ b/src/widgets/text-toolbar.cpp @@ -1459,7 +1459,6 @@ void sp_text_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje "/tools/text/lineheight", /* preferences path */ 0.0, /* default */ GTK_WIDGET(desktop->canvas), /* focusTarget */ - NULL, /* unit selector */ holder, /* dataKludge */ FALSE, /* set alt-x keyboard shortcut? */ NULL, /* altx_mark */ @@ -1490,7 +1489,6 @@ void sp_text_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje "/tools/text/wordspacing", /* preferences path */ 0.0, /* default */ GTK_WIDGET(desktop->canvas), /* focusTarget */ - NULL, /* unit selector */ holder, /* dataKludge */ FALSE, /* set alt-x keyboard shortcut? */ NULL, /* altx_mark */ @@ -1521,7 +1519,6 @@ void sp_text_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje "/tools/text/letterspacing", /* preferences path */ 0.0, /* default */ GTK_WIDGET(desktop->canvas), /* focusTarget */ - NULL, /* unit selector */ holder, /* dataKludge */ FALSE, /* set alt-x keyboard shortcut? */ NULL, /* altx_mark */ @@ -1552,7 +1549,6 @@ void sp_text_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje "/tools/text/dx", /* preferences path */ 0.0, /* default */ GTK_WIDGET(desktop->canvas), /* focusTarget */ - NULL, /* unit selector */ holder, /* dataKludge */ FALSE, /* set alt-x keyboard shortcut? */ NULL, /* altx_mark */ @@ -1583,7 +1579,6 @@ void sp_text_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje "/tools/text/dy", /* preferences path */ 0.0, /* default */ GTK_WIDGET(desktop->canvas), /* focusTarget */ - NULL, /* unit selector */ holder, /* dataKludge */ FALSE, /* set alt-x keyboard shortcut? */ NULL, /* altx_mark */ @@ -1614,7 +1609,6 @@ void sp_text_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje "/tools/text/rotation", /* preferences path */ 0.0, /* default */ GTK_WIDGET(desktop->canvas), /* focusTarget */ - NULL, /* unit selector */ holder, /* dataKludge */ FALSE, /* set alt-x keyboard shortcut? */ NULL, /* altx_mark */ diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 687f62420..dcd4360fd 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -49,7 +49,6 @@ #include "../graphlayout.h" #include "../helper/action.h" #include "../helper/action-context.h" -#include "../helper/unit-menu.h" #include "icon.h" #include "../ink-action.h" #include "../ink-comboboxentry-action.h" @@ -1028,7 +1027,6 @@ EgeAdjustmentAction * create_adjustment_action( gchar const *name, gchar const *label, gchar const *shortLabel, gchar const *tooltip, Glib::ustring const &path, gdouble def, GtkWidget *focusTarget, - GtkWidget *us, GObject *dataKludge, gboolean altx, gchar const *altx_mark, gdouble lower, gdouble upper, gdouble step, gdouble page, @@ -1045,9 +1043,6 @@ EgeAdjustmentAction * create_adjustment_action( gchar const *name, Inkscape::Preferences *prefs = Inkscape::Preferences::get(); GtkAdjustment* adj = GTK_ADJUSTMENT( gtk_adjustment_new( prefs->getDouble(path, def) * factor, lower, upper, step, page, 0 ) ); - if (us) { - sp_unit_selector_add_adjustment( SP_UNIT_SELECTOR(us), adj ); - } g_signal_connect( G_OBJECT(adj), "value-changed", G_CALLBACK(callback), dataKludge ); diff --git a/src/widgets/toolbox.h b/src/widgets/toolbox.h index 9c839a8fe..197f0fb5e 100644 --- a/src/widgets/toolbox.h +++ b/src/widgets/toolbox.h @@ -118,7 +118,6 @@ void delete_connection(GObject * /*obj*/, sigc::connection *connection); gchar const *label, gchar const *shortLabel, gchar const *tooltip, Glib::ustring const &path, gdouble def, GtkWidget *focusTarget, - GtkWidget *us, GObject *dataKludge, gboolean altx, gchar const *altx_mark, gdouble lower, gdouble upper, gdouble step, gdouble page, diff --git a/src/widgets/tweak-toolbar.cpp b/src/widgets/tweak-toolbar.cpp index e96418957..d5fe67ef7 100644 --- a/src/widgets/tweak-toolbar.cpp +++ b/src/widgets/tweak-toolbar.cpp @@ -141,7 +141,7 @@ void sp_tweak_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObj EgeAdjustmentAction *eact = create_adjustment_action( "TweakWidthAction", _("Width"), _("Width:"), _("The width of the tweak area (relative to the visible canvas area)"), "/tools/tweak/width", 15, - GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "altx-tweak", + GTK_WIDGET(desktop->canvas), holder, TRUE, "altx-tweak", 1, 100, 1.0, 10.0, labels, values, G_N_ELEMENTS(labels), sp_tweak_width_value_changed, 0.01, 0, 100 ); @@ -158,7 +158,7 @@ void sp_tweak_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObj EgeAdjustmentAction *eact = create_adjustment_action( "TweakForceAction", _("Force"), _("Force:"), _("The force of the tweak action"), "/tools/tweak/force", 20, - GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "tweak-force", + GTK_WIDGET(desktop->canvas), holder, TRUE, "tweak-force", 1, 100, 1.0, 10.0, labels, values, G_N_ELEMENTS(labels), sp_tweak_force_value_changed, 0.01, 0, 100 ); @@ -367,7 +367,7 @@ void sp_tweak_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObj _("Fidelity"), _("Fidelity:"), _("Low fidelity simplifies paths; high fidelity preserves path features but may generate a lot of new nodes"), "/tools/tweak/fidelity", 50, - GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "tweak-fidelity", + GTK_WIDGET(desktop->canvas), holder, TRUE, "tweak-fidelity", 1, 100, 1.0, 10.0, labels, values, G_N_ELEMENTS(labels), sp_tweak_fidelity_value_changed, 0.01, 0, 100 ); -- cgit v1.2.3 From 912d3580e5931b73b79fef0c060906676259d9f0 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Fri, 19 Jul 2013 14:20:56 -0400 Subject: Removed "helper/unit-menu.h" and "helper/units.h" from "desktop-events.cpp". (bzr r12380.1.31) --- src/desktop-events.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/desktop-events.cpp b/src/desktop-events.cpp index 217187553..473ccfa9f 100644 --- a/src/desktop-events.cpp +++ b/src/desktop-events.cpp @@ -34,8 +34,6 @@ #include "document-undo.h" #include "event-context.h" #include "helper/action.h" -#include "helper/unit-menu.h" -#include "helper/units.h" #include "message-context.h" #include "preferences.h" #include "snap.h" -- cgit v1.2.3 From 180129cb81a37d222ab8fb3bd0446d043324ba2e Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Fri, 19 Jul 2013 14:22:11 -0400 Subject: Removed "helper/unit-menu.h" and "helper/units.h" from "flood-context.h". (bzr r12380.1.32) --- src/flood-context.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/flood-context.h b/src/flood-context.h index 3e81cd01e..810a3b48f 100644 --- a/src/flood-context.h +++ b/src/flood-context.h @@ -15,8 +15,6 @@ #include #include #include "event-context.h" -#include "helper/unit-menu.h" -#include "helper/units.h" #define SP_TYPE_FLOOD_CONTEXT (sp_flood_context_get_type ()) #define SP_FLOOD_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_FLOOD_CONTEXT, SPFloodContext)) -- cgit v1.2.3 From 231a793d4d28f83b55fe9104a6593d72bca75219 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Fri, 19 Jul 2013 14:32:09 -0400 Subject: Removed "helper/units.h" from "ui/dialog/document-properties.cpp". (bzr r12380.1.33) --- src/ui/dialog/document-properties.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index af462a1df..77fb182e5 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -28,7 +28,6 @@ #include "document.h" #include "desktop-handles.h" #include "desktop.h" -#include "helper/units.h" #include "inkscape.h" #include "io/sys.h" #include "preferences.h" @@ -1431,8 +1430,8 @@ void DocumentProperties::update() _rcp_bord.setRgba32 (nv->bordercolor); _rcb_shad.setActive (nv->showpageshadow); - //if (nv->doc_units) - // _rum_deflt.setUnit (nv->doc_units); + if (nv->doc_units) + _rum_deflt.setUnit (nv->doc_units->abbr); double const doc_w_px = sp_desktop_document(dt)->getWidth(); double const doc_h_px = sp_desktop_document(dt)->getHeight(); -- cgit v1.2.3 From 0fb0f1dd09f4c03a420dd8abf2089b81cd6d30d7 Mon Sep 17 00:00:00 2001 From: Slagvi Public Date: Fri, 19 Jul 2013 20:35:26 +0200 Subject: New From Template ui rearrangement (bzr r12379.2.11) --- src/ui/dialog/Makefile_insert | 4 +- src/ui/dialog/new-from-template.cpp | 10 +-- src/ui/dialog/new-from-template.h | 6 +- src/ui/dialog/static-template-load-tab.cpp | 80 --------------------- src/ui/dialog/static-template-load-tab.h | 44 ------------ src/ui/dialog/template-load-tab.cpp | 48 +++++-------- src/ui/dialog/template-load-tab.h | 20 +++--- src/ui/dialog/template-widget.cpp | 110 +++++++++++++++++++++++++++++ src/ui/dialog/template-widget.h | 48 +++++++++++++ 9 files changed, 193 insertions(+), 177 deletions(-) delete mode 100644 src/ui/dialog/static-template-load-tab.cpp delete mode 100644 src/ui/dialog/static-template-load-tab.h create mode 100644 src/ui/dialog/template-widget.cpp create mode 100644 src/ui/dialog/template-widget.h (limited to 'src') diff --git a/src/ui/dialog/Makefile_insert b/src/ui/dialog/Makefile_insert index 4a34cc71c..41e3ecbf8 100644 --- a/src/ui/dialog/Makefile_insert +++ b/src/ui/dialog/Makefile_insert @@ -87,8 +87,6 @@ ink_common_sources += \ ui/dialog/scriptdialog.h \ ui/dialog/spellcheck.cpp \ ui/dialog/spellcheck.h \ - ui/dialog/static-template-load-tab.cpp \ - ui/dialog/static-template-load-tab.h \ ui/dialog/svg-fonts-dialog.cpp \ ui/dialog/svg-fonts-dialog.h \ ui/dialog/swatches.cpp \ @@ -97,6 +95,8 @@ ink_common_sources += \ ui/dialog/symbols.h \ ui/dialog/template-load-tab.cpp \ ui/dialog/template-load-tab.h \ + ui/dialog/template-widget.cpp \ + ui/dialog/template-widget.h \ ui/dialog/text-edit.cpp \ ui/dialog/text-edit.h \ ui/dialog/tile.cpp \ diff --git a/src/ui/dialog/new-from-template.cpp b/src/ui/dialog/new-from-template.cpp index 765ec0bce..241da3f43 100644 --- a/src/ui/dialog/new-from-template.cpp +++ b/src/ui/dialog/new-from-template.cpp @@ -27,9 +27,7 @@ NewFromTemplate::NewFromTemplate() resize(400, 400); get_vbox()->pack_start(_main_widget); - _main_widget.append_page(_tab1, "Static Templates"); - _main_widget.append_page(_tab2, "Procedural Templates"); - + Gtk::Alignment *align; align = manage(new Gtk::Alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER, 0.0, 0.0)); get_vbox()->pack_end(*align, Gtk::PACK_SHRINK, 5); @@ -44,11 +42,7 @@ NewFromTemplate::NewFromTemplate() void NewFromTemplate::_createFromTemplate() { - if ( _main_widget.get_current_page() == 0 ) { - _tab1.createTemplate(); - } else { - _tab2.createTemplate(); - } + _main_widget.createTemplate(); response(0); } diff --git a/src/ui/dialog/new-from-template.h b/src/ui/dialog/new-from-template.h index 59b61a015..05af98a50 100644 --- a/src/ui/dialog/new-from-template.h +++ b/src/ui/dialog/new-from-template.h @@ -16,7 +16,6 @@ #include #include "template-load-tab.h" -#include "static-template-load-tab.h" namespace Inkscape { @@ -30,10 +29,9 @@ public: private: NewFromTemplate(); - Gtk::Notebook _main_widget; Gtk::Button _create_template_button; - StaticTemplateLoadTab _tab1; - TemplateLoadTab _tab2; + //StaticTemplateLoadTab _tab1; + TemplateLoadTab _main_widget; void _createFromTemplate(); }; diff --git a/src/ui/dialog/static-template-load-tab.cpp b/src/ui/dialog/static-template-load-tab.cpp deleted file mode 100644 index 35f3430fb..000000000 --- a/src/ui/dialog/static-template-load-tab.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/** @file - * @brief New From Template static templates tab - implementation - */ -/* Authors: - * Jan Darowski , supervised by Krzysztof KosiĹ„ski - * - * Copyright (C) 2013 Authors - * Released under GNU GPL, read the file 'COPYING' for more information - */ - -#include "static-template-load-tab.h" - -#include -#include -#include -#include - -#include "file.h" - - -namespace Inkscape { -namespace UI { - - -StaticTemplateLoadTab::StaticTemplateLoadTab() - : TemplateLoadTab() - , _more_info_button("More info") - , _short_description_label("Short description - I like trains. ad asda asd asdweqe gdfg") - , _template_author_label("by template_author") - , _template_name_label("Template_name") - , _preview_image("preview.png") -{ - _loading_path = ""; - _loadTemplates(); - _initLists(); - - _info_box.pack_start(_template_name_label, Gtk::PACK_SHRINK, 4); - _info_box.pack_start(_template_author_label, Gtk::PACK_SHRINK, 0); - _info_box.pack_start(_preview_image, Gtk::PACK_SHRINK, 15); - _info_box.pack_start(_short_description_label, Gtk::PACK_SHRINK, 4); - - _short_description_label.set_line_wrap(true); - _short_description_label.set_size_request(200); - - Gtk::Alignment *align; - align = manage(new Gtk::Alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER, 0.0, 0.0)); - _info_box.pack_start(*align, Gtk::PACK_SHRINK, 5); - align->add(_more_info_button); - - _more_info_button.signal_pressed().connect( - sigc::mem_fun(*this, &StaticTemplateLoadTab::_displayTemplateDetails)); -} - - -void StaticTemplateLoadTab::createTemplate() -{ - Glib::ustring path; - if (_tdata.find(_current_template) != _tdata.end()){ - path = _tdata[_current_template].path; - } - else - path = ""; - - sp_file_new(path); -} - - -void StaticTemplateLoadTab::_displayTemplateInfo() -{ - TemplateLoadTab::_displayTemplateInfo(); - _template_name_label.set_text(_current_template); - _template_author_label.set_text(_tdata[_current_template].author); - _short_description_label.set_text(_tdata[_current_template].short_description); - - Glib::ustring imagePath = Glib::build_filename(Glib::path_get_dirname(_tdata[_current_template].path), _tdata[_current_template].preview_name); - _preview_image.set(imagePath); -} - -} -} diff --git a/src/ui/dialog/static-template-load-tab.h b/src/ui/dialog/static-template-load-tab.h deleted file mode 100644 index 9b19c495a..000000000 --- a/src/ui/dialog/static-template-load-tab.h +++ /dev/null @@ -1,44 +0,0 @@ -/** @file - * @brief New From Template static templates tab - */ -/* Authors: - * Jan Darowski , supervised by Krzysztof KosiĹ„ski - * - * Copyright (C) 2013 Authors - * Released under GNU GPL, read the file 'COPYING' for more information - */ - -#ifndef INKSCAPE_SEEN_UI_DIALOG_STATIC_TEMPLATE_LOAD_TAB_H -#define INKSCAPE_SEEN_UI_DIALOG_STATIC_TEMPLATE_LOAD_TAB_H - -#include "template-load-tab.h" - -#include -#include -#include - - -namespace Inkscape { -namespace UI { - - -class StaticTemplateLoadTab : public TemplateLoadTab -{ -public: - StaticTemplateLoadTab(); - virtual void createTemplate(); - -protected: - virtual void _displayTemplateInfo(); - - Gtk::Button _more_info_button; - Gtk::Label _short_description_label; - Gtk::Label _template_author_label; - Gtk::Label _template_name_label; - Gtk::Image _preview_image; -}; - -} -} - -#endif diff --git a/src/ui/dialog/template-load-tab.cpp b/src/ui/dialog/template-load-tab.cpp index 90980dc39..70dadfc52 100644 --- a/src/ui/dialog/template-load-tab.cpp +++ b/src/ui/dialog/template-load-tab.cpp @@ -23,6 +23,8 @@ #include "xml/document.h" #include "xml/node.h" +#include "template-widget.h" + // #include @@ -39,10 +41,11 @@ namespace UI { TemplateLoadTab::TemplateLoadTab() : _current_keyword("") , _keywords_combo(true) - ,_current_search_type(ALL) + , _current_search_type(ALL) { set_border_width(10); + _info_widget = manage(new TemplateWidget()); Gtk::Label *title; title = manage(new Gtk::Label("Search:")); _tlist_box.pack_start(*title, Gtk::PACK_SHRINK, 10); @@ -53,11 +56,11 @@ TemplateLoadTab::TemplateLoadTab() _tlist_box.pack_start(*title, Gtk::PACK_SHRINK, 10); title = manage(new Gtk::Label("Selected template")); - _info_box.pack_start(*title, Gtk::PACK_SHRINK, 10); + _info_widget->pack_start(*title, Gtk::PACK_SHRINK, 10); add(_main_box); _main_box.pack_start(_tlist_box, Gtk::PACK_SHRINK, 20); - _main_box.pack_start(_info_box, Gtk::PACK_EXPAND_WIDGET, 10); + _main_box.pack_start(*_info_widget, Gtk::PACK_EXPAND_WIDGET, 10); Gtk::ScrolledWindow *scrolled; scrolled = manage(new Gtk::ScrolledWindow()); @@ -68,6 +71,11 @@ TemplateLoadTab::TemplateLoadTab() _keywords_combo.signal_changed().connect( sigc::mem_fun(*this, &TemplateLoadTab::_keywordSelected)); this->show_all(); + + + _loading_path = ""; + _loadTemplates(); + _initLists(); } @@ -78,7 +86,7 @@ TemplateLoadTab::~TemplateLoadTab() void TemplateLoadTab::createTemplate() { - std::cout << "Default Template Tab" << std::endl; + _info_widget->create(); } @@ -87,7 +95,10 @@ void TemplateLoadTab::_displayTemplateInfo() Glib::RefPtr templateSelectionRef = _tlist_view.get_selection(); if (templateSelectionRef->get_selected()) { _current_template = (*templateSelectionRef->get_selected())[_columns.textValue]; + + _info_widget->display(_tdata[_current_template]); } + } @@ -194,7 +205,8 @@ TemplateLoadTab::TemplateData TemplateLoadTab::_processTemplateFile(const Glib:: { TemplateData result; result.path = path; - result.display_name = Glib::path_get_basename(path);/* + result.display_name = Glib::path_get_basename(path); + result.is_procedural = false;/* result.short_description = "LaLaLaLa"; result.author = "JAASDASD";*/ @@ -264,31 +276,5 @@ void TemplateLoadTab::_getTemplatesFromDir(const Glib::ustring &path) } } -void TemplateLoadTab::_displayTemplateDetails() -{ - if (_current_template == "") - return; - - TemplateData &tmpl = _tdata[_current_template]; - - Glib::ustring message = tmpl.display_name + "\n\n" + - _("Path: ") + tmpl.path + "\n\n"; - - if (tmpl.long_description != "") - message += _("Description: ") + _tdata[_current_template].long_description + "\n\n"; - if (tmpl.keywords.size() > 0){ - message += _("Keywords: "); - for (std::set::iterator it = tmpl.keywords.begin(); it != tmpl.keywords.end(); ++it) - message += *it + " "; - message += "\n\n"; - } - - if (tmpl.author != "") - message += _("By: ") + _tdata[_current_template].author + " " + tmpl.creation_date + "\n\n"; - - Gtk::MessageDialog dl(message, false, Gtk::MESSAGE_OTHER); - dl.run(); -} - } } diff --git a/src/ui/dialog/template-load-tab.h b/src/ui/dialog/template-load-tab.h index 8290f1b3f..48ad23ae9 100644 --- a/src/ui/dialog/template-load-tab.h +++ b/src/ui/dialog/template-load-tab.h @@ -22,19 +22,16 @@ namespace Inkscape { namespace UI { - + +class TemplateWidget; class TemplateLoadTab : public Gtk::Frame { public: - TemplateLoadTab(); - virtual ~TemplateLoadTab(); - virtual void createTemplate(); - -protected: struct TemplateData { + bool is_procedural; Glib::ustring path; Glib::ustring display_name; Glib::ustring author; @@ -45,6 +42,12 @@ protected: std::set keywords; }; + TemplateLoadTab(); + virtual ~TemplateLoadTab(); + virtual void createTemplate(); + +protected: + class StringModelColumns : public Gtk::TreeModelColumnRecord { public: @@ -68,11 +71,10 @@ protected: virtual void _refreshTemplatesList(); void _loadTemplates(); void _initLists(); - void _displayTemplateDetails(); Gtk::HBox _main_box; Gtk::VBox _tlist_box; - Gtk::VBox _info_box; + TemplateWidget *_info_widget; Gtk::ComboBoxText _keywords_combo; @@ -80,6 +82,8 @@ protected: Glib::RefPtr _tlist_store; StringModelColumns _columns; + + private: enum SearchType { diff --git a/src/ui/dialog/template-widget.cpp b/src/ui/dialog/template-widget.cpp new file mode 100644 index 000000000..dd066c90b --- /dev/null +++ b/src/ui/dialog/template-widget.cpp @@ -0,0 +1,110 @@ + + +/** @file + * @brief New From Template - templates widget - implementation + */ +/* Authors: + * Jan Darowski , supervised by Krzysztof KosiĹ„ski + * + * Copyright (C) 2013 Authors + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#include "template-widget.h" +#include "template-load-tab.h" + +#include +#include +#include +#include +#include + +#include "file.h" + +#include +#include +#include + + +namespace Inkscape { +namespace UI { + + +TemplateWidget::TemplateWidget() + : _more_info_button("More info") + , _short_description_label("Short description - I like trains. ad asda asd asdweqe gdfg") + , _template_author_label("by template_author") + , _template_name_label("Template_name") + , _preview_image("preview.png") +{ + pack_start(_template_name_label, Gtk::PACK_SHRINK, 4); + pack_start(_template_author_label, Gtk::PACK_SHRINK, 0); + pack_start(_preview_image, Gtk::PACK_SHRINK, 15); + pack_start(_short_description_label, Gtk::PACK_SHRINK, 4); + + _short_description_label.set_line_wrap(true); + _short_description_label.set_size_request(200); + + Gtk::Alignment *align; + align = manage(new Gtk::Alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER, 0.0, 0.0)); + pack_start(*align, Gtk::PACK_SHRINK, 5); + align->add(_more_info_button); + + _more_info_button.signal_pressed().connect( + sigc::mem_fun(*this, &TemplateWidget::_displayTemplateDetails)); +} + + +void TemplateWidget::create() +{ + if (_current_template.path == "") + return; + if (_current_template.is_procedural){ + + } + else { + sp_file_new(_current_template.path); + } +} + + +void TemplateWidget::display(TemplateLoadTab::TemplateData data) +{ + _current_template = data; + if (data.is_procedural){} + else{ + _template_name_label.set_text(_current_template.display_name); + _template_author_label.set_text(_current_template.author); + _short_description_label.set_text(_current_template.short_description); + + Glib::ustring imagePath = Glib::build_filename(Glib::path_get_dirname(_current_template.path), _current_template.preview_name); + _preview_image.set(imagePath); + } +} + +void TemplateWidget::_displayTemplateDetails() +{ + if (_current_template.path == "") + return; + + Glib::ustring message = _current_template.display_name + "\n\n" + + _("Path: ") + _current_template.path + "\n\n"; + + if (_current_template.long_description != "") + message += _("Description: ") + _current_template.long_description + "\n\n"; + if (_current_template.keywords.size() > 0){ + message += _("Keywords: "); + for (std::set::iterator it = _current_template.keywords.begin(); it != _current_template.keywords.end(); ++it) + message += *it + " "; + message += "\n\n"; + } + + if (_current_template.author != "") + message += _("By: ") + _current_template.author + " " + _current_template.creation_date + "\n\n"; + + Gtk::MessageDialog dl(message, false, Gtk::MESSAGE_OTHER); + dl.run(); +} + +} +} diff --git a/src/ui/dialog/template-widget.h b/src/ui/dialog/template-widget.h new file mode 100644 index 000000000..83024e0d8 --- /dev/null +++ b/src/ui/dialog/template-widget.h @@ -0,0 +1,48 @@ +/** @file + * @brief New From Template - template widget + */ +/* Authors: + * Jan Darowski , supervised by Krzysztof KosiĹ„ski + * + * Copyright (C) 2013 Authors + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#ifndef INKSCAPE_SEEN_UI_DIALOG_TEMPLATE_WIDGET_H +#define INKSCAPE_SEEN_UI_DIALOG_TEMPLATE_WIDGET_H + +#include "template-load-tab.h" +#include + + + +namespace Inkscape { +namespace UI { + +class TemplateLoadTab; + + +class TemplateWidget : public Gtk::VBox +{ +public: + TemplateWidget (); + void create(); + void display(TemplateLoadTab::TemplateData); + +private: + TemplateLoadTab::TemplateData _current_template; + + Gtk::Button _more_info_button; + Gtk::Label _short_description_label; + Gtk::Label _template_author_label; + Gtk::Label _template_name_label; + Gtk::Image _preview_image; + + void _displayTemplateDetails(); + +}; + +} +} + +#endif -- cgit v1.2.3 From fb1ac7622934007e4358a5797473f78fc1704ee9 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Fri, 19 Jul 2013 14:42:21 -0400 Subject: Removed "helper/units.h" from "snap-preferences.h". (bzr r12380.1.34) --- src/snap-preferences.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/snap-preferences.h b/src/snap-preferences.h index c2db0b432..a7a2e2926 100644 --- a/src/snap-preferences.h +++ b/src/snap-preferences.h @@ -10,7 +10,6 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include "helper/units.h" #include "snap-enums.h" namespace Inkscape -- cgit v1.2.3 From bd2265c6e8a1496f40692752f9d710f36a24fada Mon Sep 17 00:00:00 2001 From: Slagvi Public Date: Fri, 19 Jul 2013 20:57:07 +0200 Subject: Minor code fixes (bzr r12379.2.12) --- src/ui/dialog/new-from-template.cpp | 9 +++++---- src/ui/dialog/new-from-template.h | 2 -- src/ui/dialog/template-load-tab.cpp | 26 ++++++-------------------- src/ui/dialog/template-load-tab.h | 8 ++------ src/ui/dialog/template-widget.cpp | 23 ++++++++++------------- src/ui/dialog/template-widget.h | 4 ---- 6 files changed, 23 insertions(+), 49 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/new-from-template.cpp b/src/ui/dialog/new-from-template.cpp index 241da3f43..6598aecdf 100644 --- a/src/ui/dialog/new-from-template.cpp +++ b/src/ui/dialog/new-from-template.cpp @@ -10,10 +10,10 @@ #include "new-from-template.h" +#include "file.h" #include - -#include "file.h" +#include namespace Inkscape { @@ -21,9 +21,9 @@ namespace UI { NewFromTemplate::NewFromTemplate() - : _create_template_button("Create from template") + : _create_template_button(_("Create from template")) { - set_title("New From Template"); + set_title(_("New From Template")); resize(400, 400); get_vbox()->pack_start(_main_widget); @@ -47,6 +47,7 @@ void NewFromTemplate::_createFromTemplate() response(0); } + void NewFromTemplate::load_new_from_template() { NewFromTemplate dl; diff --git a/src/ui/dialog/new-from-template.h b/src/ui/dialog/new-from-template.h index 05af98a50..8ebcb2863 100644 --- a/src/ui/dialog/new-from-template.h +++ b/src/ui/dialog/new-from-template.h @@ -13,7 +13,6 @@ #include #include -#include #include "template-load-tab.h" @@ -30,7 +29,6 @@ public: private: NewFromTemplate(); Gtk::Button _create_template_button; - //StaticTemplateLoadTab _tab1; TemplateLoadTab _main_widget; void _createFromTemplate(); diff --git a/src/ui/dialog/template-load-tab.cpp b/src/ui/dialog/template-load-tab.cpp index 70dadfc52..ded4fc6fd 100644 --- a/src/ui/dialog/template-load-tab.cpp +++ b/src/ui/dialog/template-load-tab.cpp @@ -9,9 +9,11 @@ */ #include "template-load-tab.h" +#include "template-widget.h" #include #include +#include #include #include "interface.h" @@ -23,16 +25,6 @@ #include "xml/document.h" #include "xml/node.h" -#include "template-widget.h" - -// -#include - -#include -#include -#include -// - namespace Inkscape { namespace UI { @@ -47,17 +39,14 @@ TemplateLoadTab::TemplateLoadTab() _info_widget = manage(new TemplateWidget()); Gtk::Label *title; - title = manage(new Gtk::Label("Search:")); + title = manage(new Gtk::Label(_("Search:"))); _tlist_box.pack_start(*title, Gtk::PACK_SHRINK, 10); _tlist_box.pack_start(_keywords_combo, Gtk::PACK_SHRINK, 0); - title = manage(new Gtk::Label("Templates")); + title = manage(new Gtk::Label(_("Templates"))); _tlist_box.pack_start(*title, Gtk::PACK_SHRINK, 10); - title = manage(new Gtk::Label("Selected template")); - _info_widget->pack_start(*title, Gtk::PACK_SHRINK, 10); - add(_main_box); _main_box.pack_start(_tlist_box, Gtk::PACK_SHRINK, 20); _main_box.pack_start(*_info_widget, Gtk::PACK_EXPAND_WIDGET, 10); @@ -72,7 +61,6 @@ TemplateLoadTab::TemplateLoadTab() sigc::mem_fun(*this, &TemplateLoadTab::_keywordSelected)); this->show_all(); - _loading_path = ""; _loadTemplates(); _initLists(); @@ -139,7 +127,7 @@ void TemplateLoadTab::_keywordSelected() else _current_search_type = LIST_KEYWORD; - if (_current_keyword == "" || _current_keyword == "All") + if (_current_keyword == "" || _current_keyword == _("All")) _current_search_type = ALL; _refreshTemplatesList(); @@ -206,9 +194,7 @@ TemplateLoadTab::TemplateData TemplateLoadTab::_processTemplateFile(const Glib:: TemplateData result; result.path = path; result.display_name = Glib::path_get_basename(path); - result.is_procedural = false;/* - result.short_description = "LaLaLaLa"; - result.author = "JAASDASD";*/ + result.is_procedural = false; Inkscape::XML::Document *rdoc; rdoc = sp_repr_read_file(path.data(), SP_SVG_NS_URI); diff --git a/src/ui/dialog/template-load-tab.h b/src/ui/dialog/template-load-tab.h index 48ad23ae9..cc5229c95 100644 --- a/src/ui/dialog/template-load-tab.h +++ b/src/ui/dialog/template-load-tab.h @@ -46,8 +46,7 @@ public: virtual ~TemplateLoadTab(); virtual void createTemplate(); -protected: - +protected: class StringModelColumns : public Gtk::TreeModelColumnRecord { public: @@ -80,9 +79,7 @@ protected: Gtk::TreeView _tlist_view; Glib::RefPtr _tlist_store; - StringModelColumns _columns; - - + StringModelColumns _columns; private: enum SearchType @@ -97,7 +94,6 @@ private: void _getTemplatesFromDir(const Glib::ustring &); void _keywordSelected(); TemplateData _processTemplateFile(const Glib::ustring &); - }; } diff --git a/src/ui/dialog/template-widget.cpp b/src/ui/dialog/template-widget.cpp index dd066c90b..bb2c4a683 100644 --- a/src/ui/dialog/template-widget.cpp +++ b/src/ui/dialog/template-widget.cpp @@ -12,18 +12,13 @@ #include "template-widget.h" #include "template-load-tab.h" +#include "file.h" #include #include #include #include -#include - -#include "file.h" - -#include #include -#include namespace Inkscape { @@ -31,12 +26,14 @@ namespace UI { TemplateWidget::TemplateWidget() - : _more_info_button("More info") - , _short_description_label("Short description - I like trains. ad asda asd asdweqe gdfg") - , _template_author_label("by template_author") - , _template_name_label("Template_name") + : _more_info_button(_("More info")) + , _short_description_label(_("Short description")) + , _template_author_label(_("by template_author")) + , _template_name_label(_("Template_name")) , _preview_image("preview.png") { + Gtk::Label *title = manage(new Gtk::Label(_("Selected template"))); + pack_start(*title, Gtk::PACK_SHRINK, 10); pack_start(_template_name_label, Gtk::PACK_SHRINK, 4); pack_start(_template_author_label, Gtk::PACK_SHRINK, 0); pack_start(_preview_image, Gtk::PACK_SHRINK, 15); @@ -59,9 +56,8 @@ void TemplateWidget::create() { if (_current_template.path == "") return; - if (_current_template.is_procedural){ - - } + + if (_current_template.is_procedural) {} else { sp_file_new(_current_template.path); } @@ -82,6 +78,7 @@ void TemplateWidget::display(TemplateLoadTab::TemplateData data) } } + void TemplateWidget::_displayTemplateDetails() { if (_current_template.path == "") diff --git a/src/ui/dialog/template-widget.h b/src/ui/dialog/template-widget.h index 83024e0d8..743fb524d 100644 --- a/src/ui/dialog/template-widget.h +++ b/src/ui/dialog/template-widget.h @@ -15,13 +15,10 @@ #include - namespace Inkscape { namespace UI { -class TemplateLoadTab; - class TemplateWidget : public Gtk::VBox { public: @@ -39,7 +36,6 @@ private: Gtk::Image _preview_image; void _displayTemplateDetails(); - }; } -- cgit v1.2.3 From 6e9cf2ac415ff74108850236175ed7aeef496059 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Fri, 19 Jul 2013 14:59:49 -0400 Subject: Ported "src/lpe-tool-context.*" (bzr r12380.1.35) --- src/lpe-tool-context.cpp | 37 ++++++++++++++++++++++++++++--------- src/lpe-tool-context.h | 1 - 2 files changed, 28 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/lpe-tool-context.cpp b/src/lpe-tool-context.cpp index feabfa02d..bf032b7eb 100644 --- a/src/lpe-tool-context.cpp +++ b/src/lpe-tool-context.cpp @@ -37,7 +37,7 @@ #include "display/canvas-text.h" #include "message-stack.h" #include "sp-path.h" -#include "helper/units.h" +#include "util/units.h" #include "lpe-tool-context.h" @@ -444,6 +444,8 @@ lpetool_create_measuring_items(SPLPEToolContext *lc, Inkscape::Selection *select gchar *arc_length; double lengthval; + Inkscape::Util::UnitTable unit_table; + for (GSList const *i = selection->itemList(); i != NULL; i = i->next) { if (SP_IS_PATH(i->data)) { path = SP_PATH(i->data); @@ -453,13 +455,21 @@ lpetool_create_measuring_items(SPLPEToolContext *lc, Inkscape::Selection *select if (!show) sp_canvas_item_hide(SP_CANVAS_ITEM(canvas_text)); - SPUnitId unitid = static_cast(prefs->getInt("/tools/lpetool/unitid", SP_UNIT_PX)); - SPUnit unit = sp_unit_get_by_id(unitid); + //SPUnitId unitid = static_cast(prefs->getInt("/tools/lpetool/unitid", SP_UNIT_PX)); + //SPUnit unit = sp_unit_get_by_id(unitid); + Inkscape::Util::Unit unit; + if (prefs->getString("/tools/lpetool/unit").compare("")) { + unit = unit_table.getUnit(prefs->getString("/tools/lpetool/unit")); + } else { + unit = unit_table.getUnit("px"); + } lengthval = Geom::length(pwd2); gboolean success; - success = sp_convert_distance(&lengthval, &sp_unit_get_by_id(SP_UNIT_PX), &unit); - arc_length = g_strdup_printf("%.2f %s", lengthval, success ? sp_unit_get_abbreviation(&unit) : "px"); + //success = sp_convert_distance(&lengthval, &sp_unit_get_by_id(SP_UNIT_PX), &unit); + lengthval = Inkscape::Util::Quantity::convert(lengthval, "px", unit); + //arc_length = g_strdup_printf("%.2f %s", lengthval, success ? sp_unit_get_abbreviation(&unit) : "px"); + arc_length = g_strdup_printf("%.2f %s", lengthval, unit.abbr.c_str()); sp_canvastext_set_text (canvas_text, arc_length); set_pos_and_anchor(canvas_text, pwd2, 0.5, 10); // TODO: must we free arc_length? @@ -482,6 +492,7 @@ void lpetool_update_measuring_items(SPLPEToolContext *lc) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + Inkscape::Util::UnitTable unit_table; SPPath *path; SPCurve *curve; double lengthval; @@ -491,12 +502,20 @@ lpetool_update_measuring_items(SPLPEToolContext *lc) path = i->first; curve = SP_SHAPE(path)->getCurve(); Geom::Piecewise > pwd2 = Geom::paths_to_pw(curve->get_pathvector()); - SPUnitId unitid = static_cast(prefs->getInt("/tools/lpetool/unitid", SP_UNIT_PX)); - SPUnit unit = sp_unit_get_by_id(unitid); + //SPUnitId unitid = static_cast(prefs->getInt("/tools/lpetool/unitid", SP_UNIT_PX)); + //SPUnit unit = sp_unit_get_by_id(unitid); + Inkscape::Util::Unit unit; + if (prefs->getString("/tools/lpetool/unit").compare("")) { + unit = unit_table.getUnit(prefs->getString("/tools/lpetool/unit")); + } else { + unit = unit_table.getUnit("px"); + } lengthval = Geom::length(pwd2); gboolean success; - success = sp_convert_distance(&lengthval, &sp_unit_get_by_id(SP_UNIT_PX), &unit); - arc_length = g_strdup_printf("%.2f %s", lengthval, success ? sp_unit_get_abbreviation(&unit) : "px"); + //success = sp_convert_distance(&lengthval, &sp_unit_get_by_id(SP_UNIT_PX), &unit); + lengthval = Inkscape::Util::Quantity::convert(lengthval, "px", unit); + //arc_length = g_strdup_printf("%.2f %s", lengthval, success ? sp_unit_get_abbreviation(&unit) : "px"); + arc_length = g_strdup_printf("%.2f %s", lengthval, unit.abbr.c_str()); sp_canvastext_set_text (SP_CANVASTEXT(i->second), arc_length); set_pos_and_anchor(SP_CANVASTEXT(i->second), pwd2, 0.5, 10); // TODO: must we free arc_length? diff --git a/src/lpe-tool-context.h b/src/lpe-tool-context.h index fb3a5d4e2..7b85b09f2 100644 --- a/src/lpe-tool-context.h +++ b/src/lpe-tool-context.h @@ -16,7 +16,6 @@ */ #include "pen-context.h" -#include "helper/units.h" #define SP_TYPE_LPETOOL_CONTEXT (sp_lpetool_context_get_type()) #define SP_LPETOOL_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_CAST((o), SP_TYPE_LPETOOL_CONTEXT, SPLPEToolContext)) -- cgit v1.2.3 From d955b45ebb37552b33e8d3350be2446bd4692bd9 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Fri, 19 Jul 2013 15:01:55 -0400 Subject: Removed "helper/units.h" from "display/canvas-grid.cpp". (bzr r12380.1.36) --- src/display/canvas-grid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp index e72e01dbc..1a5e0e52d 100644 --- a/src/display/canvas-grid.cpp +++ b/src/display/canvas-grid.cpp @@ -42,7 +42,7 @@ #include "display/canvas-grid.h" #include "display/sp-canvas-group.h" #include "document.h" -#include "helper/units.h" +#include "util/units.h" #include "inkscape.h" #include "preferences.h" #include "sp-namedview.h" -- cgit v1.2.3 From dbc9ab3286ecb7a885ae9bdb524174c661607d6a Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Fri, 19 Jul 2013 15:04:03 -0400 Subject: Removed "helper/units.h" from "selection-chemistry.cpp". (bzr r12380.1.37) --- src/selection-chemistry.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 29cb208d9..dc786f340 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -86,7 +86,6 @@ SPCycleType SP_CYCLING = SP_CYCLE_FOCUS; #include #include #include -#include "helper/units.h" #include "sp-item.h" #include "box3d.h" #include "persp3d.h" -- cgit v1.2.3 From 4d84edcf25468530660a441c55544c7db27c2682 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Fri, 19 Jul 2013 15:08:24 -0400 Subject: Removed "helper/units.h" from "pen-context.cpp". (bzr r12380.1.38) --- src/pen-context.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/pen-context.cpp b/src/pen-context.cpp index 5972a6ca8..eac2ce5d1 100644 --- a/src/pen-context.cpp +++ b/src/pen-context.cpp @@ -39,7 +39,6 @@ #include "display/sp-ctrlline.h" #include "display/sodipodi-ctrl.h" #include -#include "helper/units.h" #include "macros.h" #include "context-fns.h" #include "tools-switch.h" @@ -1188,8 +1187,12 @@ static void spdc_pen_set_angle_distance_status_message(SPPenContext *const pc, G GString *dist = SP_PX_TO_METRIC_STRING(Geom::L2(rel), desktop->namedview->getDefaultMetric()); double angle = atan2(rel[Geom::Y], rel[Geom::X]) * 180 / M_PI; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - if (prefs->getBool("/options/compassangledisplay/value", 0) != 0) - angle = angle_to_compass (angle); + if (prefs->getBool("/options/compassangledisplay/value", 0) != 0) { + angle = 90 - angle; + if (angle < 0) { + angle += 360; + } + } pc->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE, message, angle, dist->str); g_string_free(dist, FALSE); -- cgit v1.2.3 From 4f6415189dc97ccb8b8dfaa5ad515b56dd72de0f Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Fri, 19 Jul 2013 15:48:48 -0400 Subject: Ported "ui/widget/selected-style.*". (bzr r12380.1.39) --- src/desktop.cpp | 1 - src/ui/widget/selected-style.cpp | 29 ++++++++++++++++------------- src/ui/widget/selected-style.h | 11 +++++++---- src/widgets/desktop-widget.cpp | 5 +++-- 4 files changed, 26 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/desktop.cpp b/src/desktop.cpp index ce740f76f..13e339abe 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -54,7 +54,6 @@ #include "document.h" #include "event-log.h" #include "helper/action-context.h" -#include "helper/units.h" #include "interface.h" #include "inkscape-private.h" #include "layer-fns.h" diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index 102132158..edf53d25c 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -50,6 +50,7 @@ #include "pixmaps/cursor-adj-a.xpm" #include "sp-cursor.h" #include "gradient-chemistry.h" +#include "util/units.h" static gdouble const _sw_presets[] = { 32 , 16 , 10 , 8 , 6 , 4 , 3 , 2 , 1.5 , 1 , 0.75 , 0.5 , 0.25 , 0.1 }; static gchar const *const _sw_presets_str[] = {"32", "16", "10", "8", "6", "4", "3", "2", "1.5", "1", "0.75", "0.5", "0.25", "0.1"}; @@ -306,15 +307,18 @@ SelectedStyle::SelectedStyle(bool /*layout*/) { int row = 0; - // List of units should match with Fill/Stroke dialog stroke style width list - for (GSList *l = sp_unit_get_list(SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE); l != NULL; l = l->next) { - SPUnit const *u = static_cast(l->data); + Inkscape::Util::UnitTable unit_table; + Inkscape::Util::UnitTable::UnitMap m = unit_table.units(Inkscape::Util::UNIT_TYPE_LINEAR); + Inkscape::Util::UnitTable::UnitMap::iterator iter = m.begin(); + while(iter != m.end()) { Gtk::RadioMenuItem *mi = Gtk::manage(new Gtk::RadioMenuItem(_sw_group)); - mi->add(*(new Gtk::Label(u->abbr, 0.0, 0.5))); + mi->add(*(new Gtk::Label((*iter).first, 0.0, 0.5))); _unit_mis = g_slist_append(_unit_mis, mi); - mi->signal_activate().connect(sigc::bind(sigc::mem_fun(*this, &SelectedStyle::on_popup_units), u->unit_id)); + Inkscape::Util::Unit const *u = new Inkscape::Util::Unit(unit_table.getUnit(iter->first)); + mi->signal_activate().connect(sigc::bind(sigc::mem_fun(*this, &SelectedStyle::on_popup_units), *u)); _popup_sw.attach(*mi, 0,1, row, row+1); row++; + ++iter; } _popup_sw.attach(*(new Gtk::SeparatorMenuItem()), 0,1, row, row+1); @@ -476,14 +480,13 @@ SelectedStyle::setDesktop(SPDesktop *desktop) this ) )); - //_sw_unit = const_cast(sp_desktop_namedview(desktop)->doc_units); - _sw_unit = const_cast(&sp_unit_get_by_id(SP_UNIT_PX)); + _sw_unit = const_cast(sp_desktop_namedview(desktop)->doc_units); // Set the doc default unit active in the units list gint length = g_slist_length(_unit_mis); for (int i = 0; i < length; i++) { Gtk::RadioMenuItem *mi = (Gtk::RadioMenuItem *) g_slist_nth_data(_unit_mis, i); - if (mi && mi->get_label() == Glib::ustring(_sw_unit->abbr)) { + if (mi && mi->get_label() == _sw_unit->abbr) { mi->set_active(); break; } @@ -927,8 +930,8 @@ SelectedStyle::on_opacity_click(GdkEventButton *event) return false; } -void SelectedStyle::on_popup_units(SPUnitId id) { - _sw_unit = (SPUnit *) &(sp_unit_get_by_id(id)); +void SelectedStyle::on_popup_units(Inkscape::Util::Unit &unit) { + _sw_unit = new Inkscape::Util::Unit(unit); update(); } @@ -936,7 +939,7 @@ void SelectedStyle::on_popup_preset(int i) { SPCSSAttr *css = sp_repr_css_attr_new (); gdouble w; if (_sw_unit) { - w = sp_units_get_pixels (_sw_presets[i], *_sw_unit); + w = Inkscape::Util::Quantity::convert(_sw_presets[i], *_sw_unit, "px"); } else { w = _sw_presets[i]; } @@ -1115,7 +1118,7 @@ SelectedStyle::update() { double w; if (_sw_unit) { - w = sp_pixels_get_units(query->stroke_width.computed, *_sw_unit); + w = Inkscape::Util::Quantity::convert(query->stroke_width.computed, "px", *_sw_unit); } else { w = query->stroke_width.computed; } @@ -1129,7 +1132,7 @@ SelectedStyle::update() { gchar *str = g_strdup_printf(_("Stroke width: %.5g%s%s"), w, - _sw_unit? sp_unit_get_abbreviation(_sw_unit) : "px", + _sw_unit? _sw_unit->abbr.c_str() : "px", (result_sw == QUERY_STYLE_MULTIPLE_AVERAGED)? _(" (averaged)") : ""); _stroke_width_place.set_tooltip_text(str); diff --git a/src/ui/widget/selected-style.h b/src/ui/widget/selected-style.h index e5bc4f883..0a907f1fd 100644 --- a/src/ui/widget/selected-style.h +++ b/src/ui/widget/selected-style.h @@ -41,12 +41,15 @@ #include #include "rotateable.h" -#include "helper/units.h" class SPDesktop; -struct SPUnit; namespace Inkscape { + +namespace Util { + class Unit; +} + namespace UI { namespace Widget { @@ -273,11 +276,11 @@ protected: Gtk::Menu _popup_sw; Gtk::RadioButtonGroup _sw_group; GSList *_unit_mis; - void on_popup_units(SPUnitId id); + void on_popup_units(Inkscape::Util::Unit &u); void on_popup_preset(int i); Gtk::MenuItem _popup_sw_remove; - SPUnit *_sw_unit; + Inkscape::Util::Unit *_sw_unit; void *_drop[2]; bool _dropEnabled[2]; diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 1c6852f35..56a5baf5b 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -394,7 +394,8 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw ) dtw->hruler = sp_ruler_new(GTK_ORIENTATION_HORIZONTAL); dtw->hruler_box = eventbox; sp_ruler_set_unit(SP_RULER(dtw->hruler), SP_PT); - gtk_widget_set_tooltip_text (dtw->hruler_box, gettext(sp_unit_get_plural (&sp_unit_get_by_id(SP_UNIT_PT)))); + Inkscape::Util::UnitTable unit_table; + gtk_widget_set_tooltip_text (dtw->hruler_box, gettext(unit_table.getUnit("pt").name_plural.c_str())); gtk_container_add (GTK_CONTAINER (eventbox), dtw->hruler); g_signal_connect (G_OBJECT (eventbox), "button_press_event", G_CALLBACK (sp_dt_hruler_event), dtw); g_signal_connect (G_OBJECT (eventbox), "button_release_event", G_CALLBACK (sp_dt_hruler_event), dtw); @@ -423,7 +424,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw ) dtw->vruler = sp_ruler_new(GTK_ORIENTATION_VERTICAL); dtw->vruler_box = eventbox; sp_ruler_set_unit (SP_RULER (dtw->vruler), SP_PT); - gtk_widget_set_tooltip_text (dtw->vruler_box, gettext(sp_unit_get_plural (&sp_unit_get_by_id(SP_UNIT_PT)))); + gtk_widget_set_tooltip_text (dtw->vruler_box, gettext(unit_table.getUnit("pt").name_plural.c_str())); gtk_container_add (GTK_CONTAINER (eventbox), GTK_WIDGET (dtw->vruler)); #if GTK_CHECK_VERSION(3,0,0) -- cgit v1.2.3 From 4d00e731811f7c795b80b49b408eb76a9852b9f0 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Fri, 19 Jul 2013 15:56:24 -0400 Subject: Ported "ui/widget/style-swatch.*". (bzr r12380.1.40) --- src/ui/widget/style-swatch.cpp | 6 +++--- src/ui/widget/style-swatch.h | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/ui/widget/style-swatch.cpp b/src/ui/widget/style-swatch.cpp index aedab3fa5..682457bed 100644 --- a/src/ui/widget/style-swatch.cpp +++ b/src/ui/widget/style-swatch.cpp @@ -26,7 +26,7 @@ #include "xml/repr.h" #include "xml/sp-css-attr.h" #include "widgets/widget-sizes.h" -#include "helper/units.h" +#include "util/units.h" #include "helper/action.h" #include "helper/action-context.h" #include "preferences.h" @@ -333,7 +333,7 @@ void StyleSwatch::setStyle(SPStyle *query) if (has_stroke) { double w; if (_sw_unit) { - w = sp_pixels_get_units(query->stroke_width.computed, *_sw_unit); + w = Inkscape::Util::Quantity::convert(query->stroke_width.computed, "px", *_sw_unit); } else { w = query->stroke_width.computed; } @@ -346,7 +346,7 @@ void StyleSwatch::setStyle(SPStyle *query) { gchar *str = g_strdup_printf(_("Stroke width: %.5g%s"), w, - _sw_unit? sp_unit_get_abbreviation(_sw_unit) : "px"); + _sw_unit? _sw_unit->abbr.c_str() : "px"); _stroke_width_place.set_tooltip_text(str); g_free (str); } diff --git a/src/ui/widget/style-swatch.h b/src/ui/widget/style-swatch.h index 6bdb5e248..6da58a2dd 100644 --- a/src/ui/widget/style-swatch.h +++ b/src/ui/widget/style-swatch.h @@ -30,7 +30,6 @@ #include "button.h" #include "preferences.h" -struct SPUnit; struct SPStyle; class SPCSSAttr; @@ -43,6 +42,11 @@ class Table; } namespace Inkscape { + +namespace Util { + class Unit; +} + namespace UI { namespace Widget { @@ -93,7 +97,7 @@ private: Gtk::EventBox _stroke_width_place; Gtk::Label _stroke_width; - SPUnit *_sw_unit; + Inkscape::Util::Unit *_sw_unit; friend class ToolObserver; }; -- cgit v1.2.3 From 5b8a6e510cb69d33bc8834a7586142be800471b5 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Fri, 19 Jul 2013 16:31:57 -0400 Subject: Ported "live_effects/parameter/unit.*". (bzr r12380.1.41) --- src/live_effects/lpe-path_length.cpp | 5 +++-- src/live_effects/lpe-ruler.cpp | 8 ++++---- src/live_effects/parameter/unit.cpp | 22 ++++++++++++---------- src/live_effects/parameter/unit.h | 15 +++++++++------ 4 files changed, 28 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/live_effects/lpe-path_length.cpp b/src/live_effects/lpe-path_length.cpp index d3edcda27..504fb53c0 100644 --- a/src/live_effects/lpe-path_length.cpp +++ b/src/live_effects/lpe-path_length.cpp @@ -15,6 +15,7 @@ #include "live_effects/lpe-path_length.h" #include "sp-metrics.h" +#include "util/units.h" #include "2geom/sbasis-geometric.h" @@ -52,11 +53,11 @@ LPEPathLength::doEffect_pwd2 (Geom::Piecewise > const & p /* convert the measured length to the correct unit ... */ double lengthval = Geom::length(pwd2_in) * scale; - gboolean success = sp_convert_distance(&lengthval, &sp_unit_get_by_id(SP_UNIT_PX), unit); + lengthval = Inkscape::Util::Quantity::convert(lengthval, "px", unit.get_abbreviation()); /* ... set it as the canvas text ... */ gchar *arc_length = g_strdup_printf("%.2f %s", lengthval, - display_unit ? (success ? unit.get_abbreviation() : "px") : ""); + display_unit ? unit.get_abbreviation() : ""); info_text.param_setValue(arc_length); g_free(arc_length); diff --git a/src/live_effects/lpe-ruler.cpp b/src/live_effects/lpe-ruler.cpp index fefdad95a..788ab593a 100644 --- a/src/live_effects/lpe-ruler.cpp +++ b/src/live_effects/lpe-ruler.cpp @@ -81,9 +81,9 @@ LPERuler::ruler_mark(Geom::Point const &A, Geom::Point const &n, MarkType const using namespace Geom; double real_mark_length = mark_length; - sp_convert_distance(&real_mark_length, unit, &sp_unit_get_by_id(SP_UNIT_PX)); + real_mark_length = Inkscape::Util::Quantity::convert(real_mark_length, unit.get_abbreviation(), "px"); double real_minor_mark_length = minor_mark_length; - sp_convert_distance(&real_minor_mark_length, unit, &sp_unit_get_by_id(SP_UNIT_PX)); + real_minor_mark_length = Inkscape::Util::Quantity::convert(real_minor_mark_length, unit.get_abbreviation(), "px"); n_major = real_mark_length * n; n_minor = real_minor_mark_length * n; @@ -133,10 +133,10 @@ LPERuler::doEffect_pwd2 (Geom::Piecewise > const & pwd2_i std::vector s_cuts; double real_mark_distance = mark_distance; - sp_convert_distance(&real_mark_distance, unit, &sp_unit_get_by_id(SP_UNIT_PX)); + real_mark_distance = Inkscape::Util::Quantity::convert(real_mark_distance, unit.get_abbreviation(), "px"); double real_offset = offset; - sp_convert_distance(&real_offset, unit, &sp_unit_get_by_id(SP_UNIT_PX)); + real_offset = Inkscape::Util::Quantity::convert(real_offset, unit.get_abbreviation(), "px"); for (double s = real_offset; sabbr.c_str()); } void UnitParam::param_set_default() { - param_set_value(defunit); + param_set_value(*defunit); } void -UnitParam::param_set_value(SPUnit const *val) +UnitParam::param_set_value(Inkscape::Util::Unit const &val) { - unit = val; + unit = new Inkscape::Util::Unit(val); } const gchar * UnitParam::get_abbreviation() const { - return sp_unit_get_abbreviation(unit); + return unit->abbr.c_str(); } Gtk::Widget * diff --git a/src/live_effects/parameter/unit.h b/src/live_effects/parameter/unit.h index ea7a0112a..59a483018 100644 --- a/src/live_effects/parameter/unit.h +++ b/src/live_effects/parameter/unit.h @@ -10,10 +10,13 @@ */ #include "live_effects/parameter/parameter.h" -#include namespace Inkscape { +namespace Util { + class Unit; +} + namespace LivePathEffect { class UnitParam : public Parameter { @@ -23,22 +26,22 @@ public: const Glib::ustring& key, Inkscape::UI::Widget::Registry* wr, Effect* effect, - SPUnitId default_value = SP_UNIT_PX); + Glib::ustring default_unit = "px"); virtual ~UnitParam(); virtual bool param_readSVGValue(const gchar * strvalue); virtual gchar * param_getSVGValue() const; virtual void param_set_default(); - void param_set_value(SPUnit const *val); + void param_set_value(Inkscape::Util::Unit const &val); const gchar *get_abbreviation() const; virtual Gtk::Widget * param_newWidget(); - operator SPUnit const *() const { return unit; } + operator Inkscape::Util::Unit const *() const { return unit; } private: - SPUnit const *unit; - SPUnit const *defunit; + Inkscape::Util::Unit const *unit; + Inkscape::Util::Unit const *defunit; UnitParam(const UnitParam&); UnitParam& operator=(const UnitParam&); -- cgit v1.2.3 From 988e8e11fd11f1598d3ac0a42bdeef605772e6a9 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Fri, 19 Jul 2013 16:34:39 -0400 Subject: Cleanup. (bzr r12380.1.42) --- src/lpe-tool-context.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src') diff --git a/src/lpe-tool-context.cpp b/src/lpe-tool-context.cpp index bf032b7eb..32096970f 100644 --- a/src/lpe-tool-context.cpp +++ b/src/lpe-tool-context.cpp @@ -455,8 +455,6 @@ lpetool_create_measuring_items(SPLPEToolContext *lc, Inkscape::Selection *select if (!show) sp_canvas_item_hide(SP_CANVAS_ITEM(canvas_text)); - //SPUnitId unitid = static_cast(prefs->getInt("/tools/lpetool/unitid", SP_UNIT_PX)); - //SPUnit unit = sp_unit_get_by_id(unitid); Inkscape::Util::Unit unit; if (prefs->getString("/tools/lpetool/unit").compare("")) { unit = unit_table.getUnit(prefs->getString("/tools/lpetool/unit")); @@ -466,9 +464,7 @@ lpetool_create_measuring_items(SPLPEToolContext *lc, Inkscape::Selection *select lengthval = Geom::length(pwd2); gboolean success; - //success = sp_convert_distance(&lengthval, &sp_unit_get_by_id(SP_UNIT_PX), &unit); lengthval = Inkscape::Util::Quantity::convert(lengthval, "px", unit); - //arc_length = g_strdup_printf("%.2f %s", lengthval, success ? sp_unit_get_abbreviation(&unit) : "px"); arc_length = g_strdup_printf("%.2f %s", lengthval, unit.abbr.c_str()); sp_canvastext_set_text (canvas_text, arc_length); set_pos_and_anchor(canvas_text, pwd2, 0.5, 10); @@ -502,8 +498,6 @@ lpetool_update_measuring_items(SPLPEToolContext *lc) path = i->first; curve = SP_SHAPE(path)->getCurve(); Geom::Piecewise > pwd2 = Geom::paths_to_pw(curve->get_pathvector()); - //SPUnitId unitid = static_cast(prefs->getInt("/tools/lpetool/unitid", SP_UNIT_PX)); - //SPUnit unit = sp_unit_get_by_id(unitid); Inkscape::Util::Unit unit; if (prefs->getString("/tools/lpetool/unit").compare("")) { unit = unit_table.getUnit(prefs->getString("/tools/lpetool/unit")); @@ -512,9 +506,7 @@ lpetool_update_measuring_items(SPLPEToolContext *lc) } lengthval = Geom::length(pwd2); gboolean success; - //success = sp_convert_distance(&lengthval, &sp_unit_get_by_id(SP_UNIT_PX), &unit); lengthval = Inkscape::Util::Quantity::convert(lengthval, "px", unit); - //arc_length = g_strdup_printf("%.2f %s", lengthval, success ? sp_unit_get_abbreviation(&unit) : "px"); arc_length = g_strdup_printf("%.2f %s", lengthval, unit.abbr.c_str()); sp_canvastext_set_text (SP_CANVASTEXT(i->second), arc_length); set_pos_and_anchor(SP_CANVASTEXT(i->second), pwd2, 0.5, 10); -- cgit v1.2.3 From b4b22e6dba56bc9b0b8c35a9d484f1d86d61f45b Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Sat, 20 Jul 2013 12:29:12 -0400 Subject: Added percentage support to "Inkscape::Util::Quantity::convert". (bzr r12380.1.43) --- src/util/units.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/util/units.cpp b/src/util/units.cpp index 78531bfaf..dcb3ae4b1 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -504,6 +504,11 @@ double Quantity::value(const Glib::ustring u) const /** Convert distances. */ double Quantity::convert(const double from_dist, const Unit &from, const Unit &to) { + // Percentage + if (to.type == UNIT_TYPE_DIMENSIONLESS) { + return from_dist * to.factor; + } + // Incompatible units if (from.type != to.type) { return -1; -- cgit v1.2.3 From 08d18ac062f175f893bc7251e39072d0f0d4577c Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Sat, 20 Jul 2013 12:30:28 -0400 Subject: Ported "widgets/stroke-style.*". (bzr r12380.1.44) --- src/widgets/stroke-style.cpp | 123 ++++++++++++------------------------------- src/widgets/stroke-style.h | 24 ++++++--- 2 files changed, 50 insertions(+), 97 deletions(-) (limited to 'src') diff --git a/src/widgets/stroke-style.cpp b/src/widgets/stroke-style.cpp index 17e3984bb..e35a8b36b 100644 --- a/src/widgets/stroke-style.cpp +++ b/src/widgets/stroke-style.cpp @@ -22,6 +22,8 @@ #include "sp-gradient.h" #include "sp-stop.h" #include "svg/svg-color.h" +#include "util/units.h" +#include "ui/widget/unit-menu.h" using Inkscape::DocumentUndo; @@ -189,22 +191,23 @@ StrokeStyle::StrokeStyle() : sp_dialog_defocus_on_enter_cpp(widthSpin); hb->pack_start(*widthSpin, false, false, 0); - unitSelector = sp_unit_selector_new(SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE); - Gtk::Widget *us = manage(Glib::wrap(unitSelector)); + unitSelector = new Inkscape::UI::Widget::UnitMenu(); + unitSelector->setUnitType(Inkscape::Util::UNIT_TYPE_LINEAR); + Gtk::Widget *us = manage(unitSelector); SPDesktop *desktop = SP_ACTIVE_DESKTOP; - //if (desktop) - // sp_unit_selector_set_unit (SP_UNIT_SELECTOR(unitSelector), sp_desktop_namedview(desktop)->doc_units); - sp_unit_selector_add_unit(SP_UNIT_SELECTOR(unitSelector), &sp_unit_get_by_id(SP_UNIT_PERCENT), 0); - g_signal_connect ( G_OBJECT (unitSelector), "set_unit", G_CALLBACK (StrokeStyle::setStrokeWidthUnit), this ); + Inkscape::Util::UnitTable unit_table; + unitSelector->addUnit(unit_table.getUnit("%")); + if (desktop) { + unitSelector->setUnit(sp_desktop_namedview(desktop)->doc_units->abbr); + _old_unit = new Inkscape::Util::Unit(*sp_desktop_namedview(desktop)->doc_units); + } + _old_unit = new Inkscape::Util::Unit(unitSelector->getUnit()); + widthSpin->setUnitMenu(unitSelector); + unitChangedConn = unitSelector->signal_changed().connect(sigc::mem_fun(*this, &StrokeStyle::unitChangedCB)); + us->show(); -#if WITH_GTKMM_3_0 - sp_unit_selector_add_adjustment( SP_UNIT_SELECTOR(unitSelector), GTK_ADJUSTMENT((*widthAdj)->gobj()) ); -#else - sp_unit_selector_add_adjustment( SP_UNIT_SELECTOR(unitSelector), GTK_ADJUSTMENT(widthAdj->gobj()) ); -#endif - hb->pack_start(*us, FALSE, FALSE, 0); #if WITH_GTKMM_3_0 @@ -519,75 +522,17 @@ void StrokeStyle::updateMarkerHist(SPMarkerLoc const which) } /** - * Sets the stroke width units for all selected items. - * Also handles absolute and dimensionless units. + * Callback for when UnitMenu widget is modified. + * Triggers update action. */ -gboolean StrokeStyle::setStrokeWidthUnit(SPUnitSelector *, - SPUnit const *old, - SPUnit const *new_units, - StrokeStyle *spw) +void StrokeStyle::unitChangedCB() { - if (spw->update) { - return FALSE; - } - - if (!spw->desktop) { - return FALSE; + Inkscape::Util::Unit new_unit = unitSelector->getUnit(); + if (new_unit.type == Inkscape::Util::UNIT_TYPE_DIMENSIONLESS) { + widthSpin->set_value(100); } - - Inkscape::Selection *selection = sp_desktop_selection (spw->desktop); - - if (selection->isEmpty()) - return FALSE; - - GSList const *objects = selection->itemList(); - - if ((old->base == SP_UNIT_ABSOLUTE || old->base == SP_UNIT_DEVICE) && - (new_units->base == SP_UNIT_DIMENSIONLESS)) { - - /* Absolute to percentage */ - spw->update = true; - -#if WITH_GTKMM_3_0 - float w = sp_units_get_pixels( (*spw->widthAdj)->get_value(), *old); -#else - float w = sp_units_get_pixels(spw->widthAdj->get_value(), *old); -#endif - - gdouble average = stroke_average_width (objects); - - if ((average == Geom::infinity()) || (average < 1e-8)){ //less than 1e-8: to campare against zero, while taking numeric accuracy into account - return FALSE; - } - -#if WITH_GTKMM_3_0 - (*spw->widthAdj)->set_value(100.0 * w / average); -#else - spw->widthAdj->set_value(100.0 * w / average); -#endif - - spw->update = false; - return TRUE; - - } else if ((old->base == SP_UNIT_DIMENSIONLESS) && - (new_units->base == SP_UNIT_ABSOLUTE || new_units->base == SP_UNIT_DEVICE)) { - - /* Percentage to absolute */ - spw->update = true; - - gdouble average = stroke_average_width (objects); - -#if WITH_GTKMM_3_0 - (*spw->widthAdj)->set_value (sp_pixels_get_units (0.01 * (*spw->widthAdj)->get_value() * average, *new_units)); -#else - spw->widthAdj->set_value (sp_pixels_get_units (0.01 * spw->widthAdj->get_value() * average, *new_units)); -#endif - - spw->update = false; - return TRUE; - } - - return FALSE; + widthSpin->set_value(Inkscape::Util::Quantity::convert(widthSpin->get_value(), *_old_unit, new_unit)); + _old_unit = new Inkscape::Util::Unit(new_unit); } /** @@ -877,21 +822,21 @@ StrokeStyle::updateLine() } else { table->set_sensitive(true); - SPUnit const *unit = sp_unit_selector_get_unit(SP_UNIT_SELECTOR(unitSelector)); + Inkscape::Util::Unit const *unit = new Inkscape::Util::Unit(unitSelector->getUnit()); if (result_sw == QUERY_STYLE_MULTIPLE_AVERAGED) { - sp_unit_selector_set_unit(SP_UNIT_SELECTOR(unitSelector), &sp_unit_get_by_id(SP_UNIT_PERCENT)); + unitSelector->setUnit("%"); } else { // same width, or only one object; no sense to keep percent, switch to absolute - if (unit->base != SP_UNIT_ABSOLUTE && unit->base != SP_UNIT_DEVICE) { - //sp_unit_selector_set_unit(SP_UNIT_SELECTOR(unitSelector), sp_desktop_namedview(SP_ACTIVE_DESKTOP)->doc_units); + if (unit->type != Inkscape::Util::UNIT_TYPE_LINEAR) { + unitSelector->setUnit(sp_desktop_namedview(SP_ACTIVE_DESKTOP)->doc_units->abbr); } } - unit = sp_unit_selector_get_unit(SP_UNIT_SELECTOR(unitSelector)); + unit = new Inkscape::Util::Unit(unitSelector->getUnit()); - if (unit->base == SP_UNIT_ABSOLUTE || unit->base == SP_UNIT_DEVICE) { - double avgwidth = sp_pixels_get_units (query->stroke_width.computed, *unit); + if (unit->type == Inkscape::Util::UNIT_TYPE_LINEAR) { + double avgwidth = Inkscape::Util::Quantity::convert(query->stroke_width.computed, "px", *unit); #if WITH_GTKMM_3_0 (*widthAdj)->set_value(avgwidth); #else @@ -1017,7 +962,7 @@ StrokeStyle::scaleLine() double const miterlimit = miterLimitAdj->get_value(); #endif - SPUnit const *const unit = sp_unit_selector_get_unit(SP_UNIT_SELECTOR(unitSelector)); + Inkscape::Util::Unit const *const unit = new Inkscape::Util::Unit(unitSelector->getUnit()); double *dash, offset; int ndash; @@ -1026,8 +971,8 @@ StrokeStyle::scaleLine() for (GSList const *i = items; i != NULL; i = i->next) { /* Set stroke width */ double width; - if (unit->base == SP_UNIT_ABSOLUTE || unit->base == SP_UNIT_DEVICE) { - width = sp_units_get_pixels (width_typed, *unit); + if (unit->type == Inkscape::Util::UNIT_TYPE_LINEAR) { + width = Inkscape::Util::Quantity::convert(width_typed, *unit, "px"); } else { // percentage gdouble old_w = SP_OBJECT(i->data)->style->stroke_width.computed; width = old_w * width_typed / 100; @@ -1053,7 +998,7 @@ StrokeStyle::scaleLine() g_free(dash); - if (unit->base != SP_UNIT_ABSOLUTE && unit->base != SP_UNIT_DEVICE) { + if (unit->type != Inkscape::Util::UNIT_TYPE_LINEAR) { // reset to 100 percent #if WITH_GTKMM_3_0 (*widthAdj)->set_value(100.0); diff --git a/src/widgets/stroke-style.h b/src/widgets/stroke-style.h index fd9940db1..440881c6d 100644 --- a/src/widgets/stroke-style.h +++ b/src/widgets/stroke-style.h @@ -40,8 +40,6 @@ #include "document-undo.h" #include "gradient-chemistry.h" #include "helper/stock-items.h" -#include "helper/unit-menu.h" -#include "helper/units.h" #include "inkscape.h" #include "io/sys.h" #include "marker.h" @@ -77,6 +75,17 @@ class Widget; class Container; } +namespace Inkscape { + namespace Util { + class Unit; + } + namespace UI { + namespace Widget { + class UnitMenu; + } + } +} + struct { gchar const *key; gint value; } const SPMarkerNames[] = { {"marker-all", SP_MARKER_LOC}, {"marker-start", SP_MARKER_LOC_START}, @@ -162,17 +171,13 @@ private: StrokeStyleButtonType button_type, gchar const *stroke_style); - static gboolean setStrokeWidthUnit(SPUnitSelector *, - SPUnit const *old, - SPUnit const *new_units, - StrokeStyle *spw); - // Callback functions void selectionModifiedCB(guint flags); void selectionChangedCB(); void widthChangedCB(); void miterLimitChangedCB(); void lineDashChangedCB(); + void unitChangedCB(); static void markerSelectCB(MarkerComboBox *marker_combo, StrokeStyle *spw, SPMarkerLoc const which); static void buttonToggledCB(StrokeStyleButton *tb, StrokeStyle *spw); @@ -191,7 +196,7 @@ private: #endif Inkscape::UI::Widget::SpinButton *miterLimitSpin; Inkscape::UI::Widget::SpinButton *widthSpin; - GtkWidget *unitSelector; + Inkscape::UI::Widget::UnitMenu *unitSelector; StrokeStyleButton *joinMiter; StrokeStyleButton *joinRound; StrokeStyleButton *joinBevel; @@ -207,6 +212,9 @@ private: sigc::connection startMarkerConn; sigc::connection midMarkerConn; sigc::connection endMarkerConn; + sigc::connection unitChangedConn; + + Inkscape::Util::Unit *_old_unit; }; } // namespace Inkscape -- cgit v1.2.3 From 567fbf4a2759ff93533a22a8688b4dcc01f19138 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Sat, 20 Jul 2013 14:00:42 -0400 Subject: Removed last traces of "SPUnit" and removed "helper/unit*". (bzr r12380.1.45) --- src/helper/Makefile_insert | 4 - src/helper/unit-menu.cpp | 360 -------------------------------------- src/helper/unit-menu.h | 60 ------- src/helper/units-test.h | 90 ---------- src/helper/units.cpp | 261 --------------------------- src/helper/units.h | 146 ---------------- src/ui/widget/registered-widget.h | 1 - 7 files changed, 922 deletions(-) delete mode 100644 src/helper/unit-menu.cpp delete mode 100644 src/helper/unit-menu.h delete mode 100644 src/helper/units-test.h delete mode 100644 src/helper/units.cpp delete mode 100644 src/helper/units.h (limited to 'src') diff --git a/src/helper/Makefile_insert b/src/helper/Makefile_insert index 0008936dd..5d1703b5c 100644 --- a/src/helper/Makefile_insert +++ b/src/helper/Makefile_insert @@ -18,10 +18,6 @@ ink_common_sources += \ helper/png-write.h \ helper/sp-marshal.cpp \ helper/sp-marshal.h \ - helper/unit-menu.cpp \ - helper/unit-menu.h \ - helper/units.cpp \ - helper/units.h \ helper/window.cpp \ helper/window.h \ helper/stock-items.cpp \ diff --git a/src/helper/unit-menu.cpp b/src/helper/unit-menu.cpp deleted file mode 100644 index af07c03c1..000000000 --- a/src/helper/unit-menu.cpp +++ /dev/null @@ -1,360 +0,0 @@ -#define __SP_UNIT_MENU_C__ - -/* - * Unit selector with autupdate capability - * - * Authors: - * Lauris Kaplinski - * bulia byak - * - * Copyright (C) 2000-2002 Authors - * - * Released under GNU GPL, read the file 'COPYING' for more information - */ - -#define noUNIT_SELECTOR_VERBOSE - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif -#include -#include "helper/sp-marshal.h" -#include "helper/units.h" -#include "helper/unit-menu.h" -#include "widgets/spw-utilities.h" - -struct SPUnitSelector { - GtkHBox box; - - GtkWidget *combo_box; - GtkListStore *store; - - - guint bases; - GSList *units; - SPUnit const *unit; - gdouble ctmscale; - guint plural : 1; - guint abbr : 1; - - guint update : 1; - - GSList *adjustments; -}; - -enum {COMBO_COL_LABEL=0, COMBO_COL_UNIT}; - -struct SPUnitSelectorClass { - GtkHBoxClass parent_class; - - gboolean (* set_unit)(SPUnitSelector *us, SPUnit const *old, SPUnit const *new_unit); -}; - -enum {SET_UNIT, LAST_SIGNAL}; - -static void sp_unit_selector_finalize(GObject *object); - -static guint signals[LAST_SIGNAL] = {0}; - -G_DEFINE_TYPE(SPUnitSelector, sp_unit_selector, GTK_TYPE_HBOX); - -static void -sp_unit_selector_class_init(SPUnitSelectorClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS(klass); - - signals[SET_UNIT] = g_signal_new("set_unit", - G_TYPE_FROM_CLASS(klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(SPUnitSelectorClass, set_unit), - NULL, NULL, - sp_marshal_BOOLEAN__POINTER_POINTER, - G_TYPE_BOOLEAN, 2, - G_TYPE_POINTER, G_TYPE_POINTER); - - object_class->finalize = sp_unit_selector_finalize; -} - -static void -sp_unit_selector_init(SPUnitSelector *us) -{ - us->ctmscale = 1.0; - us->abbr = FALSE; - us->plural = TRUE; - - /** - * Create a combo_box and store with 2 columns, - * a label and a pointer to a SPUnit - */ - us->store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); - us->combo_box = gtk_combo_box_new_with_model (GTK_TREE_MODEL (us->store)); - - GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); - g_object_set (renderer, "scale", 0.8, "scale-set", TRUE, NULL); - gtk_cell_renderer_set_padding (renderer, 2, 0); - gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (us->combo_box), renderer, TRUE); - gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (us->combo_box), renderer, "text", COMBO_COL_LABEL, NULL); - - gtk_widget_show (us->combo_box); - gtk_box_pack_start (GTK_BOX(us), us->combo_box, TRUE, TRUE, 0); -} - -static void -sp_unit_selector_finalize(GObject *object) -{ - SPUnitSelector *selector = SP_UNIT_SELECTOR(object); - - if (selector->combo_box) { - selector->combo_box = NULL; - } - - while (selector->adjustments) { - g_object_unref(selector->adjustments->data); - selector->adjustments = g_slist_remove(selector->adjustments, selector->adjustments->data); - } - - if (selector->units) { - sp_unit_free_list(selector->units); - } - - selector->unit = NULL; - - G_OBJECT_CLASS(sp_unit_selector_parent_class)->finalize(object); -} - -GtkWidget * -sp_unit_selector_new(guint bases) -{ - SPUnitSelector *us = SP_UNIT_SELECTOR(g_object_new(SP_TYPE_UNIT_SELECTOR, NULL)); - - sp_unit_selector_set_bases(us, bases); - - return GTK_WIDGET(us); -} - -void -sp_unit_selector_setsize(GtkWidget *us, guint w, guint h) -{ - gtk_widget_set_size_request((SP_UNIT_SELECTOR(us))->combo_box, w, h); -} - -SPUnit const * -sp_unit_selector_get_unit(SPUnitSelector const *us) -{ - g_return_val_if_fail(us != NULL, NULL); - g_return_val_if_fail(SP_IS_UNIT_SELECTOR(us), NULL); - - return us->unit; -} - - -static void -on_combo_box_changed (GtkComboBox *widget, SPUnitSelector *us) -{ - GtkTreeIter iter; - if (!gtk_combo_box_get_active_iter (widget, &iter)) { - return; - } - - SPUnit const *unit = NULL; - gtk_tree_model_get (GTK_TREE_MODEL(us->store), &iter, COMBO_COL_UNIT, &unit, -1); - - g_return_if_fail(unit != NULL); - -#ifdef UNIT_SELECTOR_VERBOSE - g_print("Old unit %s new unit %s\n", us->unit->name, unit->name); -#endif - - SPUnit const *old = us->unit; - us->unit = unit; - - us->update = TRUE; - - gboolean consumed = FALSE; - g_signal_emit(G_OBJECT(us), signals[SET_UNIT], 0, old, unit, &consumed); - - if ( !consumed - && ( unit->base == old->base - || ( unit->base == SP_UNIT_ABSOLUTE && old->base == SP_UNIT_DEVICE ) - || ( old->base == SP_UNIT_ABSOLUTE && unit->base == SP_UNIT_DEVICE ) ) ) { - // Either the same base, or absolute<->device: - /* Recalculate adjustments. */ - for (GSList *l = us->adjustments; l != NULL; l = g_slist_next(l)) { - GtkAdjustment *adj = GTK_ADJUSTMENT(l->data); - gdouble val = gtk_adjustment_get_value (adj); -#ifdef UNIT_SELECTOR_VERBOSE - g_print("Old val %g ... ", val); -#endif - val = sp_convert_distance_full(val, *old, *unit); -#ifdef UNIT_SELECTOR_VERBOSE - g_print("new val %g\n", val); -#endif - gtk_adjustment_set_value (adj, val); - } - /* need to separate the value changing from the notification - * or else the unit changes can break the calculations */ - for (GSList *l = us->adjustments; l != NULL; l = g_slist_next(l)) { - gtk_adjustment_value_changed(GTK_ADJUSTMENT(l->data)); - } - } else if (!consumed && unit->base != old->base) { - /* when the base changes, signal all the adjustments to get them - * to recalculate */ - for (GSList *l = us->adjustments; l != NULL; l = g_slist_next(l)) { - g_signal_emit_by_name(G_OBJECT(l->data), "value_changed"); - } - } - - us->update = FALSE; - -} - -static void -spus_rebuild_menu(SPUnitSelector *us) -{ - - gtk_list_store_clear(us->store); - - GtkTreeIter iter; - - gint pos = 0; - gint p = 0; - for (GSList *l = us->units; l != NULL; l = l->next) { - SPUnit const *u = static_cast(l->data); - - // use only abbreviations in the menu - // i = gtk_menu_item_new_with_label((us->abbr) ? (us->plural) ? u->abbr_plural : u->abbr : (us->plural) ? u->plural : u->name); - gtk_list_store_append (us->store, &iter); - gtk_list_store_set (us->store, &iter, COMBO_COL_LABEL, u->abbr, COMBO_COL_UNIT, (gpointer) u, -1); - - if (u == us->unit) { - pos = p; - } - - p += 1; - } - - gtk_combo_box_set_active(GTK_COMBO_BOX(us->combo_box), pos); - g_signal_connect (G_OBJECT (us->combo_box), "changed", G_CALLBACK (on_combo_box_changed), us); -} - -void -sp_unit_selector_set_bases(SPUnitSelector *us, guint bases) -{ - g_return_if_fail(us != NULL); - g_return_if_fail(SP_IS_UNIT_SELECTOR(us)); - - if (bases == us->bases) return; - - GSList *units = sp_unit_get_list(bases); - g_return_if_fail(units != NULL); - sp_unit_free_list(us->units); - us->units = units; - us->unit = static_cast(units->data); - - spus_rebuild_menu(us); -} - -void -sp_unit_selector_add_unit(SPUnitSelector *us, SPUnit const *unit, int position) -{ - if (!g_slist_find(us->units, (gpointer) unit)) { - us->units = g_slist_insert(us->units, (gpointer) unit, position); - - spus_rebuild_menu(us); - } -} - -void -sp_unit_selector_set_unit(SPUnitSelector *us, SPUnit const *unit) -{ - g_return_if_fail(us != NULL); - g_return_if_fail(SP_IS_UNIT_SELECTOR(us)); - - if (unit == NULL) { - return; // silently return, by default a newly created selector uses pt - } - if (unit == us->unit) { - return; - } - - gint const pos = g_slist_index(us->units, (gpointer) unit); - g_return_if_fail(pos >= 0); - - gtk_combo_box_set_active(GTK_COMBO_BOX(us->combo_box), pos); - - SPUnit const *old = us->unit; - us->unit = unit; - - /* Recalculate adjustments */ - for (GSList *l = us->adjustments; l != NULL; l = l->next) { - GtkAdjustment *adj = GTK_ADJUSTMENT(l->data); - gdouble const val = sp_convert_distance_full(gtk_adjustment_get_value (adj), *old, *unit); - gtk_adjustment_set_value(adj, val); - } -} - -void -sp_unit_selector_add_adjustment(SPUnitSelector *us, GtkAdjustment *adj) -{ - g_return_if_fail(us != NULL); - g_return_if_fail(SP_IS_UNIT_SELECTOR(us)); - g_return_if_fail(adj != NULL); - g_return_if_fail(GTK_IS_ADJUSTMENT(adj)); - - g_return_if_fail(!g_slist_find(us->adjustments, adj)); - - g_object_ref(adj); - us->adjustments = g_slist_prepend(us->adjustments, adj); -} - -void -sp_unit_selector_remove_adjustment(SPUnitSelector *us, GtkAdjustment *adj) -{ - g_return_if_fail(us != NULL); - g_return_if_fail(SP_IS_UNIT_SELECTOR(us)); - g_return_if_fail(adj != NULL); - g_return_if_fail(GTK_IS_ADJUSTMENT(adj)); - - g_return_if_fail(g_slist_find(us->adjustments, adj)); - - us->adjustments = g_slist_remove(us->adjustments, adj); - g_object_unref(adj); -} - -gboolean -sp_unit_selector_update_test(SPUnitSelector const *selector) -{ - g_return_val_if_fail(selector != NULL, FALSE); - g_return_val_if_fail(SP_IS_UNIT_SELECTOR(selector), FALSE); - - return selector->update; -} - -double -sp_unit_selector_get_value_in_pixels(SPUnitSelector const *selector, GtkAdjustment *adj) -{ - g_return_val_if_fail(selector != NULL, gtk_adjustment_get_value (adj)); - g_return_val_if_fail(SP_IS_UNIT_SELECTOR(selector), gtk_adjustment_get_value (adj)); - - return sp_units_get_pixels(gtk_adjustment_get_value (adj), *(selector->unit)); -} - -void -sp_unit_selector_set_value_in_pixels(SPUnitSelector *selector, GtkAdjustment *adj, double value) -{ - g_return_if_fail(selector != NULL); - g_return_if_fail(SP_IS_UNIT_SELECTOR(selector)); - - gtk_adjustment_set_value(adj, sp_pixels_get_units(value, *(selector->unit))); -} - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/helper/unit-menu.h b/src/helper/unit-menu.h deleted file mode 100644 index b3ee6bcd1..000000000 --- a/src/helper/unit-menu.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef SP_UNIT_MENU_H -#define SP_UNIT_MENU_H - -/* - * SPUnitMenu - * - * Generic (and quite unintelligent) grid item for gnome canvas - * - * Copyright (C) Lauris Kaplinski 2000 - * - */ - -#include -#include - -struct SPUnit; -struct SPUnitSelector; -struct SPUnitSelectorClass; - -/* Unit selector Widget */ - -#define SP_TYPE_UNIT_SELECTOR (sp_unit_selector_get_type()) -#define SP_UNIT_SELECTOR(o) (G_TYPE_CHECK_INSTANCE_CAST((o), SP_TYPE_UNIT_SELECTOR, SPUnitSelector)) -#define SP_UNIT_SELECTOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), SP_TYPE_UNIT_SELECTOR, SPUnitSelectorClass)) -#define SP_IS_UNIT_SELECTOR(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), SP_TYPE_UNIT_SELECTOR)) -#define SP_IS_UNIT_SELECTOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), SP_TYPE_UNIT_SELECTOR)) - -GType sp_unit_selector_get_type(void); - -GtkWidget *sp_unit_selector_new(guint bases); -void sp_unit_selector_setsize(GtkWidget *us, guint w, guint h); - -SPUnit const *sp_unit_selector_get_unit(SPUnitSelector const *selector); - -void sp_unit_selector_set_bases(SPUnitSelector *selector, guint bases); -void sp_unit_selector_add_unit(SPUnitSelector *selector, SPUnit const *unit, int position); - -void sp_unit_selector_set_unit(SPUnitSelector *selector, SPUnit const *unit); -void sp_unit_selector_add_adjustment(SPUnitSelector *selector, GtkAdjustment *adjustment); -void sp_unit_selector_remove_adjustment(SPUnitSelector *selector, GtkAdjustment *adjustment); - -gboolean sp_unit_selector_update_test(SPUnitSelector const *selector); - -double sp_unit_selector_get_value_in_pixels(SPUnitSelector const *selector, GtkAdjustment *adj); -void sp_unit_selector_set_value_in_pixels(SPUnitSelector *selector, GtkAdjustment *adj, double value); - - - -#endif // SP_UNIT_MENU_H - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/helper/units-test.h b/src/helper/units-test.h deleted file mode 100644 index 05bc75eff..000000000 --- a/src/helper/units-test.h +++ /dev/null @@ -1,90 +0,0 @@ -#include - -#include -#include -#include - -class UnitsTest : public CxxTest::TestSuite { -public: - - UnitsTest() - { - } - virtual ~UnitsTest() {} - -// createSuite and destroySuite get us per-suite setup and teardown -// without us having to worry about static initialization order, etc. - static UnitsTest *createSuite() { return new UnitsTest(); } - static void destroySuite( UnitsTest *suite ) { delete suite; } - - void testConversions() - { - struct Case { double x; char const *abbr; double pts; } const tests[] = { - { 1.0, "pt", 1.0 }, - { 5.0, "pt", 5.0 }, - { 1.0, "in", 72.0 }, - { 2.0, "in", 144.0 }, - { 254., "mm", 720.0 }, - { 254., "cm", 7200. }, - { 254., "m", 720000. }, - { 1.5, "mm", (15 * 72. / 254) } - }; - for (unsigned i = 0; i < G_N_ELEMENTS(tests); ++i) { - Case const &c = tests[i]; - SPUnit const &unit = *sp_unit_get_by_abbreviation(N_(c.abbr)); - - double const calc_pts = sp_units_get_points(c.x, unit); - TS_ASSERT(approx_equal(calc_pts, c.pts)); - - double const calc_x = sp_points_get_units(c.pts, unit); - TS_ASSERT(approx_equal(calc_x, c.x)); - - double tmp = c.x; - bool const converted_to_pts = sp_convert_distance(&tmp, &unit, SP_PS_UNIT); - TS_ASSERT(converted_to_pts); - TS_ASSERT(approx_equal(tmp, c.pts)); - - tmp = c.pts; - bool const converted_from_pts = sp_convert_distance(&tmp, SP_PS_UNIT, &unit); - TS_ASSERT(converted_from_pts); - TS_ASSERT(approx_equal(tmp, c.x)); - } - } - - void testUnitTable() - { - TS_ASSERT(sp_units_table_sane()); - } - -private: - /* N.B. Wrongly returns false if both near 0. (Not a problem for current users.) */ - bool approx_equal(double const x, double const y) - { - return fabs(x / y - 1) < 1e-15; - } - - double sp_units_get_points(double const x, SPUnit const &unit) - { - SPUnit const &pt_unit = sp_unit_get_by_id(SP_UNIT_PT); - double const px = sp_units_get_pixels(x, unit); - return sp_pixels_get_units(px, pt_unit); - } - - double sp_points_get_units(double const pts, SPUnit const &unit) - { - SPUnit const &pt_unit = sp_unit_get_by_id(SP_UNIT_PT); - double const px = sp_units_get_pixels(pts, pt_unit); - return sp_pixels_get_units(px, unit); - } -}; - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/helper/units.cpp b/src/helper/units.cpp deleted file mode 100644 index 1593fc131..000000000 --- a/src/helper/units.cpp +++ /dev/null @@ -1,261 +0,0 @@ -#define __SP_PAPER_C__ - -/* - * SPUnit - * - * Ported from libgnomeprint - * - * Authors: - * Dirk Luetjens - * Yves Arrouye - * Lauris Kaplinski - * bulia byak - * - * Copyright 1999-2001 Ximian, Inc. and authors - * - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "helper/units.h" -#include // g_assert() -#include -#include "unit-constants.h" -#include "svg/svg-length.h" - -/* todo: use some fancy unit program */ - -/* The order determines the order of the list returned by sp_unit_get_list. - * (It can also affect string lookups if there are any duplicates in the - * current locale... hopefully none.) If you re-order this list, then you must - * also re-order the SPUnitId enum values accordingly. Run `make check' (which - * calls sp_unit_table_sane) to ensure that the two are in sync. - */ -SPUnit const sp_units[] = { - {SP_UNIT_SCALE, SP_UNIT_DIMENSIONLESS, 1.0, SP_NONE, SVGLength::NONE, N_("Unit"), "", N_("Units"), ""}, - {SP_UNIT_PT, SP_UNIT_ABSOLUTE, PX_PER_PT, SP_PT, SVGLength::PT, N_("Point"), N_("pt"), N_("Points"), N_("Pt")}, - {SP_UNIT_PC, SP_UNIT_ABSOLUTE, PX_PER_PC, SP_PC, SVGLength::PC, N_("Pica"), N_("pc"), N_("Picas"), N_("Pc")}, - {SP_UNIT_PX, SP_UNIT_DEVICE, PX_PER_PX, SP_PX, SVGLength::PX, N_("Pixel"), N_("px"), N_("Pixels"), N_("Px")}, - /* You can add new elements from this point forward */ - {SP_UNIT_PERCENT, SP_UNIT_DIMENSIONLESS, 0.01, SP_NONE, SVGLength::PERCENT, N_("Percent"), N_("%"), N_("Percents"), N_("%")}, - {SP_UNIT_MM, SP_UNIT_ABSOLUTE, PX_PER_MM, SP_MM, SVGLength::MM, N_("Millimeter"), N_("mm"), N_("Millimeters"), N_("mm")}, - {SP_UNIT_CM, SP_UNIT_ABSOLUTE, PX_PER_CM, SP_CM, SVGLength::CM, N_("Centimeter"), N_("cm"), N_("Centimeters"), N_("cm")}, - {SP_UNIT_M, SP_UNIT_ABSOLUTE, PX_PER_M, SP_M, SVGLength::NONE, N_("Meter"), N_("m"), N_("Meters"), N_("m")}, // no svg_unit - {SP_UNIT_IN, SP_UNIT_ABSOLUTE, PX_PER_IN, SP_IN, SVGLength::INCH, N_("Inch"), N_("in"), N_("Inches"), N_("in")}, - {SP_UNIT_FT, SP_UNIT_ABSOLUTE, PX_PER_FT, SP_FT, SVGLength::FOOT, N_("Foot"), N_("ft"), N_("Feet"), N_("ft")}, - /* Volatiles do not have default, so there are none here */ - // TRANSLATORS: for info, see http://www.w3.org/TR/REC-CSS2/syndata.html#length-units - {SP_UNIT_EM, SP_UNIT_VOLATILE, 1.0, SP_NONE, SVGLength::EM, N_("Em square"), N_("em"), N_("Em squares"), N_("em")}, - // TRANSLATORS: for info, see http://www.w3.org/TR/REC-CSS2/syndata.html#length-units - {SP_UNIT_EX, SP_UNIT_VOLATILE, 1.0, SP_NONE, SVGLength::EX, N_("Ex square"), N_("ex"), N_("Ex squares"), N_("ex")}, -}; - -#define sp_num_units G_N_ELEMENTS(sp_units) - -SPUnit const * -sp_unit_get_by_abbreviation(gchar const *abbreviation) -{ - g_return_val_if_fail(abbreviation != NULL, NULL); - - for (unsigned i = 0 ; i < sp_num_units ; i++) { - if (!g_ascii_strcasecmp(abbreviation, sp_units[i].abbr)) return &sp_units[i]; - if (!g_ascii_strcasecmp(abbreviation, sp_units[i].abbr_plural)) return &sp_units[i]; - } - - return NULL; -} - -gchar const * -sp_unit_get_abbreviation(SPUnit const *unit) -{ - g_return_val_if_fail(unit != NULL, NULL); - - return unit->abbr; -} - -gchar const * -sp_unit_get_plural (SPUnit const *unit) -{ - g_return_val_if_fail(unit != NULL, NULL); - - return unit->plural; -} - -SPMetric sp_unit_get_metric(SPUnit const *unit) -{ - g_return_val_if_fail(unit != NULL, SP_NONE); - - return unit->metric; -} - -guint sp_unit_get_svg_unit(SPUnit const *unit) -{ - g_return_val_if_fail(unit != NULL, SP_NONE); - - return unit->svg_unit; -} - -GSList * -sp_unit_get_list(guint bases) -{ - g_return_val_if_fail((bases & ~SP_UNITS_ALL) == 0, NULL); - - GSList *units = NULL; - for (unsigned i = sp_num_units ; i--; ) { - if (bases & sp_units[i].base) { - units = g_slist_prepend(units, (gpointer) &sp_units[i]); - } - } - - return units; -} - -void -sp_unit_free_list(GSList *units) -{ - g_slist_free(units); -} - -/* These are pure utility */ -/* Return TRUE if conversion is possible */ -gboolean -sp_convert_distance(gdouble *distance, SPUnit const *from, SPUnit const *to) -{ - g_return_val_if_fail(distance != NULL, FALSE); - g_return_val_if_fail(from != NULL, FALSE); - g_return_val_if_fail(to != NULL, FALSE); - - if (from == to) return TRUE; - if ((from->base == SP_UNIT_DIMENSIONLESS) || (to->base == SP_UNIT_DIMENSIONLESS)) { - *distance = *distance * from->unittobase / to->unittobase; - return TRUE; - } - if ((from->base == SP_UNIT_VOLATILE) || (to->base == SP_UNIT_VOLATILE)) return FALSE; - - if ((from->base == to->base) - || ((from->base == SP_UNIT_DEVICE) && (to->base == SP_UNIT_ABSOLUTE)) - || ((from->base == SP_UNIT_ABSOLUTE) && (to->base == SP_UNIT_DEVICE))) - { - *distance = *distance * from->unittobase / to->unittobase; - return TRUE; - } - - return FALSE; -} - -/** @param devicetransform for device units. */ -/* TODO: Remove the ctmscale parameter given that we no longer have SP_UNIT_USERSPACE. */ -gdouble -sp_convert_distance_full(gdouble const from_dist, SPUnit const &from, SPUnit const &to) -{ - if (&from == &to) { - return from_dist; - } - if (from.base == to.base) { - gdouble ret = from_dist; - bool const succ = sp_convert_distance(&ret, &from, &to); - g_assert(succ); - return ret; - } - if ((from.base == SP_UNIT_DIMENSIONLESS) - || (to.base == SP_UNIT_DIMENSIONLESS)) - { - return from_dist * from.unittobase / to.unittobase; - } - g_return_val_if_fail(((from.base != SP_UNIT_VOLATILE) - && (to.base != SP_UNIT_VOLATILE)), - from_dist); - - gdouble absolute; - switch (from.base) { - case SP_UNIT_ABSOLUTE: - case SP_UNIT_DEVICE: - absolute = from_dist * from.unittobase; - break; - default: - g_warning("file %s: line %d: Illegal unit (base 0x%x)", __FILE__, __LINE__, from.base); - return from_dist; - } - - gdouble ret; - switch (to.base) { - default: - g_warning("file %s: line %d: Illegal unit (base 0x%x)", __FILE__, __LINE__, to.base); - /* FALL-THROUGH */ - case SP_UNIT_ABSOLUTE: - case SP_UNIT_DEVICE: - ret = absolute / to.unittobase; - break; - } - - return ret; -} - -/* Some more convenience */ - -gdouble -sp_units_get_pixels(gdouble const units, SPUnit const &unit) -{ - if (unit.base == SP_UNIT_ABSOLUTE || unit.base == SP_UNIT_DEVICE) { - return units * unit.unittobase; - } else { - g_warning("Different unit bases: No exact unit conversion available"); - return units * unit.unittobase; - } -} - -gdouble -sp_pixels_get_units(gdouble const pixels, SPUnit const &unit) -{ - if (unit.base == SP_UNIT_ABSOLUTE || unit.base == SP_UNIT_DEVICE) { - return pixels / unit.unittobase; - } else { - g_warning("Different unit bases: No exact unit conversion available"); - return pixels / unit.unittobase; - } -} - -bool -sp_units_table_sane() -{ - for (unsigned i = 0; i < G_N_ELEMENTS(sp_units); ++i) { - if (unsigned(sp_units[i].unit_id) != i) { - return false; - } - } - return true; -} - -/** Converts angle (in deg) to compass display */ -double -angle_to_compass(double angle) -{ - double ret = 90 - angle; - if (ret < 0) - ret = 360 + ret; - return ret; -} - -/** Converts angle (in deg) to compass display */ -double -angle_from_compass(double angle) -{ - double ret = 90 - angle; - if (ret > 180) - ret = ret - 180; - return ret; -} - - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/helper/units.h b/src/helper/units.h deleted file mode 100644 index 93bd70615..000000000 --- a/src/helper/units.h +++ /dev/null @@ -1,146 +0,0 @@ -#ifndef __SP_UNIT_H__ -#define __SP_UNIT_H__ - -/* - * SPUnit - * - * Ported from libgnomeprint - * - * Authors: - * Dirk Luetjens - * Yves Arrouye - * Lauris Kaplinski - * - * Copyright 1999-2001 Ximian, Inc. and authors - * - */ - -#include -#include "sp-metric.h" - - -/* - * Units and conversion methods used by libgnomeprint. - * - * You need those for certain config keys (like paper size), if you are - * interested in using these (look at gnome-print-config.h for discussion, - * why you may NOT be interested in paper size). - * - * Unit bases define set of mutually unrelated measuring systems (numbers, - * paper, screen and dimesionless user coordinates). Still, you can convert - * between those, specifying scaling factors explicitly. - * - * Paper (i.e. output) coordinates are taken as absolute real world units. - * It has some justification, because screen unit (pixel) size changes, - * if you change screen resolution, while you cannot change output on paper - * as easily (unless you have thermally contracting paper, of course). - * - */ - -struct SPUnit; -struct SPDistance; - -/* - * The base linear ("absolute") unit is 1/72th of an inch, i.e. the base unit of postscript. - */ - -/* - * Unit bases - */ -enum SPUnitBase { - SP_UNIT_DIMENSIONLESS = (1 << 0), /* For percentages and like */ - SP_UNIT_ABSOLUTE = (1 << 1), /* Real world distances - i.e. mm, cm... */ - SP_UNIT_DEVICE = (1 << 2), /* Pixels in the SVG/CSS sense. */ - SP_UNIT_VOLATILE = (1 << 3) /* em and ex */ -}; - -/* - * Units: indexes into sp_units. - */ -enum SPUnitId { - SP_UNIT_SCALE, // 1.0 == 100% - SP_UNIT_PT, // Postscript points: exactly 72 per inch - SP_UNIT_PC, // Pica; there are 12 points per pica - SP_UNIT_PX, // "Pixels" in the CSS sense; though Inkscape assumes a constant 90 per inch. - SP_UNIT_PERCENT, /* Note: In Inkscape this often means "relative to current value" (for - users to edit a value), rather than the SVG/CSS use of percentages. */ - SP_UNIT_MM, // millimetres - SP_UNIT_CM, // centimetres - SP_UNIT_M, // metres - SP_UNIT_IN, // inches - SP_UNIT_FT, // foot - SP_UNIT_EM, // font-size of relevant font - SP_UNIT_EX, // x-height of relevant font - sp_max_unit_id = SP_UNIT_EX // For bounds-checking in sp_unit_get_by_id. -}; - -/* - * Notice, that for correct menus etc. you have to use - * ngettext method family yourself. For that reason we - * do not provide translations in unit names. - * I also do not know, whether to allow user-created units, - * because this would certainly confuse textdomain. - */ - -struct SPUnit { - SPUnitId unit_id; /* used as sanity check */ - SPUnitBase base; - gdouble unittobase; /* how many base units in this unit */ - SPMetric metric; // the corresponding SPMetric from sp-metrics.h - guint svg_unit; // the corresponding SVGLengthUnit - - /* When using, you must call "gettext" on them so they're translated */ - gchar const *name; - gchar const *abbr; - gchar const *plural; - gchar const *abbr_plural; -}; - -const SPUnit *sp_unit_get_by_abbreviation (const gchar *abbreviation); -/* When using, you must call "gettext" on them so they're translated */ -const gchar *sp_unit_get_abbreviation (const SPUnit *unit); -gchar const *sp_unit_get_plural (SPUnit const *unit); - -SPMetric sp_unit_get_metric(SPUnit const *unit); -guint sp_unit_get_svg_unit(SPUnit const *unit); - -extern SPUnit const sp_units[]; - -inline SPUnit const & -sp_unit_get_by_id(SPUnitId const id) -{ - /* inline because the compiler should optimize away the g_return_val_if_fail test in the - usual case that the argument value is known at compile-time, leaving just - "return sp_units[constant]". */ - unsigned const ix = unsigned(id); - g_return_val_if_fail(ix <= sp_max_unit_id, sp_units[SP_UNIT_PX]); - return sp_units[ix]; -} - -#define SP_PS_UNIT (&sp_unit_get_by_id(SP_UNIT_PT)) - - -/** Used solely by units-test.cpp. */ -bool sp_units_table_sane(); - -#define SP_UNITS_ALL (SP_UNIT_DIMENSIONLESS | SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE | SP_UNIT_VOLATILE) - -GSList *sp_unit_get_list (guint bases); -void sp_unit_free_list (GSList *units); - -/* These are pure utility */ -/* Return TRUE if conversion is possible, FALSE if unit bases differ */ -gboolean sp_convert_distance (gdouble *distance, const SPUnit *from, const SPUnit *to); - -/* If either one is NULL, transconverting to/from that base fails */ -/* Generic conversion between volatile units would be useless anyways */ -gdouble sp_convert_distance_full(gdouble const from_dist, SPUnit const &from, SPUnit const &to); - -/* Some more convenience */ -gdouble sp_units_get_pixels(gdouble const units, SPUnit const &unit); -gdouble sp_pixels_get_units(gdouble const pixels, SPUnit const &unit); - -double angle_to_compass(double angle); -double angle_from_compass(double angle); - -#endif diff --git a/src/ui/widget/registered-widget.h b/src/ui/widget/registered-widget.h index 491ca6050..53d53345a 100644 --- a/src/ui/widget/registered-widget.h +++ b/src/ui/widget/registered-widget.h @@ -32,7 +32,6 @@ #include -struct SPUnit; class SPDocument; namespace Gtk { -- cgit v1.2.3 From 86abdc99654356a2047571e907b933505dbfab76 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Sat, 20 Jul 2013 14:45:18 -0400 Subject: Add string output functions for units. (bzr r12380.1.46) --- src/util/units.cpp | 13 +++++++++++++ src/util/units.h | 3 +++ 2 files changed, 16 insertions(+) (limited to 'src') diff --git a/src/util/units.cpp b/src/util/units.cpp index dcb3ae4b1..01424520b 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -15,6 +15,7 @@ #include #include +#include #include #include @@ -501,6 +502,18 @@ double Quantity::value(const Glib::ustring u) const return value(unit_table.getUnit(u)); } +/** Return a printable string of the value in the specified unit. */ +Glib::ustring Quantity::string(const Unit &u) const { + return Glib::ustring::format(std::fixed, std::setprecision(2), value(u)) + " " + unit->abbr; +} +Glib::ustring Quantity::string(const Glib::ustring u) const { + static UnitTable unit_table; + return string(unit_table.getUnit(u)); +} +Glib::ustring Quantity::string() const { + return string(*unit); +} + /** Convert distances. */ double Quantity::convert(const double from_dist, const Unit &from, const Unit &to) { diff --git a/src/util/units.h b/src/util/units.h index 392e51e7a..0bbe604ef 100644 --- a/src/util/units.h +++ b/src/util/units.h @@ -94,6 +94,9 @@ public: bool compatibleWith(const Glib::ustring u) const; double value(const Unit &u) const; double value(const Glib::ustring u) const; + Glib::ustring string(const Unit &u) const; + Glib::ustring string(const Glib::ustring u) const; + Glib::ustring string() const; static double convert(const double from_dist, const Unit &from, const Unit &to); static double convert(const double from_dist, const Glib::ustring from, const Unit &to); -- cgit v1.2.3 From fdf69629c66f6c1a69d88a00bb6c1311c97b631b Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Sat, 20 Jul 2013 15:08:31 -0400 Subject: Ported away from and removed "sp-metrics.*". (bzr r12380.1.47) --- src/CMakeLists.txt | 2 - src/Makefile_insert | 1 - src/arc-context.cpp | 7 +- src/box3d-context.cpp | 1 - src/desktop-events.cpp | 1 - src/doxygen-main.cpp | 2 - src/flood-context.cpp | 1 - src/live_effects/lpe-path_length.cpp | 1 - src/pen-context.cpp | 4 +- src/rect-context.cpp | 7 +- src/seltrans.cpp | 13 ++-- src/sp-guide.cpp | 9 ++- src/sp-metrics.cpp | 120 ----------------------------------- src/sp-metrics.h | 20 ------ src/sp-text.cpp | 4 +- src/spiral-context.cpp | 4 +- src/star-context.cpp | 4 +- src/text-context.cpp | 7 +- src/ui/tool/node.cpp | 18 ++++-- 19 files changed, 44 insertions(+), 182 deletions(-) delete mode 100644 src/sp-metrics.cpp delete mode 100644 src/sp-metrics.h (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fa54940db..f975f16bf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -46,7 +46,6 @@ set(sp_SRC sp-mesh-patch.cpp sp-mesh-row.cpp sp-metadata.cpp - sp-metrics.cpp sp-missing-glyph.cpp sp-namedview.cpp sp-object-group.cpp @@ -137,7 +136,6 @@ set(sp_SRC sp-mesh-row.h sp-metadata.h sp-metric.h - sp-metrics.h sp-missing-glyph.h sp-namedview.h sp-object-group.h diff --git a/src/Makefile_insert b/src/Makefile_insert index 88f809b52..ba14056e5 100644 --- a/src/Makefile_insert +++ b/src/Makefile_insert @@ -200,7 +200,6 @@ ink_common_sources += \ sp-mesh-row-fns.h \ sp-mesh-row.cpp sp-mesh-row.h \ sp-metric.h \ - sp-metrics.cpp sp-metrics.h \ sp-missing-glyph.cpp sp-missing-glyph.h \ sp-namedview.cpp sp-namedview.h \ sp-object.cpp sp-object.h \ diff --git a/src/arc-context.cpp b/src/arc-context.cpp index 34e4bbeab..115f45493 100644 --- a/src/arc-context.cpp +++ b/src/arc-context.cpp @@ -32,7 +32,6 @@ #include "desktop-handles.h" #include "snap.h" #include "pixmaps/cursor-ellipse.xpm" -#include "sp-metrics.h" #include "xml/repr.h" #include "xml/node-event-vector.h" #include "preferences.h" @@ -450,8 +449,10 @@ static void sp_arc_drag(SPArcContext *ac, Geom::Point pt, guint state) double rdimx = r.dimensions()[Geom::X]; double rdimy = r.dimensions()[Geom::Y]; - GString *xs = SP_PX_TO_METRIC_STRING(rdimx, desktop->namedview->getDefaultMetric()); - GString *ys = SP_PX_TO_METRIC_STRING(rdimy, desktop->namedview->getDefaultMetric()); + Inkscape::Util::Quantity rdimx_q = Inkscape::Util::Quantity(rdimx, "px"); + Inkscape::Util::Quantity rdimy_q = Inkscape::Util::Quantity(rdimy, "px"); + GString *xs = g_string_new(rdimx_q.string(*desktop->namedview->doc_units).c_str()); + GString *ys = g_string_new(rdimy_q.string(*desktop->namedview->doc_units).c_str()); if (state & GDK_CONTROL_MASK) { int ratio_x, ratio_y; if (fabs (rdimx) > fabs (rdimy)) { diff --git a/src/box3d-context.cpp b/src/box3d-context.cpp index a55aba00d..7491520de 100644 --- a/src/box3d-context.cpp +++ b/src/box3d-context.cpp @@ -35,7 +35,6 @@ #include "pixmaps/cursor-3dbox.xpm" #include "box3d.h" #include "box3d-context.h" -#include "sp-metrics.h" #include #include "xml/repr.h" #include "xml/node-event-vector.h" diff --git a/src/desktop-events.cpp b/src/desktop-events.cpp index 473ccfa9f..5cb26abc0 100644 --- a/src/desktop-events.cpp +++ b/src/desktop-events.cpp @@ -39,7 +39,6 @@ #include "snap.h" #include "display/sp-canvas.h" #include "sp-guide.h" -#include "sp-metrics.h" #include "sp-namedview.h" #include "tools-switch.h" #include "verbs.h" diff --git a/src/doxygen-main.cpp b/src/doxygen-main.cpp index 04e5ab33e..d254299c8 100644 --- a/src/doxygen-main.cpp +++ b/src/doxygen-main.cpp @@ -334,8 +334,6 @@ namespace XML {} * * Inkscape::GC * - * [\ref sp-metrics.cpp, \ref sp-metrics.h] - * * [\ref prefs-utils.cpp] [\ref print.cpp] * * - Inkscape::GZipBuffer [\ref streams-gzip.h] diff --git a/src/flood-context.cpp b/src/flood-context.cpp index 8fde11f88..a719f1202 100644 --- a/src/flood-context.cpp +++ b/src/flood-context.cpp @@ -54,7 +54,6 @@ #include "sp-defs.h" #include "sp-item.h" #include "splivarot.h" -#include "sp-metrics.h" #include "sp-namedview.h" #include "sp-object.h" #include "sp-path.h" diff --git a/src/live_effects/lpe-path_length.cpp b/src/live_effects/lpe-path_length.cpp index 504fb53c0..4ca380c15 100644 --- a/src/live_effects/lpe-path_length.cpp +++ b/src/live_effects/lpe-path_length.cpp @@ -14,7 +14,6 @@ #include #include "live_effects/lpe-path_length.h" -#include "sp-metrics.h" #include "util/units.h" #include "2geom/sbasis-geometric.h" diff --git a/src/pen-context.cpp b/src/pen-context.cpp index eac2ce5d1..69abf3513 100644 --- a/src/pen-context.cpp +++ b/src/pen-context.cpp @@ -22,7 +22,6 @@ #include "pen-context.h" #include "sp-namedview.h" -#include "sp-metrics.h" #include "desktop.h" #include "desktop-handles.h" #include "selection.h" @@ -1184,7 +1183,8 @@ static void spdc_pen_set_angle_distance_status_message(SPPenContext *const pc, G SPDesktop *desktop = SP_EVENT_CONTEXT(pc)->desktop; Geom::Point rel = p - pc->p[pc_point_to_compare]; - GString *dist = SP_PX_TO_METRIC_STRING(Geom::L2(rel), desktop->namedview->getDefaultMetric()); + Inkscape::Util::Quantity q = Inkscape::Util::Quantity(Geom::L2(rel), "px"); + GString *dist = g_string_new(q.string(*desktop->namedview->doc_units).c_str()); double angle = atan2(rel[Geom::Y], rel[Geom::X]) * 180 / M_PI; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); if (prefs->getBool("/options/compassangledisplay/value", 0) != 0) { diff --git a/src/rect-context.cpp b/src/rect-context.cpp index 06745564f..17675745f 100644 --- a/src/rect-context.cpp +++ b/src/rect-context.cpp @@ -35,7 +35,6 @@ #include "message-context.h" #include "pixmaps/cursor-rect.xpm" #include "rect-context.h" -#include "sp-metrics.h" #include #include "xml/repr.h" #include "xml/node-event-vector.h" @@ -483,8 +482,10 @@ static void sp_rect_drag(SPRectContext &rc, Geom::Point const pt, guint state) // status text double rdimx = r.dimensions()[Geom::X]; double rdimy = r.dimensions()[Geom::Y]; - GString *xs = SP_PX_TO_METRIC_STRING(rdimx, desktop->namedview->getDefaultMetric()); - GString *ys = SP_PX_TO_METRIC_STRING(rdimy, desktop->namedview->getDefaultMetric()); + Inkscape::Util::Quantity rdimx_q = Inkscape::Util::Quantity(rdimx, "px"); + Inkscape::Util::Quantity rdimy_q = Inkscape::Util::Quantity(rdimy, "px"); + GString *xs = g_string_new(rdimx_q.string(*desktop->namedview->doc_units).c_str()); + GString *ys = g_string_new(rdimy_q.string(*desktop->namedview->doc_units).c_str()); if (state & GDK_CONTROL_MASK) { int ratio_x, ratio_y; bool is_golden_ratio = false; diff --git a/src/seltrans.cpp b/src/seltrans.cpp index 33bfe3e4a..f614853bc 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -37,7 +37,6 @@ #include "seltrans-handles.h" #include "seltrans.h" #include "selection-chemistry.h" -#include "sp-metrics.h" #include "verbs.h" #include #include "display/sp-ctrlline.h" @@ -1273,8 +1272,10 @@ gboolean Inkscape::SelTrans::centerRequest(Geom::Point &pt, guint state) m.unSetup(); // status text - GString *xs = SP_PX_TO_METRIC_STRING(pt[Geom::X], _desktop->namedview->getDefaultMetric()); - GString *ys = SP_PX_TO_METRIC_STRING(pt[Geom::Y], _desktop->namedview->getDefaultMetric()); + Inkscape::Util::Quantity x_q = Inkscape::Util::Quantity(pt[Geom::X], "px"); + Inkscape::Util::Quantity y_q = Inkscape::Util::Quantity(pt[Geom::Y], "px"); + GString *xs = g_string_new(x_q.string(*_desktop->namedview->doc_units).c_str()); + GString *ys = g_string_new(y_q.string(*_desktop->namedview->doc_units).c_str()); _message_context.setF(Inkscape::NORMAL_MESSAGE, _("Move center to %s, %s"), xs->str, ys->str); g_string_free(xs, FALSE); g_string_free(ys, FALSE); @@ -1425,8 +1426,10 @@ void Inkscape::SelTrans::moveTo(Geom::Point const &xy, guint state) transform(move, norm); // status text - GString *xs = SP_PX_TO_METRIC_STRING(dxy[Geom::X], _desktop->namedview->getDefaultMetric()); - GString *ys = SP_PX_TO_METRIC_STRING(dxy[Geom::Y], _desktop->namedview->getDefaultMetric()); + Inkscape::Util::Quantity x_q = Inkscape::Util::Quantity(dxy[Geom::X], "px"); + Inkscape::Util::Quantity y_q = Inkscape::Util::Quantity(dxy[Geom::Y], "px"); + GString *xs = g_string_new(x_q.string(*_desktop->namedview->doc_units).c_str()); + GString *ys = g_string_new(y_q.string(*_desktop->namedview->doc_units).c_str()); _message_context.setF(Inkscape::NORMAL_MESSAGE, _("Move by %s, %s; with Ctrl to restrict to horizontal/vertical; with Shift to disable snapping"), xs->str, ys->str); g_string_free(xs, TRUE); g_string_free(ys, TRUE); diff --git a/src/sp-guide.cpp b/src/sp-guide.cpp index 48596cbc0..961e53e04 100644 --- a/src/sp-guide.cpp +++ b/src/sp-guide.cpp @@ -35,7 +35,6 @@ #include #include #include -#include "sp-metrics.h" #include "inkscape.h" #include "desktop.h" #include "sp-namedview.h" @@ -463,10 +462,10 @@ char *sp_guide_description(SPGuide const *guide, const bool verbose) } else { SPNamedView *namedview = sp_document_namedview(guide->document, NULL); - GString *position_string_x = SP_PX_TO_METRIC_STRING(guide->point_on_line[X], - namedview->getDefaultMetric()); - GString *position_string_y = SP_PX_TO_METRIC_STRING(guide->point_on_line[Y], - namedview->getDefaultMetric()); + Inkscape::Util::Quantity x_q = Inkscape::Util::Quantity(guide->point_on_line[X], "px"); + Inkscape::Util::Quantity y_q = Inkscape::Util::Quantity(guide->point_on_line[Y], "px"); + GString *position_string_x = g_string_new(x_q.string(*namedview->doc_units).c_str()); + GString *position_string_y = g_string_new(y_q.string(*namedview->doc_units).c_str()); gchar *shortcuts = g_strdup_printf("; %s", _("Shift+drag to rotate, Ctrl+drag to move origin, Del to delete")); diff --git a/src/sp-metrics.cpp b/src/sp-metrics.cpp deleted file mode 100644 index 2b421cf05..000000000 --- a/src/sp-metrics.cpp +++ /dev/null @@ -1,120 +0,0 @@ -#include "sp-metrics.h" -#include "unit-constants.h" - -/* - * SPMetric handling and stuff - * I hope this will be usefull :-) - */ - -gdouble -sp_absolute_metric_to_metric (gdouble length_src, const SPMetric metric_src, const SPMetric metric_dst) -{ - gdouble src = 1; - gdouble dst = 1; - - switch (metric_src) { - case SP_M: - src = M_PER_IN; - break; - case SP_MM: - src = MM_PER_IN; - break; - case SP_CM: - src = CM_PER_IN; - break; - case SP_IN: - src = IN_PER_IN; - break; - case SP_FT: - src = FT_PER_IN; - break; - case SP_PT: - src = PT_PER_IN; - break; - case SP_PC: - src = PC_PER_IN; - break; - case SP_PX: - src = PX_PER_IN; - break; - case SP_NONE: - src = 1; - break; - } - - switch (metric_dst) { - case SP_M: - dst = M_PER_IN; - break; - case SP_MM: - dst = MM_PER_IN; - break; - case SP_CM: - dst = CM_PER_IN; - break; - case SP_IN: - dst = IN_PER_IN; - break; - case SP_FT: - dst = FT_PER_IN; - break; - case SP_PT: - dst = PT_PER_IN; - break; - case SP_PC: - dst = PC_PER_IN; - break; - case SP_PX: - dst = PX_PER_IN; - break; - case SP_NONE: - dst = 1; - break; - } - - return length_src * (dst/src); -} - -/** - * Create a human-readable string suitable for status-bar display. - */ -GString * -sp_metric_to_metric_string(gdouble const length, - SPMetric const metric_src, SPMetric const metric_dst, - gboolean const m) -{ - gdouble const len = sp_absolute_metric_to_metric(length, metric_src, metric_dst); - GString *str = g_string_new(""); - g_string_printf(str, "%0.02f", len); - /* We need a fixed number of fractional digits, because otherwise the live statusbar display of - * lengths will be too jerky */ - - if (m) { - char const *unit_str; - switch (metric_dst) { - case SP_M: unit_str = " m"; break; - case SP_MM: unit_str = " mm"; break; - case SP_CM: unit_str = " cm"; break; - case SP_IN: unit_str = "\""; break; - case SP_PT: unit_str = " pt"; break; - case SP_PX: unit_str = " px"; break; - default: unit_str = NULL; break; - } - if (unit_str) { - g_string_append(str, unit_str); - } - } - return str; -} - - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/sp-metrics.h b/src/sp-metrics.h deleted file mode 100644 index c2f968797..000000000 --- a/src/sp-metrics.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef SP_METRICS_H -#define SP_METRICS_H - -#include -#include "sp-metric.h" - -gdouble sp_absolute_metric_to_metric (gdouble length_src, const SPMetric metric_src, const SPMetric metric_dst); -GString * sp_metric_to_metric_string (gdouble length, const SPMetric metric_src, const SPMetric metric_dst, gboolean m); - -// convenience since we mostly deal with points -#define SP_METRIC_TO_PT(l,m) sp_absolute_metric_to_metric(l,m,SP_PT); -#define SP_PT_TO_METRIC(l,m) sp_absolute_metric_to_metric(l,SP_PT,m); - -#define SP_PT_TO_METRIC_STRING(l,m) sp_metric_to_metric_string(l, SP_PT, m, TRUE) -#define SP_PT_TO_STRING(l,m) sp_metric_to_metric_string(l, SP_PT, m, FALSE) - -#define SP_PX_TO_METRIC_STRING(l,m) sp_metric_to_metric_string(l, SP_PX, m, TRUE) -#define SP_PX_TO_STRING(l,m) sp_metric_to_metric_string(l, SP_PX, m, FALSE) - -#endif diff --git a/src/sp-text.cpp b/src/sp-text.cpp index 8d42b7d59..d84bbdc6c 100644 --- a/src/sp-text.cpp +++ b/src/sp-text.cpp @@ -43,7 +43,6 @@ #include "sp-namedview.h" #include "style.h" #include "inkscape.h" -#include "sp-metrics.h" #include "xml/quote.h" #include "xml/repr.h" #include "mod360.h" @@ -392,7 +391,8 @@ static char * sp_text_description(SPItem *item) n = g_strdup(_("<no name found>")); } - GString *xs = SP_PX_TO_METRIC_STRING(style->font_size.computed, sp_desktop_namedview(SP_ACTIVE_DESKTOP)->getDefaultMetric()); + Inkscape::Util::Quantity q = Inkscape::Util::Quantity(style->font_size.computed, "px"); + GString *xs = g_string_new(q.string(*sp_desktop_namedview(SP_ACTIVE_DESKTOP)->doc_units).c_str()); char const *trunc = ""; Inkscape::Text::Layout const *layout = te_get_layout((SPItem *) item); diff --git a/src/spiral-context.cpp b/src/spiral-context.cpp index b7bf5aead..a6cdc6bc4 100644 --- a/src/spiral-context.cpp +++ b/src/spiral-context.cpp @@ -34,7 +34,6 @@ #include "message-context.h" #include "pixmaps/cursor-spiral.xpm" #include "spiral-context.h" -#include "sp-metrics.h" #include #include "xml/repr.h" #include "xml/node-event-vector.h" @@ -437,7 +436,8 @@ static void sp_spiral_drag(SPSpiralContext *sc, Geom::Point const &p, guint stat /*t0*/ sc->t0); /* status text */ - GString *rads = SP_PX_TO_METRIC_STRING(rad, desktop->namedview->getDefaultMetric()); + Inkscape::Util::Quantity q = Inkscape::Util::Quantity(rad, "px"); + GString *rads = g_string_new(q.string(*desktop->namedview->doc_units).c_str()); sc->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Spiral: radius %s, angle %5g°; with Ctrl to snap angle"), rads->str, sp_round((arg + 2.0*M_PI*spiral->revo)*180/M_PI, 0.0001)); diff --git a/src/star-context.cpp b/src/star-context.cpp index 5fb33a180..d4996e189 100644 --- a/src/star-context.cpp +++ b/src/star-context.cpp @@ -36,7 +36,6 @@ #include "desktop-style.h" #include "message-context.h" #include "pixmaps/cursor-star.xpm" -#include "sp-metrics.h" #include #include "preferences.h" #include "xml/repr.h" @@ -450,7 +449,8 @@ static void sp_star_drag(SPStarContext *sc, Geom::Point p, guint state) arg1, arg1 + M_PI / sides, sc->isflatsided, sc->rounded, sc->randomized); /* status text */ - GString *rads = SP_PX_TO_METRIC_STRING(r1, desktop->namedview->getDefaultMetric()); + Inkscape::Util::Quantity q = Inkscape::Util::Quantity(r1, "px"); + GString *rads = g_string_new(q.string(*desktop->namedview->doc_units).c_str()); sc->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE, ( sc->isflatsided? _("Polygon: radius %s, angle %5g°; with Ctrl to snap angle") diff --git a/src/text-context.cpp b/src/text-context.cpp index 862c50737..719a82156 100644 --- a/src/text-context.cpp +++ b/src/text-context.cpp @@ -42,7 +42,6 @@ #include "selection.h" #include "shape-editor.h" #include "sp-flowtext.h" -#include "sp-metrics.h" #include "sp-namedview.h" #include "sp-text.h" #include "style.h" @@ -640,8 +639,10 @@ static gint sp_text_context_root_handler(SPEventContext *const event_context, Gd gobble_motion_events(GDK_BUTTON1_MASK); // status text - GString *xs = SP_PX_TO_METRIC_STRING(fabs((p - tc->p0)[Geom::X]), desktop->namedview->getDefaultMetric()); - GString *ys = SP_PX_TO_METRIC_STRING(fabs((p - tc->p0)[Geom::Y]), desktop->namedview->getDefaultMetric()); + Inkscape::Util::Quantity x_q = Inkscape::Util::Quantity(fabs((p - tc->p0)[Geom::X]), "px"); + Inkscape::Util::Quantity y_q = Inkscape::Util::Quantity(fabs((p - tc->p0)[Geom::Y]), "px"); + GString *xs = g_string_new(x_q.string(*desktop->namedview->doc_units).c_str()); + GString *ys = g_string_new(y_q.string(*desktop->namedview->doc_units).c_str()); event_context->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Flowed text frame: %s × %s"), xs->str, ys->str); g_string_free(xs, FALSE); g_string_free(ys, FALSE); diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index dc6e0fbae..82eb697bd 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -22,7 +22,6 @@ #include "preferences.h" #include "snap.h" #include "snap-preferences.h" -#include "sp-metrics.h" #include "sp-namedview.h" #include "ui/control-manager.h" #include "ui/tool/control-point-selection.h" @@ -490,9 +489,13 @@ Glib::ustring Handle::_getDragTip(GdkEventMotion */*event*/) const double angle = Geom::angle_between(Geom::Point(-1,0), position() - _parent->position()); angle += M_PI; // angle is (-M_PI...M_PI] - offset by +pi and scale to 0...360 angle *= 360.0 / (2 * M_PI); - GString *x = SP_PX_TO_METRIC_STRING(dist[Geom::X], _desktop->namedview->getDefaultMetric()); - GString *y = SP_PX_TO_METRIC_STRING(dist[Geom::Y], _desktop->namedview->getDefaultMetric()); - GString *len = SP_PX_TO_METRIC_STRING(length(), _desktop->namedview->getDefaultMetric()); + + Inkscape::Util::Quantity x_q = Inkscape::Util::Quantity(dist[Geom::X], "px"); + Inkscape::Util::Quantity y_q = Inkscape::Util::Quantity(dist[Geom::Y], "px"); + Inkscape::Util::Quantity len_q = Inkscape::Util::Quantity(length(), "px"); + GString *x = g_string_new(x_q.string(*_desktop->namedview->doc_units).c_str()); + GString *y = g_string_new(y_q.string(*_desktop->namedview->doc_units).c_str()); + GString *len = g_string_new(len_q.string(*_desktop->namedview->doc_units).c_str()); Glib::ustring ret = format_tip(C_("Path handle tip", "Move handle by %s, %s; angle %.2f°, length %s"), x->str, y->str, angle, len->str); g_string_free(x, TRUE); @@ -1294,8 +1297,11 @@ Glib::ustring Node::_getTip(unsigned state) const Glib::ustring Node::_getDragTip(GdkEventMotion */*event*/) const { Geom::Point dist = position() - _last_drag_origin(); - GString *x = SP_PX_TO_METRIC_STRING(dist[Geom::X], _desktop->namedview->getDefaultMetric()); - GString *y = SP_PX_TO_METRIC_STRING(dist[Geom::Y], _desktop->namedview->getDefaultMetric()); + + Inkscape::Util::Quantity x_q = Inkscape::Util::Quantity(dist[Geom::X], "px"); + Inkscape::Util::Quantity y_q = Inkscape::Util::Quantity(dist[Geom::Y], "px"); + GString *x = g_string_new(x_q.string(*_desktop->namedview->doc_units).c_str()); + GString *y = g_string_new(y_q.string(*_desktop->namedview->doc_units).c_str()); Glib::ustring ret = format_tip(C_("Path node tip", "Move node by %s, %s"), x->str, y->str); g_string_free(x, TRUE); -- cgit v1.2.3 From 4deb0f64f3bdab48475819a4d236f125594244f4 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Sun, 21 Jul 2013 23:38:29 -0400 Subject: Ported "widgets/ruler.*" away from SPMetric. (bzr r12380.1.48) --- src/sp-namedview.cpp | 13 +++++++++++++ src/sp-namedview.h | 1 + src/widgets/desktop-widget.cpp | 17 +++++++++-------- src/widgets/ruler.cpp | 36 +++++++++++++++++++----------------- src/widgets/ruler.h | 11 ++++++++--- 5 files changed, 50 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp index bf3adf816..d01185981 100644 --- a/src/sp-namedview.cpp +++ b/src/sp-namedview.cpp @@ -1138,6 +1138,19 @@ SPMetric SPNamedView::getDefaultMetric() const } } +/** + * Returns namedview's default unit. + */ +Inkscape::Util::Unit const SPNamedView::getDefaultUnit() const +{ + if (doc_units) { + return *doc_units; + } else { + Inkscape::Util::UnitTable unit_table; + return *(new Inkscape::Util::Unit(unit_table.getUnit("pt"))); + } +} + /** * Returns the first grid it could find that isEnabled(). Returns NULL, if none is enabled */ diff --git a/src/sp-namedview.h b/src/sp-namedview.h index f9629f0c6..7f7e81f1f 100644 --- a/src/sp-namedview.h +++ b/src/sp-namedview.h @@ -85,6 +85,7 @@ struct SPNamedView : public SPObjectGroup { guint getViewCount(); GSList const *getViewList() const; SPMetric getDefaultMetric() const; + Inkscape::Util::Unit const getDefaultUnit() const; void translateGuides(Geom::Translate const &translation); void translateGrids(Geom::Translate const &translation); diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 56a5baf5b..863912d03 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -393,9 +393,10 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw ) GtkWidget *eventbox = gtk_event_box_new (); dtw->hruler = sp_ruler_new(GTK_ORIENTATION_HORIZONTAL); dtw->hruler_box = eventbox; - sp_ruler_set_unit(SP_RULER(dtw->hruler), SP_PT); Inkscape::Util::UnitTable unit_table; - gtk_widget_set_tooltip_text (dtw->hruler_box, gettext(unit_table.getUnit("pt").name_plural.c_str())); + Inkscape::Util::Unit pt = unit_table.getUnit("pt"); + sp_ruler_set_unit(SP_RULER(dtw->hruler), pt); + gtk_widget_set_tooltip_text (dtw->hruler_box, gettext(pt.name_plural.c_str())); gtk_container_add (GTK_CONTAINER (eventbox), dtw->hruler); g_signal_connect (G_OBJECT (eventbox), "button_press_event", G_CALLBACK (sp_dt_hruler_event), dtw); g_signal_connect (G_OBJECT (eventbox), "button_release_event", G_CALLBACK (sp_dt_hruler_event), dtw); @@ -423,8 +424,8 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw ) eventbox = gtk_event_box_new (); dtw->vruler = sp_ruler_new(GTK_ORIENTATION_VERTICAL); dtw->vruler_box = eventbox; - sp_ruler_set_unit (SP_RULER (dtw->vruler), SP_PT); - gtk_widget_set_tooltip_text (dtw->vruler_box, gettext(unit_table.getUnit("pt").name_plural.c_str())); + sp_ruler_set_unit (SP_RULER (dtw->vruler), pt); + gtk_widget_set_tooltip_text (dtw->vruler_box, gettext(pt.name_plural.c_str())); gtk_container_add (GTK_CONTAINER (eventbox), GTK_WIDGET (dtw->vruler)); #if GTK_CHECK_VERSION(3,0,0) @@ -1675,7 +1676,7 @@ SPDesktopWidget* SPDesktopWidget::createInstance(SPNamedView *namedview) { SPDesktopWidget *dtw = static_cast(g_object_new(SP_TYPE_DESKTOP_WIDGET, NULL)); - dtw->dt2r = namedview->doc_units->factor; + dtw->dt2r = 1. / namedview->doc_units->factor; dtw->ruler_origin = Geom::Point(0,0); //namedview->gridorigin; Why was the grid origin used here? @@ -1747,11 +1748,11 @@ void SPDesktopWidget::namedviewModified(SPObject *obj, guint flags) SPNamedView *nv=SP_NAMEDVIEW(obj); if (flags & SP_OBJECT_MODIFIED_FLAG) { - this->dt2r = nv->doc_units->factor; + this->dt2r = 1. / nv->doc_units->factor; this->ruler_origin = Geom::Point(0,0); //nv->gridorigin; Why was the grid origin used here? - sp_ruler_set_unit(SP_RULER (this->vruler), nv->getDefaultMetric()); - sp_ruler_set_unit(SP_RULER (this->hruler), nv->getDefaultMetric()); + sp_ruler_set_unit(SP_RULER (this->vruler), nv->getDefaultUnit()); + sp_ruler_set_unit(SP_RULER (this->hruler), nv->getDefaultUnit()); /* This loops through all the grandchildren of aux toolbox, * and for each that it finds, it performs an sp_search_by_data_recursive(), diff --git a/src/widgets/ruler.cpp b/src/widgets/ruler.cpp index c1f9be2a5..274e1df54 100644 --- a/src/widgets/ruler.cpp +++ b/src/widgets/ruler.cpp @@ -33,9 +33,9 @@ #include "widget-sizes.h" #include "ruler.h" -#include "unit-constants.h" #include "round.h" #include +#include "util/units.h" #define ROUND(x) ((int) ((x) + 0.5)) @@ -62,7 +62,7 @@ enum { typedef struct { GtkOrientation orientation; - SPMetric unit; + Inkscape::Util::Unit *unit; gdouble lower; gdouble upper; gdouble position; @@ -196,11 +196,10 @@ sp_ruler_class_init (SPRulerClass *klass) /* FIXME: Should probably use g_param_spec_enum */ g_object_class_install_property (object_class, PROP_UNIT, - g_param_spec_uint ("unit", + g_param_spec_string ("unit", _("Unit"), _("Unit of the ruler"), - 0, 8, - SP_PX, + "px", static_cast(GTK_PARAM_READWRITE))); g_object_class_install_property (object_class, @@ -259,8 +258,10 @@ sp_ruler_init (SPRuler *ruler) gtk_widget_set_has_window (GTK_WIDGET (ruler), FALSE); + Inkscape::Util::UnitTable unit_table; + priv->orientation = GTK_ORIENTATION_HORIZONTAL; - priv->unit = SP_PX; + priv->unit = new Inkscape::Util::Unit(unit_table.getUnit("px")); priv->lower = 0; priv->upper = 0; priv->position = 0; @@ -379,6 +380,8 @@ sp_ruler_set_property (GObject *object, SPRuler *ruler = SP_RULER (object); SPRulerPrivate *priv = SP_RULER_GET_PRIVATE (ruler); + Inkscape::Util::UnitTable unit_table; + switch (prop_id) { case PROP_ORIENTATION: @@ -387,7 +390,7 @@ sp_ruler_set_property (GObject *object, break; case PROP_UNIT: - sp_ruler_set_unit (ruler, static_cast(g_value_get_int (value))); + sp_ruler_set_unit (ruler, unit_table.getUnit(g_value_get_string (value))); break; case PROP_LOWER: @@ -436,7 +439,7 @@ sp_ruler_get_property (GObject *object, break; case PROP_UNIT: - g_value_set_int (value, priv->unit); + g_value_set_string (value, priv->unit->abbr.c_str()); break; case PROP_LOWER: g_value_set_double (value, priv->lower); @@ -1071,15 +1074,15 @@ sp_ruler_remove_track_widget (SPRuler *ruler, */ void sp_ruler_set_unit (SPRuler *ruler, - SPMetric unit) + const Inkscape::Util::Unit &unit) { SPRulerPrivate *priv = SP_RULER_GET_PRIVATE (ruler); g_return_if_fail (SP_IS_RULER (ruler)); - if (priv->unit != unit) + if (*priv->unit != unit) { - priv->unit = unit; + priv->unit = new Inkscape::Util::Unit(unit); g_object_notify(G_OBJECT(ruler), "unit"); gtk_widget_queue_draw (GTK_WIDGET (ruler)); @@ -1092,11 +1095,9 @@ sp_ruler_set_unit (SPRuler *ruler, * * Return value: the unit currently used in the @ruler widget. **/ -SPMetric +Inkscape::Util::Unit* sp_ruler_get_unit (SPRuler *ruler) { - g_return_val_if_fail(SP_IS_RULER(ruler), static_cast(0)); - return SP_RULER_GET_PRIVATE (ruler)->unit; } @@ -1184,10 +1185,11 @@ sp_ruler_draw_ticks (SPRuler *ruler) gint text_size; gint pos; gdouble max_size; - SPMetric unit; + Inkscape::Util::Unit *unit; SPRulerMetric ruler_metric = ruler_metric_general; /* The metric to use for this unit system */ PangoLayout *layout; PangoRectangle logical_rect, ink_rect; + Inkscape::Util::UnitTable unit_table; if (! gtk_widget_is_drawable (widget)) return; @@ -1300,7 +1302,7 @@ sp_ruler_draw_ticks (SPRuler *ruler) /* Inkscape change to ruler: Use a 1,2,4,8... scale for inches * or a 1,2,5,10... scale for everything else */ - if (sp_ruler_get_unit (ruler) == SP_IN) + if (*sp_ruler_get_unit (ruler) == unit_table.getUnit("in")) ruler_metric = ruler_metric_inches; for (scale = 0; scale < G_N_ELEMENTS (ruler_metric.ruler_scale); scale++) @@ -1319,7 +1321,7 @@ sp_ruler_draw_ticks (SPRuler *ruler) gdouble subd_incr; /* hack to get proper subdivisions at full pixels */ - if (unit == SP_PX && scale == 1 && i == 1) + if (*unit == unit_table.getUnit("px") && scale == 1 && i == 1) subd_incr = 1.0; else subd_incr = ((gdouble) ruler_metric.ruler_scale[scale] / diff --git a/src/widgets/ruler.h b/src/widgets/ruler.h index f0d866fff..08760f584 100644 --- a/src/widgets/ruler.h +++ b/src/widgets/ruler.h @@ -14,10 +14,15 @@ */ #include -#include "sp-metric.h" #include #include +namespace Inkscape { + namespace Util { + class Unit; + } +} + G_BEGIN_DECLS #define SP_TYPE_RULER (sp_ruler_get_type ()) @@ -51,8 +56,8 @@ void sp_ruler_remove_track_widget (SPRuler *ruler, GtkWidget *widget); void sp_ruler_set_unit (SPRuler *ruler, - SPMetric unit); -SPMetric sp_ruler_get_unit (SPRuler *ruler); + const Inkscape::Util::Unit &unit); +Inkscape::Util::Unit *sp_ruler_get_unit (SPRuler *ruler); void sp_ruler_set_position (SPRuler *ruler, gdouble set_position); gdouble sp_ruler_get_position (SPRuler *ruler); -- cgit v1.2.3 From 0b2190b4a186f4b1a2265c85b4baa801d49e5534 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Sun, 21 Jul 2013 23:50:53 -0400 Subject: Removed SPMetric. (bzr r12380.1.49) --- src/CMakeLists.txt | 1 - src/Makefile_insert | 1 - src/sp-metric.h | 28 ---------------------------- src/sp-namedview.cpp | 13 ------------- src/sp-namedview.h | 2 -- src/util/units.cpp | 22 ---------------------- src/util/units.h | 1 - 7 files changed, 68 deletions(-) delete mode 100644 src/sp-metric.h (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f975f16bf..b2af3809d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -135,7 +135,6 @@ set(sp_SRC sp-mesh-row-fns.h sp-mesh-row.h sp-metadata.h - sp-metric.h sp-missing-glyph.h sp-namedview.h sp-object-group.h diff --git a/src/Makefile_insert b/src/Makefile_insert index ba14056e5..32771b99f 100644 --- a/src/Makefile_insert +++ b/src/Makefile_insert @@ -199,7 +199,6 @@ ink_common_sources += \ sp-mesh-patch.cpp sp-mesh-patch.h \ sp-mesh-row-fns.h \ sp-mesh-row.cpp sp-mesh-row.h \ - sp-metric.h \ sp-missing-glyph.cpp sp-missing-glyph.h \ sp-namedview.cpp sp-namedview.h \ sp-object.cpp sp-object.h \ diff --git a/src/sp-metric.h b/src/sp-metric.h deleted file mode 100644 index 31f3330fa..000000000 --- a/src/sp-metric.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef INKSCAPE_SP_METRIC_H -#define INKSCAPE_SP_METRIC_H - -/** Known metrics so far. (I don't know why this doesn't include pica.) */ -enum SPMetric { - SP_NONE, - SP_MM, - SP_CM, - SP_IN, - SP_FT, - SP_PT, - SP_PC, - SP_PX, - SP_M -}; - -#endif /* !INKSCAPE_SP_METRIC_H */ - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp index d01185981..dde205eed 100644 --- a/src/sp-namedview.cpp +++ b/src/sp-namedview.cpp @@ -1125,19 +1125,6 @@ double SPNamedView::getMarginLength(gchar const * const key, return value; } - -/** - * Returns namedview's default metric. - */ -SPMetric SPNamedView::getDefaultMetric() const -{ - if (doc_units) { - return (SPMetric) doc_units->metric(); - } else { - return SP_PT; - } -} - /** * Returns namedview's default unit. */ diff --git a/src/sp-namedview.h b/src/sp-namedview.h index 7f7e81f1f..26febd7d3 100644 --- a/src/sp-namedview.h +++ b/src/sp-namedview.h @@ -21,7 +21,6 @@ #define SP_IS_NAMEDVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), SP_TYPE_NAMEDVIEW)) #include "sp-object-group.h" -#include "sp-metric.h" #include "snap.h" #include "document.h" #include "util/units.h" @@ -84,7 +83,6 @@ struct SPNamedView : public SPObjectGroup { gchar const *getName() const; guint getViewCount(); GSList const *getViewList() const; - SPMetric getDefaultMetric() const; Inkscape::Util::Unit const getDefaultUnit() const; void translateGuides(Geom::Translate const &translation); diff --git a/src/util/units.cpp b/src/util/units.cpp index 01424520b..582c52090 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -187,28 +187,6 @@ int Unit::svgUnit() const return 0; } -/** Temporary - get metric. */ -int Unit::metric() const -{ - if (!abbr.compare("mm")) - return 1; - if (!abbr.compare("cm")) - return 2; - if (!abbr.compare("in")) - return 3; - if (!abbr.compare("ft")) - return 4; - if (!abbr.compare("pt")) - return 5; - if (!abbr.compare("pc")) - return 6; - if (!abbr.compare("px")) - return 7; - if (!abbr.compare("m")) - return 8; - return 0; -} - UnitTable::UnitTable() { // if we swich to the xml file, don't forget to force locale to 'C' diff --git a/src/util/units.h b/src/util/units.h index 0bbe604ef..99ba93c6b 100644 --- a/src/util/units.h +++ b/src/util/units.h @@ -80,7 +80,6 @@ class Unit { // temporary int svgUnit() const; - int metric() const; }; class Quantity { -- cgit v1.2.3 From eb7b26af09df66f30ba50058e9e4a583028cd81a Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Tue, 23 Jul 2013 12:54:01 +0200 Subject: Remove the disabled script dialog and the nonfunctional Java binding (bzr r12428) --- src/CMakeLists.txt | 1 - src/Makefile.am | 6 - src/bind/CMakeLists.txt | 18 - src/bind/DomStub.java | 299 --- src/bind/Makefile_insert | 11 - src/bind/dobinding.cpp | 251 --- src/bind/java/org/inkscape/cmn/BaseInterface.java | 85 - src/bind/java/org/inkscape/cmn/BaseObject.java | 81 - src/bind/java/org/inkscape/cmn/Gateway.java | 346 ---- src/bind/java/org/inkscape/cmn/Resource.java | 66 - src/bind/java/org/inkscape/dom/AttrImpl.java | 58 - .../java/org/inkscape/dom/CDATASectionImpl.java | 37 - .../java/org/inkscape/dom/CharacterDataImpl.java | 70 - src/bind/java/org/inkscape/dom/CommentImpl.java | 37 - src/bind/java/org/inkscape/dom/DOMBase.java | 72 - .../org/inkscape/dom/DOMConfigurationImpl.java | 53 - .../java/org/inkscape/dom/DOMErrorHandlerImpl.java | 38 - src/bind/java/org/inkscape/dom/DOMErrorImpl.java | 48 - .../org/inkscape/dom/DOMImplementationImpl.java | 60 - .../inkscape/dom/DOMImplementationListImpl.java | 43 - .../inkscape/dom/DOMImplementationSourceImpl.java | 41 - src/bind/java/org/inkscape/dom/DOMLocatorImpl.java | 48 - .../java/org/inkscape/dom/DOMStringListImpl.java | 43 - .../org/inkscape/dom/DocumentFragmentImpl.java | 36 - src/bind/java/org/inkscape/dom/DocumentImpl.java | 138 -- .../java/org/inkscape/dom/DocumentTypeImpl.java | 52 - src/bind/java/org/inkscape/dom/ElementImpl.java | 111 -- src/bind/java/org/inkscape/dom/EntityImpl.java | 49 - .../java/org/inkscape/dom/EntityReferenceImpl.java | 37 - src/bind/java/org/inkscape/dom/NameListImpl.java | 46 - .../java/org/inkscape/dom/NamedNodeMapImpl.java | 65 - src/bind/java/org/inkscape/dom/NodeImpl.java | 139 -- src/bind/java/org/inkscape/dom/NodeListImpl.java | 41 - src/bind/java/org/inkscape/dom/NotationImpl.java | 41 - .../inkscape/dom/ProcessingInstructionImpl.java | 46 - src/bind/java/org/inkscape/dom/TextImpl.java | 52 - src/bind/java/org/inkscape/dom/TypeInfoImpl.java | 44 - .../java/org/inkscape/dom/UserDataHandlerImpl.java | 45 - .../org/inkscape/dom/css/CSS2PropertiesImpl.java | 527 ------ .../org/inkscape/dom/css/CSSCharsetRuleImpl.java | 44 - .../org/inkscape/dom/css/CSSFontFaceRuleImpl.java | 43 - .../org/inkscape/dom/css/CSSImportRuleImpl.java | 48 - .../org/inkscape/dom/css/CSSMediaRuleImpl.java | 53 - .../java/org/inkscape/dom/css/CSSPageRuleImpl.java | 46 - .../inkscape/dom/css/CSSPrimitiveValueImpl.java | 68 - .../java/org/inkscape/dom/css/CSSRuleImpl.java | 51 - .../java/org/inkscape/dom/css/CSSRuleListImpl.java | 44 - .../inkscape/dom/css/CSSStyleDeclarationImpl.java | 66 - .../org/inkscape/dom/css/CSSStyleRuleImpl.java | 47 - .../org/inkscape/dom/css/CSSStyleSheetImpl.java | 55 - .../org/inkscape/dom/css/CSSUnknownRuleImpl.java | 37 - .../java/org/inkscape/dom/css/CSSValueImpl.java | 46 - .../org/inkscape/dom/css/CSSValueListImpl.java | 45 - .../java/org/inkscape/dom/css/CounterImpl.java | 44 - .../inkscape/dom/css/DOMImplementationCSSImpl.java | 47 - .../java/org/inkscape/dom/css/DocumentCSSImpl.java | 47 - .../dom/css/ElementCSSInlineStyleImpl.java | 43 - .../java/org/inkscape/dom/css/RGBColorImpl.java | 45 - src/bind/java/org/inkscape/dom/css/RectImpl.java | 48 - .../java/org/inkscape/dom/css/ViewCSSImpl.java | 46 - .../org/inkscape/dom/events/CustomEventImpl.java | 46 - .../org/inkscape/dom/events/DocumentEventImpl.java | 48 - .../java/org/inkscape/dom/events/EventImpl.java | 74 - .../org/inkscape/dom/events/EventListenerImpl.java | 41 - .../org/inkscape/dom/events/EventTargetImpl.java | 71 - .../org/inkscape/dom/events/KeyboardEventImpl.java | 70 - .../org/inkscape/dom/events/MouseEventImpl.java | 96 - .../org/inkscape/dom/events/MutationEventImpl.java | 67 - .../inkscape/dom/events/MutationNameEventImpl.java | 58 - .../org/inkscape/dom/events/TextEventImpl.java | 55 - .../java/org/inkscape/dom/events/UIEventImpl.java | 56 - .../smil/ElementExclusiveTimeContainerImpl.java | 50 - .../org/inkscape/dom/smil/ElementLayoutImpl.java | 50 - .../dom/smil/ElementParallelTimeContainerImpl.java | 47 - .../smil/ElementSequentialTimeContainerImpl.java | 37 - .../inkscape/dom/smil/ElementSyncBehaviorImpl.java | 53 - .../dom/smil/ElementTargetAttributesImpl.java | 46 - .../org/inkscape/dom/smil/ElementTestImpl.java | 73 - .../dom/smil/ElementTimeContainerImpl.java | 43 - .../inkscape/dom/smil/ElementTimeControlImpl.java | 45 - .../org/inkscape/dom/smil/ElementTimeImpl.java | 95 - .../dom/smil/ElementTimeManipulationImpl.java | 60 - .../dom/smil/SMILAnimateColorElementImpl.java | 37 - .../inkscape/dom/smil/SMILAnimateElementImpl.java | 37 - .../dom/smil/SMILAnimateMotionElementImpl.java | 46 - .../org/inkscape/dom/smil/SMILAnimationImpl.java | 153 -- .../org/inkscape/dom/smil/SMILDocumentImpl.java | 103 - .../org/inkscape/dom/smil/SMILElementImpl.java | 42 - .../inkscape/dom/smil/SMILLayoutElementImpl.java | 43 - .../inkscape/dom/smil/SMILMediaElementImpl.java | 152 -- .../org/inkscape/dom/smil/SMILRefElementImpl.java | 37 - .../inkscape/dom/smil/SMILRegionElementImpl.java | 76 - .../inkscape/dom/smil/SMILRegionInterfaceImpl.java | 42 - .../dom/smil/SMILRootLayoutElementImpl.java | 67 - .../org/inkscape/dom/smil/SMILSetElementImpl.java | 122 -- .../inkscape/dom/smil/SMILSwitchElementImpl.java | 40 - .../dom/smil/SMILTopLayoutElementImpl.java | 66 - .../java/org/inkscape/dom/smil/TimeEventImpl.java | 49 - src/bind/java/org/inkscape/dom/smil/TimeImpl.java | 70 - .../java/org/inkscape/dom/smil/TimeListImpl.java | 43 - .../dom/stylesheets/DocumentStyleImpl.java | 43 - .../inkscape/dom/stylesheets/LinkStyleImpl.java | 41 - .../inkscape/dom/stylesheets/MediaListImpl.java | 53 - .../inkscape/dom/stylesheets/StyleSheetImpl.java | 56 - .../dom/stylesheets/StyleSheetListImpl.java | 42 - .../org/inkscape/dom/svg/GetSVGDocumentImpl.java | 43 - .../java/org/inkscape/dom/svg/SVGAElementImpl.java | 176 -- .../dom/svg/SVGAltGlyphDefElementImpl.java | 36 - .../inkscape/dom/svg/SVGAltGlyphElementImpl.java | 60 - .../dom/svg/SVGAltGlyphItemElementImpl.java | 36 - .../java/org/inkscape/dom/svg/SVGAngleImpl.java | 50 - .../dom/svg/SVGAnimateColorElementImpl.java | 36 - .../inkscape/dom/svg/SVGAnimateElementImpl.java | 35 - .../dom/svg/SVGAnimateMotionElementImpl.java | 35 - .../dom/svg/SVGAnimateTransformElementImpl.java | 35 - .../org/inkscape/dom/svg/SVGAnimatedAngleImpl.java | 43 - .../inkscape/dom/svg/SVGAnimatedBooleanImpl.java | 46 - .../dom/svg/SVGAnimatedEnumerationImpl.java | 45 - .../inkscape/dom/svg/SVGAnimatedIntegerImpl.java | 46 - .../inkscape/dom/svg/SVGAnimatedLengthImpl.java | 44 - .../dom/svg/SVGAnimatedLengthListImpl.java | 42 - .../inkscape/dom/svg/SVGAnimatedNumberImpl.java | 45 - .../dom/svg/SVGAnimatedNumberListImpl.java | 43 - .../inkscape/dom/svg/SVGAnimatedPathDataImpl.java | 46 - .../inkscape/dom/svg/SVGAnimatedPointsImpl.java | 43 - .../svg/SVGAnimatedPreserveAspectRatioImpl.java | 39 - .../org/inkscape/dom/svg/SVGAnimatedRectImpl.java | 38 - .../inkscape/dom/svg/SVGAnimatedStringImpl.java | 39 - .../dom/svg/SVGAnimatedTransformListImpl.java | 39 - .../inkscape/dom/svg/SVGAnimationElementImpl.java | 132 -- .../java/org/inkscape/dom/svg/SVGCSSRuleImpl.java | 39 - .../org/inkscape/dom/svg/SVGCircleElementImpl.java | 172 -- .../inkscape/dom/svg/SVGClipPathElementImpl.java | 134 -- .../java/org/inkscape/dom/svg/SVGColorImpl.java | 54 - .../dom/svg/SVGColorProfileElementImpl.java | 68 - .../inkscape/dom/svg/SVGColorProfileRuleImpl.java | 53 - .../SVGComponentTransferFunctionElementImpl.java | 50 - .../org/inkscape/dom/svg/SVGCursorElementImpl.java | 84 - .../dom/svg/SVGDefinitionSrcElementImpl.java | 36 - .../org/inkscape/dom/svg/SVGDefsElementImpl.java | 165 -- .../org/inkscape/dom/svg/SVGDescElementImpl.java | 82 - .../java/org/inkscape/dom/svg/SVGDocumentImpl.java | 65 - .../java/org/inkscape/dom/svg/SVGElementImpl.java | 53 - .../inkscape/dom/svg/SVGElementInstanceImpl.java | 52 - .../dom/svg/SVGElementInstanceListImpl.java | 42 - .../inkscape/dom/svg/SVGEllipseElementImpl.java | 172 -- .../java/org/inkscape/dom/svg/SVGEventImpl.java | 40 - .../dom/svg/SVGExternalResourcesRequiredImpl.java | 44 - .../inkscape/dom/svg/SVGFEBlendElementImpl.java | 84 - .../dom/svg/SVGFEColorMatrixElementImpl.java | 84 - .../dom/svg/SVGFEComponentTransferElementImpl.java | 79 - .../dom/svg/SVGFECompositeElementImpl.java | 93 - .../dom/svg/SVGFEConvolveMatrixElementImpl.java | 99 - .../dom/svg/SVGFEDiffuseLightingElementImpl.java | 86 - .../dom/svg/SVGFEDisplacementMapElementImpl.java | 81 - .../dom/svg/SVGFEDistantLightElementImpl.java | 45 - .../inkscape/dom/svg/SVGFEFloodElementImpl.java | 79 - .../inkscape/dom/svg/SVGFEFuncAElementImpl.java | 39 - .../inkscape/dom/svg/SVGFEFuncBElementImpl.java | 39 - .../inkscape/dom/svg/SVGFEFuncGElementImpl.java | 39 - .../inkscape/dom/svg/SVGFEFuncRElementImpl.java | 40 - .../dom/svg/SVGFEGaussianBlurElementImpl.java | 85 - .../inkscape/dom/svg/SVGFEImageElementImpl.java | 116 -- .../inkscape/dom/svg/SVGFEMergeElementImpl.java | 74 - .../dom/svg/SVGFEMergeNodeElementImpl.java | 44 - .../dom/svg/SVGFEMorphologyElementImpl.java | 78 - .../inkscape/dom/svg/SVGFEOffsetElementImpl.java | 79 - .../dom/svg/SVGFEPointLightElementImpl.java | 44 - .../dom/svg/SVGFESpecularLightingElementImpl.java | 81 - .../dom/svg/SVGFESpotLightElementImpl.java | 49 - .../org/inkscape/dom/svg/SVGFETileElementImpl.java | 75 - .../dom/svg/SVGFETurbulenceElementImpl.java | 85 - .../org/inkscape/dom/svg/SVGFilterElementImpl.java | 106 -- .../SVGFilterPrimitiveStandardAttributesImpl.java | 47 - .../org/inkscape/dom/svg/SVGFitToViewBoxImpl.java | 46 - .../org/inkscape/dom/svg/SVGFontElementImpl.java | 69 - .../inkscape/dom/svg/SVGFontFaceElementImpl.java | 39 - .../dom/svg/SVGFontFaceFormatElementImpl.java | 38 - .../dom/svg/SVGFontFaceNameElementImpl.java | 39 - .../dom/svg/SVGFontFaceSrcElementImpl.java | 38 - .../dom/svg/SVGFontFaceUriElementImpl.java | 38 - .../dom/svg/SVGForeignObjectElementImpl.java | 169 -- .../java/org/inkscape/dom/svg/SVGGElementImpl.java | 166 -- .../org/inkscape/dom/svg/SVGGlyphElementImpl.java | 64 - .../inkscape/dom/svg/SVGGlyphRefElementImpl.java | 90 - .../inkscape/dom/svg/SVGGradientElementImpl.java | 87 - .../org/inkscape/dom/svg/SVGHKernElementImpl.java | 38 - .../java/org/inkscape/dom/svg/SVGICCColorImpl.java | 44 - .../org/inkscape/dom/svg/SVGImageElementImpl.java | 178 -- .../org/inkscape/dom/svg/SVGLangSpaceImpl.java | 47 - .../java/org/inkscape/dom/svg/SVGLengthImpl.java | 52 - .../org/inkscape/dom/svg/SVGLengthListImpl.java | 56 - .../org/inkscape/dom/svg/SVGLineElementImpl.java | 170 -- .../dom/svg/SVGLinearGradientElementImpl.java | 45 - .../org/inkscape/dom/svg/SVGLocatableImpl.java | 51 - .../org/inkscape/dom/svg/SVGMPathElementImpl.java | 63 - .../org/inkscape/dom/svg/SVGMarkerElementImpl.java | 107 -- .../org/inkscape/dom/svg/SVGMaskElementImpl.java | 108 -- .../java/org/inkscape/dom/svg/SVGMatrixImpl.java | 72 - .../inkscape/dom/svg/SVGMetadataElementImpl.java | 38 - .../dom/svg/SVGMissingGlyphElementImpl.java | 61 - .../java/org/inkscape/dom/svg/SVGNumberImpl.java | 42 - .../org/inkscape/dom/svg/SVGNumberListImpl.java | 58 - .../java/org/inkscape/dom/svg/SVGPaintImpl.java | 49 - .../org/inkscape/dom/svg/SVGPathElementImpl.java | 215 --- .../org/inkscape/dom/svg/SVGPathSegArcAbsImpl.java | 61 - .../org/inkscape/dom/svg/SVGPathSegArcRelImpl.java | 61 - .../inkscape/dom/svg/SVGPathSegClosePathImpl.java | 38 - .../dom/svg/SVGPathSegCurvetoCubicAbsImpl.java | 58 - .../dom/svg/SVGPathSegCurvetoCubicRelImpl.java | 58 - .../svg/SVGPathSegCurvetoCubicSmoothAbsImpl.java | 52 - .../svg/SVGPathSegCurvetoCubicSmoothRelImpl.java | 52 - .../dom/svg/SVGPathSegCurvetoQuadraticAbsImpl.java | 52 - .../dom/svg/SVGPathSegCurvetoQuadraticRelImpl.java | 52 - .../SVGPathSegCurvetoQuadraticSmoothAbsImpl.java | 46 - .../SVGPathSegCurvetoQuadraticSmoothRelImpl.java | 46 - .../java/org/inkscape/dom/svg/SVGPathSegImpl.java | 38 - .../inkscape/dom/svg/SVGPathSegLinetoAbsImpl.java | 46 - .../dom/svg/SVGPathSegLinetoHorizontalAbsImpl.java | 43 - .../dom/svg/SVGPathSegLinetoHorizontalRelImpl.java | 43 - .../inkscape/dom/svg/SVGPathSegLinetoRelImpl.java | 46 - .../dom/svg/SVGPathSegLinetoVerticalAbsImpl.java | 43 - .../dom/svg/SVGPathSegLinetoVerticalRelImpl.java | 43 - .../org/inkscape/dom/svg/SVGPathSegListImpl.java | 57 - .../inkscape/dom/svg/SVGPathSegMovetoAbsImpl.java | 46 - .../inkscape/dom/svg/SVGPathSegMovetoRelImpl.java | 46 - .../inkscape/dom/svg/SVGPatternElementImpl.java | 135 -- .../java/org/inkscape/dom/svg/SVGPointImpl.java | 49 - .../org/inkscape/dom/svg/SVGPointListImpl.java | 56 - .../inkscape/dom/svg/SVGPolygonElementImpl.java | 177 -- .../inkscape/dom/svg/SVGPolylineElementImpl.java | 175 -- .../dom/svg/SVGPreserveAspectRatioImpl.java | 44 - .../dom/svg/SVGRadialGradientElementImpl.java | 46 - .../org/inkscape/dom/svg/SVGRectElementImpl.java | 170 -- .../java/org/inkscape/dom/svg/SVGRectImpl.java | 49 - .../inkscape/dom/svg/SVGRenderingIntentImpl.java | 36 - .../org/inkscape/dom/svg/SVGSVGElementImpl.java | 280 --- .../org/inkscape/dom/svg/SVGScriptElementImpl.java | 70 - .../org/inkscape/dom/svg/SVGSetElementImpl.java | 38 - .../org/inkscape/dom/svg/SVGStopElementImpl.java | 62 - .../org/inkscape/dom/svg/SVGStringListImpl.java | 56 - .../java/org/inkscape/dom/svg/SVGStylableImpl.java | 47 - .../org/inkscape/dom/svg/SVGStyleElementImpl.java | 52 - .../org/inkscape/dom/svg/SVGSwitchElementImpl.java | 166 -- .../org/inkscape/dom/svg/SVGSymbolElementImpl.java | 161 -- .../org/inkscape/dom/svg/SVGTRefElementImpl.java | 54 - .../org/inkscape/dom/svg/SVGTSpanElementImpl.java | 38 - .../java/org/inkscape/dom/svg/SVGTestsImpl.java | 45 - .../dom/svg/SVGTextContentElementImpl.java | 161 -- .../org/inkscape/dom/svg/SVGTextElementImpl.java | 69 - .../inkscape/dom/svg/SVGTextPathElementImpl.java | 57 - .../dom/svg/SVGTextPositioningElementImpl.java | 45 - .../org/inkscape/dom/svg/SVGTitleElementImpl.java | 79 - .../org/inkscape/dom/svg/SVGTransformImpl.java | 49 - .../org/inkscape/dom/svg/SVGTransformListImpl.java | 60 - .../org/inkscape/dom/svg/SVGTransformableImpl.java | 42 - .../org/inkscape/dom/svg/SVGURIReferenceImpl.java | 42 - .../org/inkscape/dom/svg/SVGUnitTypesImpl.java | 36 - .../org/inkscape/dom/svg/SVGUseElementImpl.java | 180 -- .../org/inkscape/dom/svg/SVGVKernElementImpl.java | 38 - .../org/inkscape/dom/svg/SVGViewElementImpl.java | 77 - .../java/org/inkscape/dom/svg/SVGViewSpecImpl.java | 64 - .../org/inkscape/dom/svg/SVGZoomAndPanImpl.java | 43 - .../org/inkscape/dom/svg/SVGZoomEventImpl.java | 47 - .../org/inkscape/dom/views/AbstractViewImpl.java | 42 - .../org/inkscape/dom/views/DocumentViewImpl.java | 43 - src/bind/java/org/inkscape/script/Editor.java | 311 ---- .../java/org/inkscape/script/ScriptConsole.java | 652 ------- src/bind/java/org/inkscape/script/Terminal.java | 297 --- src/bind/java/org/w3c/dom/css/CSS2Properties.java | 1411 -------------- src/bind/java/org/w3c/dom/css/CSSCharsetRule.java | 48 - src/bind/java/org/w3c/dom/css/CSSFontFaceRule.java | 28 - src/bind/java/org/w3c/dom/css/CSSImportRule.java | 44 - src/bind/java/org/w3c/dom/css/CSSMediaRule.java | 76 - src/bind/java/org/w3c/dom/css/CSSPageRule.java | 41 - .../java/org/w3c/dom/css/CSSPrimitiveValue.java | 296 --- src/bind/java/org/w3c/dom/css/CSSRule.java | 93 - src/bind/java/org/w3c/dom/css/CSSRuleList.java | 43 - .../java/org/w3c/dom/css/CSSStyleDeclaration.java | 152 -- src/bind/java/org/w3c/dom/css/CSSStyleRule.java | 42 - src/bind/java/org/w3c/dom/css/CSSStyleSheet.java | 85 - src/bind/java/org/w3c/dom/css/CSSUnknownRule.java | 22 - src/bind/java/org/w3c/dom/css/CSSValue.java | 68 - src/bind/java/org/w3c/dom/css/CSSValueList.java | 46 - src/bind/java/org/w3c/dom/css/Counter.java | 38 - .../java/org/w3c/dom/css/DOMImplementationCSS.java | 40 - src/bind/java/org/w3c/dom/css/DocumentCSS.java | 50 - .../org/w3c/dom/css/ElementCSSInlineStyle.java | 32 - src/bind/java/org/w3c/dom/css/RGBColor.java | 47 - src/bind/java/org/w3c/dom/css/Rect.java | 44 - src/bind/java/org/w3c/dom/css/ViewCSS.java | 43 - src/bind/java/org/w3c/dom/events/CustomEvent.java | 70 - .../java/org/w3c/dom/events/DocumentEvent.java | 86 - src/bind/java/org/w3c/dom/events/Event.java | 209 --- .../java/org/w3c/dom/events/EventException.java | 41 - .../java/org/w3c/dom/events/EventListener.java | 40 - src/bind/java/org/w3c/dom/events/EventTarget.java | 202 -- .../java/org/w3c/dom/events/KeyboardEvent.java | 178 -- src/bind/java/org/w3c/dom/events/MouseEvent.java | 219 --- .../java/org/w3c/dom/events/MutationEvent.java | 160 -- .../java/org/w3c/dom/events/MutationNameEvent.java | 104 -- src/bind/java/org/w3c/dom/events/TextEvent.java | 81 - src/bind/java/org/w3c/dom/events/UIEvent.java | 82 - .../dom/smil/ElementExclusiveTimeContainer.java | 41 - src/bind/java/org/w3c/dom/smil/ElementLayout.java | 55 - .../w3c/dom/smil/ElementParallelTimeContainer.java | 40 - .../dom/smil/ElementSequentialTimeContainer.java | 21 - .../java/org/w3c/dom/smil/ElementSyncBehavior.java | 49 - .../org/w3c/dom/smil/ElementTargetAttributes.java | 38 - src/bind/java/org/w3c/dom/smil/ElementTest.java | 83 - src/bind/java/org/w3c/dom/smil/ElementTime.java | 150 -- .../org/w3c/dom/smil/ElementTimeContainer.java | 39 - .../java/org/w3c/dom/smil/ElementTimeControl.java | 103 - .../org/w3c/dom/smil/ElementTimeManipulation.java | 75 - .../org/w3c/dom/smil/SMILAnimateColorElement.java | 20 - .../java/org/w3c/dom/smil/SMILAnimateElement.java | 20 - .../org/w3c/dom/smil/SMILAnimateMotionElement.java | 41 - src/bind/java/org/w3c/dom/smil/SMILAnimation.java | 124 -- src/bind/java/org/w3c/dom/smil/SMILDocument.java | 28 - src/bind/java/org/w3c/dom/smil/SMILElement.java | 40 - .../java/org/w3c/dom/smil/SMILLayoutElement.java | 33 - .../java/org/w3c/dom/smil/SMILMediaElement.java | 157 -- src/bind/java/org/w3c/dom/smil/SMILRefElement.java | 20 - .../java/org/w3c/dom/smil/SMILRegionElement.java | 47 - .../java/org/w3c/dom/smil/SMILRegionInterface.java | 26 - .../org/w3c/dom/smil/SMILRootLayoutElement.java | 21 - src/bind/java/org/w3c/dom/smil/SMILSetElement.java | 27 - .../java/org/w3c/dom/smil/SMILSwitchElement.java | 30 - .../org/w3c/dom/smil/SMILTopLayoutElement.java | 21 - src/bind/java/org/w3c/dom/smil/Time.java | 119 -- src/bind/java/org/w3c/dom/smil/TimeEvent.java | 53 - src/bind/java/org/w3c/dom/smil/TimeList.java | 41 - .../org/w3c/dom/stylesheets/DocumentStyle.java | 34 - .../java/org/w3c/dom/stylesheets/LinkStyle.java | 31 - .../java/org/w3c/dom/stylesheets/MediaList.java | 81 - .../java/org/w3c/dom/stylesheets/StyleSheet.java | 95 - .../org/w3c/dom/stylesheets/StyleSheetList.java | 42 - src/bind/java/org/w3c/dom/svg/GetSVGDocument.java | 9 - src/bind/java/org/w3c/dom/svg/SVGAElement.java | 16 - .../org/w3c/dom/svg/SVGAltGlyphDefElement.java | 6 - .../java/org/w3c/dom/svg/SVGAltGlyphElement.java | 15 - .../org/w3c/dom/svg/SVGAltGlyphItemElement.java | 6 - src/bind/java/org/w3c/dom/svg/SVGAngle.java | 26 - .../org/w3c/dom/svg/SVGAnimateColorElement.java | 6 - .../java/org/w3c/dom/svg/SVGAnimateElement.java | 6 - .../org/w3c/dom/svg/SVGAnimateMotionElement.java | 6 - .../w3c/dom/svg/SVGAnimateTransformElement.java | 6 - .../java/org/w3c/dom/svg/SVGAnimatedAngle.java | 7 - .../java/org/w3c/dom/svg/SVGAnimatedBoolean.java | 10 - .../org/w3c/dom/svg/SVGAnimatedEnumeration.java | 10 - .../java/org/w3c/dom/svg/SVGAnimatedInteger.java | 10 - .../java/org/w3c/dom/svg/SVGAnimatedLength.java | 7 - .../org/w3c/dom/svg/SVGAnimatedLengthList.java | 7 - .../java/org/w3c/dom/svg/SVGAnimatedNumber.java | 10 - .../org/w3c/dom/svg/SVGAnimatedNumberList.java | 7 - .../java/org/w3c/dom/svg/SVGAnimatedPathData.java | 9 - .../java/org/w3c/dom/svg/SVGAnimatedPoints.java | 7 - .../dom/svg/SVGAnimatedPreserveAspectRatio.java | 7 - src/bind/java/org/w3c/dom/svg/SVGAnimatedRect.java | 7 - .../java/org/w3c/dom/svg/SVGAnimatedString.java | 10 - .../org/w3c/dom/svg/SVGAnimatedTransformList.java | 7 - .../java/org/w3c/dom/svg/SVGAnimationElement.java | 20 - src/bind/java/org/w3c/dom/svg/SVGCSSRule.java | 10 - .../java/org/w3c/dom/svg/SVGCircleElement.java | 17 - .../java/org/w3c/dom/svg/SVGClipPathElement.java | 13 - src/bind/java/org/w3c/dom/svg/SVGColor.java | 25 - .../org/w3c/dom/svg/SVGColorProfileElement.java | 19 - .../java/org/w3c/dom/svg/SVGColorProfileRule.java | 18 - .../svg/SVGComponentTransferFunctionElement.java | 21 - .../java/org/w3c/dom/svg/SVGCursorElement.java | 11 - .../org/w3c/dom/svg/SVGDefinitionSrcElement.java | 6 - src/bind/java/org/w3c/dom/svg/SVGDefsElement.java | 14 - src/bind/java/org/w3c/dom/svg/SVGDescElement.java | 8 - src/bind/java/org/w3c/dom/svg/SVGDocument.java | 15 - src/bind/java/org/w3c/dom/svg/SVGElement.java | 17 - .../java/org/w3c/dom/svg/SVGElementInstance.java | 16 - .../org/w3c/dom/svg/SVGElementInstanceList.java | 8 - .../java/org/w3c/dom/svg/SVGEllipseElement.java | 18 - src/bind/java/org/w3c/dom/svg/SVGEvent.java | 8 - src/bind/java/org/w3c/dom/svg/SVGException.java | 13 - .../w3c/dom/svg/SVGExternalResourcesRequired.java | 6 - .../java/org/w3c/dom/svg/SVGFEBlendElement.java | 18 - .../org/w3c/dom/svg/SVGFEColorMatrixElement.java | 17 - .../w3c/dom/svg/SVGFEComponentTransferElement.java | 8 - .../org/w3c/dom/svg/SVGFECompositeElement.java | 23 - .../w3c/dom/svg/SVGFEConvolveMatrixElement.java | 24 - .../w3c/dom/svg/SVGFEDiffuseLightingElement.java | 12 - .../w3c/dom/svg/SVGFEDisplacementMapElement.java | 19 - .../org/w3c/dom/svg/SVGFEDistantLightElement.java | 8 - .../java/org/w3c/dom/svg/SVGFEFloodElement.java | 8 - .../java/org/w3c/dom/svg/SVGFEFuncAElement.java | 6 - .../java/org/w3c/dom/svg/SVGFEFuncBElement.java | 6 - .../java/org/w3c/dom/svg/SVGFEFuncGElement.java | 6 - .../java/org/w3c/dom/svg/SVGFEFuncRElement.java | 6 - .../org/w3c/dom/svg/SVGFEGaussianBlurElement.java | 12 - .../java/org/w3c/dom/svg/SVGFEImageElement.java | 13 - .../java/org/w3c/dom/svg/SVGFEMergeElement.java | 7 - .../org/w3c/dom/svg/SVGFEMergeNodeElement.java | 7 - .../org/w3c/dom/svg/SVGFEMorphologyElement.java | 16 - .../java/org/w3c/dom/svg/SVGFEOffsetElement.java | 10 - .../org/w3c/dom/svg/SVGFEPointLightElement.java | 9 - .../w3c/dom/svg/SVGFESpecularLightingElement.java | 11 - .../org/w3c/dom/svg/SVGFESpotLightElement.java | 14 - .../java/org/w3c/dom/svg/SVGFETileElement.java | 8 - .../org/w3c/dom/svg/SVGFETurbulenceElement.java | 22 - .../java/org/w3c/dom/svg/SVGFilterElement.java | 21 - .../svg/SVGFilterPrimitiveStandardAttributes.java | 11 - src/bind/java/org/w3c/dom/svg/SVGFitToViewBox.java | 7 - src/bind/java/org/w3c/dom/svg/SVGFontElement.java | 8 - .../java/org/w3c/dom/svg/SVGFontFaceElement.java | 6 - .../org/w3c/dom/svg/SVGFontFaceFormatElement.java | 6 - .../org/w3c/dom/svg/SVGFontFaceNameElement.java | 6 - .../org/w3c/dom/svg/SVGFontFaceSrcElement.java | 6 - .../org/w3c/dom/svg/SVGFontFaceUriElement.java | 6 - .../org/w3c/dom/svg/SVGForeignObjectElement.java | 18 - src/bind/java/org/w3c/dom/svg/SVGGElement.java | 14 - src/bind/java/org/w3c/dom/svg/SVGGlyphElement.java | 7 - .../java/org/w3c/dom/svg/SVGGlyphRefElement.java | 28 - .../java/org/w3c/dom/svg/SVGGradientElement.java | 19 - src/bind/java/org/w3c/dom/svg/SVGHKernElement.java | 6 - src/bind/java/org/w3c/dom/svg/SVGICCColor.java | 10 - src/bind/java/org/w3c/dom/svg/SVGImageElement.java | 20 - src/bind/java/org/w3c/dom/svg/SVGLangSpace.java | 13 - src/bind/java/org/w3c/dom/svg/SVGLength.java | 32 - src/bind/java/org/w3c/dom/svg/SVGLengthList.java | 23 - src/bind/java/org/w3c/dom/svg/SVGLineElement.java | 18 - .../org/w3c/dom/svg/SVGLinearGradientElement.java | 10 - src/bind/java/org/w3c/dom/svg/SVGLocatable.java | 13 - src/bind/java/org/w3c/dom/svg/SVGMPathElement.java | 8 - .../java/org/w3c/dom/svg/SVGMarkerElement.java | 29 - src/bind/java/org/w3c/dom/svg/SVGMaskElement.java | 17 - src/bind/java/org/w3c/dom/svg/SVGMatrix.java | 39 - .../java/org/w3c/dom/svg/SVGMetadataElement.java | 6 - .../org/w3c/dom/svg/SVGMissingGlyphElement.java | 7 - src/bind/java/org/w3c/dom/svg/SVGNumber.java | 10 - src/bind/java/org/w3c/dom/svg/SVGNumberList.java | 23 - src/bind/java/org/w3c/dom/svg/SVGPaint.java | 26 - src/bind/java/org/w3c/dom/svg/SVGPathElement.java | 39 - src/bind/java/org/w3c/dom/svg/SVGPathSeg.java | 29 - .../java/org/w3c/dom/svg/SVGPathSegArcAbs.java | 29 - .../java/org/w3c/dom/svg/SVGPathSegArcRel.java | 29 - .../java/org/w3c/dom/svg/SVGPathSegClosePath.java | 6 - .../org/w3c/dom/svg/SVGPathSegCurvetoCubicAbs.java | 26 - .../org/w3c/dom/svg/SVGPathSegCurvetoCubicRel.java | 26 - .../dom/svg/SVGPathSegCurvetoCubicSmoothAbs.java | 20 - .../dom/svg/SVGPathSegCurvetoCubicSmoothRel.java | 20 - .../w3c/dom/svg/SVGPathSegCurvetoQuadraticAbs.java | 20 - .../w3c/dom/svg/SVGPathSegCurvetoQuadraticRel.java | 20 - .../svg/SVGPathSegCurvetoQuadraticSmoothAbs.java | 14 - .../svg/SVGPathSegCurvetoQuadraticSmoothRel.java | 14 - .../java/org/w3c/dom/svg/SVGPathSegLinetoAbs.java | 14 - .../w3c/dom/svg/SVGPathSegLinetoHorizontalAbs.java | 11 - .../w3c/dom/svg/SVGPathSegLinetoHorizontalRel.java | 11 - .../java/org/w3c/dom/svg/SVGPathSegLinetoRel.java | 14 - .../w3c/dom/svg/SVGPathSegLinetoVerticalAbs.java | 11 - .../w3c/dom/svg/SVGPathSegLinetoVerticalRel.java | 11 - src/bind/java/org/w3c/dom/svg/SVGPathSegList.java | 23 - .../java/org/w3c/dom/svg/SVGPathSegMovetoAbs.java | 14 - .../java/org/w3c/dom/svg/SVGPathSegMovetoRel.java | 14 - .../java/org/w3c/dom/svg/SVGPatternElement.java | 20 - src/bind/java/org/w3c/dom/svg/SVGPoint.java | 15 - src/bind/java/org/w3c/dom/svg/SVGPointList.java | 23 - .../java/org/w3c/dom/svg/SVGPolygonElement.java | 15 - .../java/org/w3c/dom/svg/SVGPolylineElement.java | 15 - .../org/w3c/dom/svg/SVGPreserveAspectRatio.java | 30 - .../org/w3c/dom/svg/SVGRadialGradientElement.java | 11 - src/bind/java/org/w3c/dom/svg/SVGRect.java | 19 - src/bind/java/org/w3c/dom/svg/SVGRectElement.java | 20 - .../java/org/w3c/dom/svg/SVGRenderingIntent.java | 12 - src/bind/java/org/w3c/dom/svg/SVGSVGElement.java | 74 - .../java/org/w3c/dom/svg/SVGScriptElement.java | 13 - src/bind/java/org/w3c/dom/svg/SVGSetElement.java | 6 - src/bind/java/org/w3c/dom/svg/SVGStopElement.java | 8 - src/bind/java/org/w3c/dom/svg/SVGStringList.java | 23 - src/bind/java/org/w3c/dom/svg/SVGStylable.java | 12 - src/bind/java/org/w3c/dom/svg/SVGStyleElement.java | 20 - .../java/org/w3c/dom/svg/SVGSwitchElement.java | 14 - .../java/org/w3c/dom/svg/SVGSymbolElement.java | 13 - src/bind/java/org/w3c/dom/svg/SVGTRefElement.java | 7 - src/bind/java/org/w3c/dom/svg/SVGTSpanElement.java | 6 - src/bind/java/org/w3c/dom/svg/SVGTests.java | 10 - .../org/w3c/dom/svg/SVGTextContentElement.java | 37 - src/bind/java/org/w3c/dom/svg/SVGTextElement.java | 7 - .../java/org/w3c/dom/svg/SVGTextPathElement.java | 19 - .../org/w3c/dom/svg/SVGTextPositioningElement.java | 11 - src/bind/java/org/w3c/dom/svg/SVGTitleElement.java | 8 - src/bind/java/org/w3c/dom/svg/SVGTransform.java | 24 - .../java/org/w3c/dom/svg/SVGTransformList.java | 25 - .../java/org/w3c/dom/svg/SVGTransformable.java | 7 - src/bind/java/org/w3c/dom/svg/SVGURIReference.java | 6 - src/bind/java/org/w3c/dom/svg/SVGUnitTypes.java | 9 - src/bind/java/org/w3c/dom/svg/SVGUseElement.java | 21 - src/bind/java/org/w3c/dom/svg/SVGVKernElement.java | 6 - src/bind/java/org/w3c/dom/svg/SVGViewElement.java | 10 - src/bind/java/org/w3c/dom/svg/SVGViewSpec.java | 13 - src/bind/java/org/w3c/dom/svg/SVGZoomAndPan.java | 15 - src/bind/java/org/w3c/dom/svg/SVGZoomEvent.java | 13 - src/bind/java/org/w3c/dom/views/AbstractView.java | 27 - src/bind/java/org/w3c/dom/views/DocumentView.java | 30 - src/bind/javabind-private.h | 147 -- src/bind/javabind.cpp | 1209 ------------ src/bind/javabind.h | 405 ---- src/bind/javainc/jni.h | 1959 -------------------- src/bind/javainc/linux/jni_md.h | 26 - src/bind/javainc/solaris/jni_md.h | 42 - src/bind/javainc/win32/jni_md.h | 37 - src/bind/makefile.in | 17 - src/check-header-compile.in | 1 - src/extension/CMakeLists.txt | 4 - src/extension/script/InkscapeScript.cpp | 223 --- src/extension/script/InkscapeScript.h | 102 - src/extension/script/Makefile_insert | 6 - src/extension/script/makefile.in | 17 - src/menus-skeleton.h | 1 - src/ui/CMakeLists.txt | 2 - src/ui/dialog/Makefile_insert | 2 - src/ui/dialog/dialog-manager.cpp | 3 - src/ui/dialog/scriptdialog.cpp | 255 --- src/ui/dialog/scriptdialog.h | 64 - src/verbs.cpp | 7 - src/verbs.h | 1 - 521 files changed, 32394 deletions(-) delete mode 100644 src/bind/CMakeLists.txt delete mode 100644 src/bind/DomStub.java delete mode 100644 src/bind/Makefile_insert delete mode 100644 src/bind/dobinding.cpp delete mode 100644 src/bind/java/org/inkscape/cmn/BaseInterface.java delete mode 100644 src/bind/java/org/inkscape/cmn/BaseObject.java delete mode 100644 src/bind/java/org/inkscape/cmn/Gateway.java delete mode 100644 src/bind/java/org/inkscape/cmn/Resource.java delete mode 100644 src/bind/java/org/inkscape/dom/AttrImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/CDATASectionImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/CharacterDataImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/CommentImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/DOMBase.java delete mode 100644 src/bind/java/org/inkscape/dom/DOMConfigurationImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/DOMErrorHandlerImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/DOMErrorImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/DOMImplementationImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/DOMImplementationListImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/DOMImplementationSourceImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/DOMLocatorImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/DOMStringListImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/DocumentFragmentImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/DocumentImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/DocumentTypeImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/ElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/EntityImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/EntityReferenceImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/NameListImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/NamedNodeMapImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/NodeImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/NodeListImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/NotationImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/ProcessingInstructionImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/TextImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/TypeInfoImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/UserDataHandlerImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/css/CSS2PropertiesImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/css/CSSCharsetRuleImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/css/CSSFontFaceRuleImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/css/CSSImportRuleImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/css/CSSMediaRuleImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/css/CSSPageRuleImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/css/CSSPrimitiveValueImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/css/CSSRuleImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/css/CSSRuleListImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/css/CSSStyleDeclarationImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/css/CSSStyleRuleImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/css/CSSStyleSheetImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/css/CSSUnknownRuleImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/css/CSSValueImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/css/CSSValueListImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/css/CounterImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/css/DOMImplementationCSSImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/css/DocumentCSSImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/css/ElementCSSInlineStyleImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/css/RGBColorImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/css/RectImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/css/ViewCSSImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/events/CustomEventImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/events/DocumentEventImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/events/EventImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/events/EventListenerImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/events/EventTargetImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/events/KeyboardEventImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/events/MouseEventImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/events/MutationEventImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/events/MutationNameEventImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/events/TextEventImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/events/UIEventImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/ElementExclusiveTimeContainerImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/ElementLayoutImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/ElementParallelTimeContainerImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/ElementSequentialTimeContainerImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/ElementSyncBehaviorImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/ElementTargetAttributesImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/ElementTestImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/ElementTimeContainerImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/ElementTimeControlImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/ElementTimeImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/ElementTimeManipulationImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/SMILAnimateColorElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/SMILAnimateElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/SMILAnimateMotionElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/SMILAnimationImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/SMILDocumentImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/SMILElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/SMILLayoutElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/SMILMediaElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/SMILRefElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/SMILRegionElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/SMILRegionInterfaceImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/SMILRootLayoutElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/SMILSetElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/SMILSwitchElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/SMILTopLayoutElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/TimeEventImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/TimeImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/smil/TimeListImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/stylesheets/DocumentStyleImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/stylesheets/LinkStyleImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/stylesheets/MediaListImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/stylesheets/StyleSheetImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/stylesheets/StyleSheetListImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/GetSVGDocumentImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGAElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGAltGlyphDefElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGAltGlyphElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGAltGlyphItemElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGAngleImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGAnimateColorElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGAnimateElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGAnimateMotionElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGAnimateTransformElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGAnimatedAngleImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGAnimatedBooleanImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGAnimatedEnumerationImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGAnimatedIntegerImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGAnimatedLengthImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGAnimatedLengthListImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGAnimatedNumberImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGAnimatedNumberListImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGAnimatedPathDataImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGAnimatedPointsImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGAnimatedPreserveAspectRatioImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGAnimatedRectImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGAnimatedStringImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGAnimatedTransformListImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGAnimationElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGCSSRuleImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGCircleElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGClipPathElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGColorImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGColorProfileElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGColorProfileRuleImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGComponentTransferFunctionElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGCursorElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGDefinitionSrcElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGDefsElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGDescElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGDocumentImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGElementInstanceImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGElementInstanceListImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGEllipseElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGEventImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGExternalResourcesRequiredImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFEBlendElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFEColorMatrixElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFEComponentTransferElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFECompositeElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFEConvolveMatrixElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFEDiffuseLightingElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFEDisplacementMapElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFEDistantLightElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFEFloodElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFEFuncAElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFEFuncBElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFEFuncGElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFEFuncRElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFEGaussianBlurElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFEImageElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFEMergeElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFEMergeNodeElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFEMorphologyElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFEOffsetElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFEPointLightElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFESpecularLightingElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFESpotLightElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFETileElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFETurbulenceElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFilterElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFilterPrimitiveStandardAttributesImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFitToViewBoxImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFontElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFontFaceElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFontFaceFormatElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFontFaceNameElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFontFaceSrcElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGFontFaceUriElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGForeignObjectElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGGElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGGlyphElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGGlyphRefElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGGradientElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGHKernElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGICCColorImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGImageElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGLangSpaceImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGLengthImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGLengthListImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGLineElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGLinearGradientElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGLocatableImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGMPathElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGMarkerElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGMaskElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGMatrixImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGMetadataElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGMissingGlyphElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGNumberImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGNumberListImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPaintImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPathElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPathSegArcAbsImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPathSegArcRelImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPathSegClosePathImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoCubicAbsImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoCubicRelImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoCubicSmoothAbsImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoCubicSmoothRelImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoQuadraticAbsImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoQuadraticRelImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoQuadraticSmoothAbsImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoQuadraticSmoothRelImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPathSegImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPathSegLinetoAbsImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPathSegLinetoHorizontalAbsImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPathSegLinetoHorizontalRelImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPathSegLinetoRelImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPathSegLinetoVerticalAbsImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPathSegLinetoVerticalRelImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPathSegListImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPathSegMovetoAbsImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPathSegMovetoRelImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPatternElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPointImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPointListImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPolygonElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPolylineElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGPreserveAspectRatioImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGRadialGradientElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGRectElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGRectImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGRenderingIntentImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGSVGElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGScriptElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGSetElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGStopElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGStringListImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGStylableImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGStyleElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGSwitchElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGSymbolElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGTRefElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGTSpanElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGTestsImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGTextContentElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGTextElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGTextPathElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGTextPositioningElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGTitleElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGTransformImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGTransformListImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGTransformableImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGURIReferenceImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGUnitTypesImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGUseElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGVKernElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGViewElementImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGViewSpecImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGZoomAndPanImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/svg/SVGZoomEventImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/views/AbstractViewImpl.java delete mode 100644 src/bind/java/org/inkscape/dom/views/DocumentViewImpl.java delete mode 100644 src/bind/java/org/inkscape/script/Editor.java delete mode 100644 src/bind/java/org/inkscape/script/ScriptConsole.java delete mode 100644 src/bind/java/org/inkscape/script/Terminal.java delete mode 100644 src/bind/java/org/w3c/dom/css/CSS2Properties.java delete mode 100644 src/bind/java/org/w3c/dom/css/CSSCharsetRule.java delete mode 100644 src/bind/java/org/w3c/dom/css/CSSFontFaceRule.java delete mode 100644 src/bind/java/org/w3c/dom/css/CSSImportRule.java delete mode 100644 src/bind/java/org/w3c/dom/css/CSSMediaRule.java delete mode 100644 src/bind/java/org/w3c/dom/css/CSSPageRule.java delete mode 100644 src/bind/java/org/w3c/dom/css/CSSPrimitiveValue.java delete mode 100644 src/bind/java/org/w3c/dom/css/CSSRule.java delete mode 100644 src/bind/java/org/w3c/dom/css/CSSRuleList.java delete mode 100644 src/bind/java/org/w3c/dom/css/CSSStyleDeclaration.java delete mode 100644 src/bind/java/org/w3c/dom/css/CSSStyleRule.java delete mode 100644 src/bind/java/org/w3c/dom/css/CSSStyleSheet.java delete mode 100644 src/bind/java/org/w3c/dom/css/CSSUnknownRule.java delete mode 100644 src/bind/java/org/w3c/dom/css/CSSValue.java delete mode 100644 src/bind/java/org/w3c/dom/css/CSSValueList.java delete mode 100644 src/bind/java/org/w3c/dom/css/Counter.java delete mode 100644 src/bind/java/org/w3c/dom/css/DOMImplementationCSS.java delete mode 100644 src/bind/java/org/w3c/dom/css/DocumentCSS.java delete mode 100644 src/bind/java/org/w3c/dom/css/ElementCSSInlineStyle.java delete mode 100644 src/bind/java/org/w3c/dom/css/RGBColor.java delete mode 100644 src/bind/java/org/w3c/dom/css/Rect.java delete mode 100644 src/bind/java/org/w3c/dom/css/ViewCSS.java delete mode 100644 src/bind/java/org/w3c/dom/events/CustomEvent.java delete mode 100644 src/bind/java/org/w3c/dom/events/DocumentEvent.java delete mode 100644 src/bind/java/org/w3c/dom/events/Event.java delete mode 100644 src/bind/java/org/w3c/dom/events/EventException.java delete mode 100644 src/bind/java/org/w3c/dom/events/EventListener.java delete mode 100644 src/bind/java/org/w3c/dom/events/EventTarget.java delete mode 100644 src/bind/java/org/w3c/dom/events/KeyboardEvent.java delete mode 100644 src/bind/java/org/w3c/dom/events/MouseEvent.java delete mode 100644 src/bind/java/org/w3c/dom/events/MutationEvent.java delete mode 100644 src/bind/java/org/w3c/dom/events/MutationNameEvent.java delete mode 100644 src/bind/java/org/w3c/dom/events/TextEvent.java delete mode 100644 src/bind/java/org/w3c/dom/events/UIEvent.java delete mode 100644 src/bind/java/org/w3c/dom/smil/ElementExclusiveTimeContainer.java delete mode 100644 src/bind/java/org/w3c/dom/smil/ElementLayout.java delete mode 100644 src/bind/java/org/w3c/dom/smil/ElementParallelTimeContainer.java delete mode 100644 src/bind/java/org/w3c/dom/smil/ElementSequentialTimeContainer.java delete mode 100644 src/bind/java/org/w3c/dom/smil/ElementSyncBehavior.java delete mode 100644 src/bind/java/org/w3c/dom/smil/ElementTargetAttributes.java delete mode 100644 src/bind/java/org/w3c/dom/smil/ElementTest.java delete mode 100644 src/bind/java/org/w3c/dom/smil/ElementTime.java delete mode 100644 src/bind/java/org/w3c/dom/smil/ElementTimeContainer.java delete mode 100644 src/bind/java/org/w3c/dom/smil/ElementTimeControl.java delete mode 100644 src/bind/java/org/w3c/dom/smil/ElementTimeManipulation.java delete mode 100644 src/bind/java/org/w3c/dom/smil/SMILAnimateColorElement.java delete mode 100644 src/bind/java/org/w3c/dom/smil/SMILAnimateElement.java delete mode 100644 src/bind/java/org/w3c/dom/smil/SMILAnimateMotionElement.java delete mode 100644 src/bind/java/org/w3c/dom/smil/SMILAnimation.java delete mode 100644 src/bind/java/org/w3c/dom/smil/SMILDocument.java delete mode 100644 src/bind/java/org/w3c/dom/smil/SMILElement.java delete mode 100644 src/bind/java/org/w3c/dom/smil/SMILLayoutElement.java delete mode 100644 src/bind/java/org/w3c/dom/smil/SMILMediaElement.java delete mode 100644 src/bind/java/org/w3c/dom/smil/SMILRefElement.java delete mode 100644 src/bind/java/org/w3c/dom/smil/SMILRegionElement.java delete mode 100644 src/bind/java/org/w3c/dom/smil/SMILRegionInterface.java delete mode 100644 src/bind/java/org/w3c/dom/smil/SMILRootLayoutElement.java delete mode 100644 src/bind/java/org/w3c/dom/smil/SMILSetElement.java delete mode 100644 src/bind/java/org/w3c/dom/smil/SMILSwitchElement.java delete mode 100644 src/bind/java/org/w3c/dom/smil/SMILTopLayoutElement.java delete mode 100644 src/bind/java/org/w3c/dom/smil/Time.java delete mode 100644 src/bind/java/org/w3c/dom/smil/TimeEvent.java delete mode 100644 src/bind/java/org/w3c/dom/smil/TimeList.java delete mode 100644 src/bind/java/org/w3c/dom/stylesheets/DocumentStyle.java delete mode 100644 src/bind/java/org/w3c/dom/stylesheets/LinkStyle.java delete mode 100644 src/bind/java/org/w3c/dom/stylesheets/MediaList.java delete mode 100644 src/bind/java/org/w3c/dom/stylesheets/StyleSheet.java delete mode 100644 src/bind/java/org/w3c/dom/stylesheets/StyleSheetList.java delete mode 100644 src/bind/java/org/w3c/dom/svg/GetSVGDocument.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGAElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGAltGlyphDefElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGAltGlyphElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGAltGlyphItemElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGAngle.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGAnimateColorElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGAnimateElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGAnimateMotionElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGAnimateTransformElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGAnimatedAngle.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGAnimatedBoolean.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGAnimatedEnumeration.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGAnimatedInteger.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGAnimatedLength.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGAnimatedLengthList.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGAnimatedNumber.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGAnimatedNumberList.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGAnimatedPathData.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGAnimatedPoints.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGAnimatedPreserveAspectRatio.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGAnimatedRect.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGAnimatedString.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGAnimatedTransformList.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGAnimationElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGCSSRule.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGCircleElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGClipPathElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGColor.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGColorProfileElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGColorProfileRule.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGComponentTransferFunctionElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGCursorElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGDefinitionSrcElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGDefsElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGDescElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGDocument.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGElementInstance.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGElementInstanceList.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGEllipseElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGEvent.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGException.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGExternalResourcesRequired.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFEBlendElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFEColorMatrixElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFEComponentTransferElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFECompositeElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFEConvolveMatrixElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFEDiffuseLightingElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFEDisplacementMapElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFEDistantLightElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFEFloodElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFEFuncAElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFEFuncBElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFEFuncGElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFEFuncRElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFEGaussianBlurElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFEImageElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFEMergeElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFEMergeNodeElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFEMorphologyElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFEOffsetElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFEPointLightElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFESpecularLightingElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFESpotLightElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFETileElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFETurbulenceElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFilterElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFilterPrimitiveStandardAttributes.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFitToViewBox.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFontElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFontFaceElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFontFaceFormatElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFontFaceNameElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFontFaceSrcElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGFontFaceUriElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGForeignObjectElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGGElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGGlyphElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGGlyphRefElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGGradientElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGHKernElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGICCColor.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGImageElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGLangSpace.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGLength.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGLengthList.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGLineElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGLinearGradientElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGLocatable.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGMPathElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGMarkerElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGMaskElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGMatrix.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGMetadataElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGMissingGlyphElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGNumber.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGNumberList.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPaint.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPathElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPathSeg.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPathSegArcAbs.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPathSegArcRel.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPathSegClosePath.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoCubicAbs.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoCubicRel.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoCubicSmoothAbs.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoCubicSmoothRel.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoQuadraticAbs.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoQuadraticRel.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoQuadraticSmoothAbs.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoQuadraticSmoothRel.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPathSegLinetoAbs.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPathSegLinetoHorizontalAbs.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPathSegLinetoHorizontalRel.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPathSegLinetoRel.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPathSegLinetoVerticalAbs.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPathSegLinetoVerticalRel.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPathSegList.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPathSegMovetoAbs.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPathSegMovetoRel.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPatternElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPoint.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPointList.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPolygonElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPolylineElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGPreserveAspectRatio.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGRadialGradientElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGRect.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGRectElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGRenderingIntent.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGSVGElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGScriptElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGSetElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGStopElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGStringList.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGStylable.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGStyleElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGSwitchElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGSymbolElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGTRefElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGTSpanElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGTests.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGTextContentElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGTextElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGTextPathElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGTextPositioningElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGTitleElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGTransform.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGTransformList.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGTransformable.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGURIReference.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGUnitTypes.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGUseElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGVKernElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGViewElement.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGViewSpec.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGZoomAndPan.java delete mode 100644 src/bind/java/org/w3c/dom/svg/SVGZoomEvent.java delete mode 100644 src/bind/java/org/w3c/dom/views/AbstractView.java delete mode 100644 src/bind/java/org/w3c/dom/views/DocumentView.java delete mode 100644 src/bind/javabind-private.h delete mode 100644 src/bind/javabind.cpp delete mode 100644 src/bind/javabind.h delete mode 100644 src/bind/javainc/jni.h delete mode 100644 src/bind/javainc/linux/jni_md.h delete mode 100644 src/bind/javainc/solaris/jni_md.h delete mode 100644 src/bind/javainc/win32/jni_md.h delete mode 100644 src/bind/makefile.in delete mode 100644 src/extension/script/InkscapeScript.cpp delete mode 100644 src/extension/script/InkscapeScript.h delete mode 100644 src/extension/script/Makefile_insert delete mode 100644 src/extension/script/makefile.in delete mode 100644 src/ui/dialog/scriptdialog.cpp delete mode 100644 src/ui/dialog/scriptdialog.h (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fa54940db..87f223150 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -538,7 +538,6 @@ list(APPEND inkscape_SRC # All folders for internal inkscape # these call add_inkscape_source -add_subdirectory(bind) add_subdirectory(debug) add_subdirectory(dialogs) add_subdirectory(display) diff --git a/src/Makefile.am b/src/Makefile.am index b9ec53ab1..3a937d58b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -82,8 +82,6 @@ AM_CPPFLAGS = \ $(INKSCAPE_CFLAGS) \ -I$(top_srcdir)/cxxtest \ $(WIN32_CFLAGS) \ - -I$(srcdir)/bind/javainc \ - -I$(srcdir)/bind/javainc/linux \ -I$(builddir)/extension/dbus \ $(X11_CFLAGS) @@ -107,7 +105,6 @@ endif # Include all partial makefiles from subdirectories include Makefile_insert -include bind/Makefile_insert include dialogs/Makefile_insert include display/Makefile_insert include dom/Makefile_insert @@ -115,7 +112,6 @@ include extension/Makefile_insert include extension/dbus/Makefile_insert include extension/implementation/Makefile_insert include extension/internal/Makefile_insert -include extension/script/Makefile_insert include filters/Makefile_insert include helper/Makefile_insert include io/Makefile_insert @@ -147,7 +143,6 @@ EXTRA_DIST += \ $(top_srcdir)/Doxyfile \ sp-skeleton.cpp sp-skeleton.h \ util/makefile.in \ - bind/makefile.in \ debug/makefile.in \ dialogs/makefile.in \ display/makefile.in \ @@ -155,7 +150,6 @@ EXTRA_DIST += \ extension/implementation/makefile.in \ extension/internal/makefile.in \ extension/makefile.in \ - extension/script/makefile.in \ filters/makefile.in \ helper/makefile.in \ io/makefile.in \ diff --git a/src/bind/CMakeLists.txt b/src/bind/CMakeLists.txt deleted file mode 100644 index 9b6abad4f..000000000 --- a/src/bind/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ - -set(bind_SRC - dobinding.cpp - javabind.cpp - - - # ------- - # Headers - javabind-private.h - javabind.h - javainc/jni.h - javainc/linux/jni_md.h - javainc/solaris/jni_md.h - javainc/win32/jni_md.h -) - -# add_inkscape_lib(bind_LIB "${bind_SRC}") -add_inkscape_source("${bind_SRC}") diff --git a/src/bind/DomStub.java b/src/bind/DomStub.java deleted file mode 100644 index df82e5012..000000000 --- a/src/bind/DomStub.java +++ /dev/null @@ -1,299 +0,0 @@ - -import java.io.*; -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Collections; - - -/** - * This is not an actual java binding class. Rather, it is - * a simple tool for generating C++ native method stubs from classfiles - */ -public class DomStub -{ - -class MethodEntry -{ -ArrayList parms; -String name; -String type; - -public void addParam(String type) -{ - parms.add(type); -} - -public MethodEntry(String methodName, String type) -{ - this.name = methodName; - this.type = type; - parms = new ArrayList(); -} -} - - -class ClassEntry -{ -ArrayList methods; -String name; - -public void addMethod(MethodEntry method) -{ - methods.add(method); -} - -public ClassEntry(String className) -{ - this.name = className; - methods = new ArrayList(); -} -} - - -HashMap classes; - - -BufferedWriter out; - -void err(String msg) -{ - System.out.println("DomStub err:" + msg); -} - -void trace(String msg) -{ - System.out.println("DomStub:" + msg); -} - -void po(String msg) -{ - try - { - out.write(msg); - } - catch (IOException e) - { - } -} - - -//######################################################################## -//# G E N E R A T E -//######################################################################## - -void dumpClasses() -{ - for (ClassEntry ce : classes.values()) - { - trace("########################"); - trace("Class " + ce.name); - for (MethodEntry me : ce.methods) - { - trace(" " + me.type + " " + me.name); - for (String parm : me.parms) - { - trace(" " + parm); - } - } - } -} - - -void generateMethod(MethodEntry me) -{ - po("/**\n"); - po(" * Method : " + me.name + "\n"); - po(" */\n"); - for (String parm : me.parms) - { - po(" " + parm + "\n"); - } - -} - -void generateClass(ClassEntry ce) -{ - po("//################################################################\n"); - po("//## " + ce.name + "\n"); - po("//################################################################\n"); - - for (MethodEntry me : ce.methods) - generateMethod(me); - -} - - -void generate() -{ - ArrayList classNames = new ArrayList(classes.keySet()); - Collections.sort(classNames); - for (String key : classNames) - { - ClassEntry ce = classes.get(key); - generateClass(ce); - } -} - -//######################################################################## -//# P A R S E -//######################################################################## -boolean parseEntry(String className, String methodName, String signature) -{ - //trace("Decl :" + methodDecl); - //trace("params:" + params); - //################################# - //# Parse class and method lines - //################################# - String s = className.substring(14); - className = s.replace('_', '/'); - methodName = methodName.substring(14); - signature = signature.substring(14); - //trace("className : " + className); - //trace("methodName : " + methodName); - - int pos = signature.indexOf('('); - if (pos<0) - { - err("no opening ( for signature"); - return false; - } - pos++; - int p2 = signature.indexOf(')', pos); - if (p2<0) - { - err("no closing ) for signature"); - return false; - } - String parms = signature.substring(pos, p2); - String type = signature.substring(p2+1); - //################################# - //# create method entry. add to new or existing class - //################################# - MethodEntry method = new MethodEntry(methodName, type); - - ClassEntry clazz = classes.get(className); - if (clazz == null) - { - clazz = new ClassEntry(className); - classes.put(className, clazz); - } - clazz.addMethod(method); - - //################################# - //# Parse signature line - //################################# - - pos = 0; - int len = parms.length(); - while (pos(); -} - - - -public static void main(String argv[]) -{ - DomStub st = new DomStub(); - boolean ret = st.processFile("out.h"); -} - - -} \ No newline at end of file diff --git a/src/bind/Makefile_insert b/src/bind/Makefile_insert deleted file mode 100644 index b640957d3..000000000 --- a/src/bind/Makefile_insert +++ /dev/null @@ -1,11 +0,0 @@ -## Makefile.am fragment sourced by src/Makefile.am. - -ink_common_sources += \ - bind/javabind.h \ - bind/javabind-private.h \ - bind/javabind.cpp \ - bind/dobinding.cpp \ - bind/javainc/jni.h \ - bind/javainc/linux/jni_md.h \ - bind/javainc/solaris/jni_md.h \ - bind/javainc/win32/jni_md.h diff --git a/src/bind/dobinding.cpp b/src/bind/dobinding.cpp deleted file mode 100644 index 03b16a9dd..000000000 --- a/src/bind/dobinding.cpp +++ /dev/null @@ -1,251 +0,0 @@ -/* - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (C) 2007-2008 Bob Jamison - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - - -#include -#include -#include -#include -#include - -#ifdef __WIN32__ -#include -#else -#include -#include -#endif - -#include "javabind.h" -#include "javabind-private.h" - -#include -#include - -namespace Inkscape -{ -namespace Bind -{ - -using namespace org::w3c::dom; - -/** - * This file has the actual C++ --> Java bindings - * This file can get quite large! - */ - -/** - * This struct associates a class name with its native - * bindings. Since C++ does not allow "flexible" arrays, - * we will separate each of the tables into a JNINativeMethod - * array, and a class with a name and a pointer to that array. - */ -typedef struct -{ - const char *className; - JNINativeMethod *methods; -} NativeClass; - -/** - * Although I dislike macros, this one seems reasonable - */ -#define EXCEPTION (getExceptionString(env).c_str()) - -//######################################################################## -//# BASE OBJECT -//######################################################################## - -static jmethodID _getPointer_id = NULL; - -static jlong getPointer(JNIEnv *env, jobject obj) -{ - if (!_getPointer_id) - { - _getPointer_id = env->GetMethodID(env->GetObjectClass(obj), "getPointer", "()J"); - if (!_getPointer_id) - { - err("getPointer(): %s", EXCEPTION); - return 0; - } - } - jlong val = env->CallLongMethod(obj, _getPointer_id); - return val; -} - - -static jmethodID _setPointer_id = NULL; - -static void setPointer(JNIEnv *env, jobject obj, jlong val) -{ - if (!_setPointer_id) - { - _setPointer_id = env->GetMethodID(env->GetObjectClass(obj), "setPointer", "(J)V"); - if (!_setPointer_id) - { - err("setPointer(): %s", EXCEPTION); - return; - } - } - env->CallVoidMethod(obj, _setPointer_id, val); -} - - -static void JNICALL BaseObject_construct (JNIEnv *env, jobject obj) -{ - setPointer(env, obj, 0L); -} - -static void JNICALL BaseObject_destruct (JNIEnv *env, jobject obj) -{ - BaseObject *ptr = reinterpret_cast(getPointer(env, obj)); - if (ptr) - { - delete ptr; - } - setPointer(env, obj, 0L); -} - - -static JNINativeMethod nm_BaseObject[] = -{ -{ (char *)"construct", (char *)"()V", (void *)BaseObject_construct }, -{ (char *)"destruct", (char *)"()V", (void *)BaseObject_destruct }, -{ NULL, NULL, NULL } -}; - -static NativeClass nc_BaseObject = -{ - "org/inkscape/cmn/BaseObject", - nm_BaseObject -}; - -//######################################################################## -//# BASE OBJECT -//######################################################################## - -static void JNICALL DOMBase_construct - (JNIEnv *env, jobject obj) -{ - setPointer(env, obj, 0L); -} - -static void JNICALL DOMBase_destruct - (JNIEnv *env, jobject obj) -{ - NodePtr *ptr = reinterpret_cast(getPointer(env, obj)); - if (ptr) - { - delete ptr; - } - setPointer(env, obj, 0L); -} - - -static JNINativeMethod nm_DOMBase[] = -{ -{ (char *)"construct", (char *)"()V", (void *)DOMBase_construct }, -{ (char *)"destruct", (char *)"()V", (void *)DOMBase_destruct }, -{ NULL, NULL, NULL } -}; - -static NativeClass nc_DOMBase = -{ - "org/inkscape/dom/DOMBase", - nm_DOMBase -}; - - -//######################################################################## -//# DOMImplementation -//######################################################################## - - -static void JNICALL DOMImplementation_nCreateDocument - (JNIEnv *env, jobject obj) -{ - DOMImplementationImpl domImpl; - DocumentTypePtr docType = domImpl.createDocumentType("", "", ""); - DocumentPtr doc = domImpl.createDocument("", "", docType); - DocumentPtr *ptr = new DocumentPtr(doc); - setPointer(env, obj, (jlong)ptr); -} - - - -static JNINativeMethod nm_DOMImplementation[] = -{ -{ (char *)"construct", (char *)"()V", (void *)DOMImplementation_nCreateDocument }, -{ NULL, NULL, NULL } -}; - -static NativeClass nc_DOMImplementation = -{ - "org/inkscape/dom/DOMImplementation", - nm_DOMImplementation -}; - - - -//######################################################################## -//# MAIN -//######################################################################## - - -/** - * This is a table-of-tables, matching a class name to its - * table of native methods. We can probably think of a cleaner way - * of doing this - */ -static NativeClass *allClasses[] = -{ - &nc_BaseObject, - &nc_DOMBase, - &nc_DOMImplementation, - NULL -}; - - - -bool JavaBinderyImpl::doBinding() -{ - for (NativeClass **nc = allClasses ; *nc ; nc++) - { - bool ret = registerNatives((*nc)->className, (*nc)->methods); - if (!ret) - { - err("Could not bind native methods"); - return false; - } - } - return true; -} - - - - -} // namespace Bind -} // namespace Inkscape - -//######################################################################## -//# E N D O F F I L E -//######################################################################## diff --git a/src/bind/java/org/inkscape/cmn/BaseInterface.java b/src/bind/java/org/inkscape/cmn/BaseInterface.java deleted file mode 100644 index 2cc1228f5..000000000 --- a/src/bind/java/org/inkscape/cmn/BaseInterface.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (C) 2007-2008 Bob Jamison - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -package org.inkscape.cmn; - -/** - * A BaseInterface is not an object of its down, but is owned - * by a parent BaseObject. It has no mapping to a C++ object of - * its own, but is merely the delegate that a BaseObject calls. - * This is how we provide some semblance of multiple inheritance, - * and keep the native method count down. - */ -public class BaseInterface extends BaseObject -{ -BaseObject parent; - - -public void setParent(BaseObject par) -{ - parent = par; -} - -/** - * Overloaded. getPointer() means that -any- java instance rooted on - * either BaseObject or BaseInterface can call getPointer() to get the - * handle to the associated C++ object pointer. The difference is that - * BaseObject holds the actual pointer, while BaseInterface refers to - * its owner BaseObject. - */ -protected long getPointer() -{ - if (parent == null) - return 0L; - else - return parent.getPointer(); -} - -/** - * Since this is an interface, construct() - * means nothing. Nothing must happen - */ -protected void construct() -{ -} - -/** - * Since this is an interface, destruct() - * means nothing. Nothing must happen - */ -protected void destruct() -{ -} - - -/** - * Instances of this "interface" can only exist parasitically attached - * to a BaseObject - */ -public BaseInterface() -{ - setParent(null); -} - -} diff --git a/src/bind/java/org/inkscape/cmn/BaseObject.java b/src/bind/java/org/inkscape/cmn/BaseObject.java deleted file mode 100644 index b2c7aac8f..000000000 --- a/src/bind/java/org/inkscape/cmn/BaseObject.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (C) 2007-2008 Bob Jamison - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -package org.inkscape.cmn; - -/** - * This is the base of all classes which map to a corresponding - * C++ object. The _pointer value is storage for the C++ object's - * pointer. Construct() and destruct() are called for when things - * need to be setup or cleaned up on the C++ side during creation or - * destruction of this object. - * - * @see BaseInterface for how we add multiple inheritance to classes - * which are rooted on this class. - */ -public class BaseObject -{ - -private long _pointer; - -/** - * getPointer() means that -any- java instance rooted on - * either BaseObject or BaseInterface can call getPointer() to get the - * handle to the associated C++ object pointer. The difference is that - * BaseObject holds the actual pointer, while BaseInterface refers to - * its owner BaseObject. - */ -protected long getPointer() -{ - return _pointer; -} - -/** - * sets the pointer to the associated C++ object to a new value - */ -protected void setPointer(long val) -{ - _pointer = val; -} - -protected native void construct(); - -protected native void destruct(); - -protected BaseInterface imbue(BaseInterface intf) -{ - intf.setParent(this); - return intf; -} - - -/** - * Simple constructor - */ -public BaseObject() -{ - construct(); -} - -} diff --git a/src/bind/java/org/inkscape/cmn/Gateway.java b/src/bind/java/org/inkscape/cmn/Gateway.java deleted file mode 100644 index fa70d2b7d..000000000 --- a/src/bind/java/org/inkscape/cmn/Gateway.java +++ /dev/null @@ -1,346 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (C) 2007-2008 Bob Jamison - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -package org.inkscape.cmn; - -import java.util.List; -import java.io.FileReader; -import java.io.PrintStream; -import java.io.OutputStream; -import java.io.IOException; -import javax.swing.JOptionPane; - -//####for xml -//read -import org.w3c.dom.Document; -import java.io.ByteArrayInputStream; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -//write -import java.io.ByteArrayOutputStream; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.Transformer; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.inkscape.script.ScriptConsole; - - - -/** - * Provide a gateway from C to Java, to simplify adding - * interfaces. - */ -public class Gateway -{ -/** - * Pointer back to the BinderyImpl C++ object that launched me - */ -long backPtr; - - -//######################################################################## -//# MESSSAGES -//######################################################################## -void err(String message) -{ - ScriptConsole console = ScriptConsole.getInstance(); - if (console != null) - console.err("Gateway err:" + message); - else - log("Gateway err:" + message); -} - -void msg(String message) -{ - ScriptConsole console = ScriptConsole.getInstance(); - if (console != null) - console.msg("Gateway err:" + message); - else - log("Gateway:" + message); -} - -void trace(String message) -{ - ScriptConsole console = ScriptConsole.getInstance(); - if (console != null) - console.trace("Gateway:" + message); - else - log("Gateway:" + message); -} - - -//######################################################################## -//# U T I L I T Y -//######################################################################## - -/** - * Parse a String to an XML Document - */ -public Document stringToDoc(String xmlStr) -{ - if (xmlStr == null || xmlStr.length()==0) - return null; - Document doc = null; - try - { - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - DocumentBuilder parser = factory.newDocumentBuilder(); - doc = parser.parse(new ByteArrayInputStream(xmlStr.getBytes())); - } - catch (java.io.IOException e) - { - err("stringToDoc:" + e); - return null; - } - catch (javax.xml.parsers.ParserConfigurationException e) - { - err("stringToDoc:" + e); - return null; - } - catch (org.xml.sax.SAXException e) - { - err("stringToDoc:" + e); - return null; - } - return doc; -} - - - -/** - * Serialize an XML Document to a string - */ -public String docToString(Document doc) -{ - if (doc == null) - return ""; - String buf = ""; - try - { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - TransformerFactory factory = TransformerFactory.newInstance(); - Transformer tf = factory.newTransformer(); - tf.transform(new DOMSource(doc), new StreamResult(baos)); - baos.close(); - buf = baos.toString(); - } - catch (java.io.IOException e) - { - err("docToString:" + e); - return null; - } - catch (javax.xml.transform.TransformerConfigurationException e) - { - err("docToString:" + e); - return null; - } - catch (javax.xml.transform.TransformerException e) - { - err("docToString:" + e); - return null; - } - return buf; -} - - -//######################################################################## -//# R E P R (inkscape's xml tree) -//######################################################################## - -private native String documentGet(long backPtr); - -public String documentGet() -{ - return documentGet(backPtr); -} - - -public Document documentGetXml() -{ - String xmlStr = documentGet(); - return stringToDoc(xmlStr); -} - -private native boolean documentSet(long backPtr, String xmlStr); - -public boolean documentSet(String xmlStr) -{ - return documentSet(backPtr, xmlStr); -} - -public boolean documentSetXml(Document doc) -{ - String xmlStr = docToString(doc); - return documentSet(xmlStr); -} - - -//######################################################################## -//# LOGGING STREAM -//######################################################################## - -public native void logWrite(long backptr, int ch); - -class LogStream extends OutputStream -{ - -public void write(int ch) -{ - logWrite(backPtr, ch); -} - -} - -PrintStream log = null; - -/** - * printf-style logging - */ -void log(String fmt, Object... args) -{ - log.printf("Gateway:" + fmt, args); -} - - -//######################################################################## -//# RUN -//######################################################################## - - -/** - * Run a script buffer - * - * @param backPtr pointer back to the C context that called this - * @param lang the scripting language to run - * @param str the script buffer to execute - * @return true if successful, else false - */ -public boolean scriptRun(String lang, String str) -{ - //wrap whole thing in try/catch, since this will - //likely be called from C - try - { - ScriptConsole console = ScriptConsole.getInstance(); - if (console == null) - { - err("ScriptConsole not initialized"); - return false; - } - return console.doRun(lang, str); - } - catch (Exception e) - { - err("run :" + e); - e.printStackTrace(); - return false; - } -} - - -/** - * Run a script file - * - * @param backPtr pointer back to the C context that called this - * @param lang the scripting language to run - * @param fname the script file to execute - * @return true if successful, else false - */ -public boolean scriptRunFile(String lang, String fname) -{ - //wrap whole thing in try/catch, since this will - //likely be called from C - try - { - { - ScriptConsole console = ScriptConsole.getInstance(); - if (console == null) - { - err("ScriptConsole not initialized"); - return false; - } - return console.doRun(lang, fname); - } - } - catch (Exception e) - { - err("scriptRunFile :" + e); - return false; - } -} - - - - - -//######################################################################## -//# C O N S O L E -//######################################################################## - - -public boolean showConsole() -{ - ScriptConsole.getInstance().setVisible(true); - return true; -} - - -//######################################################################## -//# CONSTRUCTOR -//######################################################################## - - - - -/** - * Constructor - * @param backPtr pointer back to the C context that called this - */ -public Gateway(long backPtr) -{ - /** - * Set up the logging stream - */ - log = new PrintStream(new LogStream()); - - //Point back to C++ object - this.backPtr = backPtr; - - _instance = this; -} - -private static Gateway _instance = null; - -public static Gateway getInstance() -{ - return _instance; -} - -} -//######################################################################## -//# E N D O F F I L E -//######################################################################## - - diff --git a/src/bind/java/org/inkscape/cmn/Resource.java b/src/bind/java/org/inkscape/cmn/Resource.java deleted file mode 100644 index 3ad139d8a..000000000 --- a/src/bind/java/org/inkscape/cmn/Resource.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (C) 2007-2008 Bob Jamison - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -package org.inkscape.cmn; - -import java.awt.Image; -import javax.swing.ImageIcon; -import java.net.URL; - - - -/** - * This class will hold various functions for getting a - * resource from the classpath or jarfile - */ -public class Resource -{ - - -public static ImageIcon getIcon(String name) -{ - - String path = "/data/icons/" + name; - URL imgurl = Resource.class.getResource(path); - if (imgurl == null) - { - System.err.println("Icon '" + path + "' not found"); - return null; - } - ImageIcon icon = new ImageIcon(imgurl); - return icon; -} - -public static Image getImage(String name) -{ - - ImageIcon icon = getIcon(name); - if (icon == null) - return null; - return icon.getImage(); -} - - -} - diff --git a/src/bind/java/org/inkscape/dom/AttrImpl.java b/src/bind/java/org/inkscape/dom/AttrImpl.java deleted file mode 100644 index ead12c6c5..000000000 --- a/src/bind/java/org/inkscape/dom/AttrImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - - -package org.inkscape.dom; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.Element; -import org.w3c.dom.TypeInfo; - - -public class AttrImpl - extends NodeImpl - implements org.w3c.dom.Attr -{ - -public native String getName(); - -public native boolean getSpecified(); - -public native String getValue(); - -public native void setValue(String value) - throws DOMException; - -public native Element getOwnerElement(); - -public native TypeInfo getSchemaTypeInfo(); - -public native boolean isId(); - -} diff --git a/src/bind/java/org/inkscape/dom/CDATASectionImpl.java b/src/bind/java/org/inkscape/dom/CDATASectionImpl.java deleted file mode 100644 index 3ac77da54..000000000 --- a/src/bind/java/org/inkscape/dom/CDATASectionImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - - -package org.inkscape.dom; - - -public class CDATASectionImpl - extends TextImpl - implements org.w3c.dom.CDATASection -{ -} diff --git a/src/bind/java/org/inkscape/dom/CharacterDataImpl.java b/src/bind/java/org/inkscape/dom/CharacterDataImpl.java deleted file mode 100644 index 1c540a41c..000000000 --- a/src/bind/java/org/inkscape/dom/CharacterDataImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - - - -package org.inkscape.dom; - -import org.w3c.dom.DOMException; - - - - -public class CharacterDataImpl - extends NodeImpl - implements org.w3c.dom.CharacterData -{ - -public native String getData() - throws DOMException; -public native void setData(String data) - throws DOMException; - -public native int getLength(); - -public native String substringData(int offset, - int count) - throws DOMException; - -public native void appendData(String arg) - throws DOMException; - -public native void insertData(int offset, - String arg) - throws DOMException; - -public native void deleteData(int offset, - int count) - throws DOMException; - -public native void replaceData(int offset, - int count, - String arg) - throws DOMException; - -} diff --git a/src/bind/java/org/inkscape/dom/CommentImpl.java b/src/bind/java/org/inkscape/dom/CommentImpl.java deleted file mode 100644 index 5abe4d14b..000000000 --- a/src/bind/java/org/inkscape/dom/CommentImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - - -package org.inkscape.dom; - - -public class CommentImpl - extends CharacterDataImpl - implements org.w3c.dom.Comment -{ -} diff --git a/src/bind/java/org/inkscape/dom/DOMBase.java b/src/bind/java/org/inkscape/dom/DOMBase.java deleted file mode 100644 index 4ab1409f0..000000000 --- a/src/bind/java/org/inkscape/dom/DOMBase.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (C) 2007 Bob Jamison - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -package org.inkscape.dom; - - - -/** - * This is the base Java class upon which - * all of the DOM classes are rooted - */ -public class DOMBase - extends org.inkscape.cmn.BaseObject -{ - -/** - * @see dobinding.cpp: DOMBase_construct(). - * - * Overloaded from BaseObject so that we can do 'special' construction - */ -protected native void construct(); - -/** - * @see dobinding.cpp: DOMBase_destruct() - * - * Overloaded from BaseObject so that we can do 'special' destruction - */ -protected native void destruct(); - - - -/** - * Overload Object.finalize() so that we - * can perform proper cleanup. - */ -protected void finalize() -{ - destruct(); -} - - -public DOMBase() -{ - construct(); -} - -} -//######################################################################## -//# E N D O F F I L E -//######################################################################## - diff --git a/src/bind/java/org/inkscape/dom/DOMConfigurationImpl.java b/src/bind/java/org/inkscape/dom/DOMConfigurationImpl.java deleted file mode 100644 index 23ed58628..000000000 --- a/src/bind/java/org/inkscape/dom/DOMConfigurationImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - -package org.inkscape.dom; - -import org.w3c.dom.DOMException; -import org.w3c.dom.DOMStringList; - - - - -public class DOMConfigurationImpl - implements org.w3c.dom.DOMConfiguration -{ - -public native void setParameter(String name, - Object value) - throws DOMException; - -public native Object getParameter(String name) - throws DOMException; - -public native boolean canSetParameter(String name, - Object value); - -public native DOMStringList getParameterNames(); - -} diff --git a/src/bind/java/org/inkscape/dom/DOMErrorHandlerImpl.java b/src/bind/java/org/inkscape/dom/DOMErrorHandlerImpl.java deleted file mode 100644 index 5cdbe2ee9..000000000 --- a/src/bind/java/org/inkscape/dom/DOMErrorHandlerImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - -package org.inkscape.dom; - - -public class DOMErrorHandlerImpl - implements org.w3c.dom.DOMErrorHandler -{ - -public native boolean handleError(org.w3c.dom.DOMError error); - -} diff --git a/src/bind/java/org/inkscape/dom/DOMErrorImpl.java b/src/bind/java/org/inkscape/dom/DOMErrorImpl.java deleted file mode 100644 index 80cb09b9b..000000000 --- a/src/bind/java/org/inkscape/dom/DOMErrorImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - -package org.inkscape.dom; - - -public class DOMErrorImpl - implements org.w3c.dom.DOMError -{ - -public native short getSeverity(); - -public native String getMessage(); - -public native String getType(); - -public native Object getRelatedException(); - -public native Object getRelatedData(); - -public native org.w3c.dom.DOMLocator getLocation(); - -} diff --git a/src/bind/java/org/inkscape/dom/DOMImplementationImpl.java b/src/bind/java/org/inkscape/dom/DOMImplementationImpl.java deleted file mode 100644 index 1c4188ed7..000000000 --- a/src/bind/java/org/inkscape/dom/DOMImplementationImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - -package org.inkscape.dom; - -import org.w3c.dom.DOMException; -import org.w3c.dom.Document; -import org.w3c.dom.DocumentType; - - - -public class DOMImplementationImpl - implements org.w3c.dom.DOMImplementation -{ - -public native boolean hasFeature(String feature, - String version); - - -public native DocumentType createDocumentType(String qualifiedName, - String publicId, - String systemId) - throws DOMException; - - -public native Document createDocument(String namespaceURI, - String qualifiedName, - DocumentType doctype) - throws DOMException; - - -public native Object getFeature(String feature, - String version); - -} diff --git a/src/bind/java/org/inkscape/dom/DOMImplementationListImpl.java b/src/bind/java/org/inkscape/dom/DOMImplementationListImpl.java deleted file mode 100644 index 35bee53d2..000000000 --- a/src/bind/java/org/inkscape/dom/DOMImplementationListImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - -package org.inkscape.dom; - -import org.w3c.dom.DOMImplementation; - - -public class DOMImplementationListImpl - implements org.w3c.dom.DOMImplementationList -{ - -public native DOMImplementation item(int index); - - -public native int getLength(); - -} diff --git a/src/bind/java/org/inkscape/dom/DOMImplementationSourceImpl.java b/src/bind/java/org/inkscape/dom/DOMImplementationSourceImpl.java deleted file mode 100644 index a2a2a8f26..000000000 --- a/src/bind/java/org/inkscape/dom/DOMImplementationSourceImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - -package org.inkscape.dom; - -import org.w3c.dom.DOMImplementation; -import org.w3c.dom.DOMImplementationList; - -public class DOMImplementationSourceImpl - implements org.w3c.dom.DOMImplementationSource -{ -public native DOMImplementation getDOMImplementation(String features); - -public native DOMImplementationList getDOMImplementationList(String features); - -} diff --git a/src/bind/java/org/inkscape/dom/DOMLocatorImpl.java b/src/bind/java/org/inkscape/dom/DOMLocatorImpl.java deleted file mode 100644 index c5abe4ca1..000000000 --- a/src/bind/java/org/inkscape/dom/DOMLocatorImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - -package org.inkscape.dom; - - -public class DOMLocatorImpl - implements org.w3c.dom.DOMLocator -{ - -public native int getLineNumber(); - -public native int getColumnNumber(); - -public native int getByteOffset(); - -public native int getUtf16Offset(); - -public native org.w3c.dom.Node getRelatedNode(); - -public native String getUri(); - -} diff --git a/src/bind/java/org/inkscape/dom/DOMStringListImpl.java b/src/bind/java/org/inkscape/dom/DOMStringListImpl.java deleted file mode 100644 index 91c31c574..000000000 --- a/src/bind/java/org/inkscape/dom/DOMStringListImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - -package org.inkscape.dom; - - - -public class DOMStringListImpl - implements org.w3c.dom.DOMStringList -{ - -public native String item(int index); - -public native int getLength(); - -public native boolean contains(String str); - -} diff --git a/src/bind/java/org/inkscape/dom/DocumentFragmentImpl.java b/src/bind/java/org/inkscape/dom/DocumentFragmentImpl.java deleted file mode 100644 index 4148f598e..000000000 --- a/src/bind/java/org/inkscape/dom/DocumentFragmentImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - -package org.inkscape.dom; - - -public class DocumentFragmentImpl - extends NodeImpl - implements org.w3c.dom.DocumentFragment -{ -} diff --git a/src/bind/java/org/inkscape/dom/DocumentImpl.java b/src/bind/java/org/inkscape/dom/DocumentImpl.java deleted file mode 100644 index e381ce573..000000000 --- a/src/bind/java/org/inkscape/dom/DocumentImpl.java +++ /dev/null @@ -1,138 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - - -package org.inkscape.dom; - -import org.w3c.dom.DOMException; - - -import org.w3c.dom.Attr; -import org.w3c.dom.CDATASection; -import org.w3c.dom.Comment; -import org.w3c.dom.DocumentFragment; -import org.w3c.dom.DocumentType; -import org.w3c.dom.DOMConfiguration; -import org.w3c.dom.DOMImplementation; -import org.w3c.dom.DOMStringList; -import org.w3c.dom.Element; -import org.w3c.dom.EntityReference; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.ProcessingInstruction; -import org.w3c.dom.Text; - - - -public class DocumentImpl - extends NodeImpl - implements org.w3c.dom.Document -{ - -public native DocumentType getDoctype(); - -public native DOMImplementation getImplementation(); - -public native Element getDocumentElement(); - -public native Element createElement(String tagName) - throws DOMException; - -public native DocumentFragment createDocumentFragment(); - -public native Text createTextNode(String data); - -public native Comment createComment(String data); - -public native CDATASection createCDATASection(String data) - throws DOMException; - -public native ProcessingInstruction createProcessingInstruction(String target, - String data) - throws DOMException; - -public native Attr createAttribute(String name) - throws DOMException; - -public native EntityReference createEntityReference(String name) - throws DOMException; - -public native NodeList getElementsByTagName(String tagname); - -public native Node importNode(Node importedNode, - boolean deep) - throws DOMException; - -public native Element createElementNS(String namespaceURI, - String qualifiedName) - throws DOMException; - -public native Attr createAttributeNS(String namespaceURI, - String qualifiedName) - throws DOMException; - -public native NodeList getElementsByTagNameNS(String namespaceURI, - String localName); - -public native Element getElementById(String elementId); - -public native String getInputEncoding(); - -public native String getXmlEncoding(); - -public native boolean getXmlStandalone(); - -public native void setXmlStandalone(boolean xmlStandalone) - throws DOMException; - -public native String getXmlVersion(); - -public native void setXmlVersion(String xmlVersion) - throws DOMException; - -public native boolean getStrictErrorChecking(); - -public native void setStrictErrorChecking(boolean strictErrorChecking); - -public native String getDocumentURI(); - -public native void setDocumentURI(String documentURI); - -public native Node adoptNode(Node source) - throws DOMException; - -public native DOMConfiguration getDomConfig(); - -public native void normalizeDocument(); - -public native Node renameNode(Node n, - String namespaceURI, - String qualifiedName) - throws DOMException; - -} diff --git a/src/bind/java/org/inkscape/dom/DocumentTypeImpl.java b/src/bind/java/org/inkscape/dom/DocumentTypeImpl.java deleted file mode 100644 index d3aa13552..000000000 --- a/src/bind/java/org/inkscape/dom/DocumentTypeImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - -package org.inkscape.dom; - -import org.w3c.dom.NamedNodeMap; - - - -public class DocumentTypeImpl - extends NodeImpl - implements org.w3c.dom.DocumentType -{ - -public native String getName(); - -public native NamedNodeMap getEntities(); - -public native NamedNodeMap getNotations(); - -public native String getPublicId(); - -public native String getSystemId(); - -public native String getInternalSubset(); - -} diff --git a/src/bind/java/org/inkscape/dom/ElementImpl.java b/src/bind/java/org/inkscape/dom/ElementImpl.java deleted file mode 100644 index 9040c6ba4..000000000 --- a/src/bind/java/org/inkscape/dom/ElementImpl.java +++ /dev/null @@ -1,111 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - -package org.inkscape.dom; - -import org.w3c.dom.DOMException; -import org.w3c.dom.Attr; -import org.w3c.dom.NodeList; -import org.w3c.dom.TypeInfo; - - - - -public class ElementImpl - extends NodeImpl - implements org.w3c.dom.Element - -{ - -public native String getTagName(); - -public native String getAttribute(String name); - -public native void setAttribute(String name, - String value) - throws DOMException; - -public native void removeAttribute(String name) - throws DOMException; - -public native Attr getAttributeNode(String name); - -public native Attr setAttributeNode(Attr newAttr) - throws DOMException; - -public native Attr removeAttributeNode(Attr oldAttr) - throws DOMException; - -public native NodeList getElementsByTagName(String name); - -public native String getAttributeNS(String namespaceURI, - String localName) - throws DOMException; - -public native void setAttributeNS(String namespaceURI, - String qualifiedName, - String value) - throws DOMException; - -public native void removeAttributeNS(String namespaceURI, - String localName) - throws DOMException; - -public native Attr getAttributeNodeNS(String namespaceURI, - String localName) - throws DOMException; - -public native Attr setAttributeNodeNS(Attr newAttr) - throws DOMException; - -public native NodeList getElementsByTagNameNS(String namespaceURI, - String localName) - throws DOMException; - -public native boolean hasAttribute(String name); - -public native boolean hasAttributeNS(String namespaceURI, - String localName) - throws DOMException; - -public native TypeInfo getSchemaTypeInfo(); - -public native void setIdAttribute(String name, - boolean isId) - throws DOMException; - -public native void setIdAttributeNS(String namespaceURI, - String localName, - boolean isId) - throws DOMException; - -public native void setIdAttributeNode(Attr idAttr, - boolean isId) - throws DOMException; - -} diff --git a/src/bind/java/org/inkscape/dom/EntityImpl.java b/src/bind/java/org/inkscape/dom/EntityImpl.java deleted file mode 100644 index 9b86060a6..000000000 --- a/src/bind/java/org/inkscape/dom/EntityImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - -package org.inkscape.dom; - - - -public class EntityImpl - extends NodeImpl - implements org.w3c.dom.Entity -{ -public native String getPublicId(); - -public native String getSystemId(); - -public native String getNotationName(); - -public native String getInputEncoding(); - -public native String getXmlEncoding(); - -public native String getXmlVersion(); - -} diff --git a/src/bind/java/org/inkscape/dom/EntityReferenceImpl.java b/src/bind/java/org/inkscape/dom/EntityReferenceImpl.java deleted file mode 100644 index 32bbe6d58..000000000 --- a/src/bind/java/org/inkscape/dom/EntityReferenceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - -package org.inkscape.dom; - - - -public class EntityReferenceImpl - extends NodeImpl - implements org.w3c.dom.EntityReference -{ -} diff --git a/src/bind/java/org/inkscape/dom/NameListImpl.java b/src/bind/java/org/inkscape/dom/NameListImpl.java deleted file mode 100644 index e6d1f10fe..000000000 --- a/src/bind/java/org/inkscape/dom/NameListImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - -package org.inkscape.dom; - - -public class NameListImpl - implements org.w3c.dom.NameList -{ -public native String getName(int index); - -public native String getNamespaceURI(int index); - -public native int getLength(); - -public native boolean contains(String str); - -public native boolean containsNS(String namespaceURI, - String name); - -} diff --git a/src/bind/java/org/inkscape/dom/NamedNodeMapImpl.java b/src/bind/java/org/inkscape/dom/NamedNodeMapImpl.java deleted file mode 100644 index 2ee9a7c1e..000000000 --- a/src/bind/java/org/inkscape/dom/NamedNodeMapImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - -package org.inkscape.dom; - -import org.w3c.dom.DOMException; -import org.w3c.dom.Node; - - - - -public class NamedNodeMapImpl - implements org.w3c.dom.NamedNodeMap -{ - -public native Node getNamedItem(String name); - - -public native Node setNamedItem(Node arg) - throws DOMException; - -public native Node removeNamedItem(String name) - throws DOMException; - -public native Node item(int index); - -public native int getLength(); - -public native Node getNamedItemNS(String namespaceURI, - String localName) - throws DOMException; - -public native Node setNamedItemNS(Node arg) - throws DOMException; - -public native Node removeNamedItemNS(String namespaceURI, - String localName) - throws DOMException; - -} diff --git a/src/bind/java/org/inkscape/dom/NodeImpl.java b/src/bind/java/org/inkscape/dom/NodeImpl.java deleted file mode 100644 index e6071df42..000000000 --- a/src/bind/java/org/inkscape/dom/NodeImpl.java +++ /dev/null @@ -1,139 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - -package org.inkscape.dom; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.Document; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.UserDataHandler; - - - - -public class NodeImpl - extends DOMBase - implements org.w3c.dom.Node -{ - -public native String getNodeName(); - -public native String getNodeValue() - throws DOMException; -public native void setNodeValue(String nodeValue) - throws DOMException; - -public native short getNodeType(); - -public native Node getParentNode(); - -public native NodeList getChildNodes(); - -public native Node getFirstChild(); - -public native Node getLastChild(); - -public native Node getPreviousSibling(); - -public native Node getNextSibling(); - -public native NamedNodeMap getAttributes(); - -public native Document getOwnerDocument(); - -public native Node insertBefore(Node newChild, - Node refChild) - throws DOMException; - -public native Node replaceChild(Node newChild, - Node oldChild) - throws DOMException; - -public native Node removeChild(Node oldChild) - throws DOMException; - -public native Node appendChild(Node newChild) - throws DOMException; - -public native boolean hasChildNodes(); - -public native Node cloneNode(boolean deep); - -public native void normalize(); - -public native boolean isSupported(String feature, - String version); - -public native String getNamespaceURI(); - -public native String getPrefix(); - -public native void setPrefix(String prefix) - throws DOMException; - -public native String getLocalName(); - -public native boolean hasAttributes(); - -public native String getBaseURI(); - - -public native short compareDocumentPosition(Node other) - throws DOMException; - - -public native String getTextContent() - throws DOMException; - -public native void setTextContent(String textContent) - throws DOMException; - - -public native boolean isSameNode(Node other); - -public native String lookupPrefix(String namespaceURI); - -public native boolean isDefaultNamespace(String namespaceURI); - -public native String lookupNamespaceURI(String prefix); - -public native boolean isEqualNode(Node arg); - -public native Object getFeature(String feature, - String version); - -public native Object setUserData(String key, - Object data, - UserDataHandler handler); - -public native Object getUserData(String key); - -} diff --git a/src/bind/java/org/inkscape/dom/NodeListImpl.java b/src/bind/java/org/inkscape/dom/NodeListImpl.java deleted file mode 100644 index 14568cc81..000000000 --- a/src/bind/java/org/inkscape/dom/NodeListImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - -package org.inkscape.dom; - - -public class NodeListImpl - implements org.w3c.dom.NodeList -{ - -public native org.w3c.dom.Node item(int index); - - -public native int getLength(); - -} diff --git a/src/bind/java/org/inkscape/dom/NotationImpl.java b/src/bind/java/org/inkscape/dom/NotationImpl.java deleted file mode 100644 index 326e24f88..000000000 --- a/src/bind/java/org/inkscape/dom/NotationImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - -package org.inkscape.dom; - - -public class NotationImpl - extends NodeImpl - implements org.w3c.dom.Notation -{ - -public native String getPublicId(); - -public native String getSystemId(); - -} diff --git a/src/bind/java/org/inkscape/dom/ProcessingInstructionImpl.java b/src/bind/java/org/inkscape/dom/ProcessingInstructionImpl.java deleted file mode 100644 index db63fd8c0..000000000 --- a/src/bind/java/org/inkscape/dom/ProcessingInstructionImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - -package org.inkscape.dom; - -import org.w3c.dom.DOMException; - - - -public class ProcessingInstructionImpl - extends NodeImpl - implements org.w3c.dom.ProcessingInstruction -{ - -public native String getTarget(); - -public native String getData(); - -public native void setData(String data) throws DOMException; - -} diff --git a/src/bind/java/org/inkscape/dom/TextImpl.java b/src/bind/java/org/inkscape/dom/TextImpl.java deleted file mode 100644 index 0c0bb79b8..000000000 --- a/src/bind/java/org/inkscape/dom/TextImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - -package org.inkscape.dom; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.Text; - - - -public class TextImpl - extends CharacterDataImpl - implements org.w3c.dom.Text -{ - -public native Text splitText(int offset) - throws DOMException; - -public native boolean isElementContentWhitespace(); - -public native String getWholeText(); - -public native Text replaceWholeText(String content) - throws DOMException; - -} diff --git a/src/bind/java/org/inkscape/dom/TypeInfoImpl.java b/src/bind/java/org/inkscape/dom/TypeInfoImpl.java deleted file mode 100644 index d19f5f6db..000000000 --- a/src/bind/java/org/inkscape/dom/TypeInfoImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - -package org.inkscape.dom; - - -public class TypeInfoImpl - implements org.w3c.dom.TypeInfo -{ - -public native String getTypeName(); - -public native String getTypeNamespace(); - -public native boolean isDerivedFrom(String typeNamespaceArg, - String typeNameArg, - int derivationMethod); - -} diff --git a/src/bind/java/org/inkscape/dom/UserDataHandlerImpl.java b/src/bind/java/org/inkscape/dom/UserDataHandlerImpl.java deleted file mode 100644 index 98ebeae38..000000000 --- a/src/bind/java/org/inkscape/dom/UserDataHandlerImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html - */ - -package org.inkscape.dom; - -import org.w3c.dom.Node; - - - -public class UserDataHandlerImpl - implements org.w3c.dom.UserDataHandler -{ - -public native void handle(short operation, - String key, - Object data, - Node src, - Node dst); - -} diff --git a/src/bind/java/org/inkscape/dom/css/CSS2PropertiesImpl.java b/src/bind/java/org/inkscape/dom/css/CSS2PropertiesImpl.java deleted file mode 100644 index 2b1404da5..000000000 --- a/src/bind/java/org/inkscape/dom/css/CSS2PropertiesImpl.java +++ /dev/null @@ -1,527 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style - */ - - -package org.inkscape.dom.css; - -import org.w3c.dom.DOMException; - - -public class CSS2PropertiesImpl - implements org.w3c.dom.css.CSS2Properties -{ - -public native String getAzimuth(); -public native void setAzimuth(String azimuth) - throws DOMException; - -public native String getBackground(); -public native void setBackground(String background) - throws DOMException; - -public native String getBackgroundAttachment(); -public native void setBackgroundAttachment(String backgroundAttachment) - throws DOMException; - -public native String getBackgroundColor(); -public native void setBackgroundColor(String backgroundColor) - throws DOMException; - -public native String getBackgroundImage(); -public native void setBackgroundImage(String backgroundImage) - throws DOMException; - -public native String getBackgroundPosition(); -public native void setBackgroundPosition(String backgroundPosition) - throws DOMException; - -public native String getBackgroundRepeat(); -public native void setBackgroundRepeat(String backgroundRepeat) - throws DOMException; - -public native String getBorder(); -public native void setBorder(String border) - throws DOMException; - -public native String getBorderCollapse(); -public native void setBorderCollapse(String borderCollapse) - throws DOMException; - -public native String getBorderColor(); -public native void setBorderColor(String borderColor) - throws DOMException; - -public native String getBorderSpacing(); -public native void setBorderSpacing(String borderSpacing) - throws DOMException; - -public native String getBorderStyle(); -public native void setBorderStyle(String borderStyle) - throws DOMException; - -public native String getBorderTop(); -public native void setBorderTop(String borderTop) - throws DOMException; - -public native String getBorderRight(); -public native void setBorderRight(String borderRight) - throws DOMException; - -public native String getBorderBottom(); -public native void setBorderBottom(String borderBottom) - throws DOMException; - -public native String getBorderLeft(); -public native void setBorderLeft(String borderLeft) - throws DOMException; - -public native String getBorderTopColor(); -public native void setBorderTopColor(String borderTopColor) - throws DOMException; - -public native String getBorderRightColor(); -public native void setBorderRightColor(String borderRightColor) - throws DOMException; - -public native String getBorderBottomColor(); -public native void setBorderBottomColor(String borderBottomColor) - throws DOMException; - -public native String getBorderLeftColor(); -public native void setBorderLeftColor(String borderLeftColor) - throws DOMException; - -public native String getBorderTopStyle(); -public native void setBorderTopStyle(String borderTopStyle) - throws DOMException; - -public native String getBorderRightStyle(); -public native void setBorderRightStyle(String borderRightStyle) - throws DOMException; - -public native String getBorderBottomStyle(); -public native void setBorderBottomStyle(String borderBottomStyle) - throws DOMException; - -public native String getBorderLeftStyle(); -public native void setBorderLeftStyle(String borderLeftStyle) - throws DOMException; - -public native String getBorderTopWidth(); -public native void setBorderTopWidth(String borderTopWidth) - throws DOMException; - -public native String getBorderRightWidth(); -public native void setBorderRightWidth(String borderRightWidth) - throws DOMException; - -public native String getBorderBottomWidth(); -public native void setBorderBottomWidth(String borderBottomWidth) - throws DOMException; - -public native String getBorderLeftWidth(); -public native void setBorderLeftWidth(String borderLeftWidth) - throws DOMException; - -public native String getBorderWidth(); -public native void setBorderWidth(String borderWidth) - throws DOMException; - -public native String getBottom(); -public native void setBottom(String bottom) - throws DOMException; - -public native String getCaptionSide(); -public native void setCaptionSide(String captionSide) - throws DOMException; - -public native String getClear(); -public native void setClear(String clear) - throws DOMException; - -public native String getClip(); -public native void setClip(String clip) - throws DOMException; - -public native String getColor(); -public native void setColor(String color) - throws DOMException; - -public native String getContent(); -public native void setContent(String content) - throws DOMException; - -public native String getCounterIncrement(); -public native void setCounterIncrement(String counterIncrement) - throws DOMException; - -public native String getCounterReset(); -public native void setCounterReset(String counterReset) - throws DOMException; - -public native String getCue(); -public native void setCue(String cue) - throws DOMException; - -public native String getCueAfter(); -public native void setCueAfter(String cueAfter) - throws DOMException; - -public native String getCueBefore(); -public native void setCueBefore(String cueBefore) - throws DOMException; - -public native String getCursor(); -public native void setCursor(String cursor) - throws DOMException; - -public native String getDirection(); -public native void setDirection(String direction) - throws DOMException; - -public native String getDisplay(); -public native void setDisplay(String display) - throws DOMException; - -public native String getElevation(); -public native void setElevation(String elevation) - throws DOMException; - -public native String getEmptyCells(); -public native void setEmptyCells(String emptyCells) - throws DOMException; - -public native String getCssFloat(); -public native void setCssFloat(String cssFloat) - throws DOMException; - -public native String getFont(); -public native void setFont(String font) - throws DOMException; - -public native String getFontFamily(); -public native void setFontFamily(String fontFamily) - throws DOMException; - -public native String getFontSize(); -public native void setFontSize(String fontSize) - throws DOMException; - -public native String getFontSizeAdjust(); -public native void setFontSizeAdjust(String fontSizeAdjust) - throws DOMException; - -public native String getFontStretch(); -public native void setFontStretch(String fontStretch) - throws DOMException; - -public native String getFontStyle(); -public native void setFontStyle(String fontStyle) - throws DOMException; - -public native String getFontVariant(); -public native void setFontVariant(String fontVariant) - throws DOMException; - -public native String getFontWeight(); -public native void setFontWeight(String fontWeight) - throws DOMException; - -public native String getHeight(); -public native void setHeight(String height) - throws DOMException; - -public native String getLeft(); -public native void setLeft(String left) - throws DOMException; - -public native String getLetterSpacing(); -public native void setLetterSpacing(String letterSpacing) - throws DOMException; - -public native String getLineHeight(); -public native void setLineHeight(String lineHeight) - throws DOMException; - -public native String getListStyle(); -public native void setListStyle(String listStyle) - throws DOMException; - -public native String getListStyleImage(); -public native void setListStyleImage(String listStyleImage) - throws DOMException; - -public native String getListStylePosition(); -public native void setListStylePosition(String listStylePosition) - throws DOMException; - -public native String getListStyleType(); -public native void setListStyleType(String listStyleType) - throws DOMException; - -public native String getMargin(); -public native void setMargin(String margin) - throws DOMException; - -public native String getMarginTop(); -public native void setMarginTop(String marginTop) - throws DOMException; - -public native String getMarginRight(); -public native void setMarginRight(String marginRight) - throws DOMException; - -public native String getMarginBottom(); -public native void setMarginBottom(String marginBottom) - throws DOMException; - -public native String getMarginLeft(); -public native void setMarginLeft(String marginLeft) - throws DOMException; - -public native String getMarkerOffset(); -public native void setMarkerOffset(String markerOffset) - throws DOMException; - -public native String getMarks(); -public native void setMarks(String marks) - throws DOMException; - -public native String getMaxHeight(); -public native void setMaxHeight(String maxHeight) - throws DOMException; - -public native String getMaxWidth(); -public native void setMaxWidth(String maxWidth) - throws DOMException; - -public native String getMinHeight(); -public native void setMinHeight(String minHeight) - throws DOMException; - -public native String getMinWidth(); -public native void setMinWidth(String minWidth) - throws DOMException; - -public native String getOrphans(); -public native void setOrphans(String orphans) - throws DOMException; - -public native String getOutline(); -public native void setOutline(String outline) - throws DOMException; - -public native String getOutlineColor(); -public native void setOutlineColor(String outlineColor) - throws DOMException; - -public native String getOutlineStyle(); -public native void setOutlineStyle(String outlineStyle) - throws DOMException; - -public native String getOutlineWidth(); -public native void setOutlineWidth(String outlineWidth) - throws DOMException; - -public native String getOverflow(); -public native void setOverflow(String overflow) - throws DOMException; - -public native String getPadding(); -public native void setPadding(String padding) - throws DOMException; - -public native String getPaddingTop(); -public native void setPaddingTop(String paddingTop) - throws DOMException; - -public native String getPaddingRight(); -public native void setPaddingRight(String paddingRight) - throws DOMException; - -public native String getPaddingBottom(); -public native void setPaddingBottom(String paddingBottom) - throws DOMException; - -public native String getPaddingLeft(); -public native void setPaddingLeft(String paddingLeft) - throws DOMException; - -public native String getPage(); -public native void setPage(String page) - throws DOMException; - -public native String getPageBreakAfter(); -public native void setPageBreakAfter(String pageBreakAfter) - throws DOMException; - -public native String getPageBreakBefore(); -public native void setPageBreakBefore(String pageBreakBefore) - throws DOMException; - -public native String getPageBreakInside(); -public native void setPageBreakInside(String pageBreakInside) - throws DOMException; - -public native String getPause(); -public native void setPause(String pause) - throws DOMException; - -public native String getPauseAfter(); -public native void setPauseAfter(String pauseAfter) - throws DOMException; - -public native String getPauseBefore(); -public native void setPauseBefore(String pauseBefore) - throws DOMException; - -public native String getPitch(); -public native void setPitch(String pitch) - throws DOMException; - -public native String getPitchRange(); -public native void setPitchRange(String pitchRange) - throws DOMException; - -public native String getPlayDuring(); -public native void setPlayDuring(String playDuring) - throws DOMException; - -public native String getPosition(); -public native void setPosition(String position) - throws DOMException; - -public native String getQuotes(); -public native void setQuotes(String quotes) - throws DOMException; - -public native String getRichness(); -public native void setRichness(String richness) - throws DOMException; - -public native String getRight(); -public native void setRight(String right) - throws DOMException; - -public native String getSize(); -public native void setSize(String size) - throws DOMException; - -public native String getSpeak(); -public native void setSpeak(String speak) - throws DOMException; - -public native String getSpeakHeader(); -public native void setSpeakHeader(String speakHeader) - throws DOMException; - -public native String getSpeakNumeral(); -public native void setSpeakNumeral(String speakNumeral) - throws DOMException; - -public native String getSpeakPunctuation(); -public native void setSpeakPunctuation(String speakPunctuation) - throws DOMException; - -public native String getSpeechRate(); -public native void setSpeechRate(String speechRate) - throws DOMException; - -public native String getStress(); -public native void setStress(String stress) - throws DOMException; - -public native String getTableLayout(); -public native void setTableLayout(String tableLayout) - throws DOMException; - -public native String getTextAlign(); -public native void setTextAlign(String textAlign) - throws DOMException; - -public native String getTextDecoration(); -public native void setTextDecoration(String textDecoration) - throws DOMException; - -public native String getTextIndent(); -public native void setTextIndent(String textIndent) - throws DOMException; - -public native String getTextShadow(); -public native void setTextShadow(String textShadow) - throws DOMException; - -public native String getTextTransform(); -public native void setTextTransform(String textTransform) - throws DOMException; - -public native String getTop(); -public native void setTop(String top) - throws DOMException; - -public native String getUnicodeBidi(); -public native void setUnicodeBidi(String unicodeBidi) - throws DOMException; - -public native String getVerticalAlign(); -public native void setVerticalAlign(String verticalAlign) - throws DOMException; - -public native String getVisibility(); -public native void setVisibility(String visibility) - throws DOMException; - -public native String getVoiceFamily(); -public native void setVoiceFamily(String voiceFamily) - throws DOMException; - -public native String getVolume(); -public native void setVolume(String volume) - throws DOMException; - -public native String getWhiteSpace(); -public native void setWhiteSpace(String whiteSpace) - throws DOMException; - -public native String getWidows(); -public native void setWidows(String widows) - throws DOMException; - -public native String getWidth(); -public native void setWidth(String width) - throws DOMException; - -public native String getWordSpacing(); -public native void setWordSpacing(String wordSpacing) - throws DOMException; - -public native String getZIndex(); -public native void setZIndex(String zIndex) - throws DOMException; - -} diff --git a/src/bind/java/org/inkscape/dom/css/CSSCharsetRuleImpl.java b/src/bind/java/org/inkscape/dom/css/CSSCharsetRuleImpl.java deleted file mode 100644 index b29173353..000000000 --- a/src/bind/java/org/inkscape/dom/css/CSSCharsetRuleImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style - */ - - -package org.inkscape.dom.css; - -import org.w3c.dom.DOMException; - - -public class CSSCharsetRuleImpl - extends CSSRuleImpl - implements org.w3c.dom.css.CSSCharsetRule -{ - -public native String getEncoding(); -public native void setEncoding(String encoding) - throws DOMException; - -} diff --git a/src/bind/java/org/inkscape/dom/css/CSSFontFaceRuleImpl.java b/src/bind/java/org/inkscape/dom/css/CSSFontFaceRuleImpl.java deleted file mode 100644 index cfa779e27..000000000 --- a/src/bind/java/org/inkscape/dom/css/CSSFontFaceRuleImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style - */ - - -package org.inkscape.dom.css; - -import org.w3c.dom.css.CSSStyleDeclaration; - - - -public class CSSFontFaceRuleImpl - extends CSSRuleImpl - implements org.w3c.dom.css.CSSFontFaceRule -{ - -public native CSSStyleDeclaration getStyle(); - -} diff --git a/src/bind/java/org/inkscape/dom/css/CSSImportRuleImpl.java b/src/bind/java/org/inkscape/dom/css/CSSImportRuleImpl.java deleted file mode 100644 index 8efb7265f..000000000 --- a/src/bind/java/org/inkscape/dom/css/CSSImportRuleImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style - */ - - -package org.inkscape.dom.css; - -import org.w3c.dom.css.CSSStyleSheet; -import org.w3c.dom.stylesheets.MediaList; - - - -public class CSSImportRuleImpl - extends CSSRuleImpl - implements org.w3c.dom.css.CSSImportRule -{ - -public native String getHref(); - -public native MediaList getMedia(); - -public native CSSStyleSheet getStyleSheet(); - -} diff --git a/src/bind/java/org/inkscape/dom/css/CSSMediaRuleImpl.java b/src/bind/java/org/inkscape/dom/css/CSSMediaRuleImpl.java deleted file mode 100644 index 0993592ba..000000000 --- a/src/bind/java/org/inkscape/dom/css/CSSMediaRuleImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style - */ - - -package org.inkscape.dom.css; - -import org.w3c.dom.DOMException; -import org.w3c.dom.stylesheets.MediaList; -import org.w3c.dom.css.CSSRuleList; - - -public class CSSMediaRuleImpl - extends CSSRuleImpl - implements org.w3c.dom.css.CSSMediaRule -{ - -public native MediaList getMedia(); - -public native CSSRuleList getCssRules(); - -public native int insertRule(String rule, - int index) - throws DOMException; - -public native void deleteRule(int index) - throws DOMException; - -} diff --git a/src/bind/java/org/inkscape/dom/css/CSSPageRuleImpl.java b/src/bind/java/org/inkscape/dom/css/CSSPageRuleImpl.java deleted file mode 100644 index 1b7594304..000000000 --- a/src/bind/java/org/inkscape/dom/css/CSSPageRuleImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style - */ - -package org.inkscape.dom.css; - -import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSStyleDeclaration; - - -public class CSSPageRuleImpl - extends CSSRuleImpl - implements org.w3c.dom.css.CSSPageRule -{ - -public native String getSelectorText(); -public native void setSelectorText(String selectorText) - throws DOMException; - -public native CSSStyleDeclaration getStyle(); - -} diff --git a/src/bind/java/org/inkscape/dom/css/CSSPrimitiveValueImpl.java b/src/bind/java/org/inkscape/dom/css/CSSPrimitiveValueImpl.java deleted file mode 100644 index 34abe3ca1..000000000 --- a/src/bind/java/org/inkscape/dom/css/CSSPrimitiveValueImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style - */ - - -package org.inkscape.dom.css; - -import org.w3c.dom.DOMException; -import org.w3c.dom.css.Counter; -import org.w3c.dom.css.RGBColor; -import org.w3c.dom.css.Rect; - - -public class CSSPrimitiveValueImpl - extends CSSValueImpl - implements org.w3c.dom.css.CSSPrimitiveValue -{ - -public native short getPrimitiveType(); - -public native void setFloatValue(short unitType, - float floatValue) - throws DOMException; - -public native float getFloatValue(short unitType) - throws DOMException; - -public native void setStringValue(short stringType, - String stringValue) - throws DOMException; - -public native String getStringValue() - throws DOMException; - -public native Counter getCounterValue() - throws DOMException; - -public native Rect getRectValue() - throws DOMException; - -public native RGBColor getRGBColorValue() - throws DOMException; - -} diff --git a/src/bind/java/org/inkscape/dom/css/CSSRuleImpl.java b/src/bind/java/org/inkscape/dom/css/CSSRuleImpl.java deleted file mode 100644 index ace49a055..000000000 --- a/src/bind/java/org/inkscape/dom/css/CSSRuleImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style - */ - - -package org.inkscape.dom.css; - -import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSStyleSheet; -import org.w3c.dom.css.CSSRule; - - -public class CSSRuleImpl - implements org.w3c.dom.css.CSSRule -{ - -public native short getType(); - -public native String getCssText(); -public native void setCssText(String cssText) - throws DOMException; - -public native CSSStyleSheet getParentStyleSheet(); - -public native CSSRule getParentRule(); - -} diff --git a/src/bind/java/org/inkscape/dom/css/CSSRuleListImpl.java b/src/bind/java/org/inkscape/dom/css/CSSRuleListImpl.java deleted file mode 100644 index 9fa2d0535..000000000 --- a/src/bind/java/org/inkscape/dom/css/CSSRuleListImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style - */ - - -package org.inkscape.dom.css; - -import org.w3c.dom.css.CSSRule; - - - -public class CSSRuleListImpl - implements org.w3c.dom.css.CSSRuleList -{ - -public native int getLength(); - -public native CSSRule item(int index); - -} diff --git a/src/bind/java/org/inkscape/dom/css/CSSStyleDeclarationImpl.java b/src/bind/java/org/inkscape/dom/css/CSSStyleDeclarationImpl.java deleted file mode 100644 index 73483f07b..000000000 --- a/src/bind/java/org/inkscape/dom/css/CSSStyleDeclarationImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style - */ - - -package org.inkscape.dom.css; - -import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSRule; -import org.w3c.dom.css.CSSValue; - - - -public class CSSStyleDeclarationImpl - implements org.w3c.dom.css.CSSStyleDeclaration -{ - -public native String getCssText(); -public native void setCssText(String cssText) - throws DOMException; - -public native String getPropertyValue(String propertyName); - -public native CSSValue getPropertyCSSValue(String propertyName); - -public native String removeProperty(String propertyName) - throws DOMException; - -public native String getPropertyPriority(String propertyName); - -public native void setProperty(String propertyName, - String value, - String priority) - throws DOMException; - -public native int getLength(); - -public native String item(int index); - -public native CSSRule getParentRule(); - -} diff --git a/src/bind/java/org/inkscape/dom/css/CSSStyleRuleImpl.java b/src/bind/java/org/inkscape/dom/css/CSSStyleRuleImpl.java deleted file mode 100644 index de2d4945e..000000000 --- a/src/bind/java/org/inkscape/dom/css/CSSStyleRuleImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style - */ - - -package org.inkscape.dom.css; - -import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSStyleDeclaration; - - -public class CSSStyleRuleImpl - extends CSSRuleImpl - implements org.w3c.dom.css.CSSStyleRule -{ - -public native String getSelectorText(); -public native void setSelectorText(String selectorText) - throws DOMException; - -public native CSSStyleDeclaration getStyle(); - -} diff --git a/src/bind/java/org/inkscape/dom/css/CSSStyleSheetImpl.java b/src/bind/java/org/inkscape/dom/css/CSSStyleSheetImpl.java deleted file mode 100644 index ed14d69c9..000000000 --- a/src/bind/java/org/inkscape/dom/css/CSSStyleSheetImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style - */ - - -package org.inkscape.dom.css; - -import org.w3c.dom.DOMException; -import org.w3c.dom.stylesheets.StyleSheet; -import org.w3c.dom.css.CSSRule; -import org.w3c.dom.css.CSSRuleList; - - -public class CSSStyleSheetImpl - extends org.inkscape.dom.stylesheets.StyleSheetImpl - implements org.w3c.dom.css.CSSStyleSheet -{ - -public native CSSRule getOwnerRule(); - - -public native CSSRuleList getCssRules(); - -public native int insertRule(String rule, - int index) - throws DOMException; - -public native void deleteRule(int index) - throws DOMException; - -} diff --git a/src/bind/java/org/inkscape/dom/css/CSSUnknownRuleImpl.java b/src/bind/java/org/inkscape/dom/css/CSSUnknownRuleImpl.java deleted file mode 100644 index d09a73681..000000000 --- a/src/bind/java/org/inkscape/dom/css/CSSUnknownRuleImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style - */ - - -package org.inkscape.dom.css; - - -public class CSSUnknownRuleImpl - extends CSSRuleImpl - implements org.w3c.dom.css.CSSUnknownRule -{ -} diff --git a/src/bind/java/org/inkscape/dom/css/CSSValueImpl.java b/src/bind/java/org/inkscape/dom/css/CSSValueImpl.java deleted file mode 100644 index 6782a95b7..000000000 --- a/src/bind/java/org/inkscape/dom/css/CSSValueImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style - */ - - - -package org.inkscape.dom.css; - -import org.w3c.dom.DOMException; - - -public class CSSValueImpl - implements org.w3c.dom.css.CSSValue -{ - -public native String getCssText(); -public native void setCssText(String cssText) - throws DOMException; - -public native short getCssValueType(); - -} diff --git a/src/bind/java/org/inkscape/dom/css/CSSValueListImpl.java b/src/bind/java/org/inkscape/dom/css/CSSValueListImpl.java deleted file mode 100644 index 334afb1c7..000000000 --- a/src/bind/java/org/inkscape/dom/css/CSSValueListImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style - */ - - -package org.inkscape.dom.css; - -import org.w3c.dom.css.CSSValue; - - - -public class CSSValueListImpl - extends CSSValueImpl - implements org.w3c.dom.css.CSSValueList -{ - -public native int getLength(); - -public native CSSValue item(int index); - -} diff --git a/src/bind/java/org/inkscape/dom/css/CounterImpl.java b/src/bind/java/org/inkscape/dom/css/CounterImpl.java deleted file mode 100644 index 1f656b944..000000000 --- a/src/bind/java/org/inkscape/dom/css/CounterImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style - */ - - -package org.inkscape.dom.css; - - - -public class CounterImpl - implements org.w3c.dom.css.Counter -{ - -public native String getIdentifier(); - -public native String getListStyle(); - -public native String getSeparator(); - -} diff --git a/src/bind/java/org/inkscape/dom/css/DOMImplementationCSSImpl.java b/src/bind/java/org/inkscape/dom/css/DOMImplementationCSSImpl.java deleted file mode 100644 index 16bf7a994..000000000 --- a/src/bind/java/org/inkscape/dom/css/DOMImplementationCSSImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style - */ - - -package org.inkscape.dom.css; - -import org.w3c.dom.DOMImplementation; -import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSStyleSheet; - - -public class DOMImplementationCSSImpl - extends - org.inkscape.dom.DOMImplementationImpl - implements org.w3c.dom.css.DOMImplementationCSS -{ - -public native CSSStyleSheet createCSSStyleSheet(String title, - String media) - throws DOMException; - -} diff --git a/src/bind/java/org/inkscape/dom/css/DocumentCSSImpl.java b/src/bind/java/org/inkscape/dom/css/DocumentCSSImpl.java deleted file mode 100644 index bbbd9c110..000000000 --- a/src/bind/java/org/inkscape/dom/css/DocumentCSSImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style - */ - - -package org.inkscape.dom.css; - -import org.w3c.dom.stylesheets.DocumentStyle; -import org.w3c.dom.Element; -import org.w3c.dom.css.CSSStyleDeclaration; - - - -public class DocumentCSSImpl - extends - org.inkscape.dom.stylesheets.DocumentStyleImpl - implements org.w3c.dom.css.DocumentCSS -{ - -public native CSSStyleDeclaration getOverrideStyle(Element elt, - String pseudoElt); - -} diff --git a/src/bind/java/org/inkscape/dom/css/ElementCSSInlineStyleImpl.java b/src/bind/java/org/inkscape/dom/css/ElementCSSInlineStyleImpl.java deleted file mode 100644 index ba36ae487..000000000 --- a/src/bind/java/org/inkscape/dom/css/ElementCSSInlineStyleImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style - */ - - - -package org.inkscape.dom.css; - -import org.w3c.dom.css.CSSStyleDeclaration; - - - -public class ElementCSSInlineStyleImpl - implements org.w3c.dom.css.ElementCSSInlineStyle -{ - -public native CSSStyleDeclaration getStyle(); - -} diff --git a/src/bind/java/org/inkscape/dom/css/RGBColorImpl.java b/src/bind/java/org/inkscape/dom/css/RGBColorImpl.java deleted file mode 100644 index 0f4d50b58..000000000 --- a/src/bind/java/org/inkscape/dom/css/RGBColorImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style - */ - - -package org.inkscape.dom.css; - -import org.w3c.dom.css.CSSPrimitiveValue; - - -public class RGBColorImpl - implements org.w3c.dom.css.RGBColor -{ - -public native CSSPrimitiveValue getRed(); - -public native CSSPrimitiveValue getGreen(); - -public native CSSPrimitiveValue getBlue(); - -} diff --git a/src/bind/java/org/inkscape/dom/css/RectImpl.java b/src/bind/java/org/inkscape/dom/css/RectImpl.java deleted file mode 100644 index 1ef0a766a..000000000 --- a/src/bind/java/org/inkscape/dom/css/RectImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style - */ - - - -package org.inkscape.dom.css; - -import org.w3c.dom.css.CSSPrimitiveValue; - - -public class RectImpl - implements org.w3c.dom.css.Rect -{ - -public native CSSPrimitiveValue getTop(); - -public native CSSPrimitiveValue getRight(); - -public native CSSPrimitiveValue getBottom(); - -public native CSSPrimitiveValue getLeft(); - -} diff --git a/src/bind/java/org/inkscape/dom/css/ViewCSSImpl.java b/src/bind/java/org/inkscape/dom/css/ViewCSSImpl.java deleted file mode 100644 index c52d056b7..000000000 --- a/src/bind/java/org/inkscape/dom/css/ViewCSSImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style - */ - - -package org.inkscape.dom.css; - -import org.w3c.dom.views.AbstractView; -import org.w3c.dom.Element; -import org.w3c.dom.css.CSSStyleDeclaration; - - -public class ViewCSSImpl - extends - org.inkscape.dom.views.AbstractViewImpl - implements org.w3c.dom.css.ViewCSS -{ - -public native CSSStyleDeclaration getComputedStyle(Element elt, - String pseudoElt); - -} diff --git a/src/bind/java/org/inkscape/dom/events/CustomEventImpl.java b/src/bind/java/org/inkscape/dom/events/CustomEventImpl.java deleted file mode 100644 index 3762e57e2..000000000 --- a/src/bind/java/org/inkscape/dom/events/CustomEventImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the Events files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107/java-binding.html - */ - -package org.inkscape.dom.events; - -import org.w3c.dom.events.EventTarget; - - - -public class CustomEventImpl - extends EventImpl - implements org.w3c.dom.events.CustomEvent -{ -public native void setDispatchState(EventTarget target, - short phase); - -public native boolean isPropagationStopped(); - -public native boolean isImmediatePropagationStopped(); - -} diff --git a/src/bind/java/org/inkscape/dom/events/DocumentEventImpl.java b/src/bind/java/org/inkscape/dom/events/DocumentEventImpl.java deleted file mode 100644 index 504427db3..000000000 --- a/src/bind/java/org/inkscape/dom/events/DocumentEventImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the Events files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107/java-binding.html - */ - -package org.inkscape.dom.events; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.events.Event; - - - -public class DocumentEventImpl - extends - org.inkscape.cmn.BaseInterface - implements org.w3c.dom.events.DocumentEvent -{ - -public native Event createEvent(String eventType) - throws DOMException; -public native boolean canDispatch(String namespaceURI, - String type); - -} diff --git a/src/bind/java/org/inkscape/dom/events/EventImpl.java b/src/bind/java/org/inkscape/dom/events/EventImpl.java deleted file mode 100644 index 858a3e095..000000000 --- a/src/bind/java/org/inkscape/dom/events/EventImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the Events files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107/java-binding.html - */ - -package org.inkscape.dom.events; - -import org.w3c.dom.events.EventTarget; - - - -public class EventImpl - implements org.w3c.dom.events.Event -{ - -public native String getType(); - -public native EventTarget getTarget(); - -public native EventTarget getCurrentTarget(); - -public native short getEventPhase(); - -public native boolean getBubbles(); - -public native boolean getCancelable(); - -public native long getTimeStamp(); - -public native void stopPropagation(); - -public native void preventDefault(); - -public native void initEvent(String eventTypeArg, - boolean canBubbleArg, - boolean cancelableArg); - -public native String getNamespaceURI(); - -public native boolean isCustom(); - -public native void stopImmediatePropagation(); - -public native boolean isDefaultPrevented(); - -public native void initEventNS(String namespaceURIArg, - String eventTypeArg, - boolean canBubbleArg, - boolean cancelableArg); - -} diff --git a/src/bind/java/org/inkscape/dom/events/EventListenerImpl.java b/src/bind/java/org/inkscape/dom/events/EventListenerImpl.java deleted file mode 100644 index 4b680ff86..000000000 --- a/src/bind/java/org/inkscape/dom/events/EventListenerImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the Events files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107/java-binding.html - */ - -package org.inkscape.dom.events; - -import org.w3c.dom.events.Event; - - - -public class EventListenerImpl - implements org.w3c.dom.events.EventListener -{ - -public native void handleEvent(Event evt); - -} diff --git a/src/bind/java/org/inkscape/dom/events/EventTargetImpl.java b/src/bind/java/org/inkscape/dom/events/EventTargetImpl.java deleted file mode 100644 index 34778f03b..000000000 --- a/src/bind/java/org/inkscape/dom/events/EventTargetImpl.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the Events files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107/java-binding.html - */ - -package org.inkscape.dom.events; - -import org.w3c.dom.events.EventException; -import org.w3c.dom.events.Event; -import org.w3c.dom.events.EventListener; - - - -public class EventTargetImpl - extends - org.inkscape.cmn.BaseInterface - implements org.w3c.dom.events.EventTarget -{ - -public native void addEventListener(String type, - EventListener listener, - boolean useCapture); - -public native void removeEventListener(String type, - EventListener listener, - boolean useCapture); - -public native boolean dispatchEvent(Event evt) - throws EventException; - -public native void addEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture, - Object evtGroup); - -public native void removeEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture); - -public native boolean willTriggerNS(String namespaceURI, - String type); - -public native boolean hasEventListenerNS(String namespaceURI, - String type); - -} diff --git a/src/bind/java/org/inkscape/dom/events/KeyboardEventImpl.java b/src/bind/java/org/inkscape/dom/events/KeyboardEventImpl.java deleted file mode 100644 index 24f8de968..000000000 --- a/src/bind/java/org/inkscape/dom/events/KeyboardEventImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the Events files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107/java-binding.html - */ - -package org.inkscape.dom.events; - -import org.w3c.dom.views.AbstractView; - - -public class KeyboardEventImpl - extends UIEventImpl - implements org.w3c.dom.events.KeyboardEvent -{ - -public native String getKeyIdentifier(); - -public native int getKeyLocation(); - -public native boolean getCtrlKey(); - -public native boolean getShiftKey(); - -public native boolean getAltKey(); - -public native boolean getMetaKey(); - -public native boolean getModifierState(String keyIdentifierArg); - -public native void initKeyboardEvent(String typeArg, - boolean canBubbleArg, - boolean cancelableArg, - AbstractView viewArg, - String keyIdentifierArg, - int keyLocationArg, - String modifiersList); - -public native void initKeyboardEventNS(String namespaceURI, - String typeArg, - boolean canBubbleArg, - boolean cancelableArg, - AbstractView viewArg, - String keyIdentifierArg, - int keyLocationArg, - String modifiersList); - -} diff --git a/src/bind/java/org/inkscape/dom/events/MouseEventImpl.java b/src/bind/java/org/inkscape/dom/events/MouseEventImpl.java deleted file mode 100644 index 900074643..000000000 --- a/src/bind/java/org/inkscape/dom/events/MouseEventImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the Events files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107/java-binding.html - */ - -package org.inkscape.dom.events; - -import org.w3c.dom.views.AbstractView; - -import org.w3c.dom.events.EventTarget; - - - -public class MouseEventImpl - extends UIEventImpl - implements org.w3c.dom.events.MouseEvent -{ - -public native int getScreenX(); - -public native int getScreenY(); - -public native int getClientX(); - -public native int getClientY(); - -public native boolean getCtrlKey(); - -public native boolean getShiftKey(); - -public native boolean getAltKey(); - -public native boolean getMetaKey(); - -public native short getButton(); - -public native EventTarget getRelatedTarget(); - -public native void initMouseEvent(String typeArg, - boolean canBubbleArg, - boolean cancelableArg, - AbstractView viewArg, - int detailArg, - int screenXArg, - int screenYArg, - int clientXArg, - int clientYArg, - boolean ctrlKeyArg, - boolean altKeyArg, - boolean shiftKeyArg, - boolean metaKeyArg, - short buttonArg, - EventTarget relatedTargetArg); - -public native boolean getModifierState(String keyIdentifierArg); - -public native void initMouseEventNS(String namespaceURI, - String typeArg, - boolean canBubbleArg, - boolean cancelableArg, - AbstractView viewArg, - int detailArg, - int screenXArg, - int screenYArg, - int clientXArg, - int clientYArg, - short buttonArg, - EventTarget relatedTargetArg, - String modifiersList); - -} - - diff --git a/src/bind/java/org/inkscape/dom/events/MutationEventImpl.java b/src/bind/java/org/inkscape/dom/events/MutationEventImpl.java deleted file mode 100644 index df3b9915c..000000000 --- a/src/bind/java/org/inkscape/dom/events/MutationEventImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the Events files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107/java-binding.html - */ - -package org.inkscape.dom.events; - -import org.w3c.dom.Node; - - -public class MutationEventImpl - extends EventImpl - implements org.w3c.dom.events.MutationEvent -{ -public native Node getRelatedNode(); - -public native String getPrevValue(); - -public native String getNewValue(); - -public native String getAttrName(); - -public native short getAttrChange(); - -public native void initMutationEvent(String typeArg, - boolean canBubbleArg, - boolean cancelableArg, - Node relatedNodeArg, - String prevValueArg, - String newValueArg, - String attrNameArg, - short attrChangeArg); - -public native void initMutationEventNS(String namespaceURI, - String typeArg, - boolean canBubbleArg, - boolean cancelableArg, - Node relatedNodeArg, - String prevValueArg, - String newValueArg, - String attrNameArg, - short attrChangeArg); - -} diff --git a/src/bind/java/org/inkscape/dom/events/MutationNameEventImpl.java b/src/bind/java/org/inkscape/dom/events/MutationNameEventImpl.java deleted file mode 100644 index 5ee722bfa..000000000 --- a/src/bind/java/org/inkscape/dom/events/MutationNameEventImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the Events files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107/java-binding.html - */ - -package org.inkscape.dom.events; - -import org.w3c.dom.Node; - - -public class MutationNameEventImpl - extends MutationEventImpl - implements org.w3c.dom.events.MutationNameEvent -{ - -public native String getPrevNamespaceURI(); - -public native String getPrevNodeName(); - -public native void initMutationNameEvent(String typeArg, - boolean canBubbleArg, - boolean cancelableArg, - Node relatedNodeArg, - String prevNamespaceURIArg, - String prevNodeNameArg); - -public native void initMutationNameEventNS(String namespaceURI, - String typeArg, - boolean canBubbleArg, - boolean cancelableArg, - Node relatedNodeArg, - String prevNamespaceURIArg, - String prevNodeNameArg); - -} diff --git a/src/bind/java/org/inkscape/dom/events/TextEventImpl.java b/src/bind/java/org/inkscape/dom/events/TextEventImpl.java deleted file mode 100644 index c62963c53..000000000 --- a/src/bind/java/org/inkscape/dom/events/TextEventImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the Events files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107/java-binding.html - */ - - -package org.inkscape.dom.events; - -import org.w3c.dom.views.AbstractView; - - -public class TextEventImpl - extends UIEventImpl - implements org.w3c.dom.events.TextEvent -{ - -public native String getData(); - -public native void initTextEvent(String typeArg, - boolean canBubbleArg, - boolean cancelableArg, - AbstractView viewArg, - String dataArg); - -public native void initTextEventNS(String namespaceURI, - String type, - boolean canBubbleArg, - boolean cancelableArg, - AbstractView viewArg, - String dataArg); - -} diff --git a/src/bind/java/org/inkscape/dom/events/UIEventImpl.java b/src/bind/java/org/inkscape/dom/events/UIEventImpl.java deleted file mode 100644 index bb66d154f..000000000 --- a/src/bind/java/org/inkscape/dom/events/UIEventImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the Events files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107/java-binding.html - */ - -package org.inkscape.dom.events; - -import org.w3c.dom.views.AbstractView; - - -public class UIEventImpl - extends EventImpl - implements org.w3c.dom.events.UIEvent -{ - -public native AbstractView getView(); - -public native int getDetail(); - -public native void initUIEvent(String typeArg, - boolean canBubbleArg, - boolean cancelableArg, - AbstractView viewArg, - int detailArg); - -public native void initUIEventNS(String namespaceURI, - String typeArg, - boolean canBubbleArg, - boolean cancelableArg, - AbstractView viewArg, - int detailArg); - -} diff --git a/src/bind/java/org/inkscape/dom/smil/ElementExclusiveTimeContainerImpl.java b/src/bind/java/org/inkscape/dom/smil/ElementExclusiveTimeContainerImpl.java deleted file mode 100644 index bc9ce930e..000000000 --- a/src/bind/java/org/inkscape/dom/smil/ElementExclusiveTimeContainerImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - -import org.w3c.dom.DOMException; -import org.w3c.dom.NodeList; - - -public class ElementExclusiveTimeContainerImpl - extends ElementTimeContainerImpl - implements org.w3c.dom.smil.ElementExclusiveTimeContainer -{ - - -public native String getEndSync(); -public native void setEndSync(String endSync) - throws DOMException; - - -public native NodeList getPausedElements(); - - -} - diff --git a/src/bind/java/org/inkscape/dom/smil/ElementLayoutImpl.java b/src/bind/java/org/inkscape/dom/smil/ElementLayoutImpl.java deleted file mode 100644 index 2dfeacbe7..000000000 --- a/src/bind/java/org/inkscape/dom/smil/ElementLayoutImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - -import org.w3c.dom.DOMException; - - -public class ElementLayoutImpl - extends - org.inkscape.cmn.BaseInterface - implements org.w3c.dom.smil.ElementLayout -{ - -public native String getTitle(); -public native void setTitle(String title) throws DOMException; -public native String getBackgroundColor(); -public native void setBackgroundColor(String backgroundColor) throws DOMException; -public native int getHeight(); -public native void setHeight(int height) throws DOMException; -public native int getWidth(); -public native void setWidth(int width) throws DOMException; - -} - diff --git a/src/bind/java/org/inkscape/dom/smil/ElementParallelTimeContainerImpl.java b/src/bind/java/org/inkscape/dom/smil/ElementParallelTimeContainerImpl.java deleted file mode 100644 index 1feed68dd..000000000 --- a/src/bind/java/org/inkscape/dom/smil/ElementParallelTimeContainerImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - -import org.w3c.dom.DOMException; - - -public class ElementParallelTimeContainerImpl - extends ElementTimeContainerImpl - implements org.w3c.dom.smil.ElementParallelTimeContainer -{ - -public native String getEndSync(); -public native void setEndSync(String endSync) - throws DOMException; - - -public native float getImplicitDuration(); - -} - diff --git a/src/bind/java/org/inkscape/dom/smil/ElementSequentialTimeContainerImpl.java b/src/bind/java/org/inkscape/dom/smil/ElementSequentialTimeContainerImpl.java deleted file mode 100644 index 51a3abd38..000000000 --- a/src/bind/java/org/inkscape/dom/smil/ElementSequentialTimeContainerImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - - -public class ElementSequentialTimeContainerImpl - extends ElementTimeContainerImpl - implements org.w3c.dom.smil.ElementSequentialTimeContainer -{ -} - diff --git a/src/bind/java/org/inkscape/dom/smil/ElementSyncBehaviorImpl.java b/src/bind/java/org/inkscape/dom/smil/ElementSyncBehaviorImpl.java deleted file mode 100644 index 891895064..000000000 --- a/src/bind/java/org/inkscape/dom/smil/ElementSyncBehaviorImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - - -public class ElementSyncBehaviorImpl - extends - org.inkscape.cmn.BaseInterface - implements org.w3c.dom.smil.ElementSyncBehavior -{ - -public native String getSyncBehavior(); - - -public native float getSyncTolerance(); - - -public native String getDefaultSyncBehavior(); - - -public native float getDefaultSyncTolerance(); - - -public native boolean getSyncMaster(); - -} - diff --git a/src/bind/java/org/inkscape/dom/smil/ElementTargetAttributesImpl.java b/src/bind/java/org/inkscape/dom/smil/ElementTargetAttributesImpl.java deleted file mode 100644 index e406a67e9..000000000 --- a/src/bind/java/org/inkscape/dom/smil/ElementTargetAttributesImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - - -public class ElementTargetAttributesImpl - extends - org.inkscape.cmn.BaseInterface - implements org.w3c.dom.smil.ElementTargetAttributes -{ - -public native String getAttributeName(); -public native void setAttributeName(String attributeName); - - -public native short getAttributeType(); -public native void setAttributeType(short attributeType); - -} - diff --git a/src/bind/java/org/inkscape/dom/smil/ElementTestImpl.java b/src/bind/java/org/inkscape/dom/smil/ElementTestImpl.java deleted file mode 100644 index 8ab0c57b5..000000000 --- a/src/bind/java/org/inkscape/dom/smil/ElementTestImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - -import org.w3c.dom.DOMException; - -public class ElementTestImpl - extends - org.inkscape.cmn.BaseInterface - implements org.w3c.dom.smil.ElementTest -{ - -public native int getSystemBitrate(); -public native void setSystemBitrate(int systemBitrate) - throws DOMException; - - -public native boolean getSystemCaptions(); -public native void setSystemCaptions(boolean systemCaptions) - throws DOMException; - - -public native String getSystemLanguage(); -public native void setSystemLanguage(String systemLanguage) - throws DOMException; - - -public native boolean getSystemRequired(); - - -public native boolean getSystemScreenSize(); - - -public native boolean getSystemScreenDepth(); - - -public native String getSystemOverdubOrSubtitle(); -public native void setSystemOverdubOrSubtitle(String systemOverdubOrSubtitle) - throws DOMException; - - -public native boolean getSystemAudioDesc(); -public native void setSystemAudioDesc(boolean systemAudioDesc) - throws DOMException; - -} - diff --git a/src/bind/java/org/inkscape/dom/smil/ElementTimeContainerImpl.java b/src/bind/java/org/inkscape/dom/smil/ElementTimeContainerImpl.java deleted file mode 100644 index 2f4fc4cb2..000000000 --- a/src/bind/java/org/inkscape/dom/smil/ElementTimeContainerImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - -import org.w3c.dom.NodeList; - - -public class ElementTimeContainerImpl - extends ElementTimeImpl - implements org.w3c.dom.smil.ElementTimeContainer -{ - -public native NodeList getTimeChildren(); -public native NodeList getActiveChildrenAt(float instant); - -} - diff --git a/src/bind/java/org/inkscape/dom/smil/ElementTimeControlImpl.java b/src/bind/java/org/inkscape/dom/smil/ElementTimeControlImpl.java deleted file mode 100644 index e82161139..000000000 --- a/src/bind/java/org/inkscape/dom/smil/ElementTimeControlImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - -import org.w3c.dom.DOMException; - - -public class ElementTimeControlImpl - extends - org.inkscape.cmn.BaseInterface - implements org.w3c.dom.smil.ElementTimeControl -{ -public native boolean beginElement() throws DOMException; -public native boolean endElement() throws DOMException; -public native boolean beginElementAt(float offset) throws DOMException; -public native boolean endElementAt(float offset) throws DOMException; - -} - diff --git a/src/bind/java/org/inkscape/dom/smil/ElementTimeImpl.java b/src/bind/java/org/inkscape/dom/smil/ElementTimeImpl.java deleted file mode 100644 index fd1567033..000000000 --- a/src/bind/java/org/inkscape/dom/smil/ElementTimeImpl.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.smil.TimeList; - - - -public class ElementTimeImpl - extends - org.inkscape.cmn.BaseInterface - implements org.w3c.dom.smil.ElementTime -{ - -public native TimeList getBegin(); -public native void setBegin(TimeList begin) - throws DOMException; - - -public native TimeList getEnd(); -public native void setEnd(TimeList end) - throws DOMException; - - -public native float getDur(); -public native void setDur(float dur) - throws DOMException; - - - -public native short getRestart(); -public native void setRestart(short restart) - throws DOMException; - - - -public native short getFill(); -public native void setFill(short fill) - throws DOMException; - - -public native float getRepeatCount(); -public native void setRepeatCount(float repeatCount) - throws DOMException; - - -public native float getRepeatDur(); -public native void setRepeatDur(float repeatDur) - throws DOMException; - - -public native boolean beginElement(); - - -public native boolean endElement(); - - -public native void pauseElement(); - - -public native void resumeElement(); - - -public native void seekElement(float seekTo); - -} - diff --git a/src/bind/java/org/inkscape/dom/smil/ElementTimeManipulationImpl.java b/src/bind/java/org/inkscape/dom/smil/ElementTimeManipulationImpl.java deleted file mode 100644 index 89acd6188..000000000 --- a/src/bind/java/org/inkscape/dom/smil/ElementTimeManipulationImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - -import org.w3c.dom.DOMException; - - -public class ElementTimeManipulationImpl - extends - org.inkscape.cmn.BaseInterface - implements org.w3c.dom.smil.ElementTimeManipulation -{ - -public native float getSpeed(); -public native void setSpeed(float speed) - throws DOMException; - - -public native float getAccelerate(); -public native void setAccelerate(float accelerate) - throws DOMException; - - -public native float getDecelerate(); -public native void setDecelerate(float decelerate) - throws DOMException; - - -public native boolean getAutoReverse(); -public native void setAutoReverse(boolean autoReverse) - throws DOMException; - -} - diff --git a/src/bind/java/org/inkscape/dom/smil/SMILAnimateColorElementImpl.java b/src/bind/java/org/inkscape/dom/smil/SMILAnimateColorElementImpl.java deleted file mode 100644 index 028bda1a9..000000000 --- a/src/bind/java/org/inkscape/dom/smil/SMILAnimateColorElementImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - - -public class SMILAnimateColorElementImpl - extends SMILAnimationImpl - implements org.w3c.dom.smil.SMILAnimateColorElement -{ -} - diff --git a/src/bind/java/org/inkscape/dom/smil/SMILAnimateElementImpl.java b/src/bind/java/org/inkscape/dom/smil/SMILAnimateElementImpl.java deleted file mode 100644 index 371174d4e..000000000 --- a/src/bind/java/org/inkscape/dom/smil/SMILAnimateElementImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - - -public class SMILAnimateElementImpl - extends SMILAnimationImpl - implements org.w3c.dom.smil.SMILAnimateElement -{ -} - diff --git a/src/bind/java/org/inkscape/dom/smil/SMILAnimateMotionElementImpl.java b/src/bind/java/org/inkscape/dom/smil/SMILAnimateMotionElementImpl.java deleted file mode 100644 index b5f9a5a10..000000000 --- a/src/bind/java/org/inkscape/dom/smil/SMILAnimateMotionElementImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - -import org.w3c.dom.DOMException; - - -public class SMILAnimateMotionElementImpl - extends SMILAnimateElementImpl - implements org.w3c.dom.smil.SMILAnimateMotionElement -{ - -public native String getPath(); -public native void setPath(String path) throws DOMException; - -public native String getOrigin(); -public native void setOrigin(String origin) throws DOMException; - -} - diff --git a/src/bind/java/org/inkscape/dom/smil/SMILAnimationImpl.java b/src/bind/java/org/inkscape/dom/smil/SMILAnimationImpl.java deleted file mode 100644 index 46c8feeb3..000000000 --- a/src/bind/java/org/inkscape/dom/smil/SMILAnimationImpl.java +++ /dev/null @@ -1,153 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.smil.TimeList; - - -public class SMILAnimationImpl - extends SMILElementImpl - //ElementTargetAttributes, - //ElementTime, - //ElementTimeControl - implements org.w3c.dom.smil.SMILAnimation -{ - -public SMILAnimationImpl() -{ - imbue(_ElementTargetAttributes = new ElementTargetAttributesImpl()); - imbue(_ElementTime = new ElementTimeImpl()); - imbue(_ElementTimeControl = new ElementTimeControlImpl()); -} - -//from ElementTargetAttributes -ElementTargetAttributesImpl _ElementTargetAttributes; -public String getAttributeName() - { return _ElementTargetAttributes.getAttributeName(); } -public void setAttributeName(String attributeName) - { _ElementTargetAttributes.setAttributeName(attributeName); } -public short getAttributeType() - { return _ElementTargetAttributes.getAttributeType(); } -public void setAttributeType(short attributeType) - { _ElementTargetAttributes.setAttributeType(attributeType); } -//end ElementTargetAttributes - -//from ElementTime -ElementTimeImpl _ElementTime; -public TimeList getBegin() - { return _ElementTime.getBegin(); } -public void setBegin(TimeList begin) throws DOMException - { _ElementTime.setBegin(begin); } -public TimeList getEnd() - { return _ElementTime.getEnd(); } -public void setEnd(TimeList end) throws DOMException - { _ElementTime.setEnd(end); } -public float getDur() - { return _ElementTime.getDur(); } -public void setDur(float dur) throws DOMException - { _ElementTime.setDur(dur); } -public short getRestart() - { return _ElementTime.getRestart(); } -public void setRestart(short restart) throws DOMException - { _ElementTime.setRestart(restart); } -public short getFill() - { return _ElementTime.getFill(); } -public void setFill(short fill) throws DOMException - { _ElementTime.setFill(fill); } -public float getRepeatCount() - { return _ElementTime.getRepeatCount(); } -public void setRepeatCount(float repeatCount) throws DOMException - { _ElementTime.setRepeatCount(repeatCount); } -public float getRepeatDur() - { return _ElementTime.getRepeatDur(); } -public void setRepeatDur(float repeatDur) throws DOMException - { _ElementTime.setRepeatDur(repeatDur); } -public boolean beginElement() - { return _ElementTime.beginElement(); } -public boolean endElement() - { return _ElementTime.endElement(); } -public void pauseElement() - { _ElementTime.pauseElement(); } -public void resumeElement() - { _ElementTime.resumeElement(); } -public void seekElement(float seekTo) - { _ElementTime.seekElement(seekTo); } -//end ElementTime - - -//from ElementTimeControl -ElementTimeControlImpl _ElementTimeControl; -public boolean beginElementAt(float offset) throws DOMException - { return _ElementTimeControl.beginElementAt(offset); } -public boolean endElementAt(float offset) throws DOMException - { return _ElementTimeControl.endElementAt(offset); } -//end ElementTimeControl - - -public native short getAdditive(); -public native void setAdditive(short additive) - throws DOMException; - - -public native short getAccumulate(); -public native void setAccumulate(short accumulate) - throws DOMException; - -public native short getCalcMode(); -public native void setCalcMode(short calcMode) - throws DOMException; - -public native String getKeySplines(); -public native void setKeySplines(String keySplines) - throws DOMException; - -public native TimeList getKeyTimes(); -public native void setKeyTimes(TimeList keyTimes) - throws DOMException; - -public native String getValues(); -public native void setValues(String values) - throws DOMException; - -public native String getFrom(); -public native void setFrom(String from) - throws DOMException; - -public native String getTo(); -public native void setTo(String to) - throws DOMException; - -public native String getBy(); -public native void setBy(String by) - throws DOMException; - -} - diff --git a/src/bind/java/org/inkscape/dom/smil/SMILDocumentImpl.java b/src/bind/java/org/inkscape/dom/smil/SMILDocumentImpl.java deleted file mode 100644 index 15104bf47..000000000 --- a/src/bind/java/org/inkscape/dom/smil/SMILDocumentImpl.java +++ /dev/null @@ -1,103 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.NodeList; -import org.w3c.dom.smil.TimeList; - - - -public class SMILDocumentImpl - extends org.inkscape.dom.DocumentImpl - //ElementTimeContainer - implements org.w3c.dom.smil.SMILDocument -{ -public SMILDocumentImpl() -{ - imbue(_ElementTimeContainer = new ElementTimeContainerImpl()); - _ElementTime = (ElementTimeImpl)_ElementTimeContainer; -} - - - -//from ElementTimeContainer -ElementTimeContainerImpl _ElementTimeContainer; -public NodeList getTimeChildren() - { return _ElementTimeContainer.getTimeChildren(); } -public NodeList getActiveChildrenAt(float instant) - { return _ElementTimeContainer.getActiveChildrenAt(instant); } -//end ElementTimeContainer - -//from ElementTime -ElementTimeImpl _ElementTime; -public TimeList getBegin() - { return _ElementTime.getBegin(); } -public void setBegin(TimeList begin) throws DOMException - { _ElementTime.setBegin(begin); } -public TimeList getEnd() - { return _ElementTime.getEnd(); } -public void setEnd(TimeList end) throws DOMException - { _ElementTime.setEnd(end); } -public float getDur() - { return _ElementTime.getDur(); } -public void setDur(float dur) throws DOMException - { _ElementTime.setDur(dur); } -public short getRestart() - { return _ElementTime.getRestart(); } -public void setRestart(short restart) throws DOMException - { _ElementTime.setRestart(restart); } -public short getFill() - { return _ElementTime.getFill(); } -public void setFill(short fill) throws DOMException - { _ElementTime.setFill(fill); } -public float getRepeatCount() - { return _ElementTime.getRepeatCount(); } -public void setRepeatCount(float repeatCount) throws DOMException - { _ElementTime.setRepeatCount(repeatCount); } -public float getRepeatDur() - { return _ElementTime.getRepeatDur(); } -public void setRepeatDur(float repeatDur) throws DOMException - { _ElementTime.setRepeatDur(repeatDur); } -public boolean beginElement() - { return _ElementTime.beginElement(); } -public boolean endElement() - { return _ElementTime.endElement(); } -public void pauseElement() - { _ElementTime.pauseElement(); } -public void resumeElement() - { _ElementTime.resumeElement(); } -public void seekElement(float seekTo) - { _ElementTime.seekElement(seekTo); } -//end ElementTime - - -} - diff --git a/src/bind/java/org/inkscape/dom/smil/SMILElementImpl.java b/src/bind/java/org/inkscape/dom/smil/SMILElementImpl.java deleted file mode 100644 index d69fdf02e..000000000 --- a/src/bind/java/org/inkscape/dom/smil/SMILElementImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - -import org.w3c.dom.DOMException; - -public class SMILElementImpl - extends org.inkscape.dom.ElementImpl - implements org.w3c.dom.smil.SMILElement -{ - -public native String getId(); -public native void setId(String id) throws DOMException; - -} - diff --git a/src/bind/java/org/inkscape/dom/smil/SMILLayoutElementImpl.java b/src/bind/java/org/inkscape/dom/smil/SMILLayoutElementImpl.java deleted file mode 100644 index 51fc5912a..000000000 --- a/src/bind/java/org/inkscape/dom/smil/SMILLayoutElementImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - - -public class SMILLayoutElementImpl - extends SMILElementImpl - implements org.w3c.dom.smil.SMILLayoutElement -{ - -public native String getType(); - - -public native boolean getResolved(); - -} - diff --git a/src/bind/java/org/inkscape/dom/smil/SMILMediaElementImpl.java b/src/bind/java/org/inkscape/dom/smil/SMILMediaElementImpl.java deleted file mode 100644 index 67e8b032a..000000000 --- a/src/bind/java/org/inkscape/dom/smil/SMILMediaElementImpl.java +++ /dev/null @@ -1,152 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.smil.TimeList; - - - -public class SMILMediaElementImpl - extends SMILElementImpl - //ElementTime - implements org.w3c.dom.smil.SMILMediaElement -{ -public SMILMediaElementImpl() -{ - imbue(_ElementTime = new ElementTimeImpl()); -} - -//from ElementTime -ElementTimeImpl _ElementTime; -public TimeList getBegin() - { return _ElementTime.getBegin(); } -public void setBegin(TimeList begin) throws DOMException - { _ElementTime.setBegin(begin); } -public TimeList getEnd() - { return _ElementTime.getEnd(); } -public void setEnd(TimeList end) throws DOMException - { _ElementTime.setEnd(end); } -public float getDur() - { return _ElementTime.getDur(); } -public void setDur(float dur) throws DOMException - { _ElementTime.setDur(dur); } -public short getRestart() - { return _ElementTime.getRestart(); } -public void setRestart(short restart) throws DOMException - { _ElementTime.setRestart(restart); } -public short getFill() - { return _ElementTime.getFill(); } -public void setFill(short fill) throws DOMException - { _ElementTime.setFill(fill); } -public float getRepeatCount() - { return _ElementTime.getRepeatCount(); } -public void setRepeatCount(float repeatCount) throws DOMException - { _ElementTime.setRepeatCount(repeatCount); } -public float getRepeatDur() - { return _ElementTime.getRepeatDur(); } -public void setRepeatDur(float repeatDur) throws DOMException - { _ElementTime.setRepeatDur(repeatDur); } -public boolean beginElement() - { return _ElementTime.beginElement(); } -public boolean endElement() - { return _ElementTime.endElement(); } -public void pauseElement() - { _ElementTime.pauseElement(); } -public void resumeElement() - { _ElementTime.resumeElement(); } -public void seekElement(float seekTo) - { _ElementTime.seekElement(seekTo); } -//end ElementTime - - -public native String getAbstractAttr(); -public native void setAbstractAttr(String abstractAttr) - throws DOMException; - - -public native String getAlt(); -public native void setAlt(String alt) - throws DOMException; - -public native String getAuthor(); -public native void setAuthor(String author) - throws DOMException; - -public native String getClipBegin(); -public native void setClipBegin(String clipBegin) - throws DOMException; - -public native String getClipEnd(); -public native void setClipEnd(String clipEnd) - throws DOMException; - -public native String getCopyright(); -public native void setCopyright(String copyright) - throws DOMException; - -public native String getLongdesc(); -public native void setLongdesc(String longdesc) - throws DOMException; - -public native String getPort(); -public native void setPort(String port) - throws DOMException; - -public native String getReadIndex(); -public native void setReadIndex(String readIndex) - throws DOMException; - -public native String getRtpformat(); -public native void setRtpformat(String rtpformat) - throws DOMException; - -public native String getSrc(); -public native void setSrc(String src) - throws DOMException; - -public native String getStripRepeat(); -public native void setStripRepeat(String stripRepeat) - throws DOMException; - -public native String getTitle(); -public native void setTitle(String title) - throws DOMException; - -public native String getTransport(); -public native void setTransport(String transport) - throws DOMException; - -public native String getType(); -public native void setType(String type) - throws DOMException; - -} - diff --git a/src/bind/java/org/inkscape/dom/smil/SMILRefElementImpl.java b/src/bind/java/org/inkscape/dom/smil/SMILRefElementImpl.java deleted file mode 100644 index 1eb3d6a28..000000000 --- a/src/bind/java/org/inkscape/dom/smil/SMILRefElementImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - - -public class SMILRefElementImpl - extends SMILMediaElementImpl - implements org.w3c.dom.smil.SMILRefElement -{ -} - diff --git a/src/bind/java/org/inkscape/dom/smil/SMILRegionElementImpl.java b/src/bind/java/org/inkscape/dom/smil/SMILRegionElementImpl.java deleted file mode 100644 index d85cf3d0f..000000000 --- a/src/bind/java/org/inkscape/dom/smil/SMILRegionElementImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - -import org.w3c.dom.DOMException; - - -public class SMILRegionElementImpl - extends SMILElementImpl - //ElementLayout - implements org.w3c.dom.smil.SMILRegionElement -{ - -public SMILRegionElementImpl() -{ - imbue(_ElementLayout = new ElementLayoutImpl()); -} - -//from ElementLayout -ElementLayoutImpl _ElementLayout; -public String getTitle() - { return _ElementLayout.getTitle(); } -public void setTitle(String title) throws DOMException - { _ElementLayout.setTitle(title); } -public String getBackgroundColor() - { return _ElementLayout.getBackgroundColor(); } -public void setBackgroundColor(String backgroundColor) throws DOMException - { _ElementLayout.setBackgroundColor(backgroundColor); } -public int getHeight() - { return _ElementLayout.getHeight(); } -public void setHeight(int height) throws DOMException - { _ElementLayout.setHeight(height); } -public int getWidth() - { return _ElementLayout.getWidth(); } -public void setWidth(int width) throws DOMException - { _ElementLayout.setWidth(width); } -//end ElementLayout - - -public native String getFit(); -public native void setFit(String fit) throws DOMException; - -public native String getTop(); -public native void setTop(String top) throws DOMException; - -public native int getZIndex(); -public native void setZIndex(int zIndex) throws DOMException; - -} - diff --git a/src/bind/java/org/inkscape/dom/smil/SMILRegionInterfaceImpl.java b/src/bind/java/org/inkscape/dom/smil/SMILRegionInterfaceImpl.java deleted file mode 100644 index 1f44f9d1b..000000000 --- a/src/bind/java/org/inkscape/dom/smil/SMILRegionInterfaceImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - -import org.w3c.dom.smil.SMILRegionElement; - - -public class SMILRegionInterfaceImpl - implements org.w3c.dom.smil.SMILRegionInterface -{ - -public native SMILRegionElement getRegion(); -public native void setRegion(SMILRegionElement region); - -} - diff --git a/src/bind/java/org/inkscape/dom/smil/SMILRootLayoutElementImpl.java b/src/bind/java/org/inkscape/dom/smil/SMILRootLayoutElementImpl.java deleted file mode 100644 index 01def0622..000000000 --- a/src/bind/java/org/inkscape/dom/smil/SMILRootLayoutElementImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - -import org.w3c.dom.DOMException; - - - -public class SMILRootLayoutElementImpl - extends SMILElementImpl - //, ElementLayout - implements org.w3c.dom.smil.SMILRootLayoutElement -{ - -public SMILRootLayoutElementImpl() -{ - imbue(_ElementLayout = new ElementLayoutImpl()); -} - -//from ElementLayout -ElementLayoutImpl _ElementLayout; -public String getTitle() - { return _ElementLayout.getTitle(); } -public void setTitle(String title) throws DOMException - { _ElementLayout.setTitle(title); } -public String getBackgroundColor() - { return _ElementLayout.getBackgroundColor(); } -public void setBackgroundColor(String backgroundColor) throws DOMException - { _ElementLayout.setBackgroundColor(backgroundColor); } -public int getHeight() - { return _ElementLayout.getHeight(); } -public void setHeight(int height) throws DOMException - { _ElementLayout.setHeight(height); } -public int getWidth() - { return _ElementLayout.getWidth(); } -public void setWidth(int width) throws DOMException - { _ElementLayout.setWidth(width); } -//end ElementLayout - -} - diff --git a/src/bind/java/org/inkscape/dom/smil/SMILSetElementImpl.java b/src/bind/java/org/inkscape/dom/smil/SMILSetElementImpl.java deleted file mode 100644 index fce213000..000000000 --- a/src/bind/java/org/inkscape/dom/smil/SMILSetElementImpl.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.smil.TimeList; - - - -public class SMILSetElementImpl - extends SMILElementImpl - //ElementTimeControl, - //ElementTime, - //ElementTargetAttributes - implements org.w3c.dom.smil.SMILSetElement -{ - -public SMILSetElementImpl() -{ - imbue(_ElementTimeControl = new ElementTimeControlImpl()); - imbue(_ElementTime = new ElementTimeImpl()); - imbue(_ElementTargetAttributes = new ElementTargetAttributesImpl()); -} - - -//from ElementTimeControl -ElementTimeControlImpl _ElementTimeControl; -public boolean beginElementAt(float offset) throws DOMException - { return _ElementTimeControl.beginElementAt(offset); } -public boolean endElementAt(float offset) throws DOMException - { return _ElementTimeControl.endElementAt(offset); } -//end ElementTimeControl - -//from ElementTime -ElementTimeImpl _ElementTime; -public TimeList getBegin() - { return _ElementTime.getBegin(); } -public void setBegin(TimeList begin) throws DOMException - { _ElementTime.setBegin(begin); } -public TimeList getEnd() - { return _ElementTime.getEnd(); } -public void setEnd(TimeList end) throws DOMException - { _ElementTime.setEnd(end); } -public float getDur() - { return _ElementTime.getDur(); } -public void setDur(float dur) throws DOMException - { _ElementTime.setDur(dur); } -public short getRestart() - { return _ElementTime.getRestart(); } -public void setRestart(short restart) throws DOMException - { _ElementTime.setRestart(restart); } -public short getFill() - { return _ElementTime.getFill(); } -public void setFill(short fill) throws DOMException - { _ElementTime.setFill(fill); } -public float getRepeatCount() - { return _ElementTime.getRepeatCount(); } -public void setRepeatCount(float repeatCount) throws DOMException - { _ElementTime.setRepeatCount(repeatCount); } -public float getRepeatDur() - { return _ElementTime.getRepeatDur(); } -public void setRepeatDur(float repeatDur) throws DOMException - { _ElementTime.setRepeatDur(repeatDur); } -public boolean beginElement() - { return _ElementTime.beginElement(); } -public boolean endElement() - { return _ElementTime.endElement(); } -public void pauseElement() - { _ElementTime.pauseElement(); } -public void resumeElement() - { _ElementTime.resumeElement(); } -public void seekElement(float seekTo) - { _ElementTime.seekElement(seekTo); } -//end ElementTime - -//from ElementTargetAttributes -ElementTargetAttributesImpl _ElementTargetAttributes; -public String getAttributeName() - { return _ElementTargetAttributes.getAttributeName(); } -public void setAttributeName(String attributeName) - { _ElementTargetAttributes.setAttributeName(attributeName); } -public short getAttributeType() - { return _ElementTargetAttributes.getAttributeType(); } -public void setAttributeType(short attributeType) - { _ElementTargetAttributes.setAttributeType(attributeType); } -//end ElementTargetAttributes - - - - -public native String getTo(); -public native void setTo(String to); - -} - diff --git a/src/bind/java/org/inkscape/dom/smil/SMILSwitchElementImpl.java b/src/bind/java/org/inkscape/dom/smil/SMILSwitchElementImpl.java deleted file mode 100644 index 78fe093b5..000000000 --- a/src/bind/java/org/inkscape/dom/smil/SMILSwitchElementImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - - -public class SMILSwitchElementImpl - extends SMILElementImpl - implements org.w3c.dom.smil.SMILSwitchElement -{ - -public native org.w3c.dom.Element getSelectedElement(); - -} - diff --git a/src/bind/java/org/inkscape/dom/smil/SMILTopLayoutElementImpl.java b/src/bind/java/org/inkscape/dom/smil/SMILTopLayoutElementImpl.java deleted file mode 100644 index c5982e5b3..000000000 --- a/src/bind/java/org/inkscape/dom/smil/SMILTopLayoutElementImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - -import org.w3c.dom.DOMException; - - - -public class SMILTopLayoutElementImpl - extends SMILElementImpl - //, ElementLayout - implements org.w3c.dom.smil.SMILTopLayoutElement -{ -public SMILTopLayoutElementImpl() -{ - imbue(_ElementLayout = new ElementLayoutImpl()); -} - -//from ElementLayout -ElementLayoutImpl _ElementLayout; -public String getTitle() - { return _ElementLayout.getTitle(); } -public void setTitle(String title) throws DOMException - { _ElementLayout.setTitle(title); } -public String getBackgroundColor() - { return _ElementLayout.getBackgroundColor(); } -public void setBackgroundColor(String backgroundColor) throws DOMException - { _ElementLayout.setBackgroundColor(backgroundColor); } -public int getHeight() - { return _ElementLayout.getHeight(); } -public void setHeight(int height) throws DOMException - { _ElementLayout.setHeight(height); } -public int getWidth() - { return _ElementLayout.getWidth(); } -public void setWidth(int width) throws DOMException - { _ElementLayout.setWidth(width); } -//end ElementLayout - -} - diff --git a/src/bind/java/org/inkscape/dom/smil/TimeEventImpl.java b/src/bind/java/org/inkscape/dom/smil/TimeEventImpl.java deleted file mode 100644 index 40305a7ba..000000000 --- a/src/bind/java/org/inkscape/dom/smil/TimeEventImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - -import org.w3c.dom.views.AbstractView; - - - -public class TimeEventImpl - extends org.inkscape.dom.events.EventImpl - implements org.w3c.dom.smil.TimeEvent -{ - -public native AbstractView getView(); - -public native int getDetail(); - -public native void initTimeEvent(String typeArg, - AbstractView viewArg, - int detailArg); - -} - diff --git a/src/bind/java/org/inkscape/dom/smil/TimeImpl.java b/src/bind/java/org/inkscape/dom/smil/TimeImpl.java deleted file mode 100644 index e5c6d5987..000000000 --- a/src/bind/java/org/inkscape/dom/smil/TimeImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - -import org.w3c.dom.DOMException; -import org.w3c.dom.Element; - - - -public class TimeImpl - implements org.w3c.dom.smil.Time -{ - -public native boolean getResolved(); - -public native double getResolvedOffset(); - -public native short getTimeType(); - -public native double getOffset(); -public native void setOffset(double offset) - throws DOMException; - -public native Element getBaseElement(); -public native void setBaseElement(Element baseElement) - throws DOMException; - - -public native boolean getBaseBegin(); -public native void setBaseBegin(boolean baseBegin) - throws DOMException; - - -public native String getEvent(); -public native void setEvent(String event) - throws DOMException; - - -public native String getMarker(); -public native void setMarker(String marker) - throws DOMException; - -} - diff --git a/src/bind/java/org/inkscape/dom/smil/TimeListImpl.java b/src/bind/java/org/inkscape/dom/smil/TimeListImpl.java deleted file mode 100644 index 88759e61b..000000000 --- a/src/bind/java/org/inkscape/dom/smil/TimeListImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that the SMIL files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/smil-boston-dom/java-binding.html - */ - -package org.inkscape.dom.smil; - -import org.w3c.dom.smil.Time; - - -public class TimeListImpl - implements org.w3c.dom.smil.TimeList -{ - -public native Time item(int index); - -public native int getLength(); - -} - diff --git a/src/bind/java/org/inkscape/dom/stylesheets/DocumentStyleImpl.java b/src/bind/java/org/inkscape/dom/stylesheets/DocumentStyleImpl.java deleted file mode 100644 index 924e06d4e..000000000 --- a/src/bind/java/org/inkscape/dom/stylesheets/DocumentStyleImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style/ - */ - - -package org.inkscape.dom.stylesheets; - -import org.w3c.dom.stylesheets.StyleSheetList; - - -public class DocumentStyleImpl - extends - org.inkscape.cmn.BaseInterface - implements org.w3c.dom.stylesheets.DocumentStyle -{ - -public native StyleSheetList getStyleSheets(); - -} diff --git a/src/bind/java/org/inkscape/dom/stylesheets/LinkStyleImpl.java b/src/bind/java/org/inkscape/dom/stylesheets/LinkStyleImpl.java deleted file mode 100644 index 8497fbccd..000000000 --- a/src/bind/java/org/inkscape/dom/stylesheets/LinkStyleImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style/ - */ - -package org.inkscape.dom.stylesheets; - -import org.w3c.dom.stylesheets.StyleSheet; - - - -public class LinkStyleImpl - implements org.w3c.dom.stylesheets.LinkStyle -{ - -public native StyleSheet getSheet(); - -} diff --git a/src/bind/java/org/inkscape/dom/stylesheets/MediaListImpl.java b/src/bind/java/org/inkscape/dom/stylesheets/MediaListImpl.java deleted file mode 100644 index 7451dd55d..000000000 --- a/src/bind/java/org/inkscape/dom/stylesheets/MediaListImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style/ - */ - - -package org.inkscape.dom.stylesheets; - -import org.w3c.dom.DOMException; - - -public class MediaListImpl - implements org.w3c.dom.stylesheets.MediaList -{ - -public native String getMediaText(); -public native void setMediaText(String mediaText) - throws DOMException; - -public native int getLength(); - -public native String item(int index); - -public native void deleteMedium(String oldMedium) - throws DOMException; - -public native void appendMedium(String newMedium) - throws DOMException; - -} diff --git a/src/bind/java/org/inkscape/dom/stylesheets/StyleSheetImpl.java b/src/bind/java/org/inkscape/dom/stylesheets/StyleSheetImpl.java deleted file mode 100644 index 7383fa871..000000000 --- a/src/bind/java/org/inkscape/dom/stylesheets/StyleSheetImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style/ - */ - -package org.inkscape.dom.stylesheets; - -import org.w3c.dom.Node; -import org.w3c.dom.stylesheets.StyleSheet; -import org.w3c.dom.stylesheets.MediaList; - - - -public class StyleSheetImpl - implements org.w3c.dom.stylesheets.StyleSheet -{ - -public native String getType(); - -public native boolean getDisabled(); -public native void setDisabled(boolean disabled); - -public native Node getOwnerNode(); - -public native StyleSheet getParentStyleSheet(); - -public native String getHref(); - -public native String getTitle(); - -public native MediaList getMedia(); - -} diff --git a/src/bind/java/org/inkscape/dom/stylesheets/StyleSheetListImpl.java b/src/bind/java/org/inkscape/dom/stylesheets/StyleSheetListImpl.java deleted file mode 100644 index 11d024948..000000000 --- a/src/bind/java/org/inkscape/dom/stylesheets/StyleSheetListImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these DOM files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/DOM-Level-2-Style/ - */ - - -package org.inkscape.dom.stylesheets; - -import org.w3c.dom.stylesheets.StyleSheet; - -public class StyleSheetListImpl - implements org.w3c.dom.stylesheets.StyleSheetList -{ - -public native int getLength(); - -public native StyleSheet item(int index); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/GetSVGDocumentImpl.java b/src/bind/java/org/inkscape/dom/svg/GetSVGDocumentImpl.java deleted file mode 100644 index afa49fd2f..000000000 --- a/src/bind/java/org/inkscape/dom/svg/GetSVGDocumentImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; -import org.w3c.dom.svg.SVGDocument; - - -public class GetSVGDocumentImpl - implements org.w3c.dom.svg.GetSVGDocument -{ - -public native SVGDocument getSVGDocument ( ) - throws DOMException; - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGAElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGAElementImpl.java deleted file mode 100644 index 5a2c8986f..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGAElementImpl.java +++ /dev/null @@ -1,176 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - -import org.w3c.dom.events.Event; -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.events.EventException; -import org.w3c.dom.events.EventListener; - - -public class SVGAElementImpl - extends - SVGElementImpl - //SVGURIReference, - //SVGTests, - //SVGLangSpace, - //SVGExternalResourcesRequired, - //SVGStylable, - //SVGTransformable, - //EventTarget - implements org.w3c.dom.svg.SVGAElement -{ - -public SVGAElementImpl() -{ - imbue(_SVGURIReference = new SVGURIReferenceImpl()); - imbue(_SVGTests = new SVGTestsImpl()); - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); - imbue(_SVGTransformable = new SVGTransformableImpl()); - imbue(_EventTarget = new org.inkscape.dom.events.EventTargetImpl()); -} - - -//from SVGURIReference -private SVGURIReferenceImpl _SVGURIReference; -public SVGAnimatedString getHref() - { return _SVGURIReference.getHref(); } -//end SVGURIReference - -//from SVGTests -private SVGTestsImpl _SVGTests; -public SVGStringList getRequiredFeatures() - { return _SVGTests.getRequiredFeatures(); } -public SVGStringList getRequiredExtensions() - { return _SVGTests.getRequiredExtensions(); } -public SVGStringList getSystemLanguage() - { return _SVGTests.getSystemLanguage(); } -public boolean hasExtension (String extension) - { return _SVGTests.hasExtension(extension); } -//end SVGTests - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - -//from SVGTransformable -private SVGTransformableImpl _SVGTransformable; -public SVGAnimatedTransformList getTransform() - { return _SVGTransformable.getTransform(); } -//end SVGTransformable - -//from SVGLocatable (from SVGTransformable) -public SVGElement getNearestViewportElement() - { return _SVGTransformable.getNearestViewportElement(); } -public SVGElement getFarthestViewportElement() - { return _SVGTransformable.getFarthestViewportElement(); } -public SVGRect getBBox() - { return _SVGTransformable.getBBox(); } -public SVGMatrix getCTM() - { return _SVGTransformable.getCTM(); } -public SVGMatrix getScreenCTM() - { return _SVGTransformable.getScreenCTM(); } -public SVGMatrix getTransformToElement (SVGElement element) - throws SVGException - { return _SVGTransformable.getTransformToElement(element); } -//end SVGLocatable - -//from EventTarget -private org.inkscape.dom.events.EventTargetImpl _EventTarget; -public void addEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.addEventListener(type, listener, useCapture); } -public void removeEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListener(type, listener, useCapture); } -public boolean dispatchEvent(Event evt) - throws EventException - { return _EventTarget.dispatchEvent(evt); } -public void addEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture, - Object evtGroup) - { _EventTarget.addEventListenerNS(namespaceURI, type, listener, useCapture, evtGroup); } -public void removeEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListenerNS(namespaceURI, type, listener, useCapture); } -public boolean willTriggerNS(String namespaceURI, - String type) - { return _EventTarget.willTriggerNS(namespaceURI, type); } -public boolean hasEventListenerNS(String namespaceURI, - String type) - { return _EventTarget.hasEventListenerNS(namespaceURI, type); } -//end EventTarget - - -public native SVGAnimatedString getTarget( ); - - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGAltGlyphDefElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGAltGlyphDefElementImpl.java deleted file mode 100644 index a7d7fa013..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGAltGlyphDefElementImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -public class SVGAltGlyphDefElementImpl - extends SVGElementImpl - implements org.w3c.dom.svg.SVGAltGlyphDefElement -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGAltGlyphElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGAltGlyphElementImpl.java deleted file mode 100644 index a3d8522cb..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGAltGlyphElementImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; -import org.w3c.dom.svg.*; - - -public class SVGAltGlyphElementImpl - extends - SVGTextPositioningElementImpl - //SVGURIReference - implements org.w3c.dom.svg.SVGAltGlyphElement -{ - -public SVGAltGlyphElementImpl() -{ - imbue(_SVGURIReference = new SVGURIReferenceImpl()); -} - -//from SVGURIReference -private SVGURIReferenceImpl _SVGURIReference; -public SVGAnimatedString getHref() - { return _SVGURIReference.getHref(); } -//end SVGURIReference - - -public native String getGlyphRef(); -public native void setGlyphRef(String glyphRef) throws DOMException; -public native String getFormat(); -public native void setFormat(String format) throws DOMException; - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGAltGlyphItemElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGAltGlyphItemElementImpl.java deleted file mode 100644 index 6c769576a..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGAltGlyphItemElementImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -public class SVGAltGlyphItemElementImpl - extends SVGElementImpl - implements org.w3c.dom.svg.SVGAltGlyphItemElement -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGAngleImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGAngleImpl.java deleted file mode 100644 index 8c6f385d4..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGAngleImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -public class SVGAngleImpl - implements org.w3c.dom.svg.SVGAngle -{ -public native short getUnitType( ); -public native float getValue( ); -public native void setValue( float value ) - throws DOMException; -public native float getValueInSpecifiedUnits( ); -public native void setValueInSpecifiedUnits( float valueInSpecifiedUnits ) - throws DOMException; -public native String getValueAsString( ); -public native void setValueAsString( String valueAsString ) - throws DOMException; - -public native void newValueSpecifiedUnits ( short unitType, float valueInSpecifiedUnits ); -public native void convertToSpecifiedUnits ( short unitType ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGAnimateColorElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGAnimateColorElementImpl.java deleted file mode 100644 index d8dbeeab0..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGAnimateColorElementImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -public class SVGAnimateColorElementImpl - extends SVGAnimationElementImpl - implements org.w3c.dom.svg.SVGAnimateColorElement -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGAnimateElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGAnimateElementImpl.java deleted file mode 100644 index fb4cf9fe0..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGAnimateElementImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -public class SVGAnimateElementImpl - extends SVGAnimationElementImpl - implements org.w3c.dom.svg.SVGAnimateElement -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGAnimateMotionElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGAnimateMotionElementImpl.java deleted file mode 100644 index 40911bf9d..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGAnimateMotionElementImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -public class SVGAnimateMotionElementImpl - extends SVGAnimationElementImpl - implements org.w3c.dom.svg.SVGAnimateMotionElement -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGAnimateTransformElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGAnimateTransformElementImpl.java deleted file mode 100644 index 1be3639ac..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGAnimateTransformElementImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -public class SVGAnimateTransformElementImpl - extends SVGAnimationElementImpl - implements org.w3c.dom.svg.SVGAnimateTransformElement -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedAngleImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGAnimatedAngleImpl.java deleted file mode 100644 index f419f49cc..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedAngleImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGAngle; - - - -public class SVGAnimatedAngleImpl - implements org.w3c.dom.svg.SVGAnimatedAngle -{ - -public native SVGAngle getBaseVal( ); -public native SVGAngle getAnimVal( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedBooleanImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGAnimatedBooleanImpl.java deleted file mode 100644 index 7501e5120..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedBooleanImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - - -public class SVGAnimatedBooleanImpl - implements org.w3c.dom.svg.SVGAnimatedBoolean -{ - -public native boolean getBaseVal( ); - -public native void setBaseVal( boolean baseVal ) - throws DOMException; - -public native boolean getAnimVal( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedEnumerationImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGAnimatedEnumerationImpl.java deleted file mode 100644 index f38118053..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedEnumerationImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -public class SVGAnimatedEnumerationImpl - implements org.w3c.dom.svg.SVGAnimatedEnumeration -{ - -public native short getBaseVal( ); - -public native void setBaseVal( short baseVal ) - throws DOMException; - -public native short getAnimVal( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedIntegerImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGAnimatedIntegerImpl.java deleted file mode 100644 index dc6ad43d1..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedIntegerImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - - -public class SVGAnimatedIntegerImpl - implements org.w3c.dom.svg.SVGAnimatedInteger -{ - -public native int getBaseVal( ); - -public native void setBaseVal( int baseVal ) - throws DOMException; - -public native int getAnimVal( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedLengthImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGAnimatedLengthImpl.java deleted file mode 100644 index 44dce05c8..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedLengthImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGLength; - - -public class SVGAnimatedLengthImpl - implements org.w3c.dom.svg.SVGAnimatedLength -{ - -public native SVGLength getBaseVal( ); - -public native SVGLength getAnimVal( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedLengthListImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGAnimatedLengthListImpl.java deleted file mode 100644 index b9ec6059a..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedLengthListImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGLengthList; - - -public class SVGAnimatedLengthListImpl - implements org.w3c.dom.svg.SVGAnimatedLengthList -{ - -public native SVGLengthList getBaseVal( ); -public native SVGLengthList getAnimVal( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedNumberImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGAnimatedNumberImpl.java deleted file mode 100644 index dffbb259c..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedNumberImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -public class SVGAnimatedNumberImpl - implements org.w3c.dom.svg.SVGAnimatedNumber -{ - -public native float getBaseVal( ); - -public native void setBaseVal( float baseVal ) - throws DOMException; - -public native float getAnimVal( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedNumberListImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGAnimatedNumberListImpl.java deleted file mode 100644 index 0862330b0..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedNumberListImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGNumberList; - - -public class SVGAnimatedNumberListImpl - implements org.w3c.dom.svg.SVGAnimatedNumberList -{ - -public native SVGNumberList getBaseVal( ); - -public native SVGNumberList getAnimVal( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedPathDataImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGAnimatedPathDataImpl.java deleted file mode 100644 index a26e0b5f7..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedPathDataImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGPathSegList; - - -public class SVGAnimatedPathDataImpl - extends - org.inkscape.cmn.BaseInterface - implements org.w3c.dom.svg.SVGAnimatedPathData -{ - -public native SVGPathSegList getPathSegList( ); -public native SVGPathSegList getNormalizedPathSegList( ); -public native SVGPathSegList getAnimatedPathSegList( ); -public native SVGPathSegList getAnimatedNormalizedPathSegList( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedPointsImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGAnimatedPointsImpl.java deleted file mode 100644 index 3b79d667a..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedPointsImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGPointList; - - -public class SVGAnimatedPointsImpl - extends - org.inkscape.cmn.BaseInterface - implements org.w3c.dom.svg.SVGAnimatedPoints -{ - -public native SVGPointList getPoints( ); -public native SVGPointList getAnimatedPoints( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedPreserveAspectRatioImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGAnimatedPreserveAspectRatioImpl.java deleted file mode 100644 index 93d463ca0..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedPreserveAspectRatioImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGPreserveAspectRatio; - - -public class SVGAnimatedPreserveAspectRatioImpl - implements org.w3c.dom.svg.SVGAnimatedPreserveAspectRatio -{ -public native SVGPreserveAspectRatio getBaseVal( ); -public native SVGPreserveAspectRatio getAnimVal( ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedRectImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGAnimatedRectImpl.java deleted file mode 100644 index ba2bc09a8..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedRectImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGRect; - -public class SVGAnimatedRectImpl - implements org.w3c.dom.svg.SVGAnimatedRect -{ -public native SVGRect getBaseVal( ); -public native SVGRect getAnimVal( ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedStringImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGAnimatedStringImpl.java deleted file mode 100644 index 4276bcb13..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedStringImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; -public class SVGAnimatedStringImpl - implements org.w3c.dom.svg.SVGAnimatedString -{ -public native String getBaseVal( ); -public native void setBaseVal( String baseVal ) - throws DOMException; -public native String getAnimVal( ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedTransformListImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGAnimatedTransformListImpl.java deleted file mode 100644 index 21a015177..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGAnimatedTransformListImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGTransformList; - - -public class SVGAnimatedTransformListImpl - implements org.w3c.dom.svg.SVGAnimatedTransformList -{ -public native SVGTransformList getBaseVal( ); -public native SVGTransformList getAnimVal( ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGAnimationElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGAnimationElementImpl.java deleted file mode 100644 index 8681052fd..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGAnimationElementImpl.java +++ /dev/null @@ -1,132 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.smil.ElementTimeControl; -import org.w3c.dom.svg.*; - -import org.w3c.dom.events.EventException; -import org.w3c.dom.events.Event; -import org.w3c.dom.events.EventListener; - - - -public class SVGAnimationElementImpl - extends - SVGElementImpl - //SVGTests, - //SVGExternalResourcesRequired, - //ElementTimeControl, - //EventTarget - implements org.w3c.dom.svg.SVGAnimationElement -{ - -public SVGAnimationElementImpl() -{ - imbue(_SVGTests = new SVGTestsImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_ElementTimeControl = new org.inkscape.dom.smil.ElementTimeControlImpl()); - imbue(_EventTarget = new org.inkscape.dom.events.EventTargetImpl()); -} - -//from SVGTests -private SVGTestsImpl _SVGTests; -public SVGStringList getRequiredFeatures() - { return _SVGTests.getRequiredFeatures(); } -public SVGStringList getRequiredExtensions() - { return _SVGTests.getRequiredExtensions(); } -public SVGStringList getSystemLanguage() - { return _SVGTests.getSystemLanguage(); } -public boolean hasExtension (String extension) - { return _SVGTests.hasExtension(extension); } -//end SVGTests - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - -//from ElementTimeControl -org.inkscape.dom.smil.ElementTimeControlImpl _ElementTimeControl; -public boolean beginElement() throws DOMException - { return _ElementTimeControl.beginElement(); } -public boolean endElement() throws DOMException - { return _ElementTimeControl.endElement(); } -public boolean beginElementAt(float offset) throws DOMException - { return _ElementTimeControl.beginElementAt(offset); } -public boolean endElementAt(float offset) throws DOMException - { return _ElementTimeControl.endElementAt(offset); } -//end ElementTimeControl - - -//from EventTarget -private org.inkscape.dom.events.EventTargetImpl _EventTarget; -public void addEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.addEventListener(type, listener, useCapture); } -public void removeEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListener(type, listener, useCapture); } -public boolean dispatchEvent(Event evt) - throws EventException - { return _EventTarget.dispatchEvent(evt); } -public void addEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture, - Object evtGroup) - { _EventTarget.addEventListenerNS(namespaceURI, type, listener, useCapture, evtGroup); } -public void removeEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListenerNS(namespaceURI, type, listener, useCapture); } -public boolean willTriggerNS(String namespaceURI, - String type) - { return _EventTarget.willTriggerNS(namespaceURI, type); } -public boolean hasEventListenerNS(String namespaceURI, - String type) - { return _EventTarget.hasEventListenerNS(namespaceURI, type); } -//end EventTarget - - -public native SVGElement getTargetElement( ); - -public native float getStartTime ( ); - -public native float getCurrentTime ( ); - -public native float getSimpleDuration ( ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGCSSRuleImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGCSSRuleImpl.java deleted file mode 100644 index d99f6da80..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGCSSRuleImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - - - -public class SVGCSSRuleImpl - extends - org.inkscape.dom.css.CSSRuleImpl - implements org.w3c.dom.svg.SVGCSSRule -{ - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGCircleElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGCircleElementImpl.java deleted file mode 100644 index 4391867b4..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGCircleElementImpl.java +++ /dev/null @@ -1,172 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.events.EventException; -import org.w3c.dom.events.Event; -import org.w3c.dom.events.EventListener; - - -public class SVGCircleElementImpl - extends - SVGElementImpl - //SVGTests, - //SVGLangSpace, - //SVGExternalResourcesRequired, - //SVGStylable, - //SVGTransformable, - //EventTarget - implements org.w3c.dom.svg.SVGCircleElement -{ - -public SVGCircleElementImpl() -{ - imbue(_SVGTests = new SVGTestsImpl()); - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); - imbue(_SVGTransformable = new SVGTransformableImpl()); - imbue(_EventTarget = new org.inkscape.dom.events.EventTargetImpl()); -} - - -//from SVGTests -private SVGTestsImpl _SVGTests; -public SVGStringList getRequiredFeatures() - { return _SVGTests.getRequiredFeatures(); } -public SVGStringList getRequiredExtensions() - { return _SVGTests.getRequiredExtensions(); } -public SVGStringList getSystemLanguage() - { return _SVGTests.getSystemLanguage(); } -public boolean hasExtension (String extension) - { return _SVGTests.hasExtension(extension); } -//end SVGTests - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - - -//from SVGTransformable -private SVGTransformableImpl _SVGTransformable; -public SVGAnimatedTransformList getTransform() - { return _SVGTransformable.getTransform(); } -//end SVGTransformable - -//from SVGLocatable (from SVGTransformable) -public SVGElement getNearestViewportElement() - { return _SVGTransformable.getNearestViewportElement(); } -public SVGElement getFarthestViewportElement() - { return _SVGTransformable.getFarthestViewportElement(); } -public SVGRect getBBox() - { return _SVGTransformable.getBBox(); } -public SVGMatrix getCTM() - { return _SVGTransformable.getCTM(); } -public SVGMatrix getScreenCTM() - { return _SVGTransformable.getScreenCTM(); } -public SVGMatrix getTransformToElement (SVGElement element) - throws SVGException - { return _SVGTransformable.getTransformToElement(element); } -//end SVGLocatable - -//from EventTarget -private org.inkscape.dom.events.EventTargetImpl _EventTarget; -public void addEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.addEventListener(type, listener, useCapture); } -public void removeEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListener(type, listener, useCapture); } -public boolean dispatchEvent(Event evt) - throws EventException - { return _EventTarget.dispatchEvent(evt); } -public void addEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture, - Object evtGroup) - { _EventTarget.addEventListenerNS(namespaceURI, type, listener, useCapture, evtGroup); } -public void removeEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListenerNS(namespaceURI, type, listener, useCapture); } -public boolean willTriggerNS(String namespaceURI, - String type) - { return _EventTarget.willTriggerNS(namespaceURI, type); } -public boolean hasEventListenerNS(String namespaceURI, - String type) - { return _EventTarget.hasEventListenerNS(namespaceURI, type); } -//end EventTarget - - -public native SVGAnimatedLength getCx( ); - -public native SVGAnimatedLength getCy( ); - -public native SVGAnimatedLength getR( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGClipPathElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGClipPathElementImpl.java deleted file mode 100644 index be5dcbbfa..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGClipPathElementImpl.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - - - -public class SVGClipPathElementImpl - extends - SVGElementImpl - //SVGTests, - //SVGLangSpace, - //SVGExternalResourcesRequired, - //SVGStylable, - //SVGTransformable, - //SVGUnitTypes - implements org.w3c.dom.svg.SVGClipPathElement -{ - -public SVGClipPathElementImpl() -{ - imbue(_SVGTests = new SVGTestsImpl()); - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); - imbue(_SVGTransformable = new SVGTransformableImpl()); -} - -//from SVGTests -private SVGTestsImpl _SVGTests; -public SVGStringList getRequiredFeatures() - { return _SVGTests.getRequiredFeatures(); } -public SVGStringList getRequiredExtensions() - { return _SVGTests.getRequiredExtensions(); } -public SVGStringList getSystemLanguage() - { return _SVGTests.getSystemLanguage(); } -public boolean hasExtension (String extension) - { return _SVGTests.hasExtension(extension); } -//end SVGTests - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - - -//from SVGTransformable -private SVGTransformableImpl _SVGTransformable; -public SVGAnimatedTransformList getTransform() - { return _SVGTransformable.getTransform(); } -//end SVGTransformable - -//from SVGLocatable (from SVGTransformable) -public SVGElement getNearestViewportElement() - { return _SVGTransformable.getNearestViewportElement(); } -public SVGElement getFarthestViewportElement() - { return _SVGTransformable.getFarthestViewportElement(); } -public SVGRect getBBox() - { return _SVGTransformable.getBBox(); } -public SVGMatrix getCTM() - { return _SVGTransformable.getCTM(); } -public SVGMatrix getScreenCTM() - { return _SVGTransformable.getScreenCTM(); } -public SVGMatrix getTransformToElement (SVGElement element) - throws SVGException - { return _SVGTransformable.getTransformToElement(element); } -//end SVGLocatable - - - - -public native SVGAnimatedEnumeration getClipPathUnits( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGColorImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGColorImpl.java deleted file mode 100644 index 51d11e777..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGColorImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGException; -import org.w3c.dom.css.RGBColor; -import org.w3c.dom.css.CSSValue; - -import org.w3c.dom.svg.SVGICCColor; - -public class SVGColorImpl - extends - org.inkscape.dom.css.CSSValueImpl - implements org.w3c.dom.svg.SVGColor -{ - -public native short getColorType( ); -public native RGBColor getRGBColor( ); -public native SVGICCColor getICCColor( ); - -public native void setRGBColor ( String rgbColor ) - throws SVGException; -public native void setRGBColorICCColor ( String rgbColor, String iccColor ) - throws SVGException; -public native void setColor ( short colorType, String rgbColor, String iccColor ) - throws SVGException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGColorProfileElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGColorProfileElementImpl.java deleted file mode 100644 index 6e9e70a74..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGColorProfileElementImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; -import org.w3c.dom.svg.SVGAnimatedString; - - - -public class SVGColorProfileElementImpl - extends - SVGElementImpl - //SVGURIReference, - //SVGRenderingIntent - implements org.w3c.dom.svg.SVGColorProfileElement -{ - -public SVGColorProfileElementImpl() -{ - imbue(_SVGURIReference = new SVGURIReferenceImpl()); -} - -//from SVGURIReference -private SVGURIReferenceImpl _SVGURIReference; -public SVGAnimatedString getHref() - { return _SVGURIReference.getHref(); } -//end SVGURIReference - - -public native String getLocal( ); -public native void setLocal( String local ) - throws DOMException; - -public native String getName( ); -public native void setName( String name ) - throws DOMException; - -public native short getRenderingIntent( ); -public native void setRenderingIntent( short renderingIntent ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGColorProfileRuleImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGColorProfileRuleImpl.java deleted file mode 100644 index 62b95b219..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGColorProfileRuleImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - - -public class SVGColorProfileRuleImpl - extends - SVGCSSRuleImpl - //SVGRenderingIntent - implements org.w3c.dom.svg.SVGColorProfileRule -{ - -public native String getSrc( ); -public native void setSrc( String src ) - throws DOMException; - -public native String getName( ); -public native void setName( String name ) - throws DOMException; - -public native short getRenderingIntent( ); -public native void setRenderingIntent( short renderingIntent ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGComponentTransferFunctionElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGComponentTransferFunctionElementImpl.java deleted file mode 100644 index e257e76c8..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGComponentTransferFunctionElementImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGAnimatedEnumeration; -import org.w3c.dom.svg.SVGAnimatedNumberList; -import org.w3c.dom.svg.SVGAnimatedNumber; - - -public class SVGComponentTransferFunctionElementImpl - extends - SVGElementImpl - implements org.w3c.dom.svg.SVGComponentTransferFunctionElement -{ - -public native SVGAnimatedEnumeration getType( ); -public native SVGAnimatedNumberList getTableValues( ); -public native SVGAnimatedNumber getSlope( ); -public native SVGAnimatedNumber getIntercept( ); -public native SVGAnimatedNumber getAmplitude( ); -public native SVGAnimatedNumber getExponent( ); -public native SVGAnimatedNumber getOffset( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGCursorElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGCursorElementImpl.java deleted file mode 100644 index 29ffd4a10..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGCursorElementImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.*; - - -public class SVGCursorElementImpl - extends - SVGElementImpl - //SVGURIReference, - //SVGTests, - //SVGExternalResourcesRequired - implements org.w3c.dom.svg.SVGCursorElement -{ - -public SVGCursorElementImpl() -{ - imbue(_SVGURIReference = new SVGURIReferenceImpl()); - imbue(_SVGTests = new SVGTestsImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); -} - - -//from SVGURIReference -private SVGURIReferenceImpl _SVGURIReference; -public SVGAnimatedString getHref() - { return _SVGURIReference.getHref(); } -//end SVGURIReference - -//from SVGTests -private SVGTestsImpl _SVGTests; -public SVGStringList getRequiredFeatures() - { return _SVGTests.getRequiredFeatures(); } -public SVGStringList getRequiredExtensions() - { return _SVGTests.getRequiredExtensions(); } -public SVGStringList getSystemLanguage() - { return _SVGTests.getSystemLanguage(); } -public boolean hasExtension (String extension) - { return _SVGTests.hasExtension(extension); } -//end SVGTests - - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - - - - -public native SVGAnimatedLength getX( ); - -public native SVGAnimatedLength getY( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGDefinitionSrcElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGDefinitionSrcElementImpl.java deleted file mode 100644 index bc57aa1c9..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGDefinitionSrcElementImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -public class SVGDefinitionSrcElementImpl - extends - SVGElementImpl - implements org.w3c.dom.svg.SVGDefinitionSrcElement -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGDefsElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGDefsElementImpl.java deleted file mode 100644 index b1d23df04..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGDefsElementImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - -import org.w3c.dom.events.Event; -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.events.EventException; -import org.w3c.dom.events.EventListener; - - - -public class SVGDefsElementImpl - extends - SVGElementImpl - //SVGTests, - //SVGLangSpace, - //SVGExternalResourcesRequired, - //SVGStylable, - //SVGTransformable, - //EventTarget - implements org.w3c.dom.svg.SVGDefsElement -{ -public SVGDefsElementImpl() -{ - imbue(_SVGTests = new SVGTestsImpl()); - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); - imbue(_SVGTransformable = new SVGTransformableImpl()); - imbue(_EventTarget = new org.inkscape.dom.events.EventTargetImpl()); -} - - - -//from SVGTests -private SVGTestsImpl _SVGTests; -public SVGStringList getRequiredFeatures() - { return _SVGTests.getRequiredFeatures(); } -public SVGStringList getRequiredExtensions() - { return _SVGTests.getRequiredExtensions(); } -public SVGStringList getSystemLanguage() - { return _SVGTests.getSystemLanguage(); } -public boolean hasExtension (String extension) - { return _SVGTests.hasExtension(extension); } -//end SVGTests - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - -//from SVGTransformable -private SVGTransformableImpl _SVGTransformable; -public SVGAnimatedTransformList getTransform() - { return _SVGTransformable.getTransform(); } -//end SVGTransformable - -//from SVGLocatable (from SVGTransformable) -public SVGElement getNearestViewportElement() - { return _SVGTransformable.getNearestViewportElement(); } -public SVGElement getFarthestViewportElement() - { return _SVGTransformable.getFarthestViewportElement(); } -public SVGRect getBBox() - { return _SVGTransformable.getBBox(); } -public SVGMatrix getCTM() - { return _SVGTransformable.getCTM(); } -public SVGMatrix getScreenCTM() - { return _SVGTransformable.getScreenCTM(); } -public SVGMatrix getTransformToElement (SVGElement element) - throws SVGException - { return _SVGTransformable.getTransformToElement(element); } -//end SVGLocatable - -//from EventTarget -private org.inkscape.dom.events.EventTargetImpl _EventTarget; -public void addEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.addEventListener(type, listener, useCapture); } -public void removeEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListener(type, listener, useCapture); } -public boolean dispatchEvent(Event evt) - throws EventException - { return _EventTarget.dispatchEvent(evt); } -public void addEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture, - Object evtGroup) - { _EventTarget.addEventListenerNS(namespaceURI, type, listener, useCapture, evtGroup); } -public void removeEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListenerNS(namespaceURI, type, listener, useCapture); } -public boolean willTriggerNS(String namespaceURI, - String type) - { return _EventTarget.willTriggerNS(namespaceURI, type); } -public boolean hasEventListenerNS(String namespaceURI, - String type) - { return _EventTarget.hasEventListenerNS(namespaceURI, type); } -//end EventTarget - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGDescElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGDescElementImpl.java deleted file mode 100644 index 56a510974..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGDescElementImpl.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - - -public class SVGDescElementImpl - extends - SVGElementImpl - // SVGLangSpace, - // SVGStylable - implements org.w3c.dom.svg.SVGDescElement -{ - -public SVGDescElementImpl() -{ - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); -} - - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGDocumentImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGDocumentImpl.java deleted file mode 100644 index 9ee152446..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGDocumentImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; -import org.w3c.dom.Document; -import org.w3c.dom.events.Event; -import org.w3c.dom.events.DocumentEvent; - -import org.w3c.dom.svg.SVGSVGElement; - - -public class SVGDocumentImpl - extends - org.inkscape.dom.DocumentImpl - //DocumentEvent - implements org.w3c.dom.svg.SVGDocument -{ -public SVGDocumentImpl() -{ - imbue(_DocumentEvent = new org.inkscape.dom.events.DocumentEventImpl()); -} - -//from DocumentEvent -org.inkscape.dom.events.DocumentEventImpl _DocumentEvent; -public Event createEvent(String eventType) throws DOMException - { return _DocumentEvent.createEvent(eventType); } -public boolean canDispatch(String namespaceURI, String type) - { return _DocumentEvent.canDispatch(namespaceURI, type); } -//end DocumentEvent - -public native String getTitle( ); -public native String getReferrer( ); -public native String getDomain( ); -public native String getURL( ); -public native SVGSVGElement getRootElement( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGElementImpl.java deleted file mode 100644 index f0f8c3436..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGElementImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; -import org.w3c.dom.svg.SVGElement; -import org.w3c.dom.svg.SVGSVGElement; - - - -public class SVGElementImpl - extends - org.inkscape.dom.ElementImpl - implements org.w3c.dom.svg.SVGElement -{ - -public native String getId( ); -public native void setId( String id ) - throws DOMException; -public native String getXMLbase( ); -public native void setXMLbase( String xmlbase ) - throws DOMException; -public native SVGSVGElement getOwnerSVGElement( ); -public native SVGElement getViewportElement( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGElementInstanceImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGElementInstanceImpl.java deleted file mode 100644 index 2d33de6c2..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGElementInstanceImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGElement; -import org.w3c.dom.svg.SVGUseElement; -import org.w3c.dom.svg.SVGElementInstance; -import org.w3c.dom.svg.SVGElementInstanceList; - - -public class SVGElementInstanceImpl - extends - org.inkscape.dom.events.EventTargetImpl - implements org.w3c.dom.svg.SVGElementInstance -{ - -public native SVGElement getCorrespondingElement( ); -public native SVGUseElement getCorrespondingUseElement( ); -public native SVGElementInstance getParentNode( ); -public native SVGElementInstanceList getChildNodes( ); -public native SVGElementInstance getFirstChild( ); -public native SVGElementInstance getLastChild( ); -public native SVGElementInstance getPreviousSibling( ); -public native SVGElementInstance getNextSibling( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGElementInstanceListImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGElementInstanceListImpl.java deleted file mode 100644 index c504701ae..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGElementInstanceListImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGElementInstance; - - -public class SVGElementInstanceListImpl - implements org.w3c.dom.svg.SVGElementInstanceList -{ -public native int getLength( ); - -public native SVGElementInstance item ( int index ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGEllipseElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGEllipseElementImpl.java deleted file mode 100644 index 2e2111649..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGEllipseElementImpl.java +++ /dev/null @@ -1,172 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - -import org.w3c.dom.events.Event; -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.events.EventException; -import org.w3c.dom.events.EventListener; - - -public class SVGEllipseElementImpl - extends - SVGElementImpl - //SVGTests, - //SVGLangSpace, - //SVGExternalResourcesRequired, - //SVGStylable, - //SVGTransformable, - //EventTarget - implements org.w3c.dom.svg.SVGEllipseElement -{ -public SVGEllipseElementImpl() -{ - imbue(_SVGTests = new SVGTestsImpl()); - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); - imbue(_SVGTransformable = new SVGTransformableImpl()); - imbue(_EventTarget = new org.inkscape.dom.events.EventTargetImpl()); -} - -//from SVGTests -private SVGTestsImpl _SVGTests; -public SVGStringList getRequiredFeatures() - { return _SVGTests.getRequiredFeatures(); } -public SVGStringList getRequiredExtensions() - { return _SVGTests.getRequiredExtensions(); } -public SVGStringList getSystemLanguage() - { return _SVGTests.getSystemLanguage(); } -public boolean hasExtension (String extension) - { return _SVGTests.hasExtension(extension); } -//end SVGTests - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - -//from SVGTransformable -private SVGTransformableImpl _SVGTransformable; -public SVGAnimatedTransformList getTransform() - { return _SVGTransformable.getTransform(); } -//end SVGTransformable - -//from SVGLocatable (from SVGTransformable) -public SVGElement getNearestViewportElement() - { return _SVGTransformable.getNearestViewportElement(); } -public SVGElement getFarthestViewportElement() - { return _SVGTransformable.getFarthestViewportElement(); } -public SVGRect getBBox() - { return _SVGTransformable.getBBox(); } -public SVGMatrix getCTM() - { return _SVGTransformable.getCTM(); } -public SVGMatrix getScreenCTM() - { return _SVGTransformable.getScreenCTM(); } -public SVGMatrix getTransformToElement (SVGElement element) - throws SVGException - { return _SVGTransformable.getTransformToElement(element); } -//end SVGLocatable - -//from EventTarget -private org.inkscape.dom.events.EventTargetImpl _EventTarget; -public void addEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.addEventListener(type, listener, useCapture); } -public void removeEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListener(type, listener, useCapture); } -public boolean dispatchEvent(Event evt) - throws EventException - { return _EventTarget.dispatchEvent(evt); } -public void addEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture, - Object evtGroup) - { _EventTarget.addEventListenerNS(namespaceURI, type, listener, useCapture, evtGroup); } -public void removeEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListenerNS(namespaceURI, type, listener, useCapture); } -public boolean willTriggerNS(String namespaceURI, - String type) - { return _EventTarget.willTriggerNS(namespaceURI, type); } -public boolean hasEventListenerNS(String namespaceURI, - String type) - { return _EventTarget.hasEventListenerNS(namespaceURI, type); } -//end EventTarget - - - -public native SVGAnimatedLength getCx( ); - -public native SVGAnimatedLength getCy( ); - -public native SVGAnimatedLength getRx( ); - -public native SVGAnimatedLength getRy( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGEventImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGEventImpl.java deleted file mode 100644 index ab1b4686d..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGEventImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - - - - -public class SVGEventImpl - extends - org.inkscape.dom.events.EventImpl - implements org.w3c.dom.svg.SVGEvent -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGExternalResourcesRequiredImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGExternalResourcesRequiredImpl.java deleted file mode 100644 index 08fac8312..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGExternalResourcesRequiredImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGAnimatedBoolean; - - -public class SVGExternalResourcesRequiredImpl - extends - org.inkscape.cmn.BaseInterface - implements org.w3c.dom.svg.SVGExternalResourcesRequired -{ - -public native SVGAnimatedBoolean getExternalResourcesRequired( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFEBlendElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFEBlendElementImpl.java deleted file mode 100644 index a55f2ef49..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFEBlendElementImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - - -public class SVGFEBlendElementImpl - extends - SVGElementImpl - //SVGFilterPrimitiveStandardAttributes - implements org.w3c.dom.svg.SVGFEBlendElement -{ -public SVGFEBlendElementImpl() -{ - imbue(_SVGFilterPrimitiveStandardAttributes = - new SVGFilterPrimitiveStandardAttributesImpl()); -} - - -//from SVGFilterPrimitiveStandardAttributes -SVGFilterPrimitiveStandardAttributesImpl _SVGFilterPrimitiveStandardAttributes; -public SVGAnimatedLength getX() - { return _SVGFilterPrimitiveStandardAttributes.getX(); } -public SVGAnimatedLength getY() - { return _SVGFilterPrimitiveStandardAttributes.getY(); } -public SVGAnimatedLength getWidth() - { return _SVGFilterPrimitiveStandardAttributes.getWidth(); } -public SVGAnimatedLength getHeight() - { return _SVGFilterPrimitiveStandardAttributes.getHeight(); } -public SVGAnimatedString getResult() - { return _SVGFilterPrimitiveStandardAttributes.getResult(); } -//end SVGFilterPrimitiveStandardAttributes - -//from SVGStylable (from SVGFilterPrimitiveStandardAttributes) -public SVGAnimatedString getClassName() - { return _SVGFilterPrimitiveStandardAttributes.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGFilterPrimitiveStandardAttributes.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGFilterPrimitiveStandardAttributes.getPresentationAttribute(name); } -//end SVGStylable - - -public native SVGAnimatedString getIn1(); - -public native SVGAnimatedString getIn2(); - -public native SVGAnimatedEnumeration getMode(); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFEColorMatrixElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFEColorMatrixElementImpl.java deleted file mode 100644 index 9a68d21ab..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFEColorMatrixElementImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - - -public class SVGFEColorMatrixElementImpl - extends - SVGElementImpl - //SVGFilterPrimitiveStandardAttributes - implements org.w3c.dom.svg.SVGFEColorMatrixElement -{ -public SVGFEColorMatrixElementImpl() -{ - imbue(_SVGFilterPrimitiveStandardAttributes = - new SVGFilterPrimitiveStandardAttributesImpl()); -} - -//from SVGFilterPrimitiveStandardAttributes -SVGFilterPrimitiveStandardAttributesImpl _SVGFilterPrimitiveStandardAttributes; -public SVGAnimatedLength getX() - { return _SVGFilterPrimitiveStandardAttributes.getX(); } -public SVGAnimatedLength getY() - { return _SVGFilterPrimitiveStandardAttributes.getY(); } -public SVGAnimatedLength getWidth() - { return _SVGFilterPrimitiveStandardAttributes.getWidth(); } -public SVGAnimatedLength getHeight() - { return _SVGFilterPrimitiveStandardAttributes.getHeight(); } -public SVGAnimatedString getResult() - { return _SVGFilterPrimitiveStandardAttributes.getResult(); } -//end SVGFilterPrimitiveStandardAttributes - -//from SVGStylable (from SVGFilterPrimitiveStandardAttributes) -public SVGAnimatedString getClassName() - { return _SVGFilterPrimitiveStandardAttributes.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGFilterPrimitiveStandardAttributes.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGFilterPrimitiveStandardAttributes.getPresentationAttribute(name); } -//end SVGStylable - - - -public native SVGAnimatedString getIn1( ); - -public native SVGAnimatedEnumeration getType( ); - -public native SVGAnimatedNumberList getValues( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFEComponentTransferElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFEComponentTransferElementImpl.java deleted file mode 100644 index 8ecf3180c..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFEComponentTransferElementImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - - -public class SVGFEComponentTransferElementImpl - extends - SVGElementImpl - //SVGFilterPrimitiveStandardAttributes - implements org.w3c.dom.svg.SVGFEComponentTransferElement -{ -public SVGFEComponentTransferElementImpl() -{ - imbue(_SVGFilterPrimitiveStandardAttributes = - new SVGFilterPrimitiveStandardAttributesImpl()); -} - -//from SVGFilterPrimitiveStandardAttributes -SVGFilterPrimitiveStandardAttributesImpl _SVGFilterPrimitiveStandardAttributes; -public SVGAnimatedLength getX() - { return _SVGFilterPrimitiveStandardAttributes.getX(); } -public SVGAnimatedLength getY() - { return _SVGFilterPrimitiveStandardAttributes.getY(); } -public SVGAnimatedLength getWidth() - { return _SVGFilterPrimitiveStandardAttributes.getWidth(); } -public SVGAnimatedLength getHeight() - { return _SVGFilterPrimitiveStandardAttributes.getHeight(); } -public SVGAnimatedString getResult() - { return _SVGFilterPrimitiveStandardAttributes.getResult(); } -//end SVGFilterPrimitiveStandardAttributes - -//from SVGStylable (from SVGFilterPrimitiveStandardAttributes) -public SVGAnimatedString getClassName() - { return _SVGFilterPrimitiveStandardAttributes.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGFilterPrimitiveStandardAttributes.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGFilterPrimitiveStandardAttributes.getPresentationAttribute(name); } -//end SVGStylable - - - -public native SVGAnimatedString getIn1( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFECompositeElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFECompositeElementImpl.java deleted file mode 100644 index 0b5ca1276..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFECompositeElementImpl.java +++ /dev/null @@ -1,93 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - - -public class SVGFECompositeElementImpl - extends - SVGElementImpl - //SVGFilterPrimitiveStandardAttributes - implements org.w3c.dom.svg.SVGFECompositeElement -{ -public SVGFECompositeElementImpl() -{ - imbue(_SVGFilterPrimitiveStandardAttributes = - new SVGFilterPrimitiveStandardAttributesImpl()); -} - -//from SVGFilterPrimitiveStandardAttributes -SVGFilterPrimitiveStandardAttributesImpl _SVGFilterPrimitiveStandardAttributes; -public SVGAnimatedLength getX() - { return _SVGFilterPrimitiveStandardAttributes.getX(); } -public SVGAnimatedLength getY() - { return _SVGFilterPrimitiveStandardAttributes.getY(); } -public SVGAnimatedLength getWidth() - { return _SVGFilterPrimitiveStandardAttributes.getWidth(); } -public SVGAnimatedLength getHeight() - { return _SVGFilterPrimitiveStandardAttributes.getHeight(); } -public SVGAnimatedString getResult() - { return _SVGFilterPrimitiveStandardAttributes.getResult(); } -//end SVGFilterPrimitiveStandardAttributes - -//from SVGStylable (from SVGFilterPrimitiveStandardAttributes) -public SVGAnimatedString getClassName() - { return _SVGFilterPrimitiveStandardAttributes.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGFilterPrimitiveStandardAttributes.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGFilterPrimitiveStandardAttributes.getPresentationAttribute(name); } -//end SVGStylable - - - - -public native SVGAnimatedString getIn1( ); - -public native SVGAnimatedString getIn2( ); - -public native SVGAnimatedEnumeration getOperator( ); - -public native SVGAnimatedNumber getK1( ); - -public native SVGAnimatedNumber getK2( ); - -public native SVGAnimatedNumber getK3( ); - -public native SVGAnimatedNumber getK4( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFEConvolveMatrixElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFEConvolveMatrixElementImpl.java deleted file mode 100644 index 5fc3514b6..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFEConvolveMatrixElementImpl.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - -public class SVGFEConvolveMatrixElementImpl - extends - SVGElementImpl - //SVGFilterPrimitiveStandardAttributes - implements org.w3c.dom.svg.SVGFEConvolveMatrixElement -{ -public SVGFEConvolveMatrixElementImpl() -{ - imbue(_SVGFilterPrimitiveStandardAttributes = - new SVGFilterPrimitiveStandardAttributesImpl()); -} - -//from SVGFilterPrimitiveStandardAttributes -SVGFilterPrimitiveStandardAttributesImpl _SVGFilterPrimitiveStandardAttributes; -public SVGAnimatedLength getX() - { return _SVGFilterPrimitiveStandardAttributes.getX(); } -public SVGAnimatedLength getY() - { return _SVGFilterPrimitiveStandardAttributes.getY(); } -public SVGAnimatedLength getWidth() - { return _SVGFilterPrimitiveStandardAttributes.getWidth(); } -public SVGAnimatedLength getHeight() - { return _SVGFilterPrimitiveStandardAttributes.getHeight(); } -public SVGAnimatedString getResult() - { return _SVGFilterPrimitiveStandardAttributes.getResult(); } -//end SVGFilterPrimitiveStandardAttributes - -//from SVGStylable (from SVGFilterPrimitiveStandardAttributes) -public SVGAnimatedString getClassName() - { return _SVGFilterPrimitiveStandardAttributes.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGFilterPrimitiveStandardAttributes.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGFilterPrimitiveStandardAttributes.getPresentationAttribute(name); } -//end SVGStylable - - - -public native SVGAnimatedInteger getOrderX( ); - -public native SVGAnimatedInteger getOrderY( ); - -public native SVGAnimatedNumberList getKernelMatrix( ); - -public native SVGAnimatedNumber getDivisor( ); - -public native SVGAnimatedNumber getBias( ); - -public native SVGAnimatedInteger getTargetX( ); - -public native SVGAnimatedInteger getTargetY( ); - -public native SVGAnimatedEnumeration getEdgeMode( ); - -public native SVGAnimatedNumber getKernelUnitLengthX( ); - -public native SVGAnimatedNumber getKernelUnitLengthY( ); - -public native SVGAnimatedBoolean getPreserveAlpha( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFEDiffuseLightingElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFEDiffuseLightingElementImpl.java deleted file mode 100644 index 49c95cbec..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFEDiffuseLightingElementImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - -public class SVGFEDiffuseLightingElementImpl - extends - SVGElementImpl - //SVGFilterPrimitiveStandardAttributes - implements org.w3c.dom.svg.SVGFEDiffuseLightingElement -{ -public SVGFEDiffuseLightingElementImpl() -{ - imbue(_SVGFilterPrimitiveStandardAttributes = - new SVGFilterPrimitiveStandardAttributesImpl()); -} - -//from SVGFilterPrimitiveStandardAttributes -SVGFilterPrimitiveStandardAttributesImpl _SVGFilterPrimitiveStandardAttributes; -public SVGAnimatedLength getX() - { return _SVGFilterPrimitiveStandardAttributes.getX(); } -public SVGAnimatedLength getY() - { return _SVGFilterPrimitiveStandardAttributes.getY(); } -public SVGAnimatedLength getWidth() - { return _SVGFilterPrimitiveStandardAttributes.getWidth(); } -public SVGAnimatedLength getHeight() - { return _SVGFilterPrimitiveStandardAttributes.getHeight(); } -public SVGAnimatedString getResult() - { return _SVGFilterPrimitiveStandardAttributes.getResult(); } -//end SVGFilterPrimitiveStandardAttributes - -//from SVGStylable (from SVGFilterPrimitiveStandardAttributes) -public SVGAnimatedString getClassName() - { return _SVGFilterPrimitiveStandardAttributes.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGFilterPrimitiveStandardAttributes.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGFilterPrimitiveStandardAttributes.getPresentationAttribute(name); } -//end SVGStylable - - -public native SVGAnimatedString getIn1( ); - -public native SVGAnimatedNumber getSurfaceScale( ); - -public native SVGAnimatedNumber getDiffuseConstant( ); - -public native SVGAnimatedNumber getKernelUnitLengthX( ); - -public native SVGAnimatedNumber getKernelUnitLengthY( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFEDisplacementMapElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFEDisplacementMapElementImpl.java deleted file mode 100644 index 53c3199c3..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFEDisplacementMapElementImpl.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - -public class SVGFEDisplacementMapElementImpl - extends - SVGElementImpl - //SVGFilterPrimitiveStandardAttributes - implements org.w3c.dom.svg.SVGFEDisplacementMapElement -{ -public SVGFEDisplacementMapElementImpl() -{ - imbue(_SVGFilterPrimitiveStandardAttributes = - new SVGFilterPrimitiveStandardAttributesImpl()); -} - -//from SVGFilterPrimitiveStandardAttributes -SVGFilterPrimitiveStandardAttributesImpl _SVGFilterPrimitiveStandardAttributes; -public SVGAnimatedLength getX() - { return _SVGFilterPrimitiveStandardAttributes.getX(); } -public SVGAnimatedLength getY() - { return _SVGFilterPrimitiveStandardAttributes.getY(); } -public SVGAnimatedLength getWidth() - { return _SVGFilterPrimitiveStandardAttributes.getWidth(); } -public SVGAnimatedLength getHeight() - { return _SVGFilterPrimitiveStandardAttributes.getHeight(); } -public SVGAnimatedString getResult() - { return _SVGFilterPrimitiveStandardAttributes.getResult(); } -//end SVGFilterPrimitiveStandardAttributes - -//from SVGStylable (from SVGFilterPrimitiveStandardAttributes) -public SVGAnimatedString getClassName() - { return _SVGFilterPrimitiveStandardAttributes.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGFilterPrimitiveStandardAttributes.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGFilterPrimitiveStandardAttributes.getPresentationAttribute(name); } -//end SVGStylable - - -public native SVGAnimatedString getIn1( ); -public native SVGAnimatedString getIn2( ); -public native SVGAnimatedNumber getScale( ); -public native SVGAnimatedEnumeration getXChannelSelector( ); -public native SVGAnimatedEnumeration getYChannelSelector( ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFEDistantLightElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFEDistantLightElementImpl.java deleted file mode 100644 index bda6f9f2c..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFEDistantLightElementImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGAnimatedNumber; - - -public class SVGFEDistantLightElementImpl - extends - SVGElementImpl - implements org.w3c.dom.svg.SVGFEDistantLightElement -{ - -public native SVGAnimatedNumber getAzimuth( ); -public native SVGAnimatedNumber getElevation( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFEFloodElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFEFloodElementImpl.java deleted file mode 100644 index 476633c0c..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFEFloodElementImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - - -public class SVGFEFloodElementImpl - extends - SVGElementImpl - //SVGFilterPrimitiveStandardAttributes - implements org.w3c.dom.svg.SVGFEFloodElement -{ -public SVGFEFloodElementImpl() -{ - imbue(_SVGFilterPrimitiveStandardAttributes = - new SVGFilterPrimitiveStandardAttributesImpl()); -} - -//from SVGFilterPrimitiveStandardAttributes -SVGFilterPrimitiveStandardAttributesImpl _SVGFilterPrimitiveStandardAttributes; -public SVGAnimatedLength getX() - { return _SVGFilterPrimitiveStandardAttributes.getX(); } -public SVGAnimatedLength getY() - { return _SVGFilterPrimitiveStandardAttributes.getY(); } -public SVGAnimatedLength getWidth() - { return _SVGFilterPrimitiveStandardAttributes.getWidth(); } -public SVGAnimatedLength getHeight() - { return _SVGFilterPrimitiveStandardAttributes.getHeight(); } -public SVGAnimatedString getResult() - { return _SVGFilterPrimitiveStandardAttributes.getResult(); } -//end SVGFilterPrimitiveStandardAttributes - -//from SVGStylable (from SVGFilterPrimitiveStandardAttributes) -public SVGAnimatedString getClassName() - { return _SVGFilterPrimitiveStandardAttributes.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGFilterPrimitiveStandardAttributes.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGFilterPrimitiveStandardAttributes.getPresentationAttribute(name); } -//end SVGStylable - - - -public native SVGAnimatedString getIn1( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFEFuncAElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFEFuncAElementImpl.java deleted file mode 100644 index 347f2b0de..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFEFuncAElementImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - - -public class SVGFEFuncAElementImpl - extends - SVGComponentTransferFunctionElementImpl - implements org.w3c.dom.svg.SVGFEFuncAElement -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFEFuncBElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFEFuncBElementImpl.java deleted file mode 100644 index 536521c4a..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFEFuncBElementImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - - -public class SVGFEFuncBElementImpl - extends - SVGComponentTransferFunctionElementImpl - implements org.w3c.dom.svg.SVGFEFuncBElement -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFEFuncGElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFEFuncGElementImpl.java deleted file mode 100644 index 09e50e137..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFEFuncGElementImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - - -public class SVGFEFuncGElementImpl - extends - SVGComponentTransferFunctionElementImpl - implements org.w3c.dom.svg.SVGFEFuncGElement -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFEFuncRElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFEFuncRElementImpl.java deleted file mode 100644 index 21cf4674e..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFEFuncRElementImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - - - -public class SVGFEFuncRElementImpl - extends - SVGComponentTransferFunctionElementImpl - implements org.w3c.dom.svg.SVGFEFuncRElement -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFEGaussianBlurElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFEGaussianBlurElementImpl.java deleted file mode 100644 index 07c085d35..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFEGaussianBlurElementImpl.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - -public class SVGFEGaussianBlurElementImpl - extends - SVGElementImpl - //SVGFilterPrimitiveStandardAttributes - implements org.w3c.dom.svg.SVGFEGaussianBlurElement -{ -public SVGFEGaussianBlurElementImpl() -{ - imbue(_SVGFilterPrimitiveStandardAttributes = - new SVGFilterPrimitiveStandardAttributesImpl()); -} - -//from SVGFilterPrimitiveStandardAttributes -SVGFilterPrimitiveStandardAttributesImpl _SVGFilterPrimitiveStandardAttributes; -public SVGAnimatedLength getX() - { return _SVGFilterPrimitiveStandardAttributes.getX(); } -public SVGAnimatedLength getY() - { return _SVGFilterPrimitiveStandardAttributes.getY(); } -public SVGAnimatedLength getWidth() - { return _SVGFilterPrimitiveStandardAttributes.getWidth(); } -public SVGAnimatedLength getHeight() - { return _SVGFilterPrimitiveStandardAttributes.getHeight(); } -public SVGAnimatedString getResult() - { return _SVGFilterPrimitiveStandardAttributes.getResult(); } -//end SVGFilterPrimitiveStandardAttributes - -//from SVGStylable (from SVGFilterPrimitiveStandardAttributes) -public SVGAnimatedString getClassName() - { return _SVGFilterPrimitiveStandardAttributes.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGFilterPrimitiveStandardAttributes.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGFilterPrimitiveStandardAttributes.getPresentationAttribute(name); } -//end SVGStylable - - - - -public native SVGAnimatedString getIn1( ); - -public native SVGAnimatedNumber getStdDeviationX( ); - -public native SVGAnimatedNumber getStdDeviationY( ); - -public native void setStdDeviation ( float stdDeviationX, float stdDeviationY ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFEImageElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFEImageElementImpl.java deleted file mode 100644 index 896e96228..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFEImageElementImpl.java +++ /dev/null @@ -1,116 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - -import org.w3c.dom.events.Event; -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.events.EventException; -import org.w3c.dom.events.EventListener; - - -public class SVGFEImageElementImpl - extends - SVGElementImpl - //SVGURIReference, - //SVGLangSpace, - //SVGExternalResourcesRequired, - //SVGFilterPrimitiveStandardAttributes - implements org.w3c.dom.svg.SVGFEImageElement -{ -public SVGFEImageElementImpl() -{ - imbue(_SVGURIReference = new SVGURIReferenceImpl()); - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGFilterPrimitiveStandardAttributes = - new SVGFilterPrimitiveStandardAttributesImpl()); -} - - -//from SVGURIReference -private SVGURIReferenceImpl _SVGURIReference; -public SVGAnimatedString getHref() - { return _SVGURIReference.getHref(); } -//end SVGURIReference - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - -//from SVGFilterPrimitiveStandardAttributes -SVGFilterPrimitiveStandardAttributesImpl _SVGFilterPrimitiveStandardAttributes; -public SVGAnimatedLength getX() - { return _SVGFilterPrimitiveStandardAttributes.getX(); } -public SVGAnimatedLength getY() - { return _SVGFilterPrimitiveStandardAttributes.getY(); } -public SVGAnimatedLength getWidth() - { return _SVGFilterPrimitiveStandardAttributes.getWidth(); } -public SVGAnimatedLength getHeight() - { return _SVGFilterPrimitiveStandardAttributes.getHeight(); } -public SVGAnimatedString getResult() - { return _SVGFilterPrimitiveStandardAttributes.getResult(); } -//end SVGFilterPrimitiveStandardAttributes - -//from SVGStylable (from SVGFilterPrimitiveStandardAttributes) -public SVGAnimatedString getClassName() - { return _SVGFilterPrimitiveStandardAttributes.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGFilterPrimitiveStandardAttributes.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGFilterPrimitiveStandardAttributes.getPresentationAttribute(name); } -//end SVGStylable - - -public native SVGAnimatedPreserveAspectRatio getPreserveAspectRatio( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFEMergeElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFEMergeElementImpl.java deleted file mode 100644 index 29e878b69..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFEMergeElementImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - -public class SVGFEMergeElementImpl - extends - SVGElementImpl - //SVGFilterPrimitiveStandardAttributes - implements org.w3c.dom.svg.SVGFEMergeElement -{ -public SVGFEMergeElementImpl() -{ - imbue(_SVGFilterPrimitiveStandardAttributes = - new SVGFilterPrimitiveStandardAttributesImpl()); -} - -//from SVGFilterPrimitiveStandardAttributes -SVGFilterPrimitiveStandardAttributesImpl _SVGFilterPrimitiveStandardAttributes; -public SVGAnimatedLength getX() - { return _SVGFilterPrimitiveStandardAttributes.getX(); } -public SVGAnimatedLength getY() - { return _SVGFilterPrimitiveStandardAttributes.getY(); } -public SVGAnimatedLength getWidth() - { return _SVGFilterPrimitiveStandardAttributes.getWidth(); } -public SVGAnimatedLength getHeight() - { return _SVGFilterPrimitiveStandardAttributes.getHeight(); } -public SVGAnimatedString getResult() - { return _SVGFilterPrimitiveStandardAttributes.getResult(); } -//end SVGFilterPrimitiveStandardAttributes - -//from SVGStylable (from SVGFilterPrimitiveStandardAttributes) -public SVGAnimatedString getClassName() - { return _SVGFilterPrimitiveStandardAttributes.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGFilterPrimitiveStandardAttributes.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGFilterPrimitiveStandardAttributes.getPresentationAttribute(name); } -//end SVGStylable - - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFEMergeNodeElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFEMergeNodeElementImpl.java deleted file mode 100644 index 9083d0ae0..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFEMergeNodeElementImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGAnimatedString; - - -public class SVGFEMergeNodeElementImpl - extends - SVGElementImpl - implements org.w3c.dom.svg.SVGFEMergeNodeElement -{ - -public native SVGAnimatedString getIn1( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFEMorphologyElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFEMorphologyElementImpl.java deleted file mode 100644 index 4952375d0..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFEMorphologyElementImpl.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - -public class SVGFEMorphologyElementImpl - extends - SVGElementImpl - //SVGFilterPrimitiveStandardAttributes - implements org.w3c.dom.svg.SVGFEMorphologyElement -{ -public SVGFEMorphologyElementImpl() -{ - imbue(_SVGFilterPrimitiveStandardAttributes = - new SVGFilterPrimitiveStandardAttributesImpl()); -} - -//from SVGFilterPrimitiveStandardAttributes -SVGFilterPrimitiveStandardAttributesImpl _SVGFilterPrimitiveStandardAttributes; -public SVGAnimatedLength getX() - { return _SVGFilterPrimitiveStandardAttributes.getX(); } -public SVGAnimatedLength getY() - { return _SVGFilterPrimitiveStandardAttributes.getY(); } -public SVGAnimatedLength getWidth() - { return _SVGFilterPrimitiveStandardAttributes.getWidth(); } -public SVGAnimatedLength getHeight() - { return _SVGFilterPrimitiveStandardAttributes.getHeight(); } -public SVGAnimatedString getResult() - { return _SVGFilterPrimitiveStandardAttributes.getResult(); } -//end SVGFilterPrimitiveStandardAttributes - -//from SVGStylable (from SVGFilterPrimitiveStandardAttributes) -public SVGAnimatedString getClassName() - { return _SVGFilterPrimitiveStandardAttributes.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGFilterPrimitiveStandardAttributes.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGFilterPrimitiveStandardAttributes.getPresentationAttribute(name); } -//end SVGStylable - - - -public native SVGAnimatedString getIn1(); -public native SVGAnimatedEnumeration getOperator(); -public native SVGAnimatedNumber getRadiusX(); -public native SVGAnimatedNumber getRadiusY(); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFEOffsetElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFEOffsetElementImpl.java deleted file mode 100644 index 86ca46c5b..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFEOffsetElementImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - - -public class SVGFEOffsetElementImpl - extends - SVGElementImpl - //SVGFilterPrimitiveStandardAttributes - implements org.w3c.dom.svg.SVGFEOffsetElement -{ -public SVGFEOffsetElementImpl() -{ - imbue(_SVGFilterPrimitiveStandardAttributes = - new SVGFilterPrimitiveStandardAttributesImpl()); -} - -//from SVGFilterPrimitiveStandardAttributes -SVGFilterPrimitiveStandardAttributesImpl _SVGFilterPrimitiveStandardAttributes; -public SVGAnimatedLength getX() - { return _SVGFilterPrimitiveStandardAttributes.getX(); } -public SVGAnimatedLength getY() - { return _SVGFilterPrimitiveStandardAttributes.getY(); } -public SVGAnimatedLength getWidth() - { return _SVGFilterPrimitiveStandardAttributes.getWidth(); } -public SVGAnimatedLength getHeight() - { return _SVGFilterPrimitiveStandardAttributes.getHeight(); } -public SVGAnimatedString getResult() - { return _SVGFilterPrimitiveStandardAttributes.getResult(); } -//end SVGFilterPrimitiveStandardAttributes - -//from SVGStylable (from SVGFilterPrimitiveStandardAttributes) -public SVGAnimatedString getClassName() - { return _SVGFilterPrimitiveStandardAttributes.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGFilterPrimitiveStandardAttributes.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGFilterPrimitiveStandardAttributes.getPresentationAttribute(name); } -//end SVGStylable - -public native SVGAnimatedString getIn1(); - -public native SVGAnimatedNumber getDx(); - -public native SVGAnimatedNumber getDy(); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFEPointLightElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFEPointLightElementImpl.java deleted file mode 100644 index 5da2e6571..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFEPointLightElementImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGAnimatedNumber; - - -public class SVGFEPointLightElementImpl - extends - SVGElementImpl - implements org.w3c.dom.svg.SVGFEPointLightElement -{ -public native SVGAnimatedNumber getX( ); -public native SVGAnimatedNumber getY( ); -public native SVGAnimatedNumber getZ( ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFESpecularLightingElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFESpecularLightingElementImpl.java deleted file mode 100644 index 4d1091497..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFESpecularLightingElementImpl.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - -public class SVGFESpecularLightingElementImpl - extends - SVGElementImpl - //SVGFilterPrimitiveStandardAttributes - implements org.w3c.dom.svg.SVGFESpecularLightingElement -{ -public SVGFESpecularLightingElementImpl() -{ - imbue(_SVGFilterPrimitiveStandardAttributes = - new SVGFilterPrimitiveStandardAttributesImpl()); -} - -//from SVGFilterPrimitiveStandardAttributes -SVGFilterPrimitiveStandardAttributesImpl _SVGFilterPrimitiveStandardAttributes; -public SVGAnimatedLength getX() - { return _SVGFilterPrimitiveStandardAttributes.getX(); } -public SVGAnimatedLength getY() - { return _SVGFilterPrimitiveStandardAttributes.getY(); } -public SVGAnimatedLength getWidth() - { return _SVGFilterPrimitiveStandardAttributes.getWidth(); } -public SVGAnimatedLength getHeight() - { return _SVGFilterPrimitiveStandardAttributes.getHeight(); } -public SVGAnimatedString getResult() - { return _SVGFilterPrimitiveStandardAttributes.getResult(); } -//end SVGFilterPrimitiveStandardAttributes - -//from SVGStylable (from SVGFilterPrimitiveStandardAttributes) -public SVGAnimatedString getClassName() - { return _SVGFilterPrimitiveStandardAttributes.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGFilterPrimitiveStandardAttributes.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGFilterPrimitiveStandardAttributes.getPresentationAttribute(name); } -//end SVGStylable - - -public native SVGAnimatedString getIn1( ); - -public native SVGAnimatedNumber getSurfaceScale( ); - -public native SVGAnimatedNumber getSpecularConstant( ); - -public native SVGAnimatedNumber getSpecularExponent( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFESpotLightElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFESpotLightElementImpl.java deleted file mode 100644 index 9cd942d59..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFESpotLightElementImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGAnimatedNumber; - - -public class SVGFESpotLightElementImpl - extends - SVGElementImpl - implements org.w3c.dom.svg.SVGFESpotLightElement -{ -public native SVGAnimatedNumber getX( ); -public native SVGAnimatedNumber getY( ); -public native SVGAnimatedNumber getZ( ); -public native SVGAnimatedNumber getPointsAtX( ); -public native SVGAnimatedNumber getPointsAtY( ); -public native SVGAnimatedNumber getPointsAtZ( ); -public native SVGAnimatedNumber getSpecularExponent( ); -public native SVGAnimatedNumber getLimitingConeAngle( ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFETileElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFETileElementImpl.java deleted file mode 100644 index 768f1d7b0..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFETileElementImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - -public class SVGFETileElementImpl - extends - SVGElementImpl - //SVGFilterPrimitiveStandardAttributes - implements org.w3c.dom.svg.SVGFETileElement -{ -public SVGFETileElementImpl() -{ - imbue(_SVGFilterPrimitiveStandardAttributes = - new SVGFilterPrimitiveStandardAttributesImpl()); -} - -//from SVGFilterPrimitiveStandardAttributes -SVGFilterPrimitiveStandardAttributesImpl _SVGFilterPrimitiveStandardAttributes; -public SVGAnimatedLength getX() - { return _SVGFilterPrimitiveStandardAttributes.getX(); } -public SVGAnimatedLength getY() - { return _SVGFilterPrimitiveStandardAttributes.getY(); } -public SVGAnimatedLength getWidth() - { return _SVGFilterPrimitiveStandardAttributes.getWidth(); } -public SVGAnimatedLength getHeight() - { return _SVGFilterPrimitiveStandardAttributes.getHeight(); } -public SVGAnimatedString getResult() - { return _SVGFilterPrimitiveStandardAttributes.getResult(); } -//end SVGFilterPrimitiveStandardAttributes - -//from SVGStylable (from SVGFilterPrimitiveStandardAttributes) -public SVGAnimatedString getClassName() - { return _SVGFilterPrimitiveStandardAttributes.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGFilterPrimitiveStandardAttributes.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGFilterPrimitiveStandardAttributes.getPresentationAttribute(name); } -//end SVGStylable - - -public native SVGAnimatedString getIn1( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFETurbulenceElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFETurbulenceElementImpl.java deleted file mode 100644 index 15c206fe7..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFETurbulenceElementImpl.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - -public class SVGFETurbulenceElementImpl - extends - SVGElementImpl - //SVGFilterPrimitiveStandardAttributes - implements org.w3c.dom.svg.SVGFETurbulenceElement -{ -public SVGFETurbulenceElementImpl() -{ - imbue(_SVGFilterPrimitiveStandardAttributes = - new SVGFilterPrimitiveStandardAttributesImpl()); -} - -//from SVGFilterPrimitiveStandardAttributes -SVGFilterPrimitiveStandardAttributesImpl _SVGFilterPrimitiveStandardAttributes; -public SVGAnimatedLength getX() - { return _SVGFilterPrimitiveStandardAttributes.getX(); } -public SVGAnimatedLength getY() - { return _SVGFilterPrimitiveStandardAttributes.getY(); } -public SVGAnimatedLength getWidth() - { return _SVGFilterPrimitiveStandardAttributes.getWidth(); } -public SVGAnimatedLength getHeight() - { return _SVGFilterPrimitiveStandardAttributes.getHeight(); } -public SVGAnimatedString getResult() - { return _SVGFilterPrimitiveStandardAttributes.getResult(); } -//end SVGFilterPrimitiveStandardAttributes - -//from SVGStylable (from SVGFilterPrimitiveStandardAttributes) -public SVGAnimatedString getClassName() - { return _SVGFilterPrimitiveStandardAttributes.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGFilterPrimitiveStandardAttributes.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGFilterPrimitiveStandardAttributes.getPresentationAttribute(name); } -//end SVGStylable - - -public native SVGAnimatedNumber getBaseFrequencyX( ); - -public native SVGAnimatedNumber getBaseFrequencyY( ); - -public native SVGAnimatedInteger getNumOctaves( ); - -public native SVGAnimatedNumber getSeed( ); - -public native SVGAnimatedEnumeration getStitchTiles( ); - -public native SVGAnimatedEnumeration getType( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFilterElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFilterElementImpl.java deleted file mode 100644 index d5b36e81e..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFilterElementImpl.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - - -public class SVGFilterElementImpl - extends - SVGElementImpl - //SVGURIReference, - //SVGLangSpace, - //SVGExternalResourcesRequired, - //SVGStylable, - //SVGUnitTypes - implements org.w3c.dom.svg.SVGFilterElement -{ -public SVGFilterElementImpl() -{ - imbue(_SVGURIReference = new SVGURIReferenceImpl()); - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); -} - - -//from SVGURIReference -private SVGURIReferenceImpl _SVGURIReference; -public SVGAnimatedString getHref() - { return _SVGURIReference.getHref(); } -//end SVGURIReference - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - - -public native SVGAnimatedEnumeration getFilterUnits( ); -public native SVGAnimatedEnumeration getPrimitiveUnits( ); -public native SVGAnimatedLength getX( ); -public native SVGAnimatedLength getY( ); -public native SVGAnimatedLength getWidth( ); -public native SVGAnimatedLength getHeight( ); -public native SVGAnimatedInteger getFilterResX( ); -public native SVGAnimatedInteger getFilterResY( ); -public native void setFilterRes ( int filterResX, int filterResY ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFilterPrimitiveStandardAttributesImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFilterPrimitiveStandardAttributesImpl.java deleted file mode 100644 index 1dd6b2ea6..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFilterPrimitiveStandardAttributesImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGAnimatedLength; -import org.w3c.dom.svg.SVGAnimatedString; - - -public class SVGFilterPrimitiveStandardAttributesImpl - extends - SVGStylableImpl - implements org.w3c.dom.svg.SVGFilterPrimitiveStandardAttributes -{ -public native SVGAnimatedLength getX( ); -public native SVGAnimatedLength getY( ); -public native SVGAnimatedLength getWidth( ); -public native SVGAnimatedLength getHeight( ); -public native SVGAnimatedString getResult( ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFitToViewBoxImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFitToViewBoxImpl.java deleted file mode 100644 index a319e03bf..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFitToViewBoxImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGAnimatedRect; -import org.w3c.dom.svg.SVGAnimatedPreserveAspectRatio; - - -public class SVGFitToViewBoxImpl - extends - org.inkscape.cmn.BaseInterface - implements org.w3c.dom.svg.SVGFitToViewBox -{ - -public native SVGAnimatedRect getViewBox( ); -public native SVGAnimatedPreserveAspectRatio getPreserveAspectRatio( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFontElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFontElementImpl.java deleted file mode 100644 index 40e55e27c..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFontElementImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - - -public class SVGFontElementImpl - extends - SVGElementImpl - //SVGExternalResourcesRequired, - //SVGStylable - implements org.w3c.dom.svg.SVGFontElement -{ -public SVGFontElementImpl() -{ - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); -} - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFontFaceElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFontFaceElementImpl.java deleted file mode 100644 index 3e5da61f5..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFontFaceElementImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - - -public class SVGFontFaceElementImpl - extends - SVGElementImpl - implements org.w3c.dom.svg.SVGFontFaceElement -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFontFaceFormatElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFontFaceFormatElementImpl.java deleted file mode 100644 index 448ffe732..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFontFaceFormatElementImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -public class SVGFontFaceFormatElementImpl - extends - SVGElementImpl - implements org.w3c.dom.svg.SVGFontFaceFormatElement -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFontFaceNameElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFontFaceNameElementImpl.java deleted file mode 100644 index 506e1136f..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFontFaceNameElementImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - - -public class SVGFontFaceNameElementImpl - extends - SVGElementImpl - implements org.w3c.dom.svg.SVGFontFaceNameElement -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFontFaceSrcElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFontFaceSrcElementImpl.java deleted file mode 100644 index 7f86c9453..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFontFaceSrcElementImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -public class SVGFontFaceSrcElementImpl - extends - SVGElementImpl - implements org.w3c.dom.svg.SVGFontFaceSrcElement -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGFontFaceUriElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGFontFaceUriElementImpl.java deleted file mode 100644 index 228bc4867..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGFontFaceUriElementImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -public class SVGFontFaceUriElementImpl - extends - SVGElementImpl - implements org.w3c.dom.svg.SVGFontFaceUriElement -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGForeignObjectElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGForeignObjectElementImpl.java deleted file mode 100644 index 63df6409b..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGForeignObjectElementImpl.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - -import org.w3c.dom.events.Event; -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.events.EventException; -import org.w3c.dom.events.EventListener; - - - -public class SVGForeignObjectElementImpl - extends - SVGElementImpl - //SVGTests, - //SVGLangSpace, - //SVGExternalResourcesRequired, - //SVGStylable, - //SVGTransformable, - //EventTarget - implements org.w3c.dom.svg.SVGForeignObjectElement -{ -public SVGForeignObjectElementImpl() -{ - imbue(_SVGTests = new SVGTestsImpl()); - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); - imbue(_SVGTransformable = new SVGTransformableImpl()); - imbue(_EventTarget = new org.inkscape.dom.events.EventTargetImpl()); -} - - -//from SVGTests -private SVGTestsImpl _SVGTests; -public SVGStringList getRequiredFeatures() - { return _SVGTests.getRequiredFeatures(); } -public SVGStringList getRequiredExtensions() - { return _SVGTests.getRequiredExtensions(); } -public SVGStringList getSystemLanguage() - { return _SVGTests.getSystemLanguage(); } -public boolean hasExtension (String extension) - { return _SVGTests.hasExtension(extension); } -//end SVGTests - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - -//from SVGTransformable -private SVGTransformableImpl _SVGTransformable; -public SVGAnimatedTransformList getTransform() - { return _SVGTransformable.getTransform(); } -//end SVGTransformable - -//from SVGLocatable (from SVGTransformable) -public SVGElement getNearestViewportElement() - { return _SVGTransformable.getNearestViewportElement(); } -public SVGElement getFarthestViewportElement() - { return _SVGTransformable.getFarthestViewportElement(); } -public SVGRect getBBox() - { return _SVGTransformable.getBBox(); } -public SVGMatrix getCTM() - { return _SVGTransformable.getCTM(); } -public SVGMatrix getScreenCTM() - { return _SVGTransformable.getScreenCTM(); } -public SVGMatrix getTransformToElement (SVGElement element) - throws SVGException - { return _SVGTransformable.getTransformToElement(element); } -//end SVGLocatable - -//from EventTarget -private org.inkscape.dom.events.EventTargetImpl _EventTarget; -public void addEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.addEventListener(type, listener, useCapture); } -public void removeEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListener(type, listener, useCapture); } -public boolean dispatchEvent(Event evt) - throws EventException - { return _EventTarget.dispatchEvent(evt); } -public void addEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture, - Object evtGroup) - { _EventTarget.addEventListenerNS(namespaceURI, type, listener, useCapture, evtGroup); } -public void removeEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListenerNS(namespaceURI, type, listener, useCapture); } -public boolean willTriggerNS(String namespaceURI, - String type) - { return _EventTarget.willTriggerNS(namespaceURI, type); } -public boolean hasEventListenerNS(String namespaceURI, - String type) - { return _EventTarget.hasEventListenerNS(namespaceURI, type); } -//end EventTarget - - - -public native SVGAnimatedLength getX( ); -public native SVGAnimatedLength getY( ); -public native SVGAnimatedLength getWidth( ); -public native SVGAnimatedLength getHeight( ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGGElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGGElementImpl.java deleted file mode 100644 index fcc026984..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGGElementImpl.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - -import org.w3c.dom.events.Event; -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.events.EventException; -import org.w3c.dom.events.EventListener; - - - -public class SVGGElementImpl - extends - SVGElementImpl - //SVGTests, - //SVGLangSpace, - //SVGExternalResourcesRequired, - //SVGStylable, - //SVGTransformable, - //EventTarget - implements org.w3c.dom.svg.SVGGElement -{ - -public SVGGElementImpl() -{ - imbue(_SVGTests = new SVGTestsImpl()); - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); - imbue(_SVGTransformable = new SVGTransformableImpl()); - imbue(_EventTarget = new org.inkscape.dom.events.EventTargetImpl()); -} - - -//from SVGTests -private SVGTestsImpl _SVGTests; -public SVGStringList getRequiredFeatures() - { return _SVGTests.getRequiredFeatures(); } -public SVGStringList getRequiredExtensions() - { return _SVGTests.getRequiredExtensions(); } -public SVGStringList getSystemLanguage() - { return _SVGTests.getSystemLanguage(); } -public boolean hasExtension (String extension) - { return _SVGTests.hasExtension(extension); } -//end SVGTests - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - -//from SVGTransformable -private SVGTransformableImpl _SVGTransformable; -public SVGAnimatedTransformList getTransform() - { return _SVGTransformable.getTransform(); } -//end SVGTransformable - -//from SVGLocatable (from SVGTransformable) -public SVGElement getNearestViewportElement() - { return _SVGTransformable.getNearestViewportElement(); } -public SVGElement getFarthestViewportElement() - { return _SVGTransformable.getFarthestViewportElement(); } -public SVGRect getBBox() - { return _SVGTransformable.getBBox(); } -public SVGMatrix getCTM() - { return _SVGTransformable.getCTM(); } -public SVGMatrix getScreenCTM() - { return _SVGTransformable.getScreenCTM(); } -public SVGMatrix getTransformToElement (SVGElement element) - throws SVGException - { return _SVGTransformable.getTransformToElement(element); } -//end SVGLocatable - -//from EventTarget -private org.inkscape.dom.events.EventTargetImpl _EventTarget; -public void addEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.addEventListener(type, listener, useCapture); } -public void removeEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListener(type, listener, useCapture); } -public boolean dispatchEvent(Event evt) - throws EventException - { return _EventTarget.dispatchEvent(evt); } -public void addEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture, - Object evtGroup) - { _EventTarget.addEventListenerNS(namespaceURI, type, listener, useCapture, evtGroup); } -public void removeEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListenerNS(namespaceURI, type, listener, useCapture); } -public boolean willTriggerNS(String namespaceURI, - String type) - { return _EventTarget.willTriggerNS(namespaceURI, type); } -public boolean hasEventListenerNS(String namespaceURI, - String type) - { return _EventTarget.hasEventListenerNS(namespaceURI, type); } -//end EventTarget - - - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGGlyphElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGGlyphElementImpl.java deleted file mode 100644 index b5dfc9fc0..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGGlyphElementImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - - -public class SVGGlyphElementImpl - extends - SVGElementImpl - //SVGStylable - implements org.w3c.dom.svg.SVGGlyphElement -{ -public SVGGlyphElementImpl() -{ - imbue(_SVGStylable = new SVGStylableImpl()); -} - - - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - - - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGGlyphRefElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGGlyphRefElementImpl.java deleted file mode 100644 index 8f72f4fec..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGGlyphRefElementImpl.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - -public class SVGGlyphRefElementImpl - extends - SVGElementImpl - //SVGURIReference, - //SVGStylable - implements org.w3c.dom.svg.SVGGlyphRefElement -{ -public SVGGlyphRefElementImpl() -{ - imbue(_SVGURIReference = new SVGURIReferenceImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); -} - - -//from SVGURIReference -private SVGURIReferenceImpl _SVGURIReference; -public SVGAnimatedString getHref() - { return _SVGURIReference.getHref(); } -//end SVGURIReference - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - - - -public native String getGlyphRef( ); -public native void setGlyphRef( String glyphRef ) - throws DOMException; -public native String getFormat( ); -public native void setFormat( String format ) - throws DOMException; -public native float getX( ); -public native void setX( float x ) - throws DOMException; -public native float getY( ); -public native void setY( float y ) - throws DOMException; -public native float getDx( ); -public native void setDx( float dx ) - throws DOMException; -public native float getDy( ); -public native void setDy( float dy ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGGradientElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGGradientElementImpl.java deleted file mode 100644 index 5d4206901..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGGradientElementImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - - -public class SVGGradientElementImpl - extends - SVGElementImpl - //SVGURIReference, - //SVGExternalResourcesRequired, - //SVGStylable, - //SVGUnitTypes - implements org.w3c.dom.svg.SVGGradientElement -{ - -public SVGGradientElementImpl() -{ - imbue(_SVGURIReference = new SVGURIReferenceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); -} - -//from SVGURIReference -private SVGURIReferenceImpl _SVGURIReference; -public SVGAnimatedString getHref() - { return _SVGURIReference.getHref(); } -//end SVGURIReference - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - - - -public native SVGAnimatedEnumeration getGradientUnits( ); -public native SVGAnimatedTransformList getGradientTransform( ); -public native SVGAnimatedEnumeration getSpreadMethod( ); -} - - diff --git a/src/bind/java/org/inkscape/dom/svg/SVGHKernElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGHKernElementImpl.java deleted file mode 100644 index d8d303ec1..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGHKernElementImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -public class SVGHKernElementImpl - extends - SVGElementImpl - implements org.w3c.dom.svg.SVGHKernElement -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGICCColorImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGICCColorImpl.java deleted file mode 100644 index f282df71e..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGICCColorImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; -import org.w3c.dom.svg.SVGNumberList; - - -public class SVGICCColorImpl - implements org.w3c.dom.svg.SVGICCColor -{ -public native String getColorProfile( ); -public native void setColorProfile( String colorProfile ) - throws DOMException; -public native SVGNumberList getColors( ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGImageElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGImageElementImpl.java deleted file mode 100644 index d7f287fd1..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGImageElementImpl.java +++ /dev/null @@ -1,178 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - -import org.w3c.dom.events.Event; -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.events.EventException; -import org.w3c.dom.events.EventListener; - - - -public class SVGImageElementImpl - extends - SVGElementImpl - //SVGURIReference, - //SVGTests, - //SVGLangSpace, - //SVGExternalResourcesRequired, - //SVGStylable, - //SVGTransformable, - //EventTarget - implements org.w3c.dom.svg.SVGImageElement -{ - -public SVGImageElementImpl() -{ - imbue(_SVGURIReference = new SVGURIReferenceImpl()); - imbue(_SVGTests = new SVGTestsImpl()); - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); - imbue(_SVGTransformable = new SVGTransformableImpl()); - imbue(_EventTarget = new org.inkscape.dom.events.EventTargetImpl()); -} - - -//from SVGURIReference -private SVGURIReferenceImpl _SVGURIReference; -public SVGAnimatedString getHref() - { return _SVGURIReference.getHref(); } -//end SVGURIReference - -//from SVGTests -private SVGTestsImpl _SVGTests; -public SVGStringList getRequiredFeatures() - { return _SVGTests.getRequiredFeatures(); } -public SVGStringList getRequiredExtensions() - { return _SVGTests.getRequiredExtensions(); } -public SVGStringList getSystemLanguage() - { return _SVGTests.getSystemLanguage(); } -public boolean hasExtension (String extension) - { return _SVGTests.hasExtension(extension); } -//end SVGTests - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - -//from SVGTransformable -private SVGTransformableImpl _SVGTransformable; -public SVGAnimatedTransformList getTransform() - { return _SVGTransformable.getTransform(); } -//end SVGTransformable - -//from SVGLocatable (from SVGTransformable) -public SVGElement getNearestViewportElement() - { return _SVGTransformable.getNearestViewportElement(); } -public SVGElement getFarthestViewportElement() - { return _SVGTransformable.getFarthestViewportElement(); } -public SVGRect getBBox() - { return _SVGTransformable.getBBox(); } -public SVGMatrix getCTM() - { return _SVGTransformable.getCTM(); } -public SVGMatrix getScreenCTM() - { return _SVGTransformable.getScreenCTM(); } -public SVGMatrix getTransformToElement (SVGElement element) - throws SVGException - { return _SVGTransformable.getTransformToElement(element); } -//end SVGLocatable - -//from EventTarget -private org.inkscape.dom.events.EventTargetImpl _EventTarget; -public void addEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.addEventListener(type, listener, useCapture); } -public void removeEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListener(type, listener, useCapture); } -public boolean dispatchEvent(Event evt) - throws EventException - { return _EventTarget.dispatchEvent(evt); } -public void addEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture, - Object evtGroup) - { _EventTarget.addEventListenerNS(namespaceURI, type, listener, useCapture, evtGroup); } -public void removeEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListenerNS(namespaceURI, type, listener, useCapture); } -public boolean willTriggerNS(String namespaceURI, - String type) - { return _EventTarget.willTriggerNS(namespaceURI, type); } -public boolean hasEventListenerNS(String namespaceURI, - String type) - { return _EventTarget.hasEventListenerNS(namespaceURI, type); } -//end EventTarget - -public native SVGAnimatedLength getX( ); -public native SVGAnimatedLength getY( ); -public native SVGAnimatedLength getWidth( ); -public native SVGAnimatedLength getHeight( ); -public native SVGAnimatedPreserveAspectRatio getPreserveAspectRatio( ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGLangSpaceImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGLangSpaceImpl.java deleted file mode 100644 index 5caed0330..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGLangSpaceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - - -public class SVGLangSpaceImpl - extends - org.inkscape.cmn.BaseInterface - implements org.w3c.dom.svg.SVGLangSpace -{ -public native String getXMLlang( ); -public native void setXMLlang( String xmllang ) - throws DOMException; -public native String getXMLspace( ); -public native void setXMLspace( String xmlspace ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGLengthImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGLengthImpl.java deleted file mode 100644 index 7b6bf9f86..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGLengthImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - - -public class SVGLengthImpl - implements org.w3c.dom.svg.SVGLength -{ -public native short getUnitType( ); -public native float getValue( ); -public native void setValue( float value ) - throws DOMException; -public native float getValueInSpecifiedUnits( ); -public native void setValueInSpecifiedUnits( float valueInSpecifiedUnits ) - throws DOMException; -public native String getValueAsString( ); -public native void setValueAsString( String valueAsString ) - throws DOMException; - -public native void newValueSpecifiedUnits ( short unitType, float valueInSpecifiedUnits ); -public native void convertToSpecifiedUnits ( short unitType ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGLengthListImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGLengthListImpl.java deleted file mode 100644 index 4f0ce4c66..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGLengthListImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; -import org.w3c.dom.svg.SVGException; -import org.w3c.dom.svg.SVGLength; - - -public class SVGLengthListImpl - implements org.w3c.dom.svg.SVGLengthList -{ -public native int getNumberOfItems( ); - -public native void clear ( ) - throws DOMException; -public native SVGLength initialize ( SVGLength newItem ) - throws DOMException, SVGException; -public native SVGLength getItem ( int index ) - throws DOMException; -public native SVGLength insertItemBefore ( SVGLength newItem, int index ) - throws DOMException, SVGException; -public native SVGLength replaceItem ( SVGLength newItem, int index ) - throws DOMException, SVGException; -public native SVGLength removeItem ( int index ) - throws DOMException; -public native SVGLength appendItem ( SVGLength newItem ) - throws DOMException, SVGException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGLineElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGLineElementImpl.java deleted file mode 100644 index 74a5f7a61..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGLineElementImpl.java +++ /dev/null @@ -1,170 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - -import org.w3c.dom.events.Event; -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.events.EventException; -import org.w3c.dom.events.EventListener; - - - -public class SVGLineElementImpl - extends - SVGElementImpl - //SVGTests, - //SVGLangSpace, - //SVGExternalResourcesRequired, - //SVGStylable, - //SVGTransformable, - //EventTarget - implements org.w3c.dom.svg.SVGLineElement -{ - -public SVGLineElementImpl() -{ - imbue(_SVGTests = new SVGTestsImpl()); - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); - imbue(_SVGTransformable = new SVGTransformableImpl()); - imbue(_EventTarget = new org.inkscape.dom.events.EventTargetImpl()); -} - - -//from SVGTests -private SVGTestsImpl _SVGTests; -public SVGStringList getRequiredFeatures() - { return _SVGTests.getRequiredFeatures(); } -public SVGStringList getRequiredExtensions() - { return _SVGTests.getRequiredExtensions(); } -public SVGStringList getSystemLanguage() - { return _SVGTests.getSystemLanguage(); } -public boolean hasExtension (String extension) - { return _SVGTests.hasExtension(extension); } -//end SVGTests - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - -//from SVGTransformable -private SVGTransformableImpl _SVGTransformable; -public SVGAnimatedTransformList getTransform() - { return _SVGTransformable.getTransform(); } -//end SVGTransformable - -//from SVGLocatable (from SVGTransformable) -public SVGElement getNearestViewportElement() - { return _SVGTransformable.getNearestViewportElement(); } -public SVGElement getFarthestViewportElement() - { return _SVGTransformable.getFarthestViewportElement(); } -public SVGRect getBBox() - { return _SVGTransformable.getBBox(); } -public SVGMatrix getCTM() - { return _SVGTransformable.getCTM(); } -public SVGMatrix getScreenCTM() - { return _SVGTransformable.getScreenCTM(); } -public SVGMatrix getTransformToElement (SVGElement element) - throws SVGException - { return _SVGTransformable.getTransformToElement(element); } -//end SVGLocatable - -//from EventTarget -private org.inkscape.dom.events.EventTargetImpl _EventTarget; -public void addEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.addEventListener(type, listener, useCapture); } -public void removeEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListener(type, listener, useCapture); } -public boolean dispatchEvent(Event evt) - throws EventException - { return _EventTarget.dispatchEvent(evt); } -public void addEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture, - Object evtGroup) - { _EventTarget.addEventListenerNS(namespaceURI, type, listener, useCapture, evtGroup); } -public void removeEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListenerNS(namespaceURI, type, listener, useCapture); } -public boolean willTriggerNS(String namespaceURI, - String type) - { return _EventTarget.willTriggerNS(namespaceURI, type); } -public boolean hasEventListenerNS(String namespaceURI, - String type) - { return _EventTarget.hasEventListenerNS(namespaceURI, type); } -//end EventTarget - - -public native SVGAnimatedLength getX1( ); -public native SVGAnimatedLength getY1( ); -public native SVGAnimatedLength getX2( ); -public native SVGAnimatedLength getY2( ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGLinearGradientElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGLinearGradientElementImpl.java deleted file mode 100644 index 26d3bb8c0..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGLinearGradientElementImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGAnimatedLength; - - -public class SVGLinearGradientElementImpl - extends - SVGGradientElementImpl - implements org.w3c.dom.svg.SVGLinearGradientElement -{ -public native SVGAnimatedLength getX1( ); -public native SVGAnimatedLength getY1( ); -public native SVGAnimatedLength getX2( ); -public native SVGAnimatedLength getY2( ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGLocatableImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGLocatableImpl.java deleted file mode 100644 index df9a0d59b..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGLocatableImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGException; -import org.w3c.dom.svg.SVGElement; -import org.w3c.dom.svg.SVGRect; -import org.w3c.dom.svg.SVGMatrix; - - -public class SVGLocatableImpl - extends - org.inkscape.cmn.BaseInterface - implements org.w3c.dom.svg.SVGLocatable -{ -public native SVGElement getNearestViewportElement( ); -public native SVGElement getFarthestViewportElement( ); - -public native SVGRect getBBox ( ); -public native SVGMatrix getCTM ( ); -public native SVGMatrix getScreenCTM ( ); -public native SVGMatrix getTransformToElement ( SVGElement element ) - throws SVGException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGMPathElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGMPathElementImpl.java deleted file mode 100644 index 9d7c1c6ee..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGMPathElementImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.*; - - -public class SVGMPathElementImpl - extends - SVGElementImpl - //SVGURIReference, - //SVGExternalResourcesRequired - implements org.w3c.dom.svg.SVGMPathElement -{ - -public SVGMPathElementImpl() -{ - imbue(_SVGURIReference = new SVGURIReferenceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); -} - - -//from SVGURIReference -private SVGURIReferenceImpl _SVGURIReference; -public SVGAnimatedString getHref() - { return _SVGURIReference.getHref(); } -//end SVGURIReference - - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGMarkerElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGMarkerElementImpl.java deleted file mode 100644 index 656ae0f17..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGMarkerElementImpl.java +++ /dev/null @@ -1,107 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - - -public class SVGMarkerElementImpl - extends - SVGElementImpl - //SVGLangSpace, - //SVGExternalResourcesRequired, - //SVGStylable, - //SVGFitToViewBox - implements org.w3c.dom.svg.SVGMarkerElement -{ - -public SVGMarkerElementImpl() -{ - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); - imbue(_SVGFitToViewBox = new SVGFitToViewBoxImpl()); -} - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - -//from SVGFitToViewBox -SVGFitToViewBoxImpl _SVGFitToViewBox; -public SVGAnimatedRect getViewBox() - { return _SVGFitToViewBox.getViewBox(); } -public SVGAnimatedPreserveAspectRatio getPreserveAspectRatio() - { return _SVGFitToViewBox.getPreserveAspectRatio(); } -//end SVGFitToViewBox - - -public native SVGAnimatedLength getRefX( ); -public native SVGAnimatedLength getRefY( ); -public native SVGAnimatedEnumeration getMarkerUnits( ); -public native SVGAnimatedLength getMarkerWidth( ); -public native SVGAnimatedLength getMarkerHeight( ); -public native SVGAnimatedEnumeration getOrientType( ); -public native SVGAnimatedAngle getOrientAngle( ); -public native void setOrientToAuto ( ); -public native void setOrientToAngle ( SVGAngle angle ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGMaskElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGMaskElementImpl.java deleted file mode 100644 index 507095771..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGMaskElementImpl.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - -public class SVGMaskElementImpl - extends - SVGElementImpl - //SVGTests, - //SVGLangSpace, - //SVGExternalResourcesRequired, - //SVGStylable, - //SVGUnitTypes - implements org.w3c.dom.svg.SVGMaskElement -{ - -public SVGMaskElementImpl() -{ - imbue(_SVGTests = new SVGTestsImpl()); - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); -} - - -//from SVGTests -private SVGTestsImpl _SVGTests; -public SVGStringList getRequiredFeatures() - { return _SVGTests.getRequiredFeatures(); } -public SVGStringList getRequiredExtensions() - { return _SVGTests.getRequiredExtensions(); } -public SVGStringList getSystemLanguage() - { return _SVGTests.getSystemLanguage(); } -public boolean hasExtension (String extension) - { return _SVGTests.hasExtension(extension); } -//end SVGTests - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - - -public native SVGAnimatedEnumeration getMaskUnits( ); -public native SVGAnimatedEnumeration getMaskContentUnits( ); -public native SVGAnimatedLength getX( ); -public native SVGAnimatedLength getY( ); -public native SVGAnimatedLength getWidth( ); -public native SVGAnimatedLength getHeight( ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGMatrixImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGMatrixImpl.java deleted file mode 100644 index 65cf6fbfe..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGMatrixImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; -import org.w3c.dom.svg.SVGException; -import org.w3c.dom.svg.SVGMatrix; - - -public class SVGMatrixImpl - implements org.w3c.dom.svg.SVGMatrix -{ -public native float getA( ); -public native void setA( float a ) - throws DOMException; -public native float getB( ); -public native void setB( float b ) - throws DOMException; -public native float getC( ); -public native void setC( float c ) - throws DOMException; -public native float getD( ); -public native void setD( float d ) - throws DOMException; -public native float getE( ); -public native void setE( float e ) - throws DOMException; -public native float getF( ); -public native void setF( float f ) - throws DOMException; - -public native SVGMatrix multiply ( SVGMatrix secondMatrix ); -public native SVGMatrix inverse ( ) - throws SVGException; -public native SVGMatrix translate ( float x, float y ); -public native SVGMatrix scale ( float scaleFactor ); -public native SVGMatrix scaleNonUniform ( float scaleFactorX, float scaleFactorY ); -public native SVGMatrix rotate ( float angle ); -public native SVGMatrix rotateFromVector ( float x, float y ) - throws SVGException; -public native SVGMatrix flipX ( ); -public native SVGMatrix flipY ( ); -public native SVGMatrix skewX ( float angle ); -public native SVGMatrix skewY ( float angle ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGMetadataElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGMetadataElementImpl.java deleted file mode 100644 index e0197ee6f..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGMetadataElementImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -public class SVGMetadataElementImpl - extends - SVGElementImpl - implements org.w3c.dom.svg.SVGMetadataElement -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGMissingGlyphElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGMissingGlyphElementImpl.java deleted file mode 100644 index cbb115ee1..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGMissingGlyphElementImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - - -public class SVGMissingGlyphElementImpl - extends - SVGElementImpl - //SVGStylable - implements org.w3c.dom.svg.SVGMissingGlyphElement -{ - -public SVGMissingGlyphElementImpl() -{ - imbue(_SVGStylable = new SVGStylableImpl()); -} - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGNumberImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGNumberImpl.java deleted file mode 100644 index 1a0c94ffd..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGNumberImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - - -public class SVGNumberImpl - implements org.w3c.dom.svg.SVGNumber -{ -public native float getValue( ); -public native void setValue( float value ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGNumberListImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGNumberListImpl.java deleted file mode 100644 index 7e2b0c693..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGNumberListImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; -import org.w3c.dom.svg.SVGException; -import org.w3c.dom.svg.SVGNumber; - - -public class SVGNumberListImpl - implements org.w3c.dom.svg.SVGNumberList -{ - -public native int getNumberOfItems( ); - -public native void clear ( ) - throws DOMException; -public native SVGNumber initialize ( SVGNumber newItem ) - throws DOMException, SVGException; -public native SVGNumber getItem ( int index ) - throws DOMException; -public native SVGNumber insertItemBefore ( SVGNumber newItem, int index ) - throws DOMException, SVGException; -public native SVGNumber replaceItem ( SVGNumber newItem, int index ) - throws DOMException, SVGException; -public native SVGNumber removeItem ( int index ) - throws DOMException; -public native SVGNumber appendItem ( SVGNumber newItem ) - throws DOMException, SVGException; - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPaintImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPaintImpl.java deleted file mode 100644 index 7387ae150..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPaintImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.css.RGBColor; -import org.w3c.dom.svg.SVGException; - - - -public class SVGPaintImpl - extends - SVGColorImpl - implements org.w3c.dom.svg.SVGPaint -{ -public native short getPaintType( ); -public native String getUri( ); - -public native void setUri ( String uri ); -public native void setPaint ( short paintType, String uri, - String rgbColor, String iccColor ) - throws SVGException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPathElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPathElementImpl.java deleted file mode 100644 index 692c13213..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPathElementImpl.java +++ /dev/null @@ -1,215 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - -import org.w3c.dom.events.Event; -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.events.EventException; -import org.w3c.dom.events.EventListener; - - -public class SVGPathElementImpl - extends - SVGElementImpl - //SVGTests, - //SVGLangSpace, - //SVGExternalResourcesRequired, - //SVGStylable, - //SVGTransformable, - //EventTarget, - //SVGAnimatedPathData - implements org.w3c.dom.svg.SVGPathElement -{ - -public SVGPathElementImpl() -{ - imbue(_SVGTests = new SVGTestsImpl()); - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); - imbue(_SVGTransformable = new SVGTransformableImpl()); - imbue(_EventTarget = new org.inkscape.dom.events.EventTargetImpl()); - imbue(_SVGAnimatedPathData = new SVGAnimatedPathDataImpl()); -} - - -//from SVGURIReference -private SVGURIReferenceImpl _SVGURIReference; -public SVGAnimatedString getHref() - { return _SVGURIReference.getHref(); } -//end SVGURIReference - -//from SVGTests -private SVGTestsImpl _SVGTests; -public SVGStringList getRequiredFeatures() - { return _SVGTests.getRequiredFeatures(); } -public SVGStringList getRequiredExtensions() - { return _SVGTests.getRequiredExtensions(); } -public SVGStringList getSystemLanguage() - { return _SVGTests.getSystemLanguage(); } -public boolean hasExtension (String extension) - { return _SVGTests.hasExtension(extension); } -//end SVGTests - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - -//from SVGTransformable -private SVGTransformableImpl _SVGTransformable; -public SVGAnimatedTransformList getTransform() - { return _SVGTransformable.getTransform(); } -//end SVGTransformable - -//from SVGLocatable (from SVGTransformable) -public SVGElement getNearestViewportElement() - { return _SVGTransformable.getNearestViewportElement(); } -public SVGElement getFarthestViewportElement() - { return _SVGTransformable.getFarthestViewportElement(); } -public SVGRect getBBox() - { return _SVGTransformable.getBBox(); } -public SVGMatrix getCTM() - { return _SVGTransformable.getCTM(); } -public SVGMatrix getScreenCTM() - { return _SVGTransformable.getScreenCTM(); } -public SVGMatrix getTransformToElement (SVGElement element) - throws SVGException - { return _SVGTransformable.getTransformToElement(element); } -//end SVGLocatable - -//from EventTarget -private org.inkscape.dom.events.EventTargetImpl _EventTarget; -public void addEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.addEventListener(type, listener, useCapture); } -public void removeEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListener(type, listener, useCapture); } -public boolean dispatchEvent(Event evt) - throws EventException - { return _EventTarget.dispatchEvent(evt); } -public void addEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture, - Object evtGroup) - { _EventTarget.addEventListenerNS(namespaceURI, type, listener, useCapture, evtGroup); } -public void removeEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListenerNS(namespaceURI, type, listener, useCapture); } -public boolean willTriggerNS(String namespaceURI, - String type) - { return _EventTarget.willTriggerNS(namespaceURI, type); } -public boolean hasEventListenerNS(String namespaceURI, - String type) - { return _EventTarget.hasEventListenerNS(namespaceURI, type); } -//end EventTarget - -//from SVGAnimatedPathData -SVGAnimatedPathDataImpl _SVGAnimatedPathData; -public SVGPathSegList getPathSegList() - { return _SVGAnimatedPathData.getPathSegList(); } -public SVGPathSegList getNormalizedPathSegList() - { return _SVGAnimatedPathData.getNormalizedPathSegList(); } -public SVGPathSegList getAnimatedPathSegList() - { return _SVGAnimatedPathData.getAnimatedPathSegList(); } -public SVGPathSegList getAnimatedNormalizedPathSegList() - { return _SVGAnimatedPathData.getAnimatedNormalizedPathSegList(); } -//end SVGAnimatedPathData - -public native SVGAnimatedNumber getPathLength( ); -public native float getTotalLength ( ); -public native SVGPoint getPointAtLength ( float distance ); -public native int getPathSegAtLength ( float distance ); - -//CREATEs -public native SVGPathSegClosePath createSVGPathSegClosePath ( ); -public native SVGPathSegMovetoAbs createSVGPathSegMovetoAbs ( float x, float y ); -public native SVGPathSegMovetoRel createSVGPathSegMovetoRel ( float x, float y ); -public native SVGPathSegLinetoAbs createSVGPathSegLinetoAbs ( float x, float y ); -public native SVGPathSegLinetoRel createSVGPathSegLinetoRel ( float x, float y ); - -public native SVGPathSegCurvetoCubicAbs createSVGPathSegCurvetoCubicAbs ( float x, float y, float x1, float y1, float x2, float y2 ); -public native SVGPathSegCurvetoCubicRel createSVGPathSegCurvetoCubicRel ( float x, float y, float x1, float y1, float x2, float y2 ); - -public native SVGPathSegCurvetoQuadraticAbs createSVGPathSegCurvetoQuadraticAbs ( float x, float y, float x1, float y1 ); -public native SVGPathSegCurvetoQuadraticRel createSVGPathSegCurvetoQuadraticRel ( float x, float y, float x1, float y1 ); - -public native SVGPathSegArcAbs createSVGPathSegArcAbs ( float x, float y, float r1, float r2, float angle, boolean largeArcFlag, boolean sweepFlag ); -public native SVGPathSegArcRel createSVGPathSegArcRel ( float x, float y, float r1, float r2, float angle, boolean largeArcFlag, boolean sweepFlag ); - -public native SVGPathSegLinetoHorizontalAbs createSVGPathSegLinetoHorizontalAbs ( float x ); -public native SVGPathSegLinetoHorizontalRel createSVGPathSegLinetoHorizontalRel ( float x ); - -public native SVGPathSegLinetoVerticalAbs createSVGPathSegLinetoVerticalAbs ( float y ); -public native SVGPathSegLinetoVerticalRel createSVGPathSegLinetoVerticalRel ( float y ); - -public native SVGPathSegCurvetoCubicSmoothAbs createSVGPathSegCurvetoCubicSmoothAbs ( float x, float y, float x2, float y2 ); -public native SVGPathSegCurvetoCubicSmoothRel createSVGPathSegCurvetoCubicSmoothRel ( float x, float y, float x2, float y2 ); - -public native SVGPathSegCurvetoQuadraticSmoothAbs createSVGPathSegCurvetoQuadraticSmoothAbs ( float x, float y ); -public native SVGPathSegCurvetoQuadraticSmoothRel createSVGPathSegCurvetoQuadraticSmoothRel ( float x, float y ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPathSegArcAbsImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPathSegArcAbsImpl.java deleted file mode 100644 index ebef29a0a..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPathSegArcAbsImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -public class SVGPathSegArcAbsImpl - extends - SVGPathSegImpl - implements org.w3c.dom.svg.SVGPathSegArcAbs -{ -public native float getX( ); -public native void setX( float x ) - throws DOMException; -public native float getY( ); -public native void setY( float y ) - throws DOMException; -public native float getR1( ); -public native void setR1( float r1 ) - throws DOMException; -public native float getR2( ); -public native void setR2( float r2 ) - throws DOMException; -public native float getAngle( ); -public native void setAngle( float angle ) - throws DOMException; -public native boolean getLargeArcFlag( ); -public native void setLargeArcFlag( boolean largeArcFlag ) - throws DOMException; -public native boolean getSweepFlag( ); -public native void setSweepFlag( boolean sweepFlag ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPathSegArcRelImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPathSegArcRelImpl.java deleted file mode 100644 index 5d2b15774..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPathSegArcRelImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -public class SVGPathSegArcRelImpl - extends - SVGPathSegImpl - implements org.w3c.dom.svg.SVGPathSegArcRel -{ -public native float getX( ); -public native void setX( float x ) - throws DOMException; -public native float getY( ); -public native void setY( float y ) - throws DOMException; -public native float getR1( ); -public native void setR1( float r1 ) - throws DOMException; -public native float getR2( ); -public native void setR2( float r2 ) - throws DOMException; -public native float getAngle( ); -public native void setAngle( float angle ) - throws DOMException; -public native boolean getLargeArcFlag( ); -public native void setLargeArcFlag( boolean largeArcFlag ) - throws DOMException; -public native boolean getSweepFlag( ); -public native void setSweepFlag( boolean sweepFlag ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPathSegClosePathImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPathSegClosePathImpl.java deleted file mode 100644 index c1615d007..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPathSegClosePathImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -public class SVGPathSegClosePathImpl - extends - SVGPathSegImpl - implements org.w3c.dom.svg.SVGPathSegClosePath -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoCubicAbsImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoCubicAbsImpl.java deleted file mode 100644 index 2ace254c2..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoCubicAbsImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -public class SVGPathSegCurvetoCubicAbsImpl - extends - SVGPathSegImpl - implements org.w3c.dom.svg.SVGPathSegCurvetoCubicAbs -{ -public native float getX( ); -public native void setX( float x ) - throws DOMException; -public native float getY( ); -public native void setY( float y ) - throws DOMException; -public native float getX1( ); -public native void setX1( float x1 ) - throws DOMException; -public native float getY1( ); -public native void setY1( float y1 ) - throws DOMException; -public native float getX2( ); -public native void setX2( float x2 ) - throws DOMException; -public native float getY2( ); -public native void setY2( float y2 ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoCubicRelImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoCubicRelImpl.java deleted file mode 100644 index d3bbf140b..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoCubicRelImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -public class SVGPathSegCurvetoCubicRelImpl - extends - SVGPathSegImpl - implements org.w3c.dom.svg.SVGPathSegCurvetoCubicRel -{ -public native float getX( ); -public native void setX( float x ) - throws DOMException; -public native float getY( ); -public native void setY( float y ) - throws DOMException; -public native float getX1( ); -public native void setX1( float x1 ) - throws DOMException; -public native float getY1( ); -public native void setY1( float y1 ) - throws DOMException; -public native float getX2( ); -public native void setX2( float x2 ) - throws DOMException; -public native float getY2( ); -public native void setY2( float y2 ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoCubicSmoothAbsImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoCubicSmoothAbsImpl.java deleted file mode 100644 index 1c1b1328c..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoCubicSmoothAbsImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -public class SVGPathSegCurvetoCubicSmoothAbsImpl - extends - SVGPathSegImpl - implements org.w3c.dom.svg.SVGPathSegCurvetoCubicSmoothAbs -{ -public native float getX( ); -public native void setX( float x ) - throws DOMException; -public native float getY( ); -public native void setY( float y ) - throws DOMException; -public native float getX2( ); -public native void setX2( float x2 ) - throws DOMException; -public native float getY2( ); -public native void setY2( float y2 ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoCubicSmoothRelImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoCubicSmoothRelImpl.java deleted file mode 100644 index 265228bb5..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoCubicSmoothRelImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -public class SVGPathSegCurvetoCubicSmoothRelImpl - extends - SVGPathSegImpl - implements org.w3c.dom.svg.SVGPathSegCurvetoCubicSmoothRel -{ -public native float getX( ); -public native void setX( float x ) - throws DOMException; -public native float getY( ); -public native void setY( float y ) - throws DOMException; -public native float getX2( ); -public native void setX2( float x2 ) - throws DOMException; -public native float getY2( ); -public native void setY2( float y2 ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoQuadraticAbsImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoQuadraticAbsImpl.java deleted file mode 100644 index bc2b39052..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoQuadraticAbsImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -public class SVGPathSegCurvetoQuadraticAbsImpl - extends - SVGPathSegImpl - implements org.w3c.dom.svg.SVGPathSegCurvetoQuadraticAbs -{ -public native float getX( ); -public native void setX( float x ) - throws DOMException; -public native float getY( ); -public native void setY( float y ) - throws DOMException; -public native float getX1( ); -public native void setX1( float x1 ) - throws DOMException; -public native float getY1( ); -public native void setY1( float y1 ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoQuadraticRelImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoQuadraticRelImpl.java deleted file mode 100644 index 35dd8f927..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoQuadraticRelImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -public class SVGPathSegCurvetoQuadraticRelImpl - extends - SVGPathSegImpl - implements org.w3c.dom.svg.SVGPathSegCurvetoQuadraticRel -{ -public native float getX( ); -public native void setX( float x ) - throws DOMException; -public native float getY( ); -public native void setY( float y ) - throws DOMException; -public native float getX1( ); -public native void setX1( float x1 ) - throws DOMException; -public native float getY1( ); -public native void setY1( float y1 ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoQuadraticSmoothAbsImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoQuadraticSmoothAbsImpl.java deleted file mode 100644 index 50f0f4be2..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoQuadraticSmoothAbsImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -public class SVGPathSegCurvetoQuadraticSmoothAbsImpl - extends - SVGPathSegImpl - implements org.w3c.dom.svg.SVGPathSegCurvetoQuadraticSmoothAbs -{ -public native float getX( ); -public native void setX( float x ) - throws DOMException; -public native float getY( ); -public native void setY( float y ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoQuadraticSmoothRelImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoQuadraticSmoothRelImpl.java deleted file mode 100644 index c55c706fc..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPathSegCurvetoQuadraticSmoothRelImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -public class SVGPathSegCurvetoQuadraticSmoothRelImpl - extends - SVGPathSegImpl - implements org.w3c.dom.svg.SVGPathSegCurvetoQuadraticSmoothRel -{ -public native float getX( ); -public native void setX( float x ) - throws DOMException; -public native float getY( ); -public native void setY( float y ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPathSegImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPathSegImpl.java deleted file mode 100644 index 2a57b613c..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPathSegImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -public class SVGPathSegImpl - implements org.w3c.dom.svg.SVGPathSeg -{ -public native short getPathSegType( ); -public native String getPathSegTypeAsLetter( ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPathSegLinetoAbsImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPathSegLinetoAbsImpl.java deleted file mode 100644 index c53dc3de3..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPathSegLinetoAbsImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -public class SVGPathSegLinetoAbsImpl - extends - SVGPathSegImpl - implements org.w3c.dom.svg.SVGPathSegLinetoAbs -{ -public native float getX( ); -public native void setX( float x ) - throws DOMException; -public native float getY( ); -public native void setY( float y ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPathSegLinetoHorizontalAbsImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPathSegLinetoHorizontalAbsImpl.java deleted file mode 100644 index d7e29c87d..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPathSegLinetoHorizontalAbsImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -public class SVGPathSegLinetoHorizontalAbsImpl - extends - SVGPathSegImpl - implements org.w3c.dom.svg.SVGPathSegLinetoHorizontalAbs -{ -public native float getX( ); -public native void setX( float x ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPathSegLinetoHorizontalRelImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPathSegLinetoHorizontalRelImpl.java deleted file mode 100644 index 105f321e8..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPathSegLinetoHorizontalRelImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -public class SVGPathSegLinetoHorizontalRelImpl - extends - SVGPathSegImpl - implements org.w3c.dom.svg.SVGPathSegLinetoHorizontalRel -{ -public native float getX( ); -public native void setX( float x ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPathSegLinetoRelImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPathSegLinetoRelImpl.java deleted file mode 100644 index 1c941a79e..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPathSegLinetoRelImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -public class SVGPathSegLinetoRelImpl - extends - SVGPathSegImpl - implements org.w3c.dom.svg.SVGPathSegLinetoRel -{ -public native float getX( ); -public native void setX( float x ) - throws DOMException; -public native float getY( ); -public native void setY( float y ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPathSegLinetoVerticalAbsImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPathSegLinetoVerticalAbsImpl.java deleted file mode 100644 index ef7e38820..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPathSegLinetoVerticalAbsImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -public class SVGPathSegLinetoVerticalAbsImpl - extends - SVGPathSegImpl - implements org.w3c.dom.svg.SVGPathSegLinetoVerticalAbs -{ -public native float getY( ); -public native void setY( float y ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPathSegLinetoVerticalRelImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPathSegLinetoVerticalRelImpl.java deleted file mode 100644 index 22fdf9232..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPathSegLinetoVerticalRelImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -public class SVGPathSegLinetoVerticalRelImpl - extends - SVGPathSegImpl - implements org.w3c.dom.svg.SVGPathSegLinetoVerticalRel -{ -public native float getY( ); -public native void setY( float y ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPathSegListImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPathSegListImpl.java deleted file mode 100644 index 99d10586c..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPathSegListImpl.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; -import org.w3c.dom.svg.SVGException; - -import org.w3c.dom.svg.SVGPathSeg; - - -public class SVGPathSegListImpl - implements org.w3c.dom.svg.SVGPathSegList -{ -public native int getNumberOfItems( ); - -public native void clear ( ) - throws DOMException; -public native SVGPathSeg initialize ( SVGPathSeg newItem ) - throws DOMException, SVGException; -public native SVGPathSeg getItem ( int index ) - throws DOMException; -public native SVGPathSeg insertItemBefore ( SVGPathSeg newItem, int index ) - throws DOMException, SVGException; -public native SVGPathSeg replaceItem ( SVGPathSeg newItem, int index ) - throws DOMException, SVGException; -public native SVGPathSeg removeItem ( int index ) - throws DOMException; -public native SVGPathSeg appendItem ( SVGPathSeg newItem ) - throws DOMException, SVGException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPathSegMovetoAbsImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPathSegMovetoAbsImpl.java deleted file mode 100644 index a2e08dc46..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPathSegMovetoAbsImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -public class SVGPathSegMovetoAbsImpl - extends - SVGPathSegImpl - implements org.w3c.dom.svg.SVGPathSegMovetoAbs -{ -public native float getX( ); -public native void setX( float x ) - throws DOMException; -public native float getY( ); -public native void setY( float y ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPathSegMovetoRelImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPathSegMovetoRelImpl.java deleted file mode 100644 index 989925787..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPathSegMovetoRelImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -public class SVGPathSegMovetoRelImpl - extends - SVGPathSegImpl - implements org.w3c.dom.svg.SVGPathSegMovetoRel -{ -public native float getX( ); -public native void setX( float x ) - throws DOMException; -public native float getY( ); -public native void setY( float y ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPatternElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPatternElementImpl.java deleted file mode 100644 index 9d8c774fe..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPatternElementImpl.java +++ /dev/null @@ -1,135 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - -import org.w3c.dom.events.Event; -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.events.EventException; -import org.w3c.dom.events.EventListener; - - -public class SVGPatternElementImpl - extends - SVGElementImpl - //SVGURIReference, - //SVGTests, - //SVGLangSpace, - //SVGExternalResourcesRequired, - //SVGStylable, - //SVGFitToViewBox, - //SVGUnitTypes - implements org.w3c.dom.svg.SVGPatternElement -{ - -public SVGPatternElementImpl() -{ - imbue(_SVGURIReference = new SVGURIReferenceImpl()); - imbue(_SVGTests = new SVGTestsImpl()); - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); - imbue(_SVGFitToViewBox = new SVGFitToViewBoxImpl()); -} - - -//from SVGURIReference -private SVGURIReferenceImpl _SVGURIReference; -public SVGAnimatedString getHref() - { return _SVGURIReference.getHref(); } -//end SVGURIReference - -//from SVGTests -private SVGTestsImpl _SVGTests; -public SVGStringList getRequiredFeatures() - { return _SVGTests.getRequiredFeatures(); } -public SVGStringList getRequiredExtensions() - { return _SVGTests.getRequiredExtensions(); } -public SVGStringList getSystemLanguage() - { return _SVGTests.getSystemLanguage(); } -public boolean hasExtension (String extension) - { return _SVGTests.hasExtension(extension); } -//end SVGTests - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - -//from SVGFitToViewBox -SVGFitToViewBoxImpl _SVGFitToViewBox; -public SVGAnimatedRect getViewBox() - { return _SVGFitToViewBox.getViewBox(); } -public SVGAnimatedPreserveAspectRatio getPreserveAspectRatio() - { return _SVGFitToViewBox.getPreserveAspectRatio(); } -//end SVGFitToViewBox - - - -public native SVGAnimatedEnumeration getPatternUnits( ); -public native SVGAnimatedEnumeration getPatternContentUnits( ); -public native SVGAnimatedTransformList getPatternTransform( ); -public native SVGAnimatedLength getX( ); -public native SVGAnimatedLength getY( ); -public native SVGAnimatedLength getWidth( ); -public native SVGAnimatedLength getHeight( ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPointImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPointImpl.java deleted file mode 100644 index 87f806a1b..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPointImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; -import org.w3c.dom.svg.SVGPoint; -import org.w3c.dom.svg.SVGMatrix; - - -public class SVGPointImpl - implements org.w3c.dom.svg.SVGPoint -{ -public native float getX( ); -public native void setX( float x ) - throws DOMException; -public native float getY( ); -public native void setY( float y ) - throws DOMException; - -public native SVGPoint matrixTransform ( SVGMatrix matrix ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPointListImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPointListImpl.java deleted file mode 100644 index e1ab60265..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPointListImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; -import org.w3c.dom.svg.SVGException; -import org.w3c.dom.svg.SVGPoint; - - -public class SVGPointListImpl - implements org.w3c.dom.svg.SVGPointList -{ -public native int getNumberOfItems( ); - -public native void clear ( ) - throws DOMException; -public native SVGPoint initialize ( SVGPoint newItem ) - throws DOMException, SVGException; -public native SVGPoint getItem ( int index ) - throws DOMException; -public native SVGPoint insertItemBefore ( SVGPoint newItem, int index ) - throws DOMException, SVGException; -public native SVGPoint replaceItem ( SVGPoint newItem, int index ) - throws DOMException, SVGException; -public native SVGPoint removeItem ( int index ) - throws DOMException; -public native SVGPoint appendItem ( SVGPoint newItem ) - throws DOMException, SVGException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPolygonElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPolygonElementImpl.java deleted file mode 100644 index a93eca993..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPolygonElementImpl.java +++ /dev/null @@ -1,177 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - -import org.w3c.dom.events.Event; -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.events.EventException; -import org.w3c.dom.events.EventListener; - - - -public class SVGPolygonElementImpl - extends - SVGElementImpl - //SVGTests, - //SVGLangSpace, - //SVGExternalResourcesRequired, - //SVGStylable, - //SVGTransformable, - //EventTarget, - //SVGAnimatedPoints - implements org.w3c.dom.svg.SVGPolygonElement -{ - -public SVGPolygonElementImpl() -{ - imbue(_SVGTests = new SVGTestsImpl()); - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); - imbue(_SVGTransformable = new SVGTransformableImpl()); - imbue(_EventTarget = new org.inkscape.dom.events.EventTargetImpl()); - imbue(_SVGAnimatedPoints = new SVGAnimatedPointsImpl()); -} - - -//from SVGTests -private SVGTestsImpl _SVGTests; -public SVGStringList getRequiredFeatures() - { return _SVGTests.getRequiredFeatures(); } -public SVGStringList getRequiredExtensions() - { return _SVGTests.getRequiredExtensions(); } -public SVGStringList getSystemLanguage() - { return _SVGTests.getSystemLanguage(); } -public boolean hasExtension (String extension) - { return _SVGTests.hasExtension(extension); } -//end SVGTests - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - -//from SVGTransformable -private SVGTransformableImpl _SVGTransformable; -public SVGAnimatedTransformList getTransform() - { return _SVGTransformable.getTransform(); } -//end SVGTransformable - -//from SVGLocatable (from SVGTransformable) -public SVGElement getNearestViewportElement() - { return _SVGTransformable.getNearestViewportElement(); } -public SVGElement getFarthestViewportElement() - { return _SVGTransformable.getFarthestViewportElement(); } -public SVGRect getBBox() - { return _SVGTransformable.getBBox(); } -public SVGMatrix getCTM() - { return _SVGTransformable.getCTM(); } -public SVGMatrix getScreenCTM() - { return _SVGTransformable.getScreenCTM(); } -public SVGMatrix getTransformToElement (SVGElement element) - throws SVGException - { return _SVGTransformable.getTransformToElement(element); } -//end SVGLocatable - -//from EventTarget -private org.inkscape.dom.events.EventTargetImpl _EventTarget; -public void addEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.addEventListener(type, listener, useCapture); } -public void removeEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListener(type, listener, useCapture); } -public boolean dispatchEvent(Event evt) - throws EventException - { return _EventTarget.dispatchEvent(evt); } -public void addEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture, - Object evtGroup) - { _EventTarget.addEventListenerNS(namespaceURI, type, listener, useCapture, evtGroup); } -public void removeEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListenerNS(namespaceURI, type, listener, useCapture); } -public boolean willTriggerNS(String namespaceURI, - String type) - { return _EventTarget.willTriggerNS(namespaceURI, type); } -public boolean hasEventListenerNS(String namespaceURI, - String type) - { return _EventTarget.hasEventListenerNS(namespaceURI, type); } -//end EventTarget - - -//from SVGAnimatedPoints -SVGAnimatedPointsImpl _SVGAnimatedPoints; -public SVGPointList getPoints() - { return _SVGAnimatedPoints.getPoints(); } -public SVGPointList getAnimatedPoints() - { return _SVGAnimatedPoints.getAnimatedPoints(); } -//end SVGAnimatedPoints - - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPolylineElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPolylineElementImpl.java deleted file mode 100644 index ea017691d..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPolylineElementImpl.java +++ /dev/null @@ -1,175 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - -import org.w3c.dom.events.Event; -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.events.EventException; -import org.w3c.dom.events.EventListener; - - -public class SVGPolylineElementImpl - extends - SVGElementImpl - //SVGTests, - //SVGLangSpace, - //SVGExternalResourcesRequired, - //SVGStylable, - //SVGTransformable, - //EventTarget, - //SVGAnimatedPoints - implements org.w3c.dom.svg.SVGPolylineElement -{ - -public SVGPolylineElementImpl() -{ - imbue(_SVGTests = new SVGTestsImpl()); - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); - imbue(_SVGTransformable = new SVGTransformableImpl()); - imbue(_EventTarget = new org.inkscape.dom.events.EventTargetImpl()); - imbue(_SVGAnimatedPoints = new SVGAnimatedPointsImpl()); -} - - -//from SVGTests -private SVGTestsImpl _SVGTests; -public SVGStringList getRequiredFeatures() - { return _SVGTests.getRequiredFeatures(); } -public SVGStringList getRequiredExtensions() - { return _SVGTests.getRequiredExtensions(); } -public SVGStringList getSystemLanguage() - { return _SVGTests.getSystemLanguage(); } -public boolean hasExtension (String extension) - { return _SVGTests.hasExtension(extension); } -//end SVGTests - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - -//from SVGTransformable -private SVGTransformableImpl _SVGTransformable; -public SVGAnimatedTransformList getTransform() - { return _SVGTransformable.getTransform(); } -//end SVGTransformable - -//from SVGLocatable (from SVGTransformable) -public SVGElement getNearestViewportElement() - { return _SVGTransformable.getNearestViewportElement(); } -public SVGElement getFarthestViewportElement() - { return _SVGTransformable.getFarthestViewportElement(); } -public SVGRect getBBox() - { return _SVGTransformable.getBBox(); } -public SVGMatrix getCTM() - { return _SVGTransformable.getCTM(); } -public SVGMatrix getScreenCTM() - { return _SVGTransformable.getScreenCTM(); } -public SVGMatrix getTransformToElement (SVGElement element) - throws SVGException - { return _SVGTransformable.getTransformToElement(element); } -//end SVGLocatable - -//from EventTarget -private org.inkscape.dom.events.EventTargetImpl _EventTarget; -public void addEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.addEventListener(type, listener, useCapture); } -public void removeEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListener(type, listener, useCapture); } -public boolean dispatchEvent(Event evt) - throws EventException - { return _EventTarget.dispatchEvent(evt); } -public void addEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture, - Object evtGroup) - { _EventTarget.addEventListenerNS(namespaceURI, type, listener, useCapture, evtGroup); } -public void removeEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListenerNS(namespaceURI, type, listener, useCapture); } -public boolean willTriggerNS(String namespaceURI, - String type) - { return _EventTarget.willTriggerNS(namespaceURI, type); } -public boolean hasEventListenerNS(String namespaceURI, - String type) - { return _EventTarget.hasEventListenerNS(namespaceURI, type); } -//end EventTarget - - -//from SVGAnimatedPoints -SVGAnimatedPointsImpl _SVGAnimatedPoints; -public SVGPointList getPoints() - { return _SVGAnimatedPoints.getPoints(); } -public SVGPointList getAnimatedPoints() - { return _SVGAnimatedPoints.getAnimatedPoints(); } -//end SVGAnimatedPoints - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGPreserveAspectRatioImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGPreserveAspectRatioImpl.java deleted file mode 100644 index 07d9e26ec..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGPreserveAspectRatioImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -public class SVGPreserveAspectRatioImpl - implements org.w3c.dom.svg.SVGPreserveAspectRatio -{ -public native short getAlign( ); -public native void setAlign( short align ) - throws DOMException; -public native short getMeetOrSlice( ); -public native void setMeetOrSlice( short meetOrSlice ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGRadialGradientElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGRadialGradientElementImpl.java deleted file mode 100644 index 28db7de38..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGRadialGradientElementImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGAnimatedLength; - - -public class SVGRadialGradientElementImpl - extends - SVGGradientElementImpl - implements org.w3c.dom.svg.SVGRadialGradientElement -{ -public native SVGAnimatedLength getCx( ); -public native SVGAnimatedLength getCy( ); -public native SVGAnimatedLength getR( ); -public native SVGAnimatedLength getFx( ); -public native SVGAnimatedLength getFy( ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGRectElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGRectElementImpl.java deleted file mode 100644 index e0a3aefc7..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGRectElementImpl.java +++ /dev/null @@ -1,170 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - -import org.w3c.dom.events.Event; -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.events.EventException; -import org.w3c.dom.events.EventListener; - - - -public class SVGRectElementImpl - extends - SVGElementImpl - //SVGTests, - //SVGLangSpace, - //SVGExternalResourcesRequired, - //SVGStylable, - //SVGTransformable, - //EventTarget - implements org.w3c.dom.svg.SVGRectElement -{ - -public SVGRectElementImpl() -{ - imbue(_SVGTests = new SVGTestsImpl()); - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); - imbue(_SVGTransformable = new SVGTransformableImpl()); - imbue(_EventTarget = new org.inkscape.dom.events.EventTargetImpl()); -} - - -//from SVGTests -private SVGTestsImpl _SVGTests; -public SVGStringList getRequiredFeatures() - { return _SVGTests.getRequiredFeatures(); } -public SVGStringList getRequiredExtensions() - { return _SVGTests.getRequiredExtensions(); } -public SVGStringList getSystemLanguage() - { return _SVGTests.getSystemLanguage(); } -public boolean hasExtension (String extension) - { return _SVGTests.hasExtension(extension); } -//end SVGTests - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - -//from SVGTransformable -private SVGTransformableImpl _SVGTransformable; -public SVGAnimatedTransformList getTransform() - { return _SVGTransformable.getTransform(); } -//end SVGTransformable - -//from SVGLocatable (from SVGTransformable) -public SVGElement getNearestViewportElement() - { return _SVGTransformable.getNearestViewportElement(); } -public SVGElement getFarthestViewportElement() - { return _SVGTransformable.getFarthestViewportElement(); } -public SVGRect getBBox() - { return _SVGTransformable.getBBox(); } -public SVGMatrix getCTM() - { return _SVGTransformable.getCTM(); } -public SVGMatrix getScreenCTM() - { return _SVGTransformable.getScreenCTM(); } -public SVGMatrix getTransformToElement (SVGElement element) - throws SVGException - { return _SVGTransformable.getTransformToElement(element); } -//end SVGLocatable - -//from EventTarget -private org.inkscape.dom.events.EventTargetImpl _EventTarget; -public void addEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.addEventListener(type, listener, useCapture); } -public void removeEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListener(type, listener, useCapture); } -public boolean dispatchEvent(Event evt) - throws EventException - { return _EventTarget.dispatchEvent(evt); } -public void addEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture, - Object evtGroup) - { _EventTarget.addEventListenerNS(namespaceURI, type, listener, useCapture, evtGroup); } -public void removeEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListenerNS(namespaceURI, type, listener, useCapture); } -public boolean willTriggerNS(String namespaceURI, - String type) - { return _EventTarget.willTriggerNS(namespaceURI, type); } -public boolean hasEventListenerNS(String namespaceURI, - String type) - { return _EventTarget.hasEventListenerNS(namespaceURI, type); } -//end EventTarget - -public native SVGAnimatedLength getX( ); -public native SVGAnimatedLength getY( ); -public native SVGAnimatedLength getWidth( ); -public native SVGAnimatedLength getHeight( ); -public native SVGAnimatedLength getRx( ); -public native SVGAnimatedLength getRy( ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGRectImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGRectImpl.java deleted file mode 100644 index 9b4b0e762..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGRectImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - - -public class SVGRectImpl - implements org.w3c.dom.svg.SVGRect -{ -public native float getX( ); -public native void setX( float x ) - throws DOMException; -public native float getY( ); -public native void setY( float y ) - throws DOMException; -public native float getWidth( ); -public native void setWidth( float width ) - throws DOMException; -public native float getHeight( ); -public native void setHeight( float height ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGRenderingIntentImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGRenderingIntentImpl.java deleted file mode 100644 index 629a105cb..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGRenderingIntentImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -public class SVGRenderingIntentImpl - implements org.w3c.dom.svg.SVGRenderingIntent -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGSVGElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGSVGElementImpl.java deleted file mode 100644 index a98db9e07..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGSVGElementImpl.java +++ /dev/null @@ -1,280 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.NodeList; -import org.w3c.dom.Element; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; -import org.w3c.dom.css.RGBColor; - -import org.w3c.dom.views.DocumentView; - -import org.w3c.dom.events.Event; -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.events.EventException; -import org.w3c.dom.events.EventListener; -import org.w3c.dom.events.DocumentEvent; - -import org.w3c.dom.stylesheets.DocumentStyle; -import org.w3c.dom.stylesheets.StyleSheetList; - - - -public class SVGSVGElementImpl - extends - SVGElementImpl - //SVGTests, - //SVGLangSpace, - //SVGExternalResourcesRequired, - //SVGStylable, - //SVGLocatable, - //SVGFitToViewBox, - //SVGZoomAndPan, - //EventTarget, - //DocumentEvent, - //ViewCSS, - //DocumentCSS - implements org.w3c.dom.svg.SVGSVGElement -{ -public SVGSVGElementImpl() -{ - imbue(_SVGTests = new SVGTestsImpl()); - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); - imbue(_SVGLocatable = new SVGLocatableImpl()); - imbue(_SVGFitToViewBox = new SVGFitToViewBoxImpl()); - imbue(_SVGZoomAndPan = new SVGZoomAndPanImpl()); - imbue(_EventTarget = new org.inkscape.dom.events.EventTargetImpl()); - imbue(_DocumentEvent = new org.inkscape.dom.events.DocumentEventImpl()); - imbue(_ViewCSS = new org.inkscape.dom.css.ViewCSSImpl()); - imbue(_DocumentCSS = new org.inkscape.dom.css.DocumentCSSImpl()); -} - - -//from SVGURIReference -private SVGURIReferenceImpl _SVGURIReference; -public SVGAnimatedString getHref() - { return _SVGURIReference.getHref(); } -//end SVGURIReference - -//from SVGTests -private SVGTestsImpl _SVGTests; -public SVGStringList getRequiredFeatures() - { return _SVGTests.getRequiredFeatures(); } -public SVGStringList getRequiredExtensions() - { return _SVGTests.getRequiredExtensions(); } -public SVGStringList getSystemLanguage() - { return _SVGTests.getSystemLanguage(); } -public boolean hasExtension (String extension) - { return _SVGTests.hasExtension(extension); } -//end SVGTests - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - -//from SVGLocatable -private SVGLocatableImpl _SVGLocatable; -public SVGElement getNearestViewportElement() - { return _SVGLocatable.getNearestViewportElement(); } -public SVGElement getFarthestViewportElement() - { return _SVGLocatable.getFarthestViewportElement(); } -public SVGRect getBBox() - { return _SVGLocatable.getBBox(); } -public SVGMatrix getCTM() - { return _SVGLocatable.getCTM(); } -public SVGMatrix getScreenCTM() - { return _SVGLocatable.getScreenCTM(); } -public SVGMatrix getTransformToElement (SVGElement element) - throws SVGException - { return _SVGLocatable.getTransformToElement(element); } -//end SVGLocatable - -//from EventTarget -private org.inkscape.dom.events.EventTargetImpl _EventTarget; -public void addEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.addEventListener(type, listener, useCapture); } -public void removeEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListener(type, listener, useCapture); } -public boolean dispatchEvent(Event evt) - throws EventException - { return _EventTarget.dispatchEvent(evt); } -public void addEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture, - Object evtGroup) - { _EventTarget.addEventListenerNS(namespaceURI, type, listener, useCapture, evtGroup); } -public void removeEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListenerNS(namespaceURI, type, listener, useCapture); } -public boolean willTriggerNS(String namespaceURI, - String type) - { return _EventTarget.willTriggerNS(namespaceURI, type); } -public boolean hasEventListenerNS(String namespaceURI, - String type) - { return _EventTarget.hasEventListenerNS(namespaceURI, type); } -//end EventTarget - -//from SVGFitToViewBox -SVGFitToViewBoxImpl _SVGFitToViewBox; -public SVGAnimatedRect getViewBox() - { return _SVGFitToViewBox.getViewBox(); } -public SVGAnimatedPreserveAspectRatio getPreserveAspectRatio() - { return _SVGFitToViewBox.getPreserveAspectRatio(); } -//end SVGFitToViewBox - -//from SVGZoomAndPan -SVGZoomAndPanImpl _SVGZoomAndPan; -public short getZoomAndPan() - { return _SVGZoomAndPan.getZoomAndPan(); } -public void setZoomAndPan(short zoomAndPan) throws DOMException - { _SVGZoomAndPan.setZoomAndPan(zoomAndPan); } -//end SVGZoomAndPan - - -//from DocumentEvent -org.inkscape.dom.events.DocumentEventImpl _DocumentEvent; -public Event createEvent(String eventType) throws DOMException - { return _DocumentEvent.createEvent(eventType); } -public boolean canDispatch(String namespaceURI, String type) - { return _DocumentEvent.canDispatch(namespaceURI, type); } -//end DocumentEvent - -//from ViewCSS -org.inkscape.dom.css.ViewCSSImpl _ViewCSS; -public CSSStyleDeclaration getComputedStyle(Element elt, String pseudoElt) - { return _ViewCSS.getComputedStyle(elt, pseudoElt); } -//end ViewCSS - -//from AbstractView (from ViewCSS) -public DocumentView getDocument() - { return _ViewCSS.getDocument(); } -//end AbstractView - -//from DocumentCSS -org.inkscape.dom.css.DocumentCSSImpl _DocumentCSS; -public CSSStyleDeclaration getOverrideStyle(Element elt, String pseudoElt) - { return _DocumentCSS.getOverrideStyle(elt, pseudoElt); } -//end DocumentCSS - -//from DocumentStyle (from DocumentCSS) -public StyleSheetList getStyleSheets() - { return _DocumentCSS.getStyleSheets(); } -//end DocumentStyle - - -public native SVGAnimatedLength getX( ); -public native SVGAnimatedLength getY( ); -public native SVGAnimatedLength getWidth( ); -public native SVGAnimatedLength getHeight( ); -public native String getContentScriptType( ); -public native void setContentScriptType( String contentScriptType ) - throws DOMException; -public native String getContentStyleType( ); -public native void setContentStyleType( String contentStyleType ) - throws DOMException; -public native SVGRect getViewport( ); -public native float getPixelUnitToMillimeterX( ); -public native float getPixelUnitToMillimeterY( ); -public native float getScreenPixelToMillimeterX( ); -public native float getScreenPixelToMillimeterY( ); -public native boolean getUseCurrentView( ); -public native void setUseCurrentView( boolean useCurrentView ) - throws DOMException; -public native SVGViewSpec getCurrentView( ); -public native float getCurrentScale( ); -public native void setCurrentScale( float currentScale ) - throws DOMException; -public native SVGPoint getCurrentTranslate( ); - -public native int suspendRedraw ( int max_wait_milliseconds ); -public native void unsuspendRedraw ( int suspend_handle_id ) - throws DOMException; -public native void unsuspendRedrawAll ( ); -public native void forceRedraw ( ); -public native void pauseAnimations ( ); -public native void unpauseAnimations ( ); -public native boolean animationsPaused ( ); -public native float getCurrentTime ( ); -public native void setCurrentTime ( float seconds ); -public native NodeList getIntersectionList ( SVGRect rect, SVGElement referenceElement ); -public native NodeList getEnclosureList ( SVGRect rect, SVGElement referenceElement ); -public native boolean checkIntersection ( SVGElement element, SVGRect rect ); -public native boolean checkEnclosure ( SVGElement element, SVGRect rect ); -public native void deselectAll ( ); -public native SVGNumber createSVGNumber ( ); -public native SVGLength createSVGLength ( ); -public native SVGAngle createSVGAngle ( ); -public native SVGPoint createSVGPoint ( ); -public native SVGMatrix createSVGMatrix ( ); -public native SVGRect createSVGRect ( ); -public native SVGTransform createSVGTransform ( ); -public native SVGTransform createSVGTransformFromMatrix ( SVGMatrix matrix ); -public native Element getElementById ( String elementId ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGScriptElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGScriptElementImpl.java deleted file mode 100644 index a211ad345..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGScriptElementImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; -import org.w3c.dom.svg.*; - - - -public class SVGScriptElementImpl - extends - SVGElementImpl - //SVGURIReference, - //SVGExternalResourcesRequired - implements org.w3c.dom.svg.SVGScriptElement -{ - -public SVGScriptElementImpl() -{ - imbue(_SVGURIReference = new SVGURIReferenceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); -} - - -//from SVGURIReference -private SVGURIReferenceImpl _SVGURIReference; -public SVGAnimatedString getHref() - { return _SVGURIReference.getHref(); } -//end SVGURIReference - - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - - - -public native String getType( ); -public native void setType( String type ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGSetElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGSetElementImpl.java deleted file mode 100644 index 9187d6104..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGSetElementImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -public class SVGSetElementImpl - extends - SVGAnimationElementImpl - implements org.w3c.dom.svg.SVGSetElement -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGStopElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGStopElementImpl.java deleted file mode 100644 index dee28e3ed..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGStopElementImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - -public class SVGStopElementImpl - extends - SVGElementImpl - //SVGStylable - implements org.w3c.dom.svg.SVGStopElement -{ - -public SVGStopElementImpl() -{ - imbue(_SVGStylable = new SVGStylableImpl()); -} - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - - -public native SVGAnimatedNumber getOffset( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGStringListImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGStringListImpl.java deleted file mode 100644 index cb352d9c9..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGStringListImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; -import org.w3c.dom.svg.SVGException; - - - -public class SVGStringListImpl - implements org.w3c.dom.svg.SVGStringList -{ -public native int getNumberOfItems( ); - -public native void clear ( ) - throws DOMException; -public native String initialize ( String newItem ) - throws DOMException, SVGException; -public native String getItem ( int index ) - throws DOMException; -public native String insertItemBefore ( String newItem, int index ) - throws DOMException, SVGException; -public native String replaceItem ( String newItem, int index ) - throws DOMException, SVGException; -public native String removeItem ( int index ) - throws DOMException; -public native String appendItem ( String newItem ) - throws DOMException, SVGException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGStylableImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGStylableImpl.java deleted file mode 100644 index 7523d456d..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGStylableImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; -import org.w3c.dom.svg.SVGAnimatedString; - -public class SVGStylableImpl - extends - org.inkscape.cmn.BaseInterface - implements org.w3c.dom.svg.SVGStylable -{ - -public native SVGAnimatedString getClassName( ); -public native CSSStyleDeclaration getStyle( ); -public native CSSValue getPresentationAttribute ( String name ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGStyleElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGStyleElementImpl.java deleted file mode 100644 index 8b7408434..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGStyleElementImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -public class SVGStyleElementImpl - extends - SVGElementImpl - implements org.w3c.dom.svg.SVGStyleElement -{ -public native String getXMLspace( ); -public native void setXMLspace( String xmlspace ) - throws DOMException; -public native String getType( ); -public native void setType( String type ) - throws DOMException; -public native String getMedia( ); -public native void setMedia( String media ) - throws DOMException; -public native String getTitle( ); -public native void setTitle( String title ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGSwitchElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGSwitchElementImpl.java deleted file mode 100644 index fa74caf70..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGSwitchElementImpl.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - -import org.w3c.dom.events.Event; -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.events.EventException; -import org.w3c.dom.events.EventListener; - - -public class SVGSwitchElementImpl - extends - SVGElementImpl - //SVGTests, - //SVGLangSpace, - //SVGExternalResourcesRequired, - //SVGStylable, - //SVGTransformable, - //EventTarget - implements org.w3c.dom.svg.SVGSwitchElement -{ - -public SVGSwitchElementImpl() -{ - imbue(_SVGTests = new SVGTestsImpl()); - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); - imbue(_SVGTransformable = new SVGTransformableImpl()); - imbue(_EventTarget = new org.inkscape.dom.events.EventTargetImpl()); -} - - -//from SVGTests -private SVGTestsImpl _SVGTests; -public SVGStringList getRequiredFeatures() - { return _SVGTests.getRequiredFeatures(); } -public SVGStringList getRequiredExtensions() - { return _SVGTests.getRequiredExtensions(); } -public SVGStringList getSystemLanguage() - { return _SVGTests.getSystemLanguage(); } -public boolean hasExtension (String extension) - { return _SVGTests.hasExtension(extension); } -//end SVGTests - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - -//from SVGTransformable -private SVGTransformableImpl _SVGTransformable; -public SVGAnimatedTransformList getTransform() - { return _SVGTransformable.getTransform(); } -//end SVGTransformable - -//from SVGLocatable (from SVGTransformable) -public SVGElement getNearestViewportElement() - { return _SVGTransformable.getNearestViewportElement(); } -public SVGElement getFarthestViewportElement() - { return _SVGTransformable.getFarthestViewportElement(); } -public SVGRect getBBox() - { return _SVGTransformable.getBBox(); } -public SVGMatrix getCTM() - { return _SVGTransformable.getCTM(); } -public SVGMatrix getScreenCTM() - { return _SVGTransformable.getScreenCTM(); } -public SVGMatrix getTransformToElement (SVGElement element) - throws SVGException - { return _SVGTransformable.getTransformToElement(element); } -//end SVGLocatable - -//from EventTarget -private org.inkscape.dom.events.EventTargetImpl _EventTarget; -public void addEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.addEventListener(type, listener, useCapture); } -public void removeEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListener(type, listener, useCapture); } -public boolean dispatchEvent(Event evt) - throws EventException - { return _EventTarget.dispatchEvent(evt); } -public void addEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture, - Object evtGroup) - { _EventTarget.addEventListenerNS(namespaceURI, type, listener, useCapture, evtGroup); } -public void removeEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListenerNS(namespaceURI, type, listener, useCapture); } -public boolean willTriggerNS(String namespaceURI, - String type) - { return _EventTarget.willTriggerNS(namespaceURI, type); } -public boolean hasEventListenerNS(String namespaceURI, - String type) - { return _EventTarget.hasEventListenerNS(namespaceURI, type); } -//end EventTarget - - -} - diff --git a/src/bind/java/org/inkscape/dom/svg/SVGSymbolElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGSymbolElementImpl.java deleted file mode 100644 index 5fded7c3a..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGSymbolElementImpl.java +++ /dev/null @@ -1,161 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - -import org.w3c.dom.events.Event; -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.events.EventException; -import org.w3c.dom.events.EventListener; - - - -public class SVGSymbolElementImpl - extends - SVGElementImpl - //SVGLangSpace, - //SVGExternalResourcesRequired, - //SVGStylable, - //SVGFitToViewBox, - //EventTarget - implements org.w3c.dom.svg.SVGSymbolElement -{ - -public SVGSymbolElementImpl() -{ - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); - imbue(_SVGTransformable = new SVGTransformableImpl()); - imbue(_SVGFitToViewBox = new SVGFitToViewBoxImpl()); - imbue(_EventTarget = new org.inkscape.dom.events.EventTargetImpl()); -} - - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - -//from SVGTransformable -private SVGTransformableImpl _SVGTransformable; -public SVGAnimatedTransformList getTransform() - { return _SVGTransformable.getTransform(); } -//end SVGTransformable - -//from SVGLocatable (from SVGTransformable) -public SVGElement getNearestViewportElement() - { return _SVGTransformable.getNearestViewportElement(); } -public SVGElement getFarthestViewportElement() - { return _SVGTransformable.getFarthestViewportElement(); } -public SVGRect getBBox() - { return _SVGTransformable.getBBox(); } -public SVGMatrix getCTM() - { return _SVGTransformable.getCTM(); } -public SVGMatrix getScreenCTM() - { return _SVGTransformable.getScreenCTM(); } -public SVGMatrix getTransformToElement (SVGElement element) - throws SVGException - { return _SVGTransformable.getTransformToElement(element); } -//end SVGLocatable - -//from SVGFitToViewBox -SVGFitToViewBoxImpl _SVGFitToViewBox; -public SVGAnimatedRect getViewBox() - { return _SVGFitToViewBox.getViewBox(); } -public SVGAnimatedPreserveAspectRatio getPreserveAspectRatio() - { return _SVGFitToViewBox.getPreserveAspectRatio(); } -//end SVGFitToViewBox - -//from EventTarget -private org.inkscape.dom.events.EventTargetImpl _EventTarget; -public void addEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.addEventListener(type, listener, useCapture); } -public void removeEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListener(type, listener, useCapture); } -public boolean dispatchEvent(Event evt) - throws EventException - { return _EventTarget.dispatchEvent(evt); } -public void addEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture, - Object evtGroup) - { _EventTarget.addEventListenerNS(namespaceURI, type, listener, useCapture, evtGroup); } -public void removeEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListenerNS(namespaceURI, type, listener, useCapture); } -public boolean willTriggerNS(String namespaceURI, - String type) - { return _EventTarget.willTriggerNS(namespaceURI, type); } -public boolean hasEventListenerNS(String namespaceURI, - String type) - { return _EventTarget.hasEventListenerNS(namespaceURI, type); } -//end EventTarget - - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGTRefElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGTRefElementImpl.java deleted file mode 100644 index 545c1f305..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGTRefElementImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGAnimatedString; - - - -public class SVGTRefElementImpl - extends - SVGTextPositioningElementImpl - //SVGURIReference - implements org.w3c.dom.svg.SVGTRefElement -{ - -public SVGTRefElementImpl() -{ - imbue(_SVGURIReference = new SVGURIReferenceImpl()); -} - - -//from SVGURIReference -private SVGURIReferenceImpl _SVGURIReference; -public SVGAnimatedString getHref() - { return _SVGURIReference.getHref(); } -//end SVGURIReference - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGTSpanElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGTSpanElementImpl.java deleted file mode 100644 index 89ed5dabb..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGTSpanElementImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -public class SVGTSpanElementImpl - extends - SVGTextPositioningElementImpl - implements org.w3c.dom.svg.SVGTSpanElement -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGTestsImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGTestsImpl.java deleted file mode 100644 index 5f0a8c727..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGTestsImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGStringList; - - -public class SVGTestsImpl - extends - org.inkscape.cmn.BaseInterface - implements org.w3c.dom.svg.SVGTests -{ -public native SVGStringList getRequiredFeatures( ); -public native SVGStringList getRequiredExtensions( ); -public native SVGStringList getSystemLanguage( ); -public native boolean hasExtension ( String extension ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGTextContentElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGTextContentElementImpl.java deleted file mode 100644 index 3a271ce7a..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGTextContentElementImpl.java +++ /dev/null @@ -1,161 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - -import org.w3c.dom.events.EventException; -import org.w3c.dom.events.Event; -import org.w3c.dom.events.EventListener; - - - - -public class SVGTextContentElementImpl - extends - SVGElementImpl - //SVGTests, - //SVGLangSpace, - //SVGExternalResourcesRequired, - //SVGStylable, - //EventTarget - implements org.w3c.dom.svg.SVGTextContentElement -{ - -public SVGTextContentElementImpl() -{ - imbue(_SVGTests = new SVGTestsImpl()); - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); - imbue(_EventTarget = new org.inkscape.dom.events.EventTargetImpl()); -} - - -//from SVGTests -private SVGTestsImpl _SVGTests; -public SVGStringList getRequiredFeatures() - { return _SVGTests.getRequiredFeatures(); } -public SVGStringList getRequiredExtensions() - { return _SVGTests.getRequiredExtensions(); } -public SVGStringList getSystemLanguage() - { return _SVGTests.getSystemLanguage(); } -public boolean hasExtension (String extension) - { return _SVGTests.hasExtension(extension); } -//end SVGTests - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - -//from EventTarget -private org.inkscape.dom.events.EventTargetImpl _EventTarget; -public void addEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.addEventListener(type, listener, useCapture); } -public void removeEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListener(type, listener, useCapture); } -public boolean dispatchEvent(Event evt) - throws EventException - { return _EventTarget.dispatchEvent(evt); } -public void addEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture, - Object evtGroup) - { _EventTarget.addEventListenerNS(namespaceURI, type, listener, useCapture, evtGroup); } -public void removeEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListenerNS(namespaceURI, type, listener, useCapture); } -public boolean willTriggerNS(String namespaceURI, - String type) - { return _EventTarget.willTriggerNS(namespaceURI, type); } -public boolean hasEventListenerNS(String namespaceURI, - String type) - { return _EventTarget.hasEventListenerNS(namespaceURI, type); } -//end EventTarget - - - -public native SVGAnimatedLength getTextLength( ); -public native SVGAnimatedEnumeration getLengthAdjust( ); - -public native int getNumberOfChars ( ); -public native float getComputedTextLength ( ); -public native float getSubStringLength ( int charnum, int nchars ) - throws DOMException; -public native SVGPoint getStartPositionOfChar ( int charnum ) - throws DOMException; -public native SVGPoint getEndPositionOfChar ( int charnum ) - throws DOMException; -public native SVGRect getExtentOfChar ( int charnum ) - throws DOMException; -public native float getRotationOfChar ( int charnum ) - throws DOMException; -public native int getCharNumAtPosition ( SVGPoint point ); -public native void selectSubString ( int charnum, int nchars ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGTextElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGTextElementImpl.java deleted file mode 100644 index a312aade8..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGTextElementImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.*; - - -public class SVGTextElementImpl - extends - SVGTextPositioningElementImpl - //SVGTransformable - implements org.w3c.dom.svg.SVGTextElement -{ - -public SVGTextElementImpl() -{ - imbue(_SVGTransformable = new SVGTransformableImpl()); -} - - -//from SVGTransformable -private SVGTransformableImpl _SVGTransformable; -public SVGAnimatedTransformList getTransform() - { return _SVGTransformable.getTransform(); } -//end SVGTransformable - -//from SVGLocatable (from SVGTransformable) -public SVGElement getNearestViewportElement() - { return _SVGTransformable.getNearestViewportElement(); } -public SVGElement getFarthestViewportElement() - { return _SVGTransformable.getFarthestViewportElement(); } -public SVGRect getBBox() - { return _SVGTransformable.getBBox(); } -public SVGMatrix getCTM() - { return _SVGTransformable.getCTM(); } -public SVGMatrix getScreenCTM() - { return _SVGTransformable.getScreenCTM(); } -public SVGMatrix getTransformToElement (SVGElement element) - throws SVGException - { return _SVGTransformable.getTransformToElement(element); } -//end SVGLocatable - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGTextPathElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGTextPathElementImpl.java deleted file mode 100644 index ce6a96da9..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGTextPathElementImpl.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGAnimatedLength; -import org.w3c.dom.svg.SVGAnimatedString; -import org.w3c.dom.svg.SVGAnimatedEnumeration; - -public class SVGTextPathElementImpl - extends - SVGTextContentElementImpl - //SVGURIReference - implements org.w3c.dom.svg.SVGTextPathElement -{ - -public SVGTextPathElementImpl() -{ - imbue(_SVGURIReference = new SVGURIReferenceImpl()); -} - - -//from SVGURIReference -private SVGURIReferenceImpl _SVGURIReference; -public SVGAnimatedString getHref() - { return _SVGURIReference.getHref(); } -//end SVGURIReference - -public native SVGAnimatedLength getStartOffset( ); -public native SVGAnimatedEnumeration getMethod( ); -public native SVGAnimatedEnumeration getSpacing( ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGTextPositioningElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGTextPositioningElementImpl.java deleted file mode 100644 index 1192f081a..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGTextPositioningElementImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGAnimatedLengthList; -import org.w3c.dom.svg.SVGAnimatedNumberList; - - -public class SVGTextPositioningElementImpl - extends - SVGTextContentElementImpl - implements org.w3c.dom.svg.SVGTextPositioningElement -{ -public native SVGAnimatedLengthList getX( ); -public native SVGAnimatedLengthList getY( ); -public native SVGAnimatedLengthList getDx( ); -public native SVGAnimatedLengthList getDy( ); -public native SVGAnimatedNumberList getRotate( ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGTitleElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGTitleElementImpl.java deleted file mode 100644 index 83cdea5bf..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGTitleElementImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - - - -public class SVGTitleElementImpl - extends - SVGElementImpl - //SVGLangSpace, - //SVGStylable - implements org.w3c.dom.svg.SVGTitleElement -{ - -public SVGTitleElementImpl() -{ - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); -} - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGTransformImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGTransformImpl.java deleted file mode 100644 index 1a5fdc3e5..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGTransformImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGMatrix; - - -public class SVGTransformImpl - implements org.w3c.dom.svg.SVGTransform -{ -public native short getType( ); -public native SVGMatrix getMatrix( ); -public native float getAngle( ); - -public native void setMatrix ( SVGMatrix matrix ); -public native void setTranslate ( float tx, float ty ); -public native void setScale ( float sx, float sy ); -public native void setRotate ( float angle, float cx, float cy ); -public native void setSkewX ( float angle ); -public native void setSkewY ( float angle ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGTransformListImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGTransformListImpl.java deleted file mode 100644 index 6fa6012a3..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGTransformListImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; -import org.w3c.dom.svg.SVGException; - -import org.w3c.dom.svg.SVGTransform; -import org.w3c.dom.svg.SVGMatrix; - - -public class SVGTransformListImpl - implements org.w3c.dom.svg.SVGTransformList -{ -public native int getNumberOfItems( ); - -public native void clear ( ) - throws DOMException; -public native SVGTransform initialize ( SVGTransform newItem ) - throws DOMException, SVGException; -public native SVGTransform getItem ( int index ) - throws DOMException; -public native SVGTransform insertItemBefore ( SVGTransform newItem, int index ) - throws DOMException, SVGException; -public native SVGTransform replaceItem ( SVGTransform newItem, int index ) - throws DOMException, SVGException; -public native SVGTransform removeItem ( int index ) - throws DOMException; -public native SVGTransform appendItem ( SVGTransform newItem ) - throws DOMException, SVGException; -public native SVGTransform createSVGTransformFromMatrix ( SVGMatrix matrix ); -public native SVGTransform consolidate ( ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGTransformableImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGTransformableImpl.java deleted file mode 100644 index 96384f6f6..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGTransformableImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGAnimatedTransformList; - - -public class SVGTransformableImpl - extends - SVGLocatableImpl - implements org.w3c.dom.svg.SVGTransformable -{ -public native SVGAnimatedTransformList getTransform( ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGURIReferenceImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGURIReferenceImpl.java deleted file mode 100644 index 2e3bb0bd4..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGURIReferenceImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.SVGAnimatedString; - - -public class SVGURIReferenceImpl - extends - org.inkscape.cmn.BaseInterface - implements org.w3c.dom.svg.SVGURIReference -{ -public native SVGAnimatedString getHref( ); -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGUnitTypesImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGUnitTypesImpl.java deleted file mode 100644 index b76dab8ea..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGUnitTypesImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -public class SVGUnitTypesImpl - implements org.w3c.dom.svg.SVGUnitTypes -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGUseElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGUseElementImpl.java deleted file mode 100644 index 3283cdc26..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGUseElementImpl.java +++ /dev/null @@ -1,180 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -import org.w3c.dom.svg.*; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - -import org.w3c.dom.events.Event; -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.events.EventException; -import org.w3c.dom.events.EventListener; - - -public class SVGUseElementImpl - extends - SVGElementImpl - //SVGURIReference, - //SVGTests, - //SVGLangSpace, - //SVGExternalResourcesRequired, - //SVGStylable, - //SVGTransformable, - //EventTarget - implements org.w3c.dom.svg.SVGUseElement -{ -public SVGUseElementImpl() -{ - imbue(_SVGURIReference = new SVGURIReferenceImpl()); - imbue(_SVGTests = new SVGTestsImpl()); - imbue(_SVGLangSpace = new SVGLangSpaceImpl()); - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGStylable = new SVGStylableImpl()); - imbue(_SVGTransformable = new SVGTransformableImpl()); - imbue(_EventTarget = new org.inkscape.dom.events.EventTargetImpl()); -} - - -//from SVGURIReference -private SVGURIReferenceImpl _SVGURIReference; -public SVGAnimatedString getHref() - { return _SVGURIReference.getHref(); } -//end SVGURIReference - -//from SVGTests -private SVGTestsImpl _SVGTests; -public SVGStringList getRequiredFeatures() - { return _SVGTests.getRequiredFeatures(); } -public SVGStringList getRequiredExtensions() - { return _SVGTests.getRequiredExtensions(); } -public SVGStringList getSystemLanguage() - { return _SVGTests.getSystemLanguage(); } -public boolean hasExtension (String extension) - { return _SVGTests.hasExtension(extension); } -//end SVGTests - -//from SVGLangSpace -private SVGLangSpaceImpl _SVGLangSpace; -public String getXMLlang() - { return _SVGLangSpace.getXMLlang(); } -public void setXMLlang(String xmllang) - throws DOMException - { _SVGLangSpace.setXMLlang(xmllang); } -public String getXMLspace() - { return _SVGLangSpace.getXMLspace(); } -public void setXMLspace(String xmlspace) - throws DOMException - { _SVGLangSpace.setXMLspace(xmlspace); } -//end SVGLangSpace - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - -//from SVGStylable -private SVGStylableImpl _SVGStylable; -public SVGAnimatedString getClassName() - { return _SVGStylable.getClassName(); } -public CSSStyleDeclaration getStyle() - { return _SVGStylable.getStyle(); } -public CSSValue getPresentationAttribute(String name) - { return _SVGStylable.getPresentationAttribute(name); } -//end SVGStylable - -//from SVGTransformable -private SVGTransformableImpl _SVGTransformable; -public SVGAnimatedTransformList getTransform() - { return _SVGTransformable.getTransform(); } -//end SVGTransformable - -//from SVGLocatable (from SVGTransformable) -public SVGElement getNearestViewportElement() - { return _SVGTransformable.getNearestViewportElement(); } -public SVGElement getFarthestViewportElement() - { return _SVGTransformable.getFarthestViewportElement(); } -public SVGRect getBBox() - { return _SVGTransformable.getBBox(); } -public SVGMatrix getCTM() - { return _SVGTransformable.getCTM(); } -public SVGMatrix getScreenCTM() - { return _SVGTransformable.getScreenCTM(); } -public SVGMatrix getTransformToElement (SVGElement element) - throws SVGException - { return _SVGTransformable.getTransformToElement(element); } -//end SVGLocatable - -//from EventTarget -private org.inkscape.dom.events.EventTargetImpl _EventTarget; -public void addEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.addEventListener(type, listener, useCapture); } -public void removeEventListener(String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListener(type, listener, useCapture); } -public boolean dispatchEvent(Event evt) - throws EventException - { return _EventTarget.dispatchEvent(evt); } -public void addEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture, - Object evtGroup) - { _EventTarget.addEventListenerNS(namespaceURI, type, listener, useCapture, evtGroup); } -public void removeEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture) - { _EventTarget.removeEventListenerNS(namespaceURI, type, listener, useCapture); } -public boolean willTriggerNS(String namespaceURI, - String type) - { return _EventTarget.willTriggerNS(namespaceURI, type); } -public boolean hasEventListenerNS(String namespaceURI, - String type) - { return _EventTarget.hasEventListenerNS(namespaceURI, type); } -//end EventTarget - - -public native SVGAnimatedLength getX( ); -public native SVGAnimatedLength getY( ); -public native SVGAnimatedLength getWidth( ); -public native SVGAnimatedLength getHeight( ); -public native SVGElementInstance getInstanceRoot( ); -public native SVGElementInstance getAnimatedInstanceRoot( ); - -} - - diff --git a/src/bind/java/org/inkscape/dom/svg/SVGVKernElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGVKernElementImpl.java deleted file mode 100644 index 97af0c646..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGVKernElementImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -public class SVGVKernElementImpl - extends - SVGElementImpl - implements org.w3c.dom.svg.SVGVKernElement -{ -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGViewElementImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGViewElementImpl.java deleted file mode 100644 index c47336a02..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGViewElementImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; -import org.w3c.dom.svg.*; - - -public class SVGViewElementImpl - extends - SVGElementImpl - //SVGExternalResourcesRequired, - //SVGFitToViewBox, - //SVGZoomAndPan - implements org.w3c.dom.svg.SVGViewElement -{ -public SVGViewElementImpl() -{ - imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl()); - imbue(_SVGFitToViewBox = new SVGFitToViewBoxImpl()); - imbue(_SVGZoomAndPan = new SVGZoomAndPanImpl()); -} - - -//from SVGExternalResourcesRequired -private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired; -public SVGAnimatedBoolean getExternalResourcesRequired() - { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); } -//end SVGExternalResourcesRequired - - -//from SVGFitToViewBox -SVGFitToViewBoxImpl _SVGFitToViewBox; -public SVGAnimatedRect getViewBox() - { return _SVGFitToViewBox.getViewBox(); } -public SVGAnimatedPreserveAspectRatio getPreserveAspectRatio() - { return _SVGFitToViewBox.getPreserveAspectRatio(); } -//end SVGFitToViewBox - -//from SVGZoomAndPan -SVGZoomAndPanImpl _SVGZoomAndPan; -public short getZoomAndPan() - { return _SVGZoomAndPan.getZoomAndPan(); } -public void setZoomAndPan(short zoomAndPan) throws DOMException - { _SVGZoomAndPan.setZoomAndPan(zoomAndPan); } -//end SVGZoomAndPan - - -public native SVGStringList getViewTarget( ); - -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGViewSpecImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGViewSpecImpl.java deleted file mode 100644 index 20042bad5..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGViewSpecImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - -package org.inkscape.dom.svg; - -import org.w3c.dom.svg.*; - - - -public class SVGViewSpecImpl - extends - SVGZoomAndPanImpl - //SVGFitToViewBox - implements org.w3c.dom.svg.SVGViewSpec -{ - -public SVGViewSpecImpl() -{ - imbue(_SVGFitToViewBox = new SVGFitToViewBoxImpl()); -} - - -//from SVGFitToViewBox -SVGFitToViewBoxImpl _SVGFitToViewBox; -public SVGAnimatedRect getViewBox() - { return _SVGFitToViewBox.getViewBox(); } -public SVGAnimatedPreserveAspectRatio getPreserveAspectRatio() - { return _SVGFitToViewBox.getPreserveAspectRatio(); } -//end SVGFitToViewBox - - -public native SVGTransformList getTransform( ); -public native SVGElement getViewTarget( ); -public native String getViewBoxString( ); -public native String getPreserveAspectRatioString( ); -public native String getTransformString( ); -public native String getViewTargetString( ); -} - diff --git a/src/bind/java/org/inkscape/dom/svg/SVGZoomAndPanImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGZoomAndPanImpl.java deleted file mode 100644 index d77d64f75..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGZoomAndPanImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG11/java.html - */ - - - -package org.inkscape.dom.svg; - -import org.w3c.dom.DOMException; - -public class SVGZoomAndPanImpl - extends - org.inkscape.cmn.BaseInterface - implements org.w3c.dom.svg.SVGZoomAndPan -{ -public native short getZoomAndPan( ); -public native void setZoomAndPan( short zoomAndPan ) - throws DOMException; -} diff --git a/src/bind/java/org/inkscape/dom/svg/SVGZoomEventImpl.java b/src/bind/java/org/inkscape/dom/svg/SVGZoomEventImpl.java deleted file mode 100644 index 018eee915..000000000 --- a/src/bind/java/org/inkscape/dom/svg/SVGZoomEventImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these SVG files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/SVG/java.html - */ - - -package org.inkscape.dom.svg; - -import org.w3c.dom.events.UIEvent; -import org.w3c.dom.svg.SVGRect; -import org.w3c.dom.svg.SVGPoint; - - -public class SVGZoomEventImpl - extends - org.inkscape.dom.events.UIEventImpl - implements org.w3c.dom.svg.SVGZoomEvent -{ -public native SVGRect getZoomRectScreen( ); -public native float getPreviousScale( ); -public native SVGPoint getPreviousTranslate( ); -public native float getNewScale( ); -public native SVGPoint getNewTranslate( ); -} diff --git a/src/bind/java/org/inkscape/dom/views/AbstractViewImpl.java b/src/bind/java/org/inkscape/dom/views/AbstractViewImpl.java deleted file mode 100644 index 9b2bd2dad..000000000 --- a/src/bind/java/org/inkscape/dom/views/AbstractViewImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2000/REC-DOM-Level-2-Views-20001113/java-binding.html - */ - -package org.inkscape.dom.views; - -import org.w3c.dom.views.DocumentView; - - -public class AbstractViewImpl - extends - org.inkscape.cmn.BaseInterface - implements org.w3c.dom.views.AbstractView -{ - -public native DocumentView getDocument(); - -} diff --git a/src/bind/java/org/inkscape/dom/views/DocumentViewImpl.java b/src/bind/java/org/inkscape/dom/views/DocumentViewImpl.java deleted file mode 100644 index a0ae88004..000000000 --- a/src/bind/java/org/inkscape/dom/views/DocumentViewImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (c) 2007-2008 Inkscape.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Note that these files are implementations of the Java - * interface package found here: - * http://www.w3.org/TR/2000/REC-DOM-Level-2-Views-20001113/java-binding.html - */ - - -package org.inkscape.dom.views; - -import org.w3c.dom.views.AbstractView; - - -public class DocumentViewImpl - extends - org.inkscape.cmn.BaseInterface - implements org.w3c.dom.views.DocumentView -{ - -public native AbstractView getDefaultView(); - -} diff --git a/src/bind/java/org/inkscape/script/Editor.java b/src/bind/java/org/inkscape/script/Editor.java deleted file mode 100644 index 81d65f4cf..000000000 --- a/src/bind/java/org/inkscape/script/Editor.java +++ /dev/null @@ -1,311 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (C) 2007-2008 Bob Jamison - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -package org.inkscape.script; - - -import java.awt.BorderLayout; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import javax.swing.filechooser.FileNameExtensionFilter; -import javax.swing.JFileChooser; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JTextPane; - -import java.io.File; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; - - - -/** - * A simple script editor for quick fixes. - */ -public class Editor extends JPanel -{ -ScriptConsole parent; -JTextPane textPane; - -//######################################################################## -//# MESSSAGES -//######################################################################## -void err(String fmt, Object... arguments) -{ - parent.err("Editor err:" + fmt, arguments); -} - -void msg(String fmt, Object... arguments) -{ - parent.msg("Editor:" + fmt, arguments); -} - -void trace(String fmt, Object... arguments) -{ - parent.trace("Editor:" + fmt, arguments); -} - - -//######################################################################## -//# U T I L I T Y -//######################################################################## - -private JFileChooser _chooser; - -JFileChooser getChooser() -{ - if (_chooser == null) - { - _chooser = new JFileChooser(); - _chooser.setAcceptAllFileFilterUsed(false); - _chooser.setCurrentDirectory(new File(".")); - FileNameExtensionFilter filter = new FileNameExtensionFilter( - "Script Files", "js", "py", "r"); - _chooser.setFileFilter(filter); - } - return _chooser; -} - - -/** - * Returns the current text contained in this editor - */ -public String getText() -{ - return textPane.getText(); -} - - -String lastHash = null; - -/** - * Sets the text of this editor - */ -public void setText(String txt) -{ - textPane.setText(txt); - lastHash = getHash(txt); - trace("hash:" + lastHash); -} - -MessageDigest md = null; - -final String hex = "0123456789abcdef"; - -String toHex(byte arr[]) -{ - StringBuffer buf = new StringBuffer(); - for (byte b : arr) - { - buf.append(hex.charAt((b>>4) & 15)); - buf.append(hex.charAt((b ) & 15)); - } - return buf.toString(); -} - -String getHash(String text) -{ - if (md == null) - { - try - { - md = MessageDigest.getInstance("MD5"); - } - catch (NoSuchAlgorithmException e) - { - err("getHash: " + e); - return ""; - } - } - byte hash[] = md.digest(text.getBytes()); - return toHex(hash); -} - - -//######################################################################## -//# L O A D / S A V E -//######################################################################## -String fileName = ""; - -/** - * Gets the name of the current file in the editor - */ -public String getFileName() -{ - return fileName; -} - -/** - * Sets the name of the current file in the editor - */ -public void setFileName(String val) -{ - fileName = val; -} - -/** - * Selects and opens a file, loading into the editor - */ -public boolean openFile() -{ - JFileChooser chooser = getChooser(); - int ret = chooser.showOpenDialog(this); - if (ret != JFileChooser.APPROVE_OPTION) - return false; - File f = chooser.getSelectedFile(); - String fname = f.getName(); - try - { - FileReader in = new FileReader(fname); - StringBuffer buf = new StringBuffer(); - while (true) - { - int ch = in.read(); - if (ch < 0) - break; - buf.append((char)ch); - } - in.close(); - setText(buf.toString()); - } - catch (IOException e) - { - err("save file:" + e); - return false; - } - return true; -} - - -/** - * Saves the file currently in the editor. Uses the Save - * selector if there is not current file name. - */ -public boolean saveFile() -{ - if (!isDirty()) - return true; - - String fname = getFileName(); - if (fname == null || fname.length()==0) - { - JFileChooser chooser = getChooser(); - int ret = chooser.showSaveDialog(this); - if (ret != JFileChooser.APPROVE_OPTION) - return false; - File f = chooser.getSelectedFile(); - fname = f.getName(); - } - try - { - FileWriter out = new FileWriter(fname); - out.write(getText()); - out.close(); - setFileName(fname); - resetDirty(); - } - catch (IOException e) - { - err("save file:" + e); - return false; - } - return true; -} - - -/** - * Saves the file currently in the editor under a new name. - * Get the new name from the chooser, and see if it already exists. - */ -public boolean saveAsFile() -{ - JFileChooser chooser = getChooser(); - int ret = chooser.showSaveDialog(this); - if (ret != JFileChooser.APPROVE_OPTION) - return false; - File f = chooser.getSelectedFile(); - String fname = f.getName(); - if (f.exists()) - { - ret = JOptionPane.showConfirmDialog(this, - "File '" + fname + "' already exists. Overwrite?"); - if (ret != JOptionPane.YES_OPTION) - return false; - } - try - { - FileWriter out = new FileWriter(fname); - out.write(getText()); - out.close(); - setFileName(fname); - resetDirty(); - } - catch (IOException e) - { - err("saveAs file:" + e); - return false; - } - return true; -} - - -/** - * State that the editor is now 'unedited' - */ -public void resetDirty() -{ - lastHash = getHash(getText()); -} - -/** - * Determines if the editor has been edited since the last open/save - */ -public boolean isDirty() -{ - String txt = getText(); - String hash = getHash(txt); - if ( (lastHash == null && txt.length()>0) || - (lastHash != null && !lastHash.equals(hash)) ) - return true; - return false; -} - - -/** - * Creates the editor for the ScriptConsole - */ -public Editor(ScriptConsole par) -{ - super(); - parent = par; - setLayout(new BorderLayout()); - textPane = new JTextPane(); - add(textPane, BorderLayout.CENTER); -} - - - -} - diff --git a/src/bind/java/org/inkscape/script/ScriptConsole.java b/src/bind/java/org/inkscape/script/ScriptConsole.java deleted file mode 100644 index 8241e2797..000000000 --- a/src/bind/java/org/inkscape/script/ScriptConsole.java +++ /dev/null @@ -1,652 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (C) 2007-2008 Bob Jamison - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -package org.inkscape.script; - -import org.inkscape.cmn.Resource; - -import javax.script.*; - -import javax.swing.WindowConstants; -import javax.swing.JFrame; -import javax.swing.JButton; -import javax.swing.JMenu; -import javax.swing.JLabel; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JComboBox; -import javax.swing.ButtonGroup; -import javax.swing.JOptionPane; -import javax.swing.JTabbedPane; -import javax.swing.JToolBar; -import javax.swing.Action; -import javax.swing.AbstractAction; - - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.BorderLayout; - -import java.io.File; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; - - -import java.util.List; -import java.util.HashMap; -import java.util.ArrayList; -import java.util.List; - - - -/** - * This is the main Script Console window. It contains - * a terminal-like console, and a simple script editor. - */ -public class ScriptConsole extends JFrame -{ -Terminal terminal; -Editor editor; - -JTabbedPane tabPane; -JToolBar toolbar; -JMenuBar menubar; -JComboBox engineBox; - -//######################################################################## -//# MESSSAGES -//######################################################################## -public void err(String fmt, Object... arguments) -{ - terminal.errorf("ScriptConsole err:" + fmt + "\n", arguments); -} - -public void msg(String fmt, Object... arguments) -{ - terminal.outputf("ScriptConsole:" + fmt, arguments); -} - -public void trace(String fmt, Object... arguments) -{ - terminal.outputf("ScriptConsole:" + fmt + "\n", arguments); -} - - - - - - -void alert(String msg) -{ - JOptionPane.showMessageDialog(this, msg); -} - - - - -//######################################################################## -//# S C R I P T S -//######################################################################## -ScriptEngine engine; - -ArrayList engines; - - -public void setEngine(ScriptEngine engine) -{ - this.engine = engine; - this.engine.getContext().setWriter(terminal.getOutWriter()); - this.engine.getContext().setErrorWriter(terminal.getErrWriter()); - //do something to make the combobox show the current engine -} - - -public ScriptEngine getEngine() -{ - return engine; -} - - -public boolean setEngine(String langName) -{ - for (ScriptEngine engine : engines) - { - for(String name: engine.getFactory().getNames()) - { - if (langName.equalsIgnoreCase(name)) - { - setEngine(engine); - return true; - } - } - } - return false; -} - - -/** - * Run a script buffer - * - * @param str the script buffer to execute - * @return true if successful, else false - */ -public boolean doRunCmd(String str) -{ - if (engine == null) - { - err("No engine set"); - return false; - } - - //execute script from buffer - try - { - getEngine().eval(str); - } - catch (javax.script.ScriptException e) - { - err("Executing script: " + e); - //e.printStackTrace(); - } - terminal.output("\nscript> "); - return true; -} - -/** - * Run a script buffer - * - * @param str the script buffer to execute - * @return true if successful, else false - */ -public boolean doRun(String str) -{ - if (engine == null) - { - err("No engine set"); - return false; - } - - //execute script from buffer - try - { - getEngine().eval(str); - } - catch (javax.script.ScriptException e) - { - err("Executing script: " + e); - //e.printStackTrace(); - } - return true; -} - - -/** - * Run a script buffer - * - * @param lang the scripting language to run - * @param str the script buffer to execute - * @return true if successful, else false - */ -public boolean doRun(String lang, String str) -{ - // find script engine - if (!setEngine(lang)) - { - err("doRun: cannot find script engine '" + lang + "'"); - return false; - } - return doRun(str); -} - - -/** - * Run a script file - * - * @param fname the script file to execute - * @return true if successful, else false - */ -public boolean doRunFile(String fname) -{ - if (engine == null) - { - err("No engine set"); - return false; - } - - //try opening file and feeding into engine - FileReader in = null; - boolean ret = true; - try - { - in = new FileReader(fname); - } - catch (java.io.IOException e) - { - err("Executing file: " + e); - return false; - } - try - { - engine.eval(in); - } - catch (javax.script.ScriptException e) - { - err("Executing file: " + e); - ret = false; - } - try - { - in.close(); - } - catch (java.io.IOException e) - { - err("Executing file: " + e); - return false; - } - return ret; -} - - -/** - * Run a script file - * - * @param lang the scripting language to run - * @param fname the script file to execute - * @return true if successful, else false - */ -public boolean doRunFile(String lang, String fname) -{ - // find script engine - if (!setEngine(lang)) - { - err("doRunFile: cannot find script engine '" + lang + "'"); - return false; - } - return doRunFile(fname); -} - - - -class ScriptEngineAction extends AbstractAction -{ - - -public void actionPerformed(ActionEvent evt) -{ - int index = engineBox.getSelectedIndex(); - if (index<0) - return; - ScriptEngine engine = engines.get(index); - setEngine(engine); -} - -public ScriptEngineAction() -{ - super("SelectEngine", null); - putValue(SHORT_DESCRIPTION, "Select a scripting engine"); -} - -} - - -private void initScripts() -{ - engines = new ArrayList(); - Action action = new ScriptEngineAction(); - engineBox = new JComboBox(); - engineBox.setAction(action); - engineBox.setEditable(false); - toolbar.add(engineBox); - - ScriptEngineManager scriptEngineManager = - new ScriptEngineManager(); - List factories = - scriptEngineManager.getEngineFactories(); - for (ScriptEngineFactory factory: factories) - { - trace("ScriptEngineFactory Info"); - String engName = factory.getEngineName(); - String engVersion = factory.getEngineVersion(); - String fullEngName = engName + " (" + engVersion + ")"; - String langName = factory.getLanguageName(); - String langVersion = factory.getLanguageVersion(); - String fullLangName = langName + " (" + langVersion + ")"; - trace("\t" + fullEngName); - List engNames = factory.getNames(); - for(String name: engNames) - { - trace("\tEngine Alias: " + name); - } - trace("\t" + fullLangName); - engines.add(factory.getScriptEngine()); - engineBox.addItem(fullLangName + " / " + fullEngName); - } - if (engineBox.getItemCount()>0) - { - engineBox.setSelectedIndex(0); - setEngine(engines.get(0)); - } -} - - -static final String defaultCodeStr = - "/**\n" + - " * This is some example Javascript.\n" + - " * Try executing\n" + - " */\n" + - "importPackage(javax.swing);\n" + - "function sayHello() {\n" + - " JOptionPane.showMessageDialog(null, 'Hello, world!',\n" + - " 'Welcome to Inkscape', JOptionPane.WARNING_MESSAGE);\n" + - "}\n" + - "\n" + - "sayHello();\n" + - "\n"; - - -//######################################################################## -//# A C T I O N S -//######################################################################## -Action newAction; -Action openAction; -Action quitAction; -Action runAction; -Action saveAction; -Action saveAsAction; -Action stopAction; - - - -class NewAction extends AbstractAction -{ - -public void actionPerformed(ActionEvent evt) -{ - // -} - -public NewAction() -{ - super("New", Resource.getIcon("document-new.png")); - putValue(SHORT_DESCRIPTION, "Create a new script file"); -} - -} - - - -class OpenAction extends AbstractAction -{ - -public void actionPerformed(ActionEvent evt) -{ - editor.openFile(); -} - -public OpenAction() -{ - super("Open", Resource.getIcon("document-open.png")); - putValue(SHORT_DESCRIPTION, "Open a script file"); -} - -} - - - -class QuitAction extends AbstractAction -{ - -public void actionPerformed(ActionEvent evt) -{ - setVisible(false); -} - -public QuitAction() -{ - super("Quit", Resource.getIcon("system-log-out.png")); - putValue(SHORT_DESCRIPTION, "Quit this script console"); -} - -} - - - -class RunAction extends AbstractAction -{ - -public void actionPerformed(ActionEvent evt) -{ - String txt = editor.getText(); - doRun(txt); -} - -public RunAction() -{ - super("Run", Resource.getIcon("go-next.png")); - putValue(SHORT_DESCRIPTION, "Run the script in the editor"); -} - -} - - - -class SaveAction extends AbstractAction -{ - -public void actionPerformed(ActionEvent evt) -{ - editor.saveFile(); -} - -public SaveAction() -{ - super("Save", Resource.getIcon("document-save.png")); - putValue(SHORT_DESCRIPTION, "Save file"); -} - -} - - - -class SaveAsAction extends AbstractAction -{ - -public void actionPerformed(ActionEvent evt) -{ - editor.saveAsFile(); -} - -public SaveAsAction() -{ - super("SaveAs", Resource.getIcon("document-save-as.png")); - putValue(SHORT_DESCRIPTION, "Save under a new file name"); -} - -} - - - -class StopAction extends AbstractAction -{ - -public void actionPerformed(ActionEvent evt) -{ - //# -} - -public StopAction() -{ - super("Stop", Resource.getIcon("process-stop.png")); - putValue(SHORT_DESCRIPTION, "Stop the running script"); -} - -} - - - -HashMap actions; -void setupActions() -{ - actions = new HashMap(); - actions.put("New", newAction = new NewAction()); - actions.put("Open", openAction = new OpenAction()); - actions.put("Quit", quitAction = new QuitAction()); - actions.put("Run", runAction = new RunAction()); - actions.put("Save", saveAction = new SaveAction()); - actions.put("SaveAs", saveAsAction = new SaveAsAction()); - actions.put("Stop", stopAction = new StopAction()); -} - - -public void enableAction(String name) -{ - Action action = actions.get(name); - if (action == null) - return; - action.setEnabled(true); -} - -public void disableAction(String name) -{ - Action action = actions.get(name); - if (action == null) - return; - action.setEnabled(false); -} - - - -//######################################################################## -//# S E T U P -//######################################################################## - -JButton toolbarButton(Action action) -{ - JButton btn = new JButton(action); - btn.setText(""); - btn.setToolTipText((String)action.getValue(Action.SHORT_DESCRIPTION)); - return btn; -} - - -private boolean setup() -{ - setTitle("Inkscape Script Console"); - setSize(600, 400); - setIconImage(Resource.getImage("inkscape.png")); - setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); - - //###################################################### - //# A C T I O N S - //###################################################### - setupActions(); - - //###################################################### - //# M E N U - //###################################################### - menubar = new JMenuBar(); - setJMenuBar(menubar); - - JMenu menu = new JMenu("File"); - menubar.add(menu); - menu.add(new JMenuItem(openAction)); - menu.add(new JMenuItem(saveAction)); - menu.add(new JMenuItem(saveAsAction)); - menu.add(new JMenuItem(quitAction)); - - menu = new JMenu("Run"); - menubar.add(menu); - menu.add(new JMenuItem(runAction)); - menu.add(new JMenuItem(stopAction)); - - //###################################################### - //# T O O L B A R - //###################################################### - toolbar = new JToolBar(); - getContentPane().add(toolbar, BorderLayout.NORTH); - toolbar.add(toolbarButton(openAction)); - toolbar.add(toolbarButton(saveAction)); - toolbar.add(toolbarButton(runAction)); - toolbar.add(toolbarButton(stopAction)); - - //###################################################### - //# C O N T E N T - //###################################################### - tabPane = new JTabbedPane(); - getContentPane().add(tabPane, BorderLayout.CENTER); - - terminal = new Terminal(); - tabPane.addTab("Console", - Resource.getIcon("utilities-terminal.png"), - terminal); - terminal.output("\nscript> "); - - editor = new Editor(this); - tabPane.addTab("Script", - Resource.getIcon("accessories-text-editor.png"), - editor); - - editor.setText(defaultCodeStr); - - //###################################################### - //# E N G I N E - //###################################################### - initScripts(); - - return true; -} - - - - - - -public ScriptConsole() -{ - setup(); -} - - -private static ScriptConsole _instance = null; -public static ScriptConsole getInstance() -{ - if (_instance == null) - _instance = new ScriptConsole(); - return _instance; -} - - -public static void main(String argv[]) -{ - ScriptConsole sc = getInstance(); - sc.setVisible(true); -} - - -} -//######################################################################## -//# E N D O F F I L E -//######################################################################## - diff --git a/src/bind/java/org/inkscape/script/Terminal.java b/src/bind/java/org/inkscape/script/Terminal.java deleted file mode 100644 index 22d2cb251..000000000 --- a/src/bind/java/org/inkscape/script/Terminal.java +++ /dev/null @@ -1,297 +0,0 @@ -/** - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (C) 2007-2008 Bob Jamison - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -package org.inkscape.script; - -import java.awt.BorderLayout; -import javax.swing.JFrame; -import javax.swing.JPanel; -import javax.swing.JTextPane; -import javax.swing.JScrollPane; -import javax.swing.text.DefaultCaret; -import javax.swing.text.Document; -import javax.swing.text.BadLocationException; -import javax.swing.text.StyleConstants; -import javax.swing.text.SimpleAttributeSet; -import java.awt.Color; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.awt.Font; - -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; -import java.io.IOException; -import java.io.Writer; -import java.io.PrintWriter; - -public class Terminal extends JPanel - implements KeyListener -{ - -SimpleAttributeSet inTextAttr; -SimpleAttributeSet outTextAttr; -SimpleAttributeSet errTextAttr; - -StringBuffer buf = new StringBuffer(); -JTextPane textPane; - -void err(String msg) -{ - System.out.println("Terminal err: " + msg); -} - -void trace(String msg) -{ - System.out.println("Terminal: " + msg); -} - - -void processInputLine(String txt) -{ - ScriptConsole cons = ScriptConsole.getInstance(); - if (cons != null) - cons.doRunCmd(txt); -} - - - -class OutWriter extends Writer -{ - -public void write(char[] cbuf, int off, int len) -{ - String s = new String(cbuf, off, len); - output(s); -} - -public void flush() -{ -} - -public void close() -{ -} - -} - - - -PrintWriter outWriter; - -public Writer getOutWriter() -{ - if (outWriter == null) - outWriter = new PrintWriter(new OutWriter()); - return outWriter; -} - - -public void output(String txt) -{ - Document doc = textPane.getDocument(); - try - { - doc.insertString(doc.getLength(), txt, outTextAttr); - textPane.setCaretPosition(doc.getLength()); - } - catch (BadLocationException e) - { - } - -} - - -public void outputf(String fmt, Object... args) -{ - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - PrintStream out = new PrintStream(baos); - out.printf(fmt, args); - out.close(); - String s = baos.toString(); - output(s); -} - - - -class ErrWriter extends Writer -{ - -public void write(char[] cbuf, int off, int len) -{ - String s = new String(cbuf, off, len); - error(s); -} - -public void flush() -{ -} - -public void close() -{ -} - -} - - - -PrintWriter errWriter; - -public Writer getErrWriter() -{ - if (errWriter == null) - errWriter = new PrintWriter(new ErrWriter()); - return errWriter; -} - - -public void error(String txt) -{ - Document doc = textPane.getDocument(); - try - { - doc.insertString(doc.getLength(), txt, errTextAttr); - textPane.setCaretPosition(doc.getLength()); - } - catch (BadLocationException e) - { - } - -} - -public void errorf(String fmt, Object... args) -{ - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - PrintStream out = new PrintStream(baos); - out.printf(fmt, args); - out.close(); - String s = baos.toString(); - error(s); -} - - -public void keyPressed(KeyEvent evt) -{ -} - -public void keyReleased(KeyEvent evt) -{ -} - -public void keyTyped(KeyEvent evt) -{ - Document doc = textPane.getDocument(); - char ch = evt.getKeyChar(); - if (ch == 127) - { - } - else if (ch == '\b') - { - if (buf.length() == 0) - return; - try - { - buf.delete(buf.length()-1, buf.length()); - doc.remove(doc.getLength()-1, 1); - textPane.setCaretPosition(doc.getLength()); - } - catch (BadLocationException e) - { - err("keyTyped:" + e); - } - } - else - { - try - { - buf.append(ch); - doc.insertString(doc.getLength(), "" + ch, inTextAttr); - textPane.setCaretPosition(doc.getLength()); - } - catch (BadLocationException e) - { - } - if (ch == '\n' || ch == '\r') - { - String txt = buf.toString(); - buf.delete(0, buf.length()); - txt = txt.trim(); - processInputLine(txt); - } - } - - - -} - - - -void setup() -{ - setLayout(new BorderLayout()); - textPane = new JTextPane(); - add(new JScrollPane(textPane), BorderLayout.CENTER); - textPane.setEditable(false); - textPane.setBackground(Color.BLACK); - textPane.setCaretColor(Color.WHITE); - textPane.setCaret(new DefaultCaret()); - textPane.getCaret().setVisible(true); - textPane.getCaret().setBlinkRate(500); - Font currentFont = textPane.getFont(); - textPane.setFont(new Font("Monospaced", currentFont.getStyle(), currentFont.getSize())); - textPane.addKeyListener(this); - - inTextAttr = new SimpleAttributeSet(); - StyleConstants.setForeground(inTextAttr, Color.YELLOW); - outTextAttr = new SimpleAttributeSet(); - StyleConstants.setForeground(outTextAttr, Color.GREEN); - errTextAttr = new SimpleAttributeSet(); - StyleConstants.setForeground(errTextAttr, Color.RED); - - -} - - - - - - -public Terminal() -{ - super(); - setup(); -} - - - -public static void main(String argv[]) -{ - Terminal t = new Terminal(); - JFrame par = new JFrame("Terminal Test"); - par.setSize(500, 350); - par.getContentPane().add(t); - par.setVisible(true); -} - -} - diff --git a/src/bind/java/org/w3c/dom/css/CSS2Properties.java b/src/bind/java/org/w3c/dom/css/CSS2Properties.java deleted file mode 100644 index b84df9b30..000000000 --- a/src/bind/java/org/w3c/dom/css/CSS2Properties.java +++ /dev/null @@ -1,1411 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.css; - -import org.w3c.dom.DOMException; - -/** - * The CSS2Properties interface represents a convenience - * mechanism for retrieving and setting properties within a - * CSSStyleDeclaration. The attributes of this interface - * correspond to all the properties specified in CSS2. Getting an attribute - * of this interface is equivalent to calling the - * getPropertyValue method of the - * CSSStyleDeclaration interface. Setting an attribute of this - * interface is equivalent to calling the setProperty method of - * the CSSStyleDeclaration interface. - *

A conformant implementation of the CSS module is not required to - * implement the CSS2Properties interface. If an implementation - * does implement this interface, the expectation is that language-specific - * methods can be used to cast from an instance of the - * CSSStyleDeclaration interface to the - * CSS2Properties interface. - *

If an implementation does implement this interface, it is expected to - * understand the specific syntax of the shorthand properties, and apply - * their semantics; when the margin property is set, for - * example, the marginTop, marginRight, - * marginBottom and marginLeft properties are - * actually being set by the underlying implementation. - *

When dealing with CSS "shorthand" properties, the shorthand properties - * should be decomposed into their component longhand properties as - * appropriate, and when querying for their value, the form returned should - * be the shortest form exactly equivalent to the declarations made in the - * ruleset. However, if there is no shorthand declaration that could be - * added to the ruleset without changing in any way the rules already - * declared in the ruleset (i.e., by adding longhand rules that were - * previously not declared in the ruleset), then the empty string should be - * returned for the shorthand property. - *

For example, querying for the font property should not - * return "normal normal normal 14pt/normal Arial, sans-serif", when "14pt - * Arial, sans-serif" suffices. (The normals are initial values, and are - * implied by use of the longhand property.) - *

If the values for all the longhand properties that compose a particular - * string are the initial values, then a string consisting of all the - * initial values should be returned (e.g. a border-width value - * of "medium" should be returned as such, not as ""). - *

For some shorthand properties that take missing values from other - * sides, such as the margin, padding, and - * border-[width|style|color] properties, the minimum number of - * sides possible should be used; i.e., "0px 10px" will be returned instead - * of "0px 10px 0px 10px". - *

If the value of a shorthand property can not be decomposed into its - * component longhand properties, as is the case for the font - * property with a value of "menu", querying for the values of the component - * longhand properties should return the empty string. - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface CSS2Properties { - /** - * See the azimuth property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getAzimuth(); - public void setAzimuth(String azimuth) - throws DOMException; - - /** - * See the background property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBackground(); - public void setBackground(String background) - throws DOMException; - - /** - * See the background-attachment property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBackgroundAttachment(); - public void setBackgroundAttachment(String backgroundAttachment) - throws DOMException; - - /** - * See the background-color property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBackgroundColor(); - public void setBackgroundColor(String backgroundColor) - throws DOMException; - - /** - * See the background-image property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBackgroundImage(); - public void setBackgroundImage(String backgroundImage) - throws DOMException; - - /** - * See the background-position property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBackgroundPosition(); - public void setBackgroundPosition(String backgroundPosition) - throws DOMException; - - /** - * See the background-repeat property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBackgroundRepeat(); - public void setBackgroundRepeat(String backgroundRepeat) - throws DOMException; - - /** - * See the border property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBorder(); - public void setBorder(String border) - throws DOMException; - - /** - * See the border-collapse property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBorderCollapse(); - public void setBorderCollapse(String borderCollapse) - throws DOMException; - - /** - * See the border-color property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBorderColor(); - public void setBorderColor(String borderColor) - throws DOMException; - - /** - * See the border-spacing property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBorderSpacing(); - public void setBorderSpacing(String borderSpacing) - throws DOMException; - - /** - * See the border-style property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBorderStyle(); - public void setBorderStyle(String borderStyle) - throws DOMException; - - /** - * See the border-top property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBorderTop(); - public void setBorderTop(String borderTop) - throws DOMException; - - /** - * See the border-right property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBorderRight(); - public void setBorderRight(String borderRight) - throws DOMException; - - /** - * See the border-bottom property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBorderBottom(); - public void setBorderBottom(String borderBottom) - throws DOMException; - - /** - * See the border-left property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBorderLeft(); - public void setBorderLeft(String borderLeft) - throws DOMException; - - /** - * See the border-top-color property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBorderTopColor(); - public void setBorderTopColor(String borderTopColor) - throws DOMException; - - /** - * See the border-right-color property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBorderRightColor(); - public void setBorderRightColor(String borderRightColor) - throws DOMException; - - /** - * See the border-bottom-color property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBorderBottomColor(); - public void setBorderBottomColor(String borderBottomColor) - throws DOMException; - - /** - * See the border-left-color property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBorderLeftColor(); - public void setBorderLeftColor(String borderLeftColor) - throws DOMException; - - /** - * See the border-top-style property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBorderTopStyle(); - public void setBorderTopStyle(String borderTopStyle) - throws DOMException; - - /** - * See the border-right-style property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBorderRightStyle(); - public void setBorderRightStyle(String borderRightStyle) - throws DOMException; - - /** - * See the border-bottom-style property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBorderBottomStyle(); - public void setBorderBottomStyle(String borderBottomStyle) - throws DOMException; - - /** - * See the border-left-style property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBorderLeftStyle(); - public void setBorderLeftStyle(String borderLeftStyle) - throws DOMException; - - /** - * See the border-top-width property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBorderTopWidth(); - public void setBorderTopWidth(String borderTopWidth) - throws DOMException; - - /** - * See the border-right-width property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBorderRightWidth(); - public void setBorderRightWidth(String borderRightWidth) - throws DOMException; - - /** - * See the border-bottom-width property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBorderBottomWidth(); - public void setBorderBottomWidth(String borderBottomWidth) - throws DOMException; - - /** - * See the border-left-width property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBorderLeftWidth(); - public void setBorderLeftWidth(String borderLeftWidth) - throws DOMException; - - /** - * See the border-width property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBorderWidth(); - public void setBorderWidth(String borderWidth) - throws DOMException; - - /** - * See the bottom property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getBottom(); - public void setBottom(String bottom) - throws DOMException; - - /** - * See the caption-side property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getCaptionSide(); - public void setCaptionSide(String captionSide) - throws DOMException; - - /** - * See the clear property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getClear(); - public void setClear(String clear) - throws DOMException; - - /** - * See the clip property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getClip(); - public void setClip(String clip) - throws DOMException; - - /** - * See the color property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getColor(); - public void setColor(String color) - throws DOMException; - - /** - * See the content property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getContent(); - public void setContent(String content) - throws DOMException; - - /** - * See the counter-increment property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getCounterIncrement(); - public void setCounterIncrement(String counterIncrement) - throws DOMException; - - /** - * See the counter-reset property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getCounterReset(); - public void setCounterReset(String counterReset) - throws DOMException; - - /** - * See the cue property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getCue(); - public void setCue(String cue) - throws DOMException; - - /** - * See the cue-after property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getCueAfter(); - public void setCueAfter(String cueAfter) - throws DOMException; - - /** - * See the cue-before property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getCueBefore(); - public void setCueBefore(String cueBefore) - throws DOMException; - - /** - * See the cursor property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getCursor(); - public void setCursor(String cursor) - throws DOMException; - - /** - * See the direction property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getDirection(); - public void setDirection(String direction) - throws DOMException; - - /** - * See the display property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getDisplay(); - public void setDisplay(String display) - throws DOMException; - - /** - * See the elevation property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getElevation(); - public void setElevation(String elevation) - throws DOMException; - - /** - * See the empty-cells property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getEmptyCells(); - public void setEmptyCells(String emptyCells) - throws DOMException; - - /** - * See the float property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getCssFloat(); - public void setCssFloat(String cssFloat) - throws DOMException; - - /** - * See the font property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getFont(); - public void setFont(String font) - throws DOMException; - - /** - * See the font-family property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getFontFamily(); - public void setFontFamily(String fontFamily) - throws DOMException; - - /** - * See the font-size property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getFontSize(); - public void setFontSize(String fontSize) - throws DOMException; - - /** - * See the font-size-adjust property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getFontSizeAdjust(); - public void setFontSizeAdjust(String fontSizeAdjust) - throws DOMException; - - /** - * See the font-stretch property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getFontStretch(); - public void setFontStretch(String fontStretch) - throws DOMException; - - /** - * See the font-style property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getFontStyle(); - public void setFontStyle(String fontStyle) - throws DOMException; - - /** - * See the font-variant property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getFontVariant(); - public void setFontVariant(String fontVariant) - throws DOMException; - - /** - * See the font-weight property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getFontWeight(); - public void setFontWeight(String fontWeight) - throws DOMException; - - /** - * See the height property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getHeight(); - public void setHeight(String height) - throws DOMException; - - /** - * See the left property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getLeft(); - public void setLeft(String left) - throws DOMException; - - /** - * See the letter-spacing property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getLetterSpacing(); - public void setLetterSpacing(String letterSpacing) - throws DOMException; - - /** - * See the line-height property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getLineHeight(); - public void setLineHeight(String lineHeight) - throws DOMException; - - /** - * See the list-style property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getListStyle(); - public void setListStyle(String listStyle) - throws DOMException; - - /** - * See the list-style-image property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getListStyleImage(); - public void setListStyleImage(String listStyleImage) - throws DOMException; - - /** - * See the list-style-position property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getListStylePosition(); - public void setListStylePosition(String listStylePosition) - throws DOMException; - - /** - * See the list-style-type property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getListStyleType(); - public void setListStyleType(String listStyleType) - throws DOMException; - - /** - * See the margin property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getMargin(); - public void setMargin(String margin) - throws DOMException; - - /** - * See the margin-top property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getMarginTop(); - public void setMarginTop(String marginTop) - throws DOMException; - - /** - * See the margin-right property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getMarginRight(); - public void setMarginRight(String marginRight) - throws DOMException; - - /** - * See the margin-bottom property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getMarginBottom(); - public void setMarginBottom(String marginBottom) - throws DOMException; - - /** - * See the margin-left property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getMarginLeft(); - public void setMarginLeft(String marginLeft) - throws DOMException; - - /** - * See the marker-offset property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getMarkerOffset(); - public void setMarkerOffset(String markerOffset) - throws DOMException; - - /** - * See the marks property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getMarks(); - public void setMarks(String marks) - throws DOMException; - - /** - * See the max-height property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getMaxHeight(); - public void setMaxHeight(String maxHeight) - throws DOMException; - - /** - * See the max-width property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getMaxWidth(); - public void setMaxWidth(String maxWidth) - throws DOMException; - - /** - * See the min-height property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getMinHeight(); - public void setMinHeight(String minHeight) - throws DOMException; - - /** - * See the min-width property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getMinWidth(); - public void setMinWidth(String minWidth) - throws DOMException; - - /** - * See the orphans property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getOrphans(); - public void setOrphans(String orphans) - throws DOMException; - - /** - * See the outline property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getOutline(); - public void setOutline(String outline) - throws DOMException; - - /** - * See the outline-color property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getOutlineColor(); - public void setOutlineColor(String outlineColor) - throws DOMException; - - /** - * See the outline-style property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getOutlineStyle(); - public void setOutlineStyle(String outlineStyle) - throws DOMException; - - /** - * See the outline-width property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getOutlineWidth(); - public void setOutlineWidth(String outlineWidth) - throws DOMException; - - /** - * See the overflow property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getOverflow(); - public void setOverflow(String overflow) - throws DOMException; - - /** - * See the padding property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getPadding(); - public void setPadding(String padding) - throws DOMException; - - /** - * See the padding-top property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getPaddingTop(); - public void setPaddingTop(String paddingTop) - throws DOMException; - - /** - * See the padding-right property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getPaddingRight(); - public void setPaddingRight(String paddingRight) - throws DOMException; - - /** - * See the padding-bottom property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getPaddingBottom(); - public void setPaddingBottom(String paddingBottom) - throws DOMException; - - /** - * See the padding-left property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getPaddingLeft(); - public void setPaddingLeft(String paddingLeft) - throws DOMException; - - /** - * See the page property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getPage(); - public void setPage(String page) - throws DOMException; - - /** - * See the page-break-after property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getPageBreakAfter(); - public void setPageBreakAfter(String pageBreakAfter) - throws DOMException; - - /** - * See the page-break-before property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getPageBreakBefore(); - public void setPageBreakBefore(String pageBreakBefore) - throws DOMException; - - /** - * See the page-break-inside property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getPageBreakInside(); - public void setPageBreakInside(String pageBreakInside) - throws DOMException; - - /** - * See the pause property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getPause(); - public void setPause(String pause) - throws DOMException; - - /** - * See the pause-after property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getPauseAfter(); - public void setPauseAfter(String pauseAfter) - throws DOMException; - - /** - * See the pause-before property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getPauseBefore(); - public void setPauseBefore(String pauseBefore) - throws DOMException; - - /** - * See the pitch property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getPitch(); - public void setPitch(String pitch) - throws DOMException; - - /** - * See the pitch-range property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getPitchRange(); - public void setPitchRange(String pitchRange) - throws DOMException; - - /** - * See the play-during property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getPlayDuring(); - public void setPlayDuring(String playDuring) - throws DOMException; - - /** - * See the position property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getPosition(); - public void setPosition(String position) - throws DOMException; - - /** - * See the quotes property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getQuotes(); - public void setQuotes(String quotes) - throws DOMException; - - /** - * See the richness property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getRichness(); - public void setRichness(String richness) - throws DOMException; - - /** - * See the right property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getRight(); - public void setRight(String right) - throws DOMException; - - /** - * See the size property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getSize(); - public void setSize(String size) - throws DOMException; - - /** - * See the speak property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getSpeak(); - public void setSpeak(String speak) - throws DOMException; - - /** - * See the speak-header property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getSpeakHeader(); - public void setSpeakHeader(String speakHeader) - throws DOMException; - - /** - * See the speak-numeral property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getSpeakNumeral(); - public void setSpeakNumeral(String speakNumeral) - throws DOMException; - - /** - * See the speak-punctuation property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getSpeakPunctuation(); - public void setSpeakPunctuation(String speakPunctuation) - throws DOMException; - - /** - * See the speech-rate property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getSpeechRate(); - public void setSpeechRate(String speechRate) - throws DOMException; - - /** - * See the stress property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getStress(); - public void setStress(String stress) - throws DOMException; - - /** - * See the table-layout property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getTableLayout(); - public void setTableLayout(String tableLayout) - throws DOMException; - - /** - * See the text-align property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getTextAlign(); - public void setTextAlign(String textAlign) - throws DOMException; - - /** - * See the text-decoration property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getTextDecoration(); - public void setTextDecoration(String textDecoration) - throws DOMException; - - /** - * See the text-indent property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getTextIndent(); - public void setTextIndent(String textIndent) - throws DOMException; - - /** - * See the text-shadow property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getTextShadow(); - public void setTextShadow(String textShadow) - throws DOMException; - - /** - * See the text-transform property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getTextTransform(); - public void setTextTransform(String textTransform) - throws DOMException; - - /** - * See the top property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getTop(); - public void setTop(String top) - throws DOMException; - - /** - * See the unicode-bidi property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getUnicodeBidi(); - public void setUnicodeBidi(String unicodeBidi) - throws DOMException; - - /** - * See the vertical-align property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getVerticalAlign(); - public void setVerticalAlign(String verticalAlign) - throws DOMException; - - /** - * See the visibility property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getVisibility(); - public void setVisibility(String visibility) - throws DOMException; - - /** - * See the voice-family property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getVoiceFamily(); - public void setVoiceFamily(String voiceFamily) - throws DOMException; - - /** - * See the volume property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getVolume(); - public void setVolume(String volume) - throws DOMException; - - /** - * See the white-space property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getWhiteSpace(); - public void setWhiteSpace(String whiteSpace) - throws DOMException; - - /** - * See the widows property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getWidows(); - public void setWidows(String widows) - throws DOMException; - - /** - * See the width property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getWidth(); - public void setWidth(String width) - throws DOMException; - - /** - * See the word-spacing property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getWordSpacing(); - public void setWordSpacing(String wordSpacing) - throws DOMException; - - /** - * See the z-index property definition in CSS2. - * @exception DOMException - * SYNTAX_ERR: Raised if the new value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public String getZIndex(); - public void setZIndex(String zIndex) - throws DOMException; - -} diff --git a/src/bind/java/org/w3c/dom/css/CSSCharsetRule.java b/src/bind/java/org/w3c/dom/css/CSSCharsetRule.java deleted file mode 100644 index ac1884557..000000000 --- a/src/bind/java/org/w3c/dom/css/CSSCharsetRule.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.css; - -import org.w3c.dom.DOMException; - -/** - * The CSSCharsetRule interface represents a @charset rule in a - * CSS style sheet. The value of the encoding attribute does - * not affect the encoding of text data in the DOM objects; this encoding is - * always UTF-16. After a stylesheet is loaded, the value of the - * encoding attribute is the value found in the - * @charset rule. If there was no @charset in the - * original document, then no CSSCharsetRule is created. The - * value of the encoding attribute may also be used as a hint - * for the encoding used on serialization of the style sheet. - *

The value of the @charset rule (and therefore of the - * CSSCharsetRule) may not correspond to the encoding the - * document actually came in; character encoding information e.g. in an HTTP - * header, has priority (see CSS document representation) but this is not - * reflected in the CSSCharsetRule. - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface CSSCharsetRule extends CSSRule { - /** - * The encoding information used in this @charset rule. - * @exception DOMException - * SYNTAX_ERR: Raised if the specified encoding value has a syntax error - * and is unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this encoding rule is - * readonly. - */ - public String getEncoding(); - public void setEncoding(String encoding) - throws DOMException; - -} diff --git a/src/bind/java/org/w3c/dom/css/CSSFontFaceRule.java b/src/bind/java/org/w3c/dom/css/CSSFontFaceRule.java deleted file mode 100644 index a17957061..000000000 --- a/src/bind/java/org/w3c/dom/css/CSSFontFaceRule.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.css; - -/** - * The CSSFontFaceRule interface represents a @font-face rule in - * a CSS style sheet. The @font-face rule is used to hold a set - * of font descriptions. - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface CSSFontFaceRule extends CSSRule { - /** - * The declaration-block of this rule. - */ - public CSSStyleDeclaration getStyle(); - -} diff --git a/src/bind/java/org/w3c/dom/css/CSSImportRule.java b/src/bind/java/org/w3c/dom/css/CSSImportRule.java deleted file mode 100644 index e18ad569b..000000000 --- a/src/bind/java/org/w3c/dom/css/CSSImportRule.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.css; - -import org.w3c.dom.stylesheets.MediaList; - -/** - * The CSSImportRule interface represents a @import rule within - * a CSS style sheet. The @import rule is used to import style - * rules from other style sheets. - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface CSSImportRule extends CSSRule { - /** - * The location of the style sheet to be imported. The attribute will not - * contain the "url(...)" specifier around the URI. - */ - public String getHref(); - - /** - * A list of media types for which this style sheet may be used. - */ - public MediaList getMedia(); - - /** - * The style sheet referred to by this rule, if it has been loaded. The - * value of this attribute is null if the style sheet has - * not yet been loaded or if it will not be loaded (e.g. if the style - * sheet is for a media type not supported by the user agent). - */ - public CSSStyleSheet getStyleSheet(); - -} diff --git a/src/bind/java/org/w3c/dom/css/CSSMediaRule.java b/src/bind/java/org/w3c/dom/css/CSSMediaRule.java deleted file mode 100644 index c74d3faf5..000000000 --- a/src/bind/java/org/w3c/dom/css/CSSMediaRule.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.css; - -import org.w3c.dom.DOMException; -import org.w3c.dom.stylesheets.MediaList; - -/** - * The CSSMediaRule interface represents a @media rule in a CSS - * style sheet. A @media rule can be used to delimit style - * rules for specific media types. - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface CSSMediaRule extends CSSRule { - /** - * A list of media types for this rule. - */ - public MediaList getMedia(); - - /** - * A list of all CSS rules contained within the media block. - */ - public CSSRuleList getCssRules(); - - /** - * Used to insert a new rule into the media block. - * @param rule The parsable text representing the rule. For rule sets - * this contains both the selector and the style declaration. For - * at-rules, this specifies both the at-identifier and the rule - * content. - * @param index The index within the media block's rule collection of the - * rule before which to insert the specified rule. If the specified - * index is equal to the length of the media blocks's rule collection, - * the rule will be added to the end of the media block. - * @return The index within the media block's rule collection of the - * newly inserted rule. - * @exception DOMException - * HIERARCHY_REQUEST_ERR: Raised if the rule cannot be inserted at the - * specified index, e.g., if an @import rule is inserted - * after a standard rule set or other at-rule. - *
INDEX_SIZE_ERR: Raised if the specified index is not a valid - * insertion point. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this media rule is - * readonly. - *
SYNTAX_ERR: Raised if the specified rule has a syntax error and - * is unparsable. - */ - public int insertRule(String rule, - int index) - throws DOMException; - - /** - * Used to delete a rule from the media block. - * @param index The index within the media block's rule collection of the - * rule to remove. - * @exception DOMException - * INDEX_SIZE_ERR: Raised if the specified index does not correspond to - * a rule in the media rule list. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this media rule is - * readonly. - */ - public void deleteRule(int index) - throws DOMException; - -} diff --git a/src/bind/java/org/w3c/dom/css/CSSPageRule.java b/src/bind/java/org/w3c/dom/css/CSSPageRule.java deleted file mode 100644 index d2fc9c351..000000000 --- a/src/bind/java/org/w3c/dom/css/CSSPageRule.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.css; - -import org.w3c.dom.DOMException; - -/** - * The CSSPageRule interface represents a @page rule within a - * CSS style sheet. The @page rule is used to specify the - * dimensions, orientation, margins, etc. of a page box for paged media. - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface CSSPageRule extends CSSRule { - /** - * The parsable textual representation of the page selector for the rule. - * @exception DOMException - * SYNTAX_ERR: Raised if the specified CSS string value has a syntax - * error and is unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this rule is readonly. - */ - public String getSelectorText(); - public void setSelectorText(String selectorText) - throws DOMException; - - /** - * The declaration-block of this rule. - */ - public CSSStyleDeclaration getStyle(); - -} diff --git a/src/bind/java/org/w3c/dom/css/CSSPrimitiveValue.java b/src/bind/java/org/w3c/dom/css/CSSPrimitiveValue.java deleted file mode 100644 index 781ce8ab4..000000000 --- a/src/bind/java/org/w3c/dom/css/CSSPrimitiveValue.java +++ /dev/null @@ -1,296 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.css; - -import org.w3c.dom.DOMException; - -/** - * The CSSPrimitiveValue interface represents a single CSS value - * . This interface may be used to determine the value of a specific style - * property currently set in a block or to set a specific style property - * explicitly within the block. An instance of this interface might be - * obtained from the getPropertyCSSValue method of the - * CSSStyleDeclaration interface. A - * CSSPrimitiveValue object only occurs in a context of a CSS - * property. - *

Conversions are allowed between absolute values (from millimeters to - * centimeters, from degrees to radians, and so on) but not between relative - * values. (For example, a pixel value cannot be converted to a centimeter - * value.) Percentage values can't be converted since they are relative to - * the parent value (or another property value). There is one exception for - * color percentage values: since a color percentage value is relative to - * the range 0-255, a color percentage value can be converted to a number; - * (see also the RGBColor interface). - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface CSSPrimitiveValue extends CSSValue { - // UnitTypes - /** - * The value is not a recognized CSS2 value. The value can only be - * obtained by using the cssText attribute. - */ - public static final short CSS_UNKNOWN = 0; - /** - * The value is a simple number. The value can be obtained by using the - * getFloatValue method. - */ - public static final short CSS_NUMBER = 1; - /** - * The value is a percentage. The value can be obtained by using the - * getFloatValue method. - */ - public static final short CSS_PERCENTAGE = 2; - /** - * The value is a length (ems). The value can be obtained by using the - * getFloatValue method. - */ - public static final short CSS_EMS = 3; - /** - * The value is a length (exs). The value can be obtained by using the - * getFloatValue method. - */ - public static final short CSS_EXS = 4; - /** - * The value is a length (px). The value can be obtained by using the - * getFloatValue method. - */ - public static final short CSS_PX = 5; - /** - * The value is a length (cm). The value can be obtained by using the - * getFloatValue method. - */ - public static final short CSS_CM = 6; - /** - * The value is a length (mm). The value can be obtained by using the - * getFloatValue method. - */ - public static final short CSS_MM = 7; - /** - * The value is a length (in). The value can be obtained by using the - * getFloatValue method. - */ - public static final short CSS_IN = 8; - /** - * The value is a length (pt). The value can be obtained by using the - * getFloatValue method. - */ - public static final short CSS_PT = 9; - /** - * The value is a length (pc). The value can be obtained by using the - * getFloatValue method. - */ - public static final short CSS_PC = 10; - /** - * The value is an angle (deg). The value can be obtained by using the - * getFloatValue method. - */ - public static final short CSS_DEG = 11; - /** - * The value is an angle (rad). The value can be obtained by using the - * getFloatValue method. - */ - public static final short CSS_RAD = 12; - /** - * The value is an angle (grad). The value can be obtained by using the - * getFloatValue method. - */ - public static final short CSS_GRAD = 13; - /** - * The value is a time (ms). The value can be obtained by using the - * getFloatValue method. - */ - public static final short CSS_MS = 14; - /** - * The value is a time (s). The value can be obtained by using the - * getFloatValue method. - */ - public static final short CSS_S = 15; - /** - * The value is a frequency (Hz). The value can be obtained by using the - * getFloatValue method. - */ - public static final short CSS_HZ = 16; - /** - * The value is a frequency (kHz). The value can be obtained by using the - * getFloatValue method. - */ - public static final short CSS_KHZ = 17; - /** - * The value is a number with an unknown dimension. The value can be - * obtained by using the getFloatValue method. - */ - public static final short CSS_DIMENSION = 18; - /** - * The value is a STRING. The value can be obtained by using the - * getStringValue method. - */ - public static final short CSS_STRING = 19; - /** - * The value is a URI. The value can be obtained by using the - * getStringValue method. - */ - public static final short CSS_URI = 20; - /** - * The value is an identifier. The value can be obtained by using the - * getStringValue method. - */ - public static final short CSS_IDENT = 21; - /** - * The value is a attribute function. The value can be obtained by using - * the getStringValue method. - */ - public static final short CSS_ATTR = 22; - /** - * The value is a counter or counters function. The value can be obtained - * by using the getCounterValue method. - */ - public static final short CSS_COUNTER = 23; - /** - * The value is a rect function. The value can be obtained by using the - * getRectValue method. - */ - public static final short CSS_RECT = 24; - /** - * The value is a RGB color. The value can be obtained by using the - * getRGBColorValue method. - */ - public static final short CSS_RGBCOLOR = 25; - - /** - * The type of the value as defined by the constants specified above. - */ - public short getPrimitiveType(); - - /** - * A method to set the float value with a specified unit. If the property - * attached with this value can not accept the specified unit or the - * float value, the value will be unchanged and a - * DOMException will be raised. - * @param unitType A unit code as defined above. The unit code can only - * be a float unit type (i.e. CSS_NUMBER, - * CSS_PERCENTAGE, CSS_EMS, - * CSS_EXS, CSS_PX, CSS_CM, - * CSS_MM, CSS_IN, CSS_PT, - * CSS_PC, CSS_DEG, CSS_RAD, - * CSS_GRAD, CSS_MS, CSS_S, - * CSS_HZ, CSS_KHZ, - * CSS_DIMENSION). - * @param floatValue The new float value. - * @exception DOMException - * INVALID_ACCESS_ERR: Raised if the attached property doesn't support - * the float value or the unit type. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public void setFloatValue(short unitType, - float floatValue) - throws DOMException; - - /** - * This method is used to get a float value in a specified unit. If this - * CSS value doesn't contain a float value or can't be converted into - * the specified unit, a DOMException is raised. - * @param unitType A unit code to get the float value. The unit code can - * only be a float unit type (i.e. CSS_NUMBER, - * CSS_PERCENTAGE, CSS_EMS, - * CSS_EXS, CSS_PX, CSS_CM, - * CSS_MM, CSS_IN, CSS_PT, - * CSS_PC, CSS_DEG, CSS_RAD, - * CSS_GRAD, CSS_MS, CSS_S, - * CSS_HZ, CSS_KHZ, - * CSS_DIMENSION). - * @return The float value in the specified unit. - * @exception DOMException - * INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a float - * value or if the float value can't be converted into the specified - * unit. - */ - public float getFloatValue(short unitType) - throws DOMException; - - /** - * A method to set the string value with the specified unit. If the - * property attached to this value can't accept the specified unit or - * the string value, the value will be unchanged and a - * DOMException will be raised. - * @param stringType A string code as defined above. The string code can - * only be a string unit type (i.e. CSS_STRING, - * CSS_URI, CSS_IDENT, and - * CSS_ATTR). - * @param stringValue The new string value. - * @exception DOMException - * INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a string - * value or if the string value can't be converted into the specified - * unit. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. - */ - public void setStringValue(short stringType, - String stringValue) - throws DOMException; - - /** - * This method is used to get the string value. If the CSS value doesn't - * contain a string value, a DOMException is raised. Some - * properties (like 'font-family' or 'voice-family') convert a - * whitespace separated list of idents to a string. - * @return The string value in the current unit. The current - * primitiveType can only be a string unit type (i.e. - * CSS_STRING, CSS_URI, - * CSS_IDENT and CSS_ATTR). - * @exception DOMException - * INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a string - * value. - */ - public String getStringValue() - throws DOMException; - - /** - * This method is used to get the Counter value. If this CSS value - * doesn't contain a counter value, a DOMException is - * raised. Modification to the corresponding style property can be - * achieved using the Counter interface. - * @return The Counter value. - * @exception DOMException - * INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a - * Counter value (e.g. this is not CSS_COUNTER). - */ - public Counter getCounterValue() - throws DOMException; - - /** - * This method is used to get the Rect value. If this CSS value doesn't - * contain a rect value, a DOMException is raised. - * Modification to the corresponding style property can be achieved - * using the Rect interface. - * @return The Rect value. - * @exception DOMException - * INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a Rect - * value. (e.g. this is not CSS_RECT). - */ - public Rect getRectValue() - throws DOMException; - - /** - * This method is used to get the RGB color. If this CSS value doesn't - * contain a RGB color value, a DOMException is raised. - * Modification to the corresponding style property can be achieved - * using the RGBColor interface. - * @return the RGB color value. - * @exception DOMException - * INVALID_ACCESS_ERR: Raised if the attached property can't return a - * RGB color value (e.g. this is not CSS_RGBCOLOR). - */ - public RGBColor getRGBColorValue() - throws DOMException; - -} diff --git a/src/bind/java/org/w3c/dom/css/CSSRule.java b/src/bind/java/org/w3c/dom/css/CSSRule.java deleted file mode 100644 index 8626f8089..000000000 --- a/src/bind/java/org/w3c/dom/css/CSSRule.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.css; - -import org.w3c.dom.DOMException; - -/** - * The CSSRule interface is the abstract base interface for any - * type of CSS statement. This includes both rule sets and at-rules. An - * implementation is expected to preserve all rules specified in a CSS style - * sheet, even if the rule is not recognized by the parser. Unrecognized - * rules are represented using the CSSUnknownRule interface. - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface CSSRule { - // RuleType - /** - * The rule is a CSSUnknownRule. - */ - public static final short UNKNOWN_RULE = 0; - /** - * The rule is a CSSStyleRule. - */ - public static final short STYLE_RULE = 1; - /** - * The rule is a CSSCharsetRule. - */ - public static final short CHARSET_RULE = 2; - /** - * The rule is a CSSImportRule. - */ - public static final short IMPORT_RULE = 3; - /** - * The rule is a CSSMediaRule. - */ - public static final short MEDIA_RULE = 4; - /** - * The rule is a CSSFontFaceRule. - */ - public static final short FONT_FACE_RULE = 5; - /** - * The rule is a CSSPageRule. - */ - public static final short PAGE_RULE = 6; - - /** - * The type of the rule, as defined above. The expectation is that - * binding-specific casting methods can be used to cast down from an - * instance of the CSSRule interface to the specific - * derived interface implied by the type. - */ - public short getType(); - - /** - * The parsable textual representation of the rule. This reflects the - * current state of the rule and not its initial value. - * @exception DOMException - * SYNTAX_ERR: Raised if the specified CSS string value has a syntax - * error and is unparsable. - *
INVALID_MODIFICATION_ERR: Raised if the specified CSS string - * value represents a different type of rule than the current one. - *
HIERARCHY_REQUEST_ERR: Raised if the rule cannot be inserted at - * this point in the style sheet. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if the rule is readonly. - */ - public String getCssText(); - public void setCssText(String cssText) - throws DOMException; - - /** - * The style sheet that contains this rule. - */ - public CSSStyleSheet getParentStyleSheet(); - - /** - * If this rule is contained inside another rule (e.g. a style rule - * inside an @media block), this is the containing rule. If this rule is - * not nested inside any other rules, this returns null. - */ - public CSSRule getParentRule(); - -} diff --git a/src/bind/java/org/w3c/dom/css/CSSRuleList.java b/src/bind/java/org/w3c/dom/css/CSSRuleList.java deleted file mode 100644 index ba4052074..000000000 --- a/src/bind/java/org/w3c/dom/css/CSSRuleList.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.css; - -/** - * The CSSRuleList interface provides the abstraction of an - * ordered collection of CSS rules. - *

The items in the CSSRuleList are accessible via an - * integral index, starting from 0. - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface CSSRuleList { - /** - * The number of CSSRules in the list. The range of valid - * child rule indices is 0 to length-1 - * inclusive. - */ - public int getLength(); - - /** - * Used to retrieve a CSS rule by ordinal index. The order in this - * collection represents the order of the rules in the CSS style sheet. - * If index is greater than or equal to the number of rules in the list, - * this returns null. - * @param indexIndex into the collection - * @return The style rule at the index position in the - * CSSRuleList, or null if that is not a - * valid index. - */ - public CSSRule item(int index); - -} diff --git a/src/bind/java/org/w3c/dom/css/CSSStyleDeclaration.java b/src/bind/java/org/w3c/dom/css/CSSStyleDeclaration.java deleted file mode 100644 index d017fbd55..000000000 --- a/src/bind/java/org/w3c/dom/css/CSSStyleDeclaration.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.css; - -import org.w3c.dom.DOMException; - -/** - * The CSSStyleDeclaration interface represents a single CSS - * declaration block. This interface may be used to determine the style - * properties currently set in a block or to set style properties explicitly - * within the block. - *

While an implementation may not recognize all CSS properties within a - * CSS declaration block, it is expected to provide access to all specified - * properties in the style sheet through the CSSStyleDeclaration - * interface. Furthermore, implementations that support a specific level of - * CSS should correctly handle CSS shorthand properties for that level. For - * a further discussion of shorthand properties, see the - * CSS2Properties interface. - *

This interface is also used to provide a read-only access to the - * computed values of an element. See also the ViewCSS - * interface. The CSS Object Model doesn't provide an access to the - * specified or actual values of the CSS cascade. - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface CSSStyleDeclaration { - /** - * The parsable textual representation of the declaration block - * (excluding the surrounding curly braces). Setting this attribute will - * result in the parsing of the new value and resetting of all the - * properties in the declaration block including the removal or addition - * of properties. - * @exception DOMException - * SYNTAX_ERR: Raised if the specified CSS string value has a syntax - * error and is unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration is - * readonly or a property is readonly. - */ - public String getCssText(); - public void setCssText(String cssText) - throws DOMException; - - /** - * Used to retrieve the value of a CSS property if it has been explicitly - * set within this declaration block. - * @param propertyName The name of the CSS property. See the CSS property - * index. - * @return Returns the value of the property if it has been explicitly - * set for this declaration block. Returns the empty string if the - * property has not been set. - */ - public String getPropertyValue(String propertyName); - - /** - * Used to retrieve the object representation of the value of a CSS - * property if it has been explicitly set within this declaration block. - * This method returns null if the property is a shorthand - * property. Shorthand property values can only be accessed and modified - * as strings, using the getPropertyValue and - * setProperty methods. - * @param propertyName The name of the CSS property. See the CSS property - * index. - * @return Returns the value of the property if it has been explicitly - * set for this declaration block. Returns null if the - * property has not been set. - */ - public CSSValue getPropertyCSSValue(String propertyName); - - /** - * Used to remove a CSS property if it has been explicitly set within - * this declaration block. - * @param propertyName The name of the CSS property. See the CSS property - * index. - * @return Returns the value of the property if it has been explicitly - * set for this declaration block. Returns the empty string if the - * property has not been set or the property name does not correspond - * to a known CSS property. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration is readonly - * or the property is readonly. - */ - public String removeProperty(String propertyName) - throws DOMException; - - /** - * Used to retrieve the priority of a CSS property (e.g. the - * "important" qualifier) if the property has been - * explicitly set in this declaration block. - * @param propertyName The name of the CSS property. See the CSS property - * index. - * @return A string representing the priority (e.g. - * "important") if one exists. The empty string if none - * exists. - */ - public String getPropertyPriority(String propertyName); - - /** - * Used to set a property value and priority within this declaration - * block. - * @param propertyName The name of the CSS property. See the CSS property - * index. - * @param value The new value of the property. - * @param priority The new priority of the property (e.g. - * "important"). - * @exception DOMException - * SYNTAX_ERR: Raised if the specified value has a syntax error and is - * unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration is - * readonly or the property is readonly. - */ - public void setProperty(String propertyName, - String value, - String priority) - throws DOMException; - - /** - * The number of properties that have been explicitly set in this - * declaration block. The range of valid indices is 0 to length-1 - * inclusive. - */ - public int getLength(); - - /** - * Used to retrieve the properties that have been explicitly set in this - * declaration block. The order of the properties retrieved using this - * method does not have to be the order in which they were set. This - * method can be used to iterate over all properties in this declaration - * block. - * @param index Index of the property name to retrieve. - * @return The name of the property at this ordinal position. The empty - * string if no property exists at this position. - */ - public String item(int index); - - /** - * The CSS rule that contains this declaration block or null - * if this CSSStyleDeclaration is not attached to a - * CSSRule. - */ - public CSSRule getParentRule(); - -} diff --git a/src/bind/java/org/w3c/dom/css/CSSStyleRule.java b/src/bind/java/org/w3c/dom/css/CSSStyleRule.java deleted file mode 100644 index 45a647b19..000000000 --- a/src/bind/java/org/w3c/dom/css/CSSStyleRule.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.css; - -import org.w3c.dom.DOMException; - -/** - * The CSSStyleRule interface represents a single rule set in a - * CSS style sheet. - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface CSSStyleRule extends CSSRule { - /** - * The textual representation of the selector for the rule set. The - * implementation may have stripped out insignificant whitespace while - * parsing the selector. - * @exception DOMException - * SYNTAX_ERR: Raised if the specified CSS string value has a syntax - * error and is unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this rule is readonly. - */ - public String getSelectorText(); - public void setSelectorText(String selectorText) - throws DOMException; - - /** - * The declaration-block of this rule set. - */ - public CSSStyleDeclaration getStyle(); - -} diff --git a/src/bind/java/org/w3c/dom/css/CSSStyleSheet.java b/src/bind/java/org/w3c/dom/css/CSSStyleSheet.java deleted file mode 100644 index cdfd74d9a..000000000 --- a/src/bind/java/org/w3c/dom/css/CSSStyleSheet.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.css; - -import org.w3c.dom.DOMException; -import org.w3c.dom.stylesheets.StyleSheet; - -/** - * The CSSStyleSheet interface is a concrete interface used to - * represent a CSS style sheet i.e., a style sheet whose content type is - * "text/css". - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface CSSStyleSheet extends StyleSheet { - /** - * If this style sheet comes from an @import rule, the - * ownerRule attribute will contain the - * CSSImportRule. In that case, the ownerNode - * attribute in the StyleSheet interface will be - * null. If the style sheet comes from an element or a - * processing instruction, the ownerRule attribute will be - * null and the ownerNode attribute will - * contain the Node. - */ - public CSSRule getOwnerRule(); - - /** - * The list of all CSS rules contained within the style sheet. This - * includes both rule sets and at-rules. - */ - public CSSRuleList getCssRules(); - - /** - * Used to insert a new rule into the style sheet. The new rule now - * becomes part of the cascade. - * @param rule The parsable text representing the rule. For rule sets - * this contains both the selector and the style declaration. For - * at-rules, this specifies both the at-identifier and the rule - * content. - * @param index The index within the style sheet's rule list of the rule - * before which to insert the specified rule. If the specified index - * is equal to the length of the style sheet's rule collection, the - * rule will be added to the end of the style sheet. - * @return The index within the style sheet's rule collection of the - * newly inserted rule. - * @exception DOMException - * HIERARCHY_REQUEST_ERR: Raised if the rule cannot be inserted at the - * specified index e.g. if an @import rule is inserted - * after a standard rule set or other at-rule. - *
INDEX_SIZE_ERR: Raised if the specified index is not a valid - * insertion point. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this style sheet is - * readonly. - *
SYNTAX_ERR: Raised if the specified rule has a syntax error and - * is unparsable. - */ - public int insertRule(String rule, - int index) - throws DOMException; - - /** - * Used to delete a rule from the style sheet. - * @param index The index within the style sheet's rule list of the rule - * to remove. - * @exception DOMException - * INDEX_SIZE_ERR: Raised if the specified index does not correspond to - * a rule in the style sheet's rule list. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this style sheet is - * readonly. - */ - public void deleteRule(int index) - throws DOMException; - -} diff --git a/src/bind/java/org/w3c/dom/css/CSSUnknownRule.java b/src/bind/java/org/w3c/dom/css/CSSUnknownRule.java deleted file mode 100644 index 763d5f1b6..000000000 --- a/src/bind/java/org/w3c/dom/css/CSSUnknownRule.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.css; - -/** - * The CSSUnknownRule interface represents an at-rule not - * supported by this user agent. - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface CSSUnknownRule extends CSSRule { -} diff --git a/src/bind/java/org/w3c/dom/css/CSSValue.java b/src/bind/java/org/w3c/dom/css/CSSValue.java deleted file mode 100644 index c40929095..000000000 --- a/src/bind/java/org/w3c/dom/css/CSSValue.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.css; - -import org.w3c.dom.DOMException; - -/** - * The CSSValue interface represents a simple or a complex - * value. A CSSValue object only occurs in a context of a CSS - * property. - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface CSSValue { - // UnitTypes - /** - * The value is inherited and the cssText contains "inherit". - */ - public static final short CSS_INHERIT = 0; - /** - * The value is a primitive value and an instance of the - * CSSPrimitiveValue interface can be obtained by using - * binding-specific casting methods on this instance of the - * CSSValue interface. - */ - public static final short CSS_PRIMITIVE_VALUE = 1; - /** - * The value is a CSSValue list and an instance of the - * CSSValueList interface can be obtained by using - * binding-specific casting methods on this instance of the - * CSSValue interface. - */ - public static final short CSS_VALUE_LIST = 2; - /** - * The value is a custom value. - */ - public static final short CSS_CUSTOM = 3; - - /** - * A string representation of the current value. - * @exception DOMException - * SYNTAX_ERR: Raised if the specified CSS string value has a syntax - * error (according to the attached property) or is unparsable. - *
INVALID_MODIFICATION_ERR: Raised if the specified CSS string - * value represents a different type of values than the values allowed - * by the CSS property. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this value is readonly. - */ - public String getCssText(); - public void setCssText(String cssText) - throws DOMException; - - /** - * A code defining the type of the value as defined above. - */ - public short getCssValueType(); - -} diff --git a/src/bind/java/org/w3c/dom/css/CSSValueList.java b/src/bind/java/org/w3c/dom/css/CSSValueList.java deleted file mode 100644 index b159165d9..000000000 --- a/src/bind/java/org/w3c/dom/css/CSSValueList.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.css; - -/** - * The CSSValueList interface provides the abstraction of an - * ordered collection of CSS values. - *

Some properties allow an empty list into their syntax. In that case, - * these properties take the none identifier. So, an empty list - * means that the property has the value none. - *

The items in the CSSValueList are accessible via an - * integral index, starting from 0. - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface CSSValueList extends CSSValue { - /** - * The number of CSSValues in the list. The range of valid - * values of the indices is 0 to length-1 - * inclusive. - */ - public int getLength(); - - /** - * Used to retrieve a CSSValue by ordinal index. The order in - * this collection represents the order of the values in the CSS style - * property. If index is greater than or equal to the number of values - * in the list, this returns null. - * @param indexIndex into the collection. - * @return The CSSValue at the index position - * in the CSSValueList, or null if that is - * not a valid index. - */ - public CSSValue item(int index); - -} diff --git a/src/bind/java/org/w3c/dom/css/Counter.java b/src/bind/java/org/w3c/dom/css/Counter.java deleted file mode 100644 index 8cd4967b3..000000000 --- a/src/bind/java/org/w3c/dom/css/Counter.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.css; - -/** - * The Counter interface is used to represent any counter or - * counters function value. This interface reflects the values in the - * underlying style property. - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface Counter { - /** - * This attribute is used for the identifier of the counter. - */ - public String getIdentifier(); - - /** - * This attribute is used for the style of the list. - */ - public String getListStyle(); - - /** - * This attribute is used for the separator of the nested counters. - */ - public String getSeparator(); - -} diff --git a/src/bind/java/org/w3c/dom/css/DOMImplementationCSS.java b/src/bind/java/org/w3c/dom/css/DOMImplementationCSS.java deleted file mode 100644 index 66755de64..000000000 --- a/src/bind/java/org/w3c/dom/css/DOMImplementationCSS.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.css; - -import org.w3c.dom.DOMImplementation; -import org.w3c.dom.DOMException; - -/** - * This interface allows the DOM user to create a CSSStyleSheet - * outside the context of a document. There is no way to associate the new - * CSSStyleSheet with a document in DOM Level 2. - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface DOMImplementationCSS extends DOMImplementation { - /** - * Creates a new CSSStyleSheet. - * @param title The advisory title. See also the section. - * @param media The comma-separated list of media associated with the new - * style sheet. See also the section. - * @return A new CSS style sheet. - * @exception DOMException - * SYNTAX_ERR: Raised if the specified media string value has a syntax - * error and is unparsable. - */ - public CSSStyleSheet createCSSStyleSheet(String title, - String media) - throws DOMException; - -} diff --git a/src/bind/java/org/w3c/dom/css/DocumentCSS.java b/src/bind/java/org/w3c/dom/css/DocumentCSS.java deleted file mode 100644 index bb1b8540a..000000000 --- a/src/bind/java/org/w3c/dom/css/DocumentCSS.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.css; - -import org.w3c.dom.stylesheets.DocumentStyle; -import org.w3c.dom.Element; - -/** - * This interface represents a document with a CSS view. - *

The getOverrideStyle method provides a mechanism through - * which a DOM author could effect immediate change to the style of an - * element without modifying the explicitly linked style sheets of a - * document or the inline style of elements in the style sheets. This style - * sheet comes after the author style sheet in the cascade algorithm and is - * called override style sheet. The override style sheet takes precedence - * over author style sheets. An "!important" declaration still takes - * precedence over a normal declaration. Override, author, and user style - * sheets all may contain "!important" declarations. User "!important" rules - * take precedence over both override and author "!important" rules, and - * override "!important" rules take precedence over author "!important" - * rules. - *

The expectation is that an instance of the DocumentCSS - * interface can be obtained by using binding-specific casting methods on an - * instance of the Document interface. - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface DocumentCSS extends DocumentStyle { - /** - * This method is used to retrieve the override style declaration for a - * specified element and a specified pseudo-element. - * @param elt The element whose style is to be modified. This parameter - * cannot be null. - * @param pseudoElt The pseudo-element or null if none. - * @return The override style declaration. - */ - public CSSStyleDeclaration getOverrideStyle(Element elt, - String pseudoElt); - -} diff --git a/src/bind/java/org/w3c/dom/css/ElementCSSInlineStyle.java b/src/bind/java/org/w3c/dom/css/ElementCSSInlineStyle.java deleted file mode 100644 index 98b60bf9d..000000000 --- a/src/bind/java/org/w3c/dom/css/ElementCSSInlineStyle.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.css; - -/** - * Inline style information attached to elements is exposed through the - * style attribute. This represents the contents of the STYLE - * attribute for HTML elements (or elements in other schemas or DTDs which - * use the STYLE attribute in the same way). The expectation is that an - * instance of the ElementCSSInlineStyle interface can be obtained by using - * binding-specific casting methods on an instance of the Element interface - * when the element supports inline CSS style informations. - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface ElementCSSInlineStyle { - /** - * The style attribute. - */ - public CSSStyleDeclaration getStyle(); - -} diff --git a/src/bind/java/org/w3c/dom/css/RGBColor.java b/src/bind/java/org/w3c/dom/css/RGBColor.java deleted file mode 100644 index cd5daa567..000000000 --- a/src/bind/java/org/w3c/dom/css/RGBColor.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.css; - -/** - * The RGBColor interface is used to represent any RGB color - * value. This interface reflects the values in the underlying style - * property. Hence, modifications made to the CSSPrimitiveValue - * objects modify the style property. - *

A specified RGB color is not clipped (even if the number is outside the - * range 0-255 or 0%-100%). A computed RGB color is clipped depending on the - * device. - *

Even if a style sheet can only contain an integer for a color value, - * the internal storage of this integer is a float, and this can be used as - * a float in the specified or the computed style. - *

A color percentage value can always be converted to a number and vice - * versa. - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface RGBColor { - /** - * This attribute is used for the red value of the RGB color. - */ - public CSSPrimitiveValue getRed(); - - /** - * This attribute is used for the green value of the RGB color. - */ - public CSSPrimitiveValue getGreen(); - - /** - * This attribute is used for the blue value of the RGB color. - */ - public CSSPrimitiveValue getBlue(); - -} diff --git a/src/bind/java/org/w3c/dom/css/Rect.java b/src/bind/java/org/w3c/dom/css/Rect.java deleted file mode 100644 index f5efb1084..000000000 --- a/src/bind/java/org/w3c/dom/css/Rect.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.css; - -/** - * The Rect interface is used to represent any rect value. This - * interface reflects the values in the underlying style property. Hence, - * modifications made to the CSSPrimitiveValue objects modify - * the style property. - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface Rect { - /** - * This attribute is used for the top of the rect. - */ - public CSSPrimitiveValue getTop(); - - /** - * This attribute is used for the right of the rect. - */ - public CSSPrimitiveValue getRight(); - - /** - * This attribute is used for the bottom of the rect. - */ - public CSSPrimitiveValue getBottom(); - - /** - * This attribute is used for the left of the rect. - */ - public CSSPrimitiveValue getLeft(); - -} diff --git a/src/bind/java/org/w3c/dom/css/ViewCSS.java b/src/bind/java/org/w3c/dom/css/ViewCSS.java deleted file mode 100644 index 6c98bd4ec..000000000 --- a/src/bind/java/org/w3c/dom/css/ViewCSS.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.css; - -import org.w3c.dom.views.AbstractView; -import org.w3c.dom.Element; - -/** - * This interface represents a CSS view. The getComputedStyle - * method provides a read only access to the computed values of an element. - *

The expectation is that an instance of the ViewCSS - * interface can be obtained by using binding-specific casting methods on an - * instance of the AbstractView interface. - *

Since a computed style is related to an Element node, if - * this element is removed from the document, the associated - * CSSStyleDeclaration and CSSValue related to - * this declaration are no longer valid. - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface ViewCSS extends AbstractView { - /** - * This method is used to get the computed style as it is defined in . - * @param elt The element whose style is to be computed. This parameter - * cannot be null. - * @param pseudoElt The pseudo-element or null if none. - * @return The computed style. The CSSStyleDeclaration is - * read-only and contains only absolute values. - */ - public CSSStyleDeclaration getComputedStyle(Element elt, - String pseudoElt); - -} diff --git a/src/bind/java/org/w3c/dom/events/CustomEvent.java b/src/bind/java/org/w3c/dom/events/CustomEvent.java deleted file mode 100644 index c7bdf0433..000000000 --- a/src/bind/java/org/w3c/dom/events/CustomEvent.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2003 World Wide Web Consortium, - * - * (Massachusetts Institute of Technology, European Research Consortium for - * Informatics and Mathematics, Keio University). All Rights Reserved. This - * work is distributed under the W3C(r) Software License [1] in the hope that - * it will be useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 - */ - -package org.w3c.dom.events; - -/** - * The CustomEvent interface gives access to the attributes - * Event.currentTarget and Event.eventPhase. It is - * intended to be used by the DOM Events implementation to access the - * underlying current target and event phase while dispatching a custom - * Event in the tree; it is also intended to be implemented, - * and not used, by DOM applications. - *

The methods contained in this interface are not intended to be used by - * a DOM application, especially during the dispatch on the - * Event object. Changing the current target or the current - * phase may result in unpredictable results of the event flow. The DOM - * Events implementation should ensure that both methods return the - * appropriate current target and phase before invoking each event listener - * on the current target to protect DOM applications from malicious event - * listeners. - *

Note: If this interface is supported by the event object, - * Event.isCustom() must return true. - *

See also the Document Object Model (DOM) Level 3 Events Specification. - * @since DOM Level 3 - */ -public interface CustomEvent extends Event { - /** - * The setDispatchState method is used by the DOM Events - * implementation to set the values of Event.currentTarget - * and Event.eventPhase. It also reset the states of - * isPropagationStopped and - * isImmediatePropagationStopped. - * @param target Specifies the new value for the - * Event.currentTarget attribute. - * @param phase Specifies the new value for the - * Event.eventPhase attribute. - */ - public void setDispatchState(EventTarget target, - short phase); - - /** - * This method will return true if the method - * stopPropagation() has been called for this event, - * false in any other cases. - * @return true if the event propagation has been stopped - * in the current group. - */ - public boolean isPropagationStopped(); - - /** - * The isImmediatePropagationStopped method is used by the - * DOM Events implementation to know if the method - * stopImmediatePropagation() has been called for this - * event. It returns true if the method has been called, - * false otherwise. - * @return true if the event propagation has been stopped - * immediately in the current group. - */ - public boolean isImmediatePropagationStopped(); - -} diff --git a/src/bind/java/org/w3c/dom/events/DocumentEvent.java b/src/bind/java/org/w3c/dom/events/DocumentEvent.java deleted file mode 100644 index 8f50dd74b..000000000 --- a/src/bind/java/org/w3c/dom/events/DocumentEvent.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2003 World Wide Web Consortium, - * - * (Massachusetts Institute of Technology, European Research Consortium for - * Informatics and Mathematics, Keio University). All Rights Reserved. This - * work is distributed under the W3C(r) Software License [1] in the hope that - * it will be useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 - */ - -package org.w3c.dom.events; - -import org.w3c.dom.DOMException; - -/** - * The DocumentEvent interface provides a mechanism by which the - * user can create an Event object of a type supported by the - * implementation. If the feature "Events" is supported by the - * Document object, the DocumentEvent interface - * must be implemented on the same object. If the feature "+Events" is - * supported by the Document object, an object that supports - * the DocumentEvent interface must be returned by invoking the - * method Node.getFeature("+Events", "3.0") on the - * Document object. - *

See also the Document Object Model (DOM) Level 3 Events Specification. - * @since DOM Level 2 - */ -public interface DocumentEvent { - /** - * - * @param eventType The eventType parameter specifies the - * name of the DOM Events interface to be supported by the created - * event object, e.g. "Event", "MouseEvent", - * "MutationEvent" and so on. If the Event - * is to be dispatched via the EventTarget.dispatchEvent() - * method the appropriate event init method must be called after - * creation in order to initialize the Event's values. - * As an example, a user wishing to synthesize some kind of - * UIEvent would invoke - * DocumentEvent.createEvent("UIEvent"). The - * UIEvent.initUIEventNS() method could then be called on - * the newly created UIEvent object to set the specific - * type of user interface event to be dispatched, - * {"http://www.w3.org/2001/xml-events", "DOMActivate"} - * for example, and set its context information, e.g. - * UIEvent.detail in this example. The - * createEvent method is used in creating - * Events when it is either inconvenient or unnecessary - * for the user to create an Event themselves. In cases - * where the implementation provided Event is - * insufficient, users may supply their own Event - * implementations for use with the - * EventTarget.dispatchEvent() method. However, the DOM - * implementation needs access to the attributes - * Event.currentTarget and Event.eventPhase - * to appropriately propagate the event in the DOM tree. Therefore - * users' Event implementations might need to support the - * CustomEvent interface for that effect. - *

Note: For backward compatibility reason, "UIEvents", - * "MouseEvents", "MutationEvents", and "HTMLEvents" feature names are - * valid values for the parameter eventType and represent - * respectively the interfaces "UIEvent", "MouseEvent", - * "MutationEvent", and "Event". - * @return The newly created event object. - * @exception DOMException - * NOT_SUPPORTED_ERR: Raised if the implementation does not support the - * Event interface requested. - */ - public Event createEvent(String eventType) - throws DOMException; - - /** - * Test if the implementation can generate events of a specified type. - * @param namespaceURI Specifies the Event.namespaceURI of - * the event. - * @param type Specifies the Event.type of the event. - * @return true if the implementation can generate and - * dispatch this event type, false otherwise. - * @since DOM Level 3 - */ - public boolean canDispatch(String namespaceURI, - String type); - -} diff --git a/src/bind/java/org/w3c/dom/events/Event.java b/src/bind/java/org/w3c/dom/events/Event.java deleted file mode 100644 index 949931518..000000000 --- a/src/bind/java/org/w3c/dom/events/Event.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright (c) 2003 World Wide Web Consortium, - * - * (Massachusetts Institute of Technology, European Research Consortium for - * Informatics and Mathematics, Keio University). All Rights Reserved. This - * work is distributed under the W3C(r) Software License [1] in the hope that - * it will be useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 - */ - -package org.w3c.dom.events; - -/** - * The Event interface is used to provide contextual information - * about an event to the listener processing the event. An object which - * implements the Event interface is passed as the parameter to - * an EventListener. More specific context information is - * passed to event listeners by deriving additional interfaces from - * Event which contain information directly relating to the - * type of event they represent. These derived interfaces are also - * implemented by the object passed to the event listener. - *

To create an instance of the Event interface, use the - * DocumentEvent.createEvent("Event") method call. - *

See also the Document Object Model (DOM) Level 3 Events Specification. - * @since DOM Level 2 - */ -public interface Event { - // PhaseType - /** - * The current event phase is the capture phase. - */ - public static final short CAPTURING_PHASE = 1; - /** - * The current event is in the target phase, i.e. it is being evaluated - * at the event target. - */ - public static final short AT_TARGET = 2; - /** - * The current event phase is the bubbling phase. - */ - public static final short BUBBLING_PHASE = 3; - - /** - * The name should be an NCName as defined in [XML Namespaces] - * and is case-sensitive. - *
If the attribute Event.namespaceURI is different from - * null, this attribute represents a local name. - */ - public String getType(); - - /** - * Used to indicate the event target. This attribute contains the target - * node when used with the . - */ - public EventTarget getTarget(); - - /** - * Used to indicate the EventTarget whose - * EventListeners are currently being processed. This is - * particularly useful during the capture and bubbling phases. This - * attribute could contain the target node or a target ancestor when - * used with the . - */ - public EventTarget getCurrentTarget(); - - /** - * Used to indicate which phase of event flow is currently being - * accomplished. - */ - public short getEventPhase(); - - /** - * Used to indicate whether or not an event is a bubbling event. If the - * event can bubble the value is true, otherwise the value - * is false. - */ - public boolean getBubbles(); - - /** - * Used to indicate whether or not an event can have its default action - * prevented (see also ). If the default action can be prevented the - * value is true, otherwise the value is false - * . - */ - public boolean getCancelable(); - - /** - * Used to specify the time (in milliseconds relative to the epoch) at - * which the event was created. Due to the fact that some systems may - * not provide this information the value of timeStamp may - * be not available for all events. When not available, a value of - * 0 will be returned. Examples of epoch time are the time - * of the system start or 0:0:0 UTC 1st January 1970. - */ - public long getTimeStamp(); - - /** - * This method is used to prevent event listeners of the same group to be - * triggered but its effect is deferred until all event listeners - * attached on the currentTarget have been triggered (see - * ). Once it has been called, further calls to that method have no - * additional effect. - *

Note: This method does not prevent the default action from - * being invoked; use preventDefault for that effect. - */ - public void stopPropagation(); - - /** - * If an event is cancelable, the preventDefault method is - * used to signify that the event is to be canceled, meaning any default - * action normally taken by the implementation as a result of the event - * will not occur (see also ), and thus independently of event groups. - * Calling this method for a non-cancelable event has no effect. - *

Note: This method does not stop the event propagation; use - * stopPropagation or stopImmediatePropagation - * for that effect. - */ - public void preventDefault(); - - /** - * The initEvent method is used to initialize the value of - * an Event created through the - * DocumentEvent.createEvent method. This method may only - * be called before the Event has been dispatched via the - * EventTarget.dispatchEvent() method. If the method is - * called several times before invoking - * EventTarget.dispatchEvent, only the final invocation - * takes precedence. This method has no effect if called after the event - * has been dispatched. If called from a subclass of the - * Event interface only the values specified in this method - * are modified, all other attributes are left unchanged. - *
This method sets the Event.type attribute to - * eventTypeArg, and Event.namespaceURI to - * null. To initialize an event with a namespace URI, use - * the Event.initEventNS(namespaceURIArg, eventTypeArg, ...) - * method. - * @param eventTypeArg Specifies Event.type. - * @param canBubbleArg Specifies Event.bubbles. This - * parameter overrides the intrinsic bubbling behavior of the event. - * @param cancelableArg Specifies Event.cancelable. This - * parameter overrides the intrinsic cancelable behavior of the event. - */ - public void initEvent(String eventTypeArg, - boolean canBubbleArg, - boolean cancelableArg); - - /** - * The namespace URI associated with this event at creation time, or - * null if it is unspecified. - *
For events initialized with a DOM Level 2 Events method, such as - * Event.initEvent(), this is always null. - * @since DOM Level 3 - */ - public String getNamespaceURI(); - - /** - * This method will always return false, unless the event - * implements the CustomEvent interface. - * @return false, unless the event object implements the - * CustomEvent interface. - * @since DOM Level 3 - */ - public boolean isCustom(); - - /** - * This method is used to prevent event listeners of the same group to be - * triggered and, unlike stopPropagation its effect is - * immediate (see ). Once it has been called, further calls to that - * method have no additional effect. - *

Note: This method does not prevent the default action from - * being invoked; use Event.preventDefault() for that - * effect. - * @since DOM Level 3 - */ - public void stopImmediatePropagation(); - - /** - * This method will return true if the method - * Event.preventDefault() has been called for this event, - * false otherwise. - * @return true if Event.preventDefault() has - * been called for this event. - * @since DOM Level 3 - */ - public boolean isDefaultPrevented(); - - /** - * The initEventNS method is used to initialize the value of - * an Event object and has the same behavior as - * Event.initEvent(). - * @param namespaceURIArg Specifies Event.namespaceuRI, the - * namespace URI associated with this event, or null if - * no namespace. - * @param eventTypeArg Specifies Event.type, the local name - * of the event type. - * @param canBubbleArg Refer to the Event.initEvent() - * method for a description of this parameter. - * @param cancelableArg Refer to the Event.initEvent() - * method for a description of this parameter. - * @since DOM Level 3 - */ - public void initEventNS(String namespaceURIArg, - String eventTypeArg, - boolean canBubbleArg, - boolean cancelableArg); - -} diff --git a/src/bind/java/org/w3c/dom/events/EventException.java b/src/bind/java/org/w3c/dom/events/EventException.java deleted file mode 100644 index 51763b46b..000000000 --- a/src/bind/java/org/w3c/dom/events/EventException.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2003 World Wide Web Consortium, - * - * (Massachusetts Institute of Technology, European Research Consortium for - * Informatics and Mathematics, Keio University). All Rights Reserved. This - * work is distributed under the W3C(r) Software License [1] in the hope that - * it will be useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 - */ - -package org.w3c.dom.events; - -/** - * Event operations may throw an EventException as specified in - * their method descriptions. - *

See also the Document Object Model (DOM) Level 3 Events Specification. - * @since DOM Level 2 - */ -public class EventException extends RuntimeException { - public EventException(short code, String message) { - super(message); - this.code = code; - } - public short code; - // EventExceptionCode - /** - * If the Event.type was not specified by initializing the - * event before the method was called. Specification of the - * Event.type as null or an empty string will - * also trigger this exception. - */ - public static final short UNSPECIFIED_EVENT_TYPE_ERR = 0; - /** - * If the Event object is already dispatched in the tree. - * @since DOM Level 3 - */ - public static final short DISPATCH_REQUEST_ERR = 1; - -} diff --git a/src/bind/java/org/w3c/dom/events/EventListener.java b/src/bind/java/org/w3c/dom/events/EventListener.java deleted file mode 100644 index a5102b130..000000000 --- a/src/bind/java/org/w3c/dom/events/EventListener.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2003 World Wide Web Consortium, - * - * (Massachusetts Institute of Technology, European Research Consortium for - * Informatics and Mathematics, Keio University). All Rights Reserved. This - * work is distributed under the W3C(r) Software License [1] in the hope that - * it will be useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 - */ - -package org.w3c.dom.events; - -/** - * The EventListener interface is the primary way for handling - * events. Users implement the EventListener interface and - * register their event listener on an EventTarget. The users - * should also remove their EventListener from its - * EventTarget after they have completed using the listener. - *

Copying a Node, with methods such as - * Node.cloneNode or Range.cloneContents, does not - * copy the event listeners attached to it. Event listeners must be attached - * to the newly created Node afterwards if so desired. - *

Moving a Node, with methods Document.adoptNode - * , Node.appendChild, or Range.extractContents, - * does not affect the event listeners attached to it. - *

See also the Document Object Model (DOM) Level 3 Events Specification. - * @since DOM Level 2 - */ -public interface EventListener { - /** - * This method is called whenever an event occurs of the event type for - * which the EventListener interface was registered. - * @param evt The Event contains contextual information - * about the event. - */ - public void handleEvent(Event evt); - -} diff --git a/src/bind/java/org/w3c/dom/events/EventTarget.java b/src/bind/java/org/w3c/dom/events/EventTarget.java deleted file mode 100644 index 1be6edace..000000000 --- a/src/bind/java/org/w3c/dom/events/EventTarget.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright (c) 2003 World Wide Web Consortium, - * - * (Massachusetts Institute of Technology, European Research Consortium for - * Informatics and Mathematics, Keio University). All Rights Reserved. This - * work is distributed under the W3C(r) Software License [1] in the hope that - * it will be useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 - */ - -package org.w3c.dom.events; - -/** - * The EventTarget interface is implemented by all the objects - * which could be event targets in an implementation which supports the . - * The interface allows registration, removal or query of event listeners, - * and dispatch of events to an event target. - *

When used with , this interface is implemented by all target nodes and - * target ancestors, i.e. all DOM Nodes of the tree support - * this interface when the implementation conforms to DOM Level 3 Events - * and, therefore, this interface can be obtained by using binding-specific - * casting methods on an instance of the Node interface. - *

Invoking addEventListener or - * addEventListenerNS multiple times on the same - * EventTarget with the same parameters ( - * namespaceURI, type, listener, and - * useCapture) is considered to be a no-op and thus - * independently of the event group. They do not cause the - * EventListener to be called more than once and do not cause a - * change in the triggering order. In order to guarantee that an event - * listener will be added to the event target for the specified event group, - * one needs to invoke removeEventListener or - * removeEventListenerNS first. - *

See also the Document Object Model (DOM) Level 3 Events Specification. - * @since DOM Level 2 - */ -public interface EventTarget { - /** - * This method allows the registration of an event listener in the - * default group and, depending on the useCapture - * parameter, on the capture phase of the DOM event flow or its target - * and bubbling phases. - * @param type Specifies the Event.type associated with the - * event for which the user is registering. - * @param listener The listener parameter takes an object - * implemented by the user which implements the - * EventListener interface and contains the method to be - * called when the event occurs. - * @param useCapture If true, useCapture indicates that the - * user wishes to add the event listener for the capture phase only, - * i.e. this event listener will not be triggered during the target - * and bubbling phases. If false, the event listener will - * only be triggered during the target and bubbling phases. - */ - public void addEventListener(String type, - EventListener listener, - boolean useCapture); - - /** - * This method allows the removal of event listeners from the default - * group. - *
Calling removeEventListener with arguments which do - * not identify any currently registered EventListener on - * the EventTarget has no effect. - * @param type Specifies the Event.type for which the user - * registered the event listener. - * @param listener The EventListener to be removed. - * @param useCapture Specifies whether the EventListener - * being removed was registered for the capture phase or not. If a - * listener was registered twice, once for the capture phase and once - * for the target and bubbling phases, each must be removed - * separately. Removal of an event listener registered for the capture - * phase does not affect the same event listener registered for the - * target and bubbling phases, and vice versa. - */ - public void removeEventListener(String type, - EventListener listener, - boolean useCapture); - - /** - * This method allows the dispatch of events into the implementation's - * event model. The event target of the event is the - * EventTarget object on which dispatchEvent - * is called. - * @param evt The event to be dispatched. - * @return Indicates whether any of the listeners which handled the - * event called Event.preventDefault(). If - * Event.preventDefault() was called the returned value - * is false, else it is true. - * @exception EventException - * UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event.type - * was not specified by initializing the event before - * dispatchEvent was called. Specification of the - * Event.type as null or an empty string - * will also trigger this exception. - *
DISPATCH_REQUEST_ERR: Raised if the Event object is - * already being dispatched in the tree. - *
NOT_SUPPORTED_ERR: Raised if the Event object has - * not been created using DocumentEvent.createEvent() or - * does not support the interface CustomEvent. - * @version DOM Level 3 - */ - public boolean dispatchEvent(Event evt) - throws EventException; - - /** - * This method allows the registration of an event listener in a - * specified group or the default group and, depending on the - * useCapture parameter, on the capture phase of the DOM - * event flow or its target and bubbling phases. - * @param namespaceURI Specifies the Event.namespaceURI - * associated with the event for which the user is registering. - * @param type Specifies the Event.type associated with the - * event for which the user is registering. - * @param listener The listener parameter takes an object - * implemented by the user which implements the - * EventListener interface and contains the method to be - * called when the event occurs. - * @param useCapture If true, useCapture indicates that the - * user wishes to add the event listener for the capture phase only, - * i.e. this event listener will not be triggered during the target - * and bubbling phases. If false, the event listener will - * only be triggered during the target and bubbling phases. - * @param evtGroup The object that represents the event group to - * associate with the EventListener (see also ). Use - * null to attach the event listener to the default - * group. - * @since DOM Level 3 - */ - public void addEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture, - Object evtGroup); - - /** - * This method allows the removal of an event listener, independently of - * the associated event group. - *
Calling removeEventListenerNS with arguments which do - * not identify any currently registered EventListener on - * the EventTarget has no effect. - * @param namespaceURI Specifies the Event.namespaceURI - * associated with the event for which the user registered the event - * listener. - * @param type Specifies the Event.type associated with the - * event for which the user registered the event listener. - * @param listener The EventListener parameter indicates - * the EventListener to be removed. - * @param useCapture Specifies whether the EventListener - * being removed was registered for the capture phase or not. If a - * listener was registered twice, once for the capture phase and once - * for the target and bubbling phases, each must be removed - * separately. Removal of an event listener registered for the capture - * phase does not affect the same event listener registered for the - * target and bubbling phases, and vice versa. - * @since DOM Level 3 - */ - public void removeEventListenerNS(String namespaceURI, - String type, - EventListener listener, - boolean useCapture); - - /** - * This method allows the DOM application to know if an event listener, - * attached to this EventTarget or one of its ancestors, - * will be triggered by the specified event type during the dispatch of - * the event to this event target or one of its descendants. - * @param namespaceURI Specifies the Event.namespaceURI - * associated with the event. - * @param type Specifies the Event.type associated with the - * event. - * @return true if an event listener will be triggered on - * the EventTarget with the specified event type, - * false otherwise. - * @since DOM Level 3 - */ - public boolean willTriggerNS(String namespaceURI, - String type); - - /** - * This method allows the DOM application to know if this - * EventTarget contains an event listener registered for - * the specified event type. This is useful for determining at which - * nodes within a hierarchy altered handling of specific event types has - * been introduced, but should not be used to determine whether the - * specified event type triggers an event listener (see - * EventTarget.willTriggerNS()). - * @param namespaceURI Specifies the Event.namespaceURI - * associated with the event. - * @param type Specifies the Event.type associated with the - * event. - * @return true if an event listener is registered on this - * EventTarget for the specified event type, - * false otherwise. - * @since DOM Level 3 - */ - public boolean hasEventListenerNS(String namespaceURI, - String type); - -} diff --git a/src/bind/java/org/w3c/dom/events/KeyboardEvent.java b/src/bind/java/org/w3c/dom/events/KeyboardEvent.java deleted file mode 100644 index e166f5f77..000000000 --- a/src/bind/java/org/w3c/dom/events/KeyboardEvent.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (c) 2003 World Wide Web Consortium, - * - * (Massachusetts Institute of Technology, European Research Consortium for - * Informatics and Mathematics, Keio University). All Rights Reserved. This - * work is distributed under the W3C(r) Software License [1] in the hope that - * it will be useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 - */ - -package org.w3c.dom.events; - -import org.w3c.dom.views.AbstractView; - -/** - * The KeyboardEvent interface provides specific contextual - * information associated with keyboard devices. Each keyboard event - * references a key using an identifier. Keyboard events are commonly - * directed at the element that has the focus. - *

The KeyboardEvent interface provides convenient attributes - * for some common modifiers keys: KeyboardEvent.ctrlKey, - * KeyboardEvent.shiftKey, KeyboardEvent.altKey, - * KeyboardEvent.metaKey. These attributes are equivalent to - * use the method - * KeyboardEvent.getModifierState(keyIdentifierArg) with - * "Control", "Shift", "Alt", or "Meta" respectively. - *

To create an instance of the KeyboardEvent interface, use - * the DocumentEvent.createEvent("KeyboardEvent") method call. - *

See also the Document Object Model (DOM) Level 3 Events Specification. - * @since DOM Level 3 - */ -public interface KeyboardEvent extends UIEvent { - // KeyLocationCode - /** - * The key activation is not distinguished as the left or right version - * of the key, and did not originate from the numeric keypad (or did not - * originate with a virtual key corresponding to the numeric keypad). - * Example: the 'Q' key on a PC 101 Key US keyboard. - */ - public static final int DOM_KEY_LOCATION_STANDARD = 0x00; - /** - * The key activated is in the left key location (there is more than one - * possible location for this key). Example: the left Shift key on a PC - * 101 Key US keyboard. - */ - public static final int DOM_KEY_LOCATION_LEFT = 0x01; - /** - * The key activation is in the right key location (there is more than - * one possible location for this key). Example: the right Shift key on - * a PC 101 Key US keyboard. - */ - public static final int DOM_KEY_LOCATION_RIGHT = 0x02; - /** - * The key activation originated on the numeric keypad or with a virtual - * key corresponding to the numeric keypad. Example: the '1' key on a PC - * 101 Key US keyboard located on the numeric pad. - */ - public static final int DOM_KEY_LOCATION_NUMPAD = 0x03; - - /** - * keyIdentifier holds the identifier of the key. The key - * identifiers are defined in Appendix A.2 "". Implementations that are - * unable to identify a key must use the key identifier - * "Unidentified". - */ - public String getKeyIdentifier(); - - /** - * The keyLocation attribute contains an indication of the - * location of they key on the device, as described in . - */ - public int getKeyLocation(); - - /** - * true if the control (Ctrl) key modifier is activated. - */ - public boolean getCtrlKey(); - - /** - * true if the shift (Shift) key modifier is activated. - */ - public boolean getShiftKey(); - - /** - * true if the alternative (Alt) key modifier is activated. - *

Note: The Option key modifier on Macintosh systems must be - * represented using this key modifier. - */ - public boolean getAltKey(); - - /** - * true if the meta (Meta) key modifier is activated. - *

Note: The Command key modifier on Macintosh systems must be - * represented using this key modifier. - */ - public boolean getMetaKey(); - - /** - * This methods queries the state of a modifier using a key identifier. - * See also . - * @param keyIdentifierArg A modifier key identifier. Common modifier - * keys are "Alt", "AltGraph", - * "CapsLock", "Control", "Meta" - * , "NumLock", "Scroll", or - * "Shift". - *

Note: If an application wishes to distinguish between - * right and left modifiers, this information could be deduced using - * keyboard events and KeyboardEvent.keyLocation. - * @return true if it is modifier key and the modifier is - * activated, false otherwise. - */ - public boolean getModifierState(String keyIdentifierArg); - - /** - * The initKeyboardEvent method is used to initialize the - * value of a KeyboardEvent object and has the same - * behavior as UIEvent.initUIEvent(). The value of - * UIEvent.detail remains undefined. - * @param typeArg Refer to the UIEvent.initUIEvent() method - * for a description of this parameter. - * @param canBubbleArg Refer to the UIEvent.initUIEvent() - * method for a description of this parameter. - * @param cancelableArg Refer to the UIEvent.initUIEvent() - * method for a description of this parameter. - * @param viewArg Refer to the UIEvent.initUIEvent() method - * for a description of this parameter. - * @param keyIdentifierArg Specifies - * KeyboardEvent.keyIdentifier. - * @param keyLocationArg Specifies KeyboardEvent.keyLocation - * . - * @param modifiersList A white space separated list of modifier key identifiers to be activated on this - * object. - */ - public void initKeyboardEvent(String typeArg, - boolean canBubbleArg, - boolean cancelableArg, - AbstractView viewArg, - String keyIdentifierArg, - int keyLocationArg, - String modifiersList); - - /** - * The initKeyboardEventNS method is used to initialize the - * value of a KeyboardEvent object and has the same - * behavior as UIEvent.initUIEventNS(). The value of - * UIEvent.detail remains undefined. - * @param namespaceURI Refer to the UIEvent.initUIEventNS() - * method for a description of this parameter. - * @param typeArg Refer to the UIEvent.initUIEventNS() - * method for a description of this parameter. - * @param canBubbleArg Refer to the UIEvent.initUIEventNS() - * method for a description of this parameter. - * @param cancelableArg Refer to the UIEvent.initUIEventNS() - * method for a description of this parameter. - * @param viewArg Refer to the UIEvent.initUIEventNS() - * method for a description of this parameter. - * @param keyIdentifierArg Refer to the - * KeyboardEvent.initKeyboardEvent() method for a - * description of this parameter. - * @param keyLocationArg Refer to the - * KeyboardEvent.initKeyboardEvent() method for a - * description of this parameter. - * @param modifiersList A white space separated list of modifier key identifiers to be activated on this - * object. As an example, "Control Alt" will activated - * the control and alt modifiers. - */ - public void initKeyboardEventNS(String namespaceURI, - String typeArg, - boolean canBubbleArg, - boolean cancelableArg, - AbstractView viewArg, - String keyIdentifierArg, - int keyLocationArg, - String modifiersList); - -} diff --git a/src/bind/java/org/w3c/dom/events/MouseEvent.java b/src/bind/java/org/w3c/dom/events/MouseEvent.java deleted file mode 100644 index 9877e8dbc..000000000 --- a/src/bind/java/org/w3c/dom/events/MouseEvent.java +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Copyright (c) 2003 World Wide Web Consortium, - * - * (Massachusetts Institute of Technology, European Research Consortium for - * Informatics and Mathematics, Keio University). All Rights Reserved. This - * work is distributed under the W3C(r) Software License [1] in the hope that - * it will be useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 - */ - -package org.w3c.dom.events; - -import org.w3c.dom.views.AbstractView; - -/** - * The MouseEvent interface provides specific contextual - * information associated with Mouse events. - *

In the case of nested elements mouse events are always targeted at the - * most deeply nested element. Ancestors of the targeted element may use - * bubbling to obtain notification of mouse events which occur within theirs - * descendent elements. - *

To create an instance of the MouseEvent interface, use the - * DocumentEvent.createEvent("MouseEvent") method call. - *

Note: When initializing MouseEvent objects using - * initMouseEvent or initMouseEventNS, - * implementations should use the client coordinates clientX - * and clientY for calculation of other coordinates (such as - * target coordinates exposed by DOM Level 0 implementations). - *

See also the Document Object Model (DOM) Level 3 Events Specification. - * @since DOM Level 2 - */ -public interface MouseEvent extends UIEvent { - /** - * The horizontal coordinate at which the event occurred relative to the - * origin of the screen coordinate system. - */ - public int getScreenX(); - - /** - * The vertical coordinate at which the event occurred relative to the - * origin of the screen coordinate system. - */ - public int getScreenY(); - - /** - * The horizontal coordinate at which the event occurred relative to the - * DOM implementation's client area. - */ - public int getClientX(); - - /** - * The vertical coordinate at which the event occurred relative to the DOM - * implementation's client area. - */ - public int getClientY(); - - /** - * true if the control (Ctrl) key modifier is activated. - */ - public boolean getCtrlKey(); - - /** - * true if the shift (Shift) key modifier is activated. - */ - public boolean getShiftKey(); - - /** - * true if the alt (alternative) key modifier is activated. - *

Note: The Option key modifier on Macintosh systems must be - * represented using this key modifier. - */ - public boolean getAltKey(); - - /** - * true if the meta (Meta) key modifier is activated. - *

Note: The Command key modifier on Macintosh system must be - * represented using this meta key. - */ - public boolean getMetaKey(); - - /** - * During mouse events caused by the depression or release of a mouse - * button, button is used to indicate which mouse button - * changed state. 0 indicates the normal button of the - * mouse (in general on the left or the one button on Macintosh mice, - * used to activate a button or select text). 2 indicates - * the contextual property (in general on the right, used to display a - * context menu) button of the mouse if present. 1 - * indicates the extra (in general in the middle and often combined with - * the mouse wheel) button. Some mice may provide or simulate more - * buttons, and values higher than 2 can be used to - * represent such buttons. - */ - public short getButton(); - - /** - * Used to identify a secondary EventTarget related to a UI - * event. Currently this attribute is used with the mouseover event to - * indicate the EventTarget which the pointing device - * exited and with the mouseout event to indicate the - * EventTarget which the pointing device entered. - */ - public EventTarget getRelatedTarget(); - - /** - * The initMouseEvent method is used to initialize the value - * of a MouseEvent object and has the same behavior as - * UIEvent.initUIEvent(). - * @param typeArg Refer to the UIEvent.initUIEvent() method - * for a description of this parameter. - * @param canBubbleArg Refer to the UIEvent.initUIEvent() - * method for a description of this parameter. - * @param cancelableArg Refer to the UIEvent.initUIEvent() - * method for a description of this parameter. - * @param viewArg Refer to the UIEvent.initUIEvent() method - * for a description of this parameter. - * @param detailArg Refer to the UIEvent.initUIEvent() - * method for a description of this parameter. - * @param screenXArg Specifies MouseEvent.screenX. - * @param screenYArg Specifies MouseEvent.screenY. - * @param clientXArg Specifies MouseEvent.clientX. - * @param clientYArg Specifies MouseEvent.clientY. - * @param ctrlKeyArg Specifies MouseEvent.ctrlKey. - * @param altKeyArg Specifies MouseEvent.altKey. - * @param shiftKeyArg Specifies MouseEvent.shiftKey. - * @param metaKeyArg Specifies MouseEvent.metaKey. - * @param buttonArg Specifies MouseEvent.button. - * @param relatedTargetArg Specifies - * MouseEvent.relatedTarget. - */ - public void initMouseEvent(String typeArg, - boolean canBubbleArg, - boolean cancelableArg, - AbstractView viewArg, - int detailArg, - int screenXArg, - int screenYArg, - int clientXArg, - int clientYArg, - boolean ctrlKeyArg, - boolean altKeyArg, - boolean shiftKeyArg, - boolean metaKeyArg, - short buttonArg, - EventTarget relatedTargetArg); - - /** - * This methods queries the state of a modifier using a key identifier. - * See also . - * @param keyIdentifierArg A modifier key identifier, as defined by the - * KeyboardEvent.keyIdentifier attribute. Common modifier - * keys are "Alt", "AltGraph", - * "CapsLock", "Control", "Meta" - * , "NumLock", "Scroll", or - * "Shift". - *

Note: If an application wishes to distinguish between - * right and left modifiers, this information could be deduced using - * keyboard events and KeyboardEvent.keyLocation. - * @return true if it is modifier key and the modifier is - * activated, false otherwise. - * @since DOM Level 3 - */ - public boolean getModifierState(String keyIdentifierArg); - - /** - * The initMouseEventNS method is used to initialize the - * value of a MouseEvent object and has the same behavior - * as UIEvent.initUIEventNS(). - * @param namespaceURI Refer to the UIEvent.initUIEventNS() - * method for a description of this parameter. - * @param typeArg Refer to the UIEvent.initUIEventNS() - * method for a description of this parameter. - * @param canBubbleArg Refer to the UIEvent.initUIEventNS() - * method for a description of this parameter. - * @param cancelableArg Refer to the UIEvent.initUIEventNS() - * method for a description of this parameter. - * @param viewArg Refer to the UIEvent.initUIEventNS() - * method for a description of this parameter. - * @param detailArg Refer to the UIEvent.initUIEventNS() - * method for a description of this parameter. - * @param screenXArg Refer to the - * MouseEvent.initMouseEvent() method for a description - * of this parameter. - * @param screenYArg Refer to the - * MouseEvent.initMouseEvent() method for a description - * of this parameter. - * @param clientXArg Refer to the - * MouseEvent.initMouseEvent() method for a description - * of this parameter. - * @param clientYArg Refer to the - * MouseEvent.initMouseEvent() method for a description - * of this parameter. - * @param buttonArg Refer to the MouseEvent.initMouseEvent() - * method for a description of this parameter. - * @param relatedTargetArg Refer to the - * MouseEvent.initMouseEvent() method for a description - * of this parameter. - * @param modifiersList A white space separated list of modifier key identifiers to be activated on this - * object. As an example, "Control Alt" will activated - * the control and alt modifiers. - * @since DOM Level 3 - */ - public void initMouseEventNS(String namespaceURI, - String typeArg, - boolean canBubbleArg, - boolean cancelableArg, - AbstractView viewArg, - int detailArg, - int screenXArg, - int screenYArg, - int clientXArg, - int clientYArg, - short buttonArg, - EventTarget relatedTargetArg, - String modifiersList); - -} diff --git a/src/bind/java/org/w3c/dom/events/MutationEvent.java b/src/bind/java/org/w3c/dom/events/MutationEvent.java deleted file mode 100644 index 12d8b2f6b..000000000 --- a/src/bind/java/org/w3c/dom/events/MutationEvent.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (c) 2003 World Wide Web Consortium, - * - * (Massachusetts Institute of Technology, European Research Consortium for - * Informatics and Mathematics, Keio University). All Rights Reserved. This - * work is distributed under the W3C(r) Software License [1] in the hope that - * it will be useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 - */ - -package org.w3c.dom.events; - -import org.w3c.dom.Node; - -/** - * The MutationEvent interface provides specific contextual - * information associated with Mutation events. - *

To create an instance of the MutationEvent interface, use - * the DocumentEvent.createEvent("MutationEvent") method call. - *

See also the Document Object Model (DOM) Level 3 Events Specification. - * @since DOM Level 2 - */ -public interface MutationEvent extends Event { - // attrChangeType - /** - * The Attr was modified in place. - */ - public static final short MODIFICATION = 1; - /** - * The Attr was just added. - */ - public static final short ADDITION = 2; - /** - * The Attr was just removed. - */ - public static final short REMOVAL = 3; - - /** - * relatedNode is used to identify a secondary node related - * to a mutation event. For example, if a mutation event is dispatched - * to a node indicating that its parent has changed, the - * relatedNode is the changed parent. If an event is - * instead dispatched to a subtree indicating a node was changed within - * it, the relatedNode is the changed node. In the case of - * the - * {"http://www.w3.org/2001/xml-events", "DOMAttrModified"} - * event it indicates the Attr node which was modified, - * added, or removed. - */ - public Node getRelatedNode(); - - /** - * prevValue indicates the previous value of the - * Attr node in - * {"http://www.w3.org/2001/xml-events", "DOMAttrModified"} - * events, and of the CharacterData node in - * {"http://www.w3.org/2001/xml-events", "DOMCharacterDataModified"} - * events. - */ - public String getPrevValue(); - - /** - * newValue indicates the new value of the Attr - * node in - * {"http://www.w3.org/2001/xml-events", "DOMAttrModified"} - * events, and of the CharacterData node in - * {"http://www.w3.org/2001/xml-events", "DOMCharacterDataModified"} - * events. - */ - public String getNewValue(); - - /** - * attrName indicates the name of the changed - * Attr node in a - * {"http://www.w3.org/2001/xml-events", "DOMAttrModified"} - * event. - */ - public String getAttrName(); - - /** - * attrChange indicates the type of change which triggered - * the - * {"http://www.w3.org/2001/xml-events", "DOMAttrModified"} - * event. The values can be MODIFICATION, - * ADDITION, or REMOVAL. - */ - public short getAttrChange(); - - /** - * The initMutationEvent method is used to initialize the - * value of a MutationEvent object and has the same - * behavior as Event.initEvent(). - * @param typeArg Refer to the Event.initEvent() method for - * a description of this parameter. - * @param canBubbleArg Refer to the Event.initEvent() - * method for a description of this parameter. - * @param cancelableArg Refer to the Event.initEvent() - * method for a description of this parameter. - * @param relatedNodeArg Specifies MutationEvent.relatedNode - * . - * @param prevValueArg Specifies MutationEvent.prevValue. - * This value may be null. - * @param newValueArg Specifies MutationEvent.newValue. - * This value may be null. - * @param attrNameArg Specifies MutationEvent.attrname. - * This value may be null. - * @param attrChangeArg Specifies MutationEvent.attrChange. - * This value may be null. - */ - public void initMutationEvent(String typeArg, - boolean canBubbleArg, - boolean cancelableArg, - Node relatedNodeArg, - String prevValueArg, - String newValueArg, - String attrNameArg, - short attrChangeArg); - - /** - * The initMutationEventNS method is used to initialize the - * value of a MutationEvent object and has the same - * behavior as Event.initEventNS(). - * @param namespaceURI Refer to the Event.initEventNS() - * method for a description of this parameter. - * @param typeArg Refer to the Event.initEventNS() method - * for a description of this parameter. - * @param canBubbleArg Refer to the Event.initEventNS() - * method for a description of this parameter. - * @param cancelableArg Refer to the Event.initEventNS() - * method for a description of this parameter. - * @param relatedNodeArg Refer to the - * MutationEvent.initMutationEvent() method for a - * description of this parameter. - * @param prevValueArg Refer to the - * MutationEvent.initMutationEvent() method for a - * description of this parameter. - * @param newValueArg Refer to the - * MutationEvent.initMutationEvent() method for a - * description of this parameter. - * @param attrNameArg Refer to the - * MutationEvent.initMutationEvent() method for a - * description of this parameter. - * @param attrChangeArg Refer to the - * MutationEvent.initMutationEvent() method for a - * description of this parameter. - * @since DOM Level 3 - */ - public void initMutationEventNS(String namespaceURI, - String typeArg, - boolean canBubbleArg, - boolean cancelableArg, - Node relatedNodeArg, - String prevValueArg, - String newValueArg, - String attrNameArg, - short attrChangeArg); - -} diff --git a/src/bind/java/org/w3c/dom/events/MutationNameEvent.java b/src/bind/java/org/w3c/dom/events/MutationNameEvent.java deleted file mode 100644 index f5c217198..000000000 --- a/src/bind/java/org/w3c/dom/events/MutationNameEvent.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2003 World Wide Web Consortium, - * - * (Massachusetts Institute of Technology, European Research Consortium for - * Informatics and Mathematics, Keio University). All Rights Reserved. This - * work is distributed under the W3C(r) Software License [1] in the hope that - * it will be useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 - */ - -package org.w3c.dom.events; - -import org.w3c.dom.Node; - -/** - * The MutationNameEvent interface provides specific contextual - * information associated with Mutation name event types. - *

To create an instance of the MutationNameEvent interface, - * use the Document.createEvent("MutationNameEvent") method - * call. - *

See also the Document Object Model (DOM) Level 3 Events Specification. - * @since DOM Level 3 - */ -public interface MutationNameEvent extends MutationEvent { - /** - * The previous value of the relatedNode's - * namespaceURI. - */ - public String getPrevNamespaceURI(); - - /** - * The previous value of the relatedNode's - * nodeName. - */ - public String getPrevNodeName(); - - /** - * The initMutationNameEvent method is used to initialize - * the value of a MutationNameEvent object and has the same - * behavior as MutationEvent.initMutationEvent(). - * @param typeArg Refer to the - * MutationEvent.initMutationEvent() method for a - * description of this parameter. - * @param canBubbleArg Refer to the - * MutationEvent.initMutationEvent() method for a - * description of this parameter. - * @param cancelableArg Refer to the - * MutationEvent.initMutationEvent() method for a - * description of this parameter. - * @param relatedNodeArg Refer to the - * MutationEvent.initMutationEvent() method for a - * description of this parameter. - * @param prevNamespaceURIArg Specifies - * MutationNameEvent.prevNamespaceURI. This value may be - * null. - * @param prevNodeNameArg Specifies - * MutationNameEvent.prevNodeName. - * @since DOM Level 3 - */ - public void initMutationNameEvent(String typeArg, - boolean canBubbleArg, - boolean cancelableArg, - Node relatedNodeArg, - String prevNamespaceURIArg, - String prevNodeNameArg); - - /** - * The initMutationNameEventNS method is used to initialize - * the value of a MutationNameEvent object and has the same - * behavior as MutationEvent.initMutationEventNS(). - * @param namespaceURI Refer to the - * MutationEvent.initMutationEventNS() method for a - * description of this parameter. - * @param typeArg Refer to the - * MutationEvent.initMutationEventNS() method for a - * description of this parameter. - * @param canBubbleArg Refer to the - * MutationEvent.initMutationEventNS() method for a - * description of this parameter. - * @param cancelableArg Refer to the - * MutationEvent.initMutationEventNS() method for a - * description of this parameter. - * @param relatedNodeArg Refer to the - * MutationEvent.initMutationEventNS() method for a - * description of this parameter. - * @param prevNamespaceURIArg Refer to the - * MutationEvent.initMutationEvent() method for a - * description of this parameter. - * @param prevNodeNameArg Refer to the - * MutationEvent.initMutationEvent() method for a - * description of this parameter. - * @since DOM Level 3 - */ - public void initMutationNameEventNS(String namespaceURI, - String typeArg, - boolean canBubbleArg, - boolean cancelableArg, - Node relatedNodeArg, - String prevNamespaceURIArg, - String prevNodeNameArg); - -} diff --git a/src/bind/java/org/w3c/dom/events/TextEvent.java b/src/bind/java/org/w3c/dom/events/TextEvent.java deleted file mode 100644 index 4ba5f5abf..000000000 --- a/src/bind/java/org/w3c/dom/events/TextEvent.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2003 World Wide Web Consortium, - * - * (Massachusetts Institute of Technology, European Research Consortium for - * Informatics and Mathematics, Keio University). All Rights Reserved. This - * work is distributed under the W3C(r) Software License [1] in the hope that - * it will be useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 - */ - -package org.w3c.dom.events; - -import org.w3c.dom.views.AbstractView; - -/** - * The TextEvent interface provides specific contextual - * information associated with Text Events. - *

To create an instance of the TextEvent interface, use the - * DocumentEvent.createEvent("TextEvent") method call. - *

See also the Document Object Model (DOM) Level 3 Events Specification. - * @since DOM Level 3 - */ -public interface TextEvent extends UIEvent { - /** - * data holds the value of the characters generated by the - * character device. This may be a single Unicode character or a - * non-empty sequence of Unicode characters [Unicode]. Characters should be normalized as defined by the Unicode - * normalization form NFC, defined in [UTR #15]. This - * attribute cannot be null or contain the empty string. - */ - public String getData(); - - /** - * The initTextEvent method is used to initialize the value - * of a TextEvent object and has the same behavior as - * UIEvent.initUIEvent(). The value of - * UIEvent.detail remains undefined. - * @param typeArg Refer to the UIEvent.initUIEvent() method - * for a description of this parameter. - * @param canBubbleArg Refer to the UIEvent.initUIEvent() - * method for a description of this parameter. - * @param cancelableArg Refer to the UIEvent.initUIEvent() - * method for a description of this parameter. - * @param viewArg Refer to the UIEvent.initUIEvent() method - * for a description of this parameter. - * @param dataArg Specifies TextEvent.data. - */ - public void initTextEvent(String typeArg, - boolean canBubbleArg, - boolean cancelableArg, - AbstractView viewArg, - String dataArg); - - /** - * The initTextEventNS method is used to initialize the - * value of a TextEvent object and has the same behavior as - * UIEvent.initUIEventNS(). The value of - * UIEvent.detail remains undefined. - * @param namespaceURI Refer to the UIEvent.initUIEventNS() - * method for a description of this parameter. - * @param type Refer to the UIEvent.initUIEventNS() method - * for a description of this parameter. - * @param canBubbleArg Refer to the UIEvent.initUIEventNS() - * method for a description of this parameter. - * @param cancelableArg Refer to the UIEvent.initUIEventNS() - * method for a description of this parameter. - * @param viewArg Refer to the UIEvent.initUIEventNS() - * method for a description of this parameter. - * @param dataArg Refer to the TextEvent.initTextEvent() - * method for a description of this parameter. - */ - public void initTextEventNS(String namespaceURI, - String type, - boolean canBubbleArg, - boolean cancelableArg, - AbstractView viewArg, - String dataArg); - -} diff --git a/src/bind/java/org/w3c/dom/events/UIEvent.java b/src/bind/java/org/w3c/dom/events/UIEvent.java deleted file mode 100644 index e4a819c73..000000000 --- a/src/bind/java/org/w3c/dom/events/UIEvent.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2003 World Wide Web Consortium, - * - * (Massachusetts Institute of Technology, European Research Consortium for - * Informatics and Mathematics, Keio University). All Rights Reserved. This - * work is distributed under the W3C(r) Software License [1] in the hope that - * it will be useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 - */ - -package org.w3c.dom.events; - -import org.w3c.dom.views.AbstractView; - -/** - * The UIEvent interface provides specific contextual - * information associated with User Interface events. - *

To create an instance of the UIEvent interface, use the - * DocumentEvent.createEvent("UIEvent") method call. - *

See also the Document Object Model (DOM) Level 3 Events Specification. - * @since DOM Level 2 - */ -public interface UIEvent extends Event { - /** - * The view attribute identifies the AbstractView - * from which the event was generated. - */ - public AbstractView getView(); - - /** - * Specifies some detail information about the Event, - * depending on the type of event. - */ - public int getDetail(); - - /** - * The initUIEvent method is used to initialize the value of - * a UIEvent object and has the same behavior as - * Event.initEvent(). - * @param typeArg Refer to the Event.initEvent() method for - * a description of this parameter. - * @param canBubbleArg Refer to the Event.initEvent() - * method for a description of this parameter. - * @param cancelableArg Refer to the Event.initEvent() - * method for a description of this parameter. - * @param viewArg Specifies UIEvent.view. - * @param detailArg Specifies UIEvent.detail. - */ - public void initUIEvent(String typeArg, - boolean canBubbleArg, - boolean cancelableArg, - AbstractView viewArg, - int detailArg); - - /** - * The initUIEventNS method is used to initialize the value - * of a UIEvent object and has the same behavior as - * Event.initEventNS(). - * @param namespaceURI Refer to the Event.initEventNS() - * method for a description of this parameter. - * @param typeArg Refer to the Event.initEventNS() method - * for a description of this parameter. - * @param canBubbleArg Refer to the Event.initEventNS() - * method for a description of this parameter. - * @param cancelableArg Refer to the Event.initEventNS() - * method for a description of this parameter. - * @param viewArg Refer to the UIEvent.initUIEvent() method - * for a description of this parameter. - * @param detailArg Refer to the UIEvent.initUIEvent() - * method for a description of this parameter. - * @since DOM Level 3 - */ - public void initUIEventNS(String namespaceURI, - String typeArg, - boolean canBubbleArg, - boolean cancelableArg, - AbstractView viewArg, - int detailArg); - -} diff --git a/src/bind/java/org/w3c/dom/smil/ElementExclusiveTimeContainer.java b/src/bind/java/org/w3c/dom/smil/ElementExclusiveTimeContainer.java deleted file mode 100644 index 84c7a14b4..000000000 --- a/src/bind/java/org/w3c/dom/smil/ElementExclusiveTimeContainer.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -import org.w3c.dom.DOMException; -import org.w3c.dom.NodeList; - -/** - * This interface defines a time container with semantics based upon par, but - * with the additional constraint that only one child element may play at a - * time. - */ -public interface ElementExclusiveTimeContainer extends ElementTimeContainer { - /** - * Controls the end of the container. Need to address thr id-ref value. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getEndSync(); - public void setEndSync(String endSync) - throws DOMException; - - /** - * This should support another method to get the ordered collection of - * paused elements (the paused stack) at a given point in time. - * @return All paused elements at the current time. - */ - public NodeList getPausedElements(); - -} - diff --git a/src/bind/java/org/w3c/dom/smil/ElementLayout.java b/src/bind/java/org/w3c/dom/smil/ElementLayout.java deleted file mode 100644 index 7f3128fae..000000000 --- a/src/bind/java/org/w3c/dom/smil/ElementLayout.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -import org.w3c.dom.DOMException; - -/** - * This interface is used by SMIL elements root-layout, top-layout and region. - * - */ -public interface ElementLayout { - /** - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getTitle(); - public void setTitle(String title) - throws DOMException; - - /** - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getBackgroundColor(); - public void setBackgroundColor(String backgroundColor) - throws DOMException; - - /** - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public int getHeight(); - public void setHeight(int height) - throws DOMException; - - /** - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public int getWidth(); - public void setWidth(int width) - throws DOMException; - -} - diff --git a/src/bind/java/org/w3c/dom/smil/ElementParallelTimeContainer.java b/src/bind/java/org/w3c/dom/smil/ElementParallelTimeContainer.java deleted file mode 100644 index a796bc7be..000000000 --- a/src/bind/java/org/w3c/dom/smil/ElementParallelTimeContainer.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -import org.w3c.dom.DOMException; - -/** - * A parallel container defines a simple parallel time grouping - * in which multiple elements can play back at the same time. It may have to - * specify a repeat iteration. (?) - */ -public interface ElementParallelTimeContainer extends ElementTimeContainer { - /** - * Controls the end of the container. Need to address thr id-ref value. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getEndSync(); - public void setEndSync(String endSync) - throws DOMException; - - /** - * This method returns the implicit duration in seconds. - * @return The implicit duration in seconds or -1 if the implicit is - * unknown (indefinite?). - */ - public float getImplicitDuration(); - -} - diff --git a/src/bind/java/org/w3c/dom/smil/ElementSequentialTimeContainer.java b/src/bind/java/org/w3c/dom/smil/ElementSequentialTimeContainer.java deleted file mode 100644 index bca584164..000000000 --- a/src/bind/java/org/w3c/dom/smil/ElementSequentialTimeContainer.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -/** - * A seq container defines a sequence of elements in which - * elements play one after the other. - */ -public interface ElementSequentialTimeContainer extends ElementTimeContainer { -} - diff --git a/src/bind/java/org/w3c/dom/smil/ElementSyncBehavior.java b/src/bind/java/org/w3c/dom/smil/ElementSyncBehavior.java deleted file mode 100644 index e75feccc0..000000000 --- a/src/bind/java/org/w3c/dom/smil/ElementSyncBehavior.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -/** - * The synchronization behavior extension. - */ -public interface ElementSyncBehavior { - /** - * The runtime synchronization behavior for an element. - */ - public String getSyncBehavior(); - - /** - * The sync tolerance for the associated element. It has an effect only if - * the element has syncBehavior="locked" . - */ - public float getSyncTolerance(); - - /** - * Defines the default value for the runtime synchronization behavior for - * an element, and all descendents. - */ - public String getDefaultSyncBehavior(); - - /** - * Defines the default value for the sync tolerance for an element, and - * all descendents. - */ - public float getDefaultSyncTolerance(); - - /** - * If set to true, forces the time container playback to sync to this - * element. - */ - public boolean getSyncMaster(); - -} - diff --git a/src/bind/java/org/w3c/dom/smil/ElementTargetAttributes.java b/src/bind/java/org/w3c/dom/smil/ElementTargetAttributes.java deleted file mode 100644 index 23a37b638..000000000 --- a/src/bind/java/org/w3c/dom/smil/ElementTargetAttributes.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -/** - * This interface define the set of animation target extensions. - */ -public interface ElementTargetAttributes { - /** - * The name of the target attribute. - */ - public String getAttributeName(); - public void setAttributeName(String attributeName); - - // attributeTypes - public static final short ATTRIBUTE_TYPE_AUTO = 0; - public static final short ATTRIBUTE_TYPE_CSS = 1; - public static final short ATTRIBUTE_TYPE_XML = 2; - - /** - * A code representing the value of the attributeType attribute, as - * defined above. Default value is ATTRIBUTE_TYPE_CODE . - */ - public short getAttributeType(); - public void setAttributeType(short attributeType); - -} - diff --git a/src/bind/java/org/w3c/dom/smil/ElementTest.java b/src/bind/java/org/w3c/dom/smil/ElementTest.java deleted file mode 100644 index 78fe497d5..000000000 --- a/src/bind/java/org/w3c/dom/smil/ElementTest.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -import org.w3c.dom.DOMException; - -/** - * Defines the test attributes interface. See the Test attributes definition - * . - */ -public interface ElementTest { - /** - * The systemBitrate value. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public int getSystemBitrate(); - public void setSystemBitrate(int systemBitrate) - throws DOMException; - - /** - * The systemCaptions value. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public boolean getSystemCaptions(); - public void setSystemCaptions(boolean systemCaptions) - throws DOMException; - - /** - * The systemLanguage value. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getSystemLanguage(); - public void setSystemLanguage(String systemLanguage) - throws DOMException; - - /** - * The result of the evaluation of the systemRequired attribute. - */ - public boolean getSystemRequired(); - - /** - * The result of the evaluation of the systemScreenSize attribute. - */ - public boolean getSystemScreenSize(); - - /** - * The result of the evaluation of the systemScreenDepth attribute. - */ - public boolean getSystemScreenDepth(); - - /** - * The value of the systemOverdubOrSubtitle attribute. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getSystemOverdubOrSubtitle(); - public void setSystemOverdubOrSubtitle(String systemOverdubOrSubtitle) - throws DOMException; - - /** - * The value of the systemAudioDesc attribute. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public boolean getSystemAudioDesc(); - public void setSystemAudioDesc(boolean systemAudioDesc) - throws DOMException; - -} - diff --git a/src/bind/java/org/w3c/dom/smil/ElementTime.java b/src/bind/java/org/w3c/dom/smil/ElementTime.java deleted file mode 100644 index 715d46ac9..000000000 --- a/src/bind/java/org/w3c/dom/smil/ElementTime.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -import org.w3c.dom.DOMException; - -/** - * This interface defines the set of timing attributes that are common to all - * timed elements. - */ -public interface ElementTime { - /** - * The desired value (as a list of times) of the begin instant of this - * node. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public TimeList getBegin(); - public void setBegin(TimeList begin) - throws DOMException; - - /** - * The list of active ends for this node. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public TimeList getEnd(); - public void setEnd(TimeList end) - throws DOMException; - - /** - * The desired simple duration value of this node in seconds. Negative - * value means "indefinite". - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public float getDur(); - public void setDur(float dur) - throws DOMException; - - // restartTypes - public static final short RESTART_ALWAYS = 0; - public static final short RESTART_NEVER = 1; - public static final short RESTART_WHEN_NOT_ACTIVE = 2; - - /** - * A code representing the value of the restart attribute, as defined - * above. Default value is RESTART_ALWAYS . - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public short getRestart(); - public void setRestart(short restart) - throws DOMException; - - // fillTypes - public static final short FILL_REMOVE = 0; - public static final short FILL_FREEZE = 1; - - /** - * A code representing the value of the fill attribute, as defined - * above. Default value is FILL_REMOVE . - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public short getFill(); - public void setFill(short fill) - throws DOMException; - - /** - * The repeatCount attribute causes the element to play repeatedly - * (loop) for the specified number of times. A negative value repeat the - * element indefinitely. Default value is 0 (unspecified). - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public float getRepeatCount(); - public void setRepeatCount(float repeatCount) - throws DOMException; - - /** - * The repeatDur causes the element to play repeatedly (loop) for the - * specified duration in milliseconds. Negative means "indefinite". - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public float getRepeatDur(); - public void setRepeatDur(float repeatDur) - throws DOMException; - - /** - * Causes this element to begin the local timeline (subject to sync - * constraints). - * @return true if the method call was successful and the - * element was begun. false if the method call failed. - * Possible reasons for failure include: The element doesn't support - * the beginElement method. (the beginEvent - * attribute is not set to "undefinite" ) The element is - * already active and can't be restart when it is active. (the - * restart attribute is set to "whenNotActive" - * ) The element is active or has been active and can't be restart. - * (the restart attribute is set to "never" ). - * - */ - public boolean beginElement(); - - /** - * Causes this element to end the local timeline (subject to sync - * constraints). - * @return true if the method call was successful and the - * element was endeed. false if method call failed. - * Possible reasons for failure include: The element doesn't support - * the endElement method. (the endEvent - * attribute is not set to "undefinite" ) The element is - * not active. - */ - public boolean endElement(); - - /** - * Causes this element to pause the local timeline (subject to sync - * constraints). - */ - public void pauseElement(); - - /** - * Causes this element to resume a paused local timeline. - */ - public void resumeElement(); - - /** - * Seeks this element to the specified point on the local timeline - * (subject to sync constraints). If this is a timeline, this must seek - * the entire timeline (i.e. propagate to all timeChildren). - * @param seekTo The desired position on the local timeline in - * milliseconds. - */ - public void seekElement(float seekTo); - -} - diff --git a/src/bind/java/org/w3c/dom/smil/ElementTimeContainer.java b/src/bind/java/org/w3c/dom/smil/ElementTimeContainer.java deleted file mode 100644 index 69b39e820..000000000 --- a/src/bind/java/org/w3c/dom/smil/ElementTimeContainer.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -import org.w3c.dom.NodeList; - -/** - * This is a placeholder - subject to change. This represents generic - * timelines. - */ -public interface ElementTimeContainer extends ElementTime { - /** - * A NodeList that contains all timed childrens of this node. If there are - * no timed children, the Nodelist is empty. An iterator - * is more appropriate here than a node list but it requires Traversal - * module support. - */ - public NodeList getTimeChildren(); - - /** - * Returns a list of child elements active at the specified invocation. - * @param instant The desired position on the local timeline in - * milliseconds. - * @return List of timed child-elements active at instant. - */ - public NodeList getActiveChildrenAt(float instant); - -} - diff --git a/src/bind/java/org/w3c/dom/smil/ElementTimeControl.java b/src/bind/java/org/w3c/dom/smil/ElementTimeControl.java deleted file mode 100644 index e546b3609..000000000 --- a/src/bind/java/org/w3c/dom/smil/ElementTimeControl.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -import org.w3c.dom.DOMException; - -/** - */ -public interface ElementTimeControl { - /** - * Causes this element to begin the local timeline (subject to sync - * constraints). - * @return true if the method call was successful and the - * element was begun. false if the method call failed. - * Possible reasons for failure include: The element doesn't support - * the beginElement method. (the begin - * attribute is not set to "indefinite" ) The element is - * already active and can't be restart when it is active. (the - * restart attribute is set to "whenNotActive" - * ) The element is active or has been active and can't be restart. - * (the restart attribute is set to "never" ). - * - * @exception DOMException - * SYNTAX_ERR: The element was not defined with the appropriate syntax - * to allow beginElement calls. - */ - public boolean beginElement() - throws DOMException; - - /** - * Causes this element to begin the local timeline (subject to sync - * constraints), at the passed offset from the current time when the - * method is called. If the offset is >= 0, the semantics are - * equivalent to an event-base begin with the specified offset. If the - * offset is < 0, the semantics are equivalent to beginElement(), but - * the element active duration is evaluated as though the element had - * begun at the passed (negative) offset from the current time when the - * method is called. - * @param offset The offset in seconds at which to begin the element. - * @return true if the method call was successful and the - * element was begun. false if the method call failed. - * Possible reasons for failure include: The element doesn't support - * the beginElementAt method. (the begin - * attribute is not set to "indefinite" ) The element is - * already active and can't be restart when it is active. (the - * restart attribute is set to "whenNotActive" - * ) The element is active or has been active and can't be restart. - * (the restart attribute is set to "never" ). - * - * @exception DOMException - * SYNTAX_ERR: The element was not defined with the appropriate syntax - * to allow beginElementAt calls. - */ - public boolean beginElementAt(float offset) - throws DOMException; - - /** - * Causes this element to end the local timeline (subject to sync - * constraints). - * @return true if the method call was successful and the - * element was ended. false if method call failed. - * Possible reasons for failure include: The element doesn't support - * the endElement method. (the end attribute - * is not set to "indefinite" ) The element is not active. - * - * @exception DOMException - * SYNTAX_ERR: The element was not defined with the appropriate syntax - * to allow endElement calls. - */ - public boolean endElement() - throws DOMException; - - /** - * Causes this element to end the local timeline (subject to sync - * constraints) at the specified offset from the current time when the - * method is called. - * @param offset The offset in seconds at which to end the element. Must - * be >= 0. - * @return true if the method call was successful and the - * element was ended. false if method call failed. - * Possible reasons for failure include: The element doesn't support - * the endElementAt method. (the end - * attribute is not set to "indefinite" ) The element is - * not active. - * @exception DOMException - * SYNTAX_ERR: The element was not defined with the appropriate syntax - * to allow endElementAt calls. - */ - public boolean endElementAt(float offset) - throws DOMException; - -} - diff --git a/src/bind/java/org/w3c/dom/smil/ElementTimeManipulation.java b/src/bind/java/org/w3c/dom/smil/ElementTimeManipulation.java deleted file mode 100644 index bb83326e6..000000000 --- a/src/bind/java/org/w3c/dom/smil/ElementTimeManipulation.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -import org.w3c.dom.DOMException; - -/** - * This interface support use-cases commonly associated with animation. - * "accelerate" and "decelerate" are float values in the timing draft and - * percentage values even in this draft if both of them represent a - * percentage. - */ -public interface ElementTimeManipulation { - /** - * Defines the playback speed of element time. The value is specified as - * a multiple of normal (parent time container) play speed. Legal values - * are signed floating point values. Zero values are not allowed. The - * default is 1.0 (no modification of speed). - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public float getSpeed(); - public void setSpeed(float speed) - throws DOMException; - - /** - * The percentage value of the simple acceleration of time for the - * element. Allowed values are from 0 to 100 . - * Default value is 0 (no acceleration). - *
The sum of the values for accelerate and decelerate must not exceed - * 100. If it does, the deceleration value will be reduced to make the - * sum legal. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public float getAccelerate(); - public void setAccelerate(float accelerate) - throws DOMException; - - /** - * The percentage value of the simple decelerate of time for the - * element. Allowed values are from 0 to 100 . - * Default value is 0 (no deceleration). - *
The sum of the values for accelerate and decelerate must not exceed - * 100. If it does, the deceleration value will be reduced to make the - * sum legal. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public float getDecelerate(); - public void setDecelerate(float decelerate) - throws DOMException; - - /** - * The autoReverse attribute controls the "play forwards then backwards" - * functionality. Default value is false . - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public boolean getAutoReverse(); - public void setAutoReverse(boolean autoReverse) - throws DOMException; - -} - diff --git a/src/bind/java/org/w3c/dom/smil/SMILAnimateColorElement.java b/src/bind/java/org/w3c/dom/smil/SMILAnimateColorElement.java deleted file mode 100644 index 9bd9d13a6..000000000 --- a/src/bind/java/org/w3c/dom/smil/SMILAnimateColorElement.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -/** - * This interface represents the SMIL animateColor element. - */ -public interface SMILAnimateColorElement extends SMILAnimation { -} - diff --git a/src/bind/java/org/w3c/dom/smil/SMILAnimateElement.java b/src/bind/java/org/w3c/dom/smil/SMILAnimateElement.java deleted file mode 100644 index 9393e00c5..000000000 --- a/src/bind/java/org/w3c/dom/smil/SMILAnimateElement.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -/** - * This interface represents the SMIL animate element. - */ -public interface SMILAnimateElement extends SMILAnimation { -} - diff --git a/src/bind/java/org/w3c/dom/smil/SMILAnimateMotionElement.java b/src/bind/java/org/w3c/dom/smil/SMILAnimateMotionElement.java deleted file mode 100644 index 6a140ad9f..000000000 --- a/src/bind/java/org/w3c/dom/smil/SMILAnimateMotionElement.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -import org.w3c.dom.DOMException; - -/** - * This interface present the animationMotion element in SMIL. - */ -public interface SMILAnimateMotionElement extends SMILAnimateElement { - /** - * Specifies the curve that describes the attribute value as a function - * of time. Check with the SVG spec for better support - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getPath(); - public void setPath(String path) - throws DOMException; - - /** - * Specifies the origin of motion for the animation. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getOrigin(); - public void setOrigin(String origin) - throws DOMException; - -} - diff --git a/src/bind/java/org/w3c/dom/smil/SMILAnimation.java b/src/bind/java/org/w3c/dom/smil/SMILAnimation.java deleted file mode 100644 index 8615dfaeb..000000000 --- a/src/bind/java/org/w3c/dom/smil/SMILAnimation.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -import org.w3c.dom.DOMException; - -/** - * This interface define the set of animation extensions for SMIL. The - * attributes will go in a XLink interface. - */ -public interface SMILAnimation extends SMILElement, ElementTargetAttributes, ElementTime, ElementTimeControl { - // additiveTypes - public static final short ADDITIVE_REPLACE = 0; - public static final short ADDITIVE_SUM = 1; - - /** - * A code representing the value of the additive attribute, as defined - * above. Default value is ADDITIVE_REPLACE . - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public short getAdditive(); - public void setAdditive(short additive) - throws DOMException; - - // accumulateTypes - public static final short ACCUMULATE_NONE = 0; - public static final short ACCUMULATE_SUM = 1; - - /** - * A code representing the value of the accumulate attribute, as defined - * above. Default value is ACCUMULATE_NONE . - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public short getAccumulate(); - public void setAccumulate(short accumulate) - throws DOMException; - - // calcModeTypes - public static final short CALCMODE_DISCRETE = 0; - public static final short CALCMODE_LINEAR = 1; - public static final short CALCMODE_PACED = 2; - public static final short CALCMODE_SPLINE = 3; - - /** - * A code representing the value of the calcMode attribute, as defined - * above. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public short getCalcMode(); - public void setCalcMode(short calcMode) - throws DOMException; - - /** - * A DOMString representing the value of the keySplines - * attribute. Need an interface a point (x1,y1,x2,y2) - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getKeySplines(); - public void setKeySplines(String keySplines) - throws DOMException; - - /** - * A list of the time value of the keyTimes attribute. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public TimeList getKeyTimes(); - public void setKeyTimes(TimeList keyTimes) - throws DOMException; - - /** - * A DOMString representing the value of the values - * attribute. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getValues(); - public void setValues(String values) - throws DOMException; - - /** - * A DOMString representing the value of the from attribute. - * - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getFrom(); - public void setFrom(String from) - throws DOMException; - - /** - * A DOMString representing the value of the to attribute. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getTo(); - public void setTo(String to) - throws DOMException; - - /** - * A DOMString representing the value of the by attribute. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getBy(); - public void setBy(String by) - throws DOMException; - -} - diff --git a/src/bind/java/org/w3c/dom/smil/SMILDocument.java b/src/bind/java/org/w3c/dom/smil/SMILDocument.java deleted file mode 100644 index 5f54dd329..000000000 --- a/src/bind/java/org/w3c/dom/smil/SMILDocument.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -import org.w3c.dom.Document; - -/** - * A SMIL document is the root of the SMIL Hierarchy and holds the entire - * content. Beside providing access to the hierarchy, it also provides some - * convenience methods for accessing certain sets of information from the - * document. Cover document timing, document locking?, linking modality and - * any other document level issues. Are there issues with nested SMIL files? - * Is it worth talking about different document scenarios, corresponding to - * differing profiles? E.g. Standalone SMIL, HTML integration, etc. - */ -public interface SMILDocument extends Document, ElementSequentialTimeContainer { -} - diff --git a/src/bind/java/org/w3c/dom/smil/SMILElement.java b/src/bind/java/org/w3c/dom/smil/SMILElement.java deleted file mode 100644 index 748de23fc..000000000 --- a/src/bind/java/org/w3c/dom/smil/SMILElement.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -import org.w3c.dom.DOMException; -import org.w3c.dom.Element; - -/** - * The SMILElement interface is the base for all SMIL element - * types. It follows the model of the HTMLElement in the HTML - * DOM, extending the base Element class to denote SMIL-specific - * elements. - *

Note that the SMILElement interface overlaps with the - * HTMLElement interface. In practice, an integrated document - * profile that include HTML and SMIL modules will effectively implement both - * interfaces (see also the DOM documentation discussion of Inheritance vs - * Flattened Views of the API ). // etc. This needs attention - */ -public interface SMILElement extends Element { - /** - * The unique id. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getId(); - public void setId(String id) - throws DOMException; - -} - diff --git a/src/bind/java/org/w3c/dom/smil/SMILLayoutElement.java b/src/bind/java/org/w3c/dom/smil/SMILLayoutElement.java deleted file mode 100644 index 2d6136db3..000000000 --- a/src/bind/java/org/w3c/dom/smil/SMILLayoutElement.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -/** - * Declares layout type for the document. See the LAYOUT element definition . - * - */ -public interface SMILLayoutElement extends SMILElement { - /** - * The mime type of the layout langage used in this layout element.The - * default value of the type attribute is "text/smil-basic-layout". - */ - public String getType(); - - /** - * true if the player can understand the mime type, - * false otherwise. - */ - public boolean getResolved(); - -} - diff --git a/src/bind/java/org/w3c/dom/smil/SMILMediaElement.java b/src/bind/java/org/w3c/dom/smil/SMILMediaElement.java deleted file mode 100644 index d6a2d2de2..000000000 --- a/src/bind/java/org/w3c/dom/smil/SMILMediaElement.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -import org.w3c.dom.DOMException; - -/** - * Declares media content. - */ -public interface SMILMediaElement extends ElementTime, SMILElement { - /** - * See the abstract attribute from . - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getAbstractAttr(); - public void setAbstractAttr(String abstractAttr) - throws DOMException; - - /** - * See the alt attribute from . - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getAlt(); - public void setAlt(String alt) - throws DOMException; - - /** - * See the author attribute from . - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getAuthor(); - public void setAuthor(String author) - throws DOMException; - - /** - * See the clipBegin attribute from . - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getClipBegin(); - public void setClipBegin(String clipBegin) - throws DOMException; - - /** - * See the clipEnd attribute from . - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getClipEnd(); - public void setClipEnd(String clipEnd) - throws DOMException; - - /** - * See the copyright attribute from . - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getCopyright(); - public void setCopyright(String copyright) - throws DOMException; - - /** - * See the longdesc attribute from . - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getLongdesc(); - public void setLongdesc(String longdesc) - throws DOMException; - - /** - * See the port attribute from . - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getPort(); - public void setPort(String port) - throws DOMException; - - /** - * See the readIndex attribute from . - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getReadIndex(); - public void setReadIndex(String readIndex) - throws DOMException; - - /** - * See the rtpformat attribute from . - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getRtpformat(); - public void setRtpformat(String rtpformat) - throws DOMException; - - /** - * See the src attribute from . - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getSrc(); - public void setSrc(String src) - throws DOMException; - - /** - * See the stripRepeat attribute from . - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getStripRepeat(); - public void setStripRepeat(String stripRepeat) - throws DOMException; - - /** - * See the title attribute from . - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getTitle(); - public void setTitle(String title) - throws DOMException; - - /** - * See the transport attribute from . - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getTransport(); - public void setTransport(String transport) - throws DOMException; - - /** - * See the type attribute from . - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getType(); - public void setType(String type) - throws DOMException; - -} - diff --git a/src/bind/java/org/w3c/dom/smil/SMILRefElement.java b/src/bind/java/org/w3c/dom/smil/SMILRefElement.java deleted file mode 100644 index adeb2b354..000000000 --- a/src/bind/java/org/w3c/dom/smil/SMILRefElement.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -/** - * // audio, video, ... - */ -public interface SMILRefElement extends SMILMediaElement { -} - diff --git a/src/bind/java/org/w3c/dom/smil/SMILRegionElement.java b/src/bind/java/org/w3c/dom/smil/SMILRegionElement.java deleted file mode 100644 index 927fb4007..000000000 --- a/src/bind/java/org/w3c/dom/smil/SMILRegionElement.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -import org.w3c.dom.DOMException; - -/** - * Controls the position, size and scaling of media object elements. See the - * region element definition . - */ -public interface SMILRegionElement extends SMILElement, ElementLayout { - /** - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getFit(); - public void setFit(String fit) - throws DOMException; - - /** - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public String getTop(); - public void setTop(String top) - throws DOMException; - - /** - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. - */ - public int getZIndex(); - public void setZIndex(int zIndex) - throws DOMException; - -} - diff --git a/src/bind/java/org/w3c/dom/smil/SMILRegionInterface.java b/src/bind/java/org/w3c/dom/smil/SMILRegionInterface.java deleted file mode 100644 index b5e43c3b2..000000000 --- a/src/bind/java/org/w3c/dom/smil/SMILRegionInterface.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -/** - * Declares rendering surface for an element. See the region attribute - * definition . - */ -public interface SMILRegionInterface { - /** - */ - public SMILRegionElement getRegion(); - public void setRegion(SMILRegionElement region); - -} - diff --git a/src/bind/java/org/w3c/dom/smil/SMILRootLayoutElement.java b/src/bind/java/org/w3c/dom/smil/SMILRootLayoutElement.java deleted file mode 100644 index 327ecd6b2..000000000 --- a/src/bind/java/org/w3c/dom/smil/SMILRootLayoutElement.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -/** - * Declares layout properties for the root-layout element. See the - * root-layout element definition . - */ -public interface SMILRootLayoutElement extends SMILElement, ElementLayout { -} - diff --git a/src/bind/java/org/w3c/dom/smil/SMILSetElement.java b/src/bind/java/org/w3c/dom/smil/SMILSetElement.java deleted file mode 100644 index 8e0b1b72f..000000000 --- a/src/bind/java/org/w3c/dom/smil/SMILSetElement.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -/** - * This interface represents the set element. - */ -public interface SMILSetElement extends ElementTimeControl, ElementTime, ElementTargetAttributes, SMILElement { - /** - * Specifies the value for the attribute during the duration of this - * element. - */ - public String getTo(); - public void setTo(String to); - -} - diff --git a/src/bind/java/org/w3c/dom/smil/SMILSwitchElement.java b/src/bind/java/org/w3c/dom/smil/SMILSwitchElement.java deleted file mode 100644 index 27abb91cf..000000000 --- a/src/bind/java/org/w3c/dom/smil/SMILSwitchElement.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -import org.w3c.dom.Element; - -/** - * Defines a block of content control. See the switch element definition . - */ -public interface SMILSwitchElement extends SMILElement { - /** - * Returns the slected element at runtime. null if the - * selected element is not yet available. - * @return The selected Element for thisd switch - * element. - */ - public Element getSelectedElement(); - -} - diff --git a/src/bind/java/org/w3c/dom/smil/SMILTopLayoutElement.java b/src/bind/java/org/w3c/dom/smil/SMILTopLayoutElement.java deleted file mode 100644 index 26214191b..000000000 --- a/src/bind/java/org/w3c/dom/smil/SMILTopLayoutElement.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -/** - * Declares layout properties for the top-layout element. See the top-layout - * element definition . - */ -public interface SMILTopLayoutElement extends SMILElement, ElementLayout { -} - diff --git a/src/bind/java/org/w3c/dom/smil/Time.java b/src/bind/java/org/w3c/dom/smil/Time.java deleted file mode 100644 index 72fe08668..000000000 --- a/src/bind/java/org/w3c/dom/smil/Time.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -import org.w3c.dom.DOMException; -import org.w3c.dom.Element; - -/** - * The Time interface is a datatype that represents times within - * the timegraph. A Time has a type, key values to describe the - * time, and a boolean to indicate whether the values are currently - * unresolved. Still need to address the wallclock values. - */ -public interface Time { - /** - * A boolean indicating whether the current Time has been - * fully resolved to the document schedule. Note that for this to be - * true, the current Time must be defined (not indefinite), - * the syncbase and all Time 's that the syncbase depends on - * must be defined (not indefinite), and the begin Time of - * all ascendent time containers of this element and all Time - * elements that this depends upon must be defined (not indefinite). - *
If this Time is based upon an event, this - * Time will only be resolved once the specified event has - * happened, subject to the constraints of the time container. - *
Note that this may change from true to false when the parent time - * container ends its simple duration (including when it repeats or - * restarts). - */ - public boolean getResolved(); - - /** - * The clock value in seconds relative to the parent time container begin. - * This indicates the resolved time relationship to the parent time - * container. This is only valid if resolved is true. - */ - public double getResolvedOffset(); - - // TimeTypes - public static final short SMIL_TIME_INDEFINITE = 0; - public static final short SMIL_TIME_OFFSET = 1; - public static final short SMIL_TIME_SYNC_BASED = 2; - public static final short SMIL_TIME_EVENT_BASED = 3; - public static final short SMIL_TIME_WALLCLOCK = 4; - public static final short SMIL_TIME_MEDIA_MARKER = 5; - - /** - * A code representing the type of the underlying object, as defined - * above. - */ - public short getTimeType(); - - /** - * The clock value in seconds relative to the syncbase or eventbase. - * Default value is 0 . - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised on attempts to modify this - * readonly attribute. - */ - public double getOffset(); - public void setOffset(double offset) - throws DOMException; - - /** - * The base element for a sync-based or event-based time. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised on attempts to modify this - * readonly attribute. - */ - public Element getBaseElement(); - public void setBaseElement(Element baseElement) - throws DOMException; - - /** - * If true , indicates that a sync-based time is relative to - * the begin of the baseElement. If false , indicates that a - * sync-based time is relative to the active end of the baseElement. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised on attempts to modify this - * readonly attribute. - */ - public boolean getBaseBegin(); - public void setBaseBegin(boolean baseBegin) - throws DOMException; - - /** - * The name of the event for an event-based time. Default value is - * null . - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised on attempts to modify this - * readonly attribute. - */ - public String getEvent(); - public void setEvent(String event) - throws DOMException; - - /** - * The name of the marker from the media element, for media marker times. - * Default value is null . - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised on attempts to modify this - * readonly attribute. - */ - public String getMarker(); - public void setMarker(String marker) - throws DOMException; - -} - diff --git a/src/bind/java/org/w3c/dom/smil/TimeEvent.java b/src/bind/java/org/w3c/dom/smil/TimeEvent.java deleted file mode 100644 index a79c4ca05..000000000 --- a/src/bind/java/org/w3c/dom/smil/TimeEvent.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -import org.w3c.dom.events.Event; -import org.w3c.dom.views.AbstractView; - -/** - * The TimeEvent interface provides specific contextual - * information associated with Time events. - */ -public interface TimeEvent extends Event { - /** - * The view attribute identifies the - * AbstractView from which the event was generated. - */ - public AbstractView getView(); - - /** - * Specifies some detail information about the Event , - * depending on the type of event. - */ - public int getDetail(); - - /** - * The initTimeEvent method is used to initialize the value - * of a TimeEvent created through the - * DocumentEvent interface. This method may only be called - * before the TimeEvent has been dispatched via the - * dispatchEvent method, though it may be called multiple - * times during that phase if necessary. If called multiple times, the - * final invocation takes precedence. - * @param typeArg Specifies the event type. - * @param viewArg Specifies the Event 's - * AbstractView . - * @param detailArg Specifies the Event 's detail. - */ - public void initTimeEvent(String typeArg, - AbstractView viewArg, - int detailArg); - -} - diff --git a/src/bind/java/org/w3c/dom/smil/TimeList.java b/src/bind/java/org/w3c/dom/smil/TimeList.java deleted file mode 100644 index 7cec133fa..000000000 --- a/src/bind/java/org/w3c/dom/smil/TimeList.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom.smil; - -/** - * The TimeList interface provides the abstraction of an ordered - * collection of times, without defining or constraining how this collection - * is implemented. - *

The items in the TimeList are accessible via an integral - * index, starting from 0. - */ -public interface TimeList { - /** - * Returns the index th item in the collection. If - * index is greater than or equal to the number of times in - * the list, this returns null . - * @param index Index into the collection. - * @return The time at the index th position in the - * TimeList , or null if that is not a valid - * index. - */ - public Time item(int index); - - /** - * The number of times in the list. The range of valid child time indices - * is 0 to length-1 inclusive. - */ - public int getLength(); - -} - diff --git a/src/bind/java/org/w3c/dom/stylesheets/DocumentStyle.java b/src/bind/java/org/w3c/dom/stylesheets/DocumentStyle.java deleted file mode 100644 index 2270505e7..000000000 --- a/src/bind/java/org/w3c/dom/stylesheets/DocumentStyle.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.stylesheets; - -/** - * The DocumentStyle interface provides a mechanism by which the - * style sheets embedded in a document can be retrieved. The expectation is - * that an instance of the DocumentStyle interface can be - * obtained by using binding-specific casting methods on an instance of the - * Document interface. - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface DocumentStyle { - /** - * A list containing all the style sheets explicitly linked into or - * embedded in a document. For HTML documents, this includes external - * style sheets, included via the HTML LINK element, and inline STYLE - * elements. In XML, this includes external style sheets, included via - * style sheet processing instructions (see ). - */ - public StyleSheetList getStyleSheets(); - -} diff --git a/src/bind/java/org/w3c/dom/stylesheets/LinkStyle.java b/src/bind/java/org/w3c/dom/stylesheets/LinkStyle.java deleted file mode 100644 index 481bd19db..000000000 --- a/src/bind/java/org/w3c/dom/stylesheets/LinkStyle.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.stylesheets; - -/** - * The LinkStyle interface provides a mechanism by which a style - * sheet can be retrieved from the node responsible for linking it into a - * document. An instance of the LinkStyle interface can be - * obtained using binding-specific casting methods on an instance of a - * linking node (HTMLLinkElement, HTMLStyleElement - * or ProcessingInstruction in DOM Level 2). - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface LinkStyle { - /** - * The style sheet. - */ - public StyleSheet getSheet(); - -} diff --git a/src/bind/java/org/w3c/dom/stylesheets/MediaList.java b/src/bind/java/org/w3c/dom/stylesheets/MediaList.java deleted file mode 100644 index 92c46609f..000000000 --- a/src/bind/java/org/w3c/dom/stylesheets/MediaList.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.stylesheets; - -import org.w3c.dom.DOMException; - -/** - * The MediaList interface provides the abstraction of an - * ordered collection of media, without defining or constraining how this - * collection is implemented. An empty list is the same as a list that - * contains the medium "all". - *

The items in the MediaList are accessible via an integral - * index, starting from 0. - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface MediaList { - /** - * The parsable textual representation of the media list. This is a - * comma-separated list of media. - * @exception DOMException - * SYNTAX_ERR: Raised if the specified string value has a syntax error - * and is unparsable. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this media list is - * readonly. - */ - public String getMediaText(); - public void setMediaText(String mediaText) - throws DOMException; - - /** - * The number of media in the list. The range of valid media is - * 0 to length-1 inclusive. - */ - public int getLength(); - - /** - * Returns the indexth in the list. If index is - * greater than or equal to the number of media in the list, this - * returns null. - * @param index Index into the collection. - * @return The medium at the indexth position in the - * MediaList, or null if that is not a valid - * index. - */ - public String item(int index); - - /** - * Deletes the medium indicated by oldMedium from the list. - * @param oldMediumThe medium to delete in the media list. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this list is readonly. - *
NOT_FOUND_ERR: Raised if oldMedium is not in the - * list. - */ - public void deleteMedium(String oldMedium) - throws DOMException; - - /** - * Adds the medium newMedium to the end of the list. If the - * newMedium is already used, it is first removed. - * @param newMediumThe new medium to add. - * @exception DOMException - * INVALID_CHARACTER_ERR: If the medium contains characters that are - * invalid in the underlying style language. - *
NO_MODIFICATION_ALLOWED_ERR: Raised if this list is readonly. - */ - public void appendMedium(String newMedium) - throws DOMException; - -} diff --git a/src/bind/java/org/w3c/dom/stylesheets/StyleSheet.java b/src/bind/java/org/w3c/dom/stylesheets/StyleSheet.java deleted file mode 100644 index 94ccc1885..000000000 --- a/src/bind/java/org/w3c/dom/stylesheets/StyleSheet.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.stylesheets; - -import org.w3c.dom.Node; - -/** - * The StyleSheet interface is the abstract base interface for - * any type of style sheet. It represents a single style sheet associated - * with a structured document. In HTML, the StyleSheet interface represents - * either an external style sheet, included via the HTML LINK element, or - * an inline STYLE element. In XML, this interface represents an external - * style sheet, included via a style sheet processing instruction. - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface StyleSheet { - /** - * This specifies the style sheet language for this style sheet. The - * style sheet language is specified as a content type (e.g. - * "text/css"). The content type is often specified in the - * ownerNode. Also see the type attribute definition for - * the LINK element in HTML 4.0, and the type - * pseudo-attribute for the XML style sheet processing instruction. - */ - public String getType(); - - /** - * false if the style sheet is applied to the document. - * true if it is not. Modifying this attribute may cause a - * new resolution of style for the document. A stylesheet only applies - * if both an appropriate medium definition is present and the disabled - * attribute is false. So, if the media doesn't apply to the current - * user agent, the disabled attribute is ignored. - */ - public boolean getDisabled(); - public void setDisabled(boolean disabled); - - /** - * The node that associates this style sheet with the document. For HTML, - * this may be the corresponding LINK or STYLE - * element. For XML, it may be the linking processing instruction. For - * style sheets that are included by other style sheets, the value of - * this attribute is null. - */ - public Node getOwnerNode(); - - /** - * For style sheet languages that support the concept of style sheet - * inclusion, this attribute represents the including style sheet, if - * one exists. If the style sheet is a top-level style sheet, or the - * style sheet language does not support inclusion, the value of this - * attribute is null. - */ - public StyleSheet getParentStyleSheet(); - - /** - * If the style sheet is a linked style sheet, the value of its attribute - * is its location. For inline style sheets, the value of this attribute - * is null. See the href attribute definition for the - * LINK element in HTML 4.0, and the href pseudo-attribute - * for the XML style sheet processing instruction. - */ - public String getHref(); - - /** - * The advisory title. The title is often specified in the - * ownerNode. See the title attribute definition for the - * LINK element in HTML 4.0, and the title pseudo-attribute - * for the XML style sheet processing instruction. - */ - public String getTitle(); - - /** - * The intended destination media for style information. The media is - * often specified in the ownerNode. If no media has been - * specified, the MediaList will be empty. See the media - * attribute definition for the LINK element in HTML 4.0, - * and the media pseudo-attribute for the XML style sheet processing - * instruction . Modifying the media list may cause a change to the - * attribute disabled. - */ - public MediaList getMedia(); - -} diff --git a/src/bind/java/org/w3c/dom/stylesheets/StyleSheetList.java b/src/bind/java/org/w3c/dom/stylesheets/StyleSheetList.java deleted file mode 100644 index 76c0c59e1..000000000 --- a/src/bind/java/org/w3c/dom/stylesheets/StyleSheetList.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.stylesheets; - -/** - * The StyleSheetList interface provides the abstraction of an - * ordered collection of style sheets. - *

The items in the StyleSheetList are accessible via an - * integral index, starting from 0. - *

See also the Document Object Model (DOM) Level 2 Style Specification. - * @since DOM Level 2 - */ -public interface StyleSheetList { - /** - * The number of StyleSheets in the list. The range of valid - * child stylesheet indices is 0 to length-1 - * inclusive. - */ - public int getLength(); - - /** - * Used to retrieve a style sheet by ordinal index. If index is greater - * than or equal to the number of style sheets in the list, this returns - * null. - * @param indexIndex into the collection - * @return The style sheet at the index position in the - * StyleSheetList, or null if that is not a - * valid index. - */ - public StyleSheet item(int index); - -} diff --git a/src/bind/java/org/w3c/dom/svg/GetSVGDocument.java b/src/bind/java/org/w3c/dom/svg/GetSVGDocument.java deleted file mode 100644 index cc8970137..000000000 --- a/src/bind/java/org/w3c/dom/svg/GetSVGDocument.java +++ /dev/null @@ -1,9 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface GetSVGDocument { - public SVGDocument getSVGDocument ( ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGAElement.java b/src/bind/java/org/w3c/dom/svg/SVGAElement.java deleted file mode 100644 index a403086cd..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGAElement.java +++ /dev/null @@ -1,16 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.events.EventTarget; - -public interface SVGAElement extends - SVGElement, - SVGURIReference, - SVGTests, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGStylable, - SVGTransformable, - EventTarget { - public SVGAnimatedString getTarget( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGAltGlyphDefElement.java b/src/bind/java/org/w3c/dom/svg/SVGAltGlyphDefElement.java deleted file mode 100644 index c8e4d2dd0..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGAltGlyphDefElement.java +++ /dev/null @@ -1,6 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGAltGlyphDefElement extends - SVGElement { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGAltGlyphElement.java b/src/bind/java/org/w3c/dom/svg/SVGAltGlyphElement.java deleted file mode 100644 index 4362efb35..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGAltGlyphElement.java +++ /dev/null @@ -1,15 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGAltGlyphElement extends - SVGTextPositioningElement, - SVGURIReference { - public String getGlyphRef( ); - public void setGlyphRef( String glyphRef ) - throws DOMException; - public String getFormat( ); - public void setFormat( String format ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGAltGlyphItemElement.java b/src/bind/java/org/w3c/dom/svg/SVGAltGlyphItemElement.java deleted file mode 100644 index 93c01b3d5..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGAltGlyphItemElement.java +++ /dev/null @@ -1,6 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGAltGlyphItemElement extends - SVGElement { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGAngle.java b/src/bind/java/org/w3c/dom/svg/SVGAngle.java deleted file mode 100644 index 8f212b7c5..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGAngle.java +++ /dev/null @@ -1,26 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; -public interface SVGAngle { - // Angle Unit Types - public static final short SVG_ANGLETYPE_UNKNOWN = 0; - public static final short SVG_ANGLETYPE_UNSPECIFIED = 1; - public static final short SVG_ANGLETYPE_DEG = 2; - public static final short SVG_ANGLETYPE_RAD = 3; - public static final short SVG_ANGLETYPE_GRAD = 4; - - public short getUnitType( ); - public float getValue( ); - public void setValue( float value ) - throws DOMException; - public float getValueInSpecifiedUnits( ); - public void setValueInSpecifiedUnits( float valueInSpecifiedUnits ) - throws DOMException; - public String getValueAsString( ); - public void setValueAsString( String valueAsString ) - throws DOMException; - - public void newValueSpecifiedUnits ( short unitType, float valueInSpecifiedUnits ); - public void convertToSpecifiedUnits ( short unitType ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGAnimateColorElement.java b/src/bind/java/org/w3c/dom/svg/SVGAnimateColorElement.java deleted file mode 100644 index 9efb69aab..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGAnimateColorElement.java +++ /dev/null @@ -1,6 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGAnimateColorElement extends - SVGAnimationElement { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGAnimateElement.java b/src/bind/java/org/w3c/dom/svg/SVGAnimateElement.java deleted file mode 100644 index 4d365b257..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGAnimateElement.java +++ /dev/null @@ -1,6 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGAnimateElement extends - SVGAnimationElement { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGAnimateMotionElement.java b/src/bind/java/org/w3c/dom/svg/SVGAnimateMotionElement.java deleted file mode 100644 index a06728dde..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGAnimateMotionElement.java +++ /dev/null @@ -1,6 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGAnimateMotionElement extends - SVGAnimationElement { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGAnimateTransformElement.java b/src/bind/java/org/w3c/dom/svg/SVGAnimateTransformElement.java deleted file mode 100644 index 1f4ac36cd..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGAnimateTransformElement.java +++ /dev/null @@ -1,6 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGAnimateTransformElement extends - SVGAnimationElement { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGAnimatedAngle.java b/src/bind/java/org/w3c/dom/svg/SVGAnimatedAngle.java deleted file mode 100644 index ae5d8a08a..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGAnimatedAngle.java +++ /dev/null @@ -1,7 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGAnimatedAngle { - public SVGAngle getBaseVal( ); - public SVGAngle getAnimVal( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGAnimatedBoolean.java b/src/bind/java/org/w3c/dom/svg/SVGAnimatedBoolean.java deleted file mode 100644 index 1a5e39259..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGAnimatedBoolean.java +++ /dev/null @@ -1,10 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; -public interface SVGAnimatedBoolean { - public boolean getBaseVal( ); - public void setBaseVal( boolean baseVal ) - throws DOMException; - public boolean getAnimVal( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGAnimatedEnumeration.java b/src/bind/java/org/w3c/dom/svg/SVGAnimatedEnumeration.java deleted file mode 100644 index 71122ffe4..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGAnimatedEnumeration.java +++ /dev/null @@ -1,10 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; -public interface SVGAnimatedEnumeration { - public short getBaseVal( ); - public void setBaseVal( short baseVal ) - throws DOMException; - public short getAnimVal( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGAnimatedInteger.java b/src/bind/java/org/w3c/dom/svg/SVGAnimatedInteger.java deleted file mode 100644 index dbc20bc35..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGAnimatedInteger.java +++ /dev/null @@ -1,10 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; -public interface SVGAnimatedInteger { - public int getBaseVal( ); - public void setBaseVal( int baseVal ) - throws DOMException; - public int getAnimVal( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGAnimatedLength.java b/src/bind/java/org/w3c/dom/svg/SVGAnimatedLength.java deleted file mode 100644 index 75da0ceb7..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGAnimatedLength.java +++ /dev/null @@ -1,7 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGAnimatedLength { - public SVGLength getBaseVal( ); - public SVGLength getAnimVal( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGAnimatedLengthList.java b/src/bind/java/org/w3c/dom/svg/SVGAnimatedLengthList.java deleted file mode 100644 index 4294f55ed..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGAnimatedLengthList.java +++ /dev/null @@ -1,7 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGAnimatedLengthList { - public SVGLengthList getBaseVal( ); - public SVGLengthList getAnimVal( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGAnimatedNumber.java b/src/bind/java/org/w3c/dom/svg/SVGAnimatedNumber.java deleted file mode 100644 index 39bb6a14d..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGAnimatedNumber.java +++ /dev/null @@ -1,10 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; -public interface SVGAnimatedNumber { - public float getBaseVal( ); - public void setBaseVal( float baseVal ) - throws DOMException; - public float getAnimVal( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGAnimatedNumberList.java b/src/bind/java/org/w3c/dom/svg/SVGAnimatedNumberList.java deleted file mode 100644 index 29ea31ad0..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGAnimatedNumberList.java +++ /dev/null @@ -1,7 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGAnimatedNumberList { - public SVGNumberList getBaseVal( ); - public SVGNumberList getAnimVal( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGAnimatedPathData.java b/src/bind/java/org/w3c/dom/svg/SVGAnimatedPathData.java deleted file mode 100644 index 3154b9ba0..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGAnimatedPathData.java +++ /dev/null @@ -1,9 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGAnimatedPathData { - public SVGPathSegList getPathSegList( ); - public SVGPathSegList getNormalizedPathSegList( ); - public SVGPathSegList getAnimatedPathSegList( ); - public SVGPathSegList getAnimatedNormalizedPathSegList( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGAnimatedPoints.java b/src/bind/java/org/w3c/dom/svg/SVGAnimatedPoints.java deleted file mode 100644 index 1f7f7280c..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGAnimatedPoints.java +++ /dev/null @@ -1,7 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGAnimatedPoints { - public SVGPointList getPoints( ); - public SVGPointList getAnimatedPoints( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGAnimatedPreserveAspectRatio.java b/src/bind/java/org/w3c/dom/svg/SVGAnimatedPreserveAspectRatio.java deleted file mode 100644 index a3cddac37..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGAnimatedPreserveAspectRatio.java +++ /dev/null @@ -1,7 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGAnimatedPreserveAspectRatio { - public SVGPreserveAspectRatio getBaseVal( ); - public SVGPreserveAspectRatio getAnimVal( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGAnimatedRect.java b/src/bind/java/org/w3c/dom/svg/SVGAnimatedRect.java deleted file mode 100644 index 405d45c04..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGAnimatedRect.java +++ /dev/null @@ -1,7 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGAnimatedRect { - public SVGRect getBaseVal( ); - public SVGRect getAnimVal( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGAnimatedString.java b/src/bind/java/org/w3c/dom/svg/SVGAnimatedString.java deleted file mode 100644 index 78cf12e0c..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGAnimatedString.java +++ /dev/null @@ -1,10 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; -public interface SVGAnimatedString { - public String getBaseVal( ); - public void setBaseVal( String baseVal ) - throws DOMException; - public String getAnimVal( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGAnimatedTransformList.java b/src/bind/java/org/w3c/dom/svg/SVGAnimatedTransformList.java deleted file mode 100644 index 793df4316..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGAnimatedTransformList.java +++ /dev/null @@ -1,7 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGAnimatedTransformList { - public SVGTransformList getBaseVal( ); - public SVGTransformList getAnimVal( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGAnimationElement.java b/src/bind/java/org/w3c/dom/svg/SVGAnimationElement.java deleted file mode 100644 index f299c2b94..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGAnimationElement.java +++ /dev/null @@ -1,20 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.smil.ElementTimeControl; - -public interface SVGAnimationElement extends - SVGElement, - SVGTests, - SVGExternalResourcesRequired, - ElementTimeControl, - EventTarget { - public SVGElement getTargetElement( ); - - public float getStartTime ( ); - public float getCurrentTime ( ); - public float getSimpleDuration ( ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGCSSRule.java b/src/bind/java/org/w3c/dom/svg/SVGCSSRule.java deleted file mode 100644 index 5365e5dfd..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGCSSRule.java +++ /dev/null @@ -1,10 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.css.CSSRule; - -public interface SVGCSSRule extends - CSSRule { - // Additional CSS RuleType to support ICC color specifications - public static final short COLOR_PROFILE_RULE = 7; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGCircleElement.java b/src/bind/java/org/w3c/dom/svg/SVGCircleElement.java deleted file mode 100644 index 6c9aa02ec..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGCircleElement.java +++ /dev/null @@ -1,17 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.events.EventTarget; - -public interface SVGCircleElement extends - SVGElement, - SVGTests, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGStylable, - SVGTransformable, - EventTarget { - public SVGAnimatedLength getCx( ); - public SVGAnimatedLength getCy( ); - public SVGAnimatedLength getR( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGClipPathElement.java b/src/bind/java/org/w3c/dom/svg/SVGClipPathElement.java deleted file mode 100644 index ebe018c2c..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGClipPathElement.java +++ /dev/null @@ -1,13 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGClipPathElement extends - SVGElement, - SVGTests, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGStylable, - SVGTransformable, - SVGUnitTypes { - public SVGAnimatedEnumeration getClipPathUnits( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGColor.java b/src/bind/java/org/w3c/dom/svg/SVGColor.java deleted file mode 100644 index 27e942ac8..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGColor.java +++ /dev/null @@ -1,25 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.css.RGBColor; -import org.w3c.dom.css.CSSValue; - -public interface SVGColor extends - CSSValue { - // Color Types - public static final short SVG_COLORTYPE_UNKNOWN = 0; - public static final short SVG_COLORTYPE_RGBCOLOR = 1; - public static final short SVG_COLORTYPE_RGBCOLOR_ICCCOLOR = 2; - public static final short SVG_COLORTYPE_CURRENTCOLOR = 3; - - public short getColorType( ); - public RGBColor getRGBColor( ); - public SVGICCColor getICCColor( ); - - public void setRGBColor ( String rgbColor ) - throws SVGException; - public void setRGBColorICCColor ( String rgbColor, String iccColor ) - throws SVGException; - public void setColor ( short colorType, String rgbColor, String iccColor ) - throws SVGException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGColorProfileElement.java b/src/bind/java/org/w3c/dom/svg/SVGColorProfileElement.java deleted file mode 100644 index ce6d33598..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGColorProfileElement.java +++ /dev/null @@ -1,19 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGColorProfileElement extends - SVGElement, - SVGURIReference, - SVGRenderingIntent { - public String getLocal( ); - public void setLocal( String local ) - throws DOMException; - public String getName( ); - public void setName( String name ) - throws DOMException; - public short getRenderingIntent( ); - public void setRenderingIntent( short renderingIntent ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGColorProfileRule.java b/src/bind/java/org/w3c/dom/svg/SVGColorProfileRule.java deleted file mode 100644 index 97faa309b..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGColorProfileRule.java +++ /dev/null @@ -1,18 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGColorProfileRule extends - SVGCSSRule, - SVGRenderingIntent { - public String getSrc( ); - public void setSrc( String src ) - throws DOMException; - public String getName( ); - public void setName( String name ) - throws DOMException; - public short getRenderingIntent( ); - public void setRenderingIntent( short renderingIntent ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGComponentTransferFunctionElement.java b/src/bind/java/org/w3c/dom/svg/SVGComponentTransferFunctionElement.java deleted file mode 100644 index 82e061141..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGComponentTransferFunctionElement.java +++ /dev/null @@ -1,21 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGComponentTransferFunctionElement extends - SVGElement { - // Component Transfer Types - public static final short SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN = 0; - public static final short SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY = 1; - public static final short SVG_FECOMPONENTTRANSFER_TYPE_TABLE = 2; - public static final short SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE = 3; - public static final short SVG_FECOMPONENTTRANSFER_TYPE_LINEAR = 4; - public static final short SVG_FECOMPONENTTRANSFER_TYPE_GAMMA = 5; - - public SVGAnimatedEnumeration getType( ); - public SVGAnimatedNumberList getTableValues( ); - public SVGAnimatedNumber getSlope( ); - public SVGAnimatedNumber getIntercept( ); - public SVGAnimatedNumber getAmplitude( ); - public SVGAnimatedNumber getExponent( ); - public SVGAnimatedNumber getOffset( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGCursorElement.java b/src/bind/java/org/w3c/dom/svg/SVGCursorElement.java deleted file mode 100644 index cc8cdf298..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGCursorElement.java +++ /dev/null @@ -1,11 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGCursorElement extends - SVGElement, - SVGURIReference, - SVGTests, - SVGExternalResourcesRequired { - public SVGAnimatedLength getX( ); - public SVGAnimatedLength getY( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGDefinitionSrcElement.java b/src/bind/java/org/w3c/dom/svg/SVGDefinitionSrcElement.java deleted file mode 100644 index 4123b5a97..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGDefinitionSrcElement.java +++ /dev/null @@ -1,6 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGDefinitionSrcElement extends - SVGElement { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGDefsElement.java b/src/bind/java/org/w3c/dom/svg/SVGDefsElement.java deleted file mode 100644 index 6b83bedc3..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGDefsElement.java +++ /dev/null @@ -1,14 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.events.EventTarget; - -public interface SVGDefsElement extends - SVGElement, - SVGTests, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGStylable, - SVGTransformable, - EventTarget { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGDescElement.java b/src/bind/java/org/w3c/dom/svg/SVGDescElement.java deleted file mode 100644 index d3eaf7384..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGDescElement.java +++ /dev/null @@ -1,8 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGDescElement extends - SVGElement, - SVGLangSpace, - SVGStylable { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGDocument.java b/src/bind/java/org/w3c/dom/svg/SVGDocument.java deleted file mode 100644 index b6d9064b8..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGDocument.java +++ /dev/null @@ -1,15 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.Document; -import org.w3c.dom.events.DocumentEvent; - -public interface SVGDocument extends - Document, - DocumentEvent { - public String getTitle( ); - public String getReferrer( ); - public String getDomain( ); - public String getURL( ); - public SVGSVGElement getRootElement( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGElement.java b/src/bind/java/org/w3c/dom/svg/SVGElement.java deleted file mode 100644 index d6a0299ca..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGElement.java +++ /dev/null @@ -1,17 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; -import org.w3c.dom.Element; - -public interface SVGElement extends - Element { - public String getId( ); - public void setId( String id ) - throws DOMException; - public String getXMLbase( ); - public void setXMLbase( String xmlbase ) - throws DOMException; - public SVGSVGElement getOwnerSVGElement( ); - public SVGElement getViewportElement( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGElementInstance.java b/src/bind/java/org/w3c/dom/svg/SVGElementInstance.java deleted file mode 100644 index 2509ec9c6..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGElementInstance.java +++ /dev/null @@ -1,16 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.events.EventTarget; - -public interface SVGElementInstance extends - EventTarget { - public SVGElement getCorrespondingElement( ); - public SVGUseElement getCorrespondingUseElement( ); - public SVGElementInstance getParentNode( ); - public SVGElementInstanceList getChildNodes( ); - public SVGElementInstance getFirstChild( ); - public SVGElementInstance getLastChild( ); - public SVGElementInstance getPreviousSibling( ); - public SVGElementInstance getNextSibling( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGElementInstanceList.java b/src/bind/java/org/w3c/dom/svg/SVGElementInstanceList.java deleted file mode 100644 index 010ddfb4f..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGElementInstanceList.java +++ /dev/null @@ -1,8 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGElementInstanceList { - public int getLength( ); - - public SVGElementInstance item ( int index ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGEllipseElement.java b/src/bind/java/org/w3c/dom/svg/SVGEllipseElement.java deleted file mode 100644 index 2f7f7dbaa..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGEllipseElement.java +++ /dev/null @@ -1,18 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.events.EventTarget; - -public interface SVGEllipseElement extends - SVGElement, - SVGTests, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGStylable, - SVGTransformable, - EventTarget { - public SVGAnimatedLength getCx( ); - public SVGAnimatedLength getCy( ); - public SVGAnimatedLength getRx( ); - public SVGAnimatedLength getRy( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGEvent.java b/src/bind/java/org/w3c/dom/svg/SVGEvent.java deleted file mode 100644 index 252825ba7..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGEvent.java +++ /dev/null @@ -1,8 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.events.Event; - -public interface SVGEvent extends - Event { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGException.java b/src/bind/java/org/w3c/dom/svg/SVGException.java deleted file mode 100644 index 64f3743e1..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGException.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.w3c.dom.svg; - -public class SVGException extends RuntimeException { - public SVGException(short code, String message) { - super(message); - this.code = code; - } - public short code; - // ExceptionCode - public static final short SVG_WRONG_TYPE_ERR = 0; - public static final short SVG_INVALID_VALUE_ERR = 1; - public static final short SVG_MATRIX_NOT_INVERTABLE = 2; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGExternalResourcesRequired.java b/src/bind/java/org/w3c/dom/svg/SVGExternalResourcesRequired.java deleted file mode 100644 index aa362066f..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGExternalResourcesRequired.java +++ /dev/null @@ -1,6 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGExternalResourcesRequired { - public SVGAnimatedBoolean getExternalResourcesRequired( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFEBlendElement.java b/src/bind/java/org/w3c/dom/svg/SVGFEBlendElement.java deleted file mode 100644 index 3d8a11ade..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFEBlendElement.java +++ /dev/null @@ -1,18 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFEBlendElement extends - SVGElement, - SVGFilterPrimitiveStandardAttributes { - // Blend Mode Types - public static final short SVG_FEBLEND_MODE_UNKNOWN = 0; - public static final short SVG_FEBLEND_MODE_NORMAL = 1; - public static final short SVG_FEBLEND_MODE_MULTIPLY = 2; - public static final short SVG_FEBLEND_MODE_SCREEN = 3; - public static final short SVG_FEBLEND_MODE_DARKEN = 4; - public static final short SVG_FEBLEND_MODE_LIGHTEN = 5; - - public SVGAnimatedString getIn1( ); - public SVGAnimatedString getIn2( ); - public SVGAnimatedEnumeration getMode( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFEColorMatrixElement.java b/src/bind/java/org/w3c/dom/svg/SVGFEColorMatrixElement.java deleted file mode 100644 index 6aac0e35c..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFEColorMatrixElement.java +++ /dev/null @@ -1,17 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFEColorMatrixElement extends - SVGElement, - SVGFilterPrimitiveStandardAttributes { - // Color Matrix Types - public static final short SVG_FECOLORMATRIX_TYPE_UNKNOWN = 0; - public static final short SVG_FECOLORMATRIX_TYPE_MATRIX = 1; - public static final short SVG_FECOLORMATRIX_TYPE_SATURATE = 2; - public static final short SVG_FECOLORMATRIX_TYPE_HUEROTATE = 3; - public static final short SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA = 4; - - public SVGAnimatedString getIn1( ); - public SVGAnimatedEnumeration getType( ); - public SVGAnimatedNumberList getValues( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFEComponentTransferElement.java b/src/bind/java/org/w3c/dom/svg/SVGFEComponentTransferElement.java deleted file mode 100644 index 38d3fba34..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFEComponentTransferElement.java +++ /dev/null @@ -1,8 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFEComponentTransferElement extends - SVGElement, - SVGFilterPrimitiveStandardAttributes { - public SVGAnimatedString getIn1( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFECompositeElement.java b/src/bind/java/org/w3c/dom/svg/SVGFECompositeElement.java deleted file mode 100644 index 244888d01..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFECompositeElement.java +++ /dev/null @@ -1,23 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFECompositeElement extends - SVGElement, - SVGFilterPrimitiveStandardAttributes { - // Composite Operators - public static final short SVG_FECOMPOSITE_OPERATOR_UNKNOWN = 0; - public static final short SVG_FECOMPOSITE_OPERATOR_OVER = 1; - public static final short SVG_FECOMPOSITE_OPERATOR_IN = 2; - public static final short SVG_FECOMPOSITE_OPERATOR_OUT = 3; - public static final short SVG_FECOMPOSITE_OPERATOR_ATOP = 4; - public static final short SVG_FECOMPOSITE_OPERATOR_XOR = 5; - public static final short SVG_FECOMPOSITE_OPERATOR_ARITHMETIC = 6; - - public SVGAnimatedString getIn1( ); - public SVGAnimatedString getIn2( ); - public SVGAnimatedEnumeration getOperator( ); - public SVGAnimatedNumber getK1( ); - public SVGAnimatedNumber getK2( ); - public SVGAnimatedNumber getK3( ); - public SVGAnimatedNumber getK4( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFEConvolveMatrixElement.java b/src/bind/java/org/w3c/dom/svg/SVGFEConvolveMatrixElement.java deleted file mode 100644 index 391a0d858..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFEConvolveMatrixElement.java +++ /dev/null @@ -1,24 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFEConvolveMatrixElement extends - SVGElement, - SVGFilterPrimitiveStandardAttributes { - // Edge Mode Values - public static final short SVG_EDGEMODE_UNKNOWN = 0; - public static final short SVG_EDGEMODE_DUPLICATE = 1; - public static final short SVG_EDGEMODE_WRAP = 2; - public static final short SVG_EDGEMODE_NONE = 3; - - public SVGAnimatedInteger getOrderX( ); - public SVGAnimatedInteger getOrderY( ); - public SVGAnimatedNumberList getKernelMatrix( ); - public SVGAnimatedNumber getDivisor( ); - public SVGAnimatedNumber getBias( ); - public SVGAnimatedInteger getTargetX( ); - public SVGAnimatedInteger getTargetY( ); - public SVGAnimatedEnumeration getEdgeMode( ); - public SVGAnimatedNumber getKernelUnitLengthX( ); - public SVGAnimatedNumber getKernelUnitLengthY( ); - public SVGAnimatedBoolean getPreserveAlpha( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFEDiffuseLightingElement.java b/src/bind/java/org/w3c/dom/svg/SVGFEDiffuseLightingElement.java deleted file mode 100644 index e5c01e87c..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFEDiffuseLightingElement.java +++ /dev/null @@ -1,12 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFEDiffuseLightingElement extends - SVGElement, - SVGFilterPrimitiveStandardAttributes { - public SVGAnimatedString getIn1( ); - public SVGAnimatedNumber getSurfaceScale( ); - public SVGAnimatedNumber getDiffuseConstant( ); - public SVGAnimatedNumber getKernelUnitLengthX( ); - public SVGAnimatedNumber getKernelUnitLengthY( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFEDisplacementMapElement.java b/src/bind/java/org/w3c/dom/svg/SVGFEDisplacementMapElement.java deleted file mode 100644 index 4c82fd85a..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFEDisplacementMapElement.java +++ /dev/null @@ -1,19 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFEDisplacementMapElement extends - SVGElement, - SVGFilterPrimitiveStandardAttributes { - // Channel Selectors - public static final short SVG_CHANNEL_UNKNOWN = 0; - public static final short SVG_CHANNEL_R = 1; - public static final short SVG_CHANNEL_G = 2; - public static final short SVG_CHANNEL_B = 3; - public static final short SVG_CHANNEL_A = 4; - - public SVGAnimatedString getIn1( ); - public SVGAnimatedString getIn2( ); - public SVGAnimatedNumber getScale( ); - public SVGAnimatedEnumeration getXChannelSelector( ); - public SVGAnimatedEnumeration getYChannelSelector( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFEDistantLightElement.java b/src/bind/java/org/w3c/dom/svg/SVGFEDistantLightElement.java deleted file mode 100644 index a96a1e15d..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFEDistantLightElement.java +++ /dev/null @@ -1,8 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFEDistantLightElement extends - SVGElement { - public SVGAnimatedNumber getAzimuth( ); - public SVGAnimatedNumber getElevation( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFEFloodElement.java b/src/bind/java/org/w3c/dom/svg/SVGFEFloodElement.java deleted file mode 100644 index 313097a2f..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFEFloodElement.java +++ /dev/null @@ -1,8 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFEFloodElement extends - SVGElement, - SVGFilterPrimitiveStandardAttributes { - public SVGAnimatedString getIn1( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFEFuncAElement.java b/src/bind/java/org/w3c/dom/svg/SVGFEFuncAElement.java deleted file mode 100644 index fa9773524..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFEFuncAElement.java +++ /dev/null @@ -1,6 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFEFuncAElement extends - SVGComponentTransferFunctionElement { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFEFuncBElement.java b/src/bind/java/org/w3c/dom/svg/SVGFEFuncBElement.java deleted file mode 100644 index 17733d62b..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFEFuncBElement.java +++ /dev/null @@ -1,6 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFEFuncBElement extends - SVGComponentTransferFunctionElement { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFEFuncGElement.java b/src/bind/java/org/w3c/dom/svg/SVGFEFuncGElement.java deleted file mode 100644 index 5078436f1..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFEFuncGElement.java +++ /dev/null @@ -1,6 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFEFuncGElement extends - SVGComponentTransferFunctionElement { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFEFuncRElement.java b/src/bind/java/org/w3c/dom/svg/SVGFEFuncRElement.java deleted file mode 100644 index 72efaac9d..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFEFuncRElement.java +++ /dev/null @@ -1,6 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFEFuncRElement extends - SVGComponentTransferFunctionElement { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFEGaussianBlurElement.java b/src/bind/java/org/w3c/dom/svg/SVGFEGaussianBlurElement.java deleted file mode 100644 index b3385fa4b..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFEGaussianBlurElement.java +++ /dev/null @@ -1,12 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFEGaussianBlurElement extends - SVGElement, - SVGFilterPrimitiveStandardAttributes { - public SVGAnimatedString getIn1( ); - public SVGAnimatedNumber getStdDeviationX( ); - public SVGAnimatedNumber getStdDeviationY( ); - - public void setStdDeviation ( float stdDeviationX, float stdDeviationY ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFEImageElement.java b/src/bind/java/org/w3c/dom/svg/SVGFEImageElement.java deleted file mode 100644 index b74daa7d2..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFEImageElement.java +++ /dev/null @@ -1,13 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFEImageElement extends - SVGElement, - SVGURIReference, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGFilterPrimitiveStandardAttributes { - - public SVGAnimatedPreserveAspectRatio getPreserveAspectRatio( ); - -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFEMergeElement.java b/src/bind/java/org/w3c/dom/svg/SVGFEMergeElement.java deleted file mode 100644 index cea3d6fa9..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFEMergeElement.java +++ /dev/null @@ -1,7 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFEMergeElement extends - SVGElement, - SVGFilterPrimitiveStandardAttributes { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFEMergeNodeElement.java b/src/bind/java/org/w3c/dom/svg/SVGFEMergeNodeElement.java deleted file mode 100644 index e0ae4c402..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFEMergeNodeElement.java +++ /dev/null @@ -1,7 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFEMergeNodeElement extends - SVGElement { - public SVGAnimatedString getIn1( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFEMorphologyElement.java b/src/bind/java/org/w3c/dom/svg/SVGFEMorphologyElement.java deleted file mode 100644 index b04c80c84..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFEMorphologyElement.java +++ /dev/null @@ -1,16 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFEMorphologyElement extends - SVGElement, - SVGFilterPrimitiveStandardAttributes { - // Morphology Operators - public static final short SVG_MORPHOLOGY_OPERATOR_UNKNOWN = 0; - public static final short SVG_MORPHOLOGY_OPERATOR_ERODE = 1; - public static final short SVG_MORPHOLOGY_OPERATOR_DILATE = 2; - - public SVGAnimatedString getIn1( ); - public SVGAnimatedEnumeration getOperator( ); - public SVGAnimatedNumber getRadiusX( ); - public SVGAnimatedNumber getRadiusY( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFEOffsetElement.java b/src/bind/java/org/w3c/dom/svg/SVGFEOffsetElement.java deleted file mode 100644 index 6a76b8d42..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFEOffsetElement.java +++ /dev/null @@ -1,10 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFEOffsetElement extends - SVGElement, - SVGFilterPrimitiveStandardAttributes { - public SVGAnimatedString getIn1( ); - public SVGAnimatedNumber getDx( ); - public SVGAnimatedNumber getDy( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFEPointLightElement.java b/src/bind/java/org/w3c/dom/svg/SVGFEPointLightElement.java deleted file mode 100644 index cec24b204..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFEPointLightElement.java +++ /dev/null @@ -1,9 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFEPointLightElement extends - SVGElement { - public SVGAnimatedNumber getX( ); - public SVGAnimatedNumber getY( ); - public SVGAnimatedNumber getZ( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFESpecularLightingElement.java b/src/bind/java/org/w3c/dom/svg/SVGFESpecularLightingElement.java deleted file mode 100644 index 2070f72dc..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFESpecularLightingElement.java +++ /dev/null @@ -1,11 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFESpecularLightingElement extends - SVGElement, - SVGFilterPrimitiveStandardAttributes { - public SVGAnimatedString getIn1( ); - public SVGAnimatedNumber getSurfaceScale( ); - public SVGAnimatedNumber getSpecularConstant( ); - public SVGAnimatedNumber getSpecularExponent( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFESpotLightElement.java b/src/bind/java/org/w3c/dom/svg/SVGFESpotLightElement.java deleted file mode 100644 index 2beaaf55d..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFESpotLightElement.java +++ /dev/null @@ -1,14 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFESpotLightElement extends - SVGElement { - public SVGAnimatedNumber getX( ); - public SVGAnimatedNumber getY( ); - public SVGAnimatedNumber getZ( ); - public SVGAnimatedNumber getPointsAtX( ); - public SVGAnimatedNumber getPointsAtY( ); - public SVGAnimatedNumber getPointsAtZ( ); - public SVGAnimatedNumber getSpecularExponent( ); - public SVGAnimatedNumber getLimitingConeAngle( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFETileElement.java b/src/bind/java/org/w3c/dom/svg/SVGFETileElement.java deleted file mode 100644 index 4c281292b..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFETileElement.java +++ /dev/null @@ -1,8 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFETileElement extends - SVGElement, - SVGFilterPrimitiveStandardAttributes { - public SVGAnimatedString getIn1( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFETurbulenceElement.java b/src/bind/java/org/w3c/dom/svg/SVGFETurbulenceElement.java deleted file mode 100644 index f8badaafc..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFETurbulenceElement.java +++ /dev/null @@ -1,22 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFETurbulenceElement extends - SVGElement, - SVGFilterPrimitiveStandardAttributes { - // Turbulence Types - public static final short SVG_TURBULENCE_TYPE_UNKNOWN = 0; - public static final short SVG_TURBULENCE_TYPE_FRACTALNOISE = 1; - public static final short SVG_TURBULENCE_TYPE_TURBULENCE = 2; - // Stitch Options - public static final short SVG_STITCHTYPE_UNKNOWN = 0; - public static final short SVG_STITCHTYPE_STITCH = 1; - public static final short SVG_STITCHTYPE_NOSTITCH = 2; - - public SVGAnimatedNumber getBaseFrequencyX( ); - public SVGAnimatedNumber getBaseFrequencyY( ); - public SVGAnimatedInteger getNumOctaves( ); - public SVGAnimatedNumber getSeed( ); - public SVGAnimatedEnumeration getStitchTiles( ); - public SVGAnimatedEnumeration getType( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFilterElement.java b/src/bind/java/org/w3c/dom/svg/SVGFilterElement.java deleted file mode 100644 index 01e57fdf2..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFilterElement.java +++ /dev/null @@ -1,21 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFilterElement extends - SVGElement, - SVGURIReference, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGStylable, - SVGUnitTypes { - public SVGAnimatedEnumeration getFilterUnits( ); - public SVGAnimatedEnumeration getPrimitiveUnits( ); - public SVGAnimatedLength getX( ); - public SVGAnimatedLength getY( ); - public SVGAnimatedLength getWidth( ); - public SVGAnimatedLength getHeight( ); - public SVGAnimatedInteger getFilterResX( ); - public SVGAnimatedInteger getFilterResY( ); - - public void setFilterRes ( int filterResX, int filterResY ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFilterPrimitiveStandardAttributes.java b/src/bind/java/org/w3c/dom/svg/SVGFilterPrimitiveStandardAttributes.java deleted file mode 100644 index cd7ed6276..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFilterPrimitiveStandardAttributes.java +++ /dev/null @@ -1,11 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFilterPrimitiveStandardAttributes extends - SVGStylable { - public SVGAnimatedLength getX( ); - public SVGAnimatedLength getY( ); - public SVGAnimatedLength getWidth( ); - public SVGAnimatedLength getHeight( ); - public SVGAnimatedString getResult( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFitToViewBox.java b/src/bind/java/org/w3c/dom/svg/SVGFitToViewBox.java deleted file mode 100644 index d40c6a1a4..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFitToViewBox.java +++ /dev/null @@ -1,7 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFitToViewBox { - public SVGAnimatedRect getViewBox( ); - public SVGAnimatedPreserveAspectRatio getPreserveAspectRatio( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFontElement.java b/src/bind/java/org/w3c/dom/svg/SVGFontElement.java deleted file mode 100644 index e11dc355e..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFontElement.java +++ /dev/null @@ -1,8 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFontElement extends - SVGElement, - SVGExternalResourcesRequired, - SVGStylable { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFontFaceElement.java b/src/bind/java/org/w3c/dom/svg/SVGFontFaceElement.java deleted file mode 100644 index b201c9456..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFontFaceElement.java +++ /dev/null @@ -1,6 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFontFaceElement extends - SVGElement { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFontFaceFormatElement.java b/src/bind/java/org/w3c/dom/svg/SVGFontFaceFormatElement.java deleted file mode 100644 index 895cd6c77..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFontFaceFormatElement.java +++ /dev/null @@ -1,6 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFontFaceFormatElement extends - SVGElement { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFontFaceNameElement.java b/src/bind/java/org/w3c/dom/svg/SVGFontFaceNameElement.java deleted file mode 100644 index 723370a07..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFontFaceNameElement.java +++ /dev/null @@ -1,6 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFontFaceNameElement extends - SVGElement { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFontFaceSrcElement.java b/src/bind/java/org/w3c/dom/svg/SVGFontFaceSrcElement.java deleted file mode 100644 index dcc898b6f..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFontFaceSrcElement.java +++ /dev/null @@ -1,6 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFontFaceSrcElement extends - SVGElement { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGFontFaceUriElement.java b/src/bind/java/org/w3c/dom/svg/SVGFontFaceUriElement.java deleted file mode 100644 index 39dd039e9..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGFontFaceUriElement.java +++ /dev/null @@ -1,6 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGFontFaceUriElement extends - SVGElement { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGForeignObjectElement.java b/src/bind/java/org/w3c/dom/svg/SVGForeignObjectElement.java deleted file mode 100644 index 49e37af09..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGForeignObjectElement.java +++ /dev/null @@ -1,18 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.events.EventTarget; - -public interface SVGForeignObjectElement extends - SVGElement, - SVGTests, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGStylable, - SVGTransformable, - EventTarget { - public SVGAnimatedLength getX( ); - public SVGAnimatedLength getY( ); - public SVGAnimatedLength getWidth( ); - public SVGAnimatedLength getHeight( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGGElement.java b/src/bind/java/org/w3c/dom/svg/SVGGElement.java deleted file mode 100644 index e9a78190e..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGGElement.java +++ /dev/null @@ -1,14 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.events.EventTarget; - -public interface SVGGElement extends - SVGElement, - SVGTests, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGStylable, - SVGTransformable, - EventTarget { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGGlyphElement.java b/src/bind/java/org/w3c/dom/svg/SVGGlyphElement.java deleted file mode 100644 index 9354bb74d..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGGlyphElement.java +++ /dev/null @@ -1,7 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGGlyphElement extends - SVGElement, - SVGStylable { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGGlyphRefElement.java b/src/bind/java/org/w3c/dom/svg/SVGGlyphRefElement.java deleted file mode 100644 index c16aaa1cb..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGGlyphRefElement.java +++ /dev/null @@ -1,28 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGGlyphRefElement extends - SVGElement, - SVGURIReference, - SVGStylable { - public String getGlyphRef( ); - public void setGlyphRef( String glyphRef ) - throws DOMException; - public String getFormat( ); - public void setFormat( String format ) - throws DOMException; - public float getX( ); - public void setX( float x ) - throws DOMException; - public float getY( ); - public void setY( float y ) - throws DOMException; - public float getDx( ); - public void setDx( float dx ) - throws DOMException; - public float getDy( ); - public void setDy( float dy ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGGradientElement.java b/src/bind/java/org/w3c/dom/svg/SVGGradientElement.java deleted file mode 100644 index 8cbc03f1c..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGGradientElement.java +++ /dev/null @@ -1,19 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGGradientElement extends - SVGElement, - SVGURIReference, - SVGExternalResourcesRequired, - SVGStylable, - SVGUnitTypes { - // Spread Method Types - public static final short SVG_SPREADMETHOD_UNKNOWN = 0; - public static final short SVG_SPREADMETHOD_PAD = 1; - public static final short SVG_SPREADMETHOD_REFLECT = 2; - public static final short SVG_SPREADMETHOD_REPEAT = 3; - - public SVGAnimatedEnumeration getGradientUnits( ); - public SVGAnimatedTransformList getGradientTransform( ); - public SVGAnimatedEnumeration getSpreadMethod( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGHKernElement.java b/src/bind/java/org/w3c/dom/svg/SVGHKernElement.java deleted file mode 100644 index ca527b67c..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGHKernElement.java +++ /dev/null @@ -1,6 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGHKernElement extends - SVGElement { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGICCColor.java b/src/bind/java/org/w3c/dom/svg/SVGICCColor.java deleted file mode 100644 index e04962838..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGICCColor.java +++ /dev/null @@ -1,10 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; -public interface SVGICCColor { - public String getColorProfile( ); - public void setColorProfile( String colorProfile ) - throws DOMException; - public SVGNumberList getColors( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGImageElement.java b/src/bind/java/org/w3c/dom/svg/SVGImageElement.java deleted file mode 100644 index f77101f91..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGImageElement.java +++ /dev/null @@ -1,20 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.events.EventTarget; - -public interface SVGImageElement extends - SVGElement, - SVGURIReference, - SVGTests, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGStylable, - SVGTransformable, - EventTarget { - public SVGAnimatedLength getX( ); - public SVGAnimatedLength getY( ); - public SVGAnimatedLength getWidth( ); - public SVGAnimatedLength getHeight( ); - public SVGAnimatedPreserveAspectRatio getPreserveAspectRatio( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGLangSpace.java b/src/bind/java/org/w3c/dom/svg/SVGLangSpace.java deleted file mode 100644 index 300d52725..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGLangSpace.java +++ /dev/null @@ -1,13 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGLangSpace { - public String getXMLlang( ); - public void setXMLlang( String xmllang ) - throws DOMException; - public String getXMLspace( ); - public void setXMLspace( String xmlspace ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGLength.java b/src/bind/java/org/w3c/dom/svg/SVGLength.java deleted file mode 100644 index 88b7bdd38..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGLength.java +++ /dev/null @@ -1,32 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; -public interface SVGLength { - // Length Unit Types - public static final short SVG_LENGTHTYPE_UNKNOWN = 0; - public static final short SVG_LENGTHTYPE_NUMBER = 1; - public static final short SVG_LENGTHTYPE_PERCENTAGE = 2; - public static final short SVG_LENGTHTYPE_EMS = 3; - public static final short SVG_LENGTHTYPE_EXS = 4; - public static final short SVG_LENGTHTYPE_PX = 5; - public static final short SVG_LENGTHTYPE_CM = 6; - public static final short SVG_LENGTHTYPE_MM = 7; - public static final short SVG_LENGTHTYPE_IN = 8; - public static final short SVG_LENGTHTYPE_PT = 9; - public static final short SVG_LENGTHTYPE_PC = 10; - - public short getUnitType( ); - public float getValue( ); - public void setValue( float value ) - throws DOMException; - public float getValueInSpecifiedUnits( ); - public void setValueInSpecifiedUnits( float valueInSpecifiedUnits ) - throws DOMException; - public String getValueAsString( ); - public void setValueAsString( String valueAsString ) - throws DOMException; - - public void newValueSpecifiedUnits ( short unitType, float valueInSpecifiedUnits ); - public void convertToSpecifiedUnits ( short unitType ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGLengthList.java b/src/bind/java/org/w3c/dom/svg/SVGLengthList.java deleted file mode 100644 index ba4c259e8..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGLengthList.java +++ /dev/null @@ -1,23 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGLengthList { - public int getNumberOfItems( ); - - public void clear ( ) - throws DOMException; - public SVGLength initialize ( SVGLength newItem ) - throws DOMException, SVGException; - public SVGLength getItem ( int index ) - throws DOMException; - public SVGLength insertItemBefore ( SVGLength newItem, int index ) - throws DOMException, SVGException; - public SVGLength replaceItem ( SVGLength newItem, int index ) - throws DOMException, SVGException; - public SVGLength removeItem ( int index ) - throws DOMException; - public SVGLength appendItem ( SVGLength newItem ) - throws DOMException, SVGException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGLineElement.java b/src/bind/java/org/w3c/dom/svg/SVGLineElement.java deleted file mode 100644 index 45b947cbc..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGLineElement.java +++ /dev/null @@ -1,18 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.events.EventTarget; - -public interface SVGLineElement extends - SVGElement, - SVGTests, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGStylable, - SVGTransformable, - EventTarget { - public SVGAnimatedLength getX1( ); - public SVGAnimatedLength getY1( ); - public SVGAnimatedLength getX2( ); - public SVGAnimatedLength getY2( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGLinearGradientElement.java b/src/bind/java/org/w3c/dom/svg/SVGLinearGradientElement.java deleted file mode 100644 index 189eda2cb..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGLinearGradientElement.java +++ /dev/null @@ -1,10 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGLinearGradientElement extends - SVGGradientElement { - public SVGAnimatedLength getX1( ); - public SVGAnimatedLength getY1( ); - public SVGAnimatedLength getX2( ); - public SVGAnimatedLength getY2( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGLocatable.java b/src/bind/java/org/w3c/dom/svg/SVGLocatable.java deleted file mode 100644 index 618b955eb..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGLocatable.java +++ /dev/null @@ -1,13 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGLocatable { - public SVGElement getNearestViewportElement( ); - public SVGElement getFarthestViewportElement( ); - - public SVGRect getBBox ( ); - public SVGMatrix getCTM ( ); - public SVGMatrix getScreenCTM ( ); - public SVGMatrix getTransformToElement ( SVGElement element ) - throws SVGException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGMPathElement.java b/src/bind/java/org/w3c/dom/svg/SVGMPathElement.java deleted file mode 100644 index 36032385b..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGMPathElement.java +++ /dev/null @@ -1,8 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGMPathElement extends - SVGElement, - SVGURIReference, - SVGExternalResourcesRequired { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGMarkerElement.java b/src/bind/java/org/w3c/dom/svg/SVGMarkerElement.java deleted file mode 100644 index 810ce56f4..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGMarkerElement.java +++ /dev/null @@ -1,29 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGMarkerElement extends - SVGElement, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGStylable, - SVGFitToViewBox { - // Marker Unit Types - public static final short SVG_MARKERUNITS_UNKNOWN = 0; - public static final short SVG_MARKERUNITS_USERSPACEONUSE = 1; - public static final short SVG_MARKERUNITS_STROKEWIDTH = 2; - // Marker Orientation Types - public static final short SVG_MARKER_ORIENT_UNKNOWN = 0; - public static final short SVG_MARKER_ORIENT_AUTO = 1; - public static final short SVG_MARKER_ORIENT_ANGLE = 2; - - public SVGAnimatedLength getRefX( ); - public SVGAnimatedLength getRefY( ); - public SVGAnimatedEnumeration getMarkerUnits( ); - public SVGAnimatedLength getMarkerWidth( ); - public SVGAnimatedLength getMarkerHeight( ); - public SVGAnimatedEnumeration getOrientType( ); - public SVGAnimatedAngle getOrientAngle( ); - - public void setOrientToAuto ( ); - public void setOrientToAngle ( SVGAngle angle ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGMaskElement.java b/src/bind/java/org/w3c/dom/svg/SVGMaskElement.java deleted file mode 100644 index bb3a8651f..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGMaskElement.java +++ /dev/null @@ -1,17 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGMaskElement extends - SVGElement, - SVGTests, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGStylable, - SVGUnitTypes { - public SVGAnimatedEnumeration getMaskUnits( ); - public SVGAnimatedEnumeration getMaskContentUnits( ); - public SVGAnimatedLength getX( ); - public SVGAnimatedLength getY( ); - public SVGAnimatedLength getWidth( ); - public SVGAnimatedLength getHeight( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGMatrix.java b/src/bind/java/org/w3c/dom/svg/SVGMatrix.java deleted file mode 100644 index 652b4e1b0..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGMatrix.java +++ /dev/null @@ -1,39 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGMatrix { - public float getA( ); - public void setA( float a ) - throws DOMException; - public float getB( ); - public void setB( float b ) - throws DOMException; - public float getC( ); - public void setC( float c ) - throws DOMException; - public float getD( ); - public void setD( float d ) - throws DOMException; - public float getE( ); - public void setE( float e ) - throws DOMException; - public float getF( ); - public void setF( float f ) - throws DOMException; - - public SVGMatrix multiply ( SVGMatrix secondMatrix ); - public SVGMatrix inverse ( ) - throws SVGException; - public SVGMatrix translate ( float x, float y ); - public SVGMatrix scale ( float scaleFactor ); - public SVGMatrix scaleNonUniform ( float scaleFactorX, float scaleFactorY ); - public SVGMatrix rotate ( float angle ); - public SVGMatrix rotateFromVector ( float x, float y ) - throws SVGException; - public SVGMatrix flipX ( ); - public SVGMatrix flipY ( ); - public SVGMatrix skewX ( float angle ); - public SVGMatrix skewY ( float angle ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGMetadataElement.java b/src/bind/java/org/w3c/dom/svg/SVGMetadataElement.java deleted file mode 100644 index d8485d124..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGMetadataElement.java +++ /dev/null @@ -1,6 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGMetadataElement extends - SVGElement { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGMissingGlyphElement.java b/src/bind/java/org/w3c/dom/svg/SVGMissingGlyphElement.java deleted file mode 100644 index 8c777fb2a..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGMissingGlyphElement.java +++ /dev/null @@ -1,7 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGMissingGlyphElement extends - SVGElement, - SVGStylable { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGNumber.java b/src/bind/java/org/w3c/dom/svg/SVGNumber.java deleted file mode 100644 index 1dcdc8a23..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGNumber.java +++ /dev/null @@ -1,10 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGNumber { - public float getValue( ); - public void setValue( float value ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGNumberList.java b/src/bind/java/org/w3c/dom/svg/SVGNumberList.java deleted file mode 100644 index a2db146fc..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGNumberList.java +++ /dev/null @@ -1,23 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGNumberList { - public int getNumberOfItems( ); - - public void clear ( ) - throws DOMException; - public SVGNumber initialize ( SVGNumber newItem ) - throws DOMException, SVGException; - public SVGNumber getItem ( int index ) - throws DOMException; - public SVGNumber insertItemBefore ( SVGNumber newItem, int index ) - throws DOMException, SVGException; - public SVGNumber replaceItem ( SVGNumber newItem, int index ) - throws DOMException, SVGException; - public SVGNumber removeItem ( int index ) - throws DOMException; - public SVGNumber appendItem ( SVGNumber newItem ) - throws DOMException, SVGException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPaint.java b/src/bind/java/org/w3c/dom/svg/SVGPaint.java deleted file mode 100644 index 66d54c668..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPaint.java +++ /dev/null @@ -1,26 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.css.RGBColor; - -public interface SVGPaint extends - SVGColor { - // Paint Types - public static final short SVG_PAINTTYPE_UNKNOWN = 0; - public static final short SVG_PAINTTYPE_RGBCOLOR = 1; - public static final short SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR = 2; - public static final short SVG_PAINTTYPE_NONE = 101; - public static final short SVG_PAINTTYPE_CURRENTCOLOR = 102; - public static final short SVG_PAINTTYPE_URI_NONE = 103; - public static final short SVG_PAINTTYPE_URI_CURRENTCOLOR = 104; - public static final short SVG_PAINTTYPE_URI_RGBCOLOR = 105; - public static final short SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR = 106; - public static final short SVG_PAINTTYPE_URI = 107; - - public short getPaintType( ); - public String getUri( ); - - public void setUri ( String uri ); - public void setPaint ( short paintType, String uri, String rgbColor, String iccColor ) - throws SVGException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPathElement.java b/src/bind/java/org/w3c/dom/svg/SVGPathElement.java deleted file mode 100644 index 71efe6d69..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPathElement.java +++ /dev/null @@ -1,39 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.events.EventTarget; - -public interface SVGPathElement extends - SVGElement, - SVGTests, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGStylable, - SVGTransformable, - EventTarget, - SVGAnimatedPathData { - public SVGAnimatedNumber getPathLength( ); - - public float getTotalLength ( ); - public SVGPoint getPointAtLength ( float distance ); - public int getPathSegAtLength ( float distance ); - public SVGPathSegClosePath createSVGPathSegClosePath ( ); - public SVGPathSegMovetoAbs createSVGPathSegMovetoAbs ( float x, float y ); - public SVGPathSegMovetoRel createSVGPathSegMovetoRel ( float x, float y ); - public SVGPathSegLinetoAbs createSVGPathSegLinetoAbs ( float x, float y ); - public SVGPathSegLinetoRel createSVGPathSegLinetoRel ( float x, float y ); - public SVGPathSegCurvetoCubicAbs createSVGPathSegCurvetoCubicAbs ( float x, float y, float x1, float y1, float x2, float y2 ); - public SVGPathSegCurvetoCubicRel createSVGPathSegCurvetoCubicRel ( float x, float y, float x1, float y1, float x2, float y2 ); - public SVGPathSegCurvetoQuadraticAbs createSVGPathSegCurvetoQuadraticAbs ( float x, float y, float x1, float y1 ); - public SVGPathSegCurvetoQuadraticRel createSVGPathSegCurvetoQuadraticRel ( float x, float y, float x1, float y1 ); - public SVGPathSegArcAbs createSVGPathSegArcAbs ( float x, float y, float r1, float r2, float angle, boolean largeArcFlag, boolean sweepFlag ); - public SVGPathSegArcRel createSVGPathSegArcRel ( float x, float y, float r1, float r2, float angle, boolean largeArcFlag, boolean sweepFlag ); - public SVGPathSegLinetoHorizontalAbs createSVGPathSegLinetoHorizontalAbs ( float x ); - public SVGPathSegLinetoHorizontalRel createSVGPathSegLinetoHorizontalRel ( float x ); - public SVGPathSegLinetoVerticalAbs createSVGPathSegLinetoVerticalAbs ( float y ); - public SVGPathSegLinetoVerticalRel createSVGPathSegLinetoVerticalRel ( float y ); - public SVGPathSegCurvetoCubicSmoothAbs createSVGPathSegCurvetoCubicSmoothAbs ( float x, float y, float x2, float y2 ); - public SVGPathSegCurvetoCubicSmoothRel createSVGPathSegCurvetoCubicSmoothRel ( float x, float y, float x2, float y2 ); - public SVGPathSegCurvetoQuadraticSmoothAbs createSVGPathSegCurvetoQuadraticSmoothAbs ( float x, float y ); - public SVGPathSegCurvetoQuadraticSmoothRel createSVGPathSegCurvetoQuadraticSmoothRel ( float x, float y ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPathSeg.java b/src/bind/java/org/w3c/dom/svg/SVGPathSeg.java deleted file mode 100644 index dea607e41..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPathSeg.java +++ /dev/null @@ -1,29 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGPathSeg { - // Path Segment Types - public static final short PATHSEG_UNKNOWN = 0; - public static final short PATHSEG_CLOSEPATH = 1; - public static final short PATHSEG_MOVETO_ABS = 2; - public static final short PATHSEG_MOVETO_REL = 3; - public static final short PATHSEG_LINETO_ABS = 4; - public static final short PATHSEG_LINETO_REL = 5; - public static final short PATHSEG_CURVETO_CUBIC_ABS = 6; - public static final short PATHSEG_CURVETO_CUBIC_REL = 7; - public static final short PATHSEG_CURVETO_QUADRATIC_ABS = 8; - public static final short PATHSEG_CURVETO_QUADRATIC_REL = 9; - public static final short PATHSEG_ARC_ABS = 10; - public static final short PATHSEG_ARC_REL = 11; - public static final short PATHSEG_LINETO_HORIZONTAL_ABS = 12; - public static final short PATHSEG_LINETO_HORIZONTAL_REL = 13; - public static final short PATHSEG_LINETO_VERTICAL_ABS = 14; - public static final short PATHSEG_LINETO_VERTICAL_REL = 15; - public static final short PATHSEG_CURVETO_CUBIC_SMOOTH_ABS = 16; - public static final short PATHSEG_CURVETO_CUBIC_SMOOTH_REL = 17; - public static final short PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18; - public static final short PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19; - - public short getPathSegType( ); - public String getPathSegTypeAsLetter( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPathSegArcAbs.java b/src/bind/java/org/w3c/dom/svg/SVGPathSegArcAbs.java deleted file mode 100644 index 84c2e7e2b..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPathSegArcAbs.java +++ /dev/null @@ -1,29 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGPathSegArcAbs extends - SVGPathSeg { - public float getX( ); - public void setX( float x ) - throws DOMException; - public float getY( ); - public void setY( float y ) - throws DOMException; - public float getR1( ); - public void setR1( float r1 ) - throws DOMException; - public float getR2( ); - public void setR2( float r2 ) - throws DOMException; - public float getAngle( ); - public void setAngle( float angle ) - throws DOMException; - public boolean getLargeArcFlag( ); - public void setLargeArcFlag( boolean largeArcFlag ) - throws DOMException; - public boolean getSweepFlag( ); - public void setSweepFlag( boolean sweepFlag ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPathSegArcRel.java b/src/bind/java/org/w3c/dom/svg/SVGPathSegArcRel.java deleted file mode 100644 index 074bb799c..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPathSegArcRel.java +++ /dev/null @@ -1,29 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGPathSegArcRel extends - SVGPathSeg { - public float getX( ); - public void setX( float x ) - throws DOMException; - public float getY( ); - public void setY( float y ) - throws DOMException; - public float getR1( ); - public void setR1( float r1 ) - throws DOMException; - public float getR2( ); - public void setR2( float r2 ) - throws DOMException; - public float getAngle( ); - public void setAngle( float angle ) - throws DOMException; - public boolean getLargeArcFlag( ); - public void setLargeArcFlag( boolean largeArcFlag ) - throws DOMException; - public boolean getSweepFlag( ); - public void setSweepFlag( boolean sweepFlag ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPathSegClosePath.java b/src/bind/java/org/w3c/dom/svg/SVGPathSegClosePath.java deleted file mode 100644 index 9beb4667d..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPathSegClosePath.java +++ /dev/null @@ -1,6 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGPathSegClosePath extends - SVGPathSeg { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoCubicAbs.java b/src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoCubicAbs.java deleted file mode 100644 index 9aeec16d6..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoCubicAbs.java +++ /dev/null @@ -1,26 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGPathSegCurvetoCubicAbs extends - SVGPathSeg { - public float getX( ); - public void setX( float x ) - throws DOMException; - public float getY( ); - public void setY( float y ) - throws DOMException; - public float getX1( ); - public void setX1( float x1 ) - throws DOMException; - public float getY1( ); - public void setY1( float y1 ) - throws DOMException; - public float getX2( ); - public void setX2( float x2 ) - throws DOMException; - public float getY2( ); - public void setY2( float y2 ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoCubicRel.java b/src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoCubicRel.java deleted file mode 100644 index 890d98ef7..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoCubicRel.java +++ /dev/null @@ -1,26 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGPathSegCurvetoCubicRel extends - SVGPathSeg { - public float getX( ); - public void setX( float x ) - throws DOMException; - public float getY( ); - public void setY( float y ) - throws DOMException; - public float getX1( ); - public void setX1( float x1 ) - throws DOMException; - public float getY1( ); - public void setY1( float y1 ) - throws DOMException; - public float getX2( ); - public void setX2( float x2 ) - throws DOMException; - public float getY2( ); - public void setY2( float y2 ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoCubicSmoothAbs.java b/src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoCubicSmoothAbs.java deleted file mode 100644 index ede2644d8..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoCubicSmoothAbs.java +++ /dev/null @@ -1,20 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGPathSegCurvetoCubicSmoothAbs extends - SVGPathSeg { - public float getX( ); - public void setX( float x ) - throws DOMException; - public float getY( ); - public void setY( float y ) - throws DOMException; - public float getX2( ); - public void setX2( float x2 ) - throws DOMException; - public float getY2( ); - public void setY2( float y2 ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoCubicSmoothRel.java b/src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoCubicSmoothRel.java deleted file mode 100644 index 2336ad699..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoCubicSmoothRel.java +++ /dev/null @@ -1,20 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGPathSegCurvetoCubicSmoothRel extends - SVGPathSeg { - public float getX( ); - public void setX( float x ) - throws DOMException; - public float getY( ); - public void setY( float y ) - throws DOMException; - public float getX2( ); - public void setX2( float x2 ) - throws DOMException; - public float getY2( ); - public void setY2( float y2 ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoQuadraticAbs.java b/src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoQuadraticAbs.java deleted file mode 100644 index 9e3d742da..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoQuadraticAbs.java +++ /dev/null @@ -1,20 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGPathSegCurvetoQuadraticAbs extends - SVGPathSeg { - public float getX( ); - public void setX( float x ) - throws DOMException; - public float getY( ); - public void setY( float y ) - throws DOMException; - public float getX1( ); - public void setX1( float x1 ) - throws DOMException; - public float getY1( ); - public void setY1( float y1 ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoQuadraticRel.java b/src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoQuadraticRel.java deleted file mode 100644 index bf2add7f4..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoQuadraticRel.java +++ /dev/null @@ -1,20 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGPathSegCurvetoQuadraticRel extends - SVGPathSeg { - public float getX( ); - public void setX( float x ) - throws DOMException; - public float getY( ); - public void setY( float y ) - throws DOMException; - public float getX1( ); - public void setX1( float x1 ) - throws DOMException; - public float getY1( ); - public void setY1( float y1 ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoQuadraticSmoothAbs.java b/src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoQuadraticSmoothAbs.java deleted file mode 100644 index de08156cc..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoQuadraticSmoothAbs.java +++ /dev/null @@ -1,14 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGPathSegCurvetoQuadraticSmoothAbs extends - SVGPathSeg { - public float getX( ); - public void setX( float x ) - throws DOMException; - public float getY( ); - public void setY( float y ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoQuadraticSmoothRel.java b/src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoQuadraticSmoothRel.java deleted file mode 100644 index 2e434493e..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPathSegCurvetoQuadraticSmoothRel.java +++ /dev/null @@ -1,14 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGPathSegCurvetoQuadraticSmoothRel extends - SVGPathSeg { - public float getX( ); - public void setX( float x ) - throws DOMException; - public float getY( ); - public void setY( float y ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPathSegLinetoAbs.java b/src/bind/java/org/w3c/dom/svg/SVGPathSegLinetoAbs.java deleted file mode 100644 index e9d666f6c..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPathSegLinetoAbs.java +++ /dev/null @@ -1,14 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGPathSegLinetoAbs extends - SVGPathSeg { - public float getX( ); - public void setX( float x ) - throws DOMException; - public float getY( ); - public void setY( float y ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPathSegLinetoHorizontalAbs.java b/src/bind/java/org/w3c/dom/svg/SVGPathSegLinetoHorizontalAbs.java deleted file mode 100644 index 6a30564d8..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPathSegLinetoHorizontalAbs.java +++ /dev/null @@ -1,11 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGPathSegLinetoHorizontalAbs extends - SVGPathSeg { - public float getX( ); - public void setX( float x ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPathSegLinetoHorizontalRel.java b/src/bind/java/org/w3c/dom/svg/SVGPathSegLinetoHorizontalRel.java deleted file mode 100644 index 353dd607e..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPathSegLinetoHorizontalRel.java +++ /dev/null @@ -1,11 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGPathSegLinetoHorizontalRel extends - SVGPathSeg { - public float getX( ); - public void setX( float x ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPathSegLinetoRel.java b/src/bind/java/org/w3c/dom/svg/SVGPathSegLinetoRel.java deleted file mode 100644 index f41da3905..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPathSegLinetoRel.java +++ /dev/null @@ -1,14 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGPathSegLinetoRel extends - SVGPathSeg { - public float getX( ); - public void setX( float x ) - throws DOMException; - public float getY( ); - public void setY( float y ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPathSegLinetoVerticalAbs.java b/src/bind/java/org/w3c/dom/svg/SVGPathSegLinetoVerticalAbs.java deleted file mode 100644 index 77d4e70fe..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPathSegLinetoVerticalAbs.java +++ /dev/null @@ -1,11 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGPathSegLinetoVerticalAbs extends - SVGPathSeg { - public float getY( ); - public void setY( float y ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPathSegLinetoVerticalRel.java b/src/bind/java/org/w3c/dom/svg/SVGPathSegLinetoVerticalRel.java deleted file mode 100644 index fc46adcfe..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPathSegLinetoVerticalRel.java +++ /dev/null @@ -1,11 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGPathSegLinetoVerticalRel extends - SVGPathSeg { - public float getY( ); - public void setY( float y ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPathSegList.java b/src/bind/java/org/w3c/dom/svg/SVGPathSegList.java deleted file mode 100644 index f5005e7c3..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPathSegList.java +++ /dev/null @@ -1,23 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGPathSegList { - public int getNumberOfItems( ); - - public void clear ( ) - throws DOMException; - public SVGPathSeg initialize ( SVGPathSeg newItem ) - throws DOMException, SVGException; - public SVGPathSeg getItem ( int index ) - throws DOMException; - public SVGPathSeg insertItemBefore ( SVGPathSeg newItem, int index ) - throws DOMException, SVGException; - public SVGPathSeg replaceItem ( SVGPathSeg newItem, int index ) - throws DOMException, SVGException; - public SVGPathSeg removeItem ( int index ) - throws DOMException; - public SVGPathSeg appendItem ( SVGPathSeg newItem ) - throws DOMException, SVGException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPathSegMovetoAbs.java b/src/bind/java/org/w3c/dom/svg/SVGPathSegMovetoAbs.java deleted file mode 100644 index 80642f5b3..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPathSegMovetoAbs.java +++ /dev/null @@ -1,14 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGPathSegMovetoAbs extends - SVGPathSeg { - public float getX( ); - public void setX( float x ) - throws DOMException; - public float getY( ); - public void setY( float y ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPathSegMovetoRel.java b/src/bind/java/org/w3c/dom/svg/SVGPathSegMovetoRel.java deleted file mode 100644 index 405c56fbc..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPathSegMovetoRel.java +++ /dev/null @@ -1,14 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGPathSegMovetoRel extends - SVGPathSeg { - public float getX( ); - public void setX( float x ) - throws DOMException; - public float getY( ); - public void setY( float y ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPatternElement.java b/src/bind/java/org/w3c/dom/svg/SVGPatternElement.java deleted file mode 100644 index cfa147173..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPatternElement.java +++ /dev/null @@ -1,20 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGPatternElement extends - SVGElement, - SVGURIReference, - SVGTests, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGStylable, - SVGFitToViewBox, - SVGUnitTypes { - public SVGAnimatedEnumeration getPatternUnits( ); - public SVGAnimatedEnumeration getPatternContentUnits( ); - public SVGAnimatedTransformList getPatternTransform( ); - public SVGAnimatedLength getX( ); - public SVGAnimatedLength getY( ); - public SVGAnimatedLength getWidth( ); - public SVGAnimatedLength getHeight( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPoint.java b/src/bind/java/org/w3c/dom/svg/SVGPoint.java deleted file mode 100644 index 982576cd2..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPoint.java +++ /dev/null @@ -1,15 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGPoint { - public float getX( ); - public void setX( float x ) - throws DOMException; - public float getY( ); - public void setY( float y ) - throws DOMException; - - public SVGPoint matrixTransform ( SVGMatrix matrix ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPointList.java b/src/bind/java/org/w3c/dom/svg/SVGPointList.java deleted file mode 100644 index 8fe262a9e..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPointList.java +++ /dev/null @@ -1,23 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGPointList { - public int getNumberOfItems( ); - - public void clear ( ) - throws DOMException; - public SVGPoint initialize ( SVGPoint newItem ) - throws DOMException, SVGException; - public SVGPoint getItem ( int index ) - throws DOMException; - public SVGPoint insertItemBefore ( SVGPoint newItem, int index ) - throws DOMException, SVGException; - public SVGPoint replaceItem ( SVGPoint newItem, int index ) - throws DOMException, SVGException; - public SVGPoint removeItem ( int index ) - throws DOMException; - public SVGPoint appendItem ( SVGPoint newItem ) - throws DOMException, SVGException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPolygonElement.java b/src/bind/java/org/w3c/dom/svg/SVGPolygonElement.java deleted file mode 100644 index 6171fb69c..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPolygonElement.java +++ /dev/null @@ -1,15 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.events.EventTarget; - -public interface SVGPolygonElement extends - SVGElement, - SVGTests, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGStylable, - SVGTransformable, - EventTarget, - SVGAnimatedPoints { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPolylineElement.java b/src/bind/java/org/w3c/dom/svg/SVGPolylineElement.java deleted file mode 100644 index 9fad2ab31..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPolylineElement.java +++ /dev/null @@ -1,15 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.events.EventTarget; - -public interface SVGPolylineElement extends - SVGElement, - SVGTests, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGStylable, - SVGTransformable, - EventTarget, - SVGAnimatedPoints { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGPreserveAspectRatio.java b/src/bind/java/org/w3c/dom/svg/SVGPreserveAspectRatio.java deleted file mode 100644 index 919569dac..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGPreserveAspectRatio.java +++ /dev/null @@ -1,30 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGPreserveAspectRatio { - // Alignment Types - public static final short SVG_PRESERVEASPECTRATIO_UNKNOWN = 0; - public static final short SVG_PRESERVEASPECTRATIO_NONE = 1; - public static final short SVG_PRESERVEASPECTRATIO_XMINYMIN = 2; - public static final short SVG_PRESERVEASPECTRATIO_XMIDYMIN = 3; - public static final short SVG_PRESERVEASPECTRATIO_XMAXYMIN = 4; - public static final short SVG_PRESERVEASPECTRATIO_XMINYMID = 5; - public static final short SVG_PRESERVEASPECTRATIO_XMIDYMID = 6; - public static final short SVG_PRESERVEASPECTRATIO_XMAXYMID = 7; - public static final short SVG_PRESERVEASPECTRATIO_XMINYMAX = 8; - public static final short SVG_PRESERVEASPECTRATIO_XMIDYMAX = 9; - public static final short SVG_PRESERVEASPECTRATIO_XMAXYMAX = 10; - // Meet-or-slice Types - public static final short SVG_MEETORSLICE_UNKNOWN = 0; - public static final short SVG_MEETORSLICE_MEET = 1; - public static final short SVG_MEETORSLICE_SLICE = 2; - - public short getAlign( ); - public void setAlign( short align ) - throws DOMException; - public short getMeetOrSlice( ); - public void setMeetOrSlice( short meetOrSlice ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGRadialGradientElement.java b/src/bind/java/org/w3c/dom/svg/SVGRadialGradientElement.java deleted file mode 100644 index 6c8af9294..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGRadialGradientElement.java +++ /dev/null @@ -1,11 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGRadialGradientElement extends - SVGGradientElement { - public SVGAnimatedLength getCx( ); - public SVGAnimatedLength getCy( ); - public SVGAnimatedLength getR( ); - public SVGAnimatedLength getFx( ); - public SVGAnimatedLength getFy( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGRect.java b/src/bind/java/org/w3c/dom/svg/SVGRect.java deleted file mode 100644 index fd6de0603..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGRect.java +++ /dev/null @@ -1,19 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGRect { - public float getX( ); - public void setX( float x ) - throws DOMException; - public float getY( ); - public void setY( float y ) - throws DOMException; - public float getWidth( ); - public void setWidth( float width ) - throws DOMException; - public float getHeight( ); - public void setHeight( float height ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGRectElement.java b/src/bind/java/org/w3c/dom/svg/SVGRectElement.java deleted file mode 100644 index 4c79150f3..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGRectElement.java +++ /dev/null @@ -1,20 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.events.EventTarget; - -public interface SVGRectElement extends - SVGElement, - SVGTests, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGStylable, - SVGTransformable, - EventTarget { - public SVGAnimatedLength getX( ); - public SVGAnimatedLength getY( ); - public SVGAnimatedLength getWidth( ); - public SVGAnimatedLength getHeight( ); - public SVGAnimatedLength getRx( ); - public SVGAnimatedLength getRy( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGRenderingIntent.java b/src/bind/java/org/w3c/dom/svg/SVGRenderingIntent.java deleted file mode 100644 index fc46f9f79..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGRenderingIntent.java +++ /dev/null @@ -1,12 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGRenderingIntent { - // Rendering Intent Types - public static final short RENDERING_INTENT_UNKNOWN = 0; - public static final short RENDERING_INTENT_AUTO = 1; - public static final short RENDERING_INTENT_PERCEPTUAL = 2; - public static final short RENDERING_INTENT_RELATIVE_COLORIMETRIC = 3; - public static final short RENDERING_INTENT_SATURATION = 4; - public static final short RENDERING_INTENT_ABSOLUTE_COLORIMETRIC = 5; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGSVGElement.java b/src/bind/java/org/w3c/dom/svg/SVGSVGElement.java deleted file mode 100644 index 6507a1304..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGSVGElement.java +++ /dev/null @@ -1,74 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.events.DocumentEvent; -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.DOMException; -import org.w3c.dom.NodeList; -import org.w3c.dom.Element; -import org.w3c.dom.css.ViewCSS; -import org.w3c.dom.css.DocumentCSS; -import org.w3c.dom.css.RGBColor; - -public interface SVGSVGElement extends - SVGElement, - SVGTests, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGStylable, - SVGLocatable, - SVGFitToViewBox, - SVGZoomAndPan, - EventTarget, - DocumentEvent, - ViewCSS, - DocumentCSS { - public SVGAnimatedLength getX( ); - public SVGAnimatedLength getY( ); - public SVGAnimatedLength getWidth( ); - public SVGAnimatedLength getHeight( ); - public String getContentScriptType( ); - public void setContentScriptType( String contentScriptType ) - throws DOMException; - public String getContentStyleType( ); - public void setContentStyleType( String contentStyleType ) - throws DOMException; - public SVGRect getViewport( ); - public float getPixelUnitToMillimeterX( ); - public float getPixelUnitToMillimeterY( ); - public float getScreenPixelToMillimeterX( ); - public float getScreenPixelToMillimeterY( ); - public boolean getUseCurrentView( ); - public void setUseCurrentView( boolean useCurrentView ) - throws DOMException; - public SVGViewSpec getCurrentView( ); - public float getCurrentScale( ); - public void setCurrentScale( float currentScale ) - throws DOMException; - public SVGPoint getCurrentTranslate( ); - - public int suspendRedraw ( int max_wait_milliseconds ); - public void unsuspendRedraw ( int suspend_handle_id ) - throws DOMException; - public void unsuspendRedrawAll ( ); - public void forceRedraw ( ); - public void pauseAnimations ( ); - public void unpauseAnimations ( ); - public boolean animationsPaused ( ); - public float getCurrentTime ( ); - public void setCurrentTime ( float seconds ); - public NodeList getIntersectionList ( SVGRect rect, SVGElement referenceElement ); - public NodeList getEnclosureList ( SVGRect rect, SVGElement referenceElement ); - public boolean checkIntersection ( SVGElement element, SVGRect rect ); - public boolean checkEnclosure ( SVGElement element, SVGRect rect ); - public void deselectAll ( ); - public SVGNumber createSVGNumber ( ); - public SVGLength createSVGLength ( ); - public SVGAngle createSVGAngle ( ); - public SVGPoint createSVGPoint ( ); - public SVGMatrix createSVGMatrix ( ); - public SVGRect createSVGRect ( ); - public SVGTransform createSVGTransform ( ); - public SVGTransform createSVGTransformFromMatrix ( SVGMatrix matrix ); - public Element getElementById ( String elementId ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGScriptElement.java b/src/bind/java/org/w3c/dom/svg/SVGScriptElement.java deleted file mode 100644 index 14863e6eb..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGScriptElement.java +++ /dev/null @@ -1,13 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGScriptElement extends - SVGElement, - SVGURIReference, - SVGExternalResourcesRequired { - public String getType( ); - public void setType( String type ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGSetElement.java b/src/bind/java/org/w3c/dom/svg/SVGSetElement.java deleted file mode 100644 index 0ca9c09ef..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGSetElement.java +++ /dev/null @@ -1,6 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGSetElement extends - SVGAnimationElement { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGStopElement.java b/src/bind/java/org/w3c/dom/svg/SVGStopElement.java deleted file mode 100644 index 5865e6e60..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGStopElement.java +++ /dev/null @@ -1,8 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGStopElement extends - SVGElement, - SVGStylable { - public SVGAnimatedNumber getOffset( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGStringList.java b/src/bind/java/org/w3c/dom/svg/SVGStringList.java deleted file mode 100644 index d0fa0df9c..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGStringList.java +++ /dev/null @@ -1,23 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGStringList { - public int getNumberOfItems( ); - - public void clear ( ) - throws DOMException; - public String initialize ( String newItem ) - throws DOMException, SVGException; - public String getItem ( int index ) - throws DOMException; - public String insertItemBefore ( String newItem, int index ) - throws DOMException, SVGException; - public String replaceItem ( String newItem, int index ) - throws DOMException, SVGException; - public String removeItem ( int index ) - throws DOMException; - public String appendItem ( String newItem ) - throws DOMException, SVGException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGStylable.java b/src/bind/java/org/w3c/dom/svg/SVGStylable.java deleted file mode 100644 index 82c4913f8..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGStylable.java +++ /dev/null @@ -1,12 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - -public interface SVGStylable { - public SVGAnimatedString getClassName( ); - public CSSStyleDeclaration getStyle( ); - - public CSSValue getPresentationAttribute ( String name ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGStyleElement.java b/src/bind/java/org/w3c/dom/svg/SVGStyleElement.java deleted file mode 100644 index 1051ef67f..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGStyleElement.java +++ /dev/null @@ -1,20 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGStyleElement extends - SVGElement { - public String getXMLspace( ); - public void setXMLspace( String xmlspace ) - throws DOMException; - public String getType( ); - public void setType( String type ) - throws DOMException; - public String getMedia( ); - public void setMedia( String media ) - throws DOMException; - public String getTitle( ); - public void setTitle( String title ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGSwitchElement.java b/src/bind/java/org/w3c/dom/svg/SVGSwitchElement.java deleted file mode 100644 index c5187563b..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGSwitchElement.java +++ /dev/null @@ -1,14 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.events.EventTarget; - -public interface SVGSwitchElement extends - SVGElement, - SVGTests, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGStylable, - SVGTransformable, - EventTarget { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGSymbolElement.java b/src/bind/java/org/w3c/dom/svg/SVGSymbolElement.java deleted file mode 100644 index ee288bc92..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGSymbolElement.java +++ /dev/null @@ -1,13 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.events.EventTarget; - -public interface SVGSymbolElement extends - SVGElement, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGStylable, - SVGFitToViewBox, - EventTarget { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGTRefElement.java b/src/bind/java/org/w3c/dom/svg/SVGTRefElement.java deleted file mode 100644 index 2d8202ede..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGTRefElement.java +++ /dev/null @@ -1,7 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGTRefElement extends - SVGTextPositioningElement, - SVGURIReference { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGTSpanElement.java b/src/bind/java/org/w3c/dom/svg/SVGTSpanElement.java deleted file mode 100644 index 729b857db..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGTSpanElement.java +++ /dev/null @@ -1,6 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGTSpanElement extends - SVGTextPositioningElement { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGTests.java b/src/bind/java/org/w3c/dom/svg/SVGTests.java deleted file mode 100644 index a7026a5b0..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGTests.java +++ /dev/null @@ -1,10 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGTests { - public SVGStringList getRequiredFeatures( ); - public SVGStringList getRequiredExtensions( ); - public SVGStringList getSystemLanguage( ); - - public boolean hasExtension ( String extension ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGTextContentElement.java b/src/bind/java/org/w3c/dom/svg/SVGTextContentElement.java deleted file mode 100644 index c7c212961..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGTextContentElement.java +++ /dev/null @@ -1,37 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.DOMException; - -public interface SVGTextContentElement extends - SVGElement, - SVGTests, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGStylable, - EventTarget { - // lengthAdjust Types - public static final short LENGTHADJUST_UNKNOWN = 0; - public static final short LENGTHADJUST_SPACING = 1; - public static final short LENGTHADJUST_SPACINGANDGLYPHS = 2; - - public SVGAnimatedLength getTextLength( ); - public SVGAnimatedEnumeration getLengthAdjust( ); - - public int getNumberOfChars ( ); - public float getComputedTextLength ( ); - public float getSubStringLength ( int charnum, int nchars ) - throws DOMException; - public SVGPoint getStartPositionOfChar ( int charnum ) - throws DOMException; - public SVGPoint getEndPositionOfChar ( int charnum ) - throws DOMException; - public SVGRect getExtentOfChar ( int charnum ) - throws DOMException; - public float getRotationOfChar ( int charnum ) - throws DOMException; - public int getCharNumAtPosition ( SVGPoint point ); - public void selectSubString ( int charnum, int nchars ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGTextElement.java b/src/bind/java/org/w3c/dom/svg/SVGTextElement.java deleted file mode 100644 index f25cc3c20..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGTextElement.java +++ /dev/null @@ -1,7 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGTextElement extends - SVGTextPositioningElement, - SVGTransformable { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGTextPathElement.java b/src/bind/java/org/w3c/dom/svg/SVGTextPathElement.java deleted file mode 100644 index 0a8a256ad..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGTextPathElement.java +++ /dev/null @@ -1,19 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGTextPathElement extends - SVGTextContentElement, - SVGURIReference { - // textPath Method Types - public static final short TEXTPATH_METHODTYPE_UNKNOWN = 0; - public static final short TEXTPATH_METHODTYPE_ALIGN = 1; - public static final short TEXTPATH_METHODTYPE_STRETCH = 2; - // textPath Spacing Types - public static final short TEXTPATH_SPACINGTYPE_UNKNOWN = 0; - public static final short TEXTPATH_SPACINGTYPE_AUTO = 1; - public static final short TEXTPATH_SPACINGTYPE_EXACT = 2; - - public SVGAnimatedLength getStartOffset( ); - public SVGAnimatedEnumeration getMethod( ); - public SVGAnimatedEnumeration getSpacing( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGTextPositioningElement.java b/src/bind/java/org/w3c/dom/svg/SVGTextPositioningElement.java deleted file mode 100644 index d47887b8d..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGTextPositioningElement.java +++ /dev/null @@ -1,11 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGTextPositioningElement extends - SVGTextContentElement { - public SVGAnimatedLengthList getX( ); - public SVGAnimatedLengthList getY( ); - public SVGAnimatedLengthList getDx( ); - public SVGAnimatedLengthList getDy( ); - public SVGAnimatedNumberList getRotate( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGTitleElement.java b/src/bind/java/org/w3c/dom/svg/SVGTitleElement.java deleted file mode 100644 index cbf45fe2a..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGTitleElement.java +++ /dev/null @@ -1,8 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGTitleElement extends - SVGElement, - SVGLangSpace, - SVGStylable { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGTransform.java b/src/bind/java/org/w3c/dom/svg/SVGTransform.java deleted file mode 100644 index 16df6080f..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGTransform.java +++ /dev/null @@ -1,24 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGTransform { - // Transform Types - public static final short SVG_TRANSFORM_UNKNOWN = 0; - public static final short SVG_TRANSFORM_MATRIX = 1; - public static final short SVG_TRANSFORM_TRANSLATE = 2; - public static final short SVG_TRANSFORM_SCALE = 3; - public static final short SVG_TRANSFORM_ROTATE = 4; - public static final short SVG_TRANSFORM_SKEWX = 5; - public static final short SVG_TRANSFORM_SKEWY = 6; - - public short getType( ); - public SVGMatrix getMatrix( ); - public float getAngle( ); - - public void setMatrix ( SVGMatrix matrix ); - public void setTranslate ( float tx, float ty ); - public void setScale ( float sx, float sy ); - public void setRotate ( float angle, float cx, float cy ); - public void setSkewX ( float angle ); - public void setSkewY ( float angle ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGTransformList.java b/src/bind/java/org/w3c/dom/svg/SVGTransformList.java deleted file mode 100644 index 3e3a4c217..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGTransformList.java +++ /dev/null @@ -1,25 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGTransformList { - public int getNumberOfItems( ); - - public void clear ( ) - throws DOMException; - public SVGTransform initialize ( SVGTransform newItem ) - throws DOMException, SVGException; - public SVGTransform getItem ( int index ) - throws DOMException; - public SVGTransform insertItemBefore ( SVGTransform newItem, int index ) - throws DOMException, SVGException; - public SVGTransform replaceItem ( SVGTransform newItem, int index ) - throws DOMException, SVGException; - public SVGTransform removeItem ( int index ) - throws DOMException; - public SVGTransform appendItem ( SVGTransform newItem ) - throws DOMException, SVGException; - public SVGTransform createSVGTransformFromMatrix ( SVGMatrix matrix ); - public SVGTransform consolidate ( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGTransformable.java b/src/bind/java/org/w3c/dom/svg/SVGTransformable.java deleted file mode 100644 index 9abaaf0b1..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGTransformable.java +++ /dev/null @@ -1,7 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGTransformable extends - SVGLocatable { - public SVGAnimatedTransformList getTransform( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGURIReference.java b/src/bind/java/org/w3c/dom/svg/SVGURIReference.java deleted file mode 100644 index 3f2f784df..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGURIReference.java +++ /dev/null @@ -1,6 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGURIReference { - public SVGAnimatedString getHref( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGUnitTypes.java b/src/bind/java/org/w3c/dom/svg/SVGUnitTypes.java deleted file mode 100644 index 9fc7685e9..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGUnitTypes.java +++ /dev/null @@ -1,9 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGUnitTypes { - // Unit Types - public static final short SVG_UNIT_TYPE_UNKNOWN = 0; - public static final short SVG_UNIT_TYPE_USERSPACEONUSE = 1; - public static final short SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGUseElement.java b/src/bind/java/org/w3c/dom/svg/SVGUseElement.java deleted file mode 100644 index 3ce448141..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGUseElement.java +++ /dev/null @@ -1,21 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.events.EventTarget; - -public interface SVGUseElement extends - SVGElement, - SVGURIReference, - SVGTests, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGStylable, - SVGTransformable, - EventTarget { - public SVGAnimatedLength getX( ); - public SVGAnimatedLength getY( ); - public SVGAnimatedLength getWidth( ); - public SVGAnimatedLength getHeight( ); - public SVGElementInstance getInstanceRoot( ); - public SVGElementInstance getAnimatedInstanceRoot( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGVKernElement.java b/src/bind/java/org/w3c/dom/svg/SVGVKernElement.java deleted file mode 100644 index cc2e4f4f1..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGVKernElement.java +++ /dev/null @@ -1,6 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGVKernElement extends - SVGElement { -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGViewElement.java b/src/bind/java/org/w3c/dom/svg/SVGViewElement.java deleted file mode 100644 index 08adbecd8..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGViewElement.java +++ /dev/null @@ -1,10 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGViewElement extends - SVGElement, - SVGExternalResourcesRequired, - SVGFitToViewBox, - SVGZoomAndPan { - public SVGStringList getViewTarget( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGViewSpec.java b/src/bind/java/org/w3c/dom/svg/SVGViewSpec.java deleted file mode 100644 index 97ef6bad9..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGViewSpec.java +++ /dev/null @@ -1,13 +0,0 @@ - -package org.w3c.dom.svg; - -public interface SVGViewSpec extends - SVGZoomAndPan, - SVGFitToViewBox { - public SVGTransformList getTransform( ); - public SVGElement getViewTarget( ); - public String getViewBoxString( ); - public String getPreserveAspectRatioString( ); - public String getTransformString( ); - public String getViewTargetString( ); -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGZoomAndPan.java b/src/bind/java/org/w3c/dom/svg/SVGZoomAndPan.java deleted file mode 100644 index f8f910eb4..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGZoomAndPan.java +++ /dev/null @@ -1,15 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.DOMException; - -public interface SVGZoomAndPan { - // Zoom and Pan Types - public static final short SVG_ZOOMANDPAN_UNKNOWN = 0; - public static final short SVG_ZOOMANDPAN_DISABLE = 1; - public static final short SVG_ZOOMANDPAN_MAGNIFY = 2; - - public short getZoomAndPan( ); - public void setZoomAndPan( short zoomAndPan ) - throws DOMException; -} diff --git a/src/bind/java/org/w3c/dom/svg/SVGZoomEvent.java b/src/bind/java/org/w3c/dom/svg/SVGZoomEvent.java deleted file mode 100644 index 7ab430d2b..000000000 --- a/src/bind/java/org/w3c/dom/svg/SVGZoomEvent.java +++ /dev/null @@ -1,13 +0,0 @@ - -package org.w3c.dom.svg; - -import org.w3c.dom.events.UIEvent; - -public interface SVGZoomEvent extends - UIEvent { - public SVGRect getZoomRectScreen( ); - public float getPreviousScale( ); - public SVGPoint getPreviousTranslate( ); - public float getNewScale( ); - public SVGPoint getNewTranslate( ); -} diff --git a/src/bind/java/org/w3c/dom/views/AbstractView.java b/src/bind/java/org/w3c/dom/views/AbstractView.java deleted file mode 100644 index 97e8f0e2b..000000000 --- a/src/bind/java/org/w3c/dom/views/AbstractView.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.views; - -/** - * A base interface that all views shall derive from. - *

See also the Document Object Model (DOM) Level 2 Views Specification. - * @since DOM Level 2 - */ -public interface AbstractView { - /** - * The source DocumentView of which this is an - * AbstractView. - */ - public DocumentView getDocument(); - -} diff --git a/src/bind/java/org/w3c/dom/views/DocumentView.java b/src/bind/java/org/w3c/dom/views/DocumentView.java deleted file mode 100644 index 2cb9eebb8..000000000 --- a/src/bind/java/org/w3c/dom/views/DocumentView.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ - -package org.w3c.dom.views; - -/** - * The DocumentView interface is implemented by - * Document objects in DOM implementations supporting DOM - * Views. It provides an attribute to retrieve the default view of a - * document. - *

See also the Document Object Model (DOM) Level 2 Views Specification. - * @since DOM Level 2 - */ -public interface DocumentView { - /** - * The default AbstractView for this Document, - * or null if none available. - */ - public AbstractView getDefaultView(); - -} diff --git a/src/bind/javabind-private.h b/src/bind/javabind-private.h deleted file mode 100644 index 56ff2e2ff..000000000 --- a/src/bind/javabind-private.h +++ /dev/null @@ -1,147 +0,0 @@ -/** - * @file - * @brief This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - */ -/* - * Authors: - * Bob Jamison - * - * Copyright (C) 2007-2008 Bob Jamison - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef SEEN_JAVABIND_PRIVATE_H -#define SEEN_JAVABIND_PRIVATE_H - -#include -#include "javabind.h" - -namespace Inkscape -{ - -namespace Bind -{ - - -class JavaBinderyImpl : public JavaBindery -{ -public: - - JavaBinderyImpl(); - - virtual ~JavaBinderyImpl(); - - virtual bool loadJVM(); - - virtual bool callStatic(int type, - const String &className, - const String &methodName, - const String &signature, - const std::vector ¶ms, - Value &retval); - - virtual bool callInstance( - int type, - const jobject obj, - const String &methodName, - const String &signature, - const std::vector ¶ms, - Value &retval); - - virtual bool callMain(const String &className, - const std::vector &args); - - virtual bool isLoaded(); - - /** - * - */ - virtual bool scriptRun(const String &lang, const String &script); - - /** - * - */ - virtual bool scriptRunFile(const String &lang, const String &fileName); - - virtual bool showConsole(); - - virtual bool registerNatives(const String &className, - const JNINativeMethod *methods); - - virtual bool doBinding(); - - virtual String getException(); - - virtual bool setupGateway(); - - static JavaBinderyImpl *getInstance(); - - -private: - - JavaVM *jvm; - JNIEnv *env; - jobject gatewayObj; -}; - - -//######################################################################## -//# MESSAGES -//######################################################################## - -void err(const char *fmt, ...); - -void msg(const char *fmt, ...); - -//######################################################################## -//# UTILITY -//######################################################################## - -String normalizePath(const String &str); - -String getExceptionString(JNIEnv *env); - -jint getInt(JNIEnv *env, jobject obj, const char *name); - -void setInt(JNIEnv *env, jobject obj, const char *name, jint val); - -jlong getLong(JNIEnv *env, jobject obj, const char *name); - -void setLong(JNIEnv *env, jobject obj, const char *name, jlong val); - -jfloat getFloat(JNIEnv *env, jobject obj, const char *name); - -void setFloat(JNIEnv *env, jobject obj, const char *name, jfloat val); - -jdouble getDouble(JNIEnv *env, jobject obj, const char *name); - -void setDouble(JNIEnv *env, jobject obj, const char *name, jdouble val); - -String getString(JNIEnv *env, jobject obj, const char *name); - -void setString(JNIEnv *env, jobject obj, const char *name, const String &val); - - - -} // namespace Bind -} // namespace Inkscape - -#endif // SEEN_JAVABIND_PRIVATE_H -//######################################################################## -//# E N D O F F I L E -//######################################################################## - diff --git a/src/bind/javabind.cpp b/src/bind/javabind.cpp deleted file mode 100644 index 8a66bac59..000000000 --- a/src/bind/javabind.cpp +++ /dev/null @@ -1,1209 +0,0 @@ -/** - * @file - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Note: We must limit Java or JVM-specific code to this file - * and to dobinding.cpp. It should be hidden from javabind.h - * - * This file is mostly about getting things up and running, and - * providing the basic C-to-Java hooks. - * - * dobinding.cpp will have the rote and repetitious - * class-by-class binding - */ -/* - * Authors: - * Bob Jamison - * - * Copyright (C) 2007-2008 Bob Jamison - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include -#include -#include -#include - -#include -#include - - -#ifdef __WIN32__ -#include -#else -#include -#include -#endif - -#if HAVE_SYS_STAT_H -#include -#endif - -#include "javabind.h" -#include "javabind-private.h" -#include -#include -#include - -//For repr and document -#include -#include -#include - - - -namespace Inkscape -{ - -namespace Bind -{ - - -//######################################################################## -//# DEFINITIONS -//######################################################################## - -typedef jint (*CreateVMFunc)(JavaVM **, JNIEnv **, void *); - - - -//######################################################################## -//# UTILITY -//######################################################################## - -/** - * Normalize path. Java wants '/', even on Windows - */ -String normalizePath(const String &str) -{ - String buf; - for (unsigned int i=0 ; iGetStringUTFChars(jstr, JNI_FALSE); - String str = chars; - env->ReleaseStringUTFChars(jstr, chars); - return str; -} - - -/** - * Check if the VM has encountered an Exception. If so, get the String for it - * and clear the exception - */ -String getExceptionString(JNIEnv *env) -{ - String buf; - jthrowable exc = env->ExceptionOccurred(); - if (!exc) - return buf; - jclass cls = env->GetObjectClass(exc); - jmethodID mid = env->GetMethodID(cls, "toString", "()Ljava/lang/String;"); - jstring jstr = (jstring) env->CallObjectMethod(exc, mid); - buf.append(getString(env, jstr)); - env->ExceptionClear(); - return buf; -} - -//######################################################################## -//# CONSTRUCTOR/DESTRUCTOR -//######################################################################## - -static JavaBinderyImpl *_instance = NULL; - -JavaBindery *JavaBindery::getInstance() -{ - return JavaBinderyImpl::getInstance(); -} - -JavaBinderyImpl *JavaBinderyImpl::getInstance() -{ - if (!_instance) - { - _instance = new JavaBinderyImpl(); - } - return _instance; -} - -JavaBinderyImpl::JavaBinderyImpl() -{ - jvm = NULL; - env = NULL; - gatewayObj = NULL; -} - -JavaBinderyImpl::~JavaBinderyImpl() -{ -} - - -//######################################################################## -//# MESSAGES -//######################################################################## - -void err(const char *fmt, ...) -{ - va_list args; - g_warning("JavaBinderyImpl err:"); - va_start(args, fmt); - g_logv(G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, fmt, args); - va_end(args); - g_warning("\n"); -} - -void msg(const char *fmt, ...) -{ - va_list args; - g_message("JavaBinderyImpl:"); - va_start(args, fmt); - g_logv(G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, fmt, args); - va_end(args); - g_message("\n"); -} - - - -//######################################################################## -//# W I N 3 2 S T Y L E -//######################################################################## -#ifdef __WIN32__ - - -#define DIR_SEPARATOR "\\" -#define PATH_SEPARATOR ";" - - - -static bool getRegistryString(HKEY /*root*/, const char *keyName, - const char *valName, char *buf, int buflen) -{ - HKEY key; - DWORD bufsiz = buflen; - RegOpenKeyEx(HKEY_LOCAL_MACHINE, keyName, 0, KEY_READ, &key); - int ret = RegQueryValueEx(key, TEXT(valName), - NULL, NULL, (BYTE *)buf, &bufsiz); - if (ret != ERROR_SUCCESS) - { - err("Key '%s\\%s not found\n", keyName, valName); - return false; - } - RegCloseKey(key); - return true; -} - - -static String cleanPath(const String &s) -{ - String buf; - for (unsigned int i=0 ; i=0) - { - //msg("found"); - return jpath; - } - } - return ""; -} - - - -/** - * Attempt to find and load a jvm.dll file. Find the createVM() - * function's address and return it - */ -static CreateVMFunc getCreateVMFunc() -{ - bool found = false; - String libname; - - /** - * First, look for an embedded jre in the .exe's dir. - * This allows us to package our own JRE if we want to. - */ - String inkscapeHome = getExePath(); - inkscapeHome.append("\\jre"); - msg("INKSCAPE_HOME='%s'", inkscapeHome.c_str()); - String path = checkPathUnderRoot(inkscapeHome); - if (path.size() > 0) - { - libname = path; - found = true; - } - - /** - * Next, look for JAVA_HOME. This will allow the user - * to override what's in the registry - */ - if (!found) - { - const char *envStr = getenv("JAVA_HOME"); - if (envStr) - { - String javaHome = cleanPath(envStr); - msg("JAVA_HOME='%s'", javaHome.c_str()); - path = checkPathUnderRoot(javaHome); - if (path.size() > 0) - { - libname = path; - found = true; - } - } - } - - //not at JAVA_HOME. check the registry - if (!found) - { - char verbuf[16]; - char regpath[80]; - strcpy(regpath, "SOFTWARE\\JavaSoft\\Java Runtime Environment"); - bool ret = getRegistryString(HKEY_LOCAL_MACHINE, - regpath, "CurrentVersion", verbuf, 15); - if (!ret) - { - msg("JVM CurrentVersion not found in registry at '%s'", regpath); - } - else - { - strcat(regpath, "\\"); - strcat(regpath, verbuf); - //msg("reg path: %s\n", regpath); - char valbuf[80]; - ret = getRegistryString(HKEY_LOCAL_MACHINE, - regpath, "RuntimeLib", valbuf, 79); - if (ret) - { - found = true; - libname = valbuf; - } - else - { - msg("JVM RuntimeLib not found in registry at '%s'", - regpath); - } - } - } - - if (!found) - { - err("JVM not found at JAVA_HOME or in registry"); - return NULL; - } - - /** - * If we are here, then we seem to have a valid path for jvm.dll - * Give it a try - */ - msg("getCreateVMFunc: Loading JVM: %s", libname.c_str()); - HMODULE lib = LoadLibrary(libname.c_str()); - if (!lib) - { - err("Java VM not found at '%s'", libname.c_str()); - return NULL; - } - CreateVMFunc createVM = (CreateVMFunc)GetProcAddress(lib, "JNI_CreateJavaVM"); - if (!createVM) - { - err("Could not find 'JNI_CreateJavaVM' in shared library '%s'", - libname.c_str()); - return NULL; - } - return createVM; -} - -/** - * Return the directory where the Java classes/libs/resources are - * located - */ -static void getJavaRoot(String &javaroot) -{ - /* - javaroot = getExePath(); - javaroot.append("\\"); - javaroot.append(INKSCAPE_BINDDIR); - javaroot.append("\\java"); - */ - javaroot = INKSCAPE_BINDDIR; - javaroot.append("\\java"); -} - - - - -//######################################################################## -//# U N I X S T Y L E -//######################################################################## -#else /* !__WIN32__ */ - - -#define DIR_SEPARATOR "/" -#define PATH_SEPARATOR ":" - - -/** - * Recursively descend into a directory looking for libjvm.so - */ -static bool findJVMRecursive(const String &dirpath, - std::vector &results) -{ - DIR *dir = opendir(dirpath.c_str()); - if (!dir) - return false; - bool ret = false; - while (true) - { - struct dirent *de = readdir(dir); - if (!de) - break; - String fname = de->d_name; - if (fname == "." || fname == "..") - continue; - String path = dirpath; - path.push_back('/'); - path.append(fname); - if (fname == "libjvm.so") - { - ret = true; - results.push_back(path); - continue; - } - struct stat finfo; - if (lstat(path.c_str(), &finfo)<0) - { - break; - } - if (finfo.st_mode & S_IFDIR) - { - ret |= findJVMRecursive(path, results); - } - } - closedir(dir); - return ret; -} - - -/** - * Some common places on a Unix filesystem where JVMs are - * often found. - */ -static const char *commonJavaPaths[] = -{ - "/usr/lib/jvm/jre", - "/usr/lib/jvm", - "/usr/local/lib/jvm/jre", - "/usr/local/lib/jvm", - "/usr/java", - "/usr/local/java", - NULL -}; - - - -/** - * Look for a Java VM (libjvm.so) in several Unix places - */ -static bool findJVM(String &result) -{ - std::vector results; - bool found = false; - - /* Is there one specified by the user? */ - const char *javaHome = getenv("JAVA_HOME"); - if (javaHome && findJVMRecursive(javaHome, results)) - found = true; - else for (const char **path = commonJavaPaths ; *path ; path++) - { - if (findJVMRecursive(*path, results)) - { - found = true; - break; - } - } - if (!found) - { - return false; - } - if (results.empty()) - return false; - //Look first for a Client VM - for (unsigned int i=0 ; id_name; - if (fname == "." || fname == "..") - continue; - if (fname.size()<5) //x.jar - continue; - if (fname.compare(fname.size()-4, 4, ".jar") != 0) - continue; - - String path = libdir; - path.append(DIR_SEPARATOR); - path.append(fname); - - cp.append(PATH_SEPARATOR); - cp.append(path); - } - closedir(dir); - - result = cp; -} - - - -//======================================================================== -// Gateway -//======================================================================== -/** - * This is provided to scripts can grab the current copy or the - * repr tree. If anyone has a smarter way of doing this, please implement. - */ -static jstring JNICALL documentGet(JNIEnv *env, jobject /*obj*/, jlong /*ptr*/) -{ - //JavaBinderyImpl *bind = (JavaBinderyImpl *)ptr; - String buf = sp_repr_save_buf((SP_ACTIVE_DOCUMENT)->rdoc); - jstring jstr = env->NewStringUTF(buf.c_str()); - return jstr; -} - -/** - * This is provided to scripts can load an XML tree into Inkscape. - * If anyone has a smarter way of doing this, please implement. - */ -static jboolean JNICALL documentSet(JNIEnv */*env*/, jobject /*obj*/, jlong /*ptr*/, jstring /*jstr*/) -{ - /* - JavaBinderyImpl *bind = (JavaBinderyImpl *)ptr; - String s = getString(env, jstr); - SPDocument *doc = sp_document_new_from_mem(s.c_str(), s.size(), true); - */ - return JNI_TRUE; -} - -/** - * This method is used to allow the gateway class to - * redirect its logging stream here. - * For the main C++/Java bindings, see dobinding.cpp - */ -static void JNICALL logWrite(JNIEnv */*env*/, jobject /*obj*/, jlong ptr, jint ch) -{ - JavaBinderyImpl *bind = reinterpret_cast(ptr); - bind->log(ch); -} - - -static JNINativeMethod gatewayMethods[] = -{ -{ (char *)"documentGet", (char *)"(J)Ljava/lang/String;", (void *)documentGet }, -{ (char *)"documentSet", (char *)"(JLjava/lang/String;)Z", (void *)documentSet }, -{ (char *)"logWrite", (char *)"(JI)V", (void *)logWrite }, -{ NULL, NULL, NULL } -}; - - -/** - * This sets up the 'Gateway' java class for execution of - * scripts. The class's constructor takes a jlong. This java long - * is used to store the pointer to 'this'. When ScriptRunner makes - * native calls, it passes that jlong back, so that it can call the - * methods of this C++ class. - */ -bool JavaBinderyImpl::setupGateway() -{ - String className = "org/inkscape/cmn/Gateway"; - if (!registerNatives(className, gatewayMethods)) - { - return false; - } - jclass cls = env->FindClass(className.c_str()); - if (!cls) - { - err("setupGateway: cannot find class '%s' : %s", - className.c_str(), getException().c_str()); - return false; - } - jmethodID mid = env->GetMethodID(cls, "", "(J)V"); - if (!mid) - { - err("setupGateway: cannot find constructor for '%s' : %s", - className.c_str(), getException().c_str()); - return false; - } - gatewayObj = env->NewObject(cls, mid, ((jlong)this)); - if (!gatewayObj) - { - err("setupGateway: cannot construct '%s' : %s", - className.c_str(), getException().c_str()); - return false; - } - - msg("Gateway ready"); - return true; -} - -bool JavaBinderyImpl::scriptRun(const String &lang, const String &script) -{ - if (!loadJVM()) - return false; - - std::vector params; - Value langParm(lang); - params.push_back(langParm); - Value scriptParm(script); - params.push_back(scriptParm); - Value retval; - callInstance(Value::BIND_VOID, gatewayObj, "scriptRun", - "(Ljava/lang/String;Ljava/lang/String;)Z", params, retval); - return retval.getBoolean(); -} - -bool JavaBinderyImpl::scriptRunFile(const String &lang, const String &fname) -{ - if (!loadJVM()) - return false; - - std::vector params; - Value langParm(lang); - params.push_back(langParm); - Value fnameParm(fname); - params.push_back(fnameParm); - Value retval; - callInstance(Value::BIND_VOID, gatewayObj, "scriptRunFile", - "(Ljava/lang/String;Ljava/lang/String;)Z", params, retval); - return retval.getBoolean(); -} - -bool JavaBinderyImpl::showConsole() -{ - if (!loadJVM()) - return false; - - std::vector params; - Value retval; - callInstance(Value::BIND_VOID, gatewayObj, "showConsole", - "()Z", params, retval); - return retval.getBoolean(); -} - - -//======================================================================== -// End Gateway -//======================================================================== - - -/** - * This is used to grab output from the VM itself. See 'options' below. - */ -static int JNICALL vfprintfHook(FILE* /*f*/, const char *fmt, va_list args) -{ - g_logv(G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, fmt, args); - return JNI_TRUE; -} - - -/** - * This is the most important part of this class. Here we - * attempt to find, load, and initialize a java (or mlvm?) virtual - * machine. - * - * @return true if successful, else false - */ -bool JavaBinderyImpl::loadJVM() -{ - if (jvm) - return true; - - CreateVMFunc createVM = getCreateVMFunc(); - if (!createVM) - { - err("Could not find 'JNI_CreateJavaVM' in shared library"); - return false; - } - - String javaroot; - getJavaRoot(javaroot); - String cp; - populateClassPath(javaroot, cp); - String classpath = "-Djava.class.path="; - classpath.append(normalizePath(cp)); - msg("Class path is: '%s'", classpath.c_str()); - - String libpath = "-Djava.library.path="; - libpath.append(javaroot); - libpath.append(DIR_SEPARATOR); - libpath.append("libm"); - libpath = normalizePath(libpath); - msg("Lib path is: '%s'", libpath.c_str()); - - JavaVMInitArgs vm_args; - JavaVMOption options[10];//should be enough - int nOptions = 0; - options[nOptions++].optionString = (char *)classpath.c_str(); - options[nOptions++].optionString = (char *)libpath.c_str(); - //options[nOptions++].optionString = (char *)"-verbose:jni"; - options[nOptions ].optionString = (char *)"vfprintf"; - options[nOptions++].extraInfo = (void *)vfprintfHook; - vm_args.version = JNI_VERSION_1_4; - vm_args.options = options; - vm_args.nOptions = nOptions; - vm_args.ignoreUnrecognized = true; - - if (createVM(&jvm, &env, &vm_args) < 0) - { - err("JNI_CreateJavaVM() failed"); - return false; - } - - //get jvm version - jint vers = env->GetVersion(); - int versionMajor = (vers>>16) & 0xffff; - int versionMinor = (vers ) & 0xffff; - msg("Loaded JVM version %d.%d", versionMajor, versionMinor); - - if (!setupGateway()) { - // set jvm = NULL, otherwise, this method will return true when called for the second time while the gateway might not have been created! - jvm->DestroyJavaVM(); - jvm = NULL; - env = NULL; - err("Java bindings: setupGateway() failed"); - return false; - } - - return true; -} - - -/** - * This is a difficult method. What we are doing is trying to - * call a static method with a list of arguments. Similar to - * a varargs call, we need to marshal the Values into their - * Java equivalents and make the proper call. - * - * @param type the return type of the method - * @param className the full (package / name) name of the java class - * @param methodName the name of the method being invoked - * @param signature the method signature (ex: "(Ljava/lang/String;I)V" ) - * that describes the param and return types of the method. - * @param retval the return value of the java method - * @return true if the call was successful, else false. This is not - * the return value of the method. - */ -bool JavaBinderyImpl::callStatic(int type, - const String &className, - const String &methodName, - const String &signature, - const std::vector ¶ms, - Value &retval) -{ - jclass cls = env->FindClass(className.c_str()); - if (!cls) - { - err("Could not find class '%s' : %s", - className.c_str(), getException().c_str()); - return false; - } - jmethodID mid = env->GetStaticMethodID(cls, - methodName.c_str(), signature.c_str()); - if (!mid) - { - err("Could not find method '%s:%s/%s' : %s", - className.c_str(), methodName.c_str(), - signature.c_str(), getException().c_str()); - return false; - } - /** - * Assemble your parameters into a form usable by JNI - */ - jvalue *jvals = new jvalue[params.size()]; - for (unsigned int i=0 ; iNewStringUTF(v.getString().c_str()); - break; - } - default: - { - err("Unknown value type: %d", v.getType()); - delete [] jvals; - return false; - } - } - } - switch (type) - { - case Value::BIND_VOID: - { - env->CallStaticVoidMethodA(cls, mid, jvals); - break; - } - case Value::BIND_BOOLEAN: - { - jboolean ret = env->CallStaticBooleanMethodA(cls, mid, jvals); - if (ret == JNI_TRUE) //remember, don't truncate - retval.setBoolean(true); - else - retval.setBoolean(false); - break; - } - case Value::BIND_INT: - { - jint ret = env->CallStaticIntMethodA(cls, mid, jvals); - retval.setInt(ret); - break; - } - case Value::BIND_DOUBLE: - { - jdouble ret = env->CallStaticDoubleMethodA(cls, mid, jvals); - retval.setDouble(ret); - break; - } - case Value::BIND_STRING: - { - jobject ret = env->CallStaticObjectMethodA(cls, mid, jvals); - jstring jstr = (jstring) ret; - const char *str = env->GetStringUTFChars(jstr, JNI_FALSE); - retval.setString(str); - env->ReleaseStringUTFChars(jstr, str); - break; - } - default: - { - err("Unknown return type: %d", type); - return false; - } - } - delete [] jvals; - String errStr = getException(); - if (errStr.size()>0) - { - err("callStatic: %s", errStr.c_str()); - return false; - } - return true; -} - - - -/** - * Another difficult method. However, this time we are operating - * on an existing instance jobject. - * - * @param type the return type of the method - * @param obj the instance upon which to make the call - * @param methodName the name of the method being invoked - * @param signature the method signature (ex: "(Ljava/lang/String;I)V" ) - * that describes the param and return types of the method. - * @param retval the return value of the java method - * @return true if the call was successful, else false. This is not - * the return value of the method. - */ -bool JavaBinderyImpl::callInstance( - int type, - const jobject obj, - const String &methodName, - const String &signature, - const std::vector ¶ms, - Value &retval) -{ - jmethodID mid = env->GetMethodID(env->GetObjectClass(obj), - methodName.c_str(), signature.c_str()); - if (!mid) - { - err("Could not find method '%s/%s' : %s", - methodName.c_str(), - signature.c_str(), getException().c_str()); - return false; - } - /** - * Assemble your parameters into a form usable by JNI - */ - jvalue *jvals = new jvalue[params.size()]; - for (unsigned int i=0 ; iNewStringUTF(v.getString().c_str()); - break; - } - default: - { - err("Unknown value type: %d", v.getType()); - delete [] jvals; - return false; - } - } - } - switch (type) - { - case Value::BIND_VOID: - { - env->CallVoidMethodA(obj, mid, jvals); - break; - } - case Value::BIND_BOOLEAN: - { - jboolean ret = env->CallBooleanMethodA(obj, mid, jvals); - if (ret == JNI_TRUE) //remember, don't truncate - retval.setBoolean(true); - else - retval.setBoolean(false); - break; - } - case Value::BIND_INT: - { - jint ret = env->CallIntMethodA(obj, mid, jvals); - retval.setInt(ret); - break; - } - case Value::BIND_DOUBLE: - { - jdouble ret = env->CallDoubleMethodA(obj, mid, jvals); - retval.setDouble(ret); - break; - } - case Value::BIND_STRING: - { - jobject ret = env->CallObjectMethodA(obj, mid, jvals); - jstring jstr = (jstring) ret; - const char *str = env->GetStringUTFChars(jstr, JNI_FALSE); - retval.setString(str); - env->ReleaseStringUTFChars(jstr, str); - break; - } - default: - { - err("Unknown return type: %d", type); - return false; - } - } - delete [] jvals; - String errStr = getException(); - if (errStr.size()>0) - { - err("callStatic: %s", errStr.c_str()); - return false; - } - return true; -} - - - - -/** - * Fetch the last exception from the JVM, if any. Clear it to - * continue processing - * - * @return the exception's descriptio,if any. Else "" - */ -String JavaBinderyImpl::getException() -{ - return getExceptionString(env); -} - - - -/** - * Convenience method to call the static void main(String argv[]) - * method of a given class - * - * @param className full name of the java class - * @args the argument strings to the method - * @return true if successful, else false - */ -bool JavaBinderyImpl::callMain(const String &className, - const std::vector &args) -{ - std::vector parms; - for (unsigned int i=0 ; iFindClass(className.c_str()); - if (!cls) - { - err("Could not find class '%s'", className.c_str()); - return false; - } - //msg("registerNatives: class '%s' found", className.c_str()); - - /** - * hack for JDK bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6493522 - */ - jmethodID mid = env->GetMethodID(env->GetObjectClass(cls), "getConstructors", - "()[Ljava/lang/reflect/Constructor;"); - if (!mid) - { - err("Could not get reflect mid for 'getConstructors' : %s", - getException().c_str()); - return false; - } - jobject res = env->CallObjectMethod(cls, mid); - if (!res) - { - err("Could not get constructors : %s", getException().c_str()); - return false; - } - /** - * end hack - */ - jint nrMethods = 0; - for (const JNINativeMethod *m = methods ; m->name ; m++) - nrMethods++; - jint ret = env->RegisterNatives(cls, methods, nrMethods); - if (ret < 0) - { - err("Could not register %d native methods for '%s' : %s", - nrMethods, className.c_str(), getException().c_str()); - return false; - } - return true; -} - - - - -} // namespace Bind -} // namespace Inkscape - -//######################################################################## -//# E N D O F F I L E -//######################################################################## diff --git a/src/bind/javabind.h b/src/bind/javabind.h deleted file mode 100644 index c11656a66..000000000 --- a/src/bind/javabind.h +++ /dev/null @@ -1,405 +0,0 @@ -/** - * @file - * @brief This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - */ -/* - * Authors: - * Bob Jamison - * - * Copyright (C) 2007-2008 Bob Jamison - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef SEEN_JAVABIND_H -#define SEEN_JAVABIND_H - -#include -#include - - -namespace Inkscape -{ - -namespace Bind -{ - - -/** - * Select which String implementation we want to use - */ -typedef Glib::ustring String; - - -/** - * This is the base class of all things which will be C++ object - * instances - */ -class BaseObject -{ -public: - - /** - * Simple constructor - */ - BaseObject() - {} - - /** - * Destructor - */ - virtual ~BaseObject() - {} - -}; - - -/** - * - */ -class Value -{ -public: - - /** - * Types for this value - */ - typedef enum - { - BIND_VOID, - BIND_INT, - BIND_BOOLEAN, - BIND_DOUBLE, - BIND_STRING, - BIND_OBJECT - } ValueType; - - /** - * - */ - Value() - { - init(); - } - - /** - * - */ - Value(int ival) - { - init(); - setInt(ival); - } - - /** - * - */ - Value(bool bval) - { - init(); - setBoolean(bval); - } - - /** - * - */ - Value(double dval) - { - init(); - setDouble(dval); - } - - /** - * - */ - Value(const String &sval) - { - init(); - setString(sval); - } - - /** - * - */ - Value(const Value &other) - { - assign(other); - } - - /** - * - */ - Value &operator=(const Value &other) - { - assign(other); - return *this; - } - - /** - * - */ - virtual ~Value() - { - } - - /** - * - */ - int getType() - { return type; } - - /** - * - */ - void setBoolean(bool val) - { type = BIND_BOOLEAN; ival = (int)val; } - - /** - * - */ - bool getBoolean() - { - if (type == BIND_BOOLEAN) - return (bool)ival; - else - return false; - } - - /** - * - */ - void setInt(int val) - { type = BIND_INT; ival = val; } - - /** - * - */ - bool getInt() - { - if (type == BIND_INT) - return ival; - else - return 0; - } - - /** - * - */ - void setDouble(double val) - { type = BIND_DOUBLE; dval = val; } - - /** - * - */ - double getDouble() - { - if (type == BIND_DOUBLE) - return dval; - else - return 0.0; - } - - /** - * - */ - void setString(const String &val) - { type = BIND_STRING; sval = val; } - - /** - * - */ - String getString() - { - if (type == BIND_STRING) - return sval; - else - return ""; - } - - -private: - - void init() - { - type = BIND_INT; - ival = 0; - dval = 0.0; - sval = ""; - } - - void assign(const Value &other) - { - type = other.type; - ival = other.ival; - dval = other.dval; - sval = other.sval; - } - - int type; - long ival; - double dval; - String sval; - -}; - - - - - -/** - * - */ -class JavaBindery -{ -public: - - /** - * - */ - JavaBindery() - {} - - /** - * - */ - virtual ~JavaBindery() - {} - - /** - * - */ - virtual bool loadJVM() - { - return false; - } - - /** - * - */ - virtual bool callStatic(int /*type*/, - const String &/*className*/, - const String &/*methodName*/, - const String &/*signature*/, - const std::vector &/*params*/, - Value &/*retval*/) - { - return false; - } - - /** - * - */ - virtual bool callMain(const String &/*className*/, - const std::vector &/*args*/) - { - return false; - } - - /** - * - */ - virtual bool isLoaded() - { - return false; - } - - /** - * - */ - virtual bool scriptRun(const String &/*lang*/, const String &/*script*/) - { - return false; - } - - /** - * - */ - virtual bool scriptRunFile(const String &/*lang*/, const String &/*fileName*/) - { - return false; - } - - /** - * - */ - virtual bool showConsole() - { - return false; - } - - /** - * - */ - virtual bool doBinding() - { - return false; - } - - /** - * - */ - virtual String getException() - { - return ""; - } - - virtual String logGet() - { - return logBuf; - } - - virtual void logClear() - { - logBuf.clear(); - } - - virtual void log(int ch) - { - logBuf.push_back((char)ch); - if (ch == '\n' || ch == '\r') - { - g_message("%s", logBuf.c_str()); - logBuf.clear(); - } - } - - - /** - * Return a singleton instance of this bindery - */ - static JavaBindery *getInstance(); - -protected: - - - String stdOutBuf; - String stdErrBuf; - String logBuf; - -}; - - - - - -} // namespace Bind -} // namespace Inkscape - -#endif // SEEN_JAVABIND_H -//######################################################################## -//# E N D O F F I L E -//######################################################################## - diff --git a/src/bind/javainc/jni.h b/src/bind/javainc/jni.h deleted file mode 100644 index 5989c043f..000000000 --- a/src/bind/javainc/jni.h +++ /dev/null @@ -1,1959 +0,0 @@ -/* - * Copyright 1996-2006 Sun Microsystems, Inc. All Rights Reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Sun designates this - * particular file as subject to the "Classpath" exception as provided - * by Sun in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - */ - -/* - * We used part of Netscape's Java Runtime Interface (JRI) as the starting - * point of our design and implementation. - */ - -/* *************************************************************************** - * Java Runtime Interface - * Copyright (c) 1996 Netscape Communications Corporation. All rights reserved. - *****************************************************************************/ - -#ifndef _JAVASOFT_JNI_H_ -#define _JAVASOFT_JNI_H_ - -#include -#include - -/* jni_md.h contains the machine-dependent typedefs for jbyte, jint - and jlong */ - -#include "jni_md.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * JNI Types - */ - -#ifndef JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H - -typedef unsigned char jboolean; -typedef unsigned short jchar; -typedef short jshort; -typedef float jfloat; -typedef double jdouble; - -typedef jint jsize; - -#ifdef __cplusplus - -class _jobject {}; -class _jclass : public _jobject {}; -class _jthrowable : public _jobject {}; -class _jstring : public _jobject {}; -class _jarray : public _jobject {}; -class _jbooleanArray : public _jarray {}; -class _jbyteArray : public _jarray {}; -class _jcharArray : public _jarray {}; -class _jshortArray : public _jarray {}; -class _jintArray : public _jarray {}; -class _jlongArray : public _jarray {}; -class _jfloatArray : public _jarray {}; -class _jdoubleArray : public _jarray {}; -class _jobjectArray : public _jarray {}; - -typedef _jobject *jobject; -typedef _jclass *jclass; -typedef _jthrowable *jthrowable; -typedef _jstring *jstring; -typedef _jarray *jarray; -typedef _jbooleanArray *jbooleanArray; -typedef _jbyteArray *jbyteArray; -typedef _jcharArray *jcharArray; -typedef _jshortArray *jshortArray; -typedef _jintArray *jintArray; -typedef _jlongArray *jlongArray; -typedef _jfloatArray *jfloatArray; -typedef _jdoubleArray *jdoubleArray; -typedef _jobjectArray *jobjectArray; - -#else - -struct _jobject; - -typedef struct _jobject *jobject; -typedef jobject jclass; -typedef jobject jthrowable; -typedef jobject jstring; -typedef jobject jarray; -typedef jarray jbooleanArray; -typedef jarray jbyteArray; -typedef jarray jcharArray; -typedef jarray jshortArray; -typedef jarray jintArray; -typedef jarray jlongArray; -typedef jarray jfloatArray; -typedef jarray jdoubleArray; -typedef jarray jobjectArray; - -#endif - -typedef jobject jweak; - -typedef union jvalue { - jboolean z; - jbyte b; - jchar c; - jshort s; - jint i; - jlong j; - jfloat f; - jdouble d; - jobject l; -} jvalue; - -struct _jfieldID; -typedef struct _jfieldID *jfieldID; - -struct _jmethodID; -typedef struct _jmethodID *jmethodID; - -/* Return values from jobjectRefType */ -typedef enum _jobjectType { - JNIInvalidRefType = 0, - JNILocalRefType = 1, - JNIGlobalRefType = 2, - JNIWeakGlobalRefType = 3 -} jobjectRefType; - - -#endif /* JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H */ - -/* - * jboolean constants - */ - -#define JNI_FALSE 0 -#define JNI_TRUE 1 - -/* - * possible return values for JNI functions. - */ - -#define JNI_OK 0 /* success */ -#define JNI_ERR (-1) /* unknown error */ -#define JNI_EDETACHED (-2) /* thread detached from the VM */ -#define JNI_EVERSION (-3) /* JNI version error */ -#define JNI_ENOMEM (-4) /* not enough memory */ -#define JNI_EEXIST (-5) /* VM already created */ -#define JNI_EINVAL (-6) /* invalid arguments */ - -/* - * used in ReleaseScalarArrayElements - */ - -#define JNI_COMMIT 1 -#define JNI_ABORT 2 - -/* - * used in RegisterNatives to describe native method name, signature, - * and function pointer. - */ - -typedef struct { - char *name; - char *signature; - void *fnPtr; -} JNINativeMethod; - -/* - * JNI Native Method Interface. - */ - -struct JNINativeInterface_; - -struct JNIEnv_; - -#ifdef __cplusplus -typedef JNIEnv_ JNIEnv; -#else -typedef const struct JNINativeInterface_ *JNIEnv; -#endif - -/* - * JNI Invocation Interface. - */ - -struct JNIInvokeInterface_; - -struct JavaVM_; - -#ifdef __cplusplus -typedef JavaVM_ JavaVM; -#else -typedef const struct JNIInvokeInterface_ *JavaVM; -#endif - -struct JNINativeInterface_ { - void *reserved0; - void *reserved1; - void *reserved2; - - void *reserved3; - jint (JNICALL *GetVersion)(JNIEnv *env); - - jclass (JNICALL *DefineClass) - (JNIEnv *env, const char *name, jobject loader, const jbyte *buf, - jsize len); - jclass (JNICALL *FindClass) - (JNIEnv *env, const char *name); - - jmethodID (JNICALL *FromReflectedMethod) - (JNIEnv *env, jobject method); - jfieldID (JNICALL *FromReflectedField) - (JNIEnv *env, jobject field); - - jobject (JNICALL *ToReflectedMethod) - (JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic); - - jclass (JNICALL *GetSuperclass) - (JNIEnv *env, jclass sub); - jboolean (JNICALL *IsAssignableFrom) - (JNIEnv *env, jclass sub, jclass sup); - - jobject (JNICALL *ToReflectedField) - (JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic); - - jint (JNICALL *Throw) - (JNIEnv *env, jthrowable obj); - jint (JNICALL *ThrowNew) - (JNIEnv *env, jclass clazz, const char *msg); - jthrowable (JNICALL *ExceptionOccurred) - (JNIEnv *env); - void (JNICALL *ExceptionDescribe) - (JNIEnv *env); - void (JNICALL *ExceptionClear) - (JNIEnv *env); - void (JNICALL *FatalError) - (JNIEnv *env, const char *msg); - - jint (JNICALL *PushLocalFrame) - (JNIEnv *env, jint capacity); - jobject (JNICALL *PopLocalFrame) - (JNIEnv *env, jobject result); - - jobject (JNICALL *NewGlobalRef) - (JNIEnv *env, jobject lobj); - void (JNICALL *DeleteGlobalRef) - (JNIEnv *env, jobject gref); - void (JNICALL *DeleteLocalRef) - (JNIEnv *env, jobject obj); - jboolean (JNICALL *IsSameObject) - (JNIEnv *env, jobject obj1, jobject obj2); - jobject (JNICALL *NewLocalRef) - (JNIEnv *env, jobject ref); - jint (JNICALL *EnsureLocalCapacity) - (JNIEnv *env, jint capacity); - - jobject (JNICALL *AllocObject) - (JNIEnv *env, jclass clazz); - jobject (JNICALL *NewObject) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jobject (JNICALL *NewObjectV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jobject (JNICALL *NewObjectA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jclass (JNICALL *GetObjectClass) - (JNIEnv *env, jobject obj); - jboolean (JNICALL *IsInstanceOf) - (JNIEnv *env, jobject obj, jclass clazz); - - jmethodID (JNICALL *GetMethodID) - (JNIEnv *env, jclass clazz, const char *name, const char *sig); - - jobject (JNICALL *CallObjectMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jobject (JNICALL *CallObjectMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jobject (JNICALL *CallObjectMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args); - - jboolean (JNICALL *CallBooleanMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jboolean (JNICALL *CallBooleanMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jboolean (JNICALL *CallBooleanMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args); - - jbyte (JNICALL *CallByteMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jbyte (JNICALL *CallByteMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jbyte (JNICALL *CallByteMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); - - jchar (JNICALL *CallCharMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jchar (JNICALL *CallCharMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jchar (JNICALL *CallCharMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); - - jshort (JNICALL *CallShortMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jshort (JNICALL *CallShortMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jshort (JNICALL *CallShortMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); - - jint (JNICALL *CallIntMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jint (JNICALL *CallIntMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jint (JNICALL *CallIntMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); - - jlong (JNICALL *CallLongMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jlong (JNICALL *CallLongMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jlong (JNICALL *CallLongMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); - - jfloat (JNICALL *CallFloatMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jfloat (JNICALL *CallFloatMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jfloat (JNICALL *CallFloatMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); - - jdouble (JNICALL *CallDoubleMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jdouble (JNICALL *CallDoubleMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jdouble (JNICALL *CallDoubleMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); - - void (JNICALL *CallVoidMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - void (JNICALL *CallVoidMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - void (JNICALL *CallVoidMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args); - - jobject (JNICALL *CallNonvirtualObjectMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jobject (JNICALL *CallNonvirtualObjectMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jobject (JNICALL *CallNonvirtualObjectMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue * args); - - jboolean (JNICALL *CallNonvirtualBooleanMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jboolean (JNICALL *CallNonvirtualBooleanMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jboolean (JNICALL *CallNonvirtualBooleanMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue * args); - - jbyte (JNICALL *CallNonvirtualByteMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jbyte (JNICALL *CallNonvirtualByteMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jbyte (JNICALL *CallNonvirtualByteMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue *args); - - jchar (JNICALL *CallNonvirtualCharMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jchar (JNICALL *CallNonvirtualCharMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jchar (JNICALL *CallNonvirtualCharMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue *args); - - jshort (JNICALL *CallNonvirtualShortMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jshort (JNICALL *CallNonvirtualShortMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jshort (JNICALL *CallNonvirtualShortMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue *args); - - jint (JNICALL *CallNonvirtualIntMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jint (JNICALL *CallNonvirtualIntMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jint (JNICALL *CallNonvirtualIntMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue *args); - - jlong (JNICALL *CallNonvirtualLongMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jlong (JNICALL *CallNonvirtualLongMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jlong (JNICALL *CallNonvirtualLongMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue *args); - - jfloat (JNICALL *CallNonvirtualFloatMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jfloat (JNICALL *CallNonvirtualFloatMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jfloat (JNICALL *CallNonvirtualFloatMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue *args); - - jdouble (JNICALL *CallNonvirtualDoubleMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jdouble (JNICALL *CallNonvirtualDoubleMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jdouble (JNICALL *CallNonvirtualDoubleMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue *args); - - void (JNICALL *CallNonvirtualVoidMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - void (JNICALL *CallNonvirtualVoidMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - void (JNICALL *CallNonvirtualVoidMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue * args); - - jfieldID (JNICALL *GetFieldID) - (JNIEnv *env, jclass clazz, const char *name, const char *sig); - - jobject (JNICALL *GetObjectField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jboolean (JNICALL *GetBooleanField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jbyte (JNICALL *GetByteField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jchar (JNICALL *GetCharField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jshort (JNICALL *GetShortField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jint (JNICALL *GetIntField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jlong (JNICALL *GetLongField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jfloat (JNICALL *GetFloatField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jdouble (JNICALL *GetDoubleField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - - void (JNICALL *SetObjectField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jobject val); - void (JNICALL *SetBooleanField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val); - void (JNICALL *SetByteField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val); - void (JNICALL *SetCharField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jchar val); - void (JNICALL *SetShortField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jshort val); - void (JNICALL *SetIntField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jint val); - void (JNICALL *SetLongField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jlong val); - void (JNICALL *SetFloatField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val); - void (JNICALL *SetDoubleField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val); - - jmethodID (JNICALL *GetStaticMethodID) - (JNIEnv *env, jclass clazz, const char *name, const char *sig); - - jobject (JNICALL *CallStaticObjectMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jobject (JNICALL *CallStaticObjectMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jobject (JNICALL *CallStaticObjectMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jboolean (JNICALL *CallStaticBooleanMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jboolean (JNICALL *CallStaticBooleanMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jboolean (JNICALL *CallStaticBooleanMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jbyte (JNICALL *CallStaticByteMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jbyte (JNICALL *CallStaticByteMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jbyte (JNICALL *CallStaticByteMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jchar (JNICALL *CallStaticCharMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jchar (JNICALL *CallStaticCharMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jchar (JNICALL *CallStaticCharMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jshort (JNICALL *CallStaticShortMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jshort (JNICALL *CallStaticShortMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jshort (JNICALL *CallStaticShortMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jint (JNICALL *CallStaticIntMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jint (JNICALL *CallStaticIntMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jint (JNICALL *CallStaticIntMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jlong (JNICALL *CallStaticLongMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jlong (JNICALL *CallStaticLongMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jlong (JNICALL *CallStaticLongMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jfloat (JNICALL *CallStaticFloatMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jfloat (JNICALL *CallStaticFloatMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jfloat (JNICALL *CallStaticFloatMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jdouble (JNICALL *CallStaticDoubleMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jdouble (JNICALL *CallStaticDoubleMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jdouble (JNICALL *CallStaticDoubleMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - void (JNICALL *CallStaticVoidMethod) - (JNIEnv *env, jclass cls, jmethodID methodID, ...); - void (JNICALL *CallStaticVoidMethodV) - (JNIEnv *env, jclass cls, jmethodID methodID, va_list args); - void (JNICALL *CallStaticVoidMethodA) - (JNIEnv *env, jclass cls, jmethodID methodID, const jvalue * args); - - jfieldID (JNICALL *GetStaticFieldID) - (JNIEnv *env, jclass clazz, const char *name, const char *sig); - jobject (JNICALL *GetStaticObjectField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jboolean (JNICALL *GetStaticBooleanField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jbyte (JNICALL *GetStaticByteField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jchar (JNICALL *GetStaticCharField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jshort (JNICALL *GetStaticShortField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jint (JNICALL *GetStaticIntField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jlong (JNICALL *GetStaticLongField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jfloat (JNICALL *GetStaticFloatField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jdouble (JNICALL *GetStaticDoubleField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - - void (JNICALL *SetStaticObjectField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value); - void (JNICALL *SetStaticBooleanField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value); - void (JNICALL *SetStaticByteField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value); - void (JNICALL *SetStaticCharField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value); - void (JNICALL *SetStaticShortField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value); - void (JNICALL *SetStaticIntField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jint value); - void (JNICALL *SetStaticLongField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value); - void (JNICALL *SetStaticFloatField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value); - void (JNICALL *SetStaticDoubleField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value); - - jstring (JNICALL *NewString) - (JNIEnv *env, const jchar *unicode, jsize len); - jsize (JNICALL *GetStringLength) - (JNIEnv *env, jstring str); - const jchar *(JNICALL *GetStringChars) - (JNIEnv *env, jstring str, jboolean *isCopy); - void (JNICALL *ReleaseStringChars) - (JNIEnv *env, jstring str, const jchar *chars); - - jstring (JNICALL *NewStringUTF) - (JNIEnv *env, const char *utf); - jsize (JNICALL *GetStringUTFLength) - (JNIEnv *env, jstring str); - const char* (JNICALL *GetStringUTFChars) - (JNIEnv *env, jstring str, jboolean *isCopy); - void (JNICALL *ReleaseStringUTFChars) - (JNIEnv *env, jstring str, const char* chars); - - - jsize (JNICALL *GetArrayLength) - (JNIEnv *env, jarray array); - - jobjectArray (JNICALL *NewObjectArray) - (JNIEnv *env, jsize len, jclass clazz, jobject init); - jobject (JNICALL *GetObjectArrayElement) - (JNIEnv *env, jobjectArray array, jsize index); - void (JNICALL *SetObjectArrayElement) - (JNIEnv *env, jobjectArray array, jsize index, jobject val); - - jbooleanArray (JNICALL *NewBooleanArray) - (JNIEnv *env, jsize len); - jbyteArray (JNICALL *NewByteArray) - (JNIEnv *env, jsize len); - jcharArray (JNICALL *NewCharArray) - (JNIEnv *env, jsize len); - jshortArray (JNICALL *NewShortArray) - (JNIEnv *env, jsize len); - jintArray (JNICALL *NewIntArray) - (JNIEnv *env, jsize len); - jlongArray (JNICALL *NewLongArray) - (JNIEnv *env, jsize len); - jfloatArray (JNICALL *NewFloatArray) - (JNIEnv *env, jsize len); - jdoubleArray (JNICALL *NewDoubleArray) - (JNIEnv *env, jsize len); - - jboolean * (JNICALL *GetBooleanArrayElements) - (JNIEnv *env, jbooleanArray array, jboolean *isCopy); - jbyte * (JNICALL *GetByteArrayElements) - (JNIEnv *env, jbyteArray array, jboolean *isCopy); - jchar * (JNICALL *GetCharArrayElements) - (JNIEnv *env, jcharArray array, jboolean *isCopy); - jshort * (JNICALL *GetShortArrayElements) - (JNIEnv *env, jshortArray array, jboolean *isCopy); - jint * (JNICALL *GetIntArrayElements) - (JNIEnv *env, jintArray array, jboolean *isCopy); - jlong * (JNICALL *GetLongArrayElements) - (JNIEnv *env, jlongArray array, jboolean *isCopy); - jfloat * (JNICALL *GetFloatArrayElements) - (JNIEnv *env, jfloatArray array, jboolean *isCopy); - jdouble * (JNICALL *GetDoubleArrayElements) - (JNIEnv *env, jdoubleArray array, jboolean *isCopy); - - void (JNICALL *ReleaseBooleanArrayElements) - (JNIEnv *env, jbooleanArray array, jboolean *elems, jint mode); - void (JNICALL *ReleaseByteArrayElements) - (JNIEnv *env, jbyteArray array, jbyte *elems, jint mode); - void (JNICALL *ReleaseCharArrayElements) - (JNIEnv *env, jcharArray array, jchar *elems, jint mode); - void (JNICALL *ReleaseShortArrayElements) - (JNIEnv *env, jshortArray array, jshort *elems, jint mode); - void (JNICALL *ReleaseIntArrayElements) - (JNIEnv *env, jintArray array, jint *elems, jint mode); - void (JNICALL *ReleaseLongArrayElements) - (JNIEnv *env, jlongArray array, jlong *elems, jint mode); - void (JNICALL *ReleaseFloatArrayElements) - (JNIEnv *env, jfloatArray array, jfloat *elems, jint mode); - void (JNICALL *ReleaseDoubleArrayElements) - (JNIEnv *env, jdoubleArray array, jdouble *elems, jint mode); - - void (JNICALL *GetBooleanArrayRegion) - (JNIEnv *env, jbooleanArray array, jsize start, jsize l, jboolean *buf); - void (JNICALL *GetByteArrayRegion) - (JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf); - void (JNICALL *GetCharArrayRegion) - (JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf); - void (JNICALL *GetShortArrayRegion) - (JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf); - void (JNICALL *GetIntArrayRegion) - (JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf); - void (JNICALL *GetLongArrayRegion) - (JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf); - void (JNICALL *GetFloatArrayRegion) - (JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf); - void (JNICALL *GetDoubleArrayRegion) - (JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf); - - void (JNICALL *SetBooleanArrayRegion) - (JNIEnv *env, jbooleanArray array, jsize start, jsize l, const jboolean *buf); - void (JNICALL *SetByteArrayRegion) - (JNIEnv *env, jbyteArray array, jsize start, jsize len, const jbyte *buf); - void (JNICALL *SetCharArrayRegion) - (JNIEnv *env, jcharArray array, jsize start, jsize len, const jchar *buf); - void (JNICALL *SetShortArrayRegion) - (JNIEnv *env, jshortArray array, jsize start, jsize len, const jshort *buf); - void (JNICALL *SetIntArrayRegion) - (JNIEnv *env, jintArray array, jsize start, jsize len, const jint *buf); - void (JNICALL *SetLongArrayRegion) - (JNIEnv *env, jlongArray array, jsize start, jsize len, const jlong *buf); - void (JNICALL *SetFloatArrayRegion) - (JNIEnv *env, jfloatArray array, jsize start, jsize len, const jfloat *buf); - void (JNICALL *SetDoubleArrayRegion) - (JNIEnv *env, jdoubleArray array, jsize start, jsize len, const jdouble *buf); - - jint (JNICALL *RegisterNatives) - (JNIEnv *env, jclass clazz, const JNINativeMethod *methods, - jint nMethods); - jint (JNICALL *UnregisterNatives) - (JNIEnv *env, jclass clazz); - - jint (JNICALL *MonitorEnter) - (JNIEnv *env, jobject obj); - jint (JNICALL *MonitorExit) - (JNIEnv *env, jobject obj); - - jint (JNICALL *GetJavaVM) - (JNIEnv *env, JavaVM **vm); - - void (JNICALL *GetStringRegion) - (JNIEnv *env, jstring str, jsize start, jsize len, jchar *buf); - void (JNICALL *GetStringUTFRegion) - (JNIEnv *env, jstring str, jsize start, jsize len, char *buf); - - void * (JNICALL *GetPrimitiveArrayCritical) - (JNIEnv *env, jarray array, jboolean *isCopy); - void (JNICALL *ReleasePrimitiveArrayCritical) - (JNIEnv *env, jarray array, void *carray, jint mode); - - const jchar * (JNICALL *GetStringCritical) - (JNIEnv *env, jstring string, jboolean *isCopy); - void (JNICALL *ReleaseStringCritical) - (JNIEnv *env, jstring string, const jchar *cstring); - - jweak (JNICALL *NewWeakGlobalRef) - (JNIEnv *env, jobject obj); - void (JNICALL *DeleteWeakGlobalRef) - (JNIEnv *env, jweak ref); - - jboolean (JNICALL *ExceptionCheck) - (JNIEnv *env); - - jobject (JNICALL *NewDirectByteBuffer) - (JNIEnv* env, void* address, jlong capacity); - void* (JNICALL *GetDirectBufferAddress) - (JNIEnv* env, jobject buf); - jlong (JNICALL *GetDirectBufferCapacity) - (JNIEnv* env, jobject buf); - - /* New JNI 1.6 Features */ - - jobjectRefType (JNICALL *GetObjectRefType) - (JNIEnv* env, jobject obj); -}; - -/* - * We use inlined functions for C++ so that programmers can write: - * - * env->FindClass("java/lang/String") - * - * in C++ rather than: - * - * (*env)->FindClass(env, "java/lang/String") - * - * in C. - */ - -struct JNIEnv_ { - const struct JNINativeInterface_ *functions; -#ifdef __cplusplus - - jint GetVersion() { - return functions->GetVersion(this); - } - jclass DefineClass(const char *name, jobject loader, const jbyte *buf, - jsize len) { - return functions->DefineClass(this, name, loader, buf, len); - } - jclass FindClass(const char *name) { - return functions->FindClass(this, name); - } - jmethodID FromReflectedMethod(jobject method) { - return functions->FromReflectedMethod(this,method); - } - jfieldID FromReflectedField(jobject field) { - return functions->FromReflectedField(this,field); - } - - jobject ToReflectedMethod(jclass cls, jmethodID methodID, jboolean isStatic) { - return functions->ToReflectedMethod(this, cls, methodID, isStatic); - } - - jclass GetSuperclass(jclass sub) { - return functions->GetSuperclass(this, sub); - } - jboolean IsAssignableFrom(jclass sub, jclass sup) { - return functions->IsAssignableFrom(this, sub, sup); - } - - jobject ToReflectedField(jclass cls, jfieldID fieldID, jboolean isStatic) { - return functions->ToReflectedField(this,cls,fieldID,isStatic); - } - - jint Throw(jthrowable obj) { - return functions->Throw(this, obj); - } - jint ThrowNew(jclass clazz, const char *msg) { - return functions->ThrowNew(this, clazz, msg); - } - jthrowable ExceptionOccurred() { - return functions->ExceptionOccurred(this); - } - void ExceptionDescribe() { - functions->ExceptionDescribe(this); - } - void ExceptionClear() { - functions->ExceptionClear(this); - } - void FatalError(const char *msg) { - functions->FatalError(this, msg); - } - - jint PushLocalFrame(jint capacity) { - return functions->PushLocalFrame(this,capacity); - } - jobject PopLocalFrame(jobject result) { - return functions->PopLocalFrame(this,result); - } - - jobject NewGlobalRef(jobject lobj) { - return functions->NewGlobalRef(this,lobj); - } - void DeleteGlobalRef(jobject gref) { - functions->DeleteGlobalRef(this,gref); - } - void DeleteLocalRef(jobject obj) { - functions->DeleteLocalRef(this, obj); - } - - jboolean IsSameObject(jobject obj1, jobject obj2) { - return functions->IsSameObject(this,obj1,obj2); - } - - jobject NewLocalRef(jobject ref) { - return functions->NewLocalRef(this,ref); - } - jint EnsureLocalCapacity(jint capacity) { - return functions->EnsureLocalCapacity(this,capacity); - } - - jobject AllocObject(jclass clazz) { - return functions->AllocObject(this,clazz); - } - jobject NewObject(jclass clazz, jmethodID methodID, ...) { - va_list args; - jobject result; - va_start(args, methodID); - result = functions->NewObjectV(this,clazz,methodID,args); - va_end(args); - return result; - } - jobject NewObjectV(jclass clazz, jmethodID methodID, - va_list args) { - return functions->NewObjectV(this,clazz,methodID,args); - } - jobject NewObjectA(jclass clazz, jmethodID methodID, - const jvalue *args) { - return functions->NewObjectA(this,clazz,methodID,args); - } - - jclass GetObjectClass(jobject obj) { - return functions->GetObjectClass(this,obj); - } - jboolean IsInstanceOf(jobject obj, jclass clazz) { - return functions->IsInstanceOf(this,obj,clazz); - } - - jmethodID GetMethodID(jclass clazz, const char *name, - const char *sig) { - return functions->GetMethodID(this,clazz,name,sig); - } - - jobject CallObjectMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jobject result; - va_start(args,methodID); - result = functions->CallObjectMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jobject CallObjectMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallObjectMethodV(this,obj,methodID,args); - } - jobject CallObjectMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallObjectMethodA(this,obj,methodID,args); - } - - jboolean CallBooleanMethod(jobject obj, - jmethodID methodID, ...) { - va_list args; - jboolean result; - va_start(args,methodID); - result = functions->CallBooleanMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jboolean CallBooleanMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallBooleanMethodV(this,obj,methodID,args); - } - jboolean CallBooleanMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallBooleanMethodA(this,obj,methodID, args); - } - - jbyte CallByteMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jbyte result; - va_start(args,methodID); - result = functions->CallByteMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jbyte CallByteMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallByteMethodV(this,obj,methodID,args); - } - jbyte CallByteMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallByteMethodA(this,obj,methodID,args); - } - - jchar CallCharMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jchar result; - va_start(args,methodID); - result = functions->CallCharMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jchar CallCharMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallCharMethodV(this,obj,methodID,args); - } - jchar CallCharMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallCharMethodA(this,obj,methodID,args); - } - - jshort CallShortMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jshort result; - va_start(args,methodID); - result = functions->CallShortMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jshort CallShortMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallShortMethodV(this,obj,methodID,args); - } - jshort CallShortMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallShortMethodA(this,obj,methodID,args); - } - - jint CallIntMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jint result; - va_start(args,methodID); - result = functions->CallIntMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jint CallIntMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallIntMethodV(this,obj,methodID,args); - } - jint CallIntMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallIntMethodA(this,obj,methodID,args); - } - - jlong CallLongMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jlong result; - va_start(args,methodID); - result = functions->CallLongMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jlong CallLongMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallLongMethodV(this,obj,methodID,args); - } - jlong CallLongMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallLongMethodA(this,obj,methodID,args); - } - - jfloat CallFloatMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jfloat result; - va_start(args,methodID); - result = functions->CallFloatMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jfloat CallFloatMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallFloatMethodV(this,obj,methodID,args); - } - jfloat CallFloatMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallFloatMethodA(this,obj,methodID,args); - } - - jdouble CallDoubleMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jdouble result; - va_start(args,methodID); - result = functions->CallDoubleMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jdouble CallDoubleMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallDoubleMethodV(this,obj,methodID,args); - } - jdouble CallDoubleMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallDoubleMethodA(this,obj,methodID,args); - } - - void CallVoidMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - va_start(args,methodID); - functions->CallVoidMethodV(this,obj,methodID,args); - va_end(args); - } - void CallVoidMethodV(jobject obj, jmethodID methodID, - va_list args) { - functions->CallVoidMethodV(this,obj,methodID,args); - } - void CallVoidMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - functions->CallVoidMethodA(this,obj,methodID,args); - } - - jobject CallNonvirtualObjectMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jobject result; - va_start(args,methodID); - result = functions->CallNonvirtualObjectMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jobject CallNonvirtualObjectMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualObjectMethodV(this,obj,clazz, - methodID,args); - } - jobject CallNonvirtualObjectMethodA(jobject obj, jclass clazz, - jmethodID methodID, const jvalue * args) { - return functions->CallNonvirtualObjectMethodA(this,obj,clazz, - methodID,args); - } - - jboolean CallNonvirtualBooleanMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jboolean result; - va_start(args,methodID); - result = functions->CallNonvirtualBooleanMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jboolean CallNonvirtualBooleanMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualBooleanMethodV(this,obj,clazz, - methodID,args); - } - jboolean CallNonvirtualBooleanMethodA(jobject obj, jclass clazz, - jmethodID methodID, const jvalue * args) { - return functions->CallNonvirtualBooleanMethodA(this,obj,clazz, - methodID, args); - } - - jbyte CallNonvirtualByteMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jbyte result; - va_start(args,methodID); - result = functions->CallNonvirtualByteMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jbyte CallNonvirtualByteMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualByteMethodV(this,obj,clazz, - methodID,args); - } - jbyte CallNonvirtualByteMethodA(jobject obj, jclass clazz, - jmethodID methodID, const jvalue * args) { - return functions->CallNonvirtualByteMethodA(this,obj,clazz, - methodID,args); - } - - jchar CallNonvirtualCharMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jchar result; - va_start(args,methodID); - result = functions->CallNonvirtualCharMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jchar CallNonvirtualCharMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualCharMethodV(this,obj,clazz, - methodID,args); - } - jchar CallNonvirtualCharMethodA(jobject obj, jclass clazz, - jmethodID methodID, const jvalue * args) { - return functions->CallNonvirtualCharMethodA(this,obj,clazz, - methodID,args); - } - - jshort CallNonvirtualShortMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jshort result; - va_start(args,methodID); - result = functions->CallNonvirtualShortMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jshort CallNonvirtualShortMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualShortMethodV(this,obj,clazz, - methodID,args); - } - jshort CallNonvirtualShortMethodA(jobject obj, jclass clazz, - jmethodID methodID, const jvalue * args) { - return functions->CallNonvirtualShortMethodA(this,obj,clazz, - methodID,args); - } - - jint CallNonvirtualIntMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jint result; - va_start(args,methodID); - result = functions->CallNonvirtualIntMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jint CallNonvirtualIntMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualIntMethodV(this,obj,clazz, - methodID,args); - } - jint CallNonvirtualIntMethodA(jobject obj, jclass clazz, - jmethodID methodID, const jvalue * args) { - return functions->CallNonvirtualIntMethodA(this,obj,clazz, - methodID,args); - } - - jlong CallNonvirtualLongMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jlong result; - va_start(args,methodID); - result = functions->CallNonvirtualLongMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jlong CallNonvirtualLongMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualLongMethodV(this,obj,clazz, - methodID,args); - } - jlong CallNonvirtualLongMethodA(jobject obj, jclass clazz, - jmethodID methodID, const jvalue * args) { - return functions->CallNonvirtualLongMethodA(this,obj,clazz, - methodID,args); - } - - jfloat CallNonvirtualFloatMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jfloat result; - va_start(args,methodID); - result = functions->CallNonvirtualFloatMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jfloat CallNonvirtualFloatMethodV(jobject obj, jclass clazz, - jmethodID methodID, - va_list args) { - return functions->CallNonvirtualFloatMethodV(this,obj,clazz, - methodID,args); - } - jfloat CallNonvirtualFloatMethodA(jobject obj, jclass clazz, - jmethodID methodID, - const jvalue * args) { - return functions->CallNonvirtualFloatMethodA(this,obj,clazz, - methodID,args); - } - - jdouble CallNonvirtualDoubleMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jdouble result; - va_start(args,methodID); - result = functions->CallNonvirtualDoubleMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jdouble CallNonvirtualDoubleMethodV(jobject obj, jclass clazz, - jmethodID methodID, - va_list args) { - return functions->CallNonvirtualDoubleMethodV(this,obj,clazz, - methodID,args); - } - jdouble CallNonvirtualDoubleMethodA(jobject obj, jclass clazz, - jmethodID methodID, - const jvalue * args) { - return functions->CallNonvirtualDoubleMethodA(this,obj,clazz, - methodID,args); - } - - void CallNonvirtualVoidMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - va_start(args,methodID); - functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args); - va_end(args); - } - void CallNonvirtualVoidMethodV(jobject obj, jclass clazz, - jmethodID methodID, - va_list args) { - functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args); - } - void CallNonvirtualVoidMethodA(jobject obj, jclass clazz, - jmethodID methodID, - const jvalue * args) { - functions->CallNonvirtualVoidMethodA(this,obj,clazz,methodID,args); - } - - jfieldID GetFieldID(jclass clazz, const char *name, - const char *sig) { - return functions->GetFieldID(this,clazz,name,sig); - } - - jobject GetObjectField(jobject obj, jfieldID fieldID) { - return functions->GetObjectField(this,obj,fieldID); - } - jboolean GetBooleanField(jobject obj, jfieldID fieldID) { - return functions->GetBooleanField(this,obj,fieldID); - } - jbyte GetByteField(jobject obj, jfieldID fieldID) { - return functions->GetByteField(this,obj,fieldID); - } - jchar GetCharField(jobject obj, jfieldID fieldID) { - return functions->GetCharField(this,obj,fieldID); - } - jshort GetShortField(jobject obj, jfieldID fieldID) { - return functions->GetShortField(this,obj,fieldID); - } - jint GetIntField(jobject obj, jfieldID fieldID) { - return functions->GetIntField(this,obj,fieldID); - } - jlong GetLongField(jobject obj, jfieldID fieldID) { - return functions->GetLongField(this,obj,fieldID); - } - jfloat GetFloatField(jobject obj, jfieldID fieldID) { - return functions->GetFloatField(this,obj,fieldID); - } - jdouble GetDoubleField(jobject obj, jfieldID fieldID) { - return functions->GetDoubleField(this,obj,fieldID); - } - - void SetObjectField(jobject obj, jfieldID fieldID, jobject val) { - functions->SetObjectField(this,obj,fieldID,val); - } - void SetBooleanField(jobject obj, jfieldID fieldID, - jboolean val) { - functions->SetBooleanField(this,obj,fieldID,val); - } - void SetByteField(jobject obj, jfieldID fieldID, - jbyte val) { - functions->SetByteField(this,obj,fieldID,val); - } - void SetCharField(jobject obj, jfieldID fieldID, - jchar val) { - functions->SetCharField(this,obj,fieldID,val); - } - void SetShortField(jobject obj, jfieldID fieldID, - jshort val) { - functions->SetShortField(this,obj,fieldID,val); - } - void SetIntField(jobject obj, jfieldID fieldID, - jint val) { - functions->SetIntField(this,obj,fieldID,val); - } - void SetLongField(jobject obj, jfieldID fieldID, - jlong val) { - functions->SetLongField(this,obj,fieldID,val); - } - void SetFloatField(jobject obj, jfieldID fieldID, - jfloat val) { - functions->SetFloatField(this,obj,fieldID,val); - } - void SetDoubleField(jobject obj, jfieldID fieldID, - jdouble val) { - functions->SetDoubleField(this,obj,fieldID,val); - } - - jmethodID GetStaticMethodID(jclass clazz, const char *name, - const char *sig) { - return functions->GetStaticMethodID(this,clazz,name,sig); - } - - jobject CallStaticObjectMethod(jclass clazz, jmethodID methodID, - ...) { - va_list args; - jobject result; - va_start(args,methodID); - result = functions->CallStaticObjectMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jobject CallStaticObjectMethodV(jclass clazz, jmethodID methodID, - va_list args) { - return functions->CallStaticObjectMethodV(this,clazz,methodID,args); - } - jobject CallStaticObjectMethodA(jclass clazz, jmethodID methodID, - const jvalue *args) { - return functions->CallStaticObjectMethodA(this,clazz,methodID,args); - } - - jboolean CallStaticBooleanMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jboolean result; - va_start(args,methodID); - result = functions->CallStaticBooleanMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jboolean CallStaticBooleanMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticBooleanMethodV(this,clazz,methodID,args); - } - jboolean CallStaticBooleanMethodA(jclass clazz, - jmethodID methodID, const jvalue *args) { - return functions->CallStaticBooleanMethodA(this,clazz,methodID,args); - } - - jbyte CallStaticByteMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jbyte result; - va_start(args,methodID); - result = functions->CallStaticByteMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jbyte CallStaticByteMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticByteMethodV(this,clazz,methodID,args); - } - jbyte CallStaticByteMethodA(jclass clazz, - jmethodID methodID, const jvalue *args) { - return functions->CallStaticByteMethodA(this,clazz,methodID,args); - } - - jchar CallStaticCharMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jchar result; - va_start(args,methodID); - result = functions->CallStaticCharMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jchar CallStaticCharMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticCharMethodV(this,clazz,methodID,args); - } - jchar CallStaticCharMethodA(jclass clazz, - jmethodID methodID, const jvalue *args) { - return functions->CallStaticCharMethodA(this,clazz,methodID,args); - } - - jshort CallStaticShortMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jshort result; - va_start(args,methodID); - result = functions->CallStaticShortMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jshort CallStaticShortMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticShortMethodV(this,clazz,methodID,args); - } - jshort CallStaticShortMethodA(jclass clazz, - jmethodID methodID, const jvalue *args) { - return functions->CallStaticShortMethodA(this,clazz,methodID,args); - } - - jint CallStaticIntMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jint result; - va_start(args,methodID); - result = functions->CallStaticIntMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jint CallStaticIntMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticIntMethodV(this,clazz,methodID,args); - } - jint CallStaticIntMethodA(jclass clazz, - jmethodID methodID, const jvalue *args) { - return functions->CallStaticIntMethodA(this,clazz,methodID,args); - } - - jlong CallStaticLongMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jlong result; - va_start(args,methodID); - result = functions->CallStaticLongMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jlong CallStaticLongMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticLongMethodV(this,clazz,methodID,args); - } - jlong CallStaticLongMethodA(jclass clazz, - jmethodID methodID, const jvalue *args) { - return functions->CallStaticLongMethodA(this,clazz,methodID,args); - } - - jfloat CallStaticFloatMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jfloat result; - va_start(args,methodID); - result = functions->CallStaticFloatMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jfloat CallStaticFloatMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticFloatMethodV(this,clazz,methodID,args); - } - jfloat CallStaticFloatMethodA(jclass clazz, - jmethodID methodID, const jvalue *args) { - return functions->CallStaticFloatMethodA(this,clazz,methodID,args); - } - - jdouble CallStaticDoubleMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jdouble result; - va_start(args,methodID); - result = functions->CallStaticDoubleMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jdouble CallStaticDoubleMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticDoubleMethodV(this,clazz,methodID,args); - } - jdouble CallStaticDoubleMethodA(jclass clazz, - jmethodID methodID, const jvalue *args) { - return functions->CallStaticDoubleMethodA(this,clazz,methodID,args); - } - - void CallStaticVoidMethod(jclass cls, jmethodID methodID, ...) { - va_list args; - va_start(args,methodID); - functions->CallStaticVoidMethodV(this,cls,methodID,args); - va_end(args); - } - void CallStaticVoidMethodV(jclass cls, jmethodID methodID, - va_list args) { - functions->CallStaticVoidMethodV(this,cls,methodID,args); - } - void CallStaticVoidMethodA(jclass cls, jmethodID methodID, - const jvalue * args) { - functions->CallStaticVoidMethodA(this,cls,methodID,args); - } - - jfieldID GetStaticFieldID(jclass clazz, const char *name, - const char *sig) { - return functions->GetStaticFieldID(this,clazz,name,sig); - } - jobject GetStaticObjectField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticObjectField(this,clazz,fieldID); - } - jboolean GetStaticBooleanField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticBooleanField(this,clazz,fieldID); - } - jbyte GetStaticByteField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticByteField(this,clazz,fieldID); - } - jchar GetStaticCharField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticCharField(this,clazz,fieldID); - } - jshort GetStaticShortField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticShortField(this,clazz,fieldID); - } - jint GetStaticIntField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticIntField(this,clazz,fieldID); - } - jlong GetStaticLongField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticLongField(this,clazz,fieldID); - } - jfloat GetStaticFloatField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticFloatField(this,clazz,fieldID); - } - jdouble GetStaticDoubleField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticDoubleField(this,clazz,fieldID); - } - - void SetStaticObjectField(jclass clazz, jfieldID fieldID, - jobject value) { - functions->SetStaticObjectField(this,clazz,fieldID,value); - } - void SetStaticBooleanField(jclass clazz, jfieldID fieldID, - jboolean value) { - functions->SetStaticBooleanField(this,clazz,fieldID,value); - } - void SetStaticByteField(jclass clazz, jfieldID fieldID, - jbyte value) { - functions->SetStaticByteField(this,clazz,fieldID,value); - } - void SetStaticCharField(jclass clazz, jfieldID fieldID, - jchar value) { - functions->SetStaticCharField(this,clazz,fieldID,value); - } - void SetStaticShortField(jclass clazz, jfieldID fieldID, - jshort value) { - functions->SetStaticShortField(this,clazz,fieldID,value); - } - void SetStaticIntField(jclass clazz, jfieldID fieldID, - jint value) { - functions->SetStaticIntField(this,clazz,fieldID,value); - } - void SetStaticLongField(jclass clazz, jfieldID fieldID, - jlong value) { - functions->SetStaticLongField(this,clazz,fieldID,value); - } - void SetStaticFloatField(jclass clazz, jfieldID fieldID, - jfloat value) { - functions->SetStaticFloatField(this,clazz,fieldID,value); - } - void SetStaticDoubleField(jclass clazz, jfieldID fieldID, - jdouble value) { - functions->SetStaticDoubleField(this,clazz,fieldID,value); - } - - jstring NewString(const jchar *unicode, jsize len) { - return functions->NewString(this,unicode,len); - } - jsize GetStringLength(jstring str) { - return functions->GetStringLength(this,str); - } - const jchar *GetStringChars(jstring str, jboolean *isCopy) { - return functions->GetStringChars(this,str,isCopy); - } - void ReleaseStringChars(jstring str, const jchar *chars) { - functions->ReleaseStringChars(this,str,chars); - } - - jstring NewStringUTF(const char *utf) { - return functions->NewStringUTF(this,utf); - } - jsize GetStringUTFLength(jstring str) { - return functions->GetStringUTFLength(this,str); - } - const char* GetStringUTFChars(jstring str, jboolean *isCopy) { - return functions->GetStringUTFChars(this,str,isCopy); - } - void ReleaseStringUTFChars(jstring str, const char* chars) { - functions->ReleaseStringUTFChars(this,str,chars); - } - - jsize GetArrayLength(jarray array) { - return functions->GetArrayLength(this,array); - } - - jobjectArray NewObjectArray(jsize len, jclass clazz, - jobject init) { - return functions->NewObjectArray(this,len,clazz,init); - } - jobject GetObjectArrayElement(jobjectArray array, jsize index) { - return functions->GetObjectArrayElement(this,array,index); - } - void SetObjectArrayElement(jobjectArray array, jsize index, - jobject val) { - functions->SetObjectArrayElement(this,array,index,val); - } - - jbooleanArray NewBooleanArray(jsize len) { - return functions->NewBooleanArray(this,len); - } - jbyteArray NewByteArray(jsize len) { - return functions->NewByteArray(this,len); - } - jcharArray NewCharArray(jsize len) { - return functions->NewCharArray(this,len); - } - jshortArray NewShortArray(jsize len) { - return functions->NewShortArray(this,len); - } - jintArray NewIntArray(jsize len) { - return functions->NewIntArray(this,len); - } - jlongArray NewLongArray(jsize len) { - return functions->NewLongArray(this,len); - } - jfloatArray NewFloatArray(jsize len) { - return functions->NewFloatArray(this,len); - } - jdoubleArray NewDoubleArray(jsize len) { - return functions->NewDoubleArray(this,len); - } - - jboolean * GetBooleanArrayElements(jbooleanArray array, jboolean *isCopy) { - return functions->GetBooleanArrayElements(this,array,isCopy); - } - jbyte * GetByteArrayElements(jbyteArray array, jboolean *isCopy) { - return functions->GetByteArrayElements(this,array,isCopy); - } - jchar * GetCharArrayElements(jcharArray array, jboolean *isCopy) { - return functions->GetCharArrayElements(this,array,isCopy); - } - jshort * GetShortArrayElements(jshortArray array, jboolean *isCopy) { - return functions->GetShortArrayElements(this,array,isCopy); - } - jint * GetIntArrayElements(jintArray array, jboolean *isCopy) { - return functions->GetIntArrayElements(this,array,isCopy); - } - jlong * GetLongArrayElements(jlongArray array, jboolean *isCopy) { - return functions->GetLongArrayElements(this,array,isCopy); - } - jfloat * GetFloatArrayElements(jfloatArray array, jboolean *isCopy) { - return functions->GetFloatArrayElements(this,array,isCopy); - } - jdouble * GetDoubleArrayElements(jdoubleArray array, jboolean *isCopy) { - return functions->GetDoubleArrayElements(this,array,isCopy); - } - - void ReleaseBooleanArrayElements(jbooleanArray array, - jboolean *elems, - jint mode) { - functions->ReleaseBooleanArrayElements(this,array,elems,mode); - } - void ReleaseByteArrayElements(jbyteArray array, - jbyte *elems, - jint mode) { - functions->ReleaseByteArrayElements(this,array,elems,mode); - } - void ReleaseCharArrayElements(jcharArray array, - jchar *elems, - jint mode) { - functions->ReleaseCharArrayElements(this,array,elems,mode); - } - void ReleaseShortArrayElements(jshortArray array, - jshort *elems, - jint mode) { - functions->ReleaseShortArrayElements(this,array,elems,mode); - } - void ReleaseIntArrayElements(jintArray array, - jint *elems, - jint mode) { - functions->ReleaseIntArrayElements(this,array,elems,mode); - } - void ReleaseLongArrayElements(jlongArray array, - jlong *elems, - jint mode) { - functions->ReleaseLongArrayElements(this,array,elems,mode); - } - void ReleaseFloatArrayElements(jfloatArray array, - jfloat *elems, - jint mode) { - functions->ReleaseFloatArrayElements(this,array,elems,mode); - } - void ReleaseDoubleArrayElements(jdoubleArray array, - jdouble *elems, - jint mode) { - functions->ReleaseDoubleArrayElements(this,array,elems,mode); - } - - void GetBooleanArrayRegion(jbooleanArray array, - jsize start, jsize len, jboolean *buf) { - functions->GetBooleanArrayRegion(this,array,start,len,buf); - } - void GetByteArrayRegion(jbyteArray array, - jsize start, jsize len, jbyte *buf) { - functions->GetByteArrayRegion(this,array,start,len,buf); - } - void GetCharArrayRegion(jcharArray array, - jsize start, jsize len, jchar *buf) { - functions->GetCharArrayRegion(this,array,start,len,buf); - } - void GetShortArrayRegion(jshortArray array, - jsize start, jsize len, jshort *buf) { - functions->GetShortArrayRegion(this,array,start,len,buf); - } - void GetIntArrayRegion(jintArray array, - jsize start, jsize len, jint *buf) { - functions->GetIntArrayRegion(this,array,start,len,buf); - } - void GetLongArrayRegion(jlongArray array, - jsize start, jsize len, jlong *buf) { - functions->GetLongArrayRegion(this,array,start,len,buf); - } - void GetFloatArrayRegion(jfloatArray array, - jsize start, jsize len, jfloat *buf) { - functions->GetFloatArrayRegion(this,array,start,len,buf); - } - void GetDoubleArrayRegion(jdoubleArray array, - jsize start, jsize len, jdouble *buf) { - functions->GetDoubleArrayRegion(this,array,start,len,buf); - } - - void SetBooleanArrayRegion(jbooleanArray array, jsize start, jsize len, - const jboolean *buf) { - functions->SetBooleanArrayRegion(this,array,start,len,buf); - } - void SetByteArrayRegion(jbyteArray array, jsize start, jsize len, - const jbyte *buf) { - functions->SetByteArrayRegion(this,array,start,len,buf); - } - void SetCharArrayRegion(jcharArray array, jsize start, jsize len, - const jchar *buf) { - functions->SetCharArrayRegion(this,array,start,len,buf); - } - void SetShortArrayRegion(jshortArray array, jsize start, jsize len, - const jshort *buf) { - functions->SetShortArrayRegion(this,array,start,len,buf); - } - void SetIntArrayRegion(jintArray array, jsize start, jsize len, - const jint *buf) { - functions->SetIntArrayRegion(this,array,start,len,buf); - } - void SetLongArrayRegion(jlongArray array, jsize start, jsize len, - const jlong *buf) { - functions->SetLongArrayRegion(this,array,start,len,buf); - } - void SetFloatArrayRegion(jfloatArray array, jsize start, jsize len, - const jfloat *buf) { - functions->SetFloatArrayRegion(this,array,start,len,buf); - } - void SetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len, - const jdouble *buf) { - functions->SetDoubleArrayRegion(this,array,start,len,buf); - } - - jint RegisterNatives(jclass clazz, const JNINativeMethod *methods, - jint nMethods) { - return functions->RegisterNatives(this,clazz,methods,nMethods); - } - jint UnregisterNatives(jclass clazz) { - return functions->UnregisterNatives(this,clazz); - } - - jint MonitorEnter(jobject obj) { - return functions->MonitorEnter(this,obj); - } - jint MonitorExit(jobject obj) { - return functions->MonitorExit(this,obj); - } - - jint GetJavaVM(JavaVM **vm) { - return functions->GetJavaVM(this,vm); - } - - void GetStringRegion(jstring str, jsize start, jsize len, jchar *buf) { - functions->GetStringRegion(this,str,start,len,buf); - } - void GetStringUTFRegion(jstring str, jsize start, jsize len, char *buf) { - functions->GetStringUTFRegion(this,str,start,len,buf); - } - - void * GetPrimitiveArrayCritical(jarray array, jboolean *isCopy) { - return functions->GetPrimitiveArrayCritical(this,array,isCopy); - } - void ReleasePrimitiveArrayCritical(jarray array, void *carray, jint mode) { - functions->ReleasePrimitiveArrayCritical(this,array,carray,mode); - } - - const jchar * GetStringCritical(jstring string, jboolean *isCopy) { - return functions->GetStringCritical(this,string,isCopy); - } - void ReleaseStringCritical(jstring string, const jchar *cstring) { - functions->ReleaseStringCritical(this,string,cstring); - } - - jweak NewWeakGlobalRef(jobject obj) { - return functions->NewWeakGlobalRef(this,obj); - } - void DeleteWeakGlobalRef(jweak ref) { - functions->DeleteWeakGlobalRef(this,ref); - } - - jboolean ExceptionCheck() { - return functions->ExceptionCheck(this); - } - - jobject NewDirectByteBuffer(void* address, jlong capacity) { - return functions->NewDirectByteBuffer(this, address, capacity); - } - void* GetDirectBufferAddress(jobject buf) { - return functions->GetDirectBufferAddress(this, buf); - } - jlong GetDirectBufferCapacity(jobject buf) { - return functions->GetDirectBufferCapacity(this, buf); - } - jobjectRefType GetObjectRefType(jobject obj) { - return functions->GetObjectRefType(this, obj); - } - -#endif /* __cplusplus */ -}; - -typedef struct JavaVMOption { - char *optionString; - void *extraInfo; -} JavaVMOption; - -typedef struct JavaVMInitArgs { - jint version; - - jint nOptions; - JavaVMOption *options; - jboolean ignoreUnrecognized; -} JavaVMInitArgs; - -typedef struct JavaVMAttachArgs { - jint version; - - char *name; - jobject group; -} JavaVMAttachArgs; - -/* These will be VM-specific. */ - -#define JDK1_2 -#define JDK1_4 - -/* End VM-specific. */ - -struct JNIInvokeInterface_ { - void *reserved0; - void *reserved1; - void *reserved2; - - jint (JNICALL *DestroyJavaVM)(JavaVM *vm); - - jint (JNICALL *AttachCurrentThread)(JavaVM *vm, void **penv, void *args); - - jint (JNICALL *DetachCurrentThread)(JavaVM *vm); - - jint (JNICALL *GetEnv)(JavaVM *vm, void **penv, jint version); - - jint (JNICALL *AttachCurrentThreadAsDaemon)(JavaVM *vm, void **penv, void *args); -}; - -struct JavaVM_ { - const struct JNIInvokeInterface_ *functions; -#ifdef __cplusplus - - jint DestroyJavaVM() { - return functions->DestroyJavaVM(this); - } - jint AttachCurrentThread(void **penv, void *args) { - return functions->AttachCurrentThread(this, penv, args); - } - jint DetachCurrentThread() { - return functions->DetachCurrentThread(this); - } - - jint GetEnv(void **penv, jint version) { - return functions->GetEnv(this, penv, version); - } - jint AttachCurrentThreadAsDaemon(void **penv, void *args) { - return functions->AttachCurrentThreadAsDaemon(this, penv, args); - } -#endif -}; - -#ifdef _JNI_IMPLEMENTATION_ -#define _JNI_IMPORT_OR_EXPORT_ JNIEXPORT -#else -#define _JNI_IMPORT_OR_EXPORT_ JNIIMPORT -#endif -_JNI_IMPORT_OR_EXPORT_ jint JNICALL -JNI_GetDefaultJavaVMInitArgs(void *args); - -_JNI_IMPORT_OR_EXPORT_ jint JNICALL -JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args); - -_JNI_IMPORT_OR_EXPORT_ jint JNICALL -JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *); - -/* Defined by native libraries. */ -JNIEXPORT jint JNICALL -JNI_OnLoad(JavaVM *vm, void *reserved); - -JNIEXPORT void JNICALL -JNI_OnUnload(JavaVM *vm, void *reserved); - -#define JNI_VERSION_1_1 0x00010001 -#define JNI_VERSION_1_2 0x00010002 -#define JNI_VERSION_1_4 0x00010004 -#define JNI_VERSION_1_6 0x00010006 - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - -#endif /* !_JAVASOFT_JNI_H_ */ diff --git a/src/bind/javainc/linux/jni_md.h b/src/bind/javainc/linux/jni_md.h deleted file mode 100644 index d8c88574a..000000000 --- a/src/bind/javainc/linux/jni_md.h +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file should be replaced by the "official" jni_md.h - * for linux - */ -#ifndef __JNI_MD_H__ -#define __JNI_MD_H__ - -/** - * Nothing special for these declspecs for Linux. Leave alone. - */ -#define JNIEXPORT -#define JNIIMPORT -#define JNICALL - -typedef signed char jbyte; -typedef int jint; - -/* 64 bit? */ -#ifdef _LP64 -typedef long jlong; -#else -typedef long long jlong; -#endif - - -#endif /* __JNI_MD_H__ */ diff --git a/src/bind/javainc/solaris/jni_md.h b/src/bind/javainc/solaris/jni_md.h deleted file mode 100644 index 688d573a7..000000000 --- a/src/bind/javainc/solaris/jni_md.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 1996-2000 Sun Microsystems, Inc. All Rights Reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Sun designates this - * particular file as subject to the "Classpath" exception as provided - * by Sun in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - */ - -#ifndef _JAVASOFT_JNI_MD_H_ -#define _JAVASOFT_JNI_MD_H_ - -#define JNIEXPORT -#define JNIIMPORT -#define JNICALL - -typedef int jint; -#ifdef _LP64 /* 64-bit Solaris */ -typedef long jlong; -#else -typedef long long jlong; -#endif - -typedef signed char jbyte; - -#endif /* !_JAVASOFT_JNI_MD_H_ */ diff --git a/src/bind/javainc/win32/jni_md.h b/src/bind/javainc/win32/jni_md.h deleted file mode 100644 index 4ae350658..000000000 --- a/src/bind/javainc/win32/jni_md.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 1996-1998 Sun Microsystems, Inc. All Rights Reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Sun designates this - * particular file as subject to the "Classpath" exception as provided - * by Sun in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - */ - -#ifndef _JAVASOFT_JNI_MD_H_ -#define _JAVASOFT_JNI_MD_H_ - -#define JNIEXPORT __declspec(dllexport) -#define JNIIMPORT __declspec(dllimport) -#define JNICALL __stdcall - -typedef long jint; -typedef __int64 jlong; -typedef signed char jbyte; - -#endif /* !_JAVASOFT_JNI_MD_H_ */ diff --git a/src/bind/makefile.in b/src/bind/makefile.in deleted file mode 100644 index 90ed85bb4..000000000 --- a/src/bind/makefile.in +++ /dev/null @@ -1,17 +0,0 @@ -# Convenience stub makefile to call the real Makefile. - -@SET_MAKE@ - -OBJEXT = @OBJEXT@ - -# Explicit so that it's the default rule. -all: - cd .. && $(MAKE) bind/all - -clean %.a %.$(OBJEXT): - cd .. && $(MAKE) bind/$@ - -.PHONY: all clean - -.SUFFIXES: -.SUFFIXES: .a .$(OBJEXT) diff --git a/src/check-header-compile.in b/src/check-header-compile.in index ca9eb6a62..2295dcf91 100755 --- a/src/check-header-compile.in +++ b/src/check-header-compile.in @@ -26,7 +26,6 @@ if [ $# = 0 ]; then -o -name ecma -prune \ -o -name render -prune \ -o -name xpath -prune \ - -o -path '*/extension/script/js' -prune \ -o -name '*.h' \ \! -name gnome.h \! -name nr-type-gnome.h \! -name Livarot.h \! -name radial.h \ \! -name '*-test.h' \ diff --git a/src/extension/CMakeLists.txt b/src/extension/CMakeLists.txt index fa4fdd740..4507d9ce2 100644 --- a/src/extension/CMakeLists.txt +++ b/src/extension/CMakeLists.txt @@ -62,8 +62,6 @@ set(extension_SRC internal/pdfinput/pdf-parser.cpp internal/pdfinput/svg-builder.cpp - script/InkscapeScript.cpp - # ------ # Header db.h @@ -136,8 +134,6 @@ set(extension_SRC internal/svg.h internal/svgz.h internal/vsd-input.h - - script/InkscapeScript.h ) if(WIN32) diff --git a/src/extension/script/InkscapeScript.cpp b/src/extension/script/InkscapeScript.cpp deleted file mode 100644 index 02cd28fa5..000000000 --- a/src/extension/script/InkscapeScript.cpp +++ /dev/null @@ -1,223 +0,0 @@ -/* - * This is a simple mechanism to bind Inkscape to Java, and thence - * to all of the nice things that can be layered upon that. - * - * Authors: - * Bob Jamison - * - * Copyright (C) 2007-2008 Bob Jamison - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - - -#include "InkscapeScript.h" - - -#include - - -namespace Inkscape -{ -namespace Extension -{ -namespace Script -{ - - -typedef Inkscape::Bind::Value Value; - - -/** - * - */ -InkscapeScript::InkscapeScript() -{ -} - - - - -/** - * - */ -InkscapeScript::~InkscapeScript() -{ -} - - - - -/** - * Interprets the script in the 'script' buffer, - * storing the stdout output in 'output', and any - * error messages in 'error.' Language is one of the - * enumerated types in ScriptLanguage above. - */ -bool InkscapeScript::interpretScript(const Glib::ustring &script, - Glib::ustring & /*output*/, - Glib::ustring & /*error*/, - ScriptLanguage language) -{ - const char *langname=NULL; - //if() instead of switch() lets us scope vars - if (language == InkscapeScript::JAVASCRIPT) - { - langname="javascript"; - } - else if (language == InkscapeScript::PYTHON) - { - langname="python"; - } - else if (language == InkscapeScript::RUBY) - { - langname="ruby"; - } - else - { - g_warning("interpretScript: Unknown Script Language type: %d\n", - language); - return false; - } - - Inkscape::Bind::JavaBindery *binder = - Inkscape::Bind::JavaBindery::getInstance(); - if (!binder->loadJVM()) //idempotent - { - g_warning("interpretScript: unable to start JVM\n"); - return false; - } - std::vector parms; - Value retval; - Value parm; - parm.setString(langname); - parms.push_back(parm); - parm.setString(script); - parms.push_back(parm); - - //binder->stdOutClear(); - //binder->stdErrClear(); - bool ret = binder->callStatic(Value::BIND_BOOLEAN, - "org/inkscape/cmn/ScriptRunner", - "run", - "(Ljava/lang/String;Ljava/lang/String;)Z", - parms, - retval); - //output = binder->stdOutGet(); - //error = binder->stdErrGet(); - - if (!ret) - { - g_warning("interpretScript: failed\n"); - return false; - } - - return true; -} - - -/** - * Interprets the script in the named file, - * storing the stdout output in 'output', and any - * error messages in 'error.' Language is one of the - * enumerated types in ScriptLanguage above. - */ -bool InkscapeScript::interpretFile(const Glib::ustring &fname, - Glib::ustring & /*output*/, - Glib::ustring & /*error*/, - ScriptLanguage language) -{ - const char *langname=NULL; - //if() instead of switch() lets us scope vars - if (language == InkscapeScript::JAVASCRIPT) - { - langname="Javascript"; - } - else if (language == InkscapeScript::PYTHON) - { - langname="Python"; - } - else if (language == InkscapeScript::RUBY) - { - langname="Ruby"; - } - else - { - g_warning("interpretFile: Unknown Script Language type: %d\n", - language); - return false; - } - - Inkscape::Bind::JavaBindery *binder = - Inkscape::Bind::JavaBindery::getInstance(); - if (!binder->loadJVM()) //idempotent - { - g_warning("interpretFile: unable to start JVM\n"); - return false; - } - std::vector parms; - Value retval; - Value parm; - parm.setString(langname); - parms.push_back(parm); - parm.setString(fname); - parms.push_back(parm); - - //binder->stdOutClear(); - //binder->stdErrClear(); - bool ret = binder->callStatic(Value::BIND_BOOLEAN, - "org/inkscape/cmn/ScriptRunner", - "runFile", - "(Ljava/lang/String;Ljava/lang/String;)Z", - parms, - retval); - //output = binder->stdOutGet(); - //error = binder->stdErrGet(); - - if (!ret) - { - g_warning("interpretFile: failed\n"); - return false; - } - - return true; -} - - - - - - - - - -} // namespace Script -} // namespace Extension -} // namespace Inkscape - -//######################################################################### -//# E N D O F F I L E -//######################################################################### - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/extension/script/InkscapeScript.h b/src/extension/script/InkscapeScript.h deleted file mode 100644 index 8d6346582..000000000 --- a/src/extension/script/InkscapeScript.h +++ /dev/null @@ -1,102 +0,0 @@ -#ifndef SEEN_INKSCAPE_SCRIPT_H -#define SEEN_INKSCAPE_SCRIPT_H - -/* - * Authors: - * Bob Jamison - * - * Copyright (C) 2004-2008 Bob Jamison - * - * Released under GNU GPL, read the file 'COPYING' for more information - */ - -#include "config.h" - -namespace Glib { -class ustring; -} - -namespace Inkscape -{ -namespace Extension -{ -namespace Script -{ - - - -/** - * Inkscape Scripting container. - * This class is used to run scripts, either from a file or buffer. - */ -class InkscapeScript -{ -public: - - /** - * Which type of language? - */ - typedef enum - { - JAVASCRIPT, - PYTHON, - RUBY - } ScriptLanguage; - - /** - * Creates a generic script interpreter. - */ - InkscapeScript(); - - /** - * Destructor - */ - virtual ~InkscapeScript(); - - /** - * Interprets the script in the 'script' buffer, - * storing the stdout output in 'output', and any - * error messages in 'error.' Language is one of the - * enumerated types in ScriptLanguage above. - */ - bool interpretScript(const Glib::ustring &script, - Glib::ustring &output, - Glib::ustring &error, - ScriptLanguage language); - - /** - * Interprets the script in the named file, - * storing the stdout output in 'output', and any - * error messages in 'error.' Language is one of the - * enumerated types in ScriptLanguage above. - */ - bool interpretFile(const Glib::ustring &fname, - Glib::ustring &output, - Glib::ustring &error, - ScriptLanguage language); - - - -}; //class InkscapeScript - - - - -} // namespace Script -} // namespace Extension -} // namespace Inkscape - - - -#endif /* __INKSCAPE_SCRIPT_H__ */ - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/extension/script/Makefile_insert b/src/extension/script/Makefile_insert deleted file mode 100644 index c0bd91e81..000000000 --- a/src/extension/script/Makefile_insert +++ /dev/null @@ -1,6 +0,0 @@ -## Makefile.am fragment sourced by src/Makefile.am. - -ink_common_sources += \ - extension/script/InkscapeScript.h \ - extension/script/InkscapeScript.cpp - diff --git a/src/extension/script/makefile.in b/src/extension/script/makefile.in deleted file mode 100644 index f4857a9e3..000000000 --- a/src/extension/script/makefile.in +++ /dev/null @@ -1,17 +0,0 @@ -# Convenience stub makefile to call the real Makefile. - -@SET_MAKE@ - -OBJEXT = @OBJEXT@ - -# Explicit so that it's the default rule. -all: - cd ../.. && $(MAKE) extension/script/all - -clean %.a %.$(OBJEXT): - cd ../.. && $(MAKE) extension/script/$@ - -.PHONY: all clean - -.SUFFIXES: -.SUFFIXES: .a .$(OBJEXT) diff --git a/src/menus-skeleton.h b/src/menus-skeleton.h index 77e781763..d01e3e38c 100644 --- a/src/menus-skeleton.h +++ b/src/menus-skeleton.h @@ -141,7 +141,6 @@ static char const menus_skeleton[] = " \n" " \n" " \n" -//" \n" " \n" " \n" " \n" diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt index f3c3b8473..e831bcf69 100644 --- a/src/ui/CMakeLists.txt +++ b/src/ui/CMakeLists.txt @@ -59,7 +59,6 @@ set(ui_SRC dialog/ocaldialogs.cpp dialog/print-colors-preview-dialog.cpp dialog/print.cpp - dialog/scriptdialog.cpp dialog/symbols.cpp dialog/xml-tree.cpp # dialog/session-player.cpp @@ -172,7 +171,6 @@ set(ui_SRC dialog/panel-dialog.h dialog/print-colors-preview-dialog.h dialog/print.h - dialog/scriptdialog.h dialog/spellcheck.h dialog/svg-fonts-dialog.h dialog/swatches.h diff --git a/src/ui/dialog/Makefile_insert b/src/ui/dialog/Makefile_insert index 580b47522..bbede9df1 100644 --- a/src/ui/dialog/Makefile_insert +++ b/src/ui/dialog/Makefile_insert @@ -81,8 +81,6 @@ ink_common_sources += \ ui/dialog/print.h \ ui/dialog/print-colors-preview-dialog.cpp \ ui/dialog/print-colors-preview-dialog.h \ - ui/dialog/scriptdialog.cpp \ - ui/dialog/scriptdialog.h \ ui/dialog/spellcheck.cpp \ ui/dialog/spellcheck.h \ ui/dialog/svg-fonts-dialog.cpp \ diff --git a/src/ui/dialog/dialog-manager.cpp b/src/ui/dialog/dialog-manager.cpp index 993f48d8f..0ce74f54e 100644 --- a/src/ui/dialog/dialog-manager.cpp +++ b/src/ui/dialog/dialog-manager.cpp @@ -32,7 +32,6 @@ #include "ui/dialog/livepatheffect-editor.h" #include "ui/dialog/memory.h" #include "ui/dialog/messages.h" -#include "ui/dialog/scriptdialog.h" #include "ui/dialog/symbols.h" #include "ui/dialog/tile.h" #include "ui/dialog/tracedialog.h" @@ -114,7 +113,6 @@ DialogManager::DialogManager() { registerFactory("ObjectAttributes", &create); registerFactory("ObjectProperties", &create); // registerFactory("PrintColorsPreviewDialog", &create); - registerFactory("Script", &create); registerFactory("SvgFontsDialog", &create); registerFactory("Swatches", &create); registerFactory("Symbols", &create); @@ -148,7 +146,6 @@ DialogManager::DialogManager() { registerFactory("ObjectAttributes", &create); registerFactory("ObjectProperties", &create); // registerFactory("PrintColorsPreviewDialog", &create); - registerFactory("Script", &create); registerFactory("SvgFontsDialog", &create); registerFactory("Swatches", &create); registerFactory("Symbols", &create); diff --git a/src/ui/dialog/scriptdialog.cpp b/src/ui/dialog/scriptdialog.cpp deleted file mode 100644 index 87794a3ce..000000000 --- a/src/ui/dialog/scriptdialog.cpp +++ /dev/null @@ -1,255 +0,0 @@ -/** - * @file - * Dialog for executing and monitoring script execution. - */ -/* Author: - * Bob Jamison - * - * Copyright (C) 2004-2008 Authors - * - * Released under GNU GPL, read the file 'COPYING' for more information - */ -#ifdef HAVE_CONFIG_H -# include -#endif - -#include "scriptdialog.h" -#include -#include -#include -#include -#include - -#include - - - -namespace Inkscape -{ -namespace UI -{ -namespace Dialog -{ - - - -//######################################################################### -//## I M P L E M E N T A T I O N -//######################################################################### - -/** - * A script editor/executor - */ -class ScriptDialogImpl : public ScriptDialog -{ - - public: - ScriptDialogImpl(); - ~ScriptDialogImpl() - {} - - - /** - * Remove all text from the dialog. - */ - void clear(); - - /** - * Execute a script in the dialog. - * - * @param lang language in which the script is programmed - */ - void execute(Inkscape::Extension::Script::InkscapeScript::ScriptLanguage lang); - - /** - * Execute a Javascript script - */ - void executeJavascript(); - - /** - * Execute a Python script - */ - void executePython(); - - /** - * Execute a Ruby script - */ - void executeRuby(); - - - - private: - Gtk::MenuBar menuBar; - Gtk::Menu fileMenu; - - //## Script text - Gtk::Frame scriptTextFrame; - Gtk::ScrolledWindow scriptTextScroll; - Gtk::TextView scriptText; - - //## Output text - Gtk::Frame outputTextFrame; - Gtk::ScrolledWindow outputTextScroll; - Gtk::TextView outputText; - - //## Error text - Gtk::Frame errorTextFrame; - Gtk::ScrolledWindow errorTextScroll; - Gtk::TextView errorText; - - - -}; - -static const char *defaultCodeStr = - "/**\n" - " * This is some example Javascript.\n" - " * Try 'Execute Javascript'\n" - " */\n" - "importPackage(javax.swing);\n" - "function sayHello() {\n" - " JOptionPane.showMessageDialog(null, 'Hello, world!',\n" - " 'Welcome to Inkscape', JOptionPane.WARNING_MESSAGE);\n" - "}\n" - "\n" - "sayHello();\n" - "\n"; - - - - -//######################################################################### -//## E V E N T S -//######################################################################### - -static void textViewClear(Gtk::TextView &view) -{ - Glib::RefPtr buffer = view.get_buffer(); - buffer->erase(buffer->begin(), buffer->end()); -} - -void ScriptDialogImpl::clear() -{ - textViewClear(scriptText); - textViewClear(outputText); - textViewClear(errorText); -} - -void ScriptDialogImpl::execute(Inkscape::Extension::Script::InkscapeScript::ScriptLanguage lang) -{ - Glib::ustring script = scriptText.get_buffer()->get_text(true); - Glib::ustring output; - Glib::ustring error; - Inkscape::Extension::Script::InkscapeScript engine; - bool ok = engine.interpretScript(script, output, error, lang); - outputText.get_buffer()->set_text(output); - errorText.get_buffer()->set_text(error); - if (!ok) - { - //do we want something here? - } -} - -void ScriptDialogImpl::executeJavascript() -{ - execute(Inkscape::Extension::Script::InkscapeScript::JAVASCRIPT); -} - -void ScriptDialogImpl::executePython() -{ - execute(Inkscape::Extension::Script::InkscapeScript::PYTHON); -} - -void ScriptDialogImpl::executeRuby() -{ - execute(Inkscape::Extension::Script::InkscapeScript::RUBY); -} - - -//######################################################################### -//## C O N S T R U C T O R / D E S T R U C T O R -//######################################################################### -ScriptDialogImpl::ScriptDialogImpl() : - ScriptDialog() -{ - Gtk::Box *contents = _getContents(); - - //## Add a menu for clear() - Gtk::MenuItem* item = Gtk::manage(new Gtk::MenuItem(_("File"), true)); - item->set_submenu(fileMenu); - menuBar.append(*item); - - item = Gtk::manage(new Gtk::MenuItem(_("_Clear"), true)); - item->signal_activate().connect(sigc::mem_fun(*this, &ScriptDialogImpl::clear)); - fileMenu.append(*item); - - item = Gtk::manage(new Gtk::MenuItem(_("_Execute Javascript"), true)); - item->signal_activate().connect(sigc::mem_fun(*this, &ScriptDialogImpl::executeJavascript)); - fileMenu.append(*item); - - item = Gtk::manage(new Gtk::MenuItem(_("_Execute Python"), true)); - item->signal_activate().connect(sigc::mem_fun(*this, &ScriptDialogImpl::executePython)); - fileMenu.append(*item); - - item = Gtk::manage(new Gtk::MenuItem(_("_Execute Ruby"), true)); - item->signal_activate().connect(sigc::mem_fun(*this, &ScriptDialogImpl::executeRuby)); - fileMenu.append(*item); - - contents->pack_start(menuBar, Gtk::PACK_SHRINK); - - //### Set up the script field - scriptText.set_editable(true); - scriptText.get_buffer()->set_text(defaultCodeStr); - scriptTextScroll.add(scriptText); - scriptTextScroll.set_policy(Gtk::POLICY_ALWAYS, Gtk::POLICY_ALWAYS); - scriptTextFrame.set_label(_("Script")); - scriptTextFrame.set_shadow_type(Gtk::SHADOW_NONE); - scriptTextFrame.add(scriptTextScroll); - contents->pack_start(scriptTextFrame); - - //### Set up the output field - outputText.set_editable(true); - outputText.get_buffer()->set_text(""); - outputTextScroll.add(outputText); - outputTextScroll.set_policy(Gtk::POLICY_ALWAYS, Gtk::POLICY_ALWAYS); - outputTextFrame.set_label(_("Output")); - outputTextFrame.set_shadow_type(Gtk::SHADOW_NONE); - outputTextFrame.add(outputTextScroll); - contents->pack_start(outputTextFrame); - - //### Set up the error field - errorText.set_editable(true); - errorText.get_buffer()->set_text(""); - errorTextScroll.add(errorText); - errorTextScroll.set_policy(Gtk::POLICY_ALWAYS, Gtk::POLICY_ALWAYS); - errorTextFrame.set_label(_("Errors")); - errorTextFrame.set_shadow_type(Gtk::SHADOW_NONE); - errorTextFrame.add(errorTextScroll); - contents->pack_start(errorTextFrame); - - // sick of this thing shrinking too much - set_size_request(350, 400); - show_all_children(); - -} - -ScriptDialog &ScriptDialog::getInstance() -{ - ScriptDialog *dialog = new ScriptDialogImpl(); - return *dialog; -} - -} //namespace Dialogs -} //namespace UI -} //namespace Inkscape - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/scriptdialog.h b/src/ui/dialog/scriptdialog.h deleted file mode 100644 index d1962bf6f..000000000 --- a/src/ui/dialog/scriptdialog.h +++ /dev/null @@ -1,64 +0,0 @@ -/** @file - * @brief Script dialog - * - * This dialog is for launching scripts whose main purpose is - * the scripting of Inkscape itself. - */ -/* Authors: - * Bob Jamison - * Other dudes from The Inkscape Organization - * - * Copyright (C) 2004, 2005 Authors - * - * Released under GNU GPL, read the file 'COPYING' for more information - */ - -#ifndef __SCRIPTDIALOG_H__ -#define __SCRIPTDIALOG_H__ - -#include "ui/widget/panel.h" -#include "verbs.h" - -namespace Inkscape { -namespace UI { -namespace Dialog { - - -/** - * A script editor, loader, and executor - */ -class ScriptDialog : public UI::Widget::Panel -{ - - public: - ScriptDialog() : - UI::Widget::Panel("", "/dialogs/script", SP_VERB_DIALOG_SCRIPT) - {} - - /** - * Helper function which returns a new instance of the dialog. - * getInstance is needed by the dialog manager (Inkscape::UI::Dialog::DialogManager). - */ - static ScriptDialog &getInstance(); - - virtual ~ScriptDialog() {}; - -}; // class ScriptDialog - - -} //namespace Dialog -} //namespace UI -} //namespace Inkscape - -#endif /* __DEBUGDIALOG_H__ */ - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/verbs.cpp b/src/verbs.cpp index a085e841f..06e59be38 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -40,7 +40,6 @@ #include #include -#include "bind/javabind.h" #include "desktop.h" #include "desktop-handles.h" #include "display/curve.h" @@ -1992,10 +1991,6 @@ void DialogVerb::perform(SPAction *action, void *data) case SP_VERB_DIALOG_DEBUG: dt->_dlg_mgr->showDialog("Messages"); break; - case SP_VERB_DIALOG_SCRIPT: - //dt->_dlg_mgr->showDialog("Script"); - Inkscape::Bind::JavaBindery::getInstance()->showConsole(); - break; case SP_VERB_DIALOG_UNDO_HISTORY: dt->_dlg_mgr->showDialog("UndoHistory"); break; @@ -2821,8 +2816,6 @@ Verb *Verb::_base_verbs[] = { N_("Check spelling of text in document"), GTK_STOCK_SPELL_CHECK ), new DialogVerb(SP_VERB_DIALOG_DEBUG, "DialogDebug", N_("_Messages..."), N_("View debug messages"), INKSCAPE_ICON("dialog-messages")), - new DialogVerb(SP_VERB_DIALOG_SCRIPT, "DialogScript", N_("S_cripts..."), - N_("Run scripts"), INKSCAPE_ICON("dialog-scripts")), new DialogVerb(SP_VERB_DIALOG_TOGGLE, "DialogsToggle", N_("Show/Hide D_ialogs"), N_("Show or hide all open dialogs"), INKSCAPE_ICON("show-dialogs")), new DialogVerb(SP_VERB_DIALOG_CLONETILER, "DialogClonetiler", N_("Create Tiled Clones..."), diff --git a/src/verbs.h b/src/verbs.h index 053441b89..5cc2ad12e 100644 --- a/src/verbs.h +++ b/src/verbs.h @@ -280,7 +280,6 @@ enum { SP_VERB_DIALOG_FINDREPLACE, SP_VERB_DIALOG_SPELLCHECK, SP_VERB_DIALOG_DEBUG, - SP_VERB_DIALOG_SCRIPT, SP_VERB_DIALOG_TOGGLE, SP_VERB_DIALOG_CLONETILER, SP_VERB_DIALOG_ATTR, -- cgit v1.2.3 From 5aeb42cd7f874dbd127df4ab7ccc8ffcf25f07ab Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Tue, 23 Jul 2013 13:18:56 +0200 Subject: Remove the Digest class. Replace its only use with a glibmm call. (bzr r12429) --- src/color-profile.cpp | 12 +- src/dom/CMakeLists.txt | 2 - src/dom/Makefile_insert | 2 - src/dom/util/digest.cpp | 1456 ----------------------------------------------- src/dom/util/digest.h | 654 --------------------- 5 files changed, 6 insertions(+), 2120 deletions(-) delete mode 100644 src/dom/util/digest.cpp delete mode 100644 src/dom/util/digest.h (limited to 'src') diff --git a/src/color-profile.cpp b/src/color-profile.cpp index 5fb84d8ac..918fc79d4 100644 --- a/src/color-profile.cpp +++ b/src/color-profile.cpp @@ -4,6 +4,7 @@ #define noDEBUG_LCMS +#include #include #include #include @@ -41,7 +42,6 @@ #include "preferences.h" #include "dom/uri.h" -#include "dom/util/digest.h" #ifdef WIN32 #include @@ -1285,8 +1285,6 @@ Glib::ustring Inkscape::CMSSystem::getDisplayId( int screen, int monitor ) Glib::ustring Inkscape::CMSSystem::setDisplayPer( gpointer buf, guint bufLen, int screen, int monitor ) { - Glib::ustring id; - while ( static_cast(perMonitorProfiles.size()) <= screen ) { std::vector tmp; perMonitorProfiles.push_back(tmp); @@ -1302,11 +1300,13 @@ Glib::ustring Inkscape::CMSSystem::setDisplayPer( gpointer buf, guint bufLen, in cmsCloseProfile( item.hprof ); item.hprof = 0; } - id.clear(); + + Glib::ustring id; if ( buf && bufLen ) { - id = Digest::hashHex(Digest::HASH_MD5, - reinterpret_cast(buf), bufLen); + gsize len = bufLen; // len is an inout parameter + id = Glib::Checksum::compute_checksum(Glib::Checksum::CHECKSUM_MD5, + reinterpret_cast(buf), len); // Note: if this is not a valid profile, item.hprof will be set to null. item.hprof = cmsOpenProfileFromMem(buf, bufLen); diff --git a/src/dom/CMakeLists.txt b/src/dom/CMakeLists.txt index 74832a6f5..7c49466c2 100644 --- a/src/dom/CMakeLists.txt +++ b/src/dom/CMakeLists.txt @@ -20,7 +20,6 @@ set(dom_SRC io/domstream.cpp - util/digest.cpp util/ziptool.cpp @@ -57,7 +56,6 @@ set(dom_SRC io/domstream.h - util/digest.h util/ziptool.h ) diff --git a/src/dom/Makefile_insert b/src/dom/Makefile_insert index 4ed529a35..25629efb2 100644 --- a/src/dom/Makefile_insert +++ b/src/dom/Makefile_insert @@ -52,8 +52,6 @@ dom_libdom_a_SOURCES = \ dom/xpathtoken.cpp \ dom/io/domstream.cpp \ dom/io/domstream.h \ - dom/util/digest.h \ - dom/util/digest.cpp \ dom/util/ziptool.h \ dom/util/ziptool.cpp diff --git a/src/dom/util/digest.cpp b/src/dom/util/digest.cpp deleted file mode 100644 index 2baed4860..000000000 --- a/src/dom/util/digest.cpp +++ /dev/null @@ -1,1456 +0,0 @@ -/* - * Secure Hashing Tool - * * - * Authors: - * Bob Jamison - * - * Copyright (C) 2006-2008 Bob Jamison - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "digest.h" - - -//######################################################################## -//## U T I L I T Y -//######################################################################## - -/** - * Use this to print out a 64-bit int when otherwise difficult - */ -/* -static void pl(uint64_t val) -{ - for (int shift=56 ; shift>=0 ; shift-=8) - { - int ch = (val >> shift) & 0xff; - printf("%02x", ch); - } -} -*/ - - - -/** - * 3These truncate their arguments to - * unsigned 32-bit or unsigned 64-bit. - */ -#define TR32(x) ((x) & 0xffffffffL) -#define TR64(x) ((x) & 0xffffffffffffffffLL) - - -static const char *hexDigits = "0123456789abcdef"; - -static std::string toHex(const std::vector &bytes) -{ - std::string str; - std::vector::const_iterator iter; - for (iter = bytes.begin() ; iter != bytes.end() ; ++iter) - { - unsigned char ch = *iter; - str.push_back(hexDigits[(ch>>4) & 0x0f]); - str.push_back(hexDigits[(ch ) & 0x0f]); - } - return str; -} - - -//######################################################################## -//## D I G E S T -//######################################################################## - - -/** - * - */ -std::string Digest::finishHex() -{ - std::vector hash = finish(); - std::string str = toHex(hash); - return str; -} - -/** - * Convenience method. This is a simple way of getting a hash - */ -std::vector Digest::hash(Digest::HashType typ, - unsigned char *buf, - int len) -{ - std::vector ret; - switch (typ) - { - case HASH_MD5: - { - Md5 digest; - digest.append(buf, len); - ret = digest.finish(); - break; - } - case HASH_SHA1: - { - Sha1 digest; - digest.append(buf, len); - ret = digest.finish(); - break; - } - case HASH_SHA224: - { - Sha224 digest; - digest.append(buf, len); - ret = digest.finish(); - break; - } - case HASH_SHA256: - { - Sha256 digest; - digest.append(buf, len); - ret = digest.finish(); - break; - } - case HASH_SHA384: - { - Sha384 digest; - digest.append(buf, len); - ret = digest.finish(); - break; - } - case HASH_SHA512: - { - Sha512 digest; - digest.append(buf, len); - ret = digest.finish(); - break; - } - default: - { - break; - } - } - return ret; -} - - -/** - * Convenience method. Same as above, but for a std::string - */ -std::vector Digest::hash(Digest::HashType typ, - const std::string &str) -{ - return hash(typ, (unsigned char *)str.c_str(), str.size()); -} - -/** - * Convenience method. Return a hexidecimal string of the hash of the buffer. - */ -std::string Digest::hashHex(Digest::HashType typ, - unsigned char *buf, - int len) -{ - std::vector dig = hash(typ, buf, len); - return toHex(dig); -} - -/** - * Convenience method. Return a hexidecimal string of the hash of the - * string argument - */ -std::string Digest::hashHex(Digest::HashType typ, - const std::string &str) -{ - std::vector dig = hash(typ, str); - return toHex(dig); -} - - - -//4.1.1 and 4.1.2 -#define SHA_ROTL(X,n) ((((X) << (n)) & 0xffffffffL) | (((X) >> (32-(n))) & 0xffffffffL)) -#define SHA_Ch(x,y,z) ((z)^((x)&((y)^(z)))) -#define SHA_Maj(x,y,z) (((x)&(y))^((z)&((x)^(y)))) - - -//######################################################################## -//## S H A 1 -//######################################################################## - - -/** - * - */ -void Sha1::reset() -{ - longNr = 0; - byteNr = 0; - - // Initialize H with the magic constants (see FIPS180 for constants) - hashBuf[0] = 0x67452301L; - hashBuf[1] = 0xefcdab89L; - hashBuf[2] = 0x98badcfeL; - hashBuf[3] = 0x10325476L; - hashBuf[4] = 0xc3d2e1f0L; - - for (int i = 0; i < 4; i++) - inb[i] = 0; - - for (int i = 0; i < 80; i++) - inBuf[i] = 0; - - clearByteCount(); -} - - -/** - * - */ -void Sha1::update(unsigned char ch) -{ - incByteCount(); - - inb[byteNr++] = (uint32_t)ch; - if (byteNr >= 4) - { - inBuf[longNr++] = inb[0] << 24 | inb[1] << 16 | - inb[2] << 8 | inb[3]; - byteNr = 0; - } - if (longNr >= 16) - { - transform(); - longNr = 0; - } -} - - -void Sha1::transform() -{ - uint32_t *W = inBuf; - uint32_t *H = hashBuf; - - //for (int t = 0; t < 16 ; t++) - // printf("%2d %08lx\n", t, W[t]); - - //see 6.1.2 - for (int t = 16; t < 80 ; t++) - W[t] = SHA_ROTL((W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16]), 1); - - uint32_t a = H[0]; - uint32_t b = H[1]; - uint32_t c = H[2]; - uint32_t d = H[3]; - uint32_t e = H[4]; - - uint32_t T; - - int t = 0; - for ( ; t < 20 ; t++) - { - //see 4.1.1 for the boolops on B,C, and D - T = TR32(SHA_ROTL(a,5) + ((b&c)|((~b)&d)) + //Ch(b,c,d)) - e + 0x5a827999L + W[t]); - e = d; d = c; c = SHA_ROTL(b, 30); b = a; a = T; - //printf("%2d %08lx %08lx %08lx %08lx %08lx\n", t, a, b, c, d, e); - } - for ( ; t < 40 ; t++) - { - T = TR32(SHA_ROTL(a,5) + (b^c^d) + e + 0x6ed9eba1L + W[t]); - e = d; d = c; c = SHA_ROTL(b, 30); b = a; a = T; - //printf("%2d %08lx %08lx %08lx %08lx %08lx\n", t, a, b, c, d, e); - } - for ( ; t < 60 ; t++) - { - T = TR32(SHA_ROTL(a,5) + ((b&c)^(b&d)^(c&d)) + - e + 0x8f1bbcdcL + W[t]); - e = d; d = c; c = SHA_ROTL(b, 30); b = a; a = T; - //printf("%2d %08lx %08lx %08lx %08lx %08lx\n", t, a, b, c, d, e); - } - for ( ; t < 80 ; t++) - { - T = TR32(SHA_ROTL(a,5) + (b^c^d) + - e + 0xca62c1d6L + W[t]); - e = d; d = c; c = SHA_ROTL(b, 30); b = a; a = T; - //printf("%2d %08lx %08lx %08lx %08lx %08lx\n", t, a, b, c, d, e); - } - - H[0] = TR32(H[0] + a); - H[1] = TR32(H[1] + b); - H[2] = TR32(H[2] + c); - H[3] = TR32(H[3] + d); - H[4] = TR32(H[4] + e); -} - - - - -/** - * - */ -std::vector Sha1::finish() -{ - //snapshot the bit count now before padding - getBitCount(); - - //Append terminal char - update(0x80); - - //pad until we have a 56 of 64 bytes, allowing for 8 bytes at the end - while ((nrBytes & 63) != 56) - update(0); - - //##### Append length in bits - appendBitCount(); - - //copy out answer - std::vector res; - for (int i=0 ; i<5 ; i++) - { - res.push_back((unsigned char)((hashBuf[i] >> 24) & 0xff)); - res.push_back((unsigned char)((hashBuf[i] >> 16) & 0xff)); - res.push_back((unsigned char)((hashBuf[i] >> 8) & 0xff)); - res.push_back((unsigned char)((hashBuf[i] ) & 0xff)); - } - - // Re-initialize the context (also zeroizes contents) - reset(); - - return res; -} - - - - -//######################################################################## -//## SHA224 -//######################################################################## - - -/** - * SHA-224 and SHA-512 share the same operations and constants - */ - -#define SHA_Rot32(x,s) ((((x) >> s)&0xffffffffL) | (((x) << (32 - s))&0xffffffffL)) -#define SHA_SIGMA0(x) (SHA_Rot32(x, 2) ^ SHA_Rot32(x, 13) ^ SHA_Rot32(x, 22)) -#define SHA_SIGMA1(x) (SHA_Rot32(x, 6) ^ SHA_Rot32(x, 11) ^ SHA_Rot32(x, 25)) -#define SHA_sigma0(x) (SHA_Rot32(x, 7) ^ SHA_Rot32(x, 18) ^ ((x) >> 3)) -#define SHA_sigma1(x) (SHA_Rot32(x, 17) ^ SHA_Rot32(x, 19) ^ ((x) >> 10)) - - -static uint32_t sha256table[64] = -{ - 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, - 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, - 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, - 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL, - 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, - 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, - 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, - 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL, - 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL, - 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, - 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, - 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, - 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL, - 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL, - 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, - 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL -}; - - - - - -/** - * - */ -void Sha224::reset() -{ - longNr = 0; - byteNr = 0; - - // Initialize H with the magic constants (see FIPS180 for constants) - hashBuf[0] = 0xc1059ed8L; - hashBuf[1] = 0x367cd507L; - hashBuf[2] = 0x3070dd17L; - hashBuf[3] = 0xf70e5939L; - hashBuf[4] = 0xffc00b31L; - hashBuf[5] = 0x68581511L; - hashBuf[6] = 0x64f98fa7L; - hashBuf[7] = 0xbefa4fa4L; - - for (int i = 0 ; i < 64 ; i++) - inBuf[i] = 0; - - for (int i = 0 ; i < 4 ; i++) - inb[i] = 0; - - clearByteCount(); -} - - -/** - * - */ -void Sha224::update(unsigned char ch) -{ - incByteCount(); - - inb[byteNr++] = (uint32_t)ch; - if (byteNr >= 4) - { - inBuf[longNr++] = inb[0] << 24 | inb[1] << 16 | - inb[2] << 8 | inb[3]; - byteNr = 0; - } - if (longNr >= 16) - { - transform(); - longNr = 0; - } -} - - -void Sha224::transform() -{ - uint32_t *W = inBuf; - uint32_t *H = hashBuf; - - //for (int t = 0; t < 16 ; t++) - // printf("%2d %08lx\n", t, W[t]); - - //see 6.2.2 - for (int t = 16; t < 64 ; t++) - W[t] = TR32(SHA_sigma1(W[t-2]) + W[t-7] + SHA_sigma0(W[t-15]) + W[t-16]); - - uint32_t a = H[0]; - uint32_t b = H[1]; - uint32_t c = H[2]; - uint32_t d = H[3]; - uint32_t e = H[4]; - uint32_t f = H[5]; - uint32_t g = H[6]; - uint32_t h = H[7]; - - for (int t = 0 ; t < 64 ; t++) - { - //see 4.1.1 for the boolops - uint32_t T1 = TR32(h + SHA_SIGMA1(e) + SHA_Ch(e,f,g) + - sha256table[t] + W[t]); - uint32_t T2 = TR32(SHA_SIGMA0(a) + SHA_Maj(a,b,c)); - h = g; g = f; f = e; e = TR32(d + T1); d = c; c = b; b = a; a = TR32(T1 + T2); - //printf("%2d %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - // t, a, b, c, d, e, f, g, h); - } - - H[0] = TR32(H[0] + a); - H[1] = TR32(H[1] + b); - H[2] = TR32(H[2] + c); - H[3] = TR32(H[3] + d); - H[4] = TR32(H[4] + e); - H[5] = TR32(H[5] + f); - H[6] = TR32(H[6] + g); - H[7] = TR32(H[7] + h); -} - - - -/** - * - */ -std::vector Sha224::finish() -{ - //save our size before padding - getBitCount(); - - // Pad with a binary 1 (0x80) - update(0x80); - //append 0's to make a 56-byte buf. - while ((nrBytes & 63) != 56) - update(0); - - //##### Append length in bits - appendBitCount(); - - // Output hash - std::vector ret; - for (int i = 0 ; i < 7 ; i++) - { - ret.push_back((unsigned char)((hashBuf[i] >> 24) & 0xff)); - ret.push_back((unsigned char)((hashBuf[i] >> 16) & 0xff)); - ret.push_back((unsigned char)((hashBuf[i] >> 8) & 0xff)); - ret.push_back((unsigned char)((hashBuf[i] ) & 0xff)); - } - - // Re-initialize the context (also zeroizes contents) - reset(); - - return ret; - -} - - - -//######################################################################## -//## SHA256 -//######################################################################## - - -/** - * - */ -void Sha256::reset() -{ - longNr = 0; - byteNr = 0; - - // Initialize H with the magic constants (see FIPS180 for constants) - hashBuf[0] = 0x6a09e667L; - hashBuf[1] = 0xbb67ae85L; - hashBuf[2] = 0x3c6ef372L; - hashBuf[3] = 0xa54ff53aL; - hashBuf[4] = 0x510e527fL; - hashBuf[5] = 0x9b05688cL; - hashBuf[6] = 0x1f83d9abL; - hashBuf[7] = 0x5be0cd19L; - - for (int i = 0 ; i < 64 ; i++) - inBuf[i] = 0; - for (int i = 0 ; i < 4 ; i++) - inb[i] = 0; - - clearByteCount(); -} - - -/** - * - */ -void Sha256::update(unsigned char ch) -{ - incByteCount(); - - inb[byteNr++] = (uint32_t)ch; - if (byteNr >= 4) - { - inBuf[longNr++] = inb[0] << 24 | inb[1] << 16 | - inb[2] << 8 | inb[3]; - byteNr = 0; - } - if (longNr >= 16) - { - transform(); - longNr = 0; - } -} - - - - -void Sha256::transform() -{ - uint32_t *H = hashBuf; - uint32_t *W = inBuf; - - //for (int t = 0; t < 16 ; t++) - // printf("%2d %08lx\n", t, W[t]); - - //see 6.2.2 - for (int t = 16; t < 64 ; t++) - W[t] = TR32(SHA_sigma1(W[t-2]) + W[t-7] + SHA_sigma0(W[t-15]) + W[t-16]); - - uint32_t a = H[0]; - uint32_t b = H[1]; - uint32_t c = H[2]; - uint32_t d = H[3]; - uint32_t e = H[4]; - uint32_t f = H[5]; - uint32_t g = H[6]; - uint32_t h = H[7]; - - for (int t = 0 ; t < 64 ; t++) - { - //see 4.1.1 for the boolops - uint32_t T1 = TR32(h + SHA_SIGMA1(e) + SHA_Ch(e,f,g) + - sha256table[t] + W[t]); - uint32_t T2 = TR32(SHA_SIGMA0(a) + SHA_Maj(a,b,c)); - h = g; g = f; f = e; e = TR32(d + T1); d = c; c = b; b = a; a = TR32(T1 + T2); - //printf("%2d %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - // t, a, b, c, d, e, f, g, h); - } - - H[0] = TR32(H[0] + a); - H[1] = TR32(H[1] + b); - H[2] = TR32(H[2] + c); - H[3] = TR32(H[3] + d); - H[4] = TR32(H[4] + e); - H[5] = TR32(H[5] + f); - H[6] = TR32(H[6] + g); - H[7] = TR32(H[7] + h); -} - - - -/** - * - */ -std::vector Sha256::finish() -{ - //save our size before padding - getBitCount(); - - // Pad with a binary 1 (0x80) - update(0x80); - //append 0's to make a 56-byte buf. - while ((nrBytes & 63) != 56) - update(0); - - //##### Append length in bits - appendBitCount(); - - // Output hash - std::vector ret; - for (int i = 0 ; i < 8 ; i++) - { - ret.push_back((unsigned char)((hashBuf[i] >> 24) & 0xff)); - ret.push_back((unsigned char)((hashBuf[i] >> 16) & 0xff)); - ret.push_back((unsigned char)((hashBuf[i] >> 8) & 0xff)); - ret.push_back((unsigned char)((hashBuf[i] ) & 0xff)); - } - - // Re-initialize the context (also zeroizes contents) - reset(); - - return ret; - -} - - - -//######################################################################## -//## SHA384 -//######################################################################## - - -/** - * SHA-384 and SHA-512 share the same operations and constants - */ - -#undef SHA_SIGMA0 -#undef SHA_SIGMA1 -#undef SHA_sigma0 -#undef SHA_sigma1 - -#define SHA_Rot64(x,s) (((x) >> s) | ((x) << (64 - s))) -#define SHA_SIGMA0(x) (SHA_Rot64(x, 28) ^ SHA_Rot64(x, 34) ^ SHA_Rot64(x, 39)) -#define SHA_SIGMA1(x) (SHA_Rot64(x, 14) ^ SHA_Rot64(x, 18) ^ SHA_Rot64(x, 41)) -#define SHA_sigma0(x) (SHA_Rot64(x, 1) ^ SHA_Rot64(x, 8) ^ ((x) >> 7)) -#define SHA_sigma1(x) (SHA_Rot64(x, 19) ^ SHA_Rot64(x, 61) ^ ((x) >> 6)) - - -static uint64_t sha512table[80] = -{ - 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, - 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, - 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, - 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, - 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, - 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, - 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, - 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL, - 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, - 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, - 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, - 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, - 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, - 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL, - 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, - 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, - 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, - 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, - 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, - 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL, - 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, - 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, - 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, - 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, - 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, - 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL, - 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, - 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, - 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, - 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, - 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, - 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL, - 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, - 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, - 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, - 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, - 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, - 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL, - 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, - 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL -}; - - - - -/** - * - */ -void Sha384::reset() -{ - longNr = 0; - byteNr = 0; - - // SHA-384 differs from SHA-512 by these constants - hashBuf[0] = 0xcbbb9d5dc1059ed8ULL; - hashBuf[1] = 0x629a292a367cd507ULL; - hashBuf[2] = 0x9159015a3070dd17ULL; - hashBuf[3] = 0x152fecd8f70e5939ULL; - hashBuf[4] = 0x67332667ffc00b31ULL; - hashBuf[5] = 0x8eb44a8768581511ULL; - hashBuf[6] = 0xdb0c2e0d64f98fa7ULL; - hashBuf[7] = 0x47b5481dbefa4fa4ULL; - - for (int i = 0 ; i < 80 ; i++) - inBuf[i] = 0; - for (int i = 0 ; i < 8 ; i++) - inb[i] = 0; - - clearByteCount(); -} - - -/** - * Note that this version of update() handles 64-bit inBuf - * values. - */ -void Sha384::update(unsigned char ch) -{ - incByteCount(); - - inb[byteNr++] = (uint64_t)ch; - if (byteNr >= 8) - { - inBuf[longNr++] = inb[0] << 56 | inb[1] << 48 | - inb[2] << 40 | inb[3] << 32 | - inb[4] << 24 | inb[5] << 16 | - inb[6] << 8 | inb[7]; - byteNr = 0; - } - if (longNr >= 16) - { - transform(); - longNr = 0; - } -} - - - - -void Sha384::transform() -{ - uint64_t *H = hashBuf; - uint64_t *W = inBuf; - - /* - for (int t = 0; t < 16 ; t++) - { - printf("%2d ", t); - pl(W[t]); - printf("\n"); - } - */ - - //see 6.2.2 - for (int t = 16; t < 80 ; t++) - W[t] = TR64(SHA_sigma1(W[t-2]) + W[t-7] + SHA_sigma0(W[t-15]) + W[t-16]); - - uint64_t a = H[0]; - uint64_t b = H[1]; - uint64_t c = H[2]; - uint64_t d = H[3]; - uint64_t e = H[4]; - uint64_t f = H[5]; - uint64_t g = H[6]; - uint64_t h = H[7]; - - for (int t = 0 ; t < 80 ; t++) - { - //see 4.1.1 for the boolops - uint64_t T1 = TR64(h + SHA_SIGMA1(e) + SHA_Ch(e,f,g) + - sha512table[t] + W[t]); - uint64_t T2 = TR64(SHA_SIGMA0(a) + SHA_Maj(a,b,c)); - h = g; g = f; f = e; e = TR64(d + T1); d = c; c = b; b = a; a = TR64(T1 + T2); - } - - H[0] = TR64(H[0] + a); - H[1] = TR64(H[1] + b); - H[2] = TR64(H[2] + c); - H[3] = TR64(H[3] + d); - H[4] = TR64(H[4] + e); - H[5] = TR64(H[5] + f); - H[6] = TR64(H[6] + g); - H[7] = TR64(H[7] + h); -} - - - -/** - * - */ -std::vector Sha384::finish() -{ - //save our size before padding - getBitCount(); - - // Pad with a binary 1 (0x80) - update((unsigned char)0x80); - //append 0's to make a 112-byte buf. - //we will loop around once if already over 112 - while ((nrBytes & 127) != 112) - update(0); - - //append 128-bit size - //64 upper bits - for (int i = 0 ; i < 8 ; i++) - update((unsigned char)0x00); - //64 lower bits - //##### Append length in bits - appendBitCount(); - - // Output hash - //for SHA-384, we use the left-most 6 64-bit words - std::vector ret; - for (int i = 0 ; i < 6 ; i++) - { - ret.push_back((unsigned char)((hashBuf[i] >> 56) & 0xff)); - ret.push_back((unsigned char)((hashBuf[i] >> 48) & 0xff)); - ret.push_back((unsigned char)((hashBuf[i] >> 40) & 0xff)); - ret.push_back((unsigned char)((hashBuf[i] >> 32) & 0xff)); - ret.push_back((unsigned char)((hashBuf[i] >> 24) & 0xff)); - ret.push_back((unsigned char)((hashBuf[i] >> 16) & 0xff)); - ret.push_back((unsigned char)((hashBuf[i] >> 8) & 0xff)); - ret.push_back((unsigned char)((hashBuf[i] ) & 0xff)); - } - - // Re-initialize the context (also zeroizes contents) - reset(); - - return ret; - -} - - -//######################################################################## -//## SHA512 -//######################################################################## - - - - - -/** - * - */ -void Sha512::reset() -{ - longNr = 0; - byteNr = 0; - - // Initialize H with the magic constants (see FIPS180 for constants) - hashBuf[0] = 0x6a09e667f3bcc908ULL; - hashBuf[1] = 0xbb67ae8584caa73bULL; - hashBuf[2] = 0x3c6ef372fe94f82bULL; - hashBuf[3] = 0xa54ff53a5f1d36f1ULL; - hashBuf[4] = 0x510e527fade682d1ULL; - hashBuf[5] = 0x9b05688c2b3e6c1fULL; - hashBuf[6] = 0x1f83d9abfb41bd6bULL; - hashBuf[7] = 0x5be0cd19137e2179ULL; - - for (int i = 0 ; i < 80 ; i++) - inBuf[i] = 0; - for (int i = 0 ; i < 8 ; i++) - inb[i] = 0; - - clearByteCount(); -} - - -/** - * Note that this version of update() handles 64-bit inBuf - * values. - */ -void Sha512::update(unsigned char ch) -{ - incByteCount(); - - inb[byteNr++] = (uint64_t)ch; - if (byteNr >= 8) - { - inBuf[longNr++] = inb[0] << 56 | inb[1] << 48 | - inb[2] << 40 | inb[3] << 32 | - inb[4] << 24 | inb[5] << 16 | - inb[6] << 8 | inb[7]; - byteNr = 0; - } - if (longNr >= 16) - { - transform(); - longNr = 0; - } -} - - - - -void Sha512::transform() -{ - uint64_t *W = inBuf; - uint64_t *H = hashBuf; - - /* - for (int t = 0; t < 16 ; t++) - { - printf("%2d ", t); - pl(W[t]); - printf("\n"); - } - */ - - //see 6.2.2 - for (int t = 16; t < 80 ; t++) - W[t] = TR64(SHA_sigma1(W[t-2]) + W[t-7] + SHA_sigma0(W[t-15]) + W[t-16]); - - uint64_t a = H[0]; - uint64_t b = H[1]; - uint64_t c = H[2]; - uint64_t d = H[3]; - uint64_t e = H[4]; - uint64_t f = H[5]; - uint64_t g = H[6]; - uint64_t h = H[7]; - - for (int t = 0 ; t < 80 ; t++) - { - //see 4.1.1 for the boolops - uint64_t T1 = TR64(h + SHA_SIGMA1(e) + SHA_Ch(e,f,g) + - sha512table[t] + W[t]); - uint64_t T2 = TR64(SHA_SIGMA0(a) + SHA_Maj(a,b,c)); - h = g; g = f; f = e; e = TR64(d + T1); d = c; c = b; b = a; a = TR64(T1 + T2); - } - - H[0] = TR64(H[0] + a); - H[1] = TR64(H[1] + b); - H[2] = TR64(H[2] + c); - H[3] = TR64(H[3] + d); - H[4] = TR64(H[4] + e); - H[5] = TR64(H[5] + f); - H[6] = TR64(H[6] + g); - H[7] = TR64(H[7] + h); -} - - - -/** - * - */ -std::vector Sha512::finish() -{ - //save our size before padding - getBitCount(); - - // Pad with a binary 1 (0x80) - update(0x80); - //append 0's to make a 112-byte buf. - //we will loop around once if already over 112 - while ((nrBytes & 127) != 112) - update(0); - - //append 128-bit size - //64 upper bits - for (int i = 0 ; i < 8 ; i++) - update((unsigned char)0x00); - //64 lower bits - //##### Append length in bits - appendBitCount(); - - // Output hash - std::vector ret; - for (int i = 0 ; i < 8 ; i++) - { - ret.push_back((unsigned char)((hashBuf[i] >> 56) & 0xff)); - ret.push_back((unsigned char)((hashBuf[i] >> 48) & 0xff)); - ret.push_back((unsigned char)((hashBuf[i] >> 40) & 0xff)); - ret.push_back((unsigned char)((hashBuf[i] >> 32) & 0xff)); - ret.push_back((unsigned char)((hashBuf[i] >> 24) & 0xff)); - ret.push_back((unsigned char)((hashBuf[i] >> 16) & 0xff)); - ret.push_back((unsigned char)((hashBuf[i] >> 8) & 0xff)); - ret.push_back((unsigned char)((hashBuf[i] ) & 0xff)); - } - - // Re-initialize the context (also zeroizes contents) - reset(); - - return ret; - -} - - - -//######################################################################## -//## M D 5 -//######################################################################## - -/** - * - */ -void Md5::reset() -{ - hashBuf[0] = 0x67452301; - hashBuf[1] = 0xefcdab89; - hashBuf[2] = 0x98badcfe; - hashBuf[3] = 0x10325476; - - for (int i=0 ; i<16 ; i++) - inBuf[i] = 0; - for (int i=0 ; i<4 ; i++) - inb[i] = 0; - - clearByteCount(); - - byteNr = 0; - longNr = 0; -} - - -/** - * - */ -void Md5::update(unsigned char ch) -{ - incByteCount(); - - //pack 64 bytes into 16 longs - inb[byteNr++] = (uint32_t)ch; - if (byteNr >= 4) - { - //note the little-endianness - uint32_t val = - inb[3] << 24 | inb[2] << 16 | inb[1] << 8 | inb[0]; - inBuf[longNr++] = val; - byteNr = 0; - } - if (longNr >= 16) - { - transform(); - longNr = 0; - } -} - - - -//# The four core functions - F1 is optimized somewhat - -// #define F1(x, y, z) (x & y | ~x & z) -#define F1(x, y, z) (z ^ (x & (y ^ z))) -#define F2(x, y, z) F1(z, x, y) -#define F3(x, y, z) (x ^ y ^ z) -#define F4(x, y, z) (y ^ (x | ~z)) - -// ## This is the central step in the MD5 algorithm. -#define MD5STEP(f, w, x, y, z, data, s) \ - ( w = TR32(w + (f(x, y, z) + data)), w = w<>(32-s), w = TR32(w + x) ) - -/* - * The core of the MD5 algorithm, this alters an existing MD5 hash to - * reflect the addition of 16 longwords of new data. MD5Update blocks - * the data and converts bytes into longwords for this routine. - * @parm buf points to an array of 4 unsigned 32bit (at least) integers - * @parm in points to an array of 16 unsigned 32bit (at least) integers - */ -void Md5::transform() -{ - uint32_t *i = inBuf; - uint32_t a = hashBuf[0]; - uint32_t b = hashBuf[1]; - uint32_t c = hashBuf[2]; - uint32_t d = hashBuf[3]; - - MD5STEP(F1, a, b, c, d, i[ 0] + 0xd76aa478, 7); - MD5STEP(F1, d, a, b, c, i[ 1] + 0xe8c7b756, 12); - MD5STEP(F1, c, d, a, b, i[ 2] + 0x242070db, 17); - MD5STEP(F1, b, c, d, a, i[ 3] + 0xc1bdceee, 22); - MD5STEP(F1, a, b, c, d, i[ 4] + 0xf57c0faf, 7); - MD5STEP(F1, d, a, b, c, i[ 5] + 0x4787c62a, 12); - MD5STEP(F1, c, d, a, b, i[ 6] + 0xa8304613, 17); - MD5STEP(F1, b, c, d, a, i[ 7] + 0xfd469501, 22); - MD5STEP(F1, a, b, c, d, i[ 8] + 0x698098d8, 7); - MD5STEP(F1, d, a, b, c, i[ 9] + 0x8b44f7af, 12); - MD5STEP(F1, c, d, a, b, i[10] + 0xffff5bb1, 17); - MD5STEP(F1, b, c, d, a, i[11] + 0x895cd7be, 22); - MD5STEP(F1, a, b, c, d, i[12] + 0x6b901122, 7); - MD5STEP(F1, d, a, b, c, i[13] + 0xfd987193, 12); - MD5STEP(F1, c, d, a, b, i[14] + 0xa679438e, 17); - MD5STEP(F1, b, c, d, a, i[15] + 0x49b40821, 22); - - MD5STEP(F2, a, b, c, d, i[ 1] + 0xf61e2562, 5); - MD5STEP(F2, d, a, b, c, i[ 6] + 0xc040b340, 9); - MD5STEP(F2, c, d, a, b, i[11] + 0x265e5a51, 14); - MD5STEP(F2, b, c, d, a, i[ 0] + 0xe9b6c7aa, 20); - MD5STEP(F2, a, b, c, d, i[ 5] + 0xd62f105d, 5); - MD5STEP(F2, d, a, b, c, i[10] + 0x02441453, 9); - MD5STEP(F2, c, d, a, b, i[15] + 0xd8a1e681, 14); - MD5STEP(F2, b, c, d, a, i[ 4] + 0xe7d3fbc8, 20); - MD5STEP(F2, a, b, c, d, i[ 9] + 0x21e1cde6, 5); - MD5STEP(F2, d, a, b, c, i[14] + 0xc33707d6, 9); - MD5STEP(F2, c, d, a, b, i[ 3] + 0xf4d50d87, 14); - MD5STEP(F2, b, c, d, a, i[ 8] + 0x455a14ed, 20); - MD5STEP(F2, a, b, c, d, i[13] + 0xa9e3e905, 5); - MD5STEP(F2, d, a, b, c, i[ 2] + 0xfcefa3f8, 9); - MD5STEP(F2, c, d, a, b, i[ 7] + 0x676f02d9, 14); - MD5STEP(F2, b, c, d, a, i[12] + 0x8d2a4c8a, 20); - - MD5STEP(F3, a, b, c, d, i[ 5] + 0xfffa3942, 4); - MD5STEP(F3, d, a, b, c, i[ 8] + 0x8771f681, 11); - MD5STEP(F3, c, d, a, b, i[11] + 0x6d9d6122, 16); - MD5STEP(F3, b, c, d, a, i[14] + 0xfde5380c, 23); - MD5STEP(F3, a, b, c, d, i[ 1] + 0xa4beea44, 4); - MD5STEP(F3, d, a, b, c, i[ 4] + 0x4bdecfa9, 11); - MD5STEP(F3, c, d, a, b, i[ 7] + 0xf6bb4b60, 16); - MD5STEP(F3, b, c, d, a, i[10] + 0xbebfbc70, 23); - MD5STEP(F3, a, b, c, d, i[13] + 0x289b7ec6, 4); - MD5STEP(F3, d, a, b, c, i[ 0] + 0xeaa127fa, 11); - MD5STEP(F3, c, d, a, b, i[ 3] + 0xd4ef3085, 16); - MD5STEP(F3, b, c, d, a, i[ 6] + 0x04881d05, 23); - MD5STEP(F3, a, b, c, d, i[ 9] + 0xd9d4d039, 4); - MD5STEP(F3, d, a, b, c, i[12] + 0xe6db99e5, 11); - MD5STEP(F3, c, d, a, b, i[15] + 0x1fa27cf8, 16); - MD5STEP(F3, b, c, d, a, i[ 2] + 0xc4ac5665, 23); - - MD5STEP(F4, a, b, c, d, i[ 0] + 0xf4292244, 6); - MD5STEP(F4, d, a, b, c, i[ 7] + 0x432aff97, 10); - MD5STEP(F4, c, d, a, b, i[14] + 0xab9423a7, 15); - MD5STEP(F4, b, c, d, a, i[ 5] + 0xfc93a039, 21); - MD5STEP(F4, a, b, c, d, i[12] + 0x655b59c3, 6); - MD5STEP(F4, d, a, b, c, i[ 3] + 0x8f0ccc92, 10); - MD5STEP(F4, c, d, a, b, i[10] + 0xffeff47d, 15); - MD5STEP(F4, b, c, d, a, i[ 1] + 0x85845dd1, 21); - MD5STEP(F4, a, b, c, d, i[ 8] + 0x6fa87e4f, 6); - MD5STEP(F4, d, a, b, c, i[15] + 0xfe2ce6e0, 10); - MD5STEP(F4, c, d, a, b, i[ 6] + 0xa3014314, 15); - MD5STEP(F4, b, c, d, a, i[13] + 0x4e0811a1, 21); - MD5STEP(F4, a, b, c, d, i[ 4] + 0xf7537e82, 6); - MD5STEP(F4, d, a, b, c, i[11] + 0xbd3af235, 10); - MD5STEP(F4, c, d, a, b, i[ 2] + 0x2ad7d2bb, 15); - MD5STEP(F4, b, c, d, a, i[ 9] + 0xeb86d391, 21); - - hashBuf[0] = TR32(hashBuf[0] + a); - hashBuf[1] = TR32(hashBuf[1] + b); - hashBuf[2] = TR32(hashBuf[2] + c); - hashBuf[3] = TR32(hashBuf[3] + d); -} - - -/** - * - */ -std::vector Md5::finish() -{ - //snapshot the bit count now before padding - getBitCount(); - - //Append terminal char - update(0x80); - - //pad until we have a 56 of 64 bytes, allowing for 8 bytes at the end - while (longNr != 14) - update(0); - - //##### Append length in bits - // Don't use appendBitCount(), since md5 is little-endian - update((unsigned char)((nrBits ) & 0xff)); - update((unsigned char)((nrBits>> 8) & 0xff)); - update((unsigned char)((nrBits>>16) & 0xff)); - update((unsigned char)((nrBits>>24) & 0xff)); - update((unsigned char)((nrBits>>32) & 0xff)); - update((unsigned char)((nrBits>>40) & 0xff)); - update((unsigned char)((nrBits>>48) & 0xff)); - update((unsigned char)((nrBits>>56) & 0xff)); - - //copy out answer - std::vector res; - for (int i=0 ; i<4 ; i++) - { - //note the little-endianness - res.push_back((unsigned char)((hashBuf[i] ) & 0xff)); - res.push_back((unsigned char)((hashBuf[i] >> 8) & 0xff)); - res.push_back((unsigned char)((hashBuf[i] >> 16) & 0xff)); - res.push_back((unsigned char)((hashBuf[i] >> 24) & 0xff)); - } - - reset(); // Security! ;-) - - return res; -} - - - - - - -//######################################################################## -//## T E S T S -//######################################################################## - -/** - * Compile this file alone with -DDIGEST_TEST to run the - * tests below: - * > gcc -DDIGEST_TEST digest.cpp -o testdigest - * > testdigest - * - * If you add any new algorithms to this suite, then it is highly - * recommended that you add it to these tests and run it. - */ - -#ifdef DIGEST_TEST - - -typedef struct -{ - const char *msg; - const char *val; -} TestPair; - -static TestPair md5tests[] = -{ - { - "", - "d41d8cd98f00b204e9800998ecf8427e" - }, - { - "a", - "0cc175b9c0f1b6a831c399e269772661" - }, - { - "abc", - "900150983cd24fb0d6963f7d28e17f72" - }, - { - "message digest", - "f96b697d7cb7938d525a2f31aaf161d0" - }, - { - "abcdefghijklmnopqrstuvwxyz", - "c3fcd3d76192e4007dfb496cca67e13b" - }, - { - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", - "d174ab98d277d9f5a5611c2c9f419d9f" - }, - { - "12345678901234567890123456789012345678901234567890123456789012345678901234567890", - "57edf4a22be3c955ac49da2e2107b67a" - }, - { - NULL, - NULL - } -}; - - - -static TestPair sha1tests[] = -{ - { - "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", - "84983e441c3bd26ebaae4aa1f95129e5e54670f1" - }, - { - NULL, - NULL - } -}; - -static TestPair sha224tests[] = -{ - { - "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", - "75388b16512776cc5dba5da1fd890150b0c6455cb4f58b1952522525" - }, - { - NULL, - NULL - } -}; - -static TestPair sha256tests[] = -{ - { - "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", - "248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1" - }, - { - NULL, - NULL - } -}; - -static TestPair sha384tests[] = -{ - { - "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn" - "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu", - "09330c33f71147e83d192fc782cd1b4753111b173b3b05d22fa08086e3b0f712" - "fcc7c71a557e2db966c3e9fa91746039" - }, - { - NULL, - NULL - } -}; - -static TestPair sha512tests[] = -{ - { - "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn" - "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu", - "8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018" - "501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909" - }, - { - NULL, - NULL - } -}; - - -bool hashTests(Digest &digest, TestPair *tp) -{ - for (TestPair *pair = tp ; pair->msg ; pair++) - { - digest.reset(); - std::string msg = pair->msg; - std::string val = pair->val; - digest.append(msg); - std::string res = digest.finishHex(); - printf("### Msg '%s':\n hash '%s'\n exp '%s'\n", - msg.c_str(), res.c_str(), val.c_str()); - if (res != val) - { - printf("ERROR: Hash mismatch\n"); - return false; - } - } - return true; -} - - -bool millionATest(Digest &digest, const std::string &exp) -{ - digest.reset(); - for (int i=0 ; i<1000000 ; i++) - digest.append('a'); - std::string res = digest.finishHex(); - printf("\nHash of 1,000,000 'a'\n calc %s\n exp %s\n", - res.c_str(), exp.c_str()); - if (res != exp) - { - printf("ERROR: Mismatch.\n"); - return false; - } - return true; -} - -static bool doTests() -{ - printf("##########################################\n"); - printf("## MD5\n"); - printf("##########################################\n"); - Md5 md5; - if (!hashTests(md5, md5tests)) - return false; - if (!millionATest(md5, "7707d6ae4e027c70eea2a935c2296f21")) - return false; - printf("\n\n\n"); - printf("##########################################\n"); - printf("## SHA1\n"); - printf("##########################################\n"); - Sha1 sha1; - if (!hashTests(sha1, sha1tests)) - return false; - if (!millionATest(sha1, "34aa973cd4c4daa4f61eeb2bdbad27316534016f")) - return false; - printf("\n\n\n"); - printf("##########################################\n"); - printf("## SHA224\n"); - printf("##########################################\n"); - Sha224 sha224; - if (!hashTests(sha224, sha224tests)) - return false; - if (!millionATest(sha224, - "20794655980c91d8bbb4c1ea97618a4bf03f42581948b2ee4ee7ad67")) - return false; - printf("\n\n\n"); - printf("##########################################\n"); - printf("## SHA256\n"); - printf("##########################################\n"); - Sha256 sha256; - if (!hashTests(sha256, sha256tests)) - return false; - if (!millionATest(sha256, - "cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0")) - return false; - printf("\n\n\n"); - printf("##########################################\n"); - printf("## SHA384\n"); - printf("##########################################\n"); - Sha384 sha384; - if (!hashTests(sha384, sha384tests)) - return false; - /**/ - if (!millionATest(sha384, - "9d0e1809716474cb086e834e310a4a1ced149e9c00f248527972cec5704c2a5b" - "07b8b3dc38ecc4ebae97ddd87f3d8985")) - return false; - /**/ - printf("\n\n\n"); - printf("##########################################\n"); - printf("## SHA512\n"); - printf("##########################################\n"); - Sha512 sha512; - if (!hashTests(sha512, sha512tests)) - return false; - if (!millionATest(sha512, - "e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973eb" - "de0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b")) - return false; - return true; -} - - -int main(int argc, char **argv) -{ - doTests(); - printf("####### done ########\n"); - return 0; -} - - -#endif /* DIGEST_TEST */ - -//######################################################################## -//## E N D O F F I L E -//######################################################################## diff --git a/src/dom/util/digest.h b/src/dom/util/digest.h deleted file mode 100644 index c161b86bb..000000000 --- a/src/dom/util/digest.h +++ /dev/null @@ -1,654 +0,0 @@ -#ifndef SEEN_DIGEST_H -#define SEEN_DIGEST_H -/* - * - * Author: - * Bob Jamison - * - * Copyright (C) 2006-2008 Bob Jamison - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/** - * @file - * This base class and its subclasses provide an easy API for providing - * several different types of secure hashing functions for whatever use - * a developer might need. This is not intended as a high-performance - * replacement for the fine implementations already available. Rather, it - * is a small and simple (and maybe a bit slow?) tool for moderate common - * hashing requirements, like for communications and authentication. - * - * These hashes are intended to be simple to use. For example: - * Sha256 digest; - * digest.append("The quick brown dog"); - * std::string result = digest.finishHex(); - * - * Or, use one of the static convenience methods: - * - * example: std::string digest = - * Digest::hashHex(Digest::HASH_XXX, str); - * - * ...where HASH_XXX represents one of the hash - * algorithms listed in HashType. - * - * There are several forms of append() for convenience. - * finish() and finishHex() call reset() for both security and - * to prepare for the next use. - * - * - * Much effort has been applied to make this code portable, and it - * has been tested on various 32- and 64-bit machines. If you - * add another algorithm, please test it likewise. - * - * - * The SHA algorithms are derived directly from FIPS-180-3. The - * SHA tests at the bottom of digest.cpp are also directly from - * that document. - * http://csrc.nist.gov/publications/drafts/fips_180-3/draft_fips-180-3_June-08-2007.pdf - * - * The MD5 algorithm is from RFC 1321 - * - * To run the tests, compile standalone with -DDIGEST_TEST. Example: - * - * g++ -DDIGEST_TEST digest.cpp -o testdigest - * or - * g++ -DDIGEST_TEST -m64 digest.cpp -o testdigest - * - */ - -#include -#include - -#include - - - -/** - * Base class. Do not use instantiate class directly. Rather, use of of the - * subclasses below, or call one of this class's static convenience methods. - * - * For all subclasses, overload reset(), update(unsigned char), - * transform(), and finish() - */ -class Digest -{ -public: - - /** - * Different types of hash algorithms. - */ - typedef enum - { - HASH_NONE, - HASH_SHA1, - HASH_SHA224, - HASH_SHA256, - HASH_SHA384, - HASH_SHA512, - HASH_MD5 - } HashType; - - /** - * Constructor, with no type - */ - Digest() : hashType(HASH_NONE) - { reset(); } - - /** - * Destructor - */ - virtual ~Digest() - { reset(); } - - /** - * Return one of the enumerated hash types above - */ - virtual int getType() - { return hashType; } - - /** - * Append a single byte to the hash - */ - void append(unsigned char ch) - { update(ch); } - - /** - * Append a string to the hash - */ - virtual void append(const std::string &str) - { - for (unsigned int i=0 ; i &buf) - { //NOTE: function seems to be unused - for (unsigned int i=0 ; i finish() - { - std::vector ret; - return ret; - } - - - //######################## - //# Convenience methods - //######################## - - /** - * Convenience method. This is a simple way of getting a hash. - * Returns a byte buffer with the digest output. - * call with: std::vector digest = - * Digest::hash(Digest::HASH_XXX, buf, len); - */ - static std::vector hash(HashType typ, - unsigned char *buf, - int len); - /** - * Convenience method. This is a simple way of getting a hash. - * Returns a byte buffer with the digest output. - * call with: std::vector digest = - * Digest::hash(Digest::HASH_XXX, str); - */ - static std::vector hash(HashType typ, - const std::string &str); - - /** - * Convenience method. This is a simple way of getting a hash. - * Returns a string with the hexidecimal form of the digest output. - * call with: std::string digest = - * Digest::hash(Digest::HASH_XXX, buf, len); - */ - static std::string hashHex(HashType typ, - unsigned char *buf, - int len); - /** - * Convenience method. This is a simple way of getting a hash. - * Returns a string with the hexidecimal form of the digest output. - * call with: std::string digest = - * Digest::hash(Digest::HASH_XXX, str); - */ - static std::string hashHex(HashType typ, - const std::string &str); - -protected: - - /** - * Update the hash with a given byte - * Overload this in every subclass - */ - virtual void update(unsigned char /*ch*/) - {} - - /** - * Perform the particular block hashing algorithm for a - * particular type of hash. - * Overload this in every subclass - */ - virtual void transform() - {} - - - /** - * The enumerated type of the hash - */ - int hashType; - - /** - * Increment the count of bytes processed so far. Should be called - * in update() - */ - void incByteCount() - { - nrBytes++; - } - - /** - * Clear the byte / bit count information. Both for processing - * another message, also for security. Should be called in reset() - */ - void clearByteCount() - { - nrBytes = nrBits = 0; - } - - /** - * Calculates the bit count from the current byte count. Should be called - * in finish(), before any padding is added. This basically does a - * snapshot of the bitcount value before the padding. - */ - void getBitCount() - { - nrBits = (nrBytes << 3) & 0xFFFFFFFFFFFFFFFFLL; - } - - /** - * Common code for appending the 64-bit bitcount to the end of the - * message, after the padding. Should be called after padding, just - * before outputting the result. - */ - void appendBitCount() - { - update((unsigned char)((nrBits>>56) & 0xff)); - update((unsigned char)((nrBits>>48) & 0xff)); - update((unsigned char)((nrBits>>40) & 0xff)); - update((unsigned char)((nrBits>>32) & 0xff)); - update((unsigned char)((nrBits>>24) & 0xff)); - update((unsigned char)((nrBits>>16) & 0xff)); - update((unsigned char)((nrBits>> 8) & 0xff)); - update((unsigned char)((nrBits ) & 0xff)); - } - - /** - * Bit and byte counts - */ - uint64_t nrBytes; - uint64_t nrBits; -}; - - - - - -/** - * SHA-1, - * Section 6.1, SECURE HASH STANDARD - * Federal Information Processing Standards Publication 180-2 - * http://csrc.nist.gov/publications/drafts/fips_180-3/draft_fips-180-3_June-08-2007.pdf - */ -class Sha1 : public Digest -{ -public: - - /** - * Constructor - */ - Sha1() - { hashType = HASH_SHA1; reset(); } - - /** - * Destructor - */ - virtual ~Sha1() - { reset(); } - - /** - * Overloaded from Digest - */ - virtual void reset(); - - /** - * Overloaded from Digest - */ - virtual std::vector finish(); - -protected: - - /** - * Overloaded from Digest - */ - virtual void update(unsigned char val); - - /** - * Overloaded from Digest - */ - virtual void transform(); - -private: - - uint32_t hashBuf[5]; - uint32_t inBuf[80]; - - int longNr; - int byteNr; - uint32_t inb[4]; - -}; - - - - - - -/** - * SHA-224, - * Section 6.1, SECURE HASH STANDARD - * Federal Information Processing Standards Publication 180-2 - * http://csrc.nist.gov/publications/drafts/fips_180-3/draft_fips-180-3_June-08-2007.pdf - */ -class Sha224 : public Digest -{ -public: - - /** - * Constructor - */ - Sha224() - { hashType = HASH_SHA224; reset(); } - - /** - * Destructor - */ - virtual ~Sha224() - { reset(); } - - /** - * Overloaded from Digest - */ - virtual void reset(); - - /** - * Overloaded from Digest - */ - virtual std::vector finish(); - -protected: - - /** - * Overloaded from Digest - */ - virtual void update(unsigned char val); - - /** - * Overloaded from Digest - */ - virtual void transform(); - -private: - - uint32_t hashBuf[8]; - uint32_t inBuf[64]; - int longNr; - int byteNr; - uint32_t inb[4]; - -}; - - - -/** - * SHA-256, - * Section 6.1, SECURE HASH STANDARD - * Federal Information Processing Standards Publication 180-2 - * http://csrc.nist.gov/publications/drafts/fips_180-3/draft_fips-180-3_June-08-2007.pdf - */ -class Sha256 : public Digest -{ -public: - - /** - * Constructor - */ - Sha256() - { hashType = HASH_SHA256; reset(); } - - /** - * Destructor - */ - virtual ~Sha256() - { reset(); } - - /** - * Overloaded from Digest - */ - virtual void reset(); - - /** - * Overloaded from Digest - */ - virtual std::vector finish(); - -protected: - - /** - * Overloaded from Digest - */ - virtual void update(unsigned char val); - - /** - * Overloaded from Digest - */ - virtual void transform(); - -private: - - uint32_t hashBuf[8]; - uint32_t inBuf[64]; - int longNr; - int byteNr; - uint32_t inb[4]; - -}; - - - -/** - * SHA-384, - * Section 6.1, SECURE HASH STANDARD - * Federal Information Processing Standards Publication 180-2 - * http://csrc.nist.gov/publications/drafts/fips_180-3/draft_fips-180-3_June-08-2007.pdf - */ -class Sha384 : public Digest -{ -public: - - /** - * Constructor - */ - Sha384() - { hashType = HASH_SHA384; reset(); } - - /** - * Destructor - */ - virtual ~Sha384() - { reset(); } - - /** - * Overloaded from Digest - */ - virtual void reset(); - - /** - * Overloaded from Digest - */ - virtual std::vector finish(); - -protected: - - /** - * Overloaded from Digest - */ - virtual void update(unsigned char val); - - /** - * Overloaded from Digest - */ - virtual void transform(); - - - -private: - - uint64_t hashBuf[8]; - uint64_t inBuf[80]; - int longNr; - int byteNr; - uint64_t inb[8]; - -}; - - - - -/** - * SHA-512, - * Section 6.1, SECURE HASH STANDARD - * Federal Information Processing Standards Publication 180-2 - * http://csrc.nist.gov/publications/drafts/fips_180-3/draft_fips-180-3_June-08-2007.pdf - */ -class Sha512 : public Digest -{ -public: - - /** - * Constructor - */ - Sha512() - { hashType = HASH_SHA512; reset(); } - - /** - * Destructor - */ - virtual ~Sha512() - { reset(); } - - /** - * Overloaded from Digest - */ - virtual void reset(); - - /** - * Overloaded from Digest - */ - virtual std::vector finish(); - -protected: - - /** - * Overloaded from Digest - */ - virtual void update(unsigned char val); - - /** - * Overloaded from Digest - */ - virtual void transform(); - -private: - - uint64_t hashBuf[8]; - uint64_t inBuf[80]; - int longNr; - int byteNr; - uint64_t inb[8]; - -}; - - - - - - - - - -/** - * IETF RFC 1321, MD5 Specification - * http://www.ietf.org/rfc/rfc1321.txt - */ -class Md5 : public Digest -{ -public: - - /** - * Constructor - */ - Md5() - { hashType = HASH_MD5; reset(); } - - /** - * Destructor - */ - virtual ~Md5() - { reset(); } - - /** - * Overloaded from Digest - */ - virtual void reset(); - - /** - * Overloaded from Digest - */ - virtual std::vector finish(); - -protected: - - /** - * Overloaded from Digest - */ - virtual void update(unsigned char val); - - /** - * Overloaded from Digest - */ - virtual void transform(); - -private: - - uint32_t hashBuf[4]; - uint32_t inBuf[16]; - - uint32_t inb[4]; // Buffer for input bytes as longs - int byteNr; // which byte in long - int longNr; // which long in 16-long buffer - -}; - - - - - - - - - -#endif /* __DIGEST_H__ */ - - -- cgit v1.2.3 From faa38f1f6a18d5f44ebef82c7834d6b26aac34db Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Tue, 23 Jul 2013 13:44:43 +0200 Subject: Fix spelling error in filename (bzr r12430) --- src/widgets/CMakeLists.txt | 4 +- src/widgets/Makefile_insert | 4 +- src/widgets/eraser-toolbar.cpp | 172 +++++++++++++++++++++++++++++++++++++++++ src/widgets/eraser-toolbar.h | 35 +++++++++ src/widgets/erasor-toolbar.cpp | 172 ----------------------------------------- src/widgets/erasor-toolbar.h | 35 --------- src/widgets/toolbox.cpp | 2 +- 7 files changed, 212 insertions(+), 212 deletions(-) create mode 100644 src/widgets/eraser-toolbar.cpp create mode 100644 src/widgets/eraser-toolbar.h delete mode 100644 src/widgets/erasor-toolbar.cpp delete mode 100644 src/widgets/erasor-toolbar.h (limited to 'src') diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt index 19410ee1d..fe4433153 100644 --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -6,7 +6,7 @@ set(widgets_SRC calligraphy-toolbar.cpp connector-toolbar.cpp dropper-toolbar.cpp - erasor-toolbar.cpp + eraser-toolbar.cpp lpe-toolbar.cpp measure-toolbar.cpp mesh-toolbar.cpp @@ -62,7 +62,7 @@ set(widgets_SRC calligraphy-toolbar.h connector-toolbar.h dropper-toolbar.h - erasor-toolbar.h + eraser-toolbar.h lpe-toolbar.h measure-toolbar.h mesh-toolbar.h diff --git a/src/widgets/Makefile_insert b/src/widgets/Makefile_insert index 46f0bd645..97713cbee 100644 --- a/src/widgets/Makefile_insert +++ b/src/widgets/Makefile_insert @@ -21,8 +21,8 @@ ink_common_sources += \ widgets/eek-preview.h \ widgets/ege-paint-def.cpp \ widgets/ege-paint-def.h \ - widgets/erasor-toolbar.cpp \ - widgets/erasor-toolbar.h \ + widgets/eraser-toolbar.cpp \ + widgets/eraser-toolbar.h \ widgets/fill-style.cpp \ widgets/fill-style.h \ widgets/fill-n-stroke-factory.h \ diff --git a/src/widgets/eraser-toolbar.cpp b/src/widgets/eraser-toolbar.cpp new file mode 100644 index 000000000..aca960c00 --- /dev/null +++ b/src/widgets/eraser-toolbar.cpp @@ -0,0 +1,172 @@ +/** + * @file + * Erasor aux toolbar + */ +/* Authors: + * MenTaLguY + * Lauris Kaplinski + * bulia byak + * Frank Felfe + * John Cliff + * David Turner + * Josh Andler + * Jon A. Cruz + * Maximilian Albert + * Tavmjong Bah + * Abhishek Sharma + * Kris De Gussem + * + * Copyright (C) 2004 David Turner + * Copyright (C) 2003 MenTaLguY + * Copyright (C) 1999-2011 authors + * Copyright (C) 2001-2002 Ximian, Inc. + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "ui/widget/spinbutton.h" +#include +#include "toolbox.h" +#include "eraser-toolbar.h" +#include "calligraphy-toolbar.h" + +#include "../desktop.h" +#include "../desktop-handles.h" +#include "document-undo.h" +#include "../verbs.h" +#include "../inkscape.h" +#include "../selection-chemistry.h" +#include "../selection.h" +#include "../ege-adjustment-action.h" +#include "../ege-output-action.h" +#include "../ege-select-one-action.h" +#include "../ink-action.h" +#include "../ink-comboboxentry-action.h" + +#include "../widgets/button.h" +#include "../widgets/spinbutton-events.h" +#include "../widgets/spw-utilities.h" +#include "../widgets/widget-sizes.h" +#include "../xml/node-event-vector.h" +#include "../xml/repr.h" +#include "ui/uxmanager.h" +#include "../ui/icon-names.h" +#include "../helper/unit-menu.h" +#include "../helper/units.h" +#include "../helper/unit-tracker.h" +#include "../pen-context.h" + + +using Inkscape::UnitTracker; +using Inkscape::UI::UXManager; +using Inkscape::DocumentUndo; +using Inkscape::UI::ToolboxFactory; +using Inkscape::UI::PrefPusher; + +//######################## +//## Eraser ## +//######################## + +static void sp_erc_width_value_changed( GtkAdjustment *adj, GObject *tbl ) +{ + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + prefs->setDouble( "/tools/eraser/width", gtk_adjustment_get_value(adj) ); + update_presets_list(tbl); +} + +static void sp_erasertb_mode_changed( EgeSelectOneAction *act, GObject *tbl ) +{ + SPDesktop *desktop = static_cast(g_object_get_data( tbl, "desktop" )); + bool eraserMode = ege_select_one_action_get_active( act ) != 0; + if (DocumentUndo::getUndoSensitive(sp_desktop_document(desktop))) { + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + prefs->setBool( "/tools/eraser/mode", eraserMode ); + } + + // only take action if run by the attr_changed listener + if (!g_object_get_data( tbl, "freeze" )) { + // in turn, prevent listener from responding + g_object_set_data( tbl, "freeze", GINT_TO_POINTER(TRUE) ); + + /* + if ( eraserMode != 0 ) { + } else { + } + */ + // TODO finish implementation + + g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) ); + } +} + +void sp_eraser_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder) +{ + { + GtkListStore* model = gtk_list_store_new( 3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING ); + + GtkTreeIter iter; + gtk_list_store_append( model, &iter ); + gtk_list_store_set( model, &iter, + 0, _("Delete"), + 1, _("Delete objects touched by the eraser"), + 2, INKSCAPE_ICON("draw-eraser-delete-objects"), + -1 ); + + gtk_list_store_append( model, &iter ); + gtk_list_store_set( model, &iter, + 0, _("Cut"), + 1, _("Cut out from objects"), + 2, INKSCAPE_ICON("path-difference"), + -1 ); + + EgeSelectOneAction* act = ege_select_one_action_new( "EraserModeAction", (""), (""), NULL, GTK_TREE_MODEL(model) ); + g_object_set( act, "short_label", _("Mode:"), NULL ); + gtk_action_group_add_action( mainActions, GTK_ACTION(act) ); + g_object_set_data( holder, "eraser_mode_action", act ); + + ege_select_one_action_set_appearance( act, "full" ); + ege_select_one_action_set_radio_action_type( act, INK_RADIO_ACTION_TYPE ); + g_object_set( G_OBJECT(act), "icon-property", "iconId", NULL ); + ege_select_one_action_set_icon_column( act, 2 ); + ege_select_one_action_set_tooltip_column( act, 1 ); + + /// @todo Convert to boolean? + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + gint eraserMode = prefs->getBool("/tools/eraser/mode") ? 1 : 0; + ege_select_one_action_set_active( act, eraserMode ); + g_signal_connect_after( G_OBJECT(act), "changed", G_CALLBACK(sp_erasertb_mode_changed), holder ); + } + + { + /* Width */ + gchar const* labels[] = {_("(hairline)"), 0, 0, 0, _("(default)"), 0, 0, 0, 0, _("(broad stroke)")}; + gdouble values[] = {1, 3, 5, 10, 15, 20, 30, 50, 75, 100}; + EgeAdjustmentAction *eact = create_adjustment_action( "EraserWidthAction", + _("Pen Width"), _("Width:"), + _("The width of the eraser pen (relative to the visible canvas area)"), + "/tools/eraser/width", 15, + GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "altx-eraser", + 1, 100, 1.0, 10.0, + labels, values, G_N_ELEMENTS(labels), + sp_erc_width_value_changed, 1, 0); + ege_adjustment_action_set_appearance( eact, TOOLBAR_SLIDER_HINT ); + gtk_action_group_add_action( mainActions, GTK_ACTION(eact) ); + gtk_action_set_sensitive( GTK_ACTION(eact), TRUE ); + } + +} + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/widgets/eraser-toolbar.h b/src/widgets/eraser-toolbar.h new file mode 100644 index 000000000..b1bb3a3fa --- /dev/null +++ b/src/widgets/eraser-toolbar.h @@ -0,0 +1,35 @@ +#ifndef SEEN_ERASOR_TOOLBAR_H +#define SEEN_ERASOR_TOOLBAR_H + +/** + * @file + * Erasor aux toolbar + */ +/* Authors: + * MenTaLguY + * Lauris Kaplinski + * bulia byak + * Frank Felfe + * John Cliff + * David Turner + * Josh Andler + * Jon A. Cruz + * Maximilian Albert + * Tavmjong Bah + * Abhishek Sharma + * Kris De Gussem + * + * Copyright (C) 2004 David Turner + * Copyright (C) 2003 MenTaLguY + * Copyright (C) 1999-2011 authors + * Copyright (C) 2001-2002 Ximian, Inc. + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#include +class SPDesktop; + +void sp_eraser_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder); + +#endif /* !SEEN_ERASOR_TOOLBAR_H */ diff --git a/src/widgets/erasor-toolbar.cpp b/src/widgets/erasor-toolbar.cpp deleted file mode 100644 index 2e074490d..000000000 --- a/src/widgets/erasor-toolbar.cpp +++ /dev/null @@ -1,172 +0,0 @@ -/** - * @file - * Erasor aux toolbar - */ -/* Authors: - * MenTaLguY - * Lauris Kaplinski - * bulia byak - * Frank Felfe - * John Cliff - * David Turner - * Josh Andler - * Jon A. Cruz - * Maximilian Albert - * Tavmjong Bah - * Abhishek Sharma - * Kris De Gussem - * - * Copyright (C) 2004 David Turner - * Copyright (C) 2003 MenTaLguY - * Copyright (C) 1999-2011 authors - * Copyright (C) 2001-2002 Ximian, Inc. - * - * Released under GNU GPL, read the file 'COPYING' for more information - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "ui/widget/spinbutton.h" -#include -#include "toolbox.h" -#include "erasor-toolbar.h" -#include "calligraphy-toolbar.h" - -#include "../desktop.h" -#include "../desktop-handles.h" -#include "document-undo.h" -#include "../verbs.h" -#include "../inkscape.h" -#include "../selection-chemistry.h" -#include "../selection.h" -#include "../ege-adjustment-action.h" -#include "../ege-output-action.h" -#include "../ege-select-one-action.h" -#include "../ink-action.h" -#include "../ink-comboboxentry-action.h" - -#include "../widgets/button.h" -#include "../widgets/spinbutton-events.h" -#include "../widgets/spw-utilities.h" -#include "../widgets/widget-sizes.h" -#include "../xml/node-event-vector.h" -#include "../xml/repr.h" -#include "ui/uxmanager.h" -#include "../ui/icon-names.h" -#include "../helper/unit-menu.h" -#include "../helper/units.h" -#include "../helper/unit-tracker.h" -#include "../pen-context.h" - - -using Inkscape::UnitTracker; -using Inkscape::UI::UXManager; -using Inkscape::DocumentUndo; -using Inkscape::UI::ToolboxFactory; -using Inkscape::UI::PrefPusher; - -//######################## -//## Eraser ## -//######################## - -static void sp_erc_width_value_changed( GtkAdjustment *adj, GObject *tbl ) -{ - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - prefs->setDouble( "/tools/eraser/width", gtk_adjustment_get_value(adj) ); - update_presets_list(tbl); -} - -static void sp_erasertb_mode_changed( EgeSelectOneAction *act, GObject *tbl ) -{ - SPDesktop *desktop = static_cast(g_object_get_data( tbl, "desktop" )); - bool eraserMode = ege_select_one_action_get_active( act ) != 0; - if (DocumentUndo::getUndoSensitive(sp_desktop_document(desktop))) { - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - prefs->setBool( "/tools/eraser/mode", eraserMode ); - } - - // only take action if run by the attr_changed listener - if (!g_object_get_data( tbl, "freeze" )) { - // in turn, prevent listener from responding - g_object_set_data( tbl, "freeze", GINT_TO_POINTER(TRUE) ); - - /* - if ( eraserMode != 0 ) { - } else { - } - */ - // TODO finish implementation - - g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) ); - } -} - -void sp_eraser_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder) -{ - { - GtkListStore* model = gtk_list_store_new( 3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING ); - - GtkTreeIter iter; - gtk_list_store_append( model, &iter ); - gtk_list_store_set( model, &iter, - 0, _("Delete"), - 1, _("Delete objects touched by the eraser"), - 2, INKSCAPE_ICON("draw-eraser-delete-objects"), - -1 ); - - gtk_list_store_append( model, &iter ); - gtk_list_store_set( model, &iter, - 0, _("Cut"), - 1, _("Cut out from objects"), - 2, INKSCAPE_ICON("path-difference"), - -1 ); - - EgeSelectOneAction* act = ege_select_one_action_new( "EraserModeAction", (""), (""), NULL, GTK_TREE_MODEL(model) ); - g_object_set( act, "short_label", _("Mode:"), NULL ); - gtk_action_group_add_action( mainActions, GTK_ACTION(act) ); - g_object_set_data( holder, "eraser_mode_action", act ); - - ege_select_one_action_set_appearance( act, "full" ); - ege_select_one_action_set_radio_action_type( act, INK_RADIO_ACTION_TYPE ); - g_object_set( G_OBJECT(act), "icon-property", "iconId", NULL ); - ege_select_one_action_set_icon_column( act, 2 ); - ege_select_one_action_set_tooltip_column( act, 1 ); - - /// @todo Convert to boolean? - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - gint eraserMode = prefs->getBool("/tools/eraser/mode") ? 1 : 0; - ege_select_one_action_set_active( act, eraserMode ); - g_signal_connect_after( G_OBJECT(act), "changed", G_CALLBACK(sp_erasertb_mode_changed), holder ); - } - - { - /* Width */ - gchar const* labels[] = {_("(hairline)"), 0, 0, 0, _("(default)"), 0, 0, 0, 0, _("(broad stroke)")}; - gdouble values[] = {1, 3, 5, 10, 15, 20, 30, 50, 75, 100}; - EgeAdjustmentAction *eact = create_adjustment_action( "EraserWidthAction", - _("Pen Width"), _("Width:"), - _("The width of the eraser pen (relative to the visible canvas area)"), - "/tools/eraser/width", 15, - GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "altx-eraser", - 1, 100, 1.0, 10.0, - labels, values, G_N_ELEMENTS(labels), - sp_erc_width_value_changed, 1, 0); - ege_adjustment_action_set_appearance( eact, TOOLBAR_SLIDER_HINT ); - gtk_action_group_add_action( mainActions, GTK_ACTION(eact) ); - gtk_action_set_sensitive( GTK_ACTION(eact), TRUE ); - } - -} - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/widgets/erasor-toolbar.h b/src/widgets/erasor-toolbar.h deleted file mode 100644 index b1bb3a3fa..000000000 --- a/src/widgets/erasor-toolbar.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef SEEN_ERASOR_TOOLBAR_H -#define SEEN_ERASOR_TOOLBAR_H - -/** - * @file - * Erasor aux toolbar - */ -/* Authors: - * MenTaLguY - * Lauris Kaplinski - * bulia byak - * Frank Felfe - * John Cliff - * David Turner - * Josh Andler - * Jon A. Cruz - * Maximilian Albert - * Tavmjong Bah - * Abhishek Sharma - * Kris De Gussem - * - * Copyright (C) 2004 David Turner - * Copyright (C) 2003 MenTaLguY - * Copyright (C) 1999-2011 authors - * Copyright (C) 2001-2002 Ximian, Inc. - * - * Released under GNU GPL, read the file 'COPYING' for more information - */ - -#include -class SPDesktop; - -void sp_eraser_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder); - -#endif /* !SEEN_ERASOR_TOOLBAR_H */ diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index ca593976f..98a0ff51e 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -79,7 +79,7 @@ #include "calligraphy-toolbar.h" #include "connector-toolbar.h" #include "dropper-toolbar.h" -#include "erasor-toolbar.h" +#include "eraser-toolbar.h" #include "gradient-toolbar.h" #include "lpe-toolbar.h" #include "mesh-toolbar.h" -- cgit v1.2.3 From 379521136cda27b5e42c7afdd87a8ac691404f16 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Tue, 23 Jul 2013 18:54:03 +0200 Subject: Remove approx-equal.h and replace with Geom::are_near (bzr r12431) --- src/CMakeLists.txt | 1 - src/Makefile_insert | 2 +- src/doxygen-main.cpp | 2 +- src/satisfied-guide-cns.cpp | 4 ++-- src/sp-item-rm-unsatisfied-cns.cpp | 5 +++-- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 87f223150..02a206787 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -312,7 +312,6 @@ set(inkscape_SRC MultiPrinter.h PylogFormatter.h TRPIFormatter.h - approx-equal.h arc-context.h attributes-test.h attributes.h diff --git a/src/Makefile_insert b/src/Makefile_insert index 88f809b52..3e61f625a 100644 --- a/src/Makefile_insert +++ b/src/Makefile_insert @@ -3,7 +3,7 @@ ink_common_sources += \ util/find-last-if.h \ util/longest-common-suffix.h \ - approx-equal.h remove-last.h \ + remove-last.h \ arc-context.cpp arc-context.h \ attributes.cpp attributes.h \ attribute-rel-svg.cpp attribute-rel-svg.h \ diff --git a/src/doxygen-main.cpp b/src/doxygen-main.cpp index 04e5ab33e..1c3e5dcbb 100644 --- a/src/doxygen-main.cpp +++ b/src/doxygen-main.cpp @@ -350,7 +350,7 @@ namespace XML {} * Inkscape::Whiteboard::UndoStackObserver [\ref undo-stack-observer.cpp, \ref composite-undo-stack-observer.cpp] * [\ref document-undo.cpp] * - * {\ref dialogs/} [\ref approx-equal.h] [\ref decimal-round.h] [\ref enums.h] [\ref unit-constants.h] + * {\ref dialogs/} [\ref decimal-round.h] [\ref enums.h] [\ref unit-constants.h] */ diff --git a/src/satisfied-guide-cns.cpp b/src/satisfied-guide-cns.cpp index 57d4ffce3..588c78ce0 100644 --- a/src/satisfied-guide-cns.cpp +++ b/src/satisfied-guide-cns.cpp @@ -1,8 +1,8 @@ +#include <2geom/coord.h> #include "desktop-handles.h" #include "sp-guide.h" #include "sp-guide-constraint.h" #include "sp-namedview.h" -#include "approx-equal.h" #include "satisfied-guide-cns.h" void satisfied_guide_cns(SPDesktop const &desktop, @@ -13,7 +13,7 @@ void satisfied_guide_cns(SPDesktop const &desktop, for (GSList const *l = nv.guides; l != NULL; l = l->next) { SPGuide &g = *SP_GUIDE(l->data); for (unsigned int i = 0; i < snappoints.size(); ++i) { - if (approx_equal( g.getDistanceFrom(snappoints[i].getPoint()), 0) ) { + if (Geom::are_near(g.getDistanceFrom(snappoints[i].getPoint()), 0, 1e-2)) { cns.push_back(SPGuideConstraint(&g, i)); } } diff --git a/src/sp-item-rm-unsatisfied-cns.cpp b/src/sp-item-rm-unsatisfied-cns.cpp index c35e4fa48..8fb171c08 100644 --- a/src/sp-item-rm-unsatisfied-cns.cpp +++ b/src/sp-item-rm-unsatisfied-cns.cpp @@ -1,7 +1,7 @@ #include +#include <2geom/coord.h> -#include "approx-equal.h" #include "remove-last.h" #include "sp-guide.h" #include "sp-guide-constraint.h" @@ -22,7 +22,8 @@ void sp_item_rm_unsatisfied_cns(SPItem &item) SPGuideConstraint const &cn = item.constraints[i]; int const snappoint_ix = cn.snappoint_ix; g_assert( snappoint_ix < int(snappoints.size()) ); - if (!approx_equal( cn.g->getDistanceFrom(snappoints[snappoint_ix].getPoint()), 0) ) { + + if (!Geom::are_near(cn.g->getDistanceFrom(snappoints[snappoint_ix].getPoint()), 0, 1e-2)) { remove_last(cn.g->attached_items, SPGuideAttachment(&item, cn.snappoint_ix)); g_assert( i < item.constraints.size() ); vector::iterator const ei(&item.constraints[i]); -- cgit v1.2.3 From 971dcf0f1cc99b33e09920370214f8d50324d975 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Tue, 23 Jul 2013 19:01:25 +0200 Subject: Remove unused fix for an ancient problem with g_ascii_strtod (bzr r12432) --- src/CMakeLists.txt | 1 - src/Makefile_insert | 1 - 2 files changed, 2 deletions(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 02a206787..1d27eaef1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -216,7 +216,6 @@ set(inkscape_SRC file.cpp filter-chemistry.cpp filter-enums.cpp - fixes.cpp flood-context.cpp gc-anchored.cpp gc-finalized.cpp diff --git a/src/Makefile_insert b/src/Makefile_insert index 3e61f625a..885b89d78 100644 --- a/src/Makefile_insert +++ b/src/Makefile_insert @@ -59,7 +59,6 @@ ink_common_sources += \ fill-or-stroke.h \ filter-chemistry.cpp filter-chemistry.h \ filter-enums.cpp filter-enums.h \ - fixes.cpp \ flood-context.cpp flood-context.h \ gc-alloc.h \ gc-anchored.h gc-anchored.cpp \ -- cgit v1.2.3 From 747e668b5497b7ae74f38491446d0187ccd0bb72 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Tue, 23 Jul 2013 19:02:50 +0200 Subject: Actually remove the file containing the unused fix (oops) (bzr r12433) --- src/fixes.cpp | 194 ---------------------------------------------------------- 1 file changed, 194 deletions(-) delete mode 100644 src/fixes.cpp (limited to 'src') diff --git a/src/fixes.cpp b/src/fixes.cpp deleted file mode 100644 index 4aed2c313..000000000 --- a/src/fixes.cpp +++ /dev/null @@ -1,194 +0,0 @@ -/* - * - * This is the header file to include to fix any broken definitions or funcs - * - * $Id$ - * - * 2004 Kees Cook - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -//#if defined(g_ascii_strtod) -#if 0 -/* - * until 2004-04-22, g_ascii_strtod could not handle having a locale-based - * decimal separator immediately following the number ("5,4" would - * parse to "5,4" instead of "5.0" in fr_FR) - * - * This is the corrected function, lifted from 1.107 gstrfuncs.c in glib - */ -extern "C" { -#include -#include -#include -#include -#include - -gdouble -fixed_g_ascii_strtod (const gchar *nptr, - gchar **endptr) -{ - gchar *fail_pos; - gdouble val; - struct lconv *locale_data; - const char *decimal_point; - int decimal_point_len; - const char *p, *decimal_point_pos; - const char *end = NULL; /* Silence gcc */ - - g_return_val_if_fail (nptr != NULL, 0); - - fail_pos = NULL; - - locale_data = localeconv (); - decimal_point = locale_data->decimal_point; - decimal_point_len = strlen (decimal_point); - - g_assert (decimal_point_len != 0); - - decimal_point_pos = NULL; - if (decimal_point[0] != '.' || - decimal_point[1] != 0) - { - p = nptr; - /* Skip leading space */ - while (g_ascii_isspace (*p)) - p++; - - /* Skip leading optional sign */ - if (*p == '+' || *p == '-') - p++; - - if (p[0] == '0' && - (p[1] == 'x' || p[1] == 'X')) - { - p += 2; - /* HEX - find the (optional) decimal point */ - - while (g_ascii_isxdigit (*p)) - p++; - - if (*p == '.') - { - decimal_point_pos = p++; - - while (g_ascii_isxdigit (*p)) - p++; - - if (*p == 'p' || *p == 'P') - p++; - if (*p == '+' || *p == '-') - p++; - while (g_ascii_isdigit (*p)) - p++; - } - } - else - { - while (g_ascii_isdigit (*p)) - p++; - - if (*p == '.') - { - decimal_point_pos = p++; - - while (g_ascii_isdigit (*p)) - p++; - - if (*p == 'e' || *p == 'E') - p++; - if (*p == '+' || *p == '-') - p++; - while (g_ascii_isdigit (*p)) - p++; - } - } - /* For the other cases, we need not convert the decimal point */ - end = p; - } - - /* Set errno to zero, so that we can distinguish zero results - and underflows */ - errno = 0; - - if (decimal_point_pos) - { - char *copy, *c; - - /* We need to convert the '.' to the locale specific decimal point */ - copy = (char*)g_malloc (end - nptr + 1 + decimal_point_len); - - c = copy; - memcpy (c, nptr, decimal_point_pos - nptr); - c += decimal_point_pos - nptr; - memcpy (c, decimal_point, decimal_point_len); - c += decimal_point_len; - memcpy (c, decimal_point_pos + 1, end - (decimal_point_pos + 1)); - c += end - (decimal_point_pos + 1); - *c = 0; - - val = strtod (copy, &fail_pos); - - if (fail_pos) - { - if (fail_pos - copy > decimal_point_pos - nptr) - fail_pos = (char *)nptr + (fail_pos - copy) - (decimal_point_len - 1); - else - fail_pos = (char *)nptr + (fail_pos - copy); - } - - g_free (copy); - - } - else if (decimal_point[0] != '.' || - decimal_point[1] != 0) - { - char *copy; - - copy = (char*)g_malloc (end - (char *)nptr + 1); - memcpy (copy, nptr, end - nptr); - *(copy + (end - (char *)nptr)) = 0; - - val = strtod (copy, &fail_pos); - - if (fail_pos) - { - fail_pos = (char *)nptr + (fail_pos - copy); - } - - g_free (copy); - } - else - { - val = strtod (nptr, &fail_pos); - } - - if (endptr) - *endptr = fail_pos; - - return val; -} -} - -#endif /* BROKEN_G_ASCII_STRTOD */ - - -- cgit v1.2.3 From bb4fa724bd8e1a72571da73ee683fac3788642e4 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Tue, 23 Jul 2013 19:06:58 +0200 Subject: Fix stray prototype of a removed function (bzr r12434) --- src/number-opt-number.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'src') diff --git a/src/number-opt-number.h b/src/number-opt-number.h index b2f2f2a1e..867d0535f 100644 --- a/src/number-opt-number.h +++ b/src/number-opt-number.h @@ -23,9 +23,6 @@ #include #include "svg/stringstream.h" - -gdouble fixed_g_ascii_strtod (const gchar *nptr, gchar **endptr); - class NumberOptNumber { public: -- cgit v1.2.3 From 338a9afe505857694f1bcc2dbbc457f004545ae2 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Tue, 23 Jul 2013 19:10:46 +0200 Subject: Actually remove approx-equal.h (oops again) (bzr r12435) --- src/approx-equal.h | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 src/approx-equal.h (limited to 'src') diff --git a/src/approx-equal.h b/src/approx-equal.h deleted file mode 100644 index 92f36d7a5..000000000 --- a/src/approx-equal.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef __APROX_EQUAL_H__ -#define __APROX_EQUAL_H__ - -#include - -inline bool approx_equal(double const a, double const b) -{ - return ( (a == b) - || ( fabs( a - b ) < 1e-2 ) - || ( fabs( a / b - 1.0 ) < 1e-2 ) ); -} - - -#endif /* !__APROX_EQUAL_H__ */ - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : -- cgit v1.2.3 From 6b78e29d0a6b0a5df82b1d8779689ec41718b258 Mon Sep 17 00:00:00 2001 From: Slagvi Public Date: Wed, 24 Jul 2013 09:25:52 +0200 Subject: Old templates support removed (bzr r12379.2.13) --- src/interface.cpp | 97 +----------------------------------- src/menus-skeleton.h | 1 - src/templates/main.cpp | 16 ------ src/templates/preview.png | Bin 2426 -> 0 bytes src/ui/dialog/template-load-tab.cpp | 2 +- 5 files changed, 2 insertions(+), 114 deletions(-) delete mode 100644 src/templates/main.cpp delete mode 100644 src/templates/preview.png (limited to 'src') diff --git a/src/interface.cpp b/src/interface.cpp index 986d3107f..f9e720494 100644 --- a/src/interface.cpp +++ b/src/interface.cpp @@ -716,13 +716,6 @@ sp_recent_open(GtkRecentChooser *recent_menu, gpointer /*user_data*/) g_free(uri); } -static void -sp_file_new_from_template(GtkWidget */*widget*/, gchar const *uri) -{ - sp_file_new(uri); -} - - static bool compare_file_basenames(gchar const *a, gchar const *b) { bool rc; @@ -750,91 +743,6 @@ compare_file_basenames(gchar const *a, gchar const *b) { return rc; } -static void -sp_menu_get_svg_filenames_from_dir(gchar const *dirname, std::list *files) -{ - if ( Inkscape::IO::file_test( dirname, (GFileTest)(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR) ) ) { - GError *err = 0; - GDir *dir = g_dir_open(dirname, 0, &err); - - if (dir) { - for (gchar const *file = g_dir_read_name(dir); file != NULL; file = g_dir_read_name(dir)) { - if (!g_str_has_suffix(file, ".svg") && !g_str_has_suffix(file, ".svgz")) { - continue; // skip non-svg files - } - - { - gchar *basename = g_path_get_basename(file); - if (g_str_has_suffix(basename, ".svg") && g_str_has_prefix(basename, "default.")) { - g_free(basename); - basename = 0; - continue; // skip default.*.svg (i.e. default.svg and translations) - it's in the menu already - } - g_free(basename); - basename = 0; - } - - gchar const *filepath = g_build_filename(dirname, file, NULL); - files->push_front(filepath); - } - g_dir_close(dir); - } - } - - files->sort(compare_file_basenames); -} - -static void -sp_menu_add_filenames_to_menu(GtkWidget *menu, Inkscape::UI::View::View *view, std::list *files) -{ - if (!files->empty()) { - GtkWidget *sep = gtk_separator_menu_item_new(); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), sep); - } - - for(std::list::iterator it=files->begin(); it != files->end(); ++it) { - gchar const *filepath = *it; - gchar const *file = g_path_get_basename(filepath); - gchar *dupfile = g_strndup(file, strlen(file) - 4); - gchar *filename = g_filename_to_utf8(dupfile, -1, NULL, NULL, NULL); - g_free(dupfile); - - GtkWidget *item = gtk_menu_item_new_with_label(filename); - g_free(filename); - - gtk_widget_show(item); - // how does "filepath" ever get freed? - g_signal_connect(G_OBJECT(item), - "activate", - G_CALLBACK(sp_file_new_from_template), - (gpointer) filepath); - - if (view) { - // set null tip for now; later use a description from the template file - g_object_set_data(G_OBJECT(item), "view", (gpointer) view); - g_signal_connect( G_OBJECT(item), "select", G_CALLBACK(sp_ui_menu_select), (gpointer) NULL ); - g_signal_connect( G_OBJECT(item), "deselect", G_CALLBACK(sp_ui_menu_deselect), NULL); - } - - gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); - } - -} -static void -sp_menu_append_new_templates(GtkWidget *menu, Inkscape::UI::View::View *view) -{ - // user's local dir - std::list userfiles; - sp_menu_get_svg_filenames_from_dir(profile_path("templates"), &userfiles); - sp_menu_add_filenames_to_menu(menu, view, &userfiles); - - // system templates dir - std::list templatefiles; - sp_menu_get_svg_filenames_from_dir(INKSCAPE_TEMPLATESDIR, &templatefiles); - sp_menu_add_filenames_to_menu(menu, view, &templatefiles); - -} - static void sp_ui_checkboxes_menus(GtkMenu *m, Inkscape::UI::View::View *view) { @@ -995,10 +903,7 @@ static void sp_ui_build_dyn_menus(Inkscape::XML::Node *menus, GtkWidget *menu, I gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); continue; } - if (!strcmp(menu_pntr->name(), "template-list")) { - sp_menu_append_new_templates(menu, view); - continue; - } + if (!strcmp(menu_pntr->name(), "recent-file-list")) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); diff --git a/src/menus-skeleton.h b/src/menus-skeleton.h index 7c412b605..9dcd4a80b 100644 --- a/src/menus-skeleton.h +++ b/src/menus-skeleton.h @@ -16,7 +16,6 @@ static char const menus_skeleton[] = " \n" " \n" " \n" -" \n" " \n" " \n" " \n" diff --git a/src/templates/main.cpp b/src/templates/main.cpp deleted file mode 100644 index d7a3f40a4..000000000 --- a/src/templates/main.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include - -#include "new-from-template.h" - -using namespace Inkscape::UI; - -int main (int argc, char *argv[]) -{ - Gtk::Main kit(argc, argv); - - NewFromTemplate dialog; - dialog.run(); - //Gtk::Main::run(dialog); - - return 0; -} diff --git a/src/templates/preview.png b/src/templates/preview.png deleted file mode 100644 index c56a832a2..000000000 Binary files a/src/templates/preview.png and /dev/null differ diff --git a/src/ui/dialog/template-load-tab.cpp b/src/ui/dialog/template-load-tab.cpp index ded4fc6fd..58219f8f2 100644 --- a/src/ui/dialog/template-load-tab.cpp +++ b/src/ui/dialog/template-load-tab.cpp @@ -185,7 +185,7 @@ void TemplateLoadTab::_loadTemplates() _getTemplatesFromDir(profile_path("templates") + _loading_path); // system templates dir - // _getTemplatesFromDir(INKSCAPE_TEMPLATESDIR + _loading_path); + _getTemplatesFromDir(INKSCAPE_TEMPLATESDIR + _loading_path); } -- cgit v1.2.3 From badc78fc17340975af12905bc7a0e0c4d7ab62b4 Mon Sep 17 00:00:00 2001 From: Slagvi Public Date: Wed, 24 Jul 2013 10:22:37 +0200 Subject: Templates gui fixes (bzr r12379.2.14) --- src/ui/dialog/new-from-template.cpp | 3 ++- src/ui/dialog/template-load-tab.cpp | 14 ++++++-------- src/ui/dialog/template-load-tab.h | 5 +++-- src/ui/dialog/template-widget.cpp | 17 ++++++++--------- 4 files changed, 19 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/new-from-template.cpp b/src/ui/dialog/new-from-template.cpp index 6598aecdf..2595e2cf5 100644 --- a/src/ui/dialog/new-from-template.cpp +++ b/src/ui/dialog/new-from-template.cpp @@ -30,7 +30,8 @@ NewFromTemplate::NewFromTemplate() Gtk::Alignment *align; align = manage(new Gtk::Alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER, 0.0, 0.0)); - get_vbox()->pack_end(*align, Gtk::PACK_SHRINK, 5); + get_vbox()->pack_end(*align, Gtk::PACK_SHRINK); + align->set_padding(0, 0, 0, 15); align->add(_create_template_button); _create_template_button.signal_pressed().connect( diff --git a/src/ui/dialog/template-load-tab.cpp b/src/ui/dialog/template-load-tab.cpp index 58219f8f2..65d5e6447 100644 --- a/src/ui/dialog/template-load-tab.cpp +++ b/src/ui/dialog/template-load-tab.cpp @@ -38,18 +38,16 @@ TemplateLoadTab::TemplateLoadTab() set_border_width(10); _info_widget = manage(new TemplateWidget()); + Gtk::Label *title; title = manage(new Gtk::Label(_("Search:"))); - _tlist_box.pack_start(*title, Gtk::PACK_SHRINK, 10); - - _tlist_box.pack_start(_keywords_combo, Gtk::PACK_SHRINK, 0); + _search_box.pack_start(*title, Gtk::PACK_SHRINK); + _search_box.pack_start(_keywords_combo, Gtk::PACK_SHRINK, 5); - title = manage(new Gtk::Label(_("Templates"))); - _tlist_box.pack_start(*title, Gtk::PACK_SHRINK, 10); + _tlist_box.pack_start(_search_box, Gtk::PACK_SHRINK, 10); - add(_main_box); - _main_box.pack_start(_tlist_box, Gtk::PACK_SHRINK, 20); - _main_box.pack_start(*_info_widget, Gtk::PACK_EXPAND_WIDGET, 10); + pack_start(_tlist_box, Gtk::PACK_SHRINK); + pack_start(*_info_widget, Gtk::PACK_EXPAND_WIDGET, 5); Gtk::ScrolledWindow *scrolled; scrolled = manage(new Gtk::ScrolledWindow()); diff --git a/src/ui/dialog/template-load-tab.h b/src/ui/dialog/template-load-tab.h index cc5229c95..c3c512374 100644 --- a/src/ui/dialog/template-load-tab.h +++ b/src/ui/dialog/template-load-tab.h @@ -25,7 +25,7 @@ namespace UI { class TemplateWidget; -class TemplateLoadTab : public Gtk::Frame +class TemplateLoadTab : public Gtk::HBox { public: @@ -71,8 +71,9 @@ protected: void _loadTemplates(); void _initLists(); - Gtk::HBox _main_box; + // Gtk::HBox _main_box; Gtk::VBox _tlist_box; + Gtk::HBox _search_box; TemplateWidget *_info_widget; Gtk::ComboBoxText _keywords_combo; diff --git a/src/ui/dialog/template-widget.cpp b/src/ui/dialog/template-widget.cpp index bb2c4a683..56346403e 100644 --- a/src/ui/dialog/template-widget.cpp +++ b/src/ui/dialog/template-widget.cpp @@ -27,26 +27,25 @@ namespace UI { TemplateWidget::TemplateWidget() : _more_info_button(_("More info")) - , _short_description_label(_("Short description")) - , _template_author_label(_("by template_author")) - , _template_name_label(_("Template_name")) - , _preview_image("preview.png") + , _short_description_label(_(" ")) + , _template_author_label(_(" ")) + , _template_name_label(_("no template selected")) + , _preview_image(" ") { - Gtk::Label *title = manage(new Gtk::Label(_("Selected template"))); - pack_start(*title, Gtk::PACK_SHRINK, 10); - pack_start(_template_name_label, Gtk::PACK_SHRINK, 4); + pack_start(_template_name_label, Gtk::PACK_SHRINK, 10); pack_start(_template_author_label, Gtk::PACK_SHRINK, 0); pack_start(_preview_image, Gtk::PACK_SHRINK, 15); - pack_start(_short_description_label, Gtk::PACK_SHRINK, 4); _short_description_label.set_line_wrap(true); _short_description_label.set_size_request(200); Gtk::Alignment *align; align = manage(new Gtk::Alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER, 0.0, 0.0)); - pack_start(*align, Gtk::PACK_SHRINK, 5); + pack_end(*align, Gtk::PACK_SHRINK); align->add(_more_info_button); + pack_end(_short_description_label, Gtk::PACK_SHRINK, 5); + _more_info_button.signal_pressed().connect( sigc::mem_fun(*this, &TemplateWidget::_displayTemplateDetails)); } -- cgit v1.2.3 From a54cf666ee5f242b47305110e0eaa96bd282438b Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Thu, 25 Jul 2013 00:12:32 +0200 Subject: Remove the "simple SAX" parser. Replace its only use (loading of unit definitions in util/units.cpp) with Glib::Markup (bzr r12438) --- src/io/CMakeLists.txt | 2 - src/io/Makefile_insert | 2 - src/io/simple-sax.cpp | 1494 ------------------------------------------------ src/io/simple-sax.h | 97 ---- src/util/units.cpp | 213 ++----- src/util/units.h | 10 +- 6 files changed, 67 insertions(+), 1751 deletions(-) delete mode 100644 src/io/simple-sax.cpp delete mode 100644 src/io/simple-sax.h (limited to 'src') diff --git a/src/io/CMakeLists.txt b/src/io/CMakeLists.txt index 34502d3db..8f8355c03 100644 --- a/src/io/CMakeLists.txt +++ b/src/io/CMakeLists.txt @@ -7,7 +7,6 @@ set(io_SRC inkjar.cpp inkscapestream.cpp resource.cpp - simple-sax.cpp stringstream.cpp sys.cpp uristream.cpp @@ -22,7 +21,6 @@ set(io_SRC inkjar.h inkscapestream.h resource.h - simple-sax.h stringstream.h sys.h uristream.h diff --git a/src/io/Makefile_insert b/src/io/Makefile_insert index 935c0cc07..804c9575a 100644 --- a/src/io/Makefile_insert +++ b/src/io/Makefile_insert @@ -15,8 +15,6 @@ ink_common_sources += \ io/inkscapestream.h \ io/resource.cpp \ io/resource.h \ - io/simple-sax.cpp \ - io/simple-sax.h \ io/stringstream.cpp \ io/stringstream.h \ io/sys.h \ diff --git a/src/io/simple-sax.cpp b/src/io/simple-sax.cpp deleted file mode 100644 index 33e7b72bf..000000000 --- a/src/io/simple-sax.cpp +++ /dev/null @@ -1,1494 +0,0 @@ -/* - * SimpleSAX - * - * Authors: - * Jon A. Cruz - * - * Copyright (C) 2004 AUTHORS - * - * Released under GNU GPL, read the file 'COPYING' for more information - */ - -#include -#include -#include "simple-sax.h" - -namespace Inkscape { -namespace IO { - -SaxHandler::SaxHandler() -{ - memset( &sax, 0, sizeof(sax) ); - sax.startDocument = startDocument; - sax.endDocument = endDocument; - sax.startElement = startElement; - sax.endElement = endElement; - sax.characters = characters; -} - -SaxHandler::~SaxHandler() -{ -} - - -static int xmlErrorVals[] = { - XML_ERR_OK, - XML_ERR_INTERNAL_ERROR, - XML_ERR_NO_MEMORY, - XML_ERR_DOCUMENT_START, - XML_ERR_DOCUMENT_EMPTY, - XML_ERR_DOCUMENT_END, - XML_ERR_INVALID_HEX_CHARREF, - XML_ERR_INVALID_DEC_CHARREF, - XML_ERR_INVALID_CHARREF, - XML_ERR_INVALID_CHAR, - XML_ERR_CHARREF_AT_EOF, - XML_ERR_CHARREF_IN_PROLOG, - XML_ERR_CHARREF_IN_EPILOG, - XML_ERR_CHARREF_IN_DTD, - XML_ERR_ENTITYREF_AT_EOF, - XML_ERR_ENTITYREF_IN_PROLOG, - XML_ERR_ENTITYREF_IN_EPILOG, - XML_ERR_ENTITYREF_IN_DTD, - XML_ERR_PEREF_AT_EOF, - XML_ERR_PEREF_IN_PROLOG, - XML_ERR_PEREF_IN_EPILOG, - XML_ERR_PEREF_IN_INT_SUBSET, - XML_ERR_ENTITYREF_NO_NAME, - XML_ERR_ENTITYREF_SEMICOL_MISSING, - XML_ERR_PEREF_NO_NAME, - XML_ERR_PEREF_SEMICOL_MISSING, - XML_ERR_UNDECLARED_ENTITY, - XML_WAR_UNDECLARED_ENTITY, - XML_ERR_UNPARSED_ENTITY, - XML_ERR_ENTITY_IS_EXTERNAL, - XML_ERR_ENTITY_IS_PARAMETER, - XML_ERR_UNKNOWN_ENCODING, - XML_ERR_UNSUPPORTED_ENCODING, - XML_ERR_STRING_NOT_STARTED, - XML_ERR_STRING_NOT_CLOSED, - XML_ERR_NS_DECL_ERROR, - XML_ERR_ENTITY_NOT_STARTED, - XML_ERR_ENTITY_NOT_FINISHED, - XML_ERR_LT_IN_ATTRIBUTE, - XML_ERR_ATTRIBUTE_NOT_STARTED, - XML_ERR_ATTRIBUTE_NOT_FINISHED, - XML_ERR_ATTRIBUTE_WITHOUT_VALUE, - XML_ERR_ATTRIBUTE_REDEFINED, - XML_ERR_LITERAL_NOT_STARTED, - XML_ERR_LITERAL_NOT_FINISHED, - XML_ERR_COMMENT_NOT_FINISHED, - XML_ERR_PI_NOT_STARTED, - XML_ERR_PI_NOT_FINISHED, - XML_ERR_NOTATION_NOT_STARTED, - XML_ERR_NOTATION_NOT_FINISHED, - XML_ERR_ATTLIST_NOT_STARTED, - XML_ERR_ATTLIST_NOT_FINISHED, - XML_ERR_MIXED_NOT_STARTED, - XML_ERR_MIXED_NOT_FINISHED, - XML_ERR_ELEMCONTENT_NOT_STARTED, - XML_ERR_ELEMCONTENT_NOT_FINISHED, - XML_ERR_XMLDECL_NOT_STARTED, - XML_ERR_XMLDECL_NOT_FINISHED, - XML_ERR_CONDSEC_NOT_STARTED, - XML_ERR_CONDSEC_NOT_FINISHED, - XML_ERR_EXT_SUBSET_NOT_FINISHED, - XML_ERR_DOCTYPE_NOT_FINISHED, - XML_ERR_MISPLACED_CDATA_END, - XML_ERR_CDATA_NOT_FINISHED, - XML_ERR_RESERVED_XML_NAME, - XML_ERR_SPACE_REQUIRED, - XML_ERR_SEPARATOR_REQUIRED, - XML_ERR_NMTOKEN_REQUIRED, - XML_ERR_NAME_REQUIRED, - XML_ERR_PCDATA_REQUIRED, - XML_ERR_URI_REQUIRED, - XML_ERR_PUBID_REQUIRED, - XML_ERR_LT_REQUIRED, - XML_ERR_GT_REQUIRED, - XML_ERR_LTSLASH_REQUIRED, - XML_ERR_EQUAL_REQUIRED, - XML_ERR_TAG_NAME_MISMATCH, - XML_ERR_TAG_NOT_FINISHED, - XML_ERR_STANDALONE_VALUE, - XML_ERR_ENCODING_NAME, - XML_ERR_HYPHEN_IN_COMMENT, - XML_ERR_INVALID_ENCODING, - XML_ERR_EXT_ENTITY_STANDALONE, - XML_ERR_CONDSEC_INVALID, - XML_ERR_VALUE_REQUIRED, - XML_ERR_NOT_WELL_BALANCED, - XML_ERR_EXTRA_CONTENT, - XML_ERR_ENTITY_CHAR_ERROR, - XML_ERR_ENTITY_PE_INTERNAL, - XML_ERR_ENTITY_LOOP, - XML_ERR_ENTITY_BOUNDARY, - XML_ERR_INVALID_URI, - XML_ERR_URI_FRAGMENT, - XML_WAR_CATALOG_PI, - XML_ERR_NO_DTD, - XML_ERR_CONDSEC_INVALID_KEYWORD, - XML_ERR_VERSION_MISSING, - XML_WAR_UNKNOWN_VERSION, - XML_WAR_LANG_VALUE, - XML_WAR_NS_URI, - XML_WAR_NS_URI_RELATIVE, - XML_ERR_MISSING_ENCODING, - XML_NS_ERR_XML_NAMESPACE, - XML_NS_ERR_UNDEFINED_NAMESPACE, - XML_NS_ERR_QNAME, - XML_NS_ERR_ATTRIBUTE_REDEFINED, - XML_DTD_ATTRIBUTE_DEFAULT, - XML_DTD_ATTRIBUTE_REDEFINED, - XML_DTD_ATTRIBUTE_VALUE, - XML_DTD_CONTENT_ERROR, - XML_DTD_CONTENT_MODEL, - XML_DTD_CONTENT_NOT_DETERMINIST, - XML_DTD_DIFFERENT_PREFIX, - XML_DTD_ELEM_DEFAULT_NAMESPACE, - XML_DTD_ELEM_NAMESPACE, - XML_DTD_ELEM_REDEFINED, - XML_DTD_EMPTY_NOTATION, - XML_DTD_ENTITY_TYPE, - XML_DTD_ID_FIXED, - XML_DTD_ID_REDEFINED, - XML_DTD_ID_SUBSET, - XML_DTD_INVALID_CHILD, - XML_DTD_INVALID_DEFAULT, - XML_DTD_LOAD_ERROR, - XML_DTD_MISSING_ATTRIBUTE, - XML_DTD_MIXED_CORRUPT, - XML_DTD_MULTIPLE_ID, - XML_DTD_NO_DOC, - XML_DTD_NO_DTD, - XML_DTD_NO_ELEM_NAME, - XML_DTD_NO_PREFIX, - XML_DTD_NO_ROOT, - XML_DTD_NOTATION_REDEFINED, - XML_DTD_NOTATION_VALUE, - XML_DTD_NOT_EMPTY, - XML_DTD_NOT_PCDATA, - XML_DTD_NOT_STANDALONE, - XML_DTD_ROOT_NAME, - XML_DTD_STANDALONE_WHITE_SPACE, - XML_DTD_UNKNOWN_ATTRIBUTE, - XML_DTD_UNKNOWN_ELEM, - XML_DTD_UNKNOWN_ENTITY, - XML_DTD_UNKNOWN_ID, - XML_DTD_UNKNOWN_NOTATION, - XML_DTD_STANDALONE_DEFAULTED, - XML_DTD_XMLID_VALUE, - XML_DTD_XMLID_TYPE, - XML_HTML_STRUCURE_ERROR, - XML_HTML_UNKNOWN_TAG, - XML_RNGP_ANYNAME_ATTR_ANCESTOR, - XML_RNGP_ATTR_CONFLICT, - XML_RNGP_ATTRIBUTE_CHILDREN, - XML_RNGP_ATTRIBUTE_CONTENT, - XML_RNGP_ATTRIBUTE_EMPTY, - XML_RNGP_ATTRIBUTE_NOOP, - XML_RNGP_CHOICE_CONTENT, - XML_RNGP_CHOICE_EMPTY, - XML_RNGP_CREATE_FAILURE, - XML_RNGP_DATA_CONTENT, - XML_RNGP_DEF_CHOICE_AND_INTERLEAVE, - XML_RNGP_DEFINE_CREATE_FAILED, - XML_RNGP_DEFINE_EMPTY, - XML_RNGP_DEFINE_MISSING, - XML_RNGP_DEFINE_NAME_MISSING, - XML_RNGP_ELEM_CONTENT_EMPTY, - XML_RNGP_ELEM_CONTENT_ERROR, - XML_RNGP_ELEMENT_EMPTY, - XML_RNGP_ELEMENT_CONTENT, - XML_RNGP_ELEMENT_NAME, - XML_RNGP_ELEMENT_NO_CONTENT, - XML_RNGP_ELEM_TEXT_CONFLICT, - XML_RNGP_EMPTY, - XML_RNGP_EMPTY_CONSTRUCT, - XML_RNGP_EMPTY_CONTENT, - XML_RNGP_EMPTY_NOT_EMPTY, - XML_RNGP_ERROR_TYPE_LIB, - XML_RNGP_EXCEPT_EMPTY, - XML_RNGP_EXCEPT_MISSING, - XML_RNGP_EXCEPT_MULTIPLE, - XML_RNGP_EXCEPT_NO_CONTENT, - XML_RNGP_EXTERNALREF_EMTPY, - XML_RNGP_EXTERNAL_REF_FAILURE, - XML_RNGP_EXTERNALREF_RECURSE, - XML_RNGP_FORBIDDEN_ATTRIBUTE, - XML_RNGP_FOREIGN_ELEMENT, - XML_RNGP_GRAMMAR_CONTENT, - XML_RNGP_GRAMMAR_EMPTY, - XML_RNGP_GRAMMAR_MISSING, - XML_RNGP_GRAMMAR_NO_START, - XML_RNGP_GROUP_ATTR_CONFLICT, - XML_RNGP_HREF_ERROR, - XML_RNGP_INCLUDE_EMPTY, - XML_RNGP_INCLUDE_FAILURE, - XML_RNGP_INCLUDE_RECURSE, - XML_RNGP_INTERLEAVE_ADD, - XML_RNGP_INTERLEAVE_CREATE_FAILED, - XML_RNGP_INTERLEAVE_EMPTY, - XML_RNGP_INTERLEAVE_NO_CONTENT, - XML_RNGP_INVALID_DEFINE_NAME, - XML_RNGP_INVALID_URI, - XML_RNGP_INVALID_VALUE, - XML_RNGP_MISSING_HREF, - XML_RNGP_NAME_MISSING, - XML_RNGP_NEED_COMBINE, - XML_RNGP_NOTALLOWED_NOT_EMPTY, - XML_RNGP_NSNAME_ATTR_ANCESTOR, - XML_RNGP_NSNAME_NO_NS, - XML_RNGP_PARAM_FORBIDDEN, - XML_RNGP_PARAM_NAME_MISSING, - XML_RNGP_PARENTREF_CREATE_FAILED, - XML_RNGP_PARENTREF_NAME_INVALID, - XML_RNGP_PARENTREF_NO_NAME, - XML_RNGP_PARENTREF_NO_PARENT, - XML_RNGP_PARENTREF_NOT_EMPTY, - XML_RNGP_PARSE_ERROR, - XML_RNGP_PAT_ANYNAME_EXCEPT_ANYNAME, - XML_RNGP_PAT_ATTR_ATTR, - XML_RNGP_PAT_ATTR_ELEM, - XML_RNGP_PAT_DATA_EXCEPT_ATTR, - XML_RNGP_PAT_DATA_EXCEPT_ELEM, - XML_RNGP_PAT_DATA_EXCEPT_EMPTY, - XML_RNGP_PAT_DATA_EXCEPT_GROUP, - XML_RNGP_PAT_DATA_EXCEPT_INTERLEAVE, - XML_RNGP_PAT_DATA_EXCEPT_LIST, - XML_RNGP_PAT_DATA_EXCEPT_ONEMORE, - XML_RNGP_PAT_DATA_EXCEPT_REF, - XML_RNGP_PAT_DATA_EXCEPT_TEXT, - XML_RNGP_PAT_LIST_ATTR, - XML_RNGP_PAT_LIST_ELEM, - XML_RNGP_PAT_LIST_INTERLEAVE, - XML_RNGP_PAT_LIST_LIST, - XML_RNGP_PAT_LIST_REF, - XML_RNGP_PAT_LIST_TEXT, - XML_RNGP_PAT_NSNAME_EXCEPT_ANYNAME, - XML_RNGP_PAT_NSNAME_EXCEPT_NSNAME, - XML_RNGP_PAT_ONEMORE_GROUP_ATTR, - XML_RNGP_PAT_ONEMORE_INTERLEAVE_ATTR, - XML_RNGP_PAT_START_ATTR, - XML_RNGP_PAT_START_DATA, - XML_RNGP_PAT_START_EMPTY, - XML_RNGP_PAT_START_GROUP, - XML_RNGP_PAT_START_INTERLEAVE, - XML_RNGP_PAT_START_LIST, - XML_RNGP_PAT_START_ONEMORE, - XML_RNGP_PAT_START_TEXT, - XML_RNGP_PAT_START_VALUE, - XML_RNGP_PREFIX_UNDEFINED, - XML_RNGP_REF_CREATE_FAILED, - XML_RNGP_REF_CYCLE, - XML_RNGP_REF_NAME_INVALID, - XML_RNGP_REF_NO_DEF, - XML_RNGP_REF_NO_NAME, - XML_RNGP_REF_NOT_EMPTY, - XML_RNGP_START_CHOICE_AND_INTERLEAVE, - XML_RNGP_START_CONTENT, - XML_RNGP_START_EMPTY, - XML_RNGP_START_MISSING, - XML_RNGP_TEXT_EXPECTED, - XML_RNGP_TEXT_HAS_CHILD, - XML_RNGP_TYPE_MISSING, - XML_RNGP_TYPE_NOT_FOUND, - XML_RNGP_TYPE_VALUE, - XML_RNGP_UNKNOWN_ATTRIBUTE, - XML_RNGP_UNKNOWN_COMBINE, - XML_RNGP_UNKNOWN_CONSTRUCT, - XML_RNGP_UNKNOWN_TYPE_LIB, - XML_RNGP_URI_FRAGMENT, - XML_RNGP_URI_NOT_ABSOLUTE, - XML_RNGP_VALUE_EMPTY, - XML_RNGP_VALUE_NO_CONTENT, - XML_RNGP_XMLNS_NAME, - XML_RNGP_XML_NS, - XML_XPATH_EXPRESSION_OK, - XML_XPATH_NUMBER_ERROR, - XML_XPATH_UNFINISHED_LITERAL_ERROR, - XML_XPATH_START_LITERAL_ERROR, - XML_XPATH_VARIABLE_REF_ERROR, - XML_XPATH_UNDEF_VARIABLE_ERROR, - XML_XPATH_INVALID_PREDICATE_ERROR, - XML_XPATH_EXPR_ERROR, - XML_XPATH_UNCLOSED_ERROR, - XML_XPATH_UNKNOWN_FUNC_ERROR, - XML_XPATH_INVALID_OPERAND, - XML_XPATH_INVALID_TYPE, - XML_XPATH_INVALID_ARITY, - XML_XPATH_INVALID_CTXT_SIZE, - XML_XPATH_INVALID_CTXT_POSITION, - XML_XPATH_MEMORY_ERROR, - XML_XPTR_SYNTAX_ERROR, - XML_XPTR_RESOURCE_ERROR, - XML_XPTR_SUB_RESOURCE_ERROR, - XML_XPATH_UNDEF_PREFIX_ERROR, - XML_XPATH_ENCODING_ERROR, - XML_XPATH_INVALID_CHAR_ERROR, - XML_TREE_INVALID_HEX, - XML_TREE_INVALID_DEC, - XML_TREE_UNTERMINATED_ENTITY, - XML_SAVE_NOT_UTF8, - XML_SAVE_CHAR_INVALID, - XML_SAVE_NO_DOCTYPE, - XML_SAVE_UNKNOWN_ENCODING, - XML_REGEXP_COMPILE_ERROR, - XML_IO_UNKNOWN, - XML_IO_EACCES, - XML_IO_EAGAIN, - XML_IO_EBADF, - XML_IO_EBADMSG, - XML_IO_EBUSY, - XML_IO_ECANCELED, - XML_IO_ECHILD, - XML_IO_EDEADLK, - XML_IO_EDOM, - XML_IO_EEXIST, - XML_IO_EFAULT, - XML_IO_EFBIG, - XML_IO_EINPROGRESS, - XML_IO_EINTR, - XML_IO_EINVAL, - XML_IO_EIO, - XML_IO_EISDIR, - XML_IO_EMFILE, - XML_IO_EMLINK, - XML_IO_EMSGSIZE, - XML_IO_ENAMETOOLONG, - XML_IO_ENFILE, - XML_IO_ENODEV, - XML_IO_ENOENT, - XML_IO_ENOEXEC, - XML_IO_ENOLCK, - XML_IO_ENOMEM, - XML_IO_ENOSPC, - XML_IO_ENOSYS, - XML_IO_ENOTDIR, - XML_IO_ENOTEMPTY, - XML_IO_ENOTSUP, - XML_IO_ENOTTY, - XML_IO_ENXIO, - XML_IO_EPERM, - XML_IO_EPIPE, - XML_IO_ERANGE, - XML_IO_EROFS, - XML_IO_ESPIPE, - XML_IO_ESRCH, - XML_IO_ETIMEDOUT, - XML_IO_EXDEV, - XML_IO_NETWORK_ATTEMPT, - XML_IO_ENCODER, - XML_IO_FLUSH, - XML_IO_WRITE, - XML_IO_NO_INPUT, - XML_IO_BUFFER_FULL, - XML_IO_LOAD_ERROR, - XML_IO_ENOTSOCK, - XML_IO_EISCONN, - XML_IO_ECONNREFUSED, - XML_IO_ENETUNREACH, - XML_IO_EADDRINUSE, - XML_IO_EALREADY, - XML_IO_EAFNOSUPPORT, - XML_XINCLUDE_RECURSION, - XML_XINCLUDE_PARSE_VALUE, - XML_XINCLUDE_ENTITY_DEF_MISMATCH, - XML_XINCLUDE_NO_HREF, - XML_XINCLUDE_NO_FALLBACK, - XML_XINCLUDE_HREF_URI, - XML_XINCLUDE_TEXT_FRAGMENT, - XML_XINCLUDE_TEXT_DOCUMENT, - XML_XINCLUDE_INVALID_CHAR, - XML_XINCLUDE_BUILD_FAILED, - XML_XINCLUDE_UNKNOWN_ENCODING, - XML_XINCLUDE_MULTIPLE_ROOT, - XML_XINCLUDE_XPTR_FAILED, - XML_XINCLUDE_XPTR_RESULT, - XML_XINCLUDE_INCLUDE_IN_INCLUDE, - XML_XINCLUDE_FALLBACKS_IN_INCLUDE, - XML_XINCLUDE_FALLBACK_NOT_IN_INCLUDE, - XML_XINCLUDE_DEPRECATED_NS, - XML_XINCLUDE_FRAGMENT_ID, - XML_CATALOG_MISSING_ATTR, - XML_CATALOG_ENTRY_BROKEN, - XML_CATALOG_PREFER_VALUE, - XML_CATALOG_NOT_CATALOG, - XML_CATALOG_RECURSION, - XML_SCHEMAP_PREFIX_UNDEFINED, - XML_SCHEMAP_ATTRFORMDEFAULT_VALUE, - XML_SCHEMAP_ATTRGRP_NONAME_NOREF, - XML_SCHEMAP_ATTR_NONAME_NOREF, - XML_SCHEMAP_COMPLEXTYPE_NONAME_NOREF, - XML_SCHEMAP_ELEMFORMDEFAULT_VALUE, - XML_SCHEMAP_ELEM_NONAME_NOREF, - XML_SCHEMAP_EXTENSION_NO_BASE, - XML_SCHEMAP_FACET_NO_VALUE, - XML_SCHEMAP_FAILED_BUILD_IMPORT, - XML_SCHEMAP_GROUP_NONAME_NOREF, - XML_SCHEMAP_IMPORT_NAMESPACE_NOT_URI, - XML_SCHEMAP_IMPORT_REDEFINE_NSNAME, - XML_SCHEMAP_IMPORT_SCHEMA_NOT_URI, - XML_SCHEMAP_INVALID_BOOLEAN, - XML_SCHEMAP_INVALID_ENUM, - XML_SCHEMAP_INVALID_FACET, - XML_SCHEMAP_INVALID_FACET_VALUE, - XML_SCHEMAP_INVALID_MAXOCCURS, - XML_SCHEMAP_INVALID_MINOCCURS, - XML_SCHEMAP_INVALID_REF_AND_SUBTYPE, - XML_SCHEMAP_INVALID_WHITE_SPACE, - XML_SCHEMAP_NOATTR_NOREF, - XML_SCHEMAP_NOTATION_NO_NAME, - XML_SCHEMAP_NOTYPE_NOREF, - XML_SCHEMAP_REF_AND_SUBTYPE, - XML_SCHEMAP_RESTRICTION_NONAME_NOREF, - XML_SCHEMAP_SIMPLETYPE_NONAME, - XML_SCHEMAP_TYPE_AND_SUBTYPE, - XML_SCHEMAP_UNKNOWN_ALL_CHILD, - XML_SCHEMAP_UNKNOWN_ANYATTRIBUTE_CHILD, - XML_SCHEMAP_UNKNOWN_ATTR_CHILD, - XML_SCHEMAP_UNKNOWN_ATTRGRP_CHILD, - XML_SCHEMAP_UNKNOWN_ATTRIBUTE_GROUP, - XML_SCHEMAP_UNKNOWN_BASE_TYPE, - XML_SCHEMAP_UNKNOWN_CHOICE_CHILD, - XML_SCHEMAP_UNKNOWN_COMPLEXCONTENT_CHILD, - XML_SCHEMAP_UNKNOWN_COMPLEXTYPE_CHILD, - XML_SCHEMAP_UNKNOWN_ELEM_CHILD, - XML_SCHEMAP_UNKNOWN_EXTENSION_CHILD, - XML_SCHEMAP_UNKNOWN_FACET_CHILD, - XML_SCHEMAP_UNKNOWN_FACET_TYPE, - XML_SCHEMAP_UNKNOWN_GROUP_CHILD, - XML_SCHEMAP_UNKNOWN_IMPORT_CHILD, - XML_SCHEMAP_UNKNOWN_LIST_CHILD, - XML_SCHEMAP_UNKNOWN_NOTATION_CHILD, - XML_SCHEMAP_UNKNOWN_PROCESSCONTENT_CHILD, - XML_SCHEMAP_UNKNOWN_REF, - XML_SCHEMAP_UNKNOWN_RESTRICTION_CHILD, - XML_SCHEMAP_UNKNOWN_SCHEMAS_CHILD, - XML_SCHEMAP_UNKNOWN_SEQUENCE_CHILD, - XML_SCHEMAP_UNKNOWN_SIMPLECONTENT_CHILD, - XML_SCHEMAP_UNKNOWN_SIMPLETYPE_CHILD, - XML_SCHEMAP_UNKNOWN_TYPE, - XML_SCHEMAP_UNKNOWN_UNION_CHILD, - XML_SCHEMAP_ELEM_DEFAULT_FIXED, - XML_SCHEMAP_REGEXP_INVALID, - XML_SCHEMAP_FAILED_LOAD, - XML_SCHEMAP_NOTHING_TO_PARSE, - XML_SCHEMAP_NOROOT, - XML_SCHEMAP_REDEFINED_GROUP, - XML_SCHEMAP_REDEFINED_TYPE, - XML_SCHEMAP_REDEFINED_ELEMENT, - XML_SCHEMAP_REDEFINED_ATTRGROUP, - XML_SCHEMAP_REDEFINED_ATTR, - XML_SCHEMAP_REDEFINED_NOTATION, - XML_SCHEMAP_FAILED_PARSE, - XML_SCHEMAP_UNKNOWN_PREFIX, - XML_SCHEMAP_DEF_AND_PREFIX, - XML_SCHEMAP_UNKNOWN_INCLUDE_CHILD, - XML_SCHEMAP_INCLUDE_SCHEMA_NOT_URI, - XML_SCHEMAP_INCLUDE_SCHEMA_NO_URI, - XML_SCHEMAP_NOT_SCHEMA, - XML_SCHEMAP_UNKNOWN_MEMBER_TYPE, - XML_SCHEMAP_INVALID_ATTR_USE, - XML_SCHEMAP_RECURSIVE, - XML_SCHEMAP_SUPERNUMEROUS_LIST_ITEM_TYPE, - XML_SCHEMAP_INVALID_ATTR_COMBINATION, - XML_SCHEMAP_INVALID_ATTR_INLINE_COMBINATION, - XML_SCHEMAP_MISSING_SIMPLETYPE_CHILD, - XML_SCHEMAP_INVALID_ATTR_NAME, - XML_SCHEMAP_REF_AND_CONTENT, - XML_SCHEMAP_CT_PROPS_CORRECT_1, - XML_SCHEMAP_CT_PROPS_CORRECT_2, - XML_SCHEMAP_CT_PROPS_CORRECT_3, - XML_SCHEMAP_CT_PROPS_CORRECT_4, - XML_SCHEMAP_CT_PROPS_CORRECT_5, - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1, - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1, - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2, - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_2, - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_3, - XML_SCHEMAP_WILDCARD_INVALID_NS_MEMBER, - XML_SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE, - XML_SCHEMAP_UNION_NOT_EXPRESSIBLE, - XML_SCHEMAP_SRC_IMPORT_3_1, - XML_SCHEMAP_SRC_IMPORT_3_2, - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_1, - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_2, - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_3, - XML_SCHEMAP_COS_CT_EXTENDS_1_3, - XML_SCHEMAV_NOROOT, - XML_SCHEMAV_UNDECLAREDELEM, - XML_SCHEMAV_NOTTOPLEVEL, - XML_SCHEMAV_MISSING, - XML_SCHEMAV_WRONGELEM, - XML_SCHEMAV_NOTYPE, - XML_SCHEMAV_NOROLLBACK, - XML_SCHEMAV_ISABSTRACT, - XML_SCHEMAV_NOTEMPTY, - XML_SCHEMAV_ELEMCONT, - XML_SCHEMAV_HAVEDEFAULT, - XML_SCHEMAV_NOTNILLABLE, - XML_SCHEMAV_EXTRACONTENT, - XML_SCHEMAV_INVALIDATTR, - XML_SCHEMAV_INVALIDELEM, - XML_SCHEMAV_NOTDETERMINIST, - XML_SCHEMAV_CONSTRUCT, - XML_SCHEMAV_INTERNAL, - XML_SCHEMAV_NOTSIMPLE, - XML_SCHEMAV_ATTRUNKNOWN, - XML_SCHEMAV_ATTRINVALID, - XML_SCHEMAV_VALUE, - XML_SCHEMAV_FACET, - XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1, - XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2, - XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_3, - XML_SCHEMAV_CVC_TYPE_3_1_1, - XML_SCHEMAV_CVC_TYPE_3_1_2, - XML_SCHEMAV_CVC_FACET_VALID, - XML_SCHEMAV_CVC_LENGTH_VALID, - XML_SCHEMAV_CVC_MINLENGTH_VALID, - XML_SCHEMAV_CVC_MAXLENGTH_VALID, - XML_SCHEMAV_CVC_MININCLUSIVE_VALID, - XML_SCHEMAV_CVC_MAXINCLUSIVE_VALID, - XML_SCHEMAV_CVC_MINEXCLUSIVE_VALID, - XML_SCHEMAV_CVC_MAXEXCLUSIVE_VALID, - XML_SCHEMAV_CVC_TOTALDIGITS_VALID, - XML_SCHEMAV_CVC_FRACTIONDIGITS_VALID, - XML_SCHEMAV_CVC_PATTERN_VALID, - XML_SCHEMAV_CVC_ENUMERATION_VALID, - XML_SCHEMAV_CVC_COMPLEX_TYPE_2_1, - XML_SCHEMAV_CVC_COMPLEX_TYPE_2_2, - XML_SCHEMAV_CVC_COMPLEX_TYPE_2_3, - XML_SCHEMAV_CVC_COMPLEX_TYPE_2_4, - -#if defined XML_SCHEMAV_CVC_ELT_1 - XML_SCHEMAV_CVC_ELT_1, - XML_SCHEMAV_CVC_ELT_2, - XML_SCHEMAV_CVC_ELT_3_1, - XML_SCHEMAV_CVC_ELT_3_2_1, - XML_SCHEMAV_CVC_ELT_3_2_2, - XML_SCHEMAV_CVC_ELT_4_1, - XML_SCHEMAV_CVC_ELT_4_2, - XML_SCHEMAV_CVC_ELT_4_3, - XML_SCHEMAV_CVC_ELT_5_1_1, - XML_SCHEMAV_CVC_ELT_5_1_2, - XML_SCHEMAV_CVC_ELT_5_2_1, - XML_SCHEMAV_CVC_ELT_5_2_2_1, - XML_SCHEMAV_CVC_ELT_5_2_2_2_1, - XML_SCHEMAV_CVC_ELT_5_2_2_2_2, - XML_SCHEMAV_CVC_ELT_6, - XML_SCHEMAV_CVC_ELT_7, - XML_SCHEMAV_CVC_ATTRIBUTE_1, - XML_SCHEMAV_CVC_ATTRIBUTE_2, - XML_SCHEMAV_CVC_ATTRIBUTE_3, - XML_SCHEMAV_CVC_ATTRIBUTE_4, - XML_SCHEMAV_CVC_COMPLEX_TYPE_3_1, - XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_1, - XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_2, - XML_SCHEMAV_CVC_COMPLEX_TYPE_4, - XML_SCHEMAV_CVC_COMPLEX_TYPE_5_1, - XML_SCHEMAV_CVC_COMPLEX_TYPE_5_2, - XML_SCHEMAV_ELEMENT_CONTENT, - XML_SCHEMAV_DOCUMENT_ELEMENT_MISSING, -#endif - -#if defined XML_SCHEMAV_CVC_COMPLEX_TYPE_1 - XML_SCHEMAV_CVC_COMPLEX_TYPE_1, - XML_SCHEMAV_CVC_AU, - XML_SCHEMAV_CVC_TYPE_1, - XML_SCHEMAV_CVC_TYPE_2, -#endif - - XML_XPTR_UNKNOWN_SCHEME, - XML_XPTR_CHILDSEQ_START, - XML_XPTR_EVAL_FAILED, - XML_XPTR_EXTRA_OBJECTS, - XML_C14N_CREATE_CTXT, - XML_C14N_REQUIRES_UTF8, - XML_C14N_CREATE_STACK, - XML_C14N_INVALID_NODE, - XML_FTP_PASV_ANSWER, - XML_FTP_EPSV_ANSWER, - XML_FTP_ACCNT, - XML_HTTP_URL_SYNTAX, - XML_HTTP_USE_IP, - XML_HTTP_UNKNOWN_HOST, - XML_SCHEMAP_SRC_SIMPLE_TYPE_1, - XML_SCHEMAP_SRC_SIMPLE_TYPE_2, - XML_SCHEMAP_SRC_SIMPLE_TYPE_3, - XML_SCHEMAP_SRC_SIMPLE_TYPE_4, - XML_SCHEMAP_SRC_RESOLVE, - XML_SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE, - XML_SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE, - XML_SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES, - XML_SCHEMAP_ST_PROPS_CORRECT_1, - XML_SCHEMAP_ST_PROPS_CORRECT_2, - XML_SCHEMAP_ST_PROPS_CORRECT_3, - XML_SCHEMAP_COS_ST_RESTRICTS_1_1, - XML_SCHEMAP_COS_ST_RESTRICTS_1_2, - XML_SCHEMAP_COS_ST_RESTRICTS_1_3_1, - XML_SCHEMAP_COS_ST_RESTRICTS_1_3_2, - XML_SCHEMAP_COS_ST_RESTRICTS_2_1, - XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_1, - XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_2, - XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_1, - XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_2, - XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_3, - XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_4, - XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_5, - XML_SCHEMAP_COS_ST_RESTRICTS_3_1, - XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1, - XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1_2, - XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_2, - XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_1, - XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_3, - XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_4, - XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_5, - XML_SCHEMAP_COS_ST_DERIVED_OK_2_1, - XML_SCHEMAP_COS_ST_DERIVED_OK_2_2, - XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - XML_SCHEMAP_S4S_ELEM_MISSING, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - XML_SCHEMAP_S4S_ATTR_MISSING, - -#if defined XML_SCHEMAP_S4S_ATTR_INVALID_VALUE - XML_SCHEMAP_S4S_ATTR_INVALID_VALUE, - XML_SCHEMAP_SRC_ELEMENT_1, - XML_SCHEMAP_SRC_ELEMENT_2_1, - XML_SCHEMAP_SRC_ELEMENT_2_2, - XML_SCHEMAP_SRC_ELEMENT_3, - XML_SCHEMAP_P_PROPS_CORRECT_1, - XML_SCHEMAP_P_PROPS_CORRECT_2_1, - XML_SCHEMAP_P_PROPS_CORRECT_2_2, - XML_SCHEMAP_E_PROPS_CORRECT_2, - XML_SCHEMAP_E_PROPS_CORRECT_3, - XML_SCHEMAP_E_PROPS_CORRECT_4, - XML_SCHEMAP_E_PROPS_CORRECT_5, - XML_SCHEMAP_E_PROPS_CORRECT_6, - XML_SCHEMAP_SRC_INCLUDE, - XML_SCHEMAP_SRC_ATTRIBUTE_1, - XML_SCHEMAP_SRC_ATTRIBUTE_2, - XML_SCHEMAP_SRC_ATTRIBUTE_3_1, - XML_SCHEMAP_SRC_ATTRIBUTE_3_2, - XML_SCHEMAP_SRC_ATTRIBUTE_4, - XML_SCHEMAP_NO_XMLNS, - XML_SCHEMAP_NO_XSI, - XML_SCHEMAP_COS_VALID_DEFAULT_1, - XML_SCHEMAP_COS_VALID_DEFAULT_2_1, - XML_SCHEMAP_COS_VALID_DEFAULT_2_2_1, - XML_SCHEMAP_COS_VALID_DEFAULT_2_2_2, - XML_SCHEMAP_CVC_SIMPLE_TYPE, - XML_SCHEMAP_COS_CT_EXTENDS_1_1, - XML_SCHEMAP_SRC_IMPORT_1_1, - XML_SCHEMAP_SRC_IMPORT_1_2, - XML_SCHEMAP_SRC_IMPORT_2, - XML_SCHEMAP_SRC_IMPORT_2_1, - XML_SCHEMAP_SRC_IMPORT_2_2, -#endif - -#if defined XML_SCHEMAP_INTERNAL - XML_SCHEMAP_INTERNAL, - XML_SCHEMAP_NOT_DETERMINISTIC, -#endif - -#if defined XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_1 - XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_1, - XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_2, - XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_3, - XML_SCHEMAP_MG_PROPS_CORRECT_1, - XML_SCHEMAP_MG_PROPS_CORRECT_2, - XML_SCHEMAP_SRC_CT_1, - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3, - XML_SCHEMAP_AU_PROPS_CORRECT_2, - XML_SCHEMAP_A_PROPS_CORRECT_2, -#endif - -1 -}; - - -static const char* xmlErrorStrs[] = { - "ERR_OK", - "ERR_INTERNAL_ERROR", - "ERR_NO_MEMORY", - "ERR_DOCUMENT_START", - "ERR_DOCUMENT_EMPTY", - "ERR_DOCUMENT_END", - "ERR_INVALID_HEX_CHARREF", - "ERR_INVALID_DEC_CHARREF", - "ERR_INVALID_CHARREF", - "ERR_INVALID_CHAR", - "ERR_CHARREF_AT_EOF", - "ERR_CHARREF_IN_PROLOG", - "ERR_CHARREF_IN_EPILOG", - "ERR_CHARREF_IN_DTD", - "ERR_ENTITYREF_AT_EOF", - "ERR_ENTITYREF_IN_PROLOG", - "ERR_ENTITYREF_IN_EPILOG", - "ERR_ENTITYREF_IN_DTD", - "ERR_PEREF_AT_EOF", - "ERR_PEREF_IN_PROLOG", - "ERR_PEREF_IN_EPILOG", - "ERR_PEREF_IN_INT_SUBSET", - "ERR_ENTITYREF_NO_NAME", - "ERR_ENTITYREF_SEMICOL_MISSING", - "ERR_PEREF_NO_NAME", - "ERR_PEREF_SEMICOL_MISSING", - "ERR_UNDECLARED_ENTITY", - "WAR_UNDECLARED_ENTITY", - "ERR_UNPARSED_ENTITY", - "ERR_ENTITY_IS_EXTERNAL", - "ERR_ENTITY_IS_PARAMETER", - "ERR_UNKNOWN_ENCODING", - "ERR_UNSUPPORTED_ENCODING", - "ERR_STRING_NOT_STARTED", - "ERR_STRING_NOT_CLOSED", - "ERR_NS_DECL_ERROR", - "ERR_ENTITY_NOT_STARTED", - "ERR_ENTITY_NOT_FINISHED", - "ERR_LT_IN_ATTRIBUTE", - "ERR_ATTRIBUTE_NOT_STARTED", - "ERR_ATTRIBUTE_NOT_FINISHED", - "ERR_ATTRIBUTE_WITHOUT_VALUE", - "ERR_ATTRIBUTE_REDEFINED", - "ERR_LITERAL_NOT_STARTED", - "ERR_LITERAL_NOT_FINISHED", - "ERR_COMMENT_NOT_FINISHED", - "ERR_PI_NOT_STARTED", - "ERR_PI_NOT_FINISHED", - "ERR_NOTATION_NOT_STARTED", - "ERR_NOTATION_NOT_FINISHED", - "ERR_ATTLIST_NOT_STARTED", - "ERR_ATTLIST_NOT_FINISHED", - "ERR_MIXED_NOT_STARTED", - "ERR_MIXED_NOT_FINISHED", - "ERR_ELEMCONTENT_NOT_STARTED", - "ERR_ELEMCONTENT_NOT_FINISHED", - "ERR_XMLDECL_NOT_STARTED", - "ERR_XMLDECL_NOT_FINISHED", - "ERR_CONDSEC_NOT_STARTED", - "ERR_CONDSEC_NOT_FINISHED", - "ERR_EXT_SUBSET_NOT_FINISHED", - "ERR_DOCTYPE_NOT_FINISHED", - "ERR_MISPLACED_CDATA_END", - "ERR_CDATA_NOT_FINISHED", - "ERR_RESERVED_XML_NAME", - "ERR_SPACE_REQUIRED", - "ERR_SEPARATOR_REQUIRED", - "ERR_NMTOKEN_REQUIRED", - "ERR_NAME_REQUIRED", - "ERR_PCDATA_REQUIRED", - "ERR_URI_REQUIRED", - "ERR_PUBID_REQUIRED", - "ERR_LT_REQUIRED", - "ERR_GT_REQUIRED", - "ERR_LTSLASH_REQUIRED", - "ERR_EQUAL_REQUIRED", - "ERR_TAG_NAME_MISMATCH", - "ERR_TAG_NOT_FINISHED", - "ERR_STANDALONE_VALUE", - "ERR_ENCODING_NAME", - "ERR_HYPHEN_IN_COMMENT", - "ERR_INVALID_ENCODING", - "ERR_EXT_ENTITY_STANDALONE", - "ERR_CONDSEC_INVALID", - "ERR_VALUE_REQUIRED", - "ERR_NOT_WELL_BALANCED", - "ERR_EXTRA_CONTENT", - "ERR_ENTITY_CHAR_ERROR", - "ERR_ENTITY_PE_INTERNAL", - "ERR_ENTITY_LOOP", - "ERR_ENTITY_BOUNDARY", - "ERR_INVALID_URI", - "ERR_URI_FRAGMENT", - "WAR_CATALOG_PI", - "ERR_NO_DTD", - "ERR_CONDSEC_INVALID_KEYWORD", - "ERR_VERSION_MISSING", - "WAR_UNKNOWN_VERSION", - "WAR_LANG_VALUE", - "WAR_NS_URI", - "WAR_NS_URI_RELATIVE", - "ERR_MISSING_ENCODING", - "NS_ERR_XML_NAMESPACE", - "NS_ERR_UNDEFINED_NAMESPACE", - "NS_ERR_QNAME", - "NS_ERR_ATTRIBUTE_REDEFINED", - "DTD_ATTRIBUTE_DEFAULT", - "DTD_ATTRIBUTE_REDEFINED", - "DTD_ATTRIBUTE_VALUE", - "DTD_CONTENT_ERROR", - "DTD_CONTENT_MODEL", - "DTD_CONTENT_NOT_DETERMINIST", - "DTD_DIFFERENT_PREFIX", - "DTD_ELEM_DEFAULT_NAMESPACE", - "DTD_ELEM_NAMESPACE", - "DTD_ELEM_REDEFINED", - "DTD_EMPTY_NOTATION", - "DTD_ENTITY_TYPE", - "DTD_ID_FIXED", - "DTD_ID_REDEFINED", - "DTD_ID_SUBSET", - "DTD_INVALID_CHILD", - "DTD_INVALID_DEFAULT", - "DTD_LOAD_ERROR", - "DTD_MISSING_ATTRIBUTE", - "DTD_MIXED_CORRUPT", - "DTD_MULTIPLE_ID", - "DTD_NO_DOC", - "DTD_NO_DTD", - "DTD_NO_ELEM_NAME", - "DTD_NO_PREFIX", - "DTD_NO_ROOT", - "DTD_NOTATION_REDEFINED", - "DTD_NOTATION_VALUE", - "DTD_NOT_EMPTY", - "DTD_NOT_PCDATA", - "DTD_NOT_STANDALONE", - "DTD_ROOT_NAME", - "DTD_STANDALONE_WHITE_SPACE", - "DTD_UNKNOWN_ATTRIBUTE", - "DTD_UNKNOWN_ELEM", - "DTD_UNKNOWN_ENTITY", - "DTD_UNKNOWN_ID", - "DTD_UNKNOWN_NOTATION", - "DTD_STANDALONE_DEFAULTED", - "DTD_XMLID_VALUE", - "DTD_XMLID_TYPE", - "HTML_STRUCURE_ERROR", - "HTML_UNKNOWN_TAG", - "RNGP_ANYNAME_ATTR_ANCESTOR", - "RNGP_ATTR_CONFLICT", - "RNGP_ATTRIBUTE_CHILDREN", - "RNGP_ATTRIBUTE_CONTENT", - "RNGP_ATTRIBUTE_EMPTY", - "RNGP_ATTRIBUTE_NOOP", - "RNGP_CHOICE_CONTENT", - "RNGP_CHOICE_EMPTY", - "RNGP_CREATE_FAILURE", - "RNGP_DATA_CONTENT", - "RNGP_DEF_CHOICE_AND_INTERLEAVE", - "RNGP_DEFINE_CREATE_FAILED", - "RNGP_DEFINE_EMPTY", - "RNGP_DEFINE_MISSING", - "RNGP_DEFINE_NAME_MISSING", - "RNGP_ELEM_CONTENT_EMPTY", - "RNGP_ELEM_CONTENT_ERROR", - "RNGP_ELEMENT_EMPTY", - "RNGP_ELEMENT_CONTENT", - "RNGP_ELEMENT_NAME", - "RNGP_ELEMENT_NO_CONTENT", - "RNGP_ELEM_TEXT_CONFLICT", - "RNGP_EMPTY", - "RNGP_EMPTY_CONSTRUCT", - "RNGP_EMPTY_CONTENT", - "RNGP_EMPTY_NOT_EMPTY", - "RNGP_ERROR_TYPE_LIB", - "RNGP_EXCEPT_EMPTY", - "RNGP_EXCEPT_MISSING", - "RNGP_EXCEPT_MULTIPLE", - "RNGP_EXCEPT_NO_CONTENT", - "RNGP_EXTERNALREF_EMTPY", - "RNGP_EXTERNAL_REF_FAILURE", - "RNGP_EXTERNALREF_RECURSE", - "RNGP_FORBIDDEN_ATTRIBUTE", - "RNGP_FOREIGN_ELEMENT", - "RNGP_GRAMMAR_CONTENT", - "RNGP_GRAMMAR_EMPTY", - "RNGP_GRAMMAR_MISSING", - "RNGP_GRAMMAR_NO_START", - "RNGP_GROUP_ATTR_CONFLICT", - "RNGP_HREF_ERROR", - "RNGP_INCLUDE_EMPTY", - "RNGP_INCLUDE_FAILURE", - "RNGP_INCLUDE_RECURSE", - "RNGP_INTERLEAVE_ADD", - "RNGP_INTERLEAVE_CREATE_FAILED", - "RNGP_INTERLEAVE_EMPTY", - "RNGP_INTERLEAVE_NO_CONTENT", - "RNGP_INVALID_DEFINE_NAME", - "RNGP_INVALID_URI", - "RNGP_INVALID_VALUE", - "RNGP_MISSING_HREF", - "RNGP_NAME_MISSING", - "RNGP_NEED_COMBINE", - "RNGP_NOTALLOWED_NOT_EMPTY", - "RNGP_NSNAME_ATTR_ANCESTOR", - "RNGP_NSNAME_NO_NS", - "RNGP_PARAM_FORBIDDEN", - "RNGP_PARAM_NAME_MISSING", - "RNGP_PARENTREF_CREATE_FAILED", - "RNGP_PARENTREF_NAME_INVALID", - "RNGP_PARENTREF_NO_NAME", - "RNGP_PARENTREF_NO_PARENT", - "RNGP_PARENTREF_NOT_EMPTY", - "RNGP_PARSE_ERROR", - "RNGP_PAT_ANYNAME_EXCEPT_ANYNAME", - "RNGP_PAT_ATTR_ATTR", - "RNGP_PAT_ATTR_ELEM", - "RNGP_PAT_DATA_EXCEPT_ATTR", - "RNGP_PAT_DATA_EXCEPT_ELEM", - "RNGP_PAT_DATA_EXCEPT_EMPTY", - "RNGP_PAT_DATA_EXCEPT_GROUP", - "RNGP_PAT_DATA_EXCEPT_INTERLEAVE", - "RNGP_PAT_DATA_EXCEPT_LIST", - "RNGP_PAT_DATA_EXCEPT_ONEMORE", - "RNGP_PAT_DATA_EXCEPT_REF", - "RNGP_PAT_DATA_EXCEPT_TEXT", - "RNGP_PAT_LIST_ATTR", - "RNGP_PAT_LIST_ELEM", - "RNGP_PAT_LIST_INTERLEAVE", - "RNGP_PAT_LIST_LIST", - "RNGP_PAT_LIST_REF", - "RNGP_PAT_LIST_TEXT", - "RNGP_PAT_NSNAME_EXCEPT_ANYNAME", - "RNGP_PAT_NSNAME_EXCEPT_NSNAME", - "RNGP_PAT_ONEMORE_GROUP_ATTR", - "RNGP_PAT_ONEMORE_INTERLEAVE_ATTR", - "RNGP_PAT_START_ATTR", - "RNGP_PAT_START_DATA", - "RNGP_PAT_START_EMPTY", - "RNGP_PAT_START_GROUP", - "RNGP_PAT_START_INTERLEAVE", - "RNGP_PAT_START_LIST", - "RNGP_PAT_START_ONEMORE", - "RNGP_PAT_START_TEXT", - "RNGP_PAT_START_VALUE", - "RNGP_PREFIX_UNDEFINED", - "RNGP_REF_CREATE_FAILED", - "RNGP_REF_CYCLE", - "RNGP_REF_NAME_INVALID", - "RNGP_REF_NO_DEF", - "RNGP_REF_NO_NAME", - "RNGP_REF_NOT_EMPTY", - "RNGP_START_CHOICE_AND_INTERLEAVE", - "RNGP_START_CONTENT", - "RNGP_START_EMPTY", - "RNGP_START_MISSING", - "RNGP_TEXT_EXPECTED", - "RNGP_TEXT_HAS_CHILD", - "RNGP_TYPE_MISSING", - "RNGP_TYPE_NOT_FOUND", - "RNGP_TYPE_VALUE", - "RNGP_UNKNOWN_ATTRIBUTE", - "RNGP_UNKNOWN_COMBINE", - "RNGP_UNKNOWN_CONSTRUCT", - "RNGP_UNKNOWN_TYPE_LIB", - "RNGP_URI_FRAGMENT", - "RNGP_URI_NOT_ABSOLUTE", - "RNGP_VALUE_EMPTY", - "RNGP_VALUE_NO_CONTENT", - "RNGP_XMLNS_NAME", - "RNGP_XML_NS", - "XPATH_EXPRESSION_OK", - "XPATH_NUMBER_ERROR", - "XPATH_UNFINISHED_LITERAL_ERROR", - "XPATH_START_LITERAL_ERROR", - "XPATH_VARIABLE_REF_ERROR", - "XPATH_UNDEF_VARIABLE_ERROR", - "XPATH_INVALID_PREDICATE_ERROR", - "XPATH_EXPR_ERROR", - "XPATH_UNCLOSED_ERROR", - "XPATH_UNKNOWN_FUNC_ERROR", - "XPATH_INVALID_OPERAND", - "XPATH_INVALID_TYPE", - "XPATH_INVALID_ARITY", - "XPATH_INVALID_CTXT_SIZE", - "XPATH_INVALID_CTXT_POSITION", - "XPATH_MEMORY_ERROR", - "XPTR_SYNTAX_ERROR", - "XPTR_RESOURCE_ERROR", - "XPTR_SUB_RESOURCE_ERROR", - "XPATH_UNDEF_PREFIX_ERROR", - "XPATH_ENCODING_ERROR", - "XPATH_INVALID_CHAR_ERROR", - "TREE_INVALID_HEX", - "TREE_INVALID_DEC", - "TREE_UNTERMINATED_ENTITY", - "SAVE_NOT_UTF8", - "SAVE_CHAR_INVALID", - "SAVE_NO_DOCTYPE", - "SAVE_UNKNOWN_ENCODING", - "REGEXP_COMPILE_ERROR", - "IO_UNKNOWN", - "IO_EACCES", - "IO_EAGAIN", - "IO_EBADF", - "IO_EBADMSG", - "IO_EBUSY", - "IO_ECANCELED", - "IO_ECHILD", - "IO_EDEADLK", - "IO_EDOM", - "IO_EEXIST", - "IO_EFAULT", - "IO_EFBIG", - "IO_EINPROGRESS", - "IO_EINTR", - "IO_EINVAL", - "IO_EIO", - "IO_EISDIR", - "IO_EMFILE", - "IO_EMLINK", - "IO_EMSGSIZE", - "IO_ENAMETOOLONG", - "IO_ENFILE", - "IO_ENODEV", - "IO_ENOENT", - "IO_ENOEXEC", - "IO_ENOLCK", - "IO_ENOMEM", - "IO_ENOSPC", - "IO_ENOSYS", - "IO_ENOTDIR", - "IO_ENOTEMPTY", - "IO_ENOTSUP", - "IO_ENOTTY", - "IO_ENXIO", - "IO_EPERM", - "IO_EPIPE", - "IO_ERANGE", - "IO_EROFS", - "IO_ESPIPE", - "IO_ESRCH", - "IO_ETIMEDOUT", - "IO_EXDEV", - "IO_NETWORK_ATTEMPT", - "IO_ENCODER", - "IO_FLUSH", - "IO_WRITE", - "IO_NO_INPUT", - "IO_BUFFER_FULL", - "IO_LOAD_ERROR", - "IO_ENOTSOCK", - "IO_EISCONN", - "IO_ECONNREFUSED", - "IO_ENETUNREACH", - "IO_EADDRINUSE", - "IO_EALREADY", - "IO_EAFNOSUPPORT", - "XINCLUDE_RECURSION", - "XINCLUDE_PARSE_VALUE", - "XINCLUDE_ENTITY_DEF_MISMATCH", - "XINCLUDE_NO_HREF", - "XINCLUDE_NO_FALLBACK", - "XINCLUDE_HREF_URI", - "XINCLUDE_TEXT_FRAGMENT", - "XINCLUDE_TEXT_DOCUMENT", - "XINCLUDE_INVALID_CHAR", - "XINCLUDE_BUILD_FAILED", - "XINCLUDE_UNKNOWN_ENCODING", - "XINCLUDE_MULTIPLE_ROOT", - "XINCLUDE_XPTR_FAILED", - "XINCLUDE_XPTR_RESULT", - "XINCLUDE_INCLUDE_IN_INCLUDE", - "XINCLUDE_FALLBACKS_IN_INCLUDE", - "XINCLUDE_FALLBACK_NOT_IN_INCLUDE", - "XINCLUDE_DEPRECATED_NS", - "XINCLUDE_FRAGMENT_ID", - "CATALOG_MISSING_ATTR", - "CATALOG_ENTRY_BROKEN", - "CATALOG_PREFER_VALUE", - "CATALOG_NOT_CATALOG", - "CATALOG_RECURSION", - "SCHEMAP_PREFIX_UNDEFINED", - "SCHEMAP_ATTRFORMDEFAULT_VALUE", - "SCHEMAP_ATTRGRP_NONAME_NOREF", - "SCHEMAP_ATTR_NONAME_NOREF", - "SCHEMAP_COMPLEXTYPE_NONAME_NOREF", - "SCHEMAP_ELEMFORMDEFAULT_VALUE", - "SCHEMAP_ELEM_NONAME_NOREF", - "SCHEMAP_EXTENSION_NO_BASE", - "SCHEMAP_FACET_NO_VALUE", - "SCHEMAP_FAILED_BUILD_IMPORT", - "SCHEMAP_GROUP_NONAME_NOREF", - "SCHEMAP_IMPORT_NAMESPACE_NOT_URI", - "SCHEMAP_IMPORT_REDEFINE_NSNAME", - "SCHEMAP_IMPORT_SCHEMA_NOT_URI", - "SCHEMAP_INVALID_BOOLEAN", - "SCHEMAP_INVALID_ENUM", - "SCHEMAP_INVALID_FACET", - "SCHEMAP_INVALID_FACET_VALUE", - "SCHEMAP_INVALID_MAXOCCURS", - "SCHEMAP_INVALID_MINOCCURS", - "SCHEMAP_INVALID_REF_AND_SUBTYPE", - "SCHEMAP_INVALID_WHITE_SPACE", - "SCHEMAP_NOATTR_NOREF", - "SCHEMAP_NOTATION_NO_NAME", - "SCHEMAP_NOTYPE_NOREF", - "SCHEMAP_REF_AND_SUBTYPE", - "SCHEMAP_RESTRICTION_NONAME_NOREF", - "SCHEMAP_SIMPLETYPE_NONAME", - "SCHEMAP_TYPE_AND_SUBTYPE", - "SCHEMAP_UNKNOWN_ALL_CHILD", - "SCHEMAP_UNKNOWN_ANYATTRIBUTE_CHILD", - "SCHEMAP_UNKNOWN_ATTR_CHILD", - "SCHEMAP_UNKNOWN_ATTRGRP_CHILD", - "SCHEMAP_UNKNOWN_ATTRIBUTE_GROUP", - "SCHEMAP_UNKNOWN_BASE_TYPE", - "SCHEMAP_UNKNOWN_CHOICE_CHILD", - "SCHEMAP_UNKNOWN_COMPLEXCONTENT_CHILD", - "SCHEMAP_UNKNOWN_COMPLEXTYPE_CHILD", - "SCHEMAP_UNKNOWN_ELEM_CHILD", - "SCHEMAP_UNKNOWN_EXTENSION_CHILD", - "SCHEMAP_UNKNOWN_FACET_CHILD", - "SCHEMAP_UNKNOWN_FACET_TYPE", - "SCHEMAP_UNKNOWN_GROUP_CHILD", - "SCHEMAP_UNKNOWN_IMPORT_CHILD", - "SCHEMAP_UNKNOWN_LIST_CHILD", - "SCHEMAP_UNKNOWN_NOTATION_CHILD", - "SCHEMAP_UNKNOWN_PROCESSCONTENT_CHILD", - "SCHEMAP_UNKNOWN_REF", - "SCHEMAP_UNKNOWN_RESTRICTION_CHILD", - "SCHEMAP_UNKNOWN_SCHEMAS_CHILD", - "SCHEMAP_UNKNOWN_SEQUENCE_CHILD", - "SCHEMAP_UNKNOWN_SIMPLECONTENT_CHILD", - "SCHEMAP_UNKNOWN_SIMPLETYPE_CHILD", - "SCHEMAP_UNKNOWN_TYPE", - "SCHEMAP_UNKNOWN_UNION_CHILD", - "SCHEMAP_ELEM_DEFAULT_FIXED", - "SCHEMAP_REGEXP_INVALID", - "SCHEMAP_FAILED_LOAD", - "SCHEMAP_NOTHING_TO_PARSE", - "SCHEMAP_NOROOT", - "SCHEMAP_REDEFINED_GROUP", - "SCHEMAP_REDEFINED_TYPE", - "SCHEMAP_REDEFINED_ELEMENT", - "SCHEMAP_REDEFINED_ATTRGROUP", - "SCHEMAP_REDEFINED_ATTR", - "SCHEMAP_REDEFINED_NOTATION", - "SCHEMAP_FAILED_PARSE", - "SCHEMAP_UNKNOWN_PREFIX", - "SCHEMAP_DEF_AND_PREFIX", - "SCHEMAP_UNKNOWN_INCLUDE_CHILD", - "SCHEMAP_INCLUDE_SCHEMA_NOT_URI", - "SCHEMAP_INCLUDE_SCHEMA_NO_URI", - "SCHEMAP_NOT_SCHEMA", - "SCHEMAP_UNKNOWN_MEMBER_TYPE", - "SCHEMAP_INVALID_ATTR_USE", - "SCHEMAP_RECURSIVE", - "SCHEMAP_SUPERNUMEROUS_LIST_ITEM_TYPE", - "SCHEMAP_INVALID_ATTR_COMBINATION", - "SCHEMAP_INVALID_ATTR_INLINE_COMBINATION", - "SCHEMAP_MISSING_SIMPLETYPE_CHILD", - "SCHEMAP_INVALID_ATTR_NAME", - "SCHEMAP_REF_AND_CONTENT", - "SCHEMAP_CT_PROPS_CORRECT_1", - "SCHEMAP_CT_PROPS_CORRECT_2", - "SCHEMAP_CT_PROPS_CORRECT_3", - "SCHEMAP_CT_PROPS_CORRECT_4", - "SCHEMAP_CT_PROPS_CORRECT_5", - "SCHEMAP_DERIVATION_OK_RESTRICTION_1", - "SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1", - "SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2", - "SCHEMAP_DERIVATION_OK_RESTRICTION_2_2", - "SCHEMAP_DERIVATION_OK_RESTRICTION_3", - "SCHEMAP_WILDCARD_INVALID_NS_MEMBER", - "SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE", - "SCHEMAP_UNION_NOT_EXPRESSIBLE", - "SCHEMAP_SRC_IMPORT_3_1", - "SCHEMAP_SRC_IMPORT_3_2", - "SCHEMAP_DERIVATION_OK_RESTRICTION_4_1", - "SCHEMAP_DERIVATION_OK_RESTRICTION_4_2", - "SCHEMAP_DERIVATION_OK_RESTRICTION_4_3", - "SCHEMAP_COS_CT_EXTENDS_1_3", - "SCHEMAV_NOROOT", - "SCHEMAV_UNDECLAREDELEM", - "SCHEMAV_NOTTOPLEVEL", - "SCHEMAV_MISSING", - "SCHEMAV_WRONGELEM", - "SCHEMAV_NOTYPE", - "SCHEMAV_NOROLLBACK", - "SCHEMAV_ISABSTRACT", - "SCHEMAV_NOTEMPTY", - "SCHEMAV_ELEMCONT", - "SCHEMAV_HAVEDEFAULT", - "SCHEMAV_NOTNILLABLE", - "SCHEMAV_EXTRACONTENT", - "SCHEMAV_INVALIDATTR", - "SCHEMAV_INVALIDELEM", - "SCHEMAV_NOTDETERMINIST", - "SCHEMAV_CONSTRUCT", - "SCHEMAV_INTERNAL", - "SCHEMAV_NOTSIMPLE", - "SCHEMAV_ATTRUNKNOWN", - "SCHEMAV_ATTRINVALID", - "SCHEMAV_VALUE", - "SCHEMAV_FACET", - "SCHEMAV_CVC_DATATYPE_VALID_1_2_1", - "SCHEMAV_CVC_DATATYPE_VALID_1_2_2", - "SCHEMAV_CVC_DATATYPE_VALID_1_2_3", - "SCHEMAV_CVC_TYPE_3_1_1", - "SCHEMAV_CVC_TYPE_3_1_2", - "SCHEMAV_CVC_FACET_VALID", - "SCHEMAV_CVC_LENGTH_VALID", - "SCHEMAV_CVC_MINLENGTH_VALID", - "SCHEMAV_CVC_MAXLENGTH_VALID", - "SCHEMAV_CVC_MININCLUSIVE_VALID", - "SCHEMAV_CVC_MAXINCLUSIVE_VALID", - "SCHEMAV_CVC_MINEXCLUSIVE_VALID", - "SCHEMAV_CVC_MAXEXCLUSIVE_VALID", - "SCHEMAV_CVC_TOTALDIGITS_VALID", - "SCHEMAV_CVC_FRACTIONDIGITS_VALID", - "SCHEMAV_CVC_PATTERN_VALID", - "SCHEMAV_CVC_ENUMERATION_VALID", - "SCHEMAV_CVC_COMPLEX_TYPE_2_1", - "SCHEMAV_CVC_COMPLEX_TYPE_2_2", - "SCHEMAV_CVC_COMPLEX_TYPE_2_3", - "SCHEMAV_CVC_COMPLEX_TYPE_2_4", - -#if defined XML_SCHEMAV_CVC_ELT_1 - "SCHEMAV_CVC_ELT_1", - "SCHEMAV_CVC_ELT_2", - "SCHEMAV_CVC_ELT_3_1", - "SCHEMAV_CVC_ELT_3_2_1", - "SCHEMAV_CVC_ELT_3_2_2", - "SCHEMAV_CVC_ELT_4_1", - "SCHEMAV_CVC_ELT_4_2", - "SCHEMAV_CVC_ELT_4_3", - "SCHEMAV_CVC_ELT_5_1_1", - "SCHEMAV_CVC_ELT_5_1_2", - "SCHEMAV_CVC_ELT_5_2_1", - "SCHEMAV_CVC_ELT_5_2_2_1", - "SCHEMAV_CVC_ELT_5_2_2_2_1", - "SCHEMAV_CVC_ELT_5_2_2_2_2", - "SCHEMAV_CVC_ELT_6", - "SCHEMAV_CVC_ELT_7", - "SCHEMAV_CVC_ATTRIBUTE_1", - "SCHEMAV_CVC_ATTRIBUTE_2", - "SCHEMAV_CVC_ATTRIBUTE_3", - "SCHEMAV_CVC_ATTRIBUTE_4", - "SCHEMAV_CVC_COMPLEX_TYPE_3_1", - "SCHEMAV_CVC_COMPLEX_TYPE_3_2_1", - "SCHEMAV_CVC_COMPLEX_TYPE_3_2_2", - "SCHEMAV_CVC_COMPLEX_TYPE_4", - "SCHEMAV_CVC_COMPLEX_TYPE_5_1", - "SCHEMAV_CVC_COMPLEX_TYPE_5_2", - "SCHEMAV_ELEMENT_CONTENT", - "SCHEMAV_DOCUMENT_ELEMENT_MISSING", -#endif - -#if defined XML_SCHEMAV_CVC_COMPLEX_TYPE_1 - "SCHEMAV_CVC_COMPLEX_TYPE_1", - "SCHEMAV_CVC_AU", - "SCHEMAV_CVC_TYPE_1", - "SCHEMAV_CVC_TYPE_2", -#endif - - "XPTR_UNKNOWN_SCHEME", - "XPTR_CHILDSEQ_START", - "XPTR_EVAL_FAILED", - "XPTR_EXTRA_OBJECTS", - "C14N_CREATE_CTXT", - "C14N_REQUIRES_UTF8", - "C14N_CREATE_STACK", - "C14N_INVALID_NODE", - "FTP_PASV_ANSWER", - "FTP_EPSV_ANSWER", - "FTP_ACCNT", - "HTTP_URL_SYNTAX", - "HTTP_USE_IP", - "HTTP_UNKNOWN_HOST", - "SCHEMAP_SRC_SIMPLE_TYPE_1", - "SCHEMAP_SRC_SIMPLE_TYPE_2", - "SCHEMAP_SRC_SIMPLE_TYPE_3", - "SCHEMAP_SRC_SIMPLE_TYPE_4", - "SCHEMAP_SRC_RESOLVE", - "SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE", - "SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE", - "SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES", - "SCHEMAP_ST_PROPS_CORRECT_1", - "SCHEMAP_ST_PROPS_CORRECT_2", - "SCHEMAP_ST_PROPS_CORRECT_3", - "SCHEMAP_COS_ST_RESTRICTS_1_1", - "SCHEMAP_COS_ST_RESTRICTS_1_2", - "SCHEMAP_COS_ST_RESTRICTS_1_3_1", - "SCHEMAP_COS_ST_RESTRICTS_1_3_2", - "SCHEMAP_COS_ST_RESTRICTS_2_1", - "SCHEMAP_COS_ST_RESTRICTS_2_3_1_1", - "SCHEMAP_COS_ST_RESTRICTS_2_3_1_2", - "SCHEMAP_COS_ST_RESTRICTS_2_3_2_1", - "SCHEMAP_COS_ST_RESTRICTS_2_3_2_2", - "SCHEMAP_COS_ST_RESTRICTS_2_3_2_3", - "SCHEMAP_COS_ST_RESTRICTS_2_3_2_4", - "SCHEMAP_COS_ST_RESTRICTS_2_3_2_5", - "SCHEMAP_COS_ST_RESTRICTS_3_1", - "SCHEMAP_COS_ST_RESTRICTS_3_3_1", - "SCHEMAP_COS_ST_RESTRICTS_3_3_1_2", - "SCHEMAP_COS_ST_RESTRICTS_3_3_2_2", - "SCHEMAP_COS_ST_RESTRICTS_3_3_2_1", - "SCHEMAP_COS_ST_RESTRICTS_3_3_2_3", - "SCHEMAP_COS_ST_RESTRICTS_3_3_2_4", - "SCHEMAP_COS_ST_RESTRICTS_3_3_2_5", - "SCHEMAP_COS_ST_DERIVED_OK_2_1", - "SCHEMAP_COS_ST_DERIVED_OK_2_2", - "SCHEMAP_S4S_ELEM_NOT_ALLOWED", - "SCHEMAP_S4S_ELEM_MISSING", - "SCHEMAP_S4S_ATTR_NOT_ALLOWED", - "SCHEMAP_S4S_ATTR_MISSING", - -#if defined XML_SCHEMAP_S4S_ATTR_INVALID_VALUE - "SCHEMAP_S4S_ATTR_INVALID_VALUE", - "SCHEMAP_SRC_ELEMENT_1", - "SCHEMAP_SRC_ELEMENT_2_1", - "SCHEMAP_SRC_ELEMENT_2_2", - "SCHEMAP_SRC_ELEMENT_3", - "SCHEMAP_P_PROPS_CORRECT_1", - "SCHEMAP_P_PROPS_CORRECT_2_1", - "SCHEMAP_P_PROPS_CORRECT_2_2", - "SCHEMAP_E_PROPS_CORRECT_2", - "SCHEMAP_E_PROPS_CORRECT_3", - "SCHEMAP_E_PROPS_CORRECT_4", - "SCHEMAP_E_PROPS_CORRECT_5", - "SCHEMAP_E_PROPS_CORRECT_6", - "SCHEMAP_SRC_INCLUDE", - "SCHEMAP_SRC_ATTRIBUTE_1", - "SCHEMAP_SRC_ATTRIBUTE_2", - "SCHEMAP_SRC_ATTRIBUTE_3_1", - "SCHEMAP_SRC_ATTRIBUTE_3_2", - "SCHEMAP_SRC_ATTRIBUTE_4", - "SCHEMAP_NO_XMLNS", - "SCHEMAP_NO_XSI", - "SCHEMAP_COS_VALID_DEFAULT_1", - "SCHEMAP_COS_VALID_DEFAULT_2_1", - "SCHEMAP_COS_VALID_DEFAULT_2_2_1", - "SCHEMAP_COS_VALID_DEFAULT_2_2_2", - "SCHEMAP_CVC_SIMPLE_TYPE", - "SCHEMAP_COS_CT_EXTENDS_1_1", - "SCHEMAP_SRC_IMPORT_1_1", - "SCHEMAP_SRC_IMPORT_1_2", - "SCHEMAP_SRC_IMPORT_2", - "SCHEMAP_SRC_IMPORT_2_1", - "SCHEMAP_SRC_IMPORT_2_2", -#endif - -#if defined XML_SCHEMAP_INTERNAL - "SCHEMAP_INTERNAL", - "SCHEMAP_NOT_DETERMINISTIC", -#endif - -#if defined XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_1 - "SCHEMAP_SRC_ATTRIBUTE_GROUP_1", - "SCHEMAP_SRC_ATTRIBUTE_GROUP_2", - "SCHEMAP_SRC_ATTRIBUTE_GROUP_3", - "SCHEMAP_MG_PROPS_CORRECT_1", - "SCHEMAP_MG_PROPS_CORRECT_2", - "SCHEMAP_SRC_CT_1", - "SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3", - "SCHEMAP_AU_PROPS_CORRECT_2", - "SCHEMAP_A_PROPS_CORRECT_2", -#endif - NULL -}; - -const char* SaxHandler::errToStr( int errVal ) -{ - const char* str = NULL; - int index = 0; - while ( errVal != xmlErrorVals[index] && xmlErrorVals[index] >= 0 ) - { - index++; - } - - if ( errVal == xmlErrorVals[index] ) - { - str = xmlErrorStrs[index]; - } - - return str; -} - - -int SaxHandler::parseMemory( const char* buffer, int size ) -{ - int result = xmlSAXUserParseMemory( &sax, - this, - buffer, - size ); - return result; -} - -int SaxHandler::parseFile( const char* filename ) -{ - int result = xmlSAXUserParseFile( &sax, - this, - filename ); - return result; -} - -void SaxHandler::startDocument(void *user_data) -{ - SaxHandler* self = reinterpret_cast(user_data); - self->_startDocument(); -} - -void SaxHandler::endDocument(void *user_data) -{ - SaxHandler* self = reinterpret_cast(user_data); - self->_endDocument(); -} -void SaxHandler::startElement(void *user_data, - const xmlChar *name, - const xmlChar **attrs) -{ - SaxHandler* self = reinterpret_cast(user_data); - self->_startElement(name, attrs); -} -void SaxHandler::endElement(void *user_data, - const xmlChar *name) -{ - SaxHandler* self = reinterpret_cast(user_data); - self->_endElement(name); -} -void SaxHandler::characters(void *user_data, - const xmlChar *ch, - int len) -{ - SaxHandler* self = reinterpret_cast(user_data); - self->_characters(ch, len); -} - - - - - - - -FlatSaxHandler::FlatSaxHandler() - : SaxHandler() -{ -} - -FlatSaxHandler::~FlatSaxHandler() -{ -} - -void FlatSaxHandler::_startElement(const xmlChar */*name*/, const xmlChar **/*attrs*/) -{ - data.clear(); -} - -void FlatSaxHandler::_endElement(const xmlChar */*name*/) -{ - //g_message("<%s>%s", name, data.c_str(), name); - data.clear(); -} - -void FlatSaxHandler::_characters(const xmlChar *ch, int len) -{ - data.append((const char*)ch, len); -} - - -} // namespace IO -} // namespace Inkscape - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/io/simple-sax.h b/src/io/simple-sax.h deleted file mode 100644 index 17c571e19..000000000 --- a/src/io/simple-sax.h +++ /dev/null @@ -1,97 +0,0 @@ -#ifndef SEEN_SIMPLE_SAX_H -#define SEEN_SIMPLE_SAX_H - -/* - * SimpleSAX - * - * Authors: - * Jon A. Cruz - * - * Copyright (C) 2004 AUTHORS - * - * Released under GNU GPL, read the file 'COPYING' for more information - */ - -#include -#include - -namespace Inkscape { -namespace IO -{ - -class SaxHandler -{ -public: - SaxHandler(); - virtual ~SaxHandler(); - - int parseMemory( const char* buffer, int size ); - int parseFile( const char* filename ); - - static const char* errToStr( int errVal ); - -protected: - virtual void _startDocument() {} - virtual void _endDocument() {} - virtual void _startElement(const xmlChar */*name*/, const xmlChar **/*attrs*/) {} - virtual void _endElement(const xmlChar */*name*/) {} - virtual void _characters(const xmlChar */*ch*/, int /*len*/) {} - -private: - static void startDocument(void *user_data); - static void endDocument(void *user_data); - static void startElement(void *user_data, - const xmlChar *name, - const xmlChar **attrs); - static void endElement(void *user_data, - const xmlChar *name); - static void characters(void * user_data, - const xmlChar *ch, - int len); - - // Disable: - SaxHandler(SaxHandler const &); - SaxHandler &operator=(SaxHandler const &); - - xmlSAXHandler sax; -}; - - - -class FlatSaxHandler : public SaxHandler -{ -public: - FlatSaxHandler(); - virtual ~FlatSaxHandler(); - -protected: - virtual void _startElement(const xmlChar *name, const xmlChar **attrs); - virtual void _endElement(const xmlChar *name); - virtual void _characters(const xmlChar *ch, int len); - - Glib::ustring data; - -private: - // Disable: - FlatSaxHandler(FlatSaxHandler const &); - FlatSaxHandler &operator=(FlatSaxHandler const &); -}; - - - -} // namespace IO -} // namespace Inkscape - - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : - -#endif // SEEN_SIMPLE_SAX_H diff --git a/src/util/units.cpp b/src/util/units.cpp index d1275b082..757d05ffe 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -5,8 +5,9 @@ #include #include #include +#include +#include -#include "io/simple-sax.h" #include "util/units.h" #include "path-prefix.h" #include "streq.h" @@ -47,27 +48,33 @@ std::map &getTypeMappings() namespace Inkscape { namespace Util { -class UnitsSAXHandler : public Inkscape::IO::FlatSaxHandler +class UnitParser : public Glib::Markup::Parser { public: - UnitsSAXHandler(UnitTable *table); - virtual ~UnitsSAXHandler() {} + typedef Glib::Markup::Parser::AttributeMap AttrMap; + typedef Glib::Markup::ParseContext Ctx; - virtual void _startElement(xmlChar const *name, xmlChar const **attrs); - virtual void _endElement(xmlChar const *name); + UnitParser(UnitTable *table); + virtual ~UnitParser() {} +protected: + virtual void on_start_element(Ctx &ctx, Glib::ustring const &name, AttrMap const &attrs); + virtual void on_end_element(Ctx &ctx, Glib::ustring const &name); + virtual void on_text(Ctx &ctx, Glib::ustring const &text); + + Glib::ustring _current_element; + +public: UnitTable *tbl; bool primary; bool skip; Unit unit; }; -UnitsSAXHandler::UnitsSAXHandler(UnitTable *table) : - FlatSaxHandler(), +UnitParser::UnitParser(UnitTable *table) : tbl(table), - primary(0), - skip(0), - unit() + primary(false), + skip(false) { } @@ -115,10 +122,8 @@ int Unit::defaultDigits() const { UnitTable::UnitTable() { - // if we swich to the xml file, don't forget to force locale to 'C' - // load("share/ui/units.xml"); // <-- Buggy - gchar *filename = g_build_filename(INKSCAPE_UIDIR, "units.txt", NULL); - loadText(filename); + gchar *filename = g_build_filename(INKSCAPE_UIDIR, "units.xml", NULL); + load(filename); g_free(filename); } @@ -183,165 +188,73 @@ Glib::ustring UnitTable::primary(UnitType type) const return _primary_unit[type]; } -bool UnitTable::loadText(Glib::ustring const &filename) -{ - char buf[BUFSIZE] = {0}; - - // Open file for reading - FILE * f = fopen(filename.c_str(), "r"); - if (f == NULL) { - g_warning("Could not open units file '%s': %s\n", - filename.c_str(), strerror(errno)); - g_warning("* INKSCAPE_DATADIR is: '%s'\n", INKSCAPE_DATADIR); - g_warning("* INKSCAPE_UIDIR is: '%s'\n", INKSCAPE_UIDIR); - return false; - } - - /** @todo fix this to use C++ means and explicit locale to avoid need to change. */ - // bypass current locale in order to make - // sscanf read floats with '.' as a separator - // set locale to 'C' and keep old locale - char *old_locale = g_strdup(setlocale(LC_NUMERIC, NULL)); - setlocale (LC_NUMERIC, "C"); - - while (fgets(buf, BUFSIZE, f) != NULL) { - char name[BUFSIZE] = {0}; - char plural[BUFSIZE] = {0}; - char abbr[BUFSIZE] = {0}; - char type[BUFSIZE] = {0}; - double factor = 0.0; - char primary[BUFSIZE] = {0}; - - int nchars = 0; - // locale is set to C, scanning %lf should work _everywhere_ - /** @todo address %15n, which causes a warning: */ - if (sscanf(buf, "%15s %15s %15s %15s %8lf %1s %15n", - name, plural, abbr, type, &factor, primary, &nchars) != 6) - { - // Skip the line - doesn't appear to be valid - continue; - } - - g_assert(nchars < BUFSIZE); - - char *desc = buf; - desc += nchars; // buf is now only the description - - // insert into _unit_map - if (getTypeMappings().find(type) == getTypeMappings().end()) - { - g_warning("Skipping unknown unit type '%s' for %s.\n", type, name); - continue; - } - UnitType utype = getTypeMappings()[type]; - - Unit u(utype, factor, name, plural, abbr, desc); - - // if primary is 'Y', list this unit as a primary - addUnit(u, (primary[0]=='Y' || primary[0]=='y')); - } - - // set back the saved locale - setlocale (LC_NUMERIC, old_locale); - g_free (old_locale); - - // close file - if (fclose(f) != 0) { - g_warning("Error closing units file '%s': %s\n", filename.c_str(), strerror(errno)); - return false; - } - - return true; -} - -bool UnitTable::load(Glib::ustring const &filename) { - UnitsSAXHandler handler(this); +bool UnitTable::load(std::string const &filename) { + UnitParser uparser(this); + Glib::Markup::ParseContext ctx(uparser); - int result = handler.parseFile( filename.c_str() ); - if ( result != 0 ) { - // perhaps - g_warning("Problem loading units file '%s': %d\n", filename.c_str(), result); + try { + Glib::ustring unitfile = Glib::file_get_contents(filename); + ctx.parse(unitfile); + ctx.end_parse(); + } catch (Glib::MarkupError const &e) { + g_warning("Problem loading units file '%s': %s\n", filename.c_str(), e.what().c_str()); return false; } - return true; } -bool UnitTable::save(Glib::ustring const &filename) { - - // open file for writing - FILE *f = fopen(filename.c_str(), "w"); - if (f == NULL) { - g_warning("Could not open units file '%s': %s\n", filename.c_str(), strerror(errno)); - return false; - } +bool UnitTable::save(std::string const &filename) { - // write out header - // foreach item in _unit_map, sorted alphabetically by type and then unit name - // sprintf a line - // name - // name_plural - // abbr - // type - // factor - // PRI - if listed in primary unit table, 'Y', else 'N' - // description - // write line to the file - - // close file - if (fclose(f) != 0) { - g_warning("Error closing units file '%s': %s\n", filename.c_str(), strerror(errno)); - return false; - } + g_warning("UnitTable::save(): not implemented"); return true; } - -void UnitsSAXHandler::_startElement(xmlChar const *name, xmlChar const **attrs) +void UnitParser::on_start_element(Ctx &ctx, Glib::ustring const &name, AttrMap const &attrs) { - if (streq("unit", (char const *)name)) { + _current_element = name; + if (name == "unit") { // reset for next use unit.clear(); primary = false; skip = false; - for ( int i = 0; attrs[i]; i += 2 ) { - char const *const key = (char const *)attrs[i]; - if (streq("type", key)) { - char const *type = (char const*)attrs[i+1]; - if (getTypeMappings().find(type) != getTypeMappings().end()) - { - unit.type = getTypeMappings()[type]; - } else { - g_warning("Skipping unknown unit type '%s' for %s.\n", type, name); - skip = true; - } - } else if (streq("pri", key)) { - primary = attrs[i+1][0] == 'y' || attrs[i+1][0] == 'Y'; + AttrMap::const_iterator f; + if ((f = attrs.find("type")) != attrs.end()) { + Glib::ustring type = f->second; + if (getTypeMappings().find(type) != getTypeMappings().end()) { + unit.type = getTypeMappings()[type]; + } else { + g_warning("Skipping unknown unit type '%s'.\n", type.c_str()); + skip = true; } } + if ((f = attrs.find("pri")) != attrs.end()) { + primary = (f->second[0] == 'y' || f->second[0] == 'Y'); + } } } -void UnitsSAXHandler::_endElement(xmlChar const *xname) +void UnitParser::on_text(Ctx &ctx, Glib::ustring const &text) { - char const *const name = (char const *) xname; - if (streq("name", name)) { - unit.name = data; - } else if (streq("plural", name)) { - unit.name_plural = data; - } else if (streq("abbr", name)) { - unit.abbr = data; - } else if (streq("factor", name)) { + if (_current_element == "name") { + unit.name = text; + } else if (_current_element == "plural") { + unit.name_plural = text; + } else if (_current_element == "abbr") { + unit.abbr = text; + } else if (_current_element == "factor") { // TODO make sure we use the right conversion - unit.factor = atol(data.c_str()); - } else if (streq("description", name)) { - unit.description = data; - } else if (streq("unit", name)) { - if (!skip) { - tbl->addUnit(unit, primary); - } + unit.factor = g_ascii_strtod(text.c_str(), NULL); + } else if (_current_element == "description") { + unit.description = text; + } +} + +void UnitParser::on_end_element(Ctx &ctx, Glib::ustring const &name) +{ + if (name == "unit" && !skip) { + tbl->addUnit(unit, primary); } } diff --git a/src/util/units.h b/src/util/units.h index 40c89a4a0..4b2d782e3 100644 --- a/src/util/units.h +++ b/src/util/units.h @@ -96,19 +96,17 @@ class UnitTable { void setScale(); - bool load(Glib::ustring const &filename); - - /** Loads units from a text file. + /** Load units from an XML file. * - * loadText loads and merges the contents of the given file into the UnitTable, + * Loads and merges the contents of the given file into the UnitTable, * possibly overwriting existing unit definitions. * * @param filename file to be loaded */ - bool loadText(Glib::ustring const &filename); + bool load(std::string const &filename); /** Saves the current UnitTable to the given file. */ - bool save(Glib::ustring const &filename); + bool save(std::string const &filename); protected: UnitTable::UnitMap _unit_map; -- cgit v1.2.3 From 13da86a85b5366284166ec5b0f1ae84de30de182 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Thu, 25 Jul 2013 00:29:24 +0200 Subject: Remove unnecessary variable from the GMarkup-based unit parser (bzr r12439) --- src/util/units.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/util/units.cpp b/src/util/units.cpp index 757d05ffe..f8ebc5c1a 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -62,8 +62,6 @@ protected: virtual void on_end_element(Ctx &ctx, Glib::ustring const &name); virtual void on_text(Ctx &ctx, Glib::ustring const &text); - Glib::ustring _current_element; - public: UnitTable *tbl; bool primary; @@ -212,7 +210,6 @@ bool UnitTable::save(std::string const &filename) { void UnitParser::on_start_element(Ctx &ctx, Glib::ustring const &name, AttrMap const &attrs) { - _current_element = name; if (name == "unit") { // reset for next use unit.clear(); @@ -237,16 +234,17 @@ void UnitParser::on_start_element(Ctx &ctx, Glib::ustring const &name, AttrMap c void UnitParser::on_text(Ctx &ctx, Glib::ustring const &text) { - if (_current_element == "name") { + Glib::ustring element = ctx.get_element(); + if (element == "name") { unit.name = text; - } else if (_current_element == "plural") { + } else if (element == "plural") { unit.name_plural = text; - } else if (_current_element == "abbr") { + } else if (element == "abbr") { unit.abbr = text; - } else if (_current_element == "factor") { + } else if (element == "factor") { // TODO make sure we use the right conversion unit.factor = g_ascii_strtod(text.c_str(), NULL); - } else if (_current_element == "description") { + } else if (element == "description") { unit.description = text; } } -- cgit v1.2.3 From 6967bad3f32f3cf9e660f6009be63adf62f94058 Mon Sep 17 00:00:00 2001 From: Slagvi Public Date: Sat, 27 Jul 2013 22:14:29 +0200 Subject: Templates related bug fixes (bzr r12379.2.15) --- src/ui/dialog/template-load-tab.cpp | 10 +++++++++- src/ui/dialog/template-widget.cpp | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/template-load-tab.cpp b/src/ui/dialog/template-load-tab.cpp index 65d5e6447..d993e0233 100644 --- a/src/ui/dialog/template-load-tab.cpp +++ b/src/ui/dialog/template-load-tab.cpp @@ -191,9 +191,17 @@ TemplateLoadTab::TemplateData TemplateLoadTab::_processTemplateFile(const Glib:: { TemplateData result; result.path = path; - result.display_name = Glib::path_get_basename(path); result.is_procedural = false; + // convert path into valid template name + result.display_name = Glib::path_get_basename(path); + gsize n = 0; + while ((n = result.display_name.find_first_of("_", 0)) < Glib::ustring::npos){ + result.display_name.replace(n, 1, 1, ' '); + } + n = result.display_name.rfind(".svg"); + result.display_name.replace(n, 4, 1, ' '); + Inkscape::XML::Document *rdoc; rdoc = sp_repr_read_file(path.data(), SP_SVG_NS_URI); Inkscape::XML::Node *myRoot; diff --git a/src/ui/dialog/template-widget.cpp b/src/ui/dialog/template-widget.cpp index 56346403e..1efa790ab 100644 --- a/src/ui/dialog/template-widget.cpp +++ b/src/ui/dialog/template-widget.cpp @@ -58,7 +58,7 @@ void TemplateWidget::create() if (_current_template.is_procedural) {} else { - sp_file_new(_current_template.path); + sp_file_open(_current_template.path, NULL); } } -- cgit v1.2.3 From d11c156518710f49dc3fc8ec3408388a1a2b1ddb Mon Sep 17 00:00:00 2001 From: Slagvi Public Date: Sat, 27 Jul 2013 22:39:28 +0200 Subject: New preview rendering option in New From Template (bzr r12379.2.16) --- src/ui/dialog/template-load-tab.cpp | 1 + src/ui/dialog/template-widget.cpp | 13 ++++++++++++- src/ui/dialog/template-widget.h | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ui/dialog/template-load-tab.cpp b/src/ui/dialog/template-load-tab.cpp index d993e0233..ade595eaa 100644 --- a/src/ui/dialog/template-load-tab.cpp +++ b/src/ui/dialog/template-load-tab.cpp @@ -192,6 +192,7 @@ TemplateLoadTab::TemplateData TemplateLoadTab::_processTemplateFile(const Glib:: TemplateData result; result.path = path; result.is_procedural = false; + result.preview_name = ""; // convert path into valid template name result.display_name = Glib::path_get_basename(path); diff --git a/src/ui/dialog/template-widget.cpp b/src/ui/dialog/template-widget.cpp index 1efa790ab..c15d234ab 100644 --- a/src/ui/dialog/template-widget.cpp +++ b/src/ui/dialog/template-widget.cpp @@ -31,10 +31,12 @@ TemplateWidget::TemplateWidget() , _template_author_label(_(" ")) , _template_name_label(_("no template selected")) , _preview_image(" ") + , _preview_render() { pack_start(_template_name_label, Gtk::PACK_SHRINK, 10); pack_start(_template_author_label, Gtk::PACK_SHRINK, 0); pack_start(_preview_image, Gtk::PACK_SHRINK, 15); + pack_start(_preview_render, Gtk::PACK_SHRINK, 10); _short_description_label.set_line_wrap(true); _short_description_label.set_size_request(200); @@ -73,7 +75,16 @@ void TemplateWidget::display(TemplateLoadTab::TemplateData data) _short_description_label.set_text(_current_template.short_description); Glib::ustring imagePath = Glib::build_filename(Glib::path_get_dirname(_current_template.path), _current_template.preview_name); - _preview_image.set(imagePath); + if (data.preview_name != ""){ + _preview_image.set(imagePath); + _preview_image.show(); + _preview_render.hide(); + } + else{ + _preview_render.showImage(data.path); + _preview_render.show(); + _preview_image.hide(); + } } } diff --git a/src/ui/dialog/template-widget.h b/src/ui/dialog/template-widget.h index 743fb524d..b9d03415c 100644 --- a/src/ui/dialog/template-widget.h +++ b/src/ui/dialog/template-widget.h @@ -12,6 +12,7 @@ #define INKSCAPE_SEEN_UI_DIALOG_TEMPLATE_WIDGET_H #include "template-load-tab.h" +#include "filedialogimpl-gtkmm.h" #include @@ -34,6 +35,7 @@ private: Gtk::Label _template_author_label; Gtk::Label _template_name_label; Gtk::Image _preview_image; + Dialog::SVGPreview _preview_render; void _displayTemplateDetails(); }; -- cgit v1.2.3 From 2b49305a582432378732c9f26456e1ada464edbd Mon Sep 17 00:00:00 2001 From: Slagvi Public Date: Sat, 27 Jul 2013 22:51:06 +0200 Subject: Template preview size fixed (bzr r12379.2.17) --- src/ui/dialog/template-widget.cpp | 6 ++++-- src/ui/dialog/template-widget.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/template-widget.cpp b/src/ui/dialog/template-widget.cpp index c15d234ab..4b64c1c73 100644 --- a/src/ui/dialog/template-widget.cpp +++ b/src/ui/dialog/template-widget.cpp @@ -35,8 +35,10 @@ TemplateWidget::TemplateWidget() { pack_start(_template_name_label, Gtk::PACK_SHRINK, 10); pack_start(_template_author_label, Gtk::PACK_SHRINK, 0); - pack_start(_preview_image, Gtk::PACK_SHRINK, 15); - pack_start(_preview_render, Gtk::PACK_SHRINK, 10); + pack_start(_preview_box, Gtk::PACK_SHRINK, 0); + + _preview_box.pack_start(_preview_image, Gtk::PACK_EXPAND_PADDING, 15); + _preview_box.pack_start(_preview_render, Gtk::PACK_EXPAND_PADDING, 10); _short_description_label.set_line_wrap(true); _short_description_label.set_size_request(200); diff --git a/src/ui/dialog/template-widget.h b/src/ui/dialog/template-widget.h index b9d03415c..3c95208de 100644 --- a/src/ui/dialog/template-widget.h +++ b/src/ui/dialog/template-widget.h @@ -34,6 +34,7 @@ private: Gtk::Label _short_description_label; Gtk::Label _template_author_label; Gtk::Label _template_name_label; + Gtk::HBox _preview_box; Gtk::Image _preview_image; Dialog::SVGPreview _preview_render; -- cgit v1.2.3 From 90edb3a743ab4e9fc18ff18844cc3624433cd3fc Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Mon, 29 Jul 2013 21:47:12 -0400 Subject: Update unit extraction regular expressions. (bzr r12380.1.50) --- src/util/units.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/util/units.cpp b/src/util/units.cpp index 582c52090..342c9ff32 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -228,14 +228,14 @@ Quantity UnitTable::getQuantity(Glib::ustring const& q) const // Extract value double value = 0; - Glib::RefPtr value_regex = Glib::Regex::create("\\d+\\.?\\d"); + Glib::RefPtr value_regex = Glib::Regex::create("[-+]*[\\d+]*\\.*[\\d+]*[eE]*[-+]*\\d+"); if (value_regex->match(q, match_info)) { value = atof(match_info.fetch(0).c_str()); } // Extract unit abbreviation Glib::ustring abbr; - Glib::RefPtr unit_regex = Glib::Regex::create("[A-z]+"); + Glib::RefPtr unit_regex = Glib::Regex::create("[A-z%]+"); if (unit_regex->match(q, match_info)) { abbr = match_info.fetch(0); } -- cgit v1.2.3 From 7aab446af9e2eb34ce50c8ef0ec58710fac49396 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Mon, 29 Jul 2013 22:51:28 -0400 Subject: Cleanup. (bzr r12380.1.52) --- src/ui/CMakeLists.txt | 2 ++ src/ui/dialog/guides.cpp | 2 +- src/ui/widget/page-sizer.cpp | 4 ++-- src/util/units.cpp | 9 --------- src/util/units.h | 13 ++++++++++++- src/widgets/measure-toolbar.cpp | 5 ----- src/widgets/text-toolbar.cpp | 6 ------ 7 files changed, 17 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt index e831bcf69..b592d2527 100644 --- a/src/ui/CMakeLists.txt +++ b/src/ui/CMakeLists.txt @@ -112,6 +112,7 @@ set(ui_SRC widget/text.cpp widget/tolerance-slider.cpp widget/unit-menu.cpp + widget/unit-tracker.cpp view/view.cpp view/view-widget.cpp @@ -240,6 +241,7 @@ set(ui_SRC widget/text.h widget/tolerance-slider.h widget/unit-menu.h + widget/unit-tracker.h view/edit-widget-interface.h view/view-widget.h diff --git a/src/ui/dialog/guides.cpp b/src/ui/dialog/guides.cpp index 9a7b19c35..2de387364 100644 --- a/src/ui/dialog/guides.cpp +++ b/src/ui/dialog/guides.cpp @@ -230,7 +230,7 @@ void GuidelinePropertiesDialog::_setup() { _unit_menu.setUnitType(UNIT_TYPE_LINEAR); _unit_menu.setUnit("px"); if (_desktop->namedview->doc_units) { - //_unit_menu.setUnit( sp_unit_get_abbreviation(_desktop->namedview->doc_units) ); + _unit_menu.setUnit( _desktop->namedview->doc_units->abbr ); } _spin_angle.setUnit(_angle_unit_status); diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp index f6392cfd8..b15ab2823 100644 --- a/src/ui/widget/page-sizer.cpp +++ b/src/ui/widget/page-sizer.cpp @@ -313,9 +313,9 @@ PageSizer::PageSizer(Registry & _wr) SPNamedView *nv = sp_desktop_namedview(dt); _wr.setUpdating (true); if (nv->units) { - //_dimensionUnits.setUnit(nv->units); + _dimensionUnits.setUnit(nv->units->abbr); } else if (nv->doc_units) { - //_dimensionUnits.setUnit(nv->doc_units); + _dimensionUnits.setUnit(nv->doc_units->abbr); } _wr.setUpdating (false); diff --git a/src/util/units.cpp b/src/util/units.cpp index f40e33c67..7f60eb391 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -132,7 +132,6 @@ int Unit::defaultDigits() const return factor_digits; } -/** Checks if a unit is compatible with the specified unit. */ bool Unit::compatibleWith(const Unit &u) const { // Percentages @@ -154,19 +153,16 @@ bool Unit::compatibleWith(const Glib::ustring u) const return compatibleWith(unit_table.getUnit(u)); } -/** Check if units are equal. */ bool operator== (const Unit &u1, const Unit &u2) { return (u1.type == u2.type && u1.name.compare(u2.name) == 0); } -/** Check if units are not equal. */ bool operator!= (const Unit &u1, const Unit &u2) { return !(u1 == u2); } -/** Temporary - get SVG unit. */ int Unit::svgUnit() const { if (!abbr.compare("px")) @@ -355,7 +351,6 @@ void UnitParser::on_end_element(Ctx &ctx, Glib::ustring const &name) } } -/** Initialize a quantity. */ Quantity::Quantity(double q, const Unit &u) { unit = new Unit(u); @@ -368,7 +363,6 @@ Quantity::Quantity(double q, const Glib::ustring u) quantity = q; } -/** Checks if a quantity is compatible with the specified unit. */ bool Quantity::compatibleWith(const Unit &u) const { return unit->compatibleWith(u); @@ -379,7 +373,6 @@ bool Quantity::compatibleWith(const Glib::ustring u) const return compatibleWith(unit_table.getUnit(u)); } -/** Return the quantity's value in the specified unit. */ double Quantity::value(const Unit &u) const { return convert(quantity, *unit, u); @@ -390,7 +383,6 @@ double Quantity::value(const Glib::ustring u) const return value(unit_table.getUnit(u)); } -/** Return a printable string of the value in the specified unit. */ Glib::ustring Quantity::string(const Unit &u) const { return Glib::ustring::format(std::fixed, std::setprecision(2), value(u)) + " " + unit->abbr; } @@ -402,7 +394,6 @@ Glib::ustring Quantity::string() const { return string(*unit); } -/** Convert distances. */ double Quantity::convert(const double from_dist, const Unit &from, const Unit &to) { // Percentage diff --git a/src/util/units.h b/src/util/units.h index 79b62be60..c30fa24b3 100644 --- a/src/util/units.h +++ b/src/util/units.h @@ -65,6 +65,7 @@ class Unit { */ int defaultDigits() const; + /** Checks if a unit is compatible with the specified unit. */ bool compatibleWith(const Unit &u) const; bool compatibleWith(const Glib::ustring) const; @@ -75,10 +76,12 @@ class Unit { Glib::ustring abbr; Glib::ustring description; + /** Check if units are equal. */ friend bool operator== (const Unit &u1, const Unit &u2); + /** Check if units are not equal. */ friend bool operator!= (const Unit &u1, const Unit &u2); - // temporary + /** Get SVG unit. */ int svgUnit() const; }; @@ -87,16 +90,24 @@ public: const Unit *unit; double quantity; + /** Initialize a quantity. */ Quantity(double q, const Unit &u); // constructor Quantity(double q, const Glib::ustring u); // constructor + + /** Checks if a quantity is compatible with the specified unit. */ bool compatibleWith(const Unit &u) const; bool compatibleWith(const Glib::ustring u) const; + + /** Return the quantity's value in the specified unit. */ double value(const Unit &u) const; double value(const Glib::ustring u) const; + + /** Return a printable string of the value in the specified unit. */ Glib::ustring string(const Unit &u) const; Glib::ustring string(const Glib::ustring u) const; Glib::ustring string() const; + /** Convert distances. */ static double convert(const double from_dist, const Unit &from, const Unit &to); static double convert(const double from_dist, const Glib::ustring from, const Unit &to); static double convert(const double from_dist, const Unit &from, const Glib::ustring to); diff --git a/src/widgets/measure-toolbar.cpp b/src/widgets/measure-toolbar.cpp index d51a81457..53ed2d275 100644 --- a/src/widgets/measure-toolbar.cpp +++ b/src/widgets/measure-toolbar.cpp @@ -93,9 +93,6 @@ void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, G Inkscape::Preferences *prefs = Inkscape::Preferences::get(); tracker->setActiveUnitByAbbr(prefs->getString("/tools/measure/unit").c_str()); - //tracker->setUnitType(UNIT_TYPE_LINEAR); - //tracker->setUnit("px"); - g_object_set_data( holder, "tracker", tracker ); EgeAdjustmentAction *eact = 0; @@ -125,10 +122,8 @@ void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, G // units menu { GtkAction* act = tracker->createAction( "MeasureUnitsAction", _("Units:"), _("The units to be used for the measurements") ); - //EgeOutputAction* act = ege_output_action_new( "MeasureUnitsAction", _("Units:"), _("The units to be used for the measurements"), 0 ); g_signal_connect_after( G_OBJECT(act), "changed", G_CALLBACK(measure_unit_changed), holder ); gtk_action_group_add_action( mainActions, act ); - //gtk_action_group_add_action( mainActions, GTK_ACTION( act ) ); } } // end of sp_measure_toolbox_prep() diff --git a/src/widgets/text-toolbar.cpp b/src/widgets/text-toolbar.cpp index a7bd25b2c..7554f4faf 100644 --- a/src/widgets/text-toolbar.cpp +++ b/src/widgets/text-toolbar.cpp @@ -1213,12 +1213,6 @@ void sp_text_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje Inkscape::Preferences *prefs = Inkscape::Preferences::get(); Inkscape::IconSize secondarySize = ToolboxFactory::prefToSize("/toolbox/secondary", 1); - // Is this used? - /*UnitTracker* tracker = new UnitTracker( SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE ); - //tracker->setActiveUnit( sp_desktop_namedview(desktop)->doc_units ); - tracker->setActiveUnit(&sp_unit_get_by_id(SP_UNIT_PX)); - g_object_set_data( holder, "tracker", tracker );*/ - /* Font family */ { // Font list -- cgit v1.2.3 From ed40d19ee34bde5b7a6b7bf38904838f8d072f87 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Wed, 31 Jul 2013 20:18:48 +0200 Subject: Fix selection of images in outline mode. Fixes LP #1089702 Fixed bugs: - https://launchpad.net/bugs/1089702 (bzr r12440) --- src/display/drawing-image.cpp | 46 ++++++++++++++----------------------------- 1 file changed, 15 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/display/drawing-image.cpp b/src/display/drawing-image.cpp index 753249e60..bdb7c15b0 100644 --- a/src/display/drawing-image.cpp +++ b/src/display/drawing-image.cpp @@ -9,6 +9,7 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include <2geom/bezier-curve.h> #include "display/cairo-utils.h" #include "display/drawing.h" #include "display/drawing-context.h" @@ -287,21 +288,9 @@ unsigned DrawingImage::_renderItem(DrawingContext &ct, Geom::IntRect const &/*ar static double distance_to_segment (Geom::Point const &p, Geom::Point const &a1, Geom::Point const &a2) { - // calculate sides of the triangle and their squares - double d1 = Geom::L2(p - a1); - double d1_2 = d1 * d1; - double d2 = Geom::L2(p - a2); - double d2_2 = d2 * d2; - double a = Geom::L2(a1 - a2); - double a_2 = a * a; - - // if one of the angles at the base is > 90, return the corresponding side - if (d1_2 + a_2 <= d2_2) return d1; - if (d2_2 + a_2 <= d1_2) return d2; - - // otherwise calculate the height to the base - double peri = (a + d1 + d2)/2; - return (2*sqrt(peri * (peri - a) * (peri - d1) * (peri - d2))/a); + Geom::LineSegment l(a1, a2); + Geom::Point np = l.pointAt(l.nearestPoint(p)); + return Geom::distance(np, p); } DrawingItem * @@ -313,22 +302,17 @@ DrawingImage::_pickItem(Geom::Point const &p, double delta, unsigned /*sticky*/) if (outline) { Geom::Rect r = bounds(); - - Geom::Point c00 = r.corner(0); - Geom::Point c01 = r.corner(3); - Geom::Point c11 = r.corner(2); - Geom::Point c10 = r.corner(1); - - // frame - if (distance_to_segment (p, c00, c10) < delta) return this; - if (distance_to_segment (p, c10, c11) < delta) return this; - if (distance_to_segment (p, c11, c01) < delta) return this; - if (distance_to_segment (p, c01, c00) < delta) return this; - - // diagonals - if (distance_to_segment (p, c00, c11) < delta) return this; - if (distance_to_segment (p, c10, c01) < delta) return this; - + Geom::Point pick = p * _ctm.inverse(); + + // find whether any side or diagonal is within delta + // to do so, iterate over all pairs of corners + for (unsigned i = 0; i < 3; ++i) { // for i=3, there is nothing to do + for (unsigned j = i+1; j < 4; ++j) { + if (distance_to_segment(pick, r.corner(i), r.corner(j)) < delta) { + return this; + } + } + } return NULL; } else { -- cgit v1.2.3 From c135cb8c39a4004e9eb8adb227ba4c54848a8c45 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Wed, 31 Jul 2013 16:45:07 -0400 Subject: Added percent support back to select toolbar. (bzr r12380.1.53) --- src/ui/widget/unit-tracker.cpp | 9 ++++++++- src/ui/widget/unit-tracker.h | 1 + src/widgets/select-toolbar.cpp | 13 +++++++------ 3 files changed, 16 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/ui/widget/unit-tracker.cpp b/src/ui/widget/unit-tracker.cpp index 372419c3b..c0d3eec9b 100644 --- a/src/ui/widget/unit-tracker.cpp +++ b/src/ui/widget/unit-tracker.cpp @@ -111,6 +111,13 @@ void UnitTracker::addAdjustment(GtkAdjustment *adj) } } +void UnitTracker::addUnit(Inkscape::Util::Unit const &u) +{ + GtkTreeIter iter; + gtk_list_store_append(_store, &iter); + gtk_list_store_set(_store, &iter, COLUMN_STRING, u.abbr.c_str(), -1); +} + void UnitTracker::setFullVal(GtkAdjustment *adj, gdouble val) { _priorValues[adj] = val; @@ -232,7 +239,7 @@ void UnitTracker::_fixupAdjustments(Inkscape::Util::Unit const oldUnit, Inkscape if ( (oldUnit.type != Inkscape::Util::UNIT_TYPE_DIMENSIONLESS) && (newUnit.type == Inkscape::Util::UNIT_TYPE_DIMENSIONLESS) ) { - val = newUnit.factor; + val = newUnit.factor * 100; _priorValues[adj] = Inkscape::Util::Quantity::convert(oldVal, oldUnit, "px"); } else if ( (oldUnit.type == Inkscape::Util::UNIT_TYPE_DIMENSIONLESS) && (newUnit.type != Inkscape::Util::UNIT_TYPE_DIMENSIONLESS) ) diff --git a/src/ui/widget/unit-tracker.h b/src/ui/widget/unit-tracker.h index 521fe50c8..cdcb07c57 100644 --- a/src/ui/widget/unit-tracker.h +++ b/src/ui/widget/unit-tracker.h @@ -39,6 +39,7 @@ public: void setActiveUnitByAbbr(gchar const *abbr); Inkscape::Util::Unit getActiveUnit() const; + void addUnit(Inkscape::Util::Unit const &u); void addAdjustment(GtkAdjustment *adj); void setFullVal(GtkAdjustment *adj, gdouble val); diff --git a/src/widgets/select-toolbar.cpp b/src/widgets/select-toolbar.cpp index 617757845..ab6d6ca3b 100644 --- a/src/widgets/select-toolbar.cpp +++ b/src/widgets/select-toolbar.cpp @@ -89,7 +89,7 @@ sp_selection_layout_widget_update(SPWidget *spw, Inkscape::Selection *sel) }; if (unit.type == Inkscape::Util::UNIT_TYPE_DIMENSIONLESS) { - double const val = unit.factor; + double const val = unit.factor * 100; for (unsigned i = 0; i < G_N_ELEMENTS(keyval); ++i) { GtkAdjustment *a = GTK_ADJUSTMENT(g_object_get_data(G_OBJECT(spw), keyval[i].key)); gtk_adjustment_set_value(a, val); @@ -202,13 +202,13 @@ sp_object_layout_any_value_changed(GtkAdjustment *adj, SPWidget *spw) y1 = y0 + Quantity::convert(gtk_adjustment_get_value(a_h), unit, "px");; yrel = Quantity::convert(gtk_adjustment_get_value(a_h), unit, "px") / bbox_user->dimensions()[Geom::Y]; } else { - double const x0_propn = gtk_adjustment_get_value (a_x) * unit.factor; + double const x0_propn = gtk_adjustment_get_value (a_x) / 100 / unit.factor; x0 = bbox_user->min()[Geom::X] * x0_propn; - double const y0_propn = gtk_adjustment_get_value (a_y) * unit.factor; + double const y0_propn = gtk_adjustment_get_value (a_y) / 100 / unit.factor; y0 = y0_propn * bbox_user->min()[Geom::Y]; - xrel = gtk_adjustment_get_value (a_w) * unit.factor; + xrel = gtk_adjustment_get_value (a_w) / 100 / unit.factor; x1 = x0 + xrel * bbox_user->dimensions()[Geom::X]; - yrel = gtk_adjustment_get_value (a_h) * unit.factor; + yrel = gtk_adjustment_get_value (a_h) / 100 / unit.factor; y1 = y0 + yrel * bbox_user->dimensions()[Geom::Y]; } @@ -493,7 +493,8 @@ void sp_select_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GOb // Create the units menu. UnitTracker* tracker = new UnitTracker(Inkscape::Util::UNIT_TYPE_LINEAR); - //tracker->addUnit( SP_UNIT_PERCENT, 0 ); + Inkscape::Util::UnitTable unit_table; + tracker->addUnit(unit_table.getUnit("%")); tracker->setActiveUnit( sp_desktop_namedview(desktop)->doc_units ); g_object_set_data( G_OBJECT(spw), "tracker", tracker ); -- cgit v1.2.3 From f1cdb3b3f47c7187d9325e8ddd8e630268dc8e8b Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Wed, 31 Jul 2013 18:33:03 -0400 Subject: Eliminate "unit-constants.h". (bzr r12380.1.54) --- src/CMakeLists.txt | 1 - src/Makefile_insert | 1 - src/document.cpp | 4 +- src/doxygen-main.cpp | 2 +- src/extension/internal/cairo-render-context.cpp | 5 +-- src/extension/internal/cairo-renderer-pdf-out.cpp | 4 +- src/extension/internal/cairo-renderer.cpp | 18 ++++----- src/extension/internal/emf-win32-inout.cpp | 1 - src/extension/internal/emf-win32-print.cpp | 2 - src/extension/internal/gdkpixbuf-input.cpp | 4 +- src/extension/internal/latex-pstricks.cpp | 6 +-- src/extension/internal/latex-text-renderer.cpp | 4 +- src/extension/internal/pdfinput/pdf-parser.cpp | 8 ++-- src/extension/internal/pdfinput/svg-builder.cpp | 4 +- src/helper/pixbuf-ops.cpp | 4 +- src/main.cpp | 12 +++--- src/selection-chemistry.cpp | 14 +++---- src/sp-text.cpp | 1 - src/style.cpp | 32 +++++++-------- src/svg/svg-length.cpp | 14 +++---- src/text-editing.cpp | 12 +++--- src/ui/clipboard.cpp | 8 ++-- src/ui/dialog/export.cpp | 7 ++-- src/ui/dialog/inkscape-preferences.cpp | 8 ++-- src/ui/dialog/print.cpp | 12 +++--- src/ui/dialog/text-edit.cpp | 4 +- src/ui/widget/rendering-options.cpp | 6 +-- src/unit-constants.h | 47 ----------------------- src/widgets/font-selector.cpp | 1 - 29 files changed, 95 insertions(+), 151 deletions(-) delete mode 100644 src/unit-constants.h (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 537e13200..4f7592119 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -481,7 +481,6 @@ set(inkscape_SRC unclump.h undo-stack-observer.h unicoderange.h - unit-constants.h uri-references.h uri.h vanishing-point.h diff --git a/src/Makefile_insert b/src/Makefile_insert index ff64dc183..429c725cd 100644 --- a/src/Makefile_insert +++ b/src/Makefile_insert @@ -250,7 +250,6 @@ ink_common_sources += \ unclump.cpp unclump.h \ undo-stack-observer.h \ unicoderange.cpp unicoderange.h \ - unit-constants.h \ uri.cpp uri.h \ uri-references.cpp uri-references.h \ vanishing-point.cpp vanishing-point.h \ diff --git a/src/document.cpp b/src/document.cpp index a024cc790..afd0a6ddc 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -62,7 +62,7 @@ #include "sp-object-repr.h" #include "sp-symbol.h" #include "transf_mat_3x4.h" -#include "unit-constants.h" +#include "util/units.h" #include "xml/repr.h" #include "xml/rebase-hrefs.h" #include "libcroco/cr-cascade.h" @@ -966,7 +966,7 @@ void SPDocument::setupViewport(SPItemCtx *ctx) if (root->viewBox_set) { // if set, take from viewBox ctx->viewport = root->viewBox; } else { // as a last resort, set size to A4 - ctx->viewport = Geom::Rect::from_xywh(0, 0, 210 * PX_PER_MM, 297 * PX_PER_MM); + ctx->viewport = Geom::Rect::from_xywh(0, 0, 210 * Inkscape::Util::Quantity::convert(1, "mm", "px"), 297 * Inkscape::Util::Quantity::convert(1, "mm", "px")); } ctx->i2vp = Geom::identity(); } diff --git a/src/doxygen-main.cpp b/src/doxygen-main.cpp index 42eb5dd13..a1d3f3604 100644 --- a/src/doxygen-main.cpp +++ b/src/doxygen-main.cpp @@ -348,7 +348,7 @@ namespace XML {} * Inkscape::Whiteboard::UndoStackObserver [\ref undo-stack-observer.cpp, \ref composite-undo-stack-observer.cpp] * [\ref document-undo.cpp] * - * {\ref dialogs/} [\ref decimal-round.h] [\ref enums.h] [\ref unit-constants.h] + * {\ref dialogs/} [\ref decimal-round.h] [\ref enums.h] */ diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp index d7a560f04..09b769229 100644 --- a/src/extension/internal/cairo-render-context.cpp +++ b/src/extension/internal/cairo-render-context.cpp @@ -44,12 +44,11 @@ #include "sp-pattern.h" #include "sp-mask.h" #include "sp-clippath.h" +#include "util/units.h" #ifdef WIN32 #include "libnrtype/FontFactory.h" // USE_PANGO_WIN32 #endif -#include - #include "cairo-render-context.h" #include "cairo-renderer.h" #include "extension/system.h" @@ -855,7 +854,7 @@ CairoRenderContext::_finishSurfaceSetup(cairo_surface_t *surface, cairo_matrix_t _surface = surface; if (_vector_based_target) { - cairo_scale(_cr, PT_PER_PX, PT_PER_PX); + cairo_scale(_cr, Inkscape::Util::Quantity::convert(1, "px", "pt"), Inkscape::Util::Quantity::convert(1, "px", "pt")); } else if (cairo_surface_get_content(_surface) != CAIRO_CONTENT_ALPHA) { // set background color on non-alpha surfaces // TODO: bgcolor should be derived from SPDocument diff --git a/src/extension/internal/cairo-renderer-pdf-out.cpp b/src/extension/internal/cairo-renderer-pdf-out.cpp index 6f641fd36..da4cf1bc1 100644 --- a/src/extension/internal/cairo-renderer-pdf-out.cpp +++ b/src/extension/internal/cairo-renderer-pdf-out.cpp @@ -39,7 +39,7 @@ #include <2geom/affine.h> #include "document.h" -#include "unit-constants.h" +#include "util/units.h" namespace Inkscape { namespace Extension { @@ -197,7 +197,7 @@ CairoRendererPdfOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, float new_bleedmargin_px = 0.; try { - new_bleedmargin_px = mod->get_param_float("bleed") * PX_PER_MM; + new_bleedmargin_px = mod->get_param_float("bleed") * Inkscape::Util::Quantity::convert(1, "mm", "px"); } catch(...) { g_warning("Parameter might not exist"); diff --git a/src/extension/internal/cairo-renderer.cpp b/src/extension/internal/cairo-renderer.cpp index 0a3cff26a..f7ab63c98 100644 --- a/src/extension/internal/cairo-renderer.cpp +++ b/src/extension/internal/cairo-renderer.cpp @@ -55,7 +55,7 @@ #include "sp-mask.h" #include "sp-clippath.h" -#include +#include "util/units.h" #include "helper/png-write.h" #include "helper/pixbuf-ops.h" @@ -442,7 +442,7 @@ static void sp_asbitmap_render(SPItem *item, CairoRenderContext *ctx) */ res = ctx->getBitmapResolution(); if(res == 0) { - res = PX_PER_IN; + res = Inkscape::Util::Quantity::convert(1, "in", "px"); } TRACE(("sp_asbitmap_render: resolution: %f\n", res )); @@ -463,8 +463,8 @@ static void sp_asbitmap_render(SPItem *item, CairoRenderContext *ctx) } // The width and height of the bitmap in pixels - unsigned width = ceil(bbox->width() * (res / PX_PER_IN)); - unsigned height = ceil(bbox->height() * (res / PX_PER_IN)); + unsigned width = ceil(bbox->width() * (res / Inkscape::Util::Quantity::convert(1, "in", "px"))); + unsigned height = ceil(bbox->height() * (res / Inkscape::Util::Quantity::convert(1, "in", "px"))); if (width == 0 || height == 0) return; @@ -477,7 +477,7 @@ static void sp_asbitmap_render(SPItem *item, CairoRenderContext *ctx) double shift_y = bbox->max()[Geom::Y]; // For default 90 dpi, snap bitmap to pixel grid - if (res == PX_PER_IN) { + if (res == Inkscape::Util::Quantity::convert(1, "in", "px")) { shift_x = round (shift_x); shift_y = -round (-shift_y); // Correct rounding despite coordinate inversion. // Remove the negations when the inversion is gone. @@ -629,7 +629,7 @@ CairoRenderer::setupDocument(CairoRenderContext *ctx, SPDocument *doc, bool page if (ctx->_vector_based_target) { // convert from px to pt - d *= Geom::Scale(PT_PER_PX); + d *= Geom::Scale(Inkscape::Util::Quantity::convert(1, "px", "pt")); } ctx->_width = d.width(); @@ -647,11 +647,11 @@ CairoRenderer::setupDocument(CairoRenderContext *ctx, SPDocument *doc, bool page } else { double high = doc->getHeight(); if (ctx->_vector_based_target) - high *= PT_PER_PX; + high *= Inkscape::Util::Quantity::convert(1, "px", "pt"); // this transform translates the export drawing to a virtual page (0,0)-(width,height) - Geom::Affine tp(Geom::Translate(-d.left() * (ctx->_vector_based_target ? PX_PER_PT : 1.0), - (d.bottom() - high) * (ctx->_vector_based_target ? PX_PER_PT : 1.0))); + Geom::Affine tp(Geom::Translate(-d.left() * (ctx->_vector_based_target ? Inkscape::Util::Quantity::convert(1, "pt", "px") : 1.0), + (d.bottom() - high) * (ctx->_vector_based_target ? Inkscape::Util::Quantity::convert(1, "pt", "px") : 1.0))); ctx->transform(tp); } } diff --git a/src/extension/internal/emf-win32-inout.cpp b/src/extension/internal/emf-win32-inout.cpp index e9360a0ea..62cb53413 100644 --- a/src/extension/internal/emf-win32-inout.cpp +++ b/src/extension/internal/emf-win32-inout.cpp @@ -37,7 +37,6 @@ #include "extension/output.h" #include "display/drawing.h" #include "display/drawing-item.h" -#include "unit-constants.h" #include "clear-n_.h" #include "document.h" diff --git a/src/extension/internal/emf-win32-print.cpp b/src/extension/internal/emf-win32-print.cpp index 2b79fd5a4..99f101bb8 100644 --- a/src/extension/internal/emf-win32-print.cpp +++ b/src/extension/internal/emf-win32-print.cpp @@ -43,8 +43,6 @@ #include "emf-win32-print.h" -#include "unit-constants.h" - #include "extension/system.h" #include "extension/print.h" #include "document.h" diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp index abfad518f..994258ccc 100644 --- a/src/extension/internal/gdkpixbuf-input.cpp +++ b/src/extension/internal/gdkpixbuf-input.cpp @@ -12,7 +12,7 @@ #include "selection-chemistry.h" #include "sp-image.h" #include "document-undo.h" -#include "unit-constants.h" +#include "util/units.h" #include "image-resolution.h" #include @@ -79,7 +79,7 @@ GdkpixbufInput::open(Inkscape::Extension::Input *mod, char const *uri) double width = gdk_pixbuf_get_width(pb); double height = gdk_pixbuf_get_height(pb); - double defaultxdpi = prefs->getDouble("/dialogs/import/defaultxdpi/value", PX_PER_IN); + double defaultxdpi = prefs->getDouble("/dialogs/import/defaultxdpi/value", Inkscape::Util::Quantity::convert(1, "in", "px")); bool forcexdpi = prefs->getBool("/dialogs/import/forcexdpi"); ImageResolution *ir = 0; double xscale = 1; diff --git a/src/extension/internal/latex-pstricks.cpp b/src/extension/internal/latex-pstricks.cpp index c1eddf539..2ece1ba87 100644 --- a/src/extension/internal/latex-pstricks.cpp +++ b/src/extension/internal/latex-pstricks.cpp @@ -21,7 +21,7 @@ #include <2geom/hvlinesegment.h> #include #include -#include +#include "util/units.h" #include "helper/geom-curves.h" #include "extension/print.h" @@ -117,8 +117,8 @@ unsigned int PrintLatex::begin (Inkscape::Extension::Print *mod, SPDocument *doc } // width and height in pt - _width = doc->getWidth() * PT_PER_PX; - _height = doc->getHeight() * PT_PER_PX; + _width = doc->getWidth() * Inkscape::Util::Quantity::convert(1, "px", "pt"); + _height = doc->getHeight() * Inkscape::Util::Quantity::convert(1, "px", "pt"); if (res >= 0) { diff --git a/src/extension/internal/latex-text-renderer.cpp b/src/extension/internal/latex-text-renderer.cpp index ecc201733..57a71b467 100644 --- a/src/extension/internal/latex-text-renderer.cpp +++ b/src/extension/internal/latex-text-renderer.cpp @@ -39,7 +39,7 @@ #include "sp-rect.h" #include "text-editing.h" -#include +#include "util/units.h" #include "extension/system.h" @@ -611,7 +611,7 @@ LaTeXTextRenderer::setupDocument(SPDocument *doc, bool pageBoundingBox, float bl // scaling of the image when including it in LaTeX os << " \\ifx\\svgwidth\\undefined%\n"; - os << " \\setlength{\\unitlength}{" << d.width() * PT_PER_PX << "bp}%\n"; // note: 'bp' is the Postscript pt unit in LaTeX, see LP bug #792384 + os << " \\setlength{\\unitlength}{" << d.width() * Inkscape::Util::Quantity::convert(1, "px", "pt") << "bp}%\n"; // note: 'bp' is the Postscript pt unit in LaTeX, see LP bug #792384 os << " \\ifx\\svgscale\\undefined%\n"; os << " \\relax%\n"; os << " \\else%\n"; diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp index 3be7af34f..3b63e9cbe 100644 --- a/src/extension/internal/pdfinput/pdf-parser.cpp +++ b/src/extension/internal/pdfinput/pdf-parser.cpp @@ -34,7 +34,7 @@ extern "C" { #include "svg-builder.h" #include "Gfx.h" #include "pdf-parser.h" -#include "unit-constants.h" +#include "util/units.h" #include "goo/gmem.h" #include "goo/GooTimer.h" @@ -279,14 +279,14 @@ PdfParser::PdfParser(XRef *xrefA, Inkscape::Extension::Internal::SvgBuilder *bui ignoreUndef = 0; operatorHistory = NULL; builder = builderA; - builder->setDocumentSize(state->getPageWidth()*PX_PER_PT, - state->getPageHeight()*PX_PER_PT); + builder->setDocumentSize(state->getPageWidth()*Inkscape::Util::Quantity::convert(1, "pt", "px"), + state->getPageHeight()*Inkscape::Util::Quantity::convert(1, "pt", "px")); double *ctm = state->getCTM(); double scaledCTM[6]; for (int i = 0; i < 6; ++i) { baseMatrix[i] = ctm[i]; - scaledCTM[i] = PX_PER_PT * ctm[i]; + scaledCTM[i] = Inkscape::Util::Quantity::convert(1, "pt", "px") * ctm[i]; } saveState(); builder->setTransform((double*)&scaledCTM); diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp index 75849f6cc..6d9ac1b1a 100644 --- a/src/extension/internal/pdfinput/svg-builder.cpp +++ b/src/extension/internal/pdfinput/svg-builder.cpp @@ -33,7 +33,7 @@ #include "svg/css-ostringstream.h" #include "svg/svg-color.h" #include "color.h" -#include "unit-constants.h" +#include "util/units.h" #include "io/stringstream.h" #include "io/base64stream.h" #include "display/nr-filter-utils.h" @@ -777,7 +777,7 @@ gchar *SvgBuilder::_createGradient(GfxShading *shading, double *matrix, bool for Geom::Affine pat_matrix(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); if ( !for_shading && _is_top_level ) { - Geom::Affine flip(1.0, 0.0, 0.0, -1.0, 0.0, _height * PT_PER_PX); + Geom::Affine flip(1.0, 0.0, 0.0, -1.0, 0.0, _height * Inkscape::Util::Quantity::convert(1, "px", "pt")); pat_matrix *= flip; } gchar *transform_text = sp_svg_transform_write(pat_matrix); diff --git a/src/helper/pixbuf-ops.cpp b/src/helper/pixbuf-ops.cpp index 9cd1967d8..75c002c57 100644 --- a/src/helper/pixbuf-ops.cpp +++ b/src/helper/pixbuf-ops.cpp @@ -29,7 +29,7 @@ #include "sp-root.h" #include "sp-use.h" #include "sp-defs.h" -#include "unit-constants.h" +#include "util/units.h" #include "helper/pixbuf-ops.h" @@ -121,7 +121,7 @@ GdkPixbuf *sp_generate_internal_bitmap(SPDocument *doc, gchar const */*filename* origin[Geom::X] = origin[Geom::X] + (screen[Geom::X].extent() * ((1 - padding) / 2)); origin[Geom::Y] = origin[Geom::Y] + (screen[Geom::Y].extent() * ((1 - padding) / 2)); - Geom::Scale scale( (xdpi / PX_PER_IN), (ydpi / PX_PER_IN)); + Geom::Scale scale( (xdpi / Inkscape::Util::Quantity::convert(1, "in", "px")), (ydpi / Inkscape::Util::Quantity::convert(1, "in", "px"))); Geom::Affine affine = scale * Geom::Translate(-origin * scale); /* Create ArenaItems and set transform */ diff --git a/src/main.cpp b/src/main.cpp index d425b88bb..577cc3d79 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -68,7 +68,7 @@ #include "color.h" #include "sp-item.h" #include "sp-root.h" -#include "unit-constants.h" +#include "util/units.h" #include "svg/svg.h" #include "svg/svg-color.h" @@ -1524,7 +1524,7 @@ static int sp_do_export_png(SPDocument *doc) // default dpi if (dpi == 0.0) { - dpi = PX_PER_IN; + dpi = Inkscape::Util::Quantity::convert(1, "in", "px"); } unsigned long int width = 0; @@ -1537,7 +1537,7 @@ static int sp_do_export_png(SPDocument *doc) g_warning("Export width %lu out of range (1 - %lu). Nothing exported.", width, (unsigned long int)PNG_UINT_31_MAX); return 1; } - dpi = (gdouble) width * PX_PER_IN / area.width(); + dpi = (gdouble) width * Inkscape::Util::Quantity::convert(1, "in", "px") / area.width(); } if (sp_export_height) { @@ -1547,15 +1547,15 @@ static int sp_do_export_png(SPDocument *doc) g_warning("Export height %lu out of range (1 - %lu). Nothing exported.", height, (unsigned long int)PNG_UINT_31_MAX); return 1; } - dpi = (gdouble) height * PX_PER_IN / area.height(); + dpi = (gdouble) height * Inkscape::Util::Quantity::convert(1, "in", "px") / area.height(); } if (!sp_export_width) { - width = (unsigned long int) (area.width() * dpi / PX_PER_IN + 0.5); + width = (unsigned long int) (area.width() * dpi / Inkscape::Util::Quantity::convert(1, "in", "px") + 0.5); } if (!sp_export_height) { - height = (unsigned long int) (area.height() * dpi / PX_PER_IN + 0.5); + height = (unsigned long int) (area.height() * dpi / Inkscape::Util::Quantity::convert(1, "in", "px") + 0.5); } guint32 bgcolor = 0x00000000; diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index dc786f340..5976555f4 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -89,7 +89,7 @@ SPCycleType SP_CYCLING = SP_CYCLE_FOCUS; #include "sp-item.h" #include "box3d.h" #include "persp3d.h" -#include "unit-constants.h" +#include "util/units.h" #include "xml/simple-document.h" #include "sp-filter-reference.h" #include "gradient-drag.h" @@ -3397,7 +3397,7 @@ void sp_selection_create_bitmap_copy(SPDesktop *desktop) res = prefs_res; } else if (0 < prefs_min) { // If minsize is given, look up minimum bitmap size (default 250 pixels) and calculate resolution from it - res = PX_PER_IN * prefs_min / MIN(bbox->width(), bbox->height()); + res = Inkscape::Util::Quantity::convert(1, "in", "px") * prefs_min / MIN(bbox->width(), bbox->height()); } else { float hint_xdpi = 0, hint_ydpi = 0; Glib::ustring hint_filename; @@ -3412,14 +3412,14 @@ void sp_selection_create_bitmap_copy(SPDesktop *desktop) res = hint_xdpi; } else { // if all else fails, take the default 90 dpi - res = PX_PER_IN; + res = Inkscape::Util::Quantity::convert(1, "in", "px"); } } } // The width and height of the bitmap in pixels - unsigned width = (unsigned) floor(bbox->width() * res / PX_PER_IN); - unsigned height =(unsigned) floor(bbox->height() * res / PX_PER_IN); + unsigned width = (unsigned) floor(bbox->width() * res / Inkscape::Util::Quantity::convert(1, "in", "px")); + unsigned height =(unsigned) floor(bbox->height() * res / Inkscape::Util::Quantity::convert(1, "in", "px")); // Find out if we have to run an external filter gchar const *run = NULL; @@ -3451,7 +3451,7 @@ void sp_selection_create_bitmap_copy(SPDesktop *desktop) double shift_x = bbox->min()[Geom::X]; double shift_y = bbox->max()[Geom::Y]; - if (res == PX_PER_IN) { // for default 90 dpi, snap it to pixel grid + if (res == Inkscape::Util::Quantity::convert(1, "in", "px")) { // for default 90 dpi, snap it to pixel grid shift_x = round(shift_x); shift_y = -round(-shift_y); // this gets correct rounding despite coordinate inversion, remove the negations when the inversion is gone } @@ -3484,7 +3484,7 @@ void sp_selection_create_bitmap_copy(SPDesktop *desktop) // Create the repr for the image Inkscape::XML::Node * repr = xml_doc->createElement("svg:image"); sp_embed_image(repr, pb, "image/png"); - if (res == PX_PER_IN) { // for default 90 dpi, snap it to pixel grid + if (res == Inkscape::Util::Quantity::convert(1, "in", "px")) { // for default 90 dpi, snap it to pixel grid sp_repr_set_svg_double(repr, "width", width); sp_repr_set_svg_double(repr, "height", height); } else { diff --git a/src/sp-text.cpp b/src/sp-text.cpp index d84bbdc6c..9e0befcca 100644 --- a/src/sp-text.cpp +++ b/src/sp-text.cpp @@ -55,7 +55,6 @@ #include "sp-tspan.h" #include "text-editing.h" -#include "unit-constants.h" /*##################################################### # SPTEXT diff --git a/src/style.cpp b/src/style.cpp index 479f30597..f617973ca 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -45,7 +45,7 @@ #include "svg/css-ostringstream.h" #include "xml/repr.h" #include "xml/simple-document.h" -#include "unit-constants.h" +#include "util/units.h" #include "macros.h" #include "preferences.h" @@ -2483,11 +2483,11 @@ sp_style_css_size_px_to_units(double size, int unit) case SP_CSS_UNIT_NONE: unit_size = size; break; case SP_CSS_UNIT_PX: unit_size = size; break; - case SP_CSS_UNIT_PT: unit_size = size * PT_PER_PX; break; - case SP_CSS_UNIT_PC: unit_size = size * (PT_PER_PX / PT_PER_PC); break; - case SP_CSS_UNIT_MM: unit_size = size * MM_PER_PX; break; - case SP_CSS_UNIT_CM: unit_size = size * CM_PER_PX; break; - case SP_CSS_UNIT_IN: unit_size = size * IN_PER_PX; break; + case SP_CSS_UNIT_PT: unit_size = size * Inkscape::Util::Quantity::convert(1, "px", "pt"); break; + case SP_CSS_UNIT_PC: unit_size = size * (Inkscape::Util::Quantity::convert(1, "px", "pt") / Inkscape::Util::Quantity::convert(1, "pc", "pt")); break; + case SP_CSS_UNIT_MM: unit_size = size * Inkscape::Util::Quantity::convert(1, "px", "mm"); break; + case SP_CSS_UNIT_CM: unit_size = size * Inkscape::Util::Quantity::convert(1, "px", "cm"); break; + case SP_CSS_UNIT_IN: unit_size = size * Inkscape::Util::Quantity::convert(1, "px", "in"); break; case SP_CSS_UNIT_EM: unit_size = size / SP_CSS_FONT_SIZE_DEFAULT; break; case SP_CSS_UNIT_EX: unit_size = size * 2.0 / SP_CSS_FONT_SIZE_DEFAULT ; break; case SP_CSS_UNIT_PERCENT: unit_size = size * 100.0 / SP_CSS_FONT_SIZE_DEFAULT; break; @@ -3400,19 +3400,19 @@ sp_style_read_ilength(SPILength *val, gchar const *str) } else if (!strcmp(e, "pt")) { /* Userspace / DEVICESCALE */ val->unit = SP_CSS_UNIT_PT; - val->computed = value * PX_PER_PT; + val->computed = value * Inkscape::Util::Quantity::convert(1, "pt", "px"); } else if (!strcmp(e, "pc")) { val->unit = SP_CSS_UNIT_PC; - val->computed = value * PX_PER_PC; + val->computed = value * Inkscape::Util::Quantity::convert(1, "pc", "px"); } else if (!strcmp(e, "mm")) { val->unit = SP_CSS_UNIT_MM; - val->computed = value * PX_PER_MM; + val->computed = value * Inkscape::Util::Quantity::convert(1, "mm", "px"); } else if (!strcmp(e, "cm")) { val->unit = SP_CSS_UNIT_CM; - val->computed = value * PX_PER_CM; + val->computed = value * Inkscape::Util::Quantity::convert(1, "cm", "px"); } else if (!strcmp(e, "in")) { val->unit = SP_CSS_UNIT_IN; - val->computed = value * PX_PER_IN; + val->computed = value * Inkscape::Util::Quantity::convert(1, "in", "px"); } else if (!strcmp(e, "em")) { /* EM square */ val->unit = SP_CSS_UNIT_EM; @@ -3971,23 +3971,23 @@ sp_style_write_ilength(gchar *p, gint const len, gchar const *const key, return g_strlcpy(p, os.str().c_str(), len); break; case SP_CSS_UNIT_PT: - os << key << ":" << val->computed * PT_PER_PX << "pt;"; + os << key << ":" << val->computed * Inkscape::Util::Quantity::convert(1, "px", "pt") << "pt;"; return g_strlcpy(p, os.str().c_str(), len); break; case SP_CSS_UNIT_PC: - os << key << ":" << val->computed * PT_PER_PX / 12.0 << "pc;"; + os << key << ":" << val->computed * Inkscape::Util::Quantity::convert(1, "px", "pt") / 12.0 << "pc;"; return g_strlcpy(p, os.str().c_str(), len); break; case SP_CSS_UNIT_MM: - os << key << ":" << val->computed * MM_PER_PX << "mm;"; + os << key << ":" << val->computed * Inkscape::Util::Quantity::convert(1, "px", "mm") << "mm;"; return g_strlcpy(p, os.str().c_str(), len); break; case SP_CSS_UNIT_CM: - os << key << ":" << val->computed * CM_PER_PX << "cm;"; + os << key << ":" << val->computed * Inkscape::Util::Quantity::convert(1, "px", "cm") << "cm;"; return g_strlcpy(p, os.str().c_str(), len); break; case SP_CSS_UNIT_IN: - os << key << ":" << val->computed * IN_PER_PX << "in;"; + os << key << ":" << val->computed * Inkscape::Util::Quantity::convert(1, "px", "in") << "in;"; return g_strlcpy(p, os.str().c_str(), len); break; case SP_CSS_UNIT_EM: diff --git a/src/svg/svg-length.cpp b/src/svg/svg-length.cpp index d2f4332d8..7f93f9f0f 100644 --- a/src/svg/svg-length.cpp +++ b/src/svg/svg-length.cpp @@ -23,7 +23,7 @@ #include "svg.h" #include "stringstream.h" -#include "../unit-constants.h" +#include "util/units.h" static unsigned sp_svg_length_read_lff(gchar const *str, SVGLength::Unit *unit, float *val, float *computed, char **next); @@ -365,7 +365,7 @@ static unsigned sp_svg_length_read_lff(gchar const *str, SVGLength::Unit *unit, *unit = SVGLength::PT; } if (computed) { - *computed = v * PX_PER_PT; + *computed = v * Inkscape::Util::Quantity::convert(1, "pt", "px"); } break; case UVAL('p','c'): @@ -373,7 +373,7 @@ static unsigned sp_svg_length_read_lff(gchar const *str, SVGLength::Unit *unit, *unit = SVGLength::PC; } if (computed) { - *computed = v * PX_PER_PC; + *computed = v * Inkscape::Util::Quantity::convert(1, "pc", "px"); } break; case UVAL('m','m'): @@ -381,7 +381,7 @@ static unsigned sp_svg_length_read_lff(gchar const *str, SVGLength::Unit *unit, *unit = SVGLength::MM; } if (computed) { - *computed = v * PX_PER_MM; + *computed = v * Inkscape::Util::Quantity::convert(1, "mm", "px"); } break; case UVAL('c','m'): @@ -389,7 +389,7 @@ static unsigned sp_svg_length_read_lff(gchar const *str, SVGLength::Unit *unit, *unit = SVGLength::CM; } if (computed) { - *computed = v * PX_PER_CM; + *computed = v * Inkscape::Util::Quantity::convert(1, "cm", "px"); } break; case UVAL('i','n'): @@ -397,7 +397,7 @@ static unsigned sp_svg_length_read_lff(gchar const *str, SVGLength::Unit *unit, *unit = SVGLength::INCH; } if (computed) { - *computed = v * PX_PER_IN; + *computed = v * Inkscape::Util::Quantity::convert(1, "in", "px"); } break; case UVAL('f','t'): @@ -405,7 +405,7 @@ static unsigned sp_svg_length_read_lff(gchar const *str, SVGLength::Unit *unit, *unit = SVGLength::FOOT; } if (computed) { - *computed = v * PX_PER_FT; + *computed = v * Inkscape::Util::Quantity::convert(1, "ft", "px"); } break; case UVAL('e','m'): diff --git a/src/text-editing.cpp b/src/text-editing.cpp index 401f56bb2..0d30863d9 100644 --- a/src/text-editing.cpp +++ b/src/text-editing.cpp @@ -24,7 +24,7 @@ #include "inkscape.h" #include "message-stack.h" #include "style.h" -#include "unit-constants.h" +#include "util/units.h" #include "document.h" #include "xml/repr.h" @@ -1278,23 +1278,23 @@ sp_te_adjust_linespacing_screen (SPItem *text, Inkscape::Text::Layout::iterator style->line_height.value = style->line_height.computed; break; case SP_CSS_UNIT_PT: - style->line_height.computed += zby * PT_PER_PX; + style->line_height.computed += zby * Inkscape::Util::Quantity::convert(1, "px", "pt"); style->line_height.value = style->line_height.computed; break; case SP_CSS_UNIT_PC: - style->line_height.computed += zby * (PT_PER_PX / 12); + style->line_height.computed += zby * (Inkscape::Util::Quantity::convert(1, "px", "pt") / 12); style->line_height.value = style->line_height.computed; break; case SP_CSS_UNIT_MM: - style->line_height.computed += zby * MM_PER_PX; + style->line_height.computed += zby * Inkscape::Util::Quantity::convert(1, "px", "mm"); style->line_height.value = style->line_height.computed; break; case SP_CSS_UNIT_CM: - style->line_height.computed += zby * CM_PER_PX; + style->line_height.computed += zby * Inkscape::Util::Quantity::convert(1, "px", "cm"); style->line_height.value = style->line_height.computed; break; case SP_CSS_UNIT_IN: - style->line_height.computed += zby * IN_PER_PX; + style->line_height.computed += zby * Inkscape::Util::Quantity::convert(1, "px", "in"); style->line_height.value = style->line_height.computed; break; } diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp index 72ddd90a9..629960613 100644 --- a/src/ui/clipboard.cpp +++ b/src/ui/clipboard.cpp @@ -79,7 +79,7 @@ #include "text-editing.h" #include "tools-switch.h" #include "path-chemistry.h" -#include "unit-constants.h" +#include "util/units.h" #include "helper/png-write.h" #include "svg/svg-color.h" #include "sp-namedview.h" @@ -1078,14 +1078,14 @@ void ClipboardManagerImpl::_onGet(Gtk::SelectionData &sel, guint /*info*/) try { if (out == outlist.end() && target == "image/png") { - gdouble dpi = PX_PER_IN; + gdouble dpi = Inkscape::Util::Quantity::convert(1, "in", "px"); guint32 bgcolor = 0x00000000; Geom::Point origin (_clipboardSPDoc->getRoot()->x.computed, _clipboardSPDoc->getRoot()->y.computed); Geom::Rect area = Geom::Rect(origin, origin + _clipboardSPDoc->getDimensions()); - unsigned long int width = (unsigned long int) (area.width() * dpi / PX_PER_IN + 0.5); - unsigned long int height = (unsigned long int) (area.height() * dpi / PX_PER_IN + 0.5); + unsigned long int width = (unsigned long int) (area.width() * dpi / Inkscape::Util::Quantity::convert(1, "in", "px") + 0.5); + unsigned long int height = (unsigned long int) (area.height() * dpi / Inkscape::Util::Quantity::convert(1, "in", "px") + 0.5); // read from namedview Inkscape::XML::Node *nv = sp_repr_lookup_name (_clipboardSPDoc->rroot, "sodipodi:namedview"); diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index 5cb9357c3..063902aa7 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -50,7 +50,6 @@ #include "ui/widget/unit-menu.h" #include "util/units.h" -#include "unit-constants.h" #include "helper/window.h" #include "inkscape-private.h" #include "document.h" @@ -98,7 +97,7 @@ #define SP_EXPORT_MIN_SIZE 1.0 -#define DPI_BASE PX_PER_IN +#define DPI_BASE Inkscape::Util::Quantity::convert(1, "in", "px") #define EXPORT_COORD_PRECISION 3 @@ -1048,8 +1047,8 @@ void Export::onExport () Geom::OptRect area = item->desktopVisualBounds(); if (area) { - gint width = (gint) (area->width() * dpi / PX_PER_IN + 0.5); - gint height = (gint) (area->height() * dpi / PX_PER_IN + 0.5); + gint width = (gint) (area->width() * dpi / DPI_BASE + 0.5); + gint height = (gint) (area->height() * dpi / DPI_BASE + 0.5); if (width > 1 && height > 1) { // Do export diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index bc648002d..7890b0b4c 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -28,7 +28,7 @@ #include "preferences.h" #include "verbs.h" #include "selcue.h" -#include "unit-constants.h" +#include "util/units.h" #include #include "enums.h" #include "desktop-handles.h" @@ -1428,10 +1428,10 @@ void InkscapePreferences::initPageBitmaps() _("Automatically reload linked images when file is changed on disk")); _misc_bitmap_editor.init("/options/bitmapeditor/value", true); _page_bitmaps.add_line( false, _("_Bitmap editor:"), _misc_bitmap_editor, "", "", true); - _importexport_export_res.init("/dialogs/export/defaultxdpi/value", 0.0, 6000.0, 1.0, 1.0, PX_PER_IN, true, false); + _importexport_export_res.init("/dialogs/export/defaultxdpi/value", 0.0, 6000.0, 1.0, 1.0, Inkscape::Util::Quantity::convert(1, "in", "px"), true, false); _page_bitmaps.add_line( false, _("Default export _resolution:"), _importexport_export_res, _("dpi"), _("Default bitmap resolution (in dots per inch) in the Export dialog"), false); - _bitmap_copy_res.init("/options/createbitmap/resolution", 1.0, 6000.0, 1.0, 1.0, PX_PER_IN, true, false); + _bitmap_copy_res.init("/options/createbitmap/resolution", 1.0, 6000.0, 1.0, 1.0, Inkscape::Util::Quantity::convert(1, "in", "px"), true, false); _page_bitmaps.add_line( false, _("Resolution for Create Bitmap _Copy:"), _bitmap_copy_res, _("dpi"), _("Resolution used by the Create Bitmap Copy command"), false); { @@ -1443,7 +1443,7 @@ void InkscapePreferences::initPageBitmaps() _bitmap_import_quality.init("/dialogs/import/quality", 1, 100, 1, 1, 100, true, false); _page_bitmaps.add_line( false, _("Bitmap import quality:"), _bitmap_import_quality, "%", "Bitmap import quality (jpeg only). 100 is best quality", false); } - _importexport_import_res.init("/dialogs/import/defaultxdpi/value", 0.0, 6000.0, 1.0, 1.0, PX_PER_IN, true, false); + _importexport_import_res.init("/dialogs/import/defaultxdpi/value", 0.0, 6000.0, 1.0, 1.0, Inkscape::Util::Quantity::convert(1, "in", "px"), true, false); _page_bitmaps.add_line( false, _("Default _import resolution:"), _importexport_import_res, _("dpi"), _("Default bitmap resolution (in dots per inch) for bitmap import"), false); _importexport_import_res_override.init(_("Override file resolution"), "/dialogs/import/forcexdpi", false); diff --git a/src/ui/dialog/print.cpp b/src/ui/dialog/print.cpp index 2ab8cf121..4c8c77f96 100644 --- a/src/ui/dialog/print.cpp +++ b/src/ui/dialog/print.cpp @@ -26,7 +26,7 @@ #include "ui/widget/rendering-options.h" #include "document.h" -#include "unit-constants.h" +#include "util/units.h" #include "helper/png-write.h" #include "svg/svg-color.h" #include "io/sys.h" @@ -72,8 +72,8 @@ static void draw_page( sp_export_png_file(junk->_doc, tmp_png.c_str(), 0.0, 0.0, width, height, - (unsigned long)(width * dpi / PX_PER_IN), - (unsigned long)(height * dpi / PX_PER_IN), + (unsigned long)(width * dpi / Inkscape::Util::Quantity::convert(1, "in", "px")), + (unsigned long)(height * dpi / Inkscape::Util::Quantity::convert(1, "in", "px")), dpi, dpi, bgcolor, NULL, NULL, true, NULL); // This doesn't seem to work: @@ -90,7 +90,7 @@ static void draw_page( cairo_t *cr = gtk_print_context_get_cairo_context (context); cairo_matrix_t m; cairo_get_matrix(cr, &m); - cairo_scale(cr, PT_PER_IN / dpi, PT_PER_IN / dpi); + cairo_scale(cr, Inkscape::Util::Quantity::convert(1, "in", "pt") / dpi, Inkscape::Util::Quantity::convert(1, "in", "pt") / dpi); // FIXME: why is the origin offset?? cairo_set_source_surface(cr, png->cobj(), -16.0, -16.0); cairo_paint(cr); @@ -195,8 +195,8 @@ Print::Print(SPDocument *doc, SPItem *base) : // set up paper size to match the document size gtk_print_operation_set_unit (_printop, GTK_UNIT_POINTS); GtkPageSetup *page_setup = gtk_page_setup_new(); - gdouble doc_width = _doc->getWidth() * PT_PER_PX; - gdouble doc_height = _doc->getHeight() * PT_PER_PX; + gdouble doc_width = _doc->getWidth() * Inkscape::Util::Quantity::convert(1, "px", "pt"); + gdouble doc_height = _doc->getHeight() * Inkscape::Util::Quantity::convert(1, "px", "pt"); GtkPaperSize *paper_size; if (doc_width > doc_height) { gtk_page_setup_set_orientation (page_setup, GTK_PAGE_ORIENTATION_LANDSCAPE); diff --git a/src/ui/dialog/text-edit.cpp b/src/ui/dialog/text-edit.cpp index a662495a0..4a25f723b 100644 --- a/src/ui/dialog/text-edit.cpp +++ b/src/ui/dialog/text-edit.cpp @@ -58,7 +58,7 @@ extern "C" { #include "widgets/font-selector.h" #include #include -#include "unit-constants.h" +#include "util/units.h" #include "sp-textpath.h" namespace Inkscape { @@ -401,7 +401,7 @@ void TextEdit::setPreviewText (Glib::ustring font_spec, Glib::ustring phrase) Inkscape::Preferences *prefs = Inkscape::Preferences::get(); int unit = prefs->getInt("/options/font/unitType", SP_CSS_UNIT_PT); - double pt_size = sp_style_css_size_units_to_px(sp_font_selector_get_size(fsel), unit) * PT_PER_PX; + double pt_size = sp_style_css_size_units_to_px(sp_font_selector_get_size(fsel), unit) * Inkscape::Util::Quantity::convert(1, "px", "pt"); // Pango font size is in 1024ths of a point // C++11: Glib::ustring size = std::to_string( pt_size * PANGO_SCALE ); diff --git a/src/ui/widget/rendering-options.cpp b/src/ui/widget/rendering-options.cpp index f26e71553..d6248df69 100644 --- a/src/ui/widget/rendering-options.cpp +++ b/src/ui/widget/rendering-options.cpp @@ -13,7 +13,7 @@ #endif #include "rendering-options.h" -#include "unit-constants.h" +#include "util/units.h" #include namespace Inkscape { @@ -59,8 +59,8 @@ RenderingOptions::RenderingOptions () : _radio_bitmap.signal_toggled().connect(sigc::mem_fun(*this, &RenderingOptions::_toggled)); // configure default DPI - _dpi.setRange(PT_PER_IN,2400.0); - _dpi.setValue(PT_PER_IN); + _dpi.setRange(Inkscape::Util::Quantity::convert(1, "in", "pt"),2400.0); + _dpi.setValue(Inkscape::Util::Quantity::convert(1, "in", "pt")); _dpi.setIncrements(1.0,10.0); _dpi.setDigits(0); _dpi.update(); diff --git a/src/unit-constants.h b/src/unit-constants.h deleted file mode 100644 index c56c0a6e8..000000000 --- a/src/unit-constants.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef INKSCAPE_UNIT_CONSTANTS_H -#define INKSCAPE_UNIT_CONSTANTS_H - -// 72 points per inch divided by the SVG-recommended value of 90 pixels per inch for computer screen -// For now it is constant throughout Inkscape, later we may make it changeable. -// Ideally this should be the only place to change it, but this is not guaranteed (be careful!) -#define DEVICESCALE 0.8 - -#define PT_PER_IN 72.0 -#define PT_PER_PX DEVICESCALE -#define PT_PER_PC 12.0 -#define PX_PER_PT (1/DEVICESCALE) -#define PX_PER_PC (PX_PER_PT * PT_PER_PC) -#define PX_PER_IN (PT_PER_IN / PT_PER_PX) -#define PC_PER_IN (PT_PER_IN / PT_PER_PC) -#define M_PER_IN 0.0254 -#define M_PER_PX (M_PER_IN / PX_PER_IN) -#define CM_PER_IN 2.54 -#define MM_PER_IN 25.4 -#define MM_PER_MM 1.0 -#define MM_PER_CM 10.0 -#define MM_PER_M 1000.0 -#define IN_PER_PT (1 / PT_PER_IN) -#define IN_PER_PX (1 / PX_PER_IN) -#define IN_PER_CM (1 / CM_PER_IN) -#define IN_PER_MM (1 / MM_PER_IN) -#define IN_PER_FT 12.0 -#define FT_PER_IN (1 / IN_PER_FT) -#define PT_PER_CM (PT_PER_IN / CM_PER_IN) -#define PX_PER_CM (PX_PER_IN / CM_PER_IN) -#define M_PER_PT (M_PER_IN / PT_PER_IN) -#define PT_PER_M (PT_PER_IN / M_PER_IN) -#define PX_PER_M (PX_PER_IN / M_PER_IN) -#define CM_PER_PT (CM_PER_IN / PT_PER_IN) -#define CM_PER_PX (CM_PER_IN / PX_PER_IN) -#define MM_PER_PT (MM_PER_IN / PT_PER_IN) -#define PT_PER_MM (PT_PER_IN / MM_PER_IN) -#define PX_PER_MM (PX_PER_IN / MM_PER_IN) -#define MM_PER_PX (MM_PER_IN / PX_PER_IN) -#define PX_PER_FT (PX_PER_IN / FT_PER_IN) -#define PT_PER_PT 1.0 -#define PC_PER_PC 1.0 -#define IN_PER_IN 1.0 -#define PX_PER_PX 1.0 -#define FT_PER_FT 1.0 - -#endif /* !INKSCAPE_UNIT_CONSTANTS_H */ diff --git a/src/widgets/font-selector.cpp b/src/widgets/font-selector.cpp index 7fa848f1e..5f9098d44 100644 --- a/src/widgets/font-selector.cpp +++ b/src/widgets/font-selector.cpp @@ -33,7 +33,6 @@ #include "desktop.h" #include "widgets/font-selector.h" #include "preferences.h" -#include "unit-constants.h" /* SPFontSelector */ -- cgit v1.2.3 From e79e9fe616e5da595551916ad5b9f6cb628dbb49 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Thu, 1 Aug 2013 00:08:04 +0100 Subject: Fix build error (bzr r12442) --- src/color-profile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/color-profile.cpp b/src/color-profile.cpp index 918fc79d4..01e6d7062 100644 --- a/src/color-profile.cpp +++ b/src/color-profile.cpp @@ -4,8 +4,8 @@ #define noDEBUG_LCMS -#include #include +#include #include #include #include -- cgit v1.2.3 From cd953884af566fce30421a9beee6cb71811ca792 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Thu, 1 Aug 2013 12:41:35 -0400 Subject: Improved math formatting. (bzr r12380.1.55) --- src/widgets/select-toolbar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/widgets/select-toolbar.cpp b/src/widgets/select-toolbar.cpp index ab6d6ca3b..b39423635 100644 --- a/src/widgets/select-toolbar.cpp +++ b/src/widgets/select-toolbar.cpp @@ -206,9 +206,9 @@ sp_object_layout_any_value_changed(GtkAdjustment *adj, SPWidget *spw) x0 = bbox_user->min()[Geom::X] * x0_propn; double const y0_propn = gtk_adjustment_get_value (a_y) / 100 / unit.factor; y0 = y0_propn * bbox_user->min()[Geom::Y]; - xrel = gtk_adjustment_get_value (a_w) / 100 / unit.factor; + xrel = gtk_adjustment_get_value (a_w) / (100 / unit.factor); x1 = x0 + xrel * bbox_user->dimensions()[Geom::X]; - yrel = gtk_adjustment_get_value (a_h) / 100 / unit.factor; + yrel = gtk_adjustment_get_value (a_h) / (100 / unit.factor); y1 = y0 + yrel * bbox_user->dimensions()[Geom::Y]; } -- cgit v1.2.3 From aaa29715c3e2e854d6c25b6a3c3216f18824d669 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Thu, 1 Aug 2013 12:44:34 -0400 Subject: Fixed Windows compile bug. (bzr r12380.1.56) --- src/extension/internal/emf-win32-inout.cpp | 13 +++--- src/extension/internal/emf-win32-print.cpp | 70 +++++++++++++++--------------- 2 files changed, 42 insertions(+), 41 deletions(-) (limited to 'src') diff --git a/src/extension/internal/emf-win32-inout.cpp b/src/extension/internal/emf-win32-inout.cpp index 62cb53413..627d78b16 100644 --- a/src/extension/internal/emf-win32-inout.cpp +++ b/src/extension/internal/emf-win32-inout.cpp @@ -39,6 +39,7 @@ #include "display/drawing-item.h" #include "clear-n_.h" #include "document.h" +#include "util/units.h" #define WIN32_LEAN_AND_MEAN #include @@ -59,7 +60,7 @@ namespace Inkscape { namespace Extension { namespace Internal { -static float device_scale = DEVICESCALE; +static float device_scale = Inkscape::Util::Quantity::convert(1, "px", "pt"); static float device_x; static float device_y; static RECTL rc_old; @@ -776,18 +777,18 @@ myEnhMetaFileProc(HDC /*hDC*/, HANDLETABLE * /*lpHTable*/, ENHMETARECORD const * d->dc[d->level].PixelsInX = pEmr->rclFrame.right - pEmr->rclFrame.left; d->dc[d->level].PixelsInY = pEmr->rclFrame.bottom - pEmr->rclFrame.top; - device_x = pEmr->rclFrame.left/100.0*PX_PER_MM; - device_y = pEmr->rclFrame.top/100.0*PX_PER_MM; + device_x = pEmr->rclFrame.left/100.0*Inkscape::Util::Quantity::Convert(1, "mm", "px"); + device_y = pEmr->rclFrame.top/100.0*Inkscape::Util::Quantity::Convert(1, "mm", "px"); d->MMX = d->dc[d->level].PixelsInX / 100.0; d->MMY = d->dc[d->level].PixelsInY / 100.0; - d->dc[d->level].PixelsOutX = d->MMX * PX_PER_MM; - d->dc[d->level].PixelsOutY = d->MMY * PX_PER_MM; + d->dc[d->level].PixelsOutX = d->MMX * Inkscape::Util::Quantity::Convert(1, "mm", "px"); + d->dc[d->level].PixelsOutY = d->MMY * Inkscape::Util::Quantity::Convert(1, "mm", "px"); // calculate ratio of Inkscape dpi/device dpi if (pEmr->szlMillimeters.cx && pEmr->szlDevice.cx) - device_scale = PX_PER_MM*pEmr->szlMillimeters.cx/pEmr->szlDevice.cx; + device_scale = Inkscape::Util::Quantity::Convert(1, "mm", "px")*pEmr->szlMillimeters.cx/pEmr->szlDevice.cx; tmp_outdef << " width=\"" << d->MMX << "mm\"\n" << diff --git a/src/extension/internal/emf-win32-print.cpp b/src/extension/internal/emf-win32-print.cpp index 99f101bb8..8784f4ace 100644 --- a/src/extension/internal/emf-win32-print.cpp +++ b/src/extension/internal/emf-win32-print.cpp @@ -127,7 +127,7 @@ unsigned int PrintEmfWin32::begin (Inkscape::Extension::Print *mod, SPDocument * if (bbox) d = *bbox; } - d *= Geom::Scale(IN_PER_PX); + d *= Geom::Scale(Inkscape::Util::Quantity::Convert(1, "px", "in")); float dwInchesX = d.width(); float dwInchesY = d.height(); @@ -194,7 +194,7 @@ unsigned int PrintEmfWin32::begin (Inkscape::Extension::Print *mod, SPDocument * snprintf(buff, sizeof(buff)-1, "Screen=%dx%dpx, %dx%dmm", PixelsX, PixelsY, MMX, MMY); GdiComment(hdc, strlen(buff), (BYTE*) buff); - snprintf(buff, sizeof(buff)-1, "Drawing=%.1lfx%.1lfpx, %.1lfx%.1lfmm", _width, _height, dwInchesX * MM_PER_IN, dwInchesY * MM_PER_IN); + snprintf(buff, sizeof(buff)-1, "Drawing=%.1lfx%.1lfpx, %.1lfx%.1lfmm", _width, _height, dwInchesX * Inkscape::Util::Quantity::Convert(1, "in", "mm"), dwInchesY * Inkscape::Util::Quantity::Convert(1, "in", "mm")); GdiComment(hdc, strlen(buff), (BYTE*) buff); } @@ -303,7 +303,7 @@ void PrintEmfWin32::create_pen(SPStyle const *style, const Geom::Affine &transfo double scale = sqrt( (p[X]*p[X]) + (p[Y]*p[Y]) ) / sqrt(2); - DWORD linewidth = MAX( 1, (DWORD) (scale * style->stroke_width.computed * IN_PER_PX * dwDPI) ); + DWORD linewidth = MAX( 1, (DWORD) (scale * style->stroke_width.computed * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI) ); if (style->stroke_linecap.computed == 0) { linecap = PS_ENDCAP_FLAT; @@ -340,7 +340,7 @@ void PrintEmfWin32::create_pen(SPStyle const *style, const Geom::Affine &transfo n_dash = style->stroke_dash.n_dash; dash = new DWORD[n_dash]; for (i = 0; i < style->stroke_dash.n_dash; i++) { - dash[i] = (DWORD) (style->stroke_dash.dash[i] * IN_PER_PX * dwDPI); + dash[i] = (DWORD) (style->stroke_dash.dash[i] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); } } } @@ -543,8 +543,8 @@ bool PrintEmfWin32::print_simple_shape(Geom::PathVector const &pathv, const Geom Geom::Point p0 = pit->initialPoint(); - p0[X] = (p0[X] * IN_PER_PX * dwDPI); - p0[Y] = (p0[Y] * IN_PER_PX * dwDPI); + p0[X] = (p0[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p0[Y] = (p0[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); LONG const x0 = (LONG) round(p0[X]); LONG const y0 = (LONG) round(rc.bottom-p0[Y]); @@ -563,10 +563,10 @@ bool PrintEmfWin32::print_simple_shape(Geom::PathVector const &pathv, const Geom //Geom::Point p0 = cit->initialPoint(); Geom::Point p1 = cit->finalPoint(); - //p0[X] = (p0[X] * IN_PER_PX * dwDPI); - p1[X] = (p1[X] * IN_PER_PX * dwDPI); - //p0[Y] = (p0[Y] * IN_PER_PX * dwDPI); - p1[Y] = (p1[Y] * IN_PER_PX * dwDPI); + //p0[X] = (p0[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p1[X] = (p1[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + //p0[Y] = (p0[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p1[Y] = (p1[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); //LONG const x0 = (LONG) round(p0[X]); //LONG const y0 = (LONG) round(rc.bottom-p0[Y]); @@ -585,14 +585,14 @@ bool PrintEmfWin32::print_simple_shape(Geom::PathVector const &pathv, const Geom Geom::Point p2 = points[2]; Geom::Point p3 = points[3]; - //p0[X] = (p0[X] * IN_PER_PX * dwDPI); - p1[X] = (p1[X] * IN_PER_PX * dwDPI); - p2[X] = (p2[X] * IN_PER_PX * dwDPI); - p3[X] = (p3[X] * IN_PER_PX * dwDPI); - //p0[Y] = (p0[Y] * IN_PER_PX * dwDPI); - p1[Y] = (p1[Y] * IN_PER_PX * dwDPI); - p2[Y] = (p2[Y] * IN_PER_PX * dwDPI); - p3[Y] = (p3[Y] * IN_PER_PX * dwDPI); + //p0[X] = (p0[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p1[X] = (p1[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p2[X] = (p2[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p3[X] = (p3[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + //p0[Y] = (p0[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p1[Y] = (p1[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p2[Y] = (p2[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p3[Y] = (p3[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); //LONG const x0 = (LONG) round(p0[X]); //LONG const y0 = (LONG) round(rc.bottom-p0[Y]); @@ -715,8 +715,8 @@ unsigned int PrintEmfWin32::print_pathv(Geom::PathVector const &pathv, const Geo Geom::Point p0 = pit->initialPoint(); - p0[X] = (p0[X] * IN_PER_PX * dwDPI); - p0[Y] = (p0[Y] * IN_PER_PX * dwDPI); + p0[X] = (p0[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p0[Y] = (p0[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); LONG const x0 = (LONG) round(p0[X]); LONG const y0 = (LONG) round(rc.bottom-p0[Y]); @@ -733,10 +733,10 @@ unsigned int PrintEmfWin32::print_pathv(Geom::PathVector const &pathv, const Geo //Geom::Point p0 = cit->initialPoint(); Geom::Point p1 = cit->finalPoint(); - //p0[X] = (p0[X] * IN_PER_PX * dwDPI); - p1[X] = (p1[X] * IN_PER_PX * dwDPI); - //p0[Y] = (p0[Y] * IN_PER_PX * dwDPI); - p1[Y] = (p1[Y] * IN_PER_PX * dwDPI); + //p0[X] = (p0[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p1[X] = (p1[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + //p0[Y] = (p0[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p1[Y] = (p1[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); //LONG const x0 = (LONG) round(p0[X]); //LONG const y0 = (LONG) round(rc.bottom-p0[Y]); @@ -753,14 +753,14 @@ unsigned int PrintEmfWin32::print_pathv(Geom::PathVector const &pathv, const Geo Geom::Point p2 = points[2]; Geom::Point p3 = points[3]; - //p0[X] = (p0[X] * IN_PER_PX * dwDPI); - p1[X] = (p1[X] * IN_PER_PX * dwDPI); - p2[X] = (p2[X] * IN_PER_PX * dwDPI); - p3[X] = (p3[X] * IN_PER_PX * dwDPI); - //p0[Y] = (p0[Y] * IN_PER_PX * dwDPI); - p1[Y] = (p1[Y] * IN_PER_PX * dwDPI); - p2[Y] = (p2[Y] * IN_PER_PX * dwDPI); - p3[Y] = (p3[Y] * IN_PER_PX * dwDPI); + //p0[X] = (p0[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p1[X] = (p1[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p2[X] = (p2[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p3[X] = (p3[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + //p0[Y] = (p0[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p1[Y] = (p1[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p2[Y] = (p2[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p3[Y] = (p3[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); //LONG const x0 = (LONG) round(p0[X]); //LONG const y0 = (LONG) round(rc.bottom-p0[Y]); @@ -828,7 +828,7 @@ unsigned int PrintEmfWin32::text(Inkscape::Extension::Print * /*mod*/, char cons LOGFONTW *lf = (LOGFONTW*)g_malloc(sizeof(LOGFONTW)); g_assert(lf != NULL); - lf->lfHeight = -style->font_size.computed * IN_PER_PX * dwDPI; + lf->lfHeight = -style->font_size.computed * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI; lf->lfWidth = 0; lf->lfEscapement = rot; lf->lfOrientation = rot; @@ -877,8 +877,8 @@ unsigned int PrintEmfWin32::text(Inkscape::Extension::Print * /*mod*/, char cons SetBkMode(hdc, TRANSPARENT); Geom::Point p2 = p * tf; - p2[Geom::X] = (p2[Geom::X] * IN_PER_PX * dwDPI); - p2[Geom::Y] = (p2[Geom::Y] * IN_PER_PX * dwDPI); + p2[Geom::X] = (p2[Geom::X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p2[Geom::Y] = (p2[Geom::Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); LONG const xpos = (LONG) round(p2[Geom::X]); LONG const ypos = (LONG) round(rc.bottom - p2[Geom::Y]); -- cgit v1.2.3 From 5a15ea1a002fa4638198d50182e6fd5847ee9cf9 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Thu, 1 Aug 2013 16:28:56 -0400 Subject: Fixed Windows compile bug. (bzr r12380.1.58) --- src/extension/internal/emf-win32-inout.cpp | 10 ++--- src/extension/internal/emf-win32-print.cpp | 71 +++++++++++++++--------------- 2 files changed, 41 insertions(+), 40 deletions(-) (limited to 'src') diff --git a/src/extension/internal/emf-win32-inout.cpp b/src/extension/internal/emf-win32-inout.cpp index 627d78b16..2530af0cc 100644 --- a/src/extension/internal/emf-win32-inout.cpp +++ b/src/extension/internal/emf-win32-inout.cpp @@ -777,18 +777,18 @@ myEnhMetaFileProc(HDC /*hDC*/, HANDLETABLE * /*lpHTable*/, ENHMETARECORD const * d->dc[d->level].PixelsInX = pEmr->rclFrame.right - pEmr->rclFrame.left; d->dc[d->level].PixelsInY = pEmr->rclFrame.bottom - pEmr->rclFrame.top; - device_x = pEmr->rclFrame.left/100.0*Inkscape::Util::Quantity::Convert(1, "mm", "px"); - device_y = pEmr->rclFrame.top/100.0*Inkscape::Util::Quantity::Convert(1, "mm", "px"); + device_x = pEmr->rclFrame.left/100.0*Inkscape::Util::Quantity::convert(1, "mm", "px"); + device_y = pEmr->rclFrame.top/100.0*Inkscape::Util::Quantity::convert(1, "mm", "px"); d->MMX = d->dc[d->level].PixelsInX / 100.0; d->MMY = d->dc[d->level].PixelsInY / 100.0; - d->dc[d->level].PixelsOutX = d->MMX * Inkscape::Util::Quantity::Convert(1, "mm", "px"); - d->dc[d->level].PixelsOutY = d->MMY * Inkscape::Util::Quantity::Convert(1, "mm", "px"); + d->dc[d->level].PixelsOutX = d->MMX * Inkscape::Util::Quantity::convert(1, "mm", "px"); + d->dc[d->level].PixelsOutY = d->MMY * Inkscape::Util::Quantity::convert(1, "mm", "px"); // calculate ratio of Inkscape dpi/device dpi if (pEmr->szlMillimeters.cx && pEmr->szlDevice.cx) - device_scale = Inkscape::Util::Quantity::Convert(1, "mm", "px")*pEmr->szlMillimeters.cx/pEmr->szlDevice.cx; + device_scale = Inkscape::Util::Quantity::convert(1, "mm", "px")*pEmr->szlMillimeters.cx/pEmr->szlDevice.cx; tmp_outdef << " width=\"" << d->MMX << "mm\"\n" << diff --git a/src/extension/internal/emf-win32-print.cpp b/src/extension/internal/emf-win32-print.cpp index 8784f4ace..dae97fecf 100644 --- a/src/extension/internal/emf-win32-print.cpp +++ b/src/extension/internal/emf-win32-print.cpp @@ -36,6 +36,7 @@ #include "helper/geom.h" #include "helper/geom-curves.h" #include "sp-item.h" +#include "util/units.h" #include "style.h" #include "inkscape-version.h" @@ -127,7 +128,7 @@ unsigned int PrintEmfWin32::begin (Inkscape::Extension::Print *mod, SPDocument * if (bbox) d = *bbox; } - d *= Geom::Scale(Inkscape::Util::Quantity::Convert(1, "px", "in")); + d *= Geom::Scale(Inkscape::Util::Quantity::convert(1, "px", "in")); float dwInchesX = d.width(); float dwInchesY = d.height(); @@ -194,7 +195,7 @@ unsigned int PrintEmfWin32::begin (Inkscape::Extension::Print *mod, SPDocument * snprintf(buff, sizeof(buff)-1, "Screen=%dx%dpx, %dx%dmm", PixelsX, PixelsY, MMX, MMY); GdiComment(hdc, strlen(buff), (BYTE*) buff); - snprintf(buff, sizeof(buff)-1, "Drawing=%.1lfx%.1lfpx, %.1lfx%.1lfmm", _width, _height, dwInchesX * Inkscape::Util::Quantity::Convert(1, "in", "mm"), dwInchesY * Inkscape::Util::Quantity::Convert(1, "in", "mm")); + snprintf(buff, sizeof(buff)-1, "Drawing=%.1lfx%.1lfpx, %.1lfx%.1lfmm", _width, _height, dwInchesX * Inkscape::Util::Quantity::convert(1, "in", "mm"), dwInchesY * Inkscape::Util::Quantity::convert(1, "in", "mm")); GdiComment(hdc, strlen(buff), (BYTE*) buff); } @@ -303,7 +304,7 @@ void PrintEmfWin32::create_pen(SPStyle const *style, const Geom::Affine &transfo double scale = sqrt( (p[X]*p[X]) + (p[Y]*p[Y]) ) / sqrt(2); - DWORD linewidth = MAX( 1, (DWORD) (scale * style->stroke_width.computed * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI) ); + DWORD linewidth = MAX( 1, (DWORD) (scale * style->stroke_width.computed * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI) ); if (style->stroke_linecap.computed == 0) { linecap = PS_ENDCAP_FLAT; @@ -340,7 +341,7 @@ void PrintEmfWin32::create_pen(SPStyle const *style, const Geom::Affine &transfo n_dash = style->stroke_dash.n_dash; dash = new DWORD[n_dash]; for (i = 0; i < style->stroke_dash.n_dash; i++) { - dash[i] = (DWORD) (style->stroke_dash.dash[i] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + dash[i] = (DWORD) (style->stroke_dash.dash[i] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); } } } @@ -543,8 +544,8 @@ bool PrintEmfWin32::print_simple_shape(Geom::PathVector const &pathv, const Geom Geom::Point p0 = pit->initialPoint(); - p0[X] = (p0[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p0[Y] = (p0[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p0[X] = (p0[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p0[Y] = (p0[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); LONG const x0 = (LONG) round(p0[X]); LONG const y0 = (LONG) round(rc.bottom-p0[Y]); @@ -563,10 +564,10 @@ bool PrintEmfWin32::print_simple_shape(Geom::PathVector const &pathv, const Geom //Geom::Point p0 = cit->initialPoint(); Geom::Point p1 = cit->finalPoint(); - //p0[X] = (p0[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p1[X] = (p1[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - //p0[Y] = (p0[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p1[Y] = (p1[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + //p0[X] = (p0[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p1[X] = (p1[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + //p0[Y] = (p0[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p1[Y] = (p1[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); //LONG const x0 = (LONG) round(p0[X]); //LONG const y0 = (LONG) round(rc.bottom-p0[Y]); @@ -585,14 +586,14 @@ bool PrintEmfWin32::print_simple_shape(Geom::PathVector const &pathv, const Geom Geom::Point p2 = points[2]; Geom::Point p3 = points[3]; - //p0[X] = (p0[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p1[X] = (p1[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p2[X] = (p2[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p3[X] = (p3[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - //p0[Y] = (p0[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p1[Y] = (p1[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p2[Y] = (p2[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p3[Y] = (p3[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + //p0[X] = (p0[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p1[X] = (p1[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p2[X] = (p2[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p3[X] = (p3[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + //p0[Y] = (p0[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p1[Y] = (p1[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p2[Y] = (p2[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p3[Y] = (p3[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); //LONG const x0 = (LONG) round(p0[X]); //LONG const y0 = (LONG) round(rc.bottom-p0[Y]); @@ -715,8 +716,8 @@ unsigned int PrintEmfWin32::print_pathv(Geom::PathVector const &pathv, const Geo Geom::Point p0 = pit->initialPoint(); - p0[X] = (p0[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p0[Y] = (p0[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p0[X] = (p0[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p0[Y] = (p0[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); LONG const x0 = (LONG) round(p0[X]); LONG const y0 = (LONG) round(rc.bottom-p0[Y]); @@ -733,10 +734,10 @@ unsigned int PrintEmfWin32::print_pathv(Geom::PathVector const &pathv, const Geo //Geom::Point p0 = cit->initialPoint(); Geom::Point p1 = cit->finalPoint(); - //p0[X] = (p0[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p1[X] = (p1[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - //p0[Y] = (p0[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p1[Y] = (p1[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + //p0[X] = (p0[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p1[X] = (p1[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + //p0[Y] = (p0[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p1[Y] = (p1[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); //LONG const x0 = (LONG) round(p0[X]); //LONG const y0 = (LONG) round(rc.bottom-p0[Y]); @@ -753,14 +754,14 @@ unsigned int PrintEmfWin32::print_pathv(Geom::PathVector const &pathv, const Geo Geom::Point p2 = points[2]; Geom::Point p3 = points[3]; - //p0[X] = (p0[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p1[X] = (p1[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p2[X] = (p2[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p3[X] = (p3[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - //p0[Y] = (p0[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p1[Y] = (p1[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p2[Y] = (p2[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p3[Y] = (p3[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + //p0[X] = (p0[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p1[X] = (p1[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p2[X] = (p2[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p3[X] = (p3[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + //p0[Y] = (p0[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p1[Y] = (p1[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p2[Y] = (p2[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p3[Y] = (p3[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); //LONG const x0 = (LONG) round(p0[X]); //LONG const y0 = (LONG) round(rc.bottom-p0[Y]); @@ -828,7 +829,7 @@ unsigned int PrintEmfWin32::text(Inkscape::Extension::Print * /*mod*/, char cons LOGFONTW *lf = (LOGFONTW*)g_malloc(sizeof(LOGFONTW)); g_assert(lf != NULL); - lf->lfHeight = -style->font_size.computed * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI; + lf->lfHeight = -style->font_size.computed * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI; lf->lfWidth = 0; lf->lfEscapement = rot; lf->lfOrientation = rot; @@ -877,8 +878,8 @@ unsigned int PrintEmfWin32::text(Inkscape::Extension::Print * /*mod*/, char cons SetBkMode(hdc, TRANSPARENT); Geom::Point p2 = p * tf; - p2[Geom::X] = (p2[Geom::X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p2[Geom::Y] = (p2[Geom::Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p2[Geom::X] = (p2[Geom::X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p2[Geom::Y] = (p2[Geom::Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); LONG const xpos = (LONG) round(p2[Geom::X]); LONG const ypos = (LONG) round(rc.bottom - p2[Geom::Y]); -- cgit v1.2.3 From f69ba9fbb46f827a2cb76f2d1f87acbf53edc416 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Thu, 1 Aug 2013 19:42:12 -0400 Subject: Fix UnitTracker percentage bug. (bzr r12380.1.59) --- src/ui/widget/unit-tracker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/ui/widget/unit-tracker.cpp b/src/ui/widget/unit-tracker.cpp index c0d3eec9b..99074be40 100644 --- a/src/ui/widget/unit-tracker.cpp +++ b/src/ui/widget/unit-tracker.cpp @@ -245,7 +245,7 @@ void UnitTracker::_fixupAdjustments(Inkscape::Util::Unit const oldUnit, Inkscape && (newUnit.type != Inkscape::Util::UNIT_TYPE_DIMENSIONLESS) ) { if (_priorValues.find(adj) != _priorValues.end()) { - val = Inkscape::Util::Quantity::convert(_priorValues[adj], newUnit, "px"); + val = Inkscape::Util::Quantity::convert(_priorValues[adj], "px", newUnit); } } else { val = Inkscape::Util::Quantity::convert(oldVal, oldUnit, newUnit); -- cgit v1.2.3 From 4cecaa65b941c6adbd70f2d6e2d6d293b8b916e7 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Sat, 3 Aug 2013 13:32:53 +0100 Subject: Fix attributes test list Fixed bugs: - https://launchpad.net/bugs/1202237 (bzr r12444) --- src/attributes-test.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/attributes-test.h b/src/attributes-test.h index 78e0ea48f..295ad618c 100644 --- a/src/attributes-test.h +++ b/src/attributes-test.h @@ -214,7 +214,7 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"overline-position", true}, {"overline-thickness", true}, {"panose-1", true}, - {"path", false}, + {"path", true}, {"pathLength", false}, {"patternContentUnits", true}, {"patternTransform", true}, @@ -354,7 +354,6 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"inkscape:snap-bbox", true}, {"inkscape:snap-nodes", true}, {"inkscape:snap-others", true}, - {"inkscape:snap-from-guide", true}, {"inkscape:snap-center", true}, {"inkscape:snap-smooth-nodes", true}, {"inkscape:snap-midpoints", true}, @@ -383,6 +382,9 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"inkscape:connector-type", true}, {"inkscape:connection-start", true}, {"inkscape:connection-end", true}, + {"inkscape:connection-points", true}, + {"inkscape:connection-start-point", true}, + {"inkscape:connection-end-point", true}, {"inkscape:connector-curvature", true}, {"inkscape:connector-avoid", true}, {"inkscape:connector-spacing", true}, @@ -429,8 +431,17 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"inkscape:dstColumn", true}, {"inkscape:excludeShape", true}, {"inkscape:layoutOptions", true}, + {"osb:paint", true}, + + /* SPMeshPatch */ + {"tensor", true}, /* SPNamedView */ + {"fit-margin-top", true}, + {"fit-margin-left", true}, + {"fit-margin-right", true}, + {"fit-margin-bottom", true}, + {"units", true}, {"viewonly", true}, {"showgrid", true}, // {"gridtype", true}, -- cgit v1.2.3 From 1a58d13b2b974a9da674311899df9c2e16f3e053 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Sat, 3 Aug 2013 16:35:41 +0100 Subject: Fix return code for extension tests] (bzr r12446) --- src/Makefile.am | 13 ++++++++++++- src/Makefile_insert | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 3a937d58b..3ca99869f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -248,7 +248,18 @@ check_PROGRAMS = cxxtests # List of all tests to be run. TESTS = $(check_PROGRAMS) ../share/extensions/test/run-all-extension-tests -XFAIL_TESTS = $(check_PROGRAMS) ../share/extensions/test/run-all-extension-tests + +# FIXME: Currently, a number of cxxtest tests fail. These should be fixed and +# the XFAIL_TESTS build target should be removed. +# See the following Launchpad bugs: +# +# LP #1202271 +# LP #1208013 +# LP #1208002 +# LP #1208005 +# LP #1207502 + +XFAIL_TESTS = $(check_PROGRAMS) # including the the testsuites here ensures that they get distributed cxxtests_SOURCES = cxxtests.cpp $(CXXTEST_TESTSUITES) diff --git a/src/Makefile_insert b/src/Makefile_insert index 885b89d78..8fc00b2f6 100644 --- a/src/Makefile_insert +++ b/src/Makefile_insert @@ -284,8 +284,8 @@ CXXTEST_TESTSUITES += \ $(srcdir)/extract-uri-test.h \ $(srcdir)/marker-test.h \ $(srcdir)/mod360-test.h \ + $(srcdir)/preferences-test.h \ $(srcdir)/round-test.h \ - $(srcdir)/preferences-test.h \ $(srcdir)/sp-gradient-test.h \ $(srcdir)/sp-style-elem-test.h \ $(srcdir)/style-test.h \ -- cgit v1.2.3 From 6c7ac8dd7e8403645de3090777ed6b50c95420e3 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Sat, 3 Aug 2013 12:21:14 -0400 Subject: Fixed building of tests. (bzr r12380.1.60) --- src/helper/Makefile_insert | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src') diff --git a/src/helper/Makefile_insert b/src/helper/Makefile_insert index 5d1703b5c..4c6437f13 100644 --- a/src/helper/Makefile_insert +++ b/src/helper/Makefile_insert @@ -40,9 +40,3 @@ helper/sp-marshal.cpp: helper/sp-marshal.list helper/sp-marshal.h else mv helper/tmp.sp-marshal.cpp helper/sp-marshal.cpp; fi helper/sp-marshal.cpp helper/sp-marshal.h: helper/sp-marshal.list - -# ###################### -# ### CxxTest stuff #### -# ###################### -CXXTEST_TESTSUITES += \ - $(srcdir)/helper/units-test.h -- cgit v1.2.3 From c935444b90a29e270371f1afee773104dc314e88 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Sat, 3 Aug 2013 12:55:11 -0400 Subject: Fix handling of SVG lengths with spaces [Bug #1208002]. (bzr r12380.1.61) --- src/svg/svg-length.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/svg/svg-length.cpp b/src/svg/svg-length.cpp index 7f93f9f0f..ea438e91a 100644 --- a/src/svg/svg-length.cpp +++ b/src/svg/svg-length.cpp @@ -330,6 +330,8 @@ static unsigned sp_svg_length_read_lff(gchar const *str, SVGLength::Unit *unit, *next = (char *) e + 1; } return 1; + } else if (g_ascii_isspace(e[0])) { + return 0; // spaces are not allowed } else { /* Unitless */ if (unit) { -- cgit v1.2.3 From 25de599c368f7859ec2a8e3e8c128fced3d52a9e Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 3 Aug 2013 21:15:44 +0200 Subject: cppcheck Common realloc mistake: 'qrsData' nulled but not freed upon failure (bzr r12448) --- src/livarot/Shape.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/livarot/Shape.cpp b/src/livarot/Shape.cpp index c29444a33..ab93486e5 100644 --- a/src/livarot/Shape.cpp +++ b/src/livarot/Shape.cpp @@ -130,7 +130,12 @@ Shape::MakeQuickRasterData (bool nVal) if (_has_quick_raster_data == false) { _has_quick_raster_data = true; - qrsData = (quick_raster_data*)realloc(qrsData, maxAr * sizeof(quick_raster_data)); + quick_raster_data* new_qrsData = static_cast(realloc(qrsData, maxAr * sizeof(quick_raster_data))); + if (!new_qrsData) { + g_error("Not enough memory available for reallocating Shape::qrsData"); + } else { + qrsData = new_qrsData; + } } } else -- cgit v1.2.3 From 4870480be25edac321a066a18d5e66f077c355db Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 3 Aug 2013 21:19:41 +0200 Subject: cppcheck fix: Memory leak: rows (bzr r12449) --- src/libgdl/gdl-switcher.c | 97 ++++++++++++++++++++++++----------------------- 1 file changed, 50 insertions(+), 47 deletions(-) (limited to 'src') diff --git a/src/libgdl/gdl-switcher.c b/src/libgdl/gdl-switcher.c index 60d53dd5f..daacebf20 100644 --- a/src/libgdl/gdl-switcher.c +++ b/src/libgdl/gdl-switcher.c @@ -370,62 +370,65 @@ layout_buttons (GdlSwitcher *switcher) if (last_buttons_height > switcher->priv->buttons_height_request) { gtk_widget_queue_resize (GTK_WIDGET (switcher)); - return -1; + y = -1; // set return value } - - /* Layout the buttons. */ - for (i = row_last; i >= 0; i --) { - int len, extra_width; - - y -= max_btn_height; - - /* Check for possible size over flow (taking into account client - * requisition - */ - if (y < (allocation.y + client_requisition.height)) { - /* We have an overflow: Insufficient allocation */ - if (last_buttons_height < switcher->priv->buttons_height_request) { - /* Request for a new resize */ - gtk_widget_queue_resize (GTK_WIDGET (switcher)); - return -1; - } - } - x = H_PADDING + allocation.x; - len = g_slist_length (rows[i]); - if (switcher_style == GDL_SWITCHER_STYLE_TEXT || - switcher_style == GDL_SWITCHER_STYLE_BOTH) - extra_width = (allocation.width - (len * max_btn_width ) - - (len * H_PADDING)) / len; - else - extra_width = 0; - for (p = rows [i]; p != NULL; p = p->next) { - GtkAllocation child_allocation; + else + { + /* Layout the buttons. */ + for (i = row_last; i >= 0; i --) { + int len, extra_width; - child_allocation.x = x; - child_allocation.y = y; - if (rows_count == 1 && row_number == 0) - { - GtkRequisition child_requisition; - gtk_widget_size_request (GTK_WIDGET (p->data), - &child_requisition); - child_allocation.width = child_requisition.width; + y -= max_btn_height; + + /* Check for possible size over flow (taking into account client + * requisition + */ + if (y < (allocation.y + client_requisition.height)) { + /* We have an overflow: Insufficient allocation */ + if (last_buttons_height < switcher->priv->buttons_height_request) { + /* Request for a new resize */ + gtk_widget_queue_resize (GTK_WIDGET (switcher)); + return -1; + } } + x = H_PADDING + allocation.x; + len = g_slist_length (rows[i]); + if (switcher_style == GDL_SWITCHER_STYLE_TEXT || + switcher_style == GDL_SWITCHER_STYLE_BOTH) + extra_width = (allocation.width - (len * max_btn_width ) + - (len * H_PADDING)) / len; else - { - child_allocation.width = max_btn_width + extra_width; + extra_width = 0; + for (p = rows [i]; p != NULL; p = p->next) { + GtkAllocation child_allocation; + + child_allocation.x = x; + child_allocation.y = y; + if (rows_count == 1 && row_number == 0) + { + GtkRequisition child_requisition; + gtk_widget_size_request (GTK_WIDGET (p->data), + &child_requisition); + child_allocation.width = child_requisition.width; + } + else + { + child_allocation.width = max_btn_width + extra_width; + } + child_allocation.height = max_btn_height; + + gtk_widget_size_allocate (GTK_WIDGET (p->data), &child_allocation); + + x += child_allocation.width + H_PADDING; } - child_allocation.height = max_btn_height; - - gtk_widget_size_allocate (GTK_WIDGET (p->data), &child_allocation); - x += child_allocation.width + H_PADDING; + y -= V_PADDING; } - - y -= V_PADDING; } - - for (i = 0; i <= row_last; i ++) + + for (i = 0; i <= row_last; i ++) { g_slist_free (rows [i]); + } g_free (rows); return y; -- cgit v1.2.3 From 1a96b84e5e99905288a9531914926d4318a198ca Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Sat, 3 Aug 2013 15:24:06 -0400 Subject: pdf import. re-define tiling pattern scaling matrix (Bug 1168908) Fixed bugs: - https://launchpad.net/bugs/1168908 (bzr r12450) --- src/extension/internal/pdfinput/svg-builder.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp index 75849f6cc..165dd38fe 100644 --- a/src/extension/internal/pdfinput/svg-builder.cpp +++ b/src/extension/internal/pdfinput/svg-builder.cpp @@ -676,7 +676,25 @@ gchar *SvgBuilder::_createTilingPattern(GfxTilingPattern *tiling_pattern, Inkscape::XML::Node *pattern_node = _xml_doc->createElement("svg:pattern"); // Set pattern transform matrix double *p2u = tiling_pattern->getMatrix(); - Geom::Affine pat_matrix(p2u[0], p2u[1], p2u[2], p2u[3], p2u[4], p2u[5]); + double m[6] = {1, 0, 0, 1, 0, 0}; + double det; + det = ttm[0] * ttm[3] - ttm[1] * ttm[2]; // see LP Bug 1168908 + if (det) { + double ittm[6]; // invert ttm + ittm[0] = ttm[3] / det; + ittm[1] = -ttm[1] / det; + ittm[2] = -ttm[2] / det; + ittm[3] = ttm[0] / det; + ittm[4] = (ttm[2] * ttm[5] - ttm[3] * ttm[4]) / det; + ittm[5] = (ttm[1] * ttm[4] - ttm[0] * ttm[5]) / det; + m[0] = p2u[0] * ittm[0] + p2u[1] * ittm[2]; + m[1] = p2u[0] * ittm[1] + p2u[1] * ittm[3]; + m[2] = p2u[2] * ittm[0] + p2u[3] * ittm[2]; + m[3] = p2u[2] * ittm[1] + p2u[3] * ittm[3]; + m[4] = p2u[4] * ittm[0] + p2u[5] * ittm[2] + ittm[4]; + m[5] = p2u[4] * ittm[1] + p2u[5] * ittm[3] + ittm[5]; + } + Geom::Affine pat_matrix(m[0], m[1], m[2], m[3], m[4], m[5]); gchar *transform_text = sp_svg_transform_write(pat_matrix); pattern_node->setAttribute("patternTransform", transform_text); g_free(transform_text); -- cgit v1.2.3 From efc2e9140b02c4042254d7a829dcff904f3631bf Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 3 Aug 2013 21:25:18 +0200 Subject: add comment. cppcheck false positive (bzr r12451) --- src/syseq.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/syseq.h b/src/syseq.h index 029f27a91..4e7ccd943 100644 --- a/src/syseq.h +++ b/src/syseq.h @@ -289,7 +289,7 @@ template SolutionKind gaussjord_solve (double A[S][T], double x[T * afterwards copy the result back to x */ double w[S]; - SysEq::multiply(B,x,w); + SysEq::multiply(B,x,w); // initializes w for (int j = 0; j < S; ++j) { x[cols[j]] = w[j]; } -- cgit v1.2.3 From 6e0c3f93c7ea02b0c072ee9c8b56a3a4e5fcfe31 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 3 Aug 2013 21:40:28 +0200 Subject: disable really bad memset on a huge struct that contains member objects besides just integers and enums (bzr r12452) --- src/style.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/style.cpp b/src/style.cpp index 479f30597..a9861f918 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -2945,14 +2945,19 @@ sp_style_clear(SPStyle *style) style->stroke.clear(); sp_style_filter_clear(style); + style->release_connection.disconnect(); + + style->fill_ps_modified_connection.disconnect(); if (style->fill.value.href) { delete style->fill.value.href; style->fill.value.href = NULL; } + style->stroke_ps_modified_connection.disconnect(); if (style->stroke.value.href) { delete style->stroke.value.href; style->stroke.value.href = NULL; } + style->filter_modified_connection.disconnect(); if (style->filter.href) { delete style->filter.href; style->filter.href = NULL; @@ -2972,8 +2977,9 @@ sp_style_clear(SPStyle *style) SPTextStyle *text = style->text; unsigned const text_private = style->text_private; - memset(style, 0, sizeof(SPStyle)); - + // this looks really bad! you can't just 0 *all* data in the whole struct! + // memset(style, 0, sizeof(SPStyle)); + style->refcount = refcount; style->object = object; style->document = document; -- cgit v1.2.3 From 47c02c0f9922bea72c73dacc1e0bb1790c259837 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 3 Aug 2013 21:59:58 +0200 Subject: init members (bzr r12453) --- src/livarot/Shape.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/livarot/Shape.cpp b/src/livarot/Shape.cpp index ab93486e5..628e0fe9f 100644 --- a/src/livarot/Shape.cpp +++ b/src/livarot/Shape.cpp @@ -20,7 +20,12 @@ */ Shape::Shape() - : qrsData(NULL), + : nbQRas(0), + firstQRas(-1), + lastQRas(-1), + qrsData(NULL), + nbInc(0), + maxInc(0), iData(NULL), sTree(NULL), sEvts(NULL), -- cgit v1.2.3 From 75df8b344627054c25384316c850c8c7b3202e4d Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 3 Aug 2013 22:08:57 +0200 Subject: remove unused variable (bzr r12454) --- src/widgets/desktop-widget.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/widgets/desktop-widget.h b/src/widgets/desktop-widget.h index 9031ac854..58739cf3b 100644 --- a/src/widgets/desktop-widget.h +++ b/src/widgets/desktop-widget.h @@ -129,7 +129,6 @@ struct SPDesktopWidget { struct WidgetStub : public Inkscape::UI::View::EditWidgetInterface { SPDesktopWidget *_dtw; - SPDesktop *_dt; WidgetStub (SPDesktopWidget* dtw) : _dtw(dtw) {} virtual void setTitle (gchar const *uri) -- cgit v1.2.3 From de2fd07b4247cd8ee7d9d4f29bdbe73b8b959d9c Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 3 Aug 2013 22:14:26 +0200 Subject: function cleanup (bzr r12455) --- src/libcroco/cr-attr-sel.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src') diff --git a/src/libcroco/cr-attr-sel.c b/src/libcroco/cr-attr-sel.c index 3c4800e66..0726f0f3e 100644 --- a/src/libcroco/cr-attr-sel.c +++ b/src/libcroco/cr-attr-sel.c @@ -208,8 +208,5 @@ cr_attr_sel_destroy (CRAttrSel * a_this) a_this->next = NULL; } - if (a_this) { - g_free (a_this); - a_this = NULL; - } + g_free (a_this); } -- cgit v1.2.3 From 56c3e481fc471764c4445ca7be1c24099b1885d3 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 3 Aug 2013 22:24:34 +0200 Subject: cleanup (bzr r12456) --- src/libcroco/cr-om-parser.c | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/libcroco/cr-om-parser.c b/src/libcroco/cr-om-parser.c index b8d70e35a..c9ce032af 100644 --- a/src/libcroco/cr-om-parser.c +++ b/src/libcroco/cr-om-parser.c @@ -217,9 +217,9 @@ start_font_face (CRDocHandler * a_this, ParsingContext **ctxtptr = NULL; UNUSED(a_location); - g_return_if_fail (a_this); - ctxtptr = &ctxt; + + ctxtptr = &ctxt; status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); g_return_if_fail (status == CR_OK && ctxt); g_return_if_fail (ctxt->cur_stmt == NULL); @@ -316,9 +316,9 @@ charset (CRDocHandler * a_this, CRString * a_charset, ParsingContext **ctxtptr = NULL; UNUSED(a_location); - g_return_if_fail (a_this); - ctxtptr = &ctxt; + + ctxtptr = &ctxt; status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); g_return_if_fail (status == CR_OK && ctxt); g_return_if_fail (ctxt->stylesheet); @@ -352,9 +352,9 @@ start_page (CRDocHandler * a_this, ParsingContext **ctxtptr = NULL; UNUSED(a_location); - g_return_if_fail (a_this); - ctxtptr = &ctxt; + + ctxtptr = &ctxt; status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); g_return_if_fail (status == CR_OK && ctxt); g_return_if_fail (ctxt->cur_stmt == NULL); @@ -395,8 +395,11 @@ end_page (CRDocHandler * a_this, ParsingContext **ctxtptr = NULL; CRStatement *stmt = NULL; + UNUSED(a_page); + UNUSED(a_pseudo_page); g_return_if_fail (a_this); - ctxtptr = &ctxt; + + ctxtptr = &ctxt; status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); g_return_if_fail (status == CR_OK && ctxt); g_return_if_fail (ctxt->cur_stmt @@ -416,8 +419,6 @@ end_page (CRDocHandler * a_this, cr_statement_destroy (ctxt->cur_stmt); ctxt->cur_stmt = NULL; } - a_page = NULL; /*keep compiler happy */ - a_pseudo_page = NULL; /*keep compiler happy */ } static void @@ -431,9 +432,9 @@ start_media (CRDocHandler * a_this, GList *media_list = NULL; UNUSED(a_location); - g_return_if_fail (a_this); - ctxtptr = &ctxt; + + ctxtptr = &ctxt; status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); g_return_if_fail (status == CR_OK && ctxt); @@ -443,12 +444,10 @@ start_media (CRDocHandler * a_this, && ctxt->stylesheet); if (a_media_list) { /*duplicate the media_list */ - media_list = cr_utils_dup_glist_of_cr_string - (a_media_list); + media_list = cr_utils_dup_glist_of_cr_string(a_media_list); } ctxt->cur_media_stmt = - cr_statement_new_at_media_rule - (ctxt->stylesheet, NULL, media_list); + cr_statement_new_at_media_rule(ctxt->stylesheet, NULL, media_list); } @@ -460,8 +459,10 @@ end_media (CRDocHandler * a_this, GList * a_media_list) ParsingContext **ctxtptr = NULL; CRStatement *stmts = NULL; + UNUSED(a_media_list); g_return_if_fail (a_this); - ctxtptr = &ctxt; + + ctxtptr = &ctxt; status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); g_return_if_fail (status == CR_OK && ctxt); g_return_if_fail (ctxt @@ -481,7 +482,6 @@ end_media (CRDocHandler * a_this, GList * a_media_list) ctxt->cur_stmt = NULL ; ctxt->cur_media_stmt = NULL ; - a_media_list = NULL; } static void @@ -499,10 +499,11 @@ import_style (CRDocHandler * a_this, ParsingContext **ctxtptr = NULL; GList *media_list = NULL ; + UNUSED(a_uri_default_ns); UNUSED(a_location); - g_return_if_fail (a_this); - ctxtptr = &ctxt; + + ctxtptr = &ctxt; status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); g_return_if_fail (status == CR_OK && ctxt); g_return_if_fail (ctxt->stylesheet); @@ -574,8 +575,10 @@ end_selector (CRDocHandler * a_this, CRSelector * a_selector_list) ParsingContext *ctxt = NULL; ParsingContext **ctxtptr = NULL; + UNUSED(a_selector_list); g_return_if_fail (a_this); - ctxtptr = &ctxt; + + ctxtptr = &ctxt; status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); g_return_if_fail (status == CR_OK && ctxt); g_return_if_fail (ctxt->cur_stmt && ctxt->stylesheet); -- cgit v1.2.3 From 00bcfb34fab1de3317781d0d639ef1bb54fb4f7e Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 3 Aug 2013 22:27:27 +0200 Subject: fix bug (bzr r12457) --- src/libcroco/cr-prop-list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/libcroco/cr-prop-list.c b/src/libcroco/cr-prop-list.c index 076837905..551f0b8ee 100644 --- a/src/libcroco/cr-prop-list.c +++ b/src/libcroco/cr-prop-list.c @@ -48,7 +48,7 @@ cr_prop_list_allocate (void) } memset (result, 0, sizeof (CRPropList)); PRIVATE (result) = (CRPropListPriv *)g_try_malloc (sizeof (CRPropListPriv)); - if (!result) { + if (!PRIVATE (result)) { cr_utils_trace_info ("could not allocate CRPropListPriv"); g_free (result); return NULL; -- cgit v1.2.3 From 4a914e1f02d9ccb70858031f89e11ad480286413 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 3 Aug 2013 22:35:52 +0200 Subject: some code cleanup, trying to get it through cppcheck (bzr r12458) --- src/libcroco/cr-parser.c | 5 +---- src/libcroco/cr-simple-sel.c | 9 ++++----- src/libcroco/cr-statement.c | 13 +++++++------ src/libcroco/cr-term.c | 7 ++----- 4 files changed, 14 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/libcroco/cr-parser.c b/src/libcroco/cr-parser.c index a8e2de5a3..917c5cb60 100644 --- a/src/libcroco/cr-parser.c +++ b/src/libcroco/cr-parser.c @@ -4402,8 +4402,5 @@ cr_parser_destroy (CRParser * a_this) PRIVATE (a_this) = NULL; } - if (a_this) { - g_free (a_this); - a_this = NULL; /*useless. Just for the sake of coherence */ - } + g_free (a_this); } diff --git a/src/libcroco/cr-simple-sel.c b/src/libcroco/cr-simple-sel.c index 18dd340d8..6a51a9526 100644 --- a/src/libcroco/cr-simple-sel.c +++ b/src/libcroco/cr-simple-sel.c @@ -275,12 +275,12 @@ cr_simple_sel_compute_specificity (CRSimpleSel * a_this) /** *The destructor of the current instance of - *#CRSimpleSel. + *#CRSimpleSel. Recursively calls the destructor of #CRSimpleSel->next *@param a_this the this pointer of the current instance of #CRSimpleSel. * */ void -cr_simple_sel_destroy (CRSimpleSel * a_this) +cr_simple_sel_destroy (CRSimpleSel * const a_this) { g_return_if_fail (a_this); @@ -296,9 +296,8 @@ cr_simple_sel_destroy (CRSimpleSel * a_this) if (a_this->next) { cr_simple_sel_destroy (a_this->next); + a_this->next = NULL; } - if (a_this) { - g_free (a_this); - } + g_free (a_this); } diff --git a/src/libcroco/cr-statement.c b/src/libcroco/cr-statement.c index 40df49878..2b2c1836c 100644 --- a/src/libcroco/cr-statement.c +++ b/src/libcroco/cr-statement.c @@ -604,7 +604,10 @@ cr_statement_ruleset_to_string (CRStatement * a_this, glong a_indent) g_return_val_if_fail (a_this && a_this->type == RULESET_STMT, NULL); - GString *stringue = (GString *)g_string_new (NULL); + GString * stringue = (GString *)g_string_new (NULL); + if (!stringue) { + return result; + } if (a_this->kind.ruleset->sel_list) { if (a_indent) @@ -635,10 +638,9 @@ cr_statement_ruleset_to_string (CRStatement * a_this, glong a_indent) g_string_append (stringue, "}"); result = stringue->str; - if (stringue) { - g_string_free (stringue, FALSE); - stringue = NULL; - } + g_string_free (stringue, FALSE); + stringue = NULL; + if (tmp_str) { g_free (tmp_str); tmp_str = NULL; @@ -1377,7 +1379,6 @@ cr_statement_at_import_rule_parse_from_buf (const guchar * a_buf, } if (media_list) { GList *cur = NULL; - for (cur = media_list; media_list; media_list = g_list_next (media_list)) { if (media_list->data) { diff --git a/src/libcroco/cr-term.c b/src/libcroco/cr-term.c index d95c4979f..635577334 100644 --- a/src/libcroco/cr-term.c +++ b/src/libcroco/cr-term.c @@ -771,7 +771,7 @@ cr_term_unref (CRTerm * a_this) *of #CRTerm. */ void -cr_term_destroy (CRTerm * a_this) +cr_term_destroy (CRTerm * const a_this) { g_return_if_fail (a_this); @@ -782,8 +782,5 @@ cr_term_destroy (CRTerm * a_this) a_this->next = NULL; } - if (a_this) { - g_free (a_this); - } - + g_free (a_this); } -- cgit v1.2.3 From c102402e576d82a87d46026f108d636f70c6a6f8 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 3 Aug 2013 22:44:24 +0200 Subject: fix initialization (bzr r12459) --- src/trace/pool.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/trace/pool.h b/src/trace/pool.h index d072a460b..88fd82bcd 100644 --- a/src/trace/pool.h +++ b/src/trace/pool.h @@ -59,17 +59,21 @@ class pool { public: pool() - { + { cblock = 0; size = sizeof(T) > sizeof(void *) ? sizeof(T) : sizeof(void *); next = NULL; - } + for (int k = 0; k < 64; k++) { + block[k] = NULL; + } + } ~pool() - { - for (int k = 0; k < cblock; k++) - free(block[k]); - } + { + for (int k = 0; k < cblock; k++) { + free(block[k]); + } + } T *draw() { @@ -89,7 +93,7 @@ class pool { int size; int cblock; - void *block[64]; //enough to store unlimited number of objects + void *block[64]; //enough to store unlimited number of objects, if 64 is changed: see constructor too void *next; void addblock() -- cgit v1.2.3 From 84ef605959069b0d7bebc61b5c08e2b34ef55945 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 3 Aug 2013 22:45:01 +0200 Subject: fix initialization (bzr r12460) --- src/ui/widget/registered-widget.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/ui/widget/registered-widget.h b/src/ui/widget/registered-widget.h index fa35b815e..18a84ea05 100644 --- a/src/ui/widget/registered-widget.h +++ b/src/ui/widget/registered-widget.h @@ -128,6 +128,7 @@ private: repr = NULL; doc = NULL; write_undo = false; + event_type = -1; } }; -- cgit v1.2.3 From 2580137d7c69ba5752ca7ce698d6cf104ff7f00c Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 3 Aug 2013 22:57:37 +0200 Subject: fix small "performance" issues (cppcheck) (bzr r12461) --- src/livarot/Path.cpp | 16 ++++++++-------- src/livarot/PathConversion.cpp | 21 ++++++--------------- src/livarot/PathCutting.cpp | 6 +++--- src/livarot/PathOutline.cpp | 3 +-- src/livarot/ShapeRaster.cpp | 6 ++---- src/livarot/ShapeSweep.cpp | 6 ++---- 6 files changed, 22 insertions(+), 36 deletions(-) (limited to 'src') diff --git a/src/livarot/Path.cpp b/src/livarot/Path.cpp index 88d397864..68891e4aa 100644 --- a/src/livarot/Path.cpp +++ b/src/livarot/Path.cpp @@ -28,7 +28,7 @@ Path::Path() Path::~Path() { - for (std::vector::iterator i = descr_cmd.begin(); i != descr_cmd.end(); i++) { + for (std::vector::iterator i = descr_cmd.begin(); i != descr_cmd.end(); ++i) { delete *i; } } @@ -37,7 +37,7 @@ Path::~Path() void Path::Affiche() { std::cout << "path: " << descr_cmd.size() << " commands." << std::endl; - for (std::vector::const_iterator i = descr_cmd.begin(); i != descr_cmd.end(); i++) { + for (std::vector::const_iterator i = descr_cmd.begin(); i != descr_cmd.end(); ++i) { (*i)->dump(std::cout); std::cout << std::endl; } @@ -47,7 +47,7 @@ void Path::Affiche() void Path::Reset() { - for (std::vector::iterator i = descr_cmd.begin(); i != descr_cmd.end(); i++) { + for (std::vector::iterator i = descr_cmd.begin(); i != descr_cmd.end(); ++i) { delete *i; } @@ -61,7 +61,7 @@ void Path::Copy(Path * who) { ResetPoints(); - for (std::vector::iterator i = descr_cmd.begin(); i != descr_cmd.end(); i++) { + for (std::vector::iterator i = descr_cmd.begin(); i != descr_cmd.end(); ++i) { delete *i; } @@ -69,7 +69,7 @@ void Path::Copy(Path * who) for (std::vector::const_iterator i = who->descr_cmd.begin(); i != who->descr_cmd.end(); - i++) + ++i) { descr_cmd.push_back((*i)->clone()); } @@ -496,9 +496,9 @@ void Path::PolylineBoundingBox(double &l, double &t, double &r, double &b) std::vector::const_iterator i = pts.begin(); l = r = i->p[Geom::X]; t = b = i->p[Geom::Y]; - i++; + ++i; - for (; i != pts.end(); i++) { + for (; i != pts.end(); ++i) { r = std::max(r, i->p[Geom::X]); l = std::min(l, i->p[Geom::X]); b = std::max(b, i->p[Geom::Y]); @@ -701,7 +701,7 @@ void Path::PointAndTangentAt(int piece, double at, Geom::Point &pos, Geom::Point void Path::Transform(const Geom::Affine &trans) { - for (std::vector::iterator i = descr_cmd.begin(); i != descr_cmd.end(); i++) { + for (std::vector::iterator i = descr_cmd.begin(); i != descr_cmd.end(); ++i) { (*i)->transform(trans); } } diff --git a/src/livarot/PathConversion.cpp b/src/livarot/PathConversion.cpp index ed5f03f80..8d36dca4c 100644 --- a/src/livarot/PathConversion.cpp +++ b/src/livarot/PathConversion.cpp @@ -119,15 +119,12 @@ void Path::ConvertWithBackData(double treshhold) if ( nbInterm >= 1 ) { Geom::Point bx = curX; - Geom::Point cx = curX; - Geom::Point dx = curX; + Geom::Point dx = nData->p; + Geom::Point cx = 2 * bx - dx; - dx = nData->p; ip++; nData = dynamic_cast(descr_cmd[ip]); - cx = 2 * bx - dx; - for (int k = 0; k < nbInterm - 1; k++) { bx = cx; cx = dx; @@ -323,15 +320,12 @@ void Path::Convert(double treshhold) RecBezierTo(midX, curX, nextX, treshhold, 8); } else if ( nbInterm > 1 ) { Geom::Point bx = curX; - Geom::Point cx = curX; - Geom::Point dx = curX; + Geom::Point dx = nData->p; + Geom::Point cx = 2 * bx - dx; - dx = nData->p; ip++; nData = dynamic_cast(descr_cmd[ip]); - cx = 2 * bx - dx; - for (int k = 0; k < nbInterm - 1; k++) { bx = cx; cx = dx; @@ -565,15 +559,12 @@ void Path::ConvertEvenLines(double treshhold) RecBezierTo(midX, curX, nextX, treshhold, 8, 4 * treshhold); } else if ( nbInterm > 1 ) { Geom::Point bx = curX; - Geom::Point cx = curX; - Geom::Point dx = curX; + Geom::Point dx = nData->p; + Geom::Point cx = 2 * bx - dx; - dx = nData->p; ip++; nData = dynamic_cast(descr_cmd[ip]); - cx = 2 * bx - dx; - for (int k = 0; k < nbInterm - 1; k++) { bx = cx; cx = dx; diff --git a/src/livarot/PathCutting.cpp b/src/livarot/PathCutting.cpp index 848d8daa8..3ce907bf3 100644 --- a/src/livarot/PathCutting.cpp +++ b/src/livarot/PathCutting.cpp @@ -482,7 +482,7 @@ double Path::Length() Geom::Point lastP = pts[0].p; double len = 0; - for (std::vector::const_iterator i = pts.begin(); i != pts.end(); i++) { + for (std::vector::const_iterator i = pts.begin(); i != pts.end(); ++i) { if ( i->isMoveTo != polyline_moveto ) { len += Geom::L2(i->p - lastP); @@ -505,7 +505,7 @@ double Path::Surface() Geom::Point lastP = lastM; double surf = 0; - for (std::vector::const_iterator i = pts.begin(); i != pts.end(); i++) { + for (std::vector::const_iterator i = pts.begin(); i != pts.end(); ++i) { if ( i->isMoveTo == polyline_moveto ) { surf += Geom::cross(lastM - lastP, lastM); @@ -900,7 +900,7 @@ Path::cut_position* Path::CurvilignToPosition(int nbCv, double *cvAbs, int &nbCu Geom::Point lastM = pts[0].p; Geom::Point lastP = lastM; - for (std::vector::const_iterator i = pts.begin(); i != pts.end(); i++) { + for (std::vector::const_iterator i = pts.begin(); i != pts.end(); ++i) { if ( i->isMoveTo == polyline_moveto ) { diff --git a/src/livarot/PathOutline.cpp b/src/livarot/PathOutline.cpp index 7f8853e31..3b5ce79f9 100644 --- a/src/livarot/PathOutline.cpp +++ b/src/livarot/PathOutline.cpp @@ -709,9 +709,8 @@ void Path::SubContractOutline(int off, int num_pd, } else if (nbInterm > 1) { Geom::Point bx=curX; Geom::Point cx=curX; - Geom::Point dx=curX; + Geom::Point dx=nData->p; - dx = nData->p; TangentOnBezAt (0.0, curX, *nData, *nBData, false, stPos, stTgt, stTle, stRad); stNor=stTgt.cw(); diff --git a/src/livarot/ShapeRaster.cpp b/src/livarot/ShapeRaster.cpp index b7b087fba..4c5bdc1ac 100644 --- a/src/livarot/ShapeRaster.cpp +++ b/src/livarot/ShapeRaster.cpp @@ -1131,8 +1131,7 @@ void Shape::Scan(float &pos, int &curP, float to, AlphaLigne *line, bool exact, int curPt = curP; while ( curPt < numberOfPoints() && getPoint(curPt).x[1] <= to ) { - int nPt = -1; - nPt = curPt++; + int nPt = curPt++; int nbUp; int nbDn; @@ -1435,8 +1434,7 @@ void Shape::QuickScan(float &pos, int &curP, float to, FillRule directed, BitLig int curPt = curP; while ( curPt < numberOfPoints() && getPoint(curPt).x[1] <= to ) { - int nPt = -1; - nPt = curPt++; + int nPt = curPt++; int nbUp; int nbDn; diff --git a/src/livarot/ShapeSweep.cpp b/src/livarot/ShapeSweep.cpp index c2fd83e31..ff58b4a71 100644 --- a/src/livarot/ShapeSweep.cpp +++ b/src/livarot/ShapeSweep.cpp @@ -252,8 +252,7 @@ Shape::ConvertToShape (Shape * a, FillRule directed, bool invert) Geom::Point rPtX; rPtX[0]= Round (ptX[0]); rPtX[1]= Round (ptX[1]); - int lastPointNo = -1; - lastPointNo = AddPoint (rPtX); + int lastPointNo = AddPoint (rPtX); pData[lastPointNo].rx = rPtX; if (rPtX[1] > lastChange) @@ -1053,8 +1052,7 @@ Shape::Booleen (Shape * a, Shape * b, BooleanOp mod,int cutPathID) Geom::Point rPtX; rPtX[0]= Round (ptX[0]); rPtX[1]= Round (ptX[1]); - int lastPointNo = -1; - lastPointNo = AddPoint (rPtX); + int lastPointNo = AddPoint (rPtX); pData[lastPointNo].rx = rPtX; if (rPtX[1] > lastChange) -- cgit v1.2.3 From 04eec6c234200e1978bd779613cc463929e50d19 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 3 Aug 2013 23:09:02 +0200 Subject: rename variable for clarity (bzr r12462) --- src/ui/dialog/livepatheffect-editor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp index e6bb9b43d..6c6f3a582 100644 --- a/src/ui/dialog/livepatheffect-editor.cpp +++ b/src/ui/dialog/livepatheffect-editor.cpp @@ -448,9 +448,9 @@ LivePathEffectEditor::onAdd() // run sp_selection_clone_original_path_lpe sp_selection_clone_original_path_lpe(current_desktop); - item = sel->singleItem(); - item->getRepr()->setAttribute("id", id); - item->getRepr()->setAttribute("transform", transform); + SPItem *new_item = sel->singleItem(); + new_item->getRepr()->setAttribute("id", id); + new_item->getRepr()->setAttribute("transform", transform); g_free(id); g_free(transform); -- cgit v1.2.3 From 013e92537296f6ba2434e29a96d18eeb353d9560 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 3 Aug 2013 23:30:12 +0200 Subject: reduce scope of variables (bzr r12463) --- src/ege-select-one-action.cpp | 3 +-- src/lpe-tool-context.cpp | 18 ++++++++---------- src/marker.cpp | 6 ++---- src/measure-context.cpp | 1 - src/object-snapper.cpp | 3 +-- src/rdf.cpp | 3 +-- 6 files changed, 13 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/ege-select-one-action.cpp b/src/ege-select-one-action.cpp index 871b961bd..184d1afb4 100644 --- a/src/ege-select-one-action.cpp +++ b/src/ege-select-one-action.cpp @@ -640,7 +640,6 @@ GtkWidget* create_tool_item( GtkAction* action ) #endif GtkRadioAction* ract = 0; - GtkWidget* sub = 0; GSList* group = 0; GtkTreeIter iter; gboolean valid = FALSE; @@ -727,7 +726,7 @@ GtkWidget* create_tool_item( GtkAction* action ) } g_signal_connect( G_OBJECT(ract), "changed", G_CALLBACK( proxy_action_chagned_cb ), act ); - sub = gtk_action_create_tool_item( GTK_ACTION(ract) ); + GtkWidget* sub = gtk_action_create_tool_item( GTK_ACTION(ract) ); gtk_activatable_set_related_action( GTK_ACTIVATABLE (sub), GTK_ACTION(ract) ); gtk_tool_item_set_tooltip_text( GTK_TOOL_ITEM(sub), tip ); diff --git a/src/lpe-tool-context.cpp b/src/lpe-tool-context.cpp index feabfa02d..e7393b97b 100644 --- a/src/lpe-tool-context.cpp +++ b/src/lpe-tool-context.cpp @@ -482,21 +482,19 @@ void lpetool_update_measuring_items(SPLPEToolContext *lc) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - SPPath *path; - SPCurve *curve; - double lengthval; - gchar *arc_length; - std::map::iterator i; - for (i = lc->measuring_items->begin(); i != lc->measuring_items->end(); ++i) { - path = i->first; - curve = SP_SHAPE(path)->getCurve(); + for ( std::map::iterator i = lc->measuring_items->begin(); + i != lc->measuring_items->end(); + ++i ) + { + SPPath *path = i->first; + SPCurve *curve = SP_SHAPE(path)->getCurve(); Geom::Piecewise > pwd2 = Geom::paths_to_pw(curve->get_pathvector()); SPUnitId unitid = static_cast(prefs->getInt("/tools/lpetool/unitid", SP_UNIT_PX)); SPUnit unit = sp_unit_get_by_id(unitid); - lengthval = Geom::length(pwd2); + double lengthval = Geom::length(pwd2); gboolean success; success = sp_convert_distance(&lengthval, &sp_unit_get_by_id(SP_UNIT_PX), &unit); - arc_length = g_strdup_printf("%.2f %s", lengthval, success ? sp_unit_get_abbreviation(&unit) : "px"); + gchar *arc_length = g_strdup_printf("%.2f %s", lengthval, success ? sp_unit_get_abbreviation(&unit) : "px"); sp_canvastext_set_text (SP_CANVASTEXT(i->second), arc_length); set_pos_and_anchor(SP_CANVASTEXT(i->second), pwd2, 0.5, 10); // TODO: must we free arc_length? diff --git a/src/marker.cpp b/src/marker.cpp index b3b493b00..057fcbfbd 100644 --- a/src/marker.cpp +++ b/src/marker.cpp @@ -536,7 +536,6 @@ void sp_marker_show_dimension (SPMarker *marker, unsigned int key, unsigned int size) { SPMarkerView *view; - unsigned int i; for (view = marker->views; view != NULL; view = view->next) { if (view->key == key) break; @@ -551,7 +550,7 @@ sp_marker_show_dimension (SPMarker *marker, unsigned int key, unsigned int size) if (!view) { view = new SPMarkerView(); view->items.clear(); - for (i = 0; i < size; i++) { + for (unsigned int i = 0; i < size; i++) { view->items.push_back(NULL); } view->next = marker->views; @@ -645,7 +644,6 @@ sp_marker_hide (SPMarker *marker, unsigned int key) static void sp_marker_view_remove (SPMarker *marker, SPMarkerView *view, unsigned int destroyitems) { - unsigned int i; if (view == marker->views) { marker->views = view->next; } else { @@ -654,7 +652,7 @@ sp_marker_view_remove (SPMarker *marker, SPMarkerView *view, unsigned int destro v->next = view->next; } if (destroyitems) { - for (i = 0; i < view->items.size(); i++) { + for (unsigned int i = 0; i < view->items.size(); i++) { /* We have to walk through the whole array because there may be hidden items */ delete view->items[i]; } diff --git a/src/measure-context.cpp b/src/measure-context.cpp index dc23cf5c6..771125b7f 100644 --- a/src/measure-context.cpp +++ b/src/measure-context.cpp @@ -494,7 +494,6 @@ static gint sp_measure_context_root_handler(SPEventContext *event_context, GdkEv } curve->transform(item->i2doc_affine()); - Geom::PathVector pathv = curve->get_pathvector(); calculate_intersections(desktop, item, lineseg, curve, intersections); diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp index e6f6d87db..77ba3040f 100644 --- a/src/object-snapper.cpp +++ b/src/object-snapper.cpp @@ -106,12 +106,11 @@ void Inkscape::ObjectSnapper::_findCandidates(SPObject* parent, if (it == NULL || i == it->end()) { SPItem *item = SP_ITEM(o); if (item) { - SPObject *obj = NULL; if (!clip_or_mask) { // cannot clip or mask more than once // The current item is not a clipping path or a mask, but might // still be the subject of clipping or masking itself ; if so, then // we should also consider that path or mask for snapping to - obj = SP_OBJECT(item->clip_ref ? item->clip_ref->getObject() : NULL); + SPObject *obj = SP_OBJECT(item->clip_ref ? item->clip_ref->getObject() : NULL); if (obj && _snapmanager->snapprefs.isTargetSnappable(SNAPTARGET_PATH_CLIP)) { _findCandidates(obj, it, false, bbox_to_snap, true, item->i2doc_affine()); } diff --git a/src/rdf.cpp b/src/rdf.cpp index a6842c31d..16344e520 100644 --- a/src/rdf.cpp +++ b/src/rdf.cpp @@ -563,7 +563,6 @@ unsigned int RDFImpl::setReprText( Inkscape::XML::Node * repr, int i; Inkscape::XML::Node * temp=NULL; - Inkscape::XML::Node * child=NULL; Inkscape::XML::Node * parent=repr; Inkscape::XML::Document * xmldoc = parent->document(); @@ -669,7 +668,7 @@ unsigned int RDFImpl::setReprText( Inkscape::XML::Node * repr, parent->appendChild(temp); Inkscape::GC::release(temp); - child = xmldoc->createTextNode( g_strstrip(str) ); + Inkscape::XML::Node * child = xmldoc->createTextNode( g_strstrip(str) ); g_return_val_if_fail (child != NULL, 0); temp->appendChild(child); -- cgit v1.2.3 From 6777466eda0b6952746a7bfb443d5e773857185a Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 3 Aug 2013 23:39:12 +0200 Subject: reduce variable scope (bzr r12464) --- src/select-context.cpp | 14 ++++++-------- src/selection-describer.cpp | 3 +-- src/selection.cpp | 6 +++--- src/shape-editor.cpp | 4 +--- 4 files changed, 11 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/select-context.cpp b/src/select-context.cpp index b4b01bf15..35a9bd172 100644 --- a/src/select-context.cpp +++ b/src/select-context.cpp @@ -464,8 +464,6 @@ sp_select_context_cycle_through_items(SPSelectContext *sc, Inkscape::Selection * static gint sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) { - SPItem *item = NULL; - SPItem *item_at_point = NULL, *group_at_point = NULL, *item_in_group = NULL; gint ret = FALSE; SPDesktop *desktop = event_context->desktop; @@ -578,14 +576,14 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) // and also when we started within tolerance, but trespassed tolerance outside of item Inkscape::Rubberband::get(desktop)->stop(); SP_EVENT_CONTEXT(sc)->defaultMessageContext()->clear(); - item_at_point = desktop->getItemAtPoint(Geom::Point(event->button.x, event->button.y), FALSE); + SPItem *item_at_point = desktop->getItemAtPoint(Geom::Point(event->button.x, event->button.y), FALSE); if (!item_at_point) // if no item at this point, try at the click point (bug 1012200) item_at_point = desktop->getItemAtPoint(Geom::Point(xp, yp), FALSE); if (item_at_point || sc->moved || sc->button_press_alt) { // drag only if starting from an item, or if something is already grabbed, or if alt-dragging if (!sc->moved) { - item_in_group = desktop->getItemAtPoint(Geom::Point(event->button.x, event->button.y), TRUE); - group_at_point = desktop->getGroupAtPoint(Geom::Point(event->button.x, event->button.y)); + SPItem *item_in_group = desktop->getItemAtPoint(Geom::Point(event->button.x, event->button.y), TRUE); + SPItem *group_at_point = desktop->getGroupAtPoint(Geom::Point(event->button.x, event->button.y)); if (SP_IS_LAYER(selection->single())) group_at_point = SP_GROUP(selection->single()); @@ -712,6 +710,7 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) sc->button_press_shift = false; + SPItem *item = NULL; if (sc->button_press_ctrl) { // go into groups, honoring Alt item = sp_event_context_find_item (desktop, @@ -730,7 +729,7 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) } else if ((sc->button_press_ctrl || sc->button_press_alt) && !rb_escaped && !drag_escaped) { // ctrl+click, alt+click - item = sp_event_context_find_item (desktop, + SPItem *item = sp_event_context_find_item (desktop, Geom::Point(event->button.x, event->button.y), sc->button_press_alt, sc->button_press_ctrl); sc->button_press_ctrl = FALSE; @@ -841,9 +840,8 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) // ... and rebuild them with the new items. sc->cycling_items_cmp = g_list_copy(sc->cycling_items); - SPItem *item; for(GList *l = sc->cycling_items; l != NULL; l = l->next) { - item = SP_ITEM(l->data); + SPItem *item = SP_ITEM(l->data); arenaitem = item->get_arenaitem(desktop->dkey); arenaitem->setOpacity(0.3); if (selection->includes(item)) { diff --git a/src/selection-describer.cpp b/src/selection-describer.cpp index 6ed8ca584..b5704bb76 100644 --- a/src/selection-describer.cpp +++ b/src/selection-describer.cpp @@ -100,9 +100,8 @@ static GSList *collect_terms (GSList *items) static int count_filtered (GSList *items) { int count=0; - SPItem *item=NULL; for (GSList *i = items; i != NULL; i = i->next) { - item = SP_ITEM(i->data); + SPItem *item = SP_ITEM(i->data); count += item->ifilt(); } return count; diff --git a/src/selection.cpp b/src/selection.cpp index 784219c88..1335c5fca 100644 --- a/src/selection.cpp +++ b/src/selection.cpp @@ -329,11 +329,11 @@ std::list const Selection::perspList() { std::list const Selection::box3DList(Persp3D *persp) { std::list boxes; if (persp) { - SPBox3D *box; for (std::list::iterator i = _3dboxes.begin(); i != _3dboxes.end(); ++i) { - box = *i; - if (persp == box3d_get_perspective(box)) + SPBox3D *box = *i; + if (persp == box3d_get_perspective(box)) { boxes.push_back(box); + } } } else { boxes = _3dboxes; diff --git a/src/shape-editor.cpp b/src/shape-editor.cpp index f2339770c..71018d89b 100644 --- a/src/shape-editor.cpp +++ b/src/shape-editor.cpp @@ -46,15 +46,13 @@ ShapeEditor::~ShapeEditor() { } void ShapeEditor::unset_item(SubType type, bool keep_knotholder) { - Inkscape::XML::Node *old_repr = NULL; - switch (type) { case SH_NODEPATH: // defunct break; case SH_KNOTHOLDER: if (this->knotholder) { - old_repr = this->knotholder->repr; + Inkscape::XML::Node *old_repr = this->knotholder->repr; if (old_repr && old_repr == knotholder_listener_attached_for) { sp_repr_remove_listener_by_data(old_repr, this); Inkscape::GC::release(old_repr); -- cgit v1.2.3 From bd17bfe0fa865957751d954a91125ce40f8add03 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 3 Aug 2013 23:39:35 +0200 Subject: catch exception by reference (bzr r12465) --- src/sp-lpe-item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index e8629ff70..d4619e794 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -185,7 +185,7 @@ static void sp_lpe_item_set(SPObject *object, unsigned int key, gchar const *val Inkscape::LivePathEffect::LPEObjectReference *path_effect_ref = new Inkscape::LivePathEffect::LPEObjectReference(object); try { path_effect_ref->link(href.c_str()); - } catch (Inkscape::BadURIException e) { + } catch (Inkscape::BadURIException &e) { g_warning("BadURIException when trying to find LPE: %s", e.what()); path_effect_ref->unlink(); delete path_effect_ref; -- cgit v1.2.3 From 3d59db609dcae34444b45348c57ac203886576b6 Mon Sep 17 00:00:00 2001 From: Slagvi Public Date: Sun, 4 Aug 2013 14:37:48 +0200 Subject: Removing template data from XML tree added (bzr r12379.2.18) --- src/extension/dbus/document-interface.cpp | 2 +- src/file.cpp | 18 ++++++++++++++---- src/file.h | 10 ++++++++-- src/help.cpp | 2 +- src/ui/dialog/template-widget.cpp | 2 +- 5 files changed, 25 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/extension/dbus/document-interface.cpp b/src/extension/dbus/document-interface.cpp index 56d1dfdbd..85c92b098 100644 --- a/src/extension/dbus/document-interface.cpp +++ b/src/extension/dbus/document-interface.cpp @@ -918,7 +918,7 @@ gboolean document_interface_load(DocumentInterface *object, { desktop_ensure_active(object->desk); const Glib::ustring file(filename); - sp_file_open(file, NULL, TRUE, TRUE); + sp_file_open(file, NULL); if (object->updates) { Inkscape::DocumentUndo::done(sp_desktop_document(object->desk), SP_VERB_FILE_OPEN, "Opened File"); } diff --git a/src/file.cpp b/src/file.cpp index 9d3c513ab..ee205b035 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -227,7 +227,7 @@ sp_file_exit() */ bool sp_file_open(const Glib::ustring &uri, Inkscape::Extension::Extension *key, - bool add_to_recent, bool replace_empty) + int flags) { SPDesktop *desktop = SP_ACTIVE_DESKTOP; if (desktop) { @@ -252,9 +252,19 @@ bool sp_file_open(const Glib::ustring &uri, } if (doc) { + if (flags & IS_FROM_TEMPLATE){ + Inkscape::XML::Node *myRoot = doc->getReprRoot(); + Inkscape::XML::Node *nodeToRemove = sp_repr_lookup_name(myRoot, "inkscape:_templateinfo"); + if (nodeToRemove != NULL){ + sp_repr_unparent(nodeToRemove); + delete nodeToRemove; + DocumentUndo::clearUndo(doc); + } + } + SPDocument *existing = desktop ? sp_desktop_document(desktop) : NULL; - if (existing && existing->virgin && replace_empty) { + if (existing && existing->virgin && (flags & REPLACE_EMPTY)) { // If the current desktop is empty, open the document there doc->ensureUpToDate(); // TODO this will trigger broken link warnings, etc. desktop->change_document(doc); @@ -268,14 +278,14 @@ bool sp_file_open(const Glib::ustring &uri, doc->virgin = FALSE; - // everyone who cares now has a reference, get rid of ours + // everyone who cares now has a reference, get rid of our`s doc->doUnref(); // resize the window to match the document properties sp_namedview_window_from_document(desktop); sp_namedview_update_layers_from_document(desktop); - if (add_to_recent) { + if (flags & ADD_TO_RECENT) { sp_file_add_recent( doc->getURI() ); } diff --git a/src/file.h b/src/file.h index fe8ad9af3..e94a3c598 100644 --- a/src/file.h +++ b/src/file.h @@ -62,11 +62,17 @@ void sp_file_exit (void); /** * Opens a new file and window from the given URI */ +enum SPFileOpenFlags +{ + ADD_TO_RECENT = 1, + REPLACE_EMPTY = 2, + IS_FROM_TEMPLATE = 4 +}; + bool sp_file_open( const Glib::ustring &uri, Inkscape::Extension::Extension *key, - bool add_to_recent = true, - bool replace_empty = true + int flags = ADD_TO_RECENT | REPLACE_EMPTY ); /** diff --git a/src/help.cpp b/src/help.cpp index 02a1930f4..f14fdf487 100644 --- a/src/help.cpp +++ b/src/help.cpp @@ -34,7 +34,7 @@ sp_help_open_tutorial(GtkMenuItem *, gpointer data) { gchar const *name = static_cast(data); gchar *c = g_build_filename(INKSCAPE_TUTORIALSDIR, name, NULL); - sp_file_open(c, NULL, false, false); + sp_file_open(c, NULL, 0); g_free(c); } diff --git a/src/ui/dialog/template-widget.cpp b/src/ui/dialog/template-widget.cpp index 4b64c1c73..66121a73a 100644 --- a/src/ui/dialog/template-widget.cpp +++ b/src/ui/dialog/template-widget.cpp @@ -62,7 +62,7 @@ void TemplateWidget::create() if (_current_template.is_procedural) {} else { - sp_file_open(_current_template.path, NULL); + sp_file_open(_current_template.path, NULL, REPLACE_EMPTY | ADD_TO_RECENT | IS_FROM_TEMPLATE); } } -- cgit v1.2.3 From 82f86789e746672e91bdd287c534546f6af0b456 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Sun, 4 Aug 2013 16:24:43 +0200 Subject: cppcheck: c-style casts > c++ style casts (bzr r12466) --- src/sp-desc.cpp | 2 +- src/sp-font-face.cpp | 2 +- src/sp-paint-server.cpp | 2 +- src/sp-tspan.cpp | 34 ++++----- src/unicoderange.cpp | 193 ++++++++++++++++++++++++------------------------ 5 files changed, 113 insertions(+), 120 deletions(-) (limited to 'src') diff --git a/src/sp-desc.cpp b/src/sp-desc.cpp index 9b27c4d17..aec90714d 100644 --- a/src/sp-desc.cpp +++ b/src/sp-desc.cpp @@ -22,7 +22,7 @@ G_DEFINE_TYPE(SPDesc, sp_desc, SP_TYPE_OBJECT); static void sp_desc_class_init(SPDescClass *klass) { - SPObjectClass *sp_object_class = (SPObjectClass *)(klass); + SPObjectClass *sp_object_class = reinterpret_cast(klass); sp_object_class->write = sp_desc_write; } diff --git a/src/sp-font-face.cpp b/src/sp-font-face.cpp index 0a649b17f..6b6d07c6d 100644 --- a/src/sp-font-face.cpp +++ b/src/sp-font-face.cpp @@ -272,7 +272,7 @@ G_DEFINE_TYPE(SPFontFace, sp_fontface, SP_TYPE_OBJECT); static void sp_fontface_class_init(SPFontFaceClass *fc) { - SPObjectClass *sp_object_class = (SPObjectClass *) fc; + SPObjectClass *sp_object_class = reinterpret_cast(fc); sp_object_class->build = sp_fontface_build; sp_object_class->release = sp_fontface_release; diff --git a/src/sp-paint-server.cpp b/src/sp-paint-server.cpp index 298b39117..bae0e2242 100644 --- a/src/sp-paint-server.cpp +++ b/src/sp-paint-server.cpp @@ -53,7 +53,7 @@ cairo_pattern_t *sp_paint_server_create_pattern(SPPaintServer *ps, g_return_val_if_fail(SP_IS_PAINT_SERVER(ps), NULL); cairo_pattern_t *cp = NULL; - SPPaintServerClass *psc = (SPPaintServerClass *) G_OBJECT_GET_CLASS(ps); + SPPaintServerClass *psc = reinterpret_cast(G_OBJECT_GET_CLASS(ps)); if ( psc->pattern_new ) { cp = (*psc->pattern_new)(ps, ct, bbox, opacity); } diff --git a/src/sp-tspan.cpp b/src/sp-tspan.cpp index 09429df6f..6f0b6ac39 100644 --- a/src/sp-tspan.cpp +++ b/src/sp-tspan.cpp @@ -145,7 +145,7 @@ static void sp_tspan_update(SPObject *object, SPCtx *ctx, guint flags) for ( SPObject *ochild = object->firstChild() ; ochild ; ochild = ochild->getNext() ) { if ( flags || ( ochild->uflags & SP_OBJECT_MODIFIED_FLAG )) { - ochild->updateDisplay(ctx, flags); + ochild->updateDisplay(ctx, flags); } } } @@ -270,8 +270,7 @@ void refresh_textpath_source(SPTextPath* offset); G_DEFINE_TYPE(SPTextPath, sp_textpath, SP_TYPE_ITEM); -static void -sp_textpath_class_init(SPTextPathClass *classname) +static void sp_textpath_class_init(SPTextPathClass *classname) { GObjectClass *gobject_class = G_OBJECT_CLASS(classname); SPObjectClass *sp_object_class = SP_OBJECT_CLASS(classname); @@ -299,16 +298,14 @@ sp_textpath_init(SPTextPath *textpath) textpath->sourcePath->user_unlink = sp_textpath_to_text; } -static void -sp_textpath_finalize(GObject *obj) +static void sp_textpath_finalize(GObject *obj) { - SPTextPath *textpath = (SPTextPath *) obj; + SPTextPath *textpath = static_cast(obj); delete textpath->sourcePath; } -static void -sp_textpath_release(SPObject *object) +static void sp_textpath_release(SPObject *object) { SPTextPath *textpath = SP_TEXTPATH(object); @@ -321,8 +318,7 @@ sp_textpath_release(SPObject *object) (SP_OBJECT_CLASS(sp_textpath_parent_class))->release(object); } -static void -sp_textpath_build(SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr) +static void sp_textpath_build(SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr) { object->readAttr( "x" ); object->readAttr( "y" ); @@ -352,8 +348,7 @@ sp_textpath_build(SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr) } } -static void -sp_textpath_set(SPObject *object, unsigned key, gchar const *value) +static void sp_textpath_set(SPObject *object, unsigned key, gchar const *value) { SPTextPath *textpath = SP_TEXTPATH(object); @@ -403,7 +398,7 @@ static void sp_textpath_update(SPObject *object, SPCtx *ctx, guint flags) } -void refresh_textpath_source(SPTextPath* tp) +void refresh_textpath_source(SPTextPath* tp) { if ( tp == NULL ) return; tp->sourcePath->refresh_source(); @@ -423,8 +418,7 @@ void refresh_textpath_source(SPTextPath* tp) } } -static void -sp_textpath_modified(SPObject *object, unsigned flags) +static void sp_textpath_modified(SPObject *object, unsigned flags) { if ((SP_OBJECT_CLASS(sp_textpath_parent_class))->modified) { (SP_OBJECT_CLASS(sp_textpath_parent_class))->modified(object, flags); @@ -454,7 +448,7 @@ sp_textpath_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape:: textpath->attributes.writeTo(repr); if (textpath->startOffset._set) { if (textpath->startOffset.unit == SVGLength::PERCENT) { - Inkscape::SVGOStringStream os; + Inkscape::SVGOStringStream os; os << (textpath->startOffset.computed * 100.0) << "%"; textpath->getRepr()->setAttribute("startOffset", os.str().c_str()); } else { @@ -506,19 +500,17 @@ sp_textpath_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape:: } -SPItem * -sp_textpath_get_path_item(SPTextPath *tp) +SPItem *sp_textpath_get_path_item(SPTextPath *tp) { if (tp && tp->sourcePath) { SPItem *refobj = tp->sourcePath->getObject(); if (SP_IS_ITEM(refobj)) - return (SPItem *) refobj; + return refobj; } return NULL; } -void -sp_textpath_to_text(SPObject *tp) +void sp_textpath_to_text(SPObject *tp) { SPObject *text = tp->parent; diff --git a/src/unicoderange.cpp b/src/unicoderange.cpp index 67239d0d2..36435024d 100644 --- a/src/unicoderange.cpp +++ b/src/unicoderange.cpp @@ -4,124 +4,125 @@ #include static unsigned int hex2int(char* s){ - int res=0; - int i=0, mul=1; - while(s[i+1]!='\0') i++; + int res=0; + int i=0, mul=1; + while(s[i+1]!='\0') i++; - while(i>=0){ - if (s[i] >= 'A' && s[i] <= 'F') res += mul * (s[i]-'A'+10); - if (s[i] >= 'a' && s[i] <= 'f') res += mul * (s[i]-'a'+10); - if (s[i] >= '0' && s[i] <= '9') res += mul * (s[i]-'0'); - i--; - mul*=16; - } - return res; + while(i>=0){ + if (s[i] >= 'A' && s[i] <= 'F') res += mul * (s[i]-'A'+10); + if (s[i] >= 'a' && s[i] <= 'f') res += mul * (s[i]-'a'+10); + if (s[i] >= '0' && s[i] <= '9') res += mul * (s[i]-'0'); + i--; + mul*=16; + } + return res; } UnicodeRange::UnicodeRange(const gchar* value){ - if (!value) return; - gchar* val = (gchar*) value; - while(val[0] != '\0'){ - if (val[0]=='U' && val[1]=='+'){ - val += add_range(val+2); - } else { - this->unichars.push_back(g_utf8_get_char(&val[0])); - val++; - } - //skip spaces or commas - while(val[0]==' ' || val[0]==',') val++; - } + if (!value) return; + gchar* val = (gchar*) value; + while(val[0] != '\0'){ + if (val[0]=='U' && val[1]=='+'){ + val += add_range(val+2); + } else { + this->unichars.push_back(g_utf8_get_char(&val[0])); + val++; + } + //skip spaces or commas + while(val[0]==' ' || val[0]==',') val++; + } } -int -UnicodeRange::add_range(gchar* val){ - Urange r; - int i=0, count=0; - while(val[i]!='\0' && val[i]!='-' && val[i]!=' ' && val[i]!=','){ +int UnicodeRange::add_range(gchar* val){ + Urange r; + int i=0, count=0; + while(val[i]!='\0' && val[i]!='-' && val[i]!=' ' && val[i]!=','){ i++; - } + } r.start = (gchar*) malloc((i+1)*sizeof(gchar*)); - strncpy(r.start, val, i); - r.start[i] = '\0'; - val+=i; - count+=i; - i=0; - if (val[0]=='-'){ - val++; - while(val[i]!='\0' && val[i]!='-' && val[i]!=' ' && val[i]!=',') i++; - r.end = (gchar*) malloc((i+1)*sizeof(gchar*)); - strncpy(r.end, val, i); - r.end[i] = '\0'; - // val+=i; - count+=i; - } else { - r.end=NULL; - } - this->range.push_back(r); - return count+1; + strncpy(r.start, val, i); + r.start[i] = '\0'; + val+=i; + count+=i; + i=0; + if (val[0]=='-'){ + val++; + while(val[i]!='\0' && val[i]!='-' && val[i]!=' ' && val[i]!=',') i++; + r.end = (gchar*) malloc((i+1)*sizeof(gchar*)); + strncpy(r.end, val, i); + r.end[i] = '\0'; + // val+=i; + count+=i; + } else { + r.end=NULL; + } + this->range.push_back(r); + return count+1; } bool UnicodeRange::contains(gchar unicode){ - for(unsigned int i=0;iunichars.size();i++){ - if ((gunichar) unicode == this->unichars[i]) return true; - } + for(unsigned int i=0;iunichars.size();i++){ + if (static_cast(unicode) == this->unichars[i]){ + return true; + } + } - unsigned int unival; - unival = g_utf8_get_char (&unicode); - char uni[9] = "00000000"; - uni[8]= '\0'; - unsigned char val; - for (unsigned int i=7; unival>0; i--){ - val = unival & 0xf; - unival = unival >> 4; - if (val < 10) uni[i] = '0' + val; - else uni[i] = 'A'+ val - 10; - } + unsigned int unival; + unival = g_utf8_get_char (&unicode); + char uni[9] = "00000000"; + uni[8]= '\0'; + unsigned char val; + for (unsigned int i=7; unival>0; i--){ + val = unival & 0xf; + unival = unival >> 4; + if (val < 10) uni[i] = '0' + val; + else uni[i] = 'A'+ val - 10; + } - bool found; - for(unsigned int i=0;irange.size();i++){ - Urange r = this->range[i]; - if (r.end){ - if (unival >= hex2int(r.start) && unival <= hex2int(r.end)) return true; - } else { - found = true; + bool found; + for(unsigned int i=0;irange.size();i++){ + Urange r = this->range[i]; + if (r.end){ + if (unival >= hex2int(r.start) && unival <= hex2int(r.end)) return true; + } else { + found = true; - int p=0; - while (r.start[p]!='\0') p++; - p--; + int p=0; + while (r.start[p]!='\0') p++; + p--; - for (int pos=8;p>=0;pos--,p--){ - if (uni[pos]!='?' && uni[pos]!=r.start[p]) found = false; - } - if (found) return true; - } - } - return false; + for (int pos=8;p>=0;pos--,p--){ + if (uni[pos]!='?' && uni[pos]!=r.start[p]) found = false; + } + if (found) return true; + } + } + return false; } Glib::ustring UnicodeRange::attribute_string(){ - Glib::ustring result; - unsigned int i; - for(i=0; iunichars.size(); i++){ - result += this->unichars[i]; - if (i!=this->unichars.size()-1) result += ","; - } + Glib::ustring result; + unsigned int i; + for(i=0; iunichars.size(); i++){ + result += this->unichars[i]; + if (i!=this->unichars.size()-1) result += ","; + } - for(i=0; irange.size(); i++){ - result += "U+" + Glib::ustring(this->range[i].start); - if (this->range[i].end) result += "-" + Glib::ustring(this->range[i].end); - if (i!=this->range.size()-1) result += ", "; - } + for(i=0; irange.size(); i++){ + result += "U+" + Glib::ustring(this->range[i].start); + if (this->range[i].end) result += "-" + Glib::ustring(this->range[i].end); + if (i!=this->range.size()-1) result += ", "; + } - return result; + return result; } gunichar UnicodeRange::sample_glyph(){ - //This could be better - if (!unichars.empty()) - return unichars[0]; - if (!range.empty()) - return hex2int(range[0].start); - return (gunichar) ' '; + //This could be better + if (!unichars.empty()) + return unichars[0]; + if (!range.empty()) + return hex2int(range[0].start); + return (gunichar) ' '; } -- cgit v1.2.3 From dd957026bd798ebe34eff033b4a839d63b790b04 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Sun, 4 Aug 2013 16:27:59 +0200 Subject: cppcheck (bzr r12467) --- src/attribute-rel-util.cpp | 55 +++-- src/select-context.cpp | 107 +++++----- src/sp-ellipse.cpp | 35 ++-- src/sp-pattern.cpp | 503 ++++++++++++++++++++++----------------------- src/sp-text.cpp | 2 +- src/sp-use.cpp | 12 +- src/syseq.h | 3 +- 7 files changed, 355 insertions(+), 362 deletions(-) (limited to 'src') diff --git a/src/attribute-rel-util.cpp b/src/attribute-rel-util.cpp index 0527dad4e..933339632 100644 --- a/src/attribute-rel-util.cpp +++ b/src/attribute-rel-util.cpp @@ -198,23 +198,22 @@ void sp_attribute_clean_style(Node* repr, SPCSSAttr *css, unsigned int flags) { // Check if a property is applicable to an element (i.e. is font-family useful for a ?). if( !SPAttributeRelCSS::findIfValid( property, element ) ) { - if( flags & SP_ATTR_CLEAN_STYLE_WARN ) { - g_warning( "<%s id=\"%s\">: CSS Style property: \"%s\" is inappropriate.", - element.c_str(), id.c_str(), property ); - } - if( flags & SP_ATTR_CLEAN_STYLE_REMOVE ) { - toDelete.insert(property); - } - continue; + if( flags & SP_ATTR_CLEAN_STYLE_WARN ) { + g_warning( "<%s id=\"%s\">: CSS Style property: \"%s\" is inappropriate.", + element.c_str(), id.c_str(), property ); + } + if( flags & SP_ATTR_CLEAN_STYLE_REMOVE ) { + toDelete.insert(property); + } + continue; } // Find parent value for same property (property) gchar const * value_p = NULL; if( css_parent != NULL ) { - gchar const * property_p = NULL; for ( List iter_p = css_parent->attributeList() ; iter_p ; ++iter_p ) { - property_p = g_quark_to_string(iter_p->key); + gchar const * property_p = g_quark_to_string(iter_p->key); if( !g_strcmp0( property, property_p ) ) { value_p = iter_p->value; @@ -226,29 +225,29 @@ void sp_attribute_clean_style(Node* repr, SPCSSAttr *css, unsigned int flags) { // If parent has same property value and property is inherited, mark for deletion. if ( !g_strcmp0( value, value_p ) && SPAttributeRelCSS::findIfInherit( property ) ) { - if ( flags & SP_ATTR_CLEAN_DEFAULT_WARN ) { - g_warning( "<%s id=\"%s\">: CSS Style property: \"%s\" has same value as parent (%s).", - element.c_str(), id.c_str(), property, value ); - } - if ( flags & SP_ATTR_CLEAN_DEFAULT_REMOVE ) { - toDelete.insert( property ); - } - continue; + if ( flags & SP_ATTR_CLEAN_DEFAULT_WARN ) { + g_warning( "<%s id=\"%s\">: CSS Style property: \"%s\" has same value as parent (%s).", + element.c_str(), id.c_str(), property, value ); + } + if ( flags & SP_ATTR_CLEAN_DEFAULT_REMOVE ) { + toDelete.insert( property ); + } + continue; } // If property value is same as default and the parent value not set or property is not inherited, // mark for deletion. if ( SPAttributeRelCSS::findIfDefault( property, value ) && - ( (css_parent != NULL && value_p == NULL) || !SPAttributeRelCSS::findIfInherit( property ) ) ) { - - if ( flags & SP_ATTR_CLEAN_DEFAULT_WARN ) { - g_warning( "<%s id=\"%s\">: CSS Style property: \"%s\" with default value (%s) not needed.", - element.c_str(), id.c_str(), property, value ); - } - if ( flags & SP_ATTR_CLEAN_DEFAULT_REMOVE ) { - toDelete.insert( property ); - } - continue; + ( (css_parent != NULL && value_p == NULL) || !SPAttributeRelCSS::findIfInherit( property ) ) ) { + + if ( flags & SP_ATTR_CLEAN_DEFAULT_WARN ) { + g_warning( "<%s id=\"%s\">: CSS Style property: \"%s\" with default value (%s) not needed.", + element.c_str(), id.c_str(), property, value ); + } + if ( flags & SP_ATTR_CLEAN_DEFAULT_REMOVE ) { + toDelete.insert( property ); + } + continue; } } // End loop over style properties diff --git a/src/select-context.cpp b/src/select-context.cpp index 35a9bd172..df90d62cb 100644 --- a/src/select-context.cpp +++ b/src/select-context.cpp @@ -333,9 +333,9 @@ sp_select_context_item_handler(SPEventContext *event_context, SPItem *item, GdkE // if shift or ctrl was pressed, do not move objects; // pass the event to root handler which will perform rubberband, shift-click, ctrl-click, ctrl-drag } else { - GdkWindow* window = gtk_widget_get_window (GTK_WIDGET (sp_desktop_canvas(desktop))); + GdkWindow* window = gtk_widget_get_window (GTK_WIDGET (sp_desktop_canvas(desktop))); - sc->dragging = TRUE; + sc->dragging = TRUE; sc->moved = FALSE; gdk_window_set_cursor(window, CursorSelectDragging); @@ -387,7 +387,7 @@ sp_select_context_item_handler(SPEventContext *event_context, SPItem *item, GdkE GdkWindow* window = gtk_widget_get_window (GTK_WIDGET (sp_desktop_canvas(desktop))); gdk_window_set_cursor(window, event_context->cursor); - } + } break; case GDK_KEY_PRESS: @@ -540,11 +540,11 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) case GDK_MOTION_NOTIFY: { - if (is_cycling) - { - moved_while_cycling = true; - prev_event_context = event_context; - } + if (is_cycling) + { + moved_while_cycling = true; + prev_event_context = event_context; + } tolerance = prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100); if ((event->motion.state & GDK_BUTTON1_MASK) && !event_context->space_panning) { Geom::Point const motion_pt(event->motion.x, event->motion.y); @@ -564,7 +564,7 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) // if it's not click and ctrl or alt was pressed (the latter with some selection // but not with shift) we want to drag rather than rubberband sc->dragging = TRUE; - GdkWindow* window = gtk_widget_get_window (GTK_WIDGET (sp_desktop_canvas(desktop))); + GdkWindow* window = gtk_widget_get_window (GTK_WIDGET (sp_desktop_canvas(desktop))); gdk_window_set_cursor(window, CursorSelectDragging); desktop->canvas->forceFullRedrawAfterInterruptions(5); @@ -638,7 +638,7 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) if ((event->button.button == 1) && (sc->grabbed) && !event_context->space_panning) { if (sc->dragging) { GdkWindow* window; - if (sc->moved) { + if (sc->moved) { // item has been moved seltrans->ungrab(); sc->moved = FALSE; @@ -670,7 +670,7 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) } } sc->dragging = FALSE; - window = gtk_widget_get_window (GTK_WIDGET (sp_desktop_canvas(desktop))); + window = gtk_widget_get_window (GTK_WIDGET (sp_desktop_canvas(desktop))); gdk_window_set_cursor(window, CursorSelectMouseover); sp_event_context_discard_delayed_snap_event(event_context); desktop->canvas->endForcedFullRedraws(); @@ -777,15 +777,15 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) GdkEventScroll *scroll_event = (GdkEventScroll*) event; if (scroll_event->state & GDK_MOD1_MASK) { // alt modified pressed - if (moved_while_cycling) - { - moved_while_cycling = false; - sp_select_context_reset_opacities(prev_event_context); - prev_event_context = NULL; - } - - is_cycling = true; - + if (moved_while_cycling) + { + moved_while_cycling = false; + sp_select_context_reset_opacities(prev_event_context); + prev_event_context = NULL; + } + + is_cycling = true; + bool shift_pressed = scroll_event->state & GDK_SHIFT_MASK; /* Rebuild list of items underneath the mouse pointer */ @@ -861,21 +861,21 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) ret = TRUE; - GtkWindow *w =GTK_WINDOW(gtk_widget_get_toplevel( GTK_WIDGET(desktop->canvas) )); - if (w) - { - gtk_window_present(w); - gtk_widget_grab_focus (GTK_WIDGET(desktop->canvas)); - } + GtkWindow *w =GTK_WINDOW(gtk_widget_get_toplevel( GTK_WIDGET(desktop->canvas) )); + if (w) + { + gtk_window_present(w); + gtk_widget_grab_focus (GTK_WIDGET(desktop->canvas)); + } } break; } case GDK_KEY_PRESS: // keybindings for select context - { - { - guint keyval = get_group0_keyval(&event->key); + { + { + guint keyval = get_group0_keyval(&event->key); bool alt = ( MOD__ALT(event) || (keyval == GDK_KEY_Alt_L) || (keyval == GDK_KEY_Alt_R) @@ -902,19 +902,19 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) _("Alt: click to select under; scroll mouse-wheel to cycle-select; drag to move selected or select by touch")); // if Alt and nonempty selection, show moving cursor ("move selected"): if (alt && !selection->isEmpty() && !desktop->isWaitingCursor()) { - GdkWindow* window = gtk_widget_get_window (GTK_WIDGET (sp_desktop_canvas(desktop))); + GdkWindow* window = gtk_widget_get_window (GTK_WIDGET (sp_desktop_canvas(desktop))); gdk_window_set_cursor(window, CursorSelectDragging); } //*/ break; } - } + } gdouble const nudge = prefs->getDoubleLimited("/options/nudgedistance/value", 2, 0, 1000, "px"); // in px - gdouble const offset = prefs->getDoubleLimited("/options/defaultscale/value", 2, 0, 1000, "px"); - int const snaps = prefs->getInt("/options/rotationsnapsperpi/value", 12); + gdouble const offset = prefs->getDoubleLimited("/options/defaultscale/value", 2, 0, 1000, "px"); + int const snaps = prefs->getInt("/options/rotationsnapsperpi/value", 12); - switch (get_group0_keyval (&event->key)) { + switch (get_group0_keyval (&event->key)) { case GDK_KEY_Left: // move selection left case GDK_KEY_KP_Left: if (!MOD__CTRL(event)) { // not ctrl @@ -1102,7 +1102,7 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) break; } break; - } + } case GDK_KEY_RELEASE: { guint keyval = get_group0_keyval(&event->key); @@ -1123,11 +1123,10 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) } else { if (alt) { // TODO: Should we have a variable like is_cycling or is it harmless to run this piece of code each time? // quit cycle-selection and reset opacities - if (is_cycling) - { - sp_select_context_reset_opacities(event_context); - is_cycling = false; - } + if (is_cycling){ + sp_select_context_reset_opacities(event_context); + is_cycling = false; + } } } @@ -1151,23 +1150,21 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) return ret; } -static void -sp_select_context_reset_opacities(SPEventContext *event_context) +static void sp_select_context_reset_opacities(SPEventContext *event_context) { // SPDesktop *desktop = event_context->desktop; - SPSelectContext *sc = SP_SELECT_CONTEXT(event_context); - Inkscape::DrawingItem *arenaitem; - for (GList *l = sc->cycling_items; l != NULL; l = g_list_next(l)) { - arenaitem = SP_ITEM(l->data)->get_arenaitem(event_context->desktop->dkey); - arenaitem->setOpacity(SP_SCALE24_TO_FLOAT(SP_ITEM(l->data)->style->opacity.value)); - } - g_list_free(sc->cycling_items); - g_list_free(sc->cycling_items_selected_before); - g_list_free(sc->cycling_items_cmp); - sc->cycling_items = NULL; - sc->cycling_items_selected_before = NULL; - sc->cycling_cur_item = NULL; - sc->cycling_items_cmp = NULL; + SPSelectContext *sc = SP_SELECT_CONTEXT(event_context); + for (GList *l = sc->cycling_items; l != NULL; l = g_list_next(l)) { + Inkscape::DrawingItem *arenaitem = SP_ITEM(l->data)->get_arenaitem(event_context->desktop->dkey); + arenaitem->setOpacity(SP_SCALE24_TO_FLOAT(SP_ITEM(l->data)->style->opacity.value)); + } + g_list_free(sc->cycling_items); + g_list_free(sc->cycling_items_selected_before); + g_list_free(sc->cycling_items_cmp); + sc->cycling_items = NULL; + sc->cycling_items_selected_before = NULL; + sc->cycling_cur_item = NULL; + sc->cycling_items_cmp = NULL; } diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp index 8a9793852..bf019fb13 100644 --- a/src/sp-ellipse.cpp +++ b/src/sp-ellipse.cpp @@ -167,16 +167,20 @@ static void sp_genericellipse_set_shape(SPShape *shape) return; } - double rx, ry, s, e; - double x0, y0, x1, y1, x2, y2, x3, y3; + double rx; + double ry; + double s; double len; gint slice = FALSE; - // gint i; SPGenericEllipse *ellipse = (SPGenericEllipse *) shape; - if ((ellipse->rx.computed < 1e-18) || (ellipse->ry.computed < 1e-18)) return; - if (fabs(ellipse->end - ellipse->start) < 1e-9) return; + if ((ellipse->rx.computed < 1e-18) || (ellipse->ry.computed < 1e-18)) { + return; + } + if (fabs(ellipse->end - ellipse->start) < 1e-9){ + return; + } sp_genericellipse_normalize(ellipse); @@ -197,18 +201,19 @@ static void sp_genericellipse_set_shape(SPShape *shape) curve->moveto(cos(ellipse->start), sin(ellipse->start)); for (s = ellipse->start; s < ellipse->end; s += M_PI_2) { - e = s + M_PI_2; - if (e > ellipse->end) + double e = s + M_PI_2; + if (e > ellipse->end){ e = ellipse->end; + } len = 4*tan((e - s)/4)/3; - x0 = cos(s); - y0 = sin(s); - x1 = x0 + len * cos(s + M_PI_2); - y1 = y0 + len * sin(s + M_PI_2); - x3 = cos(e); - y3 = sin(e); - x2 = x3 + len * cos(e - M_PI_2); - y2 = y3 + len * sin(e - M_PI_2); + double x0 = cos(s); + double y0 = sin(s); + double x1 = x0 + len * cos(s + M_PI_2); + double y1 = y0 + len * sin(s + M_PI_2); + double x3 = cos(e); + double y3 = sin(e); + double x2 = x3 + len * cos(e - M_PI_2); + double y2 = y3 + len * sin(e - M_PI_2); #ifdef ELLIPSE_VERBOSE g_print("step %d s %f e %f coords %f %f %f %f %f %f\n", i, s, e, x1, y1, x2, y2, x3, y3); diff --git a/src/sp-pattern.cpp b/src/sp-pattern.cpp index c4308a1a9..62811d51a 100644 --- a/src/sp-pattern.cpp +++ b/src/sp-pattern.cpp @@ -56,19 +56,19 @@ G_DEFINE_TYPE(SPPattern, sp_pattern, SP_TYPE_PAINT_SERVER); static void sp_pattern_class_init (SPPatternClass *klass) { - SPObjectClass *sp_object_class; - SPPaintServerClass *ps_class; + SPObjectClass *sp_object_class; + SPPaintServerClass *ps_class; - sp_object_class = (SPObjectClass *) klass; - ps_class = (SPPaintServerClass *) klass; + sp_object_class = (SPObjectClass *) klass; + ps_class = (SPPaintServerClass *) klass; - sp_object_class->build = sp_pattern_build; - sp_object_class->release = sp_pattern_release; - sp_object_class->set = sp_pattern_set; - sp_object_class->update = sp_pattern_update; - sp_object_class->modified = sp_pattern_modified; + sp_object_class->build = sp_pattern_build; + sp_object_class->release = sp_pattern_release; + sp_object_class->set = sp_pattern_set; + sp_object_class->update = sp_pattern_update; + sp_object_class->modified = sp_pattern_modified; - // do we need _write? seems to work without it + // do we need _write? seems to work without it ps_class->pattern_new = sp_pattern_create_pattern; } @@ -76,46 +76,46 @@ sp_pattern_class_init (SPPatternClass *klass) static void sp_pattern_init (SPPattern *pat) { - pat->ref = new SPPatternReference(pat); - pat->ref->changedSignal().connect(sigc::bind(sigc::ptr_fun(pattern_ref_changed), pat)); + pat->ref = new SPPatternReference(pat); + pat->ref->changedSignal().connect(sigc::bind(sigc::ptr_fun(pattern_ref_changed), pat)); - pat->patternUnits = SP_PATTERN_UNITS_OBJECTBOUNDINGBOX; - pat->patternUnits_set = FALSE; + pat->patternUnits = SP_PATTERN_UNITS_OBJECTBOUNDINGBOX; + pat->patternUnits_set = FALSE; - pat->patternContentUnits = SP_PATTERN_UNITS_USERSPACEONUSE; - pat->patternContentUnits_set = FALSE; + pat->patternContentUnits = SP_PATTERN_UNITS_USERSPACEONUSE; + pat->patternContentUnits_set = FALSE; - pat->patternTransform = Geom::identity(); - pat->patternTransform_set = FALSE; + pat->patternTransform = Geom::identity(); + pat->patternTransform_set = FALSE; - pat->x.unset(); - pat->y.unset(); - pat->width.unset(); - pat->height.unset(); + pat->x.unset(); + pat->y.unset(); + pat->width.unset(); + pat->height.unset(); - pat->viewBox_set = FALSE; + pat->viewBox_set = FALSE; - new (&pat->modified_connection) sigc::connection(); + new (&pat->modified_connection) sigc::connection(); } static void sp_pattern_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { - if (((SPObjectClass *) sp_pattern_parent_class)->build) - (* ((SPObjectClass *) sp_pattern_parent_class)->build) (object, document, repr); - - object->readAttr( "patternUnits" ); - object->readAttr( "patternContentUnits" ); - object->readAttr( "patternTransform" ); - object->readAttr( "x" ); - object->readAttr( "y" ); - object->readAttr( "width" ); - object->readAttr( "height" ); - object->readAttr( "viewBox" ); - object->readAttr( "xlink:href" ); - - /* Register ourselves */ - document->addResource("pattern", object); + if (((SPObjectClass *) sp_pattern_parent_class)->build) + (* ((SPObjectClass *) sp_pattern_parent_class)->build) (object, document, repr); + + object->readAttr( "patternUnits" ); + object->readAttr( "patternContentUnits" ); + object->readAttr( "patternTransform" ); + object->readAttr( "x" ); + object->readAttr( "y" ); + object->readAttr( "width" ); + object->readAttr( "height" ); + object->readAttr( "viewBox" ); + object->readAttr( "xlink:href" ); + + /* Register ourselves */ + document->addResource("pattern", object); } static void sp_pattern_release(SPObject *object) @@ -144,118 +144,115 @@ static void sp_pattern_release(SPObject *object) static void sp_pattern_set (SPObject *object, unsigned int key, const gchar *value) { - SPPattern *pat = SP_PATTERN (object); - - switch (key) { - case SP_ATTR_PATTERNUNITS: - if (value) { - if (!strcmp (value, "userSpaceOnUse")) { - pat->patternUnits = SP_PATTERN_UNITS_USERSPACEONUSE; - } else { - pat->patternUnits = SP_PATTERN_UNITS_OBJECTBOUNDINGBOX; - } - pat->patternUnits_set = TRUE; - } else { - pat->patternUnits_set = FALSE; - } - object->requestModified(SP_OBJECT_MODIFIED_FLAG); - break; - case SP_ATTR_PATTERNCONTENTUNITS: - if (value) { - if (!strcmp (value, "userSpaceOnUse")) { - pat->patternContentUnits = SP_PATTERN_UNITS_USERSPACEONUSE; - } else { - pat->patternContentUnits = SP_PATTERN_UNITS_OBJECTBOUNDINGBOX; - } - pat->patternContentUnits_set = TRUE; - } else { - pat->patternContentUnits_set = FALSE; - } - object->requestModified(SP_OBJECT_MODIFIED_FLAG); - break; - case SP_ATTR_PATTERNTRANSFORM: { - Geom::Affine t; - if (value && sp_svg_transform_read (value, &t)) { - pat->patternTransform = t; - pat->patternTransform_set = TRUE; - } else { - pat->patternTransform = Geom::identity(); - pat->patternTransform_set = FALSE; - } - object->requestModified(SP_OBJECT_MODIFIED_FLAG); - break; - } - case SP_ATTR_X: - pat->x.readOrUnset(value); - object->requestModified(SP_OBJECT_MODIFIED_FLAG); - break; - case SP_ATTR_Y: - pat->y.readOrUnset(value); - object->requestModified(SP_OBJECT_MODIFIED_FLAG); - break; - case SP_ATTR_WIDTH: - pat->width.readOrUnset(value); - object->requestModified(SP_OBJECT_MODIFIED_FLAG); - break; - case SP_ATTR_HEIGHT: - pat->height.readOrUnset(value); - object->requestModified(SP_OBJECT_MODIFIED_FLAG); - break; - case SP_ATTR_VIEWBOX: { - /* fixme: Think (Lauris) */ - double x, y, width, height; - char *eptr; - - if (value) { - eptr = (gchar *) value; - x = g_ascii_strtod (eptr, &eptr); - while (*eptr && ((*eptr == ',') || (*eptr == ' '))) eptr++; - y = g_ascii_strtod (eptr, &eptr); - while (*eptr && ((*eptr == ',') || (*eptr == ' '))) eptr++; - width = g_ascii_strtod (eptr, &eptr); - while (*eptr && ((*eptr == ',') || (*eptr == ' '))) eptr++; - height = g_ascii_strtod (eptr, &eptr); - while (*eptr && ((*eptr == ',') || (*eptr == ' '))) eptr++; - if ((width > 0) && (height > 0)) { - pat->viewBox = Geom::Rect::from_xywh(x, y, width, height); - pat->viewBox_set = TRUE; - } else { - pat->viewBox_set = FALSE; - } - } else { - pat->viewBox_set = FALSE; - } - object->requestModified(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_VIEWPORT_MODIFIED_FLAG); - break; - } - case SP_ATTR_XLINK_HREF: - if ( value && pat->href && ( strcmp(value, pat->href) == 0 ) ) { - /* Href unchanged, do nothing. */ - } else { - g_free(pat->href); - pat->href = NULL; - if (value) { - // First, set the href field; it's only used in the "unchanged" check above. - pat->href = g_strdup(value); - // Now do the attaching, which emits the changed signal. - if (value) { - try { - pat->ref->attach(Inkscape::URI(value)); - } catch (Inkscape::BadURIException &e) { - g_warning("%s", e.what()); - pat->ref->detach(); - } - } else { - pat->ref->detach(); - } - } - } - break; - default: - if (((SPObjectClass *) sp_pattern_parent_class)->set) - ((SPObjectClass *) sp_pattern_parent_class)->set (object, key, value); - break; - } + SPPattern *pat = SP_PATTERN (object); + + switch (key) { + case SP_ATTR_PATTERNUNITS: + if (value) { + if (!strcmp (value, "userSpaceOnUse")) { + pat->patternUnits = SP_PATTERN_UNITS_USERSPACEONUSE; + } else { + pat->patternUnits = SP_PATTERN_UNITS_OBJECTBOUNDINGBOX; + } + pat->patternUnits_set = TRUE; + } else { + pat->patternUnits_set = FALSE; + } + object->requestModified(SP_OBJECT_MODIFIED_FLAG); + break; + case SP_ATTR_PATTERNCONTENTUNITS: + if (value) { + if (!strcmp (value, "userSpaceOnUse")) { + pat->patternContentUnits = SP_PATTERN_UNITS_USERSPACEONUSE; + } else { + pat->patternContentUnits = SP_PATTERN_UNITS_OBJECTBOUNDINGBOX; + } + pat->patternContentUnits_set = TRUE; + } else { + pat->patternContentUnits_set = FALSE; + } + object->requestModified(SP_OBJECT_MODIFIED_FLAG); + break; + case SP_ATTR_PATTERNTRANSFORM: { + Geom::Affine t; + if (value && sp_svg_transform_read (value, &t)) { + pat->patternTransform = t; + pat->patternTransform_set = TRUE; + } else { + pat->patternTransform = Geom::identity(); + pat->patternTransform_set = FALSE; + } + object->requestModified(SP_OBJECT_MODIFIED_FLAG); + break; + } + case SP_ATTR_X: + pat->x.readOrUnset(value); + object->requestModified(SP_OBJECT_MODIFIED_FLAG); + break; + case SP_ATTR_Y: + pat->y.readOrUnset(value); + object->requestModified(SP_OBJECT_MODIFIED_FLAG); + break; + case SP_ATTR_WIDTH: + pat->width.readOrUnset(value); + object->requestModified(SP_OBJECT_MODIFIED_FLAG); + break; + case SP_ATTR_HEIGHT: + pat->height.readOrUnset(value); + object->requestModified(SP_OBJECT_MODIFIED_FLAG); + break; + case SP_ATTR_VIEWBOX: { + /* fixme: Think (Lauris) */ + if (value) { + char *eptr = const_cast(value); + double x = g_ascii_strtod (eptr, &eptr); + while (*eptr && ((*eptr == ',') || (*eptr == ' '))) eptr++; + double y = g_ascii_strtod (eptr, &eptr); + while (*eptr && ((*eptr == ',') || (*eptr == ' '))) eptr++; + double width = g_ascii_strtod (eptr, &eptr); + while (*eptr && ((*eptr == ',') || (*eptr == ' '))) eptr++; + double height = g_ascii_strtod (eptr, &eptr); + while (*eptr && ((*eptr == ',') || (*eptr == ' '))) eptr++; + if ((width > 0) && (height > 0)) { + pat->viewBox = Geom::Rect::from_xywh(x, y, width, height); + pat->viewBox_set = TRUE; + } else { + pat->viewBox_set = FALSE; + } + } else { + pat->viewBox_set = FALSE; + } + object->requestModified(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_VIEWPORT_MODIFIED_FLAG); + break; + } + case SP_ATTR_XLINK_HREF: + if ( value && pat->href && ( strcmp(value, pat->href) == 0 ) ) { + /* Href unchanged, do nothing. */ + } else { + g_free(pat->href); + pat->href = NULL; + if (value) { + // First, set the href field; it's only used in the "unchanged" check above. + pat->href = g_strdup(value); + // Now do the attaching, which emits the changed signal. + if (value) { + try { + pat->ref->attach(Inkscape::URI(value)); + } catch (Inkscape::BadURIException &e) { + g_warning("%s", e.what()); + pat->ref->detach(); + } + } else { + pat->ref->detach(); + } + } + } + break; + default: + if (((SPObjectClass *) sp_pattern_parent_class)->set) + ((SPObjectClass *) sp_pattern_parent_class)->set (object, key, value); + break; + } } /* TODO: do we need a ::remove_child handler? */ @@ -268,11 +265,11 @@ static GSList *pattern_getchildren(SPPattern *pat) for (SPPattern *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { if (pat_i->firstChild()) { // find the first one with children - for (SPObject *child = pat->firstChild() ; child ; child = child->getNext() ) { - l = g_slist_prepend (l, child); - } - break; // do not go further up the chain if children are found - } + for (SPObject *child = pat->firstChild() ; child ; child = child->getNext() ) { + l = g_slist_prepend (l, child); + } + break; // do not go further up the chain if children are found + } } return l; @@ -281,45 +278,45 @@ static GSList *pattern_getchildren(SPPattern *pat) static void sp_pattern_update (SPObject *object, SPCtx *ctx, unsigned int flags) { - SPPattern *pat = SP_PATTERN (object); - - if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; - flags &= SP_OBJECT_MODIFIED_CASCADE; - - GSList *l = pattern_getchildren (pat); - l = g_slist_reverse (l); - - while (l) { - SPObject *child = SP_OBJECT (l->data); - sp_object_ref (child, NULL); - l = g_slist_remove (l, child); - if (flags || (child->mflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) { - child->updateDisplay(ctx, flags); - } - sp_object_unref (child, NULL); - } + SPPattern *pat = SP_PATTERN (object); + + if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; + flags &= SP_OBJECT_MODIFIED_CASCADE; + + GSList *l = pattern_getchildren (pat); + l = g_slist_reverse (l); + + while (l) { + SPObject *child = SP_OBJECT (l->data); + sp_object_ref (child, NULL); + l = g_slist_remove (l, child); + if (flags || (child->mflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) { + child->updateDisplay(ctx, flags); + } + sp_object_unref (child, NULL); + } } static void sp_pattern_modified (SPObject *object, guint flags) { - SPPattern *pat = SP_PATTERN (object); - - if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; - flags &= SP_OBJECT_MODIFIED_CASCADE; - - GSList *l = pattern_getchildren (pat); - l = g_slist_reverse (l); - - while (l) { - SPObject *child = SP_OBJECT (l->data); - sp_object_ref (child, NULL); - l = g_slist_remove (l, child); - if (flags || (child->mflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) { - child->emitModified(flags); - } - sp_object_unref (child, NULL); - } + SPPattern *pat = SP_PATTERN (object); + + if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; + flags &= SP_OBJECT_MODIFIED_CASCADE; + + GSList *l = pattern_getchildren (pat); + l = g_slist_reverse (l); + + while (l) { + SPObject *child = SP_OBJECT (l->data); + sp_object_ref (child, NULL); + l = g_slist_remove (l, child); + if (flags || (child->mflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) { + child->emitModified(flags); + } + sp_object_unref (child, NULL); + } } /** @@ -328,14 +325,14 @@ Gets called when the pattern is reattached to another static void pattern_ref_changed(SPObject *old_ref, SPObject *ref, SPPattern *pat) { - if (old_ref) { - pat->modified_connection.disconnect(); - } - if (SP_IS_PATTERN (ref)) { - pat->modified_connection = ref->connectModified(sigc::bind<2>(sigc::ptr_fun(&pattern_ref_modified), pat)); - } - - pattern_ref_modified (ref, 0, pat); + if (old_ref) { + pat->modified_connection.disconnect(); + } + if (SP_IS_PATTERN (ref)) { + pat->modified_connection = ref->connectModified(sigc::bind<2>(sigc::ptr_fun(&pattern_ref_modified), pat)); + } + + pattern_ref_modified (ref, 0, pat); } /** @@ -386,56 +383,56 @@ count_pattern_hrefs(SPObject *o, SPPattern *pat) SPPattern *pattern_chain(SPPattern *pattern) { - SPDocument *document = pattern->document; + SPDocument *document = pattern->document; Inkscape::XML::Document *xml_doc = document->getReprDoc(); - Inkscape::XML::Node *defsrepr = document->getDefs()->getRepr(); + Inkscape::XML::Node *defsrepr = document->getDefs()->getRepr(); - Inkscape::XML::Node *repr = xml_doc->createElement("svg:pattern"); - repr->setAttribute("inkscape:collect", "always"); - gchar *parent_ref = g_strconcat("#", pattern->getRepr()->attribute("id"), NULL); - repr->setAttribute("xlink:href", parent_ref); - g_free (parent_ref); + Inkscape::XML::Node *repr = xml_doc->createElement("svg:pattern"); + repr->setAttribute("inkscape:collect", "always"); + gchar *parent_ref = g_strconcat("#", pattern->getRepr()->attribute("id"), NULL); + repr->setAttribute("xlink:href", parent_ref); + g_free (parent_ref); - defsrepr->addChild(repr, NULL); - const gchar *child_id = repr->attribute("id"); - SPObject *child = document->getObjectById(child_id); - g_assert (SP_IS_PATTERN (child)); + defsrepr->addChild(repr, NULL); + const gchar *child_id = repr->attribute("id"); + SPObject *child = document->getObjectById(child_id); + g_assert (SP_IS_PATTERN (child)); - return SP_PATTERN (child); + return SP_PATTERN (child); } SPPattern * sp_pattern_clone_if_necessary (SPItem *item, SPPattern *pattern, const gchar *property) { - if (!pattern->href || pattern->hrefcount > count_pattern_hrefs(item, pattern)) { - pattern = pattern_chain (pattern); - gchar *href = g_strconcat("url(#", pattern->getRepr()->attribute("id"), ")", NULL); - - SPCSSAttr *css = sp_repr_css_attr_new (); - sp_repr_css_set_property (css, property, href); - sp_repr_css_change_recursive(item->getRepr(), css, "style"); - } - return pattern; + if (!pattern->href || pattern->hrefcount > count_pattern_hrefs(item, pattern)) { + pattern = pattern_chain (pattern); + gchar *href = g_strconcat("url(#", pattern->getRepr()->attribute("id"), ")", NULL); + + SPCSSAttr *css = sp_repr_css_attr_new (); + sp_repr_css_set_property (css, property, href); + sp_repr_css_change_recursive(item->getRepr(), css, "style"); + } + return pattern; } void sp_pattern_transform_multiply (SPPattern *pattern, Geom::Affine postmul, bool set) { - // this formula is for a different interpretation of pattern transforms as described in (*) in sp-pattern.cpp - // for it to work, we also need sp_object_read_attr( item, "transform"); - //pattern->patternTransform = premul * item->transform * pattern->patternTransform * item->transform.inverse() * postmul; - - // otherwise the formula is much simpler - if (set) { - pattern->patternTransform = postmul; - } else { - pattern->patternTransform = pattern_patternTransform(pattern) * postmul; - } - pattern->patternTransform_set = TRUE; - - gchar *c=sp_svg_transform_write(pattern->patternTransform); - pattern->getRepr()->setAttribute("patternTransform", c); - g_free(c); + // this formula is for a different interpretation of pattern transforms as described in (*) in sp-pattern.cpp + // for it to work, we also need sp_object_read_attr( item, "transform"); + //pattern->patternTransform = premul * item->transform * pattern->patternTransform * item->transform.inverse() * postmul; + + // otherwise the formula is much simpler + if (set) { + pattern->patternTransform = postmul; + } else { + pattern->patternTransform = pattern_patternTransform(pattern) * postmul; + } + pattern->patternTransform_set = TRUE; + + gchar *c=sp_svg_transform_write(pattern->patternTransform); + pattern->getRepr()->setAttribute("patternTransform", c); + g_free(c); } const gchar *pattern_tile(GSList *reprs, Geom::Rect bounds, SPDocument *document, Geom::Affine transform, Geom::Affine move) @@ -443,33 +440,33 @@ const gchar *pattern_tile(GSList *reprs, Geom::Rect bounds, SPDocument *document Inkscape::XML::Document *xml_doc = document->getReprDoc(); Inkscape::XML::Node *defsrepr = document->getDefs()->getRepr(); - Inkscape::XML::Node *repr = xml_doc->createElement("svg:pattern"); - repr->setAttribute("patternUnits", "userSpaceOnUse"); - sp_repr_set_svg_double(repr, "width", bounds.dimensions()[Geom::X]); - sp_repr_set_svg_double(repr, "height", bounds.dimensions()[Geom::Y]); + Inkscape::XML::Node *repr = xml_doc->createElement("svg:pattern"); + repr->setAttribute("patternUnits", "userSpaceOnUse"); + sp_repr_set_svg_double(repr, "width", bounds.dimensions()[Geom::X]); + sp_repr_set_svg_double(repr, "height", bounds.dimensions()[Geom::Y]); - gchar *t=sp_svg_transform_write(transform); - repr->setAttribute("patternTransform", t); - g_free(t); + gchar *t=sp_svg_transform_write(transform); + repr->setAttribute("patternTransform", t); + g_free(t); - defsrepr->appendChild(repr); - const gchar *pat_id = repr->attribute("id"); - SPObject *pat_object = document->getObjectById(pat_id); + defsrepr->appendChild(repr); + const gchar *pat_id = repr->attribute("id"); + SPObject *pat_object = document->getObjectById(pat_id); - for (GSList *i = reprs; i != NULL; i = i->next) { - Inkscape::XML::Node *node = (Inkscape::XML::Node *)(i->data); - SPItem *copy = SP_ITEM(pat_object->appendChildRepr(node)); + for (GSList *i = reprs; i != NULL; i = i->next) { + Inkscape::XML::Node *node = (Inkscape::XML::Node *)(i->data); + SPItem *copy = SP_ITEM(pat_object->appendChildRepr(node)); - Geom::Affine dup_transform; - if (!sp_svg_transform_read (node->attribute("transform"), &dup_transform)) - dup_transform = Geom::identity(); - dup_transform *= move; + Geom::Affine dup_transform; + if (!sp_svg_transform_read (node->attribute("transform"), &dup_transform)) + dup_transform = Geom::identity(); + dup_transform *= move; copy->doWriteTransform(copy->getRepr(), dup_transform, NULL, false); } - Inkscape::GC::release(repr); - return pat_id; + Inkscape::GC::release(repr); + return pat_id; } SPPattern *pattern_getroot(SPPattern *pat) diff --git a/src/sp-text.cpp b/src/sp-text.cpp index 8d42b7d59..e43a34762 100644 --- a/src/sp-text.cpp +++ b/src/sp-text.cpp @@ -381,9 +381,9 @@ static char * sp_text_description(SPItem *item) font_instance *tf = font_factory::Default()->FaceFromStyle(style); - char name_buf[256]; char *n; if (tf) { + char name_buf[256]; tf->Family(name_buf, sizeof(name_buf)); n = xml_quote_strdup(name_buf); tf->Unref(); diff --git a/src/sp-use.cpp b/src/sp-use.cpp index 2220b4b47..5ec1f2523 100644 --- a/src/sp-use.cpp +++ b/src/sp-use.cpp @@ -252,8 +252,7 @@ sp_use_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML:: return repr; } -static Geom::OptRect -sp_use_bbox(SPItem const *item, Geom::Affine const &transform, SPItem::BBoxType type) +static Geom::OptRect sp_use_bbox(SPItem const *item, Geom::Affine const &transform, SPItem::BBoxType type) { SPUse const *use = SP_USE(item); Geom::OptRect bbox; @@ -269,8 +268,7 @@ sp_use_bbox(SPItem const *item, Geom::Affine const &transform, SPItem::BBoxType return bbox; } -static void -sp_use_print(SPItem *item, SPPrintContext *ctx) +static void sp_use_print(SPItem *item, SPPrintContext *ctx) { bool translated = false; SPUse *use = SP_USE(item); @@ -290,12 +288,10 @@ sp_use_print(SPItem *item, SPPrintContext *ctx) } } -static gchar * -sp_use_description(SPItem *item) +static gchar *sp_use_description(SPItem *item) { SPUse *use = SP_USE(item); - char *ret; if (use->child) { if( SP_IS_SYMBOL( use->child ) ) { @@ -316,7 +312,7 @@ sp_use_description(SPItem *item) char *child_desc = SP_ITEM(use->child)->description(); --recursion_depth; - ret = g_strdup_printf(_("Clone of: %s"), child_desc); + char *ret = g_strdup_printf(_("Clone of: %s"), child_desc); g_free(child_desc); return ret; } else { diff --git a/src/syseq.h b/src/syseq.h index 4e7ccd943..582f2949f 100644 --- a/src/syseq.h +++ b/src/syseq.h @@ -181,10 +181,9 @@ static std::vector gauss_jordan (double A[S][T], int avoid_col = -1) { if (avoid_col != -1) { cols_used.push_back (avoid_col); } - int col; for (int i = 0; i < S; ++i) { /* for each row find a pivot element of maximal absolute value, skipping the columns that were used before */ - col = find_pivot(A, i, cols_used); + int col = find_pivot(A, i, cols_used); cols_used.push_back(col); if (col == -1) { // no non-zero elements in the row -- cgit v1.2.3 From 6ae6c0bea96eef09907091279e0678aa5f83102d Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Sun, 4 Aug 2013 18:01:18 -0400 Subject: Switched to global UnitTable. (bzr r12380.1.62) --- src/display/canvas-axonomgrid.cpp | 4 +--- src/display/canvas-grid.cpp | 7 +------ src/document.cpp | 3 +-- src/live_effects/parameter/unit.cpp | 4 ++-- src/lpe-tool-context.cpp | 5 ++--- src/main.cpp | 1 - src/measure-context.cpp | 2 +- src/preferences.cpp | 4 ++-- src/sp-namedview.cpp | 5 +---- src/ui/dialog/clonetiler.cpp | 6 +----- src/ui/dialog/export.cpp | 4 ++-- src/ui/widget/page-sizer.cpp | 3 +-- src/ui/widget/page-sizer.h | 1 - src/ui/widget/scalar-unit.cpp | 7 ++++--- src/ui/widget/selected-style.cpp | 3 ++- src/ui/widget/unit-menu.cpp | 16 +++++++++------- src/ui/widget/unit-menu.h | 3 --- src/ui/widget/unit-tracker.cpp | 12 +++++++----- src/ui/widget/unit-tracker.h | 2 -- src/util/expression-evaluator.cpp | 4 ++-- src/util/units.cpp | 9 ++------- src/util/units.h | 2 ++ src/widgets/desktop-widget.cpp | 2 +- src/widgets/node-toolbar.cpp | 4 +--- src/widgets/paintbucket-toolbar.cpp | 2 +- src/widgets/rect-toolbar.cpp | 3 +-- src/widgets/ruler.cpp | 6 +----- src/widgets/select-toolbar.cpp | 5 +---- src/widgets/stroke-style.cpp | 2 +- 29 files changed, 50 insertions(+), 81 deletions(-) (limited to 'src') diff --git a/src/display/canvas-axonomgrid.cpp b/src/display/canvas-axonomgrid.cpp index d3db94975..f7a7cb39a 100644 --- a/src/display/canvas-axonomgrid.cpp +++ b/src/display/canvas-axonomgrid.cpp @@ -53,6 +53,7 @@ #include "round.h" #include "util/units.h" +using Inkscape::Util::unit_table; enum Dim3 { X=0, Y, Z }; @@ -160,7 +161,6 @@ CanvasAxonomGrid::CanvasAxonomGrid (SPNamedView * nv, Inkscape::XML::Node * in_r : CanvasGrid(nv, in_repr, in_doc, GRID_AXONOMETRIC) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - Inkscape::Util::UnitTable unit_table; gridunit = new Inkscape::Util::Unit(unit_table.getUnit(prefs->getString("/options/grids/axonom/units"))); if (!gridunit) gridunit = new Inkscape::Util::Unit(unit_table.getUnit("px")); @@ -213,7 +213,6 @@ void CanvasAxonomGrid::readRepr() { gchar const *value; - Inkscape::Util::UnitTable unit_table; if ( (value = repr->attribute("originx")) ) { Inkscape::Util::Quantity q = unit_table.getQuantity(value); gridunit = q.unit; @@ -370,7 +369,6 @@ _wr.setUpdating (false); _rumg->setUnit (gridunit->abbr); gdouble val; - Inkscape::Util::UnitTable unit_table; val = origin[Geom::X]; val = Inkscape::Util::Quantity::convert(val, "px", *gridunit); _rsu_ox->setValue (val); diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp index 1a5e0e52d..ef32c113b 100644 --- a/src/display/canvas-grid.cpp +++ b/src/display/canvas-grid.cpp @@ -55,6 +55,7 @@ #include "display/sp-canvas.h" using Inkscape::DocumentUndo; +using Inkscape::Util::unit_table; namespace Inkscape { @@ -397,8 +398,6 @@ void CanvasGrid::setOrigin(Geom::Point const &origin_px) Inkscape::SVGOStringStream os_x, os_y; gdouble val; - Inkscape::Util::UnitTable unit_table; - val = origin_px[Geom::X]; val = Inkscape::Util::Quantity::convert(val, "px", *gridunit); os_x << val << gridunit->abbr; @@ -490,7 +489,6 @@ CanvasXYGrid::CanvasXYGrid (SPNamedView * nv, Inkscape::XML::Node * in_repr, SPD : CanvasGrid(nv, in_repr, in_doc, GRID_RECTANGULAR) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - Inkscape::Util::UnitTable unit_table; gridunit = new Inkscape::Util::Unit(unit_table.getUnit(prefs->getString("/options/grids/xy/units"))); if (!gridunit) { gridunit = new Inkscape::Util::Unit(unit_table.getUnit("px")); @@ -588,8 +586,6 @@ static void validateInt(gint oldVal, void CanvasXYGrid::readRepr() { - Inkscape::Util::UnitTable unit_table; - gchar const *value; if ( (value = repr->attribute("originx")) ) { Inkscape::Util::Quantity q = unit_table.getQuantity(value); @@ -756,7 +752,6 @@ CanvasXYGrid::newSpecificWidget() _rumg->setUnit (gridunit->abbr); gdouble val; - Inkscape::Util::UnitTable unit_table; val = origin[Geom::X]; val = Inkscape::Util::Quantity::convert(val, "px", *gridunit); _rsu_ox->setValue (val); diff --git a/src/document.cpp b/src/document.cpp index afd0a6ddc..0b742e491 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -68,6 +68,7 @@ #include "libcroco/cr-cascade.h" using Inkscape::DocumentUndo; +using Inkscape::Util::unit_table; // Higher number means lower priority. #define SP_DOCUMENT_UPDATE_PRIORITY (G_PRIORITY_HIGH_IDLE - 2) @@ -86,8 +87,6 @@ static gint doc_count = 0; static unsigned long next_serial = 0; -static Inkscape::Util::UnitTable unit_table; - SPDocument::SPDocument() : keepalive(FALSE), virgin(TRUE), diff --git a/src/live_effects/parameter/unit.cpp b/src/live_effects/parameter/unit.cpp index 264b4b9ee..561766920 100644 --- a/src/live_effects/parameter/unit.cpp +++ b/src/live_effects/parameter/unit.cpp @@ -12,6 +12,8 @@ #include "verbs.h" #include "util/units.h" +using Inkscape::Util::unit_table; + namespace Inkscape { namespace LivePathEffect { @@ -22,7 +24,6 @@ UnitParam::UnitParam( const Glib::ustring& label, const Glib::ustring& tip, Effect* effect, Glib::ustring default_unit) : Parameter(label, tip, key, wr, effect) { - Inkscape::Util::UnitTable unit_table; defunit = new Inkscape::Util::Unit(unit_table.getUnit(default_unit)); unit = defunit; } @@ -34,7 +35,6 @@ UnitParam::~UnitParam() bool UnitParam::param_readSVGValue(const gchar * strvalue) { - Inkscape::Util::UnitTable unit_table; if (strvalue) { param_set_value(unit_table.getUnit(strvalue)); return true; diff --git a/src/lpe-tool-context.cpp b/src/lpe-tool-context.cpp index 32096970f..4e50a12e1 100644 --- a/src/lpe-tool-context.cpp +++ b/src/lpe-tool-context.cpp @@ -41,6 +41,8 @@ #include "lpe-tool-context.h" +using Inkscape::Util::unit_table; + static void sp_lpetool_context_dispose(GObject *object); static void sp_lpetool_context_setup(SPEventContext *ec); @@ -444,8 +446,6 @@ lpetool_create_measuring_items(SPLPEToolContext *lc, Inkscape::Selection *select gchar *arc_length; double lengthval; - Inkscape::Util::UnitTable unit_table; - for (GSList const *i = selection->itemList(); i != NULL; i = i->next) { if (SP_IS_PATH(i->data)) { path = SP_PATH(i->data); @@ -488,7 +488,6 @@ void lpetool_update_measuring_items(SPLPEToolContext *lc) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - Inkscape::Util::UnitTable unit_table; SPPath *path; SPCurve *curve; double lengthval; diff --git a/src/main.cpp b/src/main.cpp index 577cc3d79..29f431aa8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -68,7 +68,6 @@ #include "color.h" #include "sp-item.h" #include "sp-root.h" -#include "util/units.h" #include "svg/svg.h" #include "svg/svg-color.h" diff --git a/src/measure-context.cpp b/src/measure-context.cpp index 465b1da80..3c02c6f15 100644 --- a/src/measure-context.cpp +++ b/src/measure-context.cpp @@ -46,6 +46,7 @@ using Inkscape::ControlManager; using Inkscape::CTLINE_SECONDARY; +using Inkscape::Util::unit_table; static void sp_measure_context_setup(SPEventContext *ec); static void sp_measure_context_finish(SPEventContext *ec); @@ -515,7 +516,6 @@ static gint sp_measure_context_root_handler(SPEventContext *event_context, GdkEv std::sort(intersections.begin(), intersections.end(), GeomPointSortPredicate); } - Inkscape::Util::UnitTable unit_table; Glib::ustring unit_name = prefs->getString("/tools/measure/unit"); if (!unit_name.compare("")) { unit_name = "px"; diff --git a/src/preferences.cpp b/src/preferences.cpp index 1d7009a99..0dc6f1ec4 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -28,6 +28,8 @@ #define PREFERENCES_FILE_NAME "preferences.xml" +using Inkscape::Util::unit_table; + namespace Inkscape { static Inkscape::XML::Document *loadImpl( std::string const& prefsFilename, Glib::ustring & errMsg ); @@ -777,8 +779,6 @@ double Preferences::_extractDouble(Entry const &v) double Preferences::_extractDouble(Entry const &v, Glib::ustring const &requested_unit) { - static Inkscape::Util::UnitTable unit_table; // load the unit_table once by making it static - double val = _extractDouble(v); Glib::ustring unit = _extractUnit(v); diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp index dde205eed..48f8eba2a 100644 --- a/src/sp-namedview.cpp +++ b/src/sp-namedview.cpp @@ -40,6 +40,7 @@ #include using Inkscape::DocumentUndo; +using Inkscape::Util::unit_table; #define DEFAULTGRIDCOLOR 0x3f3fff25 #define DEFAULTGRIDEMPCOLOR 0x3f3fff60 @@ -287,8 +288,6 @@ static void sp_namedview_set(SPObject *object, unsigned int key, const gchar *va { SPNamedView *nv = SP_NAMEDVIEW(object); - static Inkscape::Util::UnitTable unit_table; - switch (key) { case SP_ATTR_VIEWONLY: nv->editable = (!value); @@ -1111,7 +1110,6 @@ double SPNamedView::getMarginLength(gchar const * const key, bool const use_width) { double value; - static Inkscape::Util::UnitTable unit_table; Inkscape::Util::Unit percent = unit_table.getUnit("%"); if(!this->storeAsDouble(key,&value)) { return 0.0; @@ -1133,7 +1131,6 @@ Inkscape::Util::Unit const SPNamedView::getDefaultUnit() const if (doc_units) { return *doc_units; } else { - Inkscape::Util::UnitTable unit_table; return *(new Inkscape::Util::Unit(unit_table.getUnit("pt"))); } } diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp index abb2512f7..b3675440b 100644 --- a/src/ui/dialog/clonetiler.cpp +++ b/src/ui/dialog/clonetiler.cpp @@ -58,6 +58,7 @@ #include "sp-root.h" using Inkscape::DocumentUndo; +using Inkscape::Util::unit_table; namespace Inkscape { namespace UI { @@ -1107,7 +1108,6 @@ CloneTiler::CloneTiler (void) : double value = prefs->getDouble(prefs_path + "fillwidth", 50.0); Inkscape::Util::Unit const unit = unit_menu->getUnit(); - Inkscape::Util::UnitTable unit_table; gdouble const units = Inkscape::Util::Quantity::convert(value, "px", unit); fill_width->set_value (units); @@ -1141,7 +1141,6 @@ CloneTiler::CloneTiler (void) : double value = prefs->getDouble(prefs_path + "fillheight", 50.0); Inkscape::Util::Unit const unit = unit_menu->getUnit(); - Inkscape::Util::UnitTable unit_table; gdouble const units = Inkscape::Util::Quantity::convert(value, "px", unit); fill_height->set_value (units); @@ -2950,7 +2949,6 @@ void CloneTiler::clonetiler_fill_width_changed(GtkAdjustment *adj, Inkscape::UI: { gdouble const raw_dist = gtk_adjustment_get_value (adj); Inkscape::Util::Unit const unit = u->getUnit(); - Inkscape::Util::UnitTable unit_table; gdouble const pixels = Inkscape::Util::Quantity::convert(raw_dist, unit, "px"); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); @@ -2961,7 +2959,6 @@ void CloneTiler::clonetiler_fill_height_changed(GtkAdjustment *adj, Inkscape::UI { gdouble const raw_dist = gtk_adjustment_get_value (adj); Inkscape::Util::Unit const unit = u->getUnit(); - Inkscape::Util::UnitTable unit_table; gdouble const pixels = Inkscape::Util::Quantity::convert(raw_dist, unit, "px"); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); @@ -2975,7 +2972,6 @@ void CloneTiler::clonetiler_unit_changed() gdouble height_pixels = prefs->getDouble(prefs_path + "fillheight"); Inkscape::Util::Unit unit = unit_menu->getUnit(); - Inkscape::Util::UnitTable unit_table; gdouble width_value = Inkscape::Util::Quantity::convert(width_pixels, "px", unit); gdouble height_value = Inkscape::Util::Quantity::convert(height_pixels, "px", unit); diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index 063902aa7..2c92608d7 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -107,6 +107,8 @@ #include "verbs.h" #include "export.h" +using Inkscape::Util::unit_table; + namespace { class MessageCleaner @@ -1883,7 +1885,6 @@ void Export::setValuePx( Gtk::Adjustment *adj, double val) #endif { const Unit unit = unit_selector->getUnit(); - Inkscape::Util::UnitTable unit_table; setValue(adj, Inkscape::Util::Quantity::convert(val, "px", unit)); @@ -1934,7 +1935,6 @@ float Export::getValuePx( Gtk::Adjustment *adj ) { float value = getValue( adj); const Unit unit = unit_selector->getUnit(); - Inkscape::Util::UnitTable unit_table; return Inkscape::Util::Quantity::convert(value, unit, "px"); } // end of sp_export_value_get_px() diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp index b15ab2823..d912fd9d3 100644 --- a/src/ui/widget/page-sizer.cpp +++ b/src/ui/widget/page-sizer.cpp @@ -47,9 +47,8 @@ #include "xml/node.h" #include "xml/repr.h" -static Inkscape::Util::UnitTable unit_table; - using std::pair; +using Inkscape::Util::unit_table; namespace Inkscape { namespace UI { diff --git a/src/ui/widget/page-sizer.h b/src/ui/widget/page-sizer.h index fc8edeeac..34ed7592d 100644 --- a/src/ui/widget/page-sizer.h +++ b/src/ui/widget/page-sizer.h @@ -117,7 +117,6 @@ private: name = ""; smaller = 0.0; larger = 0.0; - static Inkscape::Util::UnitTable unit_table; unit = unit_table.getUnit("px"); } diff --git a/src/ui/widget/scalar-unit.cpp b/src/ui/widget/scalar-unit.cpp index 99ff70846..2f4c1f341 100644 --- a/src/ui/widget/scalar-unit.cpp +++ b/src/ui/widget/scalar-unit.cpp @@ -16,6 +16,8 @@ #include "scalar-unit.h" #include "spinbutton.h" +using Inkscape::Util::unit_table; + namespace Inkscape { namespace UI { namespace Widget { @@ -226,9 +228,8 @@ void ScalarUnit::on_unit_changed() Glib::ustring abbr = _unit_menu->getUnitAbbr(); _suffix->set_label(abbr); - Inkscape::Util::UnitTable &table = _unit_menu->getUnitTable(); - Inkscape::Util::Unit new_unit = (table.getUnit(abbr)); - Inkscape::Util::Unit old_unit = (table.getUnit(lastUnits)); + Inkscape::Util::Unit new_unit = (unit_table.getUnit(abbr)); + Inkscape::Util::Unit old_unit = (unit_table.getUnit(lastUnits)); double convertedVal = 0; if (old_unit.type == UNIT_TYPE_DIMENSIONLESS && new_unit.type == UNIT_TYPE_LINEAR) { diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index edf53d25c..388a0bcea 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -52,6 +52,8 @@ #include "gradient-chemistry.h" #include "util/units.h" +using Inkscape::Util::unit_table; + static gdouble const _sw_presets[] = { 32 , 16 , 10 , 8 , 6 , 4 , 3 , 2 , 1.5 , 1 , 0.75 , 0.5 , 0.25 , 0.1 }; static gchar const *const _sw_presets_str[] = {"32", "16", "10", "8", "6", "4", "3", "2", "1.5", "1", "0.75", "0.5", "0.25", "0.1"}; @@ -307,7 +309,6 @@ SelectedStyle::SelectedStyle(bool /*layout*/) { int row = 0; - Inkscape::Util::UnitTable unit_table; Inkscape::Util::UnitTable::UnitMap m = unit_table.units(Inkscape::Util::UNIT_TYPE_LINEAR); Inkscape::Util::UnitTable::UnitMap::iterator iter = m.begin(); while(iter != m.end()) { diff --git a/src/ui/widget/unit-menu.cpp b/src/ui/widget/unit-menu.cpp index 18b7bcab9..111226774 100644 --- a/src/ui/widget/unit-menu.cpp +++ b/src/ui/widget/unit-menu.cpp @@ -15,6 +15,8 @@ #include "unit-menu.h" +using Inkscape::Util::unit_table; + namespace Inkscape { namespace UI { namespace Widget { @@ -30,7 +32,7 @@ UnitMenu::~UnitMenu() { bool UnitMenu::setUnitType(UnitType unit_type) { // Expand the unit widget with unit entries from the unit table - UnitTable::UnitMap m = _unit_table.units(unit_type); + UnitTable::UnitMap m = unit_table.units(unit_type); UnitTable::UnitMap::iterator iter = m.begin(); while(iter != m.end()) { Glib::ustring text = (*iter).first; @@ -38,7 +40,7 @@ bool UnitMenu::setUnitType(UnitType unit_type) ++iter; } _type = unit_type; - set_active_text(_unit_table.primary(unit_type)); + set_active_text(unit_table.primary(unit_type)); return true; } @@ -52,7 +54,7 @@ bool UnitMenu::resetUnitType(UnitType unit_type) void UnitMenu::addUnit(Unit const& u) { - _unit_table.addUnit(u, false); + unit_table.addUnit(u, false); append(u.abbr); } @@ -60,9 +62,9 @@ Unit UnitMenu::getUnit() const { if (get_active_text() == "") { g_assert(_type != UNIT_TYPE_NONE); - return _unit_table.getUnit(_unit_table.primary(_type)); + return unit_table.getUnit(unit_table.primary(_type)); } - return _unit_table.getUnit(get_active_text()); + return unit_table.getUnit(get_active_text()); } bool UnitMenu::setUnit(Glib::ustring const & unit) @@ -112,8 +114,8 @@ double UnitMenu::getConversion(Glib::ustring const &new_unit_abbr, Glib::ustring { double old_factor = getUnit().factor; if (old_unit_abbr != "no_unit") - old_factor = _unit_table.getUnit(old_unit_abbr).factor; - Unit new_unit = _unit_table.getUnit(new_unit_abbr); + old_factor = unit_table.getUnit(old_unit_abbr).factor; + Unit new_unit = unit_table.getUnit(new_unit_abbr); // Catch the case of zero or negative unit factors (error!) if (old_factor < 0.0000001 || diff --git a/src/ui/widget/unit-menu.h b/src/ui/widget/unit-menu.h index 3104d5aef..3f4df6bf9 100644 --- a/src/ui/widget/unit-menu.h +++ b/src/ui/widget/unit-menu.h @@ -127,10 +127,7 @@ public: */ bool isRadial() const; - UnitTable &getUnitTable() {return _unit_table;} - protected: - UnitTable _unit_table; UnitType _type; }; diff --git a/src/ui/widget/unit-tracker.cpp b/src/ui/widget/unit-tracker.cpp index 99074be40..5b2dc031b 100644 --- a/src/ui/widget/unit-tracker.cpp +++ b/src/ui/widget/unit-tracker.cpp @@ -17,6 +17,9 @@ #define COLUMN_STRING 0 +using Inkscape::Util::UnitTable; +using Inkscape::Util::unit_table; + namespace Inkscape { namespace UI { namespace Widget { @@ -32,10 +35,9 @@ UnitTracker::UnitTracker(UnitType unit_type) : _priorValues() { _store = gtk_list_store_new(1, G_TYPE_STRING); - static Inkscape::Util::UnitTable unit_table; GtkTreeIter iter; - UnitTable::UnitMap m = _unit_table.units(unit_type); + UnitTable::UnitMap m = unit_table.units(unit_type); UnitTable::UnitMap::iterator m_iter = m.begin(); while(m_iter != m.end()) { Glib::ustring text = (*m_iter).first; @@ -99,7 +101,7 @@ void UnitTracker::setActiveUnit(Inkscape::Util::Unit const *unit) void UnitTracker::setActiveUnitByAbbr(gchar const *abbr) { - Inkscape::Util::Unit u = _unit_table.getUnit(abbr); + Inkscape::Util::Unit u = unit_table.getUnit(abbr); setActiveUnit(&u); } @@ -195,13 +197,13 @@ void UnitTracker::_setActive(gint active) if (found) { gchar *abbr; gtk_tree_model_get(GTK_TREE_MODEL(_store), &iter, COLUMN_STRING, &abbr, -1); - Inkscape::Util::Unit unit = _unit_table.getUnit(abbr); + Inkscape::Util::Unit unit = unit_table.getUnit(abbr); found = gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(_store), &iter, NULL, active); if (found) { gchar *newAbbr; gtk_tree_model_get(GTK_TREE_MODEL(_store), &iter, COLUMN_STRING, &newAbbr, -1); - Inkscape::Util::Unit newUnit = _unit_table.getUnit(newAbbr); + Inkscape::Util::Unit newUnit = unit_table.getUnit(newAbbr); _activeUnit = newUnit; if (_adjList) { diff --git a/src/ui/widget/unit-tracker.h b/src/ui/widget/unit-tracker.h index cdcb07c57..19559ae1c 100644 --- a/src/ui/widget/unit-tracker.h +++ b/src/ui/widget/unit-tracker.h @@ -21,7 +21,6 @@ #include "util/units.h" using Inkscape::Util::Unit; -using Inkscape::Util::UnitTable; using Inkscape::Util::UnitType; namespace Inkscape { @@ -46,7 +45,6 @@ public: GtkAction *createAction(gchar const *name, gchar const *label, gchar const *tooltip); protected: - UnitTable _unit_table; UnitType _type; private: diff --git a/src/util/expression-evaluator.cpp b/src/util/expression-evaluator.cpp index 3e1bab6bc..dc59c67f4 100644 --- a/src/util/expression-evaluator.cpp +++ b/src/util/expression-evaluator.cpp @@ -29,6 +29,8 @@ #include +using Inkscape::Util::unit_table; + namespace Inkscape { namespace Util { @@ -77,8 +79,6 @@ typedef struct */ static bool unitresolverproc (const gchar* identifier, GimpEevlQuantity *result, Unit* unit) { - static UnitTable unit_table; - if (!unit) { result->value = 1; result->dimension = 1; diff --git a/src/util/units.cpp b/src/util/units.cpp index 7f60eb391..7bc910fcc 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -303,6 +303,8 @@ bool UnitTable::save(std::string const &filename) { return true; } +Inkscape::Util::UnitTable unit_table; + void UnitParser::on_start_element(Ctx &ctx, Glib::ustring const &name, AttrMap const &attrs) { if (name == "unit") { @@ -358,7 +360,6 @@ Quantity::Quantity(double q, const Unit &u) } Quantity::Quantity(double q, const Glib::ustring u) { - UnitTable unit_table; unit = new Unit(unit_table.getUnit(u)); quantity = q; } @@ -369,7 +370,6 @@ bool Quantity::compatibleWith(const Unit &u) const } bool Quantity::compatibleWith(const Glib::ustring u) const { - static UnitTable unit_table; return compatibleWith(unit_table.getUnit(u)); } @@ -379,7 +379,6 @@ double Quantity::value(const Unit &u) const } double Quantity::value(const Glib::ustring u) const { - static UnitTable unit_table; return value(unit_table.getUnit(u)); } @@ -387,7 +386,6 @@ Glib::ustring Quantity::string(const Unit &u) const { return Glib::ustring::format(std::fixed, std::setprecision(2), value(u)) + " " + unit->abbr; } Glib::ustring Quantity::string(const Glib::ustring u) const { - static UnitTable unit_table; return string(unit_table.getUnit(u)); } Glib::ustring Quantity::string() const { @@ -411,17 +409,14 @@ double Quantity::convert(const double from_dist, const Unit &from, const Unit &t } double Quantity::convert(const double from_dist, const Glib::ustring from, const Unit &to) { - static UnitTable unit_table; return convert(from_dist, unit_table.getUnit(from), to); } double Quantity::convert(const double from_dist, const Unit &from, const Glib::ustring to) { - static UnitTable unit_table; return convert(from_dist, from, unit_table.getUnit(to)); } double Quantity::convert(const double from_dist, const Glib::ustring from, const Glib::ustring to) { - static UnitTable unit_table; return convert(from_dist, unit_table.getUnit(from), unit_table.getUnit(to)); } diff --git a/src/util/units.h b/src/util/units.h index c30fa24b3..bb202b96a 100644 --- a/src/util/units.h +++ b/src/util/units.h @@ -175,6 +175,8 @@ class UnitTable { }; +extern UnitTable unit_table; + } // namespace Util } // namespace Inkscape diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 863912d03..6493da84d 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -83,6 +83,7 @@ using Inkscape::UI::Widget::UnitTracker; using Inkscape::UI::UXManager; using Inkscape::UI::ToolboxFactory; using ege::AppearTimeTracker; +using Inkscape::Util::unit_table; enum { ACTIVATE, @@ -393,7 +394,6 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw ) GtkWidget *eventbox = gtk_event_box_new (); dtw->hruler = sp_ruler_new(GTK_ORIENTATION_HORIZONTAL); dtw->hruler_box = eventbox; - Inkscape::Util::UnitTable unit_table; Inkscape::Util::Unit pt = unit_table.getUnit("pt"); sp_ruler_set_unit(SP_RULER(dtw->hruler), pt); gtk_widget_set_tooltip_text (dtw->hruler_box, gettext(pt.name_plural.c_str())); diff --git a/src/widgets/node-toolbar.cpp b/src/widgets/node-toolbar.cpp index 65e42a60b..a9e298f1d 100644 --- a/src/widgets/node-toolbar.cpp +++ b/src/widgets/node-toolbar.cpp @@ -70,6 +70,7 @@ using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; using Inkscape::UI::PrefPusher; +using Inkscape::Util::unit_table; //#################################### //# node editing callbacks @@ -249,7 +250,6 @@ static void sp_node_toolbox_coord_changed(gpointer /*shape_editor*/, GObject *tb } else { gtk_action_set_sensitive(xact, TRUE); gtk_action_set_sensitive(yact, TRUE); - Inkscape::Util::UnitTable unit_table; Geom::Coord oldx = Quantity::convert(gtk_adjustment_get_value(xadj), unit, "px"); Geom::Coord oldy = Quantity::convert(gtk_adjustment_get_value(yadj), unit, "px"); Geom::Point mid = nt->_selected_nodes->pointwiseBounds()->midpoint(); @@ -276,8 +276,6 @@ static void sp_node_path_value_changed(GtkAdjustment *adj, GObject *tbl, Geom::D } Unit const unit = tracker->getActiveUnit(); - Inkscape::Util::UnitTable unit_table; - if (DocumentUndo::getUndoSensitive(sp_desktop_document(desktop))) { prefs->setDouble(Glib::ustring("/tools/nodes/") + (d == Geom::X ? "x" : "y"), Quantity::convert(gtk_adjustment_get_value(adj), unit, "px")); diff --git a/src/widgets/paintbucket-toolbar.cpp b/src/widgets/paintbucket-toolbar.cpp index 3bb1fa24a..7c23379cd 100644 --- a/src/widgets/paintbucket-toolbar.cpp +++ b/src/widgets/paintbucket-toolbar.cpp @@ -68,6 +68,7 @@ using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; using Inkscape::UI::PrefPusher; +using Inkscape::Util::unit_table; @@ -175,7 +176,6 @@ void sp_paintbucket_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions // Create the units menu. UnitTracker* tracker = new UnitTracker(Inkscape::Util::UNIT_TYPE_LINEAR); - Inkscape::Util::UnitTable unit_table; Glib::ustring stored_unit = prefs->getString("/tools/paintbucket/offsetunits"); if (!stored_unit.empty()) { Unit u = unit_table.getUnit(stored_unit); diff --git a/src/widgets/rect-toolbar.cpp b/src/widgets/rect-toolbar.cpp index 29488031f..6dfd9cfcb 100644 --- a/src/widgets/rect-toolbar.cpp +++ b/src/widgets/rect-toolbar.cpp @@ -66,6 +66,7 @@ using Inkscape::UI::ToolboxFactory; using Inkscape::UI::PrefPusher; using Inkscape::Util::Unit; using Inkscape::Util::Quantity; +using Inkscape::Util::unit_table; //######################## @@ -93,7 +94,6 @@ static void sp_rtb_value_changed(GtkAdjustment *adj, GObject *tbl, gchar const * UnitTracker* tracker = reinterpret_cast(g_object_get_data( tbl, "tracker" )); Unit const unit = tracker->getActiveUnit(); - Inkscape::Util::UnitTable unit_table; if (DocumentUndo::getUndoSensitive(sp_desktop_document(desktop))) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); @@ -187,7 +187,6 @@ static void rect_tb_event_attr_changed(Inkscape::XML::Node * /*repr*/, gchar con UnitTracker* tracker = reinterpret_cast( g_object_get_data( tbl, "tracker" ) ); Unit const unit = tracker->getActiveUnit(); - Inkscape::Util::UnitTable unit_table; gpointer item = g_object_get_data( tbl, "item" ); if (item && SP_IS_RECT(item)) { diff --git a/src/widgets/ruler.cpp b/src/widgets/ruler.cpp index 274e1df54..e4e72d86e 100644 --- a/src/widgets/ruler.cpp +++ b/src/widgets/ruler.cpp @@ -44,6 +44,7 @@ #define DEFAULT_RULER_FONT_SCALE PANGO_SCALE_X_SMALL #define MINIMUM_INCR 5 +using Inkscape::Util::unit_table; enum { PROP_0, @@ -258,8 +259,6 @@ sp_ruler_init (SPRuler *ruler) gtk_widget_set_has_window (GTK_WIDGET (ruler), FALSE); - Inkscape::Util::UnitTable unit_table; - priv->orientation = GTK_ORIENTATION_HORIZONTAL; priv->unit = new Inkscape::Util::Unit(unit_table.getUnit("px")); priv->lower = 0; @@ -380,8 +379,6 @@ sp_ruler_set_property (GObject *object, SPRuler *ruler = SP_RULER (object); SPRulerPrivate *priv = SP_RULER_GET_PRIVATE (ruler); - Inkscape::Util::UnitTable unit_table; - switch (prop_id) { case PROP_ORIENTATION: @@ -1189,7 +1186,6 @@ sp_ruler_draw_ticks (SPRuler *ruler) SPRulerMetric ruler_metric = ruler_metric_general; /* The metric to use for this unit system */ PangoLayout *layout; PangoRectangle logical_rect, ink_rect; - Inkscape::Util::UnitTable unit_table; if (! gtk_widget_is_drawable (widget)) return; diff --git a/src/widgets/select-toolbar.cpp b/src/widgets/select-toolbar.cpp index b39423635..e4a5a2905 100644 --- a/src/widgets/select-toolbar.cpp +++ b/src/widgets/select-toolbar.cpp @@ -59,6 +59,7 @@ using Inkscape::UI::Widget::UnitTracker; using Inkscape::Util::Unit; using Inkscape::Util::Quantity; using Inkscape::DocumentUndo; +using Inkscape::Util::unit_table; static void sp_selection_layout_widget_update(SPWidget *spw, Inkscape::Selection *sel) @@ -96,7 +97,6 @@ sp_selection_layout_widget_update(SPWidget *spw, Inkscape::Selection *sel) tracker->setFullVal( a, keyval[i].val ); } } else { - Inkscape::Util::UnitTable unit_table; for (unsigned i = 0; i < G_N_ELEMENTS(keyval); ++i) { GtkAdjustment *a = GTK_ADJUSTMENT(g_object_get_data(G_OBJECT(spw), keyval[i].key)); gtk_adjustment_set_value(a, Quantity::convert(keyval[i].val, "px", unit)); @@ -192,8 +192,6 @@ sp_object_layout_any_value_changed(GtkAdjustment *adj, SPWidget *spw) GtkAdjustment* a_w = GTK_ADJUSTMENT( g_object_get_data( G_OBJECT(spw), "width" ) ); GtkAdjustment* a_h = GTK_ADJUSTMENT( g_object_get_data( G_OBJECT(spw), "height" ) ); - Inkscape::Util::UnitTable unit_table; - if (unit.type == Inkscape::Util::UNIT_TYPE_LINEAR) { x0 = Quantity::convert(gtk_adjustment_get_value(a_x), unit, "px"); y0 = Quantity::convert(gtk_adjustment_get_value(a_y), unit, "px"); @@ -493,7 +491,6 @@ void sp_select_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GOb // Create the units menu. UnitTracker* tracker = new UnitTracker(Inkscape::Util::UNIT_TYPE_LINEAR); - Inkscape::Util::UnitTable unit_table; tracker->addUnit(unit_table.getUnit("%")); tracker->setActiveUnit( sp_desktop_namedview(desktop)->doc_units ); diff --git a/src/widgets/stroke-style.cpp b/src/widgets/stroke-style.cpp index e35a8b36b..12d4002b8 100644 --- a/src/widgets/stroke-style.cpp +++ b/src/widgets/stroke-style.cpp @@ -26,6 +26,7 @@ #include "ui/widget/unit-menu.h" using Inkscape::DocumentUndo; +using Inkscape::Util::unit_table; /** * Creates a new widget for the line stroke paint. @@ -196,7 +197,6 @@ StrokeStyle::StrokeStyle() : Gtk::Widget *us = manage(unitSelector); SPDesktop *desktop = SP_ACTIVE_DESKTOP; - Inkscape::Util::UnitTable unit_table; unitSelector->addUnit(unit_table.getUnit("%")); if (desktop) { unitSelector->setUnit(sp_desktop_namedview(desktop)->doc_units->abbr); -- cgit v1.2.3 From 4fa681033f513c4146deb66e3a3a12b20304978c Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 5 Aug 2013 22:10:50 +0200 Subject: fix memleak (rows) (bzr r12468) --- src/libgdl/gdl-switcher.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/libgdl/gdl-switcher.c b/src/libgdl/gdl-switcher.c index daacebf20..780438886 100644 --- a/src/libgdl/gdl-switcher.c +++ b/src/libgdl/gdl-switcher.c @@ -388,7 +388,8 @@ layout_buttons (GdlSwitcher *switcher) if (last_buttons_height < switcher->priv->buttons_height_request) { /* Request for a new resize */ gtk_widget_queue_resize (GTK_WIDGET (switcher)); - return -1; + y = -1; // set return value + goto exit; } } x = H_PADDING + allocation.x; @@ -426,6 +427,7 @@ layout_buttons (GdlSwitcher *switcher) } } + exit: for (i = 0; i <= row_last; i ++) { g_slist_free (rows [i]); } -- cgit v1.2.3 From c0f2f5606f0884e00f426653168b84b23d26ffb3 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 5 Aug 2013 23:07:35 +0200 Subject: code cleanup (cppcheck) (bzr r12469) --- src/dom/cssreader.cpp | 7 +- src/extension/internal/cairo-ps-out.cpp | 12 +- src/extension/internal/cairo-render-context.cpp | 2 +- src/extension/internal/cairo-renderer-pdf-out.cpp | 6 +- src/extension/internal/emf-win32-inout.cpp | 4 + src/extension/internal/emf-win32-print.cpp | 3 +- src/extension/internal/filter/paint.h | 3 +- src/extension/internal/pdfinput/pdf-parser.cpp | 11 +- src/extension/internal/pdfinput/svg-builder.cpp | 8 +- src/helper/gnome-utils.cpp | 8 +- src/live_effects/spiro.cpp | 242 +++++++++++----------- src/unicoderange.cpp | 3 +- src/widgets/paint-selector.cpp | 4 +- src/xml/repr-io.cpp | 5 +- 14 files changed, 156 insertions(+), 162 deletions(-) (limited to 'src') diff --git a/src/dom/cssreader.cpp b/src/dom/cssreader.cpp index db114ed8d..93473b229 100644 --- a/src/dom/cssreader.cpp +++ b/src/dom/cssreader.cpp @@ -393,7 +393,6 @@ int CssReader::getStyleSheet(int p0) { int p = p0; int p2 = p; - XMLCh ch; //# CHARSET 0 or 1 if (match(p, "@charset")) @@ -408,7 +407,7 @@ int CssReader::getStyleSheet(int p0) return -1; } p = skipwhite(p2); - ch = get(p); + XMLCh ch = get(p); if (ch !=';') { error("';' required after @charset declaration"); @@ -665,7 +664,7 @@ int CssReader::getPage(int p0) while (true) { p = skipwhite(p2); - ch = get(p); + XMLCh ch = get(p); if (ch != ';') break; p++; @@ -1249,7 +1248,7 @@ int CssReader::getTerm(int p0) { int p = p0; p = skipwhite(p); - int unitType = CSSPrimitiveValue::CSS_UNKNOWN; + int unitType = CSSPrimitiveValue::CSS_UNKNOWN; /// \fixme Why is this variable never used? //# Unary operator XMLCh ch = get(p); bool hasUnary = false; diff --git a/src/extension/internal/cairo-ps-out.cpp b/src/extension/internal/cairo-ps-out.cpp index 5ce9a21f3..bfbdd8149 100644 --- a/src/extension/internal/cairo-ps-out.cpp +++ b/src/extension/internal/cairo-ps-out.cpp @@ -136,12 +136,12 @@ CairoPsOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar con if (ext == NULL) return; - const gchar *new_level = NULL; int level = CAIRO_PS_LEVEL_2; try { - new_level = mod->get_param_enum("PSlevel"); - if((new_level != NULL) && (g_ascii_strcasecmp("PS3", new_level) == 0)) + const gchar *new_level = mod->get_param_enum("PSlevel"); + if((new_level != NULL) && (g_ascii_strcasecmp("PS3", new_level) == 0)) { level = CAIRO_PS_LEVEL_3; + } } catch(...) {} bool new_textToPath = FALSE; @@ -225,12 +225,12 @@ CairoEpsOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar co if (ext == NULL) return; - const gchar *new_level = NULL; int level = CAIRO_PS_LEVEL_2; try { - new_level = mod->get_param_enum("PSlevel"); - if((new_level != NULL) && (g_ascii_strcasecmp("PS3", new_level) == 0)) + const gchar *new_level = mod->get_param_enum("PSlevel"); + if((new_level != NULL) && (g_ascii_strcasecmp("PS3", new_level) == 0)) { level = CAIRO_PS_LEVEL_3; + } } catch(...) {} bool new_textToPath = FALSE; diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp index d7a560f04..f0461c609 100644 --- a/src/extension/internal/cairo-render-context.cpp +++ b/src/extension/internal/cairo-render-context.cpp @@ -1492,7 +1492,7 @@ CairoRenderContext::renderGlyphtext(PangoFont *font, Geom::Affine const &font_ma std::vector const &glyphtext, SPStyle const *style) { // create a cairo_font_face from PangoFont - double size = style->font_size.computed; + double size = style->font_size.computed; /// \fixme why is this variable never used? gpointer fonthash = (gpointer)font; cairo_font_face_t *font_face = (cairo_font_face_t *)g_hash_table_lookup(font_table, fonthash); diff --git a/src/extension/internal/cairo-renderer-pdf-out.cpp b/src/extension/internal/cairo-renderer-pdf-out.cpp index 6f641fd36..8b2e8bf84 100644 --- a/src/extension/internal/cairo-renderer-pdf-out.cpp +++ b/src/extension/internal/cairo-renderer-pdf-out.cpp @@ -136,12 +136,12 @@ CairoRendererPdfOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, if (ext == NULL) return; - const gchar *new_level = NULL; int level = 0; try { - new_level = mod->get_param_enum("PDFversion"); - if((new_level != NULL) && (g_ascii_strcasecmp("PDF-1.5", new_level) == 0)) + const gchar *new_level = mod->get_param_enum("PDFversion"); + if((new_level != NULL) && (g_ascii_strcasecmp("PDF-1.5", new_level) == 0)) { level = 1; + } } catch(...) { g_warning("Parameter might not exist"); diff --git a/src/extension/internal/emf-win32-inout.cpp b/src/extension/internal/emf-win32-inout.cpp index e9360a0ea..063b1ca88 100644 --- a/src/extension/internal/emf-win32-inout.cpp +++ b/src/extension/internal/emf-win32-inout.cpp @@ -120,6 +120,10 @@ emf_print_document_to_file(SPDocument *doc, gchar const *filename) } mod->base->invoke_print(&context); ret = mod->finish(); + if (ret) { + g_free(oldoutput); + throw Inkscape::Extension::Output::save_failed(); + } /* Release arena */ mod->base->invoke_hide(mod->dkey); mod->base = NULL; diff --git a/src/extension/internal/emf-win32-print.cpp b/src/extension/internal/emf-win32-print.cpp index 2b79fd5a4..e30ab390d 100644 --- a/src/extension/internal/emf-win32-print.cpp +++ b/src/extension/internal/emf-win32-print.cpp @@ -242,13 +242,12 @@ unsigned int PrintEmfWin32::comment (Inkscape::Extension::Print * /*module*/, int PrintEmfWin32::create_brush(SPStyle const *style) { - float rgb[3]; - if (style) { float opacity = SP_SCALE24_TO_FLOAT(style->fill_opacity.value); if (opacity <= 0.0) return 1; + float rgb[3]; sp_color_get_rgb_floatv( &style->fill.value.color, rgb ); hbrush = CreateSolidBrush( RGB(255*rgb[0], 255*rgb[1], 255*rgb[2]) ); hbrushOld = (HBRUSH) SelectObject( hdc, hbrush ); diff --git a/src/extension/internal/filter/paint.h b/src/extension/internal/filter/paint.h index d99d1e0e2..941177f39 100644 --- a/src/extension/internal/filter/paint.h +++ b/src/extension/internal/filter/paint.h @@ -999,9 +999,8 @@ PosterizeBasic::get_filter_text (Inkscape::Extension::Extension * ext) transf << "0"; int levels = ext->get_param_int("levels") + 1; - float val = 0.0; for ( int step = 1 ; step <= levels ; step++ ) { - val = (float) step / levels; + const float val = (float) step / levels; transf << " " << val; } transf << " 1"; diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp index 3be7af34f..4e50f02f6 100644 --- a/src/extension/internal/pdfinput/pdf-parser.cpp +++ b/src/extension/internal/pdfinput/pdf-parser.cpp @@ -579,14 +579,13 @@ void PdfParser::execOp(Object *cmd, Object args[], int numArgs) { (this->*op->func)(argPtr, numArgs); } -PdfOperator *PdfParser::findOp(char *name) { - int a, b, m, cmp; - - a = -1; - b = numOps; +PdfOperator* PdfParser::findOp(char *name) { + int a = -1; + int b = numOps; + int cmp = -1; // invariant: opTab[a] < name < opTab[b] while (b - a > 1) { - m = (a + b) / 2; + const int m = (a + b) / 2; cmp = strcmp(opTab[m].name, name); if (cmp < 0) a = m; diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp index 165dd38fe..dee7d8afb 100644 --- a/src/extension/internal/pdfinput/svg-builder.cpp +++ b/src/extension/internal/pdfinput/svg-builder.cpp @@ -266,14 +266,12 @@ static void svgSetTransform(Inkscape::XML::Node *node, double c0, double c1, * \brief Generates a SVG path string from poppler's data structure */ static gchar *svgInterpretPath(GfxPath *path) { - GfxSubpath *subpath; Inkscape::SVG::PathString pathString; - int i, j; - for ( i = 0 ; i < path->getNumSubpaths() ; ++i ) { - subpath = path->getSubpath(i); + for (int i = 0 ; i < path->getNumSubpaths() ; ++i ) { + GfxSubpath *subpath = path->getSubpath(i); if (subpath->getNumPoints() > 0) { pathString.moveTo(subpath->getX(0), subpath->getY(0)); - j = 1; + int j = 1; while (j < subpath->getNumPoints()) { if (subpath->getCurve(j)) { pathString.curveTo(subpath->getX(j), subpath->getY(j), diff --git a/src/helper/gnome-utils.cpp b/src/helper/gnome-utils.cpp index d0bcaf8cd..957b7ea5e 100644 --- a/src/helper/gnome-utils.cpp +++ b/src/helper/gnome-utils.cpp @@ -83,17 +83,15 @@ gnome_uri_list_extract_uris (const gchar* uri_list) GList* gnome_uri_list_extract_filenames (const gchar* uri_list) { - GList *tmp_list, *node, *result; - g_return_val_if_fail (uri_list != NULL, NULL); - result = gnome_uri_list_extract_uris (uri_list); + GList *result = gnome_uri_list_extract_uris (uri_list); - tmp_list = result; + GList *tmp_list = result; while (tmp_list) { gchar *s = (gchar*)tmp_list->data; - node = tmp_list; + GList *node = tmp_list; tmp_list = tmp_list->next; if (!strncmp (s, "file:", 5)) { diff --git a/src/live_effects/spiro.cpp b/src/live_effects/spiro.cpp index f50399a77..46e53a0da 100644 --- a/src/live_effects/spiro.cpp +++ b/src/live_effects/spiro.cpp @@ -677,163 +677,165 @@ add_mat_line(bandmat *m, double *v, } static double -spiro_iter(spiro_seg *s, bandmat *m, int *perm, double *v, int n) +spiro_iter(spiro_seg *s, bandmat *m, int *perm, double *v, const int n) { int cyclic = s[0].ty != '{' && s[0].ty != 'v'; - int i, j, jj; int nmat = count_vec(s, n); - double norm; int n_invert; - for (i = 0; i < nmat; i++) { - v[i] = 0.; - for (j = 0; j < 11; j++) - m[i].a[j] = 0.; - for (j = 0; j < 5; j++) - m[i].al[j] = 0.; + for (int i = 0; i < nmat; i++) { + v[i] = 0.; + for (int j = 0; j < 11; j++) { + m[i].a[j] = 0.; + } + for (int j = 0; j < 5; j++) { + m[i].al[j] = 0.; + } } - j = 0; - if (s[0].ty == 'o') - jj = nmat - 2; - else if (s[0].ty == 'c') - jj = nmat - 1; - else - jj = 0; - for (i = 0; i < n; i++) { - char ty0 = s[i].ty; - char ty1 = s[i + 1].ty; - int jinc = compute_jinc(ty0, ty1); - double th = s[i].bend_th; - double ends[2][4]; - double derivs[4][2][4]; - int jthl = -1, jk0l = -1, jk1l = -1, jk2l = -1; - int jthr = -1, jk0r = -1, jk1r = -1, jk2r = -1; - - compute_pderivs(&s[i], ends, derivs, jinc); - - /* constraints crossing left */ - if (ty0 == 'o' || ty0 == 'c' || ty0 == '[' || ty0 == ']') { - jthl = jj++; - jj %= nmat; - jk0l = jj++; - } - if (ty0 == 'o') { - jj %= nmat; - jk1l = jj++; - jk2l = jj++; - } + int j = 0; + int jj; + if (s[0].ty == 'o') { + jj = nmat - 2; + } else if (s[0].ty == 'c') { + jj = nmat - 1; + } else { + jj = 0; + } + for (int i = 0; i < n; i++) { + char ty0 = s[i].ty; + char ty1 = s[i + 1].ty; + int jinc = compute_jinc(ty0, ty1); + double th = s[i].bend_th; + double ends[2][4]; + double derivs[4][2][4]; + int jthl = -1, jk0l = -1, jk1l = -1, jk2l = -1; + int jthr = -1, jk0r = -1, jk1r = -1, jk2r = -1; + + compute_pderivs(&s[i], ends, derivs, jinc); + + /* constraints crossing left */ + if (ty0 == 'o' || ty0 == 'c' || ty0 == '[' || ty0 == ']') { + jthl = jj++; + jj %= nmat; + jk0l = jj++; + } + if (ty0 == 'o') { + jj %= nmat; + jk1l = jj++; + jk2l = jj++; + } - /* constraints on left */ - if ((ty0 == '[' || ty0 == 'v' || ty0 == '{' || ty0 == 'c') && - jinc == 4) { - if (ty0 != 'c') - jk1l = jj++; - jk2l = jj++; - } + /* constraints on left */ + if ((ty0 == '[' || ty0 == 'v' || ty0 == '{' || ty0 == 'c') && + jinc == 4) { + if (ty0 != 'c') + jk1l = jj++; + jk2l = jj++; + } - /* constraints on right */ - if ((ty1 == ']' || ty1 == 'v' || ty1 == '}' || ty1 == 'c') && - jinc == 4) { - if (ty1 != 'c') - jk1r = jj++; - jk2r = jj++; - } + /* constraints on right */ + if ((ty1 == ']' || ty1 == 'v' || ty1 == '}' || ty1 == 'c') && + jinc == 4) { + if (ty1 != 'c') + jk1r = jj++; + jk2r = jj++; + } - /* constraints crossing right */ - if (ty1 == 'o' || ty1 == 'c' || ty1 == '[' || ty1 == ']') { - jthr = jj; - jk0r = (jj + 1) % nmat; - } - if (ty1 == 'o') { - jk1r = (jj + 2) % nmat; - jk2r = (jj + 3) % nmat; - } + /* constraints crossing right */ + if (ty1 == 'o' || ty1 == 'c' || ty1 == '[' || ty1 == ']') { + jthr = jj; + jk0r = (jj + 1) % nmat; + } + if (ty1 == 'o') { + jk1r = (jj + 2) % nmat; + jk2r = (jj + 3) % nmat; + } - add_mat_line(m, v, derivs[0][0], th - ends[0][0], 1, j, jthl, jinc, nmat); - add_mat_line(m, v, derivs[1][0], ends[0][1], -1, j, jk0l, jinc, nmat); - add_mat_line(m, v, derivs[2][0], ends[0][2], -1, j, jk1l, jinc, nmat); - add_mat_line(m, v, derivs[3][0], ends[0][3], -1, j, jk2l, jinc, nmat); - add_mat_line(m, v, derivs[0][1], -ends[1][0], 1, j, jthr, jinc, nmat); - add_mat_line(m, v, derivs[1][1], -ends[1][1], 1, j, jk0r, jinc, nmat); - add_mat_line(m, v, derivs[2][1], -ends[1][2], 1, j, jk1r, jinc, nmat); - add_mat_line(m, v, derivs[3][1], -ends[1][3], 1, j, jk2r, jinc, nmat); - if (jthl >= 0) - v[jthl] = mod_2pi(v[jthl]); - if (jthr >= 0) - v[jthr] = mod_2pi(v[jthr]); - j += jinc; + add_mat_line(m, v, derivs[0][0], th - ends[0][0], 1, j, jthl, jinc, nmat); + add_mat_line(m, v, derivs[1][0], ends[0][1], -1, j, jk0l, jinc, nmat); + add_mat_line(m, v, derivs[2][0], ends[0][2], -1, j, jk1l, jinc, nmat); + add_mat_line(m, v, derivs[3][0], ends[0][3], -1, j, jk2l, jinc, nmat); + add_mat_line(m, v, derivs[0][1], -ends[1][0], 1, j, jthr, jinc, nmat); + add_mat_line(m, v, derivs[1][1], -ends[1][1], 1, j, jk0r, jinc, nmat); + add_mat_line(m, v, derivs[2][1], -ends[1][2], 1, j, jk1r, jinc, nmat); + add_mat_line(m, v, derivs[3][1], -ends[1][3], 1, j, jk2r, jinc, nmat); + if (jthl >= 0) + v[jthl] = mod_2pi(v[jthl]); + if (jthr >= 0) + v[jthr] = mod_2pi(v[jthr]); + j += jinc; } if (cyclic) { - memcpy(m + nmat, m, sizeof(bandmat) * nmat); - memcpy(m + 2 * nmat, m, sizeof(bandmat) * nmat); - memcpy(v + nmat, v, sizeof(double) * nmat); - memcpy(v + 2 * nmat, v, sizeof(double) * nmat); - n_invert = 3 * nmat; - j = nmat; + memcpy(m + nmat, m, sizeof(bandmat) * nmat); + memcpy(m + 2 * nmat, m, sizeof(bandmat) * nmat); + memcpy(v + nmat, v, sizeof(double) * nmat); + memcpy(v + 2 * nmat, v, sizeof(double) * nmat); + n_invert = 3 * nmat; + j = nmat; } else { - n_invert = nmat; - j = 0; + n_invert = nmat; + j = 0; } #ifdef VERBOSE - for (i = 0; i < n; i++) { - int k; - for (k = 0; k < 11; k++) - printf(" %2.4f", m[i].a[k]); - printf(": %2.4f\n", v[i]); + for (int i = 0; i < n; i++) { + for (int k = 0; k < 11; k++) { + printf(" %2.4f", m[i].a[k]); + } + printf(": %2.4f\n", v[i]); } printf("---\n"); #endif bandec11(m, perm, n_invert); banbks11(m, perm, v, n_invert); - norm = 0.; - for (i = 0; i < n; i++) { - char ty0 = s[i].ty; - char ty1 = s[i + 1].ty; - int jinc = compute_jinc(ty0, ty1); - int k; + + double norm = 0.; + for (int i = 0; i < n; i++) { + char ty0 = s[i].ty; + char ty1 = s[i + 1].ty; + int jinc = compute_jinc(ty0, ty1); + int k; - for (k = 0; k < jinc; k++) { - double dk = v[j++]; + for (k = 0; k < jinc; k++) { + double dk = v[j++]; #ifdef VERBOSE - printf("s[%d].ks[%d] += %f\n", i, k, dk); + printf("s[%d].ks[%d] += %f\n", i, k, dk); #endif - s[i].ks[k] += dk; - norm += dk * dk; - } + s[i].ks[k] += dk; + norm += dk * dk; + } s[i].ks[0] = 2.0*mod_2pi(s[i].ks[0]/2.0); } return norm; } static int -solve_spiro(spiro_seg *s, int nseg) +solve_spiro(spiro_seg *s, const int nseg) { - bandmat *m; - double *v; - int *perm; int nmat = count_vec(s, nseg); int n_alloc = nmat; - double norm; - int i; - if (nmat == 0) - return 0; - if (s[0].ty != '{' && s[0].ty != 'v') - n_alloc *= 3; - if (n_alloc < 5) - n_alloc = 5; - m = (bandmat *)malloc(sizeof(bandmat) * n_alloc); - v = (double *)malloc(sizeof(double) * n_alloc); - perm = (int *)malloc(sizeof(int) * n_alloc); - - for (i = 0; i < 10; i++) { - norm = spiro_iter(s, m, perm, v, nseg); + if (nmat == 0) { + return 0; + } + if (s[0].ty != '{' && s[0].ty != 'v') { + n_alloc *= 3; + } + if (n_alloc < 5) { + n_alloc = 5; + } + + bandmat *m = (bandmat *)malloc(sizeof(bandmat) * n_alloc); + double *v = (double *)malloc(sizeof(double) * n_alloc); + int *perm = (int *)malloc(sizeof(int) * n_alloc); + + for (unsigned i = 0; i < 10; i++) { + double norm = spiro_iter(s, m, perm, v, nseg); #ifdef VERBOSE - printf("%% norm = %g\n", norm); + printf("%% norm = %g\n", norm); #endif - if (norm < 1e-12) break; + if (norm < 1e-12) break; } free(m); diff --git a/src/unicoderange.cpp b/src/unicoderange.cpp index 36435024d..803e1a884 100644 --- a/src/unicoderange.cpp +++ b/src/unicoderange.cpp @@ -71,9 +71,8 @@ bool UnicodeRange::contains(gchar unicode){ unival = g_utf8_get_char (&unicode); char uni[9] = "00000000"; uni[8]= '\0'; - unsigned char val; for (unsigned int i=7; unival>0; i--){ - val = unival & 0xf; + unsigned char val = unival & 0xf; unival = unival >> 4; if (val < 10) uni[i] = '0' + val; else uni[i] = 'A'+ val - 10; diff --git a/src/widgets/paint-selector.cpp b/src/widgets/paint-selector.cpp index 40d2fb9f3..cd987cc87 100644 --- a/src/widgets/paint-selector.cpp +++ b/src/widgets/paint-selector.cpp @@ -1141,14 +1141,12 @@ static void sp_paint_selector_set_mode_swatch(SPPaintSelector *psel, SPPaintSele gtk_widget_set_sensitive(psel->style, TRUE); - SwatchSelector *swatchsel = NULL; - if (psel->mode == SPPaintSelector::MODE_SWATCH){ // swatchsel = static_cast(g_object_get_data(G_OBJECT(psel->selector), "swatch-selector")); } else { sp_paint_selector_clear_frame(psel); // Create new gradient selector - swatchsel = new SwatchSelector(); + SwatchSelector *swatchsel = new SwatchSelector(); swatchsel->show(); swatchsel->connectGrabbedHandler( G_CALLBACK(sp_paint_selector_gradient_grabbed), psel ); diff --git a/src/xml/repr-io.cpp b/src/xml/repr-io.cpp index 1b6116936..af47779fe 100644 --- a/src/xml/repr-io.cpp +++ b/src/xml/repr-io.cpp @@ -504,7 +504,6 @@ gint sp_repr_qualified_name (gchar *p, gint len, xmlNsPtr ns, const xmlChar *nam static Node *sp_repr_svg_read_node (Document *xml_doc, xmlNodePtr node, const gchar *default_ns, GHashTable *prefix_map) { - Node *repr, *crepr; xmlAttrPtr prop; xmlNodePtr child; gchar c[256]; @@ -544,7 +543,7 @@ static Node *sp_repr_svg_read_node (Document *xml_doc, xmlNodePtr node, const gc } sp_repr_qualified_name (c, 256, node->ns, node->name, default_ns, prefix_map); - repr = xml_doc->createElement(c); + Node *repr = xml_doc->createElement(c); /* TODO remember node->ns->prefix if node->ns != NULL */ for (prop = node->properties; prop != NULL; prop = prop->next) { @@ -561,7 +560,7 @@ static Node *sp_repr_svg_read_node (Document *xml_doc, xmlNodePtr node, const gc child = node->xmlChildrenNode; for (child = node->xmlChildrenNode; child != NULL; child = child->next) { - crepr = sp_repr_svg_read_node (xml_doc, child, default_ns, prefix_map); + Node *crepr = sp_repr_svg_read_node (xml_doc, child, default_ns, prefix_map); if (crepr) { repr->appendChild(crepr); Inkscape::GC::release(crepr); -- cgit v1.2.3 From 41713d1e0fa740247dd81ad63c8ffbc1590a007c Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Tue, 6 Aug 2013 19:29:13 +0200 Subject: init SPStyle better: fixes a bunch of bugs resulting from improper re-init of SPStyle struct. (after r12452) (bzr r12470) --- src/style.cpp | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 71 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/style.cpp b/src/style.cpp index a9861f918..ce5460164 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -2977,9 +2977,7 @@ sp_style_clear(SPStyle *style) SPTextStyle *text = style->text; unsigned const text_private = style->text_private; - // this looks really bad! you can't just 0 *all* data in the whole struct! - // memset(style, 0, sizeof(SPStyle)); - + style->refcount = refcount; style->object = object; style->document = document; @@ -3003,49 +3001,63 @@ sp_style_clear(SPStyle *style) style->text->font_family.set = FALSE; style->font_size.set = FALSE; + style->font_size.inherit = FALSE; style->font_size.type = SP_FONT_SIZE_LITERAL; + style->font_size.unit = 0; style->font_size.literal = SP_CSS_FONT_SIZE_MEDIUM; + style->font_size.value = 12.0; style->font_size.computed = 12.0; style->font_style.set = FALSE; + style->font_style.inherit = FALSE; style->font_style.value = style->font_style.computed = SP_CSS_FONT_STYLE_NORMAL; style->font_variant.set = FALSE; + style->font_variant.inherit = FALSE; style->font_variant.value = style->font_variant.computed = SP_CSS_FONT_VARIANT_NORMAL; style->font_weight.set = FALSE; + style->font_weight.inherit = FALSE; style->font_weight.value = SP_CSS_FONT_WEIGHT_NORMAL; style->font_weight.computed = SP_CSS_FONT_WEIGHT_400; style->font_stretch.set = FALSE; + style->font_stretch.inherit = FALSE; style->font_stretch.value = style->font_stretch.computed = SP_CSS_FONT_STRETCH_NORMAL; /* text */ style->text_indent.set = FALSE; + style->text_indent.inherit = FALSE; style->text_indent.unit = SP_CSS_UNIT_NONE; style->text_indent.computed = 0.0; style->text_align.set = FALSE; + style->text_align.inherit = FALSE; style->text_align.value = style->text_align.computed = SP_CSS_TEXT_ALIGN_START; style->text_decoration.set = FALSE; + style->text_decoration.inherit = FALSE; style->text_decoration.underline = FALSE; style->text_decoration.overline = FALSE; style->text_decoration.line_through = FALSE; style->text_decoration.blink = FALSE; style->line_height.set = FALSE; + style->line_height.inherit = FALSE; style->line_height.unit = SP_CSS_UNIT_PERCENT; style->line_height.normal = TRUE; style->line_height.value = style->line_height.computed = 1.0; style->letter_spacing.set = FALSE; + style->letter_spacing.inherit = FALSE; style->letter_spacing.unit = SP_CSS_UNIT_NONE; style->letter_spacing.normal = TRUE; style->letter_spacing.value = style->letter_spacing.computed = 0.0; style->word_spacing.set = FALSE; + style->word_spacing.inherit = FALSE; style->word_spacing.unit = SP_CSS_UNIT_NONE; style->word_spacing.normal = TRUE; style->word_spacing.value = style->word_spacing.computed = 0.0; style->baseline_shift.set = FALSE; + style->baseline_shift.inherit = FALSE; style->baseline_shift.type = SP_BASELINE_SHIFT_LITERAL; style->baseline_shift.unit = SP_CSS_UNIT_NONE; style->baseline_shift.literal = SP_CSS_BASELINE_SHIFT_BASELINE; @@ -3053,74 +3065,128 @@ sp_style_clear(SPStyle *style) style->baseline_shift.computed = 0.0; style->text_transform.set = FALSE; + style->text_transform.inherit = FALSE; style->text_transform.value = style->text_transform.computed = SP_CSS_TEXT_TRANSFORM_NONE; style->direction.set = FALSE; + style->direction.inherit = FALSE; style->direction.value = style->direction.computed = SP_CSS_DIRECTION_LTR; style->block_progression.set = FALSE; + style->block_progression.inherit = FALSE; style->block_progression.value = style->block_progression.computed = SP_CSS_BLOCK_PROGRESSION_TB; style->writing_mode.set = FALSE; + style->writing_mode.inherit = FALSE; style->writing_mode.value = style->writing_mode.computed = SP_CSS_WRITING_MODE_LR_TB; style->text_anchor.set = FALSE; + style->text_anchor.inherit = FALSE; style->text_anchor.value = style->text_anchor.computed = SP_CSS_TEXT_ANCHOR_START; + style->clip_set = FALSE; + style->color_set = FALSE; + style->cursor_set = FALSE; + style->overflow_set = FALSE; + style->clip_path_set = FALSE; + style->mask_set = FALSE; + + style->clip_rule.set = FALSE; + style->clip_rule.inherit = FALSE; + style->clip_rule.value = style->clip_rule.computed = SP_WIND_RULE_NONZERO; + style->opacity.set = FALSE; + style->opacity.inherit = FALSE; style->opacity.value = SP_SCALE24_MAX; style->visibility.set = FALSE; + style->visibility.inherit = FALSE; style->visibility.value = style->visibility.computed = SP_CSS_VISIBILITY_VISIBLE; style->display.set = FALSE; + style->display.inherit = FALSE; style->display.value = style->display.computed = SP_CSS_DISPLAY_INLINE; style->overflow.set = FALSE; + style->overflow.inherit = FALSE; style->overflow.value = style->overflow.computed = SP_CSS_OVERFLOW_VISIBLE; style->color.clear(); style->color.setColor(0.0, 0.0, 0.0); + style->color_interpolation.set = FALSE; + style->color_interpolation.inherit = FALSE; style->color_interpolation.value = style->color_interpolation.computed = SP_CSS_COLOR_INTERPOLATION_SRGB; + style->color_interpolation_filters.set = FALSE; + style->color_interpolation_filters.inherit = FALSE; style->color_interpolation_filters.value = style->color_interpolation_filters.computed = SP_CSS_COLOR_INTERPOLATION_LINEARRGB; style->fill.clear(); style->fill.setColor(0.0, 0.0, 0.0); + style->fill_opacity.set = FALSE; + style->fill_opacity.inherit = FALSE; style->fill_opacity.value = SP_SCALE24_MAX; + style->fill_rule.set = FALSE; + style->fill_rule.inherit = FALSE; style->fill_rule.value = style->fill_rule.computed = SP_WIND_RULE_NONZERO; style->stroke.clear(); + style->stroke_opacity.set = FALSE; + style->stroke_opacity.inherit = FALSE; style->stroke_opacity.value = SP_SCALE24_MAX; style->stroke_width.set = FALSE; + style->stroke_width.inherit = FALSE; style->stroke_width.unit = SP_CSS_UNIT_NONE; - style->stroke_width.computed = 1.0; + style->stroke_width.value = style->stroke_width.computed = 1.0; style->stroke_linecap.set = FALSE; + style->stroke_linecap.inherit = FALSE; style->stroke_linecap.value = style->stroke_linecap.computed = SP_STROKE_LINECAP_BUTT; style->stroke_linejoin.set = FALSE; + style->stroke_linejoin.inherit = FALSE; style->stroke_linejoin.value = style->stroke_linejoin.computed = SP_STROKE_LINEJOIN_MITER; style->stroke_miterlimit.set = FALSE; + style->stroke_miterlimit.inherit = FALSE; style->stroke_miterlimit.value = 4.0; style->stroke_dash.n_dash = 0; style->stroke_dash.dash = NULL; style->stroke_dash.offset = 0.0; + style->stroke_dasharray_set = FALSE; + style->stroke_dasharray_inherit = FALSE; + style->stroke_dashoffset_set = FALSE; + style->stroke_dashoffset_inherit = FALSE; + for (unsigned i = SP_MARKER_LOC; i < SP_MARKER_LOC_QTY; i++) { g_free(style->marker[i].value); style->marker[i].set = FALSE; + style->marker[i].inherit = FALSE; + style->marker[i].data = 0; + style->marker[i].value = NULL; } + style->filter.set = FALSE; + style->filter.inherit = FALSE; + style->filter.href = NULL; + style->enable_background.value = SP_CSS_BACKGROUND_ACCUMULATE; style->enable_background.set = false; style->enable_background.inherit = false; - style->clip_rule.value = style->clip_rule.computed = SP_WIND_RULE_NONZERO; + style->filter_blend_mode.set = style->filter_blend_mode.inherit = false; + style->filter_blend_mode.value = style->filter_blend_mode.computed = 0; + style->filter_gaussianBlur_deviation.set = style->filter_gaussianBlur_deviation.inherit = false; + style->filter_gaussianBlur_deviation.value = style->filter_gaussianBlur_deviation.computed = 0; + style->color_rendering.set = style->color_rendering.inherit = false; style->color_rendering.value = style->color_rendering.computed = SP_CSS_COLOR_RENDERING_AUTO; + style->image_rendering.set = style->image_rendering.inherit = false; style->image_rendering.value = style->image_rendering.computed = SP_CSS_IMAGE_RENDERING_AUTO; + style->shape_rendering.set = style->shape_rendering.inherit = false; style->shape_rendering.value = style->shape_rendering.computed = SP_CSS_SHAPE_RENDERING_AUTO; + style->text_rendering.set = style->text_rendering.inherit = false; style->text_rendering.value = style->text_rendering.computed = SP_CSS_TEXT_RENDERING_AUTO; + style->cloned = false; } -- cgit v1.2.3 From 0ec2d349388ad6a4e0c35039b2f5c09cccadc6b0 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Tue, 6 Aug 2013 14:44:23 -0400 Subject: Fixed bug in page sizer. (bzr r12380.1.63) --- src/ui/widget/page-sizer.cpp | 138 +++++++++++++++++++++---------------------- 1 file changed, 69 insertions(+), 69 deletions(-) (limited to 'src') diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp index d912fd9d3..8287452d7 100644 --- a/src/ui/widget/page-sizer.cpp +++ b/src/ui/widget/page-sizer.cpp @@ -97,7 +97,7 @@ struct PaperSizeRec { char const * const name; //name double const smaller; //lesser dimension double const larger; //greater dimension - Inkscape::Util::Unit const unit; //units + Glib::ustring const unit; //units }; // list of page formats that should be in landscape automatically @@ -115,31 +115,31 @@ fill_landscape_papers() { } static PaperSizeRec const inkscape_papers[] = { - { "A4", 210, 297, unit_table.getUnit("mm") }, - { "US Letter", 8.5, 11, unit_table.getUnit("in") }, - { "US Legal", 8.5, 14, unit_table.getUnit("in") }, - { "US Executive", 7.25, 10.5, unit_table.getUnit("in") }, - { "A0", 841, 1189, unit_table.getUnit("mm") }, - { "A1", 594, 841, unit_table.getUnit("mm") }, - { "A2", 420, 594, unit_table.getUnit("mm") }, - { "A3", 297, 420, unit_table.getUnit("mm") }, - { "A5", 148, 210, unit_table.getUnit("mm") }, - { "A6", 105, 148, unit_table.getUnit("mm") }, - { "A7", 74, 105, unit_table.getUnit("mm") }, - { "A8", 52, 74, unit_table.getUnit("mm") }, - { "A9", 37, 52, unit_table.getUnit("mm") }, - { "A10", 26, 37, unit_table.getUnit("mm") }, - { "B0", 1000, 1414, unit_table.getUnit("mm") }, - { "B1", 707, 1000, unit_table.getUnit("mm") }, - { "B2", 500, 707, unit_table.getUnit("mm") }, - { "B3", 353, 500, unit_table.getUnit("mm") }, - { "B4", 250, 353, unit_table.getUnit("mm") }, - { "B5", 176, 250, unit_table.getUnit("mm") }, - { "B6", 125, 176, unit_table.getUnit("mm") }, - { "B7", 88, 125, unit_table.getUnit("mm") }, - { "B8", 62, 88, unit_table.getUnit("mm") }, - { "B9", 44, 62, unit_table.getUnit("mm") }, - { "B10", 31, 44, unit_table.getUnit("mm") }, + { "A4", 210, 297, "mm" }, + { "US Letter", 8.5, 11, "in" }, + { "US Legal", 8.5, 14, "in" }, + { "US Executive", 7.25, 10.5, "in" }, + { "A0", 841, 1189, "mm" }, + { "A1", 594, 841, "mm" }, + { "A2", 420, 594, "mm" }, + { "A3", 297, 420, "mm" }, + { "A5", 148, 210, "mm" }, + { "A6", 105, 148, "mm" }, + { "A7", 74, 105, "mm" }, + { "A8", 52, 74, "mm" }, + { "A9", 37, 52, "mm" }, + { "A10", 26, 37, "mm" }, + { "B0", 1000, 1414, "mm" }, + { "B1", 707, 1000, "mm" }, + { "B2", 500, 707, "mm" }, + { "B3", 353, 500, "mm" }, + { "B4", 250, 353, "mm" }, + { "B5", 176, 250, "mm" }, + { "B6", 125, 176, "mm" }, + { "B7", 88, 125, "mm" }, + { "B8", 62, 88, "mm" }, + { "B9", 44, 62, "mm" }, + { "B10", 31, 44, "mm" }, @@ -151,63 +151,63 @@ static PaperSizeRec const inkscape_papers[] = { don't know what D and E series are used for. */ - { "C0", 917, 1297, unit_table.getUnit("mm") }, - { "C1", 648, 917, unit_table.getUnit("mm") }, - { "C2", 458, 648, unit_table.getUnit("mm") }, - { "C3", 324, 458, unit_table.getUnit("mm") }, - { "C4", 229, 324, unit_table.getUnit("mm") }, - { "C5", 162, 229, unit_table.getUnit("mm") }, - { "C6", 114, 162, unit_table.getUnit("mm") }, - { "C7", 81, 114, unit_table.getUnit("mm") }, - { "C8", 57, 81, unit_table.getUnit("mm") }, - { "C9", 40, 57, unit_table.getUnit("mm") }, - { "C10", 28, 40, unit_table.getUnit("mm") }, - { "D1", 545, 771, unit_table.getUnit("mm") }, - { "D2", 385, 545, unit_table.getUnit("mm") }, - { "D3", 272, 385, unit_table.getUnit("mm") }, - { "D4", 192, 272, unit_table.getUnit("mm") }, - { "D5", 136, 192, unit_table.getUnit("mm") }, - { "D6", 96, 136, unit_table.getUnit("mm") }, - { "D7", 68, 96, unit_table.getUnit("mm") }, - { "E3", 400, 560, unit_table.getUnit("mm") }, - { "E4", 280, 400, unit_table.getUnit("mm") }, - { "E5", 200, 280, unit_table.getUnit("mm") }, - { "E6", 140, 200, unit_table.getUnit("mm") }, + { "C0", 917, 1297, "mm" }, + { "C1", 648, 917, "mm" }, + { "C2", 458, 648, "mm" }, + { "C3", 324, 458, "mm" }, + { "C4", 229, 324, "mm" }, + { "C5", 162, 229, "mm" }, + { "C6", 114, 162, "mm" }, + { "C7", 81, 114, "mm" }, + { "C8", 57, 81, "mm" }, + { "C9", 40, 57, "mm" }, + { "C10", 28, 40, "mm" }, + { "D1", 545, 771, "mm" }, + { "D2", 385, 545, "mm" }, + { "D3", 272, 385, "mm" }, + { "D4", 192, 272, "mm" }, + { "D5", 136, 192, "mm" }, + { "D6", 96, 136, "mm" }, + { "D7", 68, 96, "mm" }, + { "E3", 400, 560, "mm" }, + { "E4", 280, 400, "mm" }, + { "E5", 200, 280, "mm" }, + { "E6", 140, 200, "mm" }, //#endif - { "CSE", 462, 649, unit_table.getUnit("pt") }, - { "US #10 Envelope", 4.125, 9.5, unit_table.getUnit("in") }, + { "CSE", 462, 649, "pt" }, + { "US #10 Envelope", 4.125, 9.5, "in" }, /* See http://www.hbp.com/content/PCR_envelopes.cfm for a much larger list of US envelope sizes. */ - { "DL Envelope", 110, 220, unit_table.getUnit("mm") }, - { "Ledger/Tabloid", 11, 17, unit_table.getUnit("in") }, + { "DL Envelope", 110, 220, "mm" }, + { "Ledger/Tabloid", 11, 17, "in" }, /* Note that `Folio' (used in QPrinter/KPrinter) is deliberately absent from this list, as it means different sizes to different people: different people may expect the width to be either 8, 8.25 or 8.5 inches, and the height to be either 13 or 13.5 inches, even restricting our interpretation to foolscap folio. If you wish to introduce a folio-like page size to the list, then please consider using a name more specific than just `Folio' or `Foolscap Folio'. */ - { "Banner 468x60", 60, 468, unit_table.getUnit("px") }, - { "Icon 16x16", 16, 16, unit_table.getUnit("px") }, - { "Icon 32x32", 32, 32, unit_table.getUnit("px") }, - { "Icon 48x48", 48, 48, unit_table.getUnit("px") }, + { "Banner 468x60", 60, 468, "px" }, + { "Icon 16x16", 16, 16, "px" }, + { "Icon 32x32", 32, 32, "px" }, + { "Icon 48x48", 48, 48, "px" }, /* business cards */ - { "Business Card (ISO 7810)", 53.98, 85.60, unit_table.getUnit("mm") }, - { "Business Card (US)", 2, 3.5, unit_table.getUnit("in") }, - { "Business Card (Europe)", 55, 85, unit_table.getUnit("mm") }, - { "Business Card (Aus/NZ)", 55, 90, unit_table.getUnit("mm") }, + { "Business Card (ISO 7810)", 53.98, 85.60, "mm" }, + { "Business Card (US)", 2, 3.5, "in" }, + { "Business Card (Europe)", 55, 85, "mm" }, + { "Business Card (Aus/NZ)", 55, 90, "mm" }, // Start Arch Series List - { "Arch A", 9, 12, unit_table.getUnit("in") }, // 229 x 305 mm - { "Arch B", 12, 18, unit_table.getUnit("in") }, // 305 x 457 mm - { "Arch C", 18, 24, unit_table.getUnit("in") }, // 457 x 610 mm - { "Arch D", 24, 36, unit_table.getUnit("in") }, // 610 x 914 mm - { "Arch E", 36, 48, unit_table.getUnit("in") }, // 914 x 1219 mm - { "Arch E1", 30, 42, unit_table.getUnit("in") }, // 762 x 1067 mm + { "Arch A", 9, 12, "in" }, // 229 x 305 mm + { "Arch B", 12, 18, "in" }, // 305 x 457 mm + { "Arch C", 18, 24, "in" }, // 457 x 610 mm + { "Arch D", 24, 36, "in" }, // 610 x 914 mm + { "Arch E", 36, 48, "in" }, // 914 x 1219 mm + { "Arch E1", 30, 42, "in" }, // 762 x 1067 mm /* * The above list of Arch sizes were taken from the following site: @@ -218,7 +218,7 @@ static PaperSizeRec const inkscape_papers[] = { * September 2009 - DAK */ - { NULL, 0, 0, unit_table.getUnit("px") }, + { NULL, 0, 0, "px" }, }; @@ -277,8 +277,8 @@ PageSizer::PageSizer(Registry & _wr) char formatBuf[80]; snprintf(formatBuf, 79, "%0.1f x %0.1f", p->smaller, p->larger); Glib::ustring desc = formatBuf; - desc.append(" " + p->unit.abbr); - PaperSize paper(name, p->smaller, p->larger, p->unit); + desc.append(" " + p->unit); + PaperSize paper(name, p->smaller, p->larger, unit_table.getUnit(p->unit)); _paperSizeTable[name] = paper; Gtk::TreeModel::Row row = *(_paperSizeListStore->append()); row[_paperSizeListColumns.nameColumn] = name; -- cgit v1.2.3 From 625d70be1e222b3cfbbf6527b2829b645f369cd2 Mon Sep 17 00:00:00 2001 From: Slagvi Public Date: Tue, 6 Aug 2013 22:48:28 +0200 Subject: Adapted sp_file_new for use with templates (bzr r12379.2.19) --- src/file.cpp | 50 ++++++++++++++++++++++++++------------- src/file.h | 3 +-- src/ui/dialog/template-widget.cpp | 2 +- 3 files changed, 35 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/file.cpp b/src/file.cpp index ee205b035..258628d32 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -127,21 +127,46 @@ SPDesktop *sp_file_new(const Glib::ustring &templ) { SPDocument *doc = SPDocument::createNewDoc( !templ.empty() ? templ.c_str() : 0 , TRUE, true ); g_return_val_if_fail(doc != NULL, NULL); + + // Remove all the template info from xml tree + Inkscape::XML::Node *myRoot = doc->getReprRoot(); + Inkscape::XML::Node *nodeToRemove = sp_repr_lookup_name(myRoot, "inkscape:_templateinfo"); + if (nodeToRemove != NULL){ + sp_repr_unparent(nodeToRemove); + delete nodeToRemove; + DocumentUndo::clearUndo(doc); + } + + SPDesktop *desktop = SP_ACTIVE_DESKTOP; + if (desktop) { + desktop->setWaitingCursor(); + } + + SPDocument *existing = desktop ? sp_desktop_document(desktop) : NULL; + + if (existing && existing->virgin) { + // If the current desktop is empty, open the document there + doc->ensureUpToDate(); // TODO this will trigger broken link warnings, etc. + desktop->change_document(doc); + doc->emitResizedSignal(doc->getWidth(), doc->getHeight()); + } else { + // create a whole new desktop and window + SPViewWidget *dtw = sp_desktop_widget_new(sp_document_namedview(doc, NULL)); // TODO this will trigger broken link warnings, etc. + g_return_val_if_fail(dtw != NULL, NULL); + sp_create_window(dtw, TRUE); + desktop = static_cast(dtw->view); + } - SPViewWidget *dtw = sp_desktop_widget_new(sp_document_namedview(doc, NULL)); - g_return_val_if_fail(dtw != NULL, NULL); doc->doUnref(); - sp_create_window(dtw, TRUE); - SPDesktop *dt = static_cast(dtw->view); - sp_namedview_window_from_document(dt); - sp_namedview_update_layers_from_document(dt); + sp_namedview_window_from_document(desktop); + sp_namedview_update_layers_from_document(desktop); #ifdef WITH_DBUS Inkscape::Extension::Dbus::dbus_init_desktop_interface(dt); #endif - return dt; + return desktop; } Glib::ustring sp_file_default_template_uri() @@ -252,16 +277,7 @@ bool sp_file_open(const Glib::ustring &uri, } if (doc) { - if (flags & IS_FROM_TEMPLATE){ - Inkscape::XML::Node *myRoot = doc->getReprRoot(); - Inkscape::XML::Node *nodeToRemove = sp_repr_lookup_name(myRoot, "inkscape:_templateinfo"); - if (nodeToRemove != NULL){ - sp_repr_unparent(nodeToRemove); - delete nodeToRemove; - DocumentUndo::clearUndo(doc); - } - } - + SPDocument *existing = desktop ? sp_desktop_document(desktop) : NULL; if (existing && existing->virgin && (flags & REPLACE_EMPTY)) { diff --git a/src/file.h b/src/file.h index e94a3c598..4d55825c4 100644 --- a/src/file.h +++ b/src/file.h @@ -65,8 +65,7 @@ void sp_file_exit (void); enum SPFileOpenFlags { ADD_TO_RECENT = 1, - REPLACE_EMPTY = 2, - IS_FROM_TEMPLATE = 4 + REPLACE_EMPTY = 2 }; bool sp_file_open( diff --git a/src/ui/dialog/template-widget.cpp b/src/ui/dialog/template-widget.cpp index 66121a73a..7e0599049 100644 --- a/src/ui/dialog/template-widget.cpp +++ b/src/ui/dialog/template-widget.cpp @@ -62,7 +62,7 @@ void TemplateWidget::create() if (_current_template.is_procedural) {} else { - sp_file_open(_current_template.path, NULL, REPLACE_EMPTY | ADD_TO_RECENT | IS_FROM_TEMPLATE); + sp_file_new(_current_template.path); } } -- cgit v1.2.3 From 2f7ea8f8ae067cbb3406169d22a84426cabd43f6 Mon Sep 17 00:00:00 2001 From: Eric Greveson Date: Thu, 8 Aug 2013 17:01:03 +0100 Subject: Fix to do the "right thing" for difference/intersection boolean ops when one or more input paths are truncated to zero-size by the quantization step (coordinate rounding). Previously this had only been fixed for union ops (which happened to work for exclusion (XOR) ops as well). (bzr r12472.1.1) --- src/splivarot.cpp | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/splivarot.cpp b/src/splivarot.cpp index 356cf0161..6423129b9 100644 --- a/src/splivarot.cpp +++ b/src/splivarot.cpp @@ -277,11 +277,37 @@ sp_selected_path_boolop(Inkscape::Selection *selection, SPDesktop *desktop, bool theShapeB->ConvertToShape(theShape, origWind[curOrig]); - if (theShapeA->numberOfEdges() == 0) { - Shape *swap = theShapeB; - theShapeB = theShapeA; - theShapeA = swap; - } else if (theShapeB->numberOfEdges() > 0) { + // Due to quantization of the input shape coordinates, we may end up with A or B being empty. + // If this is a union or symdiff operation, we just use the non-empty shape as the result: + // A=0 => (0 or B) == B + // B=0 => (A or 0) == A + // A=0 => (0 xor B) == B + // B=0 => (A xor 0) == A + // If this is an intersection operation, we just use the empty shape as the result: + // A=0 => (0 and B) == 0 == A + // B=0 => (A and 0) == 0 == B + // If this a difference operation, and the upper shape (A) is empty, we keep B. + // If the lower shape (B) is empty, we still keep B, as it's empty: + // A=0 => (B - 0) == B + // B=0 => (0 - A) == 0 == B + // + // In any case, the output from this operation is stored in shape A, so we may apply + // the above rules simply by judicious use of swapping A and B where necessary. + bool zeroA = theShapeA->numberOfEdges() == 0; + bool zeroB = theShapeB->numberOfEdges() == 0; + if (zeroA || zeroB) { + // We might need to do a swap. Apply the above rules depending on operation type. + bool resultIsB = ((bop == bool_op_union || bop == bool_op_symdiff) && zeroA) + || ((bop == bool_op_inters) && zeroB) + || (bop == bool_op_diff); + if (resultIsB) { + // Swap A and B to use B as the result + Shape *swap = theShapeB; + theShapeB = theShapeA; + theShapeA = swap; + } + } else { + // Just do the Boolean operation as usual // les elements arrivent en ordre inverse dans la liste theShape->Booleen(theShapeB, theShapeA, bop); Shape *swap = theShape; -- cgit v1.2.3 From c9946d39f8b2d37991be9a02e3b0f133f48bdb22 Mon Sep 17 00:00:00 2001 From: Slagvi Public Date: Sat, 10 Aug 2013 15:23:01 +0200 Subject: Existing templates metadata added. Small keywords processing fix. (bzr r12379.2.20) --- src/ui/dialog/template-load-tab.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/ui/dialog/template-load-tab.cpp b/src/ui/dialog/template-load-tab.cpp index ade595eaa..b37b68ae3 100644 --- a/src/ui/dialog/template-load-tab.cpp +++ b/src/ui/dialog/template-load-tab.cpp @@ -207,6 +207,7 @@ TemplateLoadTab::TemplateData TemplateLoadTab::_processTemplateFile(const Glib:: rdoc = sp_repr_read_file(path.data(), SP_SVG_NS_URI); Inkscape::XML::Node *myRoot; Inkscape::XML::Node *dataNode; + std::cerr << path.c_str(); if (rdoc){ myRoot = rdoc->root(); if (strcmp(myRoot->name(), "svg:svg") != 0){ // Wrong file format @@ -236,9 +237,13 @@ TemplateLoadTab::TemplateData TemplateLoadTab::_processTemplateFile(const Glib:: Glib::ustring data = dataNode->firstChild()->content(); while (!data.empty()){ int pos = data.find_first_of(" "); + if (pos == Glib::ustring::npos) + pos = data.size(); + Glib::ustring keyword = dgettext("Document template keyword", data.substr(0, pos).data()); result.keywords.insert(keyword); _keywords.insert(keyword); + if (pos == data.size()) break; data.erase(0, pos+1); -- cgit v1.2.3 From 05f008356889de30ff55df1f73030003ed7cc312 Mon Sep 17 00:00:00 2001 From: Eric Greveson Date: Mon, 12 Aug 2013 16:39:48 +0100 Subject: Allow Object to Path verb from non-GUI (DBus) interface (bzr r12473.1.1) --- src/extension/internal/bluredge.cpp | 2 +- src/path-chemistry.cpp | 10 ++++------ src/path-chemistry.h | 4 +++- src/ui/dialog/livepatheffect-editor.cpp | 2 +- src/verbs.cpp | 23 +++++++++++++++++------ 5 files changed, 26 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/extension/internal/bluredge.cpp b/src/extension/internal/bluredge.cpp index a3d2fd6e5..3ce537d9f 100644 --- a/src/extension/internal/bluredge.cpp +++ b/src/extension/internal/bluredge.cpp @@ -94,7 +94,7 @@ BlurEdge::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View new_group->appendChild(new_items[i]); selection->add(new_items[i]); - sp_selected_path_to_curves(static_cast(desktop)); + sp_selected_path_to_curves(selection, static_cast(desktop)); if (offset < 0.0) { /* Doing an inset here folks */ diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index b192904ce..e1924664b 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -294,18 +294,16 @@ sp_selected_path_break_apart(SPDesktop *desktop) /* This function is an entry point from GUI */ void -sp_selected_path_to_curves(SPDesktop *desktop, bool interactive) +sp_selected_path_to_curves(Inkscape::Selection *selection, SPDesktop *desktop, bool interactive) { - Inkscape::Selection *selection = sp_desktop_selection(desktop); - if (selection->isEmpty()) { - if (interactive) + if (interactive && desktop) sp_desktop_message_stack(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select object(s) to convert to path.")); return; } bool did = false; - if (interactive) { + if (interactive && desktop) { desktop->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Converting objects to paths...")); // set "busy" cursor desktop->setWaitingCursor(); @@ -324,7 +322,7 @@ sp_selected_path_to_curves(SPDesktop *desktop, bool interactive) g_slist_free (to_select); g_slist_free (selected); - if (interactive) { + if (interactive && desktop) { desktop->clearWaitingCursor(); if (did) { DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_OBJECT_TO_CURVE, diff --git a/src/path-chemistry.h b/src/path-chemistry.h index b88b84087..efc687b44 100644 --- a/src/path-chemistry.h +++ b/src/path-chemistry.h @@ -19,6 +19,7 @@ class SPDesktop; class SPItem; namespace Inkscape { +class Selection; namespace XML { class Node; } // namespace XML @@ -26,7 +27,8 @@ class Node; void sp_selected_path_combine (SPDesktop *desktop); void sp_selected_path_break_apart (SPDesktop *desktop); -void sp_selected_path_to_curves (SPDesktop *desktop, bool interactive = true); +// interactive=true only has an effect if desktop != NULL, i.e. if a GUI is available +void sp_selected_path_to_curves (Inkscape::Selection *selection, SPDesktop *desktop, bool interactive = true); void sp_selected_to_lpeitems(SPDesktop *desktop); Inkscape::XML::Node *sp_selected_item_to_curved_repr(SPItem *item, guint32 text_grouping_policy); void sp_selected_path_reverse (SPDesktop *desktop); diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp index 6c6f3a582..6dc9c1ee3 100644 --- a/src/ui/dialog/livepatheffect-editor.cpp +++ b/src/ui/dialog/livepatheffect-editor.cpp @@ -416,7 +416,7 @@ LivePathEffectEditor::onAdd() // If item is a SPRect, convert it to path first: if ( SP_IS_RECT(item) ) { - sp_selected_path_to_curves(current_desktop, false); + sp_selected_path_to_curves(sel, current_desktop, false); item = sel->singleItem(); // get new item } diff --git a/src/verbs.cpp b/src/verbs.cpp index 06e59be38..baac07d60 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1446,12 +1446,26 @@ void LayerVerb::perform(SPAction *action, void *data) */ void ObjectVerb::perform( SPAction *action, void *data) { - g_return_if_fail(ensure_desktop_valid(action)); SPDesktop *dt = sp_action_get_desktop(action); + Inkscape::Selection *sel = sp_action_get_selection(action); - SPEventContext *ec = dt->event_context; + // We can perform some actions without a desktop + bool handled = true; + switch (reinterpret_cast(data)) { + case SP_VERB_OBJECT_TO_CURVE: + sp_selected_path_to_curves(sel, dt); + break; + default: + handled = false; + break; + } + if (handled) { + return; + } - Inkscape::Selection *sel = sp_desktop_selection(dt); + g_return_if_fail(ensure_desktop_valid(action)); + + SPEventContext *ec = dt->event_context; if (sel->isEmpty()) return; @@ -1478,9 +1492,6 @@ void ObjectVerb::perform( SPAction *action, void *data) case SP_VERB_OBJECT_FLATTEN: sp_selection_remove_transform(dt); break; - case SP_VERB_OBJECT_TO_CURVE: - sp_selected_path_to_curves(dt); - break; case SP_VERB_OBJECT_FLOW_TEXT: text_flow_into_shape(); break; -- cgit v1.2.3 From ca6b42152e492dc4e1a4554aae7ae1712eeecab7 Mon Sep 17 00:00:00 2001 From: Slagvi Public Date: Tue, 13 Aug 2013 12:10:07 +0200 Subject: Cleanups before merge (bzr r12379.2.21) --- src/ui/dialog/template-load-tab.cpp | 3 +-- src/ui/dialog/template-load-tab.h | 1 - src/ui/dialog/template-widget.cpp | 4 ++-- src/ui/dialog/template-widget.h | 6 +++--- 4 files changed, 6 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/template-load-tab.cpp b/src/ui/dialog/template-load-tab.cpp index b37b68ae3..4fee4c5e7 100644 --- a/src/ui/dialog/template-load-tab.cpp +++ b/src/ui/dialog/template-load-tab.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include "interface.h" #include "file.h" @@ -207,7 +206,7 @@ TemplateLoadTab::TemplateData TemplateLoadTab::_processTemplateFile(const Glib:: rdoc = sp_repr_read_file(path.data(), SP_SVG_NS_URI); Inkscape::XML::Node *myRoot; Inkscape::XML::Node *dataNode; - std::cerr << path.c_str(); + if (rdoc){ myRoot = rdoc->root(); if (strcmp(myRoot->name(), "svg:svg") != 0){ // Wrong file format diff --git a/src/ui/dialog/template-load-tab.h b/src/ui/dialog/template-load-tab.h index c3c512374..50f3e0be2 100644 --- a/src/ui/dialog/template-load-tab.h +++ b/src/ui/dialog/template-load-tab.h @@ -71,7 +71,6 @@ protected: void _loadTemplates(); void _initLists(); - // Gtk::HBox _main_box; Gtk::VBox _tlist_box; Gtk::HBox _search_box; TemplateWidget *_info_widget; diff --git a/src/ui/dialog/template-widget.cpp b/src/ui/dialog/template-widget.cpp index 7e0599049..0e05f292c 100644 --- a/src/ui/dialog/template-widget.cpp +++ b/src/ui/dialog/template-widget.cpp @@ -30,7 +30,7 @@ TemplateWidget::TemplateWidget() , _short_description_label(_(" ")) , _template_author_label(_(" ")) , _template_name_label(_("no template selected")) - , _preview_image(" ") + , _preview_image() , _preview_render() { pack_start(_template_name_label, Gtk::PACK_SHRINK, 10); @@ -41,7 +41,7 @@ TemplateWidget::TemplateWidget() _preview_box.pack_start(_preview_render, Gtk::PACK_EXPAND_PADDING, 10); _short_description_label.set_line_wrap(true); - _short_description_label.set_size_request(200); + //_short_description_label.set_size_request(200); Gtk::Alignment *align; align = manage(new Gtk::Alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER, 0.0, 0.0)); diff --git a/src/ui/dialog/template-widget.h b/src/ui/dialog/template-widget.h index 3c95208de..c7847460f 100644 --- a/src/ui/dialog/template-widget.h +++ b/src/ui/dialog/template-widget.h @@ -31,12 +31,12 @@ private: TemplateLoadTab::TemplateData _current_template; Gtk::Button _more_info_button; - Gtk::Label _short_description_label; - Gtk::Label _template_author_label; - Gtk::Label _template_name_label; Gtk::HBox _preview_box; Gtk::Image _preview_image; Dialog::SVGPreview _preview_render; + Gtk::Label _short_description_label; + Gtk::Label _template_author_label; + Gtk::Label _template_name_label; void _displayTemplateDetails(); }; -- cgit v1.2.3 From 7f43184f78f3ab203d6c597639805bf65cd22387 Mon Sep 17 00:00:00 2001 From: su_v Date: Wed, 14 Aug 2013 20:52:42 +0200 Subject: fix build with dbusapi enabled Fixed bugs: - https://launchpad.net/bugs/1212355 (bzr r12477) --- src/file.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/file.cpp b/src/file.cpp index eb917f169..68e229e62 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -164,7 +164,7 @@ SPDesktop *sp_file_new(const Glib::ustring &templ) sp_namedview_update_layers_from_document(desktop); #ifdef WITH_DBUS - Inkscape::Extension::Dbus::dbus_init_desktop_interface(dt); + Inkscape::Extension::Dbus::dbus_init_desktop_interface(desktop); #endif return desktop; -- cgit v1.2.3 From 0167937d063bb0e313aba987cbc69b59e18d2ed4 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Thu, 15 Aug 2013 01:15:59 +0200 Subject: Fix warning and hopefully fix build failures on Launchpad (bzr r12478) --- src/ui/dialog/template-load-tab.cpp | 5 ++++- src/ui/dialog/template-widget.cpp | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/template-load-tab.cpp b/src/ui/dialog/template-load-tab.cpp index 4fee4c5e7..0123f663f 100644 --- a/src/ui/dialog/template-load-tab.cpp +++ b/src/ui/dialog/template-load-tab.cpp @@ -14,6 +14,9 @@ #include #include #include +#include +#include +#include #include "interface.h" #include "file.h" @@ -235,7 +238,7 @@ TemplateLoadTab::TemplateData TemplateLoadTab::_processTemplateFile(const Glib:: if ((dataNode = sp_repr_lookup_name(myRoot, "inkscape:_keywords")) != NULL){ Glib::ustring data = dataNode->firstChild()->content(); while (!data.empty()){ - int pos = data.find_first_of(" "); + std::size_t pos = data.find_first_of(" "); if (pos == Glib::ustring::npos) pos = data.size(); diff --git a/src/ui/dialog/template-widget.cpp b/src/ui/dialog/template-widget.cpp index 0e05f292c..dfc26913f 100644 --- a/src/ui/dialog/template-widget.cpp +++ b/src/ui/dialog/template-widget.cpp @@ -30,8 +30,6 @@ TemplateWidget::TemplateWidget() , _short_description_label(_(" ")) , _template_author_label(_(" ")) , _template_name_label(_("no template selected")) - , _preview_image() - , _preview_render() { pack_start(_template_name_label, Gtk::PACK_SHRINK, 10); pack_start(_template_author_label, Gtk::PACK_SHRINK, 0); -- cgit v1.2.3 From 0be39e335f73b5b7770f1580871f48ca1791ced4 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Thu, 15 Aug 2013 10:07:55 +0100 Subject: Fix Gtk+ 3 build failure and make check (bzr r12479) --- src/ui/dialog/template-load-tab.cpp | 3 ++- src/ui/dialog/template-widget.cpp | 8 ++++---- src/ui/dialog/template-widget.h | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/template-load-tab.cpp b/src/ui/dialog/template-load-tab.cpp index 0123f663f..265ee8026 100644 --- a/src/ui/dialog/template-load-tab.cpp +++ b/src/ui/dialog/template-load-tab.cpp @@ -8,9 +8,10 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include "template-load-tab.h" #include "template-widget.h" +#include "template-load-tab.h" + #include #include #include diff --git a/src/ui/dialog/template-widget.cpp b/src/ui/dialog/template-widget.cpp index dfc26913f..be7e2b515 100644 --- a/src/ui/dialog/template-widget.cpp +++ b/src/ui/dialog/template-widget.cpp @@ -1,5 +1,3 @@ - - /** @file * @brief New From Template - templates widget - implementation */ @@ -11,15 +9,17 @@ */ #include "template-widget.h" -#include "template-load-tab.h" -#include "file.h" #include #include #include #include + #include +#include +#include "template-load-tab.h" +#include "file.h" namespace Inkscape { namespace UI { diff --git a/src/ui/dialog/template-widget.h b/src/ui/dialog/template-widget.h index c7847460f..f7e1267ce 100644 --- a/src/ui/dialog/template-widget.h +++ b/src/ui/dialog/template-widget.h @@ -11,10 +11,11 @@ #ifndef INKSCAPE_SEEN_UI_DIALOG_TEMPLATE_WIDGET_H #define INKSCAPE_SEEN_UI_DIALOG_TEMPLATE_WIDGET_H -#include "template-load-tab.h" #include "filedialogimpl-gtkmm.h" + #include +#include "template-load-tab.h" namespace Inkscape { namespace UI { -- cgit v1.2.3 From 69ac4cffff595c46b3f8dd2bcceab6bccf6e4581 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Thu, 15 Aug 2013 21:10:29 +0200 Subject: Add option to write out path data using only relative coordinates (in addition to using only absolute coordinates or using a mixture of absolute and relative coordinates optimized for length). (bzr r12480) --- src/preferences-skeleton.h | 2 +- src/svg/path-string.cpp | 72 ++++++++++++++++++++++------------ src/svg/path-string.h | 24 +++++++++--- src/ui/dialog/inkscape-preferences.cpp | 8 +++- src/ui/dialog/inkscape-preferences.h | 2 +- 5 files changed, 73 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/preferences-skeleton.h b/src/preferences-skeleton.h index c5d972966..17b912d33 100644 --- a/src/preferences-skeleton.h +++ b/src/preferences-skeleton.h @@ -326,7 +326,7 @@ static char const preferences_skeleton[] = " minimumexponent=\"-8\" " " inlineattrs=\"0\" " " indent=\"2\" " -" allowrelativecoordinates=\"1\" " +" pathstring_format=\"2\" " " forcerepeatcommands=\"0\" " " incorrect_attributes_warn=\"1\" " " incorrect_attributes_remove=\"0\" " diff --git a/src/svg/path-string.cpp b/src/svg/path-string.cpp index 61e9c90a2..6dddeadff 100644 --- a/src/svg/path-string.cpp +++ b/src/svg/path-string.cpp @@ -2,6 +2,7 @@ * Inkscape::SVG::PathString - builder for SVG path strings * * Copyright 2008 Jasper van de Gronde + * Copyright 2013 Tavmjong Bah * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -25,44 +26,65 @@ static int const maxprec = 16; int Inkscape::SVG::PathString::numericprecision; int Inkscape::SVG::PathString::minimumexponent; +Inkscape::SVG::PATHSTRING_FORMAT Inkscape::SVG::PathString::format; Inkscape::SVG::PathString::PathString() : - allow_relative_coordinates(Inkscape::Preferences::get()->getBool("/options/svgoutput/allowrelativecoordinates", true)), force_repeat_commands(Inkscape::Preferences::get()->getBool("/options/svgoutput/forcerepeatcommands")) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + format = (PATHSTRING_FORMAT)prefs->getIntLimited("/options/svgoutput/pathstring_format", 1, 0, PATHSTRING_FORMAT_SIZE - 1 ); numericprecision = std::max(minprec,std::min(maxprec, prefs->getInt("/options/svgoutput/numericprecision", 8))); minimumexponent = prefs->getInt("/options/svgoutput/minimumexponent", -8); } +// For absolute and relative paths... the entire path is kept in the "tail". +// For optimized path, at a switch between absolute and relative, add tail to commonbase. void Inkscape::SVG::PathString::_appendOp(char abs_op, char rel_op) { bool abs_op_repeated = _abs_state.prevop == abs_op && !force_repeat_commands; bool rel_op_repeated = _rel_state.prevop == rel_op && !force_repeat_commands; - unsigned int const abs_added_size = abs_op_repeated ? 0 : 2; - unsigned int const rel_added_size = rel_op_repeated ? 0 : 2; - if ( _rel_state.str.size()+2 < _abs_state.str.size()+abs_added_size && allow_relative_coordinates ) { - // Store common prefix - commonbase += _rel_state.str; - _rel_state.str.clear(); - // Copy rel to abs - _abs_state = _rel_state; - _abs_state.switches++; - abs_op_repeated = false; - // We do not have to copy abs to rel: - // _rel_state.str.size()+2 < _abs_state.str.size()+abs_added_size - // _rel_state.str.size()+rel_added_size < _abs_state.str.size()+2 - // _abs_state.str.size()+2 > _rel_state.str.size()+rel_added_size - } else if ( _abs_state.str.size()+2 < _rel_state.str.size()+rel_added_size ) { - // Store common prefix - commonbase += _abs_state.str; - _abs_state.str.clear(); - // Copy abs to rel - _rel_state = _abs_state; - _abs_state.switches++; - rel_op_repeated = false; + + // For absolute and relative paths... do nothing. + switch (format) { + case PATHSTRING_ABSOLUTE: + if ( !abs_op_repeated ) _abs_state.appendOp(abs_op); + break; + case PATHSTRING_RELATIVE: + if ( !rel_op_repeated ) _rel_state.appendOp(rel_op); + break; + case PATHSTRING_OPTIMIZE: + { + unsigned int const abs_added_size = abs_op_repeated ? 0 : 2; + unsigned int const rel_added_size = rel_op_repeated ? 0 : 2; + if ( _rel_state.str.size()+2 < _abs_state.str.size()+abs_added_size ) { + + // Store common prefix + commonbase += _rel_state.str; + _rel_state.str.clear(); + // Copy rel to abs + _abs_state = _rel_state; + _abs_state.switches++; + abs_op_repeated = false; + // We do not have to copy abs to rel: + // _rel_state.str.size()+2 < _abs_state.str.size()+abs_added_size + // _rel_state.str.size()+rel_added_size < _abs_state.str.size()+2 + // _abs_state.str.size()+2 > _rel_state.str.size()+rel_added_size + } else if ( _abs_state.str.size()+2 < _rel_state.str.size()+rel_added_size ) { + + // Store common prefix + commonbase += _abs_state.str; + _abs_state.str.clear(); + // Copy abs to rel + _rel_state = _abs_state; + _abs_state.switches++; + rel_op_repeated = false; + } + if ( !abs_op_repeated ) _abs_state.appendOp(abs_op); + if ( !rel_op_repeated ) _rel_state.appendOp(rel_op); + } + break; + default: + std::cout << "Better not be here!" << std::endl; } - if ( !abs_op_repeated ) _abs_state.appendOp(abs_op); - if ( !rel_op_repeated ) _rel_state.appendOp(rel_op); } void Inkscape::SVG::PathString::State::append(Geom::Coord v) { diff --git a/src/svg/path-string.h b/src/svg/path-string.h index 11018e65c..3a891873d 100644 --- a/src/svg/path-string.h +++ b/src/svg/path-string.h @@ -1,6 +1,7 @@ /* * Copyright 2007 MenTaLguY * Copyright 2008 Jasper van de Gronde + * Copyright 2013 Tavmjong Bah * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -23,6 +24,14 @@ namespace Inkscape { namespace SVG { +// Relative vs. absolute coordinates +enum PATHSTRING_FORMAT { + PATHSTRING_ABSOLUTE, // Use only absolute coordinates + PATHSTRING_RELATIVE, // Use only relative coordinates + PATHSTRING_OPTIMIZE, // Optimize for path string length + PATHSTRING_FORMAT_SIZE +}; + /** * Builder for SVG path strings. */ @@ -38,6 +47,7 @@ public: final.reserve(commonbase.size()+t.size()); final = commonbase; final += tail(); + // std::cout << " final: " << final << std::endl; return final; } @@ -130,12 +140,10 @@ public: } PathString &closePath() { - commonbase += _abs_state.str; - _abs_state.str.clear(); - _rel_state = _abs_state; + _abs_state.appendOp('Z'); _rel_state.appendOp('z'); - _rel_state.switches++; + _current_point = _initial_point; return *this; } @@ -229,9 +237,13 @@ private: // to cause a quadratic time complexity (in the number of characters/operators) std::string commonbase; std::string final; - std::string const &tail() const { return ((_abs_state <= _rel_state || !allow_relative_coordinates) ? _abs_state.str : _rel_state.str); } + std::string const &tail() const { + return ( (format == PATHSTRING_ABSOLUTE) || + (format == PATHSTRING_OPTIMIZE && _abs_state <= _rel_state ) ? + _abs_state.str : _rel_state.str ); + } - bool const allow_relative_coordinates; + static PATHSTRING_FORMAT format; bool const force_repeat_commands; static int numericprecision; static int minimumexponent; diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 7890b0b4c..b06c1fd1f 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -879,8 +879,12 @@ void InkscapePreferences::initPageIO() _page_svgoutput.add_group_header( _("Path data")); - _svgoutput_allowrelativecoordinates.init( _("Allow relative coordinates"), "/options/svgoutput/allowrelativecoordinates", true); - _page_svgoutput.add_line( true, "", _svgoutput_allowrelativecoordinates, "", _("If set, relative coordinates may be used in path data"), false); + int const numPathstringFormat = 3; + Glib::ustring pathstringFormatLabels[numPathstringFormat] = {_("Absolute"), _("Relative"), _("Optimized")}; + int pathstringFormatValues[numPathstringFormat] = {0, 1, 2}; + + _svgoutput_pathformat.init("/options/svgoutput/pathstring_format", pathstringFormatLabels, pathstringFormatValues, numPathstringFormat, 2); + _page_svgoutput.add_line( true, _("Path string format"), _svgoutput_pathformat, "", _("Path data should be written: only with absolute coordinates, only with relative coordinates, or optimized for string length (mixed absolute and relative coordinates)"), false); _svgoutput_forcerepeatcommands.init( _("Force repeat commands"), "/options/svgoutput/forcerepeatcommands", false); _page_svgoutput.add_line( true, "", _svgoutput_forcerepeatcommands, "", _("Force repeating of the same path command (for example, 'L 1,2 L 3,4' instead of 'L 1,2 3,4')"), false); diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h index 37c05df05..56222fb22 100644 --- a/src/ui/dialog/inkscape-preferences.h +++ b/src/ui/dialog/inkscape-preferences.h @@ -426,7 +426,7 @@ protected: UI::Widget::PrefSpinButton _svgoutput_minimumexponent; UI::Widget::PrefCheckButton _svgoutput_inlineattrs; UI::Widget::PrefSpinButton _svgoutput_indent; - UI::Widget::PrefCheckButton _svgoutput_allowrelativecoordinates; + UI::Widget::PrefCombo _svgoutput_pathformat; UI::Widget::PrefCheckButton _svgoutput_forcerepeatcommands; // Attribute Checking controls for SVG Output page: -- cgit v1.2.3 From 451210ce988fb6e6964bd4869f74ffa7fb2c462d Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Thu, 15 Aug 2013 21:13:44 +0200 Subject: Prevent writing out empty style strings. (bzr r12481) --- src/attribute-rel-util.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/attribute-rel-util.cpp b/src/attribute-rel-util.cpp index 933339632..15c71daa7 100644 --- a/src/attribute-rel-util.cpp +++ b/src/attribute-rel-util.cpp @@ -141,7 +141,11 @@ void sp_attribute_clean_style(Node *repr, unsigned int flags) { // sp_repr_css_set( repr, css, "style"); // Don't use as it will cause loop. Glib::ustring value; sp_repr_css_write_string(css, value); - repr->setAttribute("style", value.c_str()); + if( value.empty() ) { + repr->setAttribute("style", NULL ); + } else { + repr->setAttribute("style", value.c_str()); + } sp_repr_css_attr_unref( css ); } -- cgit v1.2.3 From 350476a133a3965b1d7047d2f0f05bf809b177ba Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Wed, 21 Aug 2013 13:01:40 +0200 Subject: better memory leak fix (fixes bug 986271: memory leaks associated with images) Patch by David Mathog, including revert of former fix in rev 11268 (bzr r12482) --- src/extension/internal/emf-win32-print.cpp | 12 ------------ src/extension/internal/emf-win32-print.h | 7 ------- src/sp-image.cpp | 1 + 3 files changed, 1 insertion(+), 19 deletions(-) (limited to 'src') diff --git a/src/extension/internal/emf-win32-print.cpp b/src/extension/internal/emf-win32-print.cpp index 621954f68..92f564078 100644 --- a/src/extension/internal/emf-win32-print.cpp +++ b/src/extension/internal/emf-win32-print.cpp @@ -910,18 +910,6 @@ void PrintEmfWin32::init (void) return; } -unsigned int PrintEmfWin32::image(Inkscape::Extension::Print * /* module */, /** not used */ - unsigned char *px, /** array of pixel values, Gdk::Pixbuf bitmap format */ - unsigned int /*w*/, /** width of bitmap */ - unsigned int /*h*/, /** height of bitmap */ - unsigned int /*rs*/, /** row stride (normally w*4) */ - Geom::Affine const & /*tf_ignore*/, /** WRONG affine transform, use the one from m_tr_stack */ - SPStyle const * /*style*/) /** provides indirect link to image object */ -{ - free(px); - return 0; -} - } /* namespace Internal */ } /* namespace Extension */ } /* namespace Inkscape */ diff --git a/src/extension/internal/emf-win32-print.h b/src/extension/internal/emf-win32-print.h index e7bd08477..bbeeeb051 100644 --- a/src/extension/internal/emf-win32-print.h +++ b/src/extension/internal/emf-win32-print.h @@ -50,13 +50,6 @@ class PrintEmfWin32 : public Inkscape::Extension::Implementation::Implementation unsigned int print_pathv (Geom::PathVector const &pathv, const Geom::Affine &transform); bool print_simple_shape (Geom::PathVector const &pathv, const Geom::Affine &transform); - unsigned int image(Inkscape::Extension::Print * /* module */, /** not used */ - unsigned char *px, /** array of pixel values, Gdk::Pixbuf bitmap format */ - unsigned int w, /** width of bitmap */ - unsigned int h, /** height of bitmap */ - unsigned int rs, /** row stride (normally w*4) */ - Geom::Affine const &tf_ignore, /** WRONG affine transform, use the one from m_tr_stack */ - SPStyle const *style); /** provides indirect link to image object */ public: PrintEmfWin32 (void); diff --git a/src/sp-image.cpp b/src/sp-image.cpp index d60fbc181..10d294d5c 100644 --- a/src/sp-image.cpp +++ b/src/sp-image.cpp @@ -1056,6 +1056,7 @@ static void sp_image_print( SPItem *item, SPPrintContext *ctx ) t = ti * t; sp_print_image_R8G8B8A8_N(ctx, px + trimx*pixskip + trimy*rs, trimwidth, trimheight, rs, t, item->style); } + free(px); // else big memory leak on each image print! } } -- cgit v1.2.3 From 205e7c81bd2f536b394a0786111bf60c0aac1df6 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sun, 25 Aug 2013 19:40:15 -0700 Subject: Updating outdated test. Fixes bug #1202271. Fixed bugs: - https://launchpad.net/bugs/1202271 (bzr r12487) --- src/preferences-test.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/preferences-test.h b/src/preferences-test.h index 8e8ddb65b..92cb14247 100644 --- a/src/preferences-test.h +++ b/src/preferences-test.h @@ -18,7 +18,7 @@ public: TestObserver(Glib::ustring const &path) : Inkscape::Preferences::Observer(path), value(0) {} - + virtual void notify(Inkscape::Preferences::Entry const &val) { value = val.getInt(); @@ -35,29 +35,29 @@ public: prefs = NULL; Inkscape::Preferences::unload(); } - + void testStartingState() { - TS_ASSERT(prefs != NULL); - TS_ASSERT_EQUALS(prefs->isWritable(), false); + TS_ASSERT_DIFFERS(prefs, static_cast(0)); + TS_ASSERT_EQUALS(prefs->isWritable(), true); } - + void testOverwrite() { prefs->setInt("/test/intvalue", 123); prefs->setInt("/test/intvalue", 321); TS_ASSERT_EQUALS(prefs->getInt("/test/intvalue"), 321); } - + void testDefaultReturn() { TS_ASSERT_EQUALS(prefs->getInt("/this/path/does/not/exist", 123), 123); } - + void testLimitedReturn() { prefs->setInt("/test/intvalue", 1000); - + // simple case TS_ASSERT_EQUALS(prefs->getIntLimited("/test/intvalue", 123, 0, 500), 123); // the below may seem quirky but this behaviour is intended @@ -66,7 +66,7 @@ public: TS_ASSERT_EQUALS(prefs->getIntLimited("/test/intvalue", 123, 0, 1000), 1000); TS_ASSERT_EQUALS(prefs->getIntLimited("/test/intvalue", 123, 1000, 5000), 1000); } - + void testKeyObserverNotification() { Glib::ustring const path = "/some/random/path"; @@ -74,18 +74,18 @@ public: obs.value = 1; prefs->setInt(path, 5); TS_ASSERT_EQUALS(obs.value, 1); // no notifications sent before adding - + prefs->addObserver(obs); prefs->setInt(path, 10); TS_ASSERT_EQUALS(obs.value, 10); prefs->setInt("/some/other/random/path", 10); TS_ASSERT_EQUALS(obs.value, 10); // value should not change - + prefs->removeObserver(obs); prefs->setInt(path, 15); TS_ASSERT_EQUALS(obs.value, 10); // no notifications sent after removal } - + void testEntryObserverNotification() { Glib::ustring const path = "/some/random/path"; @@ -93,11 +93,11 @@ public: obs.value = 1; prefs->setInt(path, 5); TS_ASSERT_EQUALS(obs.value, 1); // no notifications sent before adding - + prefs->addObserver(obs); prefs->setInt(path, 10); TS_ASSERT_EQUALS(obs.value, 10); - + // test that filtering works properly prefs->setInt("/some/random/value", 1234); TS_ASSERT_EQUALS(obs.value, 10); @@ -105,12 +105,12 @@ public: TS_ASSERT_EQUALS(obs.value, 10); prefs->setInt("/some/random/path2", 1234); TS_ASSERT_EQUALS(obs.value, 10); - + prefs->removeObserver(obs); prefs->setInt(path, 15); TS_ASSERT_EQUALS(obs.value, 10); // no notifications sent after removal } - + void testPreferencesEntryMethods() { prefs->setInt("/test/prefentry", 100); -- cgit v1.2.3