本文整理匯總了C++中GIMP_IS_DISPLAY函數的典型用法代碼示例。如果您正苦於以下問題:C++ GIMP_IS_DISPLAY函數的具體用法?C++ GIMP_IS_DISPLAY怎麽用?C++ GIMP_IS_DISPLAY使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GIMP_IS_DISPLAY函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: gimp_display_flush_now
void
gimp_display_flush_now (GimpDisplay *display)
{
g_return_if_fail (GIMP_IS_DISPLAY (display));
gimp_display_flush_whenever (display, TRUE);
}
示例2: gimp_foreground_select_tool_drop_masks
static void
gimp_foreground_select_tool_drop_masks (GimpForegroundSelectTool *fg_select,
GimpDisplay *display)
{
GimpTool *tool = GIMP_TOOL (fg_select);
if (fg_select->trimap)
{
g_object_unref (fg_select->trimap);
fg_select->trimap = NULL;
}
if (fg_select->mask)
{
g_object_unref (fg_select->mask);
fg_select->mask = NULL;
}
if (GIMP_IS_DISPLAY (display))
{
gimp_display_shell_set_mask (gimp_display_get_shell (display),
NULL, NULL);
}
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_TOOL_CURSOR_FREE_SELECT);
gimp_tool_control_set_toggle_tool_cursor (tool->control,
GIMP_TOOL_CURSOR_FREE_SELECT);
gimp_tool_control_set_toggled (tool->control, FALSE);
fg_select->state = MATTING_STATE_FREE_SELECT;
}
示例3: gimp_color_tool_start_sample_point
void
gimp_color_tool_start_sample_point (GimpTool *tool,
GimpDisplay *display)
{
GimpColorTool *color_tool;
g_return_if_fail (GIMP_IS_COLOR_TOOL (tool));
g_return_if_fail (GIMP_IS_DISPLAY (display));
color_tool = GIMP_COLOR_TOOL (tool);
gimp_display_shell_selection_pause (gimp_display_get_shell (display));
tool->display = display;
gimp_tool_control_activate (tool->control);
gimp_tool_control_set_scroll_lock (tool->control, TRUE);
if (gimp_draw_tool_is_active (GIMP_DRAW_TOOL (tool)))
gimp_draw_tool_stop (GIMP_DRAW_TOOL (tool));
color_tool->sample_point = NULL;
color_tool->moving_sample_point = TRUE;
color_tool->sample_point_x = SAMPLE_POINT_POSITION_INVALID;
color_tool->sample_point_y = SAMPLE_POINT_POSITION_INVALID;
gimp_tool_set_cursor (tool, display,
GIMP_CURSOR_MOUSE,
GIMP_TOOL_CURSOR_COLOR_PICKER,
GIMP_CURSOR_MODIFIER_MOVE);
gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), display);
}
示例4: gimp_tool_button_press
void
gimp_tool_button_press (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *display)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (coords != NULL);
g_return_if_fail (GIMP_IS_DISPLAY (display));
GIMP_TOOL_GET_CLASS (tool)->button_press (tool, coords, time, state,
display);
if (gimp_tool_control_is_active (tool->control))
{
tool->button_press_state = state;
tool->active_modifier_state = state;
if (gimp_tool_control_get_wants_click (tool->control))
{
tool->in_click_distance = TRUE;
tool->got_motion_event = FALSE;
tool->button_press_coords = *coords;
tool->button_press_time = time;
}
else
{
tool->in_click_distance = FALSE;
}
}
}
示例5: gimp_color_tool_start_sample_point
void
gimp_color_tool_start_sample_point (GimpTool *tool,
GimpDisplay *display)
{
GimpColorTool *color_tool;
g_return_if_fail (GIMP_IS_COLOR_TOOL (tool));
g_return_if_fail (GIMP_IS_DISPLAY (display));
color_tool = GIMP_COLOR_TOOL (tool);
gimp_display_shell_selection_control (GIMP_DISPLAY_SHELL (display->shell),
GIMP_SELECTION_PAUSE);
tool->display = display;
gimp_tool_control_activate (tool->control);
if (color_tool->sample_point)
gimp_display_shell_draw_sample_point (GIMP_DISPLAY_SHELL (display->shell),
color_tool->sample_point, FALSE);
color_tool->sample_point = NULL;
color_tool->moving_sample_point = TRUE;
color_tool->sample_point_x = -1;
color_tool->sample_point_y = -1;
gimp_tool_set_cursor (tool, display,
GIMP_CURSOR_MOUSE,
GIMP_TOOL_CURSOR_COLOR_PICKER,
GIMP_CURSOR_MODIFIER_MOVE);
gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), display);
}
示例6: gimp_display_update_area
void
gimp_display_update_area (GimpDisplay *display,
gboolean now,
gint x,
gint y,
gint w,
gint h)
{
g_return_if_fail (GIMP_IS_DISPLAY (display));
if (now)
{
gimp_display_paint_area (display, x, y, w, h);
}
else
{
GimpArea *area = gimp_area_new (CLAMP (x, 0, display->image->width),
CLAMP (y, 0, display->image->height),
CLAMP (x + w, 0, display->image->width),
CLAMP (y + h, 0, display->image->height));
display->update_areas = gimp_area_list_process (display->update_areas,
area);
}
}
示例7: gimp_tool_push_status_length
void
gimp_tool_push_status_length (GimpTool *tool,
GimpDisplay *display,
const gchar *title,
GimpOrientationType axis,
gdouble value,
const gchar *help)
{
GimpDisplayShell *shell;
const gchar *stock_id;
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (GIMP_IS_DISPLAY (display));
shell = GIMP_DISPLAY_SHELL (display->shell);
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool->tool_info));
gimp_statusbar_push_length (GIMP_STATUSBAR (shell->statusbar),
G_OBJECT_TYPE_NAME (tool), stock_id,
title, axis, value, help);
tool->status_displays = g_list_remove (tool->status_displays, display);
tool->status_displays = g_list_prepend (tool->status_displays, display);
}
示例8: gimp_tool_set_focus_display
void
gimp_tool_set_focus_display (GimpTool *tool,
GimpDisplay *display)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (display == NULL || GIMP_IS_DISPLAY (display));
#ifdef DEBUG_FOCUS
g_printerr ("%s: tool: %p display: %p focus_display: %p\n",
G_STRFUNC, tool, display, tool->focus_display);
#endif
if (display != tool->focus_display)
{
if (tool->focus_display)
{
if (tool->active_modifier_state != 0)
gimp_tool_set_active_modifier_state (tool, 0, tool->focus_display);
if (tool->modifier_state != 0)
gimp_tool_set_modifier_state (tool, 0, tool->focus_display);
}
tool->focus_display = display;
}
}
示例9: gimp_tool_push_status
void
gimp_tool_push_status (GimpTool *tool,
GimpDisplay *display,
const gchar *format,
...)
{
GimpDisplayShell *shell;
const gchar *stock_id;
va_list args;
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (GIMP_IS_DISPLAY (display));
g_return_if_fail (format != NULL);
shell = GIMP_DISPLAY_SHELL (display->shell);
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool->tool_info));
va_start (args, format);
gimp_statusbar_push_valist (GIMP_STATUSBAR (shell->statusbar),
G_OBJECT_TYPE_NAME (tool), stock_id,
format, args);
va_end (args);
tool->status_displays = g_list_remove (tool->status_displays, display);
tool->status_displays = g_list_prepend (tool->status_displays, display);
}
示例10: gimp_tool_push_status_coords
void
gimp_tool_push_status_coords (GimpTool *tool,
GimpDisplay *display,
GimpCursorPrecision precision,
const gchar *title,
gdouble x,
const gchar *separator,
gdouble y,
const gchar *help)
{
GimpDisplayShell *shell;
const gchar *stock_id;
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (GIMP_IS_DISPLAY (display));
shell = GIMP_DISPLAY_SHELL (display->shell);
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool->tool_info));
gimp_statusbar_push_coords (GIMP_STATUSBAR (shell->statusbar),
G_OBJECT_TYPE_NAME (tool), stock_id,
precision, title, x, separator, y,
help);
tool->status_displays = g_list_remove (tool->status_displays, display);
tool->status_displays = g_list_prepend (tool->status_displays, display);
}
示例11: gimp_tool_set_focus_display
void
gimp_tool_set_focus_display (GimpTool *tool,
GimpDisplay *display)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (display == NULL || GIMP_IS_DISPLAY (display));
g_return_if_fail (gimp_tool_control_is_active (tool->control) == FALSE);
GIMP_LOG (TOOL_FOCUS, "tool: %p focus_display: %p tool->focus_display: %p",
tool, display, tool->focus_display);
if (display != tool->focus_display)
{
if (tool->focus_display)
{
if (tool->active_modifier_state != 0)
{
gimp_tool_control_activate (tool->control);
gimp_tool_set_active_modifier_state (tool, 0, tool->focus_display);
gimp_tool_control_halt (tool->control);
}
if (tool->modifier_state != 0)
gimp_tool_set_modifier_state (tool, 0, tool->focus_display);
}
tool->focus_display = display;
}
}
示例12: gimp_tool_progress_start
static GimpProgress *
gimp_tool_progress_start (GimpProgress *progress,
const gchar *message,
gboolean cancelable)
{
GimpTool *tool = GIMP_TOOL (progress);
GimpDisplayShell *shell;
gint x, y, w, h;
g_return_val_if_fail (GIMP_IS_DISPLAY (tool->display), NULL);
g_return_val_if_fail (tool->progress == NULL, NULL);
shell = gimp_display_get_shell (tool->display);
gimp_display_shell_untransform_viewport (shell, &x, &y, &w, &h);
tool->progress = gimp_canvas_progress_new (shell,
GIMP_HANDLE_ANCHOR_CENTER,
x + w / 2, y + h / 2);
gimp_display_shell_add_item (shell, tool->progress);
g_object_unref (tool->progress);
gimp_progress_start (GIMP_PROGRESS (tool->progress),
message, FALSE);
gimp_widget_flush_expose (shell->canvas);
tool->progress_display = tool->display;
return progress;
}
示例13: gimp_tool_replace_status
void
gimp_tool_replace_status (GimpTool *tool,
GimpDisplay *display,
const gchar *format,
...)
{
GimpDisplayShell *shell;
va_list args;
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (GIMP_IS_DISPLAY (display));
g_return_if_fail (format != NULL);
shell = GIMP_DISPLAY_SHELL (display->shell);
va_start (args, format);
gimp_statusbar_replace_valist (GIMP_STATUSBAR (shell->statusbar),
G_OBJECT_TYPE_NAME (tool),
format, args);
va_end (args);
tool->status_displays = g_list_remove (tool->status_displays, display);
tool->status_displays = g_list_prepend (tool->status_displays, display);
}
示例14: tool_manager_initialize_active
gboolean
tool_manager_initialize_active (Gimp *gimp,
GimpDisplay *display)
{
GimpToolManager *tool_manager;
g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
g_return_val_if_fail (GIMP_IS_DISPLAY (display), FALSE);
tool_manager = tool_manager_get (gimp);
if (tool_manager->active_tool)
{
GimpTool *tool = tool_manager->active_tool;
if (gimp_tool_initialize (tool, display))
{
GimpImage *image = gimp_display_get_image (display);
tool->drawable = gimp_image_get_active_drawable (image);
return TRUE;
}
}
return FALSE;
}
示例15: action_data_get_display
GimpDisplay *
action_data_get_display (gpointer data)
{
GimpDisplay *result = NULL;
static gboolean recursion = FALSE;
if (! data || recursion)
return NULL;
recursion = TRUE;
if (GIMP_IS_DISPLAY (data))
result = data;
else if (GIMP_IS_IMAGE_WINDOW (data))
{
GimpDisplayShell *shell = gimp_image_window_get_active_shell (data);
result = shell ? shell->display : NULL;
}
if (! result)
{
GimpContext *context = action_data_get_context (data);
if (context)
result = gimp_context_get_display (context);
}
recursion = FALSE;
return result;
}