2006-12-09 21:33:38 +00:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2004-07-12 11:41:19 +00:00
|
|
|
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-17 22:28:01 +00:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2004-07-12 11:41:19 +00:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-17 22:28:01 +00:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2004-07-12 11:41:19 +00:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2018-07-11 23:27:07 +02:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2004-07-12 11:41:19 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GIMP_GUI_H__
|
|
|
|
#define __GIMP_GUI_H__
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _GimpGui GimpGui;
|
|
|
|
|
|
|
|
struct _GimpGui
|
|
|
|
{
|
2014-07-10 22:52:29 +02:00
|
|
|
void (* ungrab) (Gimp *gimp);
|
|
|
|
|
|
|
|
void (* set_busy) (Gimp *gimp);
|
|
|
|
void (* unset_busy) (Gimp *gimp);
|
|
|
|
|
|
|
|
void (* show_message) (Gimp *gimp,
|
|
|
|
GObject *handler,
|
|
|
|
GimpMessageSeverity severity,
|
|
|
|
const gchar *domain,
|
2018-02-12 01:59:08 +01:00
|
|
|
const gchar *message);
|
2014-07-10 22:52:29 +02:00
|
|
|
void (* help) (Gimp *gimp,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const gchar *help_domain,
|
|
|
|
const gchar *help_id);
|
|
|
|
|
app: add gimp_wait()
Add a GimpGui::wait() virtual function, and a corresponding
gimp_wait() function. The function takes an object implementing
the GimpWaitable interface, and a printf-style message, and waits
for the object to become ready, displaying the message as
indication in the meantime. The default implementation simply
prints the message to STDERR.
Implement the function in gui-vtable, using the busy-dialog plug-
in added in the previous commit, to display the message in a
dialog. Additionally, if the object implements the GimpCancelable
interface, provide a "cancel" button in the dialog, which, when
pressed, causes gimp_cancelable_cancel() to be called on the
object. Note that the function keeps waiting on the object even
after requesting cancelation; GimpTriviallyCancelableWaitable can
be used to stop the wait once cancelation has been requested.
2018-05-29 11:59:51 -04:00
|
|
|
gboolean (* wait) (Gimp *gimp,
|
|
|
|
GimpWaitable *waitable,
|
|
|
|
const gchar *message);
|
|
|
|
|
2014-07-10 22:52:29 +02:00
|
|
|
const gchar * (* get_program_class) (Gimp *gimp);
|
|
|
|
gchar * (* get_display_name) (Gimp *gimp,
|
2019-08-23 22:23:23 +02:00
|
|
|
gint display_id,
|
2018-04-29 17:27:47 +02:00
|
|
|
GObject **monitor,
|
|
|
|
gint *monitor_number);
|
2014-07-10 22:52:29 +02:00
|
|
|
guint32 (* get_user_time) (Gimp *gimp);
|
|
|
|
|
2014-07-17 10:09:19 +02:00
|
|
|
GFile * (* get_theme_dir) (Gimp *gimp);
|
2015-12-08 14:52:12 -05:00
|
|
|
GFile * (* get_icon_theme_dir) (Gimp *gimp);
|
2014-07-10 22:52:29 +02:00
|
|
|
|
|
|
|
GimpObject * (* get_window_strategy) (Gimp *gimp);
|
2019-09-04 14:27:18 +02:00
|
|
|
GimpDisplay * (* get_empty_display) (Gimp *gimp);
|
|
|
|
guint32 (* display_get_window_id) (GimpDisplay *display);
|
|
|
|
GimpDisplay * (* display_create) (Gimp *gimp,
|
2014-07-10 22:52:29 +02:00
|
|
|
GimpImage *image,
|
|
|
|
GimpUnit unit,
|
|
|
|
gdouble scale,
|
2018-04-29 17:27:47 +02:00
|
|
|
GObject *monitor);
|
2019-09-04 14:27:18 +02:00
|
|
|
void (* display_delete) (GimpDisplay *display);
|
2014-07-10 22:52:29 +02:00
|
|
|
void (* displays_reconnect) (Gimp *gimp,
|
|
|
|
GimpImage *old_image,
|
|
|
|
GimpImage *new_image);
|
|
|
|
|
|
|
|
GimpProgress * (* progress_new) (Gimp *gimp,
|
2019-09-04 14:27:18 +02:00
|
|
|
GimpDisplay *display);
|
2014-07-10 22:52:29 +02:00
|
|
|
void (* progress_free) (Gimp *gimp,
|
|
|
|
GimpProgress *progress);
|
|
|
|
|
|
|
|
gboolean (* pdb_dialog_new) (Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
GimpContainer *container,
|
|
|
|
const gchar *title,
|
|
|
|
const gchar *callback_name,
|
|
|
|
const gchar *object_name,
|
|
|
|
va_list args);
|
|
|
|
gboolean (* pdb_dialog_set) (Gimp *gimp,
|
|
|
|
GimpContainer *container,
|
|
|
|
const gchar *callback_name,
|
|
|
|
const gchar *object_name,
|
|
|
|
va_list args);
|
|
|
|
gboolean (* pdb_dialog_close) (Gimp *gimp,
|
|
|
|
GimpContainer *container,
|
|
|
|
const gchar *callback_name);
|
|
|
|
gboolean (* recent_list_add_file) (Gimp *gimp,
|
|
|
|
GFile *file,
|
|
|
|
const gchar *mime_type);
|
|
|
|
void (* recent_list_load) (Gimp *gimp);
|
|
|
|
|
2015-08-23 10:51:31 +02:00
|
|
|
GMountOperation
|
|
|
|
* (* get_mount_operation) (Gimp *gimp,
|
2014-07-22 20:29:52 +02:00
|
|
|
GimpProgress *progress);
|
2015-08-23 10:51:31 +02:00
|
|
|
|
|
|
|
GimpColorProfilePolicy
|
|
|
|
(* query_profile_policy) (Gimp *gimp,
|
|
|
|
GimpImage *image,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpColorProfile **dest_profile,
|
2016-06-05 22:36:52 +02:00
|
|
|
GimpColorRenderingIntent *intent,
|
|
|
|
gboolean *bpc,
|
2015-08-23 10:51:31 +02:00
|
|
|
gboolean *dont_ask);
|
app, libgimp, plug-ins: move Orientation metadata handling into core.
Orientation is now handled by core code, just next to profile conversion
handling.
One of the first consequence is that we don't need to have a non-GUI
version gimp_image_metadata_load_finish_batch() in libgimp, next to a
GUI version of the gimp_image_metadata_load_finish() function in
libgimpui. This makes for simpler API.
Also a plug-in which wishes to get access to the rotation dialog
provided by GIMP without loading ligimpui/GTK+ (for whatever reason)
will still have the feature.
The main advantage is that the "Don't ask me again" feature is now
handled by a settings in `Preferences > Image Import & Export` as the
"Metadata rotation policy". Until now it was saved as a global parasite,
which made it virtually non-editable once you checked it once (no easy
way to edit parasites except by scripts). So say you refused the
rotation once while checking "Don't ask again", and GIMP will forever
discard the rotation metadata without giving you a sane way to change
your mind. Of course, I could have passed the settings to plug-ins
through the PDB, but I find it a lot better to simply handle such
settings core-side.
The dialog code is basically the same as an app/dialogs/ as it was in
libgimp, with the minor improvement that it now takes the scale ratio
into account (basically the maximum thumbnail size will be bigger on
higher density displays).
Only downside of the move to the core is that this rotation dialog is
raised only when you open an image from the core, not as a PDB call. So
a plug-in which makes say a "file-jpeg-load" PDB call, even in
INTERACTIVE run mode, won't have rotation processed. Note that this was
already the same for embedded color profile conversion. This can be
wanted or not. Anyway some additional libgimp calls might be of interest
to explicitly call the core dialogs.
2020-09-23 19:59:09 +02:00
|
|
|
|
|
|
|
GimpMetadataRotationPolicy
|
|
|
|
(* query_rotation_policy) (Gimp *gimp,
|
|
|
|
GimpImage *image,
|
|
|
|
GimpContext *context,
|
|
|
|
gboolean *dont_ask);
|
2014-07-10 22:52:29 +02:00
|
|
|
};
|
2011-02-06 12:07:55 +01:00
|
|
|
|
|
|
|
|
2014-07-10 22:52:29 +02:00
|
|
|
void gimp_gui_init (Gimp *gimp);
|
2011-02-06 12:07:55 +01:00
|
|
|
|
2014-07-10 22:52:29 +02:00
|
|
|
void gimp_gui_ungrab (Gimp *gimp);
|
2011-02-06 12:07:55 +01:00
|
|
|
|
2014-07-10 22:52:29 +02:00
|
|
|
GimpObject * gimp_get_window_strategy (Gimp *gimp);
|
2019-09-04 14:27:18 +02:00
|
|
|
GimpDisplay * gimp_get_empty_display (Gimp *gimp);
|
|
|
|
GimpDisplay * gimp_get_display_by_id (Gimp *gimp,
|
2011-02-06 12:07:55 +01:00
|
|
|
gint ID);
|
2019-08-23 22:23:23 +02:00
|
|
|
gint gimp_get_display_id (Gimp *gimp,
|
2019-09-04 14:27:18 +02:00
|
|
|
GimpDisplay *display);
|
2014-07-10 22:52:29 +02:00
|
|
|
guint32 gimp_get_display_window_id (Gimp *gimp,
|
2019-09-04 14:27:18 +02:00
|
|
|
GimpDisplay *display);
|
|
|
|
GimpDisplay * gimp_create_display (Gimp *gimp,
|
2011-02-06 12:07:55 +01:00
|
|
|
GimpImage *image,
|
|
|
|
GimpUnit unit,
|
2014-05-02 20:20:46 +02:00
|
|
|
gdouble scale,
|
2018-04-29 17:27:47 +02:00
|
|
|
GObject *monitor);
|
2014-07-10 22:52:29 +02:00
|
|
|
void gimp_delete_display (Gimp *gimp,
|
2019-09-04 14:27:18 +02:00
|
|
|
GimpDisplay *display);
|
2014-07-10 22:52:29 +02:00
|
|
|
void gimp_reconnect_displays (Gimp *gimp,
|
2011-02-06 12:07:55 +01:00
|
|
|
GimpImage *old_image,
|
|
|
|
GimpImage *new_image);
|
|
|
|
|
2014-07-10 22:52:29 +02:00
|
|
|
void gimp_set_busy (Gimp *gimp);
|
|
|
|
void gimp_set_busy_until_idle (Gimp *gimp);
|
|
|
|
void gimp_unset_busy (Gimp *gimp);
|
|
|
|
|
|
|
|
void gimp_show_message (Gimp *gimp,
|
|
|
|
GObject *handler,
|
|
|
|
GimpMessageSeverity severity,
|
|
|
|
const gchar *domain,
|
2018-02-12 01:59:08 +01:00
|
|
|
const gchar *message);
|
2014-07-10 22:52:29 +02:00
|
|
|
void gimp_help (Gimp *gimp,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const gchar *help_domain,
|
|
|
|
const gchar *help_id);
|
|
|
|
|
app: add gimp_wait()
Add a GimpGui::wait() virtual function, and a corresponding
gimp_wait() function. The function takes an object implementing
the GimpWaitable interface, and a printf-style message, and waits
for the object to become ready, displaying the message as
indication in the meantime. The default implementation simply
prints the message to STDERR.
Implement the function in gui-vtable, using the busy-dialog plug-
in added in the previous commit, to display the message in a
dialog. Additionally, if the object implements the GimpCancelable
interface, provide a "cancel" button in the dialog, which, when
pressed, causes gimp_cancelable_cancel() to be called on the
object. Note that the function keeps waiting on the object even
after requesting cancelation; GimpTriviallyCancelableWaitable can
be used to stop the wait once cancelation has been requested.
2018-05-29 11:59:51 -04:00
|
|
|
void gimp_wait (Gimp *gimp,
|
|
|
|
GimpWaitable *waitable,
|
|
|
|
const gchar *format,
|
|
|
|
...) G_GNUC_PRINTF (3, 4);
|
|
|
|
|
2014-07-10 22:52:29 +02:00
|
|
|
GimpProgress * gimp_new_progress (Gimp *gimp,
|
2019-09-04 14:27:18 +02:00
|
|
|
GimpDisplay *display);
|
2014-07-10 22:52:29 +02:00
|
|
|
void gimp_free_progress (Gimp *gimp,
|
2011-02-06 12:07:55 +01:00
|
|
|
GimpProgress *progress);
|
|
|
|
|
2014-07-10 22:52:29 +02:00
|
|
|
const gchar * gimp_get_program_class (Gimp *gimp);
|
|
|
|
gchar * gimp_get_display_name (Gimp *gimp,
|
2019-08-23 22:23:23 +02:00
|
|
|
gint display_id,
|
2018-04-29 17:27:47 +02:00
|
|
|
GObject **monitor,
|
|
|
|
gint *monitor_number);
|
2014-07-10 22:52:29 +02:00
|
|
|
guint32 gimp_get_user_time (Gimp *gimp);
|
2014-07-17 10:09:19 +02:00
|
|
|
GFile * gimp_get_theme_dir (Gimp *gimp);
|
2015-12-08 14:52:12 -05:00
|
|
|
GFile * gimp_get_icon_theme_dir (Gimp *gimp);
|
2014-07-10 22:52:29 +02:00
|
|
|
|
|
|
|
gboolean gimp_pdb_dialog_new (Gimp *gimp,
|
2011-02-06 12:07:55 +01:00
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
GimpContainer *container,
|
|
|
|
const gchar *title,
|
|
|
|
const gchar *callback_name,
|
|
|
|
const gchar *object_name,
|
2014-07-10 22:52:29 +02:00
|
|
|
...) G_GNUC_NULL_TERMINATED;
|
|
|
|
gboolean gimp_pdb_dialog_set (Gimp *gimp,
|
2011-02-06 12:07:55 +01:00
|
|
|
GimpContainer *container,
|
|
|
|
const gchar *callback_name,
|
|
|
|
const gchar *object_name,
|
2014-07-10 22:52:29 +02:00
|
|
|
...) G_GNUC_NULL_TERMINATED;
|
|
|
|
gboolean gimp_pdb_dialog_close (Gimp *gimp,
|
2011-02-06 12:07:55 +01:00
|
|
|
GimpContainer *container,
|
|
|
|
const gchar *callback_name);
|
2014-07-10 22:52:29 +02:00
|
|
|
gboolean gimp_recent_list_add_file (Gimp *gimp,
|
2014-07-05 12:51:54 +02:00
|
|
|
GFile *file,
|
2011-02-06 12:07:55 +01:00
|
|
|
const gchar *mime_type);
|
2014-07-10 22:52:29 +02:00
|
|
|
void gimp_recent_list_load (Gimp *gimp);
|
2004-07-12 11:41:19 +00:00
|
|
|
|
2015-08-23 10:51:31 +02:00
|
|
|
GMountOperation
|
|
|
|
* gimp_get_mount_operation (Gimp *gimp,
|
2014-07-22 20:29:52 +02:00
|
|
|
GimpProgress *progress);
|
2008-03-24 11:11:15 +00:00
|
|
|
|
2015-08-23 10:51:31 +02:00
|
|
|
GimpColorProfilePolicy
|
|
|
|
gimp_query_profile_policy (Gimp *gimp,
|
|
|
|
GimpImage *image,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpColorProfile **dest_profile,
|
2016-06-05 22:36:52 +02:00
|
|
|
GimpColorRenderingIntent *intent,
|
|
|
|
gboolean *bpc,
|
2015-08-23 10:51:31 +02:00
|
|
|
gboolean *dont_ask);
|
|
|
|
|
app, libgimp, plug-ins: move Orientation metadata handling into core.
Orientation is now handled by core code, just next to profile conversion
handling.
One of the first consequence is that we don't need to have a non-GUI
version gimp_image_metadata_load_finish_batch() in libgimp, next to a
GUI version of the gimp_image_metadata_load_finish() function in
libgimpui. This makes for simpler API.
Also a plug-in which wishes to get access to the rotation dialog
provided by GIMP without loading ligimpui/GTK+ (for whatever reason)
will still have the feature.
The main advantage is that the "Don't ask me again" feature is now
handled by a settings in `Preferences > Image Import & Export` as the
"Metadata rotation policy". Until now it was saved as a global parasite,
which made it virtually non-editable once you checked it once (no easy
way to edit parasites except by scripts). So say you refused the
rotation once while checking "Don't ask again", and GIMP will forever
discard the rotation metadata without giving you a sane way to change
your mind. Of course, I could have passed the settings to plug-ins
through the PDB, but I find it a lot better to simply handle such
settings core-side.
The dialog code is basically the same as an app/dialogs/ as it was in
libgimp, with the minor improvement that it now takes the scale ratio
into account (basically the maximum thumbnail size will be bigger on
higher density displays).
Only downside of the move to the core is that this rotation dialog is
raised only when you open an image from the core, not as a PDB call. So
a plug-in which makes say a "file-jpeg-load" PDB call, even in
INTERACTIVE run mode, won't have rotation processed. Note that this was
already the same for embedded color profile conversion. This can be
wanted or not. Anyway some additional libgimp calls might be of interest
to explicitly call the core dialogs.
2020-09-23 19:59:09 +02:00
|
|
|
GimpMetadataRotationPolicy
|
|
|
|
gimp_query_rotation_policy (Gimp *gimp,
|
|
|
|
GimpImage *image,
|
|
|
|
GimpContext *context,
|
|
|
|
gboolean *dont_ask);
|
|
|
|
|
2004-07-12 11:41:19 +00:00
|
|
|
|
|
|
|
#endif /* __GIMP_GUI_H__ */
|