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


C++ GNOME_CANVAS_ITEM函数代码示例

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


在下文中一共展示了GNOME_CANVAS_ITEM函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: wire_changed_callback

static void
wire_changed_callback (Wire *wire, WireItem *item)
{
	SheetPos start_pos, length;
	GnomeCanvasPoints *points;

	wire_get_pos_and_length (wire, &start_pos, &length);

	points = gnome_canvas_points_new (2);
	points->coords[0] = 0;
	points->coords[1] = 0;
	points->coords[2] = length.x;
	points->coords[3] = length.y;

	gnome_canvas_item_set (GNOME_CANVAS_ITEM (item->priv->line),
		"points", points,
		NULL);
	gnome_canvas_points_unref (points);

	gnome_canvas_item_set (GNOME_CANVAS_ITEM (item->priv->resize1),
		"x1", -RESIZER_SIZE,
		"y1", -RESIZER_SIZE,
		"x2", RESIZER_SIZE,
		"y2", RESIZER_SIZE,
		NULL);

	gnome_canvas_item_set (GNOME_CANVAS_ITEM (item->priv->resize2),
		"x1", length.x-RESIZER_SIZE,
		"y1", length.y-RESIZER_SIZE,
		"x2", length.x+RESIZER_SIZE,
		"y2", length.y+RESIZER_SIZE,
		NULL);
}
开发者ID:Miuler,项目名称:oregano,代码行数:33,代码来源:wire-item.c

示例2: e_minicard_view_drag_begin

static gint
e_minicard_view_drag_begin (EAddressbookReflowAdapter *adapter,
                            GdkEvent *event,
                            EMinicardView *view)
{
	GdkDragContext *context;
	GtkTargetList *target_list;
	GdkDragAction actions = GDK_ACTION_MOVE | GDK_ACTION_COPY;

	clear_drag_data (view);

	view->drag_list = e_minicard_view_get_card_list (view);

	target_list = gtk_target_list_new (drag_types, G_N_ELEMENTS (drag_types));

	context = gtk_drag_begin (
		GTK_WIDGET (GNOME_CANVAS_ITEM (view)->canvas),
		target_list, actions, 1/*XXX */, event);

	if (!view->canvas_drag_data_get_id)
		view->canvas_drag_data_get_id = g_signal_connect (
			GNOME_CANVAS_ITEM (view)->canvas, "drag_data_get",
			G_CALLBACK (e_minicard_view_drag_data_get), view);

	gtk_drag_set_icon_default (context);

	return TRUE;
}
开发者ID:Distrotech,项目名称:evolution,代码行数:28,代码来源:e-minicard-view.c

示例3: iti_start_selecting

/* Starts the selection state in the icon text item */
static void
iti_start_selecting (GnomeIconTextItem *iti, int idx, guint32 event_time)
{
	GnomeIconTextItemPrivate *priv;
	GtkEditable *e;
	GdkCursor *ibeam;

	priv = iti->_priv;
	e = GTK_EDITABLE (priv->entry);

	gtk_editable_select_region (e, idx, idx);
	gtk_editable_set_position (e, idx);
	ibeam = gdk_cursor_new (GDK_XTERM);
	gnome_canvas_item_grab (GNOME_CANVAS_ITEM (iti),
				GDK_BUTTON_RELEASE_MASK |
				GDK_POINTER_MOTION_MASK,
				ibeam, event_time);
	gdk_cursor_unref (ibeam);

	gtk_editable_select_region (e, idx, idx);
	priv->selecting = TRUE;
	priv->selection_start = idx;

	gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (iti));

	g_signal_emit (iti, iti_signals[SELECTION_STARTED], 0);
}
开发者ID:DarkAngelII,项目名称:libgnomeui,代码行数:28,代码来源:gnome-icon-item.c

示例4: ghack_map_cursor_to

void
ghack_map_cursor_to(GtkWidget *win, int x, int y, gpointer data)
{
    GnomeCanvasGroup *group;
    static GnomeCanvasRE *cursor = NULL;

    double x1, y1, x2, y2;
    float hp;
    guint r, g, b;

    x1 = x * ghack_glyph_width() - 1;
    y1 = y * ghack_glyph_height() - 1;
    x2 = x1 + ghack_glyph_width() + 2;
    y2 = y1 + ghack_glyph_height() + 2;
    hp = u.mtimedone ? (u.mhmax ? (float) u.mh / u.mhmax : 1)
         : (u.uhpmax ? (float) u.uhp / u.uhpmax : 1);

    r = 255;
    g = (hp >= 0.75) ? 255 : (hp >= 0.25 ? 255 * 2 * (hp - 0.25) : 0);
    b = (hp >= 0.75) ? 255 * 4 * (hp - 0.75)
        : (hp >= 0.25 ? 0 : 255 * 4 * (0.25 - hp));

    group = gnome_canvas_root(GNOME_CANVAS(ghack_map.canvas));

    if (!cursor) {
        cursor = GNOME_CANVAS_RE(gnome_canvas_item_new(
                                     group, gnome_canvas_rect_get_type(), "width_units", 1.0, NULL));
    }
    gnome_canvas_item_set(GNOME_CANVAS_ITEM(cursor), "outline_color_rgba",
                          GNOME_CANVAS_COLOR(r, g, b), "x1", x1, "y1", y1,
                          "x2", x2, "y2", y2, NULL);

    gnome_canvas_item_raise_to_top(GNOME_CANVAS_ITEM(cursor));
    gnome_canvas_item_show(GNOME_CANVAS_ITEM(cursor));
}
开发者ID:tung,项目名称:nethack360-statuscolors,代码行数:35,代码来源:gnmap.c

示例5: ghack_map_print_glyph

void
ghack_map_print_glyph(GtkObject *win, guint x, guint y, GdkImlibImage *im,
                      gpointer data)
{
    GnomeCanvasGroup *group;
    int i = y * COLNO + x;
    int glyph = glyph_at(x, y);
    GnomeCanvasImage *canvas_image = GNOME_CANVAS_IMAGE(ghack_map.map[i]);

    group = gnome_canvas_root(GNOME_CANVAS(ghack_map.canvas));

    gnome_canvas_item_set(GNOME_CANVAS_ITEM(canvas_image), "image", im, NULL);
    gnome_canvas_item_show(GNOME_CANVAS_ITEM(canvas_image));

    canvas_image = GNOME_CANVAS_IMAGE(ghack_map.overlay[i]);

    if (x == u.ux && y == u.uy)
        ghack_map_cliparound(NULL, x, y, NULL);

    if (glyph_is_pet(glyph)
#ifdef TEXTCOLOR
            && iflags.hilite_pet
#endif
       ) {
        gnome_canvas_item_raise_to_top(GNOME_CANVAS_ITEM(canvas_image));
        gnome_canvas_item_show(GNOME_CANVAS_ITEM(canvas_image));
    } else {
        gnome_canvas_item_hide(GNOME_CANVAS_ITEM(canvas_image));
    }
}
开发者ID:tung,项目名称:nethack360-statuscolors,代码行数:30,代码来源:gnmap.c

示例6: selection_changed

static void
selection_changed(WireItem *item, gboolean select, gpointer user_data)
{
	g_object_ref(G_OBJECT(item));
	if (select) {
		gtk_idle_add ((gpointer) select_idle_callback, item);
		gnome_canvas_item_show (GNOME_CANVAS_ITEM (item->priv->resize1));
		gnome_canvas_item_show (GNOME_CANVAS_ITEM (item->priv->resize2));
	} else {
		gtk_idle_add ((gpointer) deselect_idle_callback, item);
		gnome_canvas_item_hide (GNOME_CANVAS_ITEM (item->priv->resize1));
		gnome_canvas_item_hide (GNOME_CANVAS_ITEM (item->priv->resize2));
	}
}
开发者ID:Miuler,项目名称:oregano,代码行数:14,代码来源:wire-item.c

示例7: ghack_map_clear

void
ghack_map_clear(GtkWidget *win, gpointer data)
{
    int i;

    for (i = 0; i < ROWNO * COLNO; i++) {
        if (GNOME_IS_CANVAS_IMAGE(ghack_map.map[i])) {
            gnome_canvas_item_hide(GNOME_CANVAS_ITEM(ghack_map.map[i]));
        }
        if (GNOME_IS_CANVAS_IMAGE(ghack_map.overlay[i])) {
            gnome_canvas_item_hide(GNOME_CANVAS_ITEM(ghack_map.overlay[i]));
        }
    }
    gnome_canvas_update_now(GNOME_CANVAS(ghack_map.canvas));
}
开发者ID:tung,项目名称:nethack360-statuscolors,代码行数:15,代码来源:gnmap.c

示例8: iti_stop_selecting

/* Stops the selection state in the icon text item */
static void
iti_stop_selecting (GnomeIconTextItem *iti, guint32 event_time)
{
	GnomeIconTextItemPrivate *priv;
	GnomeCanvasItem *item;

	priv = iti->_priv;
	item = GNOME_CANVAS_ITEM (iti);

	gnome_canvas_item_ungrab (item, event_time);
	priv->selecting = FALSE;

	gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (iti));
	g_signal_emit (iti, iti_signals[SELECTION_STOPPED], 0);
}
开发者ID:DarkAngelII,项目名称:libgnomeui,代码行数:16,代码来源:gnome-icon-item.c

示例9: recompute_bounding_box

/* Recomputes the bounding box of an icon text item */
static void
recompute_bounding_box (GnomeIconTextItem *iti)
{

	GnomeCanvasItem *item;
	double x1, y1, x2, y2;
	int width_c, height_c;
	int width_w, height_w;
	int max_width_w;

	item = GNOME_CANVAS_ITEM (iti);

	width_c = iti->_priv->layout_width + 2 * MARGIN_X;
	height_c = iti->_priv->layout_height + 2 * MARGIN_Y;
	width_w = ROUND (width_c / item->canvas->pixels_per_unit);
	height_w = ROUND (height_c / item->canvas->pixels_per_unit);
	max_width_w = ROUND (iti->width / item->canvas->pixels_per_unit);

	x1 = iti->x;
	y1 = iti->y;

	gnome_canvas_item_i2w (item, &x1, &y1);

	x1 += ROUND ((max_width_w - width_w) / 2);
	x2 = x1 + width_w;
	y2 = y1 + height_w;

	gnome_canvas_w2c_d (item->canvas, x1, y1, &item->x1, &item->y1);
	gnome_canvas_w2c_d (item->canvas, x2, y2, &item->x2, &item->y2);
}
开发者ID:DarkAngelII,项目名称:libgnomeui,代码行数:31,代码来源:gnome-icon-item.c

示例10: e_canvas_item_invoke_reflow

static void
e_canvas_item_invoke_reflow (GnomeCanvasItem *item, int flags)
{
	GnomeCanvasGroup *group;
	GList *list;
	GnomeCanvasItem *child;

	if (GNOME_IS_CANVAS_GROUP (item)) {
		group = GNOME_CANVAS_GROUP (item);
		for (list = group->item_list; list; list = list->next) {
			child = GNOME_CANVAS_ITEM (list->data);
			if (child->object.flags & E_CANVAS_ITEM_DESCENDENT_NEEDS_REFLOW)
				e_canvas_item_invoke_reflow (child, flags);
		}
	}

	if (item->object.flags & E_CANVAS_ITEM_NEEDS_REFLOW) {
		ECanvasItemReflowFunc func;
		func = (ECanvasItemReflowFunc)
			g_object_get_data (G_OBJECT (item),
					   "ECanvasItem::reflow_callback");
		if (func)
			func (item, flags);
	}

	item->object.flags &= ~E_CANVAS_ITEM_NEEDS_REFLOW;
	item->object.flags &= ~E_CANVAS_ITEM_DESCENDENT_NEEDS_REFLOW;
}
开发者ID:ebbywiselyn,项目名称:evolution,代码行数:28,代码来源:e-canvas.c

示例11: gnc_date_cell_enter

static gboolean
gnc_date_cell_enter (BasicCell *bcell,
                     int *cursor_position,
                     int *start_selection,
                     int *end_selection)
{
    DateCell *cell = (DateCell *) bcell;
    PopBox *box = bcell->gui_private;

    gnc_item_edit_set_popup (box->item_edit, GNOME_CANVAS_ITEM (box->date_picker),
                             get_popup_height, NULL, popup_set_focus,
                             NULL, NULL, NULL);

    block_picker_signals (cell);
    gnc_date_picker_set_date (box->date_picker,
                              box->date.tm_mday,
                              box->date.tm_mon,
                              box->date.tm_year + 1900);
    unblock_picker_signals (cell);

    date_picker_connect_signals ((DateCell *) bcell);

    *start_selection = 0;
    *end_selection = -1;

    return TRUE;
}
开发者ID:814ckf0x,项目名称:gnucash,代码行数:27,代码来源:datecell-gnome.c

示例12: e_table_group_container_construct

/**
 * e_table_group_container_construct
 * @parent: The %GnomeCanvasGroup to create a child of.
 * @etgc: The %ETableGroupContainer.
 * @full_header: The full header of the %ETable.
 * @header: The current header of the %ETable.
 * @model: The %ETableModel of the %ETable.
 * @sort_info: The %ETableSortInfo of the %ETable.
 * @n: Which grouping level this is (Starts at 0 and sends n + 1 to any child %ETableGroups.
 *
 * This routine constructs the new %ETableGroupContainer.
 */
void
e_table_group_container_construct (GnomeCanvasGroup *parent, ETableGroupContainer *etgc,
				   ETableHeader *full_header,
				   ETableHeader     *header,
				   ETableModel *model, ETableSortInfo *sort_info, int n)
{
	ETableCol *col;
	ETableSortColumn column = e_table_sort_info_grouping_get_nth(sort_info, n);
	GtkStyle *style;

	col = e_table_header_get_column_by_col_idx(full_header, column.column);
	if (col == NULL)
		col = e_table_header_get_column (full_header, e_table_header_count (full_header) - 1);

	e_table_group_construct (parent, E_TABLE_GROUP (etgc), full_header, header, model);
	etgc->ecol = col;
	g_object_ref (etgc->ecol);
	etgc->sort_info = sort_info;
	g_object_ref (etgc->sort_info);
	etgc->n = n;
	etgc->ascending = column.ascending;

	style = GTK_WIDGET (GNOME_CANVAS_ITEM (etgc)->canvas)->style;
	etgc->font_desc = pango_font_description_copy (style->font_desc);

	etgc->open = TRUE;
}
开发者ID:ebbywiselyn,项目名称:evolution,代码行数:39,代码来源:e-table-group-container.c

示例13: ea_addressbook_focus_watcher

static gboolean
ea_addressbook_focus_watcher (GSignalInvocationHint *ihint,
                              guint n_param_values,
                              const GValue *param_values,
                              gpointer data)
{
	GObject *object;
	GdkEvent *event;
	AtkObject *ea_event = NULL;

	object = g_value_get_object (param_values + 0);
	event = g_value_get_boxed (param_values + 1);

	if (E_IS_MINICARD (object)) {
		GnomeCanvasItem *item = GNOME_CANVAS_ITEM (object);
		ea_event = atk_gobject_accessible_for_object (object);
		if (event->type == GDK_FOCUS_CHANGE) {
			if (E_IS_MINICARD (item->canvas->focused_item))
				atk_object_notify_state_change (ea_event,
					ATK_STATE_FOCUSED,
					event->focus_change.in);
		}
	}

	return TRUE;
}
开发者ID:Distrotech,项目名称:evolution,代码行数:26,代码来源:ea-addressbook.c

示例14: etcta_style_updated

static void
etcta_style_updated (ETableClickToAdd *etcta)
{
	GtkWidget *widget;
	GdkColor fg, bg, text;

	widget = GTK_WIDGET (GNOME_CANVAS_ITEM (etcta)->canvas);

	e_utils_get_theme_color_color (widget, "theme_fg_color", E_UTILS_DEFAULT_THEME_FG_COLOR, &fg);
	e_utils_get_theme_color_color (widget, "theme_bg_color", E_UTILS_DEFAULT_THEME_BG_COLOR, &bg);
	e_utils_get_theme_color_color (widget, "theme_text_color,theme_fg_color", E_UTILS_DEFAULT_THEME_TEXT_COLOR, &text);

	if (etcta->rect)
		gnome_canvas_item_set (
			etcta->rect,
			"outline_color_gdk", &fg,
			"fill_color_gdk", &bg,
			NULL);

	if (etcta->text)
		gnome_canvas_item_set (
			etcta->text,
			"fill_color_gdk", &text,
			NULL);
}
开发者ID:moomoos,项目名称:evolution,代码行数:25,代码来源:e-table-click-to-add.c

示例15: week_view_event_item_button_release

static gboolean
week_view_event_item_button_release (EWeekViewEventItem *event_item,
                                     GdkEvent *event)
{
	EWeekView *week_view;
	GnomeCanvasItem *item;
	GtkWidget *parent;

	item = GNOME_CANVAS_ITEM (event_item);

	parent = gtk_widget_get_parent (GTK_WIDGET (item->canvas));
	g_return_val_if_fail (E_IS_WEEK_VIEW (parent), FALSE);

	week_view = E_WEEK_VIEW (parent);

	if (week_view->pressed_event_num != -1
	    && week_view->pressed_event_num == event_item->priv->event_num
	    && week_view->pressed_span_num == event_item->priv->span_num) {
		e_week_view_start_editing_event (week_view,
						 event_item->priv->event_num,
						 event_item->priv->span_num,
						 NULL);
		week_view->pressed_event_num = -1;
		return TRUE;
	}

	week_view->pressed_event_num = -1;

	return FALSE;
}
开发者ID:jdapena,项目名称:evolution,代码行数:30,代码来源:e-week-view-event-item.c


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