本文整理汇总了C++中UnityBerkeliumWindow类的典型用法代码示例。如果您正苦于以下问题:C++ UnityBerkeliumWindow类的具体用法?C++ UnityBerkeliumWindow怎么用?C++ UnityBerkeliumWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UnityBerkeliumWindow类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Berkelium_Window_executeJavascript
/// Thanks to agentdm
PLUGIN_API void Berkelium_Window_executeJavascript(int windowID, char* javaScript)
{
cerr << "Javascript call made: " << javaScript << endl;
UnityBerkeliumWindow *pWindow = getWindow(windowID);
size_t scriptLength = ::strlen(javaScript);
wchar_t *wctStrJScript = 0;
// Convert to Wchar ( is there an easier way to do this? )
#if 1
std::wstring wideString = Berkelium::UTF8ToWide(Berkelium::UTF8String::point_to(javaScript, scriptLength)).data();
wctStrJScript = new wchar_t[wideString.length() + 1];
memcpy(wctStrJScript, wideString.data(), wideString.length() * sizeof(wchar_t));
wctStrJScript[wideString.length()] = 0;
#else
wctStrJScript = new wchar_t[scriptLength + 1];
MultiByteToWideChar( CP_ACP, 0, javaScript, scriptLength, wctStrJScript, scriptLength);
wctStrJScript[scriptLength] = 0;
#endif
std::wcerr << "Javascript converted: " << wctStrJScript << endl;
if(pWindow)
pWindow->getBerkeliumWindow()->executeJavascript(Berkelium::WideString::point_to(wctStrJScript, scriptLength));
delete[] wctStrJScript;
}
开发者ID:ivyshao,项目名称:UnityBerkeliumPlugin,代码行数:29,代码来源:UnityBerkeliumPlugin.cpp
示例2: Berkelium_Window_everReceivedTitleUpdate
PLUGIN_API bool Berkelium_Window_everReceivedTitleUpdate(int windowID)
{
UnityBerkeliumWindow *pWindow = getWindow(windowID);
if(pWindow)
return pWindow->everReceivedTitleUpdate();
else
return false;
}
开发者ID:ivyshao,项目名称:UnityBerkeliumPlugin,代码行数:8,代码来源:UnityBerkeliumPlugin.cpp
示例3: Berkelium_Window_mouseUp
PLUGIN_API void Berkelium_Window_mouseUp(int windowID, int button)
{
UnityBerkeliumWindow *pWindow = getWindow(windowID);
if(pWindow)
pWindow->getBerkeliumWindow()->mouseButton(button, false);
else
cerr << "Warning: no berkelium window found with ID " << windowID << "!" << endl;
}
开发者ID:reissgrant,项目名称:UnityBerkeliumPlugin,代码行数:8,代码来源:UnityBerkeliumPlugin.cpp
示例4: getWindow
// TEMP This should be a parameter in the callback function
PLUGIN_API const wchar_t *Berkelium_Window_getLastExternalHostMessage(int windowID)
{
UnityBerkeliumWindow *pWindow = getWindow(windowID);
if(pWindow)
return pWindow->getLastExternalHostMessage().c_str();
else
return L"";
}
开发者ID:ivyshao,项目名称:UnityBerkeliumPlugin,代码行数:9,代码来源:UnityBerkeliumPlugin.cpp
示例5: Berkelium_Window_mouseMove
PLUGIN_API void Berkelium_Window_mouseMove(int windowID, int x, int y)
{
UnityBerkeliumWindow *pWindow = getWindow(windowID);
if(pWindow)
pWindow->getBerkeliumWindow()->mouseMoved(x, y);
else
cerr << "Warning: no berkelium window found with ID " << windowID << "!" << endl;
}
开发者ID:reissgrant,项目名称:UnityBerkeliumPlugin,代码行数:8,代码来源:UnityBerkeliumPlugin.cpp
示例6: Berkelium_Window_isDirty
PLUGIN_API bool Berkelium_Window_isDirty(int windowID){
UnityBerkeliumWindow *pWindow = getWindow(windowID);
if(pWindow){
return pWindow->getDirty();
}else{
cerr << "Warning: no berkelium window found with ID " << windowID << "!" << endl;
return false;
}
}
开发者ID:reissgrant,项目名称:UnityBerkeliumPlugin,代码行数:9,代码来源:UnityBerkeliumPlugin.cpp
示例7: Berkelium_update
PLUGIN_API void Berkelium_update(int windowID)
{
UnityBerkeliumWindow *pWindow = getWindow(windowID);
//set dirty to false, if it needs changing, onPaint will change it to true
pWindow->setDirty(false);
//! @todo We need to call this only once, not for each object
Berkelium::update();
}
开发者ID:reissgrant,项目名称:UnityBerkeliumPlugin,代码行数:10,代码来源:UnityBerkeliumPlugin.cpp
示例8: Berkelium_Window_getLastDirtyRect
// Note: we need this function because I can't get parameters in function pointers to work properly
PLUGIN_API Berkelium::Rect Berkelium_Window_getLastDirtyRect(int windowID)
{
Berkelium::Rect result;
UnityBerkeliumWindow *pWindow = getWindow(windowID);
if(pWindow)
result = pWindow->getLastDirtyRect();
return result;
}
开发者ID:ivyshao,项目名称:UnityBerkeliumPlugin,代码行数:11,代码来源:UnityBerkeliumPlugin.cpp
示例9: Berkelium_Window_textEvent
PLUGIN_API void Berkelium_Window_textEvent(int windowID, char c){
UnityBerkeliumWindow *pWindow = getWindow(windowID);
if(pWindow){
wchar_t outchars[2]; // the structure for passing chars
outchars[0] = c; // the character we want to inject
outchars[1] = 0; //terminating character
pWindow->getBerkeliumWindow()->textEvent(outchars,1);
}else{
cerr << "Warning: no berkelium window found with ID " << windowID << "!" << endl;
}
}
开发者ID:reissgrant,项目名称:UnityBerkeliumPlugin,代码行数:14,代码来源:UnityBerkeliumPlugin.cpp
示例10: Berkelium_Window_keyEvent
PLUGIN_API void Berkelium_Window_keyEvent(int windowID, int key){
UnityBerkeliumWindow *pWindow = getWindow(windowID);
if(pWindow){
bool pressed = true;
int wvmods = 0; //mapGLUTModsToBerkeliumMods(glutGetModifiers());
int vk_code = key; // this is used for backspace as it cannot be passed as char
int scancode = 0;
pWindow->getBerkeliumWindow()->keyEvent(pressed, wvmods, vk_code, scancode);
}else{
cerr << "Warning: no berkelium window found with ID " << windowID << "!" << endl;
}
}
开发者ID:reissgrant,项目名称:UnityBerkeliumPlugin,代码行数:16,代码来源:UnityBerkeliumPlugin.cpp
示例11: Berkelium_Window_executeJavascript
/// Thanks to agentdm
PLUGIN_API void Berkelium_Window_executeJavascript(int windowID, char* javaScript)
{
cerr << "Javascript call made: " << javaScript << endl;
UnityBerkeliumWindow *pWindow = getWindow(windowID);
size_t scriptLength = ::strlen(javaScript);
// Convert to Wchar ( is there an easier way to do this? )
wchar_t *wctStrJScript = new wchar_t[scriptLength + 1];
MultiByteToWideChar( CP_ACP, 0, javaScript, scriptLength, wctStrJScript, scriptLength);
wctStrJScript[scriptLength] = 0;
std::wcerr << "Javascript converted: " << wctStrJScript << endl;
if(pWindow)
pWindow->getBerkeliumWindow()->executeJavascript(Berkelium::WideString::point_to(wctStrJScript, scriptLength));
delete[] wctStrJScript;
}
开发者ID:AngelaLovesDeivl,项目名称:UnityBerkeliumPlugin,代码行数:20,代码来源:UnityBerkeliumPlugin.cpp
示例12: Berkelium_Window_unfocus
PLUGIN_API void Berkelium_Window_unfocus(int windowID)
{
UnityBerkeliumWindow *pWindow = getWindow(windowID);
if(pWindow)
pWindow->getBerkeliumWindow()->unfocus();
}
开发者ID:ivyshao,项目名称:UnityBerkeliumPlugin,代码行数:6,代码来源:UnityBerkeliumPlugin.cpp
示例13: Berkelium_Window_setLoadingStateChanged
PLUGIN_API void Berkelium_Window_setLoadingStateChanged(int windowID, UnityBerkeliumWindow::LoadingStateChangedFunc callback)
{
UnityBerkeliumWindow *pWindow = getWindow(windowID);
if(pWindow)
pWindow->setLoadingStateChanged(callback);
}
开发者ID:AngelaLovesDeivl,项目名称:UnityBerkeliumPlugin,代码行数:6,代码来源:UnityBerkeliumPlugin.cpp
示例14: Berkelium_Window_setExternalHostCallback
PLUGIN_API void Berkelium_Window_setExternalHostCallback(int windowID, UnityBerkeliumWindow::ExternalHostFunc callback)
{
UnityBerkeliumWindow *pWindow = getWindow(windowID);
if(pWindow)
pWindow->setExternalHostCallback(callback);
}
开发者ID:ivyshao,项目名称:UnityBerkeliumPlugin,代码行数:6,代码来源:UnityBerkeliumPlugin.cpp
示例15: Berkelium_Window_textEvent
PLUGIN_API void Berkelium_Window_textEvent(int windowID, wchar_t c)
{
UnityBerkeliumWindow *pWindow = getWindow(windowID);
if(pWindow)
pWindow->getBerkeliumWindow()->textEvent(&c, 1);
}
开发者ID:ivyshao,项目名称:UnityBerkeliumPlugin,代码行数:6,代码来源:UnityBerkeliumPlugin.cpp
示例16: Berkelium_Window_keyEvent
PLUGIN_API void Berkelium_Window_keyEvent(int windowID, bool pressed, int mods, int vk_code, int scancode)
{
UnityBerkeliumWindow *pWindow = getWindow(windowID);
if(pWindow)
pWindow->getBerkeliumWindow()->keyEvent(pressed, mods, vk_code, scancode);
}
开发者ID:ivyshao,项目名称:UnityBerkeliumPlugin,代码行数:6,代码来源:UnityBerkeliumPlugin.cpp
示例17: Berkelium_Window_mouseMove
PLUGIN_API void Berkelium_Window_mouseMove(int windowID, int x, int y)
{
UnityBerkeliumWindow *pWindow = getWindow(windowID);
if(pWindow)
pWindow->getBerkeliumWindow()->mouseMoved(x, y);
}
开发者ID:ivyshao,项目名称:UnityBerkeliumPlugin,代码行数:6,代码来源:UnityBerkeliumPlugin.cpp
示例18: Berkelium_Window_mouseUp
PLUGIN_API void Berkelium_Window_mouseUp(int windowID, int button)
{
UnityBerkeliumWindow *pWindow = getWindow(windowID);
if(pWindow)
pWindow->getBerkeliumWindow()->mouseButton(button, false);
}
开发者ID:ivyshao,项目名称:UnityBerkeliumPlugin,代码行数:6,代码来源:UnityBerkeliumPlugin.cpp
示例19: Berkelium_Window_navigateTo
PLUGIN_API void Berkelium_Window_navigateTo(int windowID, char *url)
{
UnityBerkeliumWindow *pWindow = getWindow(windowID);
if(pWindow)
pWindow->navigateTo(url);
}
开发者ID:ivyshao,项目名称:UnityBerkeliumPlugin,代码行数:6,代码来源:UnityBerkeliumPlugin.cpp
示例20: Berkelium_Window_setNavigationFunctions
PLUGIN_API void Berkelium_Window_setNavigationFunctions(int windowID, char* hookUrl, UnityBerkeliumWindow::NavHookCb navCb, UnityBerkeliumWindow::LoadCb loadCb)
{
UnityBerkeliumWindow *pWindow = getWindow(windowID);
if(pWindow)
pWindow->setNavigationFunctions(hookUrl, navCb, loadCb);
}
开发者ID:ivyshao,项目名称:UnityBerkeliumPlugin,代码行数:6,代码来源:UnityBerkeliumPlugin.cpp
注:本文中的UnityBerkeliumWindow类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论