summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/print-colors-preview-dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/dialog/print-colors-preview-dialog.cpp')
-rw-r--r--src/ui/dialog/print-colors-preview-dialog.cpp103
1 files changed, 103 insertions, 0 deletions
diff --git a/src/ui/dialog/print-colors-preview-dialog.cpp b/src/ui/dialog/print-colors-preview-dialog.cpp
new file mode 100644
index 0000000..6371af9
--- /dev/null
+++ b/src/ui/dialog/print-colors-preview-dialog.cpp
@@ -0,0 +1,103 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/**
+ * @file
+ * Print Colors Preview dialog - implementation.
+ */
+/* Authors:
+ * Felipe C. da S. Sanches <juca@members.fsf.org>
+ *
+ * Copyright (C) 2009 Authors
+ * Released under GNU GPL v2+, read the file 'COPYING' for more information.
+ */
+/*
+#include "desktop.h"
+#include "print-colors-preview-dialog.h"
+#include "preferences.h"
+#include <glibmm/i18n.h>
+
+namespace Inkscape {
+namespace UI {
+namespace Dialog {
+
+//Yes, I know we shouldn't hardcode CMYK. This class needs to be refactored
+// in order to accommodate spot colors and color components defined using
+// ICC colors. --Juca
+
+void PrintColorsPreviewDialog::toggle_cyan(){
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ prefs->setBool("/options/printcolorspreview/cyan", cyan->get_active());
+
+ SPDesktop *desktop = getDesktop();
+ desktop->setDisplayModePrintColorsPreview();
+}
+
+void PrintColorsPreviewDialog::toggle_magenta(){
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ prefs->setBool("/options/printcolorspreview/magenta", magenta->get_active());
+
+ SPDesktop *desktop = getDesktop();
+ desktop->setDisplayModePrintColorsPreview();
+}
+
+void PrintColorsPreviewDialog::toggle_yellow(){
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ prefs->setBool("/options/printcolorspreview/yellow", yellow->get_active());
+
+ SPDesktop *desktop = getDesktop();
+ desktop->setDisplayModePrintColorsPreview();
+}
+
+void PrintColorsPreviewDialog::toggle_black(){
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ prefs->setBool("/options/printcolorspreview/black", black->get_active());
+
+ SPDesktop *desktop = getDesktop();
+ desktop->setDisplayModePrintColorsPreview();
+}
+
+PrintColorsPreviewDialog::PrintColorsPreviewDialog()
+ : UI::Widget::Panel("/dialogs/printcolorspreview", SP_VERB_DIALOG_PRINT_COLORS_PREVIEW)
+{
+ Gtk::VBox* vbox = Gtk::manage(new Gtk::VBox());
+
+ cyan = new Gtk::ToggleButton(_("Cyan"));
+ vbox->pack_start( *cyan, false, false );
+// tips.set_tip((*cyan), _("Render cyan separation"));
+ cyan->signal_clicked().connect( sigc::mem_fun(*this, &PrintColorsPreviewDialog::toggle_cyan) );
+
+ magenta = new Gtk::ToggleButton(_("Magenta"));
+ vbox->pack_start( *magenta, false, false );
+// tips.set_tip((*magenta), _("Render magenta separation"));
+ magenta->signal_clicked().connect( sigc::mem_fun(*this, &PrintColorsPreviewDialog::toggle_magenta) );
+
+ yellow = new Gtk::ToggleButton(_("Yellow"));
+ vbox->pack_start( *yellow, false, false );
+// tips.set_tip((*yellow), _("Render yellow separation"));
+ yellow->signal_clicked().connect( sigc::mem_fun(*this, &PrintColorsPreviewDialog::toggle_yellow) );
+
+ black = new Gtk::ToggleButton(_("Black"));
+ vbox->pack_start( *black, false, false );
+// tips.set_tip((*black), _("Render black separation"));
+ black->signal_clicked().connect( sigc::mem_fun(*this, &PrintColorsPreviewDialog::toggle_black) );
+
+ gint val;
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ val = prefs->getBool("/options/printcolorspreview/cyan");
+ cyan->set_active( val != 0 );
+ val = prefs->getBool("/options/printcolorspreview/magenta");
+ magenta->set_active( val != 0 );
+ val = prefs->getBool("/options/printcolorspreview/yellow");
+ yellow->set_active( val != 0 );
+ val = prefs->getBool("/options/printcolorspreview/black");
+ black->set_active( val != 0 );
+
+ _getContents()->add(*vbox);
+ _getContents()->show_all();
+}
+
+PrintColorsPreviewDialog::~PrintColorsPreviewDialog(){}
+
+} // namespace Dialog
+} // namespace UI
+} // namespace Inkscape
+*/