Commit Graph

47 Commits

Author SHA1 Message Date
Lukas Oberhuber 042eddfb0a canvas: remove limits on ruler & statusbar updates
This removes rate limiting of ruler and statusbar updates which were
required to get acceptable performance on mac for drawing on the canvas.

This requires the latest changes on in Gtk 3.24 to be incorporated.
2022-07-05 13:02:30 +00:00
Jehan fc5e6e6c26 app: handle non-pixel cases to compute a reasonable max size for…
… cursor position label.

This should now resolve any weird jumping around of the cursor label,
hence the GUI. Of course, it could actually still happen when going
really off-canvas (though the max computation takes into account
reasonable off-canvas moving, which is totally possible, especially now
that we can view off-canvas so people can just work there and the GUI
should definitely not do weird stuff there as well).
2022-03-10 22:37:03 +00:00
Lukas Oberhuber 1baeffc913 macos: Fix 7690 (slow drawing)
Gets drawing in the canvas speed on retina displays up to the speed
of FullHD displays on macOS, making 2.99 usable on macOS.

Generic change:

Changes the cursor_label to delay the drawing phase to the idle
queue, from immediate draw on all platforms.

Before the fix in 32049afd (using a deprecated function in Gtk3)
any draws on this label forced a full canvas redraw. This is due
to a quirk in how GtkLabel functions.

The redraw occurred because GtkLabels resize themselves and everything
around them by sending a resize  message any time they receive new
text. These resizes then trigger the full canvas resize which triggers
a full canvas redraw that cannot be optimized by either Gtk or Big Sur.

MacOS changes:

Only redraws the cursor position label and each of the horizontal and
vertical rules (cursor tracking widgets) 3 times a second max for a
total of 9 redraws a second (ideally out of 60, though I don't believe
under any circumstances that GIMP achieves a 60fps).

Each of the cursor tracking widgets gets its own timeslice, and so
will not redraw when the other cursor tracking widgets are drawing.

This is required because Big Sur is merging all draw rects into
one large rect, dramatically slowing down draws.

This timeslicing ensures that draw rects are maintained at the smallest
possible size. So the typical redraw is a small rect around the
brush. However, 9 times a second, the rect will include one of the
3 cursor tracking widgets (rulers and cursor label).

Additionally, the code tries to minimize resizing the width of the
cursor label by checking if the widget is too small for the text,
then setting the char_width to a greater size so that resizes won't
be that common.

This improves the appearance of the widget as it no longer
constantly jumps about in size on each cursor move.

Here is a discussion of the issue:
https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/572#note_1389445

Reviewer's (Jehan) notes:

* The whole issue about GtkLabel resizing is no more after 32049afd. It 
  is normal for a widget to request a resize when needed. We just don't
  want the statusbar to resize and triggering canvas redraws.
* Changing cursor position text into an idle function generally makes
  sense.
  Also it reverts commit 6de9ea7022 which had a bug I hadn't realized
  when I accepted it: when we test for time, we don't know yet if it
  will be the last position change, hence we could "refuse" the last
  update. Therefore displayed cursor position would end up outdated
  on macOS. This new implementation doesn't have the problem (the last
  idle update always happens after the last move).
* The change about giving 1/3 timeslices to side canvas components 
  (rulers and statusbar) is a complete hack to work around the fact that
  macOs doesn't report properly each damaged rectangle. Instead it
  returns a huge bounding box. The workaround here is to expose these
  area separately.
  We have not been able to find a proper solution yet. This is the only
  reason why I accept this code, for macOS only, to at least have
  something usable there.
  See discussions in MRs gimp!572 and gimp-macos-build!86. With these 2 
  MRs, Lukas reported GIMP 2.99 to perform even better than GIMP 2.10 on
  Monterey, though it could not be tested on Big Sur unfortunately.
* Lastly the set_width_chars() thing is also an ugly hack which I will
  try later to revisit (see !581). I only accepted it (with mandatory 
  macOS-only macro) to have an acceptable state for release after seeing
  a screencast where the label size indeed "jumps around" on macOS.
2022-02-19 01:25:51 +00:00
Lukas Oberhuber 6de9ea7022 macos: reduce frequency of coordinates refresh
This change reduces to 3.33 times a second, the updates to the
status bar coordinates widget.
This dramatically improves frame rate on macOS retina displays
because it reduces the frequency of full screen updates which
are triggered by this widget updating and are very slow.

This makes the statusbar refresh changes mac only where the
benefit will be felt keenly, rather than saddling all
platforms with the change.
2022-02-07 13:44:46 +00:00
Ell 887d6a3670 app, themes: fix display-shell statusbar height
In gimp.css, don't set a minimum height for GimpDisplayShell
statusbars.  Instead, in GimpStatusbar, set the widget's minimum
height to the maximum of its children's natural heights.  Note that
we have to do this manually, instead of using a size group, since
GtkSizeGroup::ignore-hidden is deprecated (and nonfunctional) in
GTK3.
2020-06-18 13:12:29 +03:00
Michael Natterer 291e84281a app: fix canvas jumping because of the status bar label being too wide
Set the label to ELLIPSIZE_END and add some packing options, and
switch from using pango attributes to simply prepending the right
number of spaces to leave enough room for the icon. The attributes
were somehow breaking ellipsation.
2019-01-02 17:49:53 +01:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Michael Natterer 1806b66c5a Issue #1560 - invisible canvas flip/rotation buttons...
...at the bottom of image window

Need to show/hide the event box, not just the labels/icons inside.
2018-06-04 15:13:23 +02:00
Michael Natterer e76c1305a5 app: derive GimpStatusbar from GtkFrame not GtkStatusbar
we were not using a single GtkStatusBar features, it was only in the
way. Remove broken size allocation logic and simply set a minimum
height of 3em in CSS. Also ellipsize the label, long labels had funny
effects since changing the overall GimpDisplayShell packing to pure
GtkGrid.
2018-05-20 21:06:35 +02:00
Ell bea27171ad app: throttle statusbar progress updates
Statusbar progress updates that update the progress bar are
relatively expensive, slowing down operations that report progress
frequently.  Only update the progress bar if a certain amount of
time has passed since the last update, to counter that.
2018-04-07 12:05:59 -04:00
Jehan 80b04d06da Bug 789173 - Make canvas rotation information visible on the main window
Now add also flip information in the status bar so that one knows that
the canvas is flipped horizontally and/or vertically. Especially if you
often flip and rotate the canvas (or if you did it by mistake), at some
point, it may become confusing to remember whether this is the case. Now
it will be possible to check in a single glimpse at the status bar.
Similarly to what I previously did for the rotation information, hitting
the flip icons in status will allow to unflip easily without having to
go in menus or remember all shortcuts.
These information will be visible only when the canvas is flipped or
rotated.
2017-11-15 20:04:19 +01:00
Jehan 953a095563 Bug 789173 - Make canvas rotation information visible on the main window
The rotation angle is made visible in the status bar.
Clicking the angle label also opens the "Select Rotation Angle" dialog.
2017-11-15 20:02:54 +01:00
Michael Natterer bb8d65bcee Bug 730862 - Preview frozen while dragging selection tools...
...(crop, rectangle, etc) in large image zoomed-to-fit

Introduce a hash of the last 16 used icons in GimpStatusbar, it was
loading icons at a very high frequency. Found by Massimo.
2014-05-30 19:40:11 +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 2eb74becb8 app: add G_GNUC_PRINTF() to places where the args are a va_list
The trick is to use G_GNUC_PRINTF (n, 0).
2013-11-29 00:33:05 +01:00
Michael Natterer 372eabdd48 app: avoid using sealed GtkStatusbar members
Instead keep a pointer to the statusbar's label around in our own
object struct. Also remove conditional compilation based in GTK+
version.
2010-04-20 09:56:59 +02:00
Michael Natterer fa43c8797e Add gimp_statusbar_override/restore_window_title()
Which sets/unsets the title of an iconified toplevel image window to
the current progress message (if any). Use the new functions when the
window is (de)iconified. Not exactly the high art of programming, but
much better than the hacks in gimpdisplayshell-progress.c that are now
removed.
2009-09-28 22:55:52 +02:00
Michael Natterer fc75f38c03 Make gimp_statusbar_new() a void function and set a shell dynamically 2009-09-28 22:55:41 +02:00
Michael Natterer 82aa4084ab Add gimp_statusbar_set_shell()
Reconnect signals when a new shell is set; reorganize internal code to
not set up permanent connections to one specific shell.
2009-09-28 22:55:41 +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 d51c50820f Bug 496772 – Position shown in the statusbar needs more precision (for
2008-08-20  Michael Natterer  <mitch@gimp.org>

	Bug 496772 – Position shown in the statusbar needs more
	precision (for some tools)

	* app/display/display-enums.[ch]: add enum GimpCursorPrecision
	which can be one of { PIXEL_CENTER, PIXEL_BORDER, SUBPIXEL }.

	* app/display/gimpdisplayshell-cursor.[ch]: add "precision"
	parameter to gimp_display_shell_update_cursor() and pass it
	on to the statusbar.

	* app/display/gimpstatusbar.[ch]: add "precision" parameters to
	the cursor coordinates APIs, offset the passed coords accordingly
	and display them with one decimal point if SUBPIXEL is requested
	and the display's unit is PIXEL. Keep a second floating-point
	format string around at any time.

	* app/tools/gimptoolcontrol.[ch]: add a "precision" member and API
	so tools can configure the precision they need. Defalt to
	PIXEL_CENTER since that's right for almost all tools.

	* app/display/gimpdisplayshell-callbacks.c: pass the tool's
	precision to gimp_display_shell_update_cursor().

	* app/tools/gimptool.[ch]: add "precision" parameter to
	gimp_tool_push_status_coords() and pass it on to the statusbar.

	* app/tools/gimpaligntool.c
	* app/tools/gimpblendtool.c
	* app/tools/gimpcolortool.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimpfliptool.c
	* app/tools/gimpfreeselecttool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimppainttool.c
	* app/tools/gimpperspectiveclonetool.c
	* app/tools/gimprectangleselecttool.c
	* app/tools/gimprectangletool.c
	* app/tools/gimptransformtool.c
	* app/tools/gimpvectortool.c: set precision in init() where
	needed. Adjust the precision in the fly when needed, e.g. while
	moving guides or when toggling hard-edge on paint tools. Also pass
	an appropriate precision to gimp_tool_push_status_coords(), which
	is not always the tool's precision as used for cursor display.


svn path=/trunk/; revision=26681
2008-08-20 16:22:09 +00:00
Sven Neumann 644ad1ef2c added some logic to avoid that an info message replaces a warning. Allow
2008-08-15  Sven Neumann  <sven@gimp.org>

	* app/display/gimpstatusbar.[ch]: added some logic to avoid that
	an info message replaces a warning. Allow info messages to
	replaced other info messages.

	* app/display/gimpdisplay-handlers.c: changed accordingly.


svn path=/trunk/; revision=26572
2008-08-15 16:32:09 +00:00
Michael Natterer 598da617b0 Stop including single headers from gtk+ to be prepared for the upcoming
2008-05-23  Michael Natterer  <mitch@gimp.org>

	Stop including single headers from gtk+ to be prepared
	for the upcoming GTK_DISABLE_SINGLE_INCLUDES:

	* configure.in: add -DGTK_DISABLE_SINGLE_INCLUDES to CPPFLAGS.

	* app/display/gimpcanvas.h
	* app/display/gimpscalecombobox.h
	* app/display/gimpstatusbar.h
	* app/widgets/*.h
	* libgimp/gimpprogressbar.h
	* libgimp/gimpselectbutton.h
	* libgimpwidgets/*.h
	* libgimpwidgets/gimpstock.c
	* plug-ins/uri/gimpmountoperation.h: remove inclusion of parent
	classes and single files from gtk+.

	* app/widgets/gtkwrapbox.h
	* libgimp/gimpbrushmenu.c
	* libgimp/gimpfontmenu.c
	* libgimp/gimpgradientmenu.c
	* libgimp/gimppalettemenu.c
	* libgimp/gimppatternmenu.c
	* libgimp/gimpselectbutton.c: #include <gtk/gtk.h>

	* plug-ins/common/poppler.c: undef GTK_DISABLE_SINGLE_INCLUDES
	when including <poppler.h>.


svn path=/trunk/; revision=25781
2008-05-23 20:38:52 +00:00
Sven Neumann a95de7a59c rewritten the code that draws the icon in the statusbar label. The new
2008-04-14  Sven Neumann  <sven@gimp.org>

	* app/display/gimpstatusbar.[ch]: rewritten the code that draws
	the icon in the statusbar label. The new code gives nicer 
spacing.


svn path=/trunk/; revision=25481
2008-04-14 10:10:02 +00:00
Sven Neumann e7c5bf8086 added stock-id parameters to all statusbar setters.
2008-04-14  Sven Neumann  <sven@gimp.org>

	* app/display/gimpstatusbar.[ch]: added stock-id parameters to 
all
	statusbar setters.

	* app/display/gimpdisplayshell-title.c: pass NULL as stock-id.

	* app/tools/gimptool.c: pass the tool icon to the statusbar.

	* app/tools/gimpeditselectiontool.c 
(gimp_edit_selection_tool_start):
	inherit the tool-info from the parent tool.


svn path=/trunk/; revision=25477
2008-04-14 06:28:43 +00:00
Sven Neumann 5357d440e4 improved the check if the message can be shown in the statusbar. Do not
2008-04-10  Sven Neumann  <sven@gimp.org>

	* app/display/gimpstatusbar.[ch] 
(gimp_statusbar_progress_message):
	improved the check if the message can be shown in the statusbar.
	Do not show messages that don't fit into the given space.

	* app/gui/gui-message.c (gui_message_error_dialog): if there's
	already an error dialog associated with a progress, then use it.


svn path=/trunk/; revision=25461
2008-04-10 19:24:06 +00:00
Sven Neumann 81c46c382b derive GimpStatusbar from GtkStatusbar. Use the normal statusbar label for
2008-03-27  Sven Neumann  <sven@gimp.org>

	* app/display/gimpstatusbar.[ch]: derive GimpStatusbar from
	GtkStatusbar. Use the normal statusbar label for statusbar
	messages and only show the progressbar when progress is active.

	* app/display/gimpdisplayshell.c (gimp_display_shell_new): removed
	spacing from the main vertical box.

svn path=/trunk/; revision=25257
2008-03-27 10:43:55 +00:00
Sven Neumann f7a49c83e9 added gimp_statusbar_peek(), a method to access the contents of the
2008-03-25  Sven Neumann  <sven@gimp.org>

	* app/display/gimpstatusbar.[ch]: added gimp_statusbar_peek(), a
	method to access the contents of the statusbar.

	* app/display/gimpdisplayshell.c
	(gimp_display_shell_window_state_event): when the iconfied state
	changes, call gimp_display_shell_progress_window_state_changed().

	* app/display/gimpdisplayshell-progress.[ch]: when the image
	window is iconified, display the progress message in the window
	title so that it appears in the task bar.

	* app/menus/plug-in-menus.c: formatting.

svn path=/trunk/; revision=25224
2008-03-25 14:07:10 +00:00
Sven Neumann e81f857482 app/display/gimpdisplayshell.c app/display/gimpdisplayshell-title.c
2008-03-19  Sven Neumann  <sven@gimp.org>

	* app/display/gimpdisplayshell.c
	* app/display/gimpdisplayshell-title.c
	* app/display/gimpstatusbar.[ch]: hide/show the cursor label and
	the unit and scale combo-boxes.

svn path=/trunk/; revision=25125
2008-03-19 16:54:01 +00:00
Sven Neumann 0d818d9ad3 app/display/gimpstatusbar.[ch] only update the GtkProgressBar if that
2007-12-30  Sven Neumann  <sven@gimp.org>

	* app/display/gimpstatusbar.[ch]
	* app/widgets/gimpprogressbox.[ch]: only update the 
GtkProgressBar
	if that would cause a visible change.


svn path=/trunk/; revision=24487
2007-12-30 17:25:58 +00:00
Michael Natterer 2fe95848c5 Don't leave the user without progress bar just because the display's
2007-05-28  Michael Natterer  <mitch@gimp.org>

	Don't leave the user without progress bar just because the
	display's statusbar is invisible:

	* app/display/gimpstatusbar.[ch]: if the statusbar is invisible
	when a progress wants to be shown, temporarily show it, recording
	the fact in the new boolean "progress_shown" member. Added new API
	gimp_statusbar_get/set_visible() which is aware of the new
	temporary visibility state.

	* app/display/gimpdisplayshell-appearance.c
	(gimp_display_shell_set_show_statusbar)
	* app/display/gimpdisplayshell-progress.c
	(gimp_display_shell_progress_message): use the new API instead of
	showing/hiding the widget directly.


svn path=/trunk/; revision=22642
2007-05-28 17:42:55 +00:00
Michael Natterer 1c233b6fb6 disallow passing a NULL image.
2007-03-20  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpcursorview.[ch] (gimp_color_frame_update_cursor):
	disallow passing a NULL image.

	(gimp_color_frame_clear_cursor): new function that clears the
	cursor view.

	* app/widgets/gimpcolorframe.c (gimp_color_frame_update): if
	color_frame->sample_valid is FALSE, don't do any color
	transformations and don't construct any string because none
	of them is going to be used (all labels will show "n/a").

	* app/display/gimpstatusbar.[ch]: renamed set_cursor() API
	to update_cursor().

	* app/display/gimpdisplayshell-cursor.c
	(gimp_display_shell_update_cursor): move variables to local
	scopes. Follow GimpStatusbar API change. Cleanup.

	(gimp_display_shell_clear_cursor): ditto. Follow GimpColorFrame
	API change.


svn path=/trunk/; revision=22153
2007-03-20 19:03:34 +00:00
Raphael Quinet 65950be141 app/display/gimpstatusbar.[ch] add optional help text at the end of the
2007-01-21  Raphael Quinet  <raphael@gimp.org>

	* app/display/gimpstatusbar.[ch]
	* app/tools/gimptool.[ch]: add optional help text at the end of
	the messages generated by gimp_statusbar_push_coords() and
	gimp_statusbar_push_length().

	* app/tools/gimpcolortool.c
	* app/tools/gimpeditselectiontool.c 
	* app/tools/gimpmovetool.c
	* app/tools/gimprectangletool.c: use the updated functions.

	* app/tools/gimpblendtool.c
	* app/tools/gimpcolorpickertool.c: added status bar messages.

svn path=/trunk/; revision=21745
2007-01-21 01:24:51 +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
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
Michael Natterer 10f9181e64 added _valist() variants of all printf-style functions.
2006-09-28  Michael Natterer  <mitch@gimp.org>

	* app/display/gimpstatusbar.[ch]: added _valist() variants
	of all printf-style functions.

	* app/tools/gimptool.[ch] (gimp_tool_push_status)
	(gimp_tool_replace_status)
	(gimp_tool_message): take printf-style ... arguments and use the
	new valist() variants of the statusbar API to avoid additional
	strdups. Revert previous commit from Sven, he will add back that
	feature differently right away :)

	* app/tools/gimpmeasuretool.c
	* app/tools/gimppainttool.c: use the new printf-style status API
	where possible.

	* app/tools/gimptransformtool.c: accidentially removed
	"core/gimp.h", added it back.
2006-09-28 11:07:55 +00:00
Michael Natterer 1419751614 changed all message setting functions to use printf-style argument lists.
2006-09-22  Michael Natterer  <mitch@gimp.org>

	* app/display/gimpstatusbar.[ch]: changed all message setting
	functions to use printf-style argument lists. Added new API to
	show a temporary message that stays on top regardless of any other
	message activity and disappears after 3 seconds.

	* app/actions/edit-commands.c: show a statusbar message when
	pasting fails because the clipboard contains no image data. Pop a
	dialog when "Paste as New" fails. Addresses bug #357059 for
	internal functions.

	* app/display/gimpdisplayshell-title.c
	* app/gui/gui.c
	* app/tools/gimptool.c: changed accordingly.
2006-09-22 16:44:47 +00:00
Sven Neumann 297f871514 use a hash table instead of object data to maintain context ids. Saves
2006-09-01  Sven Neumann  <sven@gimp.org>

	* app/display/gimpstatusbar.c: use a hash table instead of object
	data to maintain context ids. Saves lots of pointless string copies.
2006-09-01 12:15:14 +00:00
Michael Natterer 04a7e8585b added new function gimp_statusbar_push_length(), which works exactly like
2004-11-10  Michael Natterer  <mitch@gimp.org>

	* app/display/gimpstatusbar.[ch]: added new function
	gimp_statusbar_push_length(), which works exactly like
	push_coords() but takes only one value plus a GimpOrientationType
	for specifying the value's axis.

	* app/tools/gimptool.[ch]: added the corresponding
	gimp_tool_push_status_length().

	* app/tools/gimpmovetool.c: use gimp_tool_push_status_length()
	so the guide position is shown in the selected display unit.
	Cleaned up the status message code a bit.
2004-11-10 01:17:40 +00:00
Michael Natterer 02d2b990f5 Redid the whole internal progress stuff: don't pass around
2004-08-10  Michael Natterer  <mitch@gimp.org>

	Redid the whole internal progress stuff: don't pass around
	progress_callback and progress_data; instead, provide a
	pointer to a GimpProgressInterface which can be implemented
	by a variety of backends.

	Addresses (but not yet fixes) bugs #6010, #97266 and #135185.

	* app/display/Makefile.am
	* app/display/gimpprogress.[ch]: removed the old progress hack.

	* app/core/Makefile.am
	* app/core/core-types.h
	* app/core/gimpprogress.[ch]: implement GimpProgressInterface.

	* app/widgets/Makefile.am
	* app/widgets/widgets-types.h
	* app/widgets/gimpprogressdialog.[ch]: the standalone progress
	dialog as widget implementing GimpProgressInterface.

	* app/display/gimpdisplay.c
	* app/display/gimpstatusbar.[ch]
	* app/widgets/gimpfiledialog.[ch]
	* app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface
	implementation to these classes.

	* app/core/gimp-gui.[ch]
	* app/gui/gui-vtable.c: replaced the old progress vtable entries
	by two new to create and destroy a GimpProgressDialog in case
	no other progress is available.

	* app/pdb/procedural_db.[ch]
	* app/plug-in/plug-in-run.[ch]
	* tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and
	all plug-ins.

	* app/plug-in/plug-in.[ch]
	* app/plug-in/plug-ins.c
	* app/plug-in/plug-in-message.c
	* app/plug-in/plug-in-progress.c: handle the case there the
	plug-in was crated with a progress as well as the case where it
	wasn't.

	* app/app_procs.c
	* app/batch.c
	* app/xcf/xcf.c
	* app/file/file-open.[ch]
	* app/file/file-save.[ch]
	* app/widgets/gimphelp.c
	* app/widgets/gimpbrushselect.c
	* app/widgets/gimpfontselect.c
	* app/widgets/gimpgradientselect.c
	* app/widgets/gimppaletteselect.c
	* app/widgets/gimppatternselect.c: changed accordingly.

	* app/core/gimpimagefile.[ch]
	* app/display/gimpdisplayshell-dnd.c
	* app/gui/file-open-dialog.c
	* app/gui/file-open-location-dialog.c
	* app/gui/file-save-dialog.c
	* app/widgets/gimplayertreeview.c
	* app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file
	related functions. Embed the progress in the file dialog where
	possible.

	* app/core/gimpdrawable-blend.[ch]
	* app/core/gimpdrawable-transform.[ch]
	* app/core/gimpimage-convert.[ch]
	* app/core/gimpimage-flip.[ch]
	* app/core/gimpimage-resize.[ch]
	* app/core/gimpimage-rotate.[ch]
	* app/core/gimpimage-scale.[ch]
	* app/core/gimpitem-linked.[ch]
	* app/core/gimpitem.[ch]
	* app/core/gimpchannel.c
	* app/core/gimpdrawable.c
	* app/core/gimplayer.c
	* app/core/gimpselection.c
	* app/vectors/gimpvectors.c: replaced callback/data by GimpProgress.

	* app/tools/gimpblendtool.c
	* app/tools/gimptransformtool.c
	* app/gui/convert-dialog.c
	* app/actions/documents-commands.c
	* app/actions/file-commands.c
	* app/actions/image-commands.c
	* app/actions/layers-commands.c
	* app/actions/plug-in-commands.c
	* app/actions/vectors-commands.c
	* tools/pdbgen/pdb/convert.pdb
	* tools/pdbgen/pdb/edit.pdb
	* tools/pdbgen/pdb/image.pdb
	* tools/pdbgen/pdb/layer.pdb: changed callers accordingly.

	* app/pdb/*_cmds.c: regenerated.
2004-08-10 18:47:21 +00:00
Michael Natterer 178d7d3ff1 massively changed: removed message_ids, the message mem chunk and all
2004-07-14  Michael Natterer  <mitch@gimp.org>

	* app/display/gimpstatusbar.[ch]: massively changed: removed
	message_ids, the message mem chunk and all signals. Added new
	function gimp_statusbar_replace() which updates a message without
	moving it to the top of the stack. Fixes bug #120175.

	* app/display/gimpdisplayshell-title.[ch]: renamed
	gimp_display_shell_update_title() to
	gimp_display_shell_title_update() and switched from pop()/push()
	to replace() so the title message keeps its place in the stack.
	Added new function gimp_display_shell_title_init() which push()es
	the title message to the stack.

	* app/display/gimpdisplayshell.c (gimp_display_shell_new): call
	gimp_display_shell_title_init() so the "title" message is at the
	bottom of the stack.

	* app/display/gimpdisplayshell-callbacks.c
	* app/display/gimpdisplayshell-handlers.c: changed accordingly.
2004-07-14 16:37:13 +00:00
Sven Neumann af16921d9b Applied a patch from Geert Jordaens that implements the GtkStatusbar
2004-06-19  Sven Neumann  <sven@gimp.org>

	Applied a patch from Geert Jordaens that implements the
	GtkStatusbar functionality in GimpStatusbar so that we can redo it
	in order to fix bug #120175:

	* app/core/gimpmarshal.list: added VOID: UINT, STRING.

	* app/display/gimpstatusbar.[ch]: copied GtkStatusbar code.

	* app/display/gimpdisplayshell.c: changed accordingly.
2004-06-19 13:31:58 +00:00
Sven Neumann a08d648a47 added a stock icon for "view-zoom-1-1".
2004-05-10  Sven Neumann  <sven@gimp.org>

	* app/actions/view-actions.c: added a stock icon for "view-zoom-1-1".

	* app/widgets/gimpunitcombobox.[ch]: added functions to get and
	set the active unit.

	* app/widgets/gimpunitstore.c (gimp_unit_store_tree_model_get_value):
	need to special case GIMP_UNIT_PIXEL.

	* app/display/Makefile.am
	* app/display/display-types.h
	* app/display/gimpscalecombobox.[ch]: new widget to be used in the
	display's statusbar.

	* app/display/gimpdisplayshell-cursor.[ch]: always display the
	cursor position, not only if the cursor is inside the image. Added
	new function gimp_display_shell_clear_cursor() to clear the cursor
	label.

	* app/display/gimpdisplayshell-callbacks.c: changed accordingly.

	* app/display/gimpstatusbar.[ch]
	* app/display/gimpdisplayshell.c
	* app/display/gimpdisplayshell-handlers.c
	* app/display/gimpdisplayshell-scale.c: do not explicitely resize
	the statusbar cursor label, connect to GimpDisplayShell::scaled
	instead. Added a GimpScaleComboBox to the status bar.
2004-05-10 10:33:21 +00:00
Sven Neumann 4722267d30 renamed struct member combo to unit_combo. Place the combobox into the
2004-05-08  Sven Neumann  <sven@gimp.org>

	* app/display/gimpstatusbar.[ch]: renamed struct member combo to
	unit_combo. Place the combobox into the cursor frame.
2004-05-07 23:31:01 +00:00
Sven Neumann ebdd4fb738 app/widgets/Makefile.am app/widgets/widgets-types.h
2004-05-08  Sven Neumann  <sven@gimp.org>

	* app/widgets/Makefile.am
	* app/widgets/widgets-types.h
	* app/widgets/gimpunitcombobox.[ch]
	* app/widgets/gimpunitstore.[ch]: added a prototype of a unit menu
	based on GtkComboBox. Will move this to libgimpwidgets later...

	* app/display/gimpstatusbar.[ch]: use the new GimpUnitComboBox and
	GimpUnitStore.

	* themes/Default/gtkrc
	* themes/Small/gtkrc: hardcode the appearance of the
	GimpUnitComboBox. It uses a hack that doesn't work in list mode.
2004-05-07 22:16:15 +00:00
Michael Natterer fa537489d7 removed gdisp->scale, gdisp->dot_for_dot, the scaling marcos and the
2002-06-27  Michael Natterer  <mitch@gimp.org>

	* app/display/gimpdisplay.[ch]: removed gdisp->scale,
	gdisp->dot_for_dot, the scaling marcos and the
	gdisplay_[un]transform[_f]() functions.

	* app/display/gimpdisplayshell.[ch]: added them here. Named the
	transform functions gimp_display_shell_[un]transform_xy[_f]().

	Made the gimp_display_shell_[un]transform_coords() functions copy
	all values of the GimpCoords struct, not just x and y.

	* app/display/gimpstatusbar.[ch]: keep a pointer to
	GimpDisplayShell, not GimpDisplay.

	* app/display/gimpdisplayshell-callbacks.c
	* app/display/gimpdisplayshell-render.c
	* app/display/gimpdisplayshell-scale.c
	* app/display/gimpdisplayshell-scroll.c
	* app/display/gimpdisplayshell-selection.c
	* app/display/gimpnavigationview.c
	* app/gui/image-commands.c
	* app/gui/info-window.c
	* app/gui/select-commands.c
	* app/gui/view-commands.c
	* app/tools/gimpbezierselecttool.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpdrawtool.c
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimpmagnifytool.c
	* app/tools/gimpmeasuretool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimppainttool.c
	* app/tools/gimppathtool.c
	* app/tools/gimprotatetool.c
	* app/tools/gimpscaletool.c
	* app/tools/gimpvectortool.c: changed accordingly.

	* app/gui/layers-commands.c: if(gimage->selection_mask) is always
	TRUE, use if(!gimp_image_mask_is_empty(gimage)) instead.

	* app/tools/gimpfuzzyselecttool.[ch]: moved global variables
	to the object struct.
2002-06-26 22:16:59 +00:00
Michael Natterer 0440bbbf5a app/display/Makefile.am app/display/display-types.h new widget derived
2002-02-03  Michael Natterer  <mitch@gimp.org>

	* app/display/Makefile.am
	* app/display/display-types.h
	* app/display/gimpstatusbar.[ch]: new widget derived from
	GtkStatusbar.  Contains the coordinates display, a progress bar
	which is also used for status message display and a cancel button.
	Added a simplified API for pushing/popping messages which takes a
	string as context_id and does the conversion to guint internally
	on each call.

	* app/display/gimpdisplayshell.[ch]: removed the status bar code.

	* app/display/gimpdisplayshell-callbacks.c
	* app/display/gimpdisplayshell-handlers.c
	* app/display/gimpdisplayshell-scale.c
	* app/gui/view-commands.c
	* app/gimpprogress.c: changed accordingly.

	Removed knowledge about GimpDisplayShell from tools:

	* app/tools/gimptool.[ch]: added gimp_tool_push_status() and
	gimp_tool_pop_status() so tools don't need to fiddle with
	display details.

	* app/tools/gimpdrawtool.[ch]: pass a GimpDisplay instead of
	a GdkWindow to gimp_draw_tool_start() (the window passed was
	always gdisp->shell->canvas->window).

	* app/tools/gimpbezierselecttool.c
	* app/tools/gimpblendtool.[ch]
	* app/tools/gimpclonetool.c
	* app/tools/gimpcolorpickertool.c
	* app/tools/gimpcroptool.[ch]
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimpfreeselecttool.c
	* app/tools/gimpfuzzyselecttool.c
	* app/tools/gimpiscissorstool.c
	* app/tools/gimpmagnifytool.c
	* app/tools/gimpmeasuretool.[ch]
	* app/tools/gimpmovetool.c
	* app/tools/gimppainttool.[ch]
	* app/tools/gimppathtool.c
	* app/tools/gimprectselecttool.[ch]
	* app/tools/gimptransformtool.c: changed accordingly:

	- pass GimpDisplay to gimp_draw_tool_start().
	- use GimpTool's new status push/pop functions.
	- removed the statusbar context_id from all tool structs.

	* app/gui/dialogs-constructors.[ch]: a bit cleanup in preparation
	of dockable editor dialogs.
2002-02-03 12:10:23 +00:00