sp-color-slider.cpp revision d0bc51c6482b98d6e238aaa3e0a9d6a42a925126
/*
* A slider with colored background
*
* Author:
* Lauris Kaplinski <lauris@kaplinski.com>
* bulia byak <buliabyak@users.sf.net>
*
* Copyright (C) 2001-2002 Lauris Kaplinski
*
* This code is in public domain
*/
#include "sp-color-scales.h"
#include "preferences.h"
#define SLIDER_WIDTH 96
#define SLIDER_HEIGHT 8
#define ARROW_SIZE 7
enum {
};
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
static void sp_color_slider_adjustment_value_changed (GtkAdjustment *adjustment, SPColorSlider *slider);
static GtkWidgetClass *parent_class;
sp_color_slider_get_type (void)
{
if (!type) {
sizeof (SPColorSliderClass),
sizeof (SPColorSlider),
0,
};
}
return type;
}
{
G_TYPE_NONE, 0);
G_TYPE_NONE, 0);
G_TYPE_NONE, 0);
G_TYPE_NONE, 0);
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
/* widget_class->draw_focus = sp_color_slider_draw_focus; */
/* widget_class->draw_default = sp_color_slider_draw_default; */
}
static void
{
/* We are widget with window */
}
{
if (slider->adjustment) {
g_signal_handlers_disconnect_matched (G_OBJECT (slider->adjustment), G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, slider);
}
}
static void
{
attributes.x = allocation.x;
attributes.y = allocation.y;
#if !GTK_CHECK_VERSION(3,0,0)
#endif
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
#if !GTK_CHECK_VERSION(3,0,0)
// This doesn't do anything in GTK+ 3
#endif
}
static void
{
}
#if GTK_CHECK_VERSION(3,0,0)
static void sp_color_slider_get_preferred_width(GtkWidget *widget, gint *minimal_width, gint *natural_width)
{
}
static void sp_color_slider_get_preferred_height(GtkWidget *widget, gint *minimal_height, gint *natural_height)
{
}
#endif
static void
{
if (gtk_widget_get_realized (widget)) {
/* Resize GdkWindow */
allocation->x, allocation->y,
}
}
#if !GTK_CHECK_VERSION(3,0,0)
{
if (gtk_widget_is_drawable(widget)) {
}
return result;
}
#endif
static gint
{
#if GTK_CHECK_VERSION(3,0,0)
NULL,
#else
#endif
}
return FALSE;
}
static gint
{
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
if (slider->value != slider->oldvalue) g_signal_emit (G_OBJECT (slider), slider_signals[CHANGED], 0);
}
return FALSE;
}
static gint
{
}
return FALSE;
}
{
return GTK_WIDGET (slider);
}
{
if (!adjustment) {
} else {
}
if (slider->adjustment) {
g_signal_handlers_disconnect_matched (G_OBJECT (slider->adjustment), G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, slider);
}
}
}
void
{
// Remove any map, if set
}
void
{
}
void
{
}
static void
{
}
static void
{
} else {
}
}
}
{
gboolean colorsOnTop = Inkscape::Preferences::get()->getBool("/options/workarounds/colorsontop", false);
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
// Draw shadow
if (colorsOnTop) {
#if GTK_CHECK_VERSION(3,0,0)
cr,
0, 0,
#else
0, 0,
#endif
}
/* Paintable part of color gradient area */
#if GTK_CHECK_VERSION(3,0,0)
&padding);
#else
#endif
/* Render map pixelstore */
gint s = 0;
}
} else {
/* Render gradient */
// part 1: from c0 to cm
for (gint i = 0; i < 4; i++) {
}
/* Draw pixelstore 1 */
}
}
// part 2: from cm to c1
for (gint i = 0; i < 4; i++) {
}
c, dc,
/* Draw pixelstore 2 */
}
}
}
/* Draw shadow */
if (!colorsOnTop) {
#if GTK_CHECK_VERSION(3,0,0)
cr,
0, 0,
#else
0, 0,
#endif
}
/* Draw arrow */
gint w = ARROW_SIZE;
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
while ( w > 0 )
{
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
w -=2;
x++;
if ( w > 0 )
{
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
}
y1++;
y2--;
}
return FALSE;
}
/* Colors are << 16 */
static const guchar *
{
gint x, y;
guint r, g, b, a;
}
if (!buf) {
}
r = c[0];
g = c[1];
b = c[2];
a = c[3];
guchar *d;
cr = r >> 16;
cg = g >> 16;
cb = b >> 16;
ca = a >> 16;
d = dp;
/* Background value */
d += 3 * width;
}
r += dc[0];
g += dc[1];
b += dc[2];
a += dc[3];
dp += 3;
}
return buf;
}
/* Positions are << 16 */
static const guchar *
{
gint x, y;
}
if (!buf) {
}
guchar *d;
d = dp;
/* Background value */
d += 3 * width;
}
dp += 3;
}
return buf;
}