Commit d96dc743 authored by Jean-Paul Saman's avatar Jean-Paul Saman

PDA Interface:

- Removing obsolete files.
- Remove debug messages.
parent 324bfec1
/* This file was created automatically by glade and fixed by bootstrap */
#include <vlc/vlc.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include "callbacks.h"
#include "interface.h"
#include "support.h"
GtkWidget*
create_pda (void)
{
GtkWidget *pda;
GtkWidget *vbox;
GtkWidget *toolbar;
GtkWidget *tmp_toolbar_icon;
GtkWidget *toolbar_open;
GtkWidget *toolbar_playlist;
GtkWidget *toolbar_preferences;
GtkWidget *toolbar_rewind;
GtkWidget *toolbar_pause;
GtkWidget *toolbar_play;
GtkWidget *toolbar_stop;
GtkWidget *toolbar_forward;
GtkWidget *toolbar_about;
GtkWidget *slider_label;
GtkWidget *slider;
GtkWidget *notebook;
GtkWidget *vbox1;
GtkWidget *hbox1;
GtkWidget *buttonMrlGo;
GtkWidget *labelUrl;
GtkWidget *mrl_combo;
GList *mrl_combo_items = NULL;
GtkWidget *mrl_entry;
GtkWidget *mediabook;
GtkWidget *scrolledwindow4;
GtkWidget *viewport2;
GtkWidget *clistmedia;
GtkWidget *labelname;
GtkWidget *labeltype;
GtkWidget *label13;
GtkWidget *vbox3;
GSList *network_group = NULL;
GtkWidget *network_multicast;
GtkWidget *table1;
GtkWidget *label21;
GtkWidget *label22;
GtkObject *network_multicast_port_adj;
GtkWidget *network_multicast_port;
GtkWidget *combo2;
GtkWidget *network_multicast_address;
GtkWidget *hseparator10;
GtkWidget *hbox9;
GtkWidget *network_http;
GtkWidget *network_ftp;
GtkWidget *network_mms;
GtkWidget *hseparator11;
GtkWidget *label20;
GtkWidget *media2;
GtkWidget *vbox4;
GtkWidget *scrolledwindow5;
GtkWidget *clistplaylist;
GtkWidget *label25;
GtkWidget *label26;
GtkWidget *hbox11;
GtkWidget *update_playlist;
GtkWidget *playlist_del;
GtkWidget *playlist_clear;
GtkWidget *playlist;
GtkWidget *vbox2;
GtkWidget *cbautoplay;
GtkWidget *hbox2;
GtkWidget *buttonSave;
GtkWidget *buttonApply;
GtkWidget *buttonCancel;
GtkWidget *preferences;
GtkWidget *scrolledwindow3;
GtkWidget *viewport1;
GtkWidget *fixed2;
GtkWidget *pixmap2;
GtkWidget *label8;
GtkWidget *label9;
GtkWidget *label11;
GtkWidget *label27;
GtkWidget *label10;
GtkWidget *about;
pda = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_set_name (pda, "pda");
gtk_object_set_data (GTK_OBJECT (pda), "pda", pda);
gtk_window_set_title (GTK_WINDOW (pda), _("VLC media player"));
gtk_window_set_policy (GTK_WINDOW (pda), TRUE, TRUE, TRUE);
vbox = gtk_vbox_new (FALSE, 0);
gtk_widget_set_name (vbox, "vbox");
gtk_widget_ref (vbox);
gtk_object_set_data_full (GTK_OBJECT (pda), "vbox", vbox,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (vbox);
gtk_container_add (GTK_CONTAINER (pda), vbox);
toolbar = gtk_toolbar_new ();
gtk_toolbar_set_orientation( GTK_TOOLBAR(toolbar),GTK_ORIENTATION_HORIZONTAL);
gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS);
gtk_widget_set_name (toolbar, "toolbar");
gtk_widget_ref (toolbar);
gtk_object_set_data_full (GTK_OBJECT (pda), "toolbar", toolbar,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar);
gtk_box_pack_start (GTK_BOX (vbox), toolbar, FALSE, FALSE, 5);
gtk_widget_set_usize (toolbar, 240, 12);
tmp_toolbar_icon = create_pixmap (pda, "pda-openb16x16.xpm");
toolbar_open = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
GTK_TOOLBAR_CHILD_BUTTON,
NULL,
"",
_("Open file"), NULL,
tmp_toolbar_icon, NULL, NULL);
gtk_widget_set_name (toolbar_open, "toolbar_open");
gtk_widget_ref (toolbar_open);
gtk_object_set_data_full (GTK_OBJECT (pda), "toolbar_open", toolbar_open,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_open);
tmp_toolbar_icon = create_pixmap (pda, "pda-playlistb16x16.xpm");
toolbar_playlist = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
GTK_TOOLBAR_CHILD_BUTTON,
NULL,
"",
NULL, NULL,
tmp_toolbar_icon, NULL, NULL);
gtk_widget_set_name (toolbar_playlist, "toolbar_playlist");
gtk_widget_ref (toolbar_playlist);
gtk_object_set_data_full (GTK_OBJECT (pda), "toolbar_playlist", toolbar_playlist,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_playlist);
tmp_toolbar_icon = create_pixmap (pda, "pda-preferencesb16x16.xpm");
toolbar_preferences = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
GTK_TOOLBAR_CHILD_BUTTON,
NULL,
_("Preferences"),
_("Preferences"), NULL,
tmp_toolbar_icon, NULL, NULL);
gtk_widget_set_name (toolbar_preferences, "toolbar_preferences");
gtk_widget_ref (toolbar_preferences);
gtk_object_set_data_full (GTK_OBJECT (pda), "toolbar_preferences", toolbar_preferences,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_preferences);
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
tmp_toolbar_icon = create_pixmap (pda, "pda-rewindb16x16.xpm");
toolbar_rewind = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
GTK_TOOLBAR_CHILD_BUTTON,
NULL,
_("Rewind"),
_("Rewind stream"), NULL,
tmp_toolbar_icon, NULL, NULL);
gtk_widget_set_name (toolbar_rewind, "toolbar_rewind");
gtk_widget_ref (toolbar_rewind);
gtk_object_set_data_full (GTK_OBJECT (pda), "toolbar_rewind", toolbar_rewind,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_rewind);
tmp_toolbar_icon = create_pixmap (pda, "pda-pauseb16x16.xpm");
toolbar_pause = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
GTK_TOOLBAR_CHILD_BUTTON,
NULL,
_("Pause"),
_("Pause stream"), NULL,
tmp_toolbar_icon, NULL, NULL);
gtk_widget_set_name (toolbar_pause, "toolbar_pause");
gtk_widget_ref (toolbar_pause);
gtk_object_set_data_full (GTK_OBJECT (pda), "toolbar_pause", toolbar_pause,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_pause);
tmp_toolbar_icon = create_pixmap (pda, "pda-playb16x16.xpm");
toolbar_play = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
GTK_TOOLBAR_CHILD_BUTTON,
NULL,
_("Play"),
_("Play stream"), NULL,
tmp_toolbar_icon, NULL, NULL);
gtk_widget_set_name (toolbar_play, "toolbar_play");
gtk_widget_ref (toolbar_play);
gtk_object_set_data_full (GTK_OBJECT (pda), "toolbar_play", toolbar_play,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_play);
tmp_toolbar_icon = create_pixmap (pda, "pda-stopb16x16.xpm");
toolbar_stop = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
GTK_TOOLBAR_CHILD_BUTTON,
NULL,
_("Stop"),
_("Stop stream"), NULL,
tmp_toolbar_icon, NULL, NULL);
gtk_widget_set_name (toolbar_stop, "toolbar_stop");
gtk_widget_ref (toolbar_stop);
gtk_object_set_data_full (GTK_OBJECT (pda), "toolbar_stop", toolbar_stop,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_stop);
tmp_toolbar_icon = create_pixmap (pda, "pda-forwardb16x16.xpm");
toolbar_forward = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
GTK_TOOLBAR_CHILD_BUTTON,
NULL,
_("Forward"),
_("Forward stream"), NULL,
tmp_toolbar_icon, NULL, NULL);
gtk_widget_set_name (toolbar_forward, "toolbar_forward");
gtk_widget_ref (toolbar_forward);
gtk_object_set_data_full (GTK_OBJECT (pda), "toolbar_forward", toolbar_forward,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_forward);
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
tmp_toolbar_icon = create_pixmap (pda, "vlc16x16.xpm");
toolbar_about = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
GTK_TOOLBAR_CHILD_BUTTON,
NULL,
_("About"),
_("About"), NULL,
tmp_toolbar_icon, NULL, NULL);
gtk_widget_set_name (toolbar_about, "toolbar_about");
gtk_widget_ref (toolbar_about);
gtk_object_set_data_full (GTK_OBJECT (pda), "toolbar_about", toolbar_about,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_about);
slider_label = gtk_label_new ("0:00:00");
gtk_widget_set_name (slider_label, "slider_label");
gtk_widget_ref (slider_label);
gtk_object_set_data_full (GTK_OBJECT (pda), "slider_label", slider_label,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (slider_label);
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
gtk_toolbar_append_widget (GTK_TOOLBAR (toolbar), slider_label, NULL, NULL);
slider = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 1, 6.25, 0)));
gtk_widget_set_name (slider, "slider");
gtk_widget_ref (slider);
gtk_object_set_data_full (GTK_OBJECT (pda), "slider", slider,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (slider);
gtk_box_pack_start (GTK_BOX (vbox), slider, FALSE, FALSE, 4);
gtk_scale_set_draw_value (GTK_SCALE (slider), FALSE);
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_RIGHT);
gtk_scale_set_digits (GTK_SCALE (slider), 3);
notebook = gtk_notebook_new ();
gtk_widget_set_name (notebook, "notebook");
gtk_widget_ref (notebook);
gtk_object_set_data_full (GTK_OBJECT (pda), "notebook", notebook,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (notebook);
gtk_box_pack_end (GTK_BOX (vbox), notebook, TRUE, TRUE, 0);
vbox1 = gtk_vbox_new (FALSE, 0);
gtk_widget_set_name (vbox1, "vbox1");
gtk_widget_ref (vbox1);
gtk_object_set_data_full (GTK_OBJECT (pda), "vbox1", vbox1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (vbox1);
gtk_container_add (GTK_CONTAINER (notebook), vbox1);
hbox1 = gtk_hbox_new (FALSE, 0);
gtk_widget_set_name (hbox1, "hbox1");
gtk_widget_ref (hbox1);
gtk_object_set_data_full (GTK_OBJECT (pda), "hbox1", hbox1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbox1);
gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, TRUE, 0);
buttonMrlGo = gtk_button_new_with_label (_("Add"));
gtk_widget_set_name (buttonMrlGo, "buttonMrlGo");
gtk_widget_ref (buttonMrlGo);
gtk_object_set_data_full (GTK_OBJECT (pda), "buttonMrlGo", buttonMrlGo,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (buttonMrlGo);
gtk_box_pack_start (GTK_BOX (hbox1), buttonMrlGo, FALSE, FALSE, 0);
labelUrl = gtk_label_new (_("MRL :"));
gtk_widget_set_name (labelUrl, "labelUrl");
gtk_widget_ref (labelUrl);
gtk_object_set_data_full (GTK_OBJECT (pda), "labelUrl", labelUrl,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (labelUrl);
gtk_box_pack_start (GTK_BOX (hbox1), labelUrl, FALSE, FALSE, 2);
mrl_combo = gtk_combo_new ();
gtk_widget_set_name (mrl_combo, "mrl_combo");
gtk_widget_ref (mrl_combo);
gtk_object_set_data_full (GTK_OBJECT (pda), "mrl_combo", mrl_combo,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (mrl_combo);
gtk_box_pack_start (GTK_BOX (hbox1), mrl_combo, TRUE, TRUE, 3);
mrl_combo_items = g_list_append (mrl_combo_items, (gpointer) "file://");
mrl_combo_items = g_list_append (mrl_combo_items, (gpointer) "ftp://");
mrl_combo_items = g_list_append (mrl_combo_items, (gpointer) "http://");
mrl_combo_items = g_list_append (mrl_combo_items, (gpointer) "udp://@:1234");
mrl_combo_items = g_list_append (mrl_combo_items, (gpointer) "udp6://@:1234");
mrl_combo_items = g_list_append (mrl_combo_items, (gpointer) "rtp://");
mrl_combo_items = g_list_append (mrl_combo_items, (gpointer) "rtp6://");
gtk_combo_set_popdown_strings (GTK_COMBO (mrl_combo), mrl_combo_items);
g_list_free (mrl_combo_items);
mrl_entry = GTK_COMBO (mrl_combo)->entry;
gtk_widget_set_name (mrl_entry, "mrl_entry");
gtk_widget_ref (mrl_entry);
gtk_object_set_data_full (GTK_OBJECT (pda), "mrl_entry", mrl_entry,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (mrl_entry);
gtk_entry_set_text (GTK_ENTRY (mrl_entry), "file://");
mediabook = gtk_notebook_new ();
gtk_widget_set_name (mediabook, "mediabook");
gtk_widget_ref (mediabook);
gtk_object_set_data_full (GTK_OBJECT (pda), "mediabook", mediabook,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (mediabook);
gtk_box_pack_start (GTK_BOX (vbox1), mediabook, TRUE, TRUE, 0);
scrolledwindow4 = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_set_name (scrolledwindow4, "scrolledwindow4");
gtk_widget_ref (scrolledwindow4);
gtk_object_set_data_full (GTK_OBJECT (pda), "scrolledwindow4", scrolledwindow4,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (scrolledwindow4);
gtk_container_add (GTK_CONTAINER (mediabook), scrolledwindow4);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow4), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
viewport2 = gtk_viewport_new (NULL, NULL);
gtk_widget_set_name (viewport2, "viewport2");
gtk_widget_ref (viewport2);
gtk_object_set_data_full (GTK_OBJECT (pda), "viewport2", viewport2,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (viewport2);
gtk_container_add (GTK_CONTAINER (scrolledwindow4), viewport2);
clistmedia = gtk_clist_new (2);
gtk_widget_set_name (clistmedia, "clistmedia");
gtk_widget_ref (clistmedia);
gtk_object_set_data_full (GTK_OBJECT (pda), "clistmedia", clistmedia,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (clistmedia);
gtk_container_add (GTK_CONTAINER (viewport2), clistmedia);
gtk_clist_set_column_width (GTK_CLIST (clistmedia), 0, 129);
gtk_clist_set_column_width (GTK_CLIST (clistmedia), 1, 80);
gtk_clist_column_titles_show (GTK_CLIST (clistmedia));
labelname = gtk_label_new (_("Name"));
gtk_widget_set_name (labelname, "labelname");
gtk_widget_ref (labelname);
gtk_object_set_data_full (GTK_OBJECT (pda), "labelname", labelname,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (labelname);
gtk_clist_set_column_widget (GTK_CLIST (clistmedia), 0, labelname);
labeltype = gtk_label_new (_("Type"));
gtk_widget_set_name (labeltype, "labeltype");
gtk_widget_ref (labeltype);
gtk_object_set_data_full (GTK_OBJECT (pda), "labeltype", labeltype,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (labeltype);
gtk_clist_set_column_widget (GTK_CLIST (clistmedia), 1, labeltype);
label13 = gtk_label_new (_("File"));
gtk_widget_set_name (label13, "label13");
gtk_widget_ref (label13);
gtk_object_set_data_full (GTK_OBJECT (pda), "label13", label13,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label13);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (mediabook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (mediabook), 0), label13);
vbox3 = gtk_vbox_new (FALSE, 2);
gtk_widget_set_name (vbox3, "vbox3");
gtk_widget_ref (vbox3);
gtk_object_set_data_full (GTK_OBJECT (pda), "vbox3", vbox3,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (vbox3);
gtk_container_add (GTK_CONTAINER (mediabook), vbox3);
network_multicast = gtk_radio_button_new_with_label (network_group, _("UDP/RTP (Adress when Multicast)"));
network_group = gtk_radio_button_group (GTK_RADIO_BUTTON (network_multicast));
gtk_widget_set_name (network_multicast, "network_multicast");
gtk_widget_ref (network_multicast);
gtk_object_set_data_full (GTK_OBJECT (pda), "network_multicast", network_multicast,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_multicast);
gtk_box_pack_start (GTK_BOX (vbox3), network_multicast, FALSE, FALSE, 0);
table1 = gtk_table_new (2, 2, FALSE);
gtk_widget_set_name (table1, "table1");
gtk_widget_ref (table1);
gtk_object_set_data_full (GTK_OBJECT (pda), "table1", table1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (table1);
gtk_box_pack_start (GTK_BOX (vbox3), table1, FALSE, TRUE, 0);
gtk_table_set_col_spacings (GTK_TABLE (table1), 5);
label21 = gtk_label_new (_("Address"));
gtk_widget_set_name (label21, "label21");
gtk_widget_ref (label21);
gtk_object_set_data_full (GTK_OBJECT (pda), "label21", label21,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label21);
gtk_table_attach (GTK_TABLE (table1), label21, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label21), 0, 0.5);
label22 = gtk_label_new (_("Port"));
gtk_widget_set_name (label22, "label22");
gtk_widget_ref (label22);
gtk_object_set_data_full (GTK_OBJECT (pda), "label22", label22,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label22);
gtk_table_attach (GTK_TABLE (table1), label22, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label22), 0, 0.5);
network_multicast_port_adj = gtk_adjustment_new (1234, 1, 65536, 1, 10, 10);
network_multicast_port = gtk_spin_button_new (GTK_ADJUSTMENT (network_multicast_port_adj), 1, 0);
gtk_widget_set_name (network_multicast_port, "network_multicast_port");
gtk_widget_ref (network_multicast_port);
gtk_object_set_data_full (GTK_OBJECT (pda), "network_multicast_port", network_multicast_port,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_multicast_port);
gtk_table_attach (GTK_TABLE (table1), network_multicast_port, 1, 2, 1, 2,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
combo2 = gtk_combo_new ();
gtk_widget_set_name (combo2, "combo2");
gtk_widget_ref (combo2);
gtk_object_set_data_full (GTK_OBJECT (pda), "combo2", combo2,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (combo2);
gtk_table_attach (GTK_TABLE (table1), combo2, 1, 2, 0, 1,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
network_multicast_address = GTK_COMBO (combo2)->entry;
gtk_widget_set_name (network_multicast_address, "network_multicast_address");
gtk_widget_ref (network_multicast_address);
gtk_object_set_data_full (GTK_OBJECT (pda), "network_multicast_address", network_multicast_address,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_multicast_address);
hseparator10 = gtk_hseparator_new ();
gtk_widget_set_name (hseparator10, "hseparator10");
gtk_widget_ref (hseparator10);
gtk_object_set_data_full (GTK_OBJECT (pda), "hseparator10", hseparator10,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hseparator10);
gtk_box_pack_start (GTK_BOX (vbox3), hseparator10, FALSE, TRUE, 0);
hbox9 = gtk_hbox_new (TRUE, 0);
gtk_widget_set_name (hbox9, "hbox9");
gtk_widget_ref (hbox9);
gtk_object_set_data_full (GTK_OBJECT (pda), "hbox9", hbox9,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbox9);
gtk_box_pack_start (GTK_BOX (vbox3), hbox9, FALSE, TRUE, 0);
network_http = gtk_radio_button_new_with_label (network_group, _("HTTP"));
network_group = gtk_radio_button_group (GTK_RADIO_BUTTON (network_http));
gtk_widget_set_name (network_http, "network_http");
gtk_widget_ref (network_http);
gtk_object_set_data_full (GTK_OBJECT (pda), "network_http", network_http,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_http);
gtk_box_pack_start (GTK_BOX (hbox9), network_http, FALSE, TRUE, 0);
gtk_widget_set_sensitive (network_http, FALSE);
network_ftp = gtk_radio_button_new_with_label (network_group, _("FTP"));
network_group = gtk_radio_button_group (GTK_RADIO_BUTTON (network_ftp));
gtk_widget_set_name (network_ftp, "network_ftp");
gtk_widget_ref (network_ftp);
gtk_object_set_data_full (GTK_OBJECT (pda), "network_ftp", network_ftp,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_ftp);
gtk_box_pack_start (GTK_BOX (hbox9), network_ftp, FALSE, TRUE, 0);
gtk_widget_set_sensitive (network_ftp, FALSE);
network_mms = gtk_radio_button_new_with_label (network_group, _("MMS"));
network_group = gtk_radio_button_group (GTK_RADIO_BUTTON (network_mms));
gtk_widget_set_name (network_mms, "network_mms");
gtk_widget_ref (network_mms);
gtk_object_set_data_full (GTK_OBJECT (pda), "network_mms", network_mms,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_mms);
gtk_box_pack_start (GTK_BOX (hbox9), network_mms, FALSE, TRUE, 0);
gtk_widget_set_sensitive (network_mms, FALSE);
hseparator11 = gtk_hseparator_new ();
gtk_widget_set_name (hseparator11, "hseparator11");
gtk_widget_ref (hseparator11);
gtk_object_set_data_full (GTK_OBJECT (pda), "hseparator11", hseparator11,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hseparator11);
gtk_box_pack_start (GTK_BOX (vbox3), hseparator11, TRUE, TRUE, 0);
label20 = gtk_label_new (_("Network"));
gtk_widget_set_name (label20, "label20");
gtk_widget_ref (label20);
gtk_object_set_data_full (GTK_OBJECT (pda), "label20", label20,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label20);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (mediabook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (mediabook), 1), label20);
media2 = gtk_label_new (_("Media"));
gtk_widget_set_name (media2, "media2");
gtk_widget_ref (media2);
gtk_object_set_data_full (GTK_OBJECT (pda), "media2", media2,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (media2);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 0), media2);
vbox4 = gtk_vbox_new (FALSE, 0);
gtk_widget_set_name (vbox4, "vbox4");
gtk_widget_ref (vbox4);
gtk_object_set_data_full (GTK_OBJECT (pda), "vbox4", vbox4,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (vbox4);
gtk_container_add (GTK_CONTAINER (notebook), vbox4);
scrolledwindow5 = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_set_name (scrolledwindow5, "scrolledwindow5");
gtk_widget_ref (scrolledwindow5);
gtk_object_set_data_full (GTK_OBJECT (pda), "scrolledwindow5", scrolledwindow5,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (scrolledwindow5);
gtk_box_pack_start (GTK_BOX (vbox4), scrolledwindow5, TRUE, TRUE, 0);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow5), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
clistplaylist = gtk_clist_new (2);
gtk_widget_set_name (clistplaylist, "clistplaylist");
gtk_widget_ref (clistplaylist);
gtk_object_set_data_full (GTK_OBJECT (pda), "clistplaylist", clistplaylist,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (clistplaylist);
gtk_container_add (GTK_CONTAINER (scrolledwindow5), clistplaylist);
gtk_clist_set_column_width (GTK_CLIST (clistplaylist), 0, 140);
gtk_clist_set_column_width (GTK_CLIST (clistplaylist), 1, 80);
gtk_clist_column_titles_show (GTK_CLIST (clistplaylist));
label25 = gtk_label_new (_("MRL"));
gtk_widget_set_name (label25, "label25");
gtk_widget_ref (label25);
gtk_object_set_data_full (GTK_OBJECT (pda), "label25", label25,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label25);
gtk_clist_set_column_widget (GTK_CLIST (clistplaylist), 0, label25);
gtk_label_set_justify (GTK_LABEL (label25), GTK_JUSTIFY_LEFT);
label26 = gtk_label_new (_("Time"));
gtk_widget_set_name (label26, "label26");
gtk_widget_ref (label26);
gtk_object_set_data_full (GTK_OBJECT (pda), "label26", label26,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label26);
gtk_clist_set_column_widget (GTK_CLIST (clistplaylist), 1, label26);
gtk_label_set_justify (GTK_LABEL (label26), GTK_JUSTIFY_RIGHT);
hbox11 = gtk_hbox_new (TRUE, 0);
gtk_widget_set_name (hbox11, "hbox11");
gtk_widget_ref (hbox11);
gtk_object_set_data_full (GTK_OBJECT (pda), "hbox11", hbox11,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbox11);
gtk_box_pack_start (GTK_BOX (vbox4), hbox11, FALSE, FALSE, 2);
update_playlist = gtk_button_new_with_label (_("Update"));
gtk_widget_set_name (update_playlist, "update_playlist");
gtk_widget_ref (update_playlist);
gtk_object_set_data_full (GTK_OBJECT (pda), "update_playlist", update_playlist,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (update_playlist);
gtk_box_pack_start (GTK_BOX (hbox11), update_playlist, FALSE, FALSE, 0);
playlist_del = gtk_button_new_with_label (_(" Del "));
gtk_widget_set_name (playlist_del, "playlist_del");
gtk_widget_ref (playlist_del);
gtk_object_set_data_full (GTK_OBJECT (pda), "playlist_del", playlist_del,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (playlist_del);
gtk_box_pack_start (GTK_BOX (hbox11), playlist_del, FALSE, FALSE, 5);
playlist_clear = gtk_button_new_with_label (_(" Clear "));
gtk_widget_set_name (playlist_clear, "playlist_clear");
gtk_widget_ref (playlist_clear);
gtk_object_set_data_full (GTK_OBJECT (pda), "playlist_clear", playlist_clear,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (playlist_clear);
gtk_box_pack_start (GTK_BOX (hbox11), playlist_clear, FALSE, FALSE, 5);
playlist = gtk_label_new (_("Playlist"));
gtk_widget_set_name (playlist, "playlist");
gtk_widget_ref (playlist);
gtk_object_set_data_full (GTK_OBJECT (pda), "playlist", playlist,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (playlist);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 1), playlist);
vbox2 = gtk_vbox_new (FALSE, 0);
gtk_widget_set_name (vbox2, "vbox2");
gtk_widget_ref (vbox2);
gtk_object_set_data_full (GTK_OBJECT (pda), "vbox2", vbox2,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (vbox2);
gtk_container_add (GTK_CONTAINER (notebook), vbox2);
cbautoplay = gtk_check_button_new_with_label (_("Automatically play file"));
gtk_widget_set_name (cbautoplay, "cbautoplay");
gtk_widget_ref (cbautoplay);
gtk_object_set_data_full (GTK_OBJECT (pda), "cbautoplay", cbautoplay,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (cbautoplay);
gtk_box_pack_start (GTK_BOX (vbox2), cbautoplay, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cbautoplay), TRUE);
hbox2 = gtk_hbox_new (TRUE, 0);
gtk_widget_set_name (hbox2, "hbox2");
gtk_widget_ref (hbox2);
gtk_object_set_data_full (GTK_OBJECT (pda), "hbox2", hbox2,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbox2);
gtk_box_pack_end (GTK_BOX (vbox2), hbox2, FALSE, FALSE, 2);
buttonSave = gtk_button_new_with_label (_(" Save "));
gtk_widget_set_name (buttonSave, "buttonSave");
gtk_widget_ref (buttonSave);
gtk_object_set_data_full (GTK_OBJECT (pda), "buttonSave", buttonSave,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (buttonSave);
gtk_box_pack_start (GTK_BOX (hbox2), buttonSave, FALSE, FALSE, 0);
buttonApply = gtk_button_new_with_label (_(" Apply "));
gtk_widget_set_name (buttonApply, "buttonApply");
gtk_widget_ref (buttonApply);
gtk_object_set_data_full (GTK_OBJECT (pda), "buttonApply", buttonApply,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (buttonApply);
gtk_box_pack_start (GTK_BOX (hbox2), buttonApply, FALSE, FALSE, 0);
buttonCancel = gtk_button_new_with_label (_(" Cancel "));
gtk_widget_set_name (buttonCancel, "buttonCancel");
gtk_widget_ref (buttonCancel);
gtk_object_set_data_full (GTK_OBJECT (pda), "buttonCancel", buttonCancel,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (buttonCancel);
gtk_box_pack_end (GTK_BOX (hbox2), buttonCancel, FALSE, FALSE, 0);
preferences = gtk_label_new (_("Preference"));
gtk_widget_set_name (preferences, "preferences");
gtk_widget_ref (preferences);
gtk_object_set_data_full (GTK_OBJECT (pda), "preferences", preferences,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (preferences);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 2), preferences);
scrolledwindow3 = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_set_name (scrolledwindow3, "scrolledwindow3");
gtk_widget_ref (scrolledwindow3);
gtk_object_set_data_full (GTK_OBJECT (pda), "scrolledwindow3", scrolledwindow3,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (scrolledwindow3);
gtk_container_add (GTK_CONTAINER (notebook), scrolledwindow3);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow3), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
viewport1 = gtk_viewport_new (NULL, NULL);
gtk_widget_set_name (viewport1, "viewport1");
gtk_widget_ref (viewport1);
gtk_object_set_data_full (GTK_OBJECT (pda), "viewport1", viewport1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (viewport1);
gtk_container_add (GTK_CONTAINER (scrolledwindow3), viewport1);
gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport1), GTK_SHADOW_NONE);
fixed2 = gtk_fixed_new ();
gtk_widget_set_name (fixed2, "fixed2");
gtk_widget_ref (fixed2);
gtk_object_set_data_full (GTK_OBJECT (pda), "fixed2", fixed2,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (fixed2);
gtk_container_add (GTK_CONTAINER (viewport1), fixed2);
pixmap2 = create_pixmap (pda, "vlc32x32.xpm");
gtk_widget_set_name (pixmap2, "pixmap2");
gtk_widget_ref (pixmap2);
gtk_object_set_data_full (GTK_OBJECT (pda), "pixmap2", pixmap2,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (pixmap2);
gtk_fixed_put (GTK_FIXED (fixed2), pixmap2, 8, 0);
gtk_widget_set_uposition (pixmap2, 8, 0);
gtk_widget_set_usize (pixmap2, 50, 50);
label8 = gtk_label_new (_("(c) 1996-2003 the VideoLAN team"));
gtk_widget_set_name (label8, "label8");
gtk_widget_ref (label8);
gtk_object_set_data_full (GTK_OBJECT (pda), "label8", label8,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label8);
gtk_fixed_put (GTK_FIXED (fixed2), label8, 16, 56);
gtk_widget_set_uposition (label8, 16, 56);
gtk_widget_set_usize (label8, 200, 18);
label9 = gtk_label_new (_("Authors: The VideoLAN Team, http://www.videolan.org"));
gtk_widget_set_name (label9, "label9");
gtk_widget_ref (label9);
gtk_object_set_data_full (GTK_OBJECT (pda), "label9", label9,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label9);
gtk_fixed_put (GTK_FIXED (fixed2), label9, 16, 80);
gtk_widget_set_uposition (label9, 16, 80);
gtk_widget_set_usize (label9, 200, 40);
gtk_label_set_line_wrap (GTK_LABEL (label9), TRUE);
label11 = gtk_label_new (_("VLC media player"));
gtk_widget_set_name (label11, "label11");
gtk_widget_ref (label11);
gtk_object_set_data_full (GTK_OBJECT (pda), "label11", label11,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label11);
gtk_fixed_put (GTK_FIXED (fixed2), label11, 64, 8);
gtk_widget_set_uposition (label11, 64, 8);
gtk_widget_set_usize (label11, 120, 40);
gtk_label_set_line_wrap (GTK_LABEL (label11), TRUE);
label27 = gtk_label_new ("http://www.videolan.org");
gtk_widget_set_name (label27, "label27");
gtk_widget_ref (label27);
gtk_object_set_data_full (GTK_OBJECT (pda), "label27", label27,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label27);
gtk_fixed_put (GTK_FIXED (fixed2), label27, 16, 200);
gtk_widget_set_uposition (label27, 16, 200);
gtk_widget_set_usize (label27, 208, 16);
label10 = gtk_label_new (_("The VideoLAN Client is a MPEG, MPEG 2, MP3, DivX player, that accepts input from local or network sources."));
gtk_widget_set_name (label10, "label10");
gtk_widget_ref (label10);
gtk_object_set_data_full (GTK_OBJECT (pda), "label10", label10,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label10);
gtk_fixed_put (GTK_FIXED (fixed2), label10, 16, 128);
gtk_widget_set_uposition (label10, 16, 128);
gtk_widget_set_usize (label10, 200, 70);
gtk_label_set_justify (GTK_LABEL (label10), GTK_JUSTIFY_LEFT);
gtk_label_set_line_wrap (GTK_LABEL (label10), TRUE);
about = gtk_label_new (_("About"));
gtk_widget_set_name (about, "about");
gtk_widget_ref (about);
gtk_object_set_data_full (GTK_OBJECT (pda), "about", about,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (about);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 3), about);
gtk_signal_connect (GTK_OBJECT (pda), "delete_event",
GTK_SIGNAL_FUNC (on_pda_delete_event),
NULL);
gtk_signal_connect (GTK_OBJECT (toolbar_open), "clicked",
GTK_SIGNAL_FUNC (on_toolbar_open_clicked),
NULL);
gtk_signal_connect (GTK_OBJECT (toolbar_playlist), "clicked",
GTK_SIGNAL_FUNC (on_toolbar_playlist_clicked),
NULL);
gtk_signal_connect (GTK_OBJECT (toolbar_preferences), "clicked",
GTK_SIGNAL_FUNC (on_toolbar_preferences_clicked),
NULL);
gtk_signal_connect (GTK_OBJECT (toolbar_rewind), "clicked",
GTK_SIGNAL_FUNC (on_toolbar_rewind_clicked),
NULL);
gtk_signal_connect (GTK_OBJECT (toolbar_pause), "clicked",
GTK_SIGNAL_FUNC (on_toolbar_pause_clicked),
NULL);
gtk_signal_connect (GTK_OBJECT (toolbar_play), "clicked",
GTK_SIGNAL_FUNC (on_toolbar_play_clicked),
NULL);
gtk_signal_connect (GTK_OBJECT (toolbar_stop), "clicked",
GTK_SIGNAL_FUNC (on_toolbar_stop_clicked),
NULL);
gtk_signal_connect (GTK_OBJECT (toolbar_forward), "clicked",
GTK_SIGNAL_FUNC (on_toolbar_forward_clicked),
NULL);
gtk_signal_connect (GTK_OBJECT (toolbar_about), "clicked",
GTK_SIGNAL_FUNC (on_toolbar_about_clicked),
NULL);
gtk_signal_connect (GTK_OBJECT (slider), "button_release_event",
GTK_SIGNAL_FUNC (PDASliderRelease),
NULL);
gtk_signal_connect (GTK_OBJECT (slider), "button_press_event",
GTK_SIGNAL_FUNC (PDASliderPress),
NULL);
gtk_signal_connect (GTK_OBJECT (buttonMrlGo), "clicked",
GTK_SIGNAL_FUNC (PDAMrlGo),
NULL);
gtk_signal_connect (GTK_OBJECT (mrl_entry), "changed",
GTK_SIGNAL_FUNC (on_comboURL_entry_changed),
NULL);
gtk_signal_connect (GTK_OBJECT (clistmedia), "select_row",
GTK_SIGNAL_FUNC (on_clistmedia_select_row),
NULL);
gtk_signal_connect (GTK_OBJECT (clistmedia), "click_column",
GTK_SIGNAL_FUNC (on_clistmedia_click_column),
NULL);
gtk_signal_connect (GTK_OBJECT (network_multicast), "toggled",
GTK_SIGNAL_FUNC (on_network_multicast_toggled),
NULL);
gtk_signal_connect (GTK_OBJECT (network_multicast_port), "changed",
GTK_SIGNAL_FUNC (on_network_multicast_port_changed),
NULL);
gtk_signal_connect (GTK_OBJECT (network_multicast_address), "changed",
GTK_SIGNAL_FUNC (on_network_multicast_address_changed),
NULL);
gtk_signal_connect (GTK_OBJECT (network_http), "toggled",
GTK_SIGNAL_FUNC (on_network_http_toggled),
NULL);
gtk_signal_connect (GTK_OBJECT (network_ftp), "toggled",
GTK_SIGNAL_FUNC (on_network_ftp_toggled),
NULL);
gtk_signal_connect (GTK_OBJECT (network_mms), "toggled",
GTK_SIGNAL_FUNC (on_network_mms_toggled),
NULL);
gtk_signal_connect (GTK_OBJECT (clistplaylist), "event",
GTK_SIGNAL_FUNC (PDAPlaylistEvent),
NULL);
gtk_signal_connect (GTK_OBJECT (update_playlist), "clicked",
GTK_SIGNAL_FUNC (PDAPlaylistUpdate),
NULL);
gtk_signal_connect (GTK_OBJECT (playlist_del), "clicked",
GTK_SIGNAL_FUNC (PDAPlaylistDel),
NULL);
gtk_signal_connect (GTK_OBJECT (playlist_clear), "clicked",
GTK_SIGNAL_FUNC (PDAPlaylistClear),
NULL);
gtk_signal_connect (GTK_OBJECT (cbautoplay), "toggled",
GTK_SIGNAL_FUNC (on_cbautoplay_toggled),
NULL);
gtk_signal_connect (GTK_OBJECT (buttonApply), "clicked",
GTK_SIGNAL_FUNC (PDAPreferencesApply),
NULL);
return pda;
}
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
GtkWidget* create_pda (void);
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* pda.c : PDA Gtk2 plugin for vlc * pda.c : PDA Gtk2 plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: pda.c,v 1.12 2003/11/30 10:26:19 jpsaman Exp $ * $Id: pda.c,v 1.13 2003/11/30 11:22:29 jpsaman Exp $
* *
* Authors: Jean-Paul Saman <jpsaman@wxs.nl> * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* Marc Ariberti <marcari@videolan.org> * Marc Ariberti <marcari@videolan.org>
...@@ -161,13 +161,12 @@ static void Run( intf_thread_t *p_intf ) ...@@ -161,13 +161,12 @@ static void Run( intf_thread_t *p_intf )
#endif #endif
/* Create some useful widgets that will certainly be used */ /* Create some useful widgets that will certainly be used */
// FIXME: magic path /* FIXME: magic path */
add_pixmap_directory("share"); add_pixmap_directory("share");
add_pixmap_directory("/usr/share/vlc"); add_pixmap_directory("/usr/share/vlc");
/* Path for pixmaps under linupy 1.4 */ /* Path for pixmaps under linupy 1.4 */
add_pixmap_directory("/usr/local/share/pixmaps/vlc"); add_pixmap_directory("/usr/local/share/pixmaps/vlc");
/* Path for pixmaps under linupy 2.0 */ /* Path for pixmaps under linupy 2.0 */
add_pixmap_directory("/usr/share/pixmaps/vlc"); add_pixmap_directory("/usr/share/pixmaps/vlc");
...@@ -178,10 +177,8 @@ static void Run( intf_thread_t *p_intf ) ...@@ -178,10 +177,8 @@ static void Run( intf_thread_t *p_intf )
} }
/* Store p_intf to keep an eye on it */ /* Store p_intf to keep an eye on it */
msg_Dbg( p_intf, "trying to store p_intf pointer ... " );
gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_window), gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_window),
"p_intf", p_intf ); "p_intf", p_intf );
msg_Dbg( p_intf, "trying to store p_intf pointer ... done" );
/* Set the title of the main window */ /* Set the title of the main window */
gtk_window_set_title( GTK_WINDOW(p_intf->p_sys->p_window), gtk_window_set_title( GTK_WINDOW(p_intf->p_sys->p_window),
...@@ -193,17 +190,23 @@ static void Run( intf_thread_t *p_intf ) ...@@ -193,17 +190,23 @@ static void Run( intf_thread_t *p_intf )
/* Get the slider object */ /* Get the slider object */
p_intf->p_sys->p_slider = GTK_HSCALE( gtk_object_get_data( p_intf->p_sys->p_slider = GTK_HSCALE( gtk_object_get_data(
GTK_OBJECT( p_intf->p_sys->p_window ), "slider" ) ); GTK_OBJECT( p_intf->p_sys->p_window ), "timeSlider" ) );
p_intf->p_sys->p_slider_label = GTK_LABEL( gtk_object_get_data( p_intf->p_sys->p_slider_label = GTK_LABEL( gtk_object_get_data(
GTK_OBJECT( p_intf->p_sys->p_window ), "slider_label" ) ); GTK_OBJECT( p_intf->p_sys->p_window ), "timeLabel" ) );
if (p_intf->p_sys->p_slider == NULL)
msg_Err( p_intf, "Time slider widget not found." );
if (p_intf->p_sys->p_slider_label == NULL)
msg_Err( p_intf, "Time label widget not found." );
#if 0 #if 0
/* Connect the date display to the slider */ /* Connect the date display to the slider */
msg_Dbg( p_intf, "setting slider adjustment ... " ); msg_Dbg( p_intf, "setting slider adjustment ... " );
#define P_SLIDER GTK_RANGE( gtk_object_get_data( \ #define P_SLIDER GTK_RANGE( gtk_object_get_data( \
GTK_OBJECT( p_intf->p_sys->p_window ), "slider" ) ) GTK_OBJECT( p_intf->p_sys->p_window ), "timeSlider" ) )
p_intf->p_sys->p_adj = gtk_range_get_adjustment( P_SLIDER ); p_intf->p_sys->p_adj = gtk_range_get_adjustment( P_SLIDER );
if (p_intf->p_sys->p_adj == NULL)
msg_Err( p_intf, "Adjustment range not found." );
gtk_signal_connect ( GTK_OBJECT( p_intf->p_sys->p_adj ), "value_changed", gtk_signal_connect ( GTK_OBJECT( p_intf->p_sys->p_adj ), "value_changed",
GTK_SIGNAL_FUNC( E_(GtkDisplayDate) ), NULL ); GTK_SIGNAL_FUNC( E_(GtkDisplayDate) ), NULL );
p_intf->p_sys->f_adj_oldvalue = 0; p_intf->p_sys->f_adj_oldvalue = 0;
...@@ -213,7 +216,6 @@ static void Run( intf_thread_t *p_intf ) ...@@ -213,7 +216,6 @@ static void Run( intf_thread_t *p_intf )
#endif #endif
/* BEGIN OF FILEVIEW GTK_TREE_VIEW */ /* BEGIN OF FILEVIEW GTK_TREE_VIEW */
msg_Dbg(p_intf, "Getting GtkTreeView FileList" );
p_intf->p_sys->p_tvfile = NULL; p_intf->p_sys->p_tvfile = NULL;
p_intf->p_sys->p_tvfile = (GtkTreeView *) lookup_widget( p_intf->p_sys->p_window, p_intf->p_sys->p_tvfile = (GtkTreeView *) lookup_widget( p_intf->p_sys->p_window,
"tvFileList"); "tvFileList");
...@@ -252,7 +254,6 @@ static void Run( intf_thread_t *p_intf ) ...@@ -252,7 +254,6 @@ static void Run( intf_thread_t *p_intf )
gtk_tree_view_column_set_sort_column_id(column, 4); gtk_tree_view_column_set_sort_column_id(column, 4);
/* Get new directory listing */ /* Get new directory listing */
msg_Dbg(p_intf, "Populating GtkTreeView FileList" );
filelist = gtk_list_store_new (5, filelist = gtk_list_store_new (5,
G_TYPE_STRING, /* Filename */ G_TYPE_STRING, /* Filename */
G_TYPE_STRING, /* permissions */ G_TYPE_STRING, /* permissions */
...@@ -260,7 +261,6 @@ static void Run( intf_thread_t *p_intf ) ...@@ -260,7 +261,6 @@ static void Run( intf_thread_t *p_intf )
G_TYPE_STRING, /* Owner */ G_TYPE_STRING, /* Owner */
G_TYPE_STRING);/* Group */ G_TYPE_STRING);/* Group */
ReadDirectory(p_intf, filelist, "."); ReadDirectory(p_intf, filelist, ".");
msg_Dbg(p_intf, "Showing GtkTreeView FileList" );
gtk_tree_view_set_model(GTK_TREE_VIEW(p_intf->p_sys->p_tvfile), GTK_TREE_MODEL(filelist)); gtk_tree_view_set_model(GTK_TREE_VIEW(p_intf->p_sys->p_tvfile), GTK_TREE_MODEL(filelist));
g_object_unref(filelist); /* Model will be released by GtkTreeView */ g_object_unref(filelist); /* Model will be released by GtkTreeView */
gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(p_intf->p_sys->p_tvfile)),GTK_SELECTION_MULTIPLE); gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(p_intf->p_sys->p_tvfile)),GTK_SELECTION_MULTIPLE);
...@@ -272,7 +272,6 @@ static void Run( intf_thread_t *p_intf ) ...@@ -272,7 +272,6 @@ static void Run( intf_thread_t *p_intf )
/* END OF FILEVIEW GTK_TREE_VIEW */ /* END OF FILEVIEW GTK_TREE_VIEW */
/* BEGIN OF PLAYLIST GTK_TREE_VIEW */ /* BEGIN OF PLAYLIST GTK_TREE_VIEW */
msg_Dbg(p_intf, "Getting GtkTreeView PlayList" );
p_intf->p_sys->p_tvplaylist = NULL; p_intf->p_sys->p_tvplaylist = NULL;
p_intf->p_sys->p_tvplaylist = (GtkTreeView *) lookup_widget( p_intf->p_sys->p_window, "tvPlaylist"); p_intf->p_sys->p_tvplaylist = (GtkTreeView *) lookup_widget( p_intf->p_sys->p_window, "tvPlaylist");
if (NULL == p_intf->p_sys->p_tvplaylist) if (NULL == p_intf->p_sys->p_tvplaylist)
...@@ -290,21 +289,20 @@ static void Run( intf_thread_t *p_intf ) ...@@ -290,21 +289,20 @@ static void Run( intf_thread_t *p_intf )
column = gtk_tree_view_get_column(p_intf->p_sys->p_tvplaylist, 1 ); column = gtk_tree_view_get_column(p_intf->p_sys->p_tvplaylist, 1 );
gtk_tree_view_column_add_attribute(column, renderer, "text", 1 ); gtk_tree_view_column_add_attribute(column, renderer, "text", 1 );
gtk_tree_view_column_set_sort_column_id(column, 1); gtk_tree_view_column_set_sort_column_id(column, 1);
/* Column 3 */ #if 0
/* Column 3 - is a hidden column used for reliable deleting items from the underlying playlist */
renderer = gtk_cell_renderer_text_new (); renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvplaylist, 2, _("Index"), renderer, NULL); gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvplaylist, 2, _("Index"), renderer, NULL);
column = gtk_tree_view_get_column(p_intf->p_sys->p_tvplaylist, 2 ); column = gtk_tree_view_get_column(p_intf->p_sys->p_tvplaylist, 2 );
gtk_tree_view_column_add_attribute(column, renderer, "text", 2 ); gtk_tree_view_column_add_attribute(column, renderer, "text", 2 );
gtk_tree_view_column_set_sort_column_id(column, 2); gtk_tree_view_column_set_sort_column_id(column, 2);
#endif
/* update the playlist */ /* update the playlist */
msg_Dbg(p_intf, "Populating GtkTreeView Playlist" );
playlist = gtk_list_store_new (3, playlist = gtk_list_store_new (3,
G_TYPE_STRING, /* Filename */ G_TYPE_STRING, /* Filename */
G_TYPE_STRING, /* Time */ G_TYPE_STRING, /* Time */
G_TYPE_UINT); /* Hidden index */ G_TYPE_UINT); /* Hidden index */
PlaylistRebuildListStore( playlist, vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE )); PlaylistRebuildListStore( playlist, vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ));
msg_Dbg(p_intf, "Showing GtkTreeView Playlist" );
gtk_tree_view_set_model(GTK_TREE_VIEW(p_intf->p_sys->p_tvplaylist), GTK_TREE_MODEL(playlist)); gtk_tree_view_set_model(GTK_TREE_VIEW(p_intf->p_sys->p_tvplaylist), GTK_TREE_MODEL(playlist));
g_object_unref(playlist); g_object_unref(playlist);
gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(p_intf->p_sys->p_tvplaylist)),GTK_SELECTION_MULTIPLE); gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(p_intf->p_sys->p_tvplaylist)),GTK_SELECTION_MULTIPLE);
...@@ -436,13 +434,11 @@ static int Manage( intf_thread_t *p_intf ) ...@@ -436,13 +434,11 @@ static int Manage( intf_thread_t *p_intf )
p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if (p_playlist != NULL) if (p_playlist != NULL)
{ {
msg_Dbg(p_intf, "Manage: Populating GtkTreeView Playlist" );
p_liststore = gtk_list_store_new (3, p_liststore = gtk_list_store_new (3,
G_TYPE_STRING, G_TYPE_STRING,
G_TYPE_STRING, G_TYPE_STRING,
G_TYPE_UINT); /* Hidden index */ G_TYPE_UINT); /* Hidden index */
PlaylistRebuildListStore(p_liststore, p_playlist); PlaylistRebuildListStore(p_liststore, p_playlist);
msg_Dbg(p_intf, "Manage: Updating GtkTreeView Playlist" );
gtk_tree_view_set_model(p_intf->p_sys->p_tvplaylist, (GtkTreeModel*) p_liststore); gtk_tree_view_set_model(p_intf->p_sys->p_tvplaylist, (GtkTreeModel*) p_liststore);
g_object_unref(p_liststore); g_object_unref(p_liststore);
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
...@@ -600,6 +596,7 @@ gint E_(GtkModeManage)( intf_thread_t * p_intf ) ...@@ -600,6 +596,7 @@ gint E_(GtkModeManage)( intf_thread_t * p_intf )
/* initialize and show slider for seekable streams */ /* initialize and show slider for seekable streams */
if( p_intf->p_sys->p_input->stream.b_seekable ) if( p_intf->p_sys->p_input->stream.b_seekable )
{ {
msg_Dbg( p_intf, "Updating slider widget" );
if (p_intf->p_libvlc->i_cpu & CPU_CAPABILITY_FPU) if (p_intf->p_libvlc->i_cpu & CPU_CAPABILITY_FPU)
p_intf->p_sys->p_adj->value = p_intf->p_sys->f_adj_oldvalue = 0; p_intf->p_sys->p_adj->value = p_intf->p_sys->f_adj_oldvalue = 0;
else else
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* pda_callbacks.c : Callbacks for the pda Linux Gtk+ plugin. * pda_callbacks.c : Callbacks for the pda Linux Gtk+ plugin.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: pda_callbacks.c,v 1.18 2003/11/30 10:26:19 jpsaman Exp $ * $Id: pda_callbacks.c,v 1.19 2003/11/30 11:22:29 jpsaman Exp $
* *
* Authors: Jean-Paul Saman <jpsaman@wxs.nl> * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* *
...@@ -120,7 +120,6 @@ void PlaylistAddItem(GtkWidget *widget, gchar *name) ...@@ -120,7 +120,6 @@ void PlaylistAddItem(GtkWidget *widget, gchar *name)
2, p_playlist->i_size, /* Hidden index. */ 2, p_playlist->i_size, /* Hidden index. */
-1 ); -1 );
msg_Dbg( p_intf, "Adding files to playlist ...");
/* Add to VLC's playlist */ /* Add to VLC's playlist */
#if 0 #if 0
if (p_intf->p_sys->b_autoplayfile) if (p_intf->p_sys->b_autoplayfile)
...@@ -134,7 +133,6 @@ void PlaylistAddItem(GtkWidget *widget, gchar *name) ...@@ -134,7 +133,6 @@ void PlaylistAddItem(GtkWidget *widget, gchar *name)
playlist_Add( p_playlist, (const char*)name, 0, 0, playlist_Add( p_playlist, (const char*)name, 0, 0,
PLAYLIST_APPEND, PLAYLIST_END ); PLAYLIST_APPEND, PLAYLIST_END );
} }
msg_Dbg( p_intf, "done");
} }
} }
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
...@@ -334,7 +332,6 @@ onPDADeleteEvent (GtkWidget *widget, ...@@ -334,7 +332,6 @@ onPDADeleteEvent (GtkWidget *widget,
{ {
intf_thread_t *p_intf = GtkGetIntf( widget ); intf_thread_t *p_intf = GtkGetIntf( widget );
msg_Dbg( p_intf, "about to exit vlc ... " );
vlc_mutex_lock( &p_intf->change_lock ); vlc_mutex_lock( &p_intf->change_lock );
p_intf->p_vlc->b_die = VLC_TRUE; p_intf->p_vlc->b_die = VLC_TRUE;
vlc_mutex_unlock( &p_intf->change_lock ); vlc_mutex_unlock( &p_intf->change_lock );
...@@ -562,6 +559,7 @@ void ...@@ -562,6 +559,7 @@ void
NetworkBuildMRL (GtkEditable *editable, NetworkBuildMRL (GtkEditable *editable,
gpointer user_data) gpointer user_data)
{ {
intf_thread_t *p_intf = GtkGetIntf( GTK_WIDGET(editable) );
GtkSpinButton *networkPort = NULL; GtkSpinButton *networkPort = NULL;
GtkEntry *entryMRL = NULL; GtkEntry *entryMRL = NULL;
GtkEntry *networkType = NULL; GtkEntry *networkType = NULL;
...@@ -595,7 +593,10 @@ NetworkBuildMRL (GtkEditable *editable, ...@@ -595,7 +593,10 @@ NetworkBuildMRL (GtkEditable *editable,
pos += snprintf( &text[pos], VLC_MAX_MRL - pos, "%s:%d", (char*)mrlAddress, (int)mrlPort ); pos += snprintf( &text[pos], VLC_MAX_MRL - pos, "%s:%d", (char*)mrlAddress, (int)mrlPort );
if (pos >= VLC_MAX_MRL) if (pos >= VLC_MAX_MRL)
{
text[VLC_MAX_MRL-1]='\0'; text[VLC_MAX_MRL-1]='\0';
msg_Err( p_intf, "Media Resource Locator is truncated to: %s", text);
}
gtk_entry_set_text(entryMRL,text); gtk_entry_set_text(entryMRL,text);
} }
...@@ -775,7 +776,6 @@ onUpdatePlaylist (GtkButton *button, ...@@ -775,7 +776,6 @@ onUpdatePlaylist (GtkButton *button,
if (p_model) if (p_model)
{ {
PlaylistRebuildListStore(p_model, p_playlist); PlaylistRebuildListStore(p_model, p_playlist);
msg_Dbg(p_intf, "Adding new model to Playlist" );
gtk_tree_view_set_model(GTK_TREE_VIEW(p_tvplaylist), GTK_TREE_MODEL(p_model)); gtk_tree_view_set_model(GTK_TREE_VIEW(p_tvplaylist), GTK_TREE_MODEL(p_model));
g_object_unref(p_model); g_object_unref(p_model);
} }
...@@ -793,7 +793,6 @@ onDeletePlaylist (GtkButton *button, ...@@ -793,7 +793,6 @@ onDeletePlaylist (GtkButton *button,
GtkTreeView *p_tvplaylist; GtkTreeView *p_tvplaylist;
/* Delete an arbitrary item from the playlist */ /* Delete an arbitrary item from the playlist */
msg_Dbg(p_intf, "Delete playlist item ... " );
p_tvplaylist = (GtkTreeView *) lookup_widget( GTK_WIDGET(button), "tvPlaylist" ); p_tvplaylist = (GtkTreeView *) lookup_widget( GTK_WIDGET(button), "tvPlaylist" );
if (p_tvplaylist != NULL) if (p_tvplaylist != NULL)
{ {
...@@ -825,14 +824,10 @@ onDeletePlaylist (GtkButton *button, ...@@ -825,14 +824,10 @@ onDeletePlaylist (GtkButton *button,
{ {
if (gtk_tree_model_get_iter(p_model, &iter, p_path)) if (gtk_tree_model_get_iter(p_model, &iter, p_path))
{ {
gchar *p_filename;
gint item; gint item;
gtk_tree_model_get(p_model, &iter, 0, &p_filename, -1);
gtk_tree_model_get(p_model, &iter, 2, &item, -1); gtk_tree_model_get(p_model, &iter, 2, &item, -1);
msg_Dbg(p_intf, "Deleting %d %s", item, p_filename);
playlist_Delete(p_playlist, item); playlist_Delete(p_playlist, item);
g_free(p_filename);
} }
} }
} }
...@@ -848,14 +843,11 @@ onDeletePlaylist (GtkButton *button, ...@@ -848,14 +843,11 @@ onDeletePlaylist (GtkButton *button,
if (p_model) if (p_model)
{ {
PlaylistRebuildListStore(GTK_LIST_STORE(p_model), p_playlist); PlaylistRebuildListStore(GTK_LIST_STORE(p_model), p_playlist);
msg_Dbg(p_intf, "Adding new model to Playlist" );
gtk_tree_view_set_model(GTK_TREE_VIEW(p_tvplaylist), GTK_TREE_MODEL(p_model)); gtk_tree_view_set_model(GTK_TREE_VIEW(p_tvplaylist), GTK_TREE_MODEL(p_model));
g_object_unref(p_model); g_object_unref(p_model);
} }
} }
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
msg_Dbg(p_intf, "Delete playlist item ... done" );
} }
...@@ -899,9 +891,12 @@ void ...@@ -899,9 +891,12 @@ void
onPreferenceSave (GtkButton *button, onPreferenceSave (GtkButton *button,
gpointer user_data) gpointer user_data)
{ {
#if 0
intf_thread_t *p_intf = GtkGetIntf( button ); intf_thread_t *p_intf = GtkGetIntf( button );
msg_Dbg(p_intf, "Preferences Save" ); msg_Dbg(p_intf, "Preferences Save" );
config_SaveConfigFile( p_intf, NULL );
#endif
} }
...@@ -909,9 +904,11 @@ void ...@@ -909,9 +904,11 @@ void
onPreferenceApply (GtkButton *button, onPreferenceApply (GtkButton *button,
gpointer user_data) gpointer user_data)
{ {
#if 0
intf_thread_t *p_intf = GtkGetIntf( button ); intf_thread_t *p_intf = GtkGetIntf( button );
msg_Dbg(p_intf, "Preferences Apply" ); msg_Dbg(p_intf, "Preferences Apply" );
#endif
} }
...@@ -919,9 +916,14 @@ void ...@@ -919,9 +916,14 @@ void
onPreferenceCancel (GtkButton *button, onPreferenceCancel (GtkButton *button,
gpointer user_data) gpointer user_data)
{ {
#if 0
intf_thread_t *p_intf = GtkGetIntf( button ); intf_thread_t *p_intf = GtkGetIntf( button );
msg_Dbg(p_intf, "Preferences Cancel" ); msg_Dbg(p_intf, "Preferences Cancel" );
config_ResetAll( p_intf );
/* Cancel interface changes. */
config_SaveConfigFile( p_intf, NULL );
#endif
} }
......
/*****************************************************************************
* playlist.c : Playlist interface of the gtk-pda plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: playlist.c,v 1.2 2003/11/30 10:26:19 jpsaman Exp $
*
* Authors: Marc Ariberti <marcari@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <sys/types.h> /* off_t */
#include <stdlib.h>
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include <vlc/vout.h>
#include <stdio.h>
#include <string.h>
#include <dirent.h>
#include <sys/stat.h>
#include <unistd.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <gtk/gtk.h>
#include "interface.h"
#include "support.h"
#include "pda.h"
#include "playlist.h"
gboolean
PDAPlaylistEvent (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
intf_thread_t * p_intf = GtkGetIntf( widget );
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
return FALSE;
}
if( ( event->button ).type == GDK_2BUTTON_PRESS )
{
GtkCList * p_clist;
gint i_row;
gint i_col;
p_clist = p_intf->p_sys->p_clistplaylist;
if( gtk_clist_get_selection_info( p_clist, (event->button).x,
(event->button).y, &i_row, &i_col ) == 1 )
{
playlist_Goto( p_playlist, i_row );
}
vlc_object_release( p_playlist );
PDARebuildCList( p_clist, p_playlist );
return TRUE;
}
vlc_object_release( p_playlist );
return FALSE;
}
void
PDAPlaylistClear (GtkButton *button,
gpointer user_data)
{
intf_thread_t * p_intf = GtkGetIntf( button );
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
int item;
if( p_playlist == NULL )
{
return;
}
for(item = p_playlist->i_size - 1 ; item >= 0 ; item-- )
{
playlist_Delete( p_playlist, item);
}
vlc_object_release( p_playlist );
PDARebuildCList( p_intf->p_sys->p_clistplaylist, p_playlist);
}
void PDARebuildCList( GtkCList * p_clist, playlist_t * p_playlist )
{
int i_dummy;
gchar * ppsz_text[2];
GdkColor red;
red.red = 65535;
red.blue = 0;
red.green = 0;
gtk_clist_freeze( p_clist );
gtk_clist_clear( p_clist );
vlc_mutex_lock( &p_playlist->object_lock );
for( i_dummy = p_playlist->i_size ; i_dummy-- ; )
{
ppsz_text[0] = p_playlist->pp_items[i_dummy]->psz_name;
ppsz_text[1] = "no info";
gtk_clist_insert( p_clist, 0, ppsz_text );
}
vlc_mutex_unlock( &p_playlist->object_lock );
gtk_clist_set_background( p_clist, p_playlist->i_index, &red);
gtk_clist_thaw( p_clist );
}
void
PDAPlaylistUpdate (GtkButton *button,
gpointer user_data)
{
intf_thread_t * p_intf = GtkGetIntf( button );
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
PDARebuildCList( p_intf->p_sys->p_clistplaylist, p_playlist );
}
static void PDADeleteGListItem( gpointer data, gpointer param )
{
int i_cur_row = (long)data;
playlist_t * p_playlist = param;
playlist_Delete( p_playlist, i_cur_row );
}
static gint PDACompareItems( gconstpointer a, gconstpointer b )
{
return (ptrdiff_t) ( (int *)b - (int *)a );
}
void
PDAPlaylistDel (GtkButton *button,
gpointer user_data)
{
/* user wants to delete a file in the queue */
GList * p_selection;
intf_thread_t * p_intf = GtkGetIntf( button );
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
/* lock the struct */
vlc_mutex_lock( &p_intf->change_lock );
p_selection = p_intf->p_sys->p_clistplaylist->selection;
if( g_list_length( p_selection ) )
{
/* reverse-sort so that we can delete from the furthest
* to the closest item to delete...
*/
p_selection = g_list_sort( p_selection, PDACompareItems );
g_list_foreach( p_selection, PDADeleteGListItem, p_playlist );
}
vlc_mutex_unlock( &p_intf->change_lock );
vlc_object_release( p_playlist );
PDARebuildCList( p_intf->p_sys->p_clistplaylist, p_playlist );
}
gboolean
PDAPlaylistEvent (GtkWidget *widget,
GdkEvent *event,
gpointer user_data);
void PDARebuildCList( GtkCList * p_clist, playlist_t * p_playlist );
void PDAPlaylistClear (GtkButton *button,
gpointer user_data);
void
PDAPlaylistUpdate (GtkButton *button,
gpointer user_data);
void
PDAPlaylistDel (GtkButton *button,
gpointer user_data);
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <gtk/gtk.h>
#include "support.h"
/* This is an internally used function to check if a pixmap file exists. */
static gchar* check_file_exists (const gchar *directory,
const gchar *filename);
/* This is an internally used function to create pixmaps. */
static GtkWidget* create_dummy_pixmap (GtkWidget *widget);
GtkWidget*
lookup_widget (GtkWidget *widget,
const gchar *widget_name)
{
GtkWidget *parent, *found_widget;
for (;;)
{
if (GTK_IS_MENU (widget))
parent = gtk_menu_get_attach_widget (GTK_MENU (widget));
else
parent = widget->parent;
if (parent == NULL)
break;
widget = parent;
}
found_widget = (GtkWidget*) gtk_object_get_data (GTK_OBJECT (widget),
widget_name);
if (!found_widget)
g_warning ("Widget not found: %s", widget_name);
return found_widget;
}
/* This is a dummy pixmap we use when a pixmap can't be found. */
static char *dummy_pixmap_xpm[] = {
/* columns rows colors chars-per-pixel */
"1 1 1 1",
" c None",
/* pixels */
" "
};
/* This is an internally used function to create pixmaps. */
static GtkWidget*
create_dummy_pixmap (GtkWidget *widget)
{
GdkColormap *colormap;
GdkPixmap *gdkpixmap;
GdkBitmap *mask;
GtkWidget *pixmap;
colormap = gtk_widget_get_colormap (widget);
gdkpixmap = gdk_pixmap_colormap_create_from_xpm_d (NULL, colormap, &mask,
NULL, dummy_pixmap_xpm);
if (gdkpixmap == NULL)
g_error ("Couldn't create replacement pixmap.");
pixmap = gtk_pixmap_new (gdkpixmap, mask);
gdk_pixmap_unref (gdkpixmap);
gdk_bitmap_unref (mask);
return pixmap;
}
static GList *pixmaps_directories = NULL;
/* Use this function to set the directory containing installed pixmaps. */
void
add_pixmap_directory (const gchar *directory)
{
pixmaps_directories = g_list_prepend (pixmaps_directories,
g_strdup (directory));
}
/* This is an internally used function to create pixmaps. */
GtkWidget*
create_pixmap (GtkWidget *widget,
const gchar *filename)
{
gchar *found_filename = NULL;
GdkColormap *colormap;
GdkPixmap *gdkpixmap;
GdkBitmap *mask;
GtkWidget *pixmap;
GList *elem;
if (!filename || !filename[0])
return create_dummy_pixmap (widget);
/* We first try any pixmaps directories set by the application. */
elem = pixmaps_directories;
while (elem)
{
found_filename = check_file_exists ((gchar*)elem->data, filename);
if (found_filename)
break;
elem = elem->next;
}
/* If we haven't found the pixmap, try the source directory. */
if (!found_filename)
{
found_filename = check_file_exists ("../../../share", filename);
}
if (!found_filename)
{
g_warning (_("Couldn't find pixmap file: %s"), filename);
return create_dummy_pixmap (widget);
}
colormap = gtk_widget_get_colormap (widget);
gdkpixmap = gdk_pixmap_colormap_create_from_xpm (NULL, colormap, &mask,
NULL, found_filename);
if (gdkpixmap == NULL)
{
g_warning (_("Error loading pixmap file: %s"), found_filename);
g_free (found_filename);
return create_dummy_pixmap (widget);
}
g_free (found_filename);
pixmap = gtk_pixmap_new (gdkpixmap, mask);
gdk_pixmap_unref (gdkpixmap);
gdk_bitmap_unref (mask);
return pixmap;
}
/* This is an internally used function to check if a pixmap file exists. */
static gchar*
check_file_exists (const gchar *directory,
const gchar *filename)
{
gchar *full_filename;
struct stat s;
gint status;
full_filename = (gchar*) g_malloc (strlen (directory) + 1
+ strlen (filename) + 1);
strcpy (full_filename, directory);
strcat (full_filename, G_DIR_SEPARATOR_S);
strcat (full_filename, filename);
status = stat (full_filename, &s);
if (status == 0 && S_ISREG (s.st_mode))
return full_filename;
g_free (full_filename);
return NULL;
}
/*
* Created by glade, fixed by bootstrap
*/
#ifdef HAVE_CONFIG_H
# include <vlc/vlc.h>
#endif
#include <gtk/gtk.h>
/*
* Standard gettext macros.
*/
#if 0 /* Disabled by bootstrap */
# include <libintl.h>
# undef _
# define _(String) dgettext (PACKAGE, String)
# ifdef gettext_noop
# define N_(String) gettext_noop (String)
# else
# define N_(String) (String)
# endif
/* #else */
# define textdomain(String) (String)
# define gettext(String) (String)
# define dgettext(Domain,Message) (Message)
# define dcgettext(Domain,Message,Type) (Message)
# define bindtextdomain(Domain,Directory) (Domain)
# define _(String) (String)
# define N_(String) (String)
#endif
/*
* Public Functions.
*/
/*
* This function returns a widget in a component created by Glade.
* Call it with the toplevel widget in the component (i.e. a window/dialog),
* or alternatively any widget in the component, and the name of the widget
* you want returned.
*/
GtkWidget* lookup_widget (GtkWidget *widget,
const gchar *widget_name);
/* get_widget() is deprecated. Use lookup_widget instead. */
#define get_widget lookup_widget
/* Use this function to set the directory containing installed pixmaps. */
void add_pixmap_directory (const gchar *directory);
/*
* Private Functions.
*/
/* This is used to create the pixmaps in the interface. */
GtkWidget* create_pixmap (GtkWidget *widget,
const gchar *filename);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment