Source code of the application. More...
#include <glib.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include <librsvg/rsvg.h>
#include <stdio.h>
#include <stdlib.h>
#include "application-data.h"
#include "constants.h"
#include "frame-common.h"
#include "frame-actions.h"
#include "frame-new-dialog.h"
#include "frame-open-panel.h"
#include "frame-saving.h"
#include "frame-table.h"
#include "log-player.h"
#include "notebook.h"
Go to the source code of this file.
Functions | |
int | main (int argc, char *argv[]) |
The main function. |
Source code of the application.
This file contains the source of the whole application. It should not be modified unless you know what you do.
Definition in file main.c.
int main | ( | int | argc, | |
char * | argv[] | |||
) |
The main function.
This is the main function. You should use it only to create and initialise frames for testing purpose.
[in] | argc | the number of command line arguments |
[in] | argv | an array containing the arguments |
Definition at line 57 of file main.c.
00058 { 00059 synema_instance_t *inst = NULL; 00060 GtkWidget *window = NULL; 00061 GtkWidget *add_tab_button = NULL; 00062 GtkWidget *frame_box = NULL; 00063 00064 g_thread_init (NULL); 00065 gdk_threads_init(); 00066 gdk_threads_enter (); 00067 gtk_init (&argc, &argv); 00068 rsvg_init (); 00069 dbus_g_thread_init (); 00070 g_set_application_name (APP_NAME); 00071 inst = synema_instance (); 00072 00073 00074 // The window used by frame developers 00075 window = (GtkWidget *) gtk_builder_get_object (inst->builder, "synema_window"); 00076 g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (pre_quit_save_frames), NULL); 00077 00078 00079 // Connecting toolbar buttons to handlers 00080 g_signal_connect ((GtkWidget *) gtk_builder_get_object (inst->builder, "toolbutton_add"), 00081 "clicked", G_CALLBACK (frame_on_new), 00082 (gpointer) inst->builder); 00083 g_signal_connect ((GtkWidget *) gtk_builder_get_object (inst->builder, "toolbutton_player"), 00084 "clicked", G_CALLBACK (toggle_panels), GINT_TO_POINTER (PANEL_PLAYER)); 00085 g_signal_connect ((GtkWidget *) gtk_builder_get_object (inst->builder, "toolbutton_open_tab"), 00086 "clicked", G_CALLBACK (toggle_panels), GINT_TO_POINTER (PANEL_OPEN)); 00087 g_signal_connect ((GtkWidget *) gtk_builder_get_object (inst->builder, "toolbutton_actions"), 00088 "clicked", G_CALLBACK (toggle_panels), GINT_TO_POINTER (PANEL_ACTIONS)); 00089 g_signal_connect ((GtkWidget *) gtk_builder_get_object (inst->builder, "toolbutton_save_tab"), 00090 "clicked", G_CALLBACK (save_frames_dialog_show), NULL); 00091 g_signal_connect ((GtkWidget *) gtk_builder_get_object (inst->builder, "toolbutton_quit"), 00092 "clicked", G_CALLBACK (pre_quit_save_frames), NULL); 00093 00094 00095 // We put the widgets in their respective containers and connect signals to handlers 00096 add_tab_button = (GtkWidget *) gtk_builder_get_object (inst->builder, "toolbutton_add_tab"); 00097 frame_box = (GtkWidget *) gtk_builder_get_object (inst->builder, "notebook"); 00098 g_signal_connect (frame_box, "page_added", G_CALLBACK (notebook_on_page_added), NULL); 00099 g_signal_connect (frame_box, "page_removed", G_CALLBACK (notebook_on_page_removed), NULL); 00100 g_signal_connect (frame_box, "switch_page", G_CALLBACK (notebook_on_page_switch), NULL); 00101 g_signal_connect (add_tab_button, "clicked", G_CALLBACK (notebook_add_page), frame_box); 00102 g_signal_connect ((GtkWidget *) gtk_builder_get_object (inst->builder, "toolbutton_settings"), "clicked", G_CALLBACK (settings_dialog_show), NULL); 00103 00104 00105 // Load previously saved frames tables and frames 00106 if (inst->settings->autosave_frames) 00107 post_init_restore_frames (); 00108 00109 // If nothing was loaded, put an empty frames table 00110 if (gtk_notebook_get_n_pages (GTK_NOTEBOOK (frame_box)) == 0) 00111 _notebook_add_page (frame_box, NULL); 00112 00113 00114 // Make sure all widgets are shown 00115 gtk_window_maximize (GTK_WINDOW (window)); 00116 gtk_widget_show_all (window); 00117 00118 00119 // Hide the side panel and setup the panels' widgets 00120 frame_action_setup_widgets (); 00121 frame_open_setup_widgets (); 00122 player_setup_widgets (); 00123 toggle_panels (GTK_TOOL_BUTTON ((GtkWidget *) gtk_builder_get_object (inst->builder, "toolbutton_player")), GINT_TO_POINTER (PANEL_NONE)); 00124 00125 gtk_main (); 00126 00127 synema_instance_free (); 00128 rsvg_term (); 00129 gdk_threads_leave (); 00130 00131 return EXIT_SUCCESS; 00132 }