mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-18 17:30:10 +00:00
Seal GtkColorSelectionDialog
svn path=/trunk/; revision=20539
This commit is contained in:
parent
a04318013f
commit
19431e8b51
@ -35,6 +35,14 @@
|
|||||||
#include "gtkbuildable.h"
|
#include "gtkbuildable.h"
|
||||||
#include "gtkalias.h"
|
#include "gtkalias.h"
|
||||||
|
|
||||||
|
enum {
|
||||||
|
PROP_0,
|
||||||
|
PROP_COLOR_SELECTION,
|
||||||
|
PROP_OK_BUTTON,
|
||||||
|
PROP_CANCEL_BUTTON,
|
||||||
|
PROP_HELP_BUTTON
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/***************************/
|
/***************************/
|
||||||
/* GtkColorSelectionDialog */
|
/* GtkColorSelectionDialog */
|
||||||
@ -52,9 +60,70 @@ G_DEFINE_TYPE_WITH_CODE (GtkColorSelectionDialog, gtk_color_selection_dialog,
|
|||||||
|
|
||||||
static GtkBuildableIface *parent_buildable_iface;
|
static GtkBuildableIface *parent_buildable_iface;
|
||||||
|
|
||||||
|
static void
|
||||||
|
gtk_color_selection_dialog_get_property (GObject *object,
|
||||||
|
guint prop_id,
|
||||||
|
GValue *value,
|
||||||
|
GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
GtkColorSelectionDialog *colorsel;
|
||||||
|
|
||||||
|
colorsel = GTK_COLOR_SELECTION_DIALOG (object);
|
||||||
|
|
||||||
|
switch (prop_id)
|
||||||
|
{
|
||||||
|
case PROP_COLOR_SELECTION:
|
||||||
|
g_value_set_object (value, colorsel->colorsel);
|
||||||
|
break;
|
||||||
|
case PROP_OK_BUTTON:
|
||||||
|
g_value_set_object (value, colorsel->ok_button);
|
||||||
|
break;
|
||||||
|
case PROP_CANCEL_BUTTON:
|
||||||
|
g_value_set_object (value, colorsel->cancel_button);
|
||||||
|
break;
|
||||||
|
case PROP_HELP_BUTTON:
|
||||||
|
g_value_set_object (value, colorsel->help_button);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_color_selection_dialog_class_init (GtkColorSelectionDialogClass *klass)
|
gtk_color_selection_dialog_class_init (GtkColorSelectionDialogClass *klass)
|
||||||
{
|
{
|
||||||
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||||
|
gobject_class->get_property = gtk_color_selection_dialog_get_property;
|
||||||
|
|
||||||
|
g_object_class_install_property (gobject_class,
|
||||||
|
PROP_COLOR_SELECTION,
|
||||||
|
g_param_spec_object ("color-selection",
|
||||||
|
P_("Color Selection"),
|
||||||
|
P_("The color selection embedded in the dialog."),
|
||||||
|
GTK_TYPE_WIDGET,
|
||||||
|
G_PARAM_READABLE));
|
||||||
|
g_object_class_install_property (gobject_class,
|
||||||
|
PROP_OK_BUTTON,
|
||||||
|
g_param_spec_object ("ok-button",
|
||||||
|
P_("OK Button"),
|
||||||
|
P_("The OK button of the dialog."),
|
||||||
|
GTK_TYPE_WIDGET,
|
||||||
|
G_PARAM_READABLE));
|
||||||
|
g_object_class_install_property (gobject_class,
|
||||||
|
PROP_CANCEL_BUTTON,
|
||||||
|
g_param_spec_object ("cancel-button",
|
||||||
|
P_("Cancel Button"),
|
||||||
|
P_("The cancel button of the dialog."),
|
||||||
|
GTK_TYPE_WIDGET,
|
||||||
|
G_PARAM_READABLE));
|
||||||
|
g_object_class_install_property (gobject_class,
|
||||||
|
PROP_HELP_BUTTON,
|
||||||
|
g_param_spec_object ("help-button",
|
||||||
|
P_("Help Button"),
|
||||||
|
P_("The help button of the dialog."),
|
||||||
|
GTK_TYPE_WIDGET,
|
||||||
|
G_PARAM_READABLE));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -118,6 +187,62 @@ gtk_color_selection_dialog_new (const gchar *title)
|
|||||||
return GTK_WIDGET (colorseldiag);
|
return GTK_WIDGET (colorseldiag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gtk_color_selection_dialog_get_color_selection:
|
||||||
|
* @colorsel: a #GtkColorSelectionDialog
|
||||||
|
*
|
||||||
|
* Retrieves the #GtkColorSelection widget embedded in the dialog.
|
||||||
|
*
|
||||||
|
* Since: GSEAL-branch
|
||||||
|
**/
|
||||||
|
GtkWidget*
|
||||||
|
gtk_color_selection_dialog_get_color_selection (GtkColorSelectionDialog *colorsel)
|
||||||
|
{
|
||||||
|
return colorsel->colorsel;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gtk_color_selection_dialog_get_ok_button:
|
||||||
|
* @colorsel: a #GtkColorSelectionDialog
|
||||||
|
*
|
||||||
|
* Retrieves the OK button of the dialog.
|
||||||
|
*
|
||||||
|
* Since: GSEAL-branch
|
||||||
|
**/
|
||||||
|
GtkWidget*
|
||||||
|
gtk_color_selection_dialog_get_ok_button (GtkColorSelectionDialog *colorsel)
|
||||||
|
{
|
||||||
|
return colorsel->ok_button;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gtk_color_selection_dialog_get_cancel_button:
|
||||||
|
* @colorsel: a #GtkColorSelectionDialog
|
||||||
|
*
|
||||||
|
* Retrieves the cancel button of the dialog.
|
||||||
|
*
|
||||||
|
* Since: GSEAL-branch
|
||||||
|
**/
|
||||||
|
GtkWidget*
|
||||||
|
gtk_color_selection_dialog_get_cancel_button (GtkColorSelectionDialog *colorsel)
|
||||||
|
{
|
||||||
|
return colorsel->cancel_button;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gtk_color_selection_dialog_get_help_button:
|
||||||
|
* @colorsel: a #GtkColorSelectionDialog
|
||||||
|
*
|
||||||
|
* Retrieves the help button of the dialog.
|
||||||
|
*
|
||||||
|
* Since: GSEAL-branch
|
||||||
|
**/
|
||||||
|
GtkWidget*
|
||||||
|
gtk_color_selection_dialog_get_help_button (GtkColorSelectionDialog *colorsel)
|
||||||
|
{
|
||||||
|
return colorsel->help_button;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_color_selection_dialog_buildable_interface_init (GtkBuildableIface *iface)
|
gtk_color_selection_dialog_buildable_interface_init (GtkBuildableIface *iface)
|
||||||
{
|
{
|
||||||
|
@ -53,10 +53,10 @@ struct _GtkColorSelectionDialog
|
|||||||
{
|
{
|
||||||
GtkDialog parent_instance;
|
GtkDialog parent_instance;
|
||||||
|
|
||||||
GtkWidget *colorsel;
|
GtkWidget *GSEAL (colorsel);
|
||||||
GtkWidget *ok_button;
|
GtkWidget *GSEAL (ok_button);
|
||||||
GtkWidget *cancel_button;
|
GtkWidget *GSEAL (cancel_button);
|
||||||
GtkWidget *help_button;
|
GtkWidget *GSEAL (help_button);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GtkColorSelectionDialogClass
|
struct _GtkColorSelectionDialogClass
|
||||||
@ -72,8 +72,12 @@ struct _GtkColorSelectionDialogClass
|
|||||||
|
|
||||||
|
|
||||||
/* ColorSelectionDialog */
|
/* ColorSelectionDialog */
|
||||||
GType gtk_color_selection_dialog_get_type (void) G_GNUC_CONST;
|
GType gtk_color_selection_dialog_get_type (void) G_GNUC_CONST;
|
||||||
GtkWidget* gtk_color_selection_dialog_new (const gchar *title);
|
GtkWidget* gtk_color_selection_dialog_new (const gchar *title);
|
||||||
|
GtkWidget* gtk_color_selection_dialog_get_color_selection (GtkColorSelectionDialog *colorsel);
|
||||||
|
GtkWidget* gtk_color_selection_dialog_get_ok_button (GtkColorSelectionDialog *colorsel);
|
||||||
|
GtkWidget* gtk_color_selection_dialog_get_cancel_button (GtkColorSelectionDialog *colorsel);
|
||||||
|
GtkWidget* gtk_color_selection_dialog_get_help_button (GtkColorSelectionDialog *colorsel);
|
||||||
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
Loading…
Reference in New Issue
Block a user