Skip to content
Snippets Groups Projects
Commit 32691c44 authored by callum_linden's avatar callum_linden
Browse files

initial support for dropdown menus/select widgits

parent 311b376a
No related branches found
No related tags found
No related merge requests found
...@@ -1536,11 +1536,11 @@ ...@@ -1536,11 +1536,11 @@
<key>archive</key> <key>archive</key>
<map> <map>
<key>hash</key> <key>hash</key>
<string>db32cc2c0d898d69d01ef61df81424e8</string> <string>e632f94b6f94a9563ccdfca6da38fb27</string>
<key>hash_algorithm</key> <key>hash_algorithm</key>
<string>md5</string> <string>md5</string>
<key>url</key> <key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llceflib_3p-llceflib/rev/307893/arch/Darwin/installer/llceflib-1.4.0.307893-darwin-307893.tar.bz2</string> <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llceflib_3p-llceflib/rev/308049/arch/Darwin/installer/llceflib-1.4.0.308049-darwin-308049.tar.bz2</string>
</map> </map>
<key>name</key> <key>name</key>
<string>darwin</string> <string>darwin</string>
...@@ -1550,18 +1550,18 @@ ...@@ -1550,18 +1550,18 @@
<key>archive</key> <key>archive</key>
<map> <map>
<key>hash</key> <key>hash</key>
<string>3c7f10479a6c4e0910df91b195be393f</string> <string>41454f05cea1149d5124d28fc3db6ae0</string>
<key>hash_algorithm</key> <key>hash_algorithm</key>
<string>md5</string> <string>md5</string>
<key>url</key> <key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llceflib_3p-llceflib/rev/307893/arch/CYGWIN/installer/llceflib-1.4.0.307893-windows-307893.tar.bz2</string> <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llceflib_3p-llceflib/rev/308049/arch/CYGWIN/installer/llceflib-1.4.0.308049-windows-308049.tar.bz2</string>
</map> </map>
<key>name</key> <key>name</key>
<string>windows</string> <string>windows</string>
</map> </map>
</map> </map>
<key>version</key> <key>version</key>
<string>1.4.0.307893</string> <string>1.4.0.308049</string>
</map> </map>
<key>llphysicsextensions_source</key> <key>llphysicsextensions_source</key>
<map> <map>
......
...@@ -56,7 +56,7 @@ class MediaPluginCEF : ...@@ -56,7 +56,7 @@ class MediaPluginCEF :
private: private:
bool init(); bool init();
void onPageChangedCallback(unsigned char* pixels, int width, int height); void onPageChangedCallback(unsigned char* pixels, int x, int y, int width, int height, bool is_popup);
void onCustomSchemeURLCallback(std::string url); void onCustomSchemeURLCallback(std::string url);
void onConsoleMessageCallback(std::string message, std::string source, int line); void onConsoleMessageCallback(std::string message, std::string source, int line);
void onStatusMessageCallback(std::string value); void onStatusMessageCallback(std::string value);
...@@ -149,13 +149,31 @@ void MediaPluginCEF::postDebugMessage(const std::string& msg) ...@@ -149,13 +149,31 @@ void MediaPluginCEF::postDebugMessage(const std::string& msg)
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// //
void MediaPluginCEF::onPageChangedCallback(unsigned char* pixels, int width, int height) void MediaPluginCEF::onPageChangedCallback(unsigned char* pixels, int x, int y, int width, int height, bool is_popup)
{ {
if (mPixels && pixels) if (mPixels && pixels)
{ {
if (mWidth == width && mHeight == height) if (is_popup)
{ {
memcpy(mPixels, pixels, mWidth * mHeight * mDepth); for (int line = 0; line < height; ++line)
{
int inverted_y = mHeight - y - height;
int src = line * width * mDepth;
int dst = (inverted_y + line) * mWidth * mDepth + x * mDepth;
if (dst + width * mDepth < mWidth * mHeight * mDepth)
{
memcpy(mPixels + dst, pixels + src, width * mDepth);
}
}
}
else
{
if (mWidth == width && mHeight == height)
{
memcpy(mPixels, pixels, mWidth * mHeight * mDepth);
}
} }
setDirty(0, 0, mWidth, mHeight); setDirty(0, 0, mWidth, mHeight);
} }
...@@ -399,7 +417,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) ...@@ -399,7 +417,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
if (message_name == "init") if (message_name == "init")
{ {
// event callbacks from LLCefLib // event callbacks from LLCefLib
mLLCEFLib->setOnPageChangedCallback(boost::bind(&MediaPluginCEF::onPageChangedCallback, this, _1, _2, _3)); mLLCEFLib->setOnPageChangedCallback(boost::bind(&MediaPluginCEF::onPageChangedCallback, this, _1, _2, _3, _4, _5, _6));
mLLCEFLib->setOnCustomSchemeURLCallback(boost::bind(&MediaPluginCEF::onCustomSchemeURLCallback, this, _1)); mLLCEFLib->setOnCustomSchemeURLCallback(boost::bind(&MediaPluginCEF::onCustomSchemeURLCallback, this, _1));
mLLCEFLib->setOnConsoleMessageCallback(boost::bind(&MediaPluginCEF::onConsoleMessageCallback, this, _1, _2, _3)); mLLCEFLib->setOnConsoleMessageCallback(boost::bind(&MediaPluginCEF::onConsoleMessageCallback, this, _1, _2, _3));
mLLCEFLib->setOnStatusMessageCallback(boost::bind(&MediaPluginCEF::onStatusMessageCallback, this, _1)); mLLCEFLib->setOnStatusMessageCallback(boost::bind(&MediaPluginCEF::onStatusMessageCallback, this, _1));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment