Fix unused-parameter warnings in plain C code
[ladish.git] / gui / canvas.h
blob3a4d81cb67763cf8311e5802eba9dfc74401f871
1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
2 /*
3 * LADI Session Handler (ladish)
5 * Copyright (C) 2009, 2010, 2011 Nedko Arnaudov <nedko@arnaudov.name>
7 **************************************************************************
8 * This file contains the interface to the canvas functionality
9 **************************************************************************
11 * LADI Session Handler is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * LADI Session Handler is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with LADI Session Handler. If not, see <http://www.gnu.org/licenses/>
23 * or write to the Free Software Foundation, Inc.,
24 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
27 #ifndef CANVAS_H__BE110B39_CB54_47C2_A5B2_FFB3BA7CDA6D__INCLUDED
28 #define CANVAS_H__BE110B39_CB54_47C2_A5B2_FFB3BA7CDA6D__INCLUDED
30 #include "common.h"
32 typedef struct canvas_tag { int unused; } * canvas_handle;
33 typedef struct canvas_module_tag { int unused; } * canvas_module_handle;
34 typedef struct canvas_port_tag { int unused; } * canvas_port_handle;
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 #if 0
40 } /* Adjust editor indent */
41 #endif
43 bool
44 canvas_init(
45 void);
47 bool
48 canvas_create(
49 double width,
50 double height,
51 void * canvas_context,
52 void (* connect_request)(void * port1_context, void * port2_context),
53 void (* disconnect_request)(void * port1_context, void * port2_context),
54 void (* module_location_changed)(void * module_context, double x, double y),
55 void (* fill_canvas_menu)(GtkMenu * menu, void * canvas_context),
56 void (* fill_module_menu)(GtkMenu * menu, void * module_context),
57 void (* fill_port_menu)(GtkMenu * menu, void * port_context),
58 canvas_handle * canvas_handle_ptr);
60 GtkWidget *
61 canvas_get_widget(
62 canvas_handle canvas);
64 void
65 canvas_destroy(
66 canvas_handle canvas);
68 void
69 canvas_clear(
70 canvas_handle canvas);
72 void
73 canvas_get_size(
74 canvas_handle canvas,
75 double * width_ptr,
76 double * height_ptr);
78 void
79 canvas_scroll_to_center(
80 canvas_handle canvas);
82 double
83 canvas_get_zoom(
84 canvas_handle canvas);
86 void
87 canvas_set_zoom(
88 canvas_handle canvas,
89 double pix_per_unit);
91 void
92 canvas_set_zoom_fit(
93 canvas_handle canvas);
95 void
96 canvas_arrange(
97 canvas_handle canvas);
99 size_t
100 canvas_get_selected_modules_count(
101 canvas_handle canvas);
103 bool
104 canvas_get_one_selected_module(
105 canvas_handle canvas,
106 void ** module_context_ptr);
108 bool
109 canvas_get_two_selected_modules(
110 canvas_handle canvas,
111 void ** module1_context_ptr,
112 void ** module2_context_ptr);
114 bool
115 canvas_create_module(
116 canvas_handle canvas,
117 const char * name,
118 double x,
119 double y,
120 bool show_title,
121 bool show_port_labels,
122 void * module_context,
123 canvas_module_handle * module_handle_ptr);
125 bool
126 canvas_destroy_module(
127 canvas_handle canvas,
128 canvas_module_handle module);
130 void
131 canvas_set_module_name(
132 canvas_module_handle module,
133 const char * name);
135 const char *
136 canvas_get_module_name(
137 canvas_module_handle module);
139 bool
140 canvas_create_port(
141 canvas_handle canvas,
142 canvas_module_handle module,
143 const char * name,
144 bool is_input,
145 int color,
146 void * port_context,
147 canvas_port_handle * port_handle_ptr);
149 bool
150 canvas_destroy_port(
151 canvas_handle canvas,
152 canvas_port_handle port);
155 canvas_get_port_color(
156 canvas_port_handle port);
158 void
159 canvas_set_port_name(
160 canvas_port_handle port,
161 const char * name);
163 const char *
164 canvas_get_port_name(
165 canvas_port_handle port);
167 bool
168 canvas_add_connection(
169 canvas_handle canvas,
170 canvas_port_handle port1,
171 canvas_port_handle port2,
172 uint32_t color);
174 bool
175 canvas_remove_connection(
176 canvas_handle canvas,
177 canvas_port_handle port1,
178 canvas_port_handle port2);
180 bool
181 canvas_enum_modules(
182 canvas_handle canvas,
183 void * callback_context,
184 bool (* callback)(void * context, canvas_module_handle module));
186 bool
187 canvas_enum_module_ports(
188 canvas_handle canvas,
189 canvas_module_handle module,
190 void * callback_context,
191 bool (* callback)(void * context, canvas_port_handle port));
193 #if 0
194 { /* Adjust editor indent */
195 #endif
196 #ifdef __cplusplus
197 } /* extern "C" */
198 #endif
200 #endif /* #ifndef CANVAS_H__BE110B39_CB54_47C2_A5B2_FFB3BA7CDA6D__INCLUDED */