1 /*****************************************************************************
2 * wince.h: private WinCE interface descriptor
3 *****************************************************************************
4 * Copyright (C) 1999-2004 VideoLAN
7 * Authors: Gildas Bazin <gbazin@videolan.org>
8 * Marodon Cedric <cedric_marodon@yahoo.fr>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
23 *****************************************************************************/
25 #ifndef WINCE_RESOURCE
27 #define MENU_HEIGHT 26
28 #define SLIDER_HEIGHT 50
30 #define SLIDER_MAX_POS 10000
45 vector<string> SeparateEntries( LPWSTR entries );
50 /*****************************************************************************
51 * intf_sys_t: description and status of wxwindows interface
52 *****************************************************************************/
58 /* The input thread */
59 input_thread_t * p_input;
62 int i_slider_pos; /* slider position */
63 int i_slider_oldpos; /* previous position */
64 vlc_bool_t b_slider_free; /* slider status */
66 /* The messages window */
67 msg_subscription_t* p_sub; /* message bank subscription */
69 /* Playlist management */
70 int i_playing; /* playlist selected item */
72 /* Send an event to show a dialog */
73 void (*pf_show_dialog) ( intf_thread_t *p_intf, int i_dialog, int i_arg,
74 intf_dialog_args_t *p_arg );
76 /* Dynamic Menu management */
77 vector<MenuItemExt*> *p_audio_menu;
78 vector<MenuItemExt*> *p_video_menu;
79 vector<MenuItemExt*> *p_navig_menu;
80 vector<MenuItemExt*> *p_settings_menu;
82 VideoWindow *p_video_window;
85 /*****************************************************************************
87 *****************************************************************************/
92 CBaseWindow(){ hInst = 0; }
93 virtual ~CBaseWindow() {};
95 HWND hWnd; // The main window handle
96 BOOL DlgFlag; // True if object is a dialog window
98 static LRESULT CALLBACK BaseWndProc( HWND hwnd, UINT msg,
99 WPARAM wParam, LPARAM lParam );
103 HINSTANCE hInst; // The current instance
104 HWND hwndCB; // The command bar handle
106 HINSTANCE GetInstance () const { return hInst; }
107 virtual LRESULT WndProc( HWND hwnd, UINT msg,
108 WPARAM wParam, LPARAM lParam,
109 PBOOL pbProcessed ){*pbProcessed = FALSE; return 0;}
119 CBaseWindow *CreateVideoWindow( intf_thread_t *, HINSTANCE, HWND );
122 class Interface : public CBaseWindow
129 BOOL InitInstance( HINSTANCE hInstance, intf_thread_t *_pIntf );
131 void TogglePlayButton( int i_playing_status );
133 HWND hwndMain; // Handle to the main window.
135 HWND hwndCB; // Handle to the command bar (contains menu)
136 HWND hwndTB; // Handle to the toolbar.
137 HWND hwndSlider; // Handle to the Sliderbar.
139 HWND hwndVol; // Handle to the volume trackbar.
140 HWND hwndSB; // Handle to the status bar.
143 FileInfo *fi; // pas besoin de la plupart de ses attributs
154 virtual LRESULT WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
157 HWND WINAPI CreateToolbar( HWND );
158 HWND WINAPI CreateSliderbar( HWND );
159 HWND WINAPI CreateStaticText( HWND );
160 HWND WINAPI CreateVolTrackbar( HWND );
161 HWND WINAPI CreateStatusbar( HWND );
163 void OnOpenFileSimple( void );
164 void OnPlayStream( void );
165 void OnVideoOnTop( void );
167 void OnSliderUpdate( int wp );
168 void OnChange( int wp );
169 void Change( int i_volume );
170 void OnStopStream( void );
171 void OnPrevStream( void );
172 void OnNextStream( void );
173 void OnSlowStream( void );
174 void OnFastStream( void );
176 intf_thread_t *pIntf;
178 int i_old_playing_status;
182 class FileInfo : public CBaseWindow
186 FileInfo( intf_thread_t *_p_intf, HINSTANCE _hInst );
187 virtual ~FileInfo(){};
191 HWND hwnd_fileinfo; // handle to fileinfo window
192 HWND hwndTV; // handle to tree-view control
193 intf_thread_t *p_intf;
195 TCHAR szFileInfoClassName[100]; // Main window class name
196 TCHAR szFileInfoTitle[100]; // Main window name
198 virtual LRESULT WndProc( HWND hwnd, UINT msg,
199 WPARAM wParam, LPARAM lParam, PBOOL pbProcessed );
200 void UpdateFileInfo( HWND );
201 BOOL CreateTreeView( HWND );
205 class Messages : public CBaseWindow
209 Messages( intf_thread_t *_p_intf, HINSTANCE _hInst );
210 virtual ~Messages(){};
214 intf_thread_t *p_intf;
216 virtual LRESULT WndProc( HWND hwnd, UINT msg,
217 WPARAM wParam, LPARAM lParam,
221 void UpdateLog(void);
223 vlc_bool_t b_verbose;
226 /* ItemInfo Dialog */
227 class ItemInfoDialog : public CBaseWindow
231 ItemInfoDialog( intf_thread_t *, HINSTANCE, playlist_item_t * );
232 virtual ~ItemInfoDialog(){};
236 intf_thread_t *p_intf;
237 HWND hwndCB; // Handle to the command bar (but no menu)
239 playlist_item_t *p_item;
241 /* Event handlers (these functions should _not_ be virtual) */
245 virtual LRESULT WndProc( HWND hwnd, UINT msg,
246 WPARAM wParam, LPARAM lParam,
249 /* Controls for the iteminfo dialog box */
257 HWND enabled_checkbox;
263 class SubsFileDialog;
264 class OpenDialog : public CBaseWindow
268 OpenDialog( intf_thread_t *_p_intf, HINSTANCE _hInst,
269 int _i_access_method, int _i_arg, int _i_method );
270 virtual ~OpenDialog(){};
273 void UpdateMRL( int i_access_method );
277 intf_thread_t *p_intf;
279 virtual LRESULT WndProc( HWND hwnd, UINT msg,
280 WPARAM wParam, LPARAM lParam,
292 HWND subsfile_checkbox;
294 HWND subsfile_button;
295 SubsFileDialog *subsfile_dialog;
300 HWND net_port_label[4];
305 HWND net_addrs_label[4];
308 int i_current_access_method;
309 int i_method; /* Normal or for the stream dialog ? */
313 void FilePanel( HWND hwnd );
314 void NetPanel( HWND hwnd );
316 void OnSubsFileEnable();
317 void OnSubsFileSettings( HWND hwnd );
321 void OnFilePanelChange();
323 void OnNetPanelChange( int event );
324 void OnNetTypeChange( int event );
325 void DisableNETCtrl();
330 vector<string> subsfile_mrl;
333 /* Subtitles File Dialog */
334 class SubsFileDialog: public CBaseWindow
338 SubsFileDialog( intf_thread_t *_p_intf, HINSTANCE _hInst );
339 virtual ~SubsFileDialog(){};
341 vector<string> subsfile_mrl;
344 friend class OpenDialog;
346 intf_thread_t *p_intf;
364 virtual LRESULT WndProc( HWND hwnd, UINT msg,
365 WPARAM wParam, LPARAM lParam,
368 /* Event handlers (these functions should _not_ be virtual) */
373 class Playlist : public CBaseWindow
377 Playlist( intf_thread_t *_p_intf, HINSTANCE _hInst );
378 virtual ~Playlist(){};
388 intf_thread_t *p_intf;
389 HWND hwndCB; // Handle to the command bar (contains menu)
390 HWND hwndTB; // Handle to the toolbar.
393 void UpdatePlaylist();
395 void UpdateItem( int );
396 LRESULT ProcessCustomDraw( LPARAM lParam );
397 void HandlePopupMenu( HWND hwnd, POINT point);
399 void DeleteItem( int item );
406 void OnDeleteSelection();
407 void OnInvertSelection();
408 void OnEnableSelection();
409 void OnDisableSelection();
411 void OnActivateItem( int i_item );
412 void ShowInfos( HWND hwnd, int i_item );
421 void OnSort( UINT event );
422 void OnColSelect( int iSubItem );
427 void OnPopupInfo( HWND hwnd );
429 virtual LRESULT WndProc( HWND hwnd, UINT msg,
430 WPARAM wParam, LPARAM lParam,
439 Timer( intf_thread_t *p_intf, HWND hwnd, Interface *_p_main_interface);
444 intf_thread_t *p_intf;
445 Interface *p_main_interface;
446 //Interface *p_main_interface;
447 int i_old_playing_status;
452 void RefreshSettingsMenu( intf_thread_t *_p_intf, HMENU hMenu );
453 void RefreshAudioMenu( intf_thread_t *_p_intf, HMENU hMenu );
454 void RefreshVideoMenu( intf_thread_t *_p_intf, HMENU hMenu );
455 void RefreshNavigMenu( intf_thread_t *_p_intf, HMENU hMenu );
456 void RefreshMenu( intf_thread_t *, vector<MenuItemExt*> *, HMENU, int,
457 char **, int *, int );
458 int wce_GetMenuItemCount( HMENU );
459 void CreateMenuItem( intf_thread_t *, vector<MenuItemExt*> *, HMENU, char *,
460 vlc_object_t *, int * );
461 HMENU CreateChoicesMenu( intf_thread_t *, vector<MenuItemExt*> *, char *,
462 vlc_object_t *, int * );
463 void OnMenuEvent( intf_thread_t *, int );
465 /*****************************************************************************
466 * A small helper class which encapsulate wxMenuitem with some other useful
468 *****************************************************************************/
473 MenuItemExt( intf_thread_t *_p_intf, int _id, char *_psz_var,
474 int _i_object_id, vlc_value_t _val, int _i_val_type );
476 virtual ~MenuItemExt();
479 intf_thread_t *p_intf;
490 /* Preferences Dialog */
491 /* Preferences Dialog */
493 class PrefsDialog: public CBaseWindow
497 PrefsDialog( intf_thread_t *_p_intf, HINSTANCE _hInst );
498 virtual ~PrefsDialog(){};
502 intf_thread_t *p_intf;
504 /* Event handlers (these functions should _not_ be virtual) */
506 /*void OnCancel( UINT event );
507 void OnSave( UINT event );
508 void OnResetAll( UINT event );
509 void OnAdvanced( UINT event );*/
513 HWND advanced_checkbox;
516 PrefsTreeCtrl *prefs_tree;
518 virtual LRESULT WndProc( HWND hwnd, UINT msg,
519 WPARAM wParam, LPARAM lParam,
523 /*****************************************************************************
524 * A small helper function for utf8 <-> unicode conversions
525 *****************************************************************************/
527 static wchar_t pwsz_mbtow[2048];
528 static char psz_wtomb[2048];
529 static inline wchar_t *_FROMMB( const char *psz_in )
531 mbstowcs( pwsz_mbtow, psz_in, 2048 );
532 pwsz_mbtow[2048] = 0;
535 static inline char *_TOMB( const wchar_t *pwsz_in )
537 wcstombs( psz_wtomb, pwsz_in, 2048 );
546 #if defined( ENABLE_NLS ) && defined( ENABLE_UTF8 )
548 #else // ENABLE_NLS && ENABLE_UTF8
552 #endif //WINCE_RESOURCE
554 #define IDD_ABOUT 101
555 #define IDI_ICON1 102
556 #define IDB_BITMAP1 103
557 #define IDB_BITMAP2 111
558 #define IDR_MENUBAR1 113
559 #define IDR_ACCELERATOR1 116
560 #define IDD_FILEINFO 118
561 #define IDD_DUMMY 118
562 #define IDD_MESSAGES 119
563 #define IDR_MENUBAR 120
564 #define IDR_MENUBAR2 121
565 #define IDD_PLAYLIST 122
566 #define IDB_BITMAP3 123
567 #define IDD_ITEMINFO 124
568 #define IDR_DUMMYMENU 126
570 #define IDSAVEAS 1002
571 #define IDC_TEXTCTRL 1004
572 #define IDC_CUSTOM1 1012
573 #define IDS_MAIN_MENUITEM1 40001
574 #define IDS_TITLE 40002
575 #define IDS_CLASSNAME 40003
576 #define IDS_CAP_QUICKFILEOPEN 40006
577 #define IDS_CAP_VIEW 40009
578 #define IDS_CAP_SETTINGS 40012
579 #define IDS_CAP_AUDIO 40015
580 #define IDS_CAP_VIDEO 40018
581 #define IDS_CAP_HELP 40021
582 #define IDS_CAP_Navigation 40024
583 #define IDS_CAP_FILE 40025
584 #define ID_COLOR_OPTIONS 40026
585 #define IDS_DYNAMENU 40027
586 #define ID_FILE 40028
587 #define IDS_BLACK 40028
588 #define IDS_LTGRAY 40029
589 #define ID_VIEW 40030
590 #define IDS_DKGRAY 40030
591 #define IDS_WHITE 40031
592 #define ID_SETTINGS 40032
593 #define ID_AUDIO 40034
594 #define ID_EMPTY 40034
595 #define ID_VIDEO 40036
596 #define ID_NAVIGATION 40038
597 #define IDM_FILE 40042
598 #define IDM_VIEW 40044
599 #define IDM_SETTINGS 40046
600 #define IDM_AUDIO 40048
601 #define IDM_VIDEO 40050
602 #define IDM_NAVIGATION 40053
603 #define ID_FILE_QUICK_OPEN 40056
604 #define ID_FILE_OPENFILE 40057
605 #define ID_FILE_QUICKOPEN 40058
606 #define ID_FILE_OPENNETWORKSTREAM 40059
607 #define ID_FILE_OPENNET 40060
608 #define ID_FILE_EXIT 40061
609 #define ID_VIEW_PLAYLIST 40063
610 #define ID_VIEW_MESSAGES 40064
611 #define ID_VIEW_MEDIAINFO 40065
612 #define ID_VIEW_STREAMINFO 40066
613 #define IDS_CAP_NAV 40067
614 #define ID_FILE_ABOUT 40069
615 #define ID_SETTINGS_PREF 40071
616 #define ID_SETTINGS_EXTEND 40072
617 #define IDS_CAP_XXX 40084
618 #define IDM_MANAGE 40087
619 #define IDM_SORT 40088
620 #define IDM_SEL 40089
621 #define ID_SORT_AUTHOR 40091
622 #define ID_SORT_RAUTHOR 40092
623 #define ID_SORT_SHUFFLE 40095
624 #define ID_SEL_INVERT 40096
625 #define ID_SEL_DELETE 40097
626 #define ID_SEL_SELECTALL 40098
627 #define ID_SEL_ENABLE 40100
628 #define ID_SEL_DISABLE 40101
629 #define ID_SORT_TITLE 40102
630 #define ID_SORT_RTITLE 40103
631 #define ID_MANAGE_SIMPLEADD 40104
632 #define ID_MANAGE_OPENPL 40105
633 #define ID_MANAGE_ADDMRL 40106
634 #define ID_MANAGE_SAVEPL 40107
635 #define ID_MENUITEM40108 40108
636 #define IDS_CAP_MENUITEM40109 40110
637 #define IDS_STOP 57601
638 #define StopStream_Event 57601
639 #define IDS_PLAY 57602
640 #define PlayStream_Event 57602
641 #define PrevStream_Event 57603
642 #define NextStream_Event 57604
643 #define SlowStream_Event 57605
644 #define FastStream_Event 57606
646 // Next default values for new objects
648 #ifdef APSTUDIO_INVOKED
649 #ifndef APSTUDIO_READONLY_SYMBOLS
650 #define _APS_NEXT_RESOURCE_VALUE 128
651 #define _APS_NEXT_COMMAND_VALUE 40111
652 #define _APS_NEXT_CONTROL_VALUE 1013
653 #define _APS_NEXT_SYMED_VALUE 101