23
23
*
24
24
* The Audacious team does not consider modular code linking to
25
25
* Audacious or using our public API to be a derived work.
26
- */
26
+ */
27
27
28
28
#include < src/hotkey/api_hotkey.h>
29
29
@@ -92,9 +92,6 @@ void Hotkey::add_hotkey(HotkeyConfiguration ** pphotkey,
92
92
photkey = *pphotkey;
93
93
if (photkey == nullptr )
94
94
return ;
95
- // keycode =
96
- // XKeysymToKeycode(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()),
97
- // keysym); if (keycode == 0) return;
98
95
if (photkey->key )
99
96
{
100
97
photkey->next = g_new (HotkeyConfiguration, 1 );
@@ -119,54 +116,6 @@ void register_global_keys(HWND handle)
119
116
}
120
117
}
121
118
122
- // void assign(wchar_t *ptr_first_element, const wchar_t *text) {
123
- // int loc = 0;
124
- // while (text[loc]) {
125
- // ptr_first_element[loc] = text[loc];
126
- // ++loc;
127
- // }
128
- // ptr_first_element[loc] = 0;
129
- // }
130
-
131
- // HRESULT AddThumbarButtons(HWND hwnd)
132
- // {
133
- // // Define an array of two buttons. These buttons provide images through an
134
- // // image list and also provide tooltips.
135
- // THUMBBUTTONMASK dwMask = THB_BITMAP | THB_TOOLTIP | THB_FLAGS;
136
- //
137
- // /*
138
- // THUMBBUTTONMASK dwMask;
139
- // UINT iId;
140
- // UINT iBitmap;
141
- // HICON hIcon;
142
- // WCHAR szTip[260];
143
- // THUMBBUTTONFLAGS dwFlags;
144
- // */
145
- //
146
- // THUMBBUTTON btn[]{
147
- // {dwMask, W_KEY_ID_PREV, 0, nullptr, L"Previous song", THBF_ENABLED},
148
- // {dwMask, W_KEY_ID_PLAY, 0, nullptr, L"Play/pause", THBF_ENABLED},
149
- // {dwMask, W_KEY_ID_NEXT, 0, nullptr, L"Next song", THBF_ENABLED}};
150
- //
151
- // ITaskbarList3 * ptbl;
152
- // HRESULT hr = CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER,
153
- // IID_PPV_ARGS(&ptbl));
154
- //
155
- // if (SUCCEEDED(hr))
156
- // {
157
- // // Declare the image list that contains the button images.
158
- // // hr = ptbl->ThumbBarSetImageList(hwnd, himl);
159
- //
160
- // if (SUCCEEDED(hr))
161
- // {
162
- // // Attach the toolbar to the thumbnail.
163
- // hr = ptbl->ThumbBarAddButtons(hwnd, ARRAYSIZE(btn), btn);
164
- // }
165
- // ptbl->Release();
166
- // }
167
- // return hr;
168
- // }
169
-
170
119
GdkFilterReturn w32_events_filter_first_everything (GdkXEvent * gdk_xevent,
171
120
GdkEvent * event,
172
121
gpointer user_data)
@@ -188,8 +137,7 @@ GdkFilterReturn w32_events_filter_first_everything(GdkXEvent * gdk_xevent,
188
137
(static_cast <std::string>(event_window)).c_str ());
189
138
if (event_window.is_main_window (true ))
190
139
{
191
- event_window.
192
- WindowsWindow::main_window_hidden_ = false ;
140
+ event_window.WindowsWindow ::main_window_hidden_ = false ;
193
141
AUDDBG (
194
142
" TRANSFER EventReceivingWindow from %s to mainwindow HWND "
195
143
" %p" ,
@@ -200,32 +148,6 @@ GdkFilterReturn w32_events_filter_first_everything(GdkXEvent * gdk_xevent,
200
148
grab_keys_onto_window ();
201
149
}
202
150
}
203
- // else
204
- // {
205
- // // leaving us.
206
- // AUDDBG("(GettingDown)FALSE %s; %s",
207
- // stringify_win_evt(msg->message).c_str(),
208
- // (static_cast<std::string>(event_window)).c_str());
209
- // }
210
- }
211
- // else if (msg->message == WM_CLOSE)
212
- // {
213
- // auto event_window = WindowsWindow::get_window_data(msg->hwnd);
214
- // AUDDBG("%s: ; %s", stringify_win_evt(msg->message).c_str(),
215
- // (static_cast<std::string>(event_window)).c_str());
216
- // }
217
- // else if (msg->message == WM_CREATE)
218
- // {
219
- // auto event_window = WindowsWindow::get_window_data(msg->hwnd);
220
- // AUDDBG("%s: ; %s", stringify_win_evt(msg->message).c_str(),
221
- // (static_cast<std::string>(event_window)).c_str());
222
- // }
223
- // else if (msg->message == WM_DESTROY)
224
- // {
225
- // auto event_window = WindowsWindow::get_window_data(msg->hwnd);
226
- // AUDDBG("%s: ; %s", stringify_win_evt(msg->message).c_str(),
227
- // (static_cast<std::string>(event_window)).c_str());
228
- // }
229
151
return GDK_FILTER_CONTINUE;
230
152
}
231
153
@@ -310,50 +232,7 @@ void release_filter()
310
232
w32_evts_filter, nullptr );
311
233
message_receiving_window = nullptr ;
312
234
}
313
- //
314
- // void main_window_created_from_statusbar(
315
- // MainWindowSearchFilterData * const passed_data,
316
- // WindowsWindow & created_main_window)
317
- // {
318
- // // When window fully shows, must add windows buttons.
319
- // gdk_window_remove_filter(
320
- // reinterpret_cast<GdkWindow *>(passed_data->window_),
321
- // reinterpret_cast<GdkFilterFunc>(passed_data->function_ptr_),
322
- // passed_data);
323
- // ungrab_keys();
324
- // release_filter();
325
- // delete passed_data;
326
- // }
327
- //
328
- // GdkFilterReturn main_window_missing_filter(GdkXEvent * gdk_xevent,
329
- // GdkEvent * event, gpointer
330
- // user_data)
331
- // {
332
- // auto msg = reinterpret_cast<MSG *>(gdk_xevent);
333
- // if (msg->message == WM_SHOWWINDOW && msg->wParam)
334
- // {
335
- // auto win_data = WindowsWindow::get_window_data(msg->hwnd);
336
- // if (win_data.is_main_window())
337
- // {
338
- // main_window_created_from_statusbar(
339
- // reinterpret_cast<MainWindowSearchFilterData *>(user_data),
340
- // win_data);
341
- // }
342
- // }
343
- // return GDK_FILTER_CONTINUE;
344
- // }
345
235
346
- /* *
347
- * GSourceFunc:
348
- * @user_data: data passed to the function, set when the source was
349
- * created with one of the above functions
350
- *
351
- * Specifies the type of function passed to g_timeout_add(),
352
- * g_timeout_add_full(), g_idle_add(), and g_idle_add_full().
353
- *
354
- * Returns: %FALSE if the source should be removed. #G_SOURCE_CONTINUE and
355
- * #G_SOURCE_REMOVE are more memorable names for the return value.
356
- */
357
236
gboolean window_created_callback (gpointer user_data)
358
237
{
359
238
AUDDBG (" Window created. Do real stuff." );
@@ -363,10 +242,7 @@ gboolean window_created_callback(gpointer user_data)
363
242
return G_SOURCE_REMOVE;
364
243
}
365
244
366
- void win_init ()
367
- {
368
- g_idle_add (&window_created_callback, nullptr );
369
- }
245
+ void win_init () { g_idle_add (&window_created_callback, nullptr ); }
370
246
371
247
void Hotkey::key_to_string (int key, char ** out_keytext)
372
248
{
@@ -375,7 +251,7 @@ void Hotkey::key_to_string(int key, char ** out_keytext)
375
251
switch (key)
376
252
{
377
253
case VK_OEM_NEC_EQUAL:
378
- // case VK_OEM_FJ_JISHO: (note: same as EQUAL)
254
+ // case VK_OEM_FJ_JISHO: (note: same as EQUAL)
379
255
case VK_OEM_FJ_MASSHOU:
380
256
case VK_OEM_FJ_TOUROKU:
381
257
case VK_OEM_FJ_LOYA:
0 commit comments