1 /* LIBGIMP - The GIMP Library
2  * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
3  *
4  * gimpscrolledpreview.h
5  *
6  * This library is free software: you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 3 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library.  If not, see
18  * <https://www.gnu.org/licenses/>.
19  */
20 
21 #if !defined (__GIMP_WIDGETS_H_INSIDE__) && !defined (GIMP_WIDGETS_COMPILATION)
22 #error "Only <libgimpwidgets/gimpwidgets.h> can be included directly."
23 #endif
24 
25 #ifndef __GIMP_SCROLLED_PREVIEW_H__
26 #define __GIMP_SCROLLED_PREVIEW_H__
27 
28 #include "gimppreview.h"
29 
30 G_BEGIN_DECLS
31 
32 
33 /* For information look into the C source or the html documentation */
34 
35 
36 #define GIMP_TYPE_SCROLLED_PREVIEW            (gimp_scrolled_preview_get_type ())
37 #define GIMP_SCROLLED_PREVIEW(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_SCROLLED_PREVIEW, GimpScrolledPreview))
38 #define GIMP_SCROLLED_PREVIEW_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_SCROLLED_PREVIEW, GimpScrolledPreviewClass))
39 #define GIMP_IS_SCROLLED_PREVIEW(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_SCROLLED_PREVIEW))
40 #define GIMP_IS_SCROLLED_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_SCROLLED_PREVIEW))
41 #define GIMP_SCROLLED_PREVIEW_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_SCROLLED_PREVIEW, GimpScrolledPreviewClass))
42 
43 
44 typedef struct _GimpScrolledPreviewClass  GimpScrolledPreviewClass;
45 
46 struct _GimpScrolledPreview
47 {
48   GimpPreview   parent_instance;
49 
50   /*< protected >*/
51   GtkWidget    *hscr;
52   GtkWidget    *vscr;
53   GtkWidget    *nav_icon;
54   GtkWidget    *nav_popup;
55   GdkCursor    *cursor_move;
56   gpointer      nav_gc; /* unused */
57 
58   /*< private >*/
59   gpointer      priv;
60 };
61 
62 struct _GimpScrolledPreviewClass
63 {
64   GimpPreviewClass  parent_class;
65 
66   /* Padding for future expansion */
67   void (* _gimp_reserved1) (void);
68   void (* _gimp_reserved2) (void);
69   void (* _gimp_reserved3) (void);
70   void (* _gimp_reserved4) (void);
71 };
72 
73 
74 GType  gimp_scrolled_preview_get_type  (void) G_GNUC_CONST;
75 
76 void   gimp_scrolled_preview_set_position (GimpScrolledPreview *preview,
77                                            gint                 x,
78                                            gint                 y);
79 void   gimp_scrolled_preview_set_policy   (GimpScrolledPreview *preview,
80                                            GtkPolicyType        hscrollbar_policy,
81                                            GtkPolicyType        vscrollbar_policy);
82 
83 /*  only for use from derived widgets  */
84 void   gimp_scrolled_preview_freeze       (GimpScrolledPreview *preview);
85 void   gimp_scrolled_preview_thaw         (GimpScrolledPreview *preview);
86 
87 
88 G_END_DECLS
89 
90 #endif /* __GIMP_SCROLLED_PREVIEW_H__ */
91