diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2013-09-10 15:30:13 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2013-09-10 15:30:13 -0400 |
commit | e6a68e1f09e4d056b4932111e09c3bff98acf29d (patch) | |
tree | ff6042868eef497f485594d7c45b6c7c45d580b8 /indra/llwindow/llwindowmacosx-objc.h | |
parent | f878b032e8c96c4e4ae752864d7641bba2ea4102 (diff) | |
parent | 55ae6a7962cdc9a9d7d087fbc529d30db9c37013 (diff) |
merge
Diffstat (limited to 'indra/llwindow/llwindowmacosx-objc.h')
-rwxr-xr-x | indra/llwindow/llwindowmacosx-objc.h | 112 |
1 files changed, 110 insertions, 2 deletions
diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index 7893dedda4..32b3bfb078 100755 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -25,13 +25,121 @@ * $/LicenseInfo$ */ +#include <map> +#include <vector> + +typedef std::vector<std::pair<int, bool> > segment_t; + +typedef std::vector<int> segment_lengths; +typedef std::vector<int> segment_standouts; + +struct attributedStringInfo { + segment_lengths seg_lengths; + segment_standouts seg_standouts; +}; // This will actually hold an NSCursor*, but that type is only available in objective C. typedef void *CursorRef; +typedef void *NSWindowRef; +typedef void *GLViewRef; + +// These are defined in llappviewermacosx.cpp. +bool initViewer(); +void handleQuit(); +bool runMainLoop(); +void initMainLoop(); +void cleanupViewer(); /* Defined in llwindowmacosx-objc.mm: */ +int createNSApp(int argc, const char **argv); void setupCocoa(); +bool pasteBoardAvailable(); +bool copyToPBoard(const unsigned short *str, unsigned int len); +const unsigned short *copyFromPBoard(); CursorRef createImageCursor(const char *fullpath, int hotspotX, int hotspotY); -OSErr releaseImageCursor(CursorRef ref); -OSErr setImageCursor(CursorRef ref); +short releaseImageCursor(CursorRef ref); +short setImageCursor(CursorRef ref); +void setArrowCursor(); +void setIBeamCursor(); +void setPointingHandCursor(); +void setCopyCursor(); +void setCrossCursor(); +void setNotAllowedCursor(); +void hideNSCursor(); +void showNSCursor(); +void hideNSCursorTillMove(bool hide); +void requestUserAttention(); +long showAlert(std::string title, std::string text, int type); + +NSWindowRef createNSWindow(int x, int y, int width, int height); + +#include <OpenGL/OpenGL.h> +GLViewRef createOpenGLView(NSWindowRef window, unsigned int samples, bool vsync); +void glSwapBuffers(void* context); +CGLContextObj getCGLContextObj(GLViewRef view); +unsigned long getVramSize(GLViewRef view); +void getContentViewBounds(NSWindowRef window, float* bounds); +void getWindowSize(NSWindowRef window, float* size); +void setWindowSize(NSWindowRef window, int width, int height); +void getCursorPos(NSWindowRef window, float* pos); +void makeWindowOrderFront(NSWindowRef window); +void convertScreenToWindow(NSWindowRef window, float *coord); +void convertWindowToScreen(NSWindowRef window, float *coord); +void convertScreenToView(NSWindowRef window, float *coord); +void convertRectToScreen(NSWindowRef window, float *coord); +void convertRectFromScreen(NSWindowRef window, float *coord); +void setWindowPos(NSWindowRef window, float* pos); +void closeWindow(NSWindowRef window); +void removeGLView(GLViewRef view); +void makeFirstResponder(NSWindowRef window, GLViewRef view); +void setupInputWindow(NSWindowRef window, GLViewRef view); + +// These are all implemented in llwindowmacosx.cpp. +// This is largely for easier interop between Obj-C and C++ (at least in the viewer's case due to the BOOL vs. BOOL conflict) +bool callKeyUp(unsigned short key, unsigned int mask); +bool callKeyDown(unsigned short key, unsigned int mask); +void callResetKeys(); +bool callUnicodeCallback(wchar_t character, unsigned int mask); +void callRightMouseDown(float *pos, unsigned int mask); +void callRightMouseUp(float *pos, unsigned int mask); +void callLeftMouseDown(float *pos, unsigned int mask); +void callLeftMouseUp(float *pos, unsigned int mask); +void callDoubleClick(float *pos, unsigned int mask); +void callResize(unsigned int width, unsigned int height); +void callMouseMoved(float *pos, unsigned int mask); +void callScrollMoved(float delta); +void callMouseExit(); +void callWindowFocus(); +void callWindowUnfocus(); +void callDeltaUpdate(float *delta, unsigned int mask); +void callMiddleMouseDown(float *pos, unsigned int mask); +void callMiddleMouseUp(float *pos, unsigned int mask); +void callFocus(); +void callFocusLost(); +void callModifier(unsigned int mask); +void callQuitHandler(); +void commitCurrentPreedit(GLViewRef glView); + +#include <string> +void callHandleDragEntered(std::string url); +void callHandleDragExited(std::string url); +void callHandleDragUpdated(std::string url); +void callHandleDragDropped(std::string url); + +// LLPreeditor C bindings. +std::basic_string<wchar_t> getPreeditString(); +void getPreeditSelectionRange(int *position, int *length); +void getPreeditMarkedRange(int *position, int *length); +bool handleUnicodeCharacter(wchar_t c); +void updatePreeditor(unsigned short *str); +void setPreeditMarkedRange(int position, int length); +void resetPreedit(); +int wstring_length(const std::basic_string<wchar_t> & wstr, const int woffset, const int utf16_length, int *unaligned); +void setMarkedText(unsigned short *text, unsigned int *selectedRange, unsigned int *replacementRange, long text_len, attributedStringInfo segments); +void getPreeditLocation(float *location, unsigned int length); +void allowDirectMarkedTextInput(bool allow, GLViewRef glView); + +NSWindowRef getMainAppWindow(); +GLViewRef getGLView(); +unsigned int getModifiers(); |