• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GTK_CELL_RENDERER_CLASS函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GTK_CELL_RENDERER_CLASS函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_CELL_RENDERER_CLASS函数的具体用法?C++ GTK_CELL_RENDERER_CLASS怎么用?C++ GTK_CELL_RENDERER_CLASS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GTK_CELL_RENDERER_CLASS函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: athena_cell_renderer_text_ellipsized_class_init

static void
athena_cell_renderer_text_ellipsized_class_init (AthenaCellRendererTextEllipsizedClass *klass)
{
	GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS (klass);

	cell_class->get_preferred_width = athena_cell_renderer_text_ellipsized_get_preferred_width;
}
开发者ID:SolusOS-discontinued,项目名称:athena,代码行数:7,代码来源:athena-cell-renderer-text-ellipsized.c


示例17: class_init

static void class_init (QCADCellRendererTextClass *klass)
  {
  GObjectClass *object_klass = G_OBJECT_CLASS (klass) ;
  GtkCellRendererClass *cr_klass = GTK_CELL_RENDERER_CLASS (klass) ;

  object_klass->set_property = set_property ;
  object_klass->get_property = get_property ;

  cr_klass->render        = render ;
  cr_klass->start_editing = start_editing ;

  g_object_class_install_property (G_OBJECT_CLASS (klass), QCAD_CELL_RENDERER_TEXT_PROPERTY_SENSITIVE,
    g_param_spec_boolean ("sensitive", "Sensitive", "Whether this text cell renderer is sensitive",
      TRUE, G_PARAM_READABLE | G_PARAM_WRITABLE)) ;

  cell_renderer_text_signals[QCAD_CELL_RENDERER_TEXT_EDITING_STARTED_SIGNAL] =
    g_signal_new (
#ifdef GTK_DOC
      "workaround-editing-started",
#else
      "editing-started",
#endif /* def GTK_DOC */
      G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST,
      G_STRUCT_OFFSET (QCADCellRendererTextClass, editing_started), NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_STRING,
        G_TYPE_NONE, 2, GTK_TYPE_CELL_EDITABLE, G_TYPE_STRING) ;
  }
开发者ID:kwalus,项目名称:QCADesigner,代码行数:26,代码来源:QCADCellRendererText.c


示例18: custom_cell_renderer_button_class_init

/***************************************************************************
 *
 *  custom_cell_renderer_button_class_init:
 *
 *  set up our own get_property and set_property functions, and
 *  override the parent's functions that we need to implement.
 *  If you want cells that can be activated on their own (ie. not
 *  just the whole row selected) or cells that are editable, you
 *  will need to override 'activate' and 'start_editing' as well.
 *
 ***************************************************************************/
static void
custom_cell_renderer_button_class_init (CustomCellRendererButtonClass *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_button_finalize;

	/* Hook up functions to set and get our
	 *   custom cell renderer properties */
	object_class->get_property = custom_cell_renderer_button_get_property;
	object_class->set_property = custom_cell_renderer_button_set_property;

	// Override activate
	cell_class->activate = custom_cell_renderer_button_activate;

	button_cell_signals[CLICKED] =
		g_signal_new (g_intern_static_string ("clicked"),
			  G_OBJECT_CLASS_TYPE (object_class),
			  G_SIGNAL_RUN_LAST,
			  G_STRUCT_OFFSET (CustomCellRendererButtonClass, clicked),
			  NULL, NULL,
			  gtk_marshal_VOID__STRING,
			  G_TYPE_NONE, 1,
			  G_TYPE_STRING);
}
开发者ID:273657127,项目名称:HandBrake,代码行数:38,代码来源:renderer_button.c


示例19: cell_renderer_key_class_init

static void
cell_renderer_key_class_init (CellRendererKeyClass *cell_key_class)
{
  GObjectClass *object_class;
  GtkCellRendererClass *cell_renderer_class;

  object_class = G_OBJECT_CLASS (cell_key_class);
  cell_renderer_class = GTK_CELL_RENDERER_CLASS (cell_key_class);
  parent_class = g_type_class_peek_parent (object_class);
  
  GTK_CELL_RENDERER_CLASS(cell_key_class)->start_editing = cell_renderer_key_start_editing;

  object_class->set_property = cell_renderer_key_set_property;
  object_class->get_property = cell_renderer_key_get_property;
  cell_renderer_class->get_size = cell_renderer_key_get_size;

  object_class->finalize = cell_renderer_key_finalize;
   
  g_object_class_install_property (object_class,
                                   PROP_SCANCODE,
                                   g_param_spec_int ("scancode",
                                                     "Scancode",
                                                     "Scancode",
                                                      -1,
                                                      G_MAXINT,
                                                      -1,
                                                      G_PARAM_READABLE | G_PARAM_WRITABLE));
  
  g_signal_new ("accel_edited",
                TYPE_CELL_RENDERER_KEY,
                G_SIGNAL_RUN_LAST,
                G_STRUCT_OFFSET(CellRendererKeyClass, accel_edited),
                NULL, NULL,
                marshal_VOID__STRING_UINT,
                G_TYPE_NONE,
                2,G_TYPE_STRING,G_TYPE_UINT);

  g_signal_new ("accel_cleared",
                TYPE_CELL_RENDERER_KEY,
                G_SIGNAL_RUN_LAST,
                G_STRUCT_OFFSET(CellRendererKeyClass, accel_cleared),
                NULL, NULL,
                gtk_marshal_VOID__STRING,
                G_TYPE_NONE,
                1,G_TYPE_STRING);
}
开发者ID:dtzWill,项目名称:supernes,代码行数:46,代码来源:cellrendererkey.c


示例20: cell_renderer_caption_render

static void
cell_renderer_caption_render (GtkCellRenderer *cell,
                                GdkWindow *window,
                                GtkWidget *widget,
                                GdkRectangle *background_area,
                                GdkRectangle *cell_area,
                                GdkRectangle *expose_area,
                                GtkCellRendererState flags)
{
  (* GTK_CELL_RENDERER_CLASS (cell_renderer_caption_parent_class)->render)
      (cell, window, widget, background_area, cell_area, expose_area, flags);

  if ((flags & (GTK_CELL_RENDERER_SELECTED|GTK_CELL_RENDERER_PRELIT)) != 0)
  {
    cairo_t *cr;
    int radius = 5;
    int x, y, w, h;
    GtkStateType state;
    x = background_area->x;
    y = background_area->y;
    w = background_area->width;
    h = background_area->height;

    /* sometimes width is -1 - not sure what to do here */
    if (w == -1)
      return;

    if ((flags & GTK_CELL_RENDERER_SELECTED) != 0)
    {
      if (GTK_WIDGET_HAS_FOCUS (widget))
        state = GTK_STATE_SELECTED;
      else
        state = GTK_STATE_ACTIVE;
    }
    else
      state = GTK_STATE_PRELIGHT;

    /* add rounded corners to the selection indicator */
    cr = gdk_cairo_create (GDK_DRAWABLE (window));

    gdk_cairo_set_source_color (cr, &widget->style->base[GTK_STATE_NORMAL]);

    cairo_rectangle (cr, x, y, w, h);

    cairo_arc (cr, x + radius, y + radius, radius, M_PI, M_PI * 1.5);
    cairo_arc (cr, x + w - radius, y + radius, radius, M_PI * 1.5, 0);
    cairo_arc (cr, x + w - radius, y + h - radius, radius, 0, M_PI * 0.5);
    cairo_arc (cr, x + radius, y + h - radius, radius, M_PI * 0.5, M_PI);
    cairo_close_path (cr);

    cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);

    cairo_fill (cr);
    cairo_destroy (cr);
  }
}
开发者ID:nh2,项目名称:gnome-control-center,代码行数:56,代码来源:caption-cellrenderer.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GTK_CELL_VIEW函数代码示例发布时间:2022-05-30
下一篇:
C++ GTK_CELL_RENDERER函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap