~sergio-br2/vbam/fixes_have-svg-icons

« back to all changes in this revision

Viewing changes to .pc/vbam-debian.patch/src/gtk/windowcallbacks.cpp

  • Committer: Sérgio Benjamim
  • Date: 2014-03-22 16:27:59 UTC
  • Revision ID: sergio@sergio-x750jb-20140322162759-xblyhd3z3i55cuwo
vbam debian patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
 
2
// Copyright (C) 1999-2003 Forgotten
 
3
// Copyright (C) 2004 Forgotten and the VBA development team
 
4
 
 
5
// This program is free software; you can redistribute it and/or modify
 
6
// it under the terms of the GNU General Public License as published by
 
7
// the Free Software Foundation; either version 2, or(at your option)
 
8
// any later version.
 
9
//
 
10
// This program is distributed in the hope that it will be useful,
 
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
// GNU General Public License for more details.
 
14
//
 
15
// You should have received a copy of the GNU General Public License
 
16
// along with this program; if not, write to the Free Software Foundation,
 
17
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
18
 
 
19
#include "window.h"
 
20
 
 
21
#include <gtkmm/stock.h>
 
22
#include <gtkmm/messagedialog.h>
 
23
#include <gtkmm/aboutdialog.h>
 
24
#include <gtkmm/builder.h>
 
25
 
 
26
#include <SDL.h>
 
27
 
 
28
#include "../gba/GBA.h"
 
29
#include "../gba/Sound.h"
 
30
#include "../gb/gb.h"
 
31
#include "../gb/gbGlobals.h"
 
32
#include "../Util.h"
 
33
#include "../sdl/inputSDL.h"
 
34
 
 
35
#include "tools.h"
 
36
#include "intl.h"
 
37
#include "joypadconfig.h"
 
38
#include "directoriesconfig.h"
 
39
#include "displayconfig.h"
 
40
#include "soundconfig.h"
 
41
#include "gameboyconfig.h"
 
42
#include "gameboyadvanceconfig.h"
 
43
#include "generalconfig.h"
 
44
#include "gameboyadvancecheatlist.h"
 
45
#include "gameboycheatlist.h"
 
46
 
 
47
namespace VBA
 
48
{
 
49
 
 
50
void Window::vOnMenuEnter()
 
51
{
 
52
  if (emulating && ! m_bPaused)
 
53
  {
 
54
    vStopEmu();
 
55
    soundPause();
 
56
  }
 
57
}
 
58
 
 
59
void Window::vOnMenuExit()
 
60
{
 
61
  if (emulating && ! m_bPaused)
 
62
  {
 
63
    vStartEmu();
 
64
    soundResume();
 
65
  }
 
66
}
 
67
 
 
68
void Window::vOnFileOpen()
 
69
{
 
70
  while (m_poFileOpenDialog->run() == Gtk::RESPONSE_OK)
 
71
  {
 
72
    if (bLoadROM(m_poFileOpenDialog->get_filename()))
 
73
    {
 
74
      break;
 
75
    }
 
76
  }
 
77
  m_poFileOpenDialog->hide();
 
78
}
 
79
 
 
80
void Window::vOnFileLoad()
 
81
{
 
82
  std::string sSaveDir = m_poDirConfig->sGetKey("saves");
 
83
 
 
84
  Gtk::FileChooserDialog oDialog(*this, _("Load game"));
 
85
  oDialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
 
86
  oDialog.add_button(Gtk::Stock::OPEN,   Gtk::RESPONSE_OK);
 
87
 
 
88
  if (sSaveDir == "")
 
89
  {
 
90
    oDialog.set_current_folder(Glib::path_get_dirname(m_sRomFile));
 
91
  }
 
92
  else
 
93
  {
 
94
    oDialog.set_current_folder(sSaveDir);
 
95
    oDialog.add_shortcut_folder(sSaveDir);
 
96
  }
 
97
 
 
98
  Gtk::FileFilter oSaveFilter;
 
99
  oSaveFilter.set_name(_("VisualBoyAdvance save game"));
 
100
  oSaveFilter.add_pattern("*.[sS][gG][mM]");
 
101
 
 
102
  oDialog.add_filter(oSaveFilter);
 
103
 
 
104
  while (oDialog.run() == Gtk::RESPONSE_OK)
 
105
  {
 
106
    if (m_stEmulator.emuReadState(oDialog.get_filename().c_str()))
 
107
    {
 
108
      break;
 
109
    }
 
110
  }
 
111
}
 
112
 
 
113
void Window::vOnFileSave()
 
114
{
 
115
  Glib::ustring sSaveDir = m_poDirConfig->sGetKey("saves");
 
116
 
 
117
  Gtk::FileChooserDialog oDialog(*this, _("Save game"),
 
118
                                 Gtk::FILE_CHOOSER_ACTION_SAVE);
 
119
  oDialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
 
120
  oDialog.add_button(Gtk::Stock::SAVE,   Gtk::RESPONSE_OK);
 
121
 
 
122
  if (sSaveDir == "")
 
123
  {
 
124
    oDialog.set_current_folder(Glib::path_get_dirname(m_sRomFile));
 
125
  }
 
126
  else
 
127
  {
 
128
    oDialog.set_current_folder(sSaveDir);
 
129
    oDialog.add_shortcut_folder(sSaveDir);
 
130
  }
 
131
  oDialog.set_current_name(sCutSuffix(Glib::path_get_basename(m_sRomFile)));
 
132
 
 
133
  Gtk::FileFilter oSaveFilter;
 
134
  oSaveFilter.set_name(_("VisualBoyAdvance save game"));
 
135
  oSaveFilter.add_pattern("*.[sS][gG][mM]");
 
136
 
 
137
  oDialog.add_filter(oSaveFilter);
 
138
 
 
139
  while (oDialog.run() == Gtk::RESPONSE_OK)
 
140
  {
 
141
    Glib::ustring sFile = oDialog.get_filename();
 
142
    if (! bHasSuffix(sFile, ".sgm", false))
 
143
    {
 
144
      sFile += ".sgm";
 
145
    }
 
146
 
 
147
    if (Glib::file_test(sFile, Glib::FILE_TEST_EXISTS))
 
148
    {
 
149
      Gtk::MessageDialog oConfirmDialog(*this,
 
150
                                        _("File already exists. Overwrite it?"),
 
151
                                        false,
 
152
                                        Gtk::MESSAGE_QUESTION,
 
153
                                        Gtk::BUTTONS_YES_NO);
 
154
      if (oConfirmDialog.run() != Gtk::RESPONSE_YES)
 
155
      {
 
156
        continue;
 
157
      }
 
158
    }
 
159
 
 
160
    if (m_stEmulator.emuWriteState(sFile.c_str()))
 
161
    {
 
162
      break;
 
163
    }
 
164
  }
 
165
}
 
166
 
 
167
void Window::vOnLoadGameMostRecent()
 
168
{
 
169
  int    iMostRecent = -1;
 
170
  time_t uiTimeMax = 0;
 
171
 
 
172
  for (int i = 0; i < 10; i++)
 
173
  {
 
174
    if (! m_astGameSlot[i].m_bEmpty
 
175
        && (iMostRecent < 0 || m_astGameSlot[i].m_uiTime > uiTimeMax))
 
176
    {
 
177
      iMostRecent = i;
 
178
      uiTimeMax = m_astGameSlot[i].m_uiTime;
 
179
    }
 
180
  }
 
181
 
 
182
  if (iMostRecent >= 0)
 
183
  {
 
184
    vOnLoadGame(iMostRecent + 1);
 
185
  }
 
186
}
 
187
 
 
188
void Window::vOnLoadGameAutoToggled(Gtk::CheckMenuItem * _poCMI)
 
189
{
 
190
  m_poCoreConfig->vSetKey("load_game_auto", _poCMI->get_active());
 
191
}
 
192
 
 
193
void Window::vOnLoadGame(int _iSlot)
 
194
{
 
195
  int i = _iSlot - 1;
 
196
  if (! m_astGameSlot[i].m_bEmpty)
 
197
  {
 
198
    m_stEmulator.emuReadState(m_astGameSlot[i].m_sFile.c_str());
 
199
    m_poFilePauseItem->set_active(false);
 
200
  }
 
201
}
 
202
 
 
203
void Window::vOnSaveGameOldest()
 
204
{
 
205
  int    iOldest = -1;
 
206
  time_t uiTimeMin = 0;
 
207
 
 
208
  for (int i = 0; i < 10; i++)
 
209
  {
 
210
    if (! m_astGameSlot[i].m_bEmpty
 
211
        && (iOldest < 0 || m_astGameSlot[i].m_uiTime < uiTimeMin))
 
212
    {
 
213
      iOldest = i;
 
214
      uiTimeMin = m_astGameSlot[i].m_uiTime;
 
215
    }
 
216
  }
 
217
 
 
218
  if (iOldest >= 0)
 
219
  {
 
220
    vOnSaveGame(iOldest + 1);
 
221
  }
 
222
  else
 
223
  {
 
224
    vOnSaveGame(1);
 
225
  }
 
226
}
 
227
 
 
228
void Window::vOnSaveGame(int _iSlot)
 
229
{
 
230
  int i = _iSlot - 1;
 
231
  m_stEmulator.emuWriteState(m_astGameSlot[i].m_sFile.c_str());
 
232
  vUpdateGameSlots();
 
233
}
 
234
 
 
235
void Window::vOnFilePauseToggled(Gtk::CheckMenuItem * _poCMI)
 
236
{
 
237
  m_bPaused = _poCMI->get_active();
 
238
  if (emulating)
 
239
  {
 
240
    if (m_bPaused)
 
241
    {
 
242
      vStopEmu();
 
243
      soundPause();
 
244
    }
 
245
    else
 
246
    {
 
247
      vStartEmu();
 
248
      soundResume();
 
249
    }
 
250
  }
 
251
}
 
252
 
 
253
void Window::vOnFileReset()
 
254
{
 
255
  if (emulating)
 
256
  {
 
257
    m_stEmulator.emuReset();
 
258
    m_poFilePauseItem->set_active(false);
 
259
  }
 
260
}
 
261
 
 
262
void Window::vOnRecentFile()
 
263
{
 
264
  Glib::ustring sURI = m_poRecentChooserMenu->get_current_uri();
 
265
 
 
266
  if (!sURI.empty())
 
267
  {
 
268
    std::string sFileName = Glib::filename_from_uri(sURI);
 
269
    bLoadROM(sFileName);
 
270
  }
 
271
}
 
272
 
 
273
void Window::vOnFileScreenCapture()
 
274
{
 
275
  std::string sCaptureDir = m_poDirConfig->sGetKey("captures");
 
276
 
 
277
  Gtk::FileChooserDialog oDialog(*this, _("Save screenshot"),
 
278
                                 Gtk::FILE_CHOOSER_ACTION_SAVE);
 
279
  oDialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
 
280
  oDialog.add_button(Gtk::Stock::SAVE,   Gtk::RESPONSE_OK);
 
281
 
 
282
  if (sCaptureDir == "")
 
283
  {
 
284
    oDialog.set_current_folder(Glib::path_get_dirname(m_sRomFile));
 
285
  }
 
286
  else
 
287
  {
 
288
    oDialog.set_current_folder(sCaptureDir);
 
289
    oDialog.add_shortcut_folder(sCaptureDir);
 
290
  }
 
291
  oDialog.set_current_name(sCutSuffix(Glib::path_get_basename(m_sRomFile)));
 
292
 
 
293
  Gtk::FileFilter oPngFilter;
 
294
  oPngFilter.set_name(_("PNG image"));
 
295
  oPngFilter.add_pattern("*.[pP][nN][gG]");
 
296
 
 
297
  oDialog.add_filter(oPngFilter);
 
298
 
 
299
  while (oDialog.run() == Gtk::RESPONSE_OK)
 
300
  {
 
301
    Glib::ustring sFile = oDialog.get_filename();
 
302
    Glib::ustring sExt = ".png";
 
303
 
 
304
    if (! bHasSuffix(sFile, sExt, false))
 
305
    {
 
306
      sFile += sExt;
 
307
    }
 
308
 
 
309
    if (Glib::file_test(sFile, Glib::FILE_TEST_EXISTS))
 
310
    {
 
311
      Gtk::MessageDialog oConfirmDialog(*this,
 
312
                                        _("File already exists. Overwrite it?"),
 
313
                                        false,
 
314
                                        Gtk::MESSAGE_QUESTION,
 
315
                                        Gtk::BUTTONS_YES_NO);
 
316
      if (oConfirmDialog.run() != Gtk::RESPONSE_YES)
 
317
      {
 
318
        continue;
 
319
      }
 
320
    }
 
321
 
 
322
    if (m_stEmulator.emuWritePNG(sFile.c_str()))
 
323
    {
 
324
      break;
 
325
    }
 
326
  }
 
327
}
 
328
 
 
329
void Window::vOnFileClose()
 
330
{
 
331
  if (m_eCartridge != CartridgeNone)
 
332
  {
 
333
    soundPause();
 
334
    vStopEmu();
 
335
    vSetDefaultTitle();
 
336
    vDrawDefaultScreen();
 
337
    vSaveBattery();
 
338
    vSaveCheats();
 
339
    m_stEmulator.emuCleanUp();
 
340
    m_eCartridge = CartridgeNone;
 
341
    emulating = 0;
 
342
 
 
343
    vUpdateGameSlots();
 
344
 
 
345
    for (std::list<Gtk::Widget *>::iterator it = m_listSensitiveWhenPlaying.begin();
 
346
         it != m_listSensitiveWhenPlaying.end();
 
347
         it++)
 
348
    {
 
349
      (*it)->set_sensitive(false);
 
350
    }
 
351
 
 
352
    m_poFilePauseItem->set_active(false);
 
353
  }
 
354
}
 
355
 
 
356
void Window::vOnFileExit()
 
357
{
 
358
  hide();
 
359
}
 
360
 
 
361
void Window::vOnVideoFullscreen()
 
362
{
 
363
  vToggleFullscreen();
 
364
}
 
365
 
 
366
void Window::vOnDirectories()
 
367
{
 
368
  DirectoriesConfigDialog oDialog(m_poDirConfig);
 
369
  oDialog.set_transient_for(*this);
 
370
  oDialog.run();
 
371
 
 
372
  // Needed if saves dir changed
 
373
  vUpdateGameSlots();
 
374
}
 
375
 
 
376
void Window::vOnJoypadConfigure()
 
377
{
 
378
  JoypadConfigDialog oDialog(m_poInputConfig);
 
379
  oDialog.set_transient_for(*this);
 
380
  oDialog.run();
 
381
}
 
382
 
 
383
void Window::vOnDisplayConfigure()
 
384
{
 
385
  std::string sUiFile = sGetUiFilePath("display.ui");
 
386
  Glib::RefPtr<Gtk::Builder> poBuilder = Gtk::Builder::create_from_file(sUiFile);
 
387
 
 
388
  DisplayConfigDialog * poDialog = 0;
 
389
  poBuilder->get_widget_derived("DisplayConfigDialog", poDialog);
 
390
  poDialog->vSetConfig(m_poDisplayConfig, this);
 
391
  poDialog->set_transient_for(*this);
 
392
  poDialog->run();
 
393
  poDialog->hide();
 
394
}
 
395
 
 
396
void Window::vOnSoundConfigure()
 
397
{
 
398
  std::string sUiFile = sGetUiFilePath("sound.ui");
 
399
  Glib::RefPtr<Gtk::Builder> poBuilder = Gtk::Builder::create_from_file(sUiFile);
 
400
 
 
401
  SoundConfigDialog * poDialog = 0;
 
402
  poBuilder->get_widget_derived("SoundConfigDialog", poDialog);
 
403
  poDialog->vSetConfig(m_poSoundConfig, this);
 
404
  poDialog->set_transient_for(*this);
 
405
  poDialog->run();
 
406
  poDialog->hide();
 
407
}
 
408
 
 
409
void Window::vOnGameBoyConfigure()
 
410
{
 
411
  std::string sUiFile = sGetUiFilePath("gameboy.ui");
 
412
  Glib::RefPtr<Gtk::Builder> poBuilder = Gtk::Builder::create_from_file(sUiFile);
 
413
 
 
414
  GameBoyConfigDialog * poDialog = 0;
 
415
  poBuilder->get_widget_derived("GameBoyConfigDialog", poDialog);
 
416
  poDialog->vSetConfig(m_poCoreConfig, this);
 
417
  poDialog->set_transient_for(*this);
 
418
  poDialog->run();
 
419
  poDialog->hide();
 
420
}
 
421
 
 
422
void Window::vOnGameBoyAdvanceConfigure()
 
423
{
 
424
  std::string sUiFile = sGetUiFilePath("gameboyadvance.ui");
 
425
  Glib::RefPtr<Gtk::Builder> poBuilder = Gtk::Builder::create_from_file(sUiFile);
 
426
 
 
427
  GameBoyAdvanceConfigDialog * poDialog = 0;
 
428
  poBuilder->get_widget_derived("GameBoyAdvanceConfigDialog", poDialog);
 
429
  poDialog->vSetConfig(m_poCoreConfig, this);
 
430
  poDialog->set_transient_for(*this);
 
431
  poDialog->run();
 
432
  poDialog->hide();
 
433
}
 
434
 
 
435
void Window::vOnGeneralConfigure()
 
436
{
 
437
  std::string sUiFile = sGetUiFilePath("preferences.ui");
 
438
  Glib::RefPtr<Gtk::Builder> poBuilder = Gtk::Builder::create_from_file(sUiFile);
 
439
 
 
440
  PreferencesDialog * poDialog = 0;
 
441
  poBuilder->get_widget_derived("PreferencesDialog", poDialog);
 
442
  poDialog->vSetConfig(m_poCoreConfig, this);
 
443
  poDialog->set_transient_for(*this);
 
444
  poDialog->run();
 
445
  poDialog->hide();
 
446
}
 
447
 
 
448
void Window::vOnCheatList()
 
449
{
 
450
  if (m_eCartridge == CartridgeGBA)
 
451
  {
 
452
    std::string sUiFile = sGetUiFilePath("cheatlist.ui");
 
453
    Glib::RefPtr<Gtk::Builder> poBuilder = Gtk::Builder::create_from_file(sUiFile);
 
454
 
 
455
    GameBoyAdvanceCheatListDialog * poDialog = 0;
 
456
    poBuilder->get_widget_derived("CheatListDialog", poDialog);
 
457
    poDialog->set_transient_for(*this);
 
458
    poDialog->vSetWindow(this);
 
459
    poDialog->run();
 
460
    poDialog->hide();
 
461
  }
 
462
  else if (m_eCartridge == CartridgeGB)
 
463
  {
 
464
    std::string sUiFile = sGetUiFilePath("cheatlist.ui");
 
465
    Glib::RefPtr<Gtk::Builder> poBuilder = Gtk::Builder::create_from_file(sUiFile);
 
466
 
 
467
    GameBoyCheatListDialog * poDialog = 0;
 
468
    poBuilder->get_widget_derived("CheatListDialog", poDialog);
 
469
    poDialog->set_transient_for(*this);
 
470
    poDialog->vSetWindow(this);
 
471
    poDialog->run();
 
472
    poDialog->hide();
 
473
  }
 
474
}
 
475
 
 
476
void Window::vOnCheatDisableToggled(Gtk::CheckMenuItem * _poCMI)
 
477
{
 
478
  if (m_eCartridge == CartridgeGB) {
 
479
    cheatsEnabled = !cheatsEnabled;
 
480
  }
 
481
  else if (m_eCartridge == CartridgeGBA) {
 
482
    cheatsEnabled = !cheatsEnabled;
 
483
  }
 
484
 
 
485
  _poCMI->set_active(!cheatsEnabled);
 
486
}
 
487
 
 
488
void Window::vOnHelpAbout()
 
489
{
 
490
  Gtk::AboutDialog oAboutDialog;
 
491
  const char csGPLHeader[] = "This program is free software: you can redistribute it and/or modify\n"
 
492
    "it under the terms of the GNU General Public License as published by\n"
 
493
    "the Free Software Foundation, either version 2 of the License, or\n"
 
494
    "(at your option) any later version.\n\n"
 
495
    "This program is distributed in the hope that it will be useful,\n"
 
496
    "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
 
497
    "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
 
498
    "GNU General Public License for more details.\n\n"
 
499
    "You should have received a copy of the GNU General Public License\n"
 
500
    "along with this program.  If not, see <http://www.gnu.org/licenses/>.";
 
501
  const char csCopyright[] = "Copyright (C) 1999-2003 Forgotten\n"
 
502
                             "Copyright (C) 2004-2006 VBA development team\n"
 
503
                             "Copyright (C) 2007-2011 VBA-M development team";
 
504
 
 
505
  oAboutDialog.set_transient_for(*this);
 
506
 
 
507
  oAboutDialog.set_name(_("VBA-M"));
 
508
  oAboutDialog.set_version(VERSION);
 
509
  oAboutDialog.set_comments(_("Nintendo GameBoy Advance emulator."));
 
510
  oAboutDialog.set_license(csGPLHeader);
 
511
  oAboutDialog.set_copyright(csCopyright);
 
512
  oAboutDialog.set_logo_icon_name("vbam");
 
513
 
 
514
  oAboutDialog.set_website("http://www.vba-m.com/");
 
515
 
 
516
  std::list<Glib::ustring> list_authors;
 
517
  list_authors.push_back("Forgotten");
 
518
  list_authors.push_back("kxu");
 
519
  list_authors.push_back("Pokemonhacker");
 
520
  list_authors.push_back("Spacy51");
 
521
  list_authors.push_back("mudlord");
 
522
  list_authors.push_back("Nach");
 
523
  list_authors.push_back("jbo_85");
 
524
  list_authors.push_back("bgK");
 
525
  oAboutDialog.set_authors(list_authors);
 
526
 
 
527
  std::list<Glib::ustring> list_artists;
 
528
  list_artists.push_back("Matteo Drera");
 
529
  list_artists.push_back("Jakub Steiner");
 
530
  list_artists.push_back("Jones Lee");
 
531
  oAboutDialog.set_artists(list_artists);
 
532
 
 
533
  oAboutDialog.run();
 
534
}
 
535
 
 
536
bool Window::bOnEmuIdle()
 
537
{
 
538
  vSDLPollEvents();
 
539
 
 
540
  m_stEmulator.emuMain(m_stEmulator.emuCount);
 
541
  return true;
 
542
}
 
543
 
 
544
bool Window::on_focus_in_event(GdkEventFocus * _pstEvent)
 
545
{
 
546
  if (emulating && !m_bPaused)
 
547
  {
 
548
    vStartEmu();
 
549
    soundResume();
 
550
  }
 
551
  return false;
 
552
}
 
553
 
 
554
bool Window::on_focus_out_event(GdkEventFocus * _pstEvent)
 
555
{
 
556
  if (emulating
 
557
      && !m_bPaused
 
558
      && m_poCoreConfig->oGetKey<bool>("pause_when_inactive"))
 
559
  {
 
560
    vStopEmu();
 
561
    soundPause();
 
562
  }
 
563
  return false;
 
564
}
 
565
 
 
566
bool Window::on_key_press_event(GdkEventKey * _pstEvent)
 
567
{
 
568
  // The menu accelerators are disabled when it is hidden
 
569
  if (_pstEvent->keyval == GDK_F11 && !m_poMenuBar->is_visible())
 
570
  {
 
571
    vToggleFullscreen();
 
572
    return true;
 
573
  }
 
574
 
 
575
  // Forward the keyboard event to the input module by faking a SDL event
 
576
  SDL_Event event;
 
577
  event.type = SDL_KEYDOWN;
 
578
  event.key.keysym.sym = (SDLKey)_pstEvent->keyval;
 
579
  inputProcessSDLEvent(event);
 
580
 
 
581
  return Gtk::Window::on_key_press_event(_pstEvent);
 
582
}
 
583
 
 
584
bool Window::on_key_release_event(GdkEventKey * _pstEvent)
 
585
{
 
586
  // Forward the keyboard event to the input module by faking a SDL event
 
587
  SDL_Event event;
 
588
  event.type = SDL_KEYUP;
 
589
  event.key.keysym.sym = (SDLKey)_pstEvent->keyval;
 
590
  inputProcessSDLEvent(event);
 
591
 
 
592
 
 
593
  return Gtk::Window::on_key_release_event(_pstEvent);
 
594
}
 
595
 
 
596
bool Window::on_window_state_event(GdkEventWindowState* _pstEvent)
 
597
{
 
598
  if (_pstEvent->changed_mask & GDK_WINDOW_STATE_FULLSCREEN)
 
599
  {
 
600
    m_bFullscreen = _pstEvent->new_window_state & GDK_WINDOW_STATE_FULLSCREEN;
 
601
  }
 
602
 
 
603
  return true;
 
604
}
 
605
 
 
606
} // namespace VBA