• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ UnityBerkeliumWindow类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Universe类代码示例发布时间:2022-05-31
下一篇:
C++ Units类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap