1.1 --- a/gmyth/AUTHORS Thu Sep 21 00:05:27 2006 +0100
1.2 +++ b/gmyth/AUTHORS Thu Sep 21 00:15:52 2006 +0100
1.3 @@ -0,0 +1,4 @@
1.4 +Alexsandro Jose Virginio dos Santos <alexsandro.santos@indt.org.br>
1.5 +Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
1.6 +Leonardo Sobral Cunha <leonardo.cunha@indt.org.br>
1.7 +Rosfran Lins Borges <rosfran.borges@indt.org.br>
2.1 --- a/gmyth/pixmaps/Makefile.am Thu Sep 21 00:05:27 2006 +0100
2.2 +++ b/gmyth/pixmaps/Makefile.am Thu Sep 21 00:15:52 2006 +0100
2.3 @@ -1,7 +1,7 @@
2.4 # Adding the application icon
2.5 -#icondir = $(datadir)/miptv/pixmaps
2.6 +#icondir = $(datadir)/mmyth/pixmaps
2.7 #icon_DATA = \
2.8 -# miptv.png
2.9 +# mmyth.png
2.10
2.11
2.12 # Adding the application resources
3.1 --- a/gmyth/src/gui/mmyth_ui.c.mine Thu Sep 21 00:05:27 2006 +0100
3.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
3.3 @@ -1,451 +0,0 @@
3.4 -
3.5 -#include <gtk/gtk.h>
3.6 -#include <gdk/gdkx.h>
3.7 -#include <gst/interfaces/xoverlay.h>
3.8 -
3.9 -#include "mmyth_ui.h"
3.10 -#include "mmyth_uicommon.h"
3.11 -/* FIXME
3.12 -#include "mmyth_videoplayer.h"
3.13 -*/
3.14 -#include "mmyth_esg_grid_view.h"
3.15 -
3.16 -static gint button_press_handler (GtkWidget *widget, GdkEvent *event);
3.17 -
3.18 -MMythUiCommon *create_main_view (MMythUi * mmyth_ui);
3.19 -MMythUiCommon *create_video_view (MMythUi * mmyth_ui);
3.20 -MMythUiCommon *create_esg_grid_view (MMythUi * mmyth_ui);
3.21 -static void cb_video_close_button (GtkButton * button, gpointer user_data);
3.22 -
3.23 -/* main box from button box separator*/
3.24 -static GtkWidget *main_vseparator = NULL;
3.25 -
3.26 -GdkPixbuf *icon_sports, *icon_news,
3.27 - *icon_movies, *icon_shows, *icon_default;
3.28 -
3.29 -/* FIXME: UGLY HACK */
3.30 -MMythUi *popup_mmyth_ui;
3.31 -
3.32 -void
3.33 -mmyth_ui_initialize_icons ()
3.34 -{
3.35 - GError *error = NULL;
3.36 -
3.37 -#ifdef MMYTH_DEVEL
3.38 - icon_sports =
3.39 - gdk_pixbuf_new_from_file ("../pixmaps/ico_sports.png", &error);
3.40 -#else
3.41 - icon_sports = gdk_pixbuf_new_from_file (PIX_DIR "ico_sports.png", &error);
3.42 -#endif
3.43 -
3.44 - if (error) {
3.45 - g_warning ("Could not load icon sports: %s\n", error->message);
3.46 - g_error_free (error);
3.47 - error = NULL;
3.48 - }
3.49 -
3.50 -#ifdef MMYTH_DEVEL
3.51 - icon_news = gdk_pixbuf_new_from_file ("../pixmaps/ico_news.png", &error);
3.52 -#else
3.53 - icon_news = gdk_pixbuf_new_from_file (PIX_DIR "ico_news.png", &error);
3.54 -#endif
3.55 -
3.56 - if (error) {
3.57 - g_warning ("Could not load icon news: %s\n", error->message);
3.58 - g_error_free (error);
3.59 - error = NULL;
3.60 - }
3.61 -
3.62 -#ifdef MMYTH_DEVEL
3.63 - icon_movies =
3.64 - gdk_pixbuf_new_from_file ("../pixmaps/ico_movies.png", &error);
3.65 -#else
3.66 - icon_movies = gdk_pixbuf_new_from_file (PIX_DIR "ico_movies.png", &error);
3.67 -#endif
3.68 - if (error) {
3.69 - g_warning ("Could not load icon movies: %s\n", error->message);
3.70 - g_error_free (error);
3.71 - error = NULL;
3.72 - }
3.73 -
3.74 -#ifdef MMYTH_DEVEL
3.75 - icon_shows = gdk_pixbuf_new_from_file ("../pixmaps/ico_shows.png", &error);
3.76 -#else
3.77 - icon_shows = gdk_pixbuf_new_from_file (PIX_DIR "ico_shows.png", &error);
3.78 -#endif
3.79 - if (error) {
3.80 - g_warning ("Could not load icon shows: %s\n", error->message);
3.81 - g_error_free (error);
3.82 - error = NULL;
3.83 - }
3.84 -
3.85 -#ifdef MMYTH_DEVEL
3.86 - icon_default =
3.87 - gdk_pixbuf_new_from_file ("../pixmaps/ico_default.png", &error);
3.88 -#else
3.89 - icon_default = gdk_pixbuf_new_from_file (PIX_DIR "ico_default.png", &error);
3.90 -#endif
3.91 -
3.92 - if (error) {
3.93 - g_warning ("Could not load icon default: %s\n", error->message);
3.94 - g_error_free (error);
3.95 - error = NULL;
3.96 - }
3.97 -
3.98 -}
3.99 -
3.100 -MMythUi *
3.101 -mmyth_ui_initialize (GtkWidget * main_window)
3.102 -{
3.103 - MMythUi *mmyth_ui;
3.104 -
3.105 - // FIXME: REMOVE ME
3.106 - //mmyth_settings_load ( );
3.107 -
3.108 - mmyth_ui = g_new0 (MMythUi, 1);
3.109 -
3.110 - mmyth_ui->main_window = main_window;
3.111 -
3.112 - /* Horizontal box that divides the view into control and video area */
3.113 - mmyth_ui->main_hbox = gtk_hbox_new (FALSE, 0);
3.114 - gtk_widget_show (mmyth_ui->main_hbox);
3.115 - g_object_ref (mmyth_ui->main_hbox);
3.116 -
3.117 - mmyth_ui_initialize_icons ();
3.118 -
3.119 - main_bg_color.red = 65000;
3.120 - main_bg_color.green = 65000;
3.121 - main_bg_color.blue = 65000;
3.122 -
3.123 - // Main widget is mmyth_ui->main_hbox
3.124 - mmyth_ui->main_uicommon = create_main_view (mmyth_ui);
3.125 - mmyth_ui->video_uicommon = create_video_view (mmyth_ui);
3.126 - mmyth_ui->esg_grid_uicommon = create_esg_grid_view (mmyth_ui);
3.127 -
3.128 - /* Popup menu */
3.129 - /* FIXME: URGENT ugly, ugly hack */
3.130 - popup_mmyth_ui = mmyth_ui;
3.131 - g_signal_connect (G_OBJECT (mmyth_ui->main_hbox), "event",
3.132 - G_CALLBACK (button_press_handler),
3.133 - G_OBJECT (mmyth_ui->main_hbox));
3.134 -
3.135 - gtk_container_add (GTK_CONTAINER (mmyth_ui->main_window),
3.136 - mmyth_ui->main_hbox);
3.137 -
3.138 - /* Add the gst video widget to hbox. It should never be removed. */
3.139 - /* FIXME: mmyth_ui->video_alignment == NULL when mmyth_player_init fails */
3.140 - if(mmyth_ui->video_alignment != NULL)
3.141 - gtk_box_pack_start (GTK_BOX (mmyth_ui->main_hbox),
3.142 - mmyth_ui->video_alignment, TRUE, TRUE, 0);
3.143 -
3.144 - mmyth_ui_set_widget (mmyth_ui, mmyth_ui->main_uicommon);
3.145 -
3.146 - return mmyth_ui;
3.147 -}
3.148 -
3.149 -void
3.150 -mmyth_ui_finalize (MMythUi * mmyth_ui)
3.151 -{
3.152 - if (mmyth_ui != NULL)
3.153 - g_free (mmyth_ui);
3.154 -
3.155 - mmyth_uicommon_unref_all (mmyth_ui->main_uicommon);
3.156 - mmyth_uicommon_unref_all (mmyth_ui->video_uicommon);
3.157 - mmyth_uicommon_unref_all (mmyth_ui->esgcurrent_uicommon);
3.158 -}
3.159 -
3.160 -void
3.161 -mmyth_ui_set_widget (MMythUi * mmyth_ui, MMythUiCommon * new_uicommon)
3.162 -{
3.163 - if (mmyth_ui->current_uicommon) {
3.164 - if (mmyth_ui->current_uicommon == mmyth_ui->video_uicommon) {
3.165 - gtk_widget_hide (mmyth_ui->current_uicommon->main_widget);
3.166 - gtk_widget_hide (mmyth_ui->videow);
3.167 - }
3.168 - else {
3.169 - gtk_container_remove (GTK_CONTAINER (mmyth_ui->main_hbox),
3.170 - mmyth_ui->current_uicommon->main_widget);
3.171 - }
3.172 -
3.173 - gtk_container_remove (GTK_CONTAINER (mmyth_ui->main_hbox),
3.174 - mmyth_ui->current_uicommon->event_box);
3.175 - gtk_container_remove (GTK_CONTAINER (mmyth_ui->main_hbox),
3.176 - main_vseparator);
3.177 -
3.178 - }
3.179 -
3.180 - if (new_uicommon->main_widget == mmyth_ui->video_alignment) {
3.181 - //gst_player_video_show (GST_PLAYER_VIDEO(mmyth_ui->videow));
3.182 - gtk_widget_show (mmyth_ui->video_alignment);
3.183 - gtk_widget_show (mmyth_ui->videow);
3.184 - }
3.185 - else {
3.186 - /* FIXME: Fst call is NULL when mmyth_player_init fails */
3.187 - if(mmyth_ui->video_alignment != NULL)
3.188 - gtk_widget_hide (mmyth_ui->video_alignment);
3.189 - /* FIXME: Fst call is NULL when mmyth_player_init fails */
3.190 - if(mmyth_ui->videow != NULL)
3.191 - gtk_widget_hide (mmyth_ui->videow);
3.192 -
3.193 - gtk_box_pack_start (GTK_BOX (mmyth_ui->main_hbox),
3.194 - new_uicommon->main_widget, TRUE, TRUE, 0);
3.195 - }
3.196 -
3.197 - if(main_vseparator == NULL) {
3.198 - /* FIXME: should free this variable*/
3.199 - main_vseparator = gtk_vseparator_new();
3.200 - g_object_ref (main_vseparator);
3.201 - }
3.202 - gtk_box_pack_start (GTK_BOX (mmyth_ui->main_hbox),
3.203 - main_vseparator, FALSE, FALSE, 0);
3.204 - gtk_widget_show (main_vseparator);
3.205 -
3.206 - gtk_box_pack_end (GTK_BOX (mmyth_ui->main_hbox), new_uicommon->event_box, FALSE,
3.207 - FALSE, 0);
3.208 -
3.209 - mmyth_ui->current_uicommon = new_uicommon;
3.210 -
3.211 -}
3.212 -
3.213 -/* The close callback is the same for all windows*/
3.214 -static void
3.215 -cb_not_impl_button (GtkButton * button, gpointer user_data)
3.216 -{
3.217 - MMythUi *mmyth_ui = (MMythUi *) user_data;
3.218 -
3.219 - GtkWidget *msg_dialog = gtk_message_dialog_new (
3.220 - GTK_WINDOW(mmyth_ui->main_window),
3.221 - GTK_DIALOG_MODAL |
3.222 - GTK_DIALOG_DESTROY_WITH_PARENT,
3.223 - GTK_MESSAGE_INFO,
3.224 - GTK_BUTTONS_OK,
3.225 - "Feature not implemented yet");
3.226 - gtk_widget_set_size_request (msg_dialog, 300, 120);
3.227 -
3.228 - gtk_dialog_run (GTK_DIALOG (msg_dialog));
3.229 -
3.230 - gtk_widget_destroy(GTK_WIDGET(msg_dialog));
3.231 -}
3.232 -
3.233 -/******************************************************************************
3.234 - * POPUP MENU WIDGET METHODS *
3.235 - *****************************************************************************/
3.236 -
3.237 -void
3.238 -detacher (GtkWidget *attach_widget,GtkMenu *menu)
3.239 -{
3.240 -}
3.241 -
3.242 -void
3.243 -menu_item_settings_cb (GtkMenuItem *menuitem,
3.244 - gpointer user_data)
3.245 -{
3.246 - /* MMythUi *mmyth_ui = (MMythUi *) user_data; */
3.247 -
3.248 - /* FIXME
3.249 - MMythUi *mmyth_ui = popup_mmyth_ui;
3.250 -
3.251 - settings_show_dialog (GTK_WINDOW (mmyth_ui->main_window));
3.252 - */
3.253 -}
3.254 -
3.255 -static void
3.256 -do_popup_menu (GtkWidget *my_widget, GdkEventButton *event)
3.257 -{
3.258 - GtkWidget *popup;
3.259 - int button, event_time;
3.260 -
3.261 - popup = gtk_menu_new ();
3.262 -
3.263 - /* ... add menu items ... */
3.264 - GtkWidget *menu_item = gtk_menu_item_new_with_label("Settings");
3.265 - gtk_menu_append(popup, menu_item);
3.266 -
3.267 - g_signal_connect (G_OBJECT(menu_item), "activate",
3.268 - G_CALLBACK (menu_item_settings_cb), NULL);
3.269 -
3.270 - if (event)
3.271 - {
3.272 - button = event->button;
3.273 - event_time = event->time;
3.274 - }
3.275 - else
3.276 - {
3.277 - button = 0;
3.278 - event_time = gtk_get_current_event_time ();
3.279 - }
3.280 -
3.281 - //gtk_menu_attach_to_widget (GTK_MENU (popup), my_widget, detacher);
3.282 - gtk_menu_popup (GTK_MENU (popup), NULL, NULL, NULL, NULL,
3.283 - button, event_time);
3.284 - gtk_widget_show_all(popup);
3.285 -}
3.286 -
3.287 -/* Respond to a button-press by posting a menu passed in as widget.
3.288 - *
3.289 - * Note that the "widget" argument is the menu being posted, NOT
3.290 - * the button that was pressed.
3.291 - */
3.292 -
3.293 -static gint
3.294 -button_press_handler (GtkWidget *widget, GdkEvent *event)
3.295 -{
3.296 -
3.297 - if (event->type == GDK_BUTTON_PRESS) {
3.298 - GdkEventButton *bevent = (GdkEventButton *) event;
3.299 - /* Ignore double-clicks and triple-clicks */
3.300 - if (bevent->button == 3)
3.301 - {
3.302 - do_popup_menu (widget, bevent);
3.303 - return TRUE;
3.304 - }
3.305 - }
3.306 -
3.307 - /* Tell calling code that we have not handled this event; pass it on. */
3.308 - return FALSE;
3.309 -}
3.310 -
3.311 -
3.312 -/******************************************************************************
3.313 - * MAIN APP VIEW METHODS *
3.314 - *****************************************************************************/
3.315 -
3.316 -/* The close callback is the same for all windows*/
3.317 -static void
3.318 -cb_close_button (GtkButton * button, gpointer user_data)
3.319 -{
3.320 - MMythUi *mmyth_ui = (MMythUi *) user_data;
3.321 -
3.322 - mmyth_ui_set_widget (mmyth_ui, mmyth_ui->main_uicommon);
3.323 -}
3.324 -
3.325 -static void
3.326 -cb_esg_today_button (GtkButton * button, gpointer user_data)
3.327 -{
3.328 - MMythUi *mmyth_ui = (MMythUi *) user_data;
3.329 -
3.330 - mmyth_ui_set_widget (mmyth_ui, mmyth_ui->esg_grid_uicommon);
3.331 -}
3.332 -
3.333 -MMythUiCommon *
3.334 -create_main_view (MMythUi * mmyth_ui)
3.335 -{
3.336 - MMythUiCommon *ui_common;
3.337 - GtkWidget *main_widget;
3.338 - GtkWidget *image;
3.339 -
3.340 - // FIXME: file path
3.341 -#ifdef MMYTH_DEV
3.342 - image = gtk_image_new_from_file ("../pixmaps/main_logo.gif");
3.343 -#else
3.344 - image = gtk_image_new_from_file ("../pixmaps/main_logo.gif");
3.345 -#endif
3.346 -
3.347 - main_widget = gtk_event_box_new();
3.348 -
3.349 - gtk_container_add (GTK_CONTAINER (main_widget),
3.350 - image);
3.351 -
3.352 -
3.353 - gtk_widget_show_all (main_widget);
3.354 - g_object_ref (main_widget);
3.355 -
3.356 - ui_common = mmyth_uicommon_new (main_widget,
3.357 - "Channels", "Current", "Today");
3.358 -
3.359 - /* Button signals */
3.360 - /* FIXME
3.361 - g_signal_connect (G_OBJECT (ui_common->button1), "clicked",
3.362 - G_CALLBACK (cb_channels_button), mmyth_ui);
3.363 - g_signal_connect (G_OBJECT (ui_common->button2), "clicked",
3.364 - G_CALLBACK (cb_esg_current_button), mmyth_ui);
3.365 - */
3.366 - g_signal_connect (G_OBJECT (ui_common->button3), "clicked",
3.367 - G_CALLBACK (cb_esg_today_button), mmyth_ui);
3.368 -
3.369 - return ui_common;
3.370 -
3.371 -}
3.372 -
3.373 -/******************************************************************************
3.374 - * ESG GRID VIEW METHODS *
3.375 - *****************************************************************************/
3.376 -
3.377 -static void
3.378 -cb_esg_grid_view_button (GtkButton * button, gpointer user_data)
3.379 -{
3.380 - /* FIXME
3.381 - MMythUi *mmyth_ui = (MMythUi *) user_data;
3.382 - guint32 service_id = -1;
3.383 -
3.384 - // Retrieves the user selected service ID
3.385 - DVBHScheduleEvent *schedule = (DVBHScheduleEvent *) mmyth_esg_grid_view_get_selected_schedule();
3.386 -
3.387 - if(schedule != NULL) {
3.388 - service_id = schedule->service->number;
3.389 - mmyth_play_channel (mmyth_ui, service_id);
3.390 - }
3.391 - */
3.392 -}
3.393 -
3.394 -MMythUiCommon *
3.395 -create_esg_grid_view (MMythUi * mmyth_ui)
3.396 -{
3.397 - MMythUiCommon *ui_common;
3.398 - GtkWidget *esg_grid_view = GTK_WIDGET (esg_grid_view_new (mmyth_ui));
3.399 -
3.400 -
3.401 - ui_common = mmyth_uicommon_new (esg_grid_view,
3.402 - "View", "Remind",
3.403 - "Close");
3.404 -
3.405 - /* Button signals */
3.406 - g_signal_connect (G_OBJECT (ui_common->button1), "clicked",
3.407 - G_CALLBACK (cb_esg_grid_view_button), mmyth_ui);
3.408 - g_signal_connect (G_OBJECT (ui_common->button2), "clicked",
3.409 - G_CALLBACK (cb_not_impl_button), mmyth_ui);
3.410 - g_signal_connect (G_OBJECT (ui_common->button3), "clicked",
3.411 - G_CALLBACK (cb_close_button), mmyth_ui);
3.412 -
3.413 - return ui_common;
3.414 -}
3.415 -
3.416 -/******************************************************************************
3.417 - * GST VIDEO WIDGET METHODS *
3.418 - *****************************************************************************/
3.419 -
3.420 -static void
3.421 -cb_video_close_button (GtkButton * button, gpointer user_data)
3.422 -{
3.423 - MMythUi *mmyth_ui = (MMythUi *) user_data;
3.424 -
3.425 - /* FIXME
3.426 - mmyth_player_stop (mmyth_ui);
3.427 - */
3.428 -
3.429 - mmyth_ui_set_widget (mmyth_ui, mmyth_ui->main_uicommon);
3.430 -}
3.431 -
3.432 -MMythUiCommon *
3.433 -create_video_view (MMythUi * mmyth_ui)
3.434 -{
3.435 -
3.436 - MMythUiCommon *ui_common;
3.437 -
3.438 - /* FIXME
3.439 - mmyth_player_init (mmyth_ui);
3.440 - */
3.441 -
3.442 - ui_common = mmyth_uicommon_new (mmyth_ui->video_alignment,
3.443 - " Full\nScreen", "Other\nServices",
3.444 - "Close");
3.445 -
3.446 - g_signal_connect (G_OBJECT (ui_common->button1), "clicked",
3.447 - G_CALLBACK (cb_not_impl_button), mmyth_ui);
3.448 - g_signal_connect (G_OBJECT (ui_common->button2), "clicked",
3.449 - G_CALLBACK (cb_not_impl_button), mmyth_ui);
3.450 - g_signal_connect (G_OBJECT (ui_common->button3), "clicked",
3.451 - G_CALLBACK (cb_video_close_button), mmyth_ui);
3.452 -
3.453 - return ui_common;
3.454 -}
4.1 --- a/gmyth/src/gui/mmyth_ui.c.r2518 Thu Sep 21 00:05:27 2006 +0100
4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
4.3 @@ -1,456 +0,0 @@
4.4 -
4.5 -#include <gtk/gtk.h>
4.6 -#include <gdk/gdkx.h>
4.7 -#include <gst/interfaces/xoverlay.h>
4.8 -
4.9 -#include "mmyth_ui.h"
4.10 -#include "mmyth_uicommon.h"
4.11 -/* FIXME
4.12 -#include "mmyth_videoplayer.h"
4.13 -#include "mmyth_esg_grid_view.h"
4.14 -#include "mmyth_common.h"
4.15 -*/
4.16 -
4.17 -static gint button_press_handler (GtkWidget *widget, GdkEvent *event);
4.18 -
4.19 -MMythUiCommon *create_main_view (MMythUi * mmyth_ui);
4.20 -MMythUiCommon *create_video_view (MMythUi * mmyth_ui);
4.21 -MMythUiCommon *create_esg_grid_view (MMythUi * mmyth_ui);
4.22 -static void cb_video_close_button (GtkButton * button, gpointer user_data);
4.23 -
4.24 -/* main box from button box separator*/
4.25 -static GtkWidget *main_vseparator = NULL;
4.26 -
4.27 -GdkPixbuf *icon_sports, *icon_news,
4.28 - *icon_movies, *icon_shows, *icon_default;
4.29 -
4.30 -/* FIXME: UGLY HACK */
4.31 -MMythUi *popup_mmyth_ui;
4.32 -
4.33 -void
4.34 -mmyth_ui_initialize_icons ()
4.35 -{
4.36 - GError *error = NULL;
4.37 -
4.38 -#ifdef MMYTH_DEVEL
4.39 - icon_sports =
4.40 - gdk_pixbuf_new_from_file ("../pixmaps/ico_sports.png", &error);
4.41 -#else
4.42 - icon_sports = gdk_pixbuf_new_from_file (PIX_DIR "ico_sports.png", &error);
4.43 -#endif
4.44 -
4.45 - if (error) {
4.46 - g_warning ("Could not load icon sports: %s\n", error->message);
4.47 - g_error_free (error);
4.48 - error = NULL;
4.49 - }
4.50 -
4.51 -#ifdef MMYTH_DEVEL
4.52 - icon_news = gdk_pixbuf_new_from_file ("../pixmaps/ico_news.png", &error);
4.53 -#else
4.54 - icon_news = gdk_pixbuf_new_from_file (PIX_DIR "ico_news.png", &error);
4.55 -#endif
4.56 -
4.57 - if (error) {
4.58 - g_warning ("Could not load icon news: %s\n", error->message);
4.59 - g_error_free (error);
4.60 - error = NULL;
4.61 - }
4.62 -
4.63 -#ifdef MMYTH_DEVEL
4.64 - icon_movies =
4.65 - gdk_pixbuf_new_from_file ("../pixmaps/ico_movies.png", &error);
4.66 -#else
4.67 - icon_movies = gdk_pixbuf_new_from_file (PIX_DIR "ico_movies.png", &error);
4.68 -#endif
4.69 - if (error) {
4.70 - g_warning ("Could not load icon movies: %s\n", error->message);
4.71 - g_error_free (error);
4.72 - error = NULL;
4.73 - }
4.74 -
4.75 -#ifdef MMYTH_DEVEL
4.76 - icon_shows = gdk_pixbuf_new_from_file ("../pixmaps/ico_shows.png", &error);
4.77 -#else
4.78 - icon_shows = gdk_pixbuf_new_from_file (PIX_DIR "ico_shows.png", &error);
4.79 -#endif
4.80 - if (error) {
4.81 - g_warning ("Could not load icon shows: %s\n", error->message);
4.82 - g_error_free (error);
4.83 - error = NULL;
4.84 - }
4.85 -
4.86 -#ifdef MMYTH_DEVEL
4.87 - icon_default =
4.88 - gdk_pixbuf_new_from_file ("../pixmaps/ico_default.png", &error);
4.89 -#else
4.90 - icon_default = gdk_pixbuf_new_from_file (PIX_DIR "ico_default.png", &error);
4.91 -#endif
4.92 -
4.93 - if (error) {
4.94 - g_warning ("Could not load icon default: %s\n", error->message);
4.95 - g_error_free (error);
4.96 - error = NULL;
4.97 - }
4.98 -
4.99 -}
4.100 -
4.101 -MMythUi *
4.102 -mmyth_ui_initialize (GtkWidget * main_window)
4.103 -{
4.104 - MMythUi *mmyth_ui;
4.105 -
4.106 - // FIXME: REMOVE ME
4.107 - //mmyth_settings_load ( );
4.108 -
4.109 - mmyth_ui = g_new0 (MMythUi, 1);
4.110 -
4.111 - mmyth_ui->main_window = main_window;
4.112 -
4.113 - /* Horizontal box that divides the view into control and video area */
4.114 - mmyth_ui->main_hbox = gtk_hbox_new (FALSE, 0);
4.115 - gtk_widget_show (mmyth_ui->main_hbox);
4.116 - g_object_ref (mmyth_ui->main_hbox);
4.117 -
4.118 - mmyth_ui_initialize_icons ();
4.119 -
4.120 - main_bg_color.red = 65000;
4.121 - main_bg_color.green = 65000;
4.122 - main_bg_color.blue = 65000;
4.123 -
4.124 - // Main widget is mmyth_ui->main_hbox
4.125 - mmyth_ui->main_uicommon = create_main_view (mmyth_ui);
4.126 - mmyth_ui->video_uicommon = create_video_view (mmyth_ui);
4.127 - mmyth_ui->esg_grid_uicommon = create_esg_grid_view (mmyth_ui);
4.128 -
4.129 - /* Popup menu */
4.130 - /* FIXME: URGENT ugly, ugly hack */
4.131 - popup_mmyth_ui = mmyth_ui;
4.132 - g_signal_connect (G_OBJECT (mmyth_ui->main_hbox), "event",
4.133 - G_CALLBACK (button_press_handler),
4.134 - G_OBJECT (mmyth_ui->main_hbox));
4.135 -
4.136 - gtk_container_add (GTK_CONTAINER (mmyth_ui->main_window),
4.137 - mmyth_ui->main_hbox);
4.138 -
4.139 - /* Add the gst video widget to hbox. It should never be removed. */
4.140 - /* FIXME: mmyth_ui->video_alignment == NULL when mmyth_player_init fails */
4.141 - if(mmyth_ui->video_alignment != NULL)
4.142 - gtk_box_pack_start (GTK_BOX (mmyth_ui->main_hbox),
4.143 - mmyth_ui->video_alignment, TRUE, TRUE, 0);
4.144 -
4.145 - mmyth_ui_set_widget (mmyth_ui, mmyth_ui->main_uicommon);
4.146 -
4.147 - return mmyth_ui;
4.148 -}
4.149 -
4.150 -void
4.151 -mmyth_ui_finalize (MMythUi * mmyth_ui)
4.152 -{
4.153 - if (mmyth_ui != NULL)
4.154 - g_free (mmyth_ui);
4.155 -
4.156 - mmyth_uicommon_unref_all (mmyth_ui->main_uicommon);
4.157 - mmyth_uicommon_unref_all (mmyth_ui->video_uicommon);
4.158 - mmyth_uicommon_unref_all (mmyth_ui->esgcurrent_uicommon);
4.159 -}
4.160 -
4.161 -void
4.162 -mmyth_ui_set_widget (MMythUi * mmyth_ui, MMythUiCommon * new_uicommon)
4.163 -{
4.164 - if (mmyth_ui->current_uicommon) {
4.165 - if (mmyth_ui->current_uicommon == mmyth_ui->video_uicommon) {
4.166 - gtk_widget_hide (mmyth_ui->current_uicommon->main_widget);
4.167 - gtk_widget_hide (mmyth_ui->videow);
4.168 - }
4.169 - else {
4.170 - gtk_container_remove (GTK_CONTAINER (mmyth_ui->main_hbox),
4.171 - mmyth_ui->current_uicommon->main_widget);
4.172 - }
4.173 -
4.174 - gtk_container_remove (GTK_CONTAINER (mmyth_ui->main_hbox),
4.175 - mmyth_ui->current_uicommon->event_box);
4.176 - gtk_container_remove (GTK_CONTAINER (mmyth_ui->main_hbox),
4.177 - main_vseparator);
4.178 -
4.179 - }
4.180 -
4.181 - if (new_uicommon->main_widget == mmyth_ui->video_alignment) {
4.182 - //gst_player_video_show (GST_PLAYER_VIDEO(mmyth_ui->videow));
4.183 - gtk_widget_show (mmyth_ui->video_alignment);
4.184 - gtk_widget_show (mmyth_ui->videow);
4.185 - }
4.186 - else {
4.187 - /* FIXME: Fst call is NULL when mmyth_player_init fails */
4.188 - if(mmyth_ui->video_alignment != NULL)
4.189 - gtk_widget_hide (mmyth_ui->video_alignment);
4.190 - /* FIXME: Fst call is NULL when mmyth_player_init fails */
4.191 - if(mmyth_ui->videow != NULL)
4.192 - gtk_widget_hide (mmyth_ui->videow);
4.193 -
4.194 - gtk_box_pack_start (GTK_BOX (mmyth_ui->main_hbox),
4.195 - new_uicommon->main_widget, TRUE, TRUE, 0);
4.196 - }
4.197 -
4.198 - if(main_vseparator == NULL) {
4.199 - /* FIXME: should free this variable*/
4.200 - main_vseparator = gtk_vseparator_new();
4.201 - g_object_ref (main_vseparator);
4.202 - }
4.203 - gtk_box_pack_start (GTK_BOX (mmyth_ui->main_hbox),
4.204 - main_vseparator, FALSE, FALSE, 0);
4.205 - gtk_widget_show (main_vseparator);
4.206 -
4.207 - gtk_box_pack_end (GTK_BOX (mmyth_ui->main_hbox), new_uicommon->event_box, FALSE,
4.208 - FALSE, 0);
4.209 -
4.210 - mmyth_ui->current_uicommon = new_uicommon;
4.211 -
4.212 -}
4.213 -
4.214 -/* The close callback is the same for all windows*/
4.215 -static void
4.216 -cb_not_impl_button (GtkButton * button, gpointer user_data)
4.217 -{
4.218 - MMythUi *mmyth_ui = (MMythUi *) user_data;
4.219 -
4.220 - GtkWidget *msg_dialog = gtk_message_dialog_new (
4.221 - GTK_WINDOW(mmyth_ui->main_window),
4.222 - GTK_DIALOG_MODAL |
4.223 - GTK_DIALOG_DESTROY_WITH_PARENT,
4.224 - GTK_MESSAGE_INFO,
4.225 - GTK_BUTTONS_OK,
4.226 - "Feature not implemented yet");
4.227 - gtk_widget_set_size_request (msg_dialog, 300, 120);
4.228 -
4.229 - gtk_dialog_run (GTK_DIALOG (msg_dialog));
4.230 -
4.231 - gtk_widget_destroy(GTK_WIDGET(msg_dialog));
4.232 -}
4.233 -
4.234 -/******************************************************************************
4.235 - * POPUP MENU WIDGET METHODS *
4.236 - *****************************************************************************/
4.237 -
4.238 -void
4.239 -detacher (GtkWidget *attach_widget,GtkMenu *menu)
4.240 -{
4.241 -}
4.242 -
4.243 -void
4.244 -menu_item_settings_cb (GtkMenuItem *menuitem,
4.245 - gpointer user_data)
4.246 -{
4.247 - /* MMythUi *mmyth_ui = (MMythUi *) user_data; */
4.248 -
4.249 - /* FIXME
4.250 - MMythUi *mmyth_ui = popup_mmyth_ui;
4.251 -
4.252 - settings_show_dialog (GTK_WINDOW (mmyth_ui->main_window));
4.253 - */
4.254 -}
4.255 -
4.256 -static void
4.257 -do_popup_menu (GtkWidget *my_widget, GdkEventButton *event)
4.258 -{
4.259 - GtkWidget *popup;
4.260 - int button, event_time;
4.261 -
4.262 - popup = gtk_menu_new ();
4.263 -
4.264 - /* ... add menu items ... */
4.265 - GtkWidget *menu_item = gtk_menu_item_new_with_label("Settings");
4.266 - gtk_menu_append(popup, menu_item);
4.267 -
4.268 - g_signal_connect (G_OBJECT(menu_item), "activate",
4.269 - G_CALLBACK (menu_item_settings_cb), NULL);
4.270 -
4.271 - if (event)
4.272 - {
4.273 - button = event->button;
4.274 - event_time = event->time;
4.275 - }
4.276 - else
4.277 - {
4.278 - button = 0;
4.279 - event_time = gtk_get_current_event_time ();
4.280 - }
4.281 -
4.282 - //gtk_menu_attach_to_widget (GTK_MENU (popup), my_widget, detacher);
4.283 - gtk_menu_popup (GTK_MENU (popup), NULL, NULL, NULL, NULL,
4.284 - button, event_time);
4.285 - gtk_widget_show_all(popup);
4.286 -}
4.287 -
4.288 -/* Respond to a button-press by posting a menu passed in as widget.
4.289 - *
4.290 - * Note that the "widget" argument is the menu being posted, NOT
4.291 - * the button that was pressed.
4.292 - */
4.293 -
4.294 -static gint
4.295 -button_press_handler (GtkWidget *widget, GdkEvent *event)
4.296 -{
4.297 -
4.298 - if (event->type == GDK_BUTTON_PRESS) {
4.299 - GdkEventButton *bevent = (GdkEventButton *) event;
4.300 - /* Ignore double-clicks and triple-clicks */
4.301 - if (bevent->button == 3)
4.302 - {
4.303 - do_popup_menu (widget, bevent);
4.304 - return TRUE;
4.305 - }
4.306 - }
4.307 -
4.308 - /* Tell calling code that we have not handled this event; pass it on. */
4.309 - return FALSE;
4.310 -}
4.311 -
4.312 -
4.313 -/******************************************************************************
4.314 - * MAIN APP VIEW METHODS *
4.315 - *****************************************************************************/
4.316 -
4.317 -/* The close callback is the same for all windows*/
4.318 -static void
4.319 -cb_close_button (GtkButton * button, gpointer user_data)
4.320 -{
4.321 - MMythUi *mmyth_ui = (MMythUi *) user_data;
4.322 -
4.323 - mmyth_ui_set_widget (mmyth_ui, mmyth_ui->main_uicommon);
4.324 -}
4.325 -
4.326 -/* FIXME
4.327 -static void
4.328 -cb_esg_today_button (GtkButton * button, gpointer user_data)
4.329 -{
4.330 - MMythUi *mmyth_ui = (MMythUi *) user_data;
4.331 -
4.332 - mmyth_ui_set_widget (mmyth_ui, mmyth_ui->esg_grid_uicommon);
4.333 -}
4.334 -*/
4.335 -
4.336 -MMythUiCommon *
4.337 -create_main_view (MMythUi * mmyth_ui)
4.338 -{
4.339 - MMythUiCommon *ui_common;
4.340 - GtkWidget *main_widget;
4.341 - GtkWidget *image;
4.342 -
4.343 - // FIXME: file path
4.344 -#ifdef MMYTH_DEV
4.345 - image = gtk_image_new_from_file ("../pixmaps/main_logo.gif");
4.346 -#else
4.347 - image = gtk_image_new_from_file ("../pixmaps/main_logo.gif");
4.348 -#endif
4.349 -
4.350 - main_widget = gtk_event_box_new();
4.351 -
4.352 - gtk_container_add (GTK_CONTAINER (main_widget),
4.353 - image);
4.354 -
4.355 -
4.356 - gtk_widget_show_all (main_widget);
4.357 - g_object_ref (main_widget);
4.358 -
4.359 - ui_common = mmyth_uicommon_new (main_widget,
4.360 - "Channels", "Current", "Today");
4.361 -
4.362 - /* Button signals */
4.363 - /* FIXME
4.364 - g_signal_connect (G_OBJECT (ui_common->button1), "clicked",
4.365 - G_CALLBACK (cb_channels_button), mmyth_ui);
4.366 - g_signal_connect (G_OBJECT (ui_common->button2), "clicked",
4.367 - G_CALLBACK (cb_esg_current_button), mmyth_ui);
4.368 - g_signal_connect (G_OBJECT (ui_common->button3), "clicked",
4.369 - G_CALLBACK (cb_esg_today_button), mmyth_ui);
4.370 - */
4.371 -
4.372 - return ui_common;
4.373 -
4.374 -}
4.375 -
4.376 -/******************************************************************************
4.377 - * ESG GRID VIEW METHODS *
4.378 - *****************************************************************************/
4.379 -
4.380 -static void
4.381 -cb_esg_grid_view_button (GtkButton * button, gpointer user_data)
4.382 -{
4.383 - /* FIXME
4.384 - MMythUi *mmyth_ui = (MMythUi *) user_data;
4.385 - guint32 service_id = -1;
4.386 -
4.387 - // Retrieves the user selected service ID
4.388 - DVBHScheduleEvent *schedule = (DVBHScheduleEvent *) mmyth_esg_grid_view_get_selected_schedule();
4.389 -
4.390 - if(schedule != NULL) {
4.391 - service_id = schedule->service->number;
4.392 - mmyth_play_channel (mmyth_ui, service_id);
4.393 - }
4.394 - */
4.395 -}
4.396 -
4.397 -MMythUiCommon *
4.398 -create_esg_grid_view (MMythUi * mmyth_ui)
4.399 -{
4.400 - MMythUiCommon *ui_common;
4.401 - /* FIXME
4.402 - GtkWidget *esg_grid_view = GTK_WIDGET (esg_grid_view_new (mmyth_ui));
4.403 -
4.404 -
4.405 - ui_common = mmyth_uicommon_new (esg_grid_view,
4.406 - "View", "Remind",
4.407 - "Close");
4.408 - */
4.409 -
4.410 - /* Button signals */
4.411 - g_signal_connect (G_OBJECT (ui_common->button1), "clicked",
4.412 - G_CALLBACK (cb_esg_grid_view_button), mmyth_ui);
4.413 - g_signal_connect (G_OBJECT (ui_common->button2), "clicked",
4.414 - G_CALLBACK (cb_not_impl_button), mmyth_ui);
4.415 - g_signal_connect (G_OBJECT (ui_common->button3), "clicked",
4.416 - G_CALLBACK (cb_close_button), mmyth_ui);
4.417 -
4.418 - return ui_common;
4.419 -}
4.420 -
4.421 -/******************************************************************************
4.422 - * GST VIDEO WIDGET METHODS *
4.423 - *****************************************************************************/
4.424 -
4.425 -static void
4.426 -cb_video_close_button (GtkButton * button, gpointer user_data)
4.427 -{
4.428 - MMythUi *mmyth_ui = (MMythUi *) user_data;
4.429 -
4.430 - /* FIXME
4.431 - mmyth_player_stop (mmyth_ui);
4.432 - */
4.433 -
4.434 - mmyth_ui_set_widget (mmyth_ui, mmyth_ui->main_uicommon);
4.435 -}
4.436 -
4.437 -MMythUiCommon *
4.438 -create_video_view (MMythUi * mmyth_ui)
4.439 -{
4.440 -
4.441 - MMythUiCommon *ui_common;
4.442 -
4.443 - /* FIXME
4.444 - mmyth_player_init (mmyth_ui);
4.445 - */
4.446 -
4.447 - ui_common = mmyth_uicommon_new (mmyth_ui->video_alignment,
4.448 - " Full\nScreen", "Other\nServices",
4.449 - "Close");
4.450 -
4.451 - g_signal_connect (G_OBJECT (ui_common->button1), "clicked",
4.452 - G_CALLBACK (cb_not_impl_button), mmyth_ui);
4.453 - g_signal_connect (G_OBJECT (ui_common->button2), "clicked",
4.454 - G_CALLBACK (cb_not_impl_button), mmyth_ui);
4.455 - g_signal_connect (G_OBJECT (ui_common->button3), "clicked",
4.456 - G_CALLBACK (cb_video_close_button), mmyth_ui);
4.457 -
4.458 - return ui_common;
4.459 -}
5.1 --- a/gmyth/src/gui/mmyth_ui.c.r2535 Thu Sep 21 00:05:27 2006 +0100
5.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
5.3 @@ -1,567 +0,0 @@
5.4 -#include <gtk/gtk.h>
5.5 -#include <gdk/gdkx.h>
5.6 -#include <gst/interfaces/xoverlay.h>
5.7 -
5.8 -#include "mmyth_ui.h"
5.9 -#include "mmyth_uicommon.h"
5.10 -#include "mmyth_uischedulerecording.h"
5.11 -#include "mmyth_uirecord.h"
5.12 -/* FIXME
5.13 -#include "mmyth_videoplayer.h"
5.14 -#include "mmyth_esg_grid_view.h"
5.15 -#include "mmyth_common.h"
5.16 -*/
5.17 -
5.18 -static gint button_press_handler (GtkWidget *widget, GdkEvent *event);
5.19 -
5.20 -MMythUiCommon *create_main_view (MMythUi * mmyth_ui);
5.21 -MMythUiCommon *create_video_view (MMythUi * mmyth_ui);
5.22 -MMythUiCommon *create_esg_grid_view (MMythUi * mmyth_ui);
5.23 -MMythUiCommon *create_record_view (MMythUi * mmyth_ui);
5.24 -MMythUiCommon *create_schedule_view (MMythUi * mmyth_ui);
5.25 -static void cb_video_close_button (GtkButton * button, gpointer user_data);
5.26 -static void cb_record_button (GtkButton * button, gpointer user_data);
5.27 -
5.28 -/* main box from button box separator*/
5.29 -static GtkWidget *main_vseparator = NULL;
5.30 -
5.31 -GdkPixbuf *icon_sports, *icon_news,
5.32 - *icon_movies, *icon_shows, *icon_default;
5.33 -
5.34 -/* FIXME: UGLY HACK */
5.35 -MMythUi *popup_mmyth_ui;
5.36 -
5.37 -void
5.38 -mmyth_ui_initialize_icons ()
5.39 -{
5.40 - GError *error = NULL;
5.41 -
5.42 -#ifdef MMYTH_DEVEL
5.43 - icon_sports =
5.44 - gdk_pixbuf_new_from_file ("../pixmaps/ico_sports.png", &error);
5.45 -#else
5.46 - icon_sports = gdk_pixbuf_new_from_file (PIX_DIR "ico_sports.png", &error);
5.47 -#endif
5.48 -
5.49 - if (error) {
5.50 - g_warning ("Could not load icon sports: %s\n", error->message);
5.51 - g_error_free (error);
5.52 - error = NULL;
5.53 - }
5.54 -
5.55 -#ifdef MMYTH_DEVEL
5.56 - icon_news = gdk_pixbuf_new_from_file ("../pixmaps/ico_news.png", &error);
5.57 -#else
5.58 - icon_news = gdk_pixbuf_new_from_file (PIX_DIR "ico_news.png", &error);
5.59 -#endif
5.60 -
5.61 - if (error) {
5.62 - g_warning ("Could not load icon news: %s\n", error->message);
5.63 - g_error_free (error);
5.64 - error = NULL;
5.65 - }
5.66 -
5.67 -#ifdef MMYTH_DEVEL
5.68 - icon_movies =
5.69 - gdk_pixbuf_new_from_file ("../pixmaps/ico_movies.png", &error);
5.70 -#else
5.71 - icon_movies = gdk_pixbuf_new_from_file (PIX_DIR "ico_movies.png", &error);
5.72 -#endif
5.73 - if (error) {
5.74 - g_warning ("Could not load icon movies: %s\n", error->message);
5.75 - g_error_free (error);
5.76 - error = NULL;
5.77 - }
5.78 -
5.79 -#ifdef MMYTH_DEVEL
5.80 - icon_shows = gdk_pixbuf_new_from_file ("../pixmaps/ico_shows.png", &error);
5.81 -#else
5.82 - icon_shows = gdk_pixbuf_new_from_file (PIX_DIR "ico_shows.png", &error);
5.83 -#endif
5.84 - if (error) {
5.85 - g_warning ("Could not load icon shows: %s\n", error->message);
5.86 - g_error_free (error);
5.87 - error = NULL;
5.88 - }
5.89 -
5.90 -#ifdef MMYTH_DEVEL
5.91 - icon_default =
5.92 - gdk_pixbuf_new_from_file ("../pixmaps/ico_default.png", &error);
5.93 -#else
5.94 - icon_default = gdk_pixbuf_new_from_file (PIX_DIR "ico_default.png", &error);
5.95 -#endif
5.96 -
5.97 - if (error) {
5.98 - g_warning ("Could not load icon default: %s\n", error->message);
5.99 - g_error_free (error);
5.100 - error = NULL;
5.101 - }
5.102 -
5.103 -}
5.104 -
5.105 -MMythUi *
5.106 -mmyth_ui_initialize (GtkWidget * main_window)
5.107 -{
5.108 - MMythUi *mmyth_ui;
5.109 -
5.110 - // FIXME: REMOVE ME
5.111 - //mmyth_settings_load ( );
5.112 -
5.113 - mmyth_ui = g_new0 (MMythUi, 1);
5.114 -
5.115 - mmyth_ui->main_window = main_window;
5.116 -
5.117 - /* Horizontal box that divides the view into control and video area */
5.118 - mmyth_ui->main_hbox = gtk_hbox_new (FALSE, 0);
5.119 - gtk_widget_show (mmyth_ui->main_hbox);
5.120 - g_object_ref (mmyth_ui->main_hbox);
5.121 -
5.122 - mmyth_ui_initialize_icons ();
5.123 -
5.124 - main_bg_color.red = 65000;
5.125 - main_bg_color.green = 65000;
5.126 - main_bg_color.blue = 65000;
5.127 -
5.128 - // Main widget is mmyth_ui->main_hbox
5.129 - mmyth_ui->main_uicommon = create_main_view (mmyth_ui);
5.130 - mmyth_ui->video_uicommon = create_video_view (mmyth_ui);
5.131 - mmyth_ui->esg_grid_uicommon = create_esg_grid_view (mmyth_ui);
5.132 - mmyth_ui->record_uicommon = create_record_view (mmyth_ui);
5.133 - mmyth_ui->schedule_uicommon = create_schedule_view (mmyth_ui);
5.134 - /* Popup menu */
5.135 - /* FIXME: URGENT ugly, ugly hack */
5.136 - popup_mmyth_ui = mmyth_ui;
5.137 - g_signal_connect (G_OBJECT (mmyth_ui->main_hbox), "event",
5.138 - G_CALLBACK (button_press_handler),
5.139 - G_OBJECT (mmyth_ui->main_hbox));
5.140 -
5.141 - gtk_container_add (GTK_CONTAINER (mmyth_ui->main_window),
5.142 - mmyth_ui->main_hbox);
5.143 -
5.144 - /* Add the gst video widget to hbox. It should never be removed. */
5.145 - /* FIXME: mmyth_ui->video_alignment == NULL when mmyth_player_init fails */
5.146 - if(mmyth_ui->video_alignment != NULL)
5.147 - gtk_box_pack_start (GTK_BOX (mmyth_ui->main_hbox),
5.148 - mmyth_ui->video_alignment, TRUE, TRUE, 0);
5.149 -
5.150 - mmyth_ui_set_widget (mmyth_ui, mmyth_ui->main_uicommon);
5.151 -
5.152 - return mmyth_ui;
5.153 -}
5.154 -
5.155 -void
5.156 -mmyth_ui_finalize (MMythUi * mmyth_ui)
5.157 -{
5.158 - if (mmyth_ui != NULL)
5.159 - g_free (mmyth_ui);
5.160 -
5.161 - mmyth_uicommon_unref_all (mmyth_ui->main_uicommon);
5.162 - mmyth_uicommon_unref_all (mmyth_ui->video_uicommon);
5.163 - mmyth_uicommon_unref_all (mmyth_ui->esgcurrent_uicommon);
5.164 -}
5.165 -
5.166 -void
5.167 -mmyth_ui_set_widget (MMythUi * mmyth_ui, MMythUiCommon * new_uicommon)
5.168 -{
5.169 - if (mmyth_ui->current_uicommon) {
5.170 - if (mmyth_ui->current_uicommon == mmyth_ui->video_uicommon) {
5.171 - gtk_widget_hide (mmyth_ui->current_uicommon->main_widget);
5.172 - gtk_widget_hide (mmyth_ui->videow);
5.173 - }
5.174 - else {
5.175 - gtk_container_remove (GTK_CONTAINER (mmyth_ui->main_hbox),
5.176 - mmyth_ui->current_uicommon->main_widget);
5.177 - }
5.178 -
5.179 - gtk_container_remove (GTK_CONTAINER (mmyth_ui->main_hbox),
5.180 - mmyth_ui->current_uicommon->event_box);
5.181 - gtk_container_remove (GTK_CONTAINER (mmyth_ui->main_hbox),
5.182 - main_vseparator);
5.183 -
5.184 - }
5.185 -
5.186 - if (new_uicommon->main_widget == mmyth_ui->video_alignment) {
5.187 - //gst_player_video_show (GST_PLAYER_VIDEO(mmyth_ui->videow));
5.188 - gtk_widget_show (mmyth_ui->video_alignment);
5.189 - gtk_widget_show (mmyth_ui->videow);
5.190 - }
5.191 - else {
5.192 - /* FIXME: Fst call is NULL when mmyth_player_init fails */
5.193 - if(mmyth_ui->video_alignment != NULL)
5.194 - gtk_widget_hide (mmyth_ui->video_alignment);
5.195 - /* FIXME: Fst call is NULL when mmyth_player_init fails */
5.196 - if(mmyth_ui->videow != NULL)
5.197 - gtk_widget_hide (mmyth_ui->videow);
5.198 -
5.199 - gtk_box_pack_start (GTK_BOX (mmyth_ui->main_hbox),
5.200 - new_uicommon->main_widget, TRUE, TRUE, 0);
5.201 - }
5.202 -
5.203 - if(main_vseparator == NULL) {
5.204 - /* FIXME: should free this variable*/
5.205 - main_vseparator = gtk_vseparator_new();
5.206 - g_object_ref (main_vseparator);
5.207 - }
5.208 - gtk_box_pack_start (GTK_BOX (mmyth_ui->main_hbox),
5.209 - main_vseparator, FALSE, FALSE, 0);
5.210 - gtk_widget_show (main_vseparator);
5.211 -
5.212 - gtk_box_pack_end (GTK_BOX (mmyth_ui->main_hbox), new_uicommon->event_box, FALSE,
5.213 - FALSE, 0);
5.214 -
5.215 - mmyth_ui->current_uicommon = new_uicommon;
5.216 -
5.217 -}
5.218 -
5.219 -/* The close callback is the same for all windows*/
5.220 -static void
5.221 -cb_not_impl_button (GtkButton * button, gpointer user_data)
5.222 -{
5.223 - MMythUi *mmyth_ui = (MMythUi *) user_data;
5.224 -
5.225 - GtkWidget *msg_dialog = gtk_message_dialog_new (
5.226 - GTK_WINDOW(mmyth_ui->main_window),
5.227 - GTK_DIALOG_MODAL |
5.228 - GTK_DIALOG_DESTROY_WITH_PARENT,
5.229 - GTK_MESSAGE_INFO,
5.230 - GTK_BUTTONS_OK,
5.231 - "Feature not implemented yet");
5.232 - gtk_widget_set_size_request (msg_dialog, 300, 120);
5.233 -
5.234 - gtk_dialog_run (GTK_DIALOG (msg_dialog));
5.235 -
5.236 - gtk_widget_destroy(GTK_WIDGET(msg_dialog));
5.237 -}
5.238 -
5.239 -/******************************************************************************
5.240 - * POPUP MENU WIDGET METHODS *
5.241 - *****************************************************************************/
5.242 -
5.243 -void
5.244 -detacher (GtkWidget *attach_widget,GtkMenu *menu)
5.245 -{
5.246 -}
5.247 -
5.248 -void
5.249 -menu_item_settings_cb (GtkMenuItem *menuitem,
5.250 - gpointer user_data)
5.251 -{
5.252 - /* MMythUi *mmyth_ui = (MMythUi *) user_data; */
5.253 -
5.254 - /* FIXME
5.255 - MMythUi *mmyth_ui = popup_mmyth_ui;
5.256 -
5.257 - settings_show_dialog (GTK_WINDOW (mmyth_ui->main_window));
5.258 - */
5.259 -}
5.260 -
5.261 -static void
5.262 -do_popup_menu (GtkWidget *my_widget, GdkEventButton *event)
5.263 -{
5.264 - GtkWidget *popup;
5.265 - int button, event_time;
5.266 -
5.267 - popup = gtk_menu_new ();
5.268 -
5.269 - /* ... add menu items ... */
5.270 - GtkWidget *menu_item = gtk_menu_item_new_with_label("Settings");
5.271 - gtk_menu_append(popup, menu_item);
5.272 -
5.273 - g_signal_connect (G_OBJECT(menu_item), "activate",
5.274 - G_CALLBACK (menu_item_settings_cb), NULL);
5.275 -
5.276 - if (event)
5.277 - {
5.278 - button = event->button;
5.279 - event_time = event->time;
5.280 - }
5.281 - else
5.282 - {
5.283 - button = 0;
5.284 - event_time = gtk_get_current_event_time ();
5.285 - }
5.286 -
5.287 - //gtk_menu_attach_to_widget (GTK_MENU (popup), my_widget, detacher);
5.288 - gtk_menu_popup (GTK_MENU (popup), NULL, NULL, NULL, NULL,
5.289 - button, event_time);
5.290 - gtk_widget_show_all(popup);
5.291 -}
5.292 -
5.293 -/* Respond to a button-press by posting a menu passed in as widget.
5.294 - *
5.295 - * Note that the "widget" argument is the menu being posted, NOT
5.296 - * the button that was pressed.
5.297 - */
5.298 -
5.299 -static gint
5.300 -button_press_handler (GtkWidget *widget, GdkEvent *event)
5.301 -{
5.302 -
5.303 - if (event->type == GDK_BUTTON_PRESS) {
5.304 - GdkEventButton *bevent = (GdkEventButton *) event;
5.305 - /* Ignore double-clicks and triple-clicks */
5.306 - if (bevent->button == 3)
5.307 - {
5.308 - do_popup_menu (widget, bevent);
5.309 - return TRUE;
5.310 - }
5.311 - }
5.312 -
5.313 - /* Tell calling code that we have not handled this event; pass it on. */
5.314 - return FALSE;
5.315 -}
5.316 -
5.317 -
5.318 -/******************************************************************************
5.319 - * MAIN APP VIEW METHODS *
5.320 - *****************************************************************************/
5.321 -
5.322 -/* The close callback is the same for all windows*/
5.323 -static void
5.324 -cb_close_button (GtkButton * button, gpointer user_data)
5.325 -{
5.326 - MMythUi *mmyth_ui = (MMythUi *) user_data;
5.327 -
5.328 - mmyth_ui_set_widget (mmyth_ui, mmyth_ui->main_uicommon);
5.329 -}
5.330 -
5.331 -// FIXME
5.332 -//static void
5.333 -//cb_record_button (GtkButton * button, gpointer user_data)
5.334 -//{
5.335 -// MMythUi *mmyth_ui = (MMythUi *) user_data;
5.336 -//
5.337 -// mmyth_ui_set_widget (mmyth_ui, mmyth_ui->record_uicommon);
5.338 -//}
5.339 -
5.340 -
5.341 -MMythUiCommon *
5.342 -create_main_view (MMythUi * mmyth_ui)
5.343 -{
5.344 - MMythUiCommon *ui_common;
5.345 - GtkWidget *main_widget;
5.346 - GtkWidget *image;
5.347 -
5.348 - // FIXME: file path
5.349 -#ifdef MMYTH_DEV
5.350 - image = gtk_image_new_from_file ("../pixmaps/main_logo.gif");
5.351 -#else
5.352 - image = gtk_image_new_from_file ("../pixmaps/main_logo.gif");
5.353 -#endif
5.354 -
5.355 - main_widget = gtk_event_box_new();
5.356 -
5.357 - gtk_container_add (GTK_CONTAINER (main_widget),
5.358 - image);
5.359 -
5.360 -
5.361 - gtk_widget_show_all (main_widget);
5.362 - g_object_ref (main_widget);
5.363 -
5.364 - ui_common = mmyth_uicommon_new (main_widget,
5.365 - "Channels", "Current", "Recording");
5.366 -
5.367 - /* Button signals */
5.368 - // FIXME
5.369 - g_signal_connect (G_OBJECT (ui_common->button1), "clicked",
5.370 - G_CALLBACK (cb_record_button), mmyth_ui);
5.371 - g_signal_connect (G_OBJECT (ui_common->button2), "clicked",
5.372 - G_CALLBACK (cb_record_button), mmyth_ui);
5.373 - g_signal_connect (G_OBJECT (ui_common->button3), "clicked",
5.374 - G_CALLBACK (cb_record_button), mmyth_ui);
5.375 -
5.376 -
5.377 - return ui_common;
5.378 -
5.379 -}
5.380 -
5.381 -/******************************************************************************
5.382 - * ESG GRID VIEW METHODS *
5.383 - *****************************************************************************/
5.384 -
5.385 -static void
5.386 -cb_esg_grid_view_button (GtkButton * button, gpointer user_data)
5.387 -{
5.388 - /* FIXME
5.389 - MMythUi *mmyth_ui = (MMythUi *) user_data;
5.390 - guint32 service_id = -1;
5.391 -
5.392 - // Retrieves the user selected service ID
5.393 - DVBHScheduleEvent *schedule = (DVBHScheduleEvent *) mmyth_esg_grid_view_get_selected_schedule();
5.394 -
5.395 - if(schedule != NULL) {
5.396 - service_id = schedule->service->number;
5.397 - mmyth_play_channel (mmyth_ui, service_id);
5.398 - }
5.399 - */
5.400 -}
5.401 -
5.402 -MMythUiCommon *
5.403 -create_esg_grid_view (MMythUi * mmyth_ui)
5.404 -{
5.405 - MMythUiCommon *ui_common;
5.406 - /* FIXME
5.407 - GtkWidget *esg_grid_view = GTK_WIDGET (esg_grid_view_new (mmyth_ui));
5.408 -
5.409 -
5.410 - ui_common = mmyth_uicommon_new (esg_grid_view,
5.411 - "View", "Remind",
5.412 - "Close");
5.413 - */
5.414 -
5.415 - /* Button signals */
5.416 - g_signal_connect (G_OBJECT (ui_common->button1), "clicked",
5.417 - G_CALLBACK (cb_esg_grid_view_button), mmyth_ui);
5.418 - g_signal_connect (G_OBJECT (ui_common->button2), "clicked",
5.419 - G_CALLBACK (cb_not_impl_button), mmyth_ui);
5.420 - g_signal_connect (G_OBJECT (ui_common->button3), "clicked",
5.421 - G_CALLBACK (cb_close_button), mmyth_ui);
5.422 -
5.423 - return ui_common;
5.424 -}
5.425 -/******************************************************************************
5.426 - * SCHEDULE VIEW METHODS *
5.427 - ******************************************************************************/
5.428 -
5.429 -static void
5.430 -cb_schedule_button (GtkButton * button, gpointer user_data)
5.431 -{
5.432 - MMythUi *mmyth_ui = (MMythUi *) user_data;
5.433 -
5.434 - mmyth_ui_set_widget (mmyth_ui, mmyth_ui->schedule_uicommon);
5.435 - /* FIXME
5.436 - MMythUi *mmyth_ui = (MMythUi *) user_data;
5.437 - guint32 service_id = -1;
5.438 -
5.439 - // Retrieves the user selected service ID
5.440 - DVBHScheduleEvent *schedule = (DVBHScheduleEvent *) mmyth_esg_grid_view_get_selected_schedule();
5.441 -
5.442 - if(schedule != NULL) {
5.443 - service_id = schedule->service->number;
5.444 - mmyth_play_channel (mmyth_ui, service_id);
5.445 - }
5.446 - */
5.447 -}
5.448 -
5.449 -MMythUiCommon *
5.450 -create_schedule_view (MMythUi * mmyth_ui)
5.451 -{
5.452 - MMythUiCommon *ui_common;
5.453 -
5.454 - GtkWidget *schedule_view = GTK_WIDGET (schedule_view_new ());
5.455 - //record_view = gtk_event_box_new();
5.456 -
5.457 -
5.458 - gtk_widget_show_all (schedule_view);
5.459 - g_object_ref (schedule_view);
5.460 -
5.461 - ui_common = mmyth_uicommon_new (schedule_view,
5.462 - "Save", "Clear",
5.463 - "Cancel");
5.464 -
5.465 - //ui->
5.466 -
5.467 - /* Button signals */
5.468 - g_signal_connect (G_OBJECT (ui_common->button1), "clicked",
5.469 - G_CALLBACK (cb_not_impl_button), mmyth_ui);
5.470 - g_signal_connect (G_OBJECT (ui_common->button2), "clicked",
5.471 - G_CALLBACK (cb_not_impl_button), mmyth_ui);
5.472 - g_signal_connect (G_OBJECT (ui_common->button3), "clicked",
5.473 - G_CALLBACK (cb_close_button), mmyth_ui);
5.474 -
5.475 - return ui_common;
5.476 -}
5.477 -/******************************************************************************
5.478 - * RECORD VIEW METHODS *
5.479 - ******************************************************************************/
5.480 -
5.481 -static void
5.482 -cb_record_button (GtkButton * button, gpointer user_data)
5.483 -{
5.484 - MMythUi *mmyth_ui = (MMythUi *) user_data;
5.485 -
5.486 - mmyth_ui_set_widget (mmyth_ui, mmyth_ui->record_uicommon);
5.487 - /* FIXME
5.488 - MMythUi *mmyth_ui = (MMythUi *) user_data;
5.489 - guint32 service_id = -1;
5.490 -
5.491 - // Retrieves the user selected service ID
5.492 - DVBHScheduleEvent *schedule = (DVBHScheduleEvent *) mmyth_esg_grid_view_get_selected_schedule();
5.493 -
5.494 - if(schedule != NULL) {
5.495 - service_id = schedule->service->number;
5.496 - mmyth_play_channel (mmyth_ui, service_id);
5.497 - }
5.498 - */
5.499 -}
5.500 -
5.501 -MMythUiCommon *
5.502 -create_record_view (MMythUi * mmyth_ui)
5.503 -{
5.504 - MMythUiCommon *ui_common;
5.505 -
5.506 - GtkWidget *record_view = GTK_WIDGET (record_view_new ());
5.507 - //record_view = gtk_event_box_new();
5.508 -
5.509 -
5.510 -
5.511 -
5.512 - gtk_widget_show_all (record_view);
5.513 - g_object_ref (record_view);
5.514 -
5.515 - ui_common = mmyth_uicommon_new (record_view,
5.516 - "Play (!)", "Schedule",
5.517 - "Delete(!)");
5.518 -
5.519 - //ui->
5.520 -
5.521 -
5.522 - /* Button signals */
5.523 - g_signal_connect (G_OBJECT (ui_common->button1), "clicked",
5.524 - G_CALLBACK (cb_not_impl_button), mmyth_ui);
5.525 - g_signal_connect (G_OBJECT (ui_common->button2), "clicked",
5.526 - G_CALLBACK (cb_schedule_button), mmyth_ui);
5.527 - g_signal_connect (G_OBJECT (ui_common->button3), "clicked",
5.528 - G_CALLBACK (cb_close_button), mmyth_ui);
5.529 -
5.530 - return ui_common;
5.531 -}
5.532 -/******************************************************************************
5.533 - * GST VIDEO WIDGET METHODS *
5.534 - *****************************************************************************/
5.535 -
5.536 -static void
5.537 -cb_video_close_button (GtkButton * button, gpointer user_data)
5.538 -{
5.539 - MMythUi *mmyth_ui = (MMythUi *) user_data;
5.540 -
5.541 - /* FIXME
5.542 - mmyth_player_stop (mmyth_ui);
5.543 - */
5.544 -
5.545 - mmyth_ui_set_widget (mmyth_ui, mmyth_ui->main_uicommon);
5.546 -}
5.547 -
5.548 -MMythUiCommon *
5.549 -create_video_view (MMythUi * mmyth_ui)
5.550 -{
5.551 -
5.552 - MMythUiCommon *ui_common;
5.553 -
5.554 - /* FIXME
5.555 - mmyth_player_init (mmyth_ui);
5.556 - */
5.557 -
5.558 - ui_common = mmyth_uicommon_new (mmyth_ui->video_alignment,
5.559 - " Full\nScreen", "Other\nServices",
5.560 - "Close");
5.561 -
5.562 - g_signal_connect (G_OBJECT (ui_common->button1), "clicked",
5.563 - G_CALLBACK (cb_not_impl_button), mmyth_ui);
5.564 - g_signal_connect (G_OBJECT (ui_common->button2), "clicked",
5.565 - G_CALLBACK (cb_not_impl_button), mmyth_ui);
5.566 - g_signal_connect (G_OBJECT (ui_common->button3), "clicked",
5.567 - G_CALLBACK (cb_video_close_button), mmyth_ui);
5.568 -
5.569 - return ui_common;
5.570 -}
6.1 --- a/gst-plugins-mythtv/AUTHORS Thu Sep 21 00:05:27 2006 +0100
6.2 +++ b/gst-plugins-mythtv/AUTHORS Thu Sep 21 00:15:52 2006 +0100
6.3 @@ -1,2 +1,4 @@
6.4 -Rosfran Borges <rosfran dot borges at indt dot org dot br>
6.5 -and the GMyth Team
6.6 +Alexsandro Jose Virginio dos Santos <alexsandro.santos@indt.org.br>
6.7 +Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
6.8 +Leonardo Sobral Cunha <leonardo.cunha@indt.org.br>
6.9 +Rosfran Lins Borges <rosfran.borges@indt.org.br>