sp-color-slider.cpp revision 18a6bbc590e5390fc822b0d84dabdb07921f6a3e
/*
* 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 {
};
/* static void sp_color_slider_draw (GtkWidget *widget, GdkRectangle *area); */
/* static void sp_color_slider_draw_focus (GtkWidget *widget); */
/* static void sp_color_slider_draw_default (GtkWidget *widget); */
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;
}
static void
{
G_TYPE_NONE, 0);
G_TYPE_NONE, 0);
G_TYPE_NONE, 0);
G_TYPE_NONE, 0);
/* widget_class->draw = sp_color_slider_draw; */
/* 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 */
}
static void
{
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;
}
static void
{
}
static void
{
if (gtk_widget_get_realized (widget)) {
/* Resize GdkWindow */
allocation->x, allocation->y,
}
}
static gint
{
if (gtk_widget_is_drawable (widget)) {
}
return FALSE;
}
static gint
{
}
return FALSE;
}
static gint
{
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 {
}
}
}
static void
{
const guchar *b;
gboolean colorsOnTop = Inkscape::Preferences::get()->getBool("/options/workarounds/colorsontop", false);
/* Widget area */
warea.x = 0;
warea.y = 0;
/* Color gradient area */
/* Arrow area */
/* Actual paintable area */
return;
}
b = NULL;
// Draw shadow
if (colorsOnTop) {
0, 0,
}
/* Paintable part of color gradient area */
gint s, d;
/* Render map pixelstore */
b = sp_color_slider_render_map (cpaint.x - carea.x, cpaint.y - carea.y, cpaint.width, cpaint.height,
if (b != NULL) {
}
} else {
gint i;
/* Render gradient */
// part 1: from c0 to cm
for (i = 0; i < 4; i++) {
}
c, dc,
/* Draw pixelstore */
if (b != NULL) {
}
}
// part 2: from cm to c1
for (i = 0; i < 4; i++) {
}
b = sp_color_slider_render_gradient (MAX(cpaint.x - carea.x, carea.width/2), cpaint.y - carea.y, wi, cpaint.height,
c, dc,
/* Draw pixelstore */
if (b != NULL) {
}
}
}
}
/* Draw shadow */
if (!colorsOnTop) {
0, 0,
}
/* Draw arrow */
x = aarea.x;
while ( w > 0 )
{
w -=2;
x++;
if ( w > 0 )
{
}
y1++;
y2--;
}
}
}
/* 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;
}