Пример #1
0
void ShapeContentGroup::addOpacityProperty(Property<float> *prop)
{
	prop->setTarget(&opacity_);
	addProperty(prop);
}
void bit_timing_loop_ff_2o_base::loadProperties()
{
    addProperty(noutput_item,
                1,
                "noutput_item",
                "noutput_item",
                "readwrite",
                "",
                "external",
                "configure");

    addProperty(a_mu,
                1,
                "a_mu",
                "a_mu",
                "readwrite",
                "",
                "external",
                "configure");

    addProperty(a_no_update,
                true,
                "a_no_update",
                "a_no_update",
                "readwrite",
                "",
                "external",
                "configure");

    addProperty(tap,
                1,
                "tap",
                "tap",
                "readwrite",
                "",
                "external",
                "configure");

    addProperty(rate,
                1,
                "rate",
                "rate",
                "readwrite",
                "",
                "external",
                "configure");

    addProperty(ninput_items_required,
                "ninput_items_required",
                "ninput_items_required",
                "readwrite",
                "",
                "external",
                "configure");

    addProperty(stream_id_map,
                "stream_id_map",
                "stream_id_map",
                "readwrite",
                "",
                "external",
                "configure");

}
Пример #3
0
void DateTimeChooserImpl::writeDocument(WebCore::DocumentWriter& writer)
{
    WebCore::DateComponents date;
    date.setMillisecondsSinceEpochForDate(m_parameters.minimum);
    String minString = date.toString();
    date.setMillisecondsSinceEpochForDate(m_parameters.maximum);
    String maxString = date.toString();
    String stepString = String::number(m_parameters.step);

    addString("<!DOCTYPE html><head><meta charset='UTF-8'><style>\n", writer);
    writer.addData(WebCore::pickerCommonCss, sizeof(WebCore::pickerCommonCss));
    writer.addData(WebCore::calendarPickerCss, sizeof(WebCore::calendarPickerCss));
    CString extraStyle = WebCore::RenderTheme::defaultTheme()->extraCalendarPickerStyleSheet();
    if (extraStyle.length())
        writer.addData(extraStyle.data(), extraStyle.length());
    addString("</style></head><body><div id=main>Loading...</div><script>\n"
               "window.dialogArguments = {\n", writer);
    addProperty("min", minString, writer);
    addProperty("max", maxString, writer);
    addProperty("step", stepString, writer);
    addProperty("required", m_parameters.required, writer);
    addProperty("currentValue", m_parameters.currentValue, writer);
    addProperty("locale", WebCore::defaultLanguage(), writer);
    addProperty("todayLabel", Platform::current()->queryLocalizedString(WebLocalizedString::CalendarToday), writer);
    addProperty("clearLabel", Platform::current()->queryLocalizedString(WebLocalizedString::CalendarClear), writer);
    addProperty("weekStartDay", WebCore::firstDayOfWeek(), writer);
    addProperty("monthLabels", WebCore::monthLabels(), writer);
    addProperty("dayLabels", WebCore::weekDayShortLabels(), writer);
    Direction dir = direction(WebCore::monthLabels()[0][0]);
    addProperty("isRTL", dir == RightToLeft || dir == RightToLeftArabic, writer);
    if (m_parameters.suggestionValues.size()) {
        addProperty("inputWidth", static_cast<unsigned>(m_parameters.anchorRectInRootView.width()), writer);
        addProperty("suggestionValues", m_parameters.suggestionValues, writer);
        addProperty("localizedSuggestionValues", m_parameters.localizedSuggestionValues, writer);
        addProperty("suggestionLabels", m_parameters.suggestionLabels, writer);
        addProperty("showOtherDateEntry", m_parameters.type == WebCore::InputTypeNames::date(), writer);
        addProperty("otherDateLabel", Platform::current()->queryLocalizedString(WebLocalizedString::OtherDateLabel), writer);
    }
    addString("}\n", writer);

    writer.addData(WebCore::pickerCommonJs, sizeof(WebCore::pickerCommonJs));
    writer.addData(WebCore::calendarPickerJs, sizeof(WebCore::calendarPickerJs));
    addString("</script></body>\n", writer);
}
Пример #4
0
TextureProperties::TextureProperties(QWidget *parent /* = 0 */)
	: QtGroupBoxPropertyBrowser(parent)//QtTreePropertyBrowser(parent)
	, curTexture(NULL)
	, curTextureDescriptor(NULL)
	, reactOnPropertyChange(true)
	, texturePropertiesChanged(false)
{
	// initialize list with string for different comboboxs
	{
		helperPVRFormats.push_back("None", DAVA::FORMAT_INVALID);
		helperPVRFormats.push_back(DAVA::Texture::GetPixelFormatString(DAVA::FORMAT_RGBA8888), DAVA::FORMAT_RGBA8888);
		helperPVRFormats.push_back(DAVA::Texture::GetPixelFormatString(DAVA::FORMAT_RGBA5551), DAVA::FORMAT_RGBA5551);
		helperPVRFormats.push_back(DAVA::Texture::GetPixelFormatString(DAVA::FORMAT_RGBA4444), DAVA::FORMAT_RGBA4444);
		helperPVRFormats.push_back(DAVA::Texture::GetPixelFormatString(DAVA::FORMAT_RGB565), DAVA::FORMAT_RGB565);
		helperPVRFormats.push_back(DAVA::Texture::GetPixelFormatString(DAVA::FORMAT_A8), DAVA::FORMAT_A8);
		helperPVRFormats.push_back(DAVA::Texture::GetPixelFormatString(DAVA::FORMAT_PVR4), DAVA::FORMAT_PVR4);
		helperPVRFormats.push_back(DAVA::Texture::GetPixelFormatString(DAVA::FORMAT_PVR2), DAVA::FORMAT_PVR2);
		helperPVRFormats.push_back(DAVA::Texture::GetPixelFormatString(DAVA::FORMAT_ETC1), DAVA::FORMAT_ETC1);


		helperDXTFormats.push_back("None", DAVA::FORMAT_INVALID);
		helperDXTFormats.push_back(DAVA::Texture::GetPixelFormatString(DAVA::FORMAT_RGBA8888), DAVA::FORMAT_RGBA8888);
		helperDXTFormats.push_back(DAVA::Texture::GetPixelFormatString(DAVA::FORMAT_DXT1), DAVA::FORMAT_DXT1);
		helperDXTFormats.push_back(DAVA::Texture::GetPixelFormatString(DAVA::FORMAT_DXT1NM), DAVA::FORMAT_DXT1NM);
		helperDXTFormats.push_back(DAVA::Texture::GetPixelFormatString(DAVA::FORMAT_DXT1A), DAVA::FORMAT_DXT1A);
		helperDXTFormats.push_back(DAVA::Texture::GetPixelFormatString(DAVA::FORMAT_DXT3), DAVA::FORMAT_DXT3);
		helperDXTFormats.push_back(DAVA::Texture::GetPixelFormatString(DAVA::FORMAT_DXT5), DAVA::FORMAT_DXT5);
		helperDXTFormats.push_back(DAVA::Texture::GetPixelFormatString(DAVA::FORMAT_DXT5NM), DAVA::FORMAT_DXT5NM);

		helperWrapModes.push_back("Clamp", DAVA::Texture::WRAP_CLAMP_TO_EDGE);
		helperWrapModes.push_back("Repeat", DAVA::Texture::WRAP_REPEAT);

		helperMinGLModes.push_back("Nearest", DAVA::Texture::FILTER_NEAREST);
		helperMinGLModes.push_back("Linear", DAVA::Texture::FILTER_LINEAR);

		helperMinGLModesWithMipmap.push_back("Nearest", DAVA::Texture::FILTER_NEAREST);
		helperMinGLModesWithMipmap.push_back("Linear", DAVA::Texture::FILTER_LINEAR);
		helperMinGLModesWithMipmap.push_back("Nearest, Mipmap Nearest", DAVA::Texture::FILTER_NEAREST_MIPMAP_NEAREST);
		helperMinGLModesWithMipmap.push_back("Linear, Mipmap Nearest", DAVA::Texture::FILTER_LINEAR_MIPMAP_NEAREST);
		helperMinGLModesWithMipmap.push_back("Nearest, Mipmap Linear", DAVA::Texture::FILTER_NEAREST_MIPMAP_LINEAR);
		helperMinGLModesWithMipmap.push_back("Linear, Mipmap Linear", DAVA::Texture::FILTER_LINEAR_MIPMAP_LINEAR);

		helperMagGLModes.push_back("Nearest", DAVA::Texture::FILTER_NEAREST);
		helperMagGLModes.push_back("Linear", DAVA::Texture::FILTER_LINEAR);
	}

	// parent widget
	oneForAllParent = new QWidget();

	// property managers
	propertiesGroup = new QtGroupPropertyManager(oneForAllParent);
	propertiesInt = new QtIntPropertyManager(oneForAllParent);
	propertiesBool = new QtBoolPropertyManager(oneForAllParent);
	propertiesEnum = new QtEnumPropertyManager(oneForAllParent);
	propertiesString = new QtStringPropertyManager(oneForAllParent);

	// property editors
	editorInt = new QtSpinBoxFactory(oneForAllParent);
	editorBool = new QtCheckBoxFactory(oneForAllParent);
	editorString = new QtLineEditFactory(oneForAllParent);
	editorEnum = new QtEnumEditorFactory(oneForAllParent);

	// setup property managers with appropriate property editors
	setFactoryForManager(propertiesInt, editorInt);
	setFactoryForManager(propertiesBool, editorBool);
	setFactoryForManager(propertiesEnum, editorEnum);
	setFactoryForManager(propertiesString, editorString);

	// Adding properties

	// groups
	QtProperty* groupPVR = propertiesGroup->addProperty("PVR");
	QtProperty* groupDXT = propertiesGroup->addProperty("DXT");
	QtProperty* groupCommon = propertiesGroup->addProperty("Common");

	// PVR group
	enumPVRFormat = propertiesEnum->addProperty("Format");
	propertiesEnum->setEnumNames(enumPVRFormat, helperPVRFormats.keyList());

	enumBasePVRMipmapLevel = propertiesEnum->addProperty("Base Mipmap level");

	groupPVR->addSubProperty(enumPVRFormat);
	groupPVR->addSubProperty(enumBasePVRMipmapLevel);
	addProperty(groupPVR);

	// DXT group
	enumDXTFormat = propertiesEnum->addProperty("Format");
	propertiesEnum->setEnumNames(enumDXTFormat, helperDXTFormats.keyList());

	enumBaseDXTMipmapLevel = propertiesEnum->addProperty("Base Mipmap level");

	groupDXT->addSubProperty(enumDXTFormat);
	groupDXT->addSubProperty(enumBaseDXTMipmapLevel);
	addProperty(groupDXT);

	// Common group

	// Mip maps
	boolGenerateMipMaps = propertiesBool->addProperty("Generate MipMaps");
	groupCommon->addSubProperty(boolGenerateMipMaps);

	// wrapmode t
	enumWrapModeS = propertiesEnum->addProperty("Wrap mode S");
	propertiesEnum->setEnumNames(enumWrapModeS, helperWrapModes.keyList());
	groupCommon->addSubProperty(enumWrapModeS);

	// wrapmode s
	enumWrapModeT = propertiesEnum->addProperty("Wrap mode T");
	propertiesEnum->setEnumNames(enumWrapModeT, helperWrapModes.keyList());
	groupCommon->addSubProperty(enumWrapModeT);

	// min OpenGL filter
	enumMinGL = propertiesEnum->addProperty("Min Filter");
	propertiesEnum->setEnumNames(enumMinGL, helperMinGLModes.keyList());
	groupCommon->addSubProperty(enumMinGL);

	// mag OpenGl filter
	enumMagGL = propertiesEnum->addProperty("Mag Filter");
	propertiesEnum->setEnumNames(enumMagGL, helperMagGLModes.keyList());
	groupCommon->addSubProperty(enumMagGL);

	addProperty(groupCommon);

	QObject::connect(propertiesEnum, SIGNAL(propertyChanged(QtProperty *)), this, SLOT(propertyChanged(QtProperty *)));
	QObject::connect(propertiesInt, SIGNAL(propertyChanged(QtProperty *)), this, SLOT(propertyChanged(QtProperty *)));
	QObject::connect(propertiesBool, SIGNAL(propertyChanged(QtProperty *)), this, SLOT(propertyChanged(QtProperty *)));
	QObject::connect(propertiesString, SIGNAL(propertyChanged(QtProperty *)), this, SLOT(propertyChanged(QtProperty *)));
}
// show project properties
//
void CDlgItemProperties::renderInfos(PROJECT* project_in) {
    std::string projectname;
    //collecting infos
    project_in->get_name(projectname);
    //disk usage needs additional lookups
    CMainDocument* pDoc = wxGetApp().GetDocument();
    pDoc->CachedDiskUsageUpdate();
    
    // CachedDiskUsageUpdate() may have invalidated our project 
    // pointer, so get an updated pointer to this project
    PROJECT* project = pDoc->project(project_in->master_url);
    if(!project) return;     // TODO: display some sort of error alert?

    std::vector<PROJECT*> dp = pDoc->disk_usage.projects;
    double diskusage=0.0;    
    for (unsigned int i=0; i< dp.size(); i++) {
        PROJECT* tp = dp[i];        
        std::string tname;        
        tp->get_name(tname);
        wxString t1(wxString(tname.c_str(),wxConvUTF8));
        if(t1.IsSameAs(wxString(projectname.c_str(),wxConvUTF8)) || t1.IsSameAs(wxString(project->master_url, wxConvUTF8))) {
            diskusage =tp->disk_usage;
            break;
        }
    }
    //set dialog title
    wxString wxTitle = _("Properties of project ");
    wxTitle.append(wxString(projectname.c_str(),wxConvUTF8));
    SetTitle(wxTitle);
    //layout controls
    addSection(_("General"));
    addProperty(_("Master URL"),wxString(project->master_url, wxConvUTF8));
    addProperty(_("User name"),wxString(project->user_name.c_str(),wxConvUTF8));
    addProperty(_("Team name"),wxString(project->team_name.c_str(),wxConvUTF8));
    addProperty(_("Resource share"),wxString::Format(wxT("%0.0f"),project->resource_share));
    if (project->min_rpc_time > dtime()) {
        addProperty(_("Scheduler RPC deferred for"), FormatTime(project->min_rpc_time - dtime()));
    }
    if (project->download_backoff) {
        addProperty(_("File downloads deferred for"), FormatTime(project->download_backoff));
    }
    if (project->upload_backoff) {
        addProperty(_("File uploads deferred for"), FormatTime(project->upload_backoff));
    }
    addProperty(_("Disk usage"),FormatDiskSpace(diskusage));
    addProperty(_("Computer ID"), wxString::Format(wxT("%d"), project->hostid));
    if (project->non_cpu_intensive) {
        addProperty(_("Non CPU intensive"), _("yes"));
    }
    addProperty(_("Suspended via GUI"),project->suspended_via_gui ? _("yes") : _("no"));
    addProperty(_("Don't request more work"),project->dont_request_more_work ? _("yes") : _("no"));
    if (project->scheduler_rpc_in_progress) {
        addProperty(_("Scheduler call in progress"), _("yes"));
    }
    if (project->trickle_up_pending) {
        addProperty(_("Trickle-up pending"), _("yes"));
    }
    if (strlen(project->venue)) {
        addProperty(_("Host location"), wxString(project->venue, wxConvUTF8));
    } else {
        addProperty(_("Host location"), _("default"));
    }

    if (project->attached_via_acct_mgr) {
        addProperty(_("Added via account manager"), _("yes"));
    }
    if (project->detach_when_done) {
        addProperty(_("Remove when tasks done"), _("yes"));
    }
    if (project->ended) {
        addProperty(_("Ended"), _("yes"));
    }
    addSection(_("Credit"));
    addProperty(_("User"),
        wxString::Format(
            wxT("%0.2f total, %0.2f average"),
            project->user_total_credit,
            project->user_expavg_credit
        )
    );
    addProperty(_("Host"),
        wxString::Format(
            wxT("%0.2f total, %0.2f average"),
            project->host_total_credit,
            project->host_expavg_credit
        )
    );
    
    if (!project->non_cpu_intensive) {
        addSection(_("Scheduling"));
        if (project->no_cpu_pref) {
            addProperty(_("Project preference"), _("Don't fetch CPU tasks"));
        }
        addProperty(_("Scheduling priority"),wxString::Format(wxT("%0.2f"), project->sched_priority));
        double x = project->cpu_backoff_time - dtime();
        if (x<0) x = 0;
        addProperty(_("CPU work fetch deferred for"), FormatTime(x));
        addProperty(_("CPU work fetch deferral interval"), FormatTime(project->cpu_backoff_interval));
        if (pDoc->state.have_nvidia) {
            if (project->no_cuda_pref) {
                addProperty(_("Project preference"), _("Don't fetch NVIDIA GPU tasks"));
            }
            x = project->cuda_backoff_time - dtime();
            if (x<0) x = 0;
            addProperty(_("NVIDIA GPU work fetch deferred for"), FormatTime(x));
            addProperty(_("NVIDIA GPU work fetch deferral interval"), FormatTime(project->cuda_backoff_interval));
        }
        if (pDoc->state.have_ati) {
            if (project->no_ati_pref) {
                addProperty(_("Project preference"), _("Don't fetch ATI GPU tasks"));
            }
            x = project->ati_backoff_time - dtime();
            if (x<0) x = 0;
            addProperty(_("ATI GPU work fetch deferred for"), FormatTime(x));
            addProperty(_("ATI GPU work fetch deferral interval"), FormatTime(project->ati_backoff_interval));
        }
        addProperty(_("Duration correction factor"),wxString::Format(wxT("%0.4f"), project->duration_correction_factor));
    }
    m_gbSizer->Layout();
    m_scrolledWindow->FitInside();
}
Пример #6
0
JSONElement& JSONElement::addProperty(const wxString& name, const wxFont& font)
{
    return addProperty(name, clFontHelper::ToString(font));
}
Пример #7
0
void emit_class(EmitUnitState& state,
                UnitEmitter& ue,
                const php::Class& cls) {
  FTRACE(2, "    class: {}\n", cls.name->data());
  auto const pce = ue.newPreClassEmitter(
    cls.name,
    cls.hoistability
  );
  pce->init(
    std::get<0>(cls.srcInfo.loc),
    std::get<1>(cls.srcInfo.loc),
    ue.bcPos(),
    cls.attrs,
    cls.parentName ? cls.parentName : s_empty.get(),
    cls.srcInfo.docComment
  );
  pce->setUserAttributes(cls.userAttributes);

  for (auto& x : cls.interfaceNames)     pce->addInterface(x);
  for (auto& x : cls.usedTraitNames)     pce->addUsedTrait(x);
  for (auto& x : cls.traitRequirements)  pce->addTraitRequirement(x);
  for (auto& x : cls.traitPrecRules)     pce->addTraitPrecRule(x);
  for (auto& x : cls.traitAliasRules)    pce->addTraitAliasRule(x);

  for (auto& m : cls.methods) {
    FTRACE(2, "    method: {}\n", m->name->data());
    auto const fe = ue.newMethodEmitter(m->name, pce);
    emit_init_func(*fe, *m);
    pce->addMethod(fe);
    auto const info = emit_bytecode(state, ue, *m);
    emit_finish_func(*m, *fe, info);
  }

  auto const privateProps   = state.index.lookup_private_props(&cls);
  auto const privateStatics = state.index.lookup_private_statics(&cls);
  for (auto& prop : cls.properties) {
    auto const repoTy = [&] (const PropState& ps) -> RepoAuthType {
      // TODO(#3599292): we don't currently infer closure use var types.
      if (is_closure(cls)) return RepoAuthType{};
      auto it = ps.find(prop.name);
      if (it == end(ps)) return RepoAuthType{};
      auto const rat = make_repo_type(*state.index.array_table_builder(),
                                      it->second);
      merge_repo_auth_type(ue, rat);
      return rat;
    };

    pce->addProperty(
      prop.name,
      prop.attrs,
      prop.typeConstraint,
      prop.docComment,
      &prop.val,
      (prop.attrs & AttrStatic) ? repoTy(privateStatics) : repoTy(privateProps)
    );
  }

  for (auto& cconst : cls.constants) {
    pce->addConstant(
      cconst.name,
      cconst.typeConstraint,
      &cconst.val,
      cconst.phpCode
    );
  }
}
Пример #8
0
void KTNEFWriter::setDtEnd( const QDateTime& dtEnd ) {
  QVariant v( dtEnd );
  addProperty( attDATEEND, atpDATE, v );
}
Пример #9
0
void KTNEFWriter::setUID( const QString& uid ) {
  QVariant v( uid );
  addProperty( attMSGID, atpSTRING, v );
}
Пример #10
0
SessionImpl::SessionImpl(const std::string& connectionString) : _mysql(0), _connected(false), _inTransaction(0)
{
    addProperty("insertId",
                &SessionImpl::setInsertId,
                &SessionImpl::getInsertId);

    std::map<std::string, std::string> options;

    // Default values
    options["host"] = "localhost";
    options["port"] = "3306";
    options["user"] = "";
    options["password"] = "";
    options["db"] = "";
    options["compress"] = "";
    options["auto-reconnect"] = "";

    //
    // Parse string
    //

    for (std::string::const_iterator start = connectionString.begin();;)
    {
        // find next ';'
        std::string::const_iterator finish = std::find(start, connectionString.end(), ';');

        // find '='
        std::string::const_iterator middle = std::find(start, finish, '=');

        if (middle == finish)
        {
            throw MySQLException("create session: bad connection string format, can not find '='");
        }

        // Parse name and value, skip all spaces
        options[copyStripped(start, middle)] = copyStripped(middle + 1, finish);

        if (finish == connectionString.end())
        {
            // end of parse
            break;
        }

        // move start position after ';'
        start = finish + 1;
    }

    //
    // Checking
    //

    if (options["user"] == "")
    {
        throw MySQLException("create session: specify user name");
    }

    if (options["db"] == "")
    {
        throw MySQLException("create session: specify database");
    }

    unsigned int port = 0;
    if (!NumberParser::tryParseUnsigned(options["port"], port) || 0 == port || port > 65535)
    {
        throw MySQLException("create session: specify correct port (numeric in decimal notation)");
    }

    //
    // Options
    //

    if (options["compress"] == "true")
    {
        _mysql.options(MYSQL_OPT_COMPRESS);
    }
    else if (options["compress"] == "false")
    {
        // do nothing
    }
    else if (options["compress"] != "")
    {
        throw MySQLException("create session: specify correct compress option (true or false) or skip it");
    }

    if (options["auto-reconnect"] == "true")
    {
        _mysql.options(MYSQL_OPT_RECONNECT, true);
    }
    else if (options["auto-reconnect"] == "false")
    {
        _mysql.options(MYSQL_OPT_RECONNECT, false);
    }
    else if (options["auto-reconnect"] != "")
    {
        throw MySQLException("create session: specify correct auto-reconnect option (true or false) or skip it");
    }

    //
    // Real connect
    //

    _mysql.connect(
        options["host"].c_str(),
        options["user"].c_str(),
        options["password"].c_str(),
        options["db"].c_str(),
        port);

    _connected = true;
}
Пример #11
0
void KTNEFWriter::setDtStart( const QDateTime& dtStart ) {
  QVariant v( dtStart );
  addProperty( attDATESTART, atpDATE, v );
}
Пример #12
0
void InteractionHandler::addEventProperty(EventPropertyBase* eventProperty) {
    eventProperties_.push_back(eventProperty);
    addProperty(eventProperty);
}
Пример #13
0
void ItemLibraryEntry::addProperty(PropertyName &name, QString &type, QVariant &value)
{
    Property property;
    property.set(name, type, value);
    addProperty(property);
}
Пример #14
0
void PropertyOwner::addProperty(Property& prop) {
    addProperty(&prop);
}
Пример #15
0
JSONElement& JSONElement::addProperty(const wxString& name, size_t value) { return addProperty(name, (int)value); }
Пример #16
0
// Date sent
void KTNEFWriter::setDtStamp( const QDateTime& dtStamp ) {
  QVariant v( dtStamp );
  addProperty( attDATESENT, atpDATE, v );
}
Пример #17
0
JSONElement& JSONElement::addProperty(const wxString& name, const char* value, const wxMBConv& conv)
{
    return addProperty(name, wxString(value, conv));
}
Пример #18
0
// I hope this is the body
void KTNEFWriter::setDescription( const QString &body ) {
  QVariant v( body );
  addProperty( attBODY, atpTEXT, v );
}
void CppTestDevice_base::loadProperties()
{
    addProperty(device_kind,
                "TestDevice",
                "DCE:cdc5ee18-7ceb-4ae6-bf4c-31f983179b4d",
                "device_kind",
                "readonly",
                "",
                "eq",
                "allocation,configure");

    addProperty(device_model,
                "CppTestDevice",
                "DCE:0f99b2e4-9903-4631-9846-ff349d18ecfb",
                "device_model",
                "readonly",
                "",
                "eq",
                "allocation,configure");

    addProperty(disk_space,
                100000000000LL,
                "disk_space",
                "disk_space",
                "readonly",
                "bytes",
                "external",
                "allocation,configure");

    addProperty(load_average,
                0.0,
                "load_average",
                "load_average",
                "readonly",
                "",
                "external",
                "allocation,configure");

    addProperty(memory_capacity,
                2147483648LL,
                "memory_capacity",
                "memory_capacity",
                "readonly",
                "bytes",
                "external",
                "configure");

    addProperty(shared_memory,
                33554432,
                "shared_memory",
                "shared_memory",
                "readonly",
                "bytes",
                "external",
                "configure");

    addProperty(memory_allocation,
                memory_allocation_struct(),
                "memory_allocation",
                "memory_allocation",
                "readwrite",
                "",
                "external",
                "allocation");

}
Пример #20
0
void KTNEFWriter::setSummary( const QString &s ) {
  QVariant v( s );
  addProperty( attSUBJECT, atpSTRING, v );
}
Пример #21
0
ButtonOverlayProcessor::ButtonOverlayProcessor()
    : ImageProcessor("image/compositor")
    , inport_(Port::INPORT, "image.input")
    , outport_(Port::OUTPORT, "image.output", "image.output", true, Processor::INVALID_PROGRAM, RenderPort::RENDERSIZE_DEFAULT, GL_RGBA)
    , overlayPort_(Port::OUTPORT, "image.overlay", "image.overlay", true, Processor::INVALID_RESULT, RenderPort::RENDERSIZE_DEFAULT, GL_RGBA)
    , pickingPort_(Port::OUTPORT, "image.picking", "image.picking", true, Processor::INVALID_RESULT, RenderPort::RENDERSIZE_DEFAULT, GL_RGBA)
    , buttonRadiusX_("buttonRadiusX", "Button Size X", 20, 1, 100)
    , buttonRadiusY_("buttonRadiusY", "Button Size Y", 20, 1, 100)
    , groupBorder_("groupBorder", "Border between Buttons", 5, 0, 30)
    , horzBorder_("horzBorder", "Distance from left/right Border", 30, 0, 1000)
    , vertBorder_("vertBorder", "Distance from top/bottom Border", 100, 0, 1000)
    , fontSize_("fontSize", "Font size", 12, 1, 48)
    , opacity_("opacity", "Opacity", 1.0f)
    , pushButtonMode_("pushButtonMode", "Use pushbutton mode", false)
#ifdef _MSC_VER
#pragma warning(disable:4355)  // passing 'this' is safe here
#endif
    , buttonChecker_("mouseEvent.clickButton", "Clicking Button", this,
                     &ButtonOverlayProcessor::onMouseClick,
                     tgt::MouseEvent::MOUSE_BUTTON_LEFT, tgt::MouseEvent::PRESSED | tgt::MouseEvent::MOTION | tgt::MouseEvent::RELEASED, tgt::Event::MODIFIER_NONE)
    , buttonTexturePressed_(0)
    , buttonTextureReleased_(0)
    , buttonProps_()
    , pushButtonProps_()
    , isVisibleProps_()
    , nameProps_()
    , regenerateOverlay_(false)
    , oldSize_(tgt::ivec2(0))
{
    addEventProperty(buttonChecker_);
    addPort(inport_);
    addPort(outport_);
    addPrivateRenderPort(&overlayPort_);
    addPrivateRenderPort(&pickingPort_);

    addProperty(horzBorder_);
    addProperty(vertBorder_);
    addProperty(buttonRadiusX_);
    addProperty(buttonRadiusY_);
    addProperty(groupBorder_);
    addProperty(opacity_);
    addProperty(fontSize_);
    addProperty(pushButtonMode_);

    buttonRadiusX_.onChange(CallMemberAction<ButtonOverlayProcessor>(this, &ButtonOverlayProcessor::onOverlayChange));
    buttonRadiusY_.onChange(CallMemberAction<ButtonOverlayProcessor>(this, &ButtonOverlayProcessor::onOverlayChange));
    opacity_.onChange(CallMemberAction<ButtonOverlayProcessor>(this, &ButtonOverlayProcessor::onOverlayChange));
    groupBorder_.onChange(CallMemberAction<ButtonOverlayProcessor>(this, &ButtonOverlayProcessor::onOverlayChange));
    horzBorder_.onChange(CallMemberAction<ButtonOverlayProcessor>(this, &ButtonOverlayProcessor::onOverlayChange));
    vertBorder_.onChange(CallMemberAction<ButtonOverlayProcessor>(this, &ButtonOverlayProcessor::onOverlayChange));
    fontSize_.onChange(CallMemberAction<ButtonOverlayProcessor>(this, &ButtonOverlayProcessor::onOverlayChange));

    for(size_t i = 0; i < 5; i++) {
        std::ostringstream os1, os2, os3, os4, os5, os6, os7, os8, os9;
        os1 << "showProp" << i;
        os2 << "Show Button No. " << i + 1;
        isVisibleProps_.push_back(new BoolProperty(os1.str(), os2.str(), false));
        isVisibleProps_.back()->onChange(CallMemberAction<ButtonOverlayProcessor>(this, &ButtonOverlayProcessor::onOverlayChange));
        addProperty(isVisibleProps_.back());

        os3 << "buttonProp" << i;
        os4 << "Button Property " << i + 1;
        buttonProps_.push_back(new BoolProperty(os3.str(), os4.str(), false));
        buttonProps_.back()->onChange(CallMemberAction<ButtonOverlayProcessor>(this, &ButtonOverlayProcessor::onOverlayChange));
        addProperty(buttonProps_.back());

        os5 << "nameProp" << i;
        os6 << "Button Name Property " << i + 1;
        os7 << "Button " << i + 1;
        nameProps_.push_back(new StringProperty(os5.str(), os6.str(), os7.str()));
        nameProps_.back()->onChange(CallMemberAction<ButtonOverlayProcessor>(this, &ButtonOverlayProcessor::onOverlayChange));
        addProperty(nameProps_.back());

        os8 << "pushButtonProp" << i;
        os9 << "Pushbutton Property " << i + 1;
        pushButtonProps_.push_back(new ButtonProperty(os8.str(), os9.str()));
        addProperty(pushButtonProps_.back());
    }

    font_ = new tgt::Font(VoreenApplication::app()->getFontPath("Vera.ttf"), 12, tgt::Font::BitmapFont);
    //font_ = new tgt::Font(VoreenApplication::app()->getFontPath("VeraMono.ttf"), 12, tgt::BitmapFont);
}
Пример #22
0
// TNEF encoding: Normal =  3, high = 2, low = 1
// MAPI encoding: Normal = -1, high = 0, low = 1
void KTNEFWriter::setPriority( Priority p ) {
  QVariant v( (Q_UINT32)p );
  addProperty( attMSGPRIORITY, atpSHORT, v );
}
Пример #23
0
bool CSSParser::parseSVGValue(int propId, bool important)
{
    CSSParserValue* value = m_valueList->current();
    if (!value)
        return false;

    int id = value->id;

    bool valid_primitive = false;
    RefPtr<CSSValue> parsedValue;

    switch (propId) {
    /* The comment to the right defines all valid value of these
     * properties as defined in SVG 1.1, Appendix N. Property index */
    case CSSPropertyAlignmentBaseline:
    // auto | baseline | before-edge | text-before-edge | middle |
    // central | after-edge | text-after-edge | ideographic | alphabetic |
    // hanging | mathematical | inherit
        if (id == CSSValueAuto || id == CSSValueBaseline || id == CSSValueMiddle ||
          (id >= CSSValueBeforeEdge && id <= CSSValueMathematical))
            valid_primitive = true;
        break;

    case CSSPropertyBaselineShift:
    // baseline | super | sub | <percentage> | <length> | inherit
        if (id == CSSValueBaseline || id == CSSValueSub ||
           id >= CSSValueSuper)
            valid_primitive = true;
        else
            valid_primitive = validUnit(value, FLength|FPercent, false);
        break;

    case CSSPropertyDominantBaseline:
    // auto | use-script | no-change | reset-size | ideographic |
    // alphabetic | hanging | mathematical | central | middle |
    // text-after-edge | text-before-edge | inherit
        if (id == CSSValueAuto || id == CSSValueMiddle ||
          (id >= CSSValueUseScript && id <= CSSValueResetSize) ||
          (id >= CSSValueCentral && id <= CSSValueMathematical))
            valid_primitive = true;
        break;

    case CSSPropertyEnableBackground:
    // accumulate | new [x] [y] [width] [height] | inherit
        if (id == CSSValueAccumulate) // TODO : new
            valid_primitive = true;
        break;

    case CSSPropertyMarkerStart:
    case CSSPropertyMarkerMid:
    case CSSPropertyMarkerEnd:
    case CSSPropertyMask:
        if (id == CSSValueNone)
            valid_primitive = true;
        else if (value->unit == CSSPrimitiveValue::CSS_URI) {
            parsedValue = CSSPrimitiveValue::create(value->string, CSSPrimitiveValue::CSS_URI);
            if (parsedValue)
                m_valueList->next();
        }
        break;

    case CSSPropertyClipRule:            // nonzero | evenodd | inherit
    case CSSPropertyFillRule:
        if (id == CSSValueNonzero || id == CSSValueEvenodd)
            valid_primitive = true;
        break;

    case CSSPropertyStrokeMiterlimit:   // <miterlimit> | inherit
        valid_primitive = validUnit(value, FNumber|FNonNeg, false);
        break;

    case CSSPropertyStrokeLinejoin:   // miter | round | bevel | inherit
        if (id == CSSValueMiter || id == CSSValueRound || id == CSSValueBevel)
            valid_primitive = true;
        break;

    case CSSPropertyStrokeLinecap:    // butt | round | square | inherit
        if (id == CSSValueButt || id == CSSValueRound || id == CSSValueSquare)
            valid_primitive = true;
        break;

    case CSSPropertyStrokeOpacity:   // <opacity-value> | inherit
    case CSSPropertyFillOpacity:
    case CSSPropertyStopOpacity:
    case CSSPropertyFloodOpacity:
        valid_primitive = (!id && validUnit(value, FNumber|FPercent, false));
        break;

    case CSSPropertyShapeRendering:
    // auto | optimizeSpeed | crispEdges | geometricPrecision | inherit
        if (id == CSSValueAuto || id == CSSValueOptimizespeed ||
            id == CSSValueCrispedges || id == CSSValueGeometricprecision)
            valid_primitive = true;
        break;

    case CSSPropertyImageRendering:  // auto | optimizeSpeed |
    case CSSPropertyColorRendering:  // optimizeQuality | inherit
        if (id == CSSValueAuto || id == CSSValueOptimizespeed ||
            id == CSSValueOptimizequality)
            valid_primitive = true;
        break;

    case CSSPropertyColorProfile: // auto | sRGB | <name> | <uri> inherit
        if (id == CSSValueAuto || id == CSSValueSrgb)
            valid_primitive = true;
        break;

    case CSSPropertyColorInterpolation:   // auto | sRGB | linearRGB | inherit
    case CSSPropertyColorInterpolationFilters:  
        if (id == CSSValueAuto || id == CSSValueSrgb || id == CSSValueLinearrgb)
            valid_primitive = true;
        break;

    /* Start of supported CSS properties with validation. This is needed for parseShortHand to work
     * correctly and allows optimization in applyRule(..)
     */

    case CSSPropertyTextAnchor:    // start | middle | end | inherit
        if (id == CSSValueStart || id == CSSValueMiddle || id == CSSValueEnd)
            valid_primitive = true;
        break;

    case CSSPropertyGlyphOrientationVertical: // auto | <angle> | inherit
        if (id == CSSValueAuto) {
            valid_primitive = true;
            break;
        }
    /* fallthrough intentional */
    case CSSPropertyGlyphOrientationHorizontal: // <angle> (restricted to _deg_ per SVG 1.1 spec) | inherit
        if (value->unit == CSSPrimitiveValue::CSS_DEG || value->unit == CSSPrimitiveValue::CSS_NUMBER) {
            parsedValue = CSSPrimitiveValue::create(value->fValue, CSSPrimitiveValue::CSS_DEG);

            if (parsedValue)
                m_valueList->next();
        }
        break;

    case CSSPropertyFill:                 // <paint> | inherit
    case CSSPropertyStroke:               // <paint> | inherit
        {
            if (id == CSSValueNone)
                parsedValue = SVGPaint::createNone();
            else if (id == CSSValueCurrentcolor)
                parsedValue = SVGPaint::createCurrentColor();
            else if ((id >= CSSValueActiveborder && id <= CSSValueWindowtext) || id == CSSValueMenu)
                parsedValue = SVGPaint::createColor(RenderTheme::defaultTheme()->systemColor(id));
            else if (value->unit == CSSPrimitiveValue::CSS_URI) {
                RGBA32 c = Color::transparent;
                if (m_valueList->next() && parseColorFromValue(m_valueList->current(), c)) {
                    parsedValue = SVGPaint::createURIAndColor(value->string, c);
                } else
                    parsedValue = SVGPaint::createURI(value->string);
            } else
                parsedValue = parseSVGPaint();

            if (parsedValue)
                m_valueList->next();
        }
        break;

    case CSSPropertyColor:                // <color> | inherit
        if ((id >= CSSValueAqua && id <= CSSValueWindowtext) ||
           (id >= CSSValueAliceblue && id <= CSSValueYellowgreen))
            parsedValue = SVGColor::createFromString(value->string);
        else
            parsedValue = parseSVGColor();

        if (parsedValue)
            m_valueList->next();
        break;

    case CSSPropertyStopColor: // TODO : icccolor
    case CSSPropertyFloodColor:
    case CSSPropertyLightingColor:
        if ((id >= CSSValueAqua && id <= CSSValueWindowtext) ||
           (id >= CSSValueAliceblue && id <= CSSValueYellowgreen))
            parsedValue = SVGColor::createFromString(value->string);
        else if (id == CSSValueCurrentcolor)
            parsedValue = SVGColor::createCurrentColor();
        else // TODO : svgcolor (iccColor)
            parsedValue = parseSVGColor();

        if (parsedValue)
            m_valueList->next();

        break;
        
    case CSSPropertyVectorEffect: // none | non-scaling-stroke | inherit
        if (id == CSSValueNone || id == CSSValueNonScalingStroke)
            valid_primitive = true;
        break;

    case CSSPropertyWritingMode:
    // lr-tb | rl_tb | tb-rl | lr | rl | tb | inherit
        if (id == CSSValueLrTb || id == CSSValueRlTb || id == CSSValueTbRl || id == CSSValueLr || id == CSSValueRl || id == CSSValueTb)
            valid_primitive = true;
        break;

    case CSSPropertyStrokeWidth:         // <length> | inherit
    case CSSPropertyStrokeDashoffset:
        valid_primitive = validUnit(value, FLength | FPercent, false);
        break;
    case CSSPropertyStrokeDasharray:     // none | <dasharray> | inherit
        if (id == CSSValueNone)
            valid_primitive = true;
        else
            parsedValue = parseSVGStrokeDasharray();

        break;

    case CSSPropertyKerning:              // auto | normal | <length> | inherit
        if (id == CSSValueAuto || id == CSSValueNormal)
            valid_primitive = true;
        else
            valid_primitive = validUnit(value, FLength, false);
        break;

    case CSSPropertyClipPath:    // <uri> | none | inherit
    case CSSPropertyFilter:
        if (id == CSSValueNone)
            valid_primitive = true;
        else if (value->unit == CSSPrimitiveValue::CSS_URI) {
            parsedValue = CSSPrimitiveValue::create(value->string, (CSSPrimitiveValue::UnitTypes) value->unit);
            if (parsedValue)
                m_valueList->next();
        }
        break;
    case CSSPropertyWebkitSvgShadow:
        if (id == CSSValueNone)
            valid_primitive = true;
        else
            return parseShadow(propId, important);

    /* shorthand properties */
    case CSSPropertyMarker:
    {
        ShorthandScope scope(this, propId);
        m_implicitShorthand = true;
        if (!parseValue(CSSPropertyMarkerStart, important))
            return false;
        if (m_valueList->current()) {
            rollbackLastProperties(1);
            return false;
        }
        CSSValue* value = m_parsedProperties[m_numParsedProperties - 1]->value();
        addProperty(CSSPropertyMarkerMid, value, important);
        addProperty(CSSPropertyMarkerEnd, value, important);
        m_implicitShorthand = false;
        return true;
    }
    default:
        // If you crash here, it's because you added a css property and are not handling it
        // in either this switch statement or the one in CSSParser::parseValue
        ASSERT_WITH_MESSAGE(0, "unimplemented propertyID: %d", propId);
        return false;
    }

    if (valid_primitive) {
        if (id != 0)
            parsedValue = CSSPrimitiveValue::createIdentifier(id);
        else if (value->unit == CSSPrimitiveValue::CSS_STRING)
            parsedValue = CSSPrimitiveValue::create(value->string, (CSSPrimitiveValue::UnitTypes) value->unit);
        else if (value->unit >= CSSPrimitiveValue::CSS_NUMBER && value->unit <= CSSPrimitiveValue::CSS_KHZ)
            parsedValue = CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes) value->unit);
        else if (value->unit >= CSSParserValue::Q_EMS)
#if ENABLE(SAMSUNG_WEBKIT_PERFORMANCE_PATCH)
            // SAMSUNG CHANGE : Webkit Performance Patch Merge + r97583
            parsedValue = CSSPrimitiveValue::createAllowingMarginQuirk(value->fValue, CSSPrimitiveValue::CSS_EMS);
#else
            parsedValue = CSSQuirkPrimitiveValue::create(value->fValue, CSSPrimitiveValue::CSS_EMS);
            // SAMSUNG CHANGE : Webkit Performance Patch Merge -
#endif
        m_valueList->next();
    }
    if (!parsedValue || (m_valueList->current() && !inShorthand()))
        return false;

    addProperty(propId, parsedValue.release(), important);
    return true;
}
Пример #24
0
/*************************************************************************
	Add properties for the slider
*************************************************************************/
void Slider::addSliderProperties(void)
{
	addProperty(&d_currentValueProperty);
	addProperty(&d_clickStepSizeProperty);
	addProperty(&d_maximumValueProperty);
}
// show task properties
//
void CDlgItemProperties::renderInfos(RESULT* result) {
    CMainDocument* pDoc = wxGetApp().GetDocument();
    wxDateTime dt;
    wxString wxTitle = _("Properties of task ");
    wxTitle.append(wxString(result->name, wxConvUTF8));
    SetTitle(wxTitle);

    APP_VERSION* avp = NULL;
    WORKUNIT* wup = NULL;
    RESULT* r = pDoc->state.lookup_result(result->project_url, result->name);
    if (r) {
        avp = r->avp;
        wup = r->wup;
    }
    
    addProperty(_("Application"), FormatApplicationName(result));
    addProperty(_("Workunit name"),wxString(result->wu_name, wxConvUTF8));
    addProperty(_("State"), result_description(result, false));
    if (result->received_time) {
        dt.Set((time_t)result->received_time);
        addProperty(_("Received"), dt.Format());
    }
    dt.Set((time_t)result->report_deadline);
    addProperty(_("Report deadline"), dt.Format());
    if (strlen(result->resources)) {
        addProperty(_("Resources"), wxString(result->resources, wxConvUTF8));
    }
    if (wup) {
        addProperty(_("Estimated computation size"), wxString::Format(wxT("%.0f GFLOPs"), wup->rsc_fpops_est/1e9));
    }
    if (result->active_task) {
        addProperty(_("CPU time at last checkpoint"), FormatTime(result->checkpoint_cpu_time));
        addProperty(_("CPU time"), FormatTime(result->current_cpu_time));
        if (result->elapsed_time >= 0) {
            addProperty(_("Elapsed time"), FormatTime(result->elapsed_time));
        }
        addProperty(_("Estimated time remaining"), FormatTime(result->estimated_cpu_time_remaining));
        addProperty(_("Fraction done"), wxString::Format(wxT("%.3f %%"), result->fraction_done*100));
        addProperty(_("Virtual memory size"), FormatDiskSpace(result->swap_size));
        addProperty(_("Working set size"), FormatDiskSpace(result->working_set_size_smoothed));
        if (result->slot >= 0) {
            addProperty(_("Directory"), wxString::Format(wxT("slots/%d"), result->slot));
        }
        if (result->pid) {
            addProperty(_("Process ID"), wxString::Format(wxT("%d"), result->pid));
        }
    } else if (result->state >= RESULT_COMPUTE_ERROR) {
        addProperty(_("CPU time"), FormatTime(result->final_cpu_time));
        addProperty(_("Elapsed time"), FormatTime(result->final_elapsed_time));
    }
    m_gbSizer->Layout();
    m_scrolledWindow->FitInside();
}
Пример #26
0
JSONElement& JSONElement::addProperty(const wxString& name, const wxPoint& pt)
{
    wxString szStr;
    szStr << pt.x << "," << pt.y;
    return addProperty(name, szStr);
}
Пример #27
0
ImageMapping::ImageMapping()
    : ImageGLProcessor("img_mapping.frag")
    , transferFunction_("transferFunction", "Transfer Function", TransferFunction()) {
    addProperty(transferFunction_);
}
Пример #28
0
JSONElement& JSONElement::addProperty(const wxString& name, const wxSize& sz)
{
    wxString szStr;
    szStr << sz.x << "," << sz.y;
    return addProperty(name, szStr);
}
Пример #29
0
const PropertyList& getGeneratorProperties( const std::string& generator )
{
    static GeneratorPropertyMap generatorProperties;
    static PropertyList emptyMap;
    if( generatorProperties.empty( ))
    {
        BOOST_FOREACH( const std::string& gen, getGenerators( ))
        {
            generatorProperties[ gen ] = PropertyList();

            PropertyList& map = generatorProperties[ gen ];
            if( gen == "ac_generator" )
            {
                addProperty( map, "amplitude", 0.0 );
                addProperty( map, "frequency", 0.0 );
                addProperty( map, "phase", 0.0 );
                continue;
            }
            else if( gen == "dc_generator" )
            {
                addProperty( map, "amplitude", 0.0 );
                continue;
            }
            else if( gen ==  "gamma_sup_generator" )
            {
                addProperty( map, "gamma_shape", false );
                addProperty( map, "rate", 0.0 );
                continue;
            }
            else if( gen ==  "mip_generator" )
            {
                addProperty( map, "mother_seed", 0 );
                continue;
            }
            else if( gen ==  "noise_generator" )
            {
                addProperty( map, "dt", 1.0 );
                addProperty( map, "frequency", 0.0 );
                addProperty( map, "mean", 0.0 );
                addProperty( map, "phase", 0.0 );
                addProperty( map, "y_0", 0.0 );
                addProperty( map, "y_1", 0.0 );
                continue;
            }
            else if( gen ==  "poisson_generator" )
            {
                addProperty( map, "rate", 0.0 );
                continue;
            }
            else if( gen ==  "poisson_generator_ps" )
            {
                addProperty( map, "rate", 0.0 );
                continue;
            }
            else if( gen ==  "ppd_sup_generator" )
            {
                addProperty( map, "amplitude", 0.0 );
                addProperty( map, "dead_time", 0.0 );
                addProperty( map, "frequency", 0.0 );
                addProperty( map, "rate", 1.0 );
                continue;
            }
            else if( gen ==  "sinusoidal_gamma_generator" )
            {
                addProperty( map, "ac", 0.0 );
                addProperty( map, "dc", 0.0 );
                addProperty( map, "individual_spike_trains", true );
                addProperty( map, "freq", 0.0 );
                addProperty( map, "phi", 0.0 );
                continue;
            }
            else if( gen ==  "sinusoidal_poisson_generator" )
            {
                addProperty( map, "ac", 0.0 );
                addProperty( map,"dc", 0.0 );
                addProperty( map,"individual_spike_trains", true );
                addProperty( map,"freq", 0.0 );
                addProperty( map,"phi", 0.0 );
                continue;
            }
            else if( gen ==  "spike_generator" )
            {
                addProperty( map, "allow_offgrid_spikes", false );
                addProperty( map, "precise_times", false );
                addProperty( map, "shift_now_spikes", true );
                addProperty( map, "spike_times", QList<QVariant>() );
                addProperty( map, "spike_weights", QList<QVariant>() );
                continue;
            }
            else if( gen ==  "step_current_generator" )
            {
                addProperty( map, "amplitude_times", QList<QVariant>() );
                addProperty( map, "amplitude_values", QList<QVariant>() );
                continue;
            }
        }
Пример #30
0
void ShapeContentGroup::addContent(ShapeContent *content)
{
	content_.push_back(content);
	addProperty(content);
}