From a11039985c1101b12665e85a8368a46b77f9de10 Mon Sep 17 00:00:00 2001 From: su_v Date: Thu, 24 Jan 2013 17:44:22 +0100 Subject: Add support for libcdr (bzr r12059.1.1) --- configure.ac | 22 +++ share/extensions/Makefile.am | 1 - share/extensions/cdr_input.inx | 17 -- src/Makefile.am | 2 + src/extension/init.cpp | 6 + src/extension/internal/Makefile_insert | 6 + src/extension/internal/cdr-input.cpp | 293 +++++++++++++++++++++++++++++++++ src/extension/internal/cdr-input.h | 54 ++++++ 8 files changed, 383 insertions(+), 18 deletions(-) delete mode 100644 share/extensions/cdr_input.inx create mode 100644 src/extension/internal/cdr-input.cpp create mode 100644 src/extension/internal/cdr-input.h diff --git a/configure.ac b/configure.ac index 27a54961e..62d8ff11f 100644 --- a/configure.ac +++ b/configure.ac @@ -706,6 +706,27 @@ AC_SUBST(LIBVISIO_LIBS) AC_SUBST(LIBVISIO_CFLAGS) AM_CONDITIONAL(WITH_LIBVISIO, test "x$with_libvisio" = "xyes") +dnl ******************************** +dnl Check for libcdr for extension +dnl ******************************** + +AC_ARG_ENABLE(wpg, + [ --disable-cdr compile without support for Microsoft Visio Diagrams], + enable_cdr=$enableval,enable_cdr=yes) + +with_libcdr=no + +if test "x$enable_cdr" = "xyes"; then + PKG_CHECK_MODULES(LIBCDR, libcdr-0.0 >= 0.0.9 libwpd-0.9 libwpd-stream-0.9 libwpg-0.2, with_libcdr=yes, with_libcdr=no) + + if test "x$with_libcdr" = "xyes"; then + AC_DEFINE(WITH_LIBCDR,1,[Build in libcdr]) + fi +fi +AC_SUBST(LIBCDR_LIBS) +AC_SUBST(LIBCDR_CFLAGS) +AM_CONDITIONAL(WITH_LIBCDR, test "x$with_libcdr" = "xyes") + dnl ****************************** dnl Support doing a local install dnl (mostly for distcheck) @@ -1170,6 +1191,7 @@ Configuration: ImageMagick Magick++: ${magick_ok} Libwpg: ${with_libwpg} Libvisio: ${with_libvisio} + Libcdr: ${with_libcdr} Doing Local Install: ${with_localinstall} GTK+ backend target: ${gtk_backend_target} " diff --git a/share/extensions/Makefile.am b/share/extensions/Makefile.am index 9a8fa6153..63a9d143c 100644 --- a/share/extensions/Makefile.am +++ b/share/extensions/Makefile.am @@ -196,7 +196,6 @@ modules = \ ai_input.inx \ aisvg.inx \ ccx_input.inx \ - cdr_input.inx\ cdt_input.inx \ cgm_input.inx \ cmx_input.inx \ diff --git a/share/extensions/cdr_input.inx b/share/extensions/cdr_input.inx deleted file mode 100644 index 781789719..000000000 --- a/share/extensions/cdr_input.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>Corel DRAW Input - org.inkscape.input.cdr - - uniconv-ext.py - - .cdr - image/x-xcdr - <_filetypename>Corel DRAW 7-X4 files (*.cdr) - <_filetypetooltip>Open files saved in Corel DRAW 7-X4 - org.inkscape.output.cdr - - - diff --git a/src/Makefile.am b/src/Makefile.am index 46c655f9c..65baec21b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -48,6 +48,7 @@ all_libs = \ $(INKBOARD_LIBS) \ $(LIBWPG_LIBS) \ $(LIBVISIO_LIBS) \ + $(LIBCDR_LIBS) \ $(DBUS_LIBS) \ $(GDL_LIBS) \ $(IMAGEMAGICK_LIBS) @@ -72,6 +73,7 @@ INCLUDES = \ $(INKBOARD_CFLAGS) \ $(LIBWPG_CFLAGS) \ $(LIBVISIO_CFLAGS) \ + $(LIBCDR_CFLAGS) \ $(DBUS_CFLAGS) \ $(GDL_CFLAGS) \ $(XFT_CFLAGS) \ diff --git a/src/extension/init.cpp b/src/extension/init.cpp index ac3c90421..5555eddf6 100644 --- a/src/extension/init.cpp +++ b/src/extension/init.cpp @@ -56,6 +56,9 @@ #ifdef WITH_LIBVISIO #include "internal/vsd-input.h" #endif +#ifdef WITH_LIBCDR +#include "internal/cdr-input.h" +#endif #include "preferences.h" #include "io/sys.h" #ifdef WITH_DBUS @@ -191,6 +194,9 @@ init() #ifdef WITH_LIBVISIO Internal::VsdInput::init(); #endif +#ifdef WITH_LIBCDR + Internal::CdrInput::init(); +#endif /* Effects */ Internal::BlurEdge::init(); diff --git a/src/extension/internal/Makefile_insert b/src/extension/internal/Makefile_insert index 1ea6caca9..9e55598df 100644 --- a/src/extension/internal/Makefile_insert +++ b/src/extension/internal/Makefile_insert @@ -12,6 +12,12 @@ ink_common_sources += \ extension/internal/vsd-input.h endif +if WITH_LIBCDR +ink_common_sources += \ + extension/internal/cdr-input.cpp \ + extension/internal/cdr-input.h +endif + if USE_IMAGE_MAGICK ink_common_sources += \ extension/internal/bitmap/imagemagick.cpp \ diff --git a/src/extension/internal/cdr-input.cpp b/src/extension/internal/cdr-input.cpp new file mode 100644 index 000000000..63531d082 --- /dev/null +++ b/src/extension/internal/cdr-input.cpp @@ -0,0 +1,293 @@ +/* + * This file came from libwpg as a source, their utility wpg2svg + * specifically. It has been modified to work as an Inkscape extension. + * The Inkscape extension code is covered by this copyright, but the + * rest is covered by the one bellow. + * + * Authors: + * Fridrich Strba (fridrich.strba@bluewin.ch) + * + * Copyright (C) 2012 Authors + * + * Released under GNU GPL, read the file 'COPYING' for more information + * + */ + +#include +#include "config.h" + +#include "cdr-input.h" + +#ifdef WITH_LIBCDR + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include "extension/system.h" +#include "extension/input.h" +#include "document.h" + +#include "document-private.h" +#include "document-undo.h" +#include "inkscape.h" + +#include "dialogs/dialog-events.h" +#include +#include "ui/widget/spinbutton.h" +#include "ui/widget/frame.h" +#include + +#include + +#include "svg-view.h" +#include "svg-view-widget.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { + + +class CdrImportDialog : public Gtk::Dialog { +public: + CdrImportDialog(const std::vector &vec); + virtual ~CdrImportDialog(); + + bool showDialog(); + unsigned getSelectedPage(); + void getImportSettings(Inkscape::XML::Node *prefs); + +private: + void _setPreviewPage(unsigned page); + + // Signal handlers +#if !WITH_GTKMM_3_0 + bool _onExposePreview(GdkEventExpose *event); +#endif + + void _onPageNumberChanged(); + + class Gtk::Button * cancelbutton; + class Gtk::Button * okbutton; + class Gtk::Label * _labelSelect; + class Inkscape::UI::Widget::SpinButton * _pageNumberSpin; + class Gtk::Label * _labelTotalPages; + class Gtk::VBox * vbox1; + class Gtk::VBox * vbox2; + class Gtk::Widget * _previewArea; + + const std::vector &_vec; // Document to be imported + unsigned _current_page; // Current selected page + int _preview_width, _preview_height; // Size of the preview area +}; + +CdrImportDialog::CdrImportDialog(const std::vector &vec) + : _vec(vec), _current_page(1) +{ + int num_pages = _vec.size(); + if ( num_pages <= 1 ) + return; + cancelbutton = Gtk::manage(new class Gtk::Button(Gtk::StockID("gtk-cancel"))); + okbutton = Gtk::manage(new class Gtk::Button(Gtk::StockID("gtk-ok"))); + _labelSelect = Gtk::manage(new class Gtk::Label(_("Select page:"))); + + // Page number +#if WITH_GTKMM_3_0 + Glib::RefPtr _pageNumberSpin_adj = Gtk::Adjustment::create(1, 1, _vec.size(), 1, 10, 0); + _pageNumberSpin = Gtk::manage(new Inkscape::UI::Widget::SpinButton(_pageNumberSpin_adj, 1, 1)); +#else + Gtk::Adjustment *_pageNumberSpin_adj = Gtk::manage( + new class Gtk::Adjustment(1, 1, _vec.size(), 1, 10, 0)); + _pageNumberSpin = Gtk::manage(new class Inkscape::UI::Widget::SpinButton(*_pageNumberSpin_adj, 1, 1)); +#endif + _labelTotalPages = Gtk::manage(new class Gtk::Label()); + gchar *label_text = g_strdup_printf(_("out of %i"), num_pages); + _labelTotalPages->set_label(label_text); + g_free(label_text); + + vbox1 = Gtk::manage(new class Gtk::VBox(false, 4)); + SPDocument *doc = SPDocument::createNewDocFromMem(_vec[0].cstr(), strlen(_vec[0].cstr()), 0); + _previewArea = Glib::wrap(sp_svg_view_widget_new(doc)); + + vbox2 = Gtk::manage(new class Gtk::VBox(false, 4)); + cancelbutton->set_can_focus(); + cancelbutton->set_can_default(); + cancelbutton->set_relief(Gtk::RELIEF_NORMAL); + okbutton->set_can_focus(); + okbutton->set_can_default(); + okbutton->set_relief(Gtk::RELIEF_NORMAL); + this->get_action_area()->property_layout_style().set_value(Gtk::BUTTONBOX_END); + _labelSelect->set_line_wrap(false); + _labelSelect->set_use_markup(false); + _labelSelect->set_selectable(false); + _pageNumberSpin->set_can_focus(); + _pageNumberSpin->set_update_policy(Gtk::UPDATE_ALWAYS); + _pageNumberSpin->set_numeric(true); + _pageNumberSpin->set_digits(0); + _pageNumberSpin->set_wrap(false); + _labelTotalPages->set_line_wrap(false); + _labelTotalPages->set_use_markup(false); + _labelTotalPages->set_selectable(false); + vbox2->pack_start(*_previewArea, Gtk::PACK_SHRINK, 0); + this->get_vbox()->set_homogeneous(false); + this->get_vbox()->set_spacing(0); + this->get_vbox()->pack_start(*vbox2); + this->set_title(_("Page Selector")); + this->set_modal(true); + sp_transientize(GTK_WIDGET(this->gobj())); //Make transient + this->property_window_position().set_value(Gtk::WIN_POS_NONE); + this->set_resizable(true); + this->property_destroy_with_parent().set_value(false); + this->get_action_area()->add(*_labelSelect); + this->add_action_widget(*_pageNumberSpin, -7); + this->get_action_area()->add(*_labelTotalPages); + this->add_action_widget(*cancelbutton, -6); + this->add_action_widget(*okbutton, -5); + cancelbutton->show(); + okbutton->show(); + _labelSelect->show(); + _pageNumberSpin->show(); + _labelTotalPages->show(); + vbox1->show(); + _previewArea->show(); + vbox2->show(); + + // Connect signals + _pageNumberSpin_adj->signal_value_changed().connect(sigc::mem_fun(*this, &CdrImportDialog::_onPageNumberChanged)); +} + +CdrImportDialog::~CdrImportDialog() {} + +bool CdrImportDialog::showDialog() +{ + show(); + gint b = run(); + hide(); + if ( b == Gtk::RESPONSE_OK ) { + return TRUE; + } else { + return FALSE; + } +} + +unsigned CdrImportDialog::getSelectedPage() +{ + return _current_page; +} + +void CdrImportDialog::_onPageNumberChanged() +{ + int page = _pageNumberSpin->get_value_as_int(); + _current_page = CLAMP(page, 1, _vec.size()); + _setPreviewPage(_current_page); +} + +/** + * \brief Renders the given page's thumbnail + */ +void CdrImportDialog::_setPreviewPage(unsigned page) +{ + SPDocument *doc = SPDocument::createNewDocFromMem(_vec[page-1].cstr(), strlen(_vec[page-1].cstr()), 0); + Gtk::Widget * tmpPreviewArea = Glib::wrap(sp_svg_view_widget_new(doc)); + std::swap(_previewArea, tmpPreviewArea); + if (tmpPreviewArea) { + _previewArea->set_size_request( tmpPreviewArea->get_width(), tmpPreviewArea->get_height() ); + delete tmpPreviewArea; + } + vbox2->pack_start(*_previewArea, Gtk::PACK_SHRINK, 0); + _previewArea->show_now(); +} + +SPDocument *CdrInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri) +{ + WPXFileStream input(uri); + + if (!libcdr::CDRDocument::isSupported(&input)) { + return NULL; + } + + libcdr::CDRStringVector output; + if (!libcdr::CDRDocument::generateSVG(&input, output)) { + return NULL; + } + + if (output.empty()) { + return NULL; + } + + std::vector tmpSVGOutput; + for (unsigned i=0; i\n\n"); + tmpString.append(output[i]); + tmpSVGOutput.push_back(tmpString); + } + + unsigned page_num = 1; + + // If only one page is present, import that one without bothering user + if (tmpSVGOutput.size() > 1) { + CdrImportDialog *dlg = 0; + if (inkscape_use_gui()) { + dlg = new CdrImportDialog(tmpSVGOutput); + if (!dlg->showDialog()) { + delete dlg; + return NULL; + } + } + + // Get needed page + if (dlg) { + page_num = dlg->getSelectedPage(); + if (page_num < 1) + page_num = 1; + if (page_num > tmpSVGOutput.size()) + page_num = tmpSVGOutput.size(); + } + } + + SPDocument * doc = SPDocument::createNewDocFromMem(tmpSVGOutput[page_num-1].cstr(), strlen(tmpSVGOutput[page_num-1].cstr()), TRUE); + return doc; +} + +#include "clear-n_.h" + +void CdrInput::init(void) +{ + /* CDR */ + Inkscape::Extension::build_from_mem( + "\n" + "" N_("Corel DRAW Input") "\n" + "org.inkscape.input.cdr\n" + "\n" + ".cdr\n" + "image/x-xcdr\n" + "" N_("Corel DRAW 7-X4 files (*.cdr)") "\n" + "" N_("Open files saved in Corel DRAW 7-X4") "\n" + "\n" + "", new CdrInput()); + + return; + +} // init + +} } } /* namespace Inkscape, Extension, Implementation */ +#endif /* WITH_LIBCDR */ + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : diff --git a/src/extension/internal/cdr-input.h b/src/extension/internal/cdr-input.h new file mode 100644 index 000000000..10af41d5a --- /dev/null +++ b/src/extension/internal/cdr-input.h @@ -0,0 +1,54 @@ +/* + * This code abstracts the libwpg interfaces into the Inkscape + * input extension interface. + * + * Authors: + * Fridrich Strba (fridrich.strba@bluewin.ch) + * + * Copyright (C) 2012 Authors + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#ifndef __EXTENSION_INTERNAL_CDROUTPUT_H__ +#define __EXTENSION_INTERNAL_CDROUTPUT_H__ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#ifdef WITH_LIBCDR + +#include + +#include "../implementation/implementation.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { + +class CdrInput : public Inkscape::Extension::Implementation::Implementation { + CdrInput () { }; +public: + SPDocument *open( Inkscape::Extension::Input *mod, + const gchar *uri ); + static void init( void ); + +}; + +} } } /* namespace Inkscape, Extension, Implementation */ + +#endif /* WITH_LIBCDR */ +#endif /* __EXTENSION_INTERNAL_CDROUTPUT_H__ */ + + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : -- cgit v1.2.3 From e31fe651573dd617dd27e146c9864d613c7cc904 Mon Sep 17 00:00:00 2001 From: su_v Date: Fri, 25 Jan 2013 11:17:25 +0100 Subject: libcdr: lower min version to 0.0.8, keep fallback input extensions for UC-based import (renamed, new id) (internal extension has priority over script-based ones for same mime-type) (bzr r12059.1.2) --- configure.ac | 2 +- share/extensions/Makefile.am | 7 ++++--- share/extensions/ccx_input-uniconv.inx | 15 +++++++++++++++ share/extensions/ccx_input.inx | 15 --------------- share/extensions/cdr_input-uniconv.inx | 17 +++++++++++++++++ share/extensions/cdt_input-uniconv.inx | 15 +++++++++++++++ share/extensions/cdt_input.inx | 15 --------------- share/extensions/cmx_input-uniconv.inx | 15 +++++++++++++++ share/extensions/cmx_input.inx | 15 --------------- 9 files changed, 67 insertions(+), 49 deletions(-) create mode 100644 share/extensions/ccx_input-uniconv.inx delete mode 100644 share/extensions/ccx_input.inx create mode 100644 share/extensions/cdr_input-uniconv.inx create mode 100644 share/extensions/cdt_input-uniconv.inx delete mode 100644 share/extensions/cdt_input.inx create mode 100644 share/extensions/cmx_input-uniconv.inx delete mode 100644 share/extensions/cmx_input.inx diff --git a/configure.ac b/configure.ac index 62d8ff11f..b62663fb2 100644 --- a/configure.ac +++ b/configure.ac @@ -717,7 +717,7 @@ AC_ARG_ENABLE(wpg, with_libcdr=no if test "x$enable_cdr" = "xyes"; then - PKG_CHECK_MODULES(LIBCDR, libcdr-0.0 >= 0.0.9 libwpd-0.9 libwpd-stream-0.9 libwpg-0.2, with_libcdr=yes, with_libcdr=no) + PKG_CHECK_MODULES(LIBCDR, libcdr-0.0 >= 0.0.8 libwpd-0.9 libwpd-stream-0.9 libwpg-0.2, with_libcdr=yes, with_libcdr=no) if test "x$with_libcdr" = "xyes"; then AC_DEFINE(WITH_LIBCDR,1,[Build in libcdr]) diff --git a/share/extensions/Makefile.am b/share/extensions/Makefile.am index 63a9d143c..5770d79e7 100644 --- a/share/extensions/Makefile.am +++ b/share/extensions/Makefile.am @@ -195,10 +195,11 @@ modules = \ addnodes.inx \ ai_input.inx \ aisvg.inx \ - ccx_input.inx \ - cdt_input.inx \ + ccx_input-uniconv.inx \ + cdr_input-uniconv.inx \ + cdt_input-uniconv.inx \ cgm_input.inx \ - cmx_input.inx \ + cmx_input-uniconv.inx \ color_blackandwhite.inx\ color_brighter.inx\ color_custom.inx \ diff --git a/share/extensions/ccx_input-uniconv.inx b/share/extensions/ccx_input-uniconv.inx new file mode 100644 index 000000000..040a2891a --- /dev/null +++ b/share/extensions/ccx_input-uniconv.inx @@ -0,0 +1,15 @@ + + + <_name>Corel DRAW Compressed Exchange files input (UC) + org.inkscape.input.ccx.uniconvertor + uniconv-ext.py + + .ccx + application/x-xccx + <_filetypename>Corel DRAW Compressed Exchange files (UC) (.ccx) + <_filetypetooltip>Open compressed exchange files saved in Corel DRAW (UC) + + + diff --git a/share/extensions/ccx_input.inx b/share/extensions/ccx_input.inx deleted file mode 100644 index 4dcd43b8e..000000000 --- a/share/extensions/ccx_input.inx +++ /dev/null @@ -1,15 +0,0 @@ - - - <_name>Corel DRAW Compressed Exchange files input - org.inkscape.input.ccx - uniconv-ext.py - - .ccx - application/x-xccx - <_filetypename>Corel DRAW Compressed Exchange files (.ccx) - <_filetypetooltip>Open compressed exchange files saved in Corel DRAW - - - diff --git a/share/extensions/cdr_input-uniconv.inx b/share/extensions/cdr_input-uniconv.inx new file mode 100644 index 000000000..6fd7f90ab --- /dev/null +++ b/share/extensions/cdr_input-uniconv.inx @@ -0,0 +1,17 @@ + + + <_name>Corel DRAW Input (UC) + org.inkscape.input.cdr.uniconvertor + + uniconv-ext.py + + .cdr + image/x-xcdr + <_filetypename>Corel DRAW 7-X4 files (UC) (*.cdr) + <_filetypetooltip>Open files saved in Corel DRAW 7-X4 (UC) + org.inkscape.output.cdr + + + diff --git a/share/extensions/cdt_input-uniconv.inx b/share/extensions/cdt_input-uniconv.inx new file mode 100644 index 000000000..78d5c6a97 --- /dev/null +++ b/share/extensions/cdt_input-uniconv.inx @@ -0,0 +1,15 @@ + + + <_name>Corel DRAW templates input (UC) + org.inkscape.input.cdt.uniconvertor + uniconv-ext.py + + .cdt + application/x-xcdt + <_filetypename>Corel DRAW 7-13 template files (UC) (.cdt) + <_filetypetooltip>Open files saved in Corel DRAW 7-13 (UC) + + + diff --git a/share/extensions/cdt_input.inx b/share/extensions/cdt_input.inx deleted file mode 100644 index 6bed364f6..000000000 --- a/share/extensions/cdt_input.inx +++ /dev/null @@ -1,15 +0,0 @@ - - - <_name>Corel DRAW templates input - org.inkscape.input.cdt - uniconv-ext.py - - .cdt - application/x-xcdt - <_filetypename>Corel DRAW 7-13 template files (.cdt) - <_filetypetooltip>Open files saved in Corel DRAW 7-13 - - - diff --git a/share/extensions/cmx_input-uniconv.inx b/share/extensions/cmx_input-uniconv.inx new file mode 100644 index 000000000..7840302d5 --- /dev/null +++ b/share/extensions/cmx_input-uniconv.inx @@ -0,0 +1,15 @@ + + + <_name>Corel DRAW Presentation Exchange files input (UC) + org.inkscape.input.cmx.uniconvertor + uniconv-ext.py + + .cmx + application/x-xcmx + <_filetypename>Corel DRAW Presentation Exchange files (UC) (.cmx) + <_filetypetooltip>Open presentation exchange files saved in Corel DRAW (UC) + + + diff --git a/share/extensions/cmx_input.inx b/share/extensions/cmx_input.inx deleted file mode 100644 index 96f84d6b2..000000000 --- a/share/extensions/cmx_input.inx +++ /dev/null @@ -1,15 +0,0 @@ - - - <_name>Corel DRAW Presentation Exchange files input - org.inkscape.input.cmx - uniconv-ext.py - - .cmx - application/x-xcmx - <_filetypename>Corel DRAW Presentation Exchange files (.cmx) - <_filetypetooltip>Open presentation exchange files saved in Corel DRAW - - - -- cgit v1.2.3 From 63d06228421acdd727ea76e4c3930ba80b04f833 Mon Sep 17 00:00:00 2001 From: su_v Date: Fri, 25 Jan 2013 12:23:00 +0100 Subject: libcdr: configure.ac - set earliest version to include CDRStringVector.h: 0.0.3 (bzr r12059.1.3) --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index b62663fb2..2bbd291e0 100644 --- a/configure.ac +++ b/configure.ac @@ -717,7 +717,7 @@ AC_ARG_ENABLE(wpg, with_libcdr=no if test "x$enable_cdr" = "xyes"; then - PKG_CHECK_MODULES(LIBCDR, libcdr-0.0 >= 0.0.8 libwpd-0.9 libwpd-stream-0.9 libwpg-0.2, with_libcdr=yes, with_libcdr=no) + PKG_CHECK_MODULES(LIBCDR, libcdr-0.0 >= 0.0.3 libwpd-0.9 libwpd-stream-0.9 libwpg-0.2, with_libcdr=yes, with_libcdr=no) if test "x$with_libcdr" = "xyes"; then AC_DEFINE(WITH_LIBCDR,1,[Build in libcdr]) -- cgit v1.2.3 From 7d0ffab9f60904f429176eec7a8196e3478bfebf Mon Sep 17 00:00:00 2001 From: su_v Date: Mon, 28 Jan 2013 17:07:35 +0100 Subject: libcdr: add remaining CorelDRAW formats (CDT, CCX, CMX) to internal support (bzr r12059.1.4) --- src/extension/internal/cdr-input.cpp | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/extension/internal/cdr-input.cpp b/src/extension/internal/cdr-input.cpp index 63531d082..8abf772b8 100644 --- a/src/extension/internal/cdr-input.cpp +++ b/src/extension/internal/cdr-input.cpp @@ -274,6 +274,45 @@ void CdrInput::init(void) "\n" "", new CdrInput()); + /* CDT */ + Inkscape::Extension::build_from_mem( + "\n" + "" N_("Corel DRAW templates input") "\n" + "org.inkscape.input.cdt\n" + "\n" + ".cdt\n" + "application/x-xcdt\n" + "" N_("Corel DRAW 7-13 template files (*.cdt)") "\n" + "" N_("Open files saved in Corel DRAW 7-13") "\n" + "\n" + "", new CdrInput()); + + /* CCX */ + Inkscape::Extension::build_from_mem( + "\n" + "" N_("Corel DRAW Compressed Exchange files input") "\n" + "org.inkscape.input.ccx\n" + "\n" + ".ccx\n" + "application/x-xccx\n" + "" N_("Corel DRAW Compressed Exchange files (*.ccx)") "\n" + "" N_("Open compressed exchange files saved in Corel DRAW") "\n" + "\n" + "", new CdrInput()); + + /* CMX */ + Inkscape::Extension::build_from_mem( + "\n" + "" N_("Corel DRAW Presentation Exchange files input") "\n" + "org.inkscape.input.cmx\n" + "\n" + ".cmx\n" + "application/x-xcmx\n" + "" N_("Corel DRAW Presentation Exchange files (*.cmx)") "\n" + "" N_("Open presentation exchange files saved in Corel DRAW") "\n" + "\n" + "", new CdrInput()); + return; } // init -- cgit v1.2.3 From 6530e43c5e80f0cf723d96ab47407d39bbdc8aef Mon Sep 17 00:00:00 2001 From: su_v Date: Thu, 31 Jan 2013 16:40:36 +0100 Subject: Revert change of file names of the UC-based input extensions (changing the ID and name tags is sufficiant, keeping the old names prevents any issues with left-behind duplicates in the install dir of a trunk build) (bzr r12059.1.5) --- share/extensions/ccx_input-uniconv.inx | 15 --------------- share/extensions/ccx_input.inx | 15 +++++++++++++++ share/extensions/cdr_input-uniconv.inx | 17 ----------------- share/extensions/cdr_input.inx | 17 +++++++++++++++++ share/extensions/cdt_input-uniconv.inx | 15 --------------- share/extensions/cdt_input.inx | 15 +++++++++++++++ share/extensions/cmx_input-uniconv.inx | 15 --------------- share/extensions/cmx_input.inx | 15 +++++++++++++++ 8 files changed, 62 insertions(+), 62 deletions(-) delete mode 100644 share/extensions/ccx_input-uniconv.inx create mode 100644 share/extensions/ccx_input.inx delete mode 100644 share/extensions/cdr_input-uniconv.inx create mode 100644 share/extensions/cdr_input.inx delete mode 100644 share/extensions/cdt_input-uniconv.inx create mode 100644 share/extensions/cdt_input.inx delete mode 100644 share/extensions/cmx_input-uniconv.inx create mode 100644 share/extensions/cmx_input.inx diff --git a/share/extensions/ccx_input-uniconv.inx b/share/extensions/ccx_input-uniconv.inx deleted file mode 100644 index 040a2891a..000000000 --- a/share/extensions/ccx_input-uniconv.inx +++ /dev/null @@ -1,15 +0,0 @@ - - - <_name>Corel DRAW Compressed Exchange files input (UC) - org.inkscape.input.ccx.uniconvertor - uniconv-ext.py - - .ccx - application/x-xccx - <_filetypename>Corel DRAW Compressed Exchange files (UC) (.ccx) - <_filetypetooltip>Open compressed exchange files saved in Corel DRAW (UC) - - - diff --git a/share/extensions/ccx_input.inx b/share/extensions/ccx_input.inx new file mode 100644 index 000000000..040a2891a --- /dev/null +++ b/share/extensions/ccx_input.inx @@ -0,0 +1,15 @@ + + + <_name>Corel DRAW Compressed Exchange files input (UC) + org.inkscape.input.ccx.uniconvertor + uniconv-ext.py + + .ccx + application/x-xccx + <_filetypename>Corel DRAW Compressed Exchange files (UC) (.ccx) + <_filetypetooltip>Open compressed exchange files saved in Corel DRAW (UC) + + + diff --git a/share/extensions/cdr_input-uniconv.inx b/share/extensions/cdr_input-uniconv.inx deleted file mode 100644 index 6fd7f90ab..000000000 --- a/share/extensions/cdr_input-uniconv.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>Corel DRAW Input (UC) - org.inkscape.input.cdr.uniconvertor - - uniconv-ext.py - - .cdr - image/x-xcdr - <_filetypename>Corel DRAW 7-X4 files (UC) (*.cdr) - <_filetypetooltip>Open files saved in Corel DRAW 7-X4 (UC) - org.inkscape.output.cdr - - - diff --git a/share/extensions/cdr_input.inx b/share/extensions/cdr_input.inx new file mode 100644 index 000000000..6fd7f90ab --- /dev/null +++ b/share/extensions/cdr_input.inx @@ -0,0 +1,17 @@ + + + <_name>Corel DRAW Input (UC) + org.inkscape.input.cdr.uniconvertor + + uniconv-ext.py + + .cdr + image/x-xcdr + <_filetypename>Corel DRAW 7-X4 files (UC) (*.cdr) + <_filetypetooltip>Open files saved in Corel DRAW 7-X4 (UC) + org.inkscape.output.cdr + + + diff --git a/share/extensions/cdt_input-uniconv.inx b/share/extensions/cdt_input-uniconv.inx deleted file mode 100644 index 78d5c6a97..000000000 --- a/share/extensions/cdt_input-uniconv.inx +++ /dev/null @@ -1,15 +0,0 @@ - - - <_name>Corel DRAW templates input (UC) - org.inkscape.input.cdt.uniconvertor - uniconv-ext.py - - .cdt - application/x-xcdt - <_filetypename>Corel DRAW 7-13 template files (UC) (.cdt) - <_filetypetooltip>Open files saved in Corel DRAW 7-13 (UC) - - - diff --git a/share/extensions/cdt_input.inx b/share/extensions/cdt_input.inx new file mode 100644 index 000000000..78d5c6a97 --- /dev/null +++ b/share/extensions/cdt_input.inx @@ -0,0 +1,15 @@ + + + <_name>Corel DRAW templates input (UC) + org.inkscape.input.cdt.uniconvertor + uniconv-ext.py + + .cdt + application/x-xcdt + <_filetypename>Corel DRAW 7-13 template files (UC) (.cdt) + <_filetypetooltip>Open files saved in Corel DRAW 7-13 (UC) + + + diff --git a/share/extensions/cmx_input-uniconv.inx b/share/extensions/cmx_input-uniconv.inx deleted file mode 100644 index 7840302d5..000000000 --- a/share/extensions/cmx_input-uniconv.inx +++ /dev/null @@ -1,15 +0,0 @@ - - - <_name>Corel DRAW Presentation Exchange files input (UC) - org.inkscape.input.cmx.uniconvertor - uniconv-ext.py - - .cmx - application/x-xcmx - <_filetypename>Corel DRAW Presentation Exchange files (UC) (.cmx) - <_filetypetooltip>Open presentation exchange files saved in Corel DRAW (UC) - - - diff --git a/share/extensions/cmx_input.inx b/share/extensions/cmx_input.inx new file mode 100644 index 000000000..7840302d5 --- /dev/null +++ b/share/extensions/cmx_input.inx @@ -0,0 +1,15 @@ + + + <_name>Corel DRAW Presentation Exchange files input (UC) + org.inkscape.input.cmx.uniconvertor + uniconv-ext.py + + .cmx + application/x-xcmx + <_filetypename>Corel DRAW Presentation Exchange files (UC) (.cmx) + <_filetypetooltip>Open presentation exchange files saved in Corel DRAW (UC) + + + -- cgit v1.2.3 From 6a49b7d48cbd8d5a8795445a1bd8b3230c87bfbc Mon Sep 17 00:00:00 2001 From: su_v Date: Fri, 1 Feb 2013 13:29:49 +0100 Subject: Revert renaming in 'share/extensions/Makefile.am' too (bzr r12059.1.6) --- share/extensions/Makefile.am | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/extensions/Makefile.am b/share/extensions/Makefile.am index 5770d79e7..ee6bd0ea3 100644 --- a/share/extensions/Makefile.am +++ b/share/extensions/Makefile.am @@ -195,11 +195,11 @@ modules = \ addnodes.inx \ ai_input.inx \ aisvg.inx \ - ccx_input-uniconv.inx \ - cdr_input-uniconv.inx \ - cdt_input-uniconv.inx \ + ccx_input.inx \ + cdr_input.inx \ + cdt_input.inx \ cgm_input.inx \ - cmx_input-uniconv.inx \ + cmx_input.inx \ color_blackandwhite.inx\ color_brighter.inx\ color_custom.inx \ -- cgit v1.2.3 From 371a87c6c93385b996261f15901f66bb2c195b9e Mon Sep 17 00:00:00 2001 From: su_v Date: Fri, 1 Feb 2013 13:41:12 +0100 Subject: libcdr, libvisio: fix compiler warnings (comparison between signed and unsigned integer expressions) (bzr r12059.1.7) --- src/extension/internal/cdr-input.cpp | 4 ++-- src/extension/internal/vsd-input.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/extension/internal/cdr-input.cpp b/src/extension/internal/cdr-input.cpp index 8abf772b8..e6c400fb5 100644 --- a/src/extension/internal/cdr-input.cpp +++ b/src/extension/internal/cdr-input.cpp @@ -185,8 +185,8 @@ unsigned CdrImportDialog::getSelectedPage() void CdrImportDialog::_onPageNumberChanged() { - int page = _pageNumberSpin->get_value_as_int(); - _current_page = CLAMP(page, 1, _vec.size()); + unsigned page = static_cast(_pageNumberSpin->get_value_as_int()); + _current_page = CLAMP(page, 1U, _vec.size()); _setPreviewPage(_current_page); } diff --git a/src/extension/internal/vsd-input.cpp b/src/extension/internal/vsd-input.cpp index 187318417..12e5150cb 100644 --- a/src/extension/internal/vsd-input.cpp +++ b/src/extension/internal/vsd-input.cpp @@ -185,8 +185,8 @@ unsigned VsdImportDialog::getSelectedPage() void VsdImportDialog::_onPageNumberChanged() { - int page = _pageNumberSpin->get_value_as_int(); - _current_page = CLAMP(page, 1, _vec.size()); + unsigned page = static_cast(_pageNumberSpin->get_value_as_int()); + _current_page = CLAMP(page, 1U, _vec.size()); _setPreviewPage(_current_page); } -- cgit v1.2.3