Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions indra/cmake/00-Common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ endif (LINUX)


if (DARWIN)
# Use rpath loading on macos
set(CMAKE_MACOSX_RPATH TRUE)

# Warnings should be fatal -- thanks, Nicky Perian, for spotting reversed default
set(CLANG_DISABLE_FATAL_WARNINGS OFF)
set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first")
Expand Down
1 change: 0 additions & 1 deletion indra/cmake/CEFPlugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ elseif (DARWIN)
${ARCH_PREBUILT_DIRS_RELEASE}/libcef_dll_wrapper.a
${ARCH_PREBUILT_DIRS_RELEASE}/libdullahan.a
${APPKIT_LIBRARY}
"-F ${CEF_LIBRARY}"
)

elseif (LINUX)
Expand Down
4 changes: 4 additions & 0 deletions indra/cmake/PluginAPI.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# -*- cmake -*-

include(OpenGL)

add_library( ll::pluginlibraries INTERFACE IMPORTED )

if (WINDOWS)
Expand All @@ -13,4 +15,6 @@ if (WINDOWS)
)
endif (WINDOWS)

target_link_libraries( ll::pluginlibraries INTERFACE OpenGL::GL)

target_include_directories( ll::pluginlibraries INTERFACE ${CMAKE_SOURCE_DIR}/llimage ${CMAKE_SOURCE_DIR}/llrender)
2 changes: 1 addition & 1 deletion indra/llfilesystem/lldir_mac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ LLDir_Mac::LLDir_Mac()

mWorkingDir = getCurPath();

mLLPluginDir = mAppRODataDir + mDirDelimiter + "llplugin";
mLLPluginDir = mAppRODataDir + mDirDelimiter + "SLPlugin.app" + mDirDelimiter + "Contents" + mDirDelimiter + "Frameworks";
}
}

Expand Down
2 changes: 1 addition & 1 deletion indra/llplugin/CMakeLists.txt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the additional XML library required for?

Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ list(APPEND llplugin_SOURCE_FILES ${llplugin_HEADER_FILES})

add_library (llplugin ${llplugin_SOURCE_FILES})
target_include_directories( llplugin INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries( llplugin llcommon llmath llrender llmessage )
target_link_libraries( llplugin llcommon llmath llmessage llxml )
add_subdirectory(slplugin)

50 changes: 50 additions & 0 deletions indra/llplugin/llpluginclassmedia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,13 @@ void LLPluginClassMedia::reset()
mLastMouseY = 0;
mStatus = LLPluginClassMediaOwner::MEDIA_NONE;
mSleepTime = 1.0f / 100.0f;
mCanUndo = false;
mCanRedo = false;
mCanCut = false;
mCanCopy = false;
mCanPaste = false;
mCanDoDelete = false;
mCanSelectAll = false;
mMediaName.clear();
mMediaDescription.clear();
mBackgroundColor = LLColor4(1.0f, 1.0f, 1.0f, 1.0f);
Expand Down Expand Up @@ -907,6 +911,18 @@ void LLPluginClassMedia::sendAuthResponse(bool ok, const std::string &username,
sendMessage(message);
}

void LLPluginClassMedia::undo()
{
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_undo");
sendMessage(message);
}

void LLPluginClassMedia::redo()
{
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_redo");
sendMessage(message);
}

void LLPluginClassMedia::cut()
{
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_cut");
Expand All @@ -925,6 +941,24 @@ void LLPluginClassMedia::paste()
sendMessage(message);
}

void LLPluginClassMedia::doDelete()
{
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_delete");
sendMessage(message);
}

void LLPluginClassMedia::selectAll()
{
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_select_all");
sendMessage(message);
}

void LLPluginClassMedia::showPageSource()
{
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_show_source");
sendMessage(message);
}

void LLPluginClassMedia::setUserDataPath(const std::string &user_data_path_cache,
const std::string &username,
const std::string &user_data_path_cef_log)
Expand Down Expand Up @@ -1178,6 +1212,14 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message)
}
else if(message_name == "edit_state")
{
if(message.hasValue("undo"))
{
mCanUndo = message.getValueBoolean("undo");
}
if(message.hasValue("redo"))
{
mCanRedo = message.getValueBoolean("redo");
}
if(message.hasValue("cut"))
{
mCanCut = message.getValueBoolean("cut");
Expand All @@ -1190,6 +1232,14 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message)
{
mCanPaste = message.getValueBoolean("paste");
}
if (message.hasValue("delete"))
{
mCanDoDelete = message.getValueBoolean("delete");
}
if (message.hasValue("select_all"))
{
mCanSelectAll = message.getValueBoolean("select_all");
}
}
else if(message_name == "name_text")
{
Expand Down
25 changes: 21 additions & 4 deletions indra/llplugin/llpluginclassmedia.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#ifndef LL_LLPLUGINCLASSMEDIA_H
#define LL_LLPLUGINCLASSMEDIA_H

#include "llgltypes.h"
#include "llpluginprocessparent.h"
#include "llrect.h"
#include "llpluginclassmediaowner.h"
Expand Down Expand Up @@ -201,6 +200,12 @@ class LLPluginClassMedia : public LLPluginProcessParentOwner

LLPluginClassMediaOwner::EMediaStatus getStatus() const { return mStatus; }

void undo();
bool canUndo() const { return mCanUndo; };

void redo();
bool canRedo() const { return mCanRedo; };

void cut();
bool canCut() const { return mCanCut; };

Expand All @@ -210,6 +215,14 @@ class LLPluginClassMedia : public LLPluginProcessParentOwner
void paste();
bool canPaste() const { return mCanPaste; };

void doDelete();
bool canDoDelete() const { return mCanDoDelete; };

void selectAll();
bool canSelectAll() const { return mCanSelectAll; };

void showPageSource();

// These can be called before init(), and they will be queued and sent before the media init message.
void setUserDataPath(const std::string &user_data_path_cache, const std::string &username, const std::string &user_data_path_cef_log);
void setLanguageCode(const std::string &language_code);
Expand Down Expand Up @@ -351,9 +364,9 @@ class LLPluginClassMedia : public LLPluginProcessParentOwner

bool mTextureParamsReceived; // the mRequestedTexture* fields are only valid when this is true
S32 mRequestedTextureDepth;
LLGLenum mRequestedTextureInternalFormat;
LLGLenum mRequestedTextureFormat;
LLGLenum mRequestedTextureType;
U32 mRequestedTextureInternalFormat;
U32 mRequestedTextureFormat;
U32 mRequestedTextureType;
bool mRequestedTextureSwapBytes;
bool mRequestedTextureCoordsOpenGL;

Expand Down Expand Up @@ -419,9 +432,13 @@ class LLPluginClassMedia : public LLPluginProcessParentOwner

F64 mSleepTime;

bool mCanUndo;
bool mCanRedo;
bool mCanCut;
bool mCanCopy;
bool mCanPaste;
bool mCanDoDelete;
bool mCanSelectAll;

std::string mMediaName;
std::string mMediaDescription;
Expand Down
28 changes: 14 additions & 14 deletions indra/llplugin/slplugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,26 @@ add_executable(SLPlugin
${SLPlugin_SOURCE_FILES}
)

if (WINDOWS)
set_target_properties(SLPlugin
PROPERTIES
LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMTD\""
)
else ()
set_target_properties(SLPlugin
PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/slplugin_info.plist
)
endif ()

target_link_libraries(SLPlugin
llplugin
llmessage
llcommon
ll::pluginlibraries
)

if (DARWIN)
if (WINDOWS)
set_target_properties(SLPlugin
PROPERTIES
LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMTD\""
)
elseif (DARWIN)
set_target_properties(SLPlugin
PROPERTIES
BUILD_WITH_INSTALL_RPATH 1
INSTALL_RPATH "@executable_path/../../../../Frameworks;@executable_path/../Frameworks;@executable_path/../Frameworks/plugins"
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/slplugin_info.plist
)

# Make sure the app bundle has a Resources directory (it will get populated by viewer-manifest.py later)
add_custom_command(
TARGET SLPlugin POST_BUILD
Expand All @@ -58,7 +58,7 @@ if (DARWIN)
-p
${CMAKE_CURRENT_BINARY_DIR}/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,>/SLPlugin.app/Contents/Resources
)
endif (DARWIN)
endif ()

if (LL_TESTS)
ll_deploy_sharedlibs_command(SLPlugin)
Expand Down
2 changes: 1 addition & 1 deletion indra/media_plugins/base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ add_library(media_plugin_base
${media_plugin_base_SOURCE_FILES}
)

target_link_libraries( media_plugin_base llplugin )
target_link_libraries( media_plugin_base llplugin ll::pluginlibraries)
target_include_directories( media_plugin_base INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
10 changes: 1 addition & 9 deletions indra/media_plugins/cef/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,8 @@ if (DARWIN)
PROPERTIES
PREFIX ""
BUILD_WITH_INSTALL_RPATH 1
INSTALL_NAME_DIR "@executable_path"
INSTALL_RPATH "@executable_path/../Frameworks"
LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp"
)

add_custom_command(TARGET media_plugin_cef
POST_BUILD COMMAND ${CMAKE_INSTALL_NAME_TOOL} -change "@executable_path/Chromium Embedded Framework"
"@executable_path/../../../../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework"
"$<TARGET_FILE:media_plugin_cef>"
VERBATIM
COMMENT "Fixing path to CEF Framework"
)

endif (DARWIN)
59 changes: 58 additions & 1 deletion indra/media_plugins/cef/media_plugin_cef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,13 @@ class MediaPluginCEF :
std::string mAuthUsername;
std::string mAuthPassword;
bool mAuthOK;
bool mCanUndo;
bool mCanRedo;
bool mCanCut;
bool mCanCopy;
bool mCanPaste;
bool mCanDelete;
bool mCanSelectAll;
std::string mRootCachePath;
std::string mCefLogFile;
bool mCefLogVerbose;
Expand Down Expand Up @@ -144,9 +148,13 @@ MediaPluginBase(host_send_func, host_user_data)
mAuthUsername = "";
mAuthPassword = "";
mAuthOK = false;
mCanUndo = false;
mCanRedo = false;
mCanCut = false;
mCanCopy = false;
mCanPaste = false;
mCanDelete = false;
mCanSelectAll = false;
mCefLogFile = "";
mCefLogVerbose = false;
mPickedFiles.clear();
Expand Down Expand Up @@ -940,6 +948,14 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
{
authResponse(message_in);
}
if (message_name == "edit_undo")
{
mCEFLib->editUndo();
}
if (message_name == "edit_redo")
{
mCEFLib->editRedo();
}
if (message_name == "edit_cut")
{
mCEFLib->editCut();
Expand All @@ -952,6 +968,18 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
{
mCEFLib->editPaste();
}
if (message_name == "edit_delete")
{
mCEFLib->editDelete();
}
if (message_name == "edit_select_all")
{
mCEFLib->editSelectAll();
}
if (message_name == "edit_show_source")
{
mCEFLib->viewSource();
}
}
else if (message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER)
{
Expand Down Expand Up @@ -1103,14 +1131,31 @@ void MediaPluginCEF::unicodeInput(std::string event, LLSD native_key_data = LLSD
//
void MediaPluginCEF::checkEditState()
{
bool can_undo = mCEFLib->editCanUndo();
bool can_redo = mCEFLib->editCanRedo();
bool can_cut = mCEFLib->editCanCut();
bool can_copy = mCEFLib->editCanCopy();
bool can_paste = mCEFLib->editCanPaste();
bool can_delete = mCEFLib->editCanDelete();
bool can_select_all = mCEFLib->editCanSelectAll();

if ((can_cut != mCanCut) || (can_copy != mCanCopy) || (can_paste != mCanPaste))
if ((can_undo != mCanUndo) || (can_redo != mCanRedo) || (can_cut != mCanCut) || (can_copy != mCanCopy)
|| (can_paste != mCanPaste) || (can_delete != mCanDelete) || (can_select_all != mCanSelectAll))
{
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_state");

if (can_undo != mCanUndo)
{
mCanUndo = can_undo;
message.setValueBoolean("undo", can_undo);
}

if (can_redo != mCanRedo)
{
mCanRedo = can_redo;
message.setValueBoolean("redo", can_redo);
}

if (can_cut != mCanCut)
{
mCanCut = can_cut;
Expand All @@ -1129,6 +1174,18 @@ void MediaPluginCEF::checkEditState()
message.setValueBoolean("paste", can_paste);
}

if (can_delete != mCanDelete)
{
mCanDelete = can_delete;
message.setValueBoolean("delete", can_delete);
}

if (can_select_all != mCanSelectAll)
{
mCanSelectAll = can_select_all;
message.setValueBoolean("select_all", can_select_all);
}

sendMessage(message);
}
}
Expand Down
2 changes: 1 addition & 1 deletion indra/media_plugins/example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if (DARWIN)
PROPERTIES
PREFIX ""
BUILD_WITH_INSTALL_RPATH 1
INSTALL_NAME_DIR "@executable_path"
INSTALL_RPATH "@executable_path/../Frameworks"
LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp"
)

Expand Down
Loading
Loading