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 "../proxies/a2j_proxy.h"
33 #include "world_tree.h"
34 #include "graph_view.h"
35 #include "../common/catdup.h"
36 #include "../proxies/studio_proxy.h"
37 #include "../proxies/conf_proxy.h"
38 #include "create_room_dialog.h"
41 #include "statusbar.h"
45 #include "../daemon/conf.h"
48 #define GETTEXT_PACKAGE "ladish"
52 GtkWidget
* g_main_win
;
55 set_main_window_title(
56 graph_view_handle view
)
62 title
= catdup3(get_view_name(view
), " - ", _("LADI Session Handler"));
63 gtk_window_set_title(GTK_WINDOW(g_main_win
), title
);
68 gtk_window_set_title(GTK_WINDOW(g_main_win
), _("LADI Session Handler"));
76 log_info("arrange request");
78 canvas
= get_current_canvas();
81 canvas_arrange(canvas
);
85 int main(int argc
, char** argv
)
88 bindtextdomain (GETTEXT_PACKAGE
, LOCALE_DIR
);
89 bind_textdomain_codeset (GETTEXT_PACKAGE
, "UTF-8");
90 textdomain (GETTEXT_PACKAGE
);
93 gtk_init(&argc
, &argv
);
97 if (!conf_proxy_init())
104 log_error("Canvas initialization failed.");
108 if (!init_gtk_builder())
113 g_main_win
= get_gtk_builder_widget("main_win");
117 if (!create_studio_lists())
125 create_room_dialog_init();
130 init_actions_and_accelerators();
144 if (!conf_register(LADISH_CONF_KEY_DAEMON_NOTIFY
, NULL
, NULL
))
149 if (!conf_register(LADISH_CONF_KEY_DAEMON_SHELL
, NULL
, NULL
))
154 if (!conf_register(LADISH_CONF_KEY_DAEMON_TERMINAL
, NULL
, NULL
))
159 if (!conf_register(LADISH_CONF_KEY_DAEMON_STUDIO_AUTOSTART
, NULL
, NULL
))
169 if (!a2j_proxy_init())
174 if (!control_proxy_init())
179 if (!studio_proxy_init())
184 set_studio_callbacks();
185 set_room_callbacks();
187 g_signal_connect(G_OBJECT(g_main_win
), "destroy", G_CALLBACK(gtk_main_quit
), NULL
);
188 g_signal_connect(G_OBJECT(get_gtk_builder_widget("menu_item_quit")), "activate", G_CALLBACK(gtk_main_quit
), NULL
);
189 g_signal_connect(G_OBJECT(get_gtk_builder_widget("menu_item_view_arrange")), "activate", G_CALLBACK(arrange
), NULL
);
190 g_signal_connect(G_OBJECT(get_gtk_builder_widget("menu_item_help_about")), "activate", G_CALLBACK(show_about
), NULL
);
192 gtk_widget_show(g_main_win
);
196 studio_proxy_uninit();
197 control_proxy_uninit();
201 create_room_dialog_uninit();
202 destroy_studio_lists();
203 uninit_gtk_builder();