本文整理汇总了C++中GTK_CELL_RENDERER_CLASS函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_CELL_RENDERER_CLASS函数的具体用法?C++ GTK_CELL_RENDERER_CLASS怎么用?C++ GTK_CELL_RENDERER_CLASS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GTK_CELL_RENDERER_CLASS函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fm_cell_renderer_text_class_init
static void fm_cell_renderer_text_class_init(FmCellRendererTextClass *klass)
{
GObjectClass *g_object_class = G_OBJECT_CLASS(klass);
GtkCellRendererClass* render_class = GTK_CELL_RENDERER_CLASS(klass);
g_object_class->get_property = fm_cell_renderer_text_get_property;
g_object_class->set_property = fm_cell_renderer_text_set_property;
render_class->render = fm_cell_renderer_text_render;
render_class->get_size = fm_cell_renderer_text_get_size;
#if GTK_CHECK_VERSION(3, 0, 0)
render_class->get_preferred_width = fm_cell_renderer_text_get_preferred_width;
render_class->get_preferred_height = fm_cell_renderer_text_get_preferred_height;
render_class->get_preferred_height_for_width = fm_cell_renderer_text_get_preferred_height_for_width;
#endif
/**
* FmCellRendererText:max-height:
*
* The #FmCellRendererText:max-height property is the maximum height
* of text that will be rendered. If text doesn't fit in that height
* then text will be ellipsized. The value of -1 means unlimited
* height.
*
* Since: 1.0.2
*/
g_object_class_install_property(g_object_class,
PROP_HEIGHT,
g_param_spec_int("max-height",
"Maximum_height",
"Maximum height",
-1, 2048, -1,
G_PARAM_READWRITE));
}
示例2: egg_cell_renderer_keys_get_size
static void
egg_cell_renderer_keys_get_size (GtkCellRenderer *cell,
GtkWidget *widget,
const GdkRectangle *cell_area,
gint *x_offset,
gint *y_offset,
gint *width,
gint *height)
{
EggCellRendererKeys *keys = (EggCellRendererKeys *) cell;
GtkRequisition requisition;
if (keys->sizing_label == NULL)
keys->sizing_label = gtk_label_new (TOOLTIP_TEXT);
#if GTK_CHECK_VERSION (3,0,0)
gtk_widget_get_preferred_size (keys->sizing_label, NULL, &requisition);
#else
gtk_widget_size_request (keys->sizing_label, &requisition);
#endif
(* GTK_CELL_RENDERER_CLASS (parent_class)->get_size) (cell, widget, cell_area, x_offset, y_offset, width, height);
/* FIXME: need to take the cell_area et al. into account */
if (width)
*width = MAX (*width, requisition.width);
if (height)
*height = MAX (*height, requisition.height);
}
示例3: parasite_property_cell_renderer_class_init
static void
parasite_property_cell_renderer_class_init(
ParasitePropertyCellRendererClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS(klass);
GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS(klass);
object_class->get_property = parasite_property_cell_renderer_get_property;
object_class->set_property = parasite_property_cell_renderer_set_property;
cell_class->start_editing = parasite_property_cell_renderer_start_editing;
g_object_class_install_property(object_class,
PROP_OBJECT,
g_param_spec_object("object",
"Object",
"The object owning the property",
G_TYPE_OBJECT,
G_PARAM_READWRITE));
g_object_class_install_property(object_class,
PROP_NAME,
g_param_spec_string("name",
"Name",
"The property name",
NULL,
G_PARAM_READWRITE));
g_type_class_add_private(object_class,
sizeof(ParasitePropertyCellRendererPrivate));
}
示例4: empathy_cell_renderer_activatable_class_init
static void
empathy_cell_renderer_activatable_class_init (
EmpathyCellRendererActivatableClass *klass)
{
GtkCellRendererClass *cell_class;
GObjectClass *oclass;
oclass = G_OBJECT_CLASS (klass);
oclass->get_property = cell_renderer_activatable_get_property;
oclass->set_property = cell_renderer_activatable_set_property;
cell_class = GTK_CELL_RENDERER_CLASS (klass);
cell_class->activate = cell_renderer_activatable_activate;
cell_class->render = cell_renderer_activatable_render;
signals[PATH_ACTIVATED] =
g_signal_new ("path-activated",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE,
1, G_TYPE_STRING);
g_object_class_install_property (oclass, PROP_SHOW_ON_SELECT,
g_param_spec_boolean ("show-on-select",
"Show on select",
"Whether the cell renderer should be shown only when it's selected",
FALSE,
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE));
g_type_class_add_private (klass,
sizeof (EmpathyCellRendererActivatablePriv));
}
示例5: gimp_cell_renderer_button_class_init
static void
gimp_cell_renderer_button_class_init (GimpCellRendererButtonClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS (klass);
/**
* GimpCellRendererButton::clicked:
* @cell:
* @path:
* @state:
*
* Called on a button cell when it is clicked.
**/
button_cell_signals[CLICKED] =
g_signal_new ("clicked",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GimpCellRendererButtonClass, clicked),
NULL, NULL,
gimp_marshal_VOID__STRING_FLAGS,
G_TYPE_NONE, 2,
G_TYPE_STRING,
GDK_TYPE_MODIFIER_TYPE);
cell_class->activate = gimp_cell_renderer_button_activate;
klass->clicked = NULL;
}
示例6: gm_cell_renderer_bitext_class_init
static void
gm_cell_renderer_bitext_class_init (GmCellRendererBitextClass* klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GtkCellRendererClass* cell_class = GTK_CELL_RENDERER_CLASS (klass);
GParamSpec *spec = NULL;
g_type_class_add_private (klass, sizeof (GmCellRendererBitextPrivate));
cell_class->get_preferred_height_for_width = gm_cell_renderer_bitext_get_preferred_height_for_width;
cell_class->render = gm_cell_renderer_bitext_render;
gobject_class->finalize = gm_cell_renderer_bitext_finalize;
gobject_class->get_property = gm_cell_renderer_bitext_get_property;
gobject_class->set_property = gm_cell_renderer_bitext_set_property;
spec = g_param_spec_string ("primary-text",
"Primary text",
"Primary text",
NULL, (GParamFlags) G_PARAM_READWRITE);
g_object_class_install_property (gobject_class,
GM_CELL_RENDERER_BITEXT_PROP_PRIMARY_TEXT,
spec);
spec = g_param_spec_string ("secondary-text",
"Secondary text",
"Secondary text",
NULL, (GParamFlags) G_PARAM_READWRITE);
g_object_class_install_property (gobject_class,
GM_CELL_RENDERER_BITEXT_PROP_SECONDARY_TEXT,
spec);
}
示例7: hippo_person_renderer_class_init
static void
hippo_person_renderer_class_init(HippoPersonRendererClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS(klass);
GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS(klass);
object_class->finalize = hippo_person_renderer_finalize;
object_class->get_property = hippo_person_renderer_get_property;
object_class->set_property = hippo_person_renderer_set_property;
cell_class->get_size = hippo_person_renderer_get_size;
cell_class->render = hippo_person_renderer_render;
g_object_class_install_property(object_class,
PROP_PERSON,
g_param_spec_object("person",
_("Person Object"),
_("The person to render"),
HIPPO_TYPE_PERSON,
G_PARAM_READWRITE));
g_object_class_install_property(object_class,
PROP_PHOTO,
g_param_spec_object("photo",
_("Photo pixbuf"),
_("The pixbuf to render for this person"),
GDK_TYPE_PIXBUF,
G_PARAM_READWRITE));
}
示例8: gcrd_class_init
static void
gcrd_class_init (GncCellRendererDateClass *klass)
{
GncCellRendererPopupClass *popup_class;
GtkCellRendererClass *cell_class;
GObjectClass *gobject_class;
popup_class = GNC_CELL_RENDERER_POPUP_CLASS (klass);
cell_class = GTK_CELL_RENDERER_CLASS (klass);
parent_class = GNC_CELL_RENDERER_POPUP_CLASS (g_type_class_peek_parent (klass));
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->set_property = gcrd_set_property;
gobject_class->get_property = gcrd_get_property;
cell_class->start_editing = gcrd_start_editing;
popup_class->show_popup = gcrd_show;
popup_class->hide_popup = gcrd_hide;
g_object_class_install_property (
gobject_class,
PROP_USE_BUTTONS,
g_param_spec_boolean ("use-buttons",
NULL,
NULL,
TRUE,
G_PARAM_READWRITE));
}
示例9: gd_two_lines_renderer_class_init
static void
gd_two_lines_renderer_class_init (GdTwoLinesRendererClass *klass)
{
GtkCellRendererClass *cclass = GTK_CELL_RENDERER_CLASS (klass);
GObjectClass *oclass = G_OBJECT_CLASS (klass);
cclass->render = gd_two_lines_renderer_render;
cclass->get_preferred_width = gd_two_lines_renderer_get_preferred_width;
cclass->get_preferred_height = gd_two_lines_renderer_get_preferred_height;
cclass->get_preferred_height_for_width = gd_two_lines_renderer_get_preferred_height_for_width;
cclass->get_aligned_area = gd_two_lines_renderer_get_aligned_area;
oclass->set_property = gd_two_lines_renderer_set_property;
oclass->get_property = gd_two_lines_renderer_get_property;
oclass->finalize = gd_two_lines_renderer_finalize;
properties[PROP_TEXT_LINES] =
g_param_spec_int ("text-lines",
"Lines of text",
"The total number of lines to be displayed",
2, G_MAXINT, 2,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
properties[PROP_LINE_TWO] =
g_param_spec_string ("line-two",
"Second line",
"Second line",
NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
g_type_class_add_private (klass, sizeof (GdTwoLinesRendererPrivate));
g_object_class_install_properties (oclass, NUM_PROPERTIES, properties);
}
示例10: nemo_cell_renderer_disk_class_init
static void
nemo_cell_renderer_disk_class_init (NemoCellRendererDiskClass *klass)
{
GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS(klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = nemo_cell_renderer_disk_finalize;
object_class->get_property = nemo_cell_renderer_disk_get_property;
object_class->set_property = nemo_cell_renderer_disk_set_property;
cell_class->render = nemo_cell_renderer_disk_render;
g_object_class_install_property (object_class,
PROP_DISK_FULL_PERCENTAGE,
g_param_spec_int ("disk-full-percent",
"Percentage",
"The fractional bar to display",
0, 100, 0,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_SHOW_DISK_FULL_PERCENTAGE,
g_param_spec_boolean ("show-disk-full-percent",
"Show Percentage Graph",
"Whether to show the bar",
FALSE,
G_PARAM_READWRITE));
}
示例11: gimp_cell_renderer_color_class_init
static void
gimp_cell_renderer_color_class_init (GimpCellRendererColorClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS (klass);
object_class->get_property = gimp_cell_renderer_color_get_property;
object_class->set_property = gimp_cell_renderer_color_set_property;
cell_class->get_size = gimp_cell_renderer_color_get_size;
cell_class->render = gimp_cell_renderer_color_render;
g_object_class_install_property (object_class,
PROP_COLOR,
g_param_spec_boxed ("color", NULL, NULL,
GIMP_TYPE_RGB,
GIMP_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_OPAQUE,
g_param_spec_boolean ("opaque", NULL, NULL,
TRUE,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
g_object_class_install_property (object_class,
PROP_SIZE,
g_param_spec_int ("icon-size", NULL, NULL,
0, G_MAXINT,
DEFAULT_ICON_SIZE,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
}
示例12: ephy_removable_pixbuf_renderer_class_init
static void
ephy_removable_pixbuf_renderer_class_init (EphyRemovablePixbufRendererClass *klass)
{
GObjectClass *oclass = G_OBJECT_CLASS (klass);
GtkCellRendererClass *crclass = GTK_CELL_RENDERER_CLASS (klass);
crclass->render = ephy_removable_pixbuf_renderer_render;
crclass->activate = ephy_removable_pixbuf_renderer_activate;
oclass->get_property = ephy_removable_pixbuf_renderer_get_property;
oclass->set_property = ephy_removable_pixbuf_renderer_set_property;
oclass->dispose = ephy_removable_pixbuf_renderer_dispose;
g_object_class_install_property (oclass,
PROP_RENDER_POLICY,
g_param_spec_enum ("render-policy",
"Render policy",
"The rendering policy for the close icon in the renderer",
EPHY_TYPE_REMOVABLE_PIXBUF_RENDER_POLICY,
EPHY_REMOVABLE_PIXBUF_RENDER_PRELIT,
G_PARAM_CONSTRUCT |
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
signals[DELETE_CLICKED] =
g_signal_new ("delete-clicked",
G_OBJECT_CLASS_TYPE (oclass),
G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL,
G_TYPE_NONE, 1,
G_TYPE_STRING);
g_type_class_add_private (klass, sizeof (EphyRemovablePixbufRendererPrivate));
}
示例13: cell_renderer_bifurcation_class_init
static void cell_renderer_bifurcation_class_init(CellRendererBifurcationClass *klass) {
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS (klass);
object_class->finalize = cell_renderer_bifurcation_finalize;
object_class->get_property = cell_renderer_bifurcation_get_property;
object_class->set_property = cell_renderer_bifurcation_set_property;
cell_class->get_size = cell_renderer_bifurcation_get_size;
cell_class->render = cell_renderer_bifurcation_render;
g_object_class_install_property(object_class,
PROP_ROW_ID,
g_param_spec_ulong("row-id",
"Row Id",
"A row ID pointing to the keyframe this diagram starts at",
0, (gulong)-1, 1,
G_PARAM_READWRITE));
g_object_class_install_property(object_class,
PROP_ANIMATION,
g_param_spec_object("animation",
"Animation",
"The animation this bifurcation diagram gets its keyframes from",
G_TYPE_OBJECT,
G_PARAM_READWRITE));
}
示例14: custom_cell_renderer_progress_class_init
static void
custom_cell_renderer_progress_class_init (CustomCellRendererProgressClass *klass)
{
GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS(klass);
GObjectClass *object_class = G_OBJECT_CLASS(klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = custom_cell_renderer_progress_finalize;
/* Hook up functions to set and get our
* custom cell renderer properties */
object_class->get_property = custom_cell_renderer_progress_get_property;
object_class->set_property = custom_cell_renderer_progress_set_property;
/* Override the two crucial functions that are the heart
* of a cell renderer in the parent class */
cell_class->get_size = custom_cell_renderer_progress_get_size;
cell_class->render = custom_cell_renderer_progress_render;
/* Install our very own properties */
g_object_class_install_property (object_class,
PROP_PERCENTAGE,
g_param_spec_double ("percentage",
"Percentage",
"The fractional progress to display",
0, 1, 0,
G_PARAM_READWRITE));
}
示例15: gtk_cell_renderer_accel_get_size
static void
gtk_cell_renderer_accel_get_size (GtkCellRenderer *cell,
GtkWidget *widget,
GdkRectangle *cell_area,
gint *x_offset,
gint *y_offset,
gint *width,
gint *height)
{
GtkCellRendererAccel *accel = (GtkCellRendererAccel *) cell;
GtkRequisition requisition;
if (accel->sizing_label == NULL)
accel->sizing_label = gtk_label_new (_("New accelerator..."));
gtk_widget_size_request (accel->sizing_label, &requisition);
GTK_CELL_RENDERER_CLASS (gtk_cell_renderer_accel_parent_class)->get_size (cell, widget, cell_area,
x_offset, y_offset, width, height);
/* FIXME: need to take the cell_area et al. into account */
if (width)
*width = MAX (*width, requisition.width);
if (height)
*height = MAX (*height, requisition.height);
}