summaryrefslogtreecommitdiffstats
path: root/src/ui/widget
diff options
context:
space:
mode:
authorKees Cook <kees@outflux.net>2007-12-10 05:29:23 +0000
committerkeescook <keescook@users.sourceforge.net>2007-12-10 05:29:23 +0000
commit3bbfb29347465809918421d6dafcd5c0816935e1 (patch)
treeeb280d39803051efd86b1f496bfe130afa42787f /src/ui/widget
parentalways build cairo backend; add interface for setting cairo surface to renderer (diff)
downloadinkscape-3bbfb29347465809918421d6dafcd5c0816935e1.tar.gz
inkscape-3bbfb29347465809918421d6dafcd5c0816935e1.zip
Implement cross-architecture print dialog using cairo and PNG backends.
(bzr r4199)
Diffstat (limited to 'src/ui/widget')
-rw-r--r--src/ui/widget/Makefile_insert2
-rw-r--r--src/ui/widget/rendering-options.cpp101
-rw-r--r--src/ui/widget/rendering-options.h55
3 files changed, 158 insertions, 0 deletions
diff --git a/src/ui/widget/Makefile_insert b/src/ui/widget/Makefile_insert
index c5bde795a..cfe163681 100644
--- a/src/ui/widget/Makefile_insert
+++ b/src/ui/widget/Makefile_insert
@@ -52,6 +52,8 @@ ui_widget_libuiwidget_a_SOURCES = \
ui/widget/registered-enums.h \
ui/widget/registry.cpp \
ui/widget/registry.h \
+ ui/widget/rendering-options.cpp \
+ ui/widget/rendering-options.h \
ui/widget/rotateable.h \
ui/widget/rotateable.cpp \
ui/widget/ruler.cpp \
diff --git a/src/ui/widget/rendering-options.cpp b/src/ui/widget/rendering-options.cpp
new file mode 100644
index 000000000..8a00bcc5d
--- /dev/null
+++ b/src/ui/widget/rendering-options.cpp
@@ -0,0 +1,101 @@
+/**
+ * \brief Rendering options widget
+ *
+ * Author:
+ * Kees Cook <kees@outflux.net>
+ *
+ * Copyright (C) 2007 Kees Cook
+ * Copyright (C) 2004 Bryce Harrington
+ *
+ * Released under GNU GPL. Read the file 'COPYING' for more information
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <glibmm/i18n.h>
+
+#include "unit-constants.h"
+#include "rendering-options.h"
+
+namespace Inkscape {
+namespace UI {
+namespace Widget {
+
+/**
+ * Construct a Rendering Options widget
+ *
+ */
+
+RenderingOptions::RenderingOptions () :
+ Gtk::VBox (),
+ //Labelled(label, tooltip, new Gtk::VBox(), suffix, icon, mnemonic),
+ _radio_cairo ( new Gtk::RadioButton () ),
+ //_radio_bitmap( new Gtk::RadioButton (_radio_cairo->get_group ()),
+ _radio_bitmap( new Gtk::RadioButton () ),
+ _widget_cairo( Glib::ustring(_("_Cairo")),
+ Glib::ustring(_("Render using Cairo vector operations. The resulting image is usually smaller in file "
+ "size and can be arbitrarily scaled, but some "
+ "filter effects will not be correctly rendered.")),
+ _radio_cairo,
+ Glib::ustring(""), Glib::ustring(""),
+ true),
+ _widget_bitmap(Glib::ustring(_("_Bitmap")),
+ Glib::ustring(_("Render everything as bitmap. The resulting image "
+ "is usually larger in file size and cannot be "
+ "arbitrarily scaled without quality loss, but all "
+ "objects will be rendered exactly as displayed.")),
+ _radio_bitmap,
+ Glib::ustring(""), Glib::ustring(""),
+ true),
+ _dpi( _("DPI"), Glib::ustring(_("Preferred resolution of rendering, in dots per inch.")),
+ 1,
+ Glib::ustring(""), Glib::ustring(""),
+ false)
+{
+ set_border_width(2);
+
+ // default to cairo operations
+ _radio_cairo->set_active (true);
+ Gtk::RadioButtonGroup group = _radio_cairo->get_group ();
+ _radio_bitmap->set_group (group);
+
+ // configure default DPI
+ _dpi.setRange(PT_PER_IN,2400.0);
+ _dpi.setValue(PT_PER_IN);
+
+ // fill up container
+ add (_widget_cairo);
+ add (_widget_bitmap);
+ add (_dpi);
+
+ show_all_children ();
+}
+
+bool
+RenderingOptions::as_bitmap ()
+{
+ return _radio_bitmap->get_active();
+}
+
+double
+RenderingOptions::bitmap_dpi ()
+{
+ return _dpi.getValue();
+}
+
+} // namespace Widget
+} // namespace UI
+} // namespace Inkscape
+
+/*
+ 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:encoding=utf-8:textwidth=99 :
diff --git a/src/ui/widget/rendering-options.h b/src/ui/widget/rendering-options.h
new file mode 100644
index 000000000..41134b814
--- /dev/null
+++ b/src/ui/widget/rendering-options.h
@@ -0,0 +1,55 @@
+/**
+ * \brief Rendering Options Widget - A container for selecting rendering options
+ *
+ * Author:
+ * Kees Cook <kees@outflux.net>
+ *
+ * Copyright (C) 2007 Kees Cook
+ * Copyright (C) 2004 Bryce Harrington
+ *
+ * Released under GNU GPL. Read the file 'COPYING' for more information.
+ */
+
+#ifndef INKSCAPE_UI_WIDGET_RENDERING_OPTIONS_H
+#define INKSCAPE_UI_WIDGET_RENDERING_OPTIONS_H
+
+#include "labelled.h"
+#include "scalar.h"
+
+namespace Inkscape {
+namespace UI {
+namespace Widget {
+
+class RenderingOptions : public Gtk::VBox
+{
+public:
+ RenderingOptions();
+
+ bool as_bitmap(); // should we render as a bitmap?
+ double bitmap_dpi(); // at what DPI should we render the bitmap?
+
+protected:
+ // Radio buttons to select desired rendering
+ Gtk::RadioButton *_radio_cairo;
+ Gtk::RadioButton *_radio_bitmap;
+ Labelled _widget_cairo;
+ Labelled _widget_bitmap;
+ Scalar _dpi; // DPI of bitmap to render
+};
+
+} // namespace Widget
+} // namespace UI
+} // namespace Inkscape
+
+#endif // INKSCAPE_UI_WIDGET_RENDERING_OPTIONS_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:encoding=utf-8:textwidth=99 :