Removed a couple of things that didn't make sense to continue in eepp.

This commit is contained in:
spartanj
2011-03-12 03:12:19 -03:00
parent a8a61e4f16
commit 97ca65ffbc
10 changed files with 31 additions and 48 deletions

View File

@@ -23,7 +23,7 @@
/**
@TODO Check for endianness problems, and make EEPP endianness agnostic.
@TODO Add backend for SDL 1.3 ( support for Android ). And may be SFML backend ( just for fun ).
@TODO Add backend for SDL 1.3 ( support for Android ). And may be SFML backend ( may be implement as the default build-in backend with sfml-window static linked ).
@TODO Support for Android and iOS.
@TODO Support color cursors \n
SDL 1.2 Not even posible ( win32 and x11 backends for this ready ) \n

View File

@@ -421,22 +421,6 @@ bool MakeDir( const std::string& path, const Uint16& mode ) {
return v == 0;
}
std::string GetWindowsPath() {
#if EE_PLATFORM == EE_PLATFORM_WIN
#ifdef UNICODE
wchar_t Buffer[1024];
GetWindowsDirectory( Buffer, 1024 );
return String( Buffer ).ToUtf8();
#else
char Buffer[1024];
GetWindowsDirectory( Buffer, 1024 );
return std::string( Buffer );
#endif
#else
return std::string( "/usr/bin/" ); // :P
#endif
}
Uint32 MakeHash( const std::string& str ) {
return MakeHash( reinterpret_cast<const Uint8*>( &str[0] ) );
}
@@ -540,33 +524,32 @@ eeInt GetNumCPUs() {
GetSystemInfo(&info);
nprocs = (eeInt) info.dwNumberOfProcessors;
#elif EE_PLATFORM == EE_PLATFORM_LINUX
#elif EE_PLATFORM == EE_PLATFORM_LINUX || EE_PLATFORM == EE_PLATFORM_SOLARIS
nprocs = sysconf(_SC_NPROCESSORS_ONLN);
#elif EE_PLATFORM == EE_PLATFORM_MACOSX
#elif EE_PLATFORM == EE_PLATFORM_MACOSX || EE_PLATFORM == EE_PLATFORM_BSD
int mib[2];
size_t len;
int maxproc = 1;
size_t len = sizeof(int);
mib[0] = CTL_HW;
mib[1] = HW_NCPU;
len = sizeof(maxproc);
// sysctl != 0 == error
if ( sysctl(mib, 2, &maxproc, &len, NULL, NULL == -1) )
return 1;
sysctl( mib, 2, &maxproc, &len, NULL, 0 );
nprocs = maxproc;
#elif EE_PLATFORM == EE_PLATFORM_HAIKU
system_info info;
if ( get_system_info( &info ) == B_OK ) {
return info.cpu_count;
if ( B_OK == get_system_info( &info ) ) {
nprocs = info.cpu_count;
}
#else
#warning GetNumCPUs not implemented on this platform ( it will return 1 ).
#endif
if ( nprocs < 0 )
if ( nprocs < 1 )
nprocs = 1;
return nprocs;

View File

@@ -37,9 +37,6 @@ namespace EE { namespace Utils {
/** Creates a new directory */
bool EE_API MakeDir( const std::string& path, const Uint16& mode = 0770 );
/** @return The default windows directory */
std::string EE_API GetWindowsPath();
/** @return string hash */
Uint32 EE_API MakeHash( const std::string& str );

View File

@@ -88,10 +88,28 @@ void cClipboardSDL::Init() {
mInfo = &( reinterpret_cast<cWindowSDL*> ( mWindow )->mWMinfo );
}
void cClipboardSDL::SetText( const std::string& Text ) {
}
#if defined( EE_X11_PLATFORM )
#ifdef X_HAVE_UTF8_STRING
#define TEXT_FORMAT XInternAtom(display, "UTF8_STRING", False)
#else
#define TEXT_FORMAT XA_STRING
#endif
#endif
void cClipboardSDL::SetText( const String& Text ) {
void cClipboardSDL::SetText( const std::string& Text ) {
#if defined( EE_X11_PLATFORM )
eeWindowHandler display = mInfo->info.x11.display;
X11Window window = mInfo->info.x11.wmwindow;
Atom format = TEXT_FORMAT;
XChangeProperty( display, DefaultRootWindow( display ), XA_CUT_BUFFER0, format, 8, PropModeReplace, (const unsigned char *)Text.c_str(), Text.size() );
if ( XGetSelectionOwner( display, XA_PRIMARY ) != window ) {
XSetSelectionOwner( display, XA_PRIMARY, window, CurrentTime );
}
#elif EE_PLATFORM == EE_PLATFORM_WIN
#endif
}
int cClipboardSDL::clipboard_convert_scrap( int type, char *dst, char *src, int srclen ) {

View File

@@ -21,8 +21,6 @@ class EE_API cClipboardSDL : public cClipboard {
String GetWideText();
void SetText( const std::string& Text );
void SetText( const String& Text );
protected:
friend class cWindowSDL;

View File

@@ -19,9 +19,6 @@ void cClipboardAl::Init() {
void cClipboardAl::SetText( const std::string& Text ) {
}
void cClipboardAl::SetText( const String& Text ) {
}
std::string cClipboardAl::GetText() {
return std::string();
}

View File

@@ -19,8 +19,6 @@ class EE_API cClipboardAl : public cClipboard {
String GetWideText();
void SetText( const std::string& Text );
void SetText( const String& Text );
protected:
friend class cWindowAl;

View File

@@ -17,9 +17,6 @@ void cClipboardNull::Init() {
void cClipboardNull::SetText( const std::string& Text ) {
}
void cClipboardNull::SetText( const String& Text ) {
}
std::string cClipboardNull::GetText() {
return std::string();
}

View File

@@ -15,8 +15,6 @@ class EE_API cClipboardNull : public cClipboard {
String GetWideText();
void SetText( const std::string& Text );
void SetText( const String& Text );
protected:
friend class cWindowNull;

View File

@@ -17,9 +17,6 @@ class cClipboard {
/** Set the current clipboard text */
virtual void SetText( const std::string& Text ) = 0;
/** Set the current clipboard text */
virtual void SetText( const String& Text ) = 0;
cWindow * GetWindow() const;
protected: