summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowwin32.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llwindow/llwindowwin32.h')
-rw-r--r--indra/llwindow/llwindowwin32.h186
1 files changed, 89 insertions, 97 deletions
diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h
index 33fa67ba50..f4964d064e 100644
--- a/indra/llwindow/llwindowwin32.h
+++ b/indra/llwindow/llwindowwin32.h
@@ -28,7 +28,7 @@
#define LL_LLWINDOWWIN32_H
// Limit Windows API to small and manageable set.
-#include "llwin32headerslean.h"
+#include "llwin32headers.h"
#include "llwindow.h"
#include "llwindowcallbacks.h"
@@ -45,84 +45,82 @@ typedef void (*LLW32MsgCallback)(const MSG &msg);
class LLWindowWin32 : public LLWindow
{
public:
- /*virtual*/ void show();
- /*virtual*/ void hide();
- /*virtual*/ void close();
- /*virtual*/ BOOL getVisible();
- /*virtual*/ BOOL getMinimized();
- /*virtual*/ BOOL getMaximized();
- /*virtual*/ BOOL maximize();
- /*virtual*/ void minimize();
- /*virtual*/ void restore();
- /*virtual*/ BOOL getFullscreen();
- /*virtual*/ BOOL getPosition(LLCoordScreen *position);
- /*virtual*/ BOOL getSize(LLCoordScreen *size);
- /*virtual*/ BOOL getSize(LLCoordWindow *size);
- /*virtual*/ BOOL setPosition(LLCoordScreen position);
- /*virtual*/ BOOL setSizeImpl(LLCoordScreen size);
- /*virtual*/ BOOL setSizeImpl(LLCoordWindow size);
- /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL enable_vsync, const LLCoordScreen * const posp = NULL);
- /*virtual*/ void setTitle(const std::string title);
+ void show() override;
+ void hide() override;
+ void close() override;
+ bool getVisible() const override;
+ bool getMinimized() const override;
+ bool getMaximized() const override;
+ bool maximize() override;
+ void minimize() override;
+ void restore() override;
+ bool getPosition(LLCoordScreen *position) const override;
+ bool getSize(LLCoordScreen *size) const override;
+ bool getSize(LLCoordWindow *size) const override;
+ bool setPosition(LLCoordScreen position) override;
+ bool setSizeImpl(LLCoordScreen size) override;
+ bool setSizeImpl(LLCoordWindow size) override;
+ bool switchContext(bool fullscreen, const LLCoordScreen &size, bool enable_vsync, const LLCoordScreen * const posp = NULL) override;
+ void setTitle(const std::string title) override;
void* createSharedContext() override;
void makeContextCurrent(void* context) override;
void destroySharedContext(void* context) override;
- /*virtual*/ void toggleVSync(bool enable_vsync);
- /*virtual*/ BOOL setCursorPosition(LLCoordWindow position);
- /*virtual*/ BOOL getCursorPosition(LLCoordWindow *position);
- /*virtual*/ BOOL getCursorDelta(LLCoordCommon* delta);
- /*virtual*/ void showCursor();
- /*virtual*/ void hideCursor();
- /*virtual*/ void showCursorFromMouseMove();
- /*virtual*/ void hideCursorUntilMouseMove();
- /*virtual*/ BOOL isCursorHidden();
- /*virtual*/ void updateCursor();
- /*virtual*/ ECursorType getCursor() const;
- /*virtual*/ void captureMouse();
- /*virtual*/ void releaseMouse();
- /*virtual*/ void setMouseClipping( BOOL b );
- /*virtual*/ BOOL isClipboardTextAvailable();
- /*virtual*/ BOOL pasteTextFromClipboard(LLWString &dst);
- /*virtual*/ BOOL copyTextToClipboard(const LLWString &src);
- /*virtual*/ void flashIcon(F32 seconds);
- /*virtual*/ F32 getGamma();
- /*virtual*/ BOOL setGamma(const F32 gamma); // Set the gamma
- /*virtual*/ void setFSAASamples(const U32 fsaa_samples);
- /*virtual*/ U32 getFSAASamples();
- /*virtual*/ BOOL restoreGamma(); // Restore original gamma table (before updating gamma)
- /*virtual*/ ESwapMethod getSwapMethod() { return mSwapMethod; }
- /*virtual*/ void gatherInput();
- /*virtual*/ void delayInputProcessing();
- /*virtual*/ void swapBuffers();
- /*virtual*/ void restoreGLContext() {};
+ void toggleVSync(bool enable_vsync) override;
+ bool setCursorPosition(LLCoordWindow position) override;
+ bool getCursorPosition(LLCoordWindow *position) override;
+ bool getCursorDelta(LLCoordCommon* delta) const override;
+ void showCursor() override;
+ void hideCursor() override;
+ void showCursorFromMouseMove() override;
+ void hideCursorUntilMouseMove() override;
+ bool isCursorHidden() override;
+ void updateCursor() override;
+ ECursorType getCursor() const override;
+ void captureMouse() override;
+ void releaseMouse() override;
+ void setMouseClipping( bool b ) override;
+ bool isClipboardTextAvailable() override;
+ bool pasteTextFromClipboard(LLWString &dst) override;
+ bool copyTextToClipboard(const LLWString &src) override;
+ void flashIcon(F32 seconds) override;
+ F32 getGamma() const override;
+ bool setGamma(const F32 gamma) override; // Set the gamma
+ void setFSAASamples(const U32 fsaa_samples) override;
+ U32 getFSAASamples() const override;
+ bool restoreGamma() override; // Restore original gamma table (before updating gamma)
+ void gatherInput(bool app_has_focus) override;
+ void delayInputProcessing() override;
+ void swapBuffers() override;
+ void restoreGLContext() {};
// handy coordinate space conversion routines
- /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to);
- /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to);
- /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordGL *to);
- /*virtual*/ BOOL convertCoords(LLCoordGL from, LLCoordWindow *to);
- /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordGL *to);
- /*virtual*/ BOOL convertCoords(LLCoordGL from, LLCoordScreen *to);
+ bool convertCoords(LLCoordScreen from, LLCoordWindow *to) const override;
+ bool convertCoords(LLCoordWindow from, LLCoordScreen *to) const override;
+ bool convertCoords(LLCoordWindow from, LLCoordGL *to) const override;
+ bool convertCoords(LLCoordGL from, LLCoordWindow *to) const override;
+ bool convertCoords(LLCoordScreen from, LLCoordGL *to) const override;
+ bool convertCoords(LLCoordGL from, LLCoordScreen *to) const override;
- /*virtual*/ LLWindowResolution* getSupportedResolutions(S32 &num_resolutions);
- /*virtual*/ F32 getNativeAspectRatio();
- /*virtual*/ F32 getPixelAspectRatio();
- /*virtual*/ void setNativeAspectRatio(F32 ratio) { mOverrideAspectRatio = ratio; }
+ LLWindowResolution* getSupportedResolutions(S32 &num_resolutions) override;
+ F32 getNativeAspectRatio() override;
+ F32 getPixelAspectRatio() override;
+ void setNativeAspectRatio(F32 ratio) override { mOverrideAspectRatio = ratio; }
- U32 getAvailableVRAMMegabytes() override;
+ bool dialogColorPicker(F32 *r, F32 *g, F32 *b ) override;
- /*virtual*/ BOOL dialogColorPicker(F32 *r, F32 *g, F32 *b );
+ void *getPlatformWindow() override;
+ void bringToFront() override;
+ void focusClient() override;
- /*virtual*/ void *getPlatformWindow();
- /*virtual*/ void bringToFront();
- /*virtual*/ void focusClient();
+ void allowLanguageTextInput(LLPreeditor *preeditor, bool b) override;
+ void setLanguageTextInput( const LLCoordGL & pos ) override;
+ void updateLanguageTextInputArea() override;
+ void interruptLanguageTextInput() override;
+ void spawnWebBrowser(const std::string& escaped_url, bool async) override;
- /*virtual*/ void allowLanguageTextInput(LLPreeditor *preeditor, BOOL b);
- /*virtual*/ void setLanguageTextInput( const LLCoordGL & pos );
- /*virtual*/ void updateLanguageTextInputArea();
- /*virtual*/ void interruptLanguageTextInput();
- /*virtual*/ void spawnWebBrowser(const std::string& escaped_url, bool async);
+ void openFolder(const std::string &path) override;
- /*virtual*/ F32 getSystemUISize();
+ F32 getSystemUISize() override;
LLWindowCallbacks::DragNDropResult completeDragNDropRequest( const LLCoordGL gl_coord, const MASK mask, LLWindowCallbacks::DragNDropAction action, const std::string url );
@@ -130,58 +128,54 @@ public:
static std::vector<std::string> getDynamicFallbackFontList();
static void setDPIAwareness();
- /*virtual*/ void* getDirectInput8();
- /*virtual*/ bool getInputDevices(U32 device_type_filter,
+ void* getDirectInput8() override;
+ bool getInputDevices(U32 device_type_filter,
std::function<bool(std::string&, LLSD&, void*)> osx_callback,
void* win_callback,
- void* userdata);
+ void* userdata) override;
- U32 getRawWParam() { return mRawWParam; }
+ U32 getRawWParam() const { return mRawWParam; }
protected:
LLWindowWin32(LLWindowCallbacks* callbacks,
const std::string& title, const std::string& name, int x, int y, int width, int height, U32 flags,
- BOOL fullscreen, BOOL clearBg, BOOL enable_vsync, BOOL use_gl,
- BOOL ignore_pixel_depth, U32 fsaa_samples, U32 max_cores, U32 max_vram, F32 max_gl_version);
+ bool fullscreen, bool clearBg, bool enable_vsync, bool use_gl,
+ bool ignore_pixel_depth, U32 fsaa_samples, U32 max_cores, F32 max_gl_version);
~LLWindowWin32();
void initCursors();
- void initInputDevices();
HCURSOR loadColorCursor(LPCTSTR name);
- BOOL isValid();
+ bool isValid();
void moveWindow(const LLCoordScreen& position,const LLCoordScreen& size);
- virtual LLSD getNativeKeyData();
+ LLSD getNativeKeyData() const override;
// Changes display resolution. Returns true if successful
- BOOL setDisplayResolution(S32 width, S32 height, S32 bits, S32 refresh);
+ bool setDisplayResolution(S32 width, S32 height, S32 bits, S32 refresh);
// Go back to last fullscreen display resolution.
- BOOL setFullscreenResolution();
+ bool setFullscreenResolution();
// Restore the display resolution to its value before we ran the app.
- BOOL resetDisplayResolution();
+ bool resetDisplayResolution();
- BOOL shouldPostQuit() { return mPostQuit; }
+ bool shouldPostQuit() { return mPostQuit; }
- void fillCompositionForm(const LLRect& bounds, COMPOSITIONFORM *form);
void fillCandidateForm(const LLCoordGL& caret, const LLRect& bounds, CANDIDATEFORM *form);
void fillCharPosition(const LLCoordGL& caret, const LLRect& bounds, const LLRect& control, IMECHARPOSITION *char_position);
void fillCompositionLogfont(LOGFONT *logfont);
U32 fillReconvertString(const LLWString &text, S32 focus, S32 focus_length, RECONVERTSTRING *reconvert_string);
void handleStartCompositionMessage();
void handleCompositionMessage(U32 indexes);
- BOOL handleImeRequests(WPARAM request, LPARAM param, LRESULT *result);
+ bool handleImeRequests(WPARAM request, LPARAM param, LRESULT *result);
protected:
//
// Platform specific methods
//
- BOOL getClientRectInScreenSpace(RECT* rectp);
- void updateJoystick( );
+ bool getClientRectInScreenSpace(RECT* rectp) const;
static LRESULT CALLBACK mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_param, LPARAM l_param);
- static BOOL CALLBACK enumChildWindows(HWND h_wnd, LPARAM l_param);
//
@@ -209,7 +203,7 @@ protected:
MASK mMouseMask;
- static BOOL sIsClassRegistered; // has the window class been registered?
+ static bool sIsClassRegistered; // has the window class been registered?
F32 mCurrentGamma;
U32 mFSAASamples;
@@ -217,16 +211,16 @@ protected:
F32 mMaxGLVersion; // maximum OpenGL version to attempt to use (clamps to 3.2 - 4.6)
WORD mPrevGammaRamp[3][256];
WORD mCurrentGammaRamp[3][256];
- BOOL mCustomGammaSet;
+ bool mCustomGammaSet;
LPWSTR mIconResource;
- BOOL mInputProcessingPaused;
+ bool mInputProcessingPaused;
// The following variables are for Language Text Input control.
// They are all static, since one context is shared by all LLWindowWin32
// instances.
- static BOOL sLanguageTextInputAllowed;
- static BOOL sWinIMEOpened;
+ static bool sLanguageTextInputAllowed;
+ static bool sWinIMEOpened;
static HKL sWinInputLocale;
static DWORD sWinIMEConversionMode;
static DWORD sWinIMESentenceMode;
@@ -245,7 +239,7 @@ protected:
U32 mRawWParam;
U32 mRawLParam;
- BOOL mMouseVanish;
+ bool mMouseVanish;
// Cached values of GetWindowRect and GetClientRect to be used by app thread
void updateWindowRect();
@@ -270,9 +264,9 @@ public:
LLSplashScreenWin32();
virtual ~LLSplashScreenWin32();
- /*virtual*/ void showImpl();
- /*virtual*/ void updateImpl(const std::string& mesg);
- /*virtual*/ void hideImpl();
+ void showImpl() override;
+ void updateImpl(const std::string& mesg) override;
+ void hideImpl() override;
#if LL_WINDOWS
static LRESULT CALLBACK windowProc(HWND h_wnd, UINT u_msg,
@@ -288,8 +282,6 @@ private:
extern LLW32MsgCallback gAsyncMsgCallback;
extern LPWSTR gIconResource;
-static void handleMessage( const MSG& msg );
-
S32 OSMessageBoxWin32(const std::string& text, const std::string& caption, U32 type);
#endif //LL_LLWINDOWWIN32_H