1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
3 * LADI Session Handler (ladish)
5 * Copyright (C) 2008, 2009, 2010 Nedko Arnaudov <nedko@arnaudov.name>
7 **************************************************************************
8 * This file contains the code that implements main() and other top-level 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.
29 #include "gtk_builder.h"
31 #include "../proxies/control_proxy.h"
32 #include "world_tree.h"
33 #include "graph_view.h"
34 #include "../common/catdup.h"
35 #include "../proxies/studio_proxy.h"
36 #include "../proxies/conf_proxy.h"
37 #include "create_room_dialog.h"
40 #include "statusbar.h"
44 #include "../daemon/conf.h"
47 GtkWidget
* g_main_win
;
50 set_main_window_title(
51 graph_view_handle view
)
57 title
= catdup(get_view_name(view
), " - LADI Session Handler");
58 gtk_window_set_title(GTK_WINDOW(g_main_win
), title
);
63 gtk_window_set_title(GTK_WINDOW(g_main_win
), "LADI Session Handler");
71 log_info("arrange request");
73 canvas
= get_current_canvas();
76 canvas_arrange(canvas
);
80 int main(int argc
, char** argv
)
82 gtk_init(&argc
, &argv
);
86 if (!conf_proxy_init())
93 log_error("Canvas initialization failed.");
97 if (!init_gtk_builder())
102 g_main_win
= get_gtk_builder_widget("main_win");
106 if (!create_studio_lists())
114 create_room_dialog_init();
119 init_actions_and_accelerators();
133 if (!conf_register(LADISH_CONF_KEY_DAEMON_NOTIFY
, NULL
, NULL
))
138 if (!conf_register(LADISH_CONF_KEY_DAEMON_SHELL
, NULL
, NULL
))
143 if (!conf_register(LADISH_CONF_KEY_DAEMON_TERMINAL
, NULL
, NULL
))
148 if (!conf_register(LADISH_CONF_KEY_DAEMON_STUDIO_AUTOSTART
, NULL
, NULL
))
158 if (!control_proxy_init())
163 if (!studio_proxy_init())
168 set_studio_callbacks();
169 set_room_callbacks();
171 g_signal_connect(G_OBJECT(g_main_win
), "destroy", G_CALLBACK(gtk_main_quit
), NULL
);
172 g_signal_connect(G_OBJECT(get_gtk_builder_widget("menu_item_quit")), "activate", G_CALLBACK(gtk_main_quit
), NULL
);
173 g_signal_connect(G_OBJECT(get_gtk_builder_widget("menu_item_view_arrange")), "activate", G_CALLBACK(arrange
), NULL
);
174 g_signal_connect(G_OBJECT(get_gtk_builder_widget("menu_item_help_about")), "activate", G_CALLBACK(show_about
), NULL
);
176 gtk_widget_show(g_main_win
);
180 studio_proxy_uninit();
181 control_proxy_uninit();
184 create_room_dialog_uninit();
185 destroy_studio_lists();
186 uninit_gtk_builder();