[Mplayerplug-in-cvs] mplayerplug-in/Source plugin-threads.cpp,1.84,1.85 plugin-ui.cpp,1.62,1.63 plug
Brought to you by:
kdekorte
From: Kevin D. <kde...@us...> - 2004-03-29 22:25:47
|
Update of /cvsroot/mplayerplug-in/mplayerplug-in/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5035 Modified Files: plugin-threads.cpp plugin-ui.cpp plugin.cpp Log Message: Index: plugin-ui.cpp =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin-ui.cpp,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** plugin-ui.cpp 29 Mar 2004 18:15:18 -0000 1.62 --- plugin-ui.cpp 29 Mar 2004 22:14:15 -0000 1.63 *************** *** 472,516 **** if (instance->panel_drawn == 0) return; ! if (instance->controlsvisible == 0) ! return; ! if (instance->panel_height > 16) ! instance->panel_height = 16; ! gtk_container_remove(GTK_CONTAINER(instance->play_event_box), ! instance->image_play); ! gtk_container_remove(GTK_CONTAINER(instance->pause_event_box), ! instance->image_pause); ! gtk_container_remove(GTK_CONTAINER(instance->stop_event_box), ! instance->image_stop); #ifdef GTK2_ENABLED ! instance->image_play = ! gtk_image_new_from_pixbuf(instance->pb_sm_play_down); ! instance->image_pause = ! gtk_image_new_from_pixbuf(instance->pb_sm_pause_up); ! instance->image_stop = ! gtk_image_new_from_pixbuf(instance->pb_sm_stop_up); #endif #ifdef GTK1_ENABLED ! instance->image_play = gtk_pixmap_new(instance->pb_sm_play_down, NULL); ! instance->image_pause = gtk_pixmap_new(instance->pb_sm_pause_up, NULL); ! instance->image_stop = gtk_pixmap_new(instance->pb_sm_stop_up, NULL); #endif ! gtk_container_add(GTK_CONTAINER(instance->play_event_box), ! instance->image_play); ! gtk_container_add(GTK_CONTAINER(instance->pause_event_box), ! instance->image_pause); ! gtk_container_add(GTK_CONTAINER(instance->stop_event_box), ! instance->image_stop); ! gtk_widget_show(instance->image_play); ! gtk_widget_show(instance->image_pause); ! gtk_widget_show(instance->image_stop); ! gtk_widget_show(instance->play_event_box); ! gtk_widget_show(instance->pause_event_box); ! gtk_widget_show(instance->stop_event_box); ! gtk_widget_show(instance->fixed_container); ! gdk_flush(); if (widget != NULL) instance->Play(); --- 472,519 ---- if (instance->panel_drawn == 0) return; ! if (instance->controlsvisible == 1) { ! if (instance->panel_height > 16) ! instance->panel_height = 16; ! gtk_container_remove(GTK_CONTAINER(instance->play_event_box), ! instance->image_play); ! gtk_container_remove(GTK_CONTAINER(instance->pause_event_box), ! instance->image_pause); ! gtk_container_remove(GTK_CONTAINER(instance->stop_event_box), ! instance->image_stop); #ifdef GTK2_ENABLED ! instance->image_play = ! gtk_image_new_from_pixbuf(instance->pb_sm_play_down); ! instance->image_pause = ! gtk_image_new_from_pixbuf(instance->pb_sm_pause_up); ! instance->image_stop = ! gtk_image_new_from_pixbuf(instance->pb_sm_stop_up); #endif #ifdef GTK1_ENABLED ! instance->image_play = ! gtk_pixmap_new(instance->pb_sm_play_down, NULL); ! instance->image_pause = ! gtk_pixmap_new(instance->pb_sm_pause_up, NULL); ! instance->image_stop = ! gtk_pixmap_new(instance->pb_sm_stop_up, NULL); #endif ! gtk_container_add(GTK_CONTAINER(instance->play_event_box), ! instance->image_play); ! gtk_container_add(GTK_CONTAINER(instance->pause_event_box), ! instance->image_pause); ! gtk_container_add(GTK_CONTAINER(instance->stop_event_box), ! instance->image_stop); ! gtk_widget_show(instance->image_play); ! gtk_widget_show(instance->image_pause); ! gtk_widget_show(instance->image_stop); ! gtk_widget_show(instance->play_event_box); ! gtk_widget_show(instance->pause_event_box); ! gtk_widget_show(instance->stop_event_box); ! gtk_widget_show(instance->fixed_container); ! gdk_flush(); ! } if (widget != NULL) instance->Play(); *************** *** 525,572 **** if (instance->panel_drawn == 0) return; ! if (instance->controlsvisible == 0) ! return; ! if (instance->panel_height > 16) ! instance->panel_height = 16; ! gtk_container_remove(GTK_CONTAINER(instance->play_event_box), ! instance->image_play); ! gtk_container_remove(GTK_CONTAINER(instance->pause_event_box), ! instance->image_pause); ! gtk_container_remove(GTK_CONTAINER(instance->stop_event_box), ! instance->image_stop); #ifdef GTK2_ENABLED ! instance->image_play = ! gtk_image_new_from_pixbuf(instance->pb_sm_play_up); ! instance->image_pause = ! gtk_image_new_from_pixbuf(instance->pb_sm_pause_down); ! instance->image_stop = ! gtk_image_new_from_pixbuf(instance->pb_sm_stop_up); #endif #ifdef GTK1_ENABLED ! instance->image_play = gtk_pixmap_new(instance->pb_sm_play_up, NULL); ! instance->image_pause = ! gtk_pixmap_new(instance->pb_sm_pause_down, NULL); ! instance->image_stop = gtk_pixmap_new(instance->pb_sm_stop_up, NULL); #endif ! gtk_container_add(GTK_CONTAINER(instance->play_event_box), ! instance->image_play); ! gtk_container_add(GTK_CONTAINER(instance->pause_event_box), ! instance->image_pause); ! gtk_container_add(GTK_CONTAINER(instance->stop_event_box), ! instance->image_stop); ! gtk_widget_show(instance->image_play); ! gtk_widget_show(instance->image_pause); ! gtk_widget_show(instance->image_stop); ! gtk_widget_show(instance->play_event_box); ! gtk_widget_show(instance->pause_event_box); ! gtk_widget_show(instance->stop_event_box); ! gtk_widget_show(instance->fixed_container); ! gdk_flush(); if (widget != NULL) instance->Pause(); --- 528,577 ---- if (instance->panel_drawn == 0) return; ! if (instance->controlsvisible == 1) { ! if (instance->panel_height > 16) ! instance->panel_height = 16; ! gtk_container_remove(GTK_CONTAINER(instance->play_event_box), ! instance->image_play); ! gtk_container_remove(GTK_CONTAINER(instance->pause_event_box), ! instance->image_pause); ! gtk_container_remove(GTK_CONTAINER(instance->stop_event_box), ! instance->image_stop); #ifdef GTK2_ENABLED ! instance->image_play = ! gtk_image_new_from_pixbuf(instance->pb_sm_play_up); ! instance->image_pause = ! gtk_image_new_from_pixbuf(instance->pb_sm_pause_down); ! instance->image_stop = ! gtk_image_new_from_pixbuf(instance->pb_sm_stop_up); #endif #ifdef GTK1_ENABLED ! instance->image_play = ! gtk_pixmap_new(instance->pb_sm_play_up, NULL); ! instance->image_pause = ! gtk_pixmap_new(instance->pb_sm_pause_down, NULL); ! instance->image_stop = ! gtk_pixmap_new(instance->pb_sm_stop_up, NULL); #endif ! gtk_container_add(GTK_CONTAINER(instance->play_event_box), ! instance->image_play); ! gtk_container_add(GTK_CONTAINER(instance->pause_event_box), ! instance->image_pause); ! gtk_container_add(GTK_CONTAINER(instance->stop_event_box), ! instance->image_stop); ! gtk_widget_show(instance->image_play); ! gtk_widget_show(instance->image_pause); ! gtk_widget_show(instance->image_stop); ! gtk_widget_show(instance->play_event_box); ! gtk_widget_show(instance->pause_event_box); ! gtk_widget_show(instance->stop_event_box); ! gtk_widget_show(instance->fixed_container); ! gdk_flush(); ! } if (widget != NULL) instance->Pause(); *************** *** 581,627 **** if (instance->panel_drawn == 0) return; ! if (instance->controlsvisible == 0) ! return; ! if (instance->panel_height > 16) ! instance->panel_height = 16; ! gtk_container_remove(GTK_CONTAINER(instance->play_event_box), ! instance->image_play); ! gtk_container_remove(GTK_CONTAINER(instance->pause_event_box), ! instance->image_pause); ! gtk_container_remove(GTK_CONTAINER(instance->stop_event_box), ! instance->image_stop); #ifdef GTK2_ENABLED ! instance->image_play = ! gtk_image_new_from_pixbuf(instance->pb_sm_play_up); ! instance->image_pause = ! gtk_image_new_from_pixbuf(instance->pb_sm_pause_up); ! instance->image_stop = ! gtk_image_new_from_pixbuf(instance->pb_sm_stop_down); #endif #ifdef GTK1_ENABLED ! instance->image_play = gtk_pixmap_new(instance->pb_sm_play_up, NULL); ! instance->image_pause = gtk_pixmap_new(instance->pb_sm_pause_up, NULL); ! instance->image_stop = gtk_pixmap_new(instance->pb_sm_stop_down, NULL); #endif ! gtk_container_add(GTK_CONTAINER(instance->play_event_box), ! instance->image_play); ! gtk_container_add(GTK_CONTAINER(instance->pause_event_box), ! instance->image_pause); ! gtk_container_add(GTK_CONTAINER(instance->stop_event_box), ! instance->image_stop); ! gtk_widget_show(instance->image_play); ! gtk_widget_show(instance->image_pause); ! gtk_widget_show(instance->image_stop); ! gtk_widget_show(instance->play_event_box); ! gtk_widget_show(instance->pause_event_box); ! gtk_widget_show(instance->stop_event_box); ! gtk_widget_show(instance->fixed_container); ! gdk_flush(); if (widget != NULL) instance->Stop(); } --- 586,637 ---- if (instance->panel_drawn == 0) return; ! if (instance->controlsvisible == 1) { ! if (instance->panel_height > 16) ! instance->panel_height = 16; ! gtk_container_remove(GTK_CONTAINER(instance->play_event_box), ! instance->image_play); ! gtk_container_remove(GTK_CONTAINER(instance->pause_event_box), ! instance->image_pause); ! gtk_container_remove(GTK_CONTAINER(instance->stop_event_box), ! instance->image_stop); #ifdef GTK2_ENABLED ! instance->image_play = ! gtk_image_new_from_pixbuf(instance->pb_sm_play_up); ! instance->image_pause = ! gtk_image_new_from_pixbuf(instance->pb_sm_pause_up); ! instance->image_stop = ! gtk_image_new_from_pixbuf(instance->pb_sm_stop_down); #endif #ifdef GTK1_ENABLED ! instance->image_play = ! gtk_pixmap_new(instance->pb_sm_play_up, NULL); ! instance->image_pause = ! gtk_pixmap_new(instance->pb_sm_pause_up, NULL); ! instance->image_stop = ! gtk_pixmap_new(instance->pb_sm_stop_down, NULL); #endif ! gtk_container_add(GTK_CONTAINER(instance->play_event_box), ! instance->image_play); ! gtk_container_add(GTK_CONTAINER(instance->pause_event_box), ! instance->image_pause); ! gtk_container_add(GTK_CONTAINER(instance->stop_event_box), ! instance->image_stop); ! gtk_widget_show(instance->image_play); ! gtk_widget_show(instance->image_pause); ! gtk_widget_show(instance->image_stop); ! gtk_widget_show(instance->play_event_box); ! gtk_widget_show(instance->pause_event_box); ! gtk_widget_show(instance->stop_event_box); ! gtk_widget_show(instance->fixed_container); ! gtk_widget_hide(GTK_WIDGET(instance->progress_bar)); ! gdk_flush(); ! } if (widget != NULL) instance->Stop(); + } *************** *** 631,671 **** if (instance->panel_drawn == 0) return; ! if (instance->controlsvisible == 0) ! return; ! if (instance->panel_height > 16) ! instance->panel_height = 16; ! gtk_container_remove(GTK_CONTAINER(instance->ff_event_box), ! instance->image_ff); #ifdef GTK2_ENABLED ! instance->image_ff = ! gtk_image_new_from_pixbuf(instance->pb_sm_ff_down); #endif #ifdef GTK1_ENABLED ! instance->image_ff = gtk_pixmap_new(instance->pb_sm_ff_down, NULL); #endif ! gtk_container_add(GTK_CONTAINER(instance->ff_event_box), ! instance->image_ff); ! gtk_widget_show(instance->image_ff); ! gtk_widget_show(instance->ff_event_box); ! gdk_flush(); ! instance->FastForward(); ! usleep(500); ! gtk_container_remove(GTK_CONTAINER(instance->ff_event_box), ! instance->image_ff); #ifdef GTK2_ENABLED ! instance->image_ff = gtk_image_new_from_pixbuf(instance->pb_sm_ff_up); #endif #ifdef GTK1_ENABLED ! instance->image_ff = gtk_pixmap_new(instance->pb_sm_ff_up, NULL); #endif ! gtk_container_add(GTK_CONTAINER(instance->ff_event_box), ! instance->image_ff); ! gtk_widget_show(instance->image_ff); ! gtk_widget_show(instance->ff_event_box); ! } --- 641,681 ---- if (instance->panel_drawn == 0) return; ! if (instance->controlsvisible == 1) { ! if (instance->panel_height > 16) ! instance->panel_height = 16; ! gtk_container_remove(GTK_CONTAINER(instance->ff_event_box), ! instance->image_ff); #ifdef GTK2_ENABLED ! instance->image_ff = ! gtk_image_new_from_pixbuf(instance->pb_sm_ff_down); #endif #ifdef GTK1_ENABLED ! instance->image_ff = gtk_pixmap_new(instance->pb_sm_ff_down, NULL); #endif ! gtk_container_add(GTK_CONTAINER(instance->ff_event_box), ! instance->image_ff); ! gtk_widget_show(instance->image_ff); ! gtk_widget_show(instance->ff_event_box); ! gdk_flush(); ! instance->FastForward(); ! usleep(500); ! gtk_container_remove(GTK_CONTAINER(instance->ff_event_box), ! instance->image_ff); #ifdef GTK2_ENABLED ! instance->image_ff = ! gtk_image_new_from_pixbuf(instance->pb_sm_ff_up); #endif #ifdef GTK1_ENABLED ! instance->image_ff = gtk_pixmap_new(instance->pb_sm_ff_up, NULL); #endif ! gtk_container_add(GTK_CONTAINER(instance->ff_event_box), ! instance->image_ff); ! gtk_widget_show(instance->image_ff); ! gtk_widget_show(instance->ff_event_box); ! } } *************** *** 676,718 **** if (instance->panel_drawn == 0) return; ! if (instance->controlsvisible == 0) ! return; ! if (instance->panel_height > 16) ! instance->panel_height = 16; ! gtk_container_remove(GTK_CONTAINER(instance->rew_event_box), ! instance->image_rew); #ifdef GTK2_ENABLED ! instance->image_rew = ! gtk_image_new_from_pixbuf(instance->pb_sm_rew_down); #endif #ifdef GTK1_ENABLED ! instance->image_rew = gtk_pixmap_new(instance->pb_sm_rew_down, NULL); #endif ! gtk_container_add(GTK_CONTAINER(instance->rew_event_box), ! instance->image_rew); ! gtk_widget_show(instance->image_rew); ! gtk_widget_show(instance->rew_event_box); ! gdk_flush(); ! instance->FastReverse(); ! usleep(500); ! gtk_container_remove(GTK_CONTAINER(instance->rew_event_box), ! instance->image_rew); #ifdef GTK2_ENABLED ! instance->image_rew = ! gtk_image_new_from_pixbuf(instance->pb_sm_rew_up); #endif #ifdef GTK1_ENABLED ! instance->image_rew = gtk_pixmap_new(instance->pb_sm_rew_up, NULL); #endif ! gtk_container_add(GTK_CONTAINER(instance->rew_event_box), ! instance->image_rew); ! gtk_widget_show(instance->image_rew); ! gtk_widget_show(instance->rew_event_box); ! } --- 686,728 ---- if (instance->panel_drawn == 0) return; ! if (instance->controlsvisible == 1) { ! if (instance->panel_height > 16) ! instance->panel_height = 16; ! gtk_container_remove(GTK_CONTAINER(instance->rew_event_box), ! instance->image_rew); #ifdef GTK2_ENABLED ! instance->image_rew = ! gtk_image_new_from_pixbuf(instance->pb_sm_rew_down); #endif #ifdef GTK1_ENABLED ! instance->image_rew = ! gtk_pixmap_new(instance->pb_sm_rew_down, NULL); #endif ! gtk_container_add(GTK_CONTAINER(instance->rew_event_box), ! instance->image_rew); ! gtk_widget_show(instance->image_rew); ! gtk_widget_show(instance->rew_event_box); ! gdk_flush(); ! instance->FastReverse(); ! usleep(500); ! gtk_container_remove(GTK_CONTAINER(instance->rew_event_box), ! instance->image_rew); #ifdef GTK2_ENABLED ! instance->image_rew = ! gtk_image_new_from_pixbuf(instance->pb_sm_rew_up); #endif #ifdef GTK1_ENABLED ! instance->image_rew = gtk_pixmap_new(instance->pb_sm_rew_up, NULL); #endif ! gtk_container_add(GTK_CONTAINER(instance->rew_event_box), ! instance->image_rew); ! gtk_widget_show(instance->image_rew); ! gtk_widget_show(instance->rew_event_box); ! } } *************** *** 726,763 **** if (instance->panel_drawn == 0) return; ! if (instance->controlsvisible == 0) ! return; ! if (instance->panel_height > 16) ! instance->panel_height = 16; ! gtk_container_remove(GTK_CONTAINER(instance->fs_event_box), ! instance->image_fs); ! if (instance->fullscreen) { #ifdef GTK2_ENABLED ! instance->image_fs = ! gtk_image_new_from_pixbuf(instance->pb_sm_fs_up); #endif #ifdef GTK1_ENABLED ! instance->image_fs = gtk_pixmap_new(instance->pb_sm_fs_up, NULL); #endif ! } else { #ifdef GTK2_ENABLED ! instance->image_fs = ! gtk_image_new_from_pixbuf(instance->pb_sm_fs_down); #endif #ifdef GTK1_ENABLED ! instance->image_fs = gtk_pixmap_new(instance->pb_sm_fs_down, NULL); #endif ! } ! gtk_container_add(GTK_CONTAINER(instance->fs_event_box), ! instance->image_fs); ! gtk_widget_show(instance->image_fs); ! gtk_widget_show(instance->fs_event_box); ! gtk_widget_show(instance->fixed_container); ! gdk_flush(); if (widget != NULL) instance->SetFullscreen(!instance->fullscreen); --- 736,775 ---- if (instance->panel_drawn == 0) return; ! if (instance->controlsvisible == 1) { ! if (instance->panel_height > 16) ! instance->panel_height = 16; ! gtk_container_remove(GTK_CONTAINER(instance->fs_event_box), ! instance->image_fs); ! if (instance->fullscreen) { #ifdef GTK2_ENABLED ! instance->image_fs = ! gtk_image_new_from_pixbuf(instance->pb_sm_fs_up); #endif #ifdef GTK1_ENABLED ! instance->image_fs = ! gtk_pixmap_new(instance->pb_sm_fs_up, NULL); #endif ! } else { #ifdef GTK2_ENABLED ! instance->image_fs = ! gtk_image_new_from_pixbuf(instance->pb_sm_fs_down); #endif #ifdef GTK1_ENABLED ! instance->image_fs = ! gtk_pixmap_new(instance->pb_sm_fs_down, NULL); #endif ! } ! gtk_container_add(GTK_CONTAINER(instance->fs_event_box), ! instance->image_fs); ! gtk_widget_show(instance->image_fs); ! gtk_widget_show(instance->fs_event_box); ! gtk_widget_show(instance->fixed_container); ! gdk_flush(); ! } if (widget != NULL) instance->SetFullscreen(!instance->fullscreen); *************** *** 1022,1025 **** --- 1034,1039 ---- instance->percent); } + if (instance->percent >= 0.99) + gtk_widget_hide(GTK_WIDGET(instance->progress_bar)); } return FALSE; *************** *** 1039,1042 **** --- 1053,1057 ---- instance->movie_width, instance->movie_height); + gtk_widget_hide(GTK_WIDGET(instance->progress_bar)); } return FALSE; *************** *** 1075,1125 **** } ! gint popup_handler(GtkWidget *widget, GdkEvent *event) { ! GtkMenu *menu; ! GdkEventButton *event_button; ! if (DEBUG) ! printf("popup menu callback\n"); ! ! menu = GTK_MENU(widget); ! if (DEBUG) ! printf("event type # %i\n",event->type); ! if (event->type == GDK_BUTTON_PRESS) { ! event_button = (GdkEventButton *)event; ! if (DEBUG) ! printf("button press # %i\n",event_button->button); ! if (event_button->button == 3) { ! gtk_menu_popup(menu, NULL, NULL, NULL, NULL, event_button->button,event_button->time); ! return TRUE; ! } } ! return FALSE; } ! void menuitem_play_callback(GtkMenuItem *menuitem, nsPluginInstance* instance) { ! play_callback(GTK_WIDGET(menuitem),NULL,instance); } ! void menuitem_pause_callback(GtkMenuItem *menuitem, nsPluginInstance* instance) { ! pause_callback(GTK_WIDGET(menuitem),NULL,instance); } ! void menuitem_stop_callback(GtkMenuItem *menuitem, nsPluginInstance* instance) { ! stop_callback(GTK_WIDGET(menuitem),NULL,instance); } ! void menuitem_showcontrols_callback(GtkCheckMenuItem *menuitem, nsPluginInstance* instance) { ! instance->SetShowControls(gtk_check_menu_item_get_active(menuitem)); } ! void menuitem_fullscreen_callback(GtkCheckMenuItem *menuitem, nsPluginInstance* instance) { ! instance->SetFullscreen(gtk_check_menu_item_get_active(menuitem)); } ! #endif --- 1090,1150 ---- } ! gint popup_handler(GtkWidget * widget, GdkEvent * event) { ! GtkMenu *menu; ! GdkEventButton *event_button; ! ! if (DEBUG) ! printf("popup menu callback\n"); ! ! menu = GTK_MENU(widget); ! if (DEBUG) ! printf("event type # %i\n", event->type); ! if (event->type == GDK_BUTTON_PRESS) { ! event_button = (GdkEventButton *) event; if (DEBUG) ! printf("button press # %i\n", event_button->button); ! if (event_button->button == 3) { ! gtk_menu_popup(menu, NULL, NULL, NULL, NULL, ! event_button->button, event_button->time); ! return TRUE; } ! } ! return FALSE; } ! void menuitem_play_callback(GtkMenuItem * menuitem, ! nsPluginInstance * instance) { ! play_callback(GTK_WIDGET(menuitem), NULL, instance); } ! void menuitem_pause_callback(GtkMenuItem * menuitem, ! nsPluginInstance * instance) { ! pause_callback(GTK_WIDGET(menuitem), NULL, instance); } ! void menuitem_stop_callback(GtkMenuItem * menuitem, ! nsPluginInstance * instance) { ! stop_callback(GTK_WIDGET(menuitem), NULL, instance); } ! void menuitem_showcontrols_callback(GtkCheckMenuItem * menuitem, ! nsPluginInstance * instance) { ! #ifdef GTK2_ENABLED ! instance->SetShowControls(gtk_check_menu_item_get_active(menuitem)); ! #endif } ! void menuitem_fullscreen_callback(GtkCheckMenuItem * menuitem, ! nsPluginInstance * instance) { ! #ifdef GTK2_ENABLED ! instance->SetFullscreen(gtk_check_menu_item_get_active(menuitem)); ! #endif } ! #endif Index: plugin-threads.cpp =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin-threads.cpp,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** plugin-threads.cpp 28 Mar 2004 19:50:15 -0000 1.84 --- plugin-threads.cpp 29 Mar 2004 22:14:15 -0000 1.85 *************** *** 316,322 **** instance->drawing_area, 0, 0); gtk_widget_show(instance->drawing_area); ! gtk_widget_set_events(instance->drawing_area, GDK_BUTTON_PRESS_MASK); ! g_signal_connect_swapped(GTK_OBJECT(instance->drawing_area),"button_press_event", G_CALLBACK(popup_handler), ! GTK_OBJECT(instance->popup_menu)); instance->player_window = GDK_WINDOW_XWINDOW(instance->drawing_area->window); --- 316,321 ---- instance->drawing_area, 0, 0); gtk_widget_show(instance->drawing_area); ! gtk_widget_set_events(instance->drawing_area, ! GDK_BUTTON_PRESS_MASK); instance->player_window = GDK_WINDOW_XWINDOW(instance->drawing_area->window); *************** *** 344,350 **** instance->window_width - 20, 19); gtk_widget_show(instance->drawing_area); ! gtk_widget_set_events(instance->drawing_area, GDK_BUTTON_PRESS_MASK); ! g_signal_connect_swapped(GTK_OBJECT(instance->drawing_area),"button_press_event", G_CALLBACK(popup_handler), ! GTK_OBJECT(instance->popup_menu)); instance->player_window = GDK_WINDOW_XWINDOW(instance->drawing_area->window); --- 343,348 ---- instance->window_width - 20, 19); gtk_widget_show(instance->drawing_area); ! gtk_widget_set_events(instance->drawing_area, ! GDK_BUTTON_PRESS_MASK); instance->player_window = GDK_WINDOW_XWINDOW(instance->drawing_area->window); Index: plugin.cpp =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin.cpp,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** plugin.cpp 29 Mar 2004 18:15:18 -0000 1.86 --- plugin.cpp 29 Mar 2004 22:14:15 -0000 1.87 *************** *** 489,523 **** #endif InitPixbufs(this); ! popup_menu = GTK_MENU(gtk_menu_new()); ! menuitem_play = GTK_MENU_ITEM(gtk_menu_item_new_with_label("Play")); ! gtk_menu_append(popup_menu,GTK_WIDGET(menuitem_play)); gtk_widget_show(GTK_WIDGET(menuitem_play)); ! menuitem_pause = GTK_MENU_ITEM(gtk_menu_item_new_with_label("Pause")); ! gtk_menu_append(popup_menu,GTK_WIDGET(menuitem_pause)); gtk_widget_show(GTK_WIDGET(menuitem_pause)); ! menuitem_stop = GTK_MENU_ITEM(gtk_menu_item_new_with_label("Stop")); ! gtk_menu_append(popup_menu,GTK_WIDGET(menuitem_stop)); gtk_widget_show(GTK_WIDGET(menuitem_stop)); menuitem_blank = GTK_MENU_ITEM(gtk_menu_item_new()); ! gtk_menu_append(popup_menu,GTK_WIDGET(menuitem_blank)); gtk_widget_show(GTK_WIDGET(menuitem_blank)); ! menuitem_showcontrols = GTK_MENU_ITEM(gtk_check_menu_item_new_with_label("Show Controls")); ! gtk_menu_append(popup_menu,GTK_WIDGET(menuitem_showcontrols)); gtk_widget_show(GTK_WIDGET(menuitem_showcontrols)); if (showcontrols) ! gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem_showcontrols),TRUE); ! menuitem_fullscreen = GTK_MENU_ITEM(gtk_check_menu_item_new_with_label("Full Screen")); ! gtk_menu_append(popup_menu,GTK_WIDGET(menuitem_fullscreen)); gtk_widget_show(GTK_WIDGET(menuitem_fullscreen)); ! gtk_widget_set_events(gtkwidget, GDK_BUTTON_PRESS_MASK); #ifdef GTK2_ENABLED ! g_signal_connect_swapped(GTK_OBJECT(gtkwidget),"button_press_event", G_CALLBACK(popup_handler), GTK_OBJECT(popup_menu)); ! g_signal_connect(GTK_OBJECT(menuitem_play),"activate",G_CALLBACK(menuitem_play_callback),this); ! g_signal_connect(GTK_OBJECT(menuitem_pause),"activate",G_CALLBACK(menuitem_pause_callback),this); ! g_signal_connect(GTK_OBJECT(menuitem_stop),"activate",G_CALLBACK(menuitem_stop_callback),this); ! g_signal_connect(GTK_OBJECT(menuitem_showcontrols),"toggled",G_CALLBACK(menuitem_showcontrols_callback),this); ! g_signal_connect(GTK_OBJECT(menuitem_fullscreen),"toggled",G_CALLBACK(menuitem_fullscreen_callback),this); ! #endif --- 489,539 ---- #endif InitPixbufs(this); ! popup_menu = GTK_MENU(gtk_menu_new()); ! menuitem_play = ! GTK_MENU_ITEM(gtk_menu_item_new_with_label("Play")); ! gtk_menu_append(popup_menu, GTK_WIDGET(menuitem_play)); gtk_widget_show(GTK_WIDGET(menuitem_play)); ! menuitem_pause = ! GTK_MENU_ITEM(gtk_menu_item_new_with_label("Pause")); ! gtk_menu_append(popup_menu, GTK_WIDGET(menuitem_pause)); gtk_widget_show(GTK_WIDGET(menuitem_pause)); ! menuitem_stop = ! GTK_MENU_ITEM(gtk_menu_item_new_with_label("Stop")); ! gtk_menu_append(popup_menu, GTK_WIDGET(menuitem_stop)); gtk_widget_show(GTK_WIDGET(menuitem_stop)); menuitem_blank = GTK_MENU_ITEM(gtk_menu_item_new()); ! gtk_menu_append(popup_menu, GTK_WIDGET(menuitem_blank)); gtk_widget_show(GTK_WIDGET(menuitem_blank)); ! menuitem_showcontrols = ! GTK_MENU_ITEM(gtk_check_menu_item_new_with_label ! ("Show Controls")); ! gtk_menu_append(popup_menu, GTK_WIDGET(menuitem_showcontrols)); gtk_widget_show(GTK_WIDGET(menuitem_showcontrols)); if (showcontrols) ! gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM ! (menuitem_showcontrols), TRUE); ! menuitem_fullscreen = ! GTK_MENU_ITEM(gtk_check_menu_item_new_with_label ! ("Full Screen")); ! gtk_menu_append(popup_menu, GTK_WIDGET(menuitem_fullscreen)); gtk_widget_show(GTK_WIDGET(menuitem_fullscreen)); ! gtk_widget_set_events(gtkwidget, GDK_BUTTON_PRESS_MASK); #ifdef GTK2_ENABLED ! g_signal_connect_swapped(GTK_OBJECT(gtkwidget), ! "button_press_event", ! G_CALLBACK(popup_handler), ! GTK_OBJECT(popup_menu)); ! g_signal_connect(GTK_OBJECT(menuitem_play), "activate", ! G_CALLBACK(menuitem_play_callback), this); ! g_signal_connect(GTK_OBJECT(menuitem_pause), "activate", ! G_CALLBACK(menuitem_pause_callback), this); ! g_signal_connect(GTK_OBJECT(menuitem_stop), "activate", ! G_CALLBACK(menuitem_stop_callback), this); ! g_signal_connect(GTK_OBJECT(menuitem_showcontrols), "toggled", ! G_CALLBACK(menuitem_showcontrols_callback), this); ! g_signal_connect(GTK_OBJECT(menuitem_fullscreen), "toggled", ! G_CALLBACK(menuitem_fullscreen_callback), this); ! #endif *************** *** 1112,1136 **** } } else { ! if (fullscreen == 0) { #ifdef X_ENABLED ! DrawUI(widget, this, message, ! 0, ! (int) ((currdownload / (maxdownload * 1.0)) * 100)); #endif #ifdef GTK_ENABLED ! if (progress_bar != NULL && maxdownload != 0) { ! gtk_progress_bar_update(progress_bar, ! ((currdownload * 1.0) / ! (maxdownload * 1.0))); ! gtk_widget_show(GTK_WIDGET(progress_bar)); ! gtk_widget_queue_draw(GTK_WIDGET(progress_bar)); ! } ! if (status != NULL) { ! gtk_label_set_text(status, message); ! gtk_widget_show(GTK_WIDGET(status)); ! gtk_widget_queue_draw(GTK_WIDGET(status)); ! } #endif ! } } --- 1128,1153 ---- } } else { ! if (fullscreen == 0) { #ifdef X_ENABLED ! DrawUI(widget, this, message, ! 0, ! (int) ((currdownload / (maxdownload * 1.0)) * ! 100)); #endif #ifdef GTK_ENABLED ! if (progress_bar != NULL && maxdownload != 0) { ! gtk_progress_bar_update(progress_bar, ! ((currdownload * 1.0) / ! (maxdownload * 1.0))); ! gtk_widget_show(GTK_WIDGET(progress_bar)); ! gtk_widget_queue_draw(GTK_WIDGET(progress_bar)); ! } ! if (status != NULL) { ! gtk_label_set_text(status, message); ! gtk_widget_show(GTK_WIDGET(status)); ! gtk_widget_queue_draw(GTK_WIDGET(status)); ! } #endif ! } } *************** *** 1537,1541 **** #endif ! } --- 1554,1562 ---- #endif ! #ifdef GTK2_ENABLED ! gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM ! (menuitem_showcontrols), ! controlsvisible); ! #endif } *************** *** 1550,1558 **** int multiplier, height = 0, width; Display *xdisp; ! #ifdef GTK_ENABLED GdkDisplay *gdisp; GdkScreen *screen; #endif ! int x, y; if (DEBUG) --- 1571,1579 ---- int multiplier, height = 0, width; Display *xdisp; ! #ifdef GTK2_ENABLED GdkDisplay *gdisp; GdkScreen *screen; #endif ! int x, y, disp_y, pos_y; if (DEBUG) *************** *** 1565,1569 **** fullscreen = 1; } else { ! #ifdef GTK_ENABLED XReparentWindow(GDK_WINDOW_XDISPLAY(gtkwidget->window), GDK_WINDOW_XWINDOW(gtkwidget->window), window, --- 1586,1590 ---- fullscreen = 1; } else { ! #ifdef GTK2_ENABLED XReparentWindow(GDK_WINDOW_XDISPLAY(gtkwidget->window), GDK_WINDOW_XWINDOW(gtkwidget->window), window, *************** *** 1616,1628 **** } if (mode == NP_EMBED) { ! gtk_widget_set_usize(drawing_area, ! embed_width, embed_height - height); } else { gtk_fixed_move(GTK_FIXED(fixed_container), ! GTK_WIDGET(drawing_area), ! 10, 100); ! gtk_widget_set_usize(drawing_area, movie_width, movie_height); ! } #endif --- 1637,1662 ---- } + if (mode == NP_EMBED) { ! if (movie_height != 0 && movie_width != 0) { ! gtk_widget_set_usize(drawing_area, ! movie_width, movie_height); ! } else { ! gtk_widget_set_usize(drawing_area, ! embed_width, embed_height); ! } ! gtk_fixed_move(GTK_FIXED(fixed_container), ! GTK_WIDGET(drawing_area), 0, 0); } else { gtk_fixed_move(GTK_FIXED(fixed_container), ! GTK_WIDGET(drawing_area), 10, 100); ! if (movie_height != 0 && movie_width != 0) { ! gtk_widget_set_usize(drawing_area, ! movie_width, movie_height); ! } else { ! gtk_widget_set_usize(drawing_area, ! window_width, window_height); ! } ! } #endif *************** *** 1632,1636 **** } else { if (value) { ! #ifdef GTK_ENABLED XReparentWindow(GDK_WINDOW_XDISPLAY(gtkwidget->window), GDK_WINDOW_XWINDOW(gtkwidget->window), --- 1666,1670 ---- } else { if (value) { ! #ifdef GTK2_ENABLED XReparentWindow(GDK_WINDOW_XDISPLAY(gtkwidget->window), GDK_WINDOW_XWINDOW(gtkwidget->window), *************** *** 1680,1691 **** } ! if (mode == NP_EMBED) { ! gtk_widget_set_usize(drawing_area, x, y - height); } else { ! gtk_fixed_move(GTK_FIXED(fixed_container), ! GTK_WIDGET(drawing_area), ! 0, 0); ! gtk_widget_set_usize(drawing_area, x, y - height); ! } #endif --- 1714,1735 ---- } ! ! if (movie_height != 0 && movie_width != 0) { ! disp_y = x * movie_height / movie_width; } else { ! if (mode == NP_EMBED) { ! disp_y = x * embed_height / embed_width; ! } else { ! disp_y = x * window_height / window_width; ! } ! } ! pos_y = (y - disp_y) / 2; ! if (disp_y > (y - 16)) { ! disp_y = y - 16; ! pos_y = 0; ! } ! gtk_widget_set_usize(drawing_area, x, disp_y); ! gtk_fixed_move(GTK_FIXED(fixed_container), ! GTK_WIDGET(drawing_area), 0, pos_y); #endif *************** *** 1696,1699 **** --- 1740,1747 ---- } } + #ifdef GTK2_ENABLED + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM + (menuitem_fullscreen), fullscreen); + #endif } |