/**
* @file
* A notebook with RGB, CMYK, CMS, HSL, and Wheel pages - implementation
*/
/* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* bulia byak <buliabyak@users.sf.net>
* Tomasz Boczkowski <penginsbacon@gmail.com> (c++-sification)
*
* Copyright (C) 2001-2014 Authors
*
* This code is in public domain
*/
#define noDUMP_CHANGE_INFO
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <cstring>
#include <string>
#include <cstdlib>
#include <cstddef>
#include <gtkmm/notebook.h>
#include "preferences.h"
#include "widgets/spw-utilities.h"
#include "svg/svg-icc-color.h"
#include "inkscape.h"
#include "document.h"
#include "profile-manager.h"
#include "color-profile.h"
#include "cms-system.h"
#include "ui/dialog-events.h"
#include "ui/tools-switch.h"
#include "ui/tools/tool-base.h"
#include "ui/widget/color-entry.h"
#include "ui/widget/color-icc-selector.h"
#include "ui/widget/color-notebook.h"
#include "ui/widget/color-scales.h"
#include "ui/widget/color-wheel-selector.h"
namespace Inkscape {
namespace UI {
namespace Widget {
#if GTK_CHECK_VERSION(3, 0, 0)
#else
#endif
{
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
#endif
_initUI();
_selected_color.signal_changed.connect(sigc::mem_fun(this, &ColorNotebook::_onSelectedColorChanged));
_selected_color.signal_dragged.connect(sigc::mem_fun(this, &ColorNotebook::_onSelectedColorChanged));
}
{
if (_buttons) {
delete[] _buttons;
_buttons = 0;
}
}
{
}
{
notebook->set_show_border(false);
notebook->set_show_tabs(false);
#if GTK_CHECK_VERSION(3, 0, 0)
#else
#endif
_addPage(_available_pages[i]);
}
#if GTK_CHECK_VERSION(3, 0, 0)
#else
#endif
#else
attach(*Glib::wrap(_buttonbox), 0, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, static_cast<Gtk::AttachOptions>(0),
#endif
row++;
#if GTK_CHECK_VERSION(3, 0, 0)
#else
#endif
#else
attach(*notebook, 0, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, XPAD * 2, YPAD);
#endif
// restore the last active page
row++;
#if GTK_CHECK_VERSION(3, 0, 0)
#else
#endif
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
/* Create color management icons */
GtkWidget *colormanaged = gtk_image_new_from_icon_name("color-management-icon", GTK_ICON_SIZE_SMALL_TOOLBAR);
GtkWidget *outofgamut = gtk_image_new_from_icon_name("out-of-gamut-icon", GTK_ICON_SIZE_SMALL_TOOLBAR);
gtk_widget_set_sensitive(_box_outofgamut, false);
GtkWidget *toomuchink = gtk_image_new_from_icon_name("too-much-ink-icon", GTK_ICON_SIZE_SMALL_TOOLBAR);
gtk_widget_set_sensitive(_box_toomuchink, false);
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
/* Color picker */
g_signal_connect(G_OBJECT(_btn_picker), "clicked", G_CALLBACK(ColorNotebook::_onPickerClicked), this);
/* Create RGBA entry and color preview */
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
// the "too much ink" icon is initially hidden
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
#if GTK_CHECK_VERSION(3, 0, 0)
#else
#endif
#else
#endif
#ifdef SPCS_PREVIEW
#endif
}
{
// Set the dropper into a "one click" mode, so it reverts to the previous tool after a click
}
{
return;
}
}
}
}
void ColorNotebook::_onPageSwitched(GtkNotebook *notebook, GtkWidget *page, guint page_num, ColorNotebook *colorbook)
{
if (colorbook->get_visible()) {
// remember the page we switched to
}
}
// TODO pass in param so as to avoid the need for SP_ACTIVE_DOCUMENT
{
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
/* update color management icon*/
/* update out-of-gamut icon */
gtk_widget_set_sensitive(_box_outofgamut, false);
if (target_profile)
}
/* update too-much-ink icon */
gtk_widget_set_sensitive(_box_toomuchink, false);
Inkscape::ColorProfile *prof = SP_ACTIVE_DOCUMENT->profileManager->find(color.icc->colorProfile.c_str());
double ink_sum = 0;
}
/* Some literature states that when the sum of paint values exceed 320%, it is considered to be a satured
color,
which means the paper can get too wet due to an excessive ammount of ink. This may lead to several
issues
such as misalignment and poor quality of printing in general.*/
if (ink_sum > 3.2)
}
else {
}
}
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
}
{
}
}
{
if (selector_widget) {
selector_widget->show();
gint page_num = gtk_notebook_append_page(GTK_NOTEBOOK(_book), selector_widget->gobj(), tab_label->gobj());
if (page_num > 0) {
}
}
}
}
}
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :