예제 #1
0
bool GiCoreView::setCommand(GiView* view, const char* name, const char* params)
{
    DrawLocker locker(impl);
    GcBaseView* aview = impl->_doc->findView(view);
    bool ret = false;

    if (aview) {
        impl->setView(aview);
        MgJsonStorage s;
        ret = impl->_cmds->setCommand(&impl->motion, name, 
                                      s.storageForRead(params));
    }

    return ret;
}
예제 #2
0
bool GiCoreView::loadFromFile(const char* vgfile)
{
#if defined(_MSC_VER) && _MSC_VER >= 1400 // VC8
    FILE *fp = NULL;
    fopen_s(&fp, vgfile, "rt");
#else
    FILE *fp = fopen(vgfile, "rt");
#endif
    DrawLocker locker(impl);
    MgJsonStorage s;
    bool ret = loadShapes(s.storageForRead(fp));

    if (fp) {
        fclose(fp);
    } else {
        LOGE("Fail to open file: %s", vgfile);
    }

    return ret;
}