sp-color-notebook.cpp revision e0129c5f1532a27a4fed2d603836741b3598859a
#define __SP_COLOR_NOTEBOOK_C__
/*
* A notebook with RGB, CMYK, CMS, HSL, and Wheel pages
*
* Author:
* Lauris Kaplinski <lauris@kaplinski.com>
* bulia byak <buliabyak@users.sf.net>
*
* Copyright (C) 2001-2002 Lauris Kaplinski
*
* 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 "../dialogs/dialog-events.h"
#include "../preferences.h"
#include "sp-color-notebook.h"
#include "spw-utilities.h"
#include "sp-color-scales.h"
#include "sp-color-icc-selector.h"
#include "sp-color-wheel-selector.h"
struct SPColorNotebookTracker {
};
static SPColorSelectorClass *parent_class;
#define XPAD 4
#define YPAD 1
{
if (!type) {
sizeof(SPColorNotebookClass),
0, // base_init
0, // base_finalize
0, // class_finalize
0, // class_data
sizeof(SPColorNotebook),
0, // n_preallocs
0 // value_table
};
type = g_type_register_static(SP_TYPE_COLOR_SELECTOR, "SPColorNotebook", &info, static_cast<GTypeFlags>(0));
}
return type;
}
static void
{
}
static void
{
if ( colorbook )
{
// remember the page we seitched to
}
}
{
{
csel = getCurrentSelector();
}
{
// Temporary workaround to undo a spurious GRABBED
_released();
}
}
{
{
/* Tell calling code that we have handled this event; the buck
* stops here. */
return TRUE;
}
/* Tell calling code that we have not handled this event; pass it on. */
return FALSE;
}
{
return TRUE;
}
{
if ( entry )
{
if ( active )
{
((ColorNotebook*)(SP_COLOR_SELECTOR(entry->backPointer)->base))->addPage(entry->type, entry->submode);
}
else
{
((ColorNotebook*)(SP_COLOR_SELECTOR(entry->backPointer)->base))->removePage(entry->type, entry->submode);
}
}
}
static void
{
{
}
}
void ColorNotebook::init()
{
guint i = 0;
guint j = 0;
GType *selector_types = 0;
guint selector_type_count = 0;
/* tempory hardcoding to get types loaded */
#if ENABLE_LCMS
#endif // ENABLE_LCMS
/* REJON: Comment out the next line to not use the normal GTK Color
wheel. */
// SP_TYPE_COLOR_GTKSELECTOR;
_btn = 0;
_popup = 0;
_trackerList = g_ptr_array_new ();
_book = gtk_notebook_new ();
for ( i = 0; i < selector_type_count; i++ )
{
{
{
for ( j = 0; j < howmany; j++ )
{
SPColorNotebookTracker *entry = reinterpret_cast< SPColorNotebookTracker* > (malloc(sizeof(SPColorNotebookTracker)));
if ( entry )
{
}
}
}
}
}
for ( i = 0; i < _trackerList->len; i++ )
{
if ( entry )
{
}
}
// restore the last active page
{
_popup = gtk_menu_new();
for ( i = 0; i < _trackerList->len; i++ )
{
SPColorNotebookTracker *entry = reinterpret_cast< SPColorNotebookTracker* > (g_ptr_array_index (_trackerList, i));
if ( entry )
{
}
}
_btn = gtk_button_new ();
// but first fix it so it remembers its settings in prefs and does not take that much space (entire vertical column!)
//gtk_table_attach (GTK_TABLE (table), align, 2, 3, row, row + 1, GTK_FILL, GTK_FILL, XPAD, YPAD);
gtk_signal_connect_object(GTK_OBJECT(_btn), "event", GTK_SIGNAL_FUNC (sp_color_notebook_menu_handler), GTK_OBJECT(_csel));
if ( !found )
{
}
}
row++;
/* Create color management icons */
GtkWidget *colormanaged = gtk_image_new_from_icon_name ("color-management-icon", GTK_ICON_SIZE_SMALL_TOOLBAR);
//gtk_widget_hide (GTK_WIDGET (box_colormanaged));
GtkWidget *outofgamut = gtk_image_new_from_icon_name ("out-of-gamut-icon", GTK_ICON_SIZE_SMALL_TOOLBAR);
//gtk_widget_hide (GTK_WIDGET (box_outofgamut));
/* Create RGBA entry and color preview */
_rgbae = gtk_entry_new ();
gtk_table_attach (GTK_TABLE (table), rgbabox, 1, 2, row, row + 1, GTK_FILL, GTK_SHRINK, XPAD, YPAD);
#ifdef SPCS_PREVIEW
#endif
_entryId = gtk_signal_connect (GTK_OBJECT (_rgbae), "changed", GTK_SIGNAL_FUNC (ColorNotebook::_rgbaEntryChangedHook), _csel);
}
static void
{
}
{
if ( _trackerList )
{
_trackerList = 0;
}
if ( _switchId )
{
if ( _book )
{
_switchId = 0;
}
}
}
static void
{
}
static void
{
}
sp_color_notebook_new (void)
{
return GTK_WIDGET (colorbook);
}
: ColorSelector( csel )
{
}
{
if ( current_page >= 0 )
{
if ( SP_IS_COLOR_SELECTOR (widget) )
{
}
}
return csel;
}
void ColorNotebook::_colorChanged()
{
if ( cselPage )
{
}
}
{
}
{
if (_updating) return;
if (_updatingrgba) return;
if (t) {
bool changed = false;
changed = true;
// it was a standard RGB hex
}
}
if ( len < 8 ) {
}
if ( changed ) {
}
}
}
}
{
if ( !_updatingrgba )
{
gchar s[32];
/* Update RGBA entry */
{
}
}
}
{
}
{
}
{
}
{
}
{
}
{
if ( page )
{
if ( submode > 0 )
{
}
// g_message( "Hitting up for tab for '%s'", str );
}
return page;
}
{
gint i = 0;
// count = gtk_notebook_get_n_pages (_book);
count = 200;
{
if ( page )
{
{
// found it.
break;
}
else
{
page = 0;
}
}
else
{
break;
}
}
return page;
}
{
if ( page )
{
if ( where >= 0 )
{
{
// getColorAlpha(_color, &_alpha);
}
}
}
}
/*
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:encoding=utf-8:textwidth=99 :