summaryrefslogtreecommitdiffstats
path: root/src/extension
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2012-04-30 22:04:12 +0000
committerAlex Valavanis <valavanisalex@gmail.com>2012-04-30 22:04:12 +0000
commitbc19e10ccfe4010990d2a86cbae992f7825e2562 (patch)
treec34501ae52633d8b9451734a951196ed1675e471 /src/extension
parentemf import. use EMR_EXTSELECTCLIPRGN to cancel clipping (Bug 990083) (diff)
downloadinkscape-bc19e10ccfe4010990d2a86cbae992f7825e2562.tar.gz
inkscape-bc19e10ccfe4010990d2a86cbae992f7825e2562.zip
gtkmm-3.0 changes for Gtk::Adjustment
(bzr r11308)
Diffstat (limited to 'src/extension')
-rw-r--r--src/extension/internal/pdf-input-cairo.cpp10
-rw-r--r--src/extension/internal/pdf-input-cairo.h4
-rw-r--r--src/extension/internal/pdfinput/pdf-input.cpp10
-rw-r--r--src/extension/internal/pdfinput/pdf-input.h4
-rw-r--r--src/extension/param/float.cpp15
-rw-r--r--src/extension/param/int.cpp15
6 files changed, 56 insertions, 2 deletions
diff --git a/src/extension/internal/pdf-input-cairo.cpp b/src/extension/internal/pdf-input-cairo.cpp
index 0a89c6661..e56b7afa8 100644
--- a/src/extension/internal/pdf-input-cairo.cpp
+++ b/src/extension/internal/pdf-input-cairo.cpp
@@ -71,8 +71,13 @@ PdfImportCairoDialog::PdfImportCairoDialog(PopplerDocument *doc)
// Page number
int num_pages = poppler_document_get_n_pages(_poppler_doc);
+#if WITH_GTKMM_3_0
+ Glib::RefPtr<Gtk::Adjustment> _pageNumberSpin_adj( Gtk::Adjustment::create(1, 1, num_pages, 1, 10, 0) );
+ _pageNumberSpin = Gtk::manage(new class Inkscape::UI::Widget::SpinButton(_pageNumberSpin_adj, 1, 1));
+#else
Gtk::Adjustment *_pageNumberSpin_adj = Gtk::manage(new class Gtk::Adjustment(1, 1, num_pages, 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
@@ -105,8 +110,13 @@ PdfImportCairoDialog::PdfImportCairoDialog(PopplerDocument *doc)
_labelPrecision = Gtk::manage(new class Gtk::Label(_("Precision of approximating gradient meshes:")));
_labelPrecisionWarning = Gtk::manage(new class Gtk::Label(_("<b>Note</b>: setting the precision too high may result in a large SVG file and slow performance.")));
+#if WITH_GTKMM_3_0
+ _fallbackPrecisionSlider_adj = Gtk::Adjustment::create(2, 1, 256, 1, 10, 10);
+ _fallbackPrecisionSlider = Gtk::manage(new Gtk::HScale(_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));
diff --git a/src/extension/internal/pdf-input-cairo.h b/src/extension/internal/pdf-input-cairo.h
index cc3ed975e..15235ee19 100644
--- a/src/extension/internal/pdf-input-cairo.h
+++ b/src/extension/internal/pdf-input-cairo.h
@@ -82,7 +82,11 @@ private:
class Gtk::Label * _labelPrecision;
class Gtk::Label * _labelPrecisionWarning;
class Gtk::HScale * _fallbackPrecisionSlider;
+#if WITH_GTKMM_3_0
+ Glib::RefPtr<Gtk::Adjustment> _fallbackPrecisionSlider_adj;
+#else
class Gtk::Adjustment *_fallbackPrecisionSlider_adj;
+#endif
class Gtk::Label * _labelPrecisionComment;
class Gtk::HBox * hbox6;
class Gtk::Label * _labelText;
diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
index 8802ce2ba..47f91e7b2 100644
--- a/src/extension/internal/pdfinput/pdf-input.cpp
+++ b/src/extension/internal/pdfinput/pdf-input.cpp
@@ -85,9 +85,14 @@ 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);
+ _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
@@ -121,8 +126,13 @@ PdfImportDialog::PdfImportDialog(PDFDoc *doc, const gchar */*uri*/)
_labelPrecision = Gtk::manage(new class Gtk::Label(_("Precision of approximating gradient meshes:")));
_labelPrecisionWarning = Gtk::manage(new class Gtk::Label(_("<b>Note</b>: setting the precision too high may result in a large SVG file and slow performance.")));
+#if WITH_GTKMM_3_0
+ _fallbackPrecisionSlider_adj = Gtk::Adjustment::create(2, 1, 256, 1, 10, 10);
+ _fallbackPrecisionSlider = Gtk::manage(new class Gtk::HScale(_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));
diff --git a/src/extension/internal/pdfinput/pdf-input.h b/src/extension/internal/pdfinput/pdf-input.h
index 8334fd2f3..3b79e6f29 100644
--- a/src/extension/internal/pdfinput/pdf-input.h
+++ b/src/extension/internal/pdfinput/pdf-input.h
@@ -92,7 +92,11 @@ private:
class Gtk::Label * _labelPrecision;
class Gtk::Label * _labelPrecisionWarning;
class Gtk::HScale * _fallbackPrecisionSlider;
+#if WITH_GTKMM_3_0
+ Glib::RefPtr<Gtk::Adjustment> _fallbackPrecisionSlider_adj;
+#else
class Gtk::Adjustment *_fallbackPrecisionSlider_adj;
+#endif
class Gtk::Label * _labelPrecisionComment;
class Gtk::HBox * hbox6;
class Gtk::Label * _labelText;
diff --git a/src/extension/param/float.cpp b/src/extension/param/float.cpp
index 0e1d1c22a..2f1c77d4e 100644
--- a/src/extension/param/float.cpp
+++ b/src/extension/param/float.cpp
@@ -184,17 +184,30 @@ Gtk::Widget * ParamFloat::get_widget(SPDocument * doc, Inkscape::XML::Node * nod
label->show();
hbox->pack_start(*label, true, true, _indent);
+#if WITH_GTKMM_3_0
+ ParamFloatAdjustment * pfa = new ParamFloatAdjustment(this, doc, node, changeSignal);
+ Glib::RefPtr<Gtk::Adjustment> fadjust(pfa);
+#else
ParamFloatAdjustment * fadjust = Gtk::manage(new ParamFloatAdjustment(this, doc, node, changeSignal));
+#endif
if (_mode == FULL) {
+#if WITH_GTKMM_3_0
+ Gtk::HScale * scale = Gtk::manage(new Gtk::HScale(fadjust));
+#else
Gtk::HScale * scale = Gtk::manage(new Gtk::HScale(*fadjust));
+#endif
scale->set_draw_value(false);
scale->set_size_request(200, -1);
scale->show();
hbox->pack_start(*scale, false, false);
}
-
+
+#if WITH_GTKMM_3_0
+ Inkscape::UI::Widget::SpinButton * spin = Gtk::manage(new Inkscape::UI::Widget::SpinButton(fadjust, 0.1, _precision));
+#else
Inkscape::UI::Widget::SpinButton * spin = Gtk::manage(new Inkscape::UI::Widget::SpinButton(*fadjust, 0.1, _precision));
+#endif
spin->show();
hbox->pack_start(*spin, false, false);
diff --git a/src/extension/param/int.cpp b/src/extension/param/int.cpp
index 440693eb1..fe29f1230 100644
--- a/src/extension/param/int.cpp
+++ b/src/extension/param/int.cpp
@@ -165,17 +165,30 @@ ParamInt::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal
label->show();
hbox->pack_start(*label, true, true, _indent);
+#if WITH_GTKMM_3_0
+ ParamIntAdjustment * pia = new ParamIntAdjustment(this, doc, node, changeSignal);
+ Glib::RefPtr<Gtk::Adjustment> fadjust(pia);
+#else
ParamIntAdjustment * fadjust = Gtk::manage(new ParamIntAdjustment(this, doc, node, changeSignal));
+#endif
if (_mode == FULL) {
+#if WITH_GTKMM_3_0
+ Gtk::HScale * scale = Gtk::manage(new Gtk::HScale(fadjust));
+#else
Gtk::HScale * scale = Gtk::manage(new Gtk::HScale(*fadjust));
+#endif
scale->set_draw_value(false);
scale->set_size_request(200, -1);
scale->show();
hbox->pack_start(*scale, false, false);
}
-
+
+#if WITH_GTKMM_3_0
+ Inkscape::UI::Widget::SpinButton * spin = Gtk::manage(new Inkscape::UI::Widget::SpinButton(fadjust, 1.0, 0));
+#else
Inkscape::UI::Widget::SpinButton * spin = Gtk::manage(new Inkscape::UI::Widget::SpinButton(*fadjust, 1.0, 0));
+#endif
spin->show();
hbox->pack_start(*spin, false, false);