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 */
39 char *strerror( int );
50 vector<string> SeparateEntries( LPWSTR entries );
55 /*****************************************************************************
56 * intf_sys_t: description and status of wxwindows interface
57 *****************************************************************************/
63 /* The input thread */
64 input_thread_t * p_input;
67 int i_slider_pos; /* slider position */
68 int i_slider_oldpos; /* previous position */
69 vlc_bool_t b_slider_free; /* slider status */
71 /* The messages window */
72 msg_subscription_t* p_sub; /* message bank subscription */
74 /* Playlist management */
75 int i_playing; /* playlist selected item */
77 /* Send an event to show a dialog */
78 void (*pf_show_dialog) ( intf_thread_t *p_intf, int i_dialog, int i_arg,
79 intf_dialog_args_t *p_arg );
81 /* Dynamic Menu management */
82 vector<MenuItemExt*> *p_audio_menu;
83 vector<MenuItemExt*> *p_video_menu;
84 vector<MenuItemExt*> *p_navig_menu;
85 vector<MenuItemExt*> *p_settings_menu;
87 VideoWindow *p_video_window;
90 /*****************************************************************************
92 *****************************************************************************/
97 CBaseWindow(){ hInst = 0; }
98 virtual ~CBaseWindow() {};
100 HWND hWnd; // The main window handle
101 BOOL DlgFlag; // True if object is a dialog window
103 static LRESULT CALLBACK BaseWndProc( HWND hwnd, UINT msg,
104 WPARAM wParam, LPARAM lParam );
108 HINSTANCE hInst; // The current instance
109 HWND hwndCB; // The command bar handle
111 HINSTANCE GetInstance () const { return hInst; }
112 virtual LRESULT WndProc( HWND hwnd, UINT msg,
113 WPARAM wParam, LPARAM lParam,
114 PBOOL pbProcessed ){*pbProcessed = FALSE; return 0;}
124 CBaseWindow *CreateVideoWindow( intf_thread_t *, HINSTANCE, HWND );
127 class Interface : public CBaseWindow
134 BOOL InitInstance( HINSTANCE hInstance, intf_thread_t *_pIntf );
136 void TogglePlayButton( int i_playing_status );
138 HWND hwndMain; // Handle to the main window.
140 HWND hwndCB; // Handle to the command bar (contains menu)
141 HWND hwndTB; // Handle to the toolbar.
142 HWND hwndSlider; // Handle to the Sliderbar.
144 HWND hwndVol; // Handle to the volume trackbar.
145 HWND hwndSB; // Handle to the status bar.
148 FileInfo *fi; // pas besoin de la plupart de ses attributs
159 virtual LRESULT WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
162 HWND WINAPI CreateToolbar( HWND );
163 HWND WINAPI CreateSliderbar( HWND );
164 HWND WINAPI CreateStaticText( HWND );
165 HWND WINAPI CreateVolTrackbar( HWND );
166 HWND WINAPI CreateStatusbar( HWND );
168 void OnOpenFileSimple( void );
169 void OnPlayStream( void );
170 void OnVideoOnTop( void );
172 void OnSliderUpdate( int wp );
173 void OnChange( int wp );
174 void Change( int i_volume );
175 void OnStopStream( void );
176 void OnPrevStream( void );
177 void OnNextStream( void );
178 void OnSlowStream( void );
179 void OnFastStream( void );
181 intf_thread_t *pIntf;
183 int i_old_playing_status;
187 class FileInfo : public CBaseWindow
191 FileInfo( intf_thread_t *_p_intf, HINSTANCE _hInst );
192 virtual ~FileInfo(){};
196 HWND hwnd_fileinfo; // handle to fileinfo window
197 HWND hwndTV; // handle to tree-view control
198 intf_thread_t *p_intf;
200 TCHAR szFileInfoClassName[100]; // Main window class name
201 TCHAR szFileInfoTitle[100]; // Main window name
203 virtual LRESULT WndProc( HWND hwnd, UINT msg,
204 WPARAM wParam, LPARAM lParam, PBOOL pbProcessed );
205 void UpdateFileInfo( HWND );
206 BOOL CreateTreeView( HWND );
210 class Messages : public CBaseWindow
214 Messages( intf_thread_t *_p_intf, HINSTANCE _hInst );
215 virtual ~Messages(){};
219 intf_thread_t *p_intf;
221 virtual LRESULT WndProc( HWND hwnd, UINT msg,
222 WPARAM wParam, LPARAM lParam,
226 void UpdateLog(void);
228 vlc_bool_t b_verbose;
231 /* ItemInfo Dialog */
232 class ItemInfoDialog : public CBaseWindow
236 ItemInfoDialog( intf_thread_t *, HINSTANCE, playlist_item_t * );
237 virtual ~ItemInfoDialog(){};
241 intf_thread_t *p_intf;
242 HWND hwndCB; // Handle to the command bar (but no menu)
244 playlist_item_t *p_item;
246 /* Event handlers (these functions should _not_ be virtual) */
250 virtual LRESULT WndProc( HWND hwnd, UINT msg,
251 WPARAM wParam, LPARAM lParam,
254 /* Controls for the iteminfo dialog box */
262 HWND enabled_checkbox;
268 class SubsFileDialog;
269 class OpenDialog : public CBaseWindow
273 OpenDialog( intf_thread_t *_p_intf, HINSTANCE _hInst,
274 int _i_access_method, int _i_arg, int _i_method );
275 virtual ~OpenDialog(){};
278 void UpdateMRL( int i_access_method );
282 intf_thread_t *p_intf;
284 virtual LRESULT WndProc( HWND hwnd, UINT msg,
285 WPARAM wParam, LPARAM lParam,
297 HWND subsfile_checkbox;
299 HWND subsfile_button;
300 SubsFileDialog *subsfile_dialog;
305 HWND net_port_label[4];
310 HWND net_addrs_label[4];
313 int i_current_access_method;
314 int i_method; /* Normal or for the stream dialog ? */
318 void FilePanel( HWND hwnd );
319 void NetPanel( HWND hwnd );
321 void OnSubsFileEnable();
322 void OnSubsFileSettings( HWND hwnd );
326 void OnFilePanelChange();
328 void OnNetPanelChange( int event );
329 void OnNetTypeChange( int event );
330 void DisableNETCtrl();
335 vector<string> subsfile_mrl;
338 /* Subtitles File Dialog */
339 class SubsFileDialog: public CBaseWindow
343 SubsFileDialog( intf_thread_t *_p_intf, HINSTANCE _hInst );
344 virtual ~SubsFileDialog(){};
346 vector<string> subsfile_mrl;
349 friend class OpenDialog;
351 intf_thread_t *p_intf;
369 virtual LRESULT WndProc( HWND hwnd, UINT msg,
370 WPARAM wParam, LPARAM lParam,
373 /* Event handlers (these functions should _not_ be virtual) */
378 class Playlist : public CBaseWindow
382 Playlist( intf_thread_t *_p_intf, HINSTANCE _hInst );
383 virtual ~Playlist(){};
393 intf_thread_t *p_intf;
394 HWND hwndCB; // Handle to the command bar (contains menu)
395 HWND hwndTB; // Handle to the toolbar.
398 void UpdatePlaylist();
400 void UpdateItem( int );
401 LRESULT ProcessCustomDraw( LPARAM lParam );
402 void HandlePopupMenu( HWND hwnd, POINT point);
404 void DeleteItem( int item );
411 void OnDeleteSelection();
412 void OnInvertSelection();
413 void OnEnableSelection();
414 void OnDisableSelection();
416 void OnActivateItem( int i_item );
417 void ShowInfos( HWND hwnd, int i_item );
426 void OnSort( UINT event );
427 void OnColSelect( int iSubItem );
432 void OnPopupInfo( HWND hwnd );
434 virtual LRESULT WndProc( HWND hwnd, UINT msg,
435 WPARAM wParam, LPARAM lParam,
444 Timer( intf_thread_t *p_intf, HWND hwnd, Interface *_p_main_interface);
449 intf_thread_t *p_intf;
450 Interface *p_main_interface;
451 //Interface *p_main_interface;
452 int i_old_playing_status;
457 void RefreshSettingsMenu( intf_thread_t *_p_intf, HMENU hMenu );
458 void RefreshAudioMenu( intf_thread_t *_p_intf, HMENU hMenu );
459 void RefreshVideoMenu( intf_thread_t *_p_intf, HMENU hMenu );
460 void RefreshNavigMenu( intf_thread_t *_p_intf, HMENU hMenu );
461 void RefreshMenu( intf_thread_t *, vector<MenuItemExt*> *, HMENU, int,
462 char **, int *, int );
463 int wce_GetMenuItemCount( HMENU );
464 void CreateMenuItem( intf_thread_t *, vector<MenuItemExt*> *, HMENU, char *,
465 vlc_object_t *, int * );
466 HMENU CreateChoicesMenu( intf_thread_t *, vector<MenuItemExt*> *, char *,
467 vlc_object_t *, int * );
468 void OnMenuEvent( intf_thread_t *, int );
470 /*****************************************************************************
471 * A small helper class which encapsulate wxMenuitem with some other useful
473 *****************************************************************************/
478 MenuItemExt( intf_thread_t *_p_intf, int _id, char *_psz_var,
479 int _i_object_id, vlc_value_t _val, int _i_val_type );
481 virtual ~MenuItemExt();
484 intf_thread_t *p_intf;
495 /* Preferences Dialog */
496 /* Preferences Dialog */
498 class PrefsDialog: public CBaseWindow
502 PrefsDialog( intf_thread_t *_p_intf, HINSTANCE _hInst );
503 virtual ~PrefsDialog(){};
507 intf_thread_t *p_intf;
509 /* Event handlers (these functions should _not_ be virtual) */
511 /*void OnCancel( UINT event );
512 void OnSave( UINT event );
513 void OnResetAll( UINT event );
514 void OnAdvanced( UINT event );*/
518 HWND advanced_checkbox;
521 PrefsTreeCtrl *prefs_tree;
523 virtual LRESULT WndProc( HWND hwnd, UINT msg,
524 WPARAM wParam, LPARAM lParam,
528 /*****************************************************************************
529 * A small helper function for utf8 <-> unicode conversions
530 *****************************************************************************/
532 static wchar_t pwsz_mbtow[2048];
533 static char psz_wtomb[2048];
534 static inline wchar_t *_FROMMB( const char *psz_in )
536 mbstowcs( pwsz_mbtow, psz_in, 2048 );
537 pwsz_mbtow[2048] = 0;
540 static inline char *_TOMB( const wchar_t *pwsz_in )
542 wcstombs( psz_wtomb, pwsz_in, 2048 );
551 #if defined( ENABLE_NLS ) && defined( ENABLE_UTF8 )
553 #else // ENABLE_NLS && ENABLE_UTF8
557 /*****************************************************************************
558 * Misc definitions (mainly from aygshell.h)
559 *****************************************************************************/
560 #define _WIN32_IE 0x0500
562 #define SHFS_HIDESIPBUTTON 0x0008
563 #define SHIDIM_FLAGS 0x0001
564 #define SHIDIF_DONEBUTTON 0x0001
565 #define SHIDIF_SIPDOWN 0x0008
566 #define SHIDIF_FULLSCREENNOMENUBAR 0x0010
567 #define SHCMBF_HMENU 0x0010
568 #define SHFS_SHOWSIPBUTTON 0x0004
569 #define GN_CONTEXTMENU 1000
570 #define SHCMBM_GETSUBMENU (WM_USER + 401)
571 #define lstrlenW wcslen
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;
609 #endif //WINCE_RESOURCE
611 #define IDD_ABOUT 101
612 #define IDI_ICON1 102
613 #define IDB_BITMAP1 103
614 #define IDB_BITMAP2 111
615 #define IDR_MENUBAR1 113
616 #define IDR_ACCELERATOR1 116
617 #define IDD_FILEINFO 118
618 #define IDD_DUMMY 118
619 #define IDD_MESSAGES 119
620 #define IDR_MENUBAR 120
621 #define IDR_MENUBAR2 121
622 #define IDD_PLAYLIST 122
623 #define IDB_BITMAP3 123
624 #define IDD_ITEMINFO 124
625 #define IDR_DUMMYMENU 126
627 #define IDSAVEAS 1002
628 #define IDC_TEXTCTRL 1004
629 #define IDC_CUSTOM1 1012
630 #define IDS_MAIN_MENUITEM1 40001
631 #define IDS_TITLE 40002
632 #define IDS_CLASSNAME 40003
633 #define IDS_CAP_QUICKFILEOPEN 40006
634 #define IDS_CAP_VIEW 40009
635 #define IDS_CAP_SETTINGS 40012
636 #define IDS_CAP_AUDIO 40015
637 #define IDS_CAP_VIDEO 40018
638 #define IDS_CAP_HELP 40021
639 #define IDS_CAP_Navigation 40024
640 #define IDS_CAP_FILE 40025
641 #define ID_COLOR_OPTIONS 40026
642 #define IDS_DYNAMENU 40027
643 #define ID_FILE 40028
644 #define IDS_BLACK 40028
645 #define IDS_LTGRAY 40029
646 #define ID_VIEW 40030
647 #define IDS_DKGRAY 40030
648 #define IDS_WHITE 40031
649 #define ID_SETTINGS 40032
650 #define ID_AUDIO 40034
651 #define ID_EMPTY 40034
652 #define ID_VIDEO 40036
653 #define ID_NAVIGATION 40038
654 #define IDM_FILE 40042
655 #define IDM_VIEW 40044
656 #define IDM_SETTINGS 40046
657 #define IDM_AUDIO 40048
658 #define IDM_VIDEO 40050
659 #define IDM_NAVIGATION 40053
660 #define ID_FILE_QUICK_OPEN 40056
661 #define ID_FILE_OPENFILE 40057
662 #define ID_FILE_QUICKOPEN 40058
663 #define ID_FILE_OPENNETWORKSTREAM 40059
664 #define ID_FILE_OPENNET 40060
665 #define ID_FILE_EXIT 40061
666 #define ID_VIEW_PLAYLIST 40063
667 #define ID_VIEW_MESSAGES 40064
668 #define ID_VIEW_MEDIAINFO 40065
669 #define ID_VIEW_STREAMINFO 40066
670 #define IDS_CAP_NAV 40067
671 #define ID_FILE_ABOUT 40069
672 #define ID_SETTINGS_PREF 40071
673 #define ID_SETTINGS_EXTEND 40072
674 #define IDS_CAP_XXX 40084
675 #define IDM_MANAGE 40087
676 #define IDM_SORT 40088
677 #define IDM_SEL 40089
678 #define ID_SORT_AUTHOR 40091
679 #define ID_SORT_RAUTHOR 40092
680 #define ID_SORT_SHUFFLE 40095
681 #define ID_SEL_INVERT 40096
682 #define ID_SEL_DELETE 40097
683 #define ID_SEL_SELECTALL 40098
684 #define ID_SEL_ENABLE 40100
685 #define ID_SEL_DISABLE 40101
686 #define ID_SORT_TITLE 40102
687 #define ID_SORT_RTITLE 40103
688 #define ID_MANAGE_SIMPLEADD 40104
689 #define ID_MANAGE_OPENPL 40105
690 #define ID_MANAGE_ADDMRL 40106
691 #define ID_MANAGE_SAVEPL 40107
692 #define ID_MENUITEM40108 40108
693 #define IDS_CAP_MENUITEM40109 40110
694 #define IDS_STOP 57601
695 #define StopStream_Event 57601
696 #define IDS_PLAY 57602
697 #define PlayStream_Event 57602
698 #define PrevStream_Event 57603
699 #define NextStream_Event 57604
700 #define SlowStream_Event 57605
701 #define FastStream_Event 57606
703 // Next default values for new objects
705 #ifdef APSTUDIO_INVOKED
706 #ifndef APSTUDIO_READONLY_SYMBOLS
707 #define _APS_NEXT_RESOURCE_VALUE 128
708 #define _APS_NEXT_COMMAND_VALUE 40111
709 #define _APS_NEXT_CONTROL_VALUE 1013
710 #define _APS_NEXT_SYMED_VALUE 101