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;
86 /* GetOpenFileName replacement */
87 BOOL (WINAPI *GetOpenFile)(void *);
88 HMODULE h_gsgetfile_dll;
91 #define GetOpenFile(a) p_intf->p_sys->GetOpenFile(a)
93 /*****************************************************************************
95 *****************************************************************************/
100 CBaseWindow(){ hInst = 0; }
101 virtual ~CBaseWindow() {};
103 HWND hWnd; // The main window handle
105 static LRESULT CALLBACK BaseWndProc( HWND, UINT, WPARAM, LPARAM );
106 static int CreateDialogBox( HWND, CBaseWindow * );
110 HINSTANCE hInst; // The current instance
111 HWND hwndCB; // The command bar handle
113 HINSTANCE GetInstance () const { return hInst; }
114 virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM ) { return 0; };
116 intf_thread_t *p_intf;
126 CBaseWindow *CreateVideoWindow( intf_thread_t *, HWND );
129 class Interface : public CBaseWindow
136 BOOL InitInstance( HINSTANCE, intf_thread_t * );
138 void TogglePlayButton( int i_playing_status );
140 HWND hwndMain; // Handle to the main window.
142 HWND hwndCB; // Handle to the command bar (contains menu)
143 HWND hwndTB; // Handle to the toolbar.
144 HWND hwndSlider; // Handle to the Sliderbar.
146 HWND hwndVol; // Handle to the volume trackbar.
147 HWND hwndSB; // Handle to the status bar.
150 FileInfo *fi; // pas besoin de la plupart de ses attributs
161 virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
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 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
192 TCHAR szFileInfoClassName[100]; // Main window class name
193 TCHAR szFileInfoTitle[100]; // Main window name
195 virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
196 void UpdateFileInfo( HWND );
197 BOOL CreateTreeView( HWND );
201 class Messages : public CBaseWindow
205 Messages( intf_thread_t *_p_intf, HINSTANCE _hInst );
206 virtual ~Messages(){};
210 virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
213 void UpdateLog(void);
215 vlc_bool_t b_verbose;
218 /* ItemInfo Dialog */
219 class ItemInfoDialog : public CBaseWindow
223 ItemInfoDialog( intf_thread_t *, HINSTANCE, playlist_item_t * );
224 virtual ~ItemInfoDialog(){};
228 intf_thread_t *p_intf;
229 HWND hwndCB; // Handle to the command bar (but no menu)
231 playlist_item_t *p_item;
233 /* Event handlers (these functions should _not_ be virtual) */
237 virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
239 /* Controls for the iteminfo dialog box */
247 HWND enabled_checkbox;
253 class SubsFileDialog;
254 class OpenDialog : public CBaseWindow
258 OpenDialog( intf_thread_t *_p_intf, HINSTANCE _hInst,
259 int _i_access_method, int _i_arg, int _i_method );
260 virtual ~OpenDialog(){};
263 void UpdateMRL( int i_access_method );
267 virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
278 HWND subsfile_checkbox;
280 HWND subsfile_button;
281 SubsFileDialog *subsfile_dialog;
286 HWND net_port_label[4];
291 HWND net_addrs_label[4];
294 int i_current_access_method;
295 int i_method; /* Normal or for the stream dialog ? */
299 void FilePanel( HWND hwnd );
300 void NetPanel( HWND hwnd );
302 void OnSubsFileEnable();
303 void OnSubsFileSettings( HWND hwnd );
307 void OnFilePanelChange();
309 void OnNetPanelChange( int event );
310 void OnNetTypeChange( int event );
311 void DisableNETCtrl();
316 vector<string> subsfile_mrl;
319 /* Subtitles File Dialog */
320 class SubsFileDialog: public CBaseWindow
324 SubsFileDialog( intf_thread_t *_p_intf, HINSTANCE _hInst );
325 virtual ~SubsFileDialog(){};
327 vector<string> subsfile_mrl;
330 friend class OpenDialog;
348 virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
350 /* Event handlers (these functions should _not_ be virtual) */
355 class Playlist : public CBaseWindow
359 Playlist( intf_thread_t *_p_intf, HINSTANCE _hInst );
360 virtual ~Playlist(){};
370 HWND hwndCB; // Handle to the command bar (contains menu)
371 HWND hwndTB; // Handle to the toolbar.
374 void UpdatePlaylist();
376 void UpdateItem( int );
377 LRESULT ProcessCustomDraw( LPARAM lParam );
378 void HandlePopupMenu( HWND hwnd, POINT point);
380 void DeleteItem( int item );
384 void OnAddFile( vlc_bool_t );
387 void OnDeleteSelection();
388 void OnInvertSelection();
389 void OnEnableSelection();
390 void OnDisableSelection();
392 void OnActivateItem( int i_item );
393 void ShowInfos( HWND hwnd, int i_item );
402 void OnSort( UINT event );
403 void OnColSelect( int iSubItem );
408 void OnPopupInfo( HWND hwnd );
410 virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
418 Timer( intf_thread_t *p_intf, HWND hwnd, Interface *_p_main_interface);
423 intf_thread_t *p_intf;
424 Interface *p_main_interface;
425 //Interface *p_main_interface;
426 int i_old_playing_status;
431 void RefreshSettingsMenu( intf_thread_t *_p_intf, HMENU hMenu );
432 void RefreshAudioMenu( intf_thread_t *_p_intf, HMENU hMenu );
433 void RefreshVideoMenu( intf_thread_t *_p_intf, HMENU hMenu );
434 void RefreshNavigMenu( intf_thread_t *_p_intf, HMENU hMenu );
435 void RefreshMenu( intf_thread_t *, vector<MenuItemExt*> *, HMENU, int,
436 char **, int *, int );
437 int wce_GetMenuItemCount( HMENU );
438 void CreateMenuItem( intf_thread_t *, vector<MenuItemExt*> *, HMENU, char *,
439 vlc_object_t *, int * );
440 HMENU CreateChoicesMenu( intf_thread_t *, vector<MenuItemExt*> *, char *,
441 vlc_object_t *, int * );
442 void OnMenuEvent( intf_thread_t *, int );
444 /*****************************************************************************
445 * A small helper class which encapsulate wxMenuitem with some other useful
447 *****************************************************************************/
452 MenuItemExt( intf_thread_t *_p_intf, int _id, char *_psz_var,
453 int _i_object_id, vlc_value_t _val, int _i_val_type );
455 virtual ~MenuItemExt();
458 intf_thread_t *p_intf;
469 /* Preferences Dialog */
470 /* Preferences Dialog */
472 class PrefsDialog: public CBaseWindow
476 PrefsDialog( intf_thread_t *_p_intf, HINSTANCE _hInst );
477 virtual ~PrefsDialog(){};
481 /* Event handlers (these functions should _not_ be virtual) */
483 /*void OnCancel( UINT event );
484 void OnSave( UINT event );
485 void OnResetAll( UINT event );
486 void OnAdvanced( UINT event );*/
490 HWND advanced_checkbox;
493 PrefsTreeCtrl *prefs_tree;
495 virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
498 /*****************************************************************************
499 * A small helper function for utf8 <-> unicode conversions
500 *****************************************************************************/
502 static wchar_t pwsz_mbtow[2048];
503 static char psz_wtomb[2048];
504 static inline wchar_t *_FROMMB( const char *psz_in )
506 mbstowcs( pwsz_mbtow, psz_in, 2048 );
507 pwsz_mbtow[2048-1] = 0;
510 static inline char *_TOMB( const wchar_t *pwsz_in )
512 wcstombs( psz_wtomb, pwsz_in, 2048 );
513 psz_wtomb[2048-1] = 0;
517 # define _FROMMB(a) a
521 #if defined( ENABLE_NLS ) && defined( ENABLE_UTF8 )
523 #else // ENABLE_NLS && ENABLE_UTF8
527 /*****************************************************************************
528 * Misc definitions (mainly from aygshell.h)
529 *****************************************************************************/
530 #define _WIN32_IE 0x0500
532 #define SHFS_HIDESIPBUTTON 0x0008
533 #define SHIDIM_FLAGS 0x0001
534 #define SHIDIF_DONEBUTTON 0x0001
535 #define SHIDIF_SIPDOWN 0x0008
536 #define SHIDIF_FULLSCREENNOMENUBAR 0x0010
537 #define SHCMBF_HMENU 0x0010
538 #define SHCMBF_EMPTYBAR 0x0001
539 #define SHFS_SHOWSIPBUTTON 0x0004
540 #define GN_CONTEXTMENU 1000
541 #define SHCMBM_GETSUBMENU (WM_USER + 401)
542 #define SHCMBM_GETMENU (WM_USER + 402)
543 #ifndef TBSTYLE_NO_DROPDOWN_ARROW
544 #define TBSTYLE_NO_DROPDOWN_ARROW 0x0080
546 #define lstrlenW wcslen
547 #define SHGetMenu(hwnd) \
548 (HMENU)SendMessage((hwnd), SHCMBM_GETMENU, (WPARAM)0, (LPARAM)0)
549 #define TrackPopupMenu(hm,u,x,y,r,hw,p) \
550 TrackPopupMenuEx((hm),(u),(x),(y),(hw),0)
553 typedef struct tagSHMENUBARINFO
564 } SHMENUBARINFO, *PSHMENUBARINFO;
566 BOOL SHCreateMenuBar( SHMENUBARINFO *pmbi );
567 BOOL SHFullScreen(HWND hwndRequester, DWORD dwState);
569 typedef struct tagSHINITDLGINFO
574 } SHINITDLGINFO, *PSHINITDLGINFO;
576 BOOL SHInitDialog(PSHINITDLGINFO pshidi);
578 typedef struct tagNMRGINFO
583 } NMRGINFO, *PNMRGINFO;
585 BOOL WINAPI CommandBar_InsertMenubarEx(HWND, HINSTANCE, LPTSTR, WORD);
588 #if defined( WIN32 ) && !defined( UNDER_CE )
589 # define SHFullScreen(a,b)
590 # define SHInitDialog(a)
591 # define SHCreateMenuBar(a) 1
594 #endif //WINCE_RESOURCE
596 #define IDD_ABOUT 101
597 #define IDI_ICON1 102
598 #define IDB_BITMAP1 103
599 #define IDB_BITMAP2 111
600 #define IDR_MENUBAR1 113
601 #define IDR_ACCELERATOR1 116
602 #define IDD_FILEINFO 118
603 #define IDD_DUMMY 118
604 #define IDD_MESSAGES 119
605 #define IDR_MENUBAR 120
606 #define IDR_MENUBAR2 121
607 #define IDD_PLAYLIST 122
608 #define IDB_BITMAP3 123
609 #define IDD_ITEMINFO 124
610 #define IDR_DUMMYMENU 126
612 #define IDSAVEAS 1002
613 #define IDC_TEXTCTRL 1004
614 #define IDC_CUSTOM1 1012
615 #define IDS_MAIN_MENUITEM1 40001
616 #define IDS_TITLE 40002
617 #define IDS_CLASSNAME 40003
618 #define IDS_CAP_QUICKFILEOPEN 40006
619 #define IDS_CAP_VIEW 40009
620 #define IDS_CAP_SETTINGS 40012
621 #define IDS_CAP_AUDIO 40015
622 #define IDS_CAP_VIDEO 40018
623 #define IDS_CAP_HELP 40021
624 #define IDS_CAP_Navigation 40024
625 #define IDS_CAP_FILE 40025
626 #define ID_COLOR_OPTIONS 40026
627 #define IDS_DYNAMENU 40027
628 #define ID_FILE 40028
629 #define IDS_BLACK 40028
630 #define IDS_LTGRAY 40029
631 #define ID_VIEW 40030
632 #define IDS_DKGRAY 40030
633 #define IDS_WHITE 40031
634 #define ID_SETTINGS 40032
635 #define ID_AUDIO 40034
636 #define ID_EMPTY 40034
637 #define ID_VIDEO 40036
638 #define ID_NAVIGATION 40038
639 #define IDM_FILE 40042
640 #define IDM_VIEW 40044
641 #define IDM_SETTINGS 40046
642 #define IDM_AUDIO 40048
643 #define IDM_VIDEO 40050
644 #define IDM_NAVIGATION 40053
645 #define ID_FILE_QUICK_OPEN 40056
646 #define ID_FILE_OPENFILE 40057
647 #define ID_FILE_QUICKOPEN 40058
648 #define ID_FILE_OPENNETWORKSTREAM 40059
649 #define ID_FILE_OPENNET 40060
650 #define ID_FILE_EXIT 40061
651 #define ID_VIEW_PLAYLIST 40063
652 #define ID_VIEW_MESSAGES 40064
653 #define ID_VIEW_MEDIAINFO 40065
654 #define ID_VIEW_STREAMINFO 40066
655 #define IDS_CAP_NAV 40067
656 #define ID_FILE_ABOUT 40069
657 #define ID_SETTINGS_PREF 40071
658 #define ID_SETTINGS_EXTEND 40072
659 #define IDS_CAP_XXX 40084
660 #define IDM_MANAGE 40087
661 #define IDM_SORT 40088
662 #define IDM_SEL 40089
663 #define ID_SORT_AUTHOR 40091
664 #define ID_SORT_RAUTHOR 40092
665 #define ID_SORT_SHUFFLE 40095
666 #define ID_SEL_INVERT 40096
667 #define ID_SEL_DELETE 40097
668 #define ID_SEL_SELECTALL 40098
669 #define ID_SEL_ENABLE 40100
670 #define ID_SEL_DISABLE 40101
671 #define ID_SORT_TITLE 40102
672 #define ID_SORT_RTITLE 40103
673 #define ID_MANAGE_ADDFILE 40104
674 #define ID_MANAGE_ADDDIRECTORY 40105
675 #define ID_MANAGE_ADDMRL 40106
676 #define ID_MANAGE_OPENPL 40107
677 #define ID_MANAGE_SAVEPL 40108
678 #define ID_MENUITEM40108 40109
679 #define IDS_CAP_MENUITEM40109 40110
680 #define IDS_STOP 57601
681 #define StopStream_Event 57601
682 #define IDS_PLAY 57602
683 #define PlayStream_Event 57602
684 #define PrevStream_Event 57603
685 #define NextStream_Event 57604
686 #define SlowStream_Event 57605
687 #define FastStream_Event 57606
689 // Next default values for new objects
691 #ifdef APSTUDIO_INVOKED
692 #ifndef APSTUDIO_READONLY_SYMBOLS
693 #define _APS_NEXT_RESOURCE_VALUE 128
694 #define _APS_NEXT_COMMAND_VALUE 40111
695 #define _APS_NEXT_CONTROL_VALUE 1013
696 #define _APS_NEXT_SYMED_VALUE 101