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 HWND WINAPI CreateToolbar( HWND );
162 HWND WINAPI CreateSliderbar( HWND );
163 HWND WINAPI CreateStaticText( HWND );
164 HWND WINAPI CreateVolTrackbar( HWND );
165 HWND WINAPI CreateStatusbar( HWND );
167 void OnOpenFileSimple( void );
168 void OnPlayStream( void );
169 void OnVideoOnTop( void );
171 void OnSliderUpdate( int wp );
172 void OnChange( int wp );
173 void Change( int i_volume );
174 void OnStopStream( void );
175 void OnPrevStream( void );
176 void OnNextStream( void );
177 void OnSlowStream( void );
178 void OnFastStream( void );
180 intf_thread_t *pIntf;
182 int i_old_playing_status;
186 class FileInfo : public CBaseWindow
190 FileInfo( intf_thread_t *_p_intf, HINSTANCE _hInst );
191 virtual ~FileInfo(){};
195 HWND hwnd_fileinfo; // handle to fileinfo window
196 HWND hwndTV; // handle to tree-view control
197 intf_thread_t *p_intf;
199 TCHAR szFileInfoClassName[100]; // Main window class name
200 TCHAR szFileInfoTitle[100]; // Main window name
202 virtual LRESULT WndProc( HWND hwnd, UINT msg,
203 WPARAM wParam, LPARAM lParam, PBOOL pbProcessed );
204 void UpdateFileInfo( HWND );
205 BOOL CreateTreeView( HWND );
209 class Messages : public CBaseWindow
213 Messages( intf_thread_t *_p_intf, HINSTANCE _hInst );
214 virtual ~Messages(){};
218 intf_thread_t *p_intf;
220 virtual LRESULT WndProc( HWND hwnd, UINT msg,
221 WPARAM wParam, LPARAM lParam,
225 void UpdateLog(void);
227 vlc_bool_t b_verbose;
230 /* ItemInfo Dialog */
231 class ItemInfoDialog : public CBaseWindow
235 ItemInfoDialog( intf_thread_t *, HINSTANCE, playlist_item_t * );
236 virtual ~ItemInfoDialog(){};
240 intf_thread_t *p_intf;
241 HWND hwndCB; // Handle to the command bar (but no menu)
243 playlist_item_t *p_item;
245 /* Event handlers (these functions should _not_ be virtual) */
249 virtual LRESULT WndProc( HWND hwnd, UINT msg,
250 WPARAM wParam, LPARAM lParam,
253 /* Controls for the iteminfo dialog box */
261 HWND enabled_checkbox;
267 class SubsFileDialog;
268 class OpenDialog : public CBaseWindow
272 OpenDialog( intf_thread_t *_p_intf, HINSTANCE _hInst,
273 int _i_access_method, int _i_arg, int _i_method );
274 virtual ~OpenDialog(){};
277 void UpdateMRL( int i_access_method );
281 intf_thread_t *p_intf;
283 virtual LRESULT WndProc( HWND hwnd, UINT msg,
284 WPARAM wParam, LPARAM lParam,
296 HWND subsfile_checkbox;
298 HWND subsfile_button;
299 SubsFileDialog *subsfile_dialog;
304 HWND net_port_label[4];
309 HWND net_addrs_label[4];
312 int i_current_access_method;
313 int i_method; /* Normal or for the stream dialog ? */
317 void FilePanel( HWND hwnd );
318 void NetPanel( HWND hwnd );
320 void OnSubsFileEnable();
321 void OnSubsFileSettings( HWND hwnd );
325 void OnFilePanelChange();
327 void OnNetPanelChange( int event );
328 void OnNetTypeChange( int event );
329 void DisableNETCtrl();
334 vector<string> subsfile_mrl;
337 /* Subtitles File Dialog */
338 class SubsFileDialog: public CBaseWindow
342 SubsFileDialog( intf_thread_t *_p_intf, HINSTANCE _hInst );
343 virtual ~SubsFileDialog(){};
345 vector<string> subsfile_mrl;
348 friend class OpenDialog;
350 intf_thread_t *p_intf;
368 virtual LRESULT WndProc( HWND hwnd, UINT msg,
369 WPARAM wParam, LPARAM lParam,
372 /* Event handlers (these functions should _not_ be virtual) */
377 class Playlist : public CBaseWindow
381 Playlist( intf_thread_t *_p_intf, HINSTANCE _hInst );
382 virtual ~Playlist(){};
392 intf_thread_t *p_intf;
393 HWND hwndCB; // Handle to the command bar (contains menu)
394 HWND hwndTB; // Handle to the toolbar.
397 void UpdatePlaylist();
399 void UpdateItem( int );
400 LRESULT ProcessCustomDraw( LPARAM lParam );
401 void HandlePopupMenu( HWND hwnd, POINT point);
403 void DeleteItem( int item );
410 void OnDeleteSelection();
411 void OnInvertSelection();
412 void OnEnableSelection();
413 void OnDisableSelection();
415 void OnActivateItem( int i_item );
416 void ShowInfos( HWND hwnd, int i_item );
425 void OnSort( UINT event );
426 void OnColSelect( int iSubItem );
431 void OnPopupInfo( HWND hwnd );
433 virtual LRESULT WndProc( HWND hwnd, UINT msg,
434 WPARAM wParam, LPARAM lParam,
443 Timer( intf_thread_t *p_intf, HWND hwnd, Interface *_p_main_interface);
448 intf_thread_t *p_intf;
449 Interface *p_main_interface;
450 //Interface *p_main_interface;
451 int i_old_playing_status;
456 void RefreshSettingsMenu( intf_thread_t *_p_intf, HMENU hMenu );
457 void RefreshAudioMenu( intf_thread_t *_p_intf, HMENU hMenu );
458 void RefreshVideoMenu( intf_thread_t *_p_intf, HMENU hMenu );
459 void RefreshNavigMenu( intf_thread_t *_p_intf, HMENU hMenu );
460 void RefreshMenu( intf_thread_t *, vector<MenuItemExt*> *, HMENU, int,
461 char **, int *, int );
462 int wce_GetMenuItemCount( HMENU );
463 void CreateMenuItem( intf_thread_t *, vector<MenuItemExt*> *, HMENU, char *,
464 vlc_object_t *, int * );
465 HMENU CreateChoicesMenu( intf_thread_t *, vector<MenuItemExt*> *, char *,
466 vlc_object_t *, int * );
467 void OnMenuEvent( intf_thread_t *, int );
469 /*****************************************************************************
470 * A small helper class which encapsulate wxMenuitem with some other useful
472 *****************************************************************************/
477 MenuItemExt( intf_thread_t *_p_intf, int _id, char *_psz_var,
478 int _i_object_id, vlc_value_t _val, int _i_val_type );
480 virtual ~MenuItemExt();
483 intf_thread_t *p_intf;
494 /* Preferences Dialog */
495 /* Preferences Dialog */
497 class PrefsDialog: public CBaseWindow
501 PrefsDialog( intf_thread_t *_p_intf, HINSTANCE _hInst );
502 virtual ~PrefsDialog(){};
506 intf_thread_t *p_intf;
508 /* Event handlers (these functions should _not_ be virtual) */
510 /*void OnCancel( UINT event );
511 void OnSave( UINT event );
512 void OnResetAll( UINT event );
513 void OnAdvanced( UINT event );*/
517 HWND advanced_checkbox;
520 PrefsTreeCtrl *prefs_tree;
522 virtual LRESULT WndProc( HWND hwnd, UINT msg,
523 WPARAM wParam, LPARAM lParam,
527 /*****************************************************************************
528 * A small helper function for utf8 <-> unicode conversions
529 *****************************************************************************/
531 static wchar_t pwsz_mbtow[2048];
532 static char psz_wtomb[2048];
533 static inline wchar_t *_FROMMB( const char *psz_in )
535 mbstowcs( pwsz_mbtow, psz_in, 2048 );
536 pwsz_mbtow[2048-1] = 0;
539 static inline char *_TOMB( const wchar_t *pwsz_in )
541 wcstombs( psz_wtomb, pwsz_in, 2048 );
542 psz_wtomb[2048-1] = 0;
546 # define _FROMMB(a) a
550 #if defined( ENABLE_NLS ) && defined( ENABLE_UTF8 )
552 #else // ENABLE_NLS && ENABLE_UTF8
556 /*****************************************************************************
557 * Misc definitions (mainly from aygshell.h)
558 *****************************************************************************/
559 #define _WIN32_IE 0x0500
561 #define SHFS_HIDESIPBUTTON 0x0008
562 #define SHIDIM_FLAGS 0x0001
563 #define SHIDIF_DONEBUTTON 0x0001
564 #define SHIDIF_SIPDOWN 0x0008
565 #define SHIDIF_FULLSCREENNOMENUBAR 0x0010
566 #define SHCMBF_HMENU 0x0010
567 #define SHFS_SHOWSIPBUTTON 0x0004
568 #define GN_CONTEXTMENU 1000
569 #define SHCMBM_GETSUBMENU (WM_USER + 401)
570 #define lstrlenW wcslen
571 #define TrackPopupMenu(hm,u,x,y,r,hw,p) \
572 TrackPopupMenuEx((hm),(u),(x),(y),(hw),0)
575 typedef struct tagSHMENUBARINFO
586 } SHMENUBARINFO, *PSHMENUBARINFO;
588 BOOL SHCreateMenuBar( SHMENUBARINFO *pmbi );
589 BOOL SHFullScreen(HWND hwndRequester, DWORD dwState);
591 typedef struct tagSHINITDLGINFO
596 } SHINITDLGINFO, *PSHINITDLGINFO;
598 BOOL SHInitDialog(PSHINITDLGINFO pshidi);
600 typedef struct tagNMRGINFO
605 } NMRGINFO, *PNMRGINFO;
608 #if defined( WIN32 ) && !defined( UNDER_CE )
609 # define SHFullScreen(a,b)
610 # define SHInitDialog(a)
611 # define SHCreateMenuBar(a) 1
614 #endif //WINCE_RESOURCE
616 #define IDD_ABOUT 101
617 #define IDI_ICON1 102
618 #define IDB_BITMAP1 103
619 #define IDB_BITMAP2 111
620 #define IDR_MENUBAR1 113
621 #define IDR_ACCELERATOR1 116
622 #define IDD_FILEINFO 118
623 #define IDD_DUMMY 118
624 #define IDD_MESSAGES 119
625 #define IDR_MENUBAR 120
626 #define IDR_MENUBAR2 121
627 #define IDD_PLAYLIST 122
628 #define IDB_BITMAP3 123
629 #define IDD_ITEMINFO 124
630 #define IDR_DUMMYMENU 126
632 #define IDSAVEAS 1002
633 #define IDC_TEXTCTRL 1004
634 #define IDC_CUSTOM1 1012
635 #define IDS_MAIN_MENUITEM1 40001
636 #define IDS_TITLE 40002
637 #define IDS_CLASSNAME 40003
638 #define IDS_CAP_QUICKFILEOPEN 40006
639 #define IDS_CAP_VIEW 40009
640 #define IDS_CAP_SETTINGS 40012
641 #define IDS_CAP_AUDIO 40015
642 #define IDS_CAP_VIDEO 40018
643 #define IDS_CAP_HELP 40021
644 #define IDS_CAP_Navigation 40024
645 #define IDS_CAP_FILE 40025
646 #define ID_COLOR_OPTIONS 40026
647 #define IDS_DYNAMENU 40027
648 #define ID_FILE 40028
649 #define IDS_BLACK 40028
650 #define IDS_LTGRAY 40029
651 #define ID_VIEW 40030
652 #define IDS_DKGRAY 40030
653 #define IDS_WHITE 40031
654 #define ID_SETTINGS 40032
655 #define ID_AUDIO 40034
656 #define ID_EMPTY 40034
657 #define ID_VIDEO 40036
658 #define ID_NAVIGATION 40038
659 #define IDM_FILE 40042
660 #define IDM_VIEW 40044
661 #define IDM_SETTINGS 40046
662 #define IDM_AUDIO 40048
663 #define IDM_VIDEO 40050
664 #define IDM_NAVIGATION 40053
665 #define ID_FILE_QUICK_OPEN 40056
666 #define ID_FILE_OPENFILE 40057
667 #define ID_FILE_QUICKOPEN 40058
668 #define ID_FILE_OPENNETWORKSTREAM 40059
669 #define ID_FILE_OPENNET 40060
670 #define ID_FILE_EXIT 40061
671 #define ID_VIEW_PLAYLIST 40063
672 #define ID_VIEW_MESSAGES 40064
673 #define ID_VIEW_MEDIAINFO 40065
674 #define ID_VIEW_STREAMINFO 40066
675 #define IDS_CAP_NAV 40067
676 #define ID_FILE_ABOUT 40069
677 #define ID_SETTINGS_PREF 40071
678 #define ID_SETTINGS_EXTEND 40072
679 #define IDS_CAP_XXX 40084
680 #define IDM_MANAGE 40087
681 #define IDM_SORT 40088
682 #define IDM_SEL 40089
683 #define ID_SORT_AUTHOR 40091
684 #define ID_SORT_RAUTHOR 40092
685 #define ID_SORT_SHUFFLE 40095
686 #define ID_SEL_INVERT 40096
687 #define ID_SEL_DELETE 40097
688 #define ID_SEL_SELECTALL 40098
689 #define ID_SEL_ENABLE 40100
690 #define ID_SEL_DISABLE 40101
691 #define ID_SORT_TITLE 40102
692 #define ID_SORT_RTITLE 40103
693 #define ID_MANAGE_SIMPLEADD 40104
694 #define ID_MANAGE_OPENPL 40105
695 #define ID_MANAGE_ADDMRL 40106
696 #define ID_MANAGE_SAVEPL 40107
697 #define ID_MENUITEM40108 40108
698 #define IDS_CAP_MENUITEM40109 40110
699 #define IDS_STOP 57601
700 #define StopStream_Event 57601
701 #define IDS_PLAY 57602
702 #define PlayStream_Event 57602
703 #define PrevStream_Event 57603
704 #define NextStream_Event 57604
705 #define SlowStream_Event 57605
706 #define FastStream_Event 57606
708 // Next default values for new objects
710 #ifdef APSTUDIO_INVOKED
711 #ifndef APSTUDIO_READONLY_SYMBOLS
712 #define _APS_NEXT_RESOURCE_VALUE 128
713 #define _APS_NEXT_COMMAND_VALUE 40111
714 #define _APS_NEXT_CONTROL_VALUE 1013
715 #define _APS_NEXT_SYMED_VALUE 101