当前位置: 首页>>代码示例>>C++>>正文


C++ GTK_CELL_RENDERER_CLASS函数代码示例

本文整理汇总了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));
}
开发者ID:Gontxal0,项目名称:libfm,代码行数:34,代码来源:fm-cell-renderer-text.c

示例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);
}
开发者ID:GNOME,项目名称:libegg,代码行数:28,代码来源:eggcellrendererkeys.c

示例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));
}
开发者ID:benzea,项目名称:gtkparasite,代码行数:31,代码来源:property-cell-renderer.c

示例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));
}
开发者ID:raluca-elena,项目名称:empathy-cheese,代码行数:35,代码来源:empathy-cell-renderer-activatable.c

示例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;
}
开发者ID:LebedevRI,项目名称:gimp,代码行数:29,代码来源:gimpcellrendererbutton.c

示例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);
}
开发者ID:UIKit0,项目名称:ekiga,代码行数:32,代码来源:gm-cell-renderer-bitext.c

示例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));                            							
}
开发者ID:manoj-makkuboy,项目名称:magnetism,代码行数:30,代码来源:hippo-person-renderer.c

示例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));

}
开发者ID:814ckf0x,项目名称:gnucash,代码行数:30,代码来源:gnc-cell-renderer-date.c

示例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);
}
开发者ID:Ahimta,项目名称:epiphany,代码行数:33,代码来源:gd-two-lines-renderer.c

示例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));
}
开发者ID:3dfxmadscientist,项目名称:nemo,代码行数:28,代码来源:nemo-cell-renderer-disk.c

示例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));
}
开发者ID:jdburton,项目名称:gimp-osx,代码行数:31,代码来源:gimpcellrenderercolor.c

示例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));
}
开发者ID:Igalia,项目名称:epiphany-gnomeos,代码行数:33,代码来源:ephy-removable-pixbuf-renderer.c

示例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));
}
开发者ID:ain101,项目名称:Fyre,代码行数:28,代码来源:cell-renderer-bifurcation.c

示例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));
}
开发者ID:Bibamaru,项目名称:showtime,代码行数:28,代码来源:gu_cell_bar.c

示例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);
}
开发者ID:garnacho,项目名称:gtk-mpx,代码行数:27,代码来源:gtkcellrendereraccel.c


注:本文中的GTK_CELL_RENDERER_CLASS函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。