Code

- new: Print Colors Preview Dialog and rendermode
authorFelipe C. da S. Sanches <juca@members.fsf.org>
Fri, 11 Dec 2009 08:37:11 +0000 (06:37 -0200)
committerFelipe C. da S. Sanches <juca@members.fsf.org>
Fri, 11 Dec 2009 08:37:11 +0000 (06:37 -0200)
- works with shapes. I still need to make it work with gradients and imported images

14 files changed:
src/desktop.cpp
src/desktop.h
src/display/nr-arena-item.cpp
src/display/nr-arena-shape.cpp
src/display/rendermode.h
src/interface.cpp
src/menus-skeleton.h
src/ui/dialog/Makefile_insert
src/ui/dialog/dialog-manager.cpp
src/ui/dialog/print-colors-preview-dialog.cpp [new file with mode: 0644]
src/ui/dialog/print-colors-preview-dialog.h [new file with mode: 0644]
src/verbs.cpp
src/verbs.h
src/widgets/desktop-widget.cpp

index 319a0d407e35d252e31d96fc97f3c05e8f45ac62..0e4d4caf3d1f4b7904a47c7196bf73f179794294 100644 (file)
@@ -458,6 +458,9 @@ void SPDesktop::displayModeToggle() {
         _setDisplayMode(Inkscape::RENDERMODE_OUTLINE);
         break;
     case Inkscape::RENDERMODE_OUTLINE:
+        _setDisplayMode(Inkscape::RENDERMODE_PRINT_COLORS_PREVIEW);
+        break;
+    case Inkscape::RENDERMODE_PRINT_COLORS_PREVIEW:
     default:
         _setDisplayMode(Inkscape::RENDERMODE_NORMAL);
     }
index cfb977425318cdb4ccb371a265dd09055572eae6..a02a31034e5a07369a60d246b865d96594e25c38 100644 (file)
@@ -201,6 +201,9 @@ struct SPDesktop : public Inkscape::UI::View::View
     void setDisplayModeOutline() {
         _setDisplayMode(Inkscape::RENDERMODE_OUTLINE);
     }
+    void setDisplayModePrintColorsPreview() {
+        _setDisplayMode(Inkscape::RENDERMODE_PRINT_COLORS_PREVIEW);
+    }
     void displayModeToggle();
     Inkscape::RenderMode _display_mode;
     Inkscape::RenderMode getMode() const { return _display_mode; }
index bdab5b479507d8dc9305063a87ab6305d00a039e..b80df727340113407243f4f3424d698645115135 100644 (file)
@@ -312,7 +312,9 @@ nr_arena_item_invoke_render (cairo_t *ct, NRArenaItem *item, NRRectL const *area
                              NRPixBlock *pb, unsigned int flags)
 {
    bool outline = (item->arena->rendermode == Inkscape::RENDERMODE_OUTLINE);
-    bool filter = (item->arena->rendermode == Inkscape::RENDERMODE_NORMAL);
+    bool filter = (item->arena->rendermode != Inkscape::RENDERMODE_OUTLINE &&
+                   item->arena->rendermode != Inkscape::RENDERMODE_NO_FILTERS);
+    bool print_colors = (item->arena->rendermode == Inkscape::RENDERMODE_PRINT_COLORS_PREVIEW);
 
     nr_return_val_if_fail (item != NULL, NR_ARENA_ITEM_STATE_INVALID);
     nr_return_val_if_fail (NR_IS_ARENA_ITEM (item),
index 96ea76cbef83f14dc6d97c96d437e43dacab1fac..d5a098c391d91ef390ea47a3aa8d32f65a241311 100644 (file)
@@ -35,6 +35,8 @@
 #include "display/nr-filter.h"
 #include <typeinfo>
 #include <cairo.h>
+#include "preferences.h"
+#include "svg/svg-device-color.h"
 
 #include <glib.h>
 #include "svg/svg.h"
@@ -844,6 +846,7 @@ nr_arena_shape_render(cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPixBlock
     if (!shape->style) return item->state;
 
     bool outline = (NR_ARENA_ITEM(shape)->arena->rendermode == Inkscape::RENDERMODE_OUTLINE);
+    bool print_colors = (NR_ARENA_ITEM(shape)->arena->rendermode == Inkscape::RENDERMODE_PRINT_COLORS_PREVIEW);
 
     if (outline) { // cairo outline rendering
 
@@ -873,7 +876,22 @@ nr_arena_shape_render(cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPixBlock
         }
     }
 
+    Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+
     SPStyle const *style = shape->style;
+    bool render_cyan = prefs->getBool("/options/printcolorspreview/cyan", true);
+    bool render_magenta = prefs->getBool("/options/printcolorspreview/magenta", true);
+    bool render_yellow = prefs->getBool("/options/printcolorspreview/yellow", true);
+    bool render_black = prefs->getBool("/options/printcolorspreview/black", true);
+
+    float rgb_v[3];
+    float cmyk_v[4];
+#define FLOAT_TO_UINT8(f) (int(f*255))
+#define RGBA_R(v) ((v) >> 24)
+#define RGBA_G(v) (((v) >> 16) & 0xff)
+#define RGBA_B(v) (((v) >> 8) & 0xff)
+#define RGBA_A(v) ((v) & 0xff)
+
     if (shape->fill_shp) {
         NRPixBlock m;
         guint32 rgba;
@@ -893,12 +911,24 @@ nr_arena_shape_render(cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPixBlock
         if (shape->_fill.paint.type() == NRArenaShape::Paint::NONE) {
             // do not render fill in any way
         } else if (shape->_fill.paint.type() == NRArenaShape::Paint::COLOR) {
+
+            const SPColor* fill_color = &shape->_fill.paint.color();
             if ( item->render_opacity ) {
-                rgba = shape->_fill.paint.color().toRGBA32( shape->_fill.opacity *
-                                                            SP_SCALE24_TO_FLOAT(style->opacity.value) );
+                rgba = fill_color->toRGBA32( shape->_fill.opacity *
+                                        SP_SCALE24_TO_FLOAT(style->opacity.value) );
             } else {
-                rgba = shape->_fill.paint.color().toRGBA32( shape->_fill.opacity );
+                rgba = fill_color->toRGBA32( shape->_fill.opacity );
+            }
+
+            if (print_colors){
+                sp_color_rgb_to_cmyk_floatv (cmyk_v, RGBA_R(rgba)/256.0, RGBA_G(rgba)/256.0, RGBA_B(rgba)/256.0); 
+                sp_color_cmyk_to_rgb_floatv (rgb_v, render_cyan ? cmyk_v[0] : 0,
+                                                    render_magenta ? cmyk_v[1] : 0,
+                                                    render_yellow ? cmyk_v[2] : 0,
+                                                    render_black ? cmyk_v[3] : 0);
+                rgba = (FLOAT_TO_UINT8(rgb_v[0])<<24) + (FLOAT_TO_UINT8(rgb_v[1])<<16) + (FLOAT_TO_UINT8(rgb_v[2])<<8) + 0xff;
             }
+
             nr_blit_pixblock_mask_rgba32(pb, &m, rgba);
             pb->empty = FALSE;
         } else if (shape->_fill.paint.type() == NRArenaShape::Paint::SERVER) {
@@ -929,14 +959,25 @@ nr_arena_shape_render(cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPixBlock
         nr_pixblock_render_shape_mask_or(m, shape->stroke_shp);
         m.empty = FALSE;
 
-            if ( item->render_opacity ) {
-                rgba = shape->_stroke.paint.color().toRGBA32( shape->_stroke.opacity *
-                                                              SP_SCALE24_TO_FLOAT(style->opacity.value) );
-            } else {
-                rgba = shape->_stroke.paint.color().toRGBA32( shape->_stroke.opacity );
-            }
-            nr_blit_pixblock_mask_rgba32(pb, &m, rgba);
-            pb->empty = FALSE;
+        const SPColor* stroke_color = &shape->_stroke.paint.color();
+        if ( item->render_opacity ) {
+            rgba = stroke_color->toRGBA32( shape->_stroke.opacity *
+                                    SP_SCALE24_TO_FLOAT(style->opacity.value) );
+        } else {
+            rgba = stroke_color->toRGBA32( shape->_stroke.opacity );
+        }
+
+        if (print_colors){
+            sp_color_rgb_to_cmyk_floatv (cmyk_v, RGBA_R(rgba)/256.0, RGBA_G(rgba)/256.0, RGBA_B(rgba)/256.0); 
+            sp_color_cmyk_to_rgb_floatv (rgb_v, render_cyan ? cmyk_v[0] : 0,
+                                                render_magenta ? cmyk_v[1] : 0,
+                                                render_yellow ? cmyk_v[2] : 0,
+                                                render_black ? cmyk_v[3] : 0);
+            rgba = (FLOAT_TO_UINT8(rgb_v[0])<<24) + (FLOAT_TO_UINT8(rgb_v[1])<<16) + (FLOAT_TO_UINT8(rgb_v[2])<<8) + 0xff;
+        }
+
+        nr_blit_pixblock_mask_rgba32(pb, &m, rgba);
+        pb->empty = FALSE;
 
         nr_pixblock_release(&m);
 
index 1b59ae9bbdf92e4cef3976ae6ad978230b5f6c12..abcdb3db43e66c869a0623f15dc6f0b343c309b8 100644 (file)
@@ -12,7 +12,8 @@ namespace Inkscape {
 enum RenderMode {
     RENDERMODE_NORMAL,
     RENDERMODE_NO_FILTERS,
-    RENDERMODE_OUTLINE
+    RENDERMODE_OUTLINE,
+    RENDERMODE_PRINT_COLORS_PREVIEW
 };
 
 }
index 415593b7885ba76dbe76fb259af0cd718708bb4e..b29b91d18ec549badd524a56672d056865e466f5 100644 (file)
@@ -703,6 +703,8 @@ update_view_menu(GtkWidget *widget, GdkEventExpose */*event*/, gpointer user_dat
        new_state = mode == Inkscape::RENDERMODE_NO_FILTERS;
     } else if (!strcmp(action->id, "ViewModeOutline")) {
        new_state = mode == Inkscape::RENDERMODE_OUTLINE;
+    } else if (!strcmp(action->id, "ViewModePrintColorsPreview")) {
+       new_state = mode == Inkscape::RENDERMODE_PRINT_COLORS_PREVIEW;
     } else {
        g_warning("update_view_menu does not handle this verb");
     }
index d7a18f2112f840ef916c4a5c9091a59f46f5c333..c664d683ac6c4a80b82f78782331b9be0a00133c 100644 (file)
@@ -110,6 +110,8 @@ static char const menus_skeleton[] =
 "         <verb verb-id=\"ViewModeNormal\" radio=\"yes\" default=\"yes\"/>\n"
 "         <verb verb-id=\"ViewModeNoFilters\" radio=\"yes\"/>\n"
 "         <verb verb-id=\"ViewModeOutline\" radio=\"yes\"/>\n"
+"         <verb verb-id=\"ViewModePrintColorsPreview\" radio=\"yes\"/>\n"
+"         <verb verb-id=\"DialogPrintColorsPreview\" />\n"
 "       </submenu>\n"
 "       <separator/>\n"
 "       <verb verb-id=\"ToggleGrid\" />\n"
index fd1b073943e1192b58e7e9f63d2acd76d46466a0..fac5bad8001cd975d82fd03824ba243ac4f4f478 100644 (file)
@@ -71,6 +71,8 @@ ink_common_sources +=         \
        ui/dialog/panel-dialog.h                \
        ui/dialog/print.cpp                     \
        ui/dialog/print.h                       \
+       ui/dialog/print-colors-preview-dialog.cpp               \
+       ui/dialog/print-colors-preview-dialog.h         \
        ui/dialog/scriptdialog.cpp              \
        ui/dialog/scriptdialog.h                \
        ui/dialog/spray-option.cpp              \
index 7f853bedcdd17b75034ed3ea5026fa1d719205b8..2116d46c3dff3335fe8d1eea4c1f81e185ac53b2 100644 (file)
@@ -41,6 +41,7 @@
 #include "ui/dialog/floating-behavior.h"
 #include "ui/dialog/dock-behavior.h"
 #include "ui/dialog/spray-option.h"
+#include "ui/dialog/print-colors-preview-dialog.h"
 #include "preferences.h"
 
 #ifdef ENABLE_SVG_FONTS
@@ -102,6 +103,7 @@ DialogManager::DialogManager() {
         registerFactory("LivePathEffect",      &create<LivePathEffectEditor, FloatingBehavior>);
         registerFactory("Memory",              &create<Memory,               FloatingBehavior>);
         registerFactory("Messages",            &create<Messages,             FloatingBehavior>);
+        registerFactory("PrintColorsPreviewDialog",      &create<PrintColorsPreviewDialog,       FloatingBehavior>);
         registerFactory("Script",              &create<ScriptDialog,         FloatingBehavior>);
 #ifdef ENABLE_SVG_FONTS
         registerFactory("SvgFontsDialog",      &create<SvgFontsDialog,       FloatingBehavior>);
@@ -129,6 +131,7 @@ DialogManager::DialogManager() {
         registerFactory("LivePathEffect",      &create<LivePathEffectEditor, DockBehavior>);
         registerFactory("Memory",              &create<Memory,               DockBehavior>);
         registerFactory("Messages",            &create<Messages,             DockBehavior>);
+        registerFactory("PrintColorsPreviewDialog",      &create<PrintColorsPreviewDialog,       DockBehavior>);
         registerFactory("Script",              &create<ScriptDialog,         DockBehavior>);
 #ifdef ENABLE_SVG_FONTS
         registerFactory("SvgFontsDialog",      &create<SvgFontsDialog,       DockBehavior>);
diff --git a/src/ui/dialog/print-colors-preview-dialog.cpp b/src/ui/dialog/print-colors-preview-dialog.cpp
new file mode 100644 (file)
index 0000000..f4d83c2
--- /dev/null
@@ -0,0 +1,100 @@
+/** @file
+ * @brief Print Colors Preview dialog - implementation
+ */
+/* Authors:
+ *   Felipe C. da S. Sanches <juca@members.fsf.org>
+ *
+ * Copyright (C) 2009 Authors
+ * Released under GNU GPLv2 (or later).  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 accomodate 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
diff --git a/src/ui/dialog/print-colors-preview-dialog.h b/src/ui/dialog/print-colors-preview-dialog.h
new file mode 100644 (file)
index 0000000..2469085
--- /dev/null
@@ -0,0 +1,48 @@
+/** @file
+ * @brief Print Colors Preview dialog
+ */
+/* Authors:
+ *   Felipe CorrĂȘa da Silva Sanches <juca@members.fsf.org>
+ *
+ * Copyright (C) 2009 Authors
+ * Released under GNU GPLv2 (or later).  Read the file 'COPYING' for more information.
+ */
+
+#ifndef INKSCAPE_UI_DIALOG_PRINT_COLORS_PREVIEW_H
+#define INKSCAPE_UI_DIALOG_PRINT_COLORS_PREVIEW_H
+
+#include "ui/widget/panel.h"
+#include "verbs.h"
+
+#include <gtkmm.h>
+#include <gtkmm/box.h>
+
+namespace Inkscape {
+namespace UI {
+namespace Dialog {
+
+class PrintColorsPreviewDialog : public UI::Widget::Panel {
+public:
+    PrintColorsPreviewDialog();
+    ~PrintColorsPreviewDialog();
+
+    static PrintColorsPreviewDialog &getInstance()
+    { return *new PrintColorsPreviewDialog(); }
+
+private:
+    void toggle_cyan();
+    void toggle_magenta();
+    void toggle_yellow();
+    void toggle_black();
+
+    Gtk::ToggleButton* cyan;
+    Gtk::ToggleButton* magenta;
+    Gtk::ToggleButton* yellow;
+    Gtk::ToggleButton* black;
+};
+
+} // namespace Dialog
+} // namespace UI
+} // namespace Inkscape
+
+#endif //#ifndef INKSCAPE_UI_PRINT_COLORS_PREVIEW_H
index 56b63e95eb2bd305796789ec0e7556284285f7a5..6f86c3ccee1a1d16066dc66db85c49b2bb44feb4 100644 (file)
@@ -1749,6 +1749,9 @@ ZoomVerb::perform(SPAction *action, void *data, void */*pdata*/)
         case SP_VERB_VIEW_MODE_OUTLINE:
             dt->setDisplayModeOutline();
             break;
+        case SP_VERB_VIEW_MODE_PRINT_COLORS_PREVIEW:
+            dt->setDisplayModePrintColorsPreview();
+            break;
         case SP_VERB_VIEW_MODE_TOGGLE:
             dt->displayModeToggle();
             break;
@@ -1871,6 +1874,9 @@ DialogVerb::perform(SPAction *action, void *data, void */*pdata*/)
         case SP_VERB_DIALOG_SVG_FONTS:
             dt->_dlg_mgr->showDialog("SvgFontsDialog");
             break;
+        case SP_VERB_DIALOG_PRINT_COLORS_PREVIEW:
+            dt->_dlg_mgr->showDialog("PrintColorsPreviewDialog");
+            break;
         default:
             break;
     }
@@ -2626,6 +2632,8 @@ Verb *Verb::_base_verbs[] = {
                  N_("Switch to normal display without filters"), NULL),
     new ZoomVerb(SP_VERB_VIEW_MODE_OUTLINE, "ViewModeOutline", N_("_Outline"),
                  N_("Switch to outline (wireframe) display mode"), NULL),
+    new ZoomVerb(SP_VERB_VIEW_MODE_PRINT_COLORS_PREVIEW, "ViewModePrintColorsPreview", N_("_Print Colors Preview"),
+                 N_("Switch to print colors preview mode"), NULL),
     new ZoomVerb(SP_VERB_VIEW_MODE_TOGGLE, "ViewModeToggle", N_("_Toggle"),
                  N_("Toggle between normal and outline display modes"), NULL),
 
@@ -2701,6 +2709,8 @@ Verb *Verb::_base_verbs[] = {
                    N_("Manage, edit, and apply SVG filters"), NULL),
     new DialogVerb(SP_VERB_DIALOG_SVG_FONTS, "DialogSVGFonts", N_("SVG Font Editor..."),
                    N_("Edit SVG fonts"), NULL),
+    new DialogVerb(SP_VERB_DIALOG_PRINT_COLORS_PREVIEW, "DialogPrintColorsPreview", N_("Print Colors..."),
+                   N_("Select which color separations to render in Print Colors Preview rendermode"), NULL),
 
     /* Help */
     new HelpVerb(SP_VERB_HELP_ABOUT_EXTENSIONS, "HelpAboutExtensions", N_("About E_xtensions"),
index 3ea2fdee89f908a6767e52816c96b46d0da75f51..d0abcdca28ef53ac834dfa90e0da8bc0bf850be7 100644 (file)
@@ -214,6 +214,7 @@ enum {
     SP_VERB_VIEW_MODE_NORMAL,
     SP_VERB_VIEW_MODE_NO_FILTERS,
     SP_VERB_VIEW_MODE_OUTLINE,
+    SP_VERB_VIEW_MODE_PRINT_COLORS_PREVIEW,
     SP_VERB_VIEW_MODE_TOGGLE,
     SP_VERB_VIEW_CMS_TOGGLE,
     SP_VERB_VIEW_ICON_PREVIEW,
@@ -251,6 +252,7 @@ enum {
     SP_VERB_DIALOG_LIVE_PATH_EFFECT,
     SP_VERB_DIALOG_FILTER_EFFECTS,
     SP_VERB_DIALOG_SVG_FONTS,
+    SP_VERB_DIALOG_PRINT_COLORS_PREVIEW,
     /* Help */
     SP_VERB_HELP_ABOUT_EXTENSIONS,
     SP_VERB_HELP_MEMORY,
index e3bf1ae9c5efecb60323a6052b7f4e1f4760d246..b63992afe9a8ff22d0528533ffc0326f20646251 100644 (file)
@@ -613,12 +613,20 @@ SPDesktopWidget::updateTitle(gchar const* uri)
         if (this->desktop->number > 1) {
             if (this->desktop->getMode() == Inkscape::RENDERMODE_OUTLINE) {
                 g_string_printf (name, _("%s: %d (outline) - Inkscape"), fname, this->desktop->number);
+            } else if (this->desktop->getMode() == Inkscape::RENDERMODE_NO_FILTERS) {
+                g_string_printf (name, _("%s: %d (no filters) - Inkscape"), fname, this->desktop->number);
+            } else if (this->desktop->getMode() == Inkscape::RENDERMODE_PRINT_COLORS_PREVIEW) {
+                g_string_printf (name, _("%s: %d (print colors preview) - Inkscape"), fname, this->desktop->number);
             } else {
                 g_string_printf (name, _("%s: %d - Inkscape"), fname, this->desktop->number);
             }
         } else {
             if (this->desktop->getMode() == Inkscape::RENDERMODE_OUTLINE) {
                 g_string_printf (name, _("%s (outline) - Inkscape"), fname);
+            } else if (this->desktop->getMode() == Inkscape::RENDERMODE_NO_FILTERS) {
+                g_string_printf (name, _("%s (no filters) - Inkscape"), fname);
+            } else if (this->desktop->getMode() == Inkscape::RENDERMODE_PRINT_COLORS_PREVIEW) {
+                g_string_printf (name, _("%s (print colors preview) - Inkscape"), fname);
             } else {
                 g_string_printf (name, _("%s - Inkscape"), fname);
             }