]> git.sesse.net Git - vlc/blob - modules/gui/wxwindows/wxwindows.h
* InterfaceWindow.cpp: removed warnigs
[vlc] / modules / gui / wxwindows / wxwindows.h
1 /*****************************************************************************
2  * wxwindows.h: private wxWindows interface description
3  *****************************************************************************
4  * Copyright (C) 1999, 2000 VideoLAN
5  * $Id: wxwindows.h,v 1.3 2002/11/23 14:28:51 gbazin Exp $
6  *
7  * Authors: Gildas Bazin <gbazin@netcourrier.com>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  * 
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24 #include <wx/listctrl.h>
25 #include <wx/dnd.h>
26
27 class Playlist;
28
29 #define SLIDER_MAX_POS 10000
30
31 /*****************************************************************************
32  * intf_sys_t: description and status of Gtk+ interface
33  *****************************************************************************/
34 struct intf_sys_t
35 {
36     /* the wx parent window */
37     wxWindow            *p_wxwindow;
38
39     /* secondary windows */
40     Playlist            *p_playlist_window;
41
42     /* special actions */
43     vlc_bool_t          b_playing;
44     vlc_bool_t          b_popup_changed;                   /* display menu ? */
45     vlc_bool_t          b_window_changed;        /* window display toggled ? */
46     vlc_bool_t          b_playlist_changed;    /* playlist display toggled ? */
47     vlc_bool_t          b_slider_free;                      /* slider status */
48
49     /* menus handlers */
50     vlc_bool_t          b_program_update;   /* do we need to update programs 
51                                                                         menu */
52     vlc_bool_t          b_title_update;  /* do we need to update title menus */
53     vlc_bool_t          b_chapter_update;            /* do we need to update
54                                                                chapter menus */
55     vlc_bool_t          b_audio_update;  /* do we need to update audio menus */
56     vlc_bool_t          b_spu_update;      /* do we need to update spu menus */
57
58     /* windows and widgets */
59
60     /* The input thread */
61     input_thread_t *    p_input;
62
63     /* The slider */
64     int                 i_slider_pos;                     /* slider position */
65     int                 i_slider_oldpos;                /* previous position */
66
67     /* The messages window */
68     msg_subscription_t* p_sub;                  /* message bank subscription */
69
70     /* Playlist management */
71     int                 i_playing;                 /* playlist selected item */
72
73     /* The window labels for DVD mode */
74     int                 i_part;                           /* current chapter */
75 };
76
77 /*****************************************************************************
78  * Prototypes
79  *****************************************************************************/
80
81 /*****************************************************************************
82  * Classes declarations.
83  *****************************************************************************/
84 class Interface;
85
86 /* Timer */
87 class Timer: public wxTimer
88 {
89 public:
90     /* Constructor */
91     Timer( intf_thread_t *p_intf, Interface *p_main_interface );
92     virtual ~Timer();
93
94     virtual void Notify();
95
96 private:
97     intf_thread_t *p_intf;
98     Interface *p_main_interface;
99 };
100
101 /* Main Interface */
102 class Interface: public wxFrame
103 {
104 public:
105     /* Constructor */
106     Interface( intf_thread_t *p_intf );
107     virtual ~Interface();
108
109     wxBoxSizer  *frame_sizer;
110     wxStatusBar *statusbar;
111
112     wxSlider    *slider;
113     wxWindow    *slider_frame;
114     wxStaticBox *slider_box;
115
116 private:
117     void CreateOurMenuBar();
118     void CreateOurToolBar();
119     void CreateOurSlider();
120
121     /* Event handlers (these functions should _not_ be virtual) */
122     void OnExit( wxCommandEvent& event );
123     void OnAbout( wxCommandEvent& event );
124     void OnPlaylist( wxCommandEvent& event );
125     void OnOpenFile( wxCommandEvent& event );
126     void OnPlayStream( wxCommandEvent& event );
127     void OnStopStream( wxCommandEvent& event );
128     void OnPauseStream( wxCommandEvent& event );
129     void OnSliderUpdate( wxScrollEvent& event );
130     void OnPrevStream( wxCommandEvent& event );
131     void OnNextStream( wxCommandEvent& event );
132
133     DECLARE_EVENT_TABLE();
134
135     Timer *timer;
136     intf_thread_t *p_intf;
137 };
138
139 /* Playlist */
140 class Playlist: public wxFrame
141 {
142 public:
143     /* Constructor */
144     Playlist( intf_thread_t *p_intf, Interface *p_main_interface );
145     virtual ~Playlist();
146     void Rebuild();
147     void Manage();
148
149 private:
150     /* Event handlers (these functions should _not_ be virtual) */
151     void OnAddUrl( wxCommandEvent& event );
152     void OnAddDirectory( wxCommandEvent& event );
153     void OnClose( wxCommandEvent& event );
154     void OnInvertSelection( wxCommandEvent& event );
155     void OnDeleteSelection( wxCommandEvent& event );
156     void OnSelectAll( wxCommandEvent& event );
157     void OnActivateItem( wxListEvent& event );
158     void OnKeyDown( wxListEvent& event );
159
160     DECLARE_EVENT_TABLE();
161
162     void DeleteItem( int item );
163     intf_thread_t *p_intf;
164     Interface *p_main_interface;
165     wxListView *listview;
166     wxButton *ok_button;
167 };
168
169 /* Drag and Drop class */
170 class DragAndDrop: public wxFileDropTarget
171 {
172 public:
173     DragAndDrop( intf_thread_t *_p_intf );
174
175     virtual bool OnDropFiles( wxCoord x, wxCoord y,
176                               const wxArrayString& filenames );
177
178 private:
179     intf_thread_t *p_intf;
180 };