daemon: improve log
[ladish.git] / gui / canvas.h
blobb1a55c78c53913ac69177e30014697a5f310aeee
1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
2 /*
3 * LADI Session Handler (ladish)
5 * Copyright (C) 2009 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 (* connect_request)(void * port1_context, void * port2_context),
52 void (* disconnect_request)(void * port1_context, void * port2_context),
53 void (* module_location_changed)(void * module_context, double x, double y),
54 canvas_handle * canvas_handle_ptr);
56 GtkWidget *
57 canvas_get_widget(
58 canvas_handle canvas);
60 void
61 canvas_destroy(
62 canvas_handle canvas);
64 void
65 canvas_clear(
66 canvas_handle canvas);
68 void
69 canvas_get_size(
70 canvas_handle canvas,
71 double * width_ptr,
72 double * height_ptr);
74 void
75 canvas_scroll_to_center(
76 canvas_handle canvas);
78 void
79 canvas_set_zoom(
80 canvas_handle canvas,
81 double pix_per_unit);
83 void
84 canvas_arrange(
85 canvas_handle canvas);
87 bool
88 canvas_create_module(
89 canvas_handle canvas,
90 const char * name,
91 double x,
92 double y,
93 bool show_title,
94 bool show_port_labels,
95 void * module_context,
96 canvas_module_handle * module_handle_ptr);
98 bool
99 canvas_destroy_module(
100 canvas_handle canvas,
101 canvas_module_handle module);
103 bool
104 canvas_create_port(
105 canvas_handle canvas,
106 canvas_module_handle module,
107 const char * name,
108 bool is_input,
109 int color,
110 void * port_context,
111 canvas_port_handle * port_handle_ptr);
113 bool
114 canvas_destroy_port(
115 canvas_handle canvas,
116 canvas_port_handle port);
119 canvas_get_port_color(
120 canvas_port_handle port);
122 bool
123 canvas_add_connection(
124 canvas_handle canvas,
125 canvas_port_handle port1,
126 canvas_port_handle port2,
127 uint32_t color);
129 bool
130 canvas_remove_connection(
131 canvas_handle canvas,
132 canvas_port_handle port1,
133 canvas_port_handle port2);
135 bool
136 canvas_enum_modules(
137 canvas_handle canvas,
138 void * callback_context,
139 bool (* callback)(void * context, canvas_module_handle module));
141 bool
142 canvas_enum_module_ports(
143 canvas_handle canvas,
144 canvas_module_handle module,
145 void * callback_context,
146 bool (* callback)(void * context, canvas_port_handle port));
148 #if 0
149 { /* Adjust editor indent */
150 #endif
151 #ifdef __cplusplus
152 } /* extern "C" */
153 #endif
155 #endif /* #ifndef CANVAS_H__BE110B39_CB54_47C2_A5B2_FFB3BA7CDA6D__INCLUDED */