mirror of https://github.com/PCSX2/pcsx2.git
wxgui: Fix linux builds and other additions/fixes.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@1491 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
3c195e9f9a
commit
aeaba2ad18
|
@ -28,7 +28,7 @@
|
|||
#define GOOGLE_NAMESPACE google
|
||||
|
||||
/* the location of <hash_fun.h>/<stl_hash_fun.h> */
|
||||
#define HASH_FUN_H <ext/hash_fun.h>
|
||||
#define HASH_FUN_H <backward/hash_fun.h>
|
||||
|
||||
/* the namespace of hash_map/hash_set */
|
||||
#define HASH_NAMESPACE __gnu_cxx
|
||||
|
|
|
@ -178,6 +178,17 @@ extern const CommonHashClass GetCommonHash;
|
|||
struct CommonHashClass
|
||||
{
|
||||
public:
|
||||
hash_key_t DoInt( u32 val ) const
|
||||
{
|
||||
u32 key = val;
|
||||
key = ~key + (key << 15);
|
||||
key = key ^ (key >> 12);
|
||||
key = key + (key << 2);
|
||||
key = key ^ (key >> 4);
|
||||
key = key * 2057;
|
||||
key = key ^ (key >> 16);
|
||||
}
|
||||
|
||||
hash_key_t operator()(const std::string& src) const
|
||||
{
|
||||
return Hash( src.data(), src.length() );
|
||||
|
@ -222,14 +233,7 @@ public:
|
|||
/// </remarks>
|
||||
hash_key_t operator()( const u32 val ) const
|
||||
{
|
||||
u32 key = val;
|
||||
key = ~key + (key << 15);
|
||||
key = key ^ (key >> 12);
|
||||
key = key + (key << 2);
|
||||
key = key ^ (key >> 4);
|
||||
key = key * 2057;
|
||||
key = key ^ (key >> 16);
|
||||
return key;
|
||||
return DoInt(val);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -244,7 +248,7 @@ public:
|
|||
/// </remarks>
|
||||
hash_key_t operator()( const s32 val ) const
|
||||
{
|
||||
return GetCommonHash((u32)val);
|
||||
return DoInt(val);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -508,12 +512,14 @@ public:
|
|||
/// parameter. This is a more favorable alternative to the indexer operator since the
|
||||
/// indexer implementation can and will create new entries for every request that
|
||||
/// </remarks>
|
||||
void TryGetValue( const Key& key, T& outval ) const
|
||||
/*void TryGetValue( const Key& key, T& outval ) const
|
||||
{
|
||||
// GCC doesn't like this for some reason -- says const_iterator can't be found.
|
||||
// Fortunately nothing uses these functions yet, so I just commented them out. --air
|
||||
const_iterator iter = find( key );
|
||||
if( iter != end() )
|
||||
outval = iter->second;
|
||||
}
|
||||
}*/
|
||||
|
||||
const T& GetValue( Key key ) const
|
||||
{
|
||||
|
@ -563,12 +569,13 @@ public:
|
|||
/// parameter. This is a more favorable alternative to the indexer operator since the
|
||||
/// indexer implementation can and will create new entries for every request that
|
||||
/// </remarks>
|
||||
void TryGetValue( const Key& key, T& outval ) const
|
||||
/*void TryGetValue( const Key& key, T& outval ) const
|
||||
{
|
||||
// See above class for notes on why this is commented out.
|
||||
const_iterator iter = find( key );
|
||||
if( iter != end() )
|
||||
outval = iter->second;
|
||||
}
|
||||
}*/
|
||||
|
||||
const T& GetValue( Key key ) const
|
||||
{
|
||||
|
@ -591,7 +598,7 @@ public:
|
|||
virtual ~Dictionary() {}
|
||||
|
||||
Dictionary( int initialCapacity=33, const std::string& emptyKey = "@@-EMPTY-@@", const std::string& deletedKey = "@@-DELETED-@@" ) :
|
||||
HashMap( emptyKey, deletedKey, initialCapacity)
|
||||
HashMap<std::string, T>( emptyKey, deletedKey, initialCapacity)
|
||||
{
|
||||
}
|
||||
private:
|
||||
|
@ -614,8 +621,8 @@ class UnicodeDictionary : public HashMap<std::wstring, T>
|
|||
public:
|
||||
virtual ~UnicodeDictionary() {}
|
||||
|
||||
UnicodeDictionary( int initialCapacity=33, std::wstring emptyKey = "@@-EMPTY-@@", std::wstring deletedKey = "@@-DELETED-@@" ) :
|
||||
HashMap( emptykey, deletedkey, initialCapacity)
|
||||
UnicodeDictionary( int initialCapacity=33, const std::wstring& emptyKey = L"@@-EMPTY-@@", const std::wstring& deletedKey = L"@@-DELETED-@@" ) :
|
||||
HashMap<std::wstring, T>( emptyKey, deletedKey, initialCapacity)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -185,7 +185,7 @@
|
|||
<Unit filename="../IopMem.h" />
|
||||
<Unit filename="../IopSio2.cpp" />
|
||||
<Unit filename="../IopSio2.h" />
|
||||
<Unit filename="../Linux/HostGui.cpp" />
|
||||
<Unit filename="LnxHostSys.cpp" />
|
||||
<Unit filename="../MMI.cpp" />
|
||||
<Unit filename="../MTGS.cpp" />
|
||||
<Unit filename="../Memory.cpp" />
|
||||
|
@ -262,6 +262,8 @@
|
|||
<Unit filename="../gui/ConsoleLogger.cpp" />
|
||||
<Unit filename="../gui/Dialogs/ConfigurationDialog.cpp" />
|
||||
<Unit filename="../gui/Dialogs/ConfigurationDialog.h" />
|
||||
<Unit filename="../gui/Dialogs/ModalPopups.h" />
|
||||
<Unit filename="../gui/Dialogs/PickUserModeDialog.cpp" />
|
||||
<Unit filename="../gui/GameFixesDialog.h" />
|
||||
<Unit filename="../gui/HostGui.cpp" />
|
||||
<Unit filename="../gui/IniInterface.cpp" />
|
||||
|
@ -289,6 +291,8 @@
|
|||
<Unit filename="../gui/Resources/EmbeddedImage.h" />
|
||||
<Unit filename="../gui/Resources/ps2_silver.h" />
|
||||
<Unit filename="../gui/SpeedHacksDialog.h" />
|
||||
<Unit filename="../gui/i18n.cpp" />
|
||||
<Unit filename="../gui/i18n.h" />
|
||||
<Unit filename="../gui/main.cpp" />
|
||||
<Unit filename="../gui/wxHelpers.cpp" />
|
||||
<Unit filename="../gui/wxHelpers.h" />
|
||||
|
|
|
@ -178,6 +178,8 @@ namespace PathDefs
|
|||
extern wxDirName GetSavestates();
|
||||
extern wxDirName GetMemoryCards();
|
||||
extern wxDirName GetSettings();
|
||||
extern wxDirName GetLogs();
|
||||
extern wxDirName GetThemes();
|
||||
}
|
||||
|
||||
namespace FilenameDefs
|
||||
|
|
|
@ -71,8 +71,8 @@ typedef int BOOL;
|
|||
// need a full recompile anyway, when modified (etc)
|
||||
|
||||
#include "zlib/zlib.h"
|
||||
#include "i18n.h"
|
||||
#include "Pcsx2Defs.h"
|
||||
#include "i18n.h"
|
||||
#include "Paths.h"
|
||||
#include "Config.h"
|
||||
#include "Utilities/Console.h"
|
||||
|
|
|
@ -39,16 +39,17 @@ public:
|
|||
virtual ~ConsoleLogFrame();
|
||||
|
||||
// menu callbacks
|
||||
virtual void OnClose(wxCommandEvent& event);
|
||||
virtual void OnClose(wxMenuEvent& event);
|
||||
virtual void OnSave (wxMenuEvent& event);
|
||||
virtual void OnClear(wxMenuEvent& event);
|
||||
|
||||
virtual void OnCloseWindow(wxCloseEvent& event);
|
||||
|
||||
virtual void OnSave (wxCommandEvent& event);
|
||||
virtual void OnClear(wxCommandEvent& event);
|
||||
|
||||
virtual void Write( const wxChar* text );
|
||||
virtual void Write( const char* text );
|
||||
void Newline();
|
||||
|
||||
void Newline();
|
||||
void SetColor( Console::Colors color );
|
||||
void ClearColor();
|
||||
|
||||
|
@ -64,8 +65,6 @@ protected:
|
|||
// common part of OnClose() and OnCloseWindow()
|
||||
virtual void DoClose();
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
void OnMoveAround( wxMoveEvent& evt );
|
||||
void OnResize( wxSizeEvent& evt );
|
||||
};
|
||||
|
|
|
@ -94,11 +94,6 @@ namespace PathDefs
|
|||
{
|
||||
return GetDocuments() + Logs;
|
||||
}
|
||||
|
||||
wxDirName GetDumps()
|
||||
{
|
||||
return GetDocuments() + Dumps;
|
||||
}
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -245,7 +240,7 @@ void i18n_DoPackageCheck( int wxLangId, wxArrayString& destEng, wxArrayString& d
|
|||
//
|
||||
void i18n_EnumeratePackages( wxArrayString& englishNames, wxArrayString& xlatedNames)
|
||||
{
|
||||
for( int li=wxLANGUAGE_ABKHAZIAN; li<wxLANGUAGE_ZULU; ++li )
|
||||
for( int li=wxLANGUAGE_UNKNOWN+1; li<wxLANGUAGE_USER_DEFINED; ++li )
|
||||
{
|
||||
i18n_DoPackageCheck( li, englishNames, xlatedNames );
|
||||
}
|
||||
|
@ -257,8 +252,10 @@ void i18n_EnumeratePackages( wxArrayString& englishNames, wxArrayString& xlatedN
|
|||
// fixme: these won't show up in alphabetical order if they're actually present (however
|
||||
// horribly unlikely that is)... do we care? Probably not.
|
||||
|
||||
i18n_DoPackageCheck( wxLANGUAGE_VALENCIAN, englishNames, xlatedNames );
|
||||
i18n_DoPackageCheck( wxLANGUAGE_SAMI, englishNames, xlatedNames );
|
||||
// Note: These aren't even available in some packaged Linux distros anyway. >_<
|
||||
|
||||
//i18n_DoPackageCheck( wxLANGUAGE_VALENCIAN, englishNames, xlatedNames );
|
||||
//i18n_DoPackageCheck( wxLANGUAGE_SAMI, englishNames, xlatedNames );
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
@ -276,7 +273,6 @@ void AppConfig::LoadSave( IniInterface& ini )
|
|||
ini.Flush();
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
//
|
||||
void AppConfig::Apply()
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
// filename and try to open it, returns true on success (file was opened),
|
||||
// false if file couldn't be opened/created and -1 if the file selection
|
||||
// dialog was canceled
|
||||
//
|
||||
static bool OpenLogFile(wxFile& file, wxString& filename, wxWindow *parent)
|
||||
{
|
||||
filename = wxSaveFileSelector(L"log", L"txt", L"log.txt", parent);
|
||||
|
@ -73,15 +74,6 @@ static bool OpenLogFile(wxFile& file, wxString& filename, wxWindow *parent)
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
||||
BEGIN_EVENT_TABLE(ConsoleLogFrame, wxFrame)
|
||||
// wxLogWindow menu events
|
||||
EVT_MENU(Menu_Close, ConsoleLogFrame::OnClose)
|
||||
EVT_MENU(Menu_Save, ConsoleLogFrame::OnSave)
|
||||
EVT_MENU(Menu_Clear, ConsoleLogFrame::OnClear)
|
||||
EVT_CLOSE(ConsoleLogFrame::OnCloseWindow)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
ConsoleLogFrame::ConsoleLogFrame(MainEmuFrame *parent, const wxString& title) :
|
||||
wxFrame(parent, wxID_ANY, title),
|
||||
m_TextCtrl( *new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
|
||||
|
@ -104,6 +96,11 @@ ConsoleLogFrame::ConsoleLogFrame(MainEmuFrame *parent, const wxString& title) :
|
|||
CreateStatusBar();
|
||||
ClearColor();
|
||||
|
||||
Connect( Menu_Close, wxEVT_COMMAND_MENU_SELECTED, wxMenuEventHandler( ConsoleLogFrame::OnClose ) );
|
||||
Connect( Menu_Save, wxEVT_COMMAND_MENU_SELECTED, wxMenuEventHandler( ConsoleLogFrame::OnSave ) );
|
||||
Connect( Menu_Clear, wxEVT_COMMAND_MENU_SELECTED, wxMenuEventHandler( ConsoleLogFrame::OnClear ) );
|
||||
|
||||
Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler(ConsoleLogFrame::OnCloseWindow) );
|
||||
Connect( wxEVT_MOVE, wxMoveEventHandler(ConsoleLogFrame::OnMoveAround) );
|
||||
Connect( wxEVT_SIZE, wxSizeEventHandler(ConsoleLogFrame::OnResize) );
|
||||
}
|
||||
|
@ -138,15 +135,15 @@ void ConsoleLogFrame::DoClose()
|
|||
wxStaticCast( GetParent(), MainEmuFrame )->OnLogBoxHidden();
|
||||
}
|
||||
|
||||
void ConsoleLogFrame::OnClose(wxCommandEvent& WXUNUSED(event)) { DoClose(); }
|
||||
void ConsoleLogFrame::OnClose(wxMenuEvent& WXUNUSED(event)) { DoClose(); }
|
||||
void ConsoleLogFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) { DoClose(); }
|
||||
|
||||
void ConsoleLogFrame::OnSave(wxCommandEvent& WXUNUSED(event))
|
||||
void ConsoleLogFrame::OnSave(wxMenuEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString filename;
|
||||
wxFile file;
|
||||
int rc = OpenLogFile( file, filename, this );
|
||||
if ( rc == -1 )
|
||||
bool rc = OpenLogFile( file, filename, this );
|
||||
if ( !rc )
|
||||
{
|
||||
// canceled
|
||||
return;
|
||||
|
@ -167,23 +164,24 @@ void ConsoleLogFrame::OnSave(wxCommandEvent& WXUNUSED(event))
|
|||
wxLogStatus(this, L"Log saved to the file '%s'.", filename.c_str());
|
||||
}
|
||||
|
||||
void ConsoleLogFrame::OnClear(wxCommandEvent& WXUNUSED(event))
|
||||
void ConsoleLogFrame::OnClear(wxMenuEvent& WXUNUSED(event))
|
||||
{
|
||||
m_TextCtrl.Clear();
|
||||
}
|
||||
|
||||
static const wxTextAttr tbl_color_codes[] =
|
||||
{
|
||||
// Standard R, G, B format:
|
||||
wxTextAttr( wxColor( 0, 0, 0 ) ),
|
||||
wxTextAttr( wxColor( 255, 0, 0 ) ),
|
||||
wxTextAttr( wxColor( 0,255, 0 ) ),
|
||||
wxTextAttr( wxColor( 255,255, 0 ) ),
|
||||
wxTextAttr( wxColor( 0, 0,255 ) ),
|
||||
wxTextAttr( wxColor( 0,255,255 ) ),
|
||||
wxTextAttr( wxColor( 255,255,255 ) )
|
||||
wxTextAttr( wxColor( 128, 0, 0 ) ),
|
||||
wxTextAttr( wxColor( 0,128, 0 ) ),
|
||||
wxTextAttr( wxColor( 180,180, 0 ) ),
|
||||
wxTextAttr( wxColor( 0, 0,128 ) ),
|
||||
wxTextAttr( wxColor( 0,160,160 ) ),
|
||||
wxTextAttr( wxColor( 160,160,160 ) )
|
||||
};
|
||||
|
||||
static const wxTextAttr color_default( wxColor( 192, 192, 192 ) );
|
||||
static const wxTextAttr color_default( wxColor( 0, 0, 0 ) );
|
||||
|
||||
// Note: SetColor currently does not work on Win32, but I suspect it *should* work when
|
||||
// we enable unicode compilation. (I really hope!)
|
||||
|
|
|
@ -57,6 +57,6 @@ Dialogs::ConfigurationDialog::ConfigurationDialog( wxWindow* parent, int id ) :
|
|||
|
||||
SetSizerAndFit( &mainSizer );
|
||||
|
||||
Center( wxCENTER_ON_SCREEN );
|
||||
Center( wxCENTER_ON_SCREEN | wxBOTH );
|
||||
}
|
||||
|
||||
|
|
|
@ -159,7 +159,7 @@ bool i18n_SetLanguage( int wxLangId )
|
|||
if( !locale->IsOk() )
|
||||
{
|
||||
Console::Notice( wxsFormat( L"SetLanguage: '%s' [%s] is not supported by the operating system",
|
||||
wxLocale::GetLanguageName( locale->GetLanguage() ), locale->GetCanonicalName() )
|
||||
wxLocale::GetLanguageName( locale->GetLanguage() ).c_str(), locale->GetCanonicalName().c_str() )
|
||||
);
|
||||
|
||||
safe_delete( locale );
|
||||
|
@ -169,7 +169,7 @@ bool i18n_SetLanguage( int wxLangId )
|
|||
if( !locale->AddCatalog( L"pcsx2main" ) ) //, wxLANGUAGE_UNKNOWN, NULL ) )
|
||||
{
|
||||
Console::Notice( wxsFormat( L"SetLanguage: Cannot find pcsx2main.mo file for language '%s' [%s]",
|
||||
wxLocale::GetLanguageName( locale->GetLanguage() ), locale->GetCanonicalName() )
|
||||
wxLocale::GetLanguageName( locale->GetLanguage() ).c_str(), locale->GetCanonicalName().c_str() )
|
||||
);
|
||||
safe_delete( locale );
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ Pcsx2App::Pcsx2App() :
|
|||
, m_ToolbarImages( NULL )
|
||||
, m_Bitmap_Logo( NULL )
|
||||
{
|
||||
SetAppName( L"Pcsx2" );
|
||||
SetAppName( L"pcsx2" );
|
||||
}
|
||||
|
||||
wxFrame* Pcsx2App::GetMainWindow() const { return m_MainFrame; }
|
||||
|
|
|
@ -193,7 +193,7 @@ void wxDialogWithHelpers::AddOkCancel( wxBoxSizer &sizer, bool hasApply )
|
|||
// create a sizer to hold the help and ok/cancel buttons, for platforms
|
||||
// that need a custom help icon. [fixme: help icon prolly better off somewhere else]
|
||||
buttonSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
buttonSizer->Add( new wxContextHelpButton(this), wxHelpers::stdButtonSizerFlags.Align( wxALIGN_LEFT ) );
|
||||
buttonSizer->Add( new wxContextHelpButton(this), wxHelpers::SizerFlags::StdButton().Align( wxALIGN_LEFT ) );
|
||||
sizer.Add( buttonSizer, wxSizerFlags().Center() );
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue