/* static */ void GeblGuiExtension::SampleMenuCallBack(void *appPtr,FsGuiPopUpMenu *,FsGuiPopUpMenuItem *)
{
	auto &guiExtension=*(GeblGuiExtension *)appPtr;
	auto &canvas=*guiExtension.canvasPtr;

	if(NULL!=canvas.Slhd())
	{
		YsShellExtEdit &shl=*(YsShellExtEdit *)canvas.Slhd();

		YsWString msg(L"Extension Menu Sample\n");

		YsString str;
		YsWString wStr;

		str.Printf("Number of vertices=%d\n",(int)shl.GetNumVertex());
		wStr.SetUTF8String(str);
		msg.Append(wStr);

		str.Printf("Number of polygons=%d\n",(int)shl.GetNumPolygon());
		wStr.SetUTF8String(str);
		msg.Append(wStr);

		msg.Append(L"You can write your own function in gui_extension/ysgebl_gui_extension.cpp.\n");

		canvas.MessageDialog(L"Extension Sample",msg);
	}
}
YSRESULT YsSpecialPath::GetUserDir(YsWString &wpath)
{
	YsString path;
	if(YSOK==GetUserDir(path))
	{
		wpath.SetUTF8String(path);
		return YSOK;
	}
	return YSERR;
}
YSRESULT YsSpecialPath::GetProgramFileName(YsWString &wpath)
{
	YsString path;
	if(YSOK==GetProgramFileName(path))
	{
		wpath.SetUTF8String(path);
		return YSOK;
	}
	return YSERR;
}
YSRESULT YsSpecialPath::GetUserDir(YsWString &wpath)
{
	const char *homeDir=getenv("HOME");
	if(NULL!=homeDir)
	{
		wpath.SetUTF8String(homeDir);
		return YSOK;
	}
	return YSERR;
}
Beispiel #5
0
int main(int ac,char *av[])
{
	if(2<=ac)
	{
		YsWString wstr;
		wstr.SetUTF8String(av[1]);
		Parser parser;
		parser.Parse(wstr);
		parser.Print();
	}
	return 0;
}
YSRESULT YsSystemEncodingToUnicode(YsWString &unicode,const char systemEncoding[])
{
	unicode.SetUTF8String(systemEncoding);
	return YSOK;
}