2006-12-09 21:33:38 +00:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
1999-09-27 17:58:10 +00:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2003-03-13 13:08:37 +00:00
|
|
|
* gimpwidgets-utils.h
|
|
|
|
* Copyright (C) 1999-2003 Michael Natterer <mitch@gimp.org>
|
1999-09-27 17:58:10 +00:00
|
|
|
*
|
2009-01-17 22:28:01 +00:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
1999-09-27 17:58:10 +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
|
1999-09-27 17:58:10 +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/>.
|
1999-09-27 17:58:10 +00:00
|
|
|
*/
|
2000-12-16 21:37:03 +00:00
|
|
|
|
2015-05-06 22:15:30 +02:00
|
|
|
#ifndef __APP_GIMP_WIDGETS_UTILS_H__
|
|
|
|
#define __APP_GIMP_WIDGETS_UTILS_H__
|
1999-09-27 17:58:10 +00:00
|
|
|
|
|
|
|
|
2018-05-02 14:50:22 +02:00
|
|
|
GtkWidget * gimp_menu_item_get_image (GtkMenuItem *item);
|
|
|
|
void gimp_menu_item_set_image (GtkMenuItem *item,
|
2023-02-22 15:04:18 +01:00
|
|
|
GtkWidget *image,
|
|
|
|
GimpAction *action);
|
2018-05-02 14:50:22 +02:00
|
|
|
|
2009-10-11 16:58:59 +02:00
|
|
|
void gimp_menu_position (GtkMenu *menu,
|
|
|
|
gint *x,
|
|
|
|
gint *y);
|
2018-04-29 18:40:43 +02:00
|
|
|
void gimp_grid_attach_icon (GtkGrid *grid,
|
2009-10-11 16:58:59 +02:00
|
|
|
gint row,
|
2014-05-07 15:30:38 +02:00
|
|
|
const gchar *icon_name,
|
2009-10-11 16:58:59 +02:00
|
|
|
GtkWidget *widget,
|
2018-04-29 18:40:43 +02:00
|
|
|
gint columns);
|
2009-10-11 16:58:59 +02:00
|
|
|
void gimp_enum_radio_box_add (GtkBox *box,
|
|
|
|
GtkWidget *widget,
|
|
|
|
gint enum_value,
|
|
|
|
gboolean below);
|
|
|
|
void gimp_enum_radio_frame_add (GtkFrame *frame,
|
|
|
|
GtkWidget *widget,
|
|
|
|
gint enum_value,
|
|
|
|
gboolean below);
|
2014-05-08 09:11:31 +02:00
|
|
|
GdkPixbuf * gimp_widget_load_icon (GtkWidget *widget,
|
|
|
|
const gchar *icon_name,
|
|
|
|
gint size);
|
2010-06-11 22:38:34 +02:00
|
|
|
GimpTabStyle gimp_preview_tab_style_to_icon (GimpTabStyle tab_style);
|
2011-10-05 19:15:17 +02:00
|
|
|
|
2009-10-11 16:58:59 +02:00
|
|
|
const gchar * gimp_get_mod_string (GdkModifierType modifiers);
|
|
|
|
gchar * gimp_suggest_modifiers (const gchar *message,
|
|
|
|
GdkModifierType modifiers,
|
2015-10-17 15:31:08 +02:00
|
|
|
const gchar *extend_selection_format,
|
|
|
|
const gchar *toggle_behavior_format,
|
2009-10-11 16:58:59 +02:00
|
|
|
const gchar *alt_format);
|
2011-10-06 10:24:49 +02:00
|
|
|
GimpChannelOps gimp_modifiers_to_channel_op (GdkModifierType modifiers);
|
2011-10-05 19:15:17 +02:00
|
|
|
GdkModifierType gimp_replace_virtual_modifiers (GdkModifierType modifiers);
|
2013-11-08 10:00:20 +01:00
|
|
|
GdkModifierType gimp_get_primary_accelerator_mask(void);
|
2011-10-06 10:20:23 +02:00
|
|
|
GdkModifierType gimp_get_extend_selection_mask (void);
|
|
|
|
GdkModifierType gimp_get_modify_selection_mask (void);
|
|
|
|
GdkModifierType gimp_get_toggle_behavior_mask (void);
|
2011-10-06 16:42:42 +02:00
|
|
|
GdkModifierType gimp_get_constrain_behavior_mask (void);
|
2011-10-10 00:17:20 +02:00
|
|
|
GdkModifierType gimp_get_all_modifiers_mask (void);
|
2011-10-05 19:15:17 +02:00
|
|
|
|
2018-04-29 17:27:47 +02:00
|
|
|
void gimp_get_monitor_resolution (GdkMonitor *monitor,
|
2009-10-11 16:58:59 +02:00
|
|
|
gdouble *xres,
|
|
|
|
gdouble *yres);
|
2011-02-07 22:16:05 +01:00
|
|
|
gboolean gimp_get_style_color (GtkWidget *widget,
|
|
|
|
const gchar *property_name,
|
|
|
|
GdkRGBA *color);
|
2009-10-11 16:58:59 +02:00
|
|
|
void gimp_window_set_hint (GtkWindow *window,
|
|
|
|
GimpWindowHint hint);
|
|
|
|
void gimp_window_set_transient_for (GtkWindow *window,
|
app, libgimp*, pdb, plug-ins: reimplement generic inter-process transient window.
Having windows ID as guint32 is a mistake. Different systems have
different protocols. In Wayland in particular, Windows handles are
exchanged as strings. What this commit does is the following:
In core:
- get_window_id() virtual function in core GimpProgress is changed to
return a GBytes, as a generic "data" to represent a window differently
on different systems.
- All implementations of get_window_id() in various classes implementing
this interface are updated accordingly:
* GimpSubProgress
* GimpDisplay returns the handle of its shell.
* GimpDisplayShell now creates its window handle at construction with
libgimpwidget's gimp_widget_set_native_handle() and simply return
this handle every time it's requested.
* GimpFileDialog also creates its window handle at construction with
gimp_widget_set_native_handle().
- gimp_window_set_transient_for() in core is changed to take a
GimpProgress as argument (instead of a guint32 ID), requests and
process the ID itself, according to the running platform. In
particular, the following were improved:
* Unlike old code, it will work even if the window is not visible yet.
In such a case, the function simply adds a signal handler to set
transient at mapping. It makes it easier to use it at construction
in a reliable way.
* It now works for Wayland too, additionally to X11.
- GimpPdbProgress now exchanges a GBytes too with the command
GIMP_PROGRESS_COMMAND_GET_WINDOW.
- display_get_window_id() in gimp-gui.h also returns a GBytes now.
PDB/libgimp:
- gimp_display_get_window_handle() and gimp_progress_get_window_handle()
now return a GBytes to represent a window handle in an opaque way
(depending on the running platform).
In libgimp:
- GimpProgress's get_window() virtual function changed to return a
GBytes and renamed get_window_handle().
- In particular GimpProgressBar is the only implementation of
get_window_handle(). It creates its handle at object construction with
libgimpwidget's gimp_widget_set_native_handle() and the virtual
method's implementation simply returns the GBytes.
In libgimpUi:
- gimp_ui_get_display_window() and gimp_ui_get_progress_window() were
removed. We should not assume anymore that it is possible to create a
GdkWindow to be used. For instance this is not possible with Wayland
which has its own way to set a window transient with a string handle.
- gimp_window_set_transient_for_display() and
gimp_window_set_transient() now use an internal implementation similar
to core gimp_window_set_transient_for(), with the same improvements
(works even at construction when the window is not visible yet + works
for Wayland too).
In libgimpwidgets:
- New gimp_widget_set_native_handle() is a helper function used both in
core and libgimp* libraries for widgets which we want to be usable as
possible parents. It takes care of getting the relevant window handle
(depending on the running platform) and stores it in a given pointer,
either immediately or after a callback once the widget is mapped. So
it can be used at construction. Also it sets a handle for X11 or
Wayland.
In plug-ins:
- Screenshot uses the new gimp_progress_get_window_handle() directly now
in its X11 code path and creates out of it a GdkWindows itself with
gdk_x11_window_foreign_new_for_display().
Our inter-process transient implementation only worked for X11, and with
this commit, it works for Wayland too.
There is code for Windows but it is currently disabled as it apparently
hangs (there is a comment in-code which links to this old report:
https://bugzilla.gnome.org/show_bug.cgi?id=359538). NikcDC tested
yesterday with re-enabling the code and said they experienced a freeze.
;-(
Finally there is no infrastructure yet to make this work on macOS and
apparently there is no implementation of window handle in GDK for macOS
that I could find. I'm not sure if macOS doesn't have this concept of
setting transient on another processus's window or GDK is simply lacking
the implementation.
2023-08-14 14:23:06 +02:00
|
|
|
GimpProgress *progress);
|
app, libgimp, pdb: add a parent_window parameter to gimp_*_popup() PDB calls.
Brush, font, gradient, palette and pattern choices are currently chosen through
a dialog created by the core, which then returns the user choice to the calling
plug-in. This has the unfortunate consequence of having a pile of likely at
least 3 windows (main GIMP window by core process, plug-in window by plug-in
process, then the choice popup by the core process) shared in 2 processes, which
often end up under each other and that's messy. Even more as the choice popup is
kinda expected to be like a sub-part of the plug-in dialog.
So anyway, now the plug-in can send its window handle to the core so that the
resource choice dialog ends up always above the plug-in dialog.
Of course, it will always work only on platforms where we have working
inter-process transient support.
2023-08-15 00:12:16 +02:00
|
|
|
void gimp_window_set_transient_for_handle (GtkWindow *window,
|
|
|
|
GBytes *handle);
|
2009-10-11 16:58:59 +02:00
|
|
|
void gimp_widget_set_accel_help (GtkWidget *widget,
|
2019-07-02 03:54:38 +02:00
|
|
|
GimpAction *action);
|
2016-10-29 16:50:13 +02:00
|
|
|
|
2014-05-07 15:30:38 +02:00
|
|
|
const gchar * gimp_get_message_icon_name (GimpMessageSeverity severity);
|
2016-10-29 16:50:13 +02:00
|
|
|
gboolean gimp_get_color_tag_color (GimpColorTag color_tag,
|
2024-04-02 04:00:50 +00:00
|
|
|
GeglColor *color,
|
2017-12-07 16:42:54 -05:00
|
|
|
gboolean inherited);
|
2016-10-29 16:50:13 +02:00
|
|
|
|
2009-10-11 16:58:59 +02:00
|
|
|
void gimp_pango_layout_set_scale (PangoLayout *layout,
|
|
|
|
double scale);
|
|
|
|
void gimp_pango_layout_set_weight (PangoLayout *layout,
|
|
|
|
PangoWeight weight);
|
2021-02-09 11:50:23 +01:00
|
|
|
|
2009-11-28 19:12:39 +01:00
|
|
|
void gimp_highlight_widget (GtkWidget *widget,
|
2021-02-09 11:50:23 +01:00
|
|
|
gboolean highlight,
|
|
|
|
GdkRectangle *rect);
|
|
|
|
void gimp_widget_blink_rect (GtkWidget *widget,
|
|
|
|
GdkRectangle *rect);
|
2017-10-28 08:42:54 -04:00
|
|
|
void gimp_widget_blink (GtkWidget *widget);
|
|
|
|
void gimp_widget_blink_cancel (GtkWidget *widget);
|
2022-03-06 13:34:12 +01:00
|
|
|
|
|
|
|
void gimp_blink_toolbox (Gimp *gimp,
|
|
|
|
const gchar *action_name,
|
|
|
|
GList **blink_script);
|
2022-03-05 14:32:34 +01:00
|
|
|
void gimp_blink_dockable (Gimp *gimp,
|
|
|
|
const gchar *dockable_identifier,
|
2022-03-05 17:29:44 +01:00
|
|
|
const gchar *widget_identifier,
|
2022-03-06 14:31:27 +01:00
|
|
|
const gchar *settings_value,
|
2022-03-05 17:29:44 +01:00
|
|
|
GList **blink_script);
|
|
|
|
|
|
|
|
void gimp_widget_script_blink (GtkWidget *widget,
|
2022-03-06 14:31:27 +01:00
|
|
|
const gchar *widget_identifier,
|
2022-03-05 17:29:44 +01:00
|
|
|
GList **blink_script);
|
|
|
|
void gimp_blink_play_script (GList *blink_script);
|
2022-03-05 14:32:34 +01:00
|
|
|
|
2021-02-09 11:50:23 +01:00
|
|
|
|
2010-02-20 16:55:35 +01:00
|
|
|
GtkWidget * gimp_dock_with_window_new (GimpDialogFactory *factory,
|
2018-04-29 17:27:47 +02:00
|
|
|
GdkMonitor *monitor,
|
2010-10-31 13:05:15 +01:00
|
|
|
gboolean toolbox);
|
2015-10-27 21:41:32 +01:00
|
|
|
GtkWidget * gimp_tools_get_tool_options_gui (GimpToolOptions *tool_options);
|
2010-10-31 13:05:15 +01:00
|
|
|
void gimp_tools_set_tool_options_gui (GimpToolOptions *tool_options,
|
|
|
|
GtkWidget *widget);
|
2018-09-27 02:31:39 -04:00
|
|
|
void gimp_tools_set_tool_options_gui_func
|
|
|
|
(GimpToolOptions *tool_options,
|
|
|
|
GimpToolOptionsGUIFunc func);
|
2008-03-19 09:29:30 +00:00
|
|
|
|
2015-10-27 21:41:32 +01:00
|
|
|
gboolean gimp_widget_get_fully_opaque (GtkWidget *widget);
|
|
|
|
void gimp_widget_set_fully_opaque (GtkWidget *widget,
|
|
|
|
gboolean fully_opaque);
|
|
|
|
|
2018-08-20 14:14:26 -04:00
|
|
|
void gimp_gtk_container_clear (GtkContainer *container);
|
|
|
|
|
2018-05-17 12:52:13 +02:00
|
|
|
void gimp_button_set_suggested (GtkWidget *button,
|
|
|
|
gboolean suggested,
|
|
|
|
GtkReliefStyle default_relief);
|
|
|
|
void gimp_button_set_destructive (GtkWidget *button,
|
2019-10-10 19:39:09 +00:00
|
|
|
gboolean destructive,
|
2018-05-17 12:52:13 +02:00
|
|
|
GtkReliefStyle default_relief);
|
|
|
|
|
2020-06-01 23:21:21 +03:00
|
|
|
void gimp_gtk_adjustment_chain (GtkAdjustment *adjustment1,
|
|
|
|
GtkAdjustment *adjustment2);
|
|
|
|
|
2011-02-24 12:34:57 +01:00
|
|
|
const gchar * gimp_print_event (const GdkEvent *event);
|
2014-05-02 03:01:23 +02:00
|
|
|
|
2016-05-22 01:19:18 +02:00
|
|
|
gboolean gimp_color_profile_store_add_defaults
|
|
|
|
(GimpColorProfileStore *store,
|
|
|
|
GimpColorConfig *config,
|
|
|
|
GimpImageBaseType base_type,
|
|
|
|
GimpPrecision precision,
|
|
|
|
GError **error);
|
|
|
|
|
2018-01-02 23:09:00 +01:00
|
|
|
void gimp_color_profile_chooser_dialog_connect_path
|
|
|
|
(GtkWidget *dialog,
|
|
|
|
GObject *config,
|
|
|
|
const gchar *property_name);
|
|
|
|
|
2019-02-19 15:31:50 +01:00
|
|
|
void gimp_widget_flush_expose (void);
|
|
|
|
|
2023-02-05 19:29:41 +01:00
|
|
|
void gimp_make_valid_action_name (gchar *action_name);
|
|
|
|
|
2023-03-30 14:53:01 +02:00
|
|
|
gchar * gimp_utils_make_canonical_menu_label (const gchar *path);
|
2023-07-13 15:29:55 +02:00
|
|
|
gchar ** gimp_utils_break_menu_path (const gchar *path,
|
2023-07-14 16:13:39 +02:00
|
|
|
gchar **mnemonic_path1,
|
2023-07-13 15:29:55 +02:00
|
|
|
gchar **section_name);
|
2023-03-30 14:53:01 +02:00
|
|
|
gboolean gimp_utils_are_menu_path_identical (const gchar *path1,
|
2023-07-13 15:29:55 +02:00
|
|
|
const gchar *path2,
|
2023-07-14 16:13:39 +02:00
|
|
|
gchar **canonical_path1,
|
|
|
|
gchar **mnemonic_path1,
|
2023-07-13 15:29:55 +02:00
|
|
|
gchar **path1_section_name);
|
2024-04-11 14:59:15 +00:00
|
|
|
#ifdef G_OS_WIN32
|
2023-10-16 16:43:17 +00:00
|
|
|
void gimp_window_set_title_bar_theme (Gimp *gimp,
|
2024-04-11 14:59:15 +00:00
|
|
|
GtkWidget *dialog);
|
|
|
|
#endif
|
2014-05-02 03:01:23 +02:00
|
|
|
|
2015-05-06 22:15:30 +02:00
|
|
|
#endif /* __APP_GIMP_WIDGETS_UTILS_H__ */
|