mirror of https://github.com/GNOME/gimp.git
app/core/gimp-gui.[ch] added gimp_get_empty_display() to the vtable.
2008-03-25 Sven Neumann <sven@gimp.org> * app/core/gimp-gui.[ch] * app/gui/gui-vtable.c: added gimp_get_empty_display() to the vtable. * app/file/file-open.c (file_open_from_command_line): use the empty display as progress window when opening an image from the command-line or via the DBus interface. svn path=/trunk/; revision=25219
This commit is contained in:
parent
c7bf68d2c7
commit
76afd97769
|
@ -1,3 +1,12 @@
|
|||
2008-03-25 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/core/gimp-gui.[ch]
|
||||
* app/gui/gui-vtable.c: added gimp_get_empty_display() to the vtable.
|
||||
|
||||
* app/file/file-open.c (file_open_from_command_line): use the
|
||||
empty display as progress window when opening an image from the
|
||||
command-line or via the DBus interface.
|
||||
|
||||
2008-03-25 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/actions/image-actions.c: remove "image-new-from-image"
|
||||
|
|
|
@ -237,6 +237,17 @@ gimp_get_theme_dir (Gimp *gimp)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
GimpObject *
|
||||
gimp_get_empty_display (Gimp *gimp)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
||||
|
||||
if (gimp->gui.get_empty_display)
|
||||
return gimp->gui.get_empty_display (gimp);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GimpObject *
|
||||
gimp_get_display_by_ID (Gimp *gimp,
|
||||
gint ID)
|
||||
|
|
|
@ -47,6 +47,7 @@ struct _GimpGui
|
|||
gint *monitor_number);
|
||||
const gchar * (* get_theme_dir) (Gimp *gimp);
|
||||
|
||||
GimpObject * (* get_empty_display) (Gimp *gimp);
|
||||
GimpObject * (* display_get_by_id) (Gimp *gimp,
|
||||
gint ID);
|
||||
gint (* display_get_id) (GimpObject *display);
|
||||
|
@ -96,6 +97,7 @@ void gimp_gui_ungrab (Gimp *gimp);
|
|||
void gimp_threads_enter (Gimp *gimp);
|
||||
void gimp_threads_leave (Gimp *gimp);
|
||||
|
||||
GimpObject * gimp_get_empty_display (Gimp *gimp);
|
||||
GimpObject * gimp_get_display_by_ID (Gimp *gimp,
|
||||
gint ID);
|
||||
gint gimp_get_display_ID (Gimp *gimp,
|
||||
|
|
|
@ -481,11 +481,12 @@ file_open_from_command_line (Gimp *gimp,
|
|||
if (uri)
|
||||
{
|
||||
GimpImage *image;
|
||||
GimpObject *display = gimp_get_empty_display (gimp);
|
||||
GimpPDBStatusType status;
|
||||
|
||||
image = file_open_with_display (gimp,
|
||||
gimp_get_user_context (gimp),
|
||||
NULL,
|
||||
GIMP_PROGRESS (display),
|
||||
uri, as_new,
|
||||
&status, &error);
|
||||
|
||||
|
@ -497,7 +498,7 @@ file_open_from_command_line (Gimp *gimp,
|
|||
{
|
||||
gchar *filename = file_utils_uri_display_name (uri);
|
||||
|
||||
gimp_message (gimp, NULL, GIMP_MESSAGE_ERROR,
|
||||
gimp_message (gimp, G_OBJECT (display), GIMP_MESSAGE_ERROR,
|
||||
_("Opening '%s' failed: %s"),
|
||||
filename, error->message);
|
||||
g_clear_error (&error);
|
||||
|
|
|
@ -89,6 +89,7 @@ static gchar * gui_get_display_name (Gimp *gimp,
|
|||
gint display_ID,
|
||||
gint *monitor_number);
|
||||
static const gchar * gui_get_theme_dir (Gimp *gimp);
|
||||
static GimpObject * gui_get_empty_display (Gimp *gimp);
|
||||
static GimpObject * gui_display_get_by_ID (Gimp *gimp,
|
||||
gint ID);
|
||||
static gint gui_display_get_ID (GimpObject *display);
|
||||
|
@ -101,7 +102,6 @@ static void gui_display_delete (GimpObject *display);
|
|||
static void gui_displays_reconnect (Gimp *gimp,
|
||||
GimpImage *old_image,
|
||||
GimpImage *new_image);
|
||||
static GimpDisplay * gui_get_empty_display (Gimp *gimp);
|
||||
static GimpProgress * gui_new_progress (Gimp *gimp,
|
||||
GimpObject *display);
|
||||
static void gui_free_progress (Gimp *gimp,
|
||||
|
@ -145,6 +145,7 @@ gui_vtable_init (Gimp *gimp)
|
|||
gimp->gui.get_program_class = gui_get_program_class;
|
||||
gimp->gui.get_display_name = gui_get_display_name;
|
||||
gimp->gui.get_theme_dir = gui_get_theme_dir;
|
||||
gimp->gui.get_empty_display = gui_get_empty_display;
|
||||
gimp->gui.display_get_by_id = gui_display_get_by_ID;
|
||||
gimp->gui.display_get_id = gui_display_get_ID;
|
||||
gimp->gui.display_get_window = gui_display_get_window;
|
||||
|
@ -260,6 +261,25 @@ gui_get_theme_dir (Gimp *gimp)
|
|||
return themes_get_theme_dir (gimp, GIMP_GUI_CONFIG (gimp->config)->theme);
|
||||
}
|
||||
|
||||
static GimpObject *
|
||||
gui_get_empty_display (Gimp *gimp)
|
||||
{
|
||||
GimpObject *display = NULL;
|
||||
|
||||
if (gimp_container_num_children (gimp->displays) == 1)
|
||||
{
|
||||
display = gimp_container_get_child_by_index (gimp->displays, 0);
|
||||
|
||||
if (GIMP_DISPLAY (display)->image)
|
||||
{
|
||||
/* The display was not empty */
|
||||
display = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return display;
|
||||
}
|
||||
|
||||
static GimpObject *
|
||||
gui_display_get_by_ID (Gimp *gimp,
|
||||
gint ID)
|
||||
|
@ -291,12 +311,11 @@ gui_display_create (Gimp *gimp,
|
|||
gdouble scale)
|
||||
{
|
||||
GimpContext *context = gimp_get_user_context (gimp);
|
||||
GimpDisplay *display = NULL;
|
||||
GimpObject *object = gui_get_empty_display (gimp);
|
||||
GimpDisplay *display = object ? GIMP_DISPLAY (object) : NULL;
|
||||
|
||||
if (gui_get_empty_display (gimp) != NULL)
|
||||
if (display)
|
||||
{
|
||||
display = gui_get_empty_display (gimp);
|
||||
|
||||
gimp_display_fill (display, image, unit, scale);
|
||||
}
|
||||
else
|
||||
|
@ -341,25 +360,6 @@ gui_displays_reconnect (Gimp *gimp,
|
|||
gimp_displays_reconnect (gimp, old_image, new_image);
|
||||
}
|
||||
|
||||
static GimpDisplay *
|
||||
gui_get_empty_display (Gimp *gimp)
|
||||
{
|
||||
GimpDisplay *display = NULL;
|
||||
|
||||
if (gimp_container_num_children (gimp->displays) == 1)
|
||||
{
|
||||
display = (GimpDisplay *) gimp_container_get_child_by_index (gimp->displays, 0);
|
||||
|
||||
if (display->image != NULL)
|
||||
{
|
||||
/* The display was not empty */
|
||||
display = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return display;
|
||||
}
|
||||
|
||||
static GimpProgress *
|
||||
gui_new_progress (Gimp *gimp,
|
||||
GimpObject *display)
|
||||
|
|
Loading…
Reference in New Issue