2006-12-09 21:33:38 +00:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2001-04-22 00:38:56 +00:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2005-05-11 20:26:12 +00:00
|
|
|
* gimpmenudock.c
|
2004-02-02 12:27:18 +00:00
|
|
|
* Copyright (C) 2001-2004 Michael Natterer <mitch@gimp.org>
|
2001-04-22 00:38:56 +00:00
|
|
|
*
|
2009-01-17 22:28:01 +00:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2001-04-22 00:38:56 +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
|
2001-04-22 00:38:56 +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/>.
|
2001-04-22 00:38:56 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2003-10-10 21:24:12 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
2008-10-09 20:24:04 +00:00
|
|
|
#include <gegl.h>
|
2001-04-22 00:38:56 +00:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2004-02-02 12:27:18 +00:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
2001-04-22 00:38:56 +00:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
2001-05-08 03:48:54 +00:00
|
|
|
#include "widgets-types.h"
|
2001-04-22 00:38:56 +00:00
|
|
|
|
2001-07-07 12:19:21 +00:00
|
|
|
#include "core/gimp.h"
|
2001-05-09 02:32:03 +00:00
|
|
|
#include "core/gimpcontext.h"
|
|
|
|
#include "core/gimpimage.h"
|
2002-05-10 13:09:19 +00:00
|
|
|
#include "core/gimplist.h"
|
|
|
|
|
2001-04-22 00:38:56 +00:00
|
|
|
#include "gimpdialogfactory.h"
|
2003-05-03 11:59:44 +00:00
|
|
|
#include "gimpdockable.h"
|
2001-04-22 00:38:56 +00:00
|
|
|
#include "gimpdockbook.h"
|
2005-05-11 20:26:12 +00:00
|
|
|
#include "gimpmenudock.h"
|
2001-04-22 00:38:56 +00:00
|
|
|
|
2003-03-25 16:38:19 +00:00
|
|
|
#include "gimp-intl.h"
|
2001-04-22 00:38:56 +00:00
|
|
|
|
|
|
|
|
2008-03-22 01:10:51 +00:00
|
|
|
#define DEFAULT_MINIMAL_WIDTH 200
|
2002-03-14 17:07:02 +00:00
|
|
|
|
2011-01-09 20:38:01 +01:00
|
|
|
|
2009-12-05 09:54:17 +01:00
|
|
|
struct _GimpMenuDockPrivate
|
|
|
|
{
|
2009-12-05 21:20:18 +01:00
|
|
|
gint make_sizeof_greater_than_zero;
|
2009-12-05 09:54:17 +01:00
|
|
|
};
|
|
|
|
|
2002-03-14 17:07:02 +00:00
|
|
|
|
2011-01-09 20:38:01 +01:00
|
|
|
static void gimp_menu_dock_style_updated (GtkWidget *widget);
|
2005-05-11 20:26:12 +00:00
|
|
|
|
2001-04-22 00:38:56 +00:00
|
|
|
|
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 12:09:39 -04:00
|
|
|
G_DEFINE_TYPE_WITH_PRIVATE (GimpMenuDock, gimp_menu_dock, GIMP_TYPE_DOCK)
|
2001-04-22 00:38:56 +00:00
|
|
|
|
2005-12-19 22:37:49 +00:00
|
|
|
#define parent_class gimp_menu_dock_parent_class
|
2001-04-22 00:38:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
static void
|
2005-05-11 20:26:12 +00:00
|
|
|
gimp_menu_dock_class_init (GimpMenuDockClass *klass)
|
2001-04-22 00:38:56 +00:00
|
|
|
{
|
2009-12-05 21:20:18 +01:00
|
|
|
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
2002-03-18 19:34:06 +00:00
|
|
|
|
2011-01-09 20:38:01 +01:00
|
|
|
widget_class->style_updated = gimp_menu_dock_style_updated;
|
2002-03-18 19:34:06 +00:00
|
|
|
|
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
2005-03-09 17:02:35 +00:00
|
|
|
g_param_spec_int ("minimal-width",
|
2002-03-18 19:34:06 +00:00
|
|
|
NULL, NULL,
|
|
|
|
0,
|
|
|
|
G_MAXINT,
|
|
|
|
DEFAULT_MINIMAL_WIDTH,
|
2006-01-18 20:29:40 +00:00
|
|
|
GIMP_PARAM_READABLE));
|
2001-04-22 00:38:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-11 20:26:12 +00:00
|
|
|
gimp_menu_dock_init (GimpMenuDock *dock)
|
2001-04-22 00:38:56 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2002-03-18 19:34:06 +00:00
|
|
|
static void
|
2011-01-09 20:38:01 +01:00
|
|
|
gimp_menu_dock_style_updated (GtkWidget *widget)
|
2002-03-18 19:34:06 +00:00
|
|
|
{
|
2009-12-05 21:20:18 +01:00
|
|
|
gint minimal_width = -1;
|
2005-05-11 20:26:12 +00:00
|
|
|
|
2011-01-09 20:38:01 +01:00
|
|
|
GTK_WIDGET_CLASS (parent_class)->style_updated (widget);
|
2002-03-18 19:34:06 +00:00
|
|
|
|
|
|
|
gtk_widget_style_get (widget,
|
2009-12-05 21:20:18 +01:00
|
|
|
"minimal-width", &minimal_width,
|
2005-01-31 16:09:52 +00:00
|
|
|
NULL);
|
2002-03-18 19:34:06 +00:00
|
|
|
|
|
|
|
gtk_widget_set_size_request (widget, minimal_width, -1);
|
2003-10-10 21:24:12 +00:00
|
|
|
}
|
|
|
|
|
2001-04-22 00:38:56 +00:00
|
|
|
GtkWidget *
|
2009-12-05 21:20:18 +01:00
|
|
|
gimp_menu_dock_new (void)
|
2001-04-22 00:38:56 +00:00
|
|
|
{
|
2009-12-05 21:20:18 +01:00
|
|
|
return g_object_new (GIMP_TYPE_MENU_DOCK, NULL);
|
2001-06-29 19:25:03 +00:00
|
|
|
}
|