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