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 */
49 vector<string> SeparateEntries( TCHAR *entries );
54 /*****************************************************************************
55 * intf_sys_t: description and status of wxwindows interface
56 *****************************************************************************/
62 /* The input thread */
63 input_thread_t * p_input;
66 int i_slider_pos; /* slider position */
67 int i_slider_oldpos; /* previous position */
68 vlc_bool_t b_slider_free; /* slider status */
70 /* The messages window */
71 msg_subscription_t* p_sub; /* message bank subscription */
73 /* Playlist management */
74 int i_playing; /* playlist selected item */
76 /* Send an event to show a dialog */
77 void (*pf_show_dialog) ( intf_thread_t *p_intf, int i_dialog, int i_arg,
78 intf_dialog_args_t *p_arg );
80 /* Dynamic Menu management */
81 vector<MenuItemExt*> *p_audio_menu;
82 vector<MenuItemExt*> *p_video_menu;
83 vector<MenuItemExt*> *p_navig_menu;
84 vector<MenuItemExt*> *p_settings_menu;
86 VideoWindow *p_video_window;
89 /*****************************************************************************
91 *****************************************************************************/
96 CBaseWindow(){ hInst = 0; }
97 virtual ~CBaseWindow() {};
99 HWND hWnd; // The main window handle
100 BOOL DlgFlag; // True if object is a dialog window
102 static LRESULT CALLBACK BaseWndProc( HWND hwnd, UINT msg,
103 WPARAM wParam, LPARAM lParam );
107 HINSTANCE hInst; // The current instance
108 HWND hwndCB; // The command bar handle
110 HINSTANCE GetInstance () const { return hInst; }
111 virtual LRESULT WndProc( HWND hwnd, UINT msg,
112 WPARAM wParam, LPARAM lParam,
113 PBOOL pbProcessed ){*pbProcessed = FALSE; return 0;}
123 CBaseWindow *CreateVideoWindow( intf_thread_t *, HINSTANCE, HWND );
126 class Interface : public CBaseWindow
133 BOOL InitInstance( HINSTANCE hInstance, intf_thread_t *_pIntf );
135 void TogglePlayButton( int i_playing_status );
137 HWND hwndMain; // Handle to the main window.
139 HWND hwndCB; // Handle to the command bar (contains menu)
140 HWND hwndTB; // Handle to the toolbar.
141 HWND hwndSlider; // Handle to the Sliderbar.
143 HWND hwndVol; // Handle to the volume trackbar.
144 HWND hwndSB; // Handle to the status bar.
147 FileInfo *fi; // pas besoin de la plupart de ses attributs
158 virtual LRESULT WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
161 void OnOpenFileSimple( void );
162 void OnPlayStream( void );
163 void OnVideoOnTop( void );
165 void OnSliderUpdate( int wp );
166 void OnChange( int wp );
167 void Change( int i_volume );
168 void OnStopStream( void );
169 void OnPrevStream( void );
170 void OnNextStream( void );
171 void OnSlowStream( void );
172 void OnFastStream( void );
174 intf_thread_t *pIntf;
176 int i_old_playing_status;
180 class FileInfo : public CBaseWindow
184 FileInfo( intf_thread_t *_p_intf, HINSTANCE _hInst );
185 virtual ~FileInfo(){};
189 HWND hwnd_fileinfo; // handle to fileinfo window
190 HWND hwndTV; // handle to tree-view control
191 intf_thread_t *p_intf;
193 TCHAR szFileInfoClassName[100]; // Main window class name
194 TCHAR szFileInfoTitle[100]; // Main window name
196 virtual LRESULT WndProc( HWND hwnd, UINT msg,
197 WPARAM wParam, LPARAM lParam, PBOOL pbProcessed );
198 void UpdateFileInfo( HWND );
199 BOOL CreateTreeView( HWND );
203 class Messages : public CBaseWindow
207 Messages( intf_thread_t *_p_intf, HINSTANCE _hInst );
208 virtual ~Messages(){};
212 intf_thread_t *p_intf;
214 virtual LRESULT WndProc( HWND hwnd, UINT msg,
215 WPARAM wParam, LPARAM lParam,
219 void UpdateLog(void);
221 vlc_bool_t b_verbose;
224 /* ItemInfo Dialog */
225 class ItemInfoDialog : public CBaseWindow
229 ItemInfoDialog( intf_thread_t *, HINSTANCE, playlist_item_t * );
230 virtual ~ItemInfoDialog(){};
234 intf_thread_t *p_intf;
235 HWND hwndCB; // Handle to the command bar (but no menu)
237 playlist_item_t *p_item;
239 /* Event handlers (these functions should _not_ be virtual) */
243 virtual LRESULT WndProc( HWND hwnd, UINT msg,
244 WPARAM wParam, LPARAM lParam,
247 /* Controls for the iteminfo dialog box */
255 HWND enabled_checkbox;
261 class SubsFileDialog;
262 class OpenDialog : public CBaseWindow
266 OpenDialog( intf_thread_t *_p_intf, HINSTANCE _hInst,
267 int _i_access_method, int _i_arg, int _i_method );
268 virtual ~OpenDialog(){};
271 void UpdateMRL( int i_access_method );
275 intf_thread_t *p_intf;
277 virtual LRESULT WndProc( HWND hwnd, UINT msg,
278 WPARAM wParam, LPARAM lParam,
290 HWND subsfile_checkbox;
292 HWND subsfile_button;
293 SubsFileDialog *subsfile_dialog;
298 HWND net_port_label[4];
303 HWND net_addrs_label[4];
306 int i_current_access_method;
307 int i_method; /* Normal or for the stream dialog ? */
311 void FilePanel( HWND hwnd );
312 void NetPanel( HWND hwnd );
314 void OnSubsFileEnable();
315 void OnSubsFileSettings( HWND hwnd );
319 void OnFilePanelChange();
321 void OnNetPanelChange( int event );
322 void OnNetTypeChange( int event );
323 void DisableNETCtrl();
328 vector<string> subsfile_mrl;
331 /* Subtitles File Dialog */
332 class SubsFileDialog: public CBaseWindow
336 SubsFileDialog( intf_thread_t *_p_intf, HINSTANCE _hInst );
337 virtual ~SubsFileDialog(){};
339 vector<string> subsfile_mrl;
342 friend class OpenDialog;
344 intf_thread_t *p_intf;
362 virtual LRESULT WndProc( HWND hwnd, UINT msg,
363 WPARAM wParam, LPARAM lParam,
366 /* Event handlers (these functions should _not_ be virtual) */
371 class Playlist : public CBaseWindow
375 Playlist( intf_thread_t *_p_intf, HINSTANCE _hInst );
376 virtual ~Playlist(){};
386 intf_thread_t *p_intf;
387 HWND hwndCB; // Handle to the command bar (contains menu)
388 HWND hwndTB; // Handle to the toolbar.
391 void UpdatePlaylist();
393 void UpdateItem( int );
394 LRESULT ProcessCustomDraw( LPARAM lParam );
395 void HandlePopupMenu( HWND hwnd, POINT point);
397 void DeleteItem( int item );
404 void OnDeleteSelection();
405 void OnInvertSelection();
406 void OnEnableSelection();
407 void OnDisableSelection();
409 void OnActivateItem( int i_item );
410 void ShowInfos( HWND hwnd, int i_item );
419 void OnSort( UINT event );
420 void OnColSelect( int iSubItem );
425 void OnPopupInfo( HWND hwnd );
427 virtual LRESULT WndProc( HWND hwnd, UINT msg,
428 WPARAM wParam, LPARAM lParam,
437 Timer( intf_thread_t *p_intf, HWND hwnd, Interface *_p_main_interface);
442 intf_thread_t *p_intf;
443 Interface *p_main_interface;
444 //Interface *p_main_interface;
445 int i_old_playing_status;
450 void RefreshSettingsMenu( intf_thread_t *_p_intf, HMENU hMenu );
451 void RefreshAudioMenu( intf_thread_t *_p_intf, HMENU hMenu );
452 void RefreshVideoMenu( intf_thread_t *_p_intf, HMENU hMenu );
453 void RefreshNavigMenu( intf_thread_t *_p_intf, HMENU hMenu );
454 void RefreshMenu( intf_thread_t *, vector<MenuItemExt*> *, HMENU, int,
455 char **, int *, int );
456 int wce_GetMenuItemCount( HMENU );
457 void CreateMenuItem( intf_thread_t *, vector<MenuItemExt*> *, HMENU, char *,
458 vlc_object_t *, int * );
459 HMENU CreateChoicesMenu( intf_thread_t *, vector<MenuItemExt*> *, char *,
460 vlc_object_t *, int * );
461 void OnMenuEvent( intf_thread_t *, int );
463 /*****************************************************************************
464 * A small helper class which encapsulate wxMenuitem with some other useful
466 *****************************************************************************/
471 MenuItemExt( intf_thread_t *_p_intf, int _id, char *_psz_var,
472 int _i_object_id, vlc_value_t _val, int _i_val_type );
474 virtual ~MenuItemExt();
477 intf_thread_t *p_intf;
488 /* Preferences Dialog */
489 /* Preferences Dialog */
491 class PrefsDialog: public CBaseWindow
495 PrefsDialog( intf_thread_t *_p_intf, HINSTANCE _hInst );
496 virtual ~PrefsDialog(){};
500 intf_thread_t *p_intf;
502 /* Event handlers (these functions should _not_ be virtual) */
504 /*void OnCancel( UINT event );
505 void OnSave( UINT event );
506 void OnResetAll( UINT event );
507 void OnAdvanced( UINT event );*/
511 HWND advanced_checkbox;
514 PrefsTreeCtrl *prefs_tree;
516 virtual LRESULT WndProc( HWND hwnd, UINT msg,
517 WPARAM wParam, LPARAM lParam,
521 /*****************************************************************************
522 * A small helper function for utf8 <-> unicode conversions
523 *****************************************************************************/
525 static wchar_t pwsz_mbtow[2048];
526 static char psz_wtomb[2048];
527 static inline wchar_t *_FROMMB( const char *psz_in )
529 mbstowcs( pwsz_mbtow, psz_in, 2048 );
530 pwsz_mbtow[2048-1] = 0;
533 static inline char *_TOMB( const wchar_t *pwsz_in )
535 wcstombs( psz_wtomb, pwsz_in, 2048 );
536 psz_wtomb[2048-1] = 0;
540 # define _FROMMB(a) a
544 #if defined( ENABLE_NLS ) && defined( ENABLE_UTF8 )
546 #else // ENABLE_NLS && ENABLE_UTF8
550 /*****************************************************************************
551 * Misc definitions (mainly from aygshell.h)
552 *****************************************************************************/
553 #define _WIN32_IE 0x0500
555 #define SHFS_HIDESIPBUTTON 0x0008
556 #define SHIDIM_FLAGS 0x0001
557 #define SHIDIF_DONEBUTTON 0x0001
558 #define SHIDIF_SIPDOWN 0x0008
559 #define SHIDIF_FULLSCREENNOMENUBAR 0x0010
560 #define SHCMBF_HMENU 0x0010
561 #define SHCMBF_EMPTYBAR 0x0001
562 #define SHFS_SHOWSIPBUTTON 0x0004
563 #define GN_CONTEXTMENU 1000
564 #define SHCMBM_GETSUBMENU (WM_USER + 401)
565 #define SHCMBM_GETMENU (WM_USER + 402)
566 #ifndef TBSTYLE_NO_DROPDOWN_ARROW
567 #define TBSTYLE_NO_DROPDOWN_ARROW 0x0080
569 #define lstrlenW wcslen
570 #define SHGetMenu(hwnd) \
571 (HMENU)SendMessage((hwnd), SHCMBM_GETMENU, (WPARAM)0, (LPARAM)0)
572 #define TrackPopupMenu(hm,u,x,y,r,hw,p) \
573 TrackPopupMenuEx((hm),(u),(x),(y),(hw),0)
576 typedef struct tagSHMENUBARINFO
587 } SHMENUBARINFO, *PSHMENUBARINFO;
589 BOOL SHCreateMenuBar( SHMENUBARINFO *pmbi );
590 BOOL SHFullScreen(HWND hwndRequester, DWORD dwState);
592 typedef struct tagSHINITDLGINFO
597 } SHINITDLGINFO, *PSHINITDLGINFO;
599 BOOL SHInitDialog(PSHINITDLGINFO pshidi);
601 typedef struct tagNMRGINFO
606 } NMRGINFO, *PNMRGINFO;
608 BOOL WINAPI CommandBar_InsertMenubarEx(HWND, HINSTANCE, LPTSTR, WORD);
611 #if defined( WIN32 ) && !defined( UNDER_CE )
612 # define SHFullScreen(a,b)
613 # define SHInitDialog(a)
614 # define SHCreateMenuBar(a) 1
617 #endif //WINCE_RESOURCE
619 #define IDD_ABOUT 101
620 #define IDI_ICON1 102
621 #define IDB_BITMAP1 103
622 #define IDB_BITMAP2 111
623 #define IDR_MENUBAR1 113
624 #define IDR_ACCELERATOR1 116
625 #define IDD_FILEINFO 118
626 #define IDD_DUMMY 118
627 #define IDD_MESSAGES 119
628 #define IDR_MENUBAR 120
629 #define IDR_MENUBAR2 121
630 #define IDD_PLAYLIST 122
631 #define IDB_BITMAP3 123
632 #define IDD_ITEMINFO 124
633 #define IDR_DUMMYMENU 126
635 #define IDSAVEAS 1002
636 #define IDC_TEXTCTRL 1004
637 #define IDC_CUSTOM1 1012
638 #define IDS_MAIN_MENUITEM1 40001
639 #define IDS_TITLE 40002
640 #define IDS_CLASSNAME 40003
641 #define IDS_CAP_QUICKFILEOPEN 40006
642 #define IDS_CAP_VIEW 40009
643 #define IDS_CAP_SETTINGS 40012
644 #define IDS_CAP_AUDIO 40015
645 #define IDS_CAP_VIDEO 40018
646 #define IDS_CAP_HELP 40021
647 #define IDS_CAP_Navigation 40024
648 #define IDS_CAP_FILE 40025
649 #define ID_COLOR_OPTIONS 40026
650 #define IDS_DYNAMENU 40027
651 #define ID_FILE 40028
652 #define IDS_BLACK 40028
653 #define IDS_LTGRAY 40029
654 #define ID_VIEW 40030
655 #define IDS_DKGRAY 40030
656 #define IDS_WHITE 40031
657 #define ID_SETTINGS 40032
658 #define ID_AUDIO 40034
659 #define ID_EMPTY 40034
660 #define ID_VIDEO 40036
661 #define ID_NAVIGATION 40038
662 #define IDM_FILE 40042
663 #define IDM_VIEW 40044
664 #define IDM_SETTINGS 40046
665 #define IDM_AUDIO 40048
666 #define IDM_VIDEO 40050
667 #define IDM_NAVIGATION 40053
668 #define ID_FILE_QUICK_OPEN 40056
669 #define ID_FILE_OPENFILE 40057
670 #define ID_FILE_QUICKOPEN 40058
671 #define ID_FILE_OPENNETWORKSTREAM 40059
672 #define ID_FILE_OPENNET 40060
673 #define ID_FILE_EXIT 40061
674 #define ID_VIEW_PLAYLIST 40063
675 #define ID_VIEW_MESSAGES 40064
676 #define ID_VIEW_MEDIAINFO 40065
677 #define ID_VIEW_STREAMINFO 40066
678 #define IDS_CAP_NAV 40067
679 #define ID_FILE_ABOUT 40069
680 #define ID_SETTINGS_PREF 40071
681 #define ID_SETTINGS_EXTEND 40072
682 #define IDS_CAP_XXX 40084
683 #define IDM_MANAGE 40087
684 #define IDM_SORT 40088
685 #define IDM_SEL 40089
686 #define ID_SORT_AUTHOR 40091
687 #define ID_SORT_RAUTHOR 40092
688 #define ID_SORT_SHUFFLE 40095
689 #define ID_SEL_INVERT 40096
690 #define ID_SEL_DELETE 40097
691 #define ID_SEL_SELECTALL 40098
692 #define ID_SEL_ENABLE 40100
693 #define ID_SEL_DISABLE 40101
694 #define ID_SORT_TITLE 40102
695 #define ID_SORT_RTITLE 40103
696 #define ID_MANAGE_SIMPLEADD 40104
697 #define ID_MANAGE_OPENPL 40105
698 #define ID_MANAGE_ADDMRL 40106
699 #define ID_MANAGE_SAVEPL 40107
700 #define ID_MENUITEM40108 40108
701 #define IDS_CAP_MENUITEM40109 40110
702 #define IDS_STOP 57601
703 #define StopStream_Event 57601
704 #define IDS_PLAY 57602
705 #define PlayStream_Event 57602
706 #define PrevStream_Event 57603
707 #define NextStream_Event 57604
708 #define SlowStream_Event 57605
709 #define FastStream_Event 57606
711 // Next default values for new objects
713 #ifdef APSTUDIO_INVOKED
714 #ifndef APSTUDIO_READONLY_SYMBOLS
715 #define _APS_NEXT_RESOURCE_VALUE 128
716 #define _APS_NEXT_COMMAND_VALUE 40111
717 #define _APS_NEXT_CONTROL_VALUE 1013
718 #define _APS_NEXT_SYMED_VALUE 101