From f27ea1aff738f3222c782a7fac5b9172fc3cf67c Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 7 Feb 2012 22:50:49 -0800 Subject: EXP-1181 WIP as a designer I would like to specify default floater positions using realtive coordinates fixed build moved conversion funcs to llwindow.cpp as they work on all platforms refactored translateintorect to take overlap as parameter --- indra/llwindow/llwindow.cpp | 39 +++++++++++++++++++++++++++++++++++++++ indra/llwindow/llwindowwin32.cpp | 38 -------------------------------------- 2 files changed, 39 insertions(+), 38 deletions(-) (limited to 'indra/llwindow') diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp index 2e9e31bfea..6834b34387 100644 --- a/indra/llwindow/llwindow.cpp +++ b/indra/llwindow/llwindow.cpp @@ -436,3 +436,42 @@ BOOL LLWindowManager::isWindowValid(LLWindow *window) { return sWindowList.find(window) != sWindowList.end(); } + +//coordinate conversion utility funcs that forward to llwindow +LLCoordCommon LL_COORD_TYPE_WINDOW::convertToCommon() const +{ + const LLCoordWindow& self = static_cast(*this); + + LLWindow* windowp = &(*LLWindow::beginInstances()); + LLCoordGL out; + windowp->convertCoords(self, &out); + return out.convert(); +} + +void LL_COORD_TYPE_WINDOW::convertFromCommon(const LLCoordCommon& from) +{ + LLCoordWindow& self = static_cast(*this); + + LLWindow* windowp = &(*LLWindow::beginInstances()); + LLCoordGL from_gl(from); + windowp->convertCoords(from_gl, &self); +} + +LLCoordCommon LL_COORD_TYPE_SCREEN::convertToCommon() const +{ + const LLCoordScreen& self = static_cast(*this); + + LLWindow* windowp = &(*LLWindow::beginInstances()); + LLCoordGL out; + windowp->convertCoords(self, &out); + return out.convert(); +} + +void LL_COORD_TYPE_SCREEN::convertFromCommon(const LLCoordCommon& from) +{ + LLCoordScreen& self = static_cast(*this); + + LLWindow* windowp = &(*LLWindow::beginInstances()); + LLCoordGL from_gl(from); + windowp->convertCoords(from_gl, &self); +} diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index a8d2836f48..ebc3203f14 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -2560,44 +2560,6 @@ BOOL LLWindowWin32::convertCoords(LLCoordGL from, LLCoordWindow *to) return TRUE; } -LLCoordCommon LL_COORD_TYPE_WINDOW::convertToCommon() const -{ - const LLCoordWindow& self = static_cast(*this); - - LLWindow* windowp = &(*LLWindow::beginInstances()); - LLCoordGL out; - windowp->convertCoords(self, &out); - return out.convert(); -} - -void LL_COORD_TYPE_WINDOW::convertFromCommon(const LLCoordCommon& from) -{ - LLCoordWindow& self = static_cast(*this); - - LLWindow* windowp = &(*LLWindow::beginInstances()); - LLCoordGL from_gl(from); - windowp->convertCoords(from_gl, &self); -} - -LLCoordCommon LL_COORD_TYPE_SCREEN::convertToCommon() const -{ - const LLCoordScreen& self = static_cast(*this); - - LLWindow* windowp = &(*LLWindow::beginInstances()); - LLCoordGL out; - windowp->convertCoords(self, &out); - return out.convert(); -} - -void LL_COORD_TYPE_SCREEN::convertFromCommon(const LLCoordCommon& from) -{ - LLCoordScreen& self = static_cast(*this); - - LLWindow* windowp = &(*LLWindow::beginInstances()); - LLCoordGL from_gl(from); - windowp->convertCoords(from_gl, &self); -} - BOOL LLWindowWin32::convertCoords(LLCoordWindow from, LLCoordGL* to) { S32 client_height; -- cgit v1.2.3