本文整理汇总了C++中GNOME_CANVAS_ITEM函数的典型用法代码示例。如果您正苦于以下问题:C++ GNOME_CANVAS_ITEM函数的具体用法?C++ GNOME_CANVAS_ITEM怎么用?C++ GNOME_CANVAS_ITEM使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GNOME_CANVAS_ITEM函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: do_adjustment
static gboolean
do_adjustment (gpointer user_data)
{
int row;
GtkAdjustment *adj ;
gfloat value, min_value, max_value;
EReflow *reflow = user_data;
row = reflow->cursor_row;
if (row == -1)
return FALSE;
adj = gtk_layout_get_hadjustment (GTK_LAYOUT (GNOME_CANVAS_ITEM (reflow)->canvas));
value = adj->value;
if ((!reflow->items) || (!reflow->items[row]))
return TRUE;
min_value = reflow->items[row]->x2 - adj->page_size;
max_value = reflow->items[row]->x1;
if (value < min_value)
value = min_value;
if (value > max_value)
value = max_value;
if (value != adj->value) {
adj->value = value;
gtk_adjustment_value_changed (adj);
}
reflow->do_adjustment_idle_id = 0;
return FALSE;
}
开发者ID:ebbywiselyn,项目名称:evolution,代码行数:35,代码来源:e-reflow.c
示例17: gnucash_cursor_set
void
gnucash_cursor_set (GnucashCursor *cursor, VirtualLocation virt_loc)
{
GnucashSheet *sheet;
g_return_if_fail (cursor != NULL);
g_return_if_fail (GNUCASH_IS_CURSOR (cursor));
sheet = cursor->sheet;
gnucash_cursor_request_redraw (cursor);
gnucash_cursor_set_block (cursor, virt_loc.vcell_loc);
gnucash_cursor_set_cell (cursor,
virt_loc.phys_row_offset,
virt_loc.phys_col_offset);
gnucash_cursor_configure (cursor);
gnome_canvas_item_set (GNOME_CANVAS_ITEM(sheet->header_item),
"cursor_name",
cursor->style->cursor->cursor_name,
NULL);
gnucash_cursor_request_redraw (cursor);
}
开发者ID:814ckf0x,项目名称:gnucash,代码行数:26,代码来源:gnucash-cursor.c
示例18: etgc_remove
static gboolean
etgc_remove (ETableGroup *etg, gint row)
{
ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg);
GList *list;
for (list = etgc->children ; list; list = g_list_next (list)) {
ETableGroupContainerChildNode *child_node = list->data;
ETableGroup *child = child_node->child;
if (e_table_group_remove (child, row)) {
child_node->count --;
if (child_node->count == 0) {
e_table_group_container_child_node_free (etgc, child_node);
etgc->children = g_list_remove (etgc->children, child_node);
g_free (child_node);
} else
compute_text (etgc, child_node);
e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (etgc));
return TRUE;
}
}
return FALSE;
}
开发者ID:ebbywiselyn,项目名称:evolution,代码行数:26,代码来源:e-table-group-container.c
示例19: week_view_event_item_get_position
static ECalendarViewPosition
week_view_event_item_get_position (EWeekViewEventItem *event_item,
gdouble x,
gdouble y)
{
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), E_CALENDAR_VIEW_POS_NONE);
week_view = E_WEEK_VIEW (parent);
if (x < item->x1 + E_WEEK_VIEW_EVENT_L_PAD
|| x >= item->x2 - E_WEEK_VIEW_EVENT_R_PAD)
return E_CALENDAR_VIEW_POS_NONE;
/* Support left/right edge for long events only. */
if (!e_week_view_is_one_day_event (week_view, event_item->priv->event_num)) {
if (x < item->x1 + E_WEEK_VIEW_EVENT_L_PAD
+ E_WEEK_VIEW_EVENT_BORDER_WIDTH
+ E_WEEK_VIEW_EVENT_EDGE_X_PAD)
return E_CALENDAR_VIEW_POS_LEFT_EDGE;
if (x >= item->x2 + 1 - E_WEEK_VIEW_EVENT_R_PAD
- E_WEEK_VIEW_EVENT_BORDER_WIDTH
- E_WEEK_VIEW_EVENT_EDGE_X_PAD)
return E_CALENDAR_VIEW_POS_RIGHT_EDGE;
}
return E_CALENDAR_VIEW_POS_EVENT;
}
开发者ID:jdapena,项目名称:evolution,代码行数:35,代码来源:e-week-view-event-item.c
示例20: greeter_item_ulist_check_show_userlist
/* Hide the userlist if there are no users displayed */
void
greeter_item_ulist_check_show_userlist (void)
{
/*
* If there are no users,
* then hide the rectangle used to contain the userlist. The
* userlist-rect id allows a rectangle to be defined with alpha
* behind the userlist that also goes away when the list is empty.
*/
if (num_users == 0) {
GreeterItemInfo *urinfo = greeter_lookup_id ("userlist-rect");
if (user_list != NULL)
gtk_widget_hide (user_list);
if (urinfo) {
GnomeCanvasItem *item;
if (urinfo->group_item != NULL)
item = GNOME_CANVAS_ITEM (urinfo->group_item);
else
item = urinfo->item;
gnome_canvas_item_hide (item);
}
}
}
开发者ID:echofourpapa,项目名称:mdm,代码行数:29,代码来源:greeter_item_ulist.c
注:本文中的GNOME_CANVAS_ITEM函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论