summaryrefslogtreecommitdiffstats
path: root/src/extension
diff options
context:
space:
mode:
authorDenis Declara <declara91@gmail.com>2012-04-15 12:29:45 +0000
committerDenis Declara <declara91@gmail.com>2012-04-15 12:29:45 +0000
commit6b5ff661a46ea1779c86f6947006c5ed32926117 (patch)
treea5b170f0830854e99ad065055ee2a3996933e614 /src/extension
parentImproved User interface. (diff)
parenti18n. Fix for Bug #980518 (Please use c-format). (diff)
downloadinkscape-6b5ff661a46ea1779c86f6947006c5ed32926117.tar.gz
inkscape-6b5ff661a46ea1779c86f6947006c5ed32926117.zip
Trunk merge
(bzr r11073.1.15)
Diffstat (limited to 'src/extension')
-rw-r--r--src/extension/dbus/document-interface.cpp3
-rw-r--r--src/extension/dxf2svg/test_dxf.cpp4
-rw-r--r--src/extension/internal/cairo-renderer.cpp2
-rw-r--r--src/extension/internal/javafx-out.cpp15
-rw-r--r--src/extension/internal/pdf-input-cairo.cpp14
-rw-r--r--src/extension/internal/pdfinput/pdf-input.cpp17
-rw-r--r--src/extension/internal/pdfinput/pdf-parser.cpp3
-rw-r--r--src/extension/param/bool.cpp5
-rw-r--r--src/extension/script/InkscapeScript.cpp12
9 files changed, 35 insertions, 40 deletions
diff --git a/src/extension/dbus/document-interface.cpp b/src/extension/dbus/document-interface.cpp
index dc1c8402d..c67234b34 100644
--- a/src/extension/dbus/document-interface.cpp
+++ b/src/extension/dbus/document-interface.cpp
@@ -15,6 +15,7 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#include "file.h" //IO
#include "document-interface.h"
#include <string.h>
#include <dbus/dbus-glib.h>
@@ -39,8 +40,6 @@
#include "sp-root.h"
#include "style.h" //style_write
-#include "file.h" //IO
-
#include "extension/system.h" //IO
#include "extension/output.h" //IO
diff --git a/src/extension/dxf2svg/test_dxf.cpp b/src/extension/dxf2svg/test_dxf.cpp
index 62969ca6e..c3bbdc141 100644
--- a/src/extension/dxf2svg/test_dxf.cpp
+++ b/src/extension/dxf2svg/test_dxf.cpp
@@ -80,7 +80,7 @@ int main(){
ents.display_all();
//char units[5] = "in";
- char units[5] = "";
+ // char units[5] = "";
cout << "\nNow for the begining of the SVG...\n\n";
@@ -90,7 +90,7 @@ int main(){
//cout << "pline2pline\n" << pline2pline(ents.ret_plines()[0], units ) << endl;
//cout << "pline2path\n" << pline2path(ents.ret_plines()[0], units );
- char tmp_char[10000];
+ // char tmp_char[10000];
cout << "\nCircle conversion\n";
//cout << "circle2circle\n" << circle2circle(ents.ret_circles()[0], 3, units, tmp_char) << endl;
diff --git a/src/extension/internal/cairo-renderer.cpp b/src/extension/internal/cairo-renderer.cpp
index 61e943dba..09d69becb 100644
--- a/src/extension/internal/cairo-renderer.cpp
+++ b/src/extension/internal/cairo-renderer.cpp
@@ -507,7 +507,7 @@ static void sp_asbitmap_render(SPItem *item, CairoRenderContext *ctx)
// TODO this is stupid - we just converted to pixbuf format when generating the bitmap!
convert_pixbuf_normal_to_argb32(pb);
ctx->renderImage(pb, t, item->style);
- gdk_pixbuf_unref(pb);
+ g_object_unref(pb);
pb = 0;
}
g_slist_free (items);
diff --git a/src/extension/internal/javafx-out.cpp b/src/extension/internal/javafx-out.cpp
index 4cf6f3c4f..67c0fae66 100644
--- a/src/extension/internal/javafx-out.cpp
+++ b/src/extension/internal/javafx-out.cpp
@@ -130,21 +130,6 @@ static JavaFXOutput::String dstr(double d)
/**
- * Format a double as an integer
- */
-static JavaFXOutput::String istr(double d)
-{
- char dbuf[G_ASCII_DTOSTR_BUF_SIZE+1];
- g_ascii_formatd(dbuf, G_ASCII_DTOSTR_BUF_SIZE,
- "%.0f", (gdouble)d);
- JavaFXOutput::String s = dbuf;
- return s;
-}
-
-#define ISTR(d) (istr(d).c_str())
-
-
-/**
* Format an rgba() string
*/
static JavaFXOutput::String rgba(guint32 rgba)
diff --git a/src/extension/internal/pdf-input-cairo.cpp b/src/extension/internal/pdf-input-cairo.cpp
index bc76a30b5..36ef66713 100644
--- a/src/extension/internal/pdf-input-cairo.cpp
+++ b/src/extension/internal/pdf-input-cairo.cpp
@@ -32,6 +32,7 @@
#include <poppler/glib/poppler-page.h>
#include "ui/widget/spinbutton.h"
+#include <gdkmm/general.h>
namespace Inkscape {
namespace Extension {
@@ -482,9 +483,10 @@ bool PdfImportCairoDialog::_onExposePreview(GdkEventExpose */*event*/) {
if (!back_pixmap) {
return true;
}
- back_pixmap->draw_pixbuf(Glib::RefPtr<Gdk::GC>(), thumb, 0, 0, 0, 0,
- _thumb_width, _thumb_height,
- Gdk::RGB_DITHER_NONE, 0, 0);
+
+ Cairo::RefPtr<Cairo::Context> cr = back_pixmap->create_cairo_context();
+ Gdk::Cairo::set_source_pixbuf(cr, thumb, 0, 0);
+ cr->paint();
_previewArea->get_window()->set_back_pixmap(back_pixmap, false);
_previewArea->get_window()->clear();
}
@@ -493,9 +495,9 @@ bool PdfImportCairoDialog::_onExposePreview(GdkEventExpose */*event*/) {
if (_render_thumb) {
copy_cairo_surface_to_pixbuf(_cairo_surface, _thumb_data, thumb->gobj());
}
- _previewArea->get_window()->draw_pixbuf(Glib::RefPtr<Gdk::GC>(), thumb,
- 0, 0, 0, _render_thumb ? 0 : 20,
- -1, -1, Gdk::RGB_DITHER_NONE, 0, 0);
+ Cairo::RefPtr<Cairo::Context> cr = _previewArea->get_window()->create_cairo_context();
+ Gdk::Cairo::set_source_pixbuf(cr, thumb, 0, _render_thumb ? 0 : 20);
+ cr->paint();
return true;
}
diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
index ee091d54b..eff488c9d 100644
--- a/src/extension/internal/pdfinput/pdf-input.cpp
+++ b/src/extension/internal/pdfinput/pdf-input.cpp
@@ -51,6 +51,8 @@
#include "ui/widget/spinbutton.h"
#include <glibmm/i18n.h>
+#include <gdkmm/general.h>
+
namespace Inkscape {
namespace Extension {
namespace Internal {
@@ -513,10 +515,11 @@ bool PdfImportDialog::_onExposePreview(GdkEventExpose */*event*/) {
if (!back_pixmap) {
return true;
}
- back_pixmap->draw_pixbuf(Glib::RefPtr<Gdk::GC>(), thumb, 0, 0, 0, 0,
- _thumb_width, _thumb_height,
- Gdk::RGB_DITHER_NONE, 0, 0);
- _previewArea->get_window()->set_back_pixmap(back_pixmap, false);
+
+ Cairo::RefPtr<Cairo::Context> cr = back_pixmap->create_cairo_context();
+ Gdk::Cairo::set_source_pixbuf(cr, thumb, 0, 0);
+ cr->paint();
+ _previewArea->get_window()->set_back_pixmap(back_pixmap, false);
_previewArea->get_window()->clear();
}
#ifdef HAVE_POPPLER_CAIRO
@@ -525,10 +528,10 @@ bool PdfImportDialog::_onExposePreview(GdkEventExpose */*event*/) {
copy_cairo_surface_to_pixbuf(_cairo_surface, _thumb_data, thumb->gobj());
}
#endif
- _previewArea->get_window()->draw_pixbuf(Glib::RefPtr<Gdk::GC>(), thumb,
- 0, 0, 0, _render_thumb ? 0 : 20,
- -1, -1, Gdk::RGB_DITHER_NONE, 0, 0);
+ Cairo::RefPtr<Cairo::Context> cr = _previewArea->get_window()->create_cairo_context();
+ Gdk::Cairo::set_source_pixbuf(cr, thumb, 0, _render_thumb ? 0 : 20);
+ cr->paint();
return true;
}
diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
index 5347a85ac..5e8b005e2 100644
--- a/src/extension/internal/pdfinput/pdf-parser.cpp
+++ b/src/extension/internal/pdfinput/pdf-parser.cpp
@@ -3199,7 +3199,8 @@ void PdfParser::opMarkPoint(Object args[], int numArgs) {
void PdfParser::saveState() {
builder->saveState();
- state = state->save();
+// state = state->save(); // nasty hack to prevent GfxRadialShading from getting corrupted during copy operation
+ state->save(); // see LP Bug 919176 comment 8
clipHistory = clipHistory->save();
}
diff --git a/src/extension/param/bool.cpp b/src/extension/param/bool.cpp
index ef0a06222..f7c4e6c0c 100644
--- a/src/extension/param/bool.cpp
+++ b/src/extension/param/bool.cpp
@@ -129,7 +129,12 @@ Gtk::Widget *ParamBool::get_widget(SPDocument * doc, Inkscape::XML::Node * node,
return NULL;
}
+#if WITH_GTKMM_3_0
+ Gtk::Box * hbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 4));
+ hbox->set_homogeneous(false);
+#else
Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, 4));
+#endif
#if WITH_GTKMM_2_22
Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_START));
diff --git a/src/extension/script/InkscapeScript.cpp b/src/extension/script/InkscapeScript.cpp
index 9f8ebfbbb..02cd28fa5 100644
--- a/src/extension/script/InkscapeScript.cpp
+++ b/src/extension/script/InkscapeScript.cpp
@@ -67,9 +67,9 @@ InkscapeScript::~InkscapeScript()
* enumerated types in ScriptLanguage above.
*/
bool InkscapeScript::interpretScript(const Glib::ustring &script,
- Glib::ustring &output,
- Glib::ustring &error,
- ScriptLanguage language)
+ Glib::ustring & /*output*/,
+ Glib::ustring & /*error*/,
+ ScriptLanguage language)
{
const char *langname=NULL;
//if() instead of switch() lets us scope vars
@@ -135,9 +135,9 @@ bool InkscapeScript::interpretScript(const Glib::ustring &script,
* enumerated types in ScriptLanguage above.
*/
bool InkscapeScript::interpretFile(const Glib::ustring &fname,
- Glib::ustring &output,
- Glib::ustring &error,
- ScriptLanguage language)
+ Glib::ustring & /*output*/,
+ Glib::ustring & /*error*/,
+ ScriptLanguage language)
{
const char *langname=NULL;
//if() instead of switch() lets us scope vars