Commit Graph

107 Commits

Author SHA1 Message Date
Michael Natterer f102ceb63f app: add gimp_button_set_suggested,destructive() to gimpwidgets-utils
which set/unset the "suggested-action" and "destructive-action" style
classes and make sure the button relief is right.
2018-05-20 21:06:35 +02:00
Michael Natterer 0c05ec63f6 app: add utility functions gimp_widget_get,set_image()
as replacement for the deprecated GtkImageMenuItem, for the few cases
where we really want an icon/image in a menu item.
2018-05-20 21:06:30 +02:00
Michael Natterer b28228d911 app: add gimp_ui_manager_ui_popup_at_widget()
and use it where we used to pass gimp_button_menu_position() to
gimp_ui_manager_up_popup(), remove gimp_button_menu_position() because
it's now unused.
2018-05-20 21:06:30 +02:00
Michael Natterer 241af754b9 app: get rid of some GtkTables in tools/ 2018-05-20 21:06:30 +02:00
Michael Natterer 5ece7a8d1f Port a lot of stuff from GdkScreen/monitor_number to GdkMonitor
including some fixes for getting pointer coords, and needed
API changes in libgimpwidgets.
2018-05-20 21:06:30 +02:00
Michael Natterer 0c00a72b17 app: remove gimp_rgb_get,set_gdk_color()
and inline the few lines into their only users.
2018-05-20 21:06:29 +02:00
Michael Natterer 88a96cf3fb app: add gimp_get_style_color() to simplify GdkRGBA style property lookup 2018-05-20 21:06:28 +02:00
Michael Natterer 135f58d3ae Bug 790002 - Remember last-used "Select color profile from disk" location
Add "color-profile-path" to GimpDialogConfig to remember the last-used
path in any profile chooser dialog.

Whenever a GimpColorProfileChooserDialog is created, call a new
gimpwidgets-utils helper function that connects to the dialog's "show"
and "response" signals and makes sure "color-profile-path" is set on
the dialog if it doesn't have a current folder already, and sets the
property back to the config object when a profile was actually chosen
from disk.
2018-01-02 23:09:00 +01:00
Ell 0beef7d97d app: in GimpItemTreeView, use color tag of parent for children with no tag
Add gimp_item_get_merged_color_tag(), which returns the color tag
of the nearest ancestor (including the current item) that has a
color tag other than NONE.  Use this function in GimpItemTreeView,
instead of gimp_item_get_color_tag(), to set the cell color of
items, so that item's with a NONE color tag inherit the color of
their parent.  Add a boolean "inherited" parameter to
gimp_get_color_tag_color(), which indicates if the color tag is the
item's actual color tag, or an inherited color tag, and modify the
returned color accordingly, so that inherited colors are less
saturated/lighter than non-inherited ones.
2017-12-07 17:02:05 -05:00
Ell e029795dfb app: add gimp_widget_blink(); use instead of gimp_dockable_blink()
gimp_dockable_blink() is used to attract the user's attention to a
specific dockable.  Generalize this to arbitrary widgets, by
replacing gimp_dockable_blink[_cancel]() with
gimp_widget_blink[_cancel](), in gimpwidgets-utils.c.
2017-10-28 10:07:10 -04:00
Michael Natterer 31fcd79dd9 Bug 769738 - Add color tags/labels for layers/channels/paths
Add property "color-tag" of type enum GimpColorTag to GimpItem so all
layers, channels and paths can be tagged with a color.

For interoperability, use the color list from Krita which is a
superset of Photoshop's colors.

Features a "Color Tag" submenu in the layers, channels and paths
menus, a row of color radio buttons in the properties dialogs,
undo and PDB API.

As a side effect, some common code is now factores out into
items-actions.[ch] and items-commands.[ch] which adds visible, linked
and lock actions for layers and channels.
2016-10-29 17:02:16 +02:00
Michael Natterer 57d497b486 app: add gimp_color_profile_store_add_defaults()
which adds default profiles for an image type/precision.
2016-05-22 01:19:18 +02:00
Michael Natterer 6b246ff6c2 app: remove ancient utility function gimp_toggle_button_set_visible()
and use g_object_bind_property() instead.
2016-05-21 14:28:11 +02:00
Michael Natterer 9f3052583b app: remove gimp_session_write_position()
and un-overengineer the session position accuracy code a bit.
2016-05-21 00:00:07 +02:00
Michael Natterer ace40d125d Bug 735891 - color areas in the color picker info window are half transparent
Add code to GimpOverlayChild which can render arbitrary children of
the widget fully opaque, ignoring the configured opacity.

Add gimp_widget_get,set_fully_opaque() which gets/sets a per-widget
boolean flag to trigger that code.

Set the color picker's and the text tool style widget's color areas to
fully opaque.
2015-10-27 21:41:32 +01:00
Michael Natterer 7ec04e4afe app: get rid of hardcoding GDK_SHIFT_MASK in tools/
gimp_suggest_modifiers(): change "shift_format" and "control_format"
parameters to "extend_selection_format" and "toggle_behavior_format",
which fixes the longstanding problem that the function did the right
thing only by accident.

tools: use gimp_get_extend_selection_mask() instead of GDK_SHIFT_MASK
which is not 100% semantically correct in all cases, but at least a
step in the right direction to make the tool modifiers easier to
improve.
2015-10-17 15:31:08 +02:00
Michael Natterer 6b0b774302 libgimpwidgets: add gimpwidgetsutils.[ch]
Move some functions from libgimpwidgets/gimpwidgets.[ch]
and from app/widgets/gimpwidgets-utils.[ch]. Newly add
gimp_widget_get_color_profile() which is extracted from
modules/display-filter-lcms.c.
2015-05-06 22:15:30 +02:00
Michael Natterer 7d0b326359 app: add gimp_widget_load_icon() as replacement for gtk_widget_render_icon()
...and use it instead.
2014-05-08 09:11:31 +02:00
Michael Natterer 0d2d1c3752 app: port most of app's GUI from stock IDs to icon names
There is still quite some stock ID rendering around, stay tuned...
2014-05-07 15:30:38 +02:00
Michael Natterer 7cdede6dec app: rename gimp_get_screen_resolution() to get_monitor_resolution()
Add a "monitor" parameter and return something reasonable, instead
of a useless resolution average of all the screen's monitors. Also
require a screen to be passed now.
2014-05-02 23:58:14 +02:00
Michael Natterer 051374a1b6 app: add gimp_get_monitor_at_pointer()
and use it instead of duplicating that code several times.
2014-05-02 13:23:25 +02:00
Michael Natterer 843866e7e7 app: make things behave more reasonable with multiple monitors
There is now a preference option that determines whether windows
should be opened on the same monitor as before. It should be disabled
when the machine gets monitors plugged/unplugged dynamically ("laptop")
and enabled when there is a static multi-monitor setup ("wokstation").
This is merely the current simplistic policy on top of the newly added
underlying infrastructure:

- pass integer monitor numbers around in all places where we already
  pass around a GdkScreen. Pass the "current" monitor to these changed
  APIs, where "current" is either the monitor where the action-triggering
  widget is, or if that is unavailable the monitor where the mouse is.

- add gimp_widget_get_monitor() in order to easily get to the monitor,
  just like gtk_widget_get_screen().

- add screen and monitor parameters in some places that were missed
  before.

- in sessionrc, save all window positions relative to the window's
  monitor, and save the monitor separately, if it's not the screen's
  primary monitor.

- when restoring window positions, use the stored monitor when the new
  prefs options says so (use the screen's primary monitor if there is
  no stored monitor), otherwise use current monitor that is now passed
  around.
2014-05-02 03:01:23 +02:00
Michael Natterer 65066ff46b app: add gimp_get_primary_accelerator_mask() to gimpwidgets-utils 2013-11-08 10:00:20 +01:00
Michael Natterer fffd1920e2 app: don't hardcode MOD2 in GimpContainerTreeView either
Add new utility function gimp_get_all_modifiers_mask() which returns
all modifiers used for "useful" things on the current platform, like
in the commit below.
2011-10-10 00:17:20 +02:00
Michael Natterer efd9906e85 app: remove gimp_get_mod_separator(), it's unused now 2011-10-07 00:34:43 +02:00
Michael Natterer f4141d6942 app: add a utility function that returns the "constrain" modifier 2011-10-06 16:42:42 +02:00
Michael Natterer c0610697cb app: remove widget parameter from gimp_modifiers_to_channel_op()
and simply use the default keymap.
2011-10-06 16:33:05 +02:00
Michael Natterer 10a9c660f8 app: add utility functions which return modifier masks
Simply get the masks from the default display's keymap, since
the widget makes absolutely no difference here.
2011-10-06 16:33:05 +02:00
Michael Natterer fdf103ce08 app: add more modifier utility functions to gimpwidgets-utils.[ch]
- gimp_modifiers_to_channel_op() translates a modifier state to REPLACE,
  ADD, SUBTRACT or INTERSECT.

- gimp_replace_virtual_modifiers() uses gdk_keymap_add_virtual_modifiers()
  to replace the physical bits in a modifier state to their virtual
  counterparts (and not just adds the virtual ones like the GDK
  function).
2011-10-05 19:26:53 +02:00
Michael Natterer 3982ddc39b app: implement gimp_get_mod_string() using gtk_accelerator_get_label()
so it can handle all modifiers (also Mac ones).
Remove gimp_get_mod_name_shift,control,alt().
2011-10-05 01:30:59 +02:00
Martin Nordholts bed298be13 app: Remember column width in multi-column dock windows 2011-05-31 23:15:39 +02:00
Michael Natterer c11b0d2a79 app: move tool event debug output to a utility function
to reduce clutter in gimp_display_shell_canvas_tool_events().
2011-02-24 12:34:57 +01:00
Michael Natterer f4af9b549e Globally switch to saying "window_id" instead of just "window"
when dealing with native window handles. Also get rid of using
GdkNativeWindow and simply consistently use guint32 all over the
place. This is more obvious and consistent and keeps the diff to the
gtk3-port branch smaller.
2011-02-06 12:07:55 +01:00
Michael Natterer cacf8b550f app: add gimp_widget_flush_expose() utility function
which flushes all pending exposes for a widget without running the
main loop. Useful for updating progress bars without returning to the
main loop.
2010-11-09 19:33:15 +01:00
Martin Nordholts 48690d60e1 app: Add gimp_tools_get/set_tool_options_gui()
Add gimp_tools_get_tool_options_gui() and
gimp_tools_set_tool_options_gui() widgets utility functions.
2010-10-31 13:05:15 +01:00
Martin Nordholts 501f97b54b Add gimp_preview_tab_style_to_icon() utility function
Also fix wrong conversion from PREVIEW_NAME to ICON_BLURB
2010-06-12 00:15:13 +02:00
Michael Natterer 0b4bdc5613 app: add GimpTextBuffer, a GtkTextBuffer subclass
Pull all text buffer utility functions as methods and use
GimpTextBuffer all over the place instead of GtkTextBuffer.
Some actually usefuly features coming soon...
2010-02-25 17:41:10 +01:00
Martin Nordholts 1e9048ded9 app: Turn gimp_dialog_factory_dock_with_window_new() into util func
Turn gimp_dialog_factory_dock_with_window_new() into a utility
function, it doesn't make sense to let it be part of the generic
GimpDialogFactory.
2010-02-20 16:55:59 +01:00
Martin Nordholts e4e7bf8471 app: Add and use gimp_highlight_widget()
Add gimp_highlight_widget() so we can simplify
gimp_dockbook_tab_drag_motion() a bit.
2009-11-28 19:12:39 +01:00
Martin Nordholts eb9b365864 app: Add GimpPanedBox
Add a new class GimpPanedBox that wraps the arrangement of widgets
into GtkPaned hierarchies. It takes over the separator management from
GimpDock and the GtkPaned management from
gimpwidgets-utils.[ch]. GimpPanedBox can be both vertically and
horizontally oriented.

Change GimpDock to use this widget and make some other minor
adaptations.
2009-10-24 18:53:46 +02:00
Martin Nordholts 21c037fdd6 app: Generalize gimp_dock_add/remove_book()
Move the GtkPaned management code into gimp_widgets_add_paned_widget()
and gimp_widgets_remove_paned_widget() in gimpwidgets-utils.[ch] so we
can share this code for GimpDockColumns later.
2009-10-11 16:58:59 +02:00
Michael Natterer d9b5207aa2 Change licence to GPLv3 (and to LGPLv3 for libgimp).
2009-01-17  Michael Natterer  <mitch@gimp.org>

	* all files with a GPL header and all COPYING files:

	Change licence to GPLv3 (and to LGPLv3 for libgimp).

	Cleaned up some copyright headers and regenerated the parsers in
	the ImageMap plugin.


svn path=/trunk/; revision=27913
2009-01-17 22:28:01 +00:00
Michael Natterer 88db29948b added "gboolean below" to gimp_enum_radio_frame_add() and
2008-10-28  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpwidgets-utils.[ch]: added "gboolean below" to
	gimp_enum_radio_frame_add() and gimp_enum_radio_box_add() and
	place the widget right of the radio button unless "below" is TRUE.

	* app/dialogs/convert-dialog.c
	* app/dialogs/layer-add-mask-dialog.c
	* app/tools/gimpbucketfilloptions.c
	* app/tools/gimpclonetool.c
	* app/tools/gimpperspectiveclonetool.c
	* app/widgets/gimpfilleditor.c: pass TRUE so everything stays as-is.


svn path=/trunk/; revision=27450
2008-10-28 17:40:32 +00:00
Michael Natterer 90c26cf10e add non-serializable properties pattern-view-type and pattern-view-size
2008-10-25  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpfilloptions.[ch]: add non-serializable properties
	pattern-view-type and pattern-view-size which are used only by the
	new UI below.

	* app/widgets/gimpfilleditor.[ch]: added boolean edit-context
	property. If TRUE, add widgets to edit the context's foreground and
	pattern. Add "edit_context" parameter to gimp_fill_editor_new().

	* app/widgets/gimpstrokeeditor.[ch]: add the same parameter here.

	* app/widgets/gimpwidgets-utils.[ch]: add gimp_enum_radio_box_add()
	which does the same as the existing gimp_enum_radio_frame_add().

	* app/dialogs/stroke-dialog.c: pass FALSE for "edit_context"
	because this dialog takes its foreground and pattern from the user
	context and doesn't need it's own GUI for them.


svn path=/trunk/; revision=27392
2008-10-24 22:34:24 +00:00
Sven Neumann ca0b070852 added gimp_pango_layout_set_scale().
2008-09-30  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpwidgets-utils.[ch]: added
	gimp_pango_layout_set_scale().

	* app/gui/splash.c: set a smaller font size on the lower label.


svn path=/trunk/; revision=27088
2008-09-30 11:16:28 +00:00
Sven Neumann a355f1777b app/widgets/gimpdockable.c moved utility function for setting attributes
2008-03-19  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpdockable.c
	* app/widgets/gimpwidgets-utils.[ch]: moved utility function for
	setting attributes on a PangoLayout out of gimpdockable.c.

	* app/display/gimpcanvas.c (gimp_canvas_draw_drop_zone): use a
	bold font and paint the layout with transparency.

svn path=/trunk/; revision=25116
2008-03-19 09:29:30 +00:00
Michael Natterer 6435c669b8 removed gimp_get_accel_string() and use gtk_accelerator_get_label()
2007-10-01  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpwidgets-utils.[ch]: removed
	gimp_get_accel_string() and use gtk_accelerator_get_label()
	instead.

	* app/widgets/gimpactionview.c: ditto.


svn path=/trunk/; revision=23704
2007-10-01 13:10:40 +00:00
Sven Neumann 41237259c9 In all files, changed the standard copyright notice to say "GIMP - The GNU
2006-12-09  Sven Neumann  <sven@gimp.org>

        * In all files, changed the standard copyright notice to say
        "GIMP - The GNU Image Manipulation Program".
2006-12-09 21:33:38 +00:00
Sven Neumann da2253fce0 don't use gimp_dialog_set_sensitive(); just make the entry not editable
2006-11-14  Sven Neumann  <sven@gimp.org>

	* app/dialogs/file-open-location-dialog.c: don't use
	gimp_dialog_set_sensitive(); just make the entry not editable and
	the dialog's OK button insensitive.

	* app/widgets/gimpfiledialog.c
	* app/widgets/gimpwidgets-utils.[ch]: moved gimp_dialog_set_sensitive()
	implementation into gimp_file_dialog_set_sensitive().
2006-11-14 13:46:43 +00:00
Michael Natterer f5afb754a5 Added message severities and make sure all messages are routed through a
2006-10-09  Michael Natterer  <mitch@gimp.org>

	Added message severities and make sure all messages are routed
	through a central function, so redirecting to the error console or
	stderr work again:

	* app/core/core-enums.[ch]: added enum GimpMessageSeverity { INFO,
	WARNING, ERROR }.

	* app/core/gimp.[ch] (gimp_message)
	(gimp_message_valist): added severity parameter. Changed
	"GimpProgress *progress" parameter to "GObject *handler", where
	"handler" can be either a GimpProgress, a GtkWidget or NULL.

	* app/core/gimp-gui.[ch] (gimp_show_message): ditto. Honor
	--console-messages again. Always dispatch to the GUI message
	handler first if it exists.

	* app/gui/gui-message.[ch]: pass severity parameters around.

	(gui_message_error_dialog): if "handler" is a progress, dispatch
	the message to it first. If it is a widget (and *not* a progress),
	use a GtkMessageDialog on top of that widget's toplevel. Fall
	back to the usual GimpErrorDialog otherwise.

	* app/core/gimpprogress.[ch] (gimp_progress_message): added
	severity parameter. Also added boolean return value to the virtual
	function so it can decide to fail if it can't handle the message.

	* app/display/gimpdisplay.c: implement GimpProgress::message() and
	redirect the message to GimpDisplayShell.

	* app/display/gimpdisplayshell-progress.c: implement
	GimpProgress::message() and redirect the message to GimpStatusbar
	if it is not an error and if the status bar is visible.

	* app/display/gimpstatusbar.[ch]: implement GimpProgress::message(),
	but fail on messages that contain a newline. Show the right icons
	for the message severities (work in progress).

	* app/display/gimpdisplayshell.[ch]: removed
	gimp_display_shell_message() and its _valist() variant.

	* app/widgets/gimperrorconsole.[ch]: show the right icons for the
	message severities.

	* app/widgets/gimpthumbbox.c (gimp_thumb_box_progress_message):
	return TRUE to swallow all messages.

	* app/widgets/gimpwidgets-utils.[ch]: removed
	gimp_show_message_dialog(). Added gimp_get_message_stock_id().

	* app/errors.c
	* app/actions/edit-commands.c
	* app/actions/error-console-commands.c
	* app/actions/file-commands.c
	* app/actions/select-commands.c
	* app/actions/text-editor-commands.c
	* app/actions/vectors-commands.c
	* app/core/gimpimage-convert.c
	* app/core/gimpimagefile.c
	* app/dialogs/convert-dialog.c
	* app/dialogs/file-open-dialog.c
	* app/dialogs/file-open-location-dialog.c
	* app/dialogs/file-save-dialog.c
	* app/dialogs/palette-import-dialog.c
	* app/dialogs/stroke-dialog.c
	* app/display/gimpdisplayshell-dnd.c
	* app/pdb/gimppdb.c
	* app/plug-in/gimpplugin.c
	* app/tools/gimpimagemaptool.c
	* app/tools/gimptool.c
	* app/tools/gimpvectortool.c
	* app/widgets/gimpactionview.c
	* app/widgets/gimpcontrollerlist.c
	* app/widgets/gimppdbdialog.c
	* app/widgets/gimpvectorstreeview.c
	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c
	* app/xcf/xcf.c
	* tools/pdbgen/pdb/brush.pdb
	* tools/pdbgen/pdb/gradient.pdb
	* tools/pdbgen/pdb/image.pdb
	* tools/pdbgen/pdb/message.pdb
	* tools/pdbgen/pdb/palette.pdb: added severity parameter to
	gimp_message() calls. Convert all calls to
	gimp_show_message_dialog() and gimp_display_shell_message() to
	gimp_message(). Also converted some more g_message() calls.

	* app/pdb/brush_cmds.c
	* app/pdb/gradient_cmds.c
	* app/pdb/image_cmds.c
	* app/pdb/message_cmds.c
	* app/pdb/palette_cmds.c: regenerated.
2006-10-09 08:17:22 +00:00