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 */
260 HWND enabled_checkbox;
266 class SubsFileDialog;
267 class OpenDialog : public CBaseWindow
271 OpenDialog( intf_thread_t *_p_intf, HINSTANCE _hInst,
272 int _i_access_method, int _i_arg, int _i_method );
273 virtual ~OpenDialog(){};
276 void UpdateMRL( int i_access_method );
280 intf_thread_t *p_intf;
282 virtual LRESULT WndProc( HWND hwnd, UINT msg,
283 WPARAM wParam, LPARAM lParam,
295 HWND subsfile_checkbox;
297 HWND subsfile_button;
298 SubsFileDialog *subsfile_dialog;
303 HWND net_port_label[4];
308 HWND net_addrs_label[4];
311 int i_current_access_method;
312 int i_method; /* Normal or for the stream dialog ? */
316 void FilePanel( HWND hwnd );
317 void NetPanel( HWND hwnd );
319 void OnSubsFileEnable();
320 void OnSubsFileSettings( HWND hwnd );
324 void OnFilePanelChange();
326 void OnNetPanelChange( int event );
327 void OnNetTypeChange( int event );
328 void DisableNETCtrl();
333 vector<string> subsfile_mrl;
336 /* Subtitles File Dialog */
337 class SubsFileDialog: public CBaseWindow
341 SubsFileDialog( intf_thread_t *_p_intf, HINSTANCE _hInst );
342 virtual ~SubsFileDialog(){};
344 vector<string> subsfile_mrl;
347 friend class OpenDialog;
349 intf_thread_t *p_intf;
367 virtual LRESULT WndProc( HWND hwnd, UINT msg,
368 WPARAM wParam, LPARAM lParam,
371 /* Event handlers (these functions should _not_ be virtual) */
376 class Playlist : public CBaseWindow
380 Playlist( intf_thread_t *_p_intf, HINSTANCE _hInst );
381 virtual ~Playlist(){};
391 intf_thread_t *p_intf;
392 HWND hwndCB; // Handle to the command bar (contains menu)
393 HWND hwndTB; // Handle to the toolbar.
396 void UpdatePlaylist();
398 void UpdateItem( int );
399 LRESULT ProcessCustomDraw( LPARAM lParam );
400 void HandlePopupMenu( HWND hwnd, POINT point);
402 void DeleteItem( int item );
409 void OnDeleteSelection();
410 void OnInvertSelection();
411 void OnEnableSelection();
412 void OnDisableSelection();
414 void OnActivateItem( int i_item );
415 void ShowInfos( HWND hwnd, int i_item );
424 void OnSort( UINT event );
425 void OnColSelect( int iSubItem );
430 void OnPopupInfo( HWND hwnd );
432 virtual LRESULT WndProc( HWND hwnd, UINT msg,
433 WPARAM wParam, LPARAM lParam,
442 Timer( intf_thread_t *p_intf, HWND hwnd, Interface *_p_main_interface);
447 intf_thread_t *p_intf;
448 Interface *p_main_interface;
449 //Interface *p_main_interface;
450 int i_old_playing_status;
455 void RefreshSettingsMenu( intf_thread_t *_p_intf, HMENU hMenu );
456 void RefreshAudioMenu( intf_thread_t *_p_intf, HMENU hMenu );
457 void RefreshVideoMenu( intf_thread_t *_p_intf, HMENU hMenu );
458 void RefreshNavigMenu( intf_thread_t *_p_intf, HMENU hMenu );
459 void RefreshMenu( intf_thread_t *, vector<MenuItemExt*> *, HMENU, int,
460 char **, int *, int );
461 int wce_GetMenuItemCount( HMENU );
462 void CreateMenuItem( intf_thread_t *, vector<MenuItemExt*> *, HMENU, char *,
463 vlc_object_t *, int * );
464 HMENU CreateChoicesMenu( intf_thread_t *, vector<MenuItemExt*> *, char *,
465 vlc_object_t *, int * );
466 void OnMenuEvent( intf_thread_t *, int );
468 /*****************************************************************************
469 * A small helper class which encapsulate wxMenuitem with some other useful
471 *****************************************************************************/
476 MenuItemExt( intf_thread_t *_p_intf, int _id, char *_psz_var,
477 int _i_object_id, vlc_value_t _val, int _i_val_type );
479 virtual ~MenuItemExt();
482 intf_thread_t *p_intf;
493 /* Preferences Dialog */
494 /* Preferences Dialog */
496 class PrefsDialog: public CBaseWindow
500 PrefsDialog( intf_thread_t *_p_intf, HINSTANCE _hInst );
501 virtual ~PrefsDialog(){};
505 intf_thread_t *p_intf;
507 /* Event handlers (these functions should _not_ be virtual) */
509 /*void OnCancel( UINT event );
510 void OnSave( UINT event );
511 void OnResetAll( UINT event );
512 void OnAdvanced( UINT event );*/
516 HWND advanced_checkbox;
519 PrefsTreeCtrl *prefs_tree;
521 virtual LRESULT WndProc( HWND hwnd, UINT msg,
522 WPARAM wParam, LPARAM lParam,
526 /*****************************************************************************
527 * A small helper function for utf8 <-> unicode conversions
528 *****************************************************************************/
530 static wchar_t pwsz_mbtow[2048];
531 static char psz_wtomb[2048];
532 static inline wchar_t *_FROMMB( const char *psz_in )
534 mbstowcs( pwsz_mbtow, psz_in, 2048 );
535 pwsz_mbtow[2048] = 0;
538 static inline char *_TOMB( const wchar_t *pwsz_in )
540 wcstombs( psz_wtomb, pwsz_in, 2048 );
549 #if defined( ENABLE_NLS ) && defined( ENABLE_UTF8 )
551 #else // ENABLE_NLS && ENABLE_UTF8
555 #endif //WINCE_RESOURCE
557 #define IDD_ABOUT 101
558 #define IDI_ICON1 102
559 #define IDB_BITMAP1 103
560 #define IDB_BITMAP2 111
561 #define IDR_MENUBAR1 113
562 #define IDR_ACCELERATOR1 116
563 #define IDD_FILEINFO 118
564 #define IDD_DUMMY 118
565 #define IDD_MESSAGES 119
566 #define IDR_MENUBAR 120
567 #define IDR_MENUBAR2 121
568 #define IDD_PLAYLIST 122
569 #define IDB_BITMAP3 123
570 #define IDD_ITEMINFO 124
571 #define IDR_DUMMYMENU 126
573 #define IDSAVEAS 1002
574 #define IDC_TEXTCTRL 1004
575 #define IDC_CUSTOM1 1012
576 #define IDS_MAIN_MENUITEM1 40001
577 #define IDS_TITLE 40002
578 #define IDS_CLASSNAME 40003
579 #define IDS_CAP_QUICKFILEOPEN 40006
580 #define IDS_CAP_VIEW 40009
581 #define IDS_CAP_SETTINGS 40012
582 #define IDS_CAP_AUDIO 40015
583 #define IDS_CAP_VIDEO 40018
584 #define IDS_CAP_HELP 40021
585 #define IDS_CAP_Navigation 40024
586 #define IDS_CAP_FILE 40025
587 #define ID_COLOR_OPTIONS 40026
588 #define IDS_DYNAMENU 40027
589 #define ID_FILE 40028
590 #define IDS_BLACK 40028
591 #define IDS_LTGRAY 40029
592 #define ID_VIEW 40030
593 #define IDS_DKGRAY 40030
594 #define IDS_WHITE 40031
595 #define ID_SETTINGS 40032
596 #define ID_AUDIO 40034
597 #define ID_EMPTY 40034
598 #define ID_VIDEO 40036
599 #define ID_NAVIGATION 40038
600 #define IDM_FILE 40042
601 #define IDM_VIEW 40044
602 #define IDM_SETTINGS 40046
603 #define IDM_AUDIO 40048
604 #define IDM_VIDEO 40050
605 #define IDM_NAVIGATION 40053
606 #define ID_FILE_QUICK_OPEN 40056
607 #define ID_FILE_OPENFILE 40057
608 #define ID_FILE_QUICKOPEN 40058
609 #define ID_FILE_OPENNETWORKSTREAM 40059
610 #define ID_FILE_OPENNET 40060
611 #define ID_FILE_EXIT 40061
612 #define ID_VIEW_PLAYLIST 40063
613 #define ID_VIEW_MESSAGES 40064
614 #define ID_VIEW_MEDIAINFO 40065
615 #define ID_VIEW_STREAMINFO 40066
616 #define IDS_CAP_NAV 40067
617 #define ID_FILE_ABOUT 40069
618 #define ID_SETTINGS_PREF 40071
619 #define ID_SETTINGS_EXTEND 40072
620 #define IDS_CAP_XXX 40084
621 #define IDM_MANAGE 40087
622 #define IDM_SORT 40088
623 #define IDM_SEL 40089
624 #define ID_SORT_AUTHOR 40091
625 #define ID_SORT_RAUTHOR 40092
626 #define ID_SORT_SHUFFLE 40095
627 #define ID_SEL_INVERT 40096
628 #define ID_SEL_DELETE 40097
629 #define ID_SEL_SELECTALL 40098
630 #define ID_SEL_ENABLE 40100
631 #define ID_SEL_DISABLE 40101
632 #define ID_SORT_TITLE 40102
633 #define ID_SORT_RTITLE 40103
634 #define ID_MANAGE_SIMPLEADD 40104
635 #define ID_MANAGE_OPENPL 40105
636 #define ID_MANAGE_ADDMRL 40106
637 #define ID_MANAGE_SAVEPL 40107
638 #define ID_MENUITEM40108 40108
639 #define IDS_CAP_MENUITEM40109 40110
640 #define IDS_STOP 57601
641 #define StopStream_Event 57601
642 #define IDS_PLAY 57602
643 #define PlayStream_Event 57602
644 #define PrevStream_Event 57603
645 #define NextStream_Event 57604
646 #define SlowStream_Event 57605
647 #define FastStream_Event 57606
649 // Next default values for new objects
651 #ifdef APSTUDIO_INVOKED
652 #ifndef APSTUDIO_READONLY_SYMBOLS
653 #define _APS_NEXT_RESOURCE_VALUE 128
654 #define _APS_NEXT_COMMAND_VALUE 40111
655 #define _APS_NEXT_CONTROL_VALUE 1013
656 #define _APS_NEXT_SYMED_VALUE 101