Exemplo n.º 1
0
static void
list(const char *root)
{
	atom a = atomString(root);
	int n = vfsList(a, NULL, 0);
	atom name[n];
	vfsList(a, name, n);
	int i;
	for (i=0;i<n;i++) {
		logPrintf("%s",atomToString(name[i]));
	}
}
Exemplo n.º 2
0
        JsonResource::ptr buildWindowResource(const WindowInfo& window)
        {
            Json windowJson = JsonConst::EmptyObject;
            windowJson["id"] = std::to_string(window.window);
            windowJson["name"] = window.title;
            windowJson["state"] = JsonConst::EmptyArray;
            for (Atom atom : window.windowState) {
                const char* state = atomToString(atom);
                if (state) {
                    windowJson["state"].append(state);
                }
            }

            windowJson["comment"] = "";
            windowJson["geometry"] = JsonConst::EmptyObject;
            windowJson["geometry"]["x"] = window.x;
            windowJson["geometry"]["y"] = window.y;
            windowJson["geometry"]["w"] = window.width;
            windowJson["geometry"]["h"] = window.height;
            windowJson["iconUrl"] = std::string("../icons/") +  window.iconName.data();
            addAction(windowJson);
            return std::make_unique<WindowResource>(std::move(windowJson), window.window);
        }
 inline ReturnType operator()( AtomType const & arg ) const
 {
     return atomToString(arg).value();
 }
 inline ReturnType operator()( Atom const & arg ) const
 {
     return Utf16String(atomToString(arg));
 }