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 SLIDER_HEIGHT 50
28 #define SLIDER_MAX_POS 10000
29 #define MENU_HEIGHT 26
37 #if defined( UNDER_CE ) && defined(__MINGW32__)
38 /* This is a gross hack for the wince gcc cross-compiler */
52 /*****************************************************************************
53 * intf_sys_t: description and status of wxwindows interface
54 *****************************************************************************/
60 /* The input thread */
61 input_thread_t * p_input;
64 int i_slider_pos; /* slider position */
65 int i_slider_oldpos; /* previous position */
66 vlc_bool_t b_slider_free; /* slider status */
68 /* The messages window */
69 msg_subscription_t* p_sub; /* message bank subscription */
71 /* Playlist management */
72 int i_playing; /* playlist selected item */
74 /* Send an event to show a dialog */
75 void (*pf_show_dialog) ( intf_thread_t *p_intf, int i_dialog, int i_arg,
76 intf_dialog_args_t *p_arg );
78 /* Dynamic Menu management */
79 vector<MenuItemExt*> *p_audio_menu;
80 vector<MenuItemExt*> *p_video_menu;
81 vector<MenuItemExt*> *p_navig_menu;
82 vector<MenuItemExt*> *p_settings_menu;
84 VideoWindow *p_video_window;
87 /*****************************************************************************
89 *****************************************************************************/
94 CBaseWindow(){ hInst = 0; }
95 virtual ~CBaseWindow() {};
97 HWND hWnd; // The main window handle
99 static LRESULT CALLBACK BaseWndProc( HWND, UINT, WPARAM, LPARAM );
100 static int CreateDialogBox( HWND, CBaseWindow * );
104 HINSTANCE hInst; // The current instance
105 HWND hwndCB; // The command bar handle
107 HINSTANCE GetInstance () const { return hInst; }
108 virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM ) {};
118 CBaseWindow *CreateVideoWindow( intf_thread_t *, HWND );
121 class Interface : public CBaseWindow
128 BOOL InitInstance( HINSTANCE hInstance, intf_thread_t *_pIntf );
130 void TogglePlayButton( int i_playing_status );
132 HWND hwndMain; // Handle to the main window.
134 HWND hwndCB; // Handle to the command bar (contains menu)
135 HWND hwndTB; // Handle to the toolbar.
136 HWND hwndSlider; // Handle to the Sliderbar.
138 HWND hwndVol; // Handle to the volume trackbar.
139 HWND hwndSB; // Handle to the status bar.
142 FileInfo *fi; // pas besoin de la plupart de ses attributs
153 virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
155 void OnOpenFileSimple( void );
156 void OnPlayStream( void );
157 void OnVideoOnTop( void );
159 void OnSliderUpdate( int wp );
160 void OnChange( int wp );
161 void Change( int i_volume );
162 void OnStopStream( void );
163 void OnPrevStream( void );
164 void OnNextStream( void );
165 void OnSlowStream( void );
166 void OnFastStream( void );
168 intf_thread_t *pIntf;
170 int i_old_playing_status;
174 class FileInfo : public CBaseWindow
178 FileInfo( intf_thread_t *_p_intf, HINSTANCE _hInst );
179 virtual ~FileInfo(){};
183 HWND hwnd_fileinfo; // handle to fileinfo window
184 HWND hwndTV; // handle to tree-view control
185 intf_thread_t *p_intf;
187 TCHAR szFileInfoClassName[100]; // Main window class name
188 TCHAR szFileInfoTitle[100]; // Main window name
190 virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
191 void UpdateFileInfo( HWND );
192 BOOL CreateTreeView( HWND );
196 class Messages : public CBaseWindow
200 Messages( intf_thread_t *_p_intf, HINSTANCE _hInst );
201 virtual ~Messages(){};
205 intf_thread_t *p_intf;
207 virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
210 void UpdateLog(void);
212 vlc_bool_t b_verbose;
215 /* ItemInfo Dialog */
216 class ItemInfoDialog : public CBaseWindow
220 ItemInfoDialog( intf_thread_t *, HINSTANCE, playlist_item_t * );
221 virtual ~ItemInfoDialog(){};
225 intf_thread_t *p_intf;
226 HWND hwndCB; // Handle to the command bar (but no menu)
228 playlist_item_t *p_item;
230 /* Event handlers (these functions should _not_ be virtual) */
234 virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
236 /* Controls for the iteminfo dialog box */
244 HWND enabled_checkbox;
250 class SubsFileDialog;
251 class OpenDialog : public CBaseWindow
255 OpenDialog( intf_thread_t *_p_intf, HINSTANCE _hInst,
256 int _i_access_method, int _i_arg, int _i_method );
257 virtual ~OpenDialog(){};
260 void UpdateMRL( int i_access_method );
264 intf_thread_t *p_intf;
266 virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
277 HWND subsfile_checkbox;
279 HWND subsfile_button;
280 SubsFileDialog *subsfile_dialog;
285 HWND net_port_label[4];
290 HWND net_addrs_label[4];
293 int i_current_access_method;
294 int i_method; /* Normal or for the stream dialog ? */
298 void FilePanel( HWND hwnd );
299 void NetPanel( HWND hwnd );
301 void OnSubsFileEnable();
302 void OnSubsFileSettings( HWND hwnd );
306 void OnFilePanelChange();
308 void OnNetPanelChange( int event );
309 void OnNetTypeChange( int event );
310 void DisableNETCtrl();
315 vector<string> subsfile_mrl;
318 /* Subtitles File Dialog */
319 class SubsFileDialog: public CBaseWindow
323 SubsFileDialog( intf_thread_t *_p_intf, HINSTANCE _hInst );
324 virtual ~SubsFileDialog(){};
326 vector<string> subsfile_mrl;
329 friend class OpenDialog;
331 intf_thread_t *p_intf;
349 virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
351 /* Event handlers (these functions should _not_ be virtual) */
356 class Playlist : public CBaseWindow
360 Playlist( intf_thread_t *_p_intf, HINSTANCE _hInst );
361 virtual ~Playlist(){};
371 intf_thread_t *p_intf;
372 HWND hwndCB; // Handle to the command bar (contains menu)
373 HWND hwndTB; // Handle to the toolbar.
376 void UpdatePlaylist();
378 void UpdateItem( int );
379 LRESULT ProcessCustomDraw( LPARAM lParam );
380 void HandlePopupMenu( HWND hwnd, POINT point);
382 void DeleteItem( int item );
386 void OnAddFile( vlc_bool_t );
389 void OnDeleteSelection();
390 void OnInvertSelection();
391 void OnEnableSelection();
392 void OnDisableSelection();
394 void OnActivateItem( int i_item );
395 void ShowInfos( HWND hwnd, int i_item );
404 void OnSort( UINT event );
405 void OnColSelect( int iSubItem );
410 void OnPopupInfo( HWND hwnd );
412 virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
420 Timer( intf_thread_t *p_intf, HWND hwnd, Interface *_p_main_interface);
425 intf_thread_t *p_intf;
426 Interface *p_main_interface;
427 //Interface *p_main_interface;
428 int i_old_playing_status;
433 void RefreshSettingsMenu( intf_thread_t *_p_intf, HMENU hMenu );
434 void RefreshAudioMenu( intf_thread_t *_p_intf, HMENU hMenu );
435 void RefreshVideoMenu( intf_thread_t *_p_intf, HMENU hMenu );
436 void RefreshNavigMenu( intf_thread_t *_p_intf, HMENU hMenu );
437 void RefreshMenu( intf_thread_t *, vector<MenuItemExt*> *, HMENU, int,
438 char **, int *, int );
439 int wce_GetMenuItemCount( HMENU );
440 void CreateMenuItem( intf_thread_t *, vector<MenuItemExt*> *, HMENU, char *,
441 vlc_object_t *, int * );
442 HMENU CreateChoicesMenu( intf_thread_t *, vector<MenuItemExt*> *, char *,
443 vlc_object_t *, int * );
444 void OnMenuEvent( intf_thread_t *, int );
446 /*****************************************************************************
447 * A small helper class which encapsulate wxMenuitem with some other useful
449 *****************************************************************************/
454 MenuItemExt( intf_thread_t *_p_intf, int _id, char *_psz_var,
455 int _i_object_id, vlc_value_t _val, int _i_val_type );
457 virtual ~MenuItemExt();
460 intf_thread_t *p_intf;
471 /* Preferences Dialog */
472 /* Preferences Dialog */
474 class PrefsDialog: public CBaseWindow
478 PrefsDialog( intf_thread_t *_p_intf, HINSTANCE _hInst );
479 virtual ~PrefsDialog(){};
483 intf_thread_t *p_intf;
485 /* Event handlers (these functions should _not_ be virtual) */
487 /*void OnCancel( UINT event );
488 void OnSave( UINT event );
489 void OnResetAll( UINT event );
490 void OnAdvanced( UINT event );*/
494 HWND advanced_checkbox;
497 PrefsTreeCtrl *prefs_tree;
499 virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
502 /*****************************************************************************
503 * A small helper function for utf8 <-> unicode conversions
504 *****************************************************************************/
506 static wchar_t pwsz_mbtow[2048];
507 static char psz_wtomb[2048];
508 static inline wchar_t *_FROMMB( const char *psz_in )
510 mbstowcs( pwsz_mbtow, psz_in, 2048 );
511 pwsz_mbtow[2048-1] = 0;
514 static inline char *_TOMB( const wchar_t *pwsz_in )
516 wcstombs( psz_wtomb, pwsz_in, 2048 );
517 psz_wtomb[2048-1] = 0;
521 # define _FROMMB(a) a
525 #if defined( ENABLE_NLS ) && defined( ENABLE_UTF8 )
527 #else // ENABLE_NLS && ENABLE_UTF8
531 /*****************************************************************************
532 * Misc definitions (mainly from aygshell.h)
533 *****************************************************************************/
534 #define _WIN32_IE 0x0500
536 #define SHFS_HIDESIPBUTTON 0x0008
537 #define SHIDIM_FLAGS 0x0001
538 #define SHIDIF_DONEBUTTON 0x0001
539 #define SHIDIF_SIPDOWN 0x0008
540 #define SHIDIF_FULLSCREENNOMENUBAR 0x0010
541 #define SHCMBF_HMENU 0x0010
542 #define SHCMBF_EMPTYBAR 0x0001
543 #define SHFS_SHOWSIPBUTTON 0x0004
544 #define GN_CONTEXTMENU 1000
545 #define SHCMBM_GETSUBMENU (WM_USER + 401)
546 #define SHCMBM_GETMENU (WM_USER + 402)
547 #ifndef TBSTYLE_NO_DROPDOWN_ARROW
548 #define TBSTYLE_NO_DROPDOWN_ARROW 0x0080
550 #define lstrlenW wcslen
551 #define SHGetMenu(hwnd) \
552 (HMENU)SendMessage((hwnd), SHCMBM_GETMENU, (WPARAM)0, (LPARAM)0)
553 #define TrackPopupMenu(hm,u,x,y,r,hw,p) \
554 TrackPopupMenuEx((hm),(u),(x),(y),(hw),0)
557 typedef struct tagSHMENUBARINFO
568 } SHMENUBARINFO, *PSHMENUBARINFO;
570 BOOL SHCreateMenuBar( SHMENUBARINFO *pmbi );
571 BOOL SHFullScreen(HWND hwndRequester, DWORD dwState);
573 typedef struct tagSHINITDLGINFO
578 } SHINITDLGINFO, *PSHINITDLGINFO;
580 BOOL SHInitDialog(PSHINITDLGINFO pshidi);
582 typedef struct tagNMRGINFO
587 } NMRGINFO, *PNMRGINFO;
589 BOOL WINAPI CommandBar_InsertMenubarEx(HWND, HINSTANCE, LPTSTR, WORD);
592 #if defined( WIN32 ) && !defined( UNDER_CE )
593 # define SHFullScreen(a,b)
594 # define SHInitDialog(a)
595 # define SHCreateMenuBar(a) 1
598 #endif //WINCE_RESOURCE
600 #define IDD_ABOUT 101
601 #define IDI_ICON1 102
602 #define IDB_BITMAP1 103
603 #define IDB_BITMAP2 111
604 #define IDR_MENUBAR1 113
605 #define IDR_ACCELERATOR1 116
606 #define IDD_FILEINFO 118
607 #define IDD_DUMMY 118
608 #define IDD_MESSAGES 119
609 #define IDR_MENUBAR 120
610 #define IDR_MENUBAR2 121
611 #define IDD_PLAYLIST 122
612 #define IDB_BITMAP3 123
613 #define IDD_ITEMINFO 124
614 #define IDR_DUMMYMENU 126
616 #define IDSAVEAS 1002
617 #define IDC_TEXTCTRL 1004
618 #define IDC_CUSTOM1 1012
619 #define IDS_MAIN_MENUITEM1 40001
620 #define IDS_TITLE 40002
621 #define IDS_CLASSNAME 40003
622 #define IDS_CAP_QUICKFILEOPEN 40006
623 #define IDS_CAP_VIEW 40009
624 #define IDS_CAP_SETTINGS 40012
625 #define IDS_CAP_AUDIO 40015
626 #define IDS_CAP_VIDEO 40018
627 #define IDS_CAP_HELP 40021
628 #define IDS_CAP_Navigation 40024
629 #define IDS_CAP_FILE 40025
630 #define ID_COLOR_OPTIONS 40026
631 #define IDS_DYNAMENU 40027
632 #define ID_FILE 40028
633 #define IDS_BLACK 40028
634 #define IDS_LTGRAY 40029
635 #define ID_VIEW 40030
636 #define IDS_DKGRAY 40030
637 #define IDS_WHITE 40031
638 #define ID_SETTINGS 40032
639 #define ID_AUDIO 40034
640 #define ID_EMPTY 40034
641 #define ID_VIDEO 40036
642 #define ID_NAVIGATION 40038
643 #define IDM_FILE 40042
644 #define IDM_VIEW 40044
645 #define IDM_SETTINGS 40046
646 #define IDM_AUDIO 40048
647 #define IDM_VIDEO 40050
648 #define IDM_NAVIGATION 40053
649 #define ID_FILE_QUICK_OPEN 40056
650 #define ID_FILE_OPENFILE 40057
651 #define ID_FILE_QUICKOPEN 40058
652 #define ID_FILE_OPENNETWORKSTREAM 40059
653 #define ID_FILE_OPENNET 40060
654 #define ID_FILE_EXIT 40061
655 #define ID_VIEW_PLAYLIST 40063
656 #define ID_VIEW_MESSAGES 40064
657 #define ID_VIEW_MEDIAINFO 40065
658 #define ID_VIEW_STREAMINFO 40066
659 #define IDS_CAP_NAV 40067
660 #define ID_FILE_ABOUT 40069
661 #define ID_SETTINGS_PREF 40071
662 #define ID_SETTINGS_EXTEND 40072
663 #define IDS_CAP_XXX 40084
664 #define IDM_MANAGE 40087
665 #define IDM_SORT 40088
666 #define IDM_SEL 40089
667 #define ID_SORT_AUTHOR 40091
668 #define ID_SORT_RAUTHOR 40092
669 #define ID_SORT_SHUFFLE 40095
670 #define ID_SEL_INVERT 40096
671 #define ID_SEL_DELETE 40097
672 #define ID_SEL_SELECTALL 40098
673 #define ID_SEL_ENABLE 40100
674 #define ID_SEL_DISABLE 40101
675 #define ID_SORT_TITLE 40102
676 #define ID_SORT_RTITLE 40103
677 #define ID_MANAGE_ADDFILE 40104
678 #define ID_MANAGE_ADDDIRECTORY 40105
679 #define ID_MANAGE_ADDMRL 40106
680 #define ID_MANAGE_OPENPL 40107
681 #define ID_MANAGE_SAVEPL 40108
682 #define ID_MENUITEM40108 40109
683 #define IDS_CAP_MENUITEM40109 40110
684 #define IDS_STOP 57601
685 #define StopStream_Event 57601
686 #define IDS_PLAY 57602
687 #define PlayStream_Event 57602
688 #define PrevStream_Event 57603
689 #define NextStream_Event 57604
690 #define SlowStream_Event 57605
691 #define FastStream_Event 57606
693 // Next default values for new objects
695 #ifdef APSTUDIO_INVOKED
696 #ifndef APSTUDIO_READONLY_SYMBOLS
697 #define _APS_NEXT_RESOURCE_VALUE 128
698 #define _APS_NEXT_COMMAND_VALUE 40111
699 #define _APS_NEXT_CONTROL_VALUE 1013
700 #define _APS_NEXT_SYMED_VALUE 101