summaryrefslogtreecommitdiffstats
path: root/src/extension
diff options
context:
space:
mode:
authorLiam P. White <inkscapebrony@gmail.com>2014-08-31 18:59:47 +0000
committerLiam P. White <inkscapebrony@gmail.com>2014-08-31 18:59:47 +0000
commit6a306cf8edbaebacbe679a58f6b162657caf5ad0 (patch)
treef043ce64170b0ab7ada1712efb8e38a3fbe5681a /src/extension
parentUpdate to experimental r13483 (diff)
parentHeader cleanup: stop using Glib types where they aren't truly needed. Eases G... (diff)
downloadinkscape-6a306cf8edbaebacbe679a58f6b162657caf5ad0.tar.gz
inkscape-6a306cf8edbaebacbe679a58f6b162657caf5ad0.zip
Update to experimental r13531
(bzr r13090.1.106)
Diffstat (limited to 'src/extension')
-rw-r--r--src/extension/implementation/script.cpp44
-rw-r--r--src/extension/implementation/script.h80
-rw-r--r--src/extension/input.h5
-rw-r--r--src/extension/internal/cairo-render-context.h3
-rw-r--r--src/extension/internal/cairo-renderer.cpp12
-rw-r--r--src/extension/internal/cdr-input.cpp6
-rw-r--r--src/extension/internal/emf-inout.cpp2
-rw-r--r--src/extension/internal/gdkpixbuf-input.cpp13
-rw-r--r--src/extension/internal/gdkpixbuf-input.h2
-rw-r--r--src/extension/internal/vsd-input.cpp6
-rw-r--r--src/extension/internal/wmf-inout.cpp1
-rw-r--r--src/extension/output.h1
12 files changed, 58 insertions, 117 deletions
diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp
index f0fd3711b..70a2ca672 100644
--- a/src/extension/implementation/script.cpp
+++ b/src/extension/implementation/script.cpp
@@ -1,28 +1,18 @@
-/** \file
- * Code for handling extensions (i.e.\ scripts).
- */
-/*
+/**
+ * Code for handling extensions (i.e. scripts).
+ *
* Authors:
* Bryce Harrington <bryce@osdl.org>
* Ted Gould <ted@gould.cx>
* Jon A. Cruz <jon@joncruz.org>
* Abhishek Sharma
*
- * Copyright (C) 2002-2005,2007 Authors
+ * Copyright (C) 2002-2007 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#define __INKSCAPE_EXTENSION_IMPLEMENTATION_SCRIPT_C__
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
-#include <glibmm/threads.h>
-#endif
-
+#include <glibmm.h>
#include <gtkmm/messagedialog.h>
#include <gtkmm/main.h>
#include <gtkmm/scrolledwindow.h>
@@ -32,44 +22,38 @@
#include <unistd.h>
#include <errno.h>
-#include <glib.h>
#include <glib/gstdio.h>
-#include "ui/view/view.h"
#include "desktop-handles.h"
#include "desktop.h"
-#include "selection.h"
-#include "sp-namedview.h"
-#include "io/sys.h"
-#include "preferences.h"
-#include "../system.h"
+#include "dialogs/dialog-events.h"
#include "extension/effect.h"
#include "extension/output.h"
#include "extension/input.h"
#include "extension/db.h"
-#include "script.h"
-#include "dialogs/dialog-events.h"
#include "inkscape.h"
+#include "io/sys.h"
+#include "preferences.h"
+#include "script.h"
+#include "selection.h"
+#include "sp-namedview.h"
+#include "extension/system.h"
+#include "ui/view/view.h"
#include "xml/node.h"
#include "xml/attribute-record.h"
#include "util/glib-list-iterators.h"
#include "path-prefix.h"
-
#ifdef WIN32
#include <windows.h>
#include <sys/stat.h>
#include "registrytool.h"
#endif
-
-
/** This is the command buffer that gets allocated from the stack */
#define BUFSIZE (255)
-
-
/* Namespaces */
namespace Inkscape {
namespace Extension {
@@ -1063,4 +1047,4 @@ int Script::execute (const std::list<std::string> &in_command,
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8 :
diff --git a/src/extension/implementation/script.h b/src/extension/implementation/script.h
index 270c361af..6a7d0c3b8 100644
--- a/src/extension/implementation/script.h
+++ b/src/extension/implementation/script.h
@@ -22,81 +22,30 @@
namespace Inkscape {
namespace XML {
class Node;
-}
-}
+} // namespace XML
-
-namespace Inkscape {
namespace Extension {
namespace Implementation {
-
/**
* Utility class used for loading and launching script extensions
*/
class Script : public Implementation {
-
public:
- /**
- *
- */
Script(void);
-
- /**
- *
- */
virtual ~Script();
-
-
- /**
- *
- */
virtual bool load(Inkscape::Extension::Extension *module);
-
- /**
- *
- */
virtual void unload(Inkscape::Extension::Extension *module);
-
- /**
- *
- */
virtual bool check(Inkscape::Extension::Extension *module);
ImplementationDocumentCache * newDocCache(Inkscape::Extension::Extension * ext, Inkscape::UI::View::View * view);
- /**
- *
- */
- virtual Gtk::Widget *prefs_input(Inkscape::Extension::Input *module,
- gchar const *filename);
-
- /**
- *
- */
- virtual SPDocument *open(Inkscape::Extension::Input *module,
- gchar const *filename);
-
- /**
- *
- */
+ virtual Gtk::Widget *prefs_input(Inkscape::Extension::Input *module, gchar const *filename);
+ virtual SPDocument *open(Inkscape::Extension::Input *module, gchar const *filename);
virtual Gtk::Widget *prefs_output(Inkscape::Extension::Output *module);
-
- /**
- *
- */
- virtual void save(Inkscape::Extension::Output *module,
- SPDocument *doc,
- gchar const *filename);
-
- /**
- *
- */
- virtual void effect(Inkscape::Extension::Effect *module,
- Inkscape::UI::View::View *doc,
- ImplementationDocumentCache * docCache);
-
+ virtual void save(Inkscape::Extension::Output *module, SPDocument *doc, gchar const *filename);
+ virtual void effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View *doc, ImplementationDocumentCache * docCache);
virtual bool cancelProcessing (void);
private:
@@ -105,7 +54,7 @@ private:
Glib::RefPtr<Glib::MainLoop> _main_loop;
/**
- * The command that has been dirived from
+ * The command that has been derived from
* the configuration file with appropriate directories
*/
std::list<std::string> command;
@@ -117,13 +66,10 @@ private:
*/
Glib::ustring helper_extension;
- std::string solve_reldir (Inkscape::XML::Node *reprin);
- bool check_existence (const std::string &command);
- void copy_doc (Inkscape::XML::Node * olddoc,
- Inkscape::XML::Node * newdoc);
- void checkStderr (const Glib::ustring &filename,
- Gtk::MessageType type,
- const Glib::ustring &message);
+ std::string solve_reldir(Inkscape::XML::Node *repr_in);
+ bool check_existence (std::string const& command);
+ void copy_doc(Inkscape::XML::Node * olddoc, Inkscape::XML::Node * newdoc);
+ void checkStderr (Glib::ustring const& filename, Gtk::MessageType type, Glib::ustring const& message);
class file_listener {
Glib::ustring _string;
@@ -140,6 +86,7 @@ private:
bool isDead () { return _dead; }
+ // TODO move these definitions into script.cpp
void init (int fd, Glib::RefPtr<Glib::MainLoop> main) {
_channel = Glib::IOChannel::create_from_fd(fd);
_channel->set_encoding();
@@ -202,11 +149,6 @@ private:
std::string resolveInterpreterExecutable(const Glib::ustring &interpNameArg);
}; // class Script
-
-
-
-
-
} // namespace Implementation
} // namespace Extension
} // namespace Inkscape
diff --git a/src/extension/input.h b/src/extension/input.h
index b01ffeb86..2a0a177a0 100644
--- a/src/extension/input.h
+++ b/src/extension/input.h
@@ -14,9 +14,8 @@
#include <exception>
#include <glib.h>
#include "extension.h"
-#include "xml/repr.h"
-#include "document.h"
-#include <gtk/gtk.h>
+
+class SPDocument;
namespace Inkscape {
namespace Extension {
diff --git a/src/extension/internal/cairo-render-context.h b/src/extension/internal/cairo-render-context.h
index 8d3e63775..8071cae36 100644
--- a/src/extension/internal/cairo-render-context.h
+++ b/src/extension/internal/cairo-render-context.h
@@ -31,6 +31,9 @@
class SPClipPath;
class SPMask;
+typedef struct _PangoFont PangoFont;
+typedef struct _PangoLayout PangoLayout;
+
namespace Inkscape {
class Pixbuf;
diff --git a/src/extension/internal/cairo-renderer.cpp b/src/extension/internal/cairo-renderer.cpp
index 6fbc85c05..0fec68c06 100644
--- a/src/extension/internal/cairo-renderer.cpp
+++ b/src/extension/internal/cairo-renderer.cpp
@@ -202,8 +202,10 @@ static void sp_shape_render (SPItem *item, CairoRenderContext *ctx)
if ( shape->_marker[i] ) {
SPMarker* marker = SP_MARKER (shape->_marker[i]);
Geom::Affine tr;
- if (marker->orient_auto) {
+ if (marker->orient_mode == MARKER_ORIENT_AUTO) {
tr = sp_shape_marker_get_transform_at_start(pathv.begin()->front());
+ } else if (marker->orient_mode == MARKER_ORIENT_AUTO_START_REVERSE) {
+ tr = Geom::Rotate::from_degrees( 180.0 ) * sp_shape_marker_get_transform_at_start(pathv.begin()->front());
} else {
tr = Geom::Rotate::from_degrees(marker->orient) * Geom::Translate(pathv.begin()->front().pointAt(0));
}
@@ -220,7 +222,7 @@ static void sp_shape_render (SPItem *item, CairoRenderContext *ctx)
&& ! ((path_it == (pathv.end()-1)) && (path_it->size_default() == 0)) ) // if this is the last path and it is a moveto-only, there is no mid marker there
{
Geom::Affine tr;
- if (marker->orient_auto) {
+ if (marker->orient_mode != MARKER_ORIENT_ANGLE) {
tr = sp_shape_marker_get_transform_at_start(path_it->front());
} else {
tr = Geom::Rotate::from_degrees(marker->orient) * Geom::Translate(path_it->front().pointAt(0));
@@ -237,7 +239,7 @@ static void sp_shape_render (SPItem *item, CairoRenderContext *ctx)
* Loop to end_default (so including closing segment), because when a path is closed,
* there should be a midpoint marker between last segment and closing straight line segment */
Geom::Affine tr;
- if (marker->orient_auto) {
+ if (marker->orient_mode != MARKER_ORIENT_ANGLE) {
tr = sp_shape_marker_get_transform(*curve_it1, *curve_it2);
} else {
tr = Geom::Rotate::from_degrees(marker->orient) * Geom::Translate(curve_it1->pointAt(1));
@@ -253,7 +255,7 @@ static void sp_shape_render (SPItem *item, CairoRenderContext *ctx)
if ( path_it != (pathv.end()-1) && !path_it->empty()) {
Geom::Curve const &lastcurve = path_it->back_default();
Geom::Affine tr;
- if (marker->orient_auto) {
+ if (marker->orient_mode != MARKER_ORIENT_ANGLE) {
tr = sp_shape_marker_get_transform_at_end(lastcurve);
} else {
tr = Geom::Rotate::from_degrees(marker->orient) * Geom::Translate(lastcurve.pointAt(1));
@@ -277,7 +279,7 @@ static void sp_shape_render (SPItem *item, CairoRenderContext *ctx)
Geom::Curve const &lastcurve = path_last[index];
Geom::Affine tr;
- if (marker->orient_auto) {
+ if (marker->orient_mode != MARKER_ORIENT_ANGLE) {
tr = sp_shape_marker_get_transform_at_end(lastcurve);
} else {
tr = Geom::Rotate::from_degrees(marker->orient) * Geom::Translate(lastcurve.pointAt(1));
diff --git a/src/extension/internal/cdr-input.cpp b/src/extension/internal/cdr-input.cpp
index 0111ed626..b8f429a87 100644
--- a/src/extension/internal/cdr-input.cpp
+++ b/src/extension/internal/cdr-input.cpp
@@ -139,9 +139,15 @@ CdrImportDialog::CdrImportDialog(const std::vector<WPXString> &vec)
_labelTotalPages->set_use_markup(false);
_labelTotalPages->set_selectable(false);
vbox2->pack_start(*_previewArea, Gtk::PACK_SHRINK, 0);
+#if WITH_GTKMM_3_0
+ this->get_content_area()->set_homogeneous(false);
+ this->get_content_area()->set_spacing(0);
+ this->get_content_area()->pack_start(*vbox2);
+#else
this->get_vbox()->set_homogeneous(false);
this->get_vbox()->set_spacing(0);
this->get_vbox()->pack_start(*vbox2);
+#endif
this->set_title(_("Page Selector"));
this->set_modal(true);
sp_transientize(GTK_WIDGET(this->gobj())); //Make transient
diff --git a/src/extension/internal/emf-inout.cpp b/src/extension/internal/emf-inout.cpp
index 084fbcd58..9a5a78a34 100644
--- a/src/extension/internal/emf-inout.cpp
+++ b/src/extension/internal/emf-inout.cpp
@@ -27,12 +27,12 @@
# include "config.h"
#endif
-//#include <png.h> //This must precede text_reassemble.h or it blows up in pngconf.h when compiling
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <libuemf/symbol_convert.h>
+#include "document.h"
#include "sp-root.h" // even though it is included indirectly by wmf-inout.h
#include "sp-path.h"
#include "print.h"
diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp
index da179bee0..28e44c461 100644
--- a/src/extension/internal/gdkpixbuf-input.cpp
+++ b/src/extension/internal/gdkpixbuf-input.cpp
@@ -1,21 +1,20 @@
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <gdk-pixbuf/gdk-pixbuf.h>
+
#include <boost/scoped_ptr.hpp>
#include <glib/gprintf.h>
#include <glibmm/i18n.h>
+#include "dir-util.h"
+#include "display/cairo-utils.h"
#include "document-private.h"
-#include <dir-util.h>
+#include "document-undo.h"
#include "extension/input.h"
#include "extension/system.h"
+#include "image-resolution.h"
#include "gdkpixbuf-input.h"
#include "preferences.h"
#include "selection-chemistry.h"
#include "sp-image.h"
-#include "document-undo.h"
#include "util/units.h"
-#include "image-resolution.h"
-#include "display/cairo-utils.h"
#include <set>
namespace Inkscape {
diff --git a/src/extension/internal/gdkpixbuf-input.h b/src/extension/internal/gdkpixbuf-input.h
index 597e7246b..2e03a96db 100644
--- a/src/extension/internal/gdkpixbuf-input.h
+++ b/src/extension/internal/gdkpixbuf-input.h
@@ -10,7 +10,7 @@ namespace Internal {
class GdkpixbufInput : Inkscape::Extension::Implementation::Implementation {
public:
SPDocument *open(Inkscape::Extension::Input *mod,
- gchar const *uri);
+ char const *uri);
static void init();
};
diff --git a/src/extension/internal/vsd-input.cpp b/src/extension/internal/vsd-input.cpp
index 6fc79237b..83bfb5a92 100644
--- a/src/extension/internal/vsd-input.cpp
+++ b/src/extension/internal/vsd-input.cpp
@@ -138,9 +138,15 @@ VsdImportDialog::VsdImportDialog(const std::vector<WPXString> &vec)
_labelTotalPages->set_use_markup(false);
_labelTotalPages->set_selectable(false);
vbox2->pack_start(*_previewArea, Gtk::PACK_SHRINK, 0);
+#if WITH_GTKMM_3_0
+ this->get_content_area()->set_homogeneous(false);
+ this->get_content_area()->set_spacing(0);
+ this->get_content_area()->pack_start(*vbox2);
+#else
this->get_vbox()->set_homogeneous(false);
this->get_vbox()->set_spacing(0);
this->get_vbox()->pack_start(*vbox2);
+#endif
this->set_title(_("Page Selector"));
this->set_modal(true);
sp_transientize(GTK_WIDGET(this->gobj())); //Make transient
diff --git a/src/extension/internal/wmf-inout.cpp b/src/extension/internal/wmf-inout.cpp
index 5ccad678a..c03e7efe0 100644
--- a/src/extension/internal/wmf-inout.cpp
+++ b/src/extension/internal/wmf-inout.cpp
@@ -33,6 +33,7 @@
#include <stdint.h>
#include <libuemf/symbol_convert.h>
+#include "document.h"
#include "sp-root.h" // even though it is included indirectly by wmf-inout.h
#include "sp-path.h"
#include "print.h"
diff --git a/src/extension/output.h b/src/extension/output.h
index c5b1beb45..44a731ca0 100644
--- a/src/extension/output.h
+++ b/src/extension/output.h
@@ -13,7 +13,6 @@
#ifndef INKSCAPE_EXTENSION_OUTPUT_H__
#define INKSCAPE_EXTENSION_OUTPUT_H__
-#include <gtk/gtk.h>
#include "extension.h"
class SPDocument;