本文整理汇总了C++中GIMP_VIEW函数的典型用法代码示例。如果您正苦于以下问题:C++ GIMP_VIEW函数的具体用法?C++ GIMP_VIEW怎么用?C++ GIMP_VIEW使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GIMP_VIEW函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: gimp_selection_editor_init
static void
gimp_selection_editor_init (GimpSelectionEditor *editor)
{
GtkWidget *frame;
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (editor), frame, TRUE, TRUE, 0);
gtk_widget_show (frame);
editor->view = gimp_view_new_by_types (NULL,
GIMP_TYPE_VIEW,
GIMP_TYPE_SELECTION,
GIMP_VIEW_SIZE_HUGE,
0, TRUE);
gimp_view_renderer_set_background (GIMP_VIEW (editor->view)->renderer,
GIMP_STOCK_TEXTURE);
gtk_widget_set_size_request (editor->view,
GIMP_VIEW_SIZE_HUGE, GIMP_VIEW_SIZE_HUGE);
gimp_view_set_expand (GIMP_VIEW (editor->view), TRUE);
gtk_container_add (GTK_CONTAINER (frame), editor->view);
gtk_widget_show (editor->view);
g_signal_connect (editor->view, "button-press-event",
G_CALLBACK (gimp_selection_view_button_press),
editor);
gimp_dnd_color_dest_add (editor->view,
gimp_selection_editor_drop_color,
editor);
gtk_widget_set_sensitive (GTK_WIDGET (editor), FALSE);
}
开发者ID:Amerekanets,项目名称:gimp,代码行数:33,代码来源:gimpselectioneditor.c
示例2: gimp_selection_editor_set_image
static void
gimp_selection_editor_set_image (GimpImageEditor *image_editor,
GimpImage *image)
{
GimpSelectionEditor *editor = GIMP_SELECTION_EDITOR (image_editor);
if (image_editor->image)
{
g_signal_handlers_disconnect_by_func (image_editor->image,
gimp_selection_editor_mask_changed,
editor);
}
GIMP_IMAGE_EDITOR_CLASS (parent_class)->set_image (image_editor, image);
if (image)
{
g_signal_connect (image, "mask-changed",
G_CALLBACK (gimp_selection_editor_mask_changed),
editor);
gimp_view_set_viewable (GIMP_VIEW (editor->view),
GIMP_VIEWABLE (gimp_image_get_mask (image)));
}
else
{
gimp_view_set_viewable (GIMP_VIEW (editor->view), NULL);
}
}
开发者ID:Amerekanets,项目名称:gimp,代码行数:29,代码来源:gimpselectioneditor.c
示例3: gimp_view_new_full
GtkWidget *
gimp_view_new_full (GimpContext *context,
GimpViewable *viewable,
gint width,
gint height,
gint border_width,
gboolean is_popup,
gboolean clickable,
gboolean show_popup)
{
GtkWidget *view;
g_return_val_if_fail (context == NULL || GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (GIMP_IS_VIEWABLE (viewable), NULL);
view = gimp_view_new_full_by_types (context,
GIMP_TYPE_VIEW,
G_TYPE_FROM_INSTANCE (viewable),
width, height, border_width,
is_popup, clickable, show_popup);
if (view)
gimp_view_set_viewable (GIMP_VIEW (view), viewable);
gimp_view_renderer_remove_idle (GIMP_VIEW (view)->renderer);
return view;
}
开发者ID:Hboybowen,项目名称:gimp,代码行数:28,代码来源:gimpview.c
示例4: gimp_palette_view_find_entry
static GimpPaletteEntry *
gimp_palette_view_find_entry (GimpPaletteView *view,
gint x,
gint y)
{
GimpPalette *palette;
GimpViewRendererPalette *renderer;
GimpPaletteEntry *entry = NULL;
gint col, row;
palette = GIMP_PALETTE (GIMP_VIEW (view)->renderer->viewable);
renderer = GIMP_VIEW_RENDERER_PALETTE (GIMP_VIEW (view)->renderer);
if (! palette)
return NULL;
col = x / renderer->cell_width;
row = y / renderer->cell_height;
if (col >= 0 && col < renderer->columns &&
row >= 0 && row < renderer->rows)
{
entry = gimp_palette_get_entry (palette,
row * renderer->columns + col);
}
return entry;
}
开发者ID:Amerekanets,项目名称:gimp-1,代码行数:28,代码来源:gimppaletteview.c
示例5: gimp_navigation_editor_set_shell
static void
gimp_navigation_editor_set_shell (GimpNavigationEditor *editor,
GimpDisplayShell *shell)
{
g_return_if_fail (GIMP_IS_NAVIGATION_EDITOR (editor));
g_return_if_fail (! shell || GIMP_IS_DISPLAY_SHELL (shell));
if (shell == editor->shell)
return;
if (editor->shell)
{
g_signal_handlers_disconnect_by_func (editor->shell,
gimp_navigation_editor_shell_scaled,
editor);
g_signal_handlers_disconnect_by_func (editor->shell,
gimp_navigation_editor_shell_scrolled,
editor);
g_signal_handlers_disconnect_by_func (editor->shell,
gimp_navigation_editor_shell_reconnect,
editor);
}
else if (shell)
{
gtk_widget_set_sensitive (GTK_WIDGET (editor), TRUE);
}
editor->shell = shell;
if (editor->shell)
{
GimpImage *image = gimp_display_get_image (shell->display);
gimp_view_set_viewable (GIMP_VIEW (editor->view),
GIMP_VIEWABLE (image));
g_signal_connect (editor->shell, "scaled",
G_CALLBACK (gimp_navigation_editor_shell_scaled),
editor);
g_signal_connect (editor->shell, "scrolled",
G_CALLBACK (gimp_navigation_editor_shell_scrolled),
editor);
g_signal_connect (editor->shell, "reconnect",
G_CALLBACK (gimp_navigation_editor_shell_reconnect),
editor);
gimp_navigation_editor_shell_scaled (editor->shell, editor);
}
else
{
gimp_view_set_viewable (GIMP_VIEW (editor->view), NULL);
gtk_widget_set_sensitive (GTK_WIDGET (editor), FALSE);
}
if (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)))
gimp_ui_manager_update (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)),
gimp_editor_get_popup_data (GIMP_EDITOR (editor)));
}
开发者ID:1ynx,项目名称:gimp,代码行数:58,代码来源:gimpnavigationeditor.c
示例6: gimp_color_selector_palette_set_config
static void
gimp_color_selector_palette_set_config (GimpColorSelector *selector,
GimpColorConfig *config)
{
GimpColorSelectorPalette *select = GIMP_COLOR_SELECTOR_PALETTE (selector);
if (select->context)
{
g_signal_handlers_disconnect_by_func (select->context,
gimp_color_selector_palette_palette_changed,
select);
select->context = NULL;
}
if (config)
select->context = g_object_get_data (G_OBJECT (config), "gimp-context");
if (select->context)
{
if (! select->view)
{
GtkWidget *frame;
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_container_add (GTK_CONTAINER (select), frame);
gtk_widget_show (frame);
select->view = gimp_view_new_full_by_types (select->context,
GIMP_TYPE_PALETTE_VIEW,
GIMP_TYPE_PALETTE,
100, 100, 0,
FALSE, TRUE, FALSE);
gimp_view_set_expand (GIMP_VIEW (select->view), TRUE);
gimp_view_renderer_palette_set_cell_size
(GIMP_VIEW_RENDERER_PALETTE (GIMP_VIEW (select->view)->renderer),
-1);
gimp_view_renderer_palette_set_draw_grid
(GIMP_VIEW_RENDERER_PALETTE (GIMP_VIEW (select->view)->renderer),
TRUE);
gtk_container_add (GTK_CONTAINER (frame), select->view);
gtk_widget_show (select->view);
g_signal_connect (select->view, "entry-clicked",
G_CALLBACK (gimp_color_selector_palette_entry_clicked),
select);
}
g_signal_connect_object (select->context, "palette-changed",
G_CALLBACK (gimp_color_selector_palette_palette_changed),
select, 0);
gimp_color_selector_palette_palette_changed (select->context,
gimp_context_get_palette (select->context),
select);
}
}
开发者ID:Amerekanets,项目名称:gimp,代码行数:57,代码来源:gimpcolorselectorpalette.c
示例7: gimp_view_drag_viewable
static GimpViewable *
gimp_view_drag_viewable (GtkWidget *widget,
GimpContext **context,
gpointer data)
{
if (context)
*context = GIMP_VIEW (widget)->renderer->context;
return GIMP_VIEW (widget)->viewable;
}
开发者ID:Hboybowen,项目名称:gimp,代码行数:10,代码来源:gimpview.c
示例8: gimp_container_grid_view_item_activated
static void
gimp_container_grid_view_item_activated (GtkWidget *widget,
gpointer data)
{
gimp_container_view_item_activated (GIMP_CONTAINER_VIEW (data),
GIMP_VIEW (widget)->viewable);
}
开发者ID:MichaelMure,项目名称:Gimp-Cage-Tool,代码行数:7,代码来源:gimpcontainergridview.c
示例9: gimp_color_selector_palette_palette_changed
static void
gimp_color_selector_palette_palette_changed (GimpContext *context,
GimpPalette *palette,
GimpColorSelectorPalette *select)
{
gimp_view_set_viewable (GIMP_VIEW (select->view), GIMP_VIEWABLE (palette));
}
开发者ID:Amerekanets,项目名称:gimp,代码行数:7,代码来源:gimpcolorselectorpalette.c
示例10: gimp_view_expose_event
static gboolean
gimp_view_expose_event (GtkWidget *widget,
GdkEventExpose *event)
{
if (gtk_widget_is_drawable (widget))
{
GtkAllocation allocation;
cairo_t *cr;
gtk_widget_get_allocation (widget, &allocation);
cr = gdk_cairo_create (event->window);
gdk_cairo_region (cr, event->region);
cairo_clip (cr);
cairo_translate (cr, allocation.x, allocation.y);
gimp_view_renderer_draw (GIMP_VIEW (widget)->renderer,
widget, cr,
allocation.width,
allocation.height);
cairo_destroy (cr);
}
return FALSE;
}
开发者ID:Hboybowen,项目名称:gimp,代码行数:27,代码来源:gimpview.c
示例11: gimp_view_button_release_event
static gboolean
gimp_view_button_release_event (GtkWidget *widget,
GdkEventButton *bevent)
{
GimpView *view = GIMP_VIEW (widget);
if (! view->clickable &&
! view->show_popup)
return FALSE;
if (bevent->button == 1)
{
gtk_grab_remove (widget);
view->has_grab = FALSE;
if (view->clickable && view->in_button)
{
g_signal_emit (widget, view_signals[CLICKED], 0, view->press_state);
}
}
else
{
return FALSE;
}
return view->eat_button_events ? TRUE : FALSE;
}
开发者ID:Hboybowen,项目名称:gimp,代码行数:27,代码来源:gimpview.c
示例12: gimp_viewable_dialog_get_property
static void
gimp_viewable_dialog_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
GimpViewableDialog *dialog = GIMP_VIEWABLE_DIALOG (object);
switch (property_id)
{
case PROP_VIEWABLE:
g_value_set_object (value,
dialog->view ?
GIMP_VIEW (dialog->view)->viewable : NULL);
break;
case PROP_CONTEXT:
g_value_set_object (value, dialog->context);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
开发者ID:kernc,项目名称:gimp,代码行数:25,代码来源:gimpviewabledialog.c
示例13: gimp_view_realize
static void
gimp_view_realize (GtkWidget *widget)
{
GimpView *view = GIMP_VIEW (widget);
GtkAllocation allocation;
GdkWindowAttr attributes;
gint attributes_mask;
GTK_WIDGET_CLASS (parent_class)->realize (widget);
gtk_widget_get_allocation (widget, &allocation);
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = allocation.x;
attributes.y = allocation.y;
attributes.width = allocation.width;
attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_ONLY;
attributes.event_mask = gtk_widget_get_events (widget);
attributes_mask = GDK_WA_X | GDK_WA_Y;
view->event_window = gdk_window_new (gtk_widget_get_window (widget),
&attributes, attributes_mask);
gdk_window_set_user_data (view->event_window, view);
}
开发者ID:Hboybowen,项目名称:gimp,代码行数:26,代码来源:gimpview.c
示例14: gimp_navigation_editor_set_context
static void
gimp_navigation_editor_set_context (GimpDocked *docked,
GimpContext *context)
{
GimpNavigationEditor *editor = GIMP_NAVIGATION_EDITOR (docked);
GimpDisplay *display = NULL;
if (editor->context)
{
g_signal_handlers_disconnect_by_func (editor->context,
gimp_navigation_editor_display_changed,
editor);
}
editor->context = context;
if (editor->context)
{
g_signal_connect (context, "display-changed",
G_CALLBACK (gimp_navigation_editor_display_changed),
editor);
display = gimp_context_get_display (context);
}
gimp_view_renderer_set_context (GIMP_VIEW (editor->view)->renderer,
context);
gimp_navigation_editor_display_changed (editor->context,
display,
editor);
}
开发者ID:1ynx,项目名称:gimp,代码行数:32,代码来源:gimpnavigationeditor.c
示例15: gimp_palette_view_draw_selected
static void
gimp_palette_view_draw_selected (GimpPaletteView *pal_view,
GdkRectangle *area)
{
GimpView *view = GIMP_VIEW (pal_view);
if (view->renderer->viewable && pal_view->selected)
{
GtkWidget *widget = GTK_WIDGET (view);
GimpViewRendererPalette *renderer;
gint row, col;
renderer = GIMP_VIEW_RENDERER_PALETTE (view->renderer);
row = pal_view->selected->position / renderer->columns;
col = pal_view->selected->position % renderer->columns;
if (area)
gdk_gc_set_clip_rectangle (pal_view->gc, area);
gdk_draw_rectangle (widget->window, pal_view->gc,
FALSE,
widget->allocation.x + col * renderer->cell_width,
widget->allocation.y + row * renderer->cell_height,
renderer->cell_width,
renderer->cell_height);
if (area)
gdk_gc_set_clip_rectangle (pal_view->gc, NULL);
}
}
开发者ID:Amerekanets,项目名称:gimp,代码行数:31,代码来源:gimppaletteview.c
示例16: gimp_file_dialog_add_preview
static void
gimp_file_dialog_add_preview (GimpFileDialog *dialog,
Gimp *gimp)
{
if (gimp->config->thumbnail_size <= 0)
return;
gtk_file_chooser_set_use_preview_label (GTK_FILE_CHOOSER (dialog), FALSE);
g_signal_connect (dialog, "selection-changed",
G_CALLBACK (gimp_file_dialog_selection_changed),
dialog);
g_signal_connect (dialog, "update-preview",
G_CALLBACK (gimp_file_dialog_update_preview),
dialog);
dialog->thumb_box = gimp_thumb_box_new (gimp_get_user_context (gimp));
gtk_widget_set_sensitive (GTK_WIDGET (dialog->thumb_box), FALSE);
gtk_file_chooser_set_preview_widget (GTK_FILE_CHOOSER (dialog),
dialog->thumb_box);
gtk_widget_show (dialog->thumb_box);
#ifdef ENABLE_FILE_SYSTEM_ICONS
GIMP_VIEW_RENDERER_IMAGEFILE (GIMP_VIEW (GIMP_THUMB_BOX (dialog->thumb_box)->preview)->renderer)->file_system = _gtk_file_chooser_get_file_system (GTK_FILE_CHOOSER (dialog));
#endif
}
开发者ID:Amerekanets,项目名称:gimp,代码行数:26,代码来源:gimpfiledialog.c
示例17: palettes_merge_callback
static void
palettes_merge_callback (GtkWidget *widget,
const gchar *palette_name,
gpointer data)
{
/* FIXME: reimplement palettes_merge_callback() */
#if 0
GimpContainerEditor *editor;
GimpPalette *palette;
GimpPalette *new_palette;
GList *sel_list;
editor = (GimpContainerEditor *) data;
sel_list = GTK_LIST (GIMP_CONTAINER_LIST_VIEW (editor->view)->gtk_list)->selection;
if (! sel_list)
{
gimp_message_literal (gimp,
G_OBJECT (widget), GIMP_MESSAGE_WARNING,
"Can't merge palettes because "
"there are no palettes selected.");
return;
}
new_palette = GIMP_PALETTE (gimp_palette_new (palette_name, FALSE));
while (sel_list)
{
GimpListItem *list_item;
list_item = GIMP_LIST_ITEM (sel_list->data);
palette = (GimpPalette *) GIMP_VIEW (list_item->preview)->viewable;
if (palette)
{
GList *cols;
for (cols = gimp_palette_get_colors (palette);
cols;
cols = g_list_next (cols))
{
GimpPaletteEntry *entry = cols->data;
gimp_palette_add_entry (new_palette,
entry->name,
&entry->color);
}
}
sel_list = sel_list->next;
}
gimp_container_add (editor->view->container,
GIMP_OBJECT (new_palette));
#endif
}
开发者ID:AdamGrzonkowski,项目名称:gimp-1,代码行数:58,代码来源:palettes-commands.c
示例18: gimp_brush_editor_set_data
static void
gimp_brush_editor_set_data (GimpDataEditor *editor,
GimpData *data)
{
GimpBrushEditor *brush_editor = GIMP_BRUSH_EDITOR (editor);
GimpBrushGeneratedShape shape = GIMP_BRUSH_GENERATED_CIRCLE;
gdouble radius = 0.0;
gint spikes = 2;
gdouble hardness = 0.0;
gdouble ratio = 0.0;
gdouble angle = 0.0;
gdouble spacing = 0.0;
if (editor->data)
g_signal_handlers_disconnect_by_func (editor->data,
gimp_brush_editor_notify_brush,
editor);
GIMP_DATA_EDITOR_CLASS (parent_class)->set_data (editor, data);
if (editor->data)
g_signal_connect (editor->data, "notify",
G_CALLBACK (gimp_brush_editor_notify_brush),
editor);
gimp_view_set_viewable (GIMP_VIEW (editor->view), GIMP_VIEWABLE (data));
if (editor->data)
{
spacing = gimp_brush_get_spacing (GIMP_BRUSH (editor->data));
if (GIMP_IS_BRUSH_GENERATED (editor->data))
{
GimpBrushGenerated *brush = GIMP_BRUSH_GENERATED (editor->data);
shape = gimp_brush_generated_get_shape (brush);
radius = gimp_brush_generated_get_radius (brush);
spikes = gimp_brush_generated_get_spikes (brush);
hardness = gimp_brush_generated_get_hardness (brush);
ratio = gimp_brush_generated_get_aspect_ratio (brush);
angle = gimp_brush_generated_get_angle (brush);
}
}
gtk_widget_set_sensitive (brush_editor->options_box,
editor->data_editable);
gimp_int_radio_group_set_active (GTK_RADIO_BUTTON (brush_editor->shape_group),
shape);
gtk_adjustment_set_value (brush_editor->radius_data, radius);
gtk_adjustment_set_value (brush_editor->spikes_data, spikes);
gtk_adjustment_set_value (brush_editor->hardness_data, hardness);
gtk_adjustment_set_value (brush_editor->aspect_ratio_data, ratio);
gtk_adjustment_set_value (brush_editor->angle_data, angle);
gtk_adjustment_set_value (brush_editor->spacing_data, spacing);
}
开发者ID:alfanak,项目名称:gimp,代码行数:57,代码来源:gimpbrusheditor.c
示例19: gimp_container_grid_view_item_context
static void
gimp_container_grid_view_item_context (GtkWidget *widget,
gpointer data)
{
/* ref the view because calling gimp_container_view_item_selected()
* may destroy the widget
*/
g_object_ref (data);
if (gimp_container_view_item_selected (GIMP_CONTAINER_VIEW (data),
GIMP_VIEW (widget)->viewable))
{
gimp_container_view_item_context (GIMP_CONTAINER_VIEW (data),
GIMP_VIEW (widget)->viewable);
}
g_object_unref (data);
}
开发者ID:MichaelMure,项目名称:Gimp-Cage-Tool,代码行数:18,代码来源:gimpcontainergridview.c
示例20: gimp_toolbox_image_area_create
GtkWidget *
gimp_toolbox_image_area_create (GimpToolbox *toolbox,
gint width,
gint height)
{
GimpContext *context;
GtkWidget *image_view;
gchar *tooltip;
g_return_val_if_fail (GIMP_IS_TOOLBOX (toolbox), NULL);
context = gimp_toolbox_get_context (toolbox);
image_view = gimp_view_new_full_by_types (context,
GIMP_TYPE_VIEW, GIMP_TYPE_IMAGE,
width, height, 0,
FALSE, TRUE, TRUE);
g_signal_connect (image_view, "set-viewable",
G_CALLBACK (image_preview_set_viewable),
NULL);
gimp_view_set_viewable (GIMP_VIEW (image_view),
GIMP_VIEWABLE (gimp_context_get_image (context)));
gtk_widget_show (image_view);
#ifdef GDK_WINDOWING_X11
tooltip = g_strdup_printf ("%s\n%s",
_("The active image.\n"
"Click to open the Image Dialog."),
_("Drag to an XDS enabled file-manager to "
"save the image."));
#else
tooltip = g_strdup (_("The active image.\n"
"Click to open the Image Dialog."));
#endif
gimp_help_set_help_data (image_view, tooltip,
GIMP_HELP_TOOLBOX_IMAGE_AREA);
g_free (tooltip);
g_signal_connect_object (context, "image-changed",
G_CALLBACK (gimp_view_set_viewable),
image_view, G_CONNECT_SWAPPED);
g_signal_connect (image_view, "clicked",
G_CALLBACK (image_preview_clicked),
toolbox);
gimp_dnd_viewable_dest_add (image_view,
GIMP_TYPE_IMAGE,
image_preview_drop_image,
context);
return image_view;
}
开发者ID:jiapei100,项目名称:gimp,代码行数:57,代码来源:gimptoolbox-image-area.c
注:本文中的GIMP_VIEW函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论