G_CONST_RETURN gchar * gsm_color_button_get_title (GSMColorButton * color_button) { g_return_val_if_fail (GSM_IS_COLOR_BUTTON (color_button), NULL); return color_button->priv->title; }
guint gsm_color_button_get_cbtype (GSMColorButton * color_button) { g_return_val_if_fail (GSM_IS_COLOR_BUTTON (color_button), 0); return color_button->priv->type; }
gdouble gsm_color_button_get_fraction (GSMColorButton * color_button) { g_return_val_if_fail (GSM_IS_COLOR_BUTTON (color_button), 0); return color_button->priv->fraction; }
static void gsm_color_button_get_preferred_height (GtkWidget * widget, gint * minimum_height, gint * natural_height) { g_return_if_fail (widget != NULL && minimum_height != NULL && natural_height != NULL); g_return_if_fail (GSM_IS_COLOR_BUTTON (widget)); *minimum_height = GSMCP_MIN_HEIGHT; *natural_height = GSMCP_MIN_HEIGHT; }
static void gsm_color_button_get_preferred_width (GtkWidget * widget, gint * minimum_width, gint * natural_width) { g_return_if_fail (widget != NULL && minimum_width != NULL && natural_width != NULL); g_return_if_fail (GSM_IS_COLOR_BUTTON (widget)); *minimum_width = GSMCP_MIN_WIDTH; *natural_width = GSMCP_MIN_WIDTH; }
void gsm_color_button_get_color (GSMColorButton * color_button, GdkColor * color) { g_return_if_fail (GSM_IS_COLOR_BUTTON (color_button)); color->red = color_button->priv->color.red; color->green = color_button->priv->color.green; color->blue = color_button->priv->color.blue; }
static void gsm_color_button_size_request (GtkWidget * widget, GtkRequisition * requisition) { g_return_if_fail (widget != NULL || requisition != NULL); g_return_if_fail (GSM_IS_COLOR_BUTTON (widget)); requisition->width = GSMCP_MIN_WIDTH; requisition->height = GSMCP_MIN_HEIGHT; }
void gsm_color_button_set_cbtype (GSMColorButton * color_button, guint type) { g_return_if_fail (GSM_IS_COLOR_BUTTON (color_button)); color_button->priv->type = type; gtk_widget_queue_draw (GTK_WIDGET (&color_button->widget)); g_object_notify (G_OBJECT (color_button), "type"); }
void gsm_color_button_set_fraction (GSMColorButton * color_button, gdouble fraction) { g_return_if_fail (GSM_IS_COLOR_BUTTON (color_button)); color_button->priv->fraction = fraction; gtk_widget_queue_draw (GTK_WIDGET (&color_button->widget)); g_object_notify (G_OBJECT (color_button), "fraction"); }
void gsm_color_button_set_color (GSMColorButton * color_button, const GdkColor * color) { g_return_if_fail (GSM_IS_COLOR_BUTTON (color_button)); g_return_if_fail (color != NULL); color_button->priv->color.red = color->red; color_button->priv->color.green = color->green; color_button->priv->color.blue = color->blue; gtk_widget_queue_draw (GTK_WIDGET (&color_button->widget)); //->priv->draw_area); g_object_notify (G_OBJECT (color_button), "color"); }
static void gsm_color_button_size_allocate (GtkWidget * widget, GtkAllocation * allocation) { g_return_if_fail (widget != NULL || allocation != NULL); g_return_if_fail (GSM_IS_COLOR_BUTTON (widget)); gtk_widget_set_allocation (widget, allocation); if (gtk_widget_get_realized (widget)) { gdk_window_move_resize (gtk_widget_get_window (widget), allocation->x, allocation->y, allocation->width, allocation->height); } }
void gsm_color_button_set_title (GSMColorButton * color_button, const gchar * title) { gchar *old_title; g_return_if_fail (GSM_IS_COLOR_BUTTON (color_button)); old_title = color_button->priv->title; color_button->priv->title = g_strdup (title); g_free (old_title); if (color_button->priv->cs_dialog) gtk_window_set_title (GTK_WINDOW (color_button->priv->cs_dialog), color_button->priv->title); g_object_notify (G_OBJECT (color_button), "title"); }