Code

tpdfv-ctl: Added controller module used to manage multiple GtkTPDFV widgets.
[tpdfview.git] / src / tpdfv-ctl.h
1 /*
2  * tpdfview - src/tpdfvctl.h
3  * Copyright (C) 2011 Sebastian 'tokkee' Harl <sh@tokkee.org>
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
19  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
28 /*
29  * This module provides a controller use to manage multiple GtkTPDFV widgets.
30  */
32 #ifndef TPDFVCTL_H
33 #define TPDFVCTL_H 1
35 #include <glib-object.h>
37 #include "gtk-tpdfv.h"
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
43 #define TPDFV_TYPE_CTL (tpdfv_ctl_get_type())
44 #define TPDFV_CTL(obj) \
45         (G_TYPE_CHECK_INSTANCE_CAST((obj), TPDFV_TYPE_CTL, TPDFVCtl))
46 #define TPDFV_CTL_CLASS(obj) \
47         (G_TYPE_CHECK_CLASS_CAST((obj), TPDFV_TYPE_CTL, TPDFVCtlClass))
48 #define TPDFV_IS_CTL(obj) \
49         (G_TYPE_CHECK_INSTANCE_TYPE((obj), TPDFV_TYPE_CTL))
50 #define TPDFV_IS_CTL_CLASS(obj) \
51         (G_TYPE_CHECK_CLASS_TYPE((obj), TPDFV_TYPE_CTL))
52 #define TPDFV_CTL_GET_CLASS(obj) \
53         (G_TYPE_INSTANCE_GET_CLASS((obj), TPDFV_TYPE_CTL, TPDFVCtlClass))
55 GType
56 tpdfv_ctl_get_type(void);
58 typedef struct {
59         GObject parent_instance;
60 } TPDFVCtl;
62 typedef struct {
63         GObjectClass parent_class;
64 } TPDFVCtlClass;
66 /*
67  * tpdfv_ctl_new:
68  * Creates a new TPDFVCtl object using the specified main GtkTPDFV widget.
69  */
70 GObject *
71 tpdfv_ctl_new(GtkTPDFV *main);
73 /*
74  * tpdfv_ctl_add_slave:
75  * Add a new slave to the controller.
76  *
77  * 'factor' and 'offset' determine how the current page of the slave relate to
78  * the master.
79  *
80  * Returns FALSE if adding the slave failed.
81  */
82 gboolean
83 tpdfv_ctl_add_slave(GObject *obj, GtkTPDFV *slave,
84                 gint factor, gint offset);
86 /*
87  * tpdfv_ctl_reload:
88  * Reload all PDF files.
89  */
90 void
91 tpdfv_ctl_reload(GObject *obj);
93 /*
94  * tpdfv_ctl_page_up, tpdfv_ctl_page_down,
95  * tpdfv_ctl_first_page, tpdfv_ctl_last_page,
96  * tpdfv_ctl_goto_page:
97  * Navigation.
98  */
99 void
100 tpdfv_ctl_page_up(GObject *obj);
101 void
102 tpdfv_ctl_page_down(GObject *obj);
103 void
104 tpdfv_ctl_first_page(GObject *obj);
105 void
106 tpdfv_ctl_last_page(GObject *obj);
107 void
108 tpdfv_ctl_goto_page(GObject *obj, gint page);
110 /*
111  * tpdfv_ctl_zoom_in, tpdfv_ctl_zoom_out,
112  * tpdfv_ctl_zoom_1:
113  * Zooming.
114  */
115 void
116 tpdfv_ctl_zoom_in(GObject *obj);
117 void
118 tpdfv_ctl_zoom_out(GObject *obj);
119 void
120 tpdfv_ctl_zoom_1(GObject *obj);
121 void
122 tpdfv_ctl_zoom_width(GObject *obj);
123 void
124 tpdfv_ctl_zoom_height(GObject *obj);
125 void
126 tpdfv_ctl_zoom_fit(GObject *obj);
128 /*
129  * tpdfv_ctl_scroll_up, tpdfv_ctl_scroll_down,
130  * tpdfv_ctl_scroll_left, tpdfv_ctl_scroll_right:
131  * Scrolling.
132  */
133 void
134 tpdfv_ctl_scroll_up(GObject *obj);
135 void
136 tpdfv_ctl_scroll_down(GObject *obj);
137 void
138 tpdfv_ctl_scroll_left(GObject *obj);
139 void
140 tpdfv_ctl_scroll_right(GObject *obj);
142 #ifdef __cplusplus
143 } /* extern "C" */
144 #endif
146 #endif /* ! TPDFVCTL_H */
148 /* vim: set tw=78 sw=4 ts=4 noexpandtab : */