Move dbus constants to separate header
[ladish.git] / gui / canvas.h
blob3d130cd82f88ef41a110757b887fa628ef435030
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 <gtk/gtk.h>
31 #include "common.h"
33 typedef struct canvas_tag { int unused; } * canvas_handle;
34 typedef struct canvas_module_tag { int unused; } * canvas_module_handle;
35 typedef struct canvas_port_tag { int unused; } * canvas_port_handle;
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 #if 0
41 } /* Adjust editor indent */
42 #endif
44 bool
45 canvas_init(
46 void);
48 bool
49 canvas_create(
50 double width,
51 double height,
52 void (* connect_request)(void * port1_context, void * port2_context),
53 void (* disconnect_request)(void * port1_context, void * port2_context),
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_set_zoom(
70 canvas_handle canvas,
71 double pix_per_unit);
73 void
74 canvas_arrange(
75 canvas_handle canvas);
77 bool
78 canvas_create_module(
79 canvas_handle canvas,
80 const char * name,
81 double x,
82 double y,
83 bool show_title,
84 bool show_port_labels,
85 canvas_module_handle * module_handle_ptr);
87 bool
88 canvas_destroy_module(
89 canvas_handle canvas,
90 canvas_module_handle module);
92 bool
93 canvas_create_port(
94 canvas_handle canvas,
95 canvas_module_handle module,
96 const char * name,
97 bool is_input,
98 int color,
99 void * port_context,
100 canvas_port_handle * port_handle_ptr);
102 bool
103 canvas_destroy_port(
104 canvas_handle canvas,
105 canvas_port_handle port);
108 canvas_get_port_color(
109 canvas_port_handle port);
111 bool
112 canvas_add_connection(
113 canvas_handle canvas,
114 canvas_port_handle port1,
115 canvas_port_handle port2,
116 uint32_t color);
118 bool
119 canvas_remove_connection(
120 canvas_handle canvas,
121 canvas_port_handle port1,
122 canvas_port_handle port2);
124 bool
125 canvas_enum_modules(
126 canvas_handle canvas,
127 void * callback_context,
128 bool (* callback)(void * context, canvas_module_handle module));
130 bool
131 canvas_enum_module_ports(
132 canvas_handle canvas,
133 canvas_module_handle module,
134 void * callback_context,
135 bool (* callback)(void * context, canvas_port_handle port));
137 #if 0
138 { /* Adjust editor indent */
139 #endif
140 #ifdef __cplusplus
141 } /* extern "C" */
142 #endif
144 #endif /* #ifndef CANVAS_H__BE110B39_CB54_47C2_A5B2_FFB3BA7CDA6D__INCLUDED */