Backed out changeset f4c0761897c6 EXT-4820([NUX] Viewer dimensions on first-run)

by which "moved LLDisplayInfo to llwindow, implemented getting the width/height of screen for mac os and linux."

--HG--
branch : product-engine
master
Igor Borovkov 2010-03-18 16:31:09 +02:00
parent 48fd4c8d14
commit c67bc96278
13 changed files with 46 additions and 135 deletions

View File

@ -775,6 +775,33 @@ void LLMemoryInfo::stream(std::ostream& s) const
#endif
}
S32 LLDisplayInfo::getDisplayWidth() const
{
#if LL_WINDOWS
return ::GetSystemMetrics(SM_CXVIRTUALSCREEN);
#elif LL_DARWIN
return 1024; //*FIXME
#elif LL_SOLARIS
return 1024; //*FIXME
#else
return 1024; //*FIXME
#endif
}
S32 LLDisplayInfo::getDisplayHeight() const
{
#if LL_WINDOWS
return ::GetSystemMetrics(SM_CYVIRTUALSCREEN);
#elif LL_DARWIN
return 768; //*FIXME
#elif LL_SOLARIS
return 768; //*FIXME
#else
return 768; //*FIXME
#endif
}
std::ostream& operator<<(std::ostream& s, const LLOSInfo& info)
{
info.stream(s);

View File

@ -122,6 +122,22 @@ public:
U32 getPhysicalMemoryClamped() const; ///< Memory size in clamped bytes
};
//=============================================================================
//
// CLASS LLDisplayInfo
class LL_COMMON_API LLDisplayInfo
/*! @brief Class to query the information about some display settings
*/
{
public:
LLDisplayInfo(){}; ///< Default constructor
S32 getDisplayWidth() const; ///< display width
S32 getDisplayHeight() const; ///< display height
};
LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLOSInfo& info);
LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLCPUInfo& info);
LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLMemoryInfo& info);

View File

@ -407,30 +407,3 @@ BOOL LLWindowManager::isWindowValid(LLWindow *window)
{
return sWindowList.find(window) != sWindowList.end();
}
S32 LLDisplayInfo::getDisplayWidth() const
{
#if LL_WINDOWS
return LLWindowWin32::getDisplayWidth();
#elif LL_DARWIN
return LLWindowMacOSX::getDisplayWidth();
#elif LL_SDL
return LLWindowSDL::getDisplayWidth();
#else
return 1024; //*FIXME
#endif
}
S32 LLDisplayInfo::getDisplayHeight() const
{
#if LL_WINDOWS
return LLWindowWin32::getDisplayHeight();
#elif LL_DARWIN
return LLWindowMacOSX::getDisplayHeight();
#elif LL_SDL
return LLWindowSDL::getDisplayHeight();
#else
return 768; //*FIXME
#endif
}

View File

@ -281,19 +281,4 @@ extern const std::string gURLProtocolWhitelistHandler[];
void simpleEscapeString ( std::string& stringIn );
//=============================================================================
//
// CLASS LLDisplayInfo
class LLDisplayInfo
/*! @brief Class to query the information about some display settings
*/
{
public:
LLDisplayInfo(){}; ///< Default constructor
S32 getDisplayWidth() const; ///< display width
S32 getDisplayHeight() const; ///< display height
};
#endif // _LL_window_h_

View File

@ -40,5 +40,4 @@ void setupCocoa();
CursorRef createImageCursor(const char *fullpath, int hotspotX, int hotspotY);
OSErr releaseImageCursor(CursorRef ref);
OSErr setImageCursor(CursorRef ref);
void getScreenSize(int* width, int* height);

View File

@ -116,12 +116,3 @@ OSErr setImageCursor(CursorRef ref)
return noErr;
}
void getScreenSize(int* width, int* height)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSRect screen_rect = [[NSScreen mainScreen] frame];
if (width) *width = (int)(screen_rect.size.width);
if (height) *height = (int)(screen_rect.size.height);
[pool release];
}

View File

@ -3464,26 +3464,6 @@ MASK LLWindowMacOSX::modifiersToMask(SInt16 modifiers)
return mask;
}
// static
S32 LLWindowMacOSX::getDisplayWidth()
{
S32 width = 1024;
// Need to invoke cocoa before use getScreenSize()
setupCocoa();
getScreenSize(&width, NULL);
return width;
}
// static
S32 LLWindowMacOSX::getDisplayHeight()
{
S32 height = 768;
// Need to invoke cocoa before use getScreenSize()
setupCocoa();
getScreenSize(NULL, &height);
return height;
}
#if LL_OS_DRAGDROP_ENABLED
OSErr LLWindowMacOSX::dragTrackingHandler(DragTrackingMessage message, WindowRef theWindow,

View File

@ -123,8 +123,6 @@ public:
// Provide native key event data
/*virtual*/ LLSD getNativeKeyData();
static S32 getDisplayWidth();
static S32 getDisplayHeight();
protected:
LLWindowMacOSX(LLWindowCallbacks* callbacks,

View File

@ -187,47 +187,6 @@ Display* LLWindowSDL::get_SDL_Display(void)
}
#endif // LL_X11
// static
S32 LLWindowSDL::getDisplayWidth()
{
#if LL_GTK
if (LLWindowSDL::ll_try_gtk_init())
{
return gdk_screen_width();
}
#endif // LL_GTK
#if LL_X11
Display *display = XOpenDisplay(NULL);
int screen_num = DefaultScreen(display);
S32 width = DisplayWidth(display, screen_num);
XCloseDisplay(display);
return width;
#endif //LL_X11
return 1024;
}
// static
S32 LLWindowSDL::getDisplayHeight()
{
#if LL_GTK
if (LLWindowSDL::ll_try_gtk_init())
{
return gdk_screen_height();
}
#endif // LL_GTK
#if LL_X11
Display *display = XOpenDisplay(NULL);
int screen_num = DefaultScreen(display);
S32 height = DisplayHeight(display, screen_num);
XCloseDisplay(display);
return height;
#endif //LL_X11
return 768;
}
LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks,
const std::string& title, S32 x, S32 y, S32 width,

View File

@ -148,9 +148,6 @@ public:
static Display* get_SDL_Display(void);
#endif // LL_X11
static S32 getDisplayWidth();
static S32 getDisplayHeight();
protected:
LLWindowSDL(LLWindowCallbacks* callbacks,
const std::string& title, int x, int y, int width, int height, U32 flags,

View File

@ -3714,16 +3714,5 @@ std::vector<std::string> LLWindowWin32::getDynamicFallbackFontList()
return std::vector<std::string>();
}
// static
S32 LLWindowWin32::getDisplayWidth()
{
return ::GetSystemMetrics(SM_CXVIRTUALSCREEN);
}
// static
S32 LLWindowWin32::getDisplayHeight()
{
return ::GetSystemMetrics(SM_CYVIRTUALSCREEN);
}
#endif // LL_WINDOWS

View File

@ -120,9 +120,6 @@ public:
static std::vector<std::string> getDynamicFallbackFontList();
static S32 getDisplayWidth();
static S32 getDisplayHeight();
protected:
LLWindowWin32(LLWindowCallbacks* callbacks,
const std::string& title, const std::string& name, int x, int y, int width, int height, U32 flags,

View File

@ -305,7 +305,7 @@ static std::string gLaunchFileOnQuit;
// Used on Win32 for other apps to identify our window (eg, win_setup)
const char* const VIEWER_WINDOW_CLASSNAME = "Second Life";
static const S32 FIRST_RUN_WINDOW_WIDTH = 1024;
static const S32 FIRST_RUN_WINDOW_HIGHT = 768;
static const S32 FIRST_RUN_WINDOW_HRIGHT = 768;
//----------------------------------------------------------------------------
// List of entries from strings.xml to always replace
@ -2375,12 +2375,12 @@ bool LLAppViewer::initWindow()
if (first_run)//for first login
{
window_width = FIRST_RUN_WINDOW_WIDTH;//yep hardcoded
window_height = FIRST_RUN_WINDOW_HIGHT;
window_height = FIRST_RUN_WINDOW_HRIGHT;
//if screen resolution is lower then 1024*768 then show maximized
LLDisplayInfo display_info;
if(display_info.getDisplayWidth() <= FIRST_RUN_WINDOW_WIDTH
|| display_info.getDisplayHeight()<=FIRST_RUN_WINDOW_HIGHT)
|| display_info.getDisplayHeight()<=FIRST_RUN_WINDOW_HRIGHT)
{
show_maximized = true;
}