1
  
2
  
3
  
4
  
5
  
6
  
7
  
8
  
9
  
10
  
11
  
12
  
13
  
14
  
15
  
16
  
17
  
18
  
19
  
20
  
21
  
22
  
23
  
24
  
25
  
26
  
27
  
28
  
29
  
30
  
31
  
32
  
33
  
34
  
35
  
36
  
37
  
38
  
39
  
40
  
41
  
42
  
43
  
44
  
45
  
46
  
47
  
48
  
49
  
50
  
51
  
52
  
53
  
54
  
55
  
56
  
57
  
58
  
59
  
60
  
61
  
62
  
63
  
64
  
65
  
66
  
67
  
68
  
69
  
70
  
71
  
72
  
73
  
74
  
75
  
76
  
77
  
78
  
79
  
80
  
81
  
82
  
83
  
84
  
85
  
86
  
87
  
88
  
89
  
90
  
91
  
/* -*- C -*- */ 
require gnome; 
class Gnome.ColorPicker; 
inherit GTK.Button; 
 
//! This widget provides color selection facilities to your 
//! application. The widget appears as a button which contains a "color 
//! swatch" of the currently selected color. When the button is 
//! pressed, the widget presents the user with a color selection dialog 
//! where the color can be selected. 
//! <p> 
//! You can select the color to be displayed in a number of ways: 
//! floating point values for the red, green and blue channels, 
//! integers in the range 0 to 65,535, or integers in the range 0 to 
//! 255, depending on your needs. 
//! IMG: Gnome.ColorPicker(); 
//! </p> 
signal color_set; 
//! This signal is emitted when the user changes the color on the color 
//! selector. The values passed to this signal are the red, green, blue 
//! and alpha channels selected in integer form in the range 0 to 
//! 65535. 
 
void create(); 
//! Creates a new GNOME color picker widget. This returns a widget in 
//! the form of a small button containing a swatch representing the 
//! current selected color. When the button is clicked, a 
//! color-selection dialog will open, allowing the user to select a 
//! color. The swatch will be updated to reflect the new color when the 
//! user finishes. 
 
void set_d( float r, float g, float b, float a ); 
//! Set color shown in the color picker widget using floating point values. 
//! The values range between 0.0 and 1.0. 
 
void set_i8( int r, int g, int b, int a); 
//! Set color shown in the color picker widget using integer values. 
//! The values range between 0 and 255. 
 
void set_i16( int r, int g, int b, int a ); 
//! Set color shown in the color picker widget using integer values. 
//! The values range between 0 and 65535. 
 
void set_dither( int dither ); 
//! Sets whether the picker should dither the color sample or just 
//! paint a solid rectangle. 
 
void set_use_alpha( int use_alpha ); 
//! Sets whether or not the picker should use the alpha channel. 
 
void set_title( string title ); 
//! Sets the title for the color selection dialog 
 
mapping get() 
//! Returns a mapping ([ "d":([ "r":rvalue, "g":gvalue, "b":bvalue, 
//! "a":avalue ]), "i8":([ ... ]), "i16":([ .. ]) ]); 
{ 
  guint8 r8, g8, b8, a8; 
  gdouble r, g, b, a; 
  gushort r16, g16, b16, a16; 
 
  gnome_color_picker_get_d( GNOME_COLOR_PICKER( THIS->obj ), 
                            &r, &g, &b, &a ); 
  gnome_color_picker_get_i8( GNOME_COLOR_PICKER( THIS->obj ), 
                             &r8, &g8, &b8, &a8 ); 
  gnome_color_picker_get_i16( GNOME_COLOR_PICKER( THIS->obj ), 
                              &r16, &g16, &b16, &a16 ); 
 
  pop_n_elems( args ); 
  push_static_text( "d" ); 
  push_static_text( "r" ); push_float( r ); 
  push_static_text( "g" ); push_float( g ); 
  push_static_text( "b" ); push_float( b ); 
  push_static_text( "a" ); push_float( a ); 
  f_aggregate_mapping( 8 ); 
  push_static_text( "i8" ); 
  push_static_text( "r" ); push_int( r8 ); 
  push_static_text( "g" ); push_int( g8 ); 
  push_static_text( "b" ); push_int( b8 ); 
  push_static_text( "a" ); push_int( a8 ); 
  f_aggregate_mapping( 8 ); 
  push_static_text( "i16" ); 
  push_static_text( "r" ); push_int( r16 ); 
  push_static_text( "g" ); push_int( g16 ); 
  push_static_text( "b" ); push_int( b16 ); 
  push_static_text( "a" ); push_int( a16 ); 
  f_aggregate_mapping( 8 ); 
  f_aggregate_mapping( 6 ); 
}