diff options
author | AiraYumi <aira.youme@airanyumi.net> | 2024-06-11 14:06:54 +0900 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-06-12 16:43:41 +0300 |
commit | c10e785e338aa63165c614d926ce882f4f116716 (patch) | |
tree | 230579431b0c4470952ef1b67f801c8a00ea4e84 /indra/llwindow | |
parent | 2bf01f80edc28ec998cab0adf3b20e9e7f7f0c4e (diff) |
Replace LL_X11 and LL_FLTK to LL_LINUX
Diffstat (limited to 'indra/llwindow')
-rw-r--r-- | indra/llwindow/llwindowsdl.cpp | 72 | ||||
-rw-r--r-- | indra/llwindow/llwindowsdl.h | 14 |
2 files changed, 43 insertions, 43 deletions
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 218f953c7f..a19aeb80c7 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -66,9 +66,9 @@ static bool ATIbug = false; // LLWindowSDL // -#if LL_X11 +#if LL_LINUX # include <X11/Xutil.h> -#endif //LL_X11 +#endif //LL_LINUX // TOFU HACK -- (*exactly* the same hack as LLWindowMacOSX for a similar // set of reasons): Stash a pointer to the LLWindowSDL object here and @@ -93,7 +93,7 @@ void maybe_unlock_display(void) } -#if LL_X11 +#if LL_LINUX // static Window LLWindowSDL::get_SDL_XWindowID(void) { @@ -111,9 +111,9 @@ Display* LLWindowSDL::get_SDL_Display(void) } return NULL; } -#endif // LL_X11 +#endif // LL_LINUX -#if LL_X11 +#if LL_LINUX // Clipboard handing via native X11, base on the implementation in Cool VL by Henri Beauchamp @@ -382,10 +382,10 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks, mIsMinimized = -1; mFSAASamples = fsaa_samples; -#if LL_X11 +#if LL_LINUX mSDL_XWindowID = None; mSDL_Display = NULL; -#endif // LL_X11 +#endif // LL_LINUX // Assume 4:3 aspect ratio until we know better mOriginalAspectRatio = 1024.0 / 768.0; @@ -410,10 +410,10 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks, // Stash an object pointer for OSMessageBox() gWindowImplementation = this; -#if LL_X11 +#if LL_LINUX mFlashing = FALSE; initialiseX11Clipboard(); -#endif // LL_X11 +#endif // LL_LINUX mKeyVirtualKey = 0; mKeyModifiers = KMOD_NONE; @@ -435,7 +435,7 @@ static SDL_Surface *Load_BMP_Resource(const char *basename) return SDL_LoadBMP(path_buffer); } -#if LL_X11 +#if LL_LINUX // This is an XFree86/XOrg-specific hack for detecting the amount of Video RAM // on this machine. It works by searching /var/log/var/log/Xorg.?.log or // /var/log/XFree86.?.log for a ': (VideoRAM ?|Memory): (%d+) kB' regex, where @@ -572,7 +572,7 @@ static int x11_detect_VRAM_kb() } return rtn; } -#endif // LL_X11 +#endif // LL_LINUX void LLWindowSDL::setTitle(const std::string title) { @@ -800,13 +800,13 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B } // Detect video memory size. -# if LL_X11 +# if LL_LINUX gGLManager.mVRAM = x11_detect_VRAM_kb() / 1024; if (gGLManager.mVRAM != 0) { LL_INFOS() << "X11 log-parser detected " << gGLManager.mVRAM << "MB VRAM." << LL_ENDL; } else -# endif // LL_X11 +# endif // LL_LINUX { // fallback to letting SDL detect VRAM. // note: I've not seen SDL's detection ever actually find @@ -856,7 +856,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B return FALSE; } -#if LL_X11 +#if LL_LINUX /* Grab the window manager specific information */ SDL_SysWMinfo info; SDL_VERSION(&info.version); @@ -879,7 +879,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B LL_WARNS() << "We're not running under any known WM. Wild." << LL_ENDL; } -#endif // LL_X11 +#endif // LL_LINUX SDL_StartTextInput(); @@ -923,12 +923,12 @@ void LLWindowSDL::destroyContext() LL_INFOS() << "destroyContext begins" << LL_ENDL; SDL_StopTextInput(); -#if LL_X11 +#if LL_LINUX mSDL_Display = NULL; mSDL_XWindowID = None; Lock_Display = NULL; Unlock_Display = NULL; -#endif // LL_X11 +#endif // LL_LINUX // Clean up remaining GL state before blowing away window LL_INFOS() << "shutdownGL begins" << LL_ENDL; @@ -1180,7 +1180,7 @@ void LLWindowSDL::setMinSize(U32 min_width, U32 min_height, bool enforce_immedia { LLWindow::setMinSize(min_width, min_height, enforce_immediately); -#if LL_X11 +#if LL_LINUX // Set the minimum size limits for X11 window // so the window manager doesn't allow resizing below those limits. XSizeHints* hints = XAllocSizeHints(); @@ -1278,9 +1278,9 @@ F32 LLWindowSDL::getPixelAspectRatio() void LLWindowSDL::beforeDialog() { bool running_x11 = false; -#if LL_X11 +#if LL_LINUX running_x11 = (mSDL_XWindowID != None); -#endif //LL_X11 +#endif //LL_LINUX LL_INFOS() << "LLWindowSDL::beforeDialog()" << LL_ENDL; @@ -1298,7 +1298,7 @@ void LLWindowSDL::beforeDialog() } } -#if LL_X11 +#if LL_LINUX if (mSDL_Display) { // Everything that we/SDL asked for should happen before we @@ -1307,7 +1307,7 @@ void LLWindowSDL::beforeDialog() XSync(mSDL_Display, False); maybe_unlock_display(); } -#endif // LL_X11 +#endif // LL_LINUX maybe_lock_display(); } @@ -1315,9 +1315,9 @@ void LLWindowSDL::beforeDialog() void LLWindowSDL::afterDialog() { bool running_x11 = false; -#if LL_X11 +#if LL_LINUX running_x11 = (mSDL_XWindowID != None); -#endif //LL_X11 +#endif //LL_LINUX LL_INFOS() << "LLWindowSDL::afterDialog()" << LL_ENDL; @@ -1335,7 +1335,7 @@ void LLWindowSDL::afterDialog() } -#if LL_X11 +#if LL_LINUX // set/reset the XWMHints flag for 'urgency' that usually makes the icon flash void LLWindowSDL::x11_set_urgent(BOOL urgent) { @@ -1361,13 +1361,13 @@ void LLWindowSDL::x11_set_urgent(BOOL urgent) maybe_unlock_display(); } } -#endif // LL_X11 +#endif // LL_LINUX void LLWindowSDL::flashIcon(F32 seconds) { if (getMinimized()) { -#if !LL_X11 +#if !LL_LINUX LL_INFOS() << "Stub LLWindowSDL::flashIcon(" << seconds << ")" << LL_ENDL; #else LL_INFOS() << "X11 LLWindowSDL::flashIcon(" << seconds << ")" << LL_ENDL; @@ -1380,7 +1380,7 @@ void LLWindowSDL::flashIcon(F32 seconds) x11_set_urgent(TRUE); mFlashing = TRUE; -#endif // LL_X11 +#endif // LL_LINUX } } @@ -1550,7 +1550,7 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture) bool newGrab = wantGrab; -#if LL_X11 +#if LL_LINUX if (!mFullscreen) /* only bother if we're windowed anyway */ { if (mSDL_Display) @@ -1590,7 +1590,7 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture) } } } -#endif // LL_X11 +#endif // LL_LINUX // return boolean success for whether we ended up in the desired state return capture == newGrab; } @@ -1994,7 +1994,7 @@ void LLWindowSDL::gatherInput() updateCursor(); -#if LL_X11 +#if LL_LINUX // This is a good time to stop flashing the icon if our mFlashTimer has // expired. if (mFlashing && mFlashTimer.hasExpired()) @@ -2002,7 +2002,7 @@ void LLWindowSDL::gatherInput() x11_set_urgent(FALSE); mFlashing = FALSE; } -#endif // LL_X11 +#endif // LL_LINUX } static SDL_Cursor *makeSDLCursorFromBMP(const char *filename, int hotx, int hoty) @@ -2428,7 +2428,7 @@ void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async) LL_INFOS() << "spawn_web_browser: " << escaped_url << LL_ENDL; #if LL_LINUX -# if LL_X11 +# if LL_LINUX if (mSDL_Display) { maybe_lock_display(); @@ -2436,7 +2436,7 @@ void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async) XSync(mSDL_Display, False); maybe_unlock_display(); } -# endif // LL_X11 +# endif // LL_LINUX std::string cmd, arg; cmd = gDirUtilp->getAppRODataDir(); @@ -2466,7 +2466,7 @@ void LLWindowSDL::bringToFront() // This is currently used when we are 'launched' to a specific // map position externally. LL_INFOS() << "bringToFront" << LL_ENDL; -#if LL_X11 +#if LL_LINUX if (mSDL_Display && !mFullscreen) { maybe_lock_display(); @@ -2474,7 +2474,7 @@ void LLWindowSDL::bringToFront() XSync(mSDL_Display, False); maybe_unlock_display(); } -#endif // LL_X11 +#endif // LL_LINUX } //static diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index d24739cbda..44b031b703 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -35,7 +35,7 @@ #include "SDL2/SDL.h" #include "SDL2/SDL_endian.h" -#if LL_X11 +#if LL_LINUX // get X11-specific headers for use in low-level stuff like copy-and-paste support #include "SDL2/SDL_syswm.h" #endif @@ -184,7 +184,7 @@ public: // Not great that these are public, but they have to be accessible // by non-class code and it's better than making them global. -#if LL_X11 +#if LL_LINUX Window mSDL_XWindowID; Display *mSDL_Display; #endif @@ -193,13 +193,13 @@ public: void (*Unlock_Display)(void); -#if LL_X11 +#if LL_LINUX static Window get_SDL_XWindowID(void); static Display *get_SDL_Display(void); -#endif // LL_X11 +#endif // LL_LINUX void *createSharedContext() override; @@ -282,20 +282,20 @@ protected: friend class LLWindowManager; private: -#if LL_X11 +#if LL_LINUX void x11_set_urgent(BOOL urgent); BOOL mFlashing; LLTimer mFlashTimer; -#endif //LL_X11 +#endif //LL_LINUX U32 mKeyVirtualKey; U32 mKeyModifiers; std::string mInputType; public: -#if LL_X11 +#if LL_LINUX static Display *getSDLDisplay(); |