- from PLD
[packages/gpac.git] / wxWidgets3.patch
1 diff -ur gpac/applications/osmo4_wx/Playlist.cpp gpac.wx3/applications/osmo4_wx/Playlist.cpp
2 --- gpac/applications/osmo4_wx/Playlist.cpp     2010-07-28 17:53:09.000000000 +0200
3 +++ gpac.wx3/applications/osmo4_wx/Playlist.cpp 2014-01-18 19:00:08.102059900 +0100
4 @@ -292,7 +292,7 @@
5  
6  void wxPlaylist::OnAddFile(wxCommandEvent &WXUNUSED(event)) 
7  {
8 -       wxFileDialog dlg(this, wxT("Select file(s)"), wxT(""), wxT(""), m_pApp->GetFileFilter(), wxOPEN | wxCHANGE_DIR | /*wxHIDE_READONLY |*/ wxMULTIPLE);
9 +       wxFileDialog dlg(this, wxT("Select file(s)"), wxT(""), wxT(""), m_pApp->GetFileFilter(), wxFD_OPEN | wxFD_CHANGE_DIR | /*wxFD_HIDE_READONLY |*/ wxFD_MULTIPLE);
10  
11         if (dlg.ShowModal() == wxID_OK) {
12                 wxArrayString stra;
13 @@ -448,7 +448,7 @@
14         char szPath[GF_MAX_PATH];
15         if (!gf_list_count(m_entries)) return;
16  
17 -       wxFileDialog dlg(this, wxT("Select file(s)"), wxT(""), wxT(""), wxT("M3U Playlists|*.m3u|ShoutCast Playlists|*.pls|"), wxSAVE | wxCHANGE_DIR | wxOVERWRITE_PROMPT);
18 +       wxFileDialog dlg(this, wxT("Select file(s)"), wxT(""), wxT(""), wxT("M3U Playlists|*.m3u|ShoutCast Playlists|*.pls|"), wxFD_SAVE | wxFD_CHANGE_DIR | wxFD_OVERWRITE_PROMPT);
19         if (dlg.ShowModal() != wxID_OK) return;
20  
21         strcpy(szPath, dlg.GetPath().mb_str(wxConvUTF8));
22 @@ -497,7 +497,7 @@
23  
24  void wxPlaylist::OnOpen(wxCommandEvent & WXUNUSED(event)) 
25  {
26 -       wxFileDialog dlg(this, wxT("Select file(s)"), wxT(""), wxT(""), wxT("M3U & PLS Playlists|*.m3u;*.pls|M3U Playlists|*.m3u|ShoutCast Playlists|*.pls|"), wxOPEN | wxCHANGE_DIR/* | wxHIDE_READONLY*/);
27 +       wxFileDialog dlg(this, wxT("Select file(s)"), wxT(""), wxT(""), wxT("M3U & PLS Playlists|*.m3u;*.pls|M3U Playlists|*.m3u|ShoutCast Playlists|*.pls|"), wxFD_OPEN | wxFD_CHANGE_DIR/* | wxFD_HIDE_READONLY*/);
28         if (dlg.ShowModal() != wxID_OK) return;
29  
30         Clear();
31 diff -ur gpac/applications/osmo4_wx/wxOsmo4.cpp gpac.wx3/applications/osmo4_wx/wxOsmo4.cpp
32 --- gpac/applications/osmo4_wx/wxOsmo4.cpp      2011-07-29 15:14:43.000000000 +0200
33 +++ gpac.wx3/applications/osmo4_wx/wxOsmo4.cpp  2014-01-18 18:59:09.155393660 +0100
34 @@ -224,9 +224,9 @@
35  #if 0
36                 /*log*/
37                 if (evt->message.error)
38 -                       ::wxLogMessage(wxString(evt->message.message, wxConvUTF8) + wxT(" (") + wxString(servName, wxConvUTF8) + wxT(") ") + wxString(gf_error_to_string(evt->message.error), wxConvUTF8) );
39 +                       wxLogMessage(wxString(evt->message.message, wxConvUTF8) + wxT(" (") + wxString(servName, wxConvUTF8) + wxT(") ") + wxString(gf_error_to_string(evt->message.error), wxConvUTF8) );
40                 else
41 -                       ::wxLogMessage(wxString(evt->message.message, wxConvUTF8) + wxT(" (") + wxString(servName, wxConvUTF8) + wxT(")"));
42 +                       wxLogMessage(wxString(evt->message.message, wxConvUTF8) + wxT(" (") + wxString(servName, wxConvUTF8) + wxT(")"));
43  #endif
44         }
45                 break;
46 @@ -286,7 +286,7 @@
47                         {
48                                 wxGPACEvent wxevt(app);
49                                 wxevt.gpac_evt = *evt;
50 -                               app->AddPendingEvent(wxevt);
51 +                               app->GetEventHandler()->AddPendingEvent(wxevt);
52                         }
53                                 break;
54                         }
55 @@ -299,7 +299,7 @@
56                 wxevt.gpac_evt.type = GF_EVENT_CONNECT;
57                 wxevt.gpac_evt.connect.is_connected = evt->connect.is_connected;
58                 if (!evt->connect.is_connected) app->m_duration = 0;
59 -               app->AddPendingEvent(wxevt);
60 +               app->GetEventHandler()->AddPendingEvent(wxevt);
61         }
62                 break;
63         case GF_EVENT_NAVIGATE:
64 @@ -307,7 +307,7 @@
65                 wxGPACEvent wxevt(app);
66                 wxevt.to_url = wxString(evt->navigate.to_url, wxConvUTF8);
67                 wxevt.gpac_evt.type = evt->type;
68 -               app->AddPendingEvent(wxevt);
69 +               app->GetEventHandler()->AddPendingEvent(wxevt);
70         }
71                 return 1;
72         case GF_EVENT_SET_CAPTION:
73 @@ -315,7 +315,7 @@
74                 wxGPACEvent wxevt(app);
75                 wxevt.to_url = wxString(evt->caption.caption, wxConvUTF8);
76                 wxevt.gpac_evt.type = evt->type;
77 -               app->AddPendingEvent(wxevt);
78 +               app->GetEventHandler()->AddPendingEvent(wxevt);
79         }
80                 return 1;
81  
82 @@ -327,7 +327,7 @@
83         {
84                 wxGPACEvent wxevt(app);
85                 wxevt.gpac_evt = *evt;
86 -               app->AddPendingEvent(wxevt);
87 +               app->GetEventHandler()->AddPendingEvent(wxevt);
88         }
89                 break;
90         case GF_EVENT_DBLCLICK:
91 @@ -536,7 +536,7 @@
92      wxString abs_gpac_path = wxT("");
93         char *gpac_cfg, *sep;
94  
95 -       ::wxLogMessage(wxT("Looking for GPAC configuration file"));
96 +       wxLogMessage(wxT("Looking for GPAC configuration file"));
97  
98         /*load config*/
99         Bool first_launch = 0;
100 @@ -565,7 +565,7 @@
101  
102         gf_sys_init(0);
103  
104 -       ::wxLogMessage(wxT("GPAC configuration file opened - looking for modules"));
105 +       wxLogMessage(wxT("GPAC configuration file opened - looking for modules"));
106  
107         m_user.modules = gf_modules_new(str, m_user.config);
108         /*initial launch*/
109 @@ -591,12 +591,12 @@
110  
111  
112  
113 -       ::wxLogMessage(wxT("%d modules found:"), gf_modules_get_count(m_user.modules));
114 +       wxLogMessage(wxT("%d modules found:"), gf_modules_get_count(m_user.modules));
115         for (u32 i=0; i<gf_modules_get_count(m_user.modules); i++) {
116 -               ::wxLogMessage(wxT("\t") + wxString(gf_modules_get_file_name(m_user.modules, i), wxConvUTF8) );
117 +               wxLogMessage(wxT("\t") + wxString(gf_modules_get_file_name(m_user.modules, i), wxConvUTF8) );
118         }
119  
120 -       ::wxLogMessage(wxT("Starting GPAC Terminal"));
121 +       wxLogMessage(wxT("Starting GPAC Terminal"));
122         /*now load terminal*/
123         m_user.opaque = this;
124         m_user.EventProc = GPAC_EventProc;
125 @@ -608,7 +608,7 @@
126                 wxMessageDialog(NULL, wxT("Fatal Error"), wxT("Cannot load GPAC Terminal"), wxOK).ShowModal();
127                 return 0;
128         } else {
129 -               ::wxLogMessage(wxT("GPAC Terminal started") );
130 +               wxLogMessage(wxT("GPAC Terminal started") );
131         }
132         return 1;
133  }
134 @@ -877,7 +877,7 @@ wxOsmo4Frame::wxOsmo4Frame() :
135         sOpt = gf_cfg_get_key(m_user.config, "Audio", "DriverName");
136  
137         if (!strcmp(sOpt, "No Audio Output Available")) {
138 -               ::wxLogMessage(wxT("WARNING: no audio output availble - make sure no other program is locking the sound card"));
139 +               wxLogMessage(wxT("WARNING: no audio output availble - make sure no other program is locking the sound card"));
140                 SetStatus(wxT("No audio ouput available"));
141  
142         } else {
143 @@ -1137,7 +1137,7 @@
144  
145  void wxOsmo4Frame::OnFileOpen(wxCommandEvent & WXUNUSED(event))
146  {
147 -       wxFileDialog dlg(this, wxT("Select file(s)"), wxT(""), wxT(""), GetFileFilter(), wxOPEN | wxMULTIPLE | wxCHANGE_DIR /*| wxHIDE_READONLY*/);
148 +       wxFileDialog dlg(this, wxT("Select file(s)"), wxT(""), wxT(""), GetFileFilter(), wxFD_OPEN | wxFD_MULTIPLE | wxFD_CHANGE_DIR /*| wxHIDE_READONLY*/);
149  
150         if (dlg.ShowModal() != wxID_OK) return;
151  
152 @@ -1900,7 +1900,7 @@
153                 evt.SetEventType(wxEVT_COMMAND_COMBOBOX_SELECTED);
154                 evt.SetEventObject(this);
155                 evt.SetId(GetId());
156 -               GetParent()->AddPendingEvent(evt);
157 +               GetParent()->GetEventHandler()->AddPendingEvent(evt);
158         }
159  }
160  
161 @@ -2135,7 +2135,7 @@
162  
163  void wxOsmo4Frame::OnAddSub(wxCommandEvent &WXUNUSED(event))
164  {
165 -       wxFileDialog dlg(this, wxT("Add Subtitle"), wxT(""), wxT(""), wxT("All Subtitles|*.srt;*.ttxt|SRT Subtitles|*.srt|3GPP TimedText|*.ttxt|"), wxOPEN | wxCHANGE_DIR /* | wxHIDE_READONLY*/);
166 +       wxFileDialog dlg(this, wxT("Add Subtitle"), wxT(""), wxT(""), wxT("All Subtitles|*.srt;*.ttxt|SRT Subtitles|*.srt|3GPP TimedText|*.ttxt|"), wxFD_OPEN | wxFD_CHANGE_DIR /* | wxHIDE_READONLY*/);
167  
168         if (dlg.ShowModal() == wxID_OK) {
169                 AddSubtitle(dlg.GetPath().mb_str(wxConvUTF8), 1);
170 --- gpac/applications/osmo4_wx/wxGPACControl.cpp~       2014-10-07 23:09:59.000000000 +0200
171 +++ gpac/applications/osmo4_wx/wxGPACControl.cpp        2014-10-07 23:36:33.313608359 +0200
172 @@ -398,7 +398,7 @@
173  
174         /*audio dec enum*/
175         sOpt = gf_cfg_get_key(cfg, "Systems", "DefAudioDec");
176 -       u32 count = gf_modules_get_count(m_pApp->m_user.modules);
177 +       count = gf_modules_get_count(m_pApp->m_user.modules);
178         GF_BaseDecoder *ifc_d;
179         select = 0;
180         s32 to_sel = 0;
181
182 --- gpac/applications/osmo4_wx/menubtn.cpp~     2014-10-07 23:09:59.000000000 +0200
183 +++ gpac/applications/osmo4_wx/menubtn.cpp      2014-10-07 23:42:37.356710868 +0200
184 @@ -86,7 +86,7 @@ bool wxCustomButton::Create(wxWindow* pa
185  
186         wxSize bestSize = DoGetBestSize();
187         SetSize(wxSize(size.x<0 ? bestSize.x:size.x, size.y<0 ? bestSize.y:size.y));
188 -#if (wxMINOR_VERSION<8)
189 +#if (wxMINOR_VERSION<8) && (wxMAJOR_VERSION < 3)
190         SetBestSize(GetSize());
191  #else
192         SetInitialSize(GetSize());
193 @@ -161,7 +161,7 @@ void wxCustomButton::OnMouseEvents(wxMou
194  
195                 m_eventType = wxEVT_LEFT_UP;
196  
197 -#if (wxMINOR_VERSION<8)
198 +#if (wxMINOR_VERSION<8) && (wxMAJOR_VERSION < 3)
199                 if (wxRect(wxPoint(0,0), GetSize()).Inside(event.GetPosition()))
200  #else
201                 if (wxRect(wxPoint(0,0), GetSize()).Contains(event.GetPosition()))
202 @@ -200,7 +200,7 @@ void wxCustomButton::OnMouseEvents(wxMou
203  
204                 m_eventType = wxEVT_RIGHT_UP;
205  
206 -#if (wxMINOR_VERSION<8)
207 +#if (wxMINOR_VERSION<8) && (wxMAJOR_VERSION < 3)
208                 if (wxRect(wxPoint(0,0), GetSize()).Inside(event.GetPosition()))
209  #else
210                 if (wxRect(wxPoint(0,0), GetSize()).Contains(event.GetPosition()))
211 @@ -319,7 +319,7 @@ void wxCustomButton::Redraw()
212  
213  void wxCustomButton::Paint( wxDC &dc )
214  {
215 -#if (wxMINOR_VERSION<8)
216 +#if (wxMINOR_VERSION<8) && (wxMAJOR_VERSION < 3)
217         dc.BeginDrawing();
218  #endif
219  
220 @@ -407,7 +407,7 @@ void wxCustomButton::Paint( wxDC &dc )
221         dc.SetBackground(wxNullBrush);
222         dc.SetBrush(wxNullBrush);
223         dc.SetPen(wxNullPen);
224 -#if (wxMINOR_VERSION<8)
225 +#if (wxMINOR_VERSION<8) && (wxMAJOR_VERSION < 3)
226         dc.EndDrawing();
227  #endif
228  }
229 @@ -580,7 +580,7 @@ public:
230                 {
231                         wxPoint p = GetParent()->ScreenToClient(wxGetMousePosition());
232  
233 -#if (wxMINOR_VERSION<8)
234 +#if (wxMINOR_VERSION<8) && (wxMAJOR_VERSION < 3)
235                         if (GetRect().Inside(p) || labelBut->GetRect().Inside(p))
236  #else
237                         if (GetRect().Contains(p) || labelBut->GetRect().Contains(p))
238 @@ -628,7 +628,7 @@ public:
239                 {
240                         wxPoint p = GetParent()->ScreenToClient(wxGetMousePosition());
241  
242 -#if (wxMINOR_VERSION<8)
243 +#if (wxMINOR_VERSION<8) && (wxMAJOR_VERSION < 3)
244                         if (GetRect().Inside(p) || dropBut->GetRect().Inside(p))
245  #else
246                         if (GetRect().Contains(p) || dropBut->GetRect().Contains(p))
247 @@ -706,7 +706,7 @@ bool wxMenuButton::Create( wxWindow* par
248         SetSize( wxSize(size.x < 0 ? bestSize.x : size.x,
249                         size.y < 0 ? bestSize.y : size.y) );
250  
251 -#if (wxMINOR_VERSION<8)
252 +#if (wxMINOR_VERSION<8) && (wxMAJOR_VERSION < 3)
253         SetBestSize(GetSize());
254  #else
255         SetInitialSize(GetSize());