![]() |
![]() |
![]() |
V_Sim API - Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Signals |
gtk_colorComboBoxWidgetgtk_colorComboBoxWidget — Defines a specialised GtkComboBox to choose stored colours. |
#include <coreTools/toolColor.h> VisuUiColorCombobox; VisuUiColorComboboxClass; GdkPixbuf * visu_ui_color_combobox_getPixbufFromColor (VisuUiColorCombobox *colorComboBox
,ToolColor *color
); float * visu_ui_color_combobox_getRangeColor (VisuUiColorCombobox *colorComboBox
); float * visu_ui_color_combobox_getRangeMaterial (VisuUiColorCombobox *colorComboBox
); GtkWidget * visu_ui_color_combobox_getRangeWidgets (VisuUiColorCombobox *colorComboBox
); ToolColor * visu_ui_color_combobox_getSelection (VisuUiColorCombobox *colorComboBox
); GtkWidget * visu_ui_color_combobox_new (gboolean hasAlphaChannel
); GtkWidget * visu_ui_color_combobox_newWithRanges (gboolean hasAlphaChannel
); void visu_ui_color_combobox_setExpanded (VisuUiColorCombobox *colorComboBox
,gboolean value
); void visu_ui_color_combobox_setPrintValues (VisuUiColorCombobox *colorComboBox
,gboolean value
); void visu_ui_color_combobox_setRangeColor (VisuUiColorCombobox *colorComboBox
,float rgba[4]
,gboolean raiseSignal
); void visu_ui_color_combobox_setRangeMaterial (VisuUiColorCombobox *colorComboBox
,float material[VISU_GL_LIGHT_MATERIAL_N_VALUES]
,gboolean raiseSignal
); gboolean visu_ui_color_combobox_setSelection (VisuUiColorCombobox *colorComboBox
,ToolColor *color
);
GObject +----GInitiallyUnowned +----GtkWidget +----GtkContainer +----GtkBin +----GtkComboBox +----VisuUiColorCombobox
VisuUiColorCombobox implements AtkImplementorIface, GtkBuildable, GtkCellLayout and GtkCellEditable.
This widget looks like a GtkComboBox and it displays a list
of stored colours. These colours may come from the configuration
files or can be selected and stored by the user actions. To do it,
the first entry of the combo box is 'new / modify', that opens a GTK
colour picker. The new values are used to craete a new colour entry
in the combo box. In a complete version, the combo box can have a
GtkVBox associated to modify colours without creating new entries, see
visu_ui_color_combobox_newWithRanges()
method. Otherwise, only already
selected colours are available. The stored colours are shared by
all widgets of this class. It is thus a convenient way to have
coherent colour picker through V_Sim.
When the widget is created with ranges, the additional part
can be retrieve with visu_ui_color_combobox_getRangeWidgets()
and attached
whereever is convenient. When the ranges are modified, the new
colour is not added to the combo box. It can be read using
visu_ui_color_combobox_getRangeColor()
or visu_ui_color_combobox_getRangeMaterial()
. The combo
box is set thus to an unselected state and
visu_ui_color_combobox_getSelection()
will return a NULL
pointer. Besides the colour ranges, there is an add button to
insert the newly defined colour into the combo box.
This widget can emit a "color-selected" signal that is a wrapper around the "changed" signal, but it is emitted only when a new colour is selected (either an existing one or a newly created from the picker). This colour is passed to the callback. The two other signals, "color-value-changed" and "material-value-changed", are generated when the widget have been created with ranges and that one of these ranges is modified.
typedef struct _VisuUiColorCombobox VisuUiColorCombobox;
Private structure to store informations of a VisuUiColorCombobox object.
Since 3.1
typedef struct _VisuUiColorComboboxClass VisuUiColorComboboxClass;
Private structure to store informations of a VisuUiColorComboboxClass object.
Since 3.1
GdkPixbuf * visu_ui_color_combobox_getPixbufFromColor (VisuUiColorCombobox *colorComboBox
,ToolColor *color
);
The colorComboBox
has little pixbufs to represent the color. User methods can
use these pixbufs but should considered them read-only.
|
a VisuUiColorCombobox widget ; |
|
a ToolColor object. |
Returns : |
a pixbuf pointer corresponding to the
little image shown on the colorComboBox . [transfer none]
|
Since 3.1
float * visu_ui_color_combobox_getRangeColor
(VisuUiColorCombobox *colorComboBox
);
If the colorComboBox
uses ranges (see visu_ui_color_combobox_newWithRanges()
), this method
is used to get the values from the color ranges.
|
a VisuUiColorCombobox widget. |
Returns : |
a newly created
array of size 4. Use g_free() to delete it. [array fixed-size=4][transfer full]
|
Since 3.2
float * visu_ui_color_combobox_getRangeMaterial
(VisuUiColorCombobox *colorComboBox
);
If the colorComboBox
uses ranges (see visu_ui_color_combobox_newWithRanges()
), this method
is used to get the values from the material ranges.
|
a VisuUiColorCombobox widget. |
Returns : |
a newly created array of size
VISU_GL_LIGHT_MATERIAL_N_VALUES (see VisuGlLightMaterial). Use g_free() to delete it. [array fixed-size=5][transfer full]
|
Since 3.3
GtkWidget * visu_ui_color_combobox_getRangeWidgets
(VisuUiColorCombobox *colorComboBox
);
Retrieve the wiodget using to represent the ranges, or NULL if the object has no ranges.
|
a ToolColor object. |
Returns : |
a widget owned by color . [transfer none]
|
Since 3.3
ToolColor * visu_ui_color_combobox_getSelection (VisuUiColorCombobox *colorComboBox
);
The user can access to the selected ToolColor object using this method.
|
a VisuUiColorCombobox widget. |
Returns : |
a pointer to the selected ToolColor object (or NULL). This object is read-only. [transfer none] |
Since 3.1
GtkWidget * visu_ui_color_combobox_new (gboolean hasAlphaChannel
);
A VisuUiColorCombobox widget is like a GtkComboBox widget, but it is already filled
with the colors stores in the structures adhoc in visu_tools.h. Using this widget
is a convienient way to share colors between all part of V_Sim and to give a consistent
look of all color selection. If the argument hasAlphaChannel
is FALSE, the widget
display all colors but without their alpha channel, assuming it to be fully opaque.
|
a boolean. |
Returns : |
a newly created VisuUiColorCombobox widget. [transfer full] |
Since 3.1
GtkWidget * visu_ui_color_combobox_newWithRanges
(gboolean hasAlphaChannel
);
Create a color combo and several ranges.
|
a boolean. |
Returns : |
a newly created VisuUiColorCombobox widget. [transfer full] |
Since 3.3
void visu_ui_color_combobox_setExpanded (VisuUiColorCombobox *colorComboBox
,gboolean value
);
Set the expanded state of the ranges. This is usable only if the colorComboBox has been created with ranges.
|
a ToolColor object ; |
|
a boolean value. |
Since 3.3
void visu_ui_color_combobox_setPrintValues (VisuUiColorCombobox *colorComboBox
,gboolean value
);
Print or not the RGB values.
|
a ToolColor object ; |
|
a boolean. |
Since 3.4
void visu_ui_color_combobox_setRangeColor (VisuUiColorCombobox *colorComboBox
,float rgba[4]
,gboolean raiseSignal
);
Change the values for the ranges that control the color. If the color exists
in the list, it is also selected.
This is possible only if the colorComboBox
has been created with
visu_ui_color_combobox_newWithRanges()
.
|
a VisuUiColorCombobox widget ; |
|
4 floating point values ; |
|
if TRUE a material-value-changed can be raised. |
Since 3.3
void visu_ui_color_combobox_setRangeMaterial (VisuUiColorCombobox *colorComboBox
,float material[VISU_GL_LIGHT_MATERIAL_N_VALUES]
,gboolean raiseSignal
);
Change the values for the ranges that control the light (emission, diffuse...).
This is possible only if the colorComboBox
has been created with
visu_ui_color_combobox_newWithRanges()
.
|
a VisuUiColorCombobox widget ; |
|
VISU_GL_LIGHT_MATERIAL_N_VALUES (see VisuGlLightMaterial) floating point values ; |
|
if TRUE a material-value-changed can be raised. |
Since 3.3
gboolean visu_ui_color_combobox_setSelection (VisuUiColorCombobox *colorComboBox
,ToolColor *color
);
Use this method to set the ComboBox on the given color. This emits a 'color-channel' signal if the color is changed, which means, a previous color has been modified, or a new color is selected.
|
a VisuUiColorCombobox widget ; |
|
a ToolColor object. |
Returns : |
TRUE if the color already exists in the model. |
Since 3.1
"color-selected"
signalvoid user_function (VisuUiColorCombobox *combo,
gpointer color,
gpointer user_data) : Action
This signal is emitted when a new valid colour is selected, either an existing one or newly created one.
|
the VisuUiColorCombobox that emits the signal ; |
|
the newly selected ToolColor. |
|
user data set when the signal handler was connected. |
Since 3.1
"color-value-changed"
signalvoid user_function (VisuUiColorCombobox *combo,
guint RGBA,
gpointer user_data) : Action
This signal is emitted when the range of a colour is modified.
|
the VisuUiColorCombobox that emits the signal ; |
|
the modified channel. |
|
user data set when the signal handler was connected. |
Since 3.3
"material-value-changed"
signalvoid user_function (VisuUiColorCombobox *combo,
guint mat,
gpointer user_data) : Action
This signal is emitted when the range of a material is modified.
|
the VisuUiColorCombobox that emits the signal ; |
|
the modified material channel (see VisuGlLightMaterial). |
|
user data set when the signal handler was connected. |
Since 3.3