~ubuntu-branches/ubuntu/vivid/gimp/vivid

« back to all changes in this revision

Viewing changes to app/widgets/gimpdynamicsfactoryview.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach
  • Date: 2012-05-08 18:50:03 UTC
  • mto: (1.1.26) (0.5.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 71.
  • Revision ID: package-import@ubuntu.com-20120508185003-tltkvbaysf8d2426
ImportĀ upstreamĀ versionĀ 2.8.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* GIMP - The GNU Image Manipulation Program
 
2
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 
3
 *
 
4
 * gimpdynamicsfactoryview.c
 
5
 * Copyright (C) 2001 Michael Natterer <mitch@gimp.org>
 
6
 *
 
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.
 
11
 *
 
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.
 
16
 *
 
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/>.
 
19
 */
 
20
 
 
21
#include "config.h"
 
22
 
 
23
#include <gtk/gtk.h>
 
24
 
 
25
#include "libgimpwidgets/gimpwidgets.h"
 
26
 
 
27
#include "widgets-types.h"
 
28
 
 
29
#include "core/gimpcontext.h"
 
30
#include "core/gimpdatafactory.h"
 
31
 
 
32
#include "gimpdynamicsfactoryview.h"
 
33
#include "gimpmenufactory.h"
 
34
#include "gimpviewrenderer.h"
 
35
 
 
36
 
 
37
G_DEFINE_TYPE (GimpDynamicsFactoryView, gimp_dynamics_factory_view,
 
38
               GIMP_TYPE_DATA_FACTORY_VIEW)
 
39
 
 
40
 
 
41
static void
 
42
gimp_dynamics_factory_view_class_init (GimpDynamicsFactoryViewClass *klass)
 
43
{
 
44
}
 
45
 
 
46
static void
 
47
gimp_dynamics_factory_view_init (GimpDynamicsFactoryView *view)
 
48
{
 
49
}
 
50
 
 
51
GtkWidget *
 
52
gimp_dynamics_factory_view_new (GimpViewType      view_type,
 
53
                                GimpDataFactory  *factory,
 
54
                                GimpContext      *context,
 
55
                                gint              view_size,
 
56
                                gint              view_border_width,
 
57
                                GimpMenuFactory  *menu_factory)
 
58
{
 
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,
 
65
                        NULL);
 
66
  g_return_val_if_fail (menu_factory == NULL ||
 
67
                        GIMP_IS_MENU_FACTORY (menu_factory), NULL);
 
68
 
 
69
  return g_object_new (GIMP_TYPE_DYNAMICS_FACTORY_VIEW,
 
70
                       "view-type",         view_type,
 
71
                       "data-factory",      factory,
 
72
                       "context",           context,
 
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",
 
79
                       NULL);
 
80
}