gtk_shadeComboBoxWidget

gtk_shadeComboBoxWidget — Defines a specialised GtkComboBox to choose pre-built shades.

Synopsis

#include <coreTools/toolShade.h>

#define             SHADE_COMBOX_TYPE
#define             SHADE_COMBOX                        (obj)
#define             SHADE_COMBOX_CLASS                  (klass)
#define             IS_SHADE_COMBOX                     (obj)
#define             IS_SHADE_COMBOX_CLASS               (klass)
                    ShadeComboBox;
                    ShadeComboBoxClass;
GType               shadeComboBox_get_type              (void);
GtkWidget*          shadeComboBox_new                   (gboolean hasAlphaChannel,
                                                         gboolean showNames);
gboolean            shadeComboBoxSet_selectionByShade   (ShadeComboBox *shadeComboBox,
                                                         Shade *shade);
Shade*              shadeComboBoxGet_selectedShade      (ShadeComboBox *shadeComboBox);
GdkPixbuf*          shadeComboBoxGet_pixbufFromShade    (ShadeComboBox *shadeComboBox,
                                                         Shade *shade);
GdkPixbuf*          shadeComboBoxBuild_shadeStamp       (Shade *shade,
                                                         GdkPixbuf *pixbuf);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkBin
                                 +----GtkComboBox
                                       +----ShadeComboBox

Implemented Interfaces

ShadeComboBox implements AtkImplementorIface, GtkBuildable, GtkCellLayout and GtkCellEditable.

Signals

  "shade-selected"                                 : Run First / Action

Description

This widget looks like a GtkComboBox and it displays a list of preset colour shades. These patterns are defined by colour parameters, see Shade.

This widget can emit a "shade-selected" signal that is a wrapper around the "changed" signal, but it is emitted only when a new shade is selected and this shade is passed to the callback.

Details

SHADE_COMBOX_TYPE

#define SHADE_COMBOX_TYPE         (shadeComboBox_get_type ())

Return: the associated GType to the ShadeComboBox objects.

Since 3.3


SHADE_COMBOX()

#define SHADE_COMBOX(obj)         (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHADE_COMBOX_TYPE, ShadeComboBox))

Cast the given object to a ShadeComboBox object.

obj :

the widget to cast.

Since 3.3


SHADE_COMBOX_CLASS()

#define SHADE_COMBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHADE_COMBOX_TYPE, ShadeComboBoxClass))

Cast the given class to a ShadeComboBoxClass object.

klass :

the class to cast.

Since 3.3


IS_SHADE_COMBOX()

#define IS_SHADE_COMBOX(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHADE_COMBOX_TYPE))

Get if the given object is a valid ShadeComboBox object.

obj :

the object to test.

Since 3.3


IS_SHADE_COMBOX_CLASS()

#define IS_SHADE_COMBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHADE_COMBOX_TYPE))

Get if the given class is a valid ShadeComboBoxClass class.

klass :

the class to test.

Since 3.3


ShadeComboBox

typedef struct _ShadeComboBox ShadeComboBox;

Private structure to store informations of a ShadeComboBox object.

Since 3.3


ShadeComboBoxClass

typedef struct _ShadeComboBoxClass ShadeComboBoxClass;

Private structure to store informations of a ShadeComboBoxClass object.

Since 3.3


shadeComboBox_get_type ()

GType               shadeComboBox_get_type              (void);

GType are unique numbers to identify objects.

Returns :

the GType associated with ShadeComboBox objects.

Since 3.3


shadeComboBox_new ()

GtkWidget*          shadeComboBox_new                   (gboolean hasAlphaChannel,
                                                         gboolean showNames);

A ShadeComboBox widget is like a GtkComboBox widget, but it is already filled with the known shades. Using this widget is a convienient way to share shades between all part of V_Sim and to give a consistent look of all shade selection. If the argument hasAlphaChannel is FALSE, the widget display all shades but without their alpha channel, assuming it to be fully opaque.

hasAlphaChannel :

a boolean.

showNames :

if TRUE, the names of the shades are displayed.

Returns :

a newly created ShadeComboBox widget.

Since 3.3


shadeComboBoxSet_selectionByShade ()

gboolean            shadeComboBoxSet_selectionByShade   (ShadeComboBox *shadeComboBox,
                                                         Shade *shade);

Use this method to set the ComboBox on the given shade. This emits a 'shade-channel' signal if the shade is changed, which means, a previous shade has been modified, or a new shade is selected.

shadeComboBox :

a ShadeComboBox widget ;

shade :

a Shade object.

Returns :

TRUE if the shade already exists in the model.

Since 3.3


shadeComboBoxGet_selectedShade ()

Shade*              shadeComboBoxGet_selectedShade      (ShadeComboBox *shadeComboBox);

The user can access to the selected Shade object using this method.

shadeComboBox :

a ShadeComboBox widget.

Returns :

a pointer to the selected Shade object (or NULL). This object is read-only.

Since 3.3


shadeComboBoxGet_pixbufFromShade ()

GdkPixbuf*          shadeComboBoxGet_pixbufFromShade    (ShadeComboBox *shadeComboBox,
                                                         Shade *shade);

The shadeComboBox has little pixbufs to represent the shade. User methods can use these pixbufs but should considered them read-only.

shadeComboBox :

a ShadeComboBox widget ;

shade :

a Shade object.

Returns :

a pixbuf pointer corresponding to the little image shown on the shadeComboBox.

Since 3.3


shadeComboBoxBuild_shadeStamp ()

GdkPixbuf*          shadeComboBoxBuild_shadeStamp       (Shade *shade,
                                                         GdkPixbuf *pixbuf);

This method is used to create pixbuf representing shades. If pixbuf is given, it must be a valid pixbuf, and the shade is created in it. Otherwise, a new pixbuf is created.

shade :

a Shade object ;

pixbuf :

an existing pixbuf (can be NULL).

Returns :

a pixbuf pointer.

Since 3.3

Signal Details

The "shade-selected" signal

void                user_function                      (ShadeComboBox *combo,
                                                        gpointer       shade,
                                                        gpointer       user_data)      : Run First / Action

This signal is emitted when a new valid colour shade is selected.

combo :

the ShadeComboBox that emits the signal ;

shade :

the newly selected Shade.

user_data :

user data set when the signal handler was connected.

Since 3.3

See Also

StippleComboBox, Shade