eb05362005-11-05Henrik Grubbström (Grubba) /* -*- C -*- */
1a05542005-07-28Martin Nilsson 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 );
5e9fc02015-08-18Per Hedbor  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 );
1a05542005-07-28Martin Nilsson  f_aggregate_mapping( 8 );
5e9fc02015-08-18Per Hedbor  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 );
1a05542005-07-28Martin Nilsson  f_aggregate_mapping( 8 );
5e9fc02015-08-18Per Hedbor  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 );
1a05542005-07-28Martin Nilsson  f_aggregate_mapping( 8 ); f_aggregate_mapping( 6 ); }