1
/* GIMP - The GNU Image Manipulation Program
2
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
4
* gimpdynamicsfactoryview.c
5
* Copyright (C) 2001 Michael Natterer <mitch@gimp.org>
7
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 3 of the License, or
10
* (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <http://www.gnu.org/licenses/>.
25
#include "libgimpwidgets/gimpwidgets.h"
27
#include "widgets-types.h"
29
#include "core/gimpcontext.h"
30
#include "core/gimpdatafactory.h"
32
#include "gimpdynamicsfactoryview.h"
33
#include "gimpmenufactory.h"
34
#include "gimpviewrenderer.h"
37
G_DEFINE_TYPE (GimpDynamicsFactoryView, gimp_dynamics_factory_view,
38
GIMP_TYPE_DATA_FACTORY_VIEW)
42
gimp_dynamics_factory_view_class_init (GimpDynamicsFactoryViewClass *klass)
47
gimp_dynamics_factory_view_init (GimpDynamicsFactoryView *view)
52
gimp_dynamics_factory_view_new (GimpViewType view_type,
53
GimpDataFactory *factory,
56
gint view_border_width,
57
GimpMenuFactory *menu_factory)
59
g_return_val_if_fail (GIMP_IS_DATA_FACTORY (factory), NULL);
60
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
61
g_return_val_if_fail (view_size > 0 &&
62
view_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, NULL);
63
g_return_val_if_fail (view_border_width >= 0 &&
64
view_border_width <= GIMP_VIEW_MAX_BORDER_WIDTH,
66
g_return_val_if_fail (menu_factory == NULL ||
67
GIMP_IS_MENU_FACTORY (menu_factory), NULL);
69
return g_object_new (GIMP_TYPE_DYNAMICS_FACTORY_VIEW,
70
"view-type", view_type,
71
"data-factory", factory,
73
"view-size", view_size,
74
"view-border-width", view_border_width,
75
"menu-factory", menu_factory,
76
"menu-identifier", "<Dynamics>",
77
"ui-path", "/dynamics-popup",
78
"action-group", "dynamics",