diff options
author | Ansariel <ansariel.hiller@phoenixviewer.com> | 2024-05-22 19:04:52 +0200 |
---|---|---|
committer | Ansariel <ansariel.hiller@phoenixviewer.com> | 2024-05-22 19:04:52 +0200 |
commit | 1b67dd855c41f5a0cda7ec2a68d98071986ca703 (patch) | |
tree | ab243607f74f78200787bba5b9b88f07ef1b966f /indra/llwindow/llwindowmacosx-objc.h | |
parent | 6d6eabca44d08d5b97bfe3e941d2b9687c2246ea (diff) | |
parent | e1623bb276f83a43ce7a197e388720c05bdefe61 (diff) |
Merge remote-tracking branch 'origin/main' into DRTVWR-600-maint-A
# Conflicts:
# autobuild.xml
# indra/cmake/CMakeLists.txt
# indra/cmake/GoogleMock.cmake
# indra/llaudio/llaudioengine_fmodstudio.cpp
# indra/llaudio/llaudioengine_fmodstudio.h
# indra/llaudio/lllistener_fmodstudio.cpp
# indra/llaudio/lllistener_fmodstudio.h
# indra/llaudio/llstreamingaudio_fmodstudio.cpp
# indra/llaudio/llstreamingaudio_fmodstudio.h
# indra/llcharacter/llmultigesture.cpp
# indra/llcharacter/llmultigesture.h
# indra/llimage/llimage.cpp
# indra/llimage/llimagepng.cpp
# indra/llimage/llimageworker.cpp
# indra/llimage/tests/llimageworker_test.cpp
# indra/llmessage/tests/llmockhttpclient.h
# indra/llprimitive/llgltfmaterial.h
# indra/llrender/llfontfreetype.cpp
# indra/llui/llcombobox.cpp
# indra/llui/llfolderview.cpp
# indra/llui/llfolderviewmodel.h
# indra/llui/lllineeditor.cpp
# indra/llui/lllineeditor.h
# indra/llui/lltextbase.cpp
# indra/llui/lltextbase.h
# indra/llui/lltexteditor.cpp
# indra/llui/lltextvalidate.cpp
# indra/llui/lltextvalidate.h
# indra/llui/lluictrl.h
# indra/llui/llview.cpp
# indra/llwindow/llwindowmacosx.cpp
# indra/newview/app_settings/settings.xml
# indra/newview/llappearancemgr.cpp
# indra/newview/llappearancemgr.h
# indra/newview/llavatarpropertiesprocessor.cpp
# indra/newview/llavatarpropertiesprocessor.h
# indra/newview/llbreadcrumbview.cpp
# indra/newview/llbreadcrumbview.h
# indra/newview/llbreastmotion.cpp
# indra/newview/llbreastmotion.h
# indra/newview/llconversationmodel.h
# indra/newview/lldensityctrl.cpp
# indra/newview/lldensityctrl.h
# indra/newview/llface.inl
# indra/newview/llfloatereditsky.cpp
# indra/newview/llfloatereditwater.cpp
# indra/newview/llfloateremojipicker.h
# indra/newview/llfloaterimsessiontab.cpp
# indra/newview/llfloaterprofiletexture.cpp
# indra/newview/llfloaterprofiletexture.h
# indra/newview/llgesturemgr.cpp
# indra/newview/llgesturemgr.h
# indra/newview/llimpanel.cpp
# indra/newview/llimpanel.h
# indra/newview/llinventorybridge.cpp
# indra/newview/llinventorybridge.h
# indra/newview/llinventoryclipboard.cpp
# indra/newview/llinventoryclipboard.h
# indra/newview/llinventoryfunctions.cpp
# indra/newview/llinventoryfunctions.h
# indra/newview/llinventorygallery.cpp
# indra/newview/lllistbrowser.cpp
# indra/newview/lllistbrowser.h
# indra/newview/llpanelobjectinventory.cpp
# indra/newview/llpanelprofile.cpp
# indra/newview/llpanelprofile.h
# indra/newview/llpreviewgesture.cpp
# indra/newview/llsavedsettingsglue.cpp
# indra/newview/llsavedsettingsglue.h
# indra/newview/lltooldraganddrop.cpp
# indra/newview/llurllineeditorctrl.cpp
# indra/newview/llvectorperfoptions.cpp
# indra/newview/llvectorperfoptions.h
# indra/newview/llviewerparceloverlay.cpp
# indra/newview/llviewertexlayer.cpp
# indra/newview/llviewertexturelist.cpp
# indra/newview/macmain.h
# indra/test/test.cpp
Diffstat (limited to 'indra/llwindow/llwindowmacosx-objc.h')
-rw-r--r-- | indra/llwindow/llwindowmacosx-objc.h | 372 |
1 files changed, 186 insertions, 186 deletions
diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index e406f7dd19..609a441d66 100644 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -1,186 +1,186 @@ -/** - * @file llwindowmacosx-objc.h - * @brief Prototypes for functions shared between llwindowmacosx.cpp - * and llwindowmacosx-objc.mm. - * - * $LicenseInfo:firstyear=2006&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLWINDOWMACOSX_OBJC_H -#define LL_LLWINDOWMACOSX_OBJC_H - -#include <map> -#include <vector> -#include <deque> - -//fir CGSize -#include <CoreGraphics/CGGeometry.h> - -typedef std::vector<std::pair<int, bool> > segment_t; - -typedef std::vector<int> segment_lengths; -typedef std::deque<bool> 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; - - -struct NativeKeyEventData { - enum EventType { - KEYUNKNOWN, - KEYUP, - KEYDOWN, - KEYCHAR - }; - - EventType mKeyEvent = KEYUNKNOWN; - uint32_t mEventType = 0; - uint32_t mEventModifiers = 0; - uint32_t mEventKeyCode = 0; - uint32_t mEventChars = 0; - uint32_t mEventUnmodChars = 0; - bool mEventRepeat = false; -}; - -typedef const NativeKeyEventData * NSKeyEventRef; - -// These are defined in llappviewermacosx.cpp. -bool initViewer(); -void handleQuit(); -bool pumpMainLoop(); -void initMainLoop(); -void cleanupViewer(); -void handleUrl(const char* url); -void dispatchUrl(std::string url); - -/* 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); -unsigned short *copyFromPBoard(); -CursorRef createImageCursor(const char *fullpath, int hotspotX, int hotspotY); -short releaseImageCursor(CursorRef ref); -short setImageCursor(CursorRef ref); -void setArrowCursor(); -void setIBeamCursor(); -void setPointingHandCursor(); -void setCopyCursor(); -void setCrossCursor(); -void setNotAllowedCursor(); -void hideNSCursor(); -void showNSCursor(); -bool isCGCursorVisible(); -void hideNSCursorTillMove(bool hide); -void requestUserAttention(); -long showAlert(std::string title, std::string text, int type); -void setResizeMode(bool oldresize, void* glview); - -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); -float getDeviceUnitSize(GLViewRef view); -CGPoint getContentViewBoundsPosition(NSWindowRef window); -CGSize getContentViewBoundsSize(NSWindowRef window); -CGSize getDeviceContentViewSize(NSWindowRef window, GLViewRef view); -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(NSKeyEventRef event, unsigned short key, unsigned int mask); -bool callKeyDown(NSKeyEventRef event, unsigned short key, unsigned int mask, wchar_t character); -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 callMouseDragged(float *pos, unsigned int mask); -void callScrollMoved(float deltaX, float deltaY); -void callMouseExit(); -void callWindowFocus(); -void callWindowUnfocus(); -void callWindowHide(); -void callWindowUnhide(); -void callWindowDidChangeScreen(); -void callDeltaUpdate(float *delta, unsigned int mask); -void callOtherMouseDown(float *pos, unsigned int mask, int button); -void callOtherMouseUp(float *pos, unsigned int mask, int button); -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(); - -#endif // LL_LLWINDOWMACOSX_OBJC_H +/**
+ * @file llwindowmacosx-objc.h
+ * @brief Prototypes for functions shared between llwindowmacosx.cpp
+ * and llwindowmacosx-objc.mm.
+ *
+ * $LicenseInfo:firstyear=2006&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLWINDOWMACOSX_OBJC_H
+#define LL_LLWINDOWMACOSX_OBJC_H
+
+#include <map>
+#include <vector>
+#include <deque>
+
+//fir CGSize
+#include <CoreGraphics/CGGeometry.h>
+
+typedef std::vector<std::pair<int, bool> > segment_t;
+
+typedef std::vector<int> segment_lengths;
+typedef std::deque<bool> 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;
+
+
+struct NativeKeyEventData {
+ enum EventType {
+ KEYUNKNOWN,
+ KEYUP,
+ KEYDOWN,
+ KEYCHAR
+ };
+
+ EventType mKeyEvent = KEYUNKNOWN;
+ uint32_t mEventType = 0;
+ uint32_t mEventModifiers = 0;
+ uint32_t mEventKeyCode = 0;
+ uint32_t mEventChars = 0;
+ uint32_t mEventUnmodChars = 0;
+ bool mEventRepeat = false;
+};
+
+typedef const NativeKeyEventData * NSKeyEventRef;
+
+// These are defined in llappviewermacosx.cpp.
+bool initViewer();
+void handleQuit();
+bool pumpMainLoop();
+void initMainLoop();
+void cleanupViewer();
+void handleUrl(const char* url);
+void dispatchUrl(std::string url);
+
+/* 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);
+unsigned short *copyFromPBoard();
+CursorRef createImageCursor(const char *fullpath, int hotspotX, int hotspotY);
+short releaseImageCursor(CursorRef ref);
+short setImageCursor(CursorRef ref);
+void setArrowCursor();
+void setIBeamCursor();
+void setPointingHandCursor();
+void setCopyCursor();
+void setCrossCursor();
+void setNotAllowedCursor();
+void hideNSCursor();
+void showNSCursor();
+bool isCGCursorVisible();
+void hideNSCursorTillMove(bool hide);
+void requestUserAttention();
+long showAlert(std::string title, std::string text, int type);
+void setResizeMode(bool oldresize, void* glview);
+
+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);
+float getDeviceUnitSize(GLViewRef view);
+CGPoint getContentViewBoundsPosition(NSWindowRef window);
+CGSize getContentViewBoundsSize(NSWindowRef window);
+CGSize getDeviceContentViewSize(NSWindowRef window, GLViewRef view);
+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(NSKeyEventRef event, unsigned short key, unsigned int mask);
+bool callKeyDown(NSKeyEventRef event, unsigned short key, unsigned int mask, wchar_t character);
+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 callMouseDragged(float *pos, unsigned int mask);
+void callScrollMoved(float deltaX, float deltaY);
+void callMouseExit();
+void callWindowFocus();
+void callWindowUnfocus();
+void callWindowHide();
+void callWindowUnhide();
+void callWindowDidChangeScreen();
+void callDeltaUpdate(float *delta, unsigned int mask);
+void callOtherMouseDown(float *pos, unsigned int mask, int button);
+void callOtherMouseUp(float *pos, unsigned int mask, int button);
+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();
+
+#endif // LL_LLWINDOWMACOSX_OBJC_H
|