1.1 --- a/maemo-ui/src/mmyth_main.c Fri Feb 23 23:19:27 2007 +0000
1.2 +++ b/maemo-ui/src/mmyth_main.c Thu Jun 14 20:40:47 2007 +0100
1.3 @@ -17,85 +17,106 @@
1.4 #include "mmyth_tvplayer.h"
1.5
1.6 static void
1.7 -cb_destroy (GtkWidget * widget, gpointer data)
1.8 +cb_destroy(GtkWidget * widget, gpointer data)
1.9 {
1.10 - MMythUi *mmyth_ui = (MMythUi *) data;
1.11 + MMythUi *mmyth_ui = (MMythUi *) data;
1.12
1.13 if (mmyth_ui->tvplayer != NULL) {
1.14 - if (mmyth_tvplayer_is_playing (mmyth_ui->tvplayer) )
1.15 - mmyth_tvplayer_stop_playing (mmyth_ui->tvplayer);
1.16 + if (mmyth_tvplayer_is_playing(mmyth_ui->tvplayer))
1.17 + mmyth_tvplayer_stop_playing(mmyth_ui->tvplayer);
1.18 }
1.19
1.20 - mmyth_ui_finalize (mmyth_ui);
1.21 -
1.22 - gtk_main_quit ();
1.23 + mmyth_ui_finalize(mmyth_ui);
1.24 +
1.25 + gtk_main_quit();
1.26 }
1.27
1.28 #ifdef NDEBUG
1.29 static void
1.30 -debug_error_func( const gchar*log_domain, GLogLevelFlags log_level, const gchar *message,
1.31 - gpointer user_data )
1.32 -
1.33 +debug_error_func(const gchar * log_domain, GLogLevelFlags log_level,
1.34 + const gchar * message, gpointer user_data)
1.35 {
1.36 - /* leave this with NO print out messages, once you need to disable debug messages! */
1.37 - //g_print ( "[%s] DEBUG messages disabled!\n", __FUNCTION__ );
1.38 + /*
1.39 + * leave this with NO print out messages, once you need to disable
1.40 + * debug messages!
1.41 + */
1.42 + // g_print ( "[%s] DEBUG messages disabled!\n", __FUNCTION__ );
1.43 }
1.44 #endif
1.45
1.46 gint
1.47 -main (gint argc, gchar * argv[])
1.48 +main(gint argc, gchar * argv[])
1.49 {
1.50 - GtkWidget *window;
1.51 - MMythUi *mmyth_ui;
1.52 + GtkWidget *window;
1.53 + MMythUi *mmyth_ui;
1.54 #ifdef MAEMO_PLATFORM
1.55 - HildonProgram *program = NULL;
1.56 + HildonProgram *program = NULL;
1.57 #endif
1.58
1.59 - /* init threads */
1.60 - g_thread_init (NULL);
1.61 + /*
1.62 + * init threads
1.63 + */
1.64 + g_thread_init(NULL);
1.65
1.66 - /* Initializes GTK */
1.67 - gtk_init (&argc, &argv);
1.68 - gst_init (&argc, &argv);
1.69 + /*
1.70 + * Initializes GTK
1.71 + */
1.72 + gtk_init(&argc, &argv);
1.73 + gst_init(&argc, &argv);
1.74 #ifdef NDEBUG
1.75 - g_log_set_default_handler( debug_error_func, NULL );
1.76 + g_log_set_default_handler(debug_error_func, NULL);
1.77 #endif
1.78
1.79 - /* Init libmmyth context */
1.80 - /* TODO */
1.81 + /*
1.82 + * Init libmmyth context
1.83 + */
1.84 + /*
1.85 + * TODO
1.86 + */
1.87 #ifndef MAEMO_PLATFORM
1.88 - /* create the main window */
1.89 - window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
1.90 - gtk_widget_set_size_request (window, MAIN_WINDOW_WIDTH, MAIN_WINDOW_HEIGHT);
1.91 - gtk_window_set_title (GTK_WINDOW (window), "Mythtv Frontend");
1.92 + /*
1.93 + * create the main window
1.94 + */
1.95 + window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
1.96 + gtk_widget_set_size_request(window, MAIN_WINDOW_WIDTH,
1.97 + MAIN_WINDOW_HEIGHT);
1.98 + gtk_window_set_title(GTK_WINDOW(window), "Mythtv Frontend");
1.99 #else
1.100 - /* Creating Hildonized main view */
1.101 + /*
1.102 + * Creating Hildonized main view
1.103 + */
1.104 program = HILDON_PROGRAM(hildon_program_get_instance());
1.105 window = hildon_window_new();
1.106
1.107 - //g_signal_connect(G_OBJECT(window), "delete_event", gtk_main_quit, NULL);
1.108 + // g_signal_connect(G_OBJECT(window), "delete_event", gtk_main_quit,
1.109 + // NULL);
1.110
1.111 - hildon_program_add_window(program, HILDON_WINDOW (window));
1.112 - g_set_application_name("Maemo Mythtv");
1.113 + hildon_program_add_window(program, HILDON_WINDOW(window));
1.114 + g_set_application_name("Maemo Mythtv");
1.115 #endif
1.116 -
1.117 - /* Initializes MMyth Widgets */
1.118 +
1.119 + /*
1.120 + * Initializes MMyth Widgets
1.121 + */
1.122 #ifdef MAEMO_PLATFORM
1.123 - mmyth_ui = mmyth_ui_initialize (program, window);
1.124 -#else
1.125 - mmyth_ui = mmyth_ui_initialize (window);
1.126 + mmyth_ui = mmyth_ui_initialize(program, window);
1.127 +#else
1.128 + mmyth_ui = mmyth_ui_initialize(window);
1.129 #endif
1.130 -
1.131 - //mmyth_ui->loop = g_main_loop_new (NULL, FALSE);
1.132
1.133 - /* Connect destroy signal handling */
1.134 - g_signal_connect (window, "destroy", G_CALLBACK (cb_destroy), mmyth_ui);
1.135 + // mmyth_ui->loop = g_main_loop_new (NULL, FALSE);
1.136
1.137 - /* Shows main window and start gtk loop */
1.138 - gtk_widget_show (window);
1.139 + /*
1.140 + * Connect destroy signal handling
1.141 + */
1.142 + g_signal_connect(window, "destroy", G_CALLBACK(cb_destroy), mmyth_ui);
1.143
1.144 - gtk_main ();
1.145 + /*
1.146 + * Shows main window and start gtk loop
1.147 + */
1.148 + gtk_widget_show(window);
1.149 +
1.150 + gtk_main();
1.151
1.152 return 0;
1.153 }
1.154 -