Various fixes for the build/install problems update to the docs/manual. Added a simpl...
[platform/upstream/gstreamer.git] / gstplay / callbacks.c
1 #ifdef HAVE_CONFIG_H
2 #  include <config.h>
3 #endif
4
5 #include <gnome.h>
6 #include <glade/glade.h>
7 #include <gst/gst.h>
8
9 #include "gstplay.h"
10 #include "callbacks.h"
11 #include "interface.h"
12
13 extern GstElement *src;
14 extern gboolean picture_shown;
15 extern GstPlayState state;
16 extern guchar statusline[];
17 extern guchar *statustext;
18 extern GtkFileSelection *open_file_selection;
19
20 void
21 on_save1_activate                      (GtkMenuItem     *menuitem,
22                                         gpointer         user_data)
23 {
24   printf("file1 activate\n");
25
26 }
27
28 void
29 on_save_as1_activate                      (GtkMenuItem     *menuitem,
30                                         gpointer         user_data)
31 {
32   printf("file1 activate\n");
33
34 }
35
36 void
37 on_media2_activate                      (GtkMenuItem     *menuitem,
38                                         gpointer         user_data)
39 {
40   printf("file1 activate\n");
41
42 }
43 void
44 on_preferences1_activate                      (GtkMenuItem     *menuitem,
45                                         gpointer         user_data)
46 {
47   printf("file1 activate\n");
48
49 }
50
51 void
52 on_open2_activate                      (GtkMenuItem     *menuitem,
53                                         gpointer         user_data)
54 {
55   GladeXML *xml;
56   xml = glade_xml_new(DATADIR "gstplay.glade", "fileselection1");
57   /* connect the signals in the interface */
58   glade_xml_signal_autoconnect(xml);
59   open_file_selection = glade_xml_get_widget(xml, "fileselection1");
60 }
61
62 void
63 on_toggle_play_toggled                 (GtkToggleButton *togglebutton,
64                                         gpointer         user_data)
65 {
66   update_buttons(0);
67   change_state(GSTPLAY_PLAYING);
68
69 }
70
71 void
72 on_toggle_pause_toggled                 (GtkToggleButton *togglebutton,
73                                         gpointer         user_data)
74 {
75   update_buttons(1);
76   change_state(GSTPLAY_PAUSE);
77
78 }
79
80 void
81 on_toggle_stop_toggled                 (GtkToggleButton *togglebutton,
82                                         gpointer         user_data)
83 {
84   update_buttons(2);
85   change_state(GSTPLAY_STOPPED);
86 }
87
88 void
89 on_hscale1_value_changed               (GtkAdjustment   *adj,
90                                         gpointer         user_data)
91 {
92   int size = gst_util_get_int_arg(GTK_OBJECT(src),"size");
93
94   gtk_object_set(GTK_OBJECT(src),"offset",(int)(adj->value*size/100.0),NULL);
95   
96   if (state != GSTPLAY_PLAYING) {
97     show_next_picture();
98   }
99 }
100
101 void
102 on_drawingarea1_configure_event        (GtkWidget *widget, GdkEventConfigure *event,
103                                         gpointer         user_data)
104 {
105   gdk_draw_rectangle(widget->window, 
106                      widget->style->black_gc,
107                      TRUE, 0,0,
108                      widget->allocation.width,
109                      widget->allocation.height);
110
111   gdk_draw_string(widget->window,widget->style->font,widget->style->white_gc, 8, 15, statustext);
112   gdk_draw_string(widget->window,widget->style->font,widget->style->white_gc, widget->allocation.width-100, 15, statusline);
113 }
114
115 void on_about_activate(GtkWidget *widget, gpointer data)
116 {
117   GladeXML *xml;
118   xml = glade_xml_new(DATADIR "gstplay.glade", "about");
119   /* connect the signals in the interface */
120   glade_xml_signal_autoconnect(xml);
121 }
122
123 void on_gstplay_destroy(GtkWidget *widget, gpointer data)
124 {
125   gtk_main_quit();
126 }
127