You can subscribe to this list here.
2004 |
Jan
(17) |
Feb
(38) |
Mar
(24) |
Apr
(18) |
May
(75) |
Jun
(2) |
Jul
|
Aug
|
Sep
(21) |
Oct
(3) |
Nov
(19) |
Dec
(5) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(15) |
Jul
(2) |
Aug
|
Sep
(5) |
Oct
|
Nov
|
Dec
|
2006 |
Jan
(8) |
Feb
|
Mar
|
Apr
(6) |
May
(73) |
Jun
(57) |
Jul
(12) |
Aug
(68) |
Sep
(6) |
Oct
|
Nov
|
Dec
|
From: S?bastien G. <kx...@us...> - 2004-05-11 03:07:48
|
Update of /cvsroot/vba/VisualBoyAdvance/src/gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9428/src/gtk Modified Files: screenarea.cpp screenarea.h sigccompat.h window.cpp window.h windowcallbacks.cpp Log Message: Now cursor disappears of the game area after 3 seconds. Fixes. Index: sigccompat.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/sigccompat.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sigccompat.h 10 May 2004 14:59:43 -0000 1.2 --- sigccompat.h 11 May 2004 03:07:30 -0000 1.3 *************** *** 50,59 **** (dynamic_cast< T_obj1&>(_A_obj), _A_func); } - template <class T_return, class T_arg1,class T_arg2,class T_arg3, class T_obj1, class T_obj2> - inline Slot3<T_return, T_arg1,T_arg2,T_arg3> - slot( T_obj1& _A_obj, T_return (T_obj2::*_A_func)(T_arg1,T_arg2,T_arg3) ) - { return ::sigc::bound_mem_functor3<T_return, T_obj2, T_arg1,T_arg2,T_arg3> - (dynamic_cast< T_obj1&>(_A_obj), _A_func); } - } // namespace SigC --- 50,53 ---- Index: screenarea.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/screenarea.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** screenarea.h 2 Apr 2004 01:22:17 -0000 1.2 --- screenarea.h 11 May 2004 03:07:30 -0000 1.3 *************** *** 22,25 **** --- 22,30 ---- #include <gtkmm/drawingarea.h> + #include <gdkmm/cursor.h> + + #ifndef GTKMM20 + # include "sigccompat.h" + #endif // ! GTKMM20 #include "filters.h" *************** *** 43,46 **** --- 48,54 ---- protected: virtual bool on_expose_event(GdkEventExpose * _pstEvent); + virtual bool on_leave_notify_event(GdkEventCrossing * _pstEvent); + virtual bool on_motion_notify_event(GdkEventMotion * _pstEvent); + virtual bool bOnCursorTimeout(); private: *************** *** 56,60 **** --- 64,74 ---- FilterIB m_vFilterIB; + bool m_bShowCursor; + Gdk::Cursor * m_poEmptyCursor; + SigC::Connection m_oCursorSig; + void vUpdateSize(); + void vHideCursor(); + void vShowCursor(); }; Index: window.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/window.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** window.h 10 May 2004 22:54:51 -0000 1.19 --- window.h 11 May 2004 03:07:30 -0000 1.20 *************** *** 186,190 **** virtual void vOnJoypadConfigure(int _iJoypad); virtual void vOnJoypadToggled(Gtk::CheckMenuItem * _poCMI, int _iJoypad); ! virtual void vOnAutofireToggled(Gtk::CheckMenuItem * _poCMI, std::string _sKey, u32 _uiKeyFlag); virtual void vOnGDBWait(); virtual void vOnGDBLoadAndWait(); --- 186,190 ---- virtual void vOnJoypadConfigure(int _iJoypad); virtual void vOnJoypadToggled(Gtk::CheckMenuItem * _poCMI, int _iJoypad); ! virtual void vOnAutofireToggled(Gtk::CheckMenuItem * _poCMI, u32 _uiKeyFlag); virtual void vOnGDBWait(); virtual void vOnGDBLoadAndWait(); Index: window.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/window.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** window.cpp 10 May 2004 22:54:51 -0000 1.19 --- window.cpp 11 May 2004 03:07:30 -0000 1.20 *************** *** 817,824 **** poCMI = dynamic_cast<Gtk::CheckMenuItem *>(_poXml->get_widget(astAutofire[i].m_csName)); poCMI->set_active(m_poInputConfig->oGetKey<bool>(astAutofire[i].m_csKey)); ! vOnAutofireToggled(poCMI, astAutofire[i].m_csKey, astAutofire[i].m_eKeyFlag); ! poCMI->signal_toggled().connect(SigC::bind<Gtk::CheckMenuItem *, std::string, u32>( SigC::slot(*this, &Window::vOnAutofireToggled), ! poCMI, astAutofire[i].m_csKey, astAutofire[i].m_eKeyFlag)); } --- 817,824 ---- poCMI = dynamic_cast<Gtk::CheckMenuItem *>(_poXml->get_widget(astAutofire[i].m_csName)); poCMI->set_active(m_poInputConfig->oGetKey<bool>(astAutofire[i].m_csKey)); ! vOnAutofireToggled(poCMI, astAutofire[i].m_eKeyFlag); ! poCMI->signal_toggled().connect(SigC::bind<Gtk::CheckMenuItem *, u32>( SigC::slot(*this, &Window::vOnAutofireToggled), ! poCMI, astAutofire[i].m_eKeyFlag)); } Index: screenarea.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/screenarea.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** screenarea.cpp 2 Apr 2004 01:22:17 -0000 1.2 --- screenarea.cpp 11 May 2004 03:07:30 -0000 1.3 *************** *** 28,32 **** m_puiDelta(NULL), m_vFilter2x(NULL), ! m_vFilterIB(NULL) { g_assert(_iWidth >= 1 && _iHeight >= 1 && _iScale >= 1); --- 28,33 ---- m_puiDelta(NULL), m_vFilter2x(NULL), ! m_vFilterIB(NULL), ! m_bShowCursor(true) { g_assert(_iWidth >= 1 && _iHeight >= 1 && _iScale >= 1); *************** *** 37,41 **** vUpdateSize(); ! set_events(Gdk::EXPOSURE_MASK); } --- 38,55 ---- vUpdateSize(); ! set_events(Gdk::EXPOSURE_MASK ! | Gdk::POINTER_MOTION_MASK ! | Gdk::LEAVE_NOTIFY_MASK); ! ! char aiEmptyData[8]; ! memset(aiEmptyData, 0, sizeof(aiEmptyData)); ! Glib::RefPtr<Gdk::Bitmap> poSource = Gdk::Bitmap::create(aiEmptyData, 8, 8); ! Glib::RefPtr<Gdk::Bitmap> poMask = Gdk::Bitmap::create(aiEmptyData, 8, 8); ! Gdk::Color oFg; ! Gdk::Color oBg; ! oFg.set_rgb(0, 0, 0); ! oBg.set_rgb(0, 0, 0); ! ! m_poEmptyCursor = new Gdk::Cursor(poSource, poMask, oFg, oBg, 0, 0); } *************** *** 51,54 **** --- 65,73 ---- delete[] m_puiDelta; } + + if (m_poEmptyCursor != NULL) + { + delete m_poEmptyCursor; + } } *************** *** 159,162 **** --- 178,217 ---- } + void ScreenArea::vUpdateSize() + { + if (m_puiPixels != NULL) + { + delete[] m_puiPixels; + } + + if (m_puiDelta != NULL) + { + delete[] m_puiDelta; + } + + m_iAreaWidth = m_iScale * m_iWidth; + m_iAreaHeight = m_iScale * m_iHeight; + m_iRowStride = m_iAreaWidth * 4; + + m_puiPixels = new u32[m_iAreaWidth * m_iAreaHeight]; + + m_puiDelta = new u8[(m_iWidth + 2) * (m_iHeight + 2) * 4]; + memset(m_puiDelta, 255, (m_iWidth + 2) * (m_iHeight + 2) * 4); + + set_size_request(m_iAreaWidth, m_iAreaHeight); + } + + void ScreenArea::vHideCursor() + { + get_window()->set_cursor(*m_poEmptyCursor); + m_bShowCursor = false; + } + + void ScreenArea::vShowCursor() + { + get_window()->set_cursor(); + m_bShowCursor = true; + } + bool ScreenArea::on_expose_event(GdkEventExpose * _pstEvent) { *************** *** 190,215 **** } ! void ScreenArea::vUpdateSize() { ! if (m_puiPixels != NULL) ! { ! delete[] m_puiPixels; ! } ! ! if (m_puiDelta != NULL) { ! delete[] m_puiDelta; } ! m_iAreaWidth = m_iScale * m_iWidth; ! m_iAreaHeight = m_iScale * m_iHeight; ! m_iRowStride = m_iAreaWidth * 4; ! ! m_puiPixels = new u32[m_iAreaWidth * m_iAreaHeight]; ! m_puiDelta = new u8[(m_iWidth + 2) * (m_iHeight + 2) * 4]; ! memset(m_puiDelta, 255, (m_iWidth + 2) * (m_iHeight + 2) * 4); ! set_size_request(m_iAreaWidth, m_iAreaHeight); } --- 245,272 ---- } ! bool ScreenArea::on_motion_notify_event(GdkEventMotion * _pstEvent) { ! if (! m_bShowCursor) { ! vShowCursor(); } ! m_oCursorSig.disconnect(); ! m_oCursorSig = Glib::signal_timeout().connect(SigC::slot(*this, &ScreenArea::bOnCursorTimeout), ! 3000, Glib::PRIORITY_DEFAULT_IDLE); ! return false; ! } ! bool ScreenArea::on_leave_notify_event(GdkEventCrossing * _pstEvent) ! { ! m_oCursorSig.disconnect(); ! vShowCursor(); ! return false; ! } ! bool ScreenArea::bOnCursorTimeout() ! { ! vHideCursor(); ! return false; } Index: windowcallbacks.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/windowcallbacks.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** windowcallbacks.cpp 10 May 2004 22:54:51 -0000 1.8 --- windowcallbacks.cpp 11 May 2004 03:07:30 -0000 1.9 *************** *** 1212,1217 **** } ! void Window::vOnAutofireToggled(Gtk::CheckMenuItem * _poCMI, std::string _sKey, ! u32 _uiKeyFlag) { if (_poCMI->get_active()) --- 1212,1216 ---- } ! void Window::vOnAutofireToggled(Gtk::CheckMenuItem * _poCMI, u32 _uiKeyFlag) { if (_poCMI->get_active()) *************** *** 1223,1227 **** m_uiAutofireState &= ~_uiKeyFlag; } ! m_poInputConfig->vSetKey(_sKey, _poCMI->get_active()); } --- 1222,1244 ---- m_uiAutofireState &= ~_uiKeyFlag; } ! ! std::string sKey; ! if (_uiKeyFlag == KeyFlagA) ! { ! sKey = "autofire_A"; ! } ! else if (_uiKeyFlag == KeyFlagB) ! { ! sKey = "autofire_B"; ! } ! else if (_uiKeyFlag == KeyFlagL) ! { ! sKey = "autofire_L"; ! } ! else if (_uiKeyFlag == KeyFlagR) ! { ! sKey = "autofire_R"; ! } ! m_poInputConfig->vSetKey(sKey, _poCMI->get_active()); } |
From: S?bastien G. <kx...@us...> - 2004-05-10 22:55:04
|
Update of /cvsroot/vba/VisualBoyAdvance/src/gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26797/src/gtk Modified Files: vba.glade window.cpp window.h windowcallbacks.cpp Log Message: Added GDB support. Index: vba.glade =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/vba.glade,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** vba.glade 10 May 2004 14:59:43 -0000 1.12 --- vba.glade 10 May 2004 22:54:51 -0000 1.13 *************** *** 51,55 **** <child internal-child="image"> ! <widget class="GtkImage" id="image120"> <property name="visible">True</property> <property name="stock">gtk-open</property> --- 51,55 ---- <child internal-child="image"> ! <widget class="GtkImage" id="image128"> <property name="visible">True</property> <property name="stock">gtk-open</property> *************** *** 473,477 **** <child internal-child="image"> ! <widget class="GtkImage" id="image121"> <property name="visible">True</property> <property name="stock">gtk-close</property> --- 473,477 ---- <child internal-child="image"> ! <widget class="GtkImage" id="image129"> <property name="visible">True</property> <property name="stock">gtk-close</property> *************** *** 494,498 **** <child internal-child="image"> ! <widget class="GtkImage" id="image122"> <property name="visible">True</property> <property name="stock">gtk-quit</property> --- 494,498 ---- <child internal-child="image"> ! <widget class="GtkImage" id="image130"> <property name="visible">True</property> <property name="stock">gtk-quit</property> *************** *** 1877,1881 **** <widget class="GtkMenuItem" id="GdbWait"> <property name="visible">True</property> ! <property name="label" translatable="yes">_Wait for connection...</property> <property name="use_underline">True</property> </widget> --- 1877,1881 ---- <widget class="GtkMenuItem" id="GdbWait"> <property name="visible">True</property> ! <property name="label" translatable="yes">_Wait connection...</property> <property name="use_underline">True</property> </widget> *************** *** 1883,1887 **** <child> ! <widget class="GtkMenuItem" id="GdbLoad"> <property name="visible">True</property> <property name="label" translatable="yes">_Load and wait...</property> --- 1883,1887 ---- <child> ! <widget class="GtkMenuItem" id="GdbLoadAndWait"> <property name="visible">True</property> <property name="label" translatable="yes">_Load and wait...</property> *************** *** 1893,1897 **** <widget class="GtkMenuItem" id="GdbBreak"> <property name="visible">True</property> ! <property name="label" translatable="yes">_Break into GDB</property> <property name="use_underline">True</property> </widget> --- 1893,1897 ---- <widget class="GtkMenuItem" id="GdbBreak"> <property name="visible">True</property> ! <property name="label" translatable="yes">_Break</property> <property name="use_underline">True</property> </widget> *************** *** 1909,1920 **** </widget> </child> - - <child> - <widget class="GtkMenuItem" id="CheatsMenu"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Cheats</property> - <property name="use_underline">True</property> - </widget> - </child> </widget> </child> --- 1909,1912 ---- *************** *** 2050,2054 **** <property name="visible">True</property> <property name="can_focus">True</property> ! <property name="label" translatable="yes">An emulator for Gameboy⢠and GameboyAdvanceâ¢.</property> <property name="use_underline">False</property> <property name="use_markup">False</property> --- 2042,2046 ---- <property name="visible">True</property> <property name="can_focus">True</property> ! <property name="label" translatable="yes">An emulator for Gameboy(TM) and GameboyAdvance(TM).</property> <property name="use_underline">False</property> <property name="use_markup">False</property> *************** *** 2072,2076 **** <property name="visible">True</property> <property name="can_focus">True</property> ! <property name="label" translatable="yes"><small>Copyright © 1999-2004 Forgotten</small></property> <property name="use_underline">False</property> <property name="use_markup">True</property> --- 2064,2068 ---- <property name="visible">True</property> <property name="can_focus">True</property> ! <property name="label" translatable="yes"><small>Copyright (C) 2004 Forgotten and the VBA development team</small></property> <property name="use_underline">False</property> <property name="use_markup">True</property> *************** *** 2153,2220 **** <child> ! <widget class="GtkHBox" id="hbox1"> <property name="visible">True</property> ! <property name="homogeneous">False</property> ! <property name="spacing">0</property> <child> ! <widget class="GtkLabel" id="label4"> <property name="visible">True</property> ! <property name="label" translatable="yes">Throttle : </property> ! <property name="use_underline">False</property> ! <property name="use_markup">False</property> ! <property name="justify">GTK_JUSTIFY_LEFT</property> ! <property name="wrap">False</property> ! <property name="selectable">False</property> ! <property name="xalign">1</property> ! <property name="yalign">0.5</property> ! <property name="xpad">0</property> ! <property name="ypad">0</property> ! </widget> ! <packing> ! <property name="padding">0</property> ! <property name="expand">True</property> ! <property name="fill">True</property> ! </packing> ! </child> ! <child> ! <widget class="GtkSpinButton" id="ThrottleSpin"> ! <property name="visible">True</property> ! <property name="can_focus">True</property> ! <property name="climb_rate">1</property> ! <property name="digits">0</property> ! <property name="numeric">True</property> ! <property name="update_policy">GTK_UPDATE_ALWAYS</property> ! <property name="snap_to_ticks">True</property> ! <property name="wrap">True</property> ! <property name="adjustment">100 5 1000 1 25 25</property> ! </widget> ! <packing> ! <property name="padding">0</property> ! <property name="expand">True</property> ! <property name="fill">True</property> ! </packing> ! </child> ! <child> ! <widget class="GtkLabel" id="label5"> ! <property name="visible">True</property> ! <property name="label" translatable="yes"> %</property> ! <property name="use_underline">False</property> ! <property name="use_markup">False</property> ! <property name="justify">GTK_JUSTIFY_LEFT</property> ! <property name="wrap">False</property> ! <property name="selectable">False</property> ! <property name="xalign">0</property> ! <property name="yalign">0.5</property> ! <property name="xpad">0</property> ! <property name="ypad">0</property> </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> </child> </widget> --- 2145,2226 ---- <child> ! <widget class="GtkAlignment" id="alignment4"> <property name="visible">True</property> ! <property name="xalign">0.5</property> ! <property name="yalign">0.5</property> ! <property name="xscale">0</property> ! <property name="yscale">0</property> ! <property name="top_padding">0</property> ! <property name="bottom_padding">0</property> ! <property name="left_padding">0</property> ! <property name="right_padding">0</property> <child> ! <widget class="GtkHBox" id="hbox1"> <property name="visible">True</property> ! <property name="homogeneous">False</property> ! <property name="spacing">0</property> ! <child> ! <widget class="GtkLabel" id="label4"> ! <property name="visible">True</property> ! <property name="label" translatable="yes">Throttle : </property> ! <property name="use_underline">False</property> ! <property name="use_markup">False</property> ! <property name="justify">GTK_JUSTIFY_LEFT</property> ! <property name="wrap">False</property> ! <property name="selectable">False</property> ! <property name="xalign">1</property> ! <property name="yalign">0.5</property> ! <property name="xpad">0</property> ! <property name="ypad">0</property> ! </widget> ! <packing> ! <property name="padding">0</property> ! <property name="expand">True</property> ! <property name="fill">True</property> ! </packing> ! </child> ! <child> ! <widget class="GtkSpinButton" id="ThrottleSpin"> ! <property name="visible">True</property> ! <property name="can_focus">True</property> ! <property name="climb_rate">1</property> ! <property name="digits">0</property> ! <property name="numeric">True</property> ! <property name="update_policy">GTK_UPDATE_ALWAYS</property> ! <property name="snap_to_ticks">True</property> ! <property name="wrap">True</property> ! <property name="adjustment">100 5 1000 1 25 25</property> ! </widget> ! <packing> ! <property name="padding">0</property> ! <property name="expand">True</property> ! <property name="fill">True</property> ! </packing> ! </child> ! ! <child> ! <widget class="GtkLabel" id="label5"> ! <property name="visible">True</property> ! <property name="label" translatable="yes"> %</property> ! <property name="use_underline">False</property> ! <property name="use_markup">False</property> ! <property name="justify">GTK_JUSTIFY_LEFT</property> ! <property name="wrap">False</property> ! <property name="selectable">False</property> ! <property name="xalign">0</property> ! <property name="yalign">0.5</property> ! <property name="xpad">0</property> ! <property name="ypad">0</property> ! </widget> ! <packing> ! <property name="padding">0</property> ! <property name="expand">True</property> ! <property name="fill">True</property> ! </packing> ! </child> </widget> </child> </widget> *************** *** 2230,2234 **** <widget class="GtkDialog" id="DirectoriesDialog"> - <property name="visible">True</property> <property name="title" translatable="yes">Directories</property> <property name="type">GTK_WINDOW_TOPLEVEL</property> --- 2236,2239 ---- *************** *** 2824,2828 **** <widget class="GtkDialog" id="JoypadConfigDialog"> - <property name="visible">True</property> <property name="title" translatable="yes">Joypad config</property> <property name="type">GTK_WINDOW_TOPLEVEL</property> --- 2829,2832 ---- *************** *** 3468,3470 **** --- 3472,3603 ---- </widget> + <widget class="GtkDialog" id="TcpPortDialog"> + <property name="title" translatable="yes">TCP port</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property> + <property name="modal">False</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">True</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="has_separator">True</property> + + <child internal-child="vbox"> + <widget class="GtkVBox" id="dialog-vbox5"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child internal-child="action_area"> + <widget class="GtkHButtonBox" id="dialog-action_area5"> + <property name="visible">True</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + + <child> + <widget class="GtkButton" id="cancelbutton4"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-cancel</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="response_id">-6</property> + </widget> + </child> + + <child> + <widget class="GtkButton" id="okbutton4"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-ok</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="response_id">-5</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + + <child> + <widget class="GtkAlignment" id="alignment3"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkLabel" id="label23"> + <property name="visible">True</property> + <property name="label" translatable="yes">Port : </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">1</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkSpinButton" id="TcpPortSpin"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">True</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">True</property> + <property name="wrap">True</property> + <property name="adjustment">55555 1 65535 1 100 100</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + </widget> + </glade-interface> Index: window.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/window.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** window.h 10 May 2004 14:59:43 -0000 1.18 --- window.h 10 May 2004 22:54:51 -0000 1.19 *************** *** 187,190 **** --- 187,194 ---- virtual void vOnJoypadToggled(Gtk::CheckMenuItem * _poCMI, int _iJoypad); virtual void vOnAutofireToggled(Gtk::CheckMenuItem * _poCMI, std::string _sKey, u32 _uiKeyFlag); + virtual void vOnGDBWait(); + virtual void vOnGDBLoadAndWait(); + virtual void vOnGDBBreak(); + virtual void vOnGDBDisconnect(); virtual void vOnHelpAbout(); virtual bool bOnEmuIdle(); *************** *** 302,305 **** --- 306,310 ---- void vDrawDefaultScreen(); void vSetDefaultTitle(); + void vCreateFileOpenDialog(); bool bLoadROM(const std::string & _rsFile); void vLoadBattery(); Index: windowcallbacks.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/windowcallbacks.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** windowcallbacks.cpp 10 May 2004 14:59:43 -0000 1.7 --- windowcallbacks.cpp 10 May 2004 22:54:51 -0000 1.8 *************** *** 40,43 **** --- 40,53 ---- extern bool debugger; extern int RGB_LOW_BITS_MASK; + extern void (*dbgMain)(); + extern void (*dbgSignal)(int, int); + extern void (*dbgOutput)(char *, u32); + extern void remoteInit(); + extern void remoteCleanUp(); + extern void remoteStubMain(); + extern void remoteStubSignal(int, int); + extern void remoteOutput(char *, u32); + extern void remoteSetProtocol(int); + extern void remoteSetPort(int); #ifdef MMX *************** *** 52,132 **** void Window::vOnFileOpen() { - if (m_poFileOpenDialog == NULL) - { - std::string sGBDir = m_poDirConfig->sGetKey("gb_roms"); - std::string sGBADir = m_poDirConfig->sGetKey("gba_roms"); - - #ifdef GTKMM20 - - Gtk::FileSelection * poDialog = new Gtk::FileSelection(_("Open")); - poDialog->set_transient_for(*this); - - if (sGBADir != "") - { - poDialog->set_filename(sGBADir + "/"); - } - else if (sGBDir != "") - { - poDialog->set_filename(sGBDir + "/"); - } - - #else // ! GTKMM20 - - Gtk::FileChooserDialog * poDialog = new Gtk::FileChooserDialog(*this, _("Open")); - poDialog->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - poDialog->add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK); - - if (sGBDir != "") - { - poDialog->add_shortcut_folder(sGBDir); - poDialog->set_current_folder(sGBDir); - } - - if (sGBADir != "" && sGBADir != sGBDir) - { - poDialog->add_shortcut_folder(sGBADir); - poDialog->set_current_folder(sGBADir); - } - - const char * acsPattern[] = - { - // GBA - "*.[bB][iI][nN]", "*.[aA][gG][bB]", "*.[gG][bB][aA]", - // GB - "*.[gG][bB]", "*.[sS][gG][bB]", "*.[cC][gG][bB]", "*.[gG][bB][cC]", - // Both - "*.[mM][bB]", "*.[eE][lL][fF]", "*.[zZ][iI][pP]", "*.[zZ]", "*.[gG][zZ]" - }; - - Gtk::FileFilter oAllGBAFilter; - oAllGBAFilter.set_name(_("All Gameboy Advance files")); - for (guint i = 0; i < sizeof(acsPattern) / sizeof(acsPattern[0]); i++) - { - oAllGBAFilter.add_pattern(acsPattern[i]); - } - - Gtk::FileFilter oGBAFilter; - oGBAFilter.set_name(_("Gameboy Advance files")); - for (int i = 0; i < 3; i++) - { - oGBAFilter.add_pattern(acsPattern[i]); - } - - Gtk::FileFilter oGBFilter; - oGBFilter.set_name(_("Gameboy files")); - for (int i = 3; i < 7; i++) - { - oGBFilter.add_pattern(acsPattern[i]); - } - - poDialog->add_filter(oAllGBAFilter); - poDialog->add_filter(oGBAFilter); - poDialog->add_filter(oGBFilter); - - #endif // ! GTKMM20 - - m_poFileOpenDialog = poDialog; - } - while (m_poFileOpenDialog->run() == Gtk::RESPONSE_OK) { --- 62,65 ---- *************** *** 681,685 **** void Window::vOnFileClose() { ! if (emulating) { soundPause(); --- 614,618 ---- void Window::vOnFileClose() { ! if (m_eCartridge != CartridgeNone) { soundPause(); *************** *** 1293,1296 **** --- 1226,1381 ---- } + void Window::vOnGDBWait() + { + Glib::RefPtr<Xml> poXml; + poXml = Xml::create(PKGDATADIR "/vba.glade", "TcpPortDialog"); + + Gtk::Dialog * poDialog = dynamic_cast<Gtk::Dialog *>(poXml->get_widget("TcpPortDialog")); + Gtk::SpinButton * poSpin = dynamic_cast<Gtk::SpinButton *>(poXml->get_widget("TcpPortSpin")); + + poDialog->set_transient_for(*this); + + int iPort = 55555; + poSpin->set_value(iPort); + + bool bOk = false; + if (poDialog->run() == Gtk::RESPONSE_OK) + { + bOk = true; + iPort = poSpin->get_value_as_int(); + } + delete poDialog; + + if (! bOk) + { + return; + } + + m_eCartridge = CartridgeGBA; + m_sRomFile = "gnu_stub"; + m_stEmulator = GBASystem; + + rom = (u8 *) malloc(0x2000000); + workRAM = (u8 *) calloc(1, 0x40000); + bios = (u8 *) calloc(1, 0x4000); + internalRAM = (u8 *) calloc(1, 0x8000); + paletteRAM = (u8 *) calloc(1, 0x400); + vram = (u8 *) calloc(1, 0x20000); + oam = (u8 *) calloc(1, 0x400); + pix = (u8 *) calloc(1, 4 * m_iGBAScreenWidth * m_iGBAScreenHeight); + ioMem = (u8 *) calloc(1, 0x400); + + useBios = m_poCoreConfig->oGetKey<bool>("use_bios_file"); + CPUInit(m_poCoreConfig->sGetKey("bios_file").c_str(), useBios); + CPUReset(); + + for (std::list<Gtk::Widget *>::iterator it = m_listSensitiveWhenPlaying.begin(); + it != m_listSensitiveWhenPlaying.end(); + it++) + { + (*it)->set_sensitive(); + } + + if (m_poCoreConfig->oGetKey<bool>("load_game_auto")) + { + vOnLoadGameMostRecent(); + } + + vStartEmu(); + + emulating = 1; + + dbgMain = remoteStubMain; + dbgSignal = remoteStubSignal; + dbgOutput = remoteOutput; + debugger = true; + + remoteSetProtocol(0); + remoteSetPort(iPort); + remoteInit(); + } + + void Window::vOnGDBLoadAndWait() + { + bool bLoaded = false; + + while (m_poFileOpenDialog->run() == Gtk::RESPONSE_OK) + { + if (bLoadROM(m_poFileOpenDialog->get_filename())) + { + bLoaded = true; + break; + } + } + m_poFileOpenDialog->hide(); + + if (! bLoaded) + { + return; + } + + if (m_eCartridge != CartridgeGBA) + { + vPopupError(_("Only GBA images are supported.")); + vOnFileClose(); + return; + } + + Glib::RefPtr<Xml> poXml; + poXml = Xml::create(PKGDATADIR "/vba.glade", "TcpPortDialog"); + + Gtk::Dialog * poDialog = dynamic_cast<Gtk::Dialog *>(poXml->get_widget("TcpPortDialog")); + Gtk::SpinButton * poSpin = dynamic_cast<Gtk::SpinButton *>(poXml->get_widget("TcpPortSpin")); + + poDialog->set_transient_for(*this); + + int iPort = 55555; + poSpin->set_value(iPort); + + bool bOk = false; + if (poDialog->run() == Gtk::RESPONSE_OK) + { + bOk = true; + iPort = poSpin->get_value_as_int(); + } + delete poDialog; + + if (! bOk) + { + return; + } + + dbgMain = remoteStubMain; + dbgSignal = remoteStubSignal; + dbgOutput = remoteOutput; + debugger = true; + + remoteSetProtocol(0); + remoteSetPort(iPort); + remoteInit(); + } + + void Window::vOnGDBBreak() + { + if (armState) + { + armNextPC -= 4; + reg[15].I -= 4; + } + else + { + armNextPC -= 2; + reg[15].I -= 2; + } + + debugger = true; + } + + void Window::vOnGDBDisconnect() + { + remoteCleanUp(); + debugger = false; + } + void Window::vOnHelpAbout() { *************** *** 1309,1312 **** --- 1394,1403 ---- bool Window::bOnEmuIdle() { + if (debugger && m_stEmulator.emuHasDebugger) + { + dbgMain(); + return true; + } + if (m_uiThrottleDelay != 0) { Index: window.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/window.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** window.cpp 10 May 2004 14:59:43 -0000 1.18 --- window.cpp 10 May 2004 22:54:51 -0000 1.19 *************** *** 41,44 **** --- 41,54 ---- extern bool debugger; extern int RGB_LOW_BITS_MASK; + extern void (*dbgMain)(); + extern void (*dbgSignal)(int, int); + extern void (*dbgOutput)(char *, u32); + extern void remoteInit(); + extern void remoteCleanUp(); + extern void remoteStubMain(); + extern void remoteStubSignal(int, int); + extern void remoteOutput(char *, u32); + extern void remoteSetProtocol(int); + extern void remoteSetPort(int); #ifdef MMX *************** *** 122,125 **** --- 132,136 ---- } + vCreateFileOpenDialog(); vLoadHistoryFromConfig(); vLoadJoypadsFromConfig(); *************** *** 806,810 **** poCMI = dynamic_cast<Gtk::CheckMenuItem *>(_poXml->get_widget(astAutofire[i].m_csName)); poCMI->set_active(m_poInputConfig->oGetKey<bool>(astAutofire[i].m_csKey)); ! vOnAutofireToggled(poCMI, astAutofire[i].m_csName, astAutofire[i].m_eKeyFlag); poCMI->signal_toggled().connect(SigC::bind<Gtk::CheckMenuItem *, std::string, u32>( SigC::slot(*this, &Window::vOnAutofireToggled), --- 817,821 ---- poCMI = dynamic_cast<Gtk::CheckMenuItem *>(_poXml->get_widget(astAutofire[i].m_csName)); poCMI->set_active(m_poInputConfig->oGetKey<bool>(astAutofire[i].m_csKey)); ! vOnAutofireToggled(poCMI, astAutofire[i].m_csKey, astAutofire[i].m_eKeyFlag); poCMI->signal_toggled().connect(SigC::bind<Gtk::CheckMenuItem *, std::string, u32>( SigC::slot(*this, &Window::vOnAutofireToggled), *************** *** 812,815 **** --- 823,840 ---- } + // GDB menu + // + poMI = dynamic_cast<Gtk::MenuItem *>(_poXml->get_widget("GdbWait")); + poMI->signal_activate().connect(SigC::slot(*this, &Window::vOnGDBWait)); + + poMI = dynamic_cast<Gtk::MenuItem *>(_poXml->get_widget("GdbLoadAndWait")); + poMI->signal_activate().connect(SigC::slot(*this, &Window::vOnGDBLoadAndWait)); + + poMI = dynamic_cast<Gtk::MenuItem *>(_poXml->get_widget("GdbBreak")); + poMI->signal_activate().connect(SigC::slot(*this, &Window::vOnGDBBreak)); + + poMI = dynamic_cast<Gtk::MenuItem *>(_poXml->get_widget("GdbDisconnect")); + poMI->signal_activate().connect(SigC::slot(*this, &Window::vOnGDBDisconnect)); + // Help menu // *************** *** 1582,1585 **** --- 1607,1692 ---- } + void Window::vCreateFileOpenDialog() + { + if (m_poFileOpenDialog != NULL) + { + return; + } + + std::string sGBDir = m_poDirConfig->sGetKey("gb_roms"); + std::string sGBADir = m_poDirConfig->sGetKey("gba_roms"); + + #ifdef GTKMM20 + + Gtk::FileSelection * poDialog = new Gtk::FileSelection(_("Open")); + poDialog->set_transient_for(*this); + + if (sGBADir != "") + { + poDialog->set_filename(sGBADir + "/"); + } + else if (sGBDir != "") + { + poDialog->set_filename(sGBDir + "/"); + } + + #else // ! GTKMM20 + + Gtk::FileChooserDialog * poDialog = new Gtk::FileChooserDialog(*this, _("Open")); + poDialog->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); + poDialog->add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK); + + if (sGBDir != "") + { + poDialog->add_shortcut_folder(sGBDir); + poDialog->set_current_folder(sGBDir); + } + + if (sGBADir != "" && sGBADir != sGBDir) + { + poDialog->add_shortcut_folder(sGBADir); + poDialog->set_current_folder(sGBADir); + } + + const char * acsPattern[] = + { + // GBA + "*.[bB][iI][nN]", "*.[aA][gG][bB]", "*.[gG][bB][aA]", + // GB + "*.[gG][bB]", "*.[sS][gG][bB]", "*.[cC][gG][bB]", "*.[gG][bB][cC]", + // Both + "*.[mM][bB]", "*.[eE][lL][fF]", "*.[zZ][iI][pP]", "*.[zZ]", "*.[gG][zZ]" + }; + + Gtk::FileFilter oAllGBAFilter; + oAllGBAFilter.set_name(_("All Gameboy Advance files")); + for (guint i = 0; i < sizeof(acsPattern) / sizeof(acsPattern[0]); i++) + { + oAllGBAFilter.add_pattern(acsPattern[i]); + } + + Gtk::FileFilter oGBAFilter; + oGBAFilter.set_name(_("Gameboy Advance files")); + for (int i = 0; i < 3; i++) + { + oGBAFilter.add_pattern(acsPattern[i]); + } + + Gtk::FileFilter oGBFilter; + oGBFilter.set_name(_("Gameboy files")); + for (int i = 3; i < 7; i++) + { + oGBFilter.add_pattern(acsPattern[i]); + } + + poDialog->add_filter(oAllGBAFilter); + poDialog->add_filter(oGBAFilter); + poDialog->add_filter(oGBFilter); + + #endif // ! GTKMM20 + + m_poFileOpenDialog = poDialog; + } + bool Window::bLoadROM(const std::string & _rsFile) { *************** *** 1637,1640 **** --- 1744,1748 ---- vUpdateScreen(); + debugger = false; // May cause conflicts emulating = 1; m_bWasEmulating = false; |
From: S?bastien G. <kx...@us...> - 2004-05-10 22:55:02
|
Update of /cvsroot/vba/VisualBoyAdvance/po In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26797/po Modified Files: POTFILES.in fr.gmo fr.po vba-1.7.2.pot Log Message: Added GDB support. Index: fr.po =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/po/fr.po,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** fr.po 5 May 2004 16:01:11 -0000 1.6 --- fr.po 10 May 2004 22:54:50 -0000 1.7 *************** *** 10,15 **** "Project-Id-Version: VisualBoyAdvance 1.7.2\n" "Report-Msgid-Bugs-To: undefined\n" ! "POT-Creation-Date: 2004-05-05 17:41+0200\n" ! "PO-Revision-Date: 2004-05-05 17:50+0200\n" "Last-Translator: Sébastien Guignot <kx...@ts...>\n" "Language-Team: French <@>\n" --- 10,15 ---- "Project-Id-Version: VisualBoyAdvance 1.7.2\n" "Report-Msgid-Bugs-To: undefined\n" ! "POT-Creation-Date: 2004-05-11 00:29+0200\n" [...1381 lines suppressed...] msgid "----/--/-- --:--:--" msgstr "--/--/---- --:--:--" ! #: src/gtk/window.cpp:1904 msgid "%Y/%m/%d %H:%M:%S" msgstr "%d/%m/%Y %H:%M:%S" *************** *** 993,999 **** msgstr "Pas de place pour le(s) tampon(s) de profil\n" ! #~ msgid "Importing the battery file failed." ! #~ msgstr "L'importation du fichier de batterie a échoué." ! ! #~ msgid "Exporting the battery file failed." ! #~ msgstr "L'exportation du fichier de batterie a échoué." --- 1080,1083 ---- msgstr "Pas de place pour le(s) tampon(s) de profil\n" ! #~ msgid "_Cheats" ! #~ msgstr "_Cheats" Index: POTFILES.in =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/po/POTFILES.in,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** POTFILES.in 5 May 2004 16:01:10 -0000 1.3 --- POTFILES.in 10 May 2004 22:54:50 -0000 1.4 *************** *** 10,13 **** --- 10,14 ---- src/gb/gbCodes.h src/gb/GB.cpp + src/gtk/joypadconfig.cpp src/gtk/system.cpp src/gtk/vba.glade Index: vba-1.7.2.pot =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/po/vba-1.7.2.pot,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** vba-1.7.2.pot 5 May 2004 16:01:11 -0000 1.6 --- vba-1.7.2.pot 10 May 2004 22:54:51 -0000 1.7 *************** *** 9,18 **** "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: undefined\n" ! "POT-Creation-Date: 2004-05-05 17:41+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL...@li...>\n" "MIME-Version: 1.0\n" ! "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" [...1375 lines suppressed...] ! #: src/gtk/window.cpp:1701 #, c-format msgid "Unknown file type %s" msgstr "" ! #: src/gtk/window.cpp:1795 msgid "Loaded battery" msgstr "" ! #: src/gtk/window.cpp:1814 msgid "Saved battery" msgstr "" ! #: src/gtk/window.cpp:1872 src/gtk/window.cpp:1919 msgid "----/--/-- --:--:--" msgstr "" ! #: src/gtk/window.cpp:1904 msgid "%Y/%m/%d %H:%M:%S" msgstr "" Index: fr.gmo =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/po/fr.gmo,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 Binary files /tmp/cvsYBRXpX and /tmp/cvsPqM4XL differ |
From: S?bastien G. <kx...@us...> - 2004-05-10 15:00:46
|
Update of /cvsroot/vba/VisualBoyAdvance/src/gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10325 Added Files: joypadconfig.cpp joypadconfig.h Log Message: Added joypad selection/configuration support, and autofire. --- NEW FILE: joypadconfig.cpp --- // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. // Copyright (C) 1999-2003 Forgotten // Copyright (C) 2004 Forgotten and the VBA development team // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2, or(at your option) // any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software Foundation, // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "joypadconfig.h" #include <string.h> #include "intl.h" namespace VBA { guint * JoypadConfig::puiAt(int _iIndex) { guint * puiMember; switch (_iIndex) { case 0: puiMember = &m_uiUp; break; case 1: puiMember = &m_uiDown; break; case 2: puiMember = &m_uiLeft; break; case 3: puiMember = &m_uiRight; break; case 4: puiMember = &m_uiA; break; case 5: puiMember = &m_uiB; break; case 6: puiMember = &m_uiL; break; case 7: puiMember = &m_uiR; break; case 8: puiMember = &m_uiSelect; break; case 9: puiMember = &m_uiStart; break; case 10: puiMember = &m_uiSpeed; break; case 11: puiMember = &m_uiCapture; break; default: puiMember = NULL; } return puiMember; } int JoypadConfig::iFind(guint _uiKeycode) { for (guint i = 0; i < 12; i++) { if (*puiAt(i) == _uiKeycode) { return i; } } return -1; } void JoypadConfig::vSetDefault() { guint auiKeyval[] = { GDK_Up, GDK_Down, GDK_Left, GDK_Right, GDK_z, GDK_x, GDK_a, GDK_s, GDK_BackSpace, GDK_Return, GDK_space, GDK_F12 }; for (guint i = 0; i < sizeof(auiKeyval) / sizeof(auiKeyval[0]); i++) { GdkKeymapKey * pstKeys; int iKeys; if (gdk_keymap_get_entries_for_keyval(gdk_keymap_get_default(), auiKeyval[i], &pstKeys, &iKeys)) { *puiAt(i) = pstKeys[0].keycode; g_free(pstKeys); } else { *puiAt(i) = 0; } } } Keymap * JoypadConfig::poCreateKeymap() const { Keymap * poKeymap = new Keymap(); poKeymap->vRegister(m_uiUp, KeyUp ); poKeymap->vRegister(m_uiDown, KeyDown ); poKeymap->vRegister(m_uiLeft, KeyLeft ); poKeymap->vRegister(m_uiRight, KeyRight ); poKeymap->vRegister(m_uiA, KeyA ); poKeymap->vRegister(m_uiB, KeyB ); poKeymap->vRegister(m_uiL, KeyL ); poKeymap->vRegister(m_uiR, KeyR ); poKeymap->vRegister(m_uiSelect, KeySelect ); poKeymap->vRegister(m_uiStart, KeyStart ); poKeymap->vRegister(m_uiSpeed, KeySpeed ); poKeymap->vRegister(m_uiCapture, KeyCapture ); return poKeymap; } JoypadConfigDialog::JoypadConfigDialog(GtkDialog * _pstDialog, const Glib::RefPtr<Gnome::Glade::Xml> & _poXml) : Gtk::Dialog(_pstDialog) { m_puiCurrentKeyCode = NULL; memset(&m_oConfig, 0, sizeof(m_oConfig)); m_poOkButton = dynamic_cast<Gtk::Button *>(_poXml->get_widget("JoypadOkButton")); m_oEntries.push_back(dynamic_cast<Gtk::Entry *>(_poXml->get_widget("JoypadUpEntry"))); m_oEntries.push_back(dynamic_cast<Gtk::Entry *>(_poXml->get_widget("JoypadDownEntry"))); m_oEntries.push_back(dynamic_cast<Gtk::Entry *>(_poXml->get_widget("JoypadLeftEntry"))); m_oEntries.push_back(dynamic_cast<Gtk::Entry *>(_poXml->get_widget("JoypadRightEntry"))); m_oEntries.push_back(dynamic_cast<Gtk::Entry *>(_poXml->get_widget("JoypadAEntry"))); m_oEntries.push_back(dynamic_cast<Gtk::Entry *>(_poXml->get_widget("JoypadBEntry"))); m_oEntries.push_back(dynamic_cast<Gtk::Entry *>(_poXml->get_widget("JoypadLEntry"))); m_oEntries.push_back(dynamic_cast<Gtk::Entry *>(_poXml->get_widget("JoypadREntry"))); m_oEntries.push_back(dynamic_cast<Gtk::Entry *>(_poXml->get_widget("JoypadSelectEntry"))); m_oEntries.push_back(dynamic_cast<Gtk::Entry *>(_poXml->get_widget("JoypadStartEntry"))); m_oEntries.push_back(dynamic_cast<Gtk::Entry *>(_poXml->get_widget("JoypadSpeedEntry"))); m_oEntries.push_back(dynamic_cast<Gtk::Entry *>(_poXml->get_widget("JoypadCaptureEntry"))); for (guint i = 0; i < m_oEntries.size(); i++) { Gtk::Entry * poEntry = m_oEntries[i]; poEntry->signal_focus_in_event().connect(SigC::bind<guint>( SigC::slot(*this, &JoypadConfigDialog::bOnEntryFocusIn), i)); poEntry->signal_focus_out_event().connect(SigC::slot(*this, &JoypadConfigDialog::bOnEntryFocusOut)); } vUpdateEntries(); } JoypadConfigDialog::~JoypadConfigDialog() { } void JoypadConfigDialog::vSetConfig(const JoypadConfig & _roConfig) { m_oConfig = _roConfig; vUpdateEntries(); } void JoypadConfigDialog::vUpdateEntries() { for (guint i = 0; i < m_oEntries.size(); i++) { guint uiKeyval = 0; gdk_keymap_translate_keyboard_state(gdk_keymap_get_default(), *m_oConfig.puiAt(i), (GdkModifierType)0, 0, &uiKeyval, NULL, NULL, NULL); const char * csName = gdk_keyval_name(uiKeyval); if (csName == NULL) { m_oEntries[i]->set_text(_("<Undefined>")); } else { m_oEntries[i]->set_text(csName); } } } bool JoypadConfigDialog::bOnEntryFocusIn(GdkEventFocus * _pstEvent, guint _uiEntry) { m_uiCurrentEntry = _uiEntry; m_puiCurrentKeyCode = m_oConfig.puiAt(_uiEntry); return false; } bool JoypadConfigDialog::bOnEntryFocusOut(GdkEventFocus * _pstEvent) { m_puiCurrentKeyCode = NULL; return false; } bool JoypadConfigDialog::on_key_press_event(GdkEventKey * _pstEvent) { if (m_puiCurrentKeyCode == NULL) { return Gtk::Dialog::on_key_press_event(_pstEvent); } *m_puiCurrentKeyCode = 0; int iFound = m_oConfig.iFind(_pstEvent->hardware_keycode); if (iFound >= 0) { *m_oConfig.puiAt(iFound) = 0; m_oEntries[iFound]->set_text(_("<Undefined>")); } *m_puiCurrentKeyCode = _pstEvent->hardware_keycode; guint uiKeyval = 0; gdk_keymap_translate_keyboard_state(gdk_keymap_get_default(), _pstEvent->hardware_keycode, (GdkModifierType)0, 0, &uiKeyval, NULL, NULL, NULL); const char * csName = gdk_keyval_name(uiKeyval); if (csName == NULL) { m_oEntries[m_uiCurrentEntry]->set_text(_("<Undefined>")); } else { m_oEntries[m_uiCurrentEntry]->set_text(csName); } if (m_uiCurrentEntry + 1 < m_oEntries.size()) { m_oEntries[m_uiCurrentEntry + 1]->grab_focus(); } else { m_poOkButton->grab_focus(); } return true; } } // namespace VBA --- NEW FILE: joypadconfig.h --- // -*- C++ -*- // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. // Copyright (C) 1999-2003 Forgotten // Copyright (C) 2004 Forgotten and the VBA development team // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2, or(at your option) // any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software Foundation, // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef __VBA_JOYPADCONFIG_H__ #define __VBA_JOYPADCONFIG_H__ #include <vector> #include <libglademm.h> #include <gtkmm.h> #ifndef GTKMM20 # include "sigccompat.h" #endif // ! GTKMM20 #include "input.h" namespace VBA { class JoypadConfig { public: guint m_uiUp; guint m_uiDown; guint m_uiLeft; guint m_uiRight; guint m_uiA; guint m_uiB; guint m_uiL; guint m_uiR; guint m_uiSelect; guint m_uiStart; guint m_uiSpeed; guint m_uiCapture; guint * puiAt(int _iIndex); int iFind(guint _uiKeycode); void vSetDefault(); Keymap * poCreateKeymap() const; }; class JoypadConfigDialog : public Gtk::Dialog { public: JoypadConfigDialog(GtkDialog * _pstDialog, const Glib::RefPtr<Gnome::Glade::Xml> & _poXml); virtual ~JoypadConfigDialog(); void vSetConfig(const JoypadConfig & _roConfig); inline JoypadConfig stGetConfig() const { return m_oConfig; } protected: bool bOnEntryFocusIn(GdkEventFocus * _pstEvent, guint _uiEntry); bool bOnEntryFocusOut(GdkEventFocus * _pstEvent); bool on_key_press_event(GdkEventKey * _pstEvent); private: JoypadConfig m_oConfig; Gtk::Button * m_poOkButton; std::vector<Gtk::Entry *> m_oEntries; guint * m_puiCurrentKeyCode; guint m_uiCurrentEntry; void vUpdateEntries(); }; } // namespace VBA #endif // __VBA_JOYPADCONFIG_H__ |
From: S?bastien G. <kx...@us...> - 2004-05-10 14:59:54
|
Update of /cvsroot/vba/VisualBoyAdvance/src/gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10035 Modified Files: Makefile.am Makefile.in sigccompat.h system.cpp vba.glade window.cpp window.h windowcallbacks.cpp Log Message: Added joypad selection/configuration support, and autofire. Index: sigccompat.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/sigccompat.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sigccompat.h 1 May 2004 14:03:59 -0000 1.1 --- sigccompat.h 10 May 2004 14:59:43 -0000 1.2 *************** *** 50,53 **** --- 50,59 ---- (dynamic_cast< T_obj1&>(_A_obj), _A_func); } + template <class T_return, class T_arg1,class T_arg2,class T_arg3, class T_obj1, class T_obj2> + inline Slot3<T_return, T_arg1,T_arg2,T_arg3> + slot( T_obj1& _A_obj, T_return (T_obj2::*_A_func)(T_arg1,T_arg2,T_arg3) ) + { return ::sigc::bound_mem_functor3<T_return, T_obj2, T_arg1,T_arg2,T_arg3> + (dynamic_cast< T_obj1&>(_A_obj), _A_func); } + } // namespace SigC Index: Makefile.am =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.am 3 May 2004 17:00:26 -0000 1.5 --- Makefile.am 10 May 2004 14:59:43 -0000 1.6 *************** *** 11,14 **** --- 11,16 ---- input.h \ intl.h \ + joypadconfig.cpp \ + joypadconfig.h \ main.cpp \ menuitem.h \ Index: system.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/system.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** system.cpp 5 May 2004 16:01:12 -0000 1.7 --- system.cpp 10 May 2004 14:59:43 -0000 1.8 *************** *** 121,124 **** --- 121,125 ---- void systemScreenCapture(int _iNum) { + GUI()->vCaptureScreen(_iNum); } Index: window.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/window.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** window.h 5 May 2004 19:36:31 -0000 1.17 --- window.h 10 May 2004 14:59:43 -0000 1.18 *************** *** 32,35 **** --- 32,36 ---- #include <string> + #include <vector> #include <list> *************** *** 40,43 **** --- 41,45 ---- #include "filters.h" #include "input.h" + #include "joypadconfig.h" namespace VBA *************** *** 73,82 **** void vComputeFrameskip(int _iRate); void vShowSpeed(int _iSpeed); - inline u32 uiReadJoypad() const { return m_uiJoypadState; } inline ECartridge eGetCartridge() const { return m_eCartridge; } inline int iGetThrottle() const { return m_iThrottle; } protected: enum EShowSpeed { --- 75,88 ---- void vComputeFrameskip(int _iRate); void vShowSpeed(int _iSpeed); + void vCaptureScreen(int _iNum); + u32 uiReadJoypad(); inline ECartridge eGetCartridge() const { return m_eCartridge; } inline int iGetThrottle() const { return m_iThrottle; } protected: + Window(GtkWindow * _pstWindow, + const Glib::RefPtr<Gnome::Glade::Xml> & _poXml); + enum EShowSpeed { *************** *** 162,165 **** --- 168,172 ---- virtual void vOnSaveTypeToggled(Gtk::CheckMenuItem * _poCMI, int _iSaveType); virtual void vOnFlashSizeToggled(Gtk::CheckMenuItem * _poCMI, int _iFlashSize); + virtual void vOnScreenshotFormatToggled(Gtk::CheckMenuItem * _poCMI, std::string _sFormat); virtual void vOnSoundStatusToggled(Gtk::CheckMenuItem * _poCMI, int _iSoundStatus); virtual void vOnSoundEchoToggled(Gtk::CheckMenuItem * _poCMI); *************** *** 177,180 **** --- 184,190 ---- virtual void vOnDisableMMXToggled(Gtk::CheckMenuItem * _poCMI); #endif // MMX + virtual void vOnJoypadConfigure(int _iJoypad); + virtual void vOnJoypadToggled(Gtk::CheckMenuItem * _poCMI, int _iJoypad); + virtual void vOnAutofireToggled(Gtk::CheckMenuItem * _poCMI, std::string _sKey, u32 _uiKeyFlag); virtual void vOnHelpAbout(); virtual bool bOnEmuIdle(); *************** *** 186,192 **** private: - Window(GtkWindow * _pstWindow, - const Glib::RefPtr<Gnome::Glade::Xml> & _poXml); - // Config limits const int m_iFrameskipMin; --- 196,199 ---- *************** *** 210,213 **** --- 217,222 ---- const int m_iFilterIBMin; const int m_iFilterIBMax; + const int m_iJoypadMin; + const int m_iJoypadMax; static Window * m_poInstance; *************** *** 223,226 **** --- 232,236 ---- Config::Section * m_poDisplayConfig; Config::Section * m_poSoundConfig; + Config::Section * m_poInputConfig; #ifdef GTKMM20 *************** *** 255,258 **** --- 265,271 ---- SigC::Connection m_oEmuSig; + std::vector<JoypadConfig> m_oJoypads; + Keymap * m_poKeymap; + int m_iScreenWidth; int m_iScreenHeight; *************** *** 261,266 **** ECartridge m_eCartridge; EmulatedSystem m_stEmulator; - Keymap m_oKeymap; u32 m_uiJoypadState; bool m_bPaused; bool m_bWasEmulating; --- 274,280 ---- ECartridge m_eCartridge; EmulatedSystem m_stEmulator; u32 m_uiJoypadState; + u32 m_uiAutofireState; + bool m_bAutofireToggle; bool m_bPaused; bool m_bWasEmulating; *************** *** 283,287 **** void vClearHistoryMenu(); void vUpdateHistoryMenu(); ! void vLoadKeymap(); void vUpdateScreen(); void vDrawDefaultScreen(); --- 297,302 ---- void vClearHistoryMenu(); void vUpdateHistoryMenu(); ! void vLoadJoypadsFromConfig(); ! void vSaveJoypadsToConfig(); void vUpdateScreen(); void vDrawDefaultScreen(); Index: window.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/window.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** window.cpp 5 May 2004 19:36:31 -0000 1.17 --- window.cpp 10 May 2004 14:59:43 -0000 1.18 *************** *** 80,84 **** m_iFilter2xMax (LastFilter), m_iFilterIBMin (FirstFilterIB), ! m_iFilterIBMax (LastFilterIB) { m_poXml = _poXml; --- 80,86 ---- m_iFilter2xMax (LastFilter), m_iFilterIBMin (FirstFilterIB), ! m_iFilterIBMax (LastFilterIB), ! m_iJoypadMin (1), ! m_iJoypadMax (4) { m_poXml = _poXml; *************** *** 121,125 **** vLoadHistoryFromConfig(); ! vLoadKeymap(); Gtk::MenuItem * poMI; --- 123,127 ---- vLoadHistoryFromConfig(); ! vLoadJoypadsFromConfig(); Gtk::MenuItem * poMI; *************** *** 467,470 **** --- 469,498 ---- } + // Screenshot format menu + // + struct + { + const char * m_csName; + const char * m_csScreenshotFormat; + } + astScreenshotFormat[] = + { + { "ScreenshotFormatPNG", "png" }, + { "ScreenshotFormatBMP", "bmp" } + }; + std::string sDefaultScreenshotFormat = m_poCoreConfig->sGetKey("screenshot_format"); + for (guint i = 0; i < sizeof(astScreenshotFormat) / sizeof(astScreenshotFormat[0]); i++) + { + poCMI = dynamic_cast<Gtk::CheckMenuItem *>(_poXml->get_widget(astScreenshotFormat[i].m_csName)); + if (astScreenshotFormat[i].m_csScreenshotFormat == sDefaultScreenshotFormat) + { + poCMI->set_active(); + vOnScreenshotFormatToggled(poCMI, sDefaultScreenshotFormat); + } + poCMI->signal_toggled().connect(SigC::bind<Gtk::CheckMenuItem *, std::string>( + SigC::slot(*this, &Window::vOnScreenshotFormatToggled), + poCMI, std::string(astScreenshotFormat[i].m_csScreenshotFormat))); + } + // Sound menu // *************** *** 724,727 **** --- 752,815 ---- } + // Joypad menu + // + poMI = dynamic_cast<Gtk::MenuItem *>(_poXml->get_widget("JoypadConfigure1")); + poMI->signal_activate().connect(SigC::bind<int>( + SigC::slot(*this, &Window::vOnJoypadConfigure), 1)); + + poMI = dynamic_cast<Gtk::MenuItem *>(_poXml->get_widget("JoypadConfigure2")); + poMI->signal_activate().connect(SigC::bind<int>( + SigC::slot(*this, &Window::vOnJoypadConfigure), 2)); + + poMI = dynamic_cast<Gtk::MenuItem *>(_poXml->get_widget("JoypadConfigure3")); + poMI->signal_activate().connect(SigC::bind<int>( + SigC::slot(*this, &Window::vOnJoypadConfigure), 3)); + + poMI = dynamic_cast<Gtk::MenuItem *>(_poXml->get_widget("JoypadConfigure4")); + poMI->signal_activate().connect(SigC::bind<int>( + SigC::slot(*this, &Window::vOnJoypadConfigure), 4)); + + int iDefaultJoypad = m_poInputConfig->oGetKey<int>("active_joypad"); + for (int i = m_iJoypadMin; i <= m_iJoypadMax; i++) + { + char csName[20]; + snprintf(csName, sizeof(csName), "Joypad%d", i); + + poCMI = dynamic_cast<Gtk::CheckMenuItem *>(_poXml->get_widget(csName)); + if (i == iDefaultJoypad) + { + poCMI->set_active(); + vOnJoypadToggled(poCMI, iDefaultJoypad); + } + poCMI->signal_toggled().connect(SigC::bind<Gtk::CheckMenuItem *, int>( + SigC::slot(*this, &Window::vOnJoypadToggled), + poCMI, i)); + } + + // Autofire menu + // + struct + { + const char * m_csKey; + const char * m_csName; + const EKeyFlag m_eKeyFlag; + } + astAutofire[] = + { + { "autofire_A", "AutofireA", KeyFlagA }, + { "autofire_B", "AutofireB", KeyFlagB }, + { "autofire_L", "AutofireL", KeyFlagL }, + { "autofire_R", "AutofireR", KeyFlagR } + }; + for (guint i = 0; i < sizeof(astAutofire) / sizeof(astAutofire[0]); i++) + { + poCMI = dynamic_cast<Gtk::CheckMenuItem *>(_poXml->get_widget(astAutofire[i].m_csName)); + poCMI->set_active(m_poInputConfig->oGetKey<bool>(astAutofire[i].m_csKey)); + vOnAutofireToggled(poCMI, astAutofire[i].m_csName, astAutofire[i].m_eKeyFlag); + poCMI->signal_toggled().connect(SigC::bind<Gtk::CheckMenuItem *, std::string, u32>( + SigC::slot(*this, &Window::vOnAutofireToggled), + poCMI, astAutofire[i].m_csKey, astAutofire[i].m_eKeyFlag)); + } + // Help menu // *************** *** 751,754 **** --- 839,843 ---- vOnFileClose(); vSaveHistoryToConfig(); + vSaveJoypadsToConfig(); vSaveConfig(m_sConfigFile); *************** *** 758,761 **** --- 847,855 ---- } + if (m_poKeymap != NULL) + { + delete m_poKeymap; + } + m_poInstance = NULL; } *************** *** 866,887 **** // m_poCoreConfig = m_oConfig.poAddSection("Core"); ! m_poCoreConfig->vSetKey("load_game_auto", false ); ! m_poCoreConfig->vSetKey("frameskip", "auto" ); ! m_poCoreConfig->vSetKey("throttle", 0 ); ! m_poCoreConfig->vSetKey("layer_bg0", true ); ! m_poCoreConfig->vSetKey("layer_bg1", true ); ! m_poCoreConfig->vSetKey("layer_bg2", true ); ! m_poCoreConfig->vSetKey("layer_bg3", true ); ! m_poCoreConfig->vSetKey("layer_obj", true ); ! m_poCoreConfig->vSetKey("layer_win0", true ); ! m_poCoreConfig->vSetKey("layer_win1", true ); ! m_poCoreConfig->vSetKey("layer_objwin", true ); ! m_poCoreConfig->vSetKey("use_bios_file", false ); ! m_poCoreConfig->vSetKey("bios_file", "" ); ! m_poCoreConfig->vSetKey("save_type", SaveAuto ); ! m_poCoreConfig->vSetKey("flash_size", 64 ); ! m_poCoreConfig->vSetKey("gb_border", true ); ! m_poCoreConfig->vSetKey("gb_printer", false ); ! m_poCoreConfig->vSetKey("emulator_type", EmulatorAuto ); // Display section --- 960,982 ---- // m_poCoreConfig = m_oConfig.poAddSection("Core"); ! m_poCoreConfig->vSetKey("load_game_auto", false ); ! m_poCoreConfig->vSetKey("frameskip", "auto" ); ! m_poCoreConfig->vSetKey("throttle", 0 ); ! m_poCoreConfig->vSetKey("layer_bg0", true ); ! m_poCoreConfig->vSetKey("layer_bg1", true ); ! m_poCoreConfig->vSetKey("layer_bg2", true ); ! m_poCoreConfig->vSetKey("layer_bg3", true ); ! m_poCoreConfig->vSetKey("layer_obj", true ); ! m_poCoreConfig->vSetKey("layer_win0", true ); ! m_poCoreConfig->vSetKey("layer_win1", true ); ! m_poCoreConfig->vSetKey("layer_objwin", true ); ! m_poCoreConfig->vSetKey("use_bios_file", false ); ! m_poCoreConfig->vSetKey("bios_file", "" ); ! m_poCoreConfig->vSetKey("save_type", SaveAuto ); ! m_poCoreConfig->vSetKey("flash_size", 64 ); ! m_poCoreConfig->vSetKey("gb_border", true ); ! m_poCoreConfig->vSetKey("gb_printer", false ); ! m_poCoreConfig->vSetKey("emulator_type", EmulatorAuto ); ! m_poCoreConfig->vSetKey("screenshot_format", "png" ); // Display section *************** *** 912,915 **** --- 1007,1039 ---- m_poSoundConfig->vSetKey("quality", Sound22K ); m_poSoundConfig->vSetKey("volume", Sound100 ); + + // Input section + // + JoypadConfig oJoypadConfig; + oJoypadConfig.vSetDefault(); + m_poInputConfig = m_oConfig.poAddSection("Input"); + m_poInputConfig->vSetKey("active_joypad", m_iJoypadMin ); + for (int i = m_iJoypadMin; i <= m_iJoypadMax; i++) + { + char csPrefix[20]; + snprintf(csPrefix, sizeof(csPrefix), "joypad%d_", i); + std::string sPrefix(csPrefix); + m_poInputConfig->vSetKey(sPrefix + "up", oJoypadConfig.m_uiUp ); + m_poInputConfig->vSetKey(sPrefix + "down", oJoypadConfig.m_uiDown ); + m_poInputConfig->vSetKey(sPrefix + "left", oJoypadConfig.m_uiLeft ); + m_poInputConfig->vSetKey(sPrefix + "right", oJoypadConfig.m_uiRight ); + m_poInputConfig->vSetKey(sPrefix + "A", oJoypadConfig.m_uiA ); + m_poInputConfig->vSetKey(sPrefix + "B", oJoypadConfig.m_uiB ); + m_poInputConfig->vSetKey(sPrefix + "L", oJoypadConfig.m_uiL ); + m_poInputConfig->vSetKey(sPrefix + "R", oJoypadConfig.m_uiR ); + m_poInputConfig->vSetKey(sPrefix + "select", oJoypadConfig.m_uiSelect ); + m_poInputConfig->vSetKey(sPrefix + "start", oJoypadConfig.m_uiStart ); + m_poInputConfig->vSetKey(sPrefix + "speed", oJoypadConfig.m_uiSpeed ); + m_poInputConfig->vSetKey(sPrefix + "capture", oJoypadConfig.m_uiCapture ); + } + m_poInputConfig->vSetKey("autofire_A", false ); + m_poInputConfig->vSetKey("autofire_B", false ); + m_poInputConfig->vSetKey("autofire_L", false ); + m_poInputConfig->vSetKey("autofire_R", false ); } *************** *** 1003,1006 **** --- 1127,1136 ---- } + sValue = m_poCoreConfig->sGetKey("screenshot_format"); + if (sValue != "png" && sValue != "bmp") + { + sValue = "png"; + } + // Display section // *************** *** 1054,1057 **** --- 1184,1196 ---- m_poSoundConfig->vSetKey("volume", iAdjusted); } + + // Input section + // + iValue = m_poInputConfig->oGetKey<int>("active_joypad"); + iAdjusted = CLAMP(iValue, m_iJoypadMin, m_iJoypadMax); + if (iValue != iAdjusted) + { + m_poInputConfig->vSetKey("active_joypad", iAdjusted); + } } *************** *** 1158,1181 **** } ! void Window::vLoadKeymap() { ! // TODO : load from prefs ! m_oKeymap.vRegister(GDK_z, KeyA); ! m_oKeymap.vRegister(GDK_Z, KeyA); ! m_oKeymap.vRegister(GDK_x, KeyB); ! m_oKeymap.vRegister(GDK_X, KeyB); ! m_oKeymap.vRegister(GDK_BackSpace, KeySelect); ! m_oKeymap.vRegister(GDK_Return, KeyStart); ! m_oKeymap.vRegister(GDK_Right, KeyRight); ! m_oKeymap.vRegister(GDK_Left, KeyLeft); ! m_oKeymap.vRegister(GDK_Up, KeyUp); ! m_oKeymap.vRegister(GDK_Down, KeyDown); ! m_oKeymap.vRegister(GDK_s, KeyR); ! m_oKeymap.vRegister(GDK_S, KeyR); ! m_oKeymap.vRegister(GDK_a, KeyL); ! m_oKeymap.vRegister(GDK_A, KeyL); ! m_oKeymap.vRegister(GDK_space, KeySpeed); ! m_oKeymap.vRegister(GDK_F12, KeyCapture); } --- 1297,1349 ---- } ! void Window::vLoadJoypadsFromConfig() { ! m_oJoypads.clear(); ! for (int i = m_iJoypadMin; i <= m_iJoypadMax; i++) ! { ! char csPrefix[20]; ! snprintf(csPrefix, sizeof(csPrefix), "joypad%d_", i); ! std::string sPrefix(csPrefix); ! ! JoypadConfig oJoypadConfig; ! oJoypadConfig.m_uiUp = m_poInputConfig->oGetKey<guint>(sPrefix + "up"); ! oJoypadConfig.m_uiDown = m_poInputConfig->oGetKey<guint>(sPrefix + "down"); ! oJoypadConfig.m_uiLeft = m_poInputConfig->oGetKey<guint>(sPrefix + "left"); ! oJoypadConfig.m_uiRight = m_poInputConfig->oGetKey<guint>(sPrefix + "right"); ! oJoypadConfig.m_uiA = m_poInputConfig->oGetKey<guint>(sPrefix + "A"); ! oJoypadConfig.m_uiB = m_poInputConfig->oGetKey<guint>(sPrefix + "B"); ! oJoypadConfig.m_uiL = m_poInputConfig->oGetKey<guint>(sPrefix + "L"); ! oJoypadConfig.m_uiR = m_poInputConfig->oGetKey<guint>(sPrefix + "R"); ! oJoypadConfig.m_uiSelect = m_poInputConfig->oGetKey<guint>(sPrefix + "select"); ! oJoypadConfig.m_uiStart = m_poInputConfig->oGetKey<guint>(sPrefix + "start"); ! oJoypadConfig.m_uiSpeed = m_poInputConfig->oGetKey<guint>(sPrefix + "speed"); ! oJoypadConfig.m_uiCapture = m_poInputConfig->oGetKey<guint>(sPrefix + "capture"); ! ! m_oJoypads.push_back(oJoypadConfig); ! } ! } ! ! void Window::vSaveJoypadsToConfig() ! { ! for (int i = m_iJoypadMin; i <= m_iJoypadMax; i++) ! { ! char csPrefix[20]; ! snprintf(csPrefix, sizeof(csPrefix), "joypad%d_", i); ! std::string sPrefix(csPrefix); ! ! m_poInputConfig->vSetKey(sPrefix + "up", m_oJoypads[i - 1].m_uiUp ); ! m_poInputConfig->vSetKey(sPrefix + "down", m_oJoypads[i - 1].m_uiDown ); ! m_poInputConfig->vSetKey(sPrefix + "left", m_oJoypads[i - 1].m_uiLeft ); ! m_poInputConfig->vSetKey(sPrefix + "right", m_oJoypads[i - 1].m_uiRight ); ! m_poInputConfig->vSetKey(sPrefix + "A", m_oJoypads[i - 1].m_uiA ); ! m_poInputConfig->vSetKey(sPrefix + "B", m_oJoypads[i - 1].m_uiB ); ! m_poInputConfig->vSetKey(sPrefix + "L", m_oJoypads[i - 1].m_uiL ); ! m_poInputConfig->vSetKey(sPrefix + "R", m_oJoypads[i - 1].m_uiR ); ! m_poInputConfig->vSetKey(sPrefix + "select", m_oJoypads[i - 1].m_uiSelect ); ! m_poInputConfig->vSetKey(sPrefix + "start", m_oJoypads[i - 1].m_uiStart ); ! m_poInputConfig->vSetKey(sPrefix + "speed", m_oJoypads[i - 1].m_uiSpeed ); ! m_poInputConfig->vSetKey(sPrefix + "capture", m_oJoypads[i - 1].m_uiCapture ); ! } } *************** *** 1368,1371 **** --- 1536,1585 ---- } + void Window::vCaptureScreen(int _iNum) + { + std::string sBaseName; + std::string sCaptureDir = m_poDirConfig->sGetKey("captures"); + if (sCaptureDir == "") + { + sBaseName = sCutSuffix(m_sRomFile); + } + else + { + sBaseName = sCaptureDir + "/" + sCutSuffix(Glib::path_get_basename(m_sRomFile)); + } + std::string sFormat = m_poCoreConfig->sGetKey("screenshot_format"); + + char * csFile = g_strdup_printf("%s_%02d.%s", + sBaseName.c_str(), + _iNum, + sFormat.c_str()); + if (sFormat == "png") + { + m_stEmulator.emuWritePNG(csFile); + } + else + { + m_stEmulator.emuWriteBMP(csFile); + } + g_free(csFile); + } + + u32 Window::uiReadJoypad() + { + u32 uiJoypad = m_uiJoypadState; + + if (m_uiAutofireState != 0) + { + uiJoypad &= ~m_uiAutofireState; + if (m_bAutofireToggle) + { + uiJoypad |= m_uiAutofireState; + } + m_bAutofireToggle = ! m_bAutofireToggle; + } + + return uiJoypad; + } + bool Window::bLoadROM(const std::string & _rsFile) { *************** *** 1378,1382 **** if (eType == IMAGE_UNKNOWN) { ! systemMessage(0, _("Unknown file type %s"), csFile); return false; } --- 1592,1596 ---- if (eType == IMAGE_UNKNOWN) { ! vPopupError(_("Unknown file type %s"), csFile); return false; } Index: Makefile.in =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/Makefile.in,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.in 3 May 2004 17:00:26 -0000 1.5 --- Makefile.in 10 May 2004 14:59:43 -0000 1.6 *************** *** 164,167 **** --- 164,169 ---- input.h \ intl.h \ + joypadconfig.cpp \ + joypadconfig.h \ main.cpp \ menuitem.h \ *************** *** 290,297 **** am_gvba_OBJECTS = gvba-configfile.$(OBJEXT) gvba-filters.$(OBJEXT) \ ! gvba-input.$(OBJEXT) gvba-main.$(OBJEXT) \ ! gvba-screenarea.$(OBJEXT) gvba-system.$(OBJEXT) \ ! gvba-tools.$(OBJEXT) gvba-windowcallbacks.$(OBJEXT) \ ! gvba-window.$(OBJEXT) gvba_OBJECTS = $(am_gvba_OBJECTS) gvba_DEPENDENCIES = libgba.a --- 292,299 ---- am_gvba_OBJECTS = gvba-configfile.$(OBJEXT) gvba-filters.$(OBJEXT) \ ! gvba-input.$(OBJEXT) gvba-joypadconfig.$(OBJEXT) \ ! gvba-main.$(OBJEXT) gvba-screenarea.$(OBJEXT) \ ! gvba-system.$(OBJEXT) gvba-tools.$(OBJEXT) \ ! gvba-windowcallbacks.$(OBJEXT) gvba-window.$(OBJEXT) gvba_OBJECTS = $(am_gvba_OBJECTS) gvba_DEPENDENCIES = libgba.a *************** *** 303,307 **** @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/gvba-configfile.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/gvba-filters.Po \ ! @AMDEP_TRUE@ ./$(DEPDIR)/gvba-input.Po ./$(DEPDIR)/gvba-main.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/gvba-screenarea.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/gvba-system.Po \ --- 305,311 ---- @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/gvba-configfile.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/gvba-filters.Po \ ! @AMDEP_TRUE@ ./$(DEPDIR)/gvba-input.Po \ ! @AMDEP_TRUE@ ./$(DEPDIR)/gvba-joypadconfig.Po \ ! @AMDEP_TRUE@ ./$(DEPDIR)/gvba-main.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/gvba-screenarea.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/gvba-system.Po \ *************** *** 414,417 **** --- 418,422 ---- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gvba-filters.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gvba-input.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gvba-joypadconfig.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gvba-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gvba-screenarea.Po@am__quote@ *************** *** 1336,1339 **** --- 1341,1366 ---- @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gvba_CPPFLAGS) $(CPPFLAGS) $(gvba_CXXFLAGS) $(CXXFLAGS) -c -o gvba-input.obj `if test -f 'input.cpp'; then $(CYGPATH_W) 'input.cpp'; else $(CYGPATH_W) '$(srcdir)/input.cpp'; fi` + gvba-joypadconfig.o: joypadconfig.cpp + @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gvba_CPPFLAGS) $(CPPFLAGS) $(gvba_CXXFLAGS) $(CXXFLAGS) -MT gvba-joypadconfig.o -MD -MP -MF "$(DEPDIR)/gvba-joypadconfig.Tpo" \ + @am__fastdepCXX_TRUE@ -c -o gvba-joypadconfig.o `test -f 'joypadconfig.cpp' || echo '$(srcdir)/'`joypadconfig.cpp; \ + @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/gvba-joypadconfig.Tpo" "$(DEPDIR)/gvba-joypadconfig.Po"; \ + @am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/gvba-joypadconfig.Tpo"; exit 1; \ + @am__fastdepCXX_TRUE@ fi + @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='joypadconfig.cpp' object='gvba-joypadconfig.o' libtool=no @AMDEPBACKSLASH@ + @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/gvba-joypadconfig.Po' tmpdepfile='$(DEPDIR)/gvba-joypadconfig.TPo' @AMDEPBACKSLASH@ + @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gvba_CPPFLAGS) $(CPPFLAGS) $(gvba_CXXFLAGS) $(CXXFLAGS) -c -o gvba-joypadconfig.o `test -f 'joypadconfig.cpp' || echo '$(srcdir)/'`joypadconfig.cpp + + gvba-joypadconfig.obj: joypadconfig.cpp + @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gvba_CPPFLAGS) $(CPPFLAGS) $(gvba_CXXFLAGS) $(CXXFLAGS) -MT gvba-joypadconfig.obj -MD -MP -MF "$(DEPDIR)/gvba-joypadconfig.Tpo" \ + @am__fastdepCXX_TRUE@ -c -o gvba-joypadconfig.obj `if test -f 'joypadconfig.cpp'; then $(CYGPATH_W) 'joypadconfig.cpp'; else $(CYGPATH_W) '$(srcdir)/joypadconfig.cpp'; fi`; \ + @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/gvba-joypadconfig.Tpo" "$(DEPDIR)/gvba-joypadconfig.Po"; \ + @am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/gvba-joypadconfig.Tpo"; exit 1; \ + @am__fastdepCXX_TRUE@ fi + @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='joypadconfig.cpp' object='gvba-joypadconfig.obj' libtool=no @AMDEPBACKSLASH@ + @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/gvba-joypadconfig.Po' tmpdepfile='$(DEPDIR)/gvba-joypadconfig.TPo' @AMDEPBACKSLASH@ + @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gvba_CPPFLAGS) $(CPPFLAGS) $(gvba_CXXFLAGS) $(CXXFLAGS) -c -o gvba-joypadconfig.obj `if test -f 'joypadconfig.cpp'; then $(CYGPATH_W) 'joypadconfig.cpp'; else $(CYGPATH_W) '$(srcdir)/joypadconfig.cpp'; fi` + gvba-main.o: main.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gvba_CPPFLAGS) $(CPPFLAGS) $(gvba_CXXFLAGS) $(CXXFLAGS) -MT gvba-main.o -MD -MP -MF "$(DEPDIR)/gvba-main.Tpo" \ Index: vba.glade =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/vba.glade,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** vba.glade 5 May 2004 19:36:31 -0000 1.11 --- vba.glade 10 May 2004 14:59:43 -0000 1.12 *************** *** 51,55 **** <child internal-child="image"> ! <widget class="GtkImage" id="image116"> <property name="visible">True</property> <property name="stock">gtk-open</property> --- 51,55 ---- <child internal-child="image"> ! <widget class="GtkImage" id="image120"> <property name="visible">True</property> <property name="stock">gtk-open</property> *************** *** 473,477 **** <child internal-child="image"> ! <widget class="GtkImage" id="image117"> <property name="visible">True</property> <property name="stock">gtk-close</property> --- 473,477 ---- <child internal-child="image"> ! <widget class="GtkImage" id="image121"> <property name="visible">True</property> <property name="stock">gtk-close</property> *************** *** 494,498 **** <child internal-child="image"> ! <widget class="GtkImage" id="image118"> <property name="visible">True</property> <property name="stock">gtk-quit</property> --- 494,498 ---- <child internal-child="image"> ! <widget class="GtkImage" id="image122"> <property name="visible">True</property> <property name="stock">gtk-quit</property> *************** *** 1067,1070 **** --- 1067,1076 ---- <child> + <widget class="GtkSeparatorMenuItem" id="separator31"> + <property name="visible">True</property> + </widget> + </child> + + <child> <widget class="GtkMenuItem" id="EmulatorSelectBios"> <property name="visible">True</property> *************** *** 1082,1085 **** --- 1088,1129 ---- </widget> </child> + + <child> + <widget class="GtkSeparatorMenuItem" id="separator30"> + <property name="visible">True</property> + </widget> + </child> + + <child> + <widget class="GtkMenuItem" id="ScreenshotFormatMenu"> + <property name="visible">True</property> + <property name="label" translatable="yes">Screenshot format</property> + <property name="use_underline">True</property> + + <child> + <widget class="GtkMenu" id="ScreenshotFormatMenu_menu"> + + <child> + <widget class="GtkRadioMenuItem" id="ScreenshotFormatPNG"> + <property name="visible">True</property> + <property name="label" translatable="yes">_PNG</property> + <property name="use_underline">True</property> + <property name="active">True</property> + </widget> + </child> + + <child> + <widget class="GtkRadioMenuItem" id="ScreenshotFormatBMP"> + <property name="visible">True</property> + <property name="label" translatable="yes">_BMP</property> + <property name="use_underline">True</property> + <property name="active">False</property> + <property name="group">ScreenshotFormatPNG</property> + </widget> + </child> + </widget> + </child> + </widget> + </child> </widget> </child> *************** *** 1752,1769 **** <child> - <widget class="GtkMenuItem" id="MotionConfigureMenu"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Motion configure...</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkSeparatorMenuItem" id="separator25"> - <property name="visible">True</property> - </widget> - </child> - - <child> <widget class="GtkMenuItem" id="AutofireMenu"> <property name="visible">True</property> --- 1796,1799 ---- *************** *** 2793,2795 **** --- 2823,3470 ---- </widget> + <widget class="GtkDialog" id="JoypadConfigDialog"> + <property name="visible">True</property> + <property name="title" translatable="yes">Joypad config</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property> + <property name="modal">False</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">True</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="has_separator">True</property> + + <child internal-child="vbox"> + <widget class="GtkVBox" id="dialog-vbox4"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child internal-child="action_area"> + <widget class="GtkHButtonBox" id="dialog-action_area4"> + <property name="visible">True</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + + <child> + <widget class="GtkButton" id="cancelbutton3"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-cancel</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="response_id">-6</property> + </widget> + </child> + + <child> + <widget class="GtkButton" id="JoypadOkButton"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-ok</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="response_id">-5</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + + <child> + <widget class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkTable" id="table2"> + <property name="visible">True</property> + <property name="n_rows">12</property> + <property name="n_columns">2</property> + <property name="homogeneous">False</property> + <property name="row_spacing">5</property> + <property name="column_spacing">0</property> + + <child> + <widget class="GtkEntry" id="JoypadUpEntry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char" translatable="yes">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options">expand</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label12"> + <property name="visible">True</property> + <property name="label" translatable="yes">Down : </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">1</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options">expand</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label13"> + <property name="visible">True</property> + <property name="label" translatable="yes">Left : </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">1</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">fill</property> + <property name="y_options">expand</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label14"> + <property name="visible">True</property> + <property name="label" translatable="yes">Right : </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">1</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">fill</property> + <property name="y_options">expand</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label15"> + <property name="visible">True</property> + <property name="label" translatable="yes">Button A : </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">1</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="x_options">fill</property> + <property name="y_options">expand</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label16"> + <property name="visible">True</property> + <property name="label" translatable="yes">Button B : </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">1</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> + <property name="x_options">fill</property> + <property name="y_options">expand</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label17"> + <property name="visible">True</property> + <property name="label" translatable="yes">Button L : </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">1</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">6</property> + <property name="bottom_attach">7</property> + <property name="x_options">fill</property> + <property name="y_options">expand</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label18"> + <property name="visible">True</property> + <property name="label" translatable="yes">Button R : </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">1</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">7</property> + <property name="bottom_attach">8</property> + <property name="x_options">fill</property> + <property name="y_options">expand</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label19"> + <property name="visible">True</property> + <property name="label" translatable="yes">Select : </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">1</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">8</property> + <property name="bottom_attach">9</property> + <property name="x_options">fill</property> + <property name="y_options">expand</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label20"> + <property name="visible">True</property> + <property name="label" translatable="yes">Start : </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">1</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">9</property> + <property name="bottom_attach">10</property> + <property name="x_options">fill</property> + <property name="y_options">expand</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label21"> + <property name="visible">True</property> + <property name="label" translatable="yes">Speed : </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">1</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">10</property> + <property name="bottom_attach">11</property> + <property name="x_options">fill</property> + <property name="y_options">expand</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label22"> + <property name="visible">True</property> + <property name="label" translatable="yes">Capture : </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">1</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">11</property> + <property name="bottom_attach">12</property> + <property name="x_options">fill</property> + <property name="y_options">expand</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="JoypadDownEntry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char" translatable="yes">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options">expand</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="JoypadLeftEntry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char" translatable="yes">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">fill</property> + <property name="y_options">expand</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="JoypadRightEntry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char" translatable="yes">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">fill</property> + <property name="y_options">expand</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="JoypadAEntry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char" translatable="yes">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="x_options">fill</property> + <property name="y_options">expand</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="JoypadBEntry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char" translatable="yes">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> + <property name="x_options">fill</property> + <property name="y_options">expand</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="JoypadLEntry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char" translatable="yes">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">6</property> + <property name="bottom_attach">7</property> + <property name="x_options">fill</property> + <property name="y_options">expand</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="JoypadREntry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char" translatable="yes">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">7</property> + <property name="bottom_attach">8</property> + <property name="x_options">fill</property> + <property name="y_options">expand</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="JoypadSelectEntry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char" translatable="yes">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">8</property> + <property name="bottom_attach">9</property> + <property name="x_options">fill</property> + <property name="y_options">expand</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="JoypadStartEntry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char" translatable="yes">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">9</property> + <property name="bottom_attach">10</property> + <property name="x_options">fill</property> + <property name="y_options">expand</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="JoypadSpeedEntry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char" translatable="yes">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">10</property> + <property name="bottom_attach">11</property> + <property name="x_options">fill</property> + <property name="y_options">expand</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="JoypadCaptureEntry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char" translatable="yes">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">11</property> + <property name="bottom_attach">12</property> + <property name="x_options">fill</property> + <property name="y_options">expand</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label11"> + <property name="visible">True</property> + <property name="label" translatable="yes">Up : </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">1</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options">expand</property> + </packing> + </child> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + </widget> + </glade-interface> Index: windowcallbacks.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/windowcallbacks.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** windowcallbacks.cpp 5 May 2004 19:36:31 -0000 1.6 --- windowcallbacks.cpp 10 May 2004 14:59:43 -0000 1.7 *************** *** 613,616 **** --- 613,621 ---- oDialog.add_filter(oBmpFilter); + if (m_poCoreConfig->sGetKey("screenshot_format") == "bmp") + { + oDialog.set_filter(oBmpFilter); + } + #endif // ! GTKMM20 *************** *** 622,626 **** #ifdef GTKMM20 ! sExt = ".png"; #else // ! GTKMM20 --- 627,631 ---- #ifdef GTKMM20 ! sExt = "." + m_poCoreConfig->sGetKey("screenshot_format"); #else // ! GTKMM20 *************** *** 1035,1038 **** --- 1040,1053 ---- } + void Window::vOnScreenshotFormatToggled(Gtk::CheckMenuItem * _poCMI, std::string _sFormat) + { + if (! _poCMI->get_active()) + { + return; + } + + m_poCoreConfig->vSetKey("screenshot_format", _sFormat); + } + void Window::vOnSoundStatusToggled(Gtk::CheckMenuItem * _poCMI, int _iSoundStatus) { *************** *** 1222,1225 **** --- 1237,1296 ---- #endif // MMX + void Window::vOnJoypadConfigure(int _iJoypad) + { + Glib::RefPtr<Xml> poXml; + poXml = Xml::create(PKGDATADIR "/vba.glade", "JoypadConfigDialog"); + + JoypadConfigDialog * poDialog = NULL; + poXml->get_widget_derived<JoypadConfigDialog>("JoypadConfigDialog", poDialog); + poDialog->set_transient_for(*this); + poDialog->vSetConfig(m_oJoypads[_iJoypad - 1]); + + if (poDialog->run() == Gtk::RESPONSE_OK) + { + m_oJoypads[_iJoypad - 1] = poDialog->stGetConfig(); + if (_iJoypad == m_poInputConfig->oGetKey<int>("active_joypad")) + { + if (m_poKeymap != NULL) + { + delete m_poKeymap; + } + m_poKeymap = m_oJoypads[_iJoypad - 1].poCreateKeymap(); + } + } + + delete poDialog; + } + + void Window::vOnJoypadToggled(Gtk::CheckMenuItem * _poCMI, int _iJoypad) + { + if (! _poCMI->get_active()) + { + return; + } + + if (m_poKeymap != NULL) + { + delete m_poKeymap; + } + m_poKeymap = m_oJoypads[_iJoypad - 1].poCreateKeymap(); + + m_poInputConfig->vSetKey("active_joypad", _iJoypad); + } + + void Window::vOnAutofireToggled(Gtk::CheckMenuItem * _poCMI, std::string _sKey, + u32 _uiKeyFlag) + { + if (_poCMI->get_active()) + { + m_uiAutofireState |= _uiKeyFlag; + } + else + { + m_uiAutofireState &= ~_uiKeyFlag; + } + m_poInputConfig->vSetKey(_sKey, _poCMI->get_active()); + } + void Window::vOnHelpAbout() { *************** *** 1285,1289 **** if ((_pstEvent->state & Gtk::AccelGroup::get_default_mod_mask()) ! || (eKey = m_oKeymap.eGetKey(_pstEvent->keyval)) == KeyNone) { return Gtk::Window::on_key_press_event(_pstEvent); --- 1356,1360 ---- if ((_pstEvent->state & Gtk::AccelGroup::get_default_mod_mask()) ! || (eKey = m_poKeymap->eGetKey(_pstEvent->hardware_keycode)) == KeyNone) { return Gtk::Window::on_key_press_event(_pstEvent); *************** *** 1343,1347 **** if ((_pstEvent->state & Gtk::AccelGroup::get_default_mod_mask()) ! || (eKey = m_oKeymap.eGetKey(_pstEvent->keyval)) == KeyNone) { return Gtk::Window::on_key_release_event(_pstEvent); --- 1414,1418 ---- if ((_pstEvent->state & Gtk::AccelGroup::get_default_mod_mask()) ! || (eKey = m_poKeymap->eGetKey(_pstEvent->hardware_keycode)) == KeyNone) { return Gtk::Window::on_key_release_event(_pstEvent); |
From: S?bastien G. <kx...@us...> - 2004-05-05 19:36:39
|
Update of /cvsroot/vba/VisualBoyAdvance/src/gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30645 Modified Files: vba.glade window.cpp window.h windowcallbacks.cpp Log Message: Added screenshot dialog. Index: window.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/window.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** window.h 5 May 2004 16:01:12 -0000 1.16 --- window.h 5 May 2004 19:36:31 -0000 1.17 *************** *** 131,141 **** virtual void vOnFileOpen(); ! virtual void vOnLoadGame(); ! virtual void vOnSaveGame(); virtual void vOnLoadGameMostRecent(); virtual void vOnLoadGameAutoToggled(Gtk::CheckMenuItem * _poCMI); ! virtual void vOnLoadGameSlot(int _iSlot); virtual void vOnSaveGameOldest(); ! virtual void vOnSaveGameSlot(int _iSlot); virtual void vOnFilePauseToggled(Gtk::CheckMenuItem * _poCMI); virtual void vOnFileReset(); --- 131,141 ---- virtual void vOnFileOpen(); ! virtual void vOnFileLoad(); ! virtual void vOnFileSave(); virtual void vOnLoadGameMostRecent(); virtual void vOnLoadGameAutoToggled(Gtk::CheckMenuItem * _poCMI); ! virtual void vOnLoadGame(int _iSlot); virtual void vOnSaveGameOldest(); ! virtual void vOnSaveGame(int _iSlot); virtual void vOnFilePauseToggled(Gtk::CheckMenuItem * _poCMI); virtual void vOnFileReset(); *************** *** 145,148 **** --- 145,149 ---- virtual void vOnImportBatteryFile(); virtual void vOnExportBatteryFile(); + virtual void vOnFileScreenCapture(); virtual void vOnFileClose(); virtual void vOnFileExit(); Index: window.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/window.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** window.cpp 5 May 2004 16:01:12 -0000 1.16 --- window.cpp 5 May 2004 19:36:31 -0000 1.17 *************** *** 132,140 **** poMI = dynamic_cast<Gtk::MenuItem *>(_poXml->get_widget("FileLoad")); ! poMI->signal_activate().connect(SigC::slot(*this, &Window::vOnLoadGame)); m_listSensitiveWhenPlaying.push_back(poMI); poMI = dynamic_cast<Gtk::MenuItem *>(_poXml->get_widget("FileSave")); ! poMI->signal_activate().connect(SigC::slot(*this, &Window::vOnSaveGame)); m_listSensitiveWhenPlaying.push_back(poMI); --- 132,140 ---- poMI = dynamic_cast<Gtk::MenuItem *>(_poXml->get_widget("FileLoad")); ! poMI->signal_activate().connect(SigC::slot(*this, &Window::vOnFileLoad)); m_listSensitiveWhenPlaying.push_back(poMI); poMI = dynamic_cast<Gtk::MenuItem *>(_poXml->get_widget("FileSave")); ! poMI->signal_activate().connect(SigC::slot(*this, &Window::vOnFileSave)); m_listSensitiveWhenPlaying.push_back(poMI); *************** *** 148,155 **** m_apoLoadGameItem[i]->signal_activate().connect(SigC::bind<int>( ! SigC::slot(*this, &Window::vOnLoadGameSlot), i + 1)); m_apoSaveGameItem[i]->signal_activate().connect(SigC::bind<int>( ! SigC::slot(*this, &Window::vOnSaveGameSlot), i + 1)); } --- 148,155 ---- m_apoLoadGameItem[i]->signal_activate().connect(SigC::bind<int>( ! SigC::slot(*this, &Window::vOnLoadGame), i + 1)); m_apoSaveGameItem[i]->signal_activate().connect(SigC::bind<int>( ! SigC::slot(*this, &Window::vOnSaveGame), i + 1)); } *************** *** 183,186 **** --- 183,190 ---- m_listSensitiveWhenPlaying.push_back(poMI); + poMI = dynamic_cast<Gtk::MenuItem *>(_poXml->get_widget("FileScreenCapture")); + poMI->signal_activate().connect(SigC::slot(*this, &Window::vOnFileScreenCapture)); + m_listSensitiveWhenPlaying.push_back(poMI); + poMI = dynamic_cast<Gtk::MenuItem *>(_poXml->get_widget("FileClose")); poMI->signal_activate().connect(SigC::slot(*this, &Window::vOnFileClose)); Index: vba.glade =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/vba.glade,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** vba.glade 5 May 2004 01:34:31 -0000 1.10 --- vba.glade 5 May 2004 19:36:31 -0000 1.11 *************** *** 51,55 **** <child internal-child="image"> ! <widget class="GtkImage" id="image114"> <property name="visible">True</property> <property name="stock">gtk-open</property> --- 51,55 ---- <child internal-child="image"> ! <widget class="GtkImage" id="image116"> <property name="visible">True</property> <property name="stock">gtk-open</property> *************** *** 461,472 **** <child> - <widget class="GtkMenuItem" id="FileRomInformation"> - <property name="visible">True</property> - <property name="label" translatable="yes">RO_M information...</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> <widget class="GtkSeparatorMenuItem" id="separator6"> <property name="visible">True</property> --- 461,464 ---- *************** *** 481,485 **** <child internal-child="image"> ! <widget class="GtkImage" id="image115"> <property name="visible">True</property> <property name="stock">gtk-close</property> --- 473,477 ---- <child internal-child="image"> ! <widget class="GtkImage" id="image117"> <property name="visible">True</property> <property name="stock">gtk-close</property> *************** *** 502,506 **** <child internal-child="image"> ! <widget class="GtkImage" id="image116"> <property name="visible">True</property> <property name="stock">gtk-quit</property> --- 494,498 ---- <child internal-child="image"> ! <widget class="GtkImage" id="image118"> <property name="visible">True</property> <property name="stock">gtk-quit</property> Index: windowcallbacks.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/windowcallbacks.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** windowcallbacks.cpp 5 May 2004 16:01:12 -0000 1.5 --- windowcallbacks.cpp 5 May 2004 19:36:31 -0000 1.6 *************** *** 139,143 **** } ! void Window::vOnLoadGame() { std::string sSaveDir = m_poDirConfig->sGetKey("saves"); --- 139,143 ---- } ! void Window::vOnFileLoad() { std::string sSaveDir = m_poDirConfig->sGetKey("saves"); *************** *** 190,194 **** } ! void Window::vOnSaveGame() { Glib::ustring sSaveDir = m_poDirConfig->sGetKey("saves"); --- 190,194 ---- } ! void Window::vOnFileSave() { Glib::ustring sSaveDir = m_poDirConfig->sGetKey("saves"); *************** *** 199,213 **** oDialog.set_transient_for(*this); - Glib::ustring sDefaultFile; if (sSaveDir == "") { ! sDefaultFile = sCutSuffix(m_sRomFile) + ".sgm"; } else { ! sDefaultFile = sSaveDir + "/" ! + sCutSuffix(Glib::path_get_basename(m_sRomFile)) + ".sgm"; } - oDialog.set_filename(sDefaultFile); #else // ! GTKMM20 --- 199,211 ---- oDialog.set_transient_for(*this); if (sSaveDir == "") { ! oDialog.set_filename(sCutSuffix(m_sRomFile)); } else { ! oDialog.set_filename(sSaveDir + "/" + ! sCutSuffix(Glib::path_get_basename(m_sRomFile))); } #else // ! GTKMM20 *************** *** 227,231 **** oDialog.add_shortcut_folder(sSaveDir); } ! oDialog.set_current_name(sCutSuffix(Glib::path_get_basename(m_sRomFile)) + ".sgm"); Gtk::FileFilter oSaveFilter; --- 225,229 ---- oDialog.add_shortcut_folder(sSaveDir); } ! oDialog.set_current_name(sCutSuffix(Glib::path_get_basename(m_sRomFile))); Gtk::FileFilter oSaveFilter; *************** *** 284,288 **** if (iMostRecent >= 0) { ! vOnLoadGameSlot(iMostRecent + 1); } } --- 282,286 ---- if (iMostRecent >= 0) { ! vOnLoadGame(iMostRecent + 1); } } *************** *** 293,297 **** } ! void Window::vOnLoadGameSlot(int _iSlot) { int i = _iSlot - 1; --- 291,295 ---- } ! void Window::vOnLoadGame(int _iSlot) { int i = _iSlot - 1; *************** *** 320,332 **** if (iOldest >= 0) { ! vOnSaveGameSlot(iOldest + 1); } else { ! vOnSaveGameSlot(1); } } ! void Window::vOnSaveGameSlot(int _iSlot) { int i = _iSlot - 1; --- 318,330 ---- if (iOldest >= 0) { ! vOnSaveGame(iOldest + 1); } else { ! vOnSaveGame(1); } } ! void Window::vOnSaveGame(int _iSlot) { int i = _iSlot - 1; *************** *** 464,472 **** if (sBatteryDir == "") { ! oDialog.set_filename(Glib::path_get_dirname(m_sRomFile) + "/"); } else { ! oDialog.set_filename(sBatteryDir + "/"); } --- 462,471 ---- if (sBatteryDir == "") { ! oDialog.set_filename(sCutSuffix(m_sRomFile)); } else { ! oDialog.set_filename(sBatteryDir + "/" + ! sCutSuffix(Glib::path_get_basename(m_sRomFile))); } *************** *** 487,490 **** --- 486,490 ---- oDialog.add_shortcut_folder(sBatteryDir); } + oDialog.set_current_name(sCutSuffix(Glib::path_get_basename(m_sRomFile))); Gtk::FileFilter oBatteryFilter; *************** *** 565,568 **** --- 565,677 ---- } + void Window::vOnFileScreenCapture() + { + std::string sCaptureDir = m_poDirConfig->sGetKey("captures"); + + #ifdef GTKMM20 + + Gtk::FileSelection oDialog(_("Save screenshot")); + oDialog.set_transient_for(*this); + + if (sCaptureDir == "") + { + oDialog.set_filename(sCutSuffix(m_sRomFile)); + } + else + { + oDialog.set_filename(sCaptureDir + "/" + + sCutSuffix(Glib::path_get_basename(m_sRomFile))); + } + + #else // ! GTKMM20 + + Gtk::FileChooserDialog oDialog(*this, _("Save screenshot"), + Gtk::FILE_CHOOSER_ACTION_SAVE); + oDialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); + oDialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK); + + if (sCaptureDir == "") + { + oDialog.set_current_folder(Glib::path_get_dirname(m_sRomFile)); + } + else + { + oDialog.set_current_folder(sCaptureDir); + oDialog.add_shortcut_folder(sCaptureDir); + } + oDialog.set_current_name(sCutSuffix(Glib::path_get_basename(m_sRomFile))); + + Gtk::FileFilter oPngFilter; + oPngFilter.set_name(_("PNG image")); + oPngFilter.add_pattern("*.[pP][nN][gG]"); + + Gtk::FileFilter oBmpFilter; + oBmpFilter.set_name(_("BMP image")); + oBmpFilter.add_pattern("*.[bB][mM][pP]"); + + oDialog.add_filter(oPngFilter); + oDialog.add_filter(oBmpFilter); + + #endif // ! GTKMM20 + + while (oDialog.run() == Gtk::RESPONSE_OK) + { + Glib::ustring sFile = oDialog.get_filename(); + Glib::ustring sExt; + + #ifdef GTKMM20 + + sExt = ".png"; + + #else // ! GTKMM20 + + if (oDialog.get_filter() == &oPngFilter) + { + sExt = ".png"; + } + else + { + sExt = ".bmp"; + } + + #endif // ! GTKMM20 + + if (! bHasSuffix(sFile, sExt, false)) + { + sFile += sExt; + } + + if (Glib::file_test(sFile, Glib::FILE_TEST_EXISTS)) + { + Gtk::MessageDialog oConfirmDialog(*this, + _("File already exists. Overwrite it?"), + #ifndef GTKMM20 + false, + #endif // ! GTKMM20 + Gtk::MESSAGE_QUESTION, + Gtk::BUTTONS_YES_NO); + if (oConfirmDialog.run() != Gtk::RESPONSE_YES) + { + continue; + } + } + + bool bResult; + if (sExt == ".png") + { + bResult = m_stEmulator.emuWritePNG(sFile.c_str()); + } + else + { + bResult = m_stEmulator.emuWriteBMP(sFile.c_str()); + } + + if (bResult) + { + break; + } + } + } + void Window::vOnFileClose() { |
From: S?bastien G. <kx...@us...> - 2004-05-05 16:01:21
|
Update of /cvsroot/vba/VisualBoyAdvance/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17105/src Modified Files: Cheats.cpp GBA.cpp NLS.h RTC.cpp Util.cpp elf.cpp Log Message: Extended the gettext support to the core. Minor fixes. French translation is now almost complete. Index: Util.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/Util.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Util.cpp 23 Jan 2004 11:42:03 -0000 1.20 --- Util.cpp 5 May 2004 16:01:11 -0000 1.21 *************** *** 59,63 **** if(!fp) { ! systemMessage(MSG_ERROR_CREATING_FILE, "Error creating file %s", fileName); return false; } --- 59,63 ---- if(!fp) { ! systemMessage(MSG_ERROR_CREATING_FILE, N_("Error creating file %s"), fileName); return false; } *************** *** 268,272 **** if(!fp) { ! systemMessage(MSG_ERROR_CREATING_FILE, "Error creating file %s", fileName); return false; } --- 268,272 ---- if(!fp) { ! systemMessage(MSG_ERROR_CREATING_FILE, N_("Error creating file %s"), fileName); return false; } *************** *** 586,590 **** if(unz == NULL) { ! systemMessage(MSG_CANNOT_OPEN_FILE, "Cannot open file %s", file); return IMAGE_UNKNOWN; } --- 586,590 ---- if(unz == NULL) { ! systemMessage(MSG_CANNOT_OPEN_FILE, N_("Cannot open file %s"), file); return IMAGE_UNKNOWN; } *************** *** 594,598 **** if(r != UNZ_OK) { unzClose(unz); ! systemMessage(MSG_BAD_ZIP_FILE, "Bad ZIP file %s", file); return IMAGE_UNKNOWN; } --- 594,598 ---- if(r != UNZ_OK) { unzClose(unz); ! systemMessage(MSG_BAD_ZIP_FILE, N_("Bad ZIP file %s"), file); return IMAGE_UNKNOWN; } *************** *** 614,618 **** if(r != UNZ_OK) { unzClose(unz); ! systemMessage(MSG_BAD_ZIP_FILE,"Bad ZIP file %s", file); return IMAGE_UNKNOWN; } --- 614,618 ---- if(r != UNZ_OK) { unzClose(unz); ! systemMessage(MSG_BAD_ZIP_FILE, N_("Bad ZIP file %s"), file); return IMAGE_UNKNOWN; } *************** *** 637,641 **** if(found == IMAGE_UNKNOWN) { systemMessage(MSG_NO_IMAGE_ON_ZIP, ! "No image found on ZIP file %s", file); return found; } --- 637,641 ---- if(found == IMAGE_UNKNOWN) { systemMessage(MSG_NO_IMAGE_ON_ZIP, ! N_("No image found on ZIP file %s"), file); return found; } *************** *** 698,702 **** if(unz == NULL) { ! systemMessage(MSG_CANNOT_OPEN_FILE, "Cannot open file %s", file); return NULL; } --- 698,702 ---- if(unz == NULL) { ! systemMessage(MSG_CANNOT_OPEN_FILE, N_("Cannot open file %s"), file); return NULL; } *************** *** 705,709 **** if(r != UNZ_OK) { unzClose(unz); ! systemMessage(MSG_BAD_ZIP_FILE, "Bad ZIP file %s", file); return NULL; } --- 705,709 ---- if(r != UNZ_OK) { unzClose(unz); ! systemMessage(MSG_BAD_ZIP_FILE, N_("Bad ZIP file %s"), file); return NULL; } *************** *** 725,729 **** if(r != UNZ_OK) { unzClose(unz); ! systemMessage(MSG_BAD_ZIP_FILE,"Bad ZIP file %s", file); return NULL; } --- 725,729 ---- if(r != UNZ_OK) { unzClose(unz); ! systemMessage(MSG_BAD_ZIP_FILE, N_("Bad ZIP file %s"), file); return NULL; } *************** *** 743,747 **** unzClose(unz); systemMessage(MSG_NO_IMAGE_ON_ZIP, ! "No image found on ZIP file %s", file); return NULL; } --- 743,747 ---- unzClose(unz); systemMessage(MSG_NO_IMAGE_ON_ZIP, ! N_("No image found on ZIP file %s"), file); return NULL; } *************** *** 754,758 **** if(r != UNZ_OK) { unzClose(unz); ! systemMessage(MSG_ERROR_OPENING_IMAGE,"Error opening image %s", buffer); return NULL; } --- 754,758 ---- if(r != UNZ_OK) { unzClose(unz); ! systemMessage(MSG_ERROR_OPENING_IMAGE, N_("Error opening image %s"), buffer); return NULL; } *************** *** 765,769 **** unzCloseCurrentFile(unz); unzClose(unz); ! systemMessage(MSG_OUT_OF_MEMORY, "Failed to allocate memory for %s", "data"); return NULL; --- 765,769 ---- unzCloseCurrentFile(unz); unzClose(unz); ! systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"), "data"); return NULL; *************** *** 781,785 **** if(r != (int)read) { systemMessage(MSG_ERROR_READING_IMAGE, ! "Error reading image %s", buffer); if(data == NULL) free(image); --- 781,785 ---- if(r != (int)read) { systemMessage(MSG_ERROR_READING_IMAGE, ! N_("Error reading image %s"), buffer); if(data == NULL) free(image); *************** *** 800,804 **** if(f == NULL) { ! systemMessage(MSG_ERROR_OPENING_IMAGE, "Error opening image %s", file); return NULL; } --- 800,804 ---- if(f == NULL) { ! systemMessage(MSG_ERROR_OPENING_IMAGE, N_("Error opening image %s"), file); return NULL; } *************** *** 814,818 **** if(gz == NULL) { // should not happen, but who knows? ! systemMessage(MSG_ERROR_OPENING_IMAGE, "Error opening image %s", file); return NULL; } --- 814,818 ---- if(gz == NULL) { // should not happen, but who knows? ! systemMessage(MSG_ERROR_OPENING_IMAGE, N_("Error opening image %s"), file); return NULL; } *************** *** 823,827 **** image = (u8 *)malloc(utilGetSize(size)); if(image == NULL) { ! systemMessage(MSG_OUT_OF_MEMORY, "Failed to allocate memory for %s", "data"); fclose(f); --- 823,827 ---- image = (u8 *)malloc(utilGetSize(size)); if(image == NULL) { ! systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"), "data"); fclose(f); *************** *** 836,840 **** if(r != (int)read) { systemMessage(MSG_ERROR_READING_IMAGE, ! "Error reading image %s", file); if(data == NULL) free(image); --- 836,840 ---- if(r != (int)read) { systemMessage(MSG_ERROR_READING_IMAGE, ! N_("Error reading image %s"), file); if(data == NULL) free(image); *************** *** 875,879 **** if(!r) { systemMessage(MSG_ERROR_READING_IMAGE, ! "Error reading image %s", buffer); urarlib_freelist(rarList); return NULL; --- 875,879 ---- if(!r) { systemMessage(MSG_ERROR_READING_IMAGE, ! N_("Error reading image %s"), buffer); urarlib_freelist(rarList); return NULL; *************** *** 887,891 **** } systemMessage(MSG_NO_IMAGE_ON_ZIP, ! "No image found on RAR file %s", file); urarlib_freelist(rarList); return NULL; --- 887,891 ---- } systemMessage(MSG_NO_IMAGE_ON_ZIP, ! N_("No image found on RAR file %s"), file); urarlib_freelist(rarList); return NULL; *************** *** 918,922 **** if(!f) { ! systemMessage(MSG_ERROR_OPENING_IMAGE, "Error opening image %s", file); return NULL; } --- 918,922 ---- if(!f) { ! systemMessage(MSG_ERROR_OPENING_IMAGE, N_("Error opening image %s"), file); return NULL; } *************** *** 931,935 **** image = (u8 *)malloc(utilGetSize(size)); if(image == NULL) { ! systemMessage(MSG_OUT_OF_MEMORY, "Failed to allocate memory for %s", "data"); fclose(f); --- 931,935 ---- image = (u8 *)malloc(utilGetSize(size)); if(image == NULL) { ! systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"), "data"); fclose(f); *************** *** 944,948 **** if(r != (int)read) { systemMessage(MSG_ERROR_READING_IMAGE, ! "Error reading image %s", file); if(data == NULL) free(image); --- 944,948 ---- if(r != (int)read) { systemMessage(MSG_ERROR_READING_IMAGE, ! N_("Error reading image %s"), file); if(data == NULL) free(image); Index: RTC.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/RTC.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RTC.cpp 31 Jan 2004 21:43:43 -0000 1.5 --- RTC.cpp 5 May 2004 16:01:11 -0000 1.6 *************** *** 22,25 **** --- 22,26 ---- #include "Port.h" #include "Util.h" + #include "NLS.h" #include <time.h> *************** *** 154,158 **** break; default: ! systemMessage(0, "Unknown RTC command %02x", rtcClockData.command); rtcClockData.state = IDLE; break; --- 155,159 ---- break; default: ! systemMessage(0, N_("Unknown RTC command %02x"), rtcClockData.command); rtcClockData.state = IDLE; break; Index: NLS.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/NLS.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NLS.h 26 Nov 2002 21:27:44 -0000 1.2 --- NLS.h 5 May 2004 16:01:11 -0000 1.3 *************** *** 17,20 **** --- 17,23 ---- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + #define N_(String) (String) + #define MSG_UNSUPPORTED_VBA_SGM 1 #define MSG_CANNOT_LOAD_SGM 2 Index: Cheats.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/Cheats.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Cheats.cpp 24 Feb 2004 10:40:23 -0000 1.18 --- Cheats.cpp 5 May 2004 16:01:11 -0000 1.19 *************** *** 651,660 **** int len = strlen(code); if(len != 11 && len != 13 && len != 17) { ! systemMessage(MSG_INVALID_CHEAT_CODE, "Invalid cheat code '%s'", code); return false; } if(code[8] != ':') { ! systemMessage(MSG_INVALID_CHEAT_CODE, "Invalid cheat code '%s'", code); return false; } --- 651,660 ---- int len = strlen(code); if(len != 11 && len != 13 && len != 17) { ! systemMessage(MSG_INVALID_CHEAT_CODE, N_("Invalid cheat code '%s'"), code); return false; } if(code[8] != ':') { ! systemMessage(MSG_INVALID_CHEAT_CODE, N_("Invalid cheat code '%s'"), code); return false; } *************** *** 665,669 **** // wrong cheat systemMessage(MSG_INVALID_CHEAT_CODE, ! "Invalid cheat code '%s'", code); return false; } --- 665,669 ---- // wrong cheat systemMessage(MSG_INVALID_CHEAT_CODE, ! N_("Invalid cheat code '%s'"), code); return false; } *************** *** 673,677 **** // wrong cheat systemMessage(MSG_INVALID_CHEAT_CODE, ! "Invalid cheat code '%s'", code); return false; } --- 673,677 ---- // wrong cheat systemMessage(MSG_INVALID_CHEAT_CODE, ! N_("Invalid cheat code '%s'"), code); return false; } *************** *** 692,696 **** default: systemMessage(MSG_INVALID_CHEAT_CODE_ADDRESS, ! "Invalid cheat code address: %08x", address); return false; --- 692,696 ---- default: systemMessage(MSG_INVALID_CHEAT_CODE_ADDRESS, ! N_("Invalid cheat code address: %08x"), address); return false; *************** *** 736,740 **** // wrong cheat systemMessage(MSG_INVALID_GSA_CODE, ! "Invalid GSA code. Format is XXXXXXXXYYYYYYYY"); return; } --- 736,740 ---- // wrong cheat systemMessage(MSG_INVALID_GSA_CODE, ! N_("Invalid GSA code. Format is XXXXXXXXYYYYYYYY")); return; } *************** *** 745,749 **** // wrong cheat systemMessage(MSG_INVALID_GSA_CODE, ! "Invalid GSA code. Format is XXXXXXXXYYYYYYYY"); return; } --- 745,749 ---- // wrong cheat systemMessage(MSG_INVALID_GSA_CODE, ! N_("Invalid GSA code. Format is XXXXXXXXYYYYYYYY")); return; } *************** *** 771,775 **** *((u32 *)buffer2) = READ32LE(((u32 *)&rom[0xac])); buffer2[4] = 0; ! systemMessage(MSG_GBA_CODE_WARNING, "Warning: cheats are for game %s. Current game is %s.\nCodes may not work correctly.", buffer, buffer2); } --- 771,775 ---- *((u32 *)buffer2) = READ32LE(((u32 *)&rom[0xac])); buffer2[4] = 0; ! systemMessage(MSG_GBA_CODE_WARNING, N_("Warning: cheats are for game %s. Current game is %s.\nCodes may not work correctly."), buffer, buffer2); } *************** *** 1305,1309 **** // wrong cheat systemMessage(MSG_INVALID_CBA_CODE, ! "Invalid CBA code. Format is XXXXXXXX YYYY."); return; } --- 1305,1309 ---- // wrong cheat systemMessage(MSG_INVALID_CBA_CODE, ! N_("Invalid CBA code. Format is XXXXXXXX YYYY.")); return; } *************** *** 1314,1318 **** // wrong cheat systemMessage(MSG_INVALID_CBA_CODE, ! "Invalid CBA code. Format is XXXXXXXX YYYY."); return; } --- 1314,1318 ---- // wrong cheat systemMessage(MSG_INVALID_CBA_CODE, ! N_("Invalid CBA code. Format is XXXXXXXX YYYY.")); return; } *************** *** 1321,1325 **** if(code[8] != ' ') { systemMessage(MSG_INVALID_CBA_CODE, ! "Invalid CBA code. Format is XXXXXXXX YYYY."); return; } --- 1321,1325 ---- if(code[8] != ' ') { systemMessage(MSG_INVALID_CBA_CODE, ! N_("Invalid CBA code. Format is XXXXXXXX YYYY.")); return; } *************** *** 1329,1333 **** // wrong cheat systemMessage(MSG_INVALID_CBA_CODE, ! "Invalid CBA code. Format is XXXXXXXX YYYY."); return; } --- 1329,1333 ---- // wrong cheat systemMessage(MSG_INVALID_CBA_CODE, ! N_("Invalid CBA code. Format is XXXXXXXX YYYY.")); return; } *************** *** 1383,1387 **** if(crc != address) { systemMessage(MSG_CBA_CODE_WARNING, ! "Warning: Codes seem to be for a different game.\nCodes may not work correctly."); } cheatsAdd(code, desc, address & 0x0FFFFFFF, value, 512, --- 1383,1387 ---- if(crc != address) { systemMessage(MSG_CBA_CODE_WARNING, ! N_("Warning: Codes seem to be for a different game.\nCodes may not work correctly.")); } cheatsAdd(code, desc, address & 0x0FFFFFFF, value, 512, *************** *** 1543,1547 **** if(version != 1) { systemMessage(MSG_UNSUPPORTED_CHEAT_LIST_VERSION, ! "Unsupported cheat list version %d", version); fclose(f); return false; --- 1543,1547 ---- if(version != 1) { systemMessage(MSG_UNSUPPORTED_CHEAT_LIST_VERSION, ! N_("Unsupported cheat list version %d"), version); fclose(f); return false; *************** *** 1556,1560 **** if(type != 0) { systemMessage(MSG_UNSUPPORTED_CHEAT_LIST_TYPE, ! "Unsupported cheat list type %d", type); fclose(f); return false; --- 1556,1560 ---- if(type != 0) { systemMessage(MSG_UNSUPPORTED_CHEAT_LIST_TYPE, ! N_("Unsupported cheat list type %d"), type); fclose(f); return false; Index: elf.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/elf.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** elf.cpp 3 May 2004 16:58:35 -0000 1.16 --- elf.cpp 5 May 2004 16:01:11 -0000 1.17 *************** *** 2812,2816 **** READ16LE(&header->e_machine) != 40 || header->clazz != 1) { ! systemMessage(0, "Not a valid ELF file %s", name); free(elfFileData); elfFileData = NULL; --- 2812,2816 ---- READ16LE(&header->e_machine) != 40 || header->clazz != 1) { ! systemMessage(0, N_("Not a valid ELF file %s"), name); free(elfFileData); elfFileData = NULL; Index: GBA.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/GBA.cpp,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** GBA.cpp 20 Mar 2004 00:18:33 -0000 1.53 --- GBA.cpp 5 May 2004 16:01:11 -0000 1.54 *************** *** 662,666 **** if(gzFile == NULL) { ! systemMessage(MSG_ERROR_CREATING_FILE, "Error creating file %s", file); return false; } --- 662,666 ---- if(gzFile == NULL) { ! systemMessage(MSG_ERROR_CREATING_FILE, N_("Error creating file %s"), file); return false; } *************** *** 699,703 **** if(version > SAVE_GAME_VERSION || version < SAVE_GAME_VERSION_1) { systemMessage(MSG_UNSUPPORTED_VBA_SGM, ! "Unsupported VisualBoyAdvance save game version %d", version); return false; --- 699,703 ---- if(version > SAVE_GAME_VERSION || version < SAVE_GAME_VERSION_1) { systemMessage(MSG_UNSUPPORTED_VBA_SGM, ! N_("Unsupported VisualBoyAdvance save game version %d"), version); return false; *************** *** 713,717 **** if(romname[i] < 32) romname[i] = 32; ! systemMessage(MSG_CANNOT_LOAD_SGM,"Cannot load save game for %s", romname); return false; } --- 713,717 ---- if(romname[i] < 32) romname[i] = 32; ! systemMessage(MSG_CANNOT_LOAD_SGM, N_("Cannot load save game for %s"), romname); return false; } *************** *** 722,729 **** if(useBios) systemMessage(MSG_SAVE_GAME_NOT_USING_BIOS, ! "Save game is not using the BIOS files"); else systemMessage(MSG_SAVE_GAME_USING_BIOS, ! "Save game is using the BIOS file"); return false; } --- 722,729 ---- if(useBios) systemMessage(MSG_SAVE_GAME_NOT_USING_BIOS, ! N_("Save game is not using the BIOS files")); else systemMessage(MSG_SAVE_GAME_USING_BIOS, ! N_("Save game is using the BIOS file")); return false; } *************** *** 805,809 **** default: systemMessage(MSG_UNSUPPORTED_SAVE_TYPE, ! "Unsupported save type %d", saveType); break; } --- 805,809 ---- default: systemMessage(MSG_UNSUPPORTED_SAVE_TYPE, ! N_("Unsupported save type %d"), saveType); break; } *************** *** 847,851 **** if(!file) { ! systemMessage(MSG_ERROR_CREATING_FILE, "Error creating file %s", fileName); return false; --- 847,851 ---- if(!file) { ! systemMessage(MSG_ERROR_CREATING_FILE, N_("Error creating file %s"), fileName); return false; *************** *** 885,889 **** if(!file) { ! systemMessage(MSG_ERROR_CREATING_FILE, "Error creating file %s", fileName); return false; --- 885,889 ---- if(!file) { ! systemMessage(MSG_ERROR_CREATING_FILE, N_("Error creating file %s"), fileName); return false; *************** *** 920,924 **** if(!file) { ! systemMessage(MSG_CANNOT_OPEN_FILE, "Cannot open file %s", fileName); return false; } --- 920,924 ---- if(!file) { ! systemMessage(MSG_CANNOT_OPEN_FILE, N_("Cannot open file %s"), fileName); return false; } *************** *** 955,959 **** if(memcmp(buffer, buffer2, 16)) { systemMessage(MSG_CANNOT_IMPORT_SNAPSHOT_FOR, ! "Cannot import snapshot for %s. Current game is %s", buffer, buffer2); --- 955,959 ---- if(memcmp(buffer, buffer2, 16)) { systemMessage(MSG_CANNOT_IMPORT_SNAPSHOT_FOR, ! N_("Cannot import snapshot for %s. Current game is %s"), buffer, buffer2); *************** *** 969,973 **** } else { systemMessage(MSG_UNSUPPORTED_SNAPSHOT_FILE, ! "Unsupported snapshot file %s", fileName); fclose(file); --- 969,973 ---- } else { systemMessage(MSG_UNSUPPORTED_SNAPSHOT_FILE, ! N_("Unsupported snapshot file %s"), fileName); fclose(file); *************** *** 987,991 **** if(!file) { ! systemMessage(MSG_CANNOT_OPEN_FILE, "Cannot open file %s", fileName); return false; } --- 987,991 ---- if(!file) { ! systemMessage(MSG_CANNOT_OPEN_FILE, N_("Cannot open file %s"), fileName); return false; } *************** *** 1272,1276 **** rom = (u8 *)malloc(0x2000000); if(rom == NULL) { ! systemMessage(MSG_OUT_OF_MEMORY, "Failed to allocate memory for %s", "ROM"); return 0; --- 1272,1276 ---- rom = (u8 *)malloc(0x2000000); if(rom == NULL) { ! systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"), "ROM"); return 0; *************** *** 1278,1282 **** workRAM = (u8 *)calloc(1, 0x40000); if(workRAM == NULL) { ! systemMessage(MSG_OUT_OF_MEMORY, "Failed to allocate memory for %s", "WRAM"); return 0; --- 1278,1282 ---- workRAM = (u8 *)calloc(1, 0x40000); if(workRAM == NULL) { ! systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"), "WRAM"); return 0; *************** *** 1290,1294 **** FILE *f = fopen(szFile, "rb"); if(!f) { ! systemMessage(MSG_ERROR_OPENING_IMAGE, "Error opening image %s", szFile); free(rom); --- 1290,1294 ---- FILE *f = fopen(szFile, "rb"); if(!f) { ! systemMessage(MSG_ERROR_OPENING_IMAGE, N_("Error opening image %s"), szFile); free(rom); *************** *** 1327,1331 **** bios = (u8 *)calloc(1,0x4000); if(bios == NULL) { ! systemMessage(MSG_OUT_OF_MEMORY, "Failed to allocate memory for %s", "BIOS"); CPUCleanUp(); --- 1327,1331 ---- bios = (u8 *)calloc(1,0x4000); if(bios == NULL) { ! systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"), "BIOS"); CPUCleanUp(); *************** *** 1334,1338 **** internalRAM = (u8 *)calloc(1,0x8000); if(internalRAM == NULL) { ! systemMessage(MSG_OUT_OF_MEMORY, "Failed to allocate memory for %s", "IRAM"); CPUCleanUp(); --- 1334,1338 ---- internalRAM = (u8 *)calloc(1,0x8000); if(internalRAM == NULL) { ! systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"), "IRAM"); CPUCleanUp(); *************** *** 1341,1345 **** paletteRAM = (u8 *)calloc(1,0x400); if(paletteRAM == NULL) { ! systemMessage(MSG_OUT_OF_MEMORY, "Failed to allocate memory for %s", "PRAM"); CPUCleanUp(); --- 1341,1345 ---- paletteRAM = (u8 *)calloc(1,0x400); if(paletteRAM == NULL) { ! systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"), "PRAM"); CPUCleanUp(); *************** *** 1348,1352 **** vram = (u8 *)calloc(1, 0x20000); if(vram == NULL) { ! systemMessage(MSG_OUT_OF_MEMORY, "Failed to allocate memory for %s", "VRAM"); CPUCleanUp(); --- 1348,1352 ---- vram = (u8 *)calloc(1, 0x20000); if(vram == NULL) { ! systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"), "VRAM"); CPUCleanUp(); *************** *** 1355,1359 **** oam = (u8 *)calloc(1, 0x400); if(oam == NULL) { ! systemMessage(MSG_OUT_OF_MEMORY, "Failed to allocate memory for %s", "OAM"); CPUCleanUp(); --- 1355,1359 ---- oam = (u8 *)calloc(1, 0x400); if(oam == NULL) { ! systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"), "OAM"); CPUCleanUp(); *************** *** 1362,1366 **** pix = (u8 *)calloc(1, 4 * 241 * 162); if(pix == NULL) { ! systemMessage(MSG_OUT_OF_MEMORY, "Failed to allocate memory for %s", "PIX"); CPUCleanUp(); --- 1362,1366 ---- pix = (u8 *)calloc(1, 4 * 241 * 162); if(pix == NULL) { ! systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"), "PIX"); CPUCleanUp(); *************** *** 1369,1373 **** ioMem = (u8 *)calloc(1, 0x400); if(ioMem == NULL) { ! systemMessage(MSG_OUT_OF_MEMORY, "Failed to allocate memory for %s", "IO"); CPUCleanUp(); --- 1369,1373 ---- ioMem = (u8 *)calloc(1, 0x400); if(ioMem == NULL) { ! systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"), "IO"); CPUCleanUp(); *************** *** 1604,1608 **** break; default: ! systemMessage(MSG_UNSUPPORTED_ARM_MODE,"Unsupported ARM mode %02x", mode); break; } --- 1604,1608 ---- break; default: ! systemMessage(MSG_UNSUPPORTED_ARM_MODE, N_("Unsupported ARM mode %02x"), mode); break; } *************** *** 1837,1841 **** if(!disableMessage) { systemMessage(MSG_UNSUPPORTED_BIOS_FUNCTION, ! "Unsupported BIOS function %02x called from %08x. A BIOS file is needed in order to get correct behaviour.", comment, armMode ? armNextPC - 4: armNextPC - 2); --- 1837,1841 ---- if(!disableMessage) { systemMessage(MSG_UNSUPPORTED_BIOS_FUNCTION, ! N_("Unsupported BIOS function %02x called from %08x. A BIOS file is needed in order to get correct behaviour."), comment, armMode ? armNextPC - 4: armNextPC - 2); *************** *** 2945,2949 **** useBios = true; else ! systemMessage(MSG_INVALID_BIOS_FILE_SIZE, "Invalid BIOS file size"); } } --- 2945,2949 ---- useBios = true; else ! systemMessage(MSG_INVALID_BIOS_FILE_SIZE, N_("Invalid BIOS file size")); } } |
From: S?bastien G. <kx...@us...> - 2004-05-05 16:01:21
|
Update of /cvsroot/vba/VisualBoyAdvance/src/gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17105/src/gtk Modified Files: intl.h main.cpp system.cpp window.cpp window.h windowcallbacks.cpp Log Message: Extended the gettext support to the core. Minor fixes. French translation is now almost complete. Index: main.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/main.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** main.cpp 1 May 2004 14:03:59 -0000 1.3 --- main.cpp 5 May 2004 16:01:12 -0000 1.4 *************** *** 49,53 **** #endif // ! GTKMM20 Gtk::MESSAGE_ERROR, ! Gtk::BUTTONS_CLOSE); oDialog.run(); return 1; --- 49,53 ---- #endif // ! GTKMM20 Gtk::MESSAGE_ERROR, ! Gtk::BUTTONS_OK); oDialog.run(); return 1; Index: system.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/system.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** system.cpp 1 May 2004 14:03:59 -0000 1.6 --- system.cpp 5 May 2004 16:01:12 -0000 1.7 *************** *** 31,34 **** --- 31,35 ---- #include "window.h" + #include "intl.h" // Required vars, used by the emulator core *************** *** 74,88 **** va_list args; va_start(args, _csFormat); - char * csMsg = g_strdup_vprintf(_csFormat, args); - va_end(args); ! Gtk::MessageDialog oDialog(*GUI(), csMsg, ! #ifndef GTKMM20 ! false, ! #endif // ! GTKMM20 ! Gtk::MESSAGE_ERROR, ! Gtk::BUTTONS_OK); ! oDialog.run(); ! free(csMsg); } --- 75,82 ---- va_list args; va_start(args, _csFormat); ! GUI()->vPopupErrorV(_(_csFormat), args); ! ! va_end(args); } Index: intl.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/intl.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** intl.h 29 Mar 2004 22:08:40 -0000 1.1 --- intl.h 5 May 2004 16:01:12 -0000 1.2 *************** *** 1,26 **** // -*- C++ -*- ! /* ! * VisualBoyAdvanced - Nintendo Gameboy/GameboyAdvance (TM) emulator ! * Copyrigh(c) 1999-2002 Forgotten (vb...@em...) ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ #ifndef __VBA_INTL_H__ #define __VBA_INTL_H__ - #ifndef GETTEXT_PACKAGE # error "GETTEXT_PACKAGE must be defined" --- 1,24 ---- // -*- C++ -*- ! // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. ! // Copyright (C) 1999-2003 Forgotten ! // Copyright (C) 2004 Forgotten and the VBA development team ! ! // This program is free software; you can redistribute it and/or modify ! // it under the terms of the GNU General Public License as published by ! // the Free Software Foundation; either version 2, or(at your option) ! // any later version. ! // ! // This program is distributed in the hope that it will be useful, ! // but WITHOUT ANY WARRANTY; without even the implied warranty of ! // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! // GNU General Public License for more details. ! // ! // You should have received a copy of the GNU General Public License ! // along with this program; if not, write to the Free Software Foundation, ! // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef __VBA_INTL_H__ #define __VBA_INTL_H__ #ifndef GETTEXT_PACKAGE # error "GETTEXT_PACKAGE must be defined" Index: window.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/window.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** window.h 5 May 2004 01:34:31 -0000 1.15 --- window.h 5 May 2004 16:01:12 -0000 1.16 *************** *** 22,25 **** --- 22,26 ---- #include <sys/types.h> + #include <stdarg.h> #include <libglademm.h> *************** *** 67,70 **** --- 68,73 ---- const int m_iGBAScreenHeight; + void vPopupError(const char * _csFormat, ...); + void vPopupErrorV(const char * _csFormat, va_list _args); void vDrawScreen(); void vComputeFrameskip(int _iRate); Index: window.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/window.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** window.cpp 5 May 2004 01:34:31 -0000 1.15 --- window.cpp 5 May 2004 16:01:12 -0000 1.16 *************** *** 1060,1071 **** catch (const Glib::Error & e) { ! Gtk::MessageDialog oDialog(*this, ! e.what(), ! #ifndef GTKMM20 ! false, ! #endif // ! GTKMM20 ! Gtk::MESSAGE_ERROR, ! Gtk::BUTTONS_CLOSE); ! oDialog.run(); } } --- 1060,1064 ---- catch (const Glib::Error & e) { ! vPopupError(e.what().c_str()); } } *************** *** 1079,1090 **** catch (const Glib::Error & e) { ! Gtk::MessageDialog oDialog(*this, ! e.what(), ! #ifndef GTKMM20 ! false, ! #endif // ! GTKMM20 ! Gtk::MESSAGE_ERROR, ! Gtk::BUTTONS_CLOSE); ! oDialog.run(); } } --- 1072,1076 ---- catch (const Glib::Error & e) { ! vPopupError(e.what().c_str()); } } *************** *** 1234,1237 **** --- 1220,1256 ---- } + void Window::vPopupError(const char * _csFormat, ...) + { + va_list args; + va_start(args, _csFormat); + char * csMsg = g_strdup_vprintf(_csFormat, args); + va_end(args); + + Gtk::MessageDialog oDialog(*this, + csMsg, + #ifndef GTKMM20 + false, + #endif // ! GTKMM20 + Gtk::MESSAGE_ERROR, + Gtk::BUTTONS_OK); + oDialog.run(); + g_free(csMsg); + } + + void Window::vPopupErrorV(const char * _csFormat, va_list _args) + { + char * csMsg = g_strdup_vprintf(_csFormat, _args); + + Gtk::MessageDialog oDialog(*this, + csMsg, + #ifndef GTKMM20 + false, + #endif // ! GTKMM20 + Gtk::MESSAGE_ERROR, + Gtk::BUTTONS_OK); + oDialog.run(); + g_free(csMsg); + } + void Window::vDrawScreen() { *************** *** 1394,1398 **** if (! bLoaded) { - systemMessage(0, _("Failed to load file %s"), csFile); return false; } --- 1413,1416 ---- Index: windowcallbacks.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/windowcallbacks.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** windowcallbacks.cpp 5 May 2004 01:34:31 -0000 1.4 --- windowcallbacks.cpp 5 May 2004 16:01:12 -0000 1.5 *************** *** 381,385 **** void Window::vOnImportBatteryFile() { ! std::string sSaveDir = m_poDirConfig->sGetKey("saves"); #ifdef GTKMM20 --- 381,385 ---- void Window::vOnImportBatteryFile() { ! std::string BatteryDir = m_poDirConfig->sGetKey("batteries"); #ifdef GTKMM20 *************** *** 388,392 **** oDialog.set_transient_for(*this); ! if (sSaveDir == "") { oDialog.set_filename(Glib::path_get_dirname(m_sRomFile) + "/"); --- 388,392 ---- oDialog.set_transient_for(*this); ! if (BatteryDir == "") { oDialog.set_filename(Glib::path_get_dirname(m_sRomFile) + "/"); *************** *** 394,398 **** else { ! oDialog.set_filename(sSaveDir + "/"); } --- 394,398 ---- else { ! oDialog.set_filename(BatteryDir + "/"); } *************** *** 403,407 **** oDialog.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK); ! if (sSaveDir == "") { oDialog.set_current_folder(Glib::path_get_dirname(m_sRomFile)); --- 403,407 ---- oDialog.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK); ! if (BatteryDir == "") { oDialog.set_current_folder(Glib::path_get_dirname(m_sRomFile)); *************** *** 409,414 **** else { ! oDialog.set_current_folder(sSaveDir); ! oDialog.add_shortcut_folder(sSaveDir); } --- 409,414 ---- else { ! oDialog.set_current_folder(BatteryDir); ! oDialog.add_shortcut_folder(BatteryDir); } *************** *** 447,458 **** else { ! Gtk::MessageDialog oErrorDialog(*this, ! _("Importing the battery file failed."), ! #ifndef GTKMM20 ! false, ! #endif // ! GTKMM20 ! Gtk::MESSAGE_ERROR, ! Gtk::BUTTONS_CLOSE); ! oErrorDialog.run(); } } --- 447,452 ---- else { ! vPopupError(_("Failed to import battery file %s."), ! oDialog.get_filename().c_str()); } } *************** *** 461,465 **** void Window::vOnExportBatteryFile() { ! std::string sSaveDir = m_poDirConfig->sGetKey("saves"); #ifdef GTKMM20 --- 455,459 ---- void Window::vOnExportBatteryFile() { ! std::string sBatteryDir = m_poDirConfig->sGetKey("batteries"); #ifdef GTKMM20 *************** *** 468,472 **** oDialog.set_transient_for(*this); ! if (sSaveDir == "") { oDialog.set_filename(Glib::path_get_dirname(m_sRomFile) + "/"); --- 462,466 ---- oDialog.set_transient_for(*this); ! if (sBatteryDir == "") { oDialog.set_filename(Glib::path_get_dirname(m_sRomFile) + "/"); *************** *** 474,478 **** else { ! oDialog.set_filename(sSaveDir + "/"); } --- 468,472 ---- else { ! oDialog.set_filename(sBatteryDir + "/"); } *************** *** 484,488 **** oDialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK); ! if (sSaveDir == "") { oDialog.set_current_folder(Glib::path_get_dirname(m_sRomFile)); --- 478,482 ---- oDialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK); ! if (sBatteryDir == "") { oDialog.set_current_folder(Glib::path_get_dirname(m_sRomFile)); *************** *** 490,495 **** else { ! oDialog.set_current_folder(sSaveDir); ! oDialog.add_shortcut_folder(sSaveDir); } --- 484,489 ---- else { ! oDialog.set_current_folder(sBatteryDir); ! oDialog.add_shortcut_folder(sBatteryDir); } *************** *** 565,576 **** else { ! Gtk::MessageDialog oErrorDialog(*this, ! _("Exporting the battery file failed."), ! #ifndef GTKMM20 ! false, ! #endif // ! GTKMM20 ! Gtk::MESSAGE_ERROR, ! Gtk::BUTTONS_CLOSE); ! oErrorDialog.run(); } } --- 559,564 ---- else { ! vPopupError(_("Failed to export battery file %s."), ! sFile.c_str()); } } |
From: S?bastien G. <kx...@us...> - 2004-05-05 16:01:21
|
Update of /cvsroot/vba/VisualBoyAdvance/src/gb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17105/src/gb Modified Files: GB.cpp gbCheats.cpp gbCodes.h gbCodesCB.h Log Message: Extended the gettext support to the core. Minor fixes. French translation is now almost complete. Index: gbCodes.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gb/gbCodes.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gbCodes.h 30 Jan 2004 00:48:29 -0000 1.4 --- gbCodes.h 5 May 2004 16:01:12 -0000 1.5 *************** *** 1401,1405 **** break; default: ! systemMessage(0, "Unknown opcode %02x at %04x", gbReadOpcode(PC.W-1),PC.W-1); emulating = false; --- 1401,1405 ---- break; default: ! systemMessage(0, N_("Unknown opcode %02x at %04x"), gbReadOpcode(PC.W-1),PC.W-1); emulating = false; Index: gbCodesCB.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gb/gbCodesCB.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gbCodesCB.h 20 Oct 2002 13:03:12 -0000 1.1 --- gbCodesCB.h 5 May 2004 16:01:12 -0000 1.2 *************** *** 1282,1286 **** break; default: ! systemMessage(0, "Unknown opcode %02x at %04x", gbReadOpcode(PC.W-1),PC.W-1); emulating = false; --- 1282,1286 ---- break; default: ! systemMessage(0, N_("Unknown opcode %02x at %04x"), gbReadOpcode(PC.W-1),PC.W-1); emulating = false; Index: GB.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gb/GB.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** GB.cpp 5 Feb 2004 11:38:31 -0000 1.17 --- GB.cpp 5 May 2004 16:01:12 -0000 1.18 *************** *** 1660,1664 **** if(gzFile == NULL) { ! systemMessage(MSG_ERROR_CREATING_FILE, "Error creating file %s", name); return; } --- 1660,1664 ---- if(gzFile == NULL) { ! systemMessage(MSG_ERROR_CREATING_FILE, N_("Error creating file %s"), name); return; } *************** *** 1677,1681 **** if(file == NULL) { ! systemMessage(MSG_ERROR_CREATING_FILE, "Error creating file %s", name); return; } --- 1677,1681 ---- if(file == NULL) { ! systemMessage(MSG_ERROR_CREATING_FILE, N_("Error creating file %s"), name); return; } *************** *** 1694,1698 **** if(gzFile == NULL) { ! systemMessage(MSG_ERROR_CREATING_FILE, "Error creating file %s", name); return; } --- 1694,1698 ---- if(gzFile == NULL) { ! systemMessage(MSG_ERROR_CREATING_FILE, N_("Error creating file %s"), name); return; } *************** *** 1717,1721 **** if(gzFile == NULL) { ! systemMessage(MSG_ERROR_CREATING_FILE,"Error creating file %s", name); return; } --- 1717,1721 ---- if(gzFile == NULL) { ! systemMessage(MSG_ERROR_CREATING_FILE, N_("Error creating file %s"), name); return; } *************** *** 1734,1738 **** if(file == NULL) { ! systemMessage(MSG_ERROR_CREATING_FILE, "Error creating file %s", name); return; } --- 1734,1738 ---- if(file == NULL) { ! systemMessage(MSG_ERROR_CREATING_FILE, N_("Error creating file %s"), name); return; } *************** *** 1759,1763 **** if(read != gbRamSize) { ! systemMessage(MSG_FAILED_TO_READ_SGM, "Failed to read complete save game %s (%d)", name, read); gzclose(gzFile); return false; --- 1759,1763 ---- if(read != gbRamSize) { ! systemMessage(MSG_FAILED_TO_READ_SGM, N_("Failed to read complete save game %s (%d)"), name, read); gzclose(gzFile); return false; *************** *** 1783,1787 **** if(read != 256) { systemMessage(MSG_FAILED_TO_READ_SGM, ! "Failed to read complete save game %s (%d)", name, read); fclose(file); return false; --- 1783,1787 ---- if(read != 256) { systemMessage(MSG_FAILED_TO_READ_SGM, ! N_("Failed to read complete save game %s (%d)"), name, read); fclose(file); return false; *************** *** 1808,1812 **** if(read != gbRamSize) { systemMessage(MSG_FAILED_TO_READ_SGM, ! "Failed to read complete save game %s (%d)", name, read); } else { read = gzread(gzFile, --- 1808,1812 ---- if(read != gbRamSize) { systemMessage(MSG_FAILED_TO_READ_SGM, ! N_("Failed to read complete save game %s (%d)"), name, read); } else { read = gzread(gzFile, *************** *** 1816,1820 **** if(read != (sizeof(int)*10 + sizeof(time_t)) && read != 0) { systemMessage(MSG_FAILED_TO_READ_RTC, ! "Failed to read RTC from save game %s (continuing)", name); res = false; --- 1816,1820 ---- if(read != (sizeof(int)*10 + sizeof(time_t)) && read != 0) { systemMessage(MSG_FAILED_TO_READ_RTC, ! N_("Failed to read RTC from save game %s (continuing)"), name); res = false; *************** *** 1840,1844 **** if(read != gbRamSize) { systemMessage(MSG_FAILED_TO_READ_SGM, ! "Failed to read complete save game %s (%d)", name, read); gzclose(gzFile); return false; --- 1840,1844 ---- if(read != gbRamSize) { systemMessage(MSG_FAILED_TO_READ_SGM, ! N_("Failed to read complete save game %s (%d)"), name, read); gzclose(gzFile); return false; *************** *** 1864,1868 **** if(read != 256) { systemMessage(MSG_FAILED_TO_READ_SGM, ! "Failed to read complete save game %s (%d)", name, read); fclose(file); return false; --- 1864,1868 ---- if(read != 256) { systemMessage(MSG_FAILED_TO_READ_SGM, ! N_("Failed to read complete save game %s (%d)"), name, read); fclose(file); return false; *************** *** 1975,1979 **** if(!file) { ! systemMessage(MSG_CANNOT_OPEN_FILE, "Cannot open file %s", fileName); return false; } --- 1975,1979 ---- if(!file) { ! systemMessage(MSG_CANNOT_OPEN_FILE, N_("Cannot open file %s"), fileName); return false; } *************** *** 1989,1993 **** if(memcmp(buffer, buffer2, 15)) { systemMessage(MSG_CANNOT_IMPORT_SNAPSHOT_FOR, ! "Cannot import snapshot for %s. Current game is %s", buffer, buffer2); --- 1989,1993 ---- if(memcmp(buffer, buffer2, 15)) { systemMessage(MSG_CANNOT_IMPORT_SNAPSHOT_FOR, ! N_("Cannot import snapshot for %s. Current game is %s"), buffer, buffer2); *************** *** 2016,2020 **** default: systemMessage(MSG_UNSUPPORTED_SNAPSHOT_FILE, ! "Unsupported snapshot file %s", fileName); fclose(file); --- 2016,2020 ---- default: systemMessage(MSG_UNSUPPORTED_SNAPSHOT_FILE, ! N_("Unsupported snapshot file %s"), fileName); fclose(file); *************** *** 2193,2197 **** if(version > GBSAVE_GAME_VERSION || version < 0) { systemMessage(MSG_UNSUPPORTED_VB_SGM, ! "Unsupported VisualBoy save game version %d", version); return false; } --- 2193,2197 ---- if(version > GBSAVE_GAME_VERSION || version < 0) { systemMessage(MSG_UNSUPPORTED_VB_SGM, ! N_("Unsupported VisualBoy save game version %d"), version); return false; } *************** *** 2203,2207 **** if(memcmp(&gbRom[0x134], romname, 15) != 0) { systemMessage(MSG_CANNOT_LOAD_SGM_FOR, ! "Cannot load save game for %s. Playing %s", romname, &gbRom[0x134]); return false; --- 2203,2207 ---- if(memcmp(&gbRom[0x134], romname, 15) != 0) { systemMessage(MSG_CANNOT_LOAD_SGM_FOR, ! N_("Cannot load save game for %s. Playing %s"), romname, &gbRom[0x134]); return false; *************** *** 2462,2466 **** if(gbRom[0x148] > 8) { systemMessage(MSG_UNSUPPORTED_ROM_SIZE, ! "Unsupported rom size %02x", gbRom[0x148]); return false; } --- 2462,2466 ---- if(gbRom[0x148] > 8) { systemMessage(MSG_UNSUPPORTED_ROM_SIZE, ! N_("Unsupported rom size %02x"), gbRom[0x148]); return false; } *************** *** 2474,2478 **** if(gbRom[0x149] > 5) { systemMessage(MSG_UNSUPPORTED_RAM_SIZE, ! "Unsupported ram size %02x", gbRom[0x149]); return false; } --- 2474,2478 ---- if(gbRom[0x149] > 5) { systemMessage(MSG_UNSUPPORTED_RAM_SIZE, ! N_("Unsupported ram size %02x"), gbRom[0x149]); return false; } *************** *** 2550,2554 **** default: systemMessage(MSG_UNKNOWN_CARTRIDGE_TYPE, ! "Unknown cartridge type %02x", type); return false; } --- 2550,2554 ---- default: systemMessage(MSG_UNKNOWN_CARTRIDGE_TYPE, ! N_("Unknown cartridge type %02x"), type); return false; } Index: gbCheats.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gb/gbCheats.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gbCheats.cpp 20 Nov 2003 02:39:11 -0000 1.5 --- gbCheats.cpp 5 May 2004 16:01:12 -0000 1.6 *************** *** 128,132 **** if(version != 1) { systemMessage(MSG_UNSUPPORTED_CHEAT_LIST_VERSION, ! "Unsupported cheat list version %d", version); fclose(f); return false; --- 128,132 ---- if(version != 1) { systemMessage(MSG_UNSUPPORTED_CHEAT_LIST_VERSION, ! N_("Unsupported cheat list version %d"), version); fclose(f); return false; *************** *** 141,145 **** if(type != 1) { systemMessage(MSG_UNSUPPORTED_CHEAT_LIST_TYPE, ! "Unsupported cheat list type %d", type); fclose(f); return false; --- 141,145 ---- if(type != 1) { systemMessage(MSG_UNSUPPORTED_CHEAT_LIST_TYPE, ! N_("Unsupported cheat list type %d"), type); fclose(f); return false; *************** *** 192,196 **** if(gbCheatNumber > 99) { systemMessage(MSG_MAXIMUM_NUMBER_OF_CHEATS, ! "Maximum number of cheats reached."); return; } --- 192,196 ---- if(gbCheatNumber > 99) { systemMessage(MSG_MAXIMUM_NUMBER_OF_CHEATS, ! N_("Maximum number of cheats reached.")); return; } *************** *** 198,202 **** if(!gbVerifyGsCode(code)) { systemMessage(MSG_INVALID_GAMESHARK_CODE, ! "Invalid GameShark code: %s", code); return; } --- 198,202 ---- if(!gbVerifyGsCode(code)) { systemMessage(MSG_INVALID_GAMESHARK_CODE, ! N_("Invalid GameShark code: %s"), code); return; } *************** *** 302,306 **** if(gbCheatNumber > 99) { systemMessage(MSG_MAXIMUM_NUMBER_OF_CHEATS, ! "Maximum number of cheats reached."); return; } --- 302,306 ---- if(gbCheatNumber > 99) { systemMessage(MSG_MAXIMUM_NUMBER_OF_CHEATS, ! N_("Maximum number of cheats reached.")); return; } *************** *** 308,312 **** if(!gbVerifyGgCode(code)) { systemMessage(MSG_INVALID_GAMEGENIE_CODE, ! "Invalid GameGenie code: %s", code); return; } --- 308,312 ---- if(!gbVerifyGgCode(code)) { systemMessage(MSG_INVALID_GAMEGENIE_CODE, ! N_("Invalid GameGenie code: %s"), code); return; } *************** *** 353,357 **** if(i < 0 || i >= gbCheatNumber) { systemMessage(MSG_INVALID_CHEAT_TO_REMOVE, ! "Invalid cheat to remove %d", i); return; } --- 353,357 ---- if(i < 0 || i >= gbCheatNumber) { systemMessage(MSG_INVALID_CHEAT_TO_REMOVE, ! N_("Invalid cheat to remove %d"), i); return; } *************** *** 398,402 **** if(!file) { ! systemMessage(MSG_CANNOT_OPEN_FILE, "Cannot open file %s", fileName); return false; } --- 398,402 ---- if(!file) { ! systemMessage(MSG_CANNOT_OPEN_FILE, N_("Cannot open file %s"), fileName); return false; } |
From: S?bastien G. <kx...@us...> - 2004-05-05 16:01:20
|
Update of /cvsroot/vba/VisualBoyAdvance/src/prof In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17105/src/prof Modified Files: prof.cpp Log Message: Extended the gettext support to the core. Minor fixes. French translation is now almost complete. Index: prof.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/prof/prof.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** prof.cpp 28 Jan 2004 18:03:26 -0000 1.3 --- prof.cpp 5 May 2004 16:01:12 -0000 1.4 *************** *** 56,59 **** --- 56,60 ---- #include "../GBA.h" + #include "../NLS.h" /* *************** *** 140,144 **** ! #define MSG "No space for profiling buffer(s)\n" void profStartup(u32 lowpc, u32 highpc) --- 141,145 ---- ! #define MSG N_("No space for profiling buffer(s)\n") void profStartup(u32 lowpc, u32 highpc) |
From: S?bastien G. <kx...@us...> - 2004-05-05 16:01:19
|
Update of /cvsroot/vba/VisualBoyAdvance/po In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17105/po Modified Files: POTFILES.in fr.gmo fr.po vba-1.7.2.pot Log Message: Extended the gettext support to the core. Minor fixes. French translation is now almost complete. Index: fr.po =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/po/fr.po,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** fr.po 1 May 2004 14:03:56 -0000 1.5 --- fr.po 5 May 2004 16:01:11 -0000 1.6 *************** *** 10,15 **** "Project-Id-Version: VisualBoyAdvance 1.7.2\n" "Report-Msgid-Bugs-To: undefined\n" ! "POT-Creation-Date: 2004-05-01 15:56+0200\n" ! "PO-Revision-Date: 2004-04-16 06:17+0200\n" "Last-Translator: Sébastien Guignot <kx...@ts...>\n" "Language-Team: French <@>\n" --- 10,15 ---- "Project-Id-Version: VisualBoyAdvance 1.7.2\n" "Report-Msgid-Bugs-To: undefined\n" ! "POT-Creation-Date: 2004-05-05 17:41+0200\n" [...1620 lines suppressed...] msgid "Saved battery" ! msgstr "Batterie enregistrée" ! #: src/gtk/window.cpp:1546 src/gtk/window.cpp:1593 msgid "----/--/-- --:--:--" ! msgstr "--/--/---- --:--:--" ! #: src/gtk/window.cpp:1578 msgid "%Y/%m/%d %H:%M:%S" ! msgstr "%d/%m/%Y %H:%M:%S" ! #: src/prof/prof.cpp:143 ! msgid "No space for profiling buffer(s)\n" ! msgstr "Pas de place pour le(s) tampon(s) de profil\n" ! ! #~ msgid "Importing the battery file failed." ! #~ msgstr "L'importation du fichier de batterie a échoué." ! ! #~ msgid "Exporting the battery file failed." ! #~ msgstr "L'exportation du fichier de batterie a échoué." Index: POTFILES.in =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/po/POTFILES.in,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** POTFILES.in 1 May 2004 14:03:56 -0000 1.2 --- POTFILES.in 5 May 2004 16:01:10 -0000 1.3 *************** *** 1,5 **** --- 1,16 ---- # List of source files which containing translatable strings. + src/Cheats.cpp + src/elf.cpp + src/GBA.cpp + src/RTC.cpp + src/Util.cpp + src/gb/gbCheats.cpp + src/gb/gbCodesCB.h + src/gb/gbCodes.h + src/gb/GB.cpp + src/gtk/system.cpp src/gtk/vba.glade src/gtk/windowcallbacks.cpp src/gtk/window.cpp + src/prof/prof.cpp Index: vba-1.7.2.pot =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/po/vba-1.7.2.pot,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** vba-1.7.2.pot 1 May 2004 14:03:57 -0000 1.5 --- vba-1.7.2.pot 5 May 2004 16:01:11 -0000 1.6 *************** *** 9,13 **** "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: undefined\n" ! "POT-Creation-Date: 2004-05-01 15:56+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" --- 9,13 ---- "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: undefined\n" ! "POT-Creation-Date: 2004-05-05 17:41+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" [...1470 lines suppressed...] ! #: src/gtk/window.cpp:1469 msgid "Loaded battery" msgstr "" ! #: src/gtk/window.cpp:1488 msgid "Saved battery" msgstr "" ! #: src/gtk/window.cpp:1546 src/gtk/window.cpp:1593 msgid "----/--/-- --:--:--" msgstr "" ! #: src/gtk/window.cpp:1578 msgid "%Y/%m/%d %H:%M:%S" msgstr "" + + #: src/prof/prof.cpp:143 + msgid "No space for profiling buffer(s)\n" + msgstr "" Index: fr.gmo =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/po/fr.gmo,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 Binary files /tmp/cvszZy1od and /tmp/cvsyvrnmu differ |
From: S?bastien G. <kx...@us...> - 2004-05-05 16:01:19
|
Update of /cvsroot/vba/VisualBoyAdvance In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17105 Modified Files: configure configure.in Log Message: Extended the gettext support to the core. Minor fixes. French translation is now almost complete. Index: configure =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/configure,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** configure 1 May 2004 14:03:51 -0000 1.23 --- configure 5 May 2004 16:01:09 -0000 1.24 *************** *** 865,870 **** --enable-c-core enable C core (default is no on x86 targets) --enable-profiling enable profiling (default is yes) ! --enable-sdl build the SDL frontend (default is yes) ! --enable-gtk=VERSION build the GTK+ frontend (default is no) --enable-dev enable development features (default is yes) --disable-nls do not use Native Language Support --- 865,870 ---- --enable-c-core enable C core (default is no on x86 targets) --enable-profiling enable profiling (default is yes) ! --enable-sdl build the SDL interface (default is yes) ! --enable-gtk=[VERSION] build the GTK+ interface (default is no) --enable-dev enable development features (default is yes) --disable-nls do not use Native Language Support Index: configure.in =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/configure.in,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** configure.in 1 May 2004 14:03:55 -0000 1.22 --- configure.in 5 May 2004 16:01:10 -0000 1.23 *************** *** 32,40 **** AC_ARG_ENABLE(sdl, ! AC_HELP_STRING([--enable-sdl],[build the SDL frontend (default is yes)]), , enable_sdl=yes) AC_ARG_ENABLE(gtk, ! AC_HELP_STRING([--enable-gtk[=VERSION]],[build the GTK+ frontend (default is no)]),[ if test "x$enable_gtk" != xno; then enable_gtk=yes --- 32,40 ---- AC_ARG_ENABLE(sdl, ! AC_HELP_STRING([--enable-sdl],[build the SDL interface (default is yes)]), , enable_sdl=yes) AC_ARG_ENABLE(gtk, ! [ --enable-gtk=[[VERSION]] build the GTK+ interface (default is no)],[ if test "x$enable_gtk" != xno; then enable_gtk=yes |
From: S?bastien G. <kx...@us...> - 2004-05-05 01:34:40
|
Update of /cvsroot/vba/VisualBoyAdvance/src/gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11297 Modified Files: vba.glade window.cpp window.h windowcallbacks.cpp Log Message: Added battery file import/export. Index: window.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/window.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** window.h 4 May 2004 20:33:16 -0000 1.14 --- window.h 5 May 2004 01:34:31 -0000 1.15 *************** *** 139,143 **** virtual void vOnRecentReset(); virtual void vOnRecentFreezeToggled(Gtk::CheckMenuItem * _poCMI); ! virtual void vOnRecent(std::string _sFile); virtual void vOnFileClose(); virtual void vOnFileExit(); --- 139,145 ---- virtual void vOnRecentReset(); virtual void vOnRecentFreezeToggled(Gtk::CheckMenuItem * _poCMI); ! virtual void vOnRecentFile(std::string _sFile); ! virtual void vOnImportBatteryFile(); ! virtual void vOnExportBatteryFile(); virtual void vOnFileClose(); virtual void vOnFileExit(); Index: window.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/window.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** window.cpp 4 May 2004 20:33:16 -0000 1.14 --- window.cpp 5 May 2004 01:34:31 -0000 1.15 *************** *** 205,208 **** --- 205,220 ---- poCMI)); + // Import menu + // + poMI = dynamic_cast<Gtk::MenuItem *>(_poXml->get_widget("ImportBatteryFile")); + poMI->signal_activate().connect(SigC::slot(*this, &Window::vOnImportBatteryFile)); + m_listSensitiveWhenPlaying.push_back(poMI); + + // Export menu + // + poMI = dynamic_cast<Gtk::MenuItem *>(_poXml->get_widget("ExportBatteryFile")); + poMI->signal_activate().connect(SigC::slot(*this, &Window::vOnExportBatteryFile)); + m_listSensitiveWhenPlaying.push_back(poMI); + // Frameskip menu // *************** *** 1145,1149 **** poIMI->signal_activate().connect(SigC::bind<std::string>( ! SigC::slot(*this, &Window::vOnRecent), *it)); --- 1157,1161 ---- poIMI->signal_activate().connect(SigC::bind<std::string>( ! SigC::slot(*this, &Window::vOnRecentFile), *it)); Index: vba.glade =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/vba.glade,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** vba.glade 3 May 2004 17:00:27 -0000 1.9 --- vba.glade 5 May 2004 01:34:31 -0000 1.10 *************** *** 51,55 **** <child internal-child="image"> ! <widget class="GtkImage" id="image108"> <property name="visible">True</property> <property name="stock">gtk-open</property> --- 51,55 ---- <child internal-child="image"> ! <widget class="GtkImage" id="image114"> <property name="visible">True</property> <property name="stock">gtk-open</property> *************** *** 409,412 **** --- 409,425 ---- <property name="label" translatable="yes">_Import</property> <property name="use_underline">True</property> + + <child> + <widget class="GtkMenu" id="ImportMenu_menu"> + + <child> + <widget class="GtkMenuItem" id="ImportBatteryFile"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Battery file...</property> + <property name="use_underline">True</property> + </widget> + </child> + </widget> + </child> </widget> </child> *************** *** 417,420 **** --- 430,446 ---- <property name="label" translatable="yes">E_xport</property> <property name="use_underline">True</property> + + <child> + <widget class="GtkMenu" id="ExportMenu_menu"> + + <child> + <widget class="GtkMenuItem" id="ExportBatteryFile"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Battery file...</property> + <property name="use_underline">True</property> + </widget> + </child> + </widget> + </child> </widget> </child> *************** *** 455,459 **** <child internal-child="image"> ! <widget class="GtkImage" id="image109"> <property name="visible">True</property> <property name="stock">gtk-close</property> --- 481,485 ---- <child internal-child="image"> ! <widget class="GtkImage" id="image115"> <property name="visible">True</property> <property name="stock">gtk-close</property> *************** *** 476,480 **** <child internal-child="image"> ! <widget class="GtkImage" id="image110"> <property name="visible">True</property> <property name="stock">gtk-quit</property> --- 502,506 ---- <child internal-child="image"> ! <widget class="GtkImage" id="image116"> <property name="visible">True</property> <property name="stock">gtk-quit</property> Index: windowcallbacks.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/windowcallbacks.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** windowcallbacks.cpp 4 May 2004 20:33:16 -0000 1.3 --- windowcallbacks.cpp 5 May 2004 01:34:31 -0000 1.4 *************** *** 245,259 **** } ! if (Glib::file_test(oDialog.get_filename(), Glib::FILE_TEST_EXISTS)) { ! Gtk::MessageDialog oConfirm(*this, ! _("File already exists. Overwrite it?"), #ifndef GTKMM20 ! false, #endif // ! GTKMM20 ! Gtk::MESSAGE_QUESTION, ! Gtk::BUTTONS_YES_NO, ! true); ! if (oConfirm.run() != Gtk::RESPONSE_YES) { continue; --- 245,258 ---- } ! if (Glib::file_test(sFile, Glib::FILE_TEST_EXISTS)) { ! Gtk::MessageDialog oConfirmDialog(*this, ! _("File already exists. Overwrite it?"), #ifndef GTKMM20 ! false, #endif // ! GTKMM20 ! Gtk::MESSAGE_QUESTION, ! Gtk::BUTTONS_YES_NO); ! if (oConfirmDialog.run() != Gtk::RESPONSE_YES) { continue; *************** *** 375,383 **** } ! void Window::vOnRecent(std::string _sFile) { bLoadROM(_sFile); } void Window::vOnFileClose() { --- 374,580 ---- } ! void Window::vOnRecentFile(std::string _sFile) { bLoadROM(_sFile); } + void Window::vOnImportBatteryFile() + { + std::string sSaveDir = m_poDirConfig->sGetKey("saves"); + + #ifdef GTKMM20 + + Gtk::FileSelection oDialog(_("Import battery file")); + oDialog.set_transient_for(*this); + + if (sSaveDir == "") + { + oDialog.set_filename(Glib::path_get_dirname(m_sRomFile) + "/"); + } + else + { + oDialog.set_filename(sSaveDir + "/"); + } + + #else // ! GTKMM20 + + Gtk::FileChooserDialog oDialog(*this, _("Import battery file")); + oDialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); + oDialog.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK); + + if (sSaveDir == "") + { + oDialog.set_current_folder(Glib::path_get_dirname(m_sRomFile)); + } + else + { + oDialog.set_current_folder(sSaveDir); + oDialog.add_shortcut_folder(sSaveDir); + } + + Gtk::FileFilter oBatteryFilter; + oBatteryFilter.set_name(_("Battery file")); + oBatteryFilter.add_pattern("*.[sS][aA][vV]"); + + Gtk::FileFilter oFlashFilter; + oFlashFilter.set_name(_("Flash save")); + oFlashFilter.add_pattern("*.[dD][aA][tT]"); + + oDialog.add_filter(oBatteryFilter); + oDialog.add_filter(oFlashFilter); + + #endif // ! GTKMM20 + + while (oDialog.run() == Gtk::RESPONSE_OK) + { + Gtk::MessageDialog oConfirmDialog(*this, + _("Importing a battery file will erase any saved games and reset the emulator. Do you want to continue?"), + #ifndef GTKMM20 + false, + #endif // ! GTKMM20 + Gtk::MESSAGE_QUESTION, + Gtk::BUTTONS_YES_NO); + if (oConfirmDialog.run() != Gtk::RESPONSE_YES) + { + continue; + } + + if (m_stEmulator.emuReadBattery(oDialog.get_filename().c_str())) + { + m_stEmulator.emuReset(); + break; + } + else + { + Gtk::MessageDialog oErrorDialog(*this, + _("Importing the battery file failed."), + #ifndef GTKMM20 + false, + #endif // ! GTKMM20 + Gtk::MESSAGE_ERROR, + Gtk::BUTTONS_CLOSE); + oErrorDialog.run(); + } + } + } + + void Window::vOnExportBatteryFile() + { + std::string sSaveDir = m_poDirConfig->sGetKey("saves"); + + #ifdef GTKMM20 + + Gtk::FileSelection oDialog(_("Export battery file")); + oDialog.set_transient_for(*this); + + if (sSaveDir == "") + { + oDialog.set_filename(Glib::path_get_dirname(m_sRomFile) + "/"); + } + else + { + oDialog.set_filename(sSaveDir + "/"); + } + + #else // ! GTKMM20 + + Gtk::FileChooserDialog oDialog(*this, _("Export battery file"), + Gtk::FILE_CHOOSER_ACTION_SAVE); + oDialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); + oDialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK); + + if (sSaveDir == "") + { + oDialog.set_current_folder(Glib::path_get_dirname(m_sRomFile)); + } + else + { + oDialog.set_current_folder(sSaveDir); + oDialog.add_shortcut_folder(sSaveDir); + } + + Gtk::FileFilter oBatteryFilter; + oBatteryFilter.set_name(_("Battery file")); + oBatteryFilter.add_pattern("*.[sS][aA][vV]"); + + Gtk::FileFilter oFlashFilter; + oFlashFilter.set_name(_("Flash save")); + oFlashFilter.add_pattern("*.[dD][aA][tT]"); + + oDialog.add_filter(oBatteryFilter); + oDialog.add_filter(oFlashFilter); + + #endif // ! GTKMM20 + + while (oDialog.run() == Gtk::RESPONSE_OK) + { + Glib::ustring sFile = oDialog.get_filename(); + Glib::ustring sExt; + + #ifdef GTKMM20 + + sExt = ".sav"; + + #else // ! GTKMM20 + + if (oDialog.get_filter() == &oBatteryFilter) + { + sExt = ".sav"; + } + else + { + sExt = ".dat"; + } + + #endif // ! GTKMM20 + + if (! bHasSuffix(sFile, sExt, false)) + { + sFile += sExt; + } + + if (Glib::file_test(sFile, Glib::FILE_TEST_EXISTS)) + { + Gtk::MessageDialog oConfirmDialog(*this, + _("File already exists. Overwrite it?"), + #ifndef GTKMM20 + false, + #endif // ! GTKMM20 + Gtk::MESSAGE_QUESTION, + Gtk::BUTTONS_YES_NO); + if (oConfirmDialog.run() != Gtk::RESPONSE_YES) + { + continue; + } + } + + bool bResult; + if (m_eCartridge == CartridgeGB) + { + bResult = gbWriteBatteryFile(sFile.c_str(), false); + } + else + { + bResult = m_stEmulator.emuWriteBattery(sFile.c_str()); + } + + if (bResult) + { + break; + } + else + { + Gtk::MessageDialog oErrorDialog(*this, + _("Exporting the battery file failed."), + #ifndef GTKMM20 + false, + #endif // ! GTKMM20 + Gtk::MESSAGE_ERROR, + Gtk::BUTTONS_CLOSE); + oErrorDialog.run(); + } + } + } + void Window::vOnFileClose() { *************** *** 996,1002 **** } - // TEST - printf("scan code: %hd\n", _pstEvent->hardware_keycode); - switch (eKey) { --- 1193,1196 ---- |
From: S?bastien G. <kx...@us...> - 2004-05-04 20:33:56
|
Update of /cvsroot/vba/VisualBoyAdvance/src/gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14729 Modified Files: tools.cpp tools.h window.cpp window.h windowcallbacks.cpp Log Message: Added load/save dialogs. Index: tools.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/tools.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tools.h 29 Mar 2004 22:08:40 -0000 1.1 --- tools.h 4 May 2004 20:33:16 -0000 1.2 *************** *** 22,31 **** #include <string> namespace VBA { ! std::string sCutSuffix(const std::string & _sString, ! const std::string & _sSep = std::string(".")); } --- 22,39 ---- #include <string> + #include <glibmm/ustring.h> namespace VBA { ! std::string sCutSuffix(const std::string & _rsString, ! const std::string & _rsSep = "."); ! ! Glib::ustring sCutSuffix(const Glib::ustring & _rsString, ! const Glib::ustring & _rsSep = "."); ! ! bool bHasSuffix(const Glib::ustring & _rsString, ! const Glib::ustring & _rsSuffix, ! bool _bCaseSensitive = true); } Index: tools.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/tools.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tools.cpp 29 Mar 2004 22:08:40 -0000 1.1 --- tools.cpp 4 May 2004 20:33:16 -0000 1.2 *************** *** 23,30 **** { ! std::string sCutSuffix(const std::string & _sString, ! const std::string & _sSep) { ! return _sString.substr(0, _sString.find_last_of(_sSep)); } --- 23,65 ---- { ! std::string sCutSuffix(const std::string & _rsString, ! const std::string & _rsSep) { ! return _rsString.substr(0, _rsString.find_last_of(_rsSep)); ! } ! ! Glib::ustring sCutSuffix(const Glib::ustring & _rsString, ! const Glib::ustring & _rsSep) ! { ! return _rsString.substr(0, _rsString.find_last_of(_rsSep)); ! } ! ! bool bHasSuffix(const Glib::ustring & _rsString, ! const Glib::ustring & _rsSuffix, ! bool _bCaseSensitive) ! { ! if (_rsSuffix.size() > _rsString.size()) ! { ! return false; ! } ! ! Glib::ustring sEnd = _rsString.substr(_rsString.size() - _rsSuffix.size()); ! ! if (_bCaseSensitive) ! { ! if (_rsSuffix == sEnd) ! { ! return true; ! } ! } ! else ! { ! if (_rsSuffix.lowercase() == sEnd.lowercase()) ! { ! return true; ! } ! } ! ! return false; } Index: window.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/window.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** window.h 3 May 2004 17:00:27 -0000 1.13 --- window.h 4 May 2004 20:33:16 -0000 1.14 *************** *** 128,136 **** virtual void vOnFileOpen(); virtual void vOnLoadGameMostRecent(); virtual void vOnLoadGameAutoToggled(Gtk::CheckMenuItem * _poCMI); ! virtual void vOnLoadGame(int _iSlot); virtual void vOnSaveGameOldest(); ! virtual void vOnSaveGame(int _iSlot); virtual void vOnFilePauseToggled(Gtk::CheckMenuItem * _poCMI); virtual void vOnFileReset(); --- 128,138 ---- virtual void vOnFileOpen(); + virtual void vOnLoadGame(); + virtual void vOnSaveGame(); virtual void vOnLoadGameMostRecent(); virtual void vOnLoadGameAutoToggled(Gtk::CheckMenuItem * _poCMI); ! virtual void vOnLoadGameSlot(int _iSlot); virtual void vOnSaveGameOldest(); ! virtual void vOnSaveGameSlot(int _iSlot); virtual void vOnFilePauseToggled(Gtk::CheckMenuItem * _poCMI); virtual void vOnFileReset(); *************** *** 216,222 **** --- 218,229 ---- Config::Section * m_poSoundConfig; + #ifdef GTKMM20 Gtk::FileSelection * m_poFileOpenDialog; + #else // ! GTKMM20 + Gtk::FileChooserDialog * m_poFileOpenDialog; + #endif // ! GTKMM20 ScreenArea * m_poScreenArea; Gtk::Menu * m_poRecentMenu; + Gtk::MenuItem * m_poRecentResetItem; Gtk::CheckMenuItem * m_poFilePauseItem; Gtk::CheckMenuItem * m_poUseBiosItem; Index: window.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/window.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** window.cpp 3 May 2004 17:00:27 -0000 1.13 --- window.cpp 4 May 2004 20:33:16 -0000 1.14 *************** *** 131,134 **** --- 131,142 ---- poMI->signal_activate().connect(SigC::slot(*this, &Window::vOnFileOpen)); + poMI = dynamic_cast<Gtk::MenuItem *>(_poXml->get_widget("FileLoad")); + poMI->signal_activate().connect(SigC::slot(*this, &Window::vOnLoadGame)); + m_listSensitiveWhenPlaying.push_back(poMI); + + poMI = dynamic_cast<Gtk::MenuItem *>(_poXml->get_widget("FileSave")); + poMI->signal_activate().connect(SigC::slot(*this, &Window::vOnSaveGame)); + m_listSensitiveWhenPlaying.push_back(poMI); + for (int i = 0; i < 10; i++) { *************** *** 140,147 **** m_apoLoadGameItem[i]->signal_activate().connect(SigC::bind<int>( ! SigC::slot(*this, &Window::vOnLoadGame), i + 1)); m_apoSaveGameItem[i]->signal_activate().connect(SigC::bind<int>( ! SigC::slot(*this, &Window::vOnSaveGame), i + 1)); } --- 148,155 ---- m_apoLoadGameItem[i]->signal_activate().connect(SigC::bind<int>( ! SigC::slot(*this, &Window::vOnLoadGameSlot), i + 1)); m_apoSaveGameItem[i]->signal_activate().connect(SigC::bind<int>( ! SigC::slot(*this, &Window::vOnSaveGameSlot), i + 1)); } *************** *** 187,192 **** vUpdateHistoryMenu(); ! poMI = dynamic_cast<Gtk::MenuItem *>(_poXml->get_widget("RecentReset")); ! poMI->signal_activate().connect(SigC::slot(*this, &Window::vOnRecentReset)); poCMI = dynamic_cast<Gtk::CheckMenuItem *>(_poXml->get_widget("RecentFreeze")); --- 195,200 ---- vUpdateHistoryMenu(); ! m_poRecentResetItem = dynamic_cast<Gtk::MenuItem *>(_poXml->get_widget("RecentReset")); ! m_poRecentResetItem->signal_activate().connect(SigC::slot(*this, &Window::vOnRecentReset)); poCMI = dynamic_cast<Gtk::CheckMenuItem *>(_poXml->get_widget("RecentFreeze")); Index: windowcallbacks.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/windowcallbacks.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** windowcallbacks.cpp 3 May 2004 17:00:27 -0000 1.2 --- windowcallbacks.cpp 4 May 2004 20:33:16 -0000 1.3 *************** *** 54,65 **** if (m_poFileOpenDialog == NULL) { ! m_poFileOpenDialog = new Gtk::FileSelection(_("Open")); ! m_poFileOpenDialog->set_transient_for(*this); ! std::string sDir = m_poDirConfig->sGetKey("gba_roms"); ! if (sDir != "") { ! m_poFileOpenDialog->set_filename(sDir + "/"); } } --- 54,130 ---- if (m_poFileOpenDialog == NULL) { ! std::string sGBDir = m_poDirConfig->sGetKey("gb_roms"); ! std::string sGBADir = m_poDirConfig->sGetKey("gba_roms"); ! #ifdef GTKMM20 ! ! Gtk::FileSelection * poDialog = new Gtk::FileSelection(_("Open")); ! poDialog->set_transient_for(*this); ! ! if (sGBADir != "") { ! poDialog->set_filename(sGBADir + "/"); ! } ! else if (sGBDir != "") ! { ! poDialog->set_filename(sGBDir + "/"); } + + #else // ! GTKMM20 + + Gtk::FileChooserDialog * poDialog = new Gtk::FileChooserDialog(*this, _("Open")); + poDialog->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); + poDialog->add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK); + + if (sGBDir != "") + { + poDialog->add_shortcut_folder(sGBDir); + poDialog->set_current_folder(sGBDir); + } + + if (sGBADir != "" && sGBADir != sGBDir) + { + poDialog->add_shortcut_folder(sGBADir); + poDialog->set_current_folder(sGBADir); + } + + const char * acsPattern[] = + { + // GBA + "*.[bB][iI][nN]", "*.[aA][gG][bB]", "*.[gG][bB][aA]", + // GB + "*.[gG][bB]", "*.[sS][gG][bB]", "*.[cC][gG][bB]", "*.[gG][bB][cC]", + // Both + "*.[mM][bB]", "*.[eE][lL][fF]", "*.[zZ][iI][pP]", "*.[zZ]", "*.[gG][zZ]" + }; + + Gtk::FileFilter oAllGBAFilter; + oAllGBAFilter.set_name(_("All Gameboy Advance files")); + for (guint i = 0; i < sizeof(acsPattern) / sizeof(acsPattern[0]); i++) + { + oAllGBAFilter.add_pattern(acsPattern[i]); + } + + Gtk::FileFilter oGBAFilter; + oGBAFilter.set_name(_("Gameboy Advance files")); + for (int i = 0; i < 3; i++) + { + oGBAFilter.add_pattern(acsPattern[i]); + } + + Gtk::FileFilter oGBFilter; + oGBFilter.set_name(_("Gameboy files")); + for (int i = 3; i < 7; i++) + { + oGBFilter.add_pattern(acsPattern[i]); + } + + poDialog->add_filter(oAllGBAFilter); + poDialog->add_filter(oGBAFilter); + poDialog->add_filter(oGBFilter); + + #endif // ! GTKMM20 + + m_poFileOpenDialog = poDialog; } *************** *** 74,77 **** --- 139,271 ---- } + void Window::vOnLoadGame() + { + std::string sSaveDir = m_poDirConfig->sGetKey("saves"); + + #ifdef GTKMM20 + + Gtk::FileSelection oDialog(_("Load game")); + oDialog.set_transient_for(*this); + + if (sSaveDir == "") + { + oDialog.set_filename(Glib::path_get_dirname(m_sRomFile) + "/"); + } + else + { + oDialog.set_filename(sSaveDir + "/"); + } + + #else // ! GTKMM20 + + Gtk::FileChooserDialog oDialog(*this, _("Load game")); + oDialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); + oDialog.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK); + + if (sSaveDir == "") + { + oDialog.set_current_folder(Glib::path_get_dirname(m_sRomFile)); + } + else + { + oDialog.set_current_folder(sSaveDir); + oDialog.add_shortcut_folder(sSaveDir); + } + + Gtk::FileFilter oSaveFilter; + oSaveFilter.set_name(_("VisualBoyAdvance save game")); + oSaveFilter.add_pattern("*.[sS][gG][mM]"); + + oDialog.add_filter(oSaveFilter); + + #endif // ! GTKMM20 + + while (oDialog.run() == Gtk::RESPONSE_OK) + { + if (m_stEmulator.emuReadState(oDialog.get_filename().c_str())) + { + break; + } + } + } + + void Window::vOnSaveGame() + { + Glib::ustring sSaveDir = m_poDirConfig->sGetKey("saves"); + + #ifdef GTKMM20 + + Gtk::FileSelection oDialog(_("Save game")); + oDialog.set_transient_for(*this); + + Glib::ustring sDefaultFile; + if (sSaveDir == "") + { + sDefaultFile = sCutSuffix(m_sRomFile) + ".sgm"; + } + else + { + sDefaultFile = sSaveDir + "/" + + sCutSuffix(Glib::path_get_basename(m_sRomFile)) + ".sgm"; + } + oDialog.set_filename(sDefaultFile); + + #else // ! GTKMM20 + + Gtk::FileChooserDialog oDialog(*this, _("Save game"), + Gtk::FILE_CHOOSER_ACTION_SAVE); + oDialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); + oDialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK); + + if (sSaveDir == "") + { + oDialog.set_current_folder(Glib::path_get_dirname(m_sRomFile)); + } + else + { + oDialog.set_current_folder(sSaveDir); + oDialog.add_shortcut_folder(sSaveDir); + } + oDialog.set_current_name(sCutSuffix(Glib::path_get_basename(m_sRomFile)) + ".sgm"); + + Gtk::FileFilter oSaveFilter; + oSaveFilter.set_name(_("VisualBoyAdvance save game")); + oSaveFilter.add_pattern("*.[sS][gG][mM]"); + + oDialog.add_filter(oSaveFilter); + + #endif // ! GTKMM20 + + while (oDialog.run() == Gtk::RESPONSE_OK) + { + Glib::ustring sFile = oDialog.get_filename(); + if (! bHasSuffix(sFile, ".sgm", false)) + { + sFile += ".sgm"; + } + + if (Glib::file_test(oDialog.get_filename(), Glib::FILE_TEST_EXISTS)) + { + Gtk::MessageDialog oConfirm(*this, + _("File already exists. Overwrite it?"), + #ifndef GTKMM20 + false, + #endif // ! GTKMM20 + Gtk::MESSAGE_QUESTION, + Gtk::BUTTONS_YES_NO, + true); + if (oConfirm.run() != Gtk::RESPONSE_YES) + { + continue; + } + } + + if (m_stEmulator.emuWriteState(sFile.c_str())) + { + break; + } + } + } + void Window::vOnLoadGameMostRecent() { *************** *** 91,95 **** if (iMostRecent >= 0) { ! vOnLoadGame(iMostRecent + 1); } } --- 285,289 ---- if (iMostRecent >= 0) { ! vOnLoadGameSlot(iMostRecent + 1); } } *************** *** 100,104 **** } ! void Window::vOnLoadGame(int _iSlot) { int i = _iSlot - 1; --- 294,298 ---- } ! void Window::vOnLoadGameSlot(int _iSlot) { int i = _iSlot - 1; *************** *** 127,139 **** if (iOldest >= 0) { ! vOnSaveGame(iOldest + 1); } else { ! vOnSaveGame(1); } } ! void Window::vOnSaveGame(int _iSlot) { int i = _iSlot - 1; --- 321,333 ---- if (iOldest >= 0) { ! vOnSaveGameSlot(iOldest + 1); } else { ! vOnSaveGameSlot(1); } } ! void Window::vOnSaveGameSlot(int _iSlot) { int i = _iSlot - 1; *************** *** 177,180 **** --- 371,375 ---- void Window::vOnRecentFreezeToggled(Gtk::CheckMenuItem * _poCMI) { + m_poRecentResetItem->set_sensitive(! _poCMI->get_active()); m_poHistoryConfig->vSetKey("freeze", _poCMI->get_active()); } *************** *** 393,407 **** void Window::vOnDirectorySelect(Gtk::Entry * _poEntry) { ! Gtk::FileSelection * poDialog = new Gtk::FileSelection(_("Select directory")); ! poDialog->set_transient_for(*this); if (_poEntry->get_text() != "") { ! poDialog->set_filename(_poEntry->get_text() + "/"); } ! if (poDialog->run() == Gtk::RESPONSE_OK) { ! std::string sFile = poDialog->get_filename(); if (! Glib::file_test(sFile, Glib::FILE_TEST_IS_DIR)) { --- 588,604 ---- void Window::vOnDirectorySelect(Gtk::Entry * _poEntry) { ! #ifdef GTKMM20 ! ! Gtk::FileSelection oDialog(_("Select directory")); ! oDialog.set_transient_for(*this); if (_poEntry->get_text() != "") { ! oDialog.set_filename(_poEntry->get_text() + "/"); } ! if (oDialog.run() == Gtk::RESPONSE_OK) { ! std::string sFile = oDialog.get_filename(); if (! Glib::file_test(sFile, Glib::FILE_TEST_IS_DIR)) { *************** *** 411,415 **** } ! delete poDialog; } --- 608,630 ---- } ! #else // ! GTKMM20 ! ! Gtk::FileChooserDialog oDialog(*this, _("Select directory"), ! Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER); ! oDialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); ! oDialog.add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK); ! ! if (_poEntry->get_text() != "") ! { ! oDialog.add_shortcut_folder(_poEntry->get_text()); ! oDialog.set_current_folder(_poEntry->get_text()); ! } ! ! if (oDialog.run() == Gtk::RESPONSE_OK) ! { ! _poEntry->set_text(oDialog.get_filename()); ! } ! ! #endif // ! GTKMM20 } *************** *** 421,443 **** void Window::vOnSelectBios() { ! Gtk::FileSelection * poDialog = new Gtk::FileSelection(_("Select BIOS file")); ! poDialog->set_transient_for(*this); if (m_poCoreConfig->sGetKey("bios_file") != "") { ! poDialog->set_filename(m_poCoreConfig->sGetKey("bios_file")); } ! while (poDialog->run() == Gtk::RESPONSE_OK) { ! if (Glib::file_test(poDialog->get_filename(), Glib::FILE_TEST_IS_REGULAR)) { ! m_poCoreConfig->vSetKey("bios_file", poDialog->get_filename()); m_poUseBiosItem->set_sensitive(); break; } } - - delete poDialog; } --- 636,693 ---- void Window::vOnSelectBios() { ! #ifdef GTKMM20 ! ! Gtk::FileSelection oDialog(_("Select BIOS file")); ! oDialog.set_transient_for(*this); if (m_poCoreConfig->sGetKey("bios_file") != "") { ! oDialog.set_filename(m_poCoreConfig->sGetKey("bios_file")); } ! #else // ! GTKMM20 ! ! Gtk::FileChooserDialog oDialog(*this, _("Select BIOS file")); ! oDialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); ! oDialog.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK); ! ! if (m_poCoreConfig->sGetKey("bios_file") != "") { ! oDialog.set_filename(m_poCoreConfig->sGetKey("bios_file")); ! } ! ! const char * acsPattern[] = ! { ! "*.[bB][iI][nN]", "*.[aA][gG][bB]", "*.[gG][bB][aA]", ! "*.[bB][iI][oO][sS]", "*.[zZ][iI][pP]", "*.[zZ]", "*.[gG][zZ]" ! }; ! ! Gtk::FileFilter oAllFilter; ! oAllFilter.set_name(_("All files")); ! oAllFilter.add_pattern("*"); ! ! Gtk::FileFilter oBiosFilter; ! oBiosFilter.set_name(_("Gameboy Advance BIOS")); ! for (guint i = 0; i < sizeof(acsPattern) / sizeof(acsPattern[0]); i++) ! { ! oBiosFilter.add_pattern(acsPattern[i]); ! } ! ! oDialog.add_filter(oAllFilter); ! oDialog.add_filter(oBiosFilter); ! ! oDialog.set_filter(oBiosFilter); ! ! #endif // ! GTKMM20 ! ! while (oDialog.run() == Gtk::RESPONSE_OK) ! { ! if (Glib::file_test(oDialog.get_filename(), Glib::FILE_TEST_IS_REGULAR)) { ! m_poCoreConfig->vSetKey("bios_file", oDialog.get_filename()); m_poUseBiosItem->set_sensitive(); break; } } } *************** *** 740,744 **** EKey eKey; ! if ((_pstEvent->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK)) || (eKey = m_oKeymap.eGetKey(_pstEvent->keyval)) == KeyNone) { --- 990,994 ---- EKey eKey; ! if ((_pstEvent->state & Gtk::AccelGroup::get_default_mod_mask()) || (eKey = m_oKeymap.eGetKey(_pstEvent->keyval)) == KeyNone) { *************** *** 746,749 **** --- 996,1002 ---- } + // TEST + printf("scan code: %hd\n", _pstEvent->hardware_keycode); + switch (eKey) { *************** *** 798,802 **** EKey eKey; ! if ((_pstEvent->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK)) || (eKey = m_oKeymap.eGetKey(_pstEvent->keyval)) == KeyNone) { --- 1051,1055 ---- EKey eKey; ! if ((_pstEvent->state & Gtk::AccelGroup::get_default_mod_mask()) || (eKey = m_oKeymap.eGetKey(_pstEvent->keyval)) == KeyNone) { |
From: S?bastien G. <kx...@us...> - 2004-05-03 17:01:34
|
Update of /cvsroot/vba/VisualBoyAdvance/src/gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7146 Added Files: menuitem.h Log Message: Added recent files menu. --- NEW FILE: menuitem.h --- // -*- C++ -*- // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. // Copyright (C) 1999-2003 Forgotten // Copyright (C) 2004 Forgotten and the VBA development team // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2, or(at your option) // any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software Foundation, // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef __VBA_MENUITEM_H__ #define __VBA_MENUITEM_H__ #include <gtkmm/menuitem.h> #include <gtkmm/imagemenuitem.h> #ifdef GTKMM20 namespace Gtk { typedef Gtk::Menu_Helpers::AccelKey AccelKey; } #endif // GTKMM20 namespace VBA { class MenuItem : public Gtk::MenuItem { public: MenuItem() {} MenuItem(Gtk::Widget & _roWidget) : Gtk::MenuItem(_roWidget) {} MenuItem(const Glib::ustring & _rsLabel, bool _bMnemonic = false) : Gtk::MenuItem(_rsLabel, _bMnemonic) {} inline void set_accel_key(const Gtk::AccelKey & _roAccelKey) { Gtk::MenuItem::set_accel_key(_roAccelKey); } }; class ImageMenuItem : public Gtk::ImageMenuItem { public: ImageMenuItem() {} ImageMenuItem(Widget & _roImage, const Glib::ustring & _rsLabel, bool _bMnemonic = false) : Gtk::ImageMenuItem(_roImage, _rsLabel, _bMnemonic) {} ImageMenuItem(const Glib::ustring & _rsLabel, bool _bMnemonic = false) : Gtk::ImageMenuItem(_rsLabel, _bMnemonic) {} ImageMenuItem(const Gtk::StockID & _roId) : Gtk::ImageMenuItem(_roId) {} inline void set_accel_key(const Gtk::AccelKey & _roAccelKey) { Gtk::MenuItem::set_accel_key(_roAccelKey); } }; } // namespace VBA #endif // __VBA_MENUITEM_H__ |
From: S?bastien G. <kx...@us...> - 2004-05-03 17:01:13
|
Update of /cvsroot/vba/VisualBoyAdvance/src/gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6897 Modified Files: Makefile.am Makefile.in configfile.cpp configfile.h vba.glade window.cpp window.h windowcallbacks.cpp Log Message: Added recent files menu. Index: Makefile.am =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.am 1 May 2004 14:03:58 -0000 1.4 --- Makefile.am 3 May 2004 17:00:26 -0000 1.5 *************** *** 12,15 **** --- 12,16 ---- intl.h \ main.cpp \ + menuitem.h \ screenarea.cpp \ screenarea.h \ Index: window.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/window.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** window.h 1 May 2004 14:04:02 -0000 1.12 --- window.h 3 May 2004 17:00:27 -0000 1.13 *************** *** 23,33 **** #include <sys/types.h> #ifndef GTKMM20 # include "sigccompat.h" #endif // ! GTKMM20 - #include <libglademm.h> - #include <gtkmm.h> - #include <string> #include <list> --- 23,33 ---- #include <sys/types.h> + #include <libglademm.h> + #include <gtkmm.h> + #ifndef GTKMM20 # include "sigccompat.h" #endif // ! GTKMM20 #include <string> #include <list> *************** *** 135,138 **** --- 135,141 ---- virtual void vOnFilePauseToggled(Gtk::CheckMenuItem * _poCMI); virtual void vOnFileReset(); + virtual void vOnRecentReset(); + virtual void vOnRecentFreezeToggled(Gtk::CheckMenuItem * _poCMI); + virtual void vOnRecent(std::string _sFile); virtual void vOnFileClose(); virtual void vOnFileExit(); *************** *** 207,210 **** --- 210,214 ---- std::string m_sConfigFile; Config::File m_oConfig; + Config::Section * m_poHistoryConfig; Config::Section * m_poDirConfig; Config::Section * m_poCoreConfig; *************** *** 214,217 **** --- 218,222 ---- Gtk::FileSelection * m_poFileOpenDialog; ScreenArea * m_poScreenArea; + Gtk::Menu * m_poRecentMenu; Gtk::CheckMenuItem * m_poFilePauseItem; Gtk::CheckMenuItem * m_poUseBiosItem; *************** *** 229,234 **** --- 234,243 ---- SGameSlot m_astGameSlot[10]; + std::list<std::string> m_listHistory; + std::list<Gtk::Widget *> m_listSensitiveWhenPlaying; + Gtk::Tooltips m_oTooltips; + SigC::Connection m_oEmuSig; *************** *** 254,264 **** void vInitConfig(); void vCheckConfig(); ! void vLoadConfig(const std::string & _sFilename); ! void vSaveConfig(const std::string & _sFilename); void vLoadKeymap(); void vUpdateScreen(); void vDrawDefaultScreen(); void vSetDefaultTitle(); ! bool bLoadROM(const std::string & _rsFilename); void vLoadBattery(); void vSaveBattery(); --- 263,278 ---- void vInitConfig(); void vCheckConfig(); ! void vLoadConfig(const std::string & _rsFile); ! void vSaveConfig(const std::string & _rsFile); ! void vLoadHistoryFromConfig(); ! void vSaveHistoryToConfig(); ! void vHistoryAdd(const std::string & _rsFile); ! void vClearHistoryMenu(); ! void vUpdateHistoryMenu(); void vLoadKeymap(); void vUpdateScreen(); void vDrawDefaultScreen(); void vSetDefaultTitle(); ! bool bLoadROM(const std::string & _rsFile); void vLoadBattery(); void vSaveBattery(); Index: configfile.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/configfile.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** configfile.h 15 Apr 2004 03:58:45 -0000 1.2 --- configfile.h 3 May 2004 17:00:27 -0000 1.3 *************** *** 128,132 **** public: File(); ! File(const std::string & _rsFilename); virtual ~File(); --- 128,132 ---- public: File(); ! File(const std::string & _rsFile); virtual ~File(); *************** *** 135,142 **** Section * poGetSection(const std::string & _rsName); void vRemoveSection(const std::string & _rsName); ! void vLoad(const std::string & _rsFilename, bool _bAddSection = true, bool _bAddKey = true); ! void vSave(const std::string & _rsFilename); void vClear(); --- 135,142 ---- Section * poGetSection(const std::string & _rsName); void vRemoveSection(const std::string & _rsName); ! void vLoad(const std::string & _rsFile, bool _bAddSection = true, bool _bAddKey = true); ! void vSave(const std::string & _rsFile); void vClear(); Index: configfile.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/configfile.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** configfile.cpp 15 Apr 2004 03:58:45 -0000 1.2 --- configfile.cpp 3 May 2004 17:00:27 -0000 1.3 *************** *** 98,104 **** } ! File::File(const string & _rsFilename) { ! vLoad(_rsFilename); } --- 98,104 ---- } ! File::File(const string & _rsFile) { ! vLoad(_rsFile); } *************** *** 161,169 **** } ! void File::vLoad(const string & _rsFilename, bool _bAddSection, bool _bAddKey) { ! string sBuffer = Glib::file_get_contents(_rsFilename); Section * poSection = NULL; char ** lines = g_strsplit(sBuffer.c_str(), "\n", 0); --- 161,169 ---- } ! void File::vLoad(const string & _rsFile, bool _bAddSection, bool _bAddKey) { ! string sBuffer = Glib::file_get_contents(_rsFile); Section * poSection = NULL; char ** lines = g_strsplit(sBuffer.c_str(), "\n", 0); *************** *** 211,217 **** } ! void File::vSave(const string & _rsFilename) { ! Glib::RefPtr<IOChannel> poFile = IOChannel::create_from_file(_rsFilename, "w"); poFile->set_encoding(""); --- 211,217 ---- } ! void File::vSave(const string & _rsFile) { ! Glib::RefPtr<IOChannel> poFile = IOChannel::create_from_file(_rsFile, "w"); poFile->set_encoding(""); Index: Makefile.in =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/Makefile.in,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.in 1 May 2004 14:03:58 -0000 1.4 --- Makefile.in 3 May 2004 17:00:26 -0000 1.5 *************** *** 165,168 **** --- 165,169 ---- intl.h \ main.cpp \ + menuitem.h \ screenarea.cpp \ screenarea.h \ Index: window.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/window.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** window.cpp 1 May 2004 14:03:59 -0000 1.12 --- window.cpp 3 May 2004 17:00:27 -0000 1.13 *************** *** 33,36 **** --- 33,37 ---- #include "../Util.h" + #include "menuitem.h" #include "tools.h" #include "intl.h" *************** *** 119,122 **** --- 120,124 ---- } + vLoadHistoryFromConfig(); vLoadKeymap(); *************** *** 180,183 **** --- 182,200 ---- poMI->signal_activate().connect(SigC::slot(*this, &Window::vOnFileExit)); + // Recent menu + // + m_poRecentMenu = dynamic_cast<Gtk::Menu *>(_poXml->get_widget("RecentMenu_menu")); + vUpdateHistoryMenu(); + + poMI = dynamic_cast<Gtk::MenuItem *>(_poXml->get_widget("RecentReset")); + poMI->signal_activate().connect(SigC::slot(*this, &Window::vOnRecentReset)); + + poCMI = dynamic_cast<Gtk::CheckMenuItem *>(_poXml->get_widget("RecentFreeze")); + poCMI->set_active(m_poHistoryConfig->oGetKey<bool>("freeze")); + vOnRecentFreezeToggled(poCMI); + poCMI->signal_toggled().connect(SigC::bind<Gtk::CheckMenuItem *>( + SigC::slot(*this, &Window::vOnRecentFreezeToggled), + poCMI)); + // Frameskip menu // *************** *** 709,712 **** --- 726,730 ---- { vOnFileClose(); + vSaveHistoryToConfig(); vSaveConfig(m_sConfigFile); *************** *** 797,800 **** --- 815,833 ---- m_oConfig.vClear(); + // History section + // + m_poHistoryConfig = m_oConfig.poAddSection("History"); + m_poHistoryConfig->vSetKey("freeze", false ); + m_poHistoryConfig->vSetKey("0", "" ); + m_poHistoryConfig->vSetKey("1", "" ); + m_poHistoryConfig->vSetKey("2", "" ); + m_poHistoryConfig->vSetKey("3", "" ); + m_poHistoryConfig->vSetKey("4", "" ); + m_poHistoryConfig->vSetKey("5", "" ); + m_poHistoryConfig->vSetKey("6", "" ); + m_poHistoryConfig->vSetKey("7", "" ); + m_poHistoryConfig->vSetKey("8", "" ); + m_poHistoryConfig->vSetKey("9", "" ); + // Directories section // *************** *** 999,1007 **** } ! void Window::vLoadConfig(const std::string & _sFilename) { try { ! m_oConfig.vLoad(_sFilename, false, false); } catch (const Glib::Error & e) --- 1032,1040 ---- } ! void Window::vLoadConfig(const std::string & _rsFile) { try { ! m_oConfig.vLoad(_rsFile, false, false); } catch (const Glib::Error & e) *************** *** 1018,1026 **** } ! void Window::vSaveConfig(const std::string & _sFilename) { try { ! m_oConfig.vSave(_sFilename); } catch (const Glib::Error & e) --- 1051,1059 ---- } ! void Window::vSaveConfig(const std::string & _rsFile) { try { ! m_oConfig.vSave(_rsFile); } catch (const Glib::Error & e) *************** *** 1037,1040 **** --- 1070,1151 ---- } + void Window::vLoadHistoryFromConfig() + { + char csKey[] = "0"; + for (int i = 0; i < 10; i++, csKey[0]++) + { + std::string sFile = m_poHistoryConfig->sGetKey(csKey); + if (sFile == "") + { + break; + } + m_listHistory.push_back(sFile); + } + } + + void Window::vSaveHistoryToConfig() + { + char csKey[] = "0"; + for (std::list<std::string>::const_iterator it = m_listHistory.begin(); + it != m_listHistory.end(); + it++, csKey[0]++) + { + m_poHistoryConfig->vSetKey(csKey, *it); + } + } + + void Window::vHistoryAdd(const std::string & _rsFile) + { + if (m_poHistoryConfig->oGetKey<bool>("freeze")) + { + return; + } + + m_listHistory.remove(_rsFile); + m_listHistory.push_front(_rsFile); + if (m_listHistory.size() > 10) + { + m_listHistory.pop_back(); + } + + vUpdateHistoryMenu(); + } + + void Window::vClearHistoryMenu() + { + Gtk::Menu_Helpers::MenuList::iterator it = m_poRecentMenu->items().begin(); + for (int i = 0; i < 3; i++, it++) + ; + + m_poRecentMenu->items().erase(it, m_poRecentMenu->items().end()); + } + + void Window::vUpdateHistoryMenu() + { + vClearHistoryMenu(); + + guint uiAccelKey = GDK_F1; + for (std::list<std::string>::const_iterator it = m_listHistory.begin(); + it != m_listHistory.end(); + it++, uiAccelKey++) + { + Gtk::Image * poImage = Gtk::manage(new Gtk::Image(Gtk::Stock::OPEN, Gtk::ICON_SIZE_MENU)); + Glib::ustring sLabel = Glib::path_get_basename(*it); + VBA::ImageMenuItem * poIMI = Gtk::manage(new VBA::ImageMenuItem(*poImage, sLabel)); + + m_oTooltips.set_tip(*poIMI, *it); + + poIMI->signal_activate().connect(SigC::bind<std::string>( + SigC::slot(*this, &Window::vOnRecent), + *it)); + + poIMI->set_accel_key(Gtk::AccelKey(uiAccelKey, Gdk::CONTROL_MASK)); + poIMI->accelerate(*this); + + poIMI->show(); + m_poRecentMenu->items().push_back(*poIMI); + } + } + void Window::vLoadKeymap() { *************** *** 1214,1228 **** } ! bool Window::bLoadROM(const std::string & _rsFilename) { vOnFileClose(); ! m_sRomFile = _rsFilename; ! const char * csFilename = _rsFilename.c_str(); ! IMAGE_TYPE eType = utilFindType(csFilename); if (eType == IMAGE_UNKNOWN) { ! systemMessage(0, _("Unknown file type %s"), csFilename); return false; } --- 1325,1339 ---- } ! bool Window::bLoadROM(const std::string & _rsFile) { vOnFileClose(); ! m_sRomFile = _rsFile; ! const char * csFile = _rsFile.c_str(); ! IMAGE_TYPE eType = utilFindType(csFile); if (eType == IMAGE_UNKNOWN) { ! systemMessage(0, _("Unknown file type %s"), csFile); return false; } *************** *** 1231,1235 **** if (eType == IMAGE_GB) { ! bLoaded = gbLoadRom(csFilename); if (bLoaded) { --- 1342,1346 ---- if (eType == IMAGE_GB) { ! bLoaded = gbLoadRom(csFile); if (bLoaded) { *************** *** 1240,1244 **** else if (eType == IMAGE_GBA) { ! int iSize = CPULoadRom(csFilename); bLoaded = (iSize > 0); if (bLoaded) --- 1351,1355 ---- else if (eType == IMAGE_GBA) { ! int iSize = CPULoadRom(csFile); bLoaded = (iSize > 0); if (bLoaded) *************** *** 1263,1267 **** if (! bLoaded) { ! systemMessage(0, _("Failed to load file %s"), csFilename); return false; } --- 1374,1378 ---- if (! bLoaded) { ! systemMessage(0, _("Failed to load file %s"), csFile); return false; } *************** *** 1284,1287 **** --- 1395,1399 ---- vUpdateGameSlots(); + vHistoryAdd(_rsFile); for (std::list<Gtk::Widget *>::iterator it = m_listSensitiveWhenPlaying.begin(); Index: vba.glade =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/vba.glade,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** vba.glade 29 Apr 2004 01:44:36 -0000 1.8 --- vba.glade 3 May 2004 17:00:27 -0000 1.9 *************** *** 51,55 **** <child internal-child="image"> ! <widget class="GtkImage" id="image106"> <property name="visible">True</property> <property name="stock">gtk-open</property> --- 51,55 ---- <child internal-child="image"> ! <widget class="GtkImage" id="image108"> <property name="visible">True</property> <property name="stock">gtk-open</property> *************** *** 367,370 **** --- 367,398 ---- <property name="label" translatable="yes">Rece_nt</property> <property name="use_underline">True</property> + + <child> + <widget class="GtkMenu" id="RecentMenu_menu"> + + <child> + <widget class="GtkMenuItem" id="RecentReset"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Reset</property> + <property name="use_underline">True</property> + </widget> + </child> + + <child> + <widget class="GtkCheckMenuItem" id="RecentFreeze"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Freeze</property> + <property name="use_underline">True</property> + <property name="active">False</property> + </widget> + </child> + + <child> + <widget class="GtkSeparatorMenuItem" id="separator29"> + <property name="visible">True</property> + </widget> + </child> + </widget> + </child> </widget> </child> *************** *** 427,431 **** <child internal-child="image"> ! <widget class="GtkImage" id="image107"> <property name="visible">True</property> <property name="stock">gtk-close</property> --- 455,459 ---- <child internal-child="image"> ! <widget class="GtkImage" id="image109"> <property name="visible">True</property> <property name="stock">gtk-close</property> *************** *** 448,452 **** <child internal-child="image"> ! <widget class="GtkImage" id="image108"> <property name="visible">True</property> <property name="stock">gtk-quit</property> --- 476,480 ---- <child internal-child="image"> ! <widget class="GtkImage" id="image110"> <property name="visible">True</property> <property name="stock">gtk-quit</property> Index: windowcallbacks.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/windowcallbacks.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** windowcallbacks.cpp 29 Apr 2004 01:44:36 -0000 1.1 --- windowcallbacks.cpp 3 May 2004 17:00:27 -0000 1.2 *************** *** 169,172 **** --- 169,188 ---- } + void Window::vOnRecentReset() + { + m_listHistory.clear(); + vClearHistoryMenu(); + } + + void Window::vOnRecentFreezeToggled(Gtk::CheckMenuItem * _poCMI) + { + m_poHistoryConfig->vSetKey("freeze", _poCMI->get_active()); + } + + void Window::vOnRecent(std::string _sFile) + { + bLoadROM(_sFile); + } + void Window::vOnFileClose() { |
From: S?bastien G. <kx...@us...> - 2004-05-03 16:58:47
|
Update of /cvsroot/vba/VisualBoyAdvance/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6437 Modified Files: elf.cpp Log Message: Fixed a missing nullify, which caused crashes while switching from elf to gba files. Index: elf.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/elf.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** elf.cpp 9 Mar 2004 11:03:59 -0000 1.15 --- elf.cpp 3 May 2004 16:58:35 -0000 1.16 *************** *** 2982,2987 **** elfFdeCount = 0; } - ELFcie *cie = elfCies; while(cie) { ELFcie *next = cie->next; --- 2982,2987 ---- elfFdeCount = 0; } + ELFcie *cie = elfCies; while(cie) { ELFcie *next = cie->next; *************** *** 2989,2992 **** --- 2989,2993 ---- cie = next; } + elfCies = NULL; if(elfFileData) { |
From: S?bastien G. <kx...@us...> - 2004-05-01 14:04:36
|
Update of /cvsroot/vba/VisualBoyAdvance/src/gb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13445/src/gb Modified Files: Makefile.in Log Message: Added gtkmm 2.4 support. Index: Makefile.in =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gb/Makefile.in,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Makefile.in 29 Mar 2004 22:08:39 -0000 1.8 --- Makefile.in 1 May 2004 14:03:57 -0000 1.9 *************** *** 64,67 **** --- 64,68 ---- GMSGFMT = @GMSGFMT@ GTKMM_CFLAGS = @GTKMM_CFLAGS@ + GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ INSTALL_DATA = @INSTALL_DATA@ |
From: S?bastien G. <kx...@us...> - 2004-05-01 14:04:35
|
Update of /cvsroot/vba/VisualBoyAdvance/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13445/src Modified Files: Makefile.in Log Message: Added gtkmm 2.4 support. Index: Makefile.in =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/Makefile.in,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Makefile.in 29 Mar 2004 22:08:39 -0000 1.18 --- Makefile.in 1 May 2004 14:03:57 -0000 1.19 *************** *** 64,67 **** --- 64,68 ---- GMSGFMT = @GMSGFMT@ GTKMM_CFLAGS = @GTKMM_CFLAGS@ + GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ INSTALL_DATA = @INSTALL_DATA@ |
From: S?bastien G. <kx...@us...> - 2004-05-01 14:04:35
|
Update of /cvsroot/vba/VisualBoyAdvance/po In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13445/po Modified Files: POTFILES.in fr.gmo fr.po vba-1.7.2.pot Log Message: Added gtkmm 2.4 support. Index: fr.po =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/po/fr.po,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** fr.po 16 Apr 2004 01:12:01 -0000 1.4 --- fr.po 1 May 2004 14:03:56 -0000 1.5 *************** *** 10,15 **** "Project-Id-Version: VisualBoyAdvance 1.7.2\n" "Report-Msgid-Bugs-To: undefined\n" ! "POT-Creation-Date: 2004-04-16 03:04+0200\n" ! "PO-Revision-Date: 2004-04-16 03:04+0200\n" "Last-Translator: Sébastien Guignot <kx...@ts...>\n" "Language-Team: French <@>\n" --- 10,15 ---- "Project-Id-Version: VisualBoyAdvance 1.7.2\n" "Report-Msgid-Bugs-To: undefined\n" ! "POT-Creation-Date: 2004-05-01 15:56+0200\n" [...1249 lines suppressed...] msgstr "Le chargement du fichier %s a échoué" ! #: src/gtk/window.cpp:1319 msgid "Loaded battery" msgstr "Sauvegarde chargée" ! #: src/gtk/window.cpp:1338 msgid "Saved battery" msgstr "Sauvegarde effectuée" ! #: src/gtk/window.cpp:1396 src/gtk/window.cpp:1443 ! msgid "----/--/-- --:--:--" ! msgstr "" ! ! #: src/gtk/window.cpp:1428 ! msgid "%Y/%m/%d %H:%M:%S" ! msgstr "" ! ! #~ msgid "Use old synchronization" ! #~ msgstr "Utiliser l'ancienne synchronisation" Index: POTFILES.in =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/po/POTFILES.in,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** POTFILES.in 29 Mar 2004 22:08:38 -0000 1.1 --- POTFILES.in 1 May 2004 14:03:56 -0000 1.2 *************** *** 2,4 **** --- 2,5 ---- src/gtk/vba.glade + src/gtk/windowcallbacks.cpp src/gtk/window.cpp Index: vba-1.7.2.pot =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/po/vba-1.7.2.pot,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** vba-1.7.2.pot 16 Apr 2004 01:12:01 -0000 1.4 --- vba-1.7.2.pot 1 May 2004 14:03:57 -0000 1.5 *************** *** 9,13 **** "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: undefined\n" ! "POT-Creation-Date: 2004-04-16 03:04+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" --- 9,13 ---- "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: undefined\n" ! "POT-Creation-Date: 2004-05-01 15:56+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" [...1243 lines suppressed...] ! #: src/gtk/window.cpp:1265 #, c-format msgid "Failed to load file %s" msgstr "" ! #: src/gtk/window.cpp:1319 msgid "Loaded battery" msgstr "" ! #: src/gtk/window.cpp:1338 msgid "Saved battery" msgstr "" ! #: src/gtk/window.cpp:1396 src/gtk/window.cpp:1443 ! msgid "----/--/-- --:--:--" ! msgstr "" ! ! #: src/gtk/window.cpp:1428 ! msgid "%Y/%m/%d %H:%M:%S" msgstr "" Index: fr.gmo =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/po/fr.gmo,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 Binary files /tmp/cvsHHFC6r and /tmp/cvsGzbvn9 differ |
From: S?bastien G. <kx...@us...> - 2004-05-01 14:04:34
|
Update of /cvsroot/vba/VisualBoyAdvance/m4 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13445/m4 Modified Files: Makefile.in Log Message: Added gtkmm 2.4 support. Index: Makefile.in =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/m4/Makefile.in,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.in 29 Mar 2004 22:08:38 -0000 1.1 --- Makefile.in 1 May 2004 14:03:55 -0000 1.2 *************** *** 64,67 **** --- 64,68 ---- GMSGFMT = @GMSGFMT@ GTKMM_CFLAGS = @GTKMM_CFLAGS@ + GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ INSTALL_DATA = @INSTALL_DATA@ |
From: S?bastien G. <kx...@us...> - 2004-05-01 14:04:33
|
Update of /cvsroot/vba/VisualBoyAdvance In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13445 Modified Files: Makefile.in configure configure.in Log Message: Added gtkmm 2.4 support. Index: Makefile.in =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/Makefile.in,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Makefile.in 29 Mar 2004 22:08:37 -0000 1.11 --- Makefile.in 1 May 2004 14:03:51 -0000 1.12 *************** *** 64,67 **** --- 64,68 ---- GMSGFMT = @GMSGFMT@ GTKMM_CFLAGS = @GTKMM_CFLAGS@ + GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ INSTALL_DATA = @INSTALL_DATA@ Index: configure =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/configure,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** configure 25 Apr 2004 19:05:59 -0000 1.22 --- configure 1 May 2004 14:03:51 -0000 1.23 *************** *** 310,314 **** #endif" ! ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LIBICONV LTLIBICONV INTLLIBS LIBINTL LTLIBINTL POSUB GETTEXT_PACKAGE YACC LEX LEXLIB LEX_OUTPUT_ROOT CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE RANLIB ac_ct_RANLIB NASM CPP EGREP SDL_CONFIG SDL_CFLAGS SDL_LIBS PKG_CONFIG GTKMM_CFLAGS GTKMM_LIBS VBA_EXTRA VBA_LIBS LIBOBJS LTLIBOBJS' ac_subst_files='' --- 310,314 ---- #endif" ! ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LIBICONV LTLIBICONV INTLLIBS LIBINTL LTLIBINTL POSUB GETTEXT_PACKAGE YACC LEX LEXLIB LEX_OUTPUT_ROOT CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE RANLIB ac_ct_RANLIB NASM CPP EGREP SDL_CONFIG SDL_CFLAGS SDL_LIBS PKG_CONFIG GTKMM_CFLAGS GTKMM_LIBS GTKMM_CPPFLAGS VBA_EXTRA VBA_LIBS LIBOBJS LTLIBOBJS' ac_subst_files='' *************** *** 866,870 **** --enable-profiling enable profiling (default is yes) --enable-sdl build the SDL frontend (default is yes) ! --enable-gtk build the GTK+ frontend (default is no) --enable-dev enable development features (default is yes) --disable-nls do not use Native Language Support --- 866,870 ---- --enable-profiling enable profiling (default is yes) --enable-sdl build the SDL frontend (default is yes) ! --enable-gtk=VERSION build the GTK+ frontend (default is no) --enable-dev enable development features (default is yes) --disable-nls do not use Native Language Support *************** *** 1870,1875 **** enableval="$enable_gtk" else ! enable_gtk=no fi; --- 1870,1886 ---- enableval="$enable_gtk" + if test "x$enable_gtk" != xno; then + enable_gtk=yes + if test "x$enableval" = xyes; then + gtk_version=2.0 + else + gtk_version=$enableval + fi + fi + else ! ! enable_gtk=no ! fi; *************** *** 8186,8190 **** fi ! SDL_VERSION=1.2.2 # Check whether --with-sdl-prefix or --without-sdl-prefix was given. --- 8197,8202 ---- fi ! if test "x$enable_sdl" = xyes || test "x$enable_gtk" = xyes; then ! SDL_VERSION=1.2.2 # Check whether --with-sdl-prefix or --without-sdl-prefix was given. *************** *** 8472,8476 **** SDL_LIBS="" ! { { echo "$as_me:$LINENO: error: *** Couldn't find SDL library (version >= $SDL_VERSION)." >&5 echo "$as_me: error: *** Couldn't find SDL library (version >= $SDL_VERSION)." >&2;} { (exit 1); exit 1; }; } --- 8484,8488 ---- SDL_LIBS="" ! { { echo "$as_me:$LINENO: error: *** Couldn't find SDL library (version >= $SDL_VERSION)." >&5 echo "$as_me: error: *** Couldn't find SDL library (version >= $SDL_VERSION)." >&2;} { (exit 1); exit 1; }; } *************** *** 8481,8484 **** --- 8493,8497 ---- rm -f conf.sdltest + fi if test "x$enable_sdl" = xyes; then *************** *** 8690,8697 **** PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then ! echo "$as_me:$LINENO: checking for gtkmm-2.0 libglademm-2.0 >= 2.1.0" >&5 ! echo $ECHO_N "checking for gtkmm-2.0 libglademm-2.0 >= 2.1.0... $ECHO_C" >&6 ! if $PKG_CONFIG --exists "gtkmm-2.0 libglademm-2.0 >= 2.1.0" ; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 --- 8703,8710 ---- PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then ! echo "$as_me:$LINENO: checking for gtkmm-$gtk_version >= 2.0.0 libglademm-$gtk_version >= 2.1.0" >&5 ! echo $ECHO_N "checking for gtkmm-$gtk_version >= 2.0.0 libglademm-$gtk_version >= 2.1.0... $ECHO_C" >&6 ! if $PKG_CONFIG --exists "gtkmm-$gtk_version >= 2.0.0 libglademm-$gtk_version >= 2.1.0" ; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 *************** *** 8700,8704 **** echo "$as_me:$LINENO: checking GTKMM_CFLAGS" >&5 echo $ECHO_N "checking GTKMM_CFLAGS... $ECHO_C" >&6 ! GTKMM_CFLAGS=`$PKG_CONFIG --cflags "gtkmm-2.0 libglademm-2.0 >= 2.1.0"` echo "$as_me:$LINENO: result: $GTKMM_CFLAGS" >&5 echo "${ECHO_T}$GTKMM_CFLAGS" >&6 --- 8713,8717 ---- echo "$as_me:$LINENO: checking GTKMM_CFLAGS" >&5 echo $ECHO_N "checking GTKMM_CFLAGS... $ECHO_C" >&6 ! GTKMM_CFLAGS=`$PKG_CONFIG --cflags "gtkmm-$gtk_version >= 2.0.0 libglademm-$gtk_version >= 2.1.0"` echo "$as_me:$LINENO: result: $GTKMM_CFLAGS" >&5 echo "${ECHO_T}$GTKMM_CFLAGS" >&6 *************** *** 8706,8710 **** echo "$as_me:$LINENO: checking GTKMM_LIBS" >&5 echo $ECHO_N "checking GTKMM_LIBS... $ECHO_C" >&6 ! GTKMM_LIBS=`$PKG_CONFIG --libs "gtkmm-2.0 libglademm-2.0 >= 2.1.0"` echo "$as_me:$LINENO: result: $GTKMM_LIBS" >&5 echo "${ECHO_T}$GTKMM_LIBS" >&6 --- 8719,8723 ---- echo "$as_me:$LINENO: checking GTKMM_LIBS" >&5 echo $ECHO_N "checking GTKMM_LIBS... $ECHO_C" >&6 ! GTKMM_LIBS=`$PKG_CONFIG --libs "gtkmm-$gtk_version >= 2.0.0 libglademm-$gtk_version >= 2.1.0"` echo "$as_me:$LINENO: result: $GTKMM_LIBS" >&5 echo "${ECHO_T}$GTKMM_LIBS" >&6 *************** *** 8714,8718 **** ## If we have a custom action on failure, don't print errors, but ## do set a variable so people can do so. ! GTKMM_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gtkmm-2.0 libglademm-2.0 >= 2.1.0"` echo $GTKMM_PKG_ERRORS fi --- 8727,8731 ---- ## If we have a custom action on failure, don't print errors, but ## do set a variable so people can do so. ! GTKMM_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gtkmm-$gtk_version >= 2.0.0 libglademm-$gtk_version >= 2.1.0"` echo $GTKMM_PKG_ERRORS fi *************** *** 8729,8734 **** : else ! { { echo "$as_me:$LINENO: error: Library requirements (gtkmm-2.0 libglademm-2.0 >= 2.1.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 ! echo "$as_me: error: Library requirements (gtkmm-2.0 libglademm-2.0 >= 2.1.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} { (exit 1); exit 1; }; } fi --- 8742,8747 ---- : else ! { { echo "$as_me:$LINENO: error: Library requirements (gtkmm-$gtk_version >= 2.0.0 libglademm-$gtk_version >= 2.1.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 ! echo "$as_me: error: Library requirements (gtkmm-$gtk_version >= 2.0.0 libglademm-$gtk_version >= 2.1.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} { (exit 1); exit 1; }; } fi *************** *** 8736,8739 **** --- 8749,8756 ---- + if test "x$gtk_version" = x2.0; then + GTKMM_CPPFLAGS="-DGTKMM20" + fi + VBA_EXTRA="$VBA_EXTRA gtk" fi *************** *** 9526,9529 **** --- 9543,9547 ---- s,@GTKMM_CFLAGS@,$GTKMM_CFLAGS,;t t s,@GTKMM_LIBS@,$GTKMM_LIBS,;t t + s,@GTKMM_CPPFLAGS@,$GTKMM_CPPFLAGS,;t t s,@VBA_EXTRA@,$VBA_EXTRA,;t t s,@VBA_LIBS@,$VBA_LIBS,;t t Index: configure.in =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/configure.in,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** configure.in 25 Apr 2004 19:06:16 -0000 1.21 --- configure.in 1 May 2004 14:03:55 -0000 1.22 *************** *** 36,41 **** AC_ARG_ENABLE(gtk, ! AC_HELP_STRING([--enable-gtk],[build the GTK+ frontend (default is no)]), ! , enable_gtk=no) AC_ARG_ENABLE(dev, --- 36,51 ---- AC_ARG_ENABLE(gtk, ! AC_HELP_STRING([--enable-gtk[=VERSION]],[build the GTK+ frontend (default is no)]),[ ! if test "x$enable_gtk" != xno; then ! enable_gtk=yes ! if test "x$enableval" = xyes; then ! gtk_version=2.0 ! else ! gtk_version=$enableval ! fi ! fi ! ],[ ! enable_gtk=no ! ]) AC_ARG_ENABLE(dev, *************** *** 119,127 **** fi ! SDL_VERSION=1.2.2 ! AM_PATH_SDL($SDL_VERSION,[ ! ],[ ! AC_MSG_ERROR([*** Couldn't find SDL library (version >= $SDL_VERSION).]) ! ]) if test "x$enable_sdl" = xyes; then --- 129,139 ---- fi ! if test "x$enable_sdl" = xyes || test "x$enable_gtk" = xyes; then ! SDL_VERSION=1.2.2 ! AM_PATH_SDL($SDL_VERSION,[ ! ],[ ! AC_MSG_ERROR([*** Couldn't find SDL library (version >= $SDL_VERSION).]) ! ]) ! fi if test "x$enable_sdl" = xyes; then *************** *** 131,137 **** if test "x$enable_gtk" = xyes; then AC_CHECK_HEADERS(libintl.h) ! PKG_CHECK_MODULES(GTKMM, gtkmm-2.0 libglademm-2.0 >= 2.1.0) AC_SUBST(GTKMM_CFLAGS) AC_SUBST(GTKMM_LIBS) VBA_EXTRA="$VBA_EXTRA gtk" fi --- 143,153 ---- if test "x$enable_gtk" = xyes; then AC_CHECK_HEADERS(libintl.h) ! PKG_CHECK_MODULES(GTKMM, gtkmm-$gtk_version >= 2.0.0 libglademm-$gtk_version >= 2.1.0) AC_SUBST(GTKMM_CFLAGS) AC_SUBST(GTKMM_LIBS) + if test "x$gtk_version" = x2.0; then + GTKMM_CPPFLAGS="-DGTKMM20" + fi + AC_SUBST(GTKMM_CPPFLAGS) VBA_EXTRA="$VBA_EXTRA gtk" fi |
From: S?bastien G. <kx...@us...> - 2004-05-01 14:04:11
|
Update of /cvsroot/vba/VisualBoyAdvance/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13445/win32 Modified Files: Makefile.in Log Message: Added gtkmm 2.4 support. Index: Makefile.in =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/win32/Makefile.in,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Makefile.in 29 Mar 2004 22:08:56 -0000 1.7 --- Makefile.in 1 May 2004 14:04:03 -0000 1.8 *************** *** 64,67 **** --- 64,68 ---- GMSGFMT = @GMSGFMT@ GTKMM_CFLAGS = @GTKMM_CFLAGS@ + GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ INSTALL_DATA = @INSTALL_DATA@ |
From: S?bastien G. <kx...@us...> - 2004-05-01 14:04:11
|
Update of /cvsroot/vba/VisualBoyAdvance/src/prof In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13445/src/prof Modified Files: Makefile.in Log Message: Added gtkmm 2.4 support. Index: Makefile.in =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/prof/Makefile.in,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.in 29 Mar 2004 22:08:40 -0000 1.5 --- Makefile.in 1 May 2004 14:04:02 -0000 1.6 *************** *** 64,67 **** --- 64,68 ---- GMSGFMT = @GMSGFMT@ GTKMM_CFLAGS = @GTKMM_CFLAGS@ + GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ INSTALL_DATA = @INSTALL_DATA@ |
From: S?bastien G. <kx...@us...> - 2004-05-01 14:04:11
|
Update of /cvsroot/vba/VisualBoyAdvance/src/gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13445/src/gtk Modified Files: Makefile.am Makefile.in main.cpp system.cpp window.cpp window.h Added Files: sigccompat.h Log Message: Added gtkmm 2.4 support. Index: main.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/main.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** main.cpp 2 Apr 2004 01:22:17 -0000 1.2 --- main.cpp 1 May 2004 14:03:59 -0000 1.3 *************** *** 45,48 **** --- 45,51 ---- { Gtk::MessageDialog oDialog(e.what(), + #ifndef GTKMM20 + false, + #endif // ! GTKMM20 Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE); Index: Makefile.am =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.am 29 Apr 2004 01:44:35 -0000 1.3 --- Makefile.am 1 May 2004 14:03:58 -0000 1.4 *************** *** 14,17 **** --- 14,18 ---- screenarea.cpp \ screenarea.h \ + sigccompat.h \ system.cpp \ tools.cpp \ *************** *** 26,30 **** -DPKGDATADIR=\"$(pkgdatadir)\" \ -DLOCALEDIR=\"$(datadir)/locale\" \ ! -DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" gvba_CXXFLAGS = @GTKMM_CFLAGS@ @SDL_CFLAGS@ --- 27,32 ---- -DPKGDATADIR=\"$(pkgdatadir)\" \ -DLOCALEDIR=\"$(datadir)/locale\" \ ! -DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \ ! $(GTKMM_CPPFLAGS) gvba_CXXFLAGS = @GTKMM_CFLAGS@ @SDL_CFLAGS@ Index: system.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/system.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** system.cpp 25 Apr 2004 19:02:44 -0000 1.5 --- system.cpp 1 May 2004 14:03:59 -0000 1.6 *************** *** 78,81 **** --- 78,84 ---- Gtk::MessageDialog oDialog(*GUI(), csMsg, + #ifndef GTKMM20 + false, + #endif // ! GTKMM20 Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK); Index: window.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/window.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** window.h 29 Apr 2004 01:44:36 -0000 1.11 --- window.h 1 May 2004 14:04:02 -0000 1.12 *************** *** 23,26 **** --- 23,30 ---- #include <sys/types.h> + #ifndef GTKMM20 + # include "sigccompat.h" + #endif // ! GTKMM20 + #include <libglademm.h> #include <gtkmm.h> Index: window.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/window.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** window.cpp 29 Apr 2004 01:44:36 -0000 1.11 --- window.cpp 1 May 2004 14:03:59 -0000 1.12 *************** *** 1009,1012 **** --- 1009,1015 ---- Gtk::MessageDialog oDialog(*this, e.what(), + #ifndef GTKMM20 + false, + #endif // ! GTKMM20 Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE); *************** *** 1025,1028 **** --- 1028,1034 ---- Gtk::MessageDialog oDialog(*this, e.what(), + #ifndef GTKMM20 + false, + #endif // ! GTKMM20 Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE); Index: Makefile.in =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/Makefile.in,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.in 29 Apr 2004 01:44:36 -0000 1.3 --- Makefile.in 1 May 2004 14:03:58 -0000 1.4 *************** *** 64,67 **** --- 64,68 ---- GMSGFMT = @GMSGFMT@ GTKMM_CFLAGS = @GTKMM_CFLAGS@ + GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ INSTALL_DATA = @INSTALL_DATA@ *************** *** 166,169 **** --- 167,171 ---- screenarea.cpp \ screenarea.h \ + sigccompat.h \ system.cpp \ tools.cpp \ *************** *** 179,183 **** -DPKGDATADIR=\"$(pkgdatadir)\" \ -DLOCALEDIR=\"$(datadir)/locale\" \ ! -DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" --- 181,186 ---- -DPKGDATADIR=\"$(pkgdatadir)\" \ -DLOCALEDIR=\"$(datadir)/locale\" \ ! -DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \ ! $(GTKMM_CPPFLAGS) --- NEW FILE: sigccompat.h --- // -*- C++ -*- // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. // Copyright (C) 1999-2003 Forgotten // Copyright (C) 2004 Forgotten and the VBA development team // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2, or(at your option) // any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software Foundation, // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef __VBA_SIGCCOMPAT_H__ #define __VBA_SIGCCOMPAT_H__ #undef LIBSIGC_DISABLE_DEPRECATED #include <sigc++/bind.h> #include <sigc++/connection.h> #include <sigc++/slot.h> #include <sigc++/object.h> #include <sigc++/functors/mem_fun.h> namespace SigC { template <class T_return, class T_obj1, class T_obj2> inline Slot0<T_return> slot( T_obj1& _A_obj, T_return (T_obj2::*_A_func)() ) { return ::sigc::bound_mem_functor0<T_return, T_obj2> (dynamic_cast< T_obj1&>(_A_obj), _A_func); } template <class T_return, class T_arg1, class T_obj1, class T_obj2> inline Slot1<T_return, T_arg1> slot( T_obj1& _A_obj, T_return (T_obj2::*_A_func)(T_arg1) ) { return ::sigc::bound_mem_functor1<T_return, T_obj2, T_arg1> (dynamic_cast< T_obj1&>(_A_obj), _A_func); } template <class T_return, class T_arg1,class T_arg2, class T_obj1, class T_obj2> inline Slot2<T_return, T_arg1,T_arg2> slot( T_obj1& _A_obj, T_return (T_obj2::*_A_func)(T_arg1,T_arg2) ) { return ::sigc::bound_mem_functor2<T_return, T_obj2, T_arg1,T_arg2> (dynamic_cast< T_obj1&>(_A_obj), _A_func); } } // namespace SigC #endif // __VBA_SIGCCOMPAT_H__ |