Commit 038f77ed authored by Johan Bilien's avatar Johan Bilien
Browse files

* Fixed a bug that made vlc segfault when choosing a program, change to
  another and come back to the first one.
* Added gtk and gnome interfaces for satellite input. We should find a
  way to hide the button if satellite support is not compiled.
parent f42368fa
......@@ -2,7 +2,7 @@
* gnome.c : Gnome plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: gnome.c,v 1.12 2002/03/11 20:14:16 gbazin Exp $
* $Id: gnome.c,v 1.13 2002/03/25 02:06:24 jobi Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -248,6 +248,7 @@ static void intf_Run( intf_thread_t *p_intf )
p_intf->p_sys->p_fileopen = NULL;
p_intf->p_sys->p_disc = NULL;
p_intf->p_sys->p_network = NULL;
p_intf->p_sys->p_sat = NULL;
p_intf->p_sys->p_jump = NULL;
/* Store p_intf to keep an eye on it */
......
......@@ -423,6 +423,21 @@
<stock_pixmap>GNOME_STOCK_PIXMAP_REFRESH</stock_pixmap>
</widget>
<widget>
<class>GtkButton</class>
<child_name>Toolbar:button</child_name>
<name>toolbar_sat</name>
<tooltip>Open a Satellite Card</tooltip>
<signal>
<name>button_press_event</name>
<handler>GtkSatOpenShow</handler>
<data>&quot;intf_window&quot;</data>
<last_modification_time>Mon, 25 Mar 2002 01:02:49 GMT</last_modification_time>
</signal>
<label>Sat</label>
<stock_pixmap>GNOME_STOCK_PIXMAP_MIC</stock_pixmap>
</widget>
<widget>
<class>GtkButton</class>
<child_name>Toolbar:button</child_name>
......@@ -517,6 +532,9 @@
</signal>
<label>Slow</label>
<stock_pixmap>GNOME_STOCK_PIXMAP_TIMER_STOP</stock_pixmap>
<child>
<new_group>True</new_group>
</child>
</widget>
<widget>
......@@ -548,9 +566,6 @@
</signal>
<label>Playlist</label>
<stock_pixmap>GNOME_STOCK_PIXMAP_INDEX</stock_pixmap>
<child>
<new_group>True</new_group>
</child>
</widget>
<widget>
......@@ -3670,4 +3685,301 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;
</widget>
</widget>
<widget>
<class>GnomeDialog</class>
<name>intf_sat</name>
<title>Open Satellite Card</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position>
<modal>True</modal>
<allow_shrink>False</allow_shrink>
<allow_grow>False</allow_grow>
<auto_shrink>False</auto_shrink>
<auto_close>False</auto_close>
<hide_on_close>False</hide_on_close>
<widget>
<class>GtkVBox</class>
<child_name>GnomeDialog:vbox</child_name>
<name>vbox15</name>
<homogeneous>False</homogeneous>
<spacing>8</spacing>
<child>
<padding>4</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkHButtonBox</class>
<child_name>GnomeDialog:action_area</child_name>
<name>hbuttonbox2</name>
<layout_style>GTK_BUTTONBOX_END</layout_style>
<spacing>8</spacing>
<child_min_width>85</child_min_width>
<child_min_height>27</child_min_height>
<child_ipad_x>7</child_ipad_x>
<child_ipad_y>0</child_ipad_y>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
<pack>GTK_PACK_END</pack>
</child>
<widget>
<class>GtkButton</class>
<name>sat_ok</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>GtkSatOpenOk</handler>
<data>&quot;intf_disc&quot;</data>
<last_modification_time>Mon, 25 Mar 2002 01:11:40 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
</widget>
<widget>
<class>GtkButton</class>
<name>sat_cancel</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>GtkSatOpenCancel</handler>
<data>&quot;intf_disc&quot;</data>
<last_modification_time>Mon, 25 Mar 2002 01:31:00 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
</widget>
</widget>
<widget>
<class>GtkHBox</class>
<name>hbox10</name>
<homogeneous>False</homogeneous>
<spacing>5</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkFrame</class>
<name>frame13</name>
<label>Transponder Settings</label>
<label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkTable</class>
<name>table5</name>
<border_width>5</border_width>
<rows>4</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>5</row_spacing>
<column_spacing>5</column_spacing>
<widget>
<class>GtkLabel</class>
<name>label30</name>
<label>Frequency</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkSpinButton</class>
<name>sat_freq</name>
<can_focus>True</can_focus>
<climb_rate>1</climb_rate>
<digits>0</digits>
<numeric>False</numeric>
<update_policy>GTK_UPDATE_ALWAYS</update_policy>
<snap>False</snap>
<wrap>False</wrap>
<value>12553</value>
<lower>1</lower>
<upper>65536</upper>
<step>1</step>
<page>10</page>
<page_size>10</page_size>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label31</name>
<label>Polarization</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkRadioButton</class>
<name>sat_pol_hor</name>
<can_focus>True</can_focus>
<label>Horizontal</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkRadioButton</class>
<name>sat_pol_vert</name>
<can_focus>True</can_focus>
<label>Vertical</label>
<active>True</active>
<draw_indicator>True</draw_indicator>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label33</name>
<label>Symbol Rate</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkSpinButton</class>
<name>sat_srate</name>
<can_focus>True</can_focus>
<climb_rate>1</climb_rate>
<digits>0</digits>
<numeric>False</numeric>
<update_policy>GTK_UPDATE_ALWAYS</update_policy>
<snap>False</snap>
<wrap>False</wrap>
<value>27500</value>
<lower>0</lower>
<upper>100</upper>
<step>1</step>
<page>10</page>
<page_size>10</page_size>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
</widget>
</widget>
</widget>
</widget>
</widget>
</GTK-Interface>
......@@ -273,4 +273,3 @@ GnomeMenubarMessagesActivate (GtkMenuItem *menuitem,
{
GtkMessagesShow( GTK_WIDGET( menuitem ), NULL, "intf_window" );
}
......@@ -150,3 +150,16 @@ GtkNetworkOpenChannel (GtkToggleButton *togglebutton,
void
GnomeMenubarMessagesActivate (GtkMenuItem *menuitem,
gpointer user_data);
gboolean
GtkSatOpenShow (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
void
GtkSatOpenOk (GtkButton *button,
gpointer user_data);
void
GtkSatOpenCancel (GtkButton *button,
gpointer user_data);
......@@ -158,6 +158,7 @@ create_intf_window (void)
GtkWidget *toolbar_file;
GtkWidget *toolbar_disc;
GtkWidget *toolbar_network;
GtkWidget *toolbar_sat;
GtkWidget *toolbar_back;
GtkWidget *toolbar_stop;
GtkWidget *toolbar_eject;
......@@ -394,6 +395,18 @@ create_intf_window (void)
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_network);
tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_MIC);
toolbar_sat = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
GTK_TOOLBAR_CHILD_BUTTON,
NULL,
_("Sat"),
_("Open a Satellite Card"), NULL,
tmp_toolbar_icon, NULL, NULL);
gtk_widget_ref (toolbar_sat);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_sat", toolbar_sat,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_sat);
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_BACK);
......@@ -458,6 +471,8 @@ create_intf_window (void)
gtk_widget_show (toolbar_pause);
gtk_widget_set_sensitive (toolbar_pause, FALSE);
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_TIMER_STOP);
toolbar_slow = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
GTK_TOOLBAR_CHILD_BUTTON,
......@@ -484,8 +499,6 @@ create_intf_window (void)
gtk_widget_show (toolbar_fast);
gtk_widget_set_sensitive (toolbar_fast, FALSE);
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_INDEX);
toolbar_playlist = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
GTK_TOOLBAR_CHILD_BUTTON,
......@@ -719,6 +732,9 @@ create_intf_window (void)
gtk_signal_connect (GTK_OBJECT (toolbar_network), "button_press_event",
GTK_SIGNAL_FUNC (GtkNetworkOpenShow),
"intf_window");
gtk_signal_connect (GTK_OBJECT (toolbar_sat), "button_press_event",
GTK_SIGNAL_FUNC (GtkSatOpenShow),
"intf_window");
gtk_signal_connect (GTK_OBJECT (toolbar_back), "button_press_event",
GTK_SIGNAL_FUNC (GtkControlBack),
"intf_window");
......@@ -2609,3 +2625,161 @@ create_intf_messages (void)
return intf_messages;
}
GtkWidget*
create_intf_sat (void)
{
GtkWidget *intf_sat;
GtkWidget *vbox15;
GtkWidget *hbox10;
GtkWidget *frame13;
GtkWidget *table5;
GtkWidget *label30;
GtkObject *sat_freq_adj;
GtkWidget *sat_freq;
GtkWidget *label31;
GSList *table5_group = NULL;
GtkWidget *sat_pol_hor;
GtkWidget *sat_pol_vert;
GtkWidget *label33;
GtkObject *sat_srate_adj;
GtkWidget *sat_srate;
GtkWidget *hbuttonbox2;
GtkWidget *sat_ok;
GtkWidget *sat_cancel;
intf_sat = gnome_dialog_new (_("Open Satellite Card"), NULL);
gtk_object_set_data (GTK_OBJECT (intf_sat), "intf_sat", intf_sat);
gtk_window_set_modal (GTK_WINDOW (intf_sat), TRUE);
gtk_window_set_policy (GTK_WINDOW (intf_sat), FALSE, FALSE, FALSE);
vbox15 = GNOME_DIALOG (intf_sat)->vbox;
gtk_object_set_data (GTK_OBJECT (intf_sat), "vbox15", vbox15);
gtk_widget_show (vbox15);
hbox10 = gtk_hbox_new (FALSE, 5);
gtk_widget_ref (hbox10);
gtk_object_set_data_full (GTK_OBJECT (intf_sat), "hbox10", hbox10,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbox10);
gtk_box_pack_start (GTK_BOX (vbox15), hbox10, TRUE, TRUE, 0);
frame13 = gtk_frame_new (_("Transponder Settings"));
gtk_widget_ref (frame13);
gtk_object_set_data_full (GTK_OBJECT (intf_sat), "frame13", frame13,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame13);
gtk_box_pack_start (GTK_BOX (hbox10), frame13, TRUE, TRUE, 0);
table5 = gtk_table_new (4, 2, FALSE);
gtk_widget_ref (table5);
gtk_object_set_data_full (GTK_OBJECT (intf_sat), "table5", table5,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (table5);
gtk_container_add (GTK_CONTAINER (frame13), table5);
gtk_container_set_border_width (GTK_CONTAINER (table5), 5);
gtk_table_set_row_spacings (GTK_TABLE (table5), 5);
gtk_table_set_col_spacings (GTK_TABLE (table5), 5);
label30 = gtk_label_new (_("Frequency"));
gtk_widget_ref (label30);
gtk_object_set_data_full (GTK_OBJECT (intf_sat), "label30", label30,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label30);
gtk_table_attach (GTK_TABLE (table5), label30, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label30), 0, 0.5);
sat_freq_adj = gtk_adjustment_new (12553, 1, 65536, 1, 10, 10);
sat_freq = gtk_spin_button_new (GTK_ADJUSTMENT (sat_freq_adj), 1, 0);
gtk_widget_ref (sat_freq);
gtk_object_set_data_full (GTK_OBJECT (intf_sat), "sat_freq", sat_freq,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (sat_freq);
gtk_table_attach (GTK_TABLE (table5), sat_freq, 1, 2, 0, 1,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
label31 = gtk_label_new (_("Polarization"));
gtk_widget_ref (label31);
gtk_object_set_data_full (GTK_OBJECT (intf_sat), "label31", label31,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label31);
gtk_table_attach (GTK_TABLE (table5), label31, 0, 1, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label31), 0, 0.5);
sat_pol_hor = gtk_radio_button_new_with_label (table5_group, _("Horizontal"));
table5_group = gtk_radio_button_group (GTK_RADIO_BUTTON (sat_pol_hor));
gtk_widget_ref (sat_pol_hor);
gtk_object_set_data_full (GTK_OBJECT (intf_sat), "sat_pol_hor", sat_pol_hor,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (sat_pol_hor);
gtk_table_attach (GTK_TABLE (table5), sat_pol_hor, 1, 2, 3, 4,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
sat_pol_vert = gtk_radio_button_new_with_label (table5_group, _("Vertical"));
table5_group = gtk_radio_button_group (GTK_RADIO_BUTTON (sat_pol_vert));
gtk_widget_ref (sat_pol_vert);
gtk_object_set_data_full (GTK_OBJECT (intf_sat), "sat_pol_vert", sat_pol_vert,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (sat_pol_vert);
gtk_table_attach (GTK_TABLE (table5), sat_pol_vert, 1, 2, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sat_pol_vert), TRUE);
label33 = gtk_label_new (_("Symbol Rate"));
gtk_widget_ref (label33);
gtk_object_set_data_full (GTK_OBJECT (intf_sat), "label33", label33,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label33);
gtk_table_attach (GTK_TABLE (table5), label33, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label33), 0, 0.5);
sat_srate_adj = gtk_adjustment_new (27500, 0, 100, 1, 10, 10);
sat_srate = gtk_spin_button_new (GTK_ADJUSTMENT (sat_srate_adj), 1, 0);
gtk_widget_ref (sat_srate);
gtk_object_set_data_full (GTK_OBJECT (intf_sat), "sat_srate", sat_srate,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (sat_srate);
gtk_table_attach (GTK_TABLE (table5), sat_srate, 1, 2, 1, 2,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
hbuttonbox2 = GNOME_DIALOG (intf_sat)->action_area;
gtk_object_set_data (GTK_OBJECT (intf_sat), "hbuttonbox2", hbuttonbox2);
gtk_widget_show (hbuttonbox2);
gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox2), GTK_BUTTONBOX_END);
gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbuttonbox2), 8);
gnome_dialog_append_button (GNOME_DIALOG (intf_sat), GNOME_STOCK_BUTTON_OK);
sat_ok = GTK_WIDGET (g_list_last (GNOME_DIALOG (intf_sat)->buttons)->data);
gtk_widget_ref (sat_ok);
gtk_object_set_data_full (GTK_OBJECT (intf_sat), "sat_ok", sat_ok,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (sat_ok);
GTK_WIDGET_SET_FLAGS (sat_ok, GTK_CAN_DEFAULT);
gnome_dialog_append_button (GNOME_DIALOG (intf_sat), GNOME_STOCK_BUTTON_CANCEL);
sat_cancel = GTK_WIDGET (g_list_last (GNOME_DIALOG (intf_sat)->buttons)->data);
gtk_widget_ref (sat_cancel);
gtk_object_set_data_full (GTK_OBJECT (intf_sat), "sat_cancel", sat_cancel,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (sat_cancel);
GTK_WIDGET_SET_FLAGS (sat_cancel, GTK_CAN_DEFAULT);
gtk_signal_connect (GTK_OBJECT (sat_ok), "clicked",
GTK_SIGNAL_FUNC (GtkSatOpenOk),
"intf_disc");
gtk_signal_connect (GTK_OBJECT (sat_cancel), "clicked",
GTK_SIGNAL_FUNC (GtkSatOpenCancel),
"intf_disc");
return intf_sat;
}
......@@ -13,3 +13,4 @@ GtkWidget* create_intf_playlist (void);
GtkWidget* create_intf_jump (void);
GtkWidget* create_intf_open (void);
GtkWidget* create_intf_messages (void);
GtkWidget* create_intf_sat (void);
......@@ -2,7 +2,7 @@
* gtk.c : Gtk+ plugin for vlc