summaryrefslogtreecommitdiffstats
path: root/src/extension/internal/pdfinput
diff options
context:
space:
mode:
authorkamalpreetgrewal <grewalkamal005@gmail.com>2016-08-15 03:59:18 +0000
committerkamalpreetgrewal <grewalkamal005@gmail.com>2016-08-15 03:59:18 +0000
commit25a9ed4f38121eeb59cf15dbf19391aaef45bba3 (patch)
treee123aeae50d98a52e1ad4575b29bf3c199619e33 /src/extension/internal/pdfinput
parentSolve crash when deleting CSS property (diff)
parentinkview: Convert to ApplicationWindow (diff)
downloadinkscape-25a9ed4f38121eeb59cf15dbf19391aaef45bba3.tar.gz
inkscape-25a9ed4f38121eeb59cf15dbf19391aaef45bba3.zip
Merge changes from trunk
(bzr r14949.1.64)
Diffstat (limited to 'src/extension/internal/pdfinput')
-rw-r--r--src/extension/internal/pdfinput/pdf-input.cpp36
-rw-r--r--src/extension/internal/pdfinput/pdf-input.h15
2 files changed, 2 insertions, 49 deletions
diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
index c1940b16a..0c22fa399 100644
--- a/src/extension/internal/pdfinput/pdf-input.cpp
+++ b/src/extension/internal/pdfinput/pdf-input.cpp
@@ -39,10 +39,8 @@
#include <gtkmm/radiobutton.h>
#include <gtkmm/scale.h>
-#if WITH_GTKMM_3_0
#include <glibmm/convert.h>
#include <glibmm/miscutils.h>
-#endif
#include "extension/system.h"
#include "extension/input.h"
@@ -92,14 +90,8 @@ PdfImportDialog::PdfImportDialog(PDFDoc *doc, const gchar */*uri*/)
_labelSelect = Gtk::manage(new class Gtk::Label(_("Select page:")));
// Page number
-#if WITH_GTKMM_3_0
- Glib::RefPtr<Gtk::Adjustment> _pageNumberSpin_adj = Gtk::Adjustment::create(1, 1, _pdf_doc->getNumPages(), 1, 10, 0);
+ auto _pageNumberSpin_adj = Gtk::Adjustment::create(1, 1, _pdf_doc->getNumPages(), 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, _pdf_doc->getNumPages(), 1, 10, 0));
- _pageNumberSpin = Gtk::manage(new class Inkscape::UI::Widget::SpinButton(*_pageNumberSpin_adj, 1, 1));
-#endif
_labelTotalPages = Gtk::manage(new class Gtk::Label());
hbox2 = Gtk::manage(new class Gtk::HBox(false, 0));
// Disable the page selector when there's only one page
@@ -137,13 +129,8 @@ PdfImportDialog::PdfImportDialog(PDFDoc *doc, const gchar */*uri*/)
_labelViaInternal = Gtk::manage(new class Gtk::Label(_("Import via internal (Poppler derived) library. Text is stored as text but white space is missing. Meshes are converted to tiles, the number depends on the precision set below.")));
#endif
-#if WITH_GTKMM_3_0
_fallbackPrecisionSlider_adj = Gtk::Adjustment::create(2, 1, 256, 1, 10, 10);
_fallbackPrecisionSlider = Gtk::manage(new class Gtk::Scale(_fallbackPrecisionSlider_adj));
-#else
- _fallbackPrecisionSlider_adj = Gtk::manage(new class Gtk::Adjustment(2, 1, 256, 1, 10, 10));
- _fallbackPrecisionSlider = Gtk::manage(new class Gtk::HScale(*_fallbackPrecisionSlider_adj));
-#endif
_fallbackPrecisionSlider->set_value(2.0);
_labelPrecisionComment = Gtk::manage(new class Gtk::Label(_("rough")));
hbox6 = Gtk::manage(new class Gtk::HBox(false, 4));
@@ -278,15 +265,9 @@ PdfImportDialog::PdfImportDialog(PDFDoc *doc, const gchar */*uri*/)
hbox1->pack_start(*vbox1);
hbox1->pack_start(*_previewArea, Gtk::PACK_EXPAND_WIDGET, 4);
-#if WITH_GTKMM_3_0
get_content_area()->set_homogeneous(false);
get_content_area()->set_spacing(0);
get_content_area()->pack_start(*hbox1);
-#else
- this->get_vbox()->set_homogeneous(false);
- this->get_vbox()->set_spacing(0);
- this->get_vbox()->pack_start(*hbox1);
-#endif
this->set_title(_("PDF Import Settings"));
this->set_modal(true);
@@ -300,12 +281,7 @@ PdfImportDialog::PdfImportDialog(PDFDoc *doc, const gchar */*uri*/)
this->show_all();
// Connect signals
-#if WITH_GTKMM_3_0
_previewArea->signal_draw().connect(sigc::mem_fun(*this, &PdfImportDialog::_onDraw));
-#else
- _previewArea->signal_expose_event().connect(sigc::mem_fun(*this, &PdfImportDialog::_onExposePreview));
-#endif
-
_pageNumberSpin_adj->signal_value_changed().connect(sigc::mem_fun(*this, &PdfImportDialog::_onPageNumberChanged));
_cropCheck->signal_toggled().connect(sigc::mem_fun(*this, &PdfImportDialog::_onToggleCropping));
_fallbackPrecisionSlider_adj->signal_value_changed().connect(sigc::mem_fun(*this, &PdfImportDialog::_onPrecisionChanged));
@@ -527,16 +503,6 @@ static void copy_cairo_surface_to_pixbuf (cairo_surface_t *surface,
#endif
-/**
- * \brief Updates the preview area with the previously rendered thumbnail
- */
-#if !WITH_GTKMM_3_0
-bool PdfImportDialog::_onExposePreview(GdkEventExpose * /*event*/) {
- Cairo::RefPtr<Cairo::Context> cr = _previewArea->get_window()->create_cairo_context();
- return _onDraw(cr);
-}
-#endif
-
bool PdfImportDialog::_onDraw(const Cairo::RefPtr<Cairo::Context>& cr) {
// Check if we have a thumbnail at all
if (!_thumb_data) {
diff --git a/src/extension/internal/pdfinput/pdf-input.h b/src/extension/internal/pdfinput/pdf-input.h
index 6e36603c3..c338207c1 100644
--- a/src/extension/internal/pdfinput/pdf-input.h
+++ b/src/extension/internal/pdfinput/pdf-input.h
@@ -39,11 +39,7 @@ namespace Gtk {
class DrawingArea;
class Frame;
class HBox;
-#if WITH_GTKMM_3_0
class Scale;
-#else
- class HScale;
-#endif
class RadioButton;
class VBox;
class Label;
@@ -79,10 +75,6 @@ private:
void _setPreviewPage(int page);
// Signal handlers
-#if !WITH_GTKMM_3_0
- bool _onExposePreview(GdkEventExpose *event);
-#endif
-
bool _onDraw(const Cairo::RefPtr<Cairo::Context>& cr);
void _onPageNumberChanged();
void _onToggleCropping();
@@ -110,13 +102,8 @@ private:
class Gtk::RadioButton * _importViaInternal; // Use native (poppler based) importing
class Gtk::Label * _labelViaInternal;
#endif
-#if WITH_GTKMM_3_0
- class Gtk::Scale * _fallbackPrecisionSlider;
+ Gtk::Scale * _fallbackPrecisionSlider;
Glib::RefPtr<Gtk::Adjustment> _fallbackPrecisionSlider_adj;
-#else
- class Gtk::HScale * _fallbackPrecisionSlider;
- class Gtk::Adjustment *_fallbackPrecisionSlider_adj;
-#endif
class Gtk::Label * _labelPrecisionComment;
class Gtk::HBox * hbox6;
class Gtk::Label * _labelText;