Commit Graph

153 Commits

Author SHA1 Message Date
Niels De Graef 878804fb01 Cleanup GObject signal marshallers
* Don't generate our own marshallers if they are available in GLib
  already
* Don't set the c_marshaller parameter in `g_signal_new()` if it's a
  default marshaller provided by GLib. See commit message of commit
  39e4aa3c57 on why this is the case.
2020-04-01 21:20:01 +00:00
Ell 3b0040c043 app, libgimp*, modules: don't use g_type_class_add_private() ...
... and G_TYPE_INSTANCE_GET_PRIVATE()

g_type_class_add_private() and G_TYPE_INSTANCE_GET_PRIVATE() were
deprecated in GLib 2.58.  Instead, use
G_DEFINE_[ABSTRACT_]TYPE_WITH_PRIVATE(), and
G_ADD_PRIVATE[_DYNAMIC](), and the implictly-defined
foo_get_instance_private() functions, all of which are available in
the GLib versions we depend on.

This commit only covers types registered using one of the
G_DEFINE_FOO() macros (i.e., most types), but not types with a
custom registration function, of which we still have a few -- GLib
currently only provides a (non-deprecated) public API for adding a
private struct using the G_DEFINE_FOO() macros.

Note that this commit was 99% auto-generated (because I'm not
*that* crazy :), so if there are any style mismatches... we'll have
to live with them for now.
2018-09-18 14:39:56 -04: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 655b170619 app: remove more GimpDock and GimpDockbook API in favor of GtkNotebook
mostly adding/removing widgets, use the plain GTK+ APIs instead.
Also, cleanup and cruft removal.
2018-06-08 02:40:31 +02:00
Michael Natterer 1de4e8a697 app: remove gimp_dock_temp_add() and _temp_remove()
and some leftover CSS prider cruft.
2018-06-08 01:41:44 +02:00
Michael Natterer 58d5cd2907 app: remove most of our own dockable DND code
and use GtkNotebook's implementation instead. This is mostly moving
dockable adding and removing code to GtkNotebook::page_added() and
::page_removed() and removing lots of code.
2018-06-08 01:37:19 +02:00
Michael Natterer 4f0a87ffa6 app, libgimpwidgets, themes: fix some themeing
Add CSS names using gtk_widget_class_set_css_name(), remove styling in
code and instead do it properly in CSS, so far in the System theme.
All horribly incomplete but a start.
2018-05-20 21:06:30 +02:00
Michael Natterer 8b8242947b app: GimpDock: port font size modification to GtkCssProvider 2018-05-20 21:06:29 +02:00
Michael Natterer f3d65fdb59 Implement GtkWidget::style_updated() instead of ::style_set() 2018-05-20 21:06:28 +02:00
luz.paz 7fdb963e01 Bug 794996 - Misc. typo fixes in comments in app/
Found via `codespell -q 3 --skip="./po*"`
2018-04-08 21:25:56 +02:00
Michael Natterer 2e63533602 app: add GimpDockContainer::get_dialog_factory()
and use it where possible instead of gimp_dialog_factory_get_singleton().
Also reduce using this function in some other places.
2016-11-25 13:26:08 +01:00
Michael Natterer a3c65e6d17 app: get rid of including menus/ stuff from widgets/ and other places
Add GimpMenuFactory can always be found in a GimpDialogManager, use
gimp_dialog_factory_get_menu_factory() where we have a dialog factory
instead of accessing "global_menu_factory" or redundantly passing a
menu factory around where we already pass around a dialog factory.
2016-11-23 19:38:44 +01:00
Michael Natterer 867da8f293 app: add gimp_context_get_foreground,background_pixel()
which takes a Babl format to convert from/to.
Include <gegl.h> in a million places.
2012-05-02 17:50:41 +02:00
Michael Natterer fbd746f95a app: don't rely on gtk_container_remove() to always destroy the child
Instead, either destroy the child instead of removing it, or remove
*and* destroy it in cases where the remove() api on the "parent"
doesn't match GTK+'s parent/child relation (like with all our dock
widgets). We can't rely on remove() to implicitly detstroy, because
there might be arbitrary other code holding references, such as
accessibility modules and whatnot. Most likely fixes unclear crashes
in accessibility code and other crashes we blamed GTK+ for.
2012-02-21 00:36:18 +01:00
Michael Natterer 3e336199b9 app: use gtk_box_new() 2011-09-30 11:29:11 +02:00
Martin Nordholts ab1b50ad4a app: Add GimpDockContainer::get_ui_manager()
Add GimpDockContainer::get_ui_manager() and make GimpDockWindow
implement it. Primary client is session restoration code.
2011-05-13 18:56:41 +02:00
Michael Natterer 85c0fd1166 app: replace gimp_dock_get_dock_columns() by gtk_widget_get_ancestor() 2011-05-04 22:41:40 +02:00
Martin Nordholts 4988a97257 app: Add gimp_dock_set_id() 2011-04-21 19:57:14 +02:00
Martin Nordholts c84d26667b app: Add missing gimp_dock_get_id() implementation 2011-04-21 18:59:12 +02:00
Michael Natterer b9a7c121a4 app: don't inherit from GtkHBox or GtkVBox
Instead, inherit from GtkBox directly and set the orientation in
init().  Replace more gtk_container_add() by gtk_box_pack_start() in
the reparented classes.
2010-10-30 15:44:46 +02:00
Michael Natterer b69eea8cd6 app: implement GObject::dispose() instead of GtkObject::destroy() 2010-10-15 14:08:36 +02:00
Martin Nordholts e8e469c53c app: Add gimp_dock_temp_add/remove()
In order to get accurate measurements of widgets that will be put in a
GimpDock, add gimp_dock_temp_add() and gimp_dock_temp_remove(). That
way we can add a widget temporarliy, measure it with the
GimpDock::font-scale property applied, then remove it when we're
done. We can't apply style properties on widget detached from a
GdkScreen hierarchy :(
2010-06-11 23:25:14 +02:00
Martin Nordholts 520da707c1 app: Only show active dockables in dock window titles
Refactor stuff a bit so that the dock window description can be both
short and long. The short version only have the active dockables, and
the long version have all the dockables in the description string. We
use the short version for the window title and the long version for
the Recently Closed Docks menu items.
2010-03-13 20:02:55 +01:00
Martin Nordholts a915132ee6 app: Don't call the dock title a title, but "description"
Don't call the dock title a title, but "description". Title is an old
name from when a GimpDock was a GtkWindow.
2010-03-13 17:18:47 +01:00
Martin Nordholts 3352b0485c app: Fix dockable separator translations
Continued fix of bug 554927. Also translate the " - " string in the
toolbox and add a "dock" translation context.
2010-03-13 12:17:46 +01:00
Martin Nordholts 35096957a9 Bug 554927 - The dock window titles uses a non localizable comma
Mark dockable separator characters used in the dock window title as
translatable so e.g. Arabic can use an arabic comma.
2010-03-07 12:51:34 +01:00
Martin Nordholts 33dbcf210e app: Move title invalidation from GimpMenuDock to GimpDock base class
Move title invalidation from GimpMenuDock to GimpDock base class so
that title invalidation works properly also for the GimpToolbox.
2010-03-07 10:25:24 +01:00
Martin Nordholts 0279daed28 app: Make Toolbox dock title complete
Make the Toolbox dock title complete, i.e. if the toolbox dock
contains Tool Options, the title will be "Toolbox - Tool Options".
2010-03-05 21:31:07 +01:00
Martin Nordholts 5d79f664d3 app: Add "dialog-factory", "ui-manager" properties to GimpDockColumns
Add "dialog-factory", "ui-manager" properties to GimpDockColumns and
let GimpDock look for these before trying to look for a dock window
which does not exist in single-window mode.
2010-01-07 19:18:03 +01:00
Martin Nordholts 3015b0d0d0 app: Update docks with new context when switching to window modes
When moving dockables from a dock window to an image window, they need
to start listening to the user context. So update the dockables with
the new context when we switch window mode.
2010-01-06 13:33:47 +01:00
Martin Nordholts 4fcd3024f1 app: Set a GimpContext on GimpDockColumns
In order to make a GimpDock get hold of a GimpContext both in
single-window mode and in multi-window mode, don't make it look for a
GimpContext in a GimpDockWindow, put the context in GimpDockColumns
instead. GimpDockColumns exists both in s-w-m and m-w-m, contrary to
GimpDockWindow. Still use the GimpDockWindow as a backup though.
2010-01-05 11:31:15 +01:00
Martin Nordholts be653a7110 app: Seal GimpDockable and add necessary getters and setters 2010-01-05 00:32:35 +01:00
Martin Nordholts 65c5541faf app: Don't crash when detaching dockables from image window
Don't crash when detaching dockables from the image window. This
scenario only occurs in single-window mode. We solve it by using
global variables and checking for NULL for src_dock_window; there is
no dock window when detaching from the image window.

The use of global variables is meant to be temporary.
2009-12-10 19:30:49 +01:00
Martin Nordholts 1bf84999e4 Move the Image Selection Menu to GimpDockWindow
Move the Image Selection Menu from GimpMenuDock to
GimpDockWindow. That is, if a dock window contains many docks then
they will share the same Image Selection Menu.

To do this we need to move around quite a bit of code. Move the
"context", "dialog-factory" and "ui-manager" properties from GimpDock
to GimpToolbox, GimpMenuDock doesn't need it any longer. Turn the
GimpDock getters for these properties into wrappers that go to the
GimpDockWindow properties. In some places, most notably GimpToolbox
construction, we use the GimpToolbox values of these properties, but
most of the time it works fine to just use the GimpDockWindow
properties. GimpDock::setup() and set/get_aux_info() have also been
moved to GimpDockWindow since the only aux info for docks was for the
image selection menu.

Also, we don't bother porting gimp_menu_dock_destroy() to
GimpDockWindow, but we leave the code around. If this is a problem, it
will show.
2009-12-05 21:21:24 +01:00
Martin Nordholts d33f643f6b app: Move GimpDockWindow::"font-scale" style property to GimpDock
To make the smaller font in docks also apply in single-window mode,
move the GimpDockWindow::font-scale style property to GimpDock. We use
the GimpDockWindow approach, so now each GimpDock has a name of the
form "gimp-internal-dock-<id>". We add "internal" to avoid clashing
with the GimpDockWindow legacy id "gimp-dock-<id>".
2009-12-03 23:08:30 +01:00
Martin Nordholts 4ccb650435 Exterminate GimpDockSeparator
Remove all GimpDockSeparator-related code. Seems pointless to keep
even the stuff in gtkrc.
2009-12-02 20:40:39 +01:00
Martin Nordholts 7b85cf4de8 app: Use a GdkWindow instead of GimpDockSeparators for dockable DND
Make drag-and-drop rearrangement of dockables happen directly in the
existing widget hierarchy so we don't have to use special, ugly
widgets (read GimpDockSeparator:s) for that.

More specifically, make edges of dockables and dockbooks have the same
semantics as the GimpDockSeparators had. We put a highlight colored
GdkWindow on top of the widget in question to highlight these special
drop areas. This GdkWindow is not taken into consideration in the GTK+
drag-and-drop code, so it does not interupt the DND interaction.

To achive this, there is a problem we must solve: Drag events in GTK+
are propagated inwards and out, but we sometimes want ancenstor
widgets to take care of drop events. We solve this by introducing the
concept of "drag handlers". A drag handler is asked if it will handle
a given drag event, and if it will, a client will let the drag event
be propagated upwards in the widget hierarchy. Right now, the
GimpPanedBox is the only "drag handler". The code could be generalized
more but it doesn't feel worth it at this point.

The size of the special drop area is 5px, the same size as the default
GtkPaned handles. This is because the plan is to later use these
handles as drop areas too.

Other changes of interest are:
 * We need to take care of "drag-motion", "drag-drop" and widget
   highlightning ourselves. We can not use the GtkDestDefaults
   conveniences with gtk_drag_dest_set() any longer since we need more
   control.
 * Make the drop callback pass the insert index directly instead of a
   GimpDockSeparator
 * Add some GIMP_LOG() debug output for DND
 * Disable the GimpDockSeparator code in GimpToolbox
2009-11-29 18:22:12 +01:00
Martin Nordholts d3bb3e7f99 app: Add and use gimp_dockbook_drag_source_to_dockable() 2009-10-25 23:02:05 +01:00
Martin Nordholts 2b622f99cd app: gimp_dock_separator_get_anchor() -> _get_insert_pos() 2009-10-25 22:25:06 +01:00
Martin Nordholts 3934813dd1 app: Insert, not prepend, into GimpDock dockbooks list
Insert, not prepend, into GimpDock dockbooks list. Fixes failing test
'test-session-management.c'.
2009-10-25 11:49:54 +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 69f17fdbf2 app: Add gimp_dock_separator_set_dropped_cb()
Allow to set the dropped callback after dock separator construction.
We need this in order to move the dock separators into a common widget
for which the callback to use is not known at construction time.
2009-10-24 18:43:35 +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
Martin Nordholts 423c9d8212 app: Always keep dock separators alive
Always keep dock separators alive and show/hide them instead. This is
to avoid having to constantly create new separators.
2009-10-11 15:20:55 +02:00
Martin Nordholts 3236b57a47 app: Generalize GimpDockSeparator
Add a callback to GimpDockSeparator to get rid of the GimpDock
dependency so that we can reuse it also for GimpDockColumns later.
2009-10-11 13:59:27 +02:00
Martin Nordholts 3b721864d7 app: Only show dock separators when rearranging the UI
For now, only show dock separators when they are needed, not all the
time. We need a better solution eventually, but at least docks in the
image window doesn't look terrible any longer.
2009-10-04 12:58:30 +02:00
Martin Nordholts 4f7693acf0 app: Make GimpDock a GtkVBox
Make GimpDock be a GtkVBox instead of a GimpDockWindow. This means we
can now put a GimpDock anywhere, including inside an image window.

In order to do this we need to:

 * Separate dock and dock window creation in the dialog factory and
   add a couple of new dock window constructors

 * Change gimp_dialog_factory_dock_new() to not only create a dock,
   but also create a dock window and then combine those two

 * Change the dock constructor to take a GimpUIManager since they
   depend on that during their construction. We get the ui manager
   from the dock window, but we can't create the dock *inside* the
   dock window, we have to add the dock later. So we create the dock
   window first and then pass its ui manager to the dock constructors

 * Make some other minor adaptions, mostly with
   gimp_dock_window_from_dock() and gimp_dock_window_get_dock()
2009-09-26 16:21:10 +02:00
Martin Nordholts 12a0ea1063 app: Destory the dock window from the dock window, not the dock 2009-09-26 15:26:05 +02:00
Martin Nordholts 3ebad746ee app: Add GimpUIManager property to GimpDock
Add GimpUIManager property to GimpDock. We need it later when the
GimpDock stops being a GimpDockWindow.
2009-09-20 19:30:16 +02:00
Martin Nordholts 2ac7cedbfc app: Make GimpDockbook instance data private
Make GimpDockbook instance data private and add necessary getters and
setters.
2009-09-13 16:30:09 +02:00