MP4StsdAtom::MP4StsdAtom() : MP4Atom("stsd") { AddVersionAndFlags(); MP4Integer32Property* pCount = new MP4Integer32Property("entryCount"); pCount->SetReadOnly(); AddProperty(pCount); ExpectChildAtom("mp4a", Optional, Many); ExpectChildAtom("enca", Optional, Many); ExpectChildAtom("mp4s", Optional, Many); ExpectChildAtom("mp4v", Optional, Many); ExpectChildAtom("encv", Optional, Many); ExpectChildAtom("rtp ", Optional, Many); ExpectChildAtom("samr", Optional, Many); // For AMR-NB ExpectChildAtom("sawb", Optional, Many); // For AMR-WB ExpectChildAtom("s263", Optional, Many); // For H.263 ExpectChildAtom("avc1", Optional, Many); ExpectChildAtom("alac", Optional, Many); ExpectChildAtom("text", Optional, Many); }
/// Get or set a named view in this storage object c4_ViewRef c4_Storage::View(const char *name_) { /* The easy solution would seem to be: c4_ViewProp prop (name_); return prop (Contents()); But this does not work, because the return value would point to an object allocated on the stack. Instead, make sure the view *has* such a property, and use the one inside the c4_Handler for it (since this will stay around). */ // int n = _root->PropIndex(c4_ViewProp (name_)); c4_ViewProp prop(name_); int n = AddProperty(prop); d4_assert(n >= 0); // the following is an expression of the form "property (rowref)" return NthProperty(n)(GetAt(0)); }
bool trpgLabelPropertyTable::Read(trpgReadBuffer &buf) { trpgLabelProperty property; trpgToken propertyTok; int32 len; bool status; int numProperty; int i; Reset(); try { buf.Get(numProperty); if (numProperty < 0) throw 1; //properties.resize(numProperty); for (i=0;i<numProperty;i++) { buf.GetToken(propertyTok,len); if (propertyTok != TRPG_LABEL_PROPERTY) throw 1; buf.PushLimit(len); property.Reset(); status = property.Read(buf); buf.PopLimit(); if (!status) throw 1; //properties[i] = property; AddProperty(property); } } catch (...) { return false; } return isValid(); }
void PListView::InitProperties(void) { SetStringProperty("Description", "A list"); AddProperty(new FloatProperty("PreferredWidth", 0)); AddProperty(new IntProperty("ItemCount", 0, " The number of items in the list. Read-only.")); AddProperty(new IntProperty("SelectionMessage", 0, " The constant of the message sent when the selection changes")); AddProperty(new FloatProperty("PreferredHeight", 0)); AddProperty(new IntProperty("InvocationMessage", 0, " The constant of the message sent when an item is invoked")); EnumProperty *prop = NULL; prop = new EnumProperty(); prop->SetName("SelectionType"); prop->SetValue((int32)B_SINGLE_SELECTION_LIST); prop->SetDescription(" The list's selection mode"); prop->AddValuePair("Single", B_SINGLE_SELECTION_LIST); prop->AddValuePair("Multiple", B_MULTIPLE_SELECTION_LIST); AddProperty(prop); }
GWEN_CONTROL_FACTORY_CONSTRUCTOR( Image_Factory, ControlFactory::Base ) { AddProperty( new Properties::ImageName() ); AddProperty( new Properties::Stretch() ); }
MP4AvcCAtom::MP4AvcCAtom(MP4File &file) : MP4Atom(file, "avcC") { MP4BitfieldProperty *pCount; MP4TableProperty *pTable; AddProperty( new MP4Integer8Property(*this,"configurationVersion")); /* 0 */ AddProperty( new MP4Integer8Property(*this,"AVCProfileIndication")); /* 1 */ AddProperty( new MP4Integer8Property(*this,"profile_compatibility")); /* 2 */ AddProperty( new MP4Integer8Property(*this,"AVCLevelIndication")); /* 3 */ AddProperty( new MP4BitfieldProperty(*this,"reserved", 6)); /* 4 */ AddProperty( new MP4BitfieldProperty(*this,"lengthSizeMinusOne", 2)); /* 5 */ AddProperty( new MP4BitfieldProperty(*this,"reserved1", 3)); /* 6 */ pCount = new MP4BitfieldProperty(*this,"numOfSequenceParameterSets", 5); AddProperty(pCount); /* 7 */ pTable = new SizeTableProperty(*this,"sequenceEntries", pCount); AddProperty(pTable); /* 8 */ pTable->AddProperty(new MP4Integer16Property(pTable->GetParentAtom(),"sequenceParameterSetLength")); pTable->AddProperty(new MP4BytesProperty(pTable->GetParentAtom(),"sequenceParameterSetNALUnit")); MP4Integer8Property *pCount2 = new MP4Integer8Property(*this,"numOfPictureParameterSets"); AddProperty(pCount2); /* 9 */ pTable = new SizeTableProperty(*this,"pictureEntries", pCount2); AddProperty(pTable); /* 10 */ pTable->AddProperty(new MP4Integer16Property(pTable->GetParentAtom(),"pictureParameterSetLength")); pTable->AddProperty(new MP4BytesProperty(pTable->GetParentAtom(),"pictureParameterSetNALUnit")); }
LexerConf::Ptr_t EclipsePHPThemeImporter::Import(const wxFileName& eclipseXmlFile) { LexerConf::Ptr_t lexer = InitializeImport(eclipseXmlFile, "php", 4); CHECK_PTR_RET_NULL(lexer); // PHP can also be found in a file which contains HTML and JavaScript // so we define them all here // HTML AddProperty(lexer, wxSTC_H_DEFAULT, "HTML Default", m_foreground.colour, m_background.colour); AddProperty(lexer, wxSTC_H_TAG, "HTML Tag", m_variable.colour, m_background.colour); AddProperty(lexer, wxSTC_H_TAGUNKNOWN, "Unknown HTML Tag", m_variable.colour, m_background.colour); AddProperty(lexer, wxSTC_H_ATTRIBUTE, "HTML Attribute", m_klass.colour, m_background.colour); AddProperty(lexer, wxSTC_H_ATTRIBUTEUNKNOWN, "Unknown HTML Attribute", m_klass.colour, m_background.colour); AddProperty(lexer, wxSTC_H_NUMBER, "HTML Number", m_number.colour, m_background.colour); AddProperty(lexer, wxSTC_H_DOUBLESTRING, "HTML Double String", m_string.colour, m_background.colour); AddProperty(lexer, wxSTC_H_SINGLESTRING, "HTML Single String", m_string.colour, m_background.colour); AddProperty(lexer, wxSTC_H_OTHER, "HTML Other", m_foreground.colour, m_background.colour); AddProperty(lexer, wxSTC_H_COMMENT, "HTML Comment", m_multiLineComment.colour, m_background.colour); AddProperty(lexer, wxSTC_H_ENTITY, "HTML Entity", m_foreground.colour, m_background.colour); // Embedded JavaScript AddProperty(lexer, wxSTC_HJ_START, "JS Start", m_foreground.colour, m_background.colour); AddProperty(lexer, wxSTC_HJ_DEFAULT, "JS Default", m_foreground.colour, m_background.colour); AddProperty(lexer, wxSTC_HJ_COMMENT, "JS Comment", m_singleLineComment.colour, m_background.colour); AddProperty(lexer, wxSTC_HJ_COMMENTLINE, "JS MultiLine Comment", m_multiLineComment.colour, m_background.colour); AddProperty(lexer, wxSTC_HJ_COMMENTDOC, "JS Doc Comment", m_multiLineComment.colour, m_background.colour); AddProperty(lexer, wxSTC_HJ_NUMBER, "JS Number", m_number.colour, m_background.colour); AddProperty(lexer, wxSTC_HJ_WORD, "JS Word", m_foreground.colour, m_background.colour); AddProperty(lexer, wxSTC_HJ_KEYWORD, "JS Keyword", m_keyword.colour, m_background.colour); AddProperty(lexer, wxSTC_HJ_DOUBLESTRING, "JS Double String", m_string.colour, m_background.colour); AddProperty(lexer, wxSTC_HJ_SINGLESTRING, "JS Single String", m_string.colour, m_background.colour); AddProperty(lexer, wxSTC_HJ_SYMBOLS, "JS Symbols", m_foreground.colour, m_background.colour); AddProperty(lexer, wxSTC_HJ_STRINGEOL, "JS String EOL", m_string.colour, m_background.colour); AddProperty(lexer, wxSTC_HJ_REGEX, "JS Regex", m_klass.colour, m_background.colour); // PHP AddProperty(lexer, wxSTC_HPHP_COMPLEX_VARIABLE, "PHP Complex Variable", m_variable.colour, m_background.colour); AddProperty(lexer, wxSTC_HPHP_DEFAULT, "PHP Default", m_foreground.colour, m_background.colour); AddProperty(lexer, wxSTC_HPHP_HSTRING, "PHP Heredoc String", m_string.colour, m_background.colour); AddProperty(lexer, wxSTC_HPHP_SIMPLESTRING, "PHP String", m_string.colour, m_background.colour); AddProperty(lexer, wxSTC_HPHP_WORD, "PHP Word", m_keyword.colour, m_background.colour); AddProperty(lexer, wxSTC_HPHP_NUMBER, "PHP Number", m_number.colour, m_background.colour); AddProperty(lexer, wxSTC_HPHP_VARIABLE, "PHP Variable", m_variable.colour, m_background.colour); AddProperty(lexer, wxSTC_HPHP_COMMENTLINE, "PHP Comment", m_singleLineComment.colour, m_background.colour); AddProperty(lexer, wxSTC_HPHP_COMMENT, "PHP Multiline Comment", m_multiLineComment.colour, m_background.colour); AddProperty(lexer, wxSTC_HPHP_HSTRING_VARIABLE, "PHP Heredoc Variable", m_variable.colour, m_background.colour); FinalizeImport(lexer); return lexer; }
MP4FrmaAtom::MP4FrmaAtom() : MP4Atom("frma") { AddProperty( /* 0 */ new MP4Integer32Property("data-format")); }
int main(int argc, char **argv) { DTEntry dtEntry; DTPropertyIterator propIter; DTEntryIterator entryIter; void *prop; int propSize; char *name; void *flatTree; uint32_t flatSize; Node *node; node = AddChild(NULL, "device-tree"); AddProperty(node, "potato", 4, "foo"); AddProperty(node, "chemistry", 4, "bar"); AddProperty(node, "physics", 4, "baz"); node = AddChild(node, "dev"); AddProperty(node, "one", 4, "one"); AddProperty(node, "two", 4, "two"); AddProperty(node, "three", 6, "three"); node = AddChild(rootNode, "foo"); AddProperty(node, "aaa", 4, "aab"); AddProperty(node, "bbb", 4, "bbc"); AddProperty(node, "cccc", 6, "ccccd"); node = FindNode("/this/is/a/test", 1); AddProperty(node, "dddd", 12, "abcdefghijk"); printf("In-memory tree:\n\n"); PrintTree(rootNode); FlattenDeviceTree(&flatTree, &flatSize); printf("Flat tree = %p, size %d\n", flatTree, flatSize); dtEntry = (DTEntry)flatTree; printf("\n\nPrinting flat tree\n\n"); DTInit(dtEntry); PrintFlattenedTree((DTEntry)flatTree); #if 0 printf("=== Entry %p ===\n", dtEntry); if (kSuccess != DTCreatePropertyIterator(dtEntry, &propIter)) { printf("Couldn't create property iterator\n"); return 1; } while( kSuccess == DTIterateProperties( propIter, &name)) { if( kSuccess != DTGetProperty( dtEntry, name, &prop, &propSize )) continue; printf(" Property %s = %s\n", name, prop); } DTDisposePropertyIterator(propIter); printf("========\n"); if (kSuccess != DTCreateEntryIterator(dtEntry, &entryIter)) { printf("Couldn't create entry iterator\n"); return 1; } while (kSuccess == DTIterateEntries( entryIter, &dtEntry )) { printf("=== Entry %p ===\n", dtEntry); if (kSuccess != DTCreatePropertyIterator(dtEntry, &propIter)) { printf("Couldn't create property iterator\n"); return 1; } while( kSuccess == DTIterateProperties( propIter, &name)) { if( kSuccess != DTGetProperty( dtEntry, name, &prop, &propSize )) continue; printf(" Property %s = %s\n", name, prop); } DTDisposePropertyIterator(propIter); printf("========\n"); } DTDisposeEntryIterator(entryIter); #endif return 0; }
DialogProperties::DialogProperties(agi::Context *c) : wxDialog(c->parent, -1, _("Script Properties")) , c(c) { SetIcon(GETICON(properties_toolbutton_16)); // Script details crap wxSizer *TopSizer = new wxStaticBoxSizer(wxHORIZONTAL,this,_("Script")); wxFlexGridSizer *TopSizerGrid = new wxFlexGridSizer(0,2,5,5); AddProperty(TopSizerGrid, _("Title:"), "Title"); AddProperty(TopSizerGrid, _("Original script:"), "Original Script"); AddProperty(TopSizerGrid, _("Translation:"), "Original Translation"); AddProperty(TopSizerGrid, _("Editing:"), "Original Editing"); AddProperty(TopSizerGrid, _("Timing:"), "Original Timing"); AddProperty(TopSizerGrid, _("Synch point:"), "Synch Point"); AddProperty(TopSizerGrid, _("Updated by:"), "Script Updated By"); AddProperty(TopSizerGrid, _("Update details:"), "Update Details"); TopSizerGrid->AddGrowableCol(1,1); TopSizer->Add(TopSizerGrid,1,wxALL | wxEXPAND,0); // Resolution box wxSizer *ResSizer = new wxStaticBoxSizer(wxHORIZONTAL,this,_("Resolution")); ResX = new wxTextCtrl(this,-1,"",wxDefaultPosition,wxSize(50,20),0,NumValidator(c->ass->GetScriptInfo("PlayResX"))); ResY = new wxTextCtrl(this,-1,"",wxDefaultPosition,wxSize(50,20),0,NumValidator(c->ass->GetScriptInfo("PlayResY"))); wxStaticText *ResText = new wxStaticText(this,-1,"x"); wxButton *FromVideo = new wxButton(this,-1,_("From &video")); if (!c->videoController->IsLoaded()) FromVideo->Enable(false); else FromVideo->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogProperties::OnSetFromVideo, this); ResSizer->Add(ResX,1,wxRIGHT | wxALIGN_CENTER_VERTICAL,5); ResSizer->Add(ResText,0,wxALIGN_CENTER | wxRIGHT,5); ResSizer->Add(ResY,1,wxRIGHT | wxALIGN_CENTER_VERTICAL,5); ResSizer->Add(FromVideo,1,0,0); // Options wxSizer *optionsBox = new wxStaticBoxSizer(wxHORIZONTAL,this,_("Options")); wxFlexGridSizer *optionsGrid = new wxFlexGridSizer(3,2,5,5); wxString wrap_opts[] = { _("0: Smart wrapping, top line is wider"), _("1: End-of-line word wrapping, only \\N breaks"), _("2: No word wrapping, both \\n and \\N break"), _("3: Smart wrapping, bottom line is wider") }; WrapStyle = new wxComboBox(this, -1, "", wxDefaultPosition, wxDefaultSize, 4, wrap_opts, wxCB_READONLY); WrapStyle->SetSelection(c->ass->GetScriptInfoAsInt("WrapStyle")); optionsGrid->Add(new wxStaticText(this,-1,_("Wrap Style: ")),0,wxALIGN_CENTER_VERTICAL,0); optionsGrid->Add(WrapStyle,1,wxEXPAND,0); wxString coll_opts[] = { _("Normal"), _("Reverse") }; collision = new wxComboBox(this, -1, "", wxDefaultPosition, wxDefaultSize, 2, coll_opts, wxCB_READONLY); collision->SetSelection(c->ass->GetScriptInfo("Collisions").Lower() == "reverse"); optionsGrid->Add(new wxStaticText(this,-1,_("Collision: ")),0,wxALIGN_CENTER_VERTICAL,0); optionsGrid->Add(collision,1,wxEXPAND,0); ScaleBorder = new wxCheckBox(this,-1,_("Scale Border and Shadow")); ScaleBorder->SetToolTip(_("Scale border and shadow together with script/render resolution. If this is unchecked, relative border and shadow size will depend on renderer.")); ScaleBorder->SetValue(c->ass->GetScriptInfo("ScaledBorderAndShadow").Lower() == "yes"); optionsGrid->AddSpacer(0); optionsGrid->Add(ScaleBorder,1,wxEXPAND,0); optionsGrid->AddGrowableCol(1,1); optionsBox->Add(optionsGrid,1,wxEXPAND,0); // Button sizer wxStdDialogButtonSizer *ButtonSizer = CreateStdDialogButtonSizer(wxOK | wxCANCEL | wxHELP); Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogProperties::OnOK, this, wxID_OK); Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&HelpButton::OpenPage, "Properties"), wxID_HELP); // MainSizer wxSizer *MainSizer = new wxBoxSizer(wxVERTICAL); MainSizer->Add(TopSizer,0,wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND,5); MainSizer->Add(ResSizer,0,wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND,5); MainSizer->Add(optionsBox,0,wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND,5); MainSizer->Add(ButtonSizer,0,wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND,5); SetSizerAndFit(MainSizer); CenterOnParent(); }
void EPropList::AddPropDir(IPropertyHost* pHost , const CString& sName , CString* pDir ) { AddProperty( new EPropertyDir(pHost, sName, pDir )); }
void EPropList::AddPropSeparator( IPropertyHost* pHost , const CString& sName ) { AddProperty( new EPropertySeparator( pHost , sName ) ); }
EPropertyFile* EPropList::AddPropFile( IPropertyHost* pHost , const CString& sName , CString* pFilename , const CString& sFilters ) { EPropertyFile* pPF = new EPropertyFile( pHost , sName , pFilename , sFilters ); AddProperty( pPF ); return pPF; }
EPropertyCheck* EPropList::AddPropCheck( IPropertyHost* pHost , const CString& sName , bool* pBoolean ) { EPropertyCheck* p = new EPropertyCheck( pHost , sName , pBoolean ); AddProperty(p); return p; }
EPropertyColor* EPropList::AddPropColor( IPropertyHost* pHost , const CString& sName , COLORREF* pColor , bool bEnabled ) { EPropertyColor* p = new EPropertyColor( pHost , sName , pColor , bEnabled ); AddProperty(p); return p; }
LexerConf::Ptr_t EclipseJavaScriptThemeImporter::Import(const wxFileName& eclipseXmlFile) { LexerConf::Ptr_t lexer = InitializeImport(eclipseXmlFile, "javascript", 3); CHECK_PTR_RET_NULL(lexer); // Covnert to codelite's XML properties AddProperty(lexer, wxSTC_C_DEFAULT, "Default", m_foreground.colour, m_background.colour); AddProperty(lexer, wxSTC_C_COMMENT, "Block comment", m_multiLineComment.colour, m_background.colour, m_multiLineComment.isBold, m_multiLineComment.isItalic); AddProperty(lexer, wxSTC_C_COMMENTLINE, "Single line comment", m_singleLineComment.colour, m_background.colour, m_singleLineComment.isBold, m_singleLineComment.isItalic); AddProperty(lexer, wxSTC_C_COMMENTDOC, "Doxygen block comment", m_javadoc.colour, m_background.colour, m_javadoc.isBold, m_javadoc.isItalic); AddProperty( lexer, wxSTC_C_NUMBER, "Number", m_number.colour, m_background.colour, m_number.isBold, m_number.isItalic); AddProperty(lexer, wxSTC_C_WORD, "JavaScript keyword", m_keyword.colour, m_background.colour, m_keyword.isBold, m_keyword.isItalic); AddProperty( lexer, wxSTC_C_STRING, "String", m_string.colour, m_background.colour, m_string.isBold, m_string.isItalic); AddProperty(lexer, wxSTC_C_CHARACTER, "Character", m_string.colour, m_background.colour, m_string.isBold, m_string.isItalic); AddProperty(lexer, wxSTC_C_OPERATOR, "Operator", m_foreground.colour, m_background.colour); AddProperty(lexer, wxSTC_C_IDENTIFIER, "Identifier", m_foreground.colour, m_background.colour); AddProperty(lexer, wxSTC_C_STRINGEOL, "Open String", m_string.colour, m_background.colour, m_string.isBold, m_string.isItalic); AddProperty(lexer, wxSTC_C_COMMENTLINEDOC, "Doxygen single line comment", m_javadoc.colour, m_background.colour, m_javadoc.isBold, m_javadoc.isItalic); AddProperty(lexer, wxSTC_C_WORD2, "JavaScript functions", m_variable.colour, m_background.colour, m_javadoc.isBold, m_javadoc.isItalic); AddProperty(lexer, wxSTC_C_GLOBALCLASS, "JavaScript global classes", m_klass.colour, m_background.colour, m_javadoc.isBold, m_javadoc.isItalic); AddProperty(lexer, wxSTC_C_COMMENTDOCKEYWORD, "Doxygen keyword", m_javadocKeyword.colour, m_background.colour, m_javadocKeyword.isBold, m_javadocKeyword.isItalic); AddProperty(lexer, wxSTC_C_COMMENTDOCKEYWORDERROR, "Doxygen keyword error", m_javadocKeyword.colour, m_background.colour, m_javadocKeyword.isBold, m_javadocKeyword.isItalic); FinalizeImport(lexer); return lexer; }
void HP_Stream::Initialize() { mFormatList = new HP_FormatList(this); AddProperty(mFormatList); }
EPropertyCharString* EPropList::AddPropCharString( IPropertyHost* pHost , const CString& sName , char* pString , int nLength ) { EPropertyCharString* p = new EPropertyCharString(pHost,sName,pString,nLength); AddProperty(p); return p; }
void MP4TkhdAtom::AddProperties(uint8_t version) { if (version == 1) { AddProperty( /* 2 */ new MP4Integer64Property("creationTime")); AddProperty( /* 3 */ new MP4Integer64Property("modificationTime")); } else { // version == 0 AddProperty( /* 2 */ new MP4Integer32Property("creationTime")); AddProperty( /* 3 */ new MP4Integer32Property("modificationTime")); } AddProperty( /* 4 */ new MP4Integer32Property("trackId")); AddReserved("reserved1", 4); /* 5 */ if (version == 1) { AddProperty( /* 6 */ new MP4Integer64Property("duration")); } else { AddProperty( /* 6 */ new MP4Integer32Property("duration")); } AddReserved("reserved2", 8); /* 7 */ AddProperty( /* 8 */ new MP4Integer16Property("layer")); AddProperty( /* 9 */ new MP4Integer16Property("alternate_group")); MP4Float32Property* pProp; pProp = new MP4Float32Property("volume"); pProp->SetFixed16Format(); AddProperty(pProp); /* 10 */ AddReserved("reserved3", 2); /* 11 */ AddProperty(new MP4BytesProperty("matrix", 36)); /* 12 */ pProp = new MP4Float32Property("width"); pProp->SetFixed32Format(); AddProperty(pProp); /* 13 */ pProp = new MP4Float32Property("height"); pProp->SetFixed32Format(); AddProperty(pProp); /* 14 */ }
void MP4TextAtom::AddPropertiesStsdType() { AddReserved("reserved1", 6); /* 0 */ AddProperty(new MP4Integer16Property("dataReferenceIndex"));/* 1 */ AddProperty(new MP4Integer32Property("displayFlags")); /* 2 */ AddProperty(new MP4Integer32Property("textJustification")); /* 3 */ AddProperty(new MP4Integer16Property("bgColorRed")); /* 4 */ AddProperty(new MP4Integer16Property("bgColorGreen")); /* 5 */ AddProperty(new MP4Integer16Property("bgColorBlue")); /* 6 */ AddProperty(new MP4Integer16Property("defTextBoxTop")); /* 7 */ AddProperty(new MP4Integer16Property("defTextBoxLeft")); /* 8 */ AddProperty(new MP4Integer16Property("defTextBoxBottom")); /* 9 */ AddProperty(new MP4Integer16Property("defTextBoxRight")); /* 10 */ AddReserved("reserved2", 8); /* 11 */ AddProperty(new MP4Integer16Property("fontNumber")); /* 12 */ AddProperty(new MP4Integer16Property("fontFace")); /* 13 */ AddReserved("reserved3", 1); /* 14 */ AddReserved("reserved4", 2); /* 15 */ AddProperty(new MP4Integer16Property("foreColorRed")); /* 16 */ AddProperty(new MP4Integer16Property("foreColorGreen")); /* 17 */ AddProperty(new MP4Integer16Property("foreColorBlue")); /* 18 */ }
void wxXmlNode::AddProperty(const wxString& name, const wxString& value) { AddProperty(new wxXmlProperty(name, value, NULL)); }
void MP4TextAtom::AddPropertiesGmhdType() { AddProperty(new MP4BytesProperty("textData", 36)); /* 0 */ }
MP4StandardAtom::MP4StandardAtom (const char *type) : MP4Atom(type) { /* * This is a big if else loop. Make sure that you don't break it * when adding new atoms, or you will set the unknown type flag * * Try to keep it in alphabetical order - it should only be called * 1 time per atom, so it's not that urgent. */ /* * b??? */ if (ATOMID(type) == ATOMID("bitr")) { AddProperty( /* 0 */ new MP4Integer32Property("avgBitrate")); AddProperty( /* 1 */ new MP4Integer32Property("maxBitrate")); } else if (ATOMID(type) == ATOMID("btrt")) { AddProperty( new MP4Integer32Property("bufferSizeDB")); /* 0 */ AddProperty( new MP4Integer32Property("avgBitrate")); /* 1 */ AddProperty( new MP4Integer32Property("maxBitrate")); /* 2 */ /* * c??? */ } else if (ATOMID(type) == ATOMID("co64")) { AddVersionAndFlags(); MP4Integer32Property* pCount = new MP4Integer32Property("entryCount"); AddProperty(pCount); MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); AddProperty(pTable); pTable->AddProperty( new MP4Integer64Property("chunkOffset")); } else if (ATOMID(type) == ATOMID("cpil")) { ExpectChildAtom("data", Required, OnlyOne); } else if (ATOMID(type) == ATOMID("covr")) { /* Apple iTunes */ ExpectChildAtom("data", Required, Many); } else if (ATOMID(type) == ATOMID("cprt")) { AddVersionAndFlags(); AddProperty( new MP4Integer16Property("language")); AddProperty( new MP4StringProperty("notice")); } else if (ATOMID(type) == ATOMID("ctts")) { AddVersionAndFlags(); MP4Integer32Property* pCount = new MP4Integer32Property("entryCount"); AddProperty(pCount); MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); AddProperty(pTable); pTable->AddProperty(new MP4Integer32Property("sampleCount")); pTable->AddProperty(new MP4Integer32Property("sampleOffset")); /* * d??? */ } else if (ATOMID(type) == ATOMID("dinf")) { ExpectChildAtom("dref", Required, OnlyOne); } else if (ATOMID(type) == ATOMID("dimm")) { AddProperty( // bytes of immediate data new MP4Integer64Property("bytes")); } else if (ATOMID(type) == ATOMID("disk")) { /* Apple iTunes */ ExpectChildAtom("data", Required, OnlyOne); } else if (ATOMID(type) == ATOMID("dmax")) { AddProperty( // max packet duration new MP4Integer32Property("milliSecs")); } else if (ATOMID(type) == ATOMID("dmed")) { AddProperty( // bytes sent from media data new MP4Integer64Property("bytes")); } else if (ATOMID(type) == ATOMID("drep")) { AddProperty( // bytes of repeated data new MP4Integer64Property("bytes")); /* * e??? */ } else if (ATOMID(type) == ATOMID("edts")) { ExpectChildAtom("elst", Required, OnlyOne); } else if (ATOMID(type) == ATOMID("esds")) { AddVersionAndFlags(); AddProperty( new MP4DescriptorProperty(NULL, MP4ESDescrTag, 0, Required, OnlyOne)); /* * f??? */ } else if (ATOMID(type) == ATOMID("frma")) { AddProperty( /* 0 */ new MP4Integer32Property("data-format")); /* * g??? */ } else if (ATOMID(type) == ATOMID("gnre")) { // Apple iTunes ExpectChildAtom("data", Optional, OnlyOne); /* * h??? */ } else if (ATOMID(type) == ATOMID("hmhd")) { AddVersionAndFlags(); AddProperty(new MP4Integer16Property("maxPduSize")); AddProperty(new MP4Integer16Property("avgPduSize")); AddProperty(new MP4Integer32Property("maxBitRate")); AddProperty(new MP4Integer32Property("avgBitRate")); AddProperty(new MP4Integer32Property("slidingAvgBitRate")); /* * i??? */ } else if (ATOMID(type) == ATOMID("iKMS")) { AddVersionAndFlags(); /* 0, 1 */ MP4StringProperty* pProp = new MP4StringProperty("kms_URI"); AddProperty(pProp); /* 2 */ } else if (ATOMID(type) == ATOMID("iSFM")) { AddVersionAndFlags(); /* 0, 1 */ AddProperty( /* 2 */ new MP4BitfieldProperty("selective-encryption", 1)); AddProperty( /* 3 */ new MP4BitfieldProperty("reserved", 7)); AddProperty( /* 4 */ new MP4Integer8Property("key-indicator-length")); AddProperty( /* 5 */ new MP4Integer8Property("IV-length")); } else if (ATOMID(type) == ATOMID("ilst")) { ExpectChildAtom("\251nam", Optional, OnlyOne); /* name */ ExpectChildAtom("\251ART", Optional, OnlyOne); /* artist */ ExpectChildAtom("\251wrt", Optional, OnlyOne); /* writer */ ExpectChildAtom("\251alb", Optional, OnlyOne); /* album */ ExpectChildAtom("\251day", Optional, OnlyOne); /* date */ ExpectChildAtom("\251too", Optional, OnlyOne); /* tool */ ExpectChildAtom("\251cmt", Optional, OnlyOne); /* comment */ ExpectChildAtom("\251gen", Optional, OnlyOne); /* custom genre */ ExpectChildAtom("trkn", Optional, OnlyOne); /* tracknumber */ ExpectChildAtom("disk", Optional, OnlyOne); /* disknumber */ ExpectChildAtom("gnre", Optional, OnlyOne); /* genre (ID3v1 index + 1) */ ExpectChildAtom("cpil", Optional, OnlyOne); /* compilation */ ExpectChildAtom("tmpo", Optional, OnlyOne); /* BPM */ ExpectChildAtom("covr", Optional, OnlyOne); /* cover art */ ExpectChildAtom("----", Optional, Many); /* ---- free form */ } else if (ATOMID(type) == ATOMID("imif")) { AddVersionAndFlags(); AddProperty(new MP4DescriptorProperty("ipmp_desc", MP4IPMPDescrTag, MP4IPMPDescrTag, Required, Many)); } else if (ATOMID(type) == ATOMID("iods")) { AddVersionAndFlags(); AddProperty( new MP4DescriptorProperty(NULL, MP4FileIODescrTag, MP4FileODescrTag, Required, OnlyOne)); /* * m??? */ } else if (ATOMID(type) == ATOMID("maxr")) { AddProperty(new MP4Integer32Property("granularity")); AddProperty(new MP4Integer32Property("bytes")); } else if (ATOMID(type) == ATOMID("mdia")) { ExpectChildAtom("mdhd", Required, OnlyOne); ExpectChildAtom("hdlr", Required, OnlyOne); ExpectChildAtom("minf", Required, OnlyOne); } else if (ATOMID(type) == ATOMID("meta")) { // iTunes AddVersionAndFlags(); /* 0, 1 */ ExpectChildAtom("hdlr", Required, OnlyOne); ExpectChildAtom("ilst", Required, OnlyOne); } else if (ATOMID(type) == ATOMID("mfhd")) { AddVersionAndFlags(); /* 0, 1 */ AddProperty( /* 2 */ new MP4Integer32Property("sequenceNumber")); } else if (ATOMID(type) == ATOMID("minf")) { ExpectChildAtom("vmhd", Optional, OnlyOne); ExpectChildAtom("smhd", Optional, OnlyOne); ExpectChildAtom("hmhd", Optional, OnlyOne); ExpectChildAtom("nmhd", Optional, OnlyOne); ExpectChildAtom("dinf", Required, OnlyOne); ExpectChildAtom("stbl", Required, OnlyOne); } else if (ATOMID(type) == ATOMID("moof")) { ExpectChildAtom("mfhd", Required, OnlyOne); ExpectChildAtom("traf", Optional, Many); } else if (ATOMID(type) == ATOMID("moov")) { ExpectChildAtom("mvhd", Required, OnlyOne); ExpectChildAtom("iods", Optional, OnlyOne); ExpectChildAtom("trak", Required, Many); ExpectChildAtom("udta", Optional, Many); ExpectChildAtom("mvex", Optional, OnlyOne); } else if (ATOMID(type) == ATOMID("mvex")) { ExpectChildAtom("trex", Required, Many); /* * n??? */ } else if (ATOMID(type) == ATOMID("nmhd")) { AddVersionAndFlags(); } else if (ATOMID(type) == ATOMID("nump")) { AddProperty( // packets sent new MP4Integer64Property("packets")); /* * o??? */ } else if (ATOMID(type) == ATOMID("odkm")) { AddVersionAndFlags(); ExpectChildAtom("ohdr", Required, OnlyOne); /* * p??? */ } else if (ATOMID(type) == ATOMID("payt")) { AddProperty(new MP4Integer32Property("payloadNumber")); AddProperty(new MP4StringProperty("rtpMap", Counted)); } else if (ATOMID(type) == ATOMID("pmax")) { AddProperty( // max packet size new MP4Integer32Property("bytes")); /* * s??? */ } else if (ATOMID(type) == ATOMID("schi")) { // not sure if this is child atoms or table of boxes // get clarification on spec 9.1.2.5 ExpectChildAtom("odkm", Optional, OnlyOne); ExpectChildAtom("iKMS", Optional, OnlyOne); ExpectChildAtom("iSFM", Optional, OnlyOne); } else if (ATOMID(type) == ATOMID("schm")) { AddVersionAndFlags(); /* 0, 1 */ AddProperty( /* 2 */ new MP4Integer32Property("scheme_type")); AddProperty( /* 3 */ new MP4Integer32Property("scheme_version")); // browser URI if flags set, TODO } else if (ATOMID(type) == ATOMID("sinf")) { ExpectChildAtom("frma", Required, OnlyOne); ExpectChildAtom("imif", Optional, OnlyOne); ExpectChildAtom("schm", Optional, OnlyOne); ExpectChildAtom("schi", Optional, OnlyOne); } else if (ATOMID(type) == ATOMID("smhd")) { AddVersionAndFlags(); AddReserved("reserved", 4); } else if (ATOMID(type) == ATOMID("snro")) { AddProperty(new MP4Integer32Property("offset")); } else if (ATOMID(type) == ATOMID("stco")) { AddVersionAndFlags(); MP4Integer32Property* pCount = new MP4Integer32Property("entryCount"); AddProperty(pCount); MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); AddProperty(pTable); pTable->AddProperty(new MP4Integer32Property("chunkOffset")); } else if (ATOMID(type) == ATOMID("stsh")) { AddVersionAndFlags(); MP4Integer32Property* pCount = new MP4Integer32Property("entryCount"); AddProperty(pCount); MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); AddProperty(pTable); pTable->AddProperty(new MP4Integer32Property("shadowedSampleNumber")); pTable->AddProperty(new MP4Integer32Property("syncSampleNumber")); } else if (ATOMID(type) == ATOMID("stss")) { AddVersionAndFlags(); MP4Integer32Property* pCount = new MP4Integer32Property("entryCount"); AddProperty(pCount); MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); AddProperty(pTable); pTable->AddProperty(new MP4Integer32Property("sampleNumber")); } else if (ATOMID(type) == ATOMID("stts")) { AddVersionAndFlags(); MP4Integer32Property* pCount = new MP4Integer32Property("entryCount"); AddProperty(pCount); MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); AddProperty(pTable); pTable->AddProperty(new MP4Integer32Property("sampleCount")); pTable->AddProperty(new MP4Integer32Property("sampleDelta")); /* * t??? */ } else if (ATOMID(type) == ATOMID("tims")) { AddProperty( new MP4Integer32Property("timeScale")); } else if (ATOMID(type) == ATOMID("tmin")) { AddProperty( // min relative xmit time new MP4Integer32Property("milliSecs")); } else if (ATOMID(type) == ATOMID("tmax")) { AddProperty( // max relative xmit time new MP4Integer32Property("milliSecs")); } else if (ATOMID(type) == ATOMID("tmpo")) { // iTunes ExpectChildAtom("data", Required, OnlyOne); } else if (ATOMID(type) == ATOMID("traf")) { ExpectChildAtom("tfhd", Required, OnlyOne); ExpectChildAtom("trun", Optional, Many); } else if (ATOMID(type) == ATOMID("trak")) { ExpectChildAtom("tkhd", Required, OnlyOne); ExpectChildAtom("tref", Optional, OnlyOne); ExpectChildAtom("edts", Optional, OnlyOne); ExpectChildAtom("mdia", Required, OnlyOne); ExpectChildAtom("udta", Optional, Many); } else if (ATOMID(type) == ATOMID("tref")) { ExpectChildAtom("dpnd", Optional, OnlyOne); ExpectChildAtom("hint", Optional, OnlyOne); ExpectChildAtom("ipir", Optional, OnlyOne); ExpectChildAtom("mpod", Optional, OnlyOne); ExpectChildAtom("sync", Optional, OnlyOne); } else if (ATOMID(type) == ATOMID("trex")) { AddVersionAndFlags(); /* 0, 1 */ AddProperty( /* 2 */ new MP4Integer32Property("trackId")); AddProperty( /* 3 */ new MP4Integer32Property("defaultSampleDesriptionIndex")); AddProperty( /* 4 */ new MP4Integer32Property("defaultSampleDuration")); AddProperty( /* 5 */ new MP4Integer32Property("defaultSampleSize")); AddProperty( /* 6 */ new MP4Integer32Property("defaultSampleFlags")); } else if (ATOMID(type) == ATOMID("trkn")) { // iTunes ExpectChildAtom("data", Required, OnlyOne); } else if (ATOMID(type) == ATOMID("trpy") || ATOMID(type) == ATOMID("tpyl")) { AddProperty( // bytes sent including RTP headers new MP4Integer64Property("bytes")); } else if (ATOMID(type) == ATOMID("tsro")) { AddProperty( new MP4Integer32Property("offset")); } else if (ATOMID(type) == ATOMID("wave")) { ExpectChildAtom("esds", Required, OnlyOne); /* * copyright??? */ } else if (ATOMID(type) == ATOMID(art) || ATOMID(type) == ATOMID(wrt) || ATOMID(type) == ATOMID(alb) || ATOMID(type) == ATOMID(day) || ATOMID(type) == ATOMID(too) || ATOMID(type) == ATOMID(gen) || ATOMID(type) == ATOMID(grp)) { /* Apple iTunes */ ExpectChildAtom("data", Required, OnlyOne); /* * ---- */ } else if (ATOMID(type) == ATOMID("----")) { /* Apple iTunes */ ExpectChildAtom("mean", Required, OnlyOne); ExpectChildAtom("name", Required, OnlyOne); ExpectChildAtom("data", Required, OnlyOne); } else { /* * default - unknown type */ SetUnknownType(true); } }
std::unique_ptr<Reply> M3Handler::HandleMessage(Message* message) { // FIXME : resolve clashes between wds exported and internal rtsp type names. //using namespace rtsp; auto received_payload = ToGetParameterPayload(message->payload()); if (!received_payload) return nullptr; auto reply = std::unique_ptr<Reply>(new Reply(rtsp::STATUS_OK)); auto reply_payload = new rtsp::PropertyMapPayload(); for (const std::string& property : received_payload->properties()) { std::shared_ptr<rtsp::Property> new_prop; if (property == GetPropertyName(rtsp::AudioCodecsPropertyType)){ // FIXME: declare that we support absolutely every audio codec/format, // but there should be a MediaManager API for it auto codec_lpcm = AudioCodec(LPCM, AudioModes(3), 0); auto codec_aac = AudioCodec(AAC, AudioModes(15), 0); auto codec_ac3 = AudioCodec(AC3, AudioModes(7), 0); std::vector<AudioCodec> codec_list; codec_list.push_back(codec_lpcm); codec_list.push_back(codec_aac); codec_list.push_back(codec_ac3); new_prop.reset(new rtsp::AudioCodecs(codec_list)); reply_payload->AddProperty(new_prop); } else if (property == GetPropertyName(rtsp::VideoFormatsPropertyType)){ new_prop.reset(new rtsp::VideoFormats(ToSinkMediaManager(manager_)->GetNativeVideoFormat(), false, ToSinkMediaManager(manager_)->GetSupportedH264VideoCodecs())); reply_payload->AddProperty(new_prop); } else if (property == GetPropertyName(rtsp::Video3DFormatsPropertyType)){ new_prop.reset(new rtsp::Formats3d()); reply_payload->AddProperty(new_prop); } else if (property == GetPropertyName(rtsp::ContentProtectionPropertyType)){ new_prop.reset(new rtsp::ContentProtection()); reply_payload->AddProperty(new_prop); } else if (property == GetPropertyName(rtsp::DisplayEdidPropertyType)){ new_prop.reset(new rtsp::DisplayEdid()); reply_payload->AddProperty(new_prop); } else if (property == GetPropertyName(rtsp::CoupledSinkPropertyType)){ new_prop.reset(new rtsp::CoupledSink()); reply_payload->AddProperty(new_prop); } else if (property == GetPropertyName(rtsp::ClientRTPPortsPropertyType)){ new_prop.reset(new rtsp::ClientRtpPorts( ToSinkMediaManager(manager_)->GetLocalRtpPorts().first, ToSinkMediaManager(manager_)->GetLocalRtpPorts().second)); reply_payload->AddProperty(new_prop); } else if (property == GetPropertyName(rtsp::I2CPropertyType)){ new_prop.reset(new rtsp::I2C(0)); reply_payload->AddProperty(new_prop); } else if (property == GetPropertyName(rtsp::UIBCCapabilityPropertyType)){ new_prop.reset(new rtsp::UIBCCapability()); reply_payload->AddProperty(new_prop); } else if (property == GetPropertyName(rtsp::ConnectorTypePropertyType)){ new_prop.reset(new rtsp::ConnectorType(ToSinkMediaManager(manager_)->GetConnectorType())); reply_payload->AddProperty(new_prop); } else if (property == GetPropertyName(rtsp::StandbyResumeCapabilityPropertyType)){ new_prop.reset(new rtsp::StandbyResumeCapability(false)); reply_payload->AddProperty(new_prop); } else { WDS_WARNING("** GET_PARAMETER: Ignoring unsupported property '%s'.", property.c_str()); } } reply->set_payload(std::unique_ptr<Payload>(reply_payload)); return reply; }
MP4HvcCAtom::MP4HvcCAtom(MP4File &file) : MP4Atom(file, "hvcC") { #if 1 //cwm 278 MP4TableProperty *pTable; AddProperty( new MP4Integer8Property(*this,"configurationVersion")); AddProperty( new MP4Integer8Property(*this,"AVCProfileIndication")); AddProperty( new MP4Integer32Property(*this,"profile_compatibility")); AddProperty( new MP4Integer32Property(*this,"AVCLevelIndication")); AddProperty( new MP4Integer16Property(*this,"m_constraint_indicator_flags_2B")); AddProperty( new MP4Integer8Property(*this,"m_hvcC_level_idc_1B")); AddProperty( new MP4Integer16Property(*this,"m_hvcC_min_spatial_segmentation_idc_2B")); AddProperty( new MP4Integer8Property(*this,"m_hvcC_parallelismType_1B")); AddProperty( new MP4Integer8Property(*this,"m_hvcC_chromaFormat_1B")); AddProperty( new MP4Integer8Property(*this,"m_hvcC_bitDepthLumaMinus8_1B")); AddProperty( new MP4Integer8Property(*this,"m_hvcC_bitDepthChromaMinus8_1B")); AddProperty( new MP4Integer16Property(*this,"m_hvcC_avgFrameRate_2B")); AddProperty( new MP4Integer8Property(*this,"lengthSizeMinusOne")); AddProperty( new MP4Integer8Property(*this,"m_hvcC_numOfArrays_1B")); //cwm vps AddProperty( new MP4Integer8Property(*this,"typeOfVideoParameterSets")); MP4BitfieldProperty *pVps = new MP4BitfieldProperty(*this,"numOfVideoParameterSets", 16); AddProperty(pVps); /* 7 */ pTable = new SizeTableProperty(*this,"videoEntries", pVps); AddProperty(pTable); /* 8 */ pTable->AddProperty(new MP4Integer16Property(pTable->GetParentAtom(),"videoParameterSetLength")); pTable->AddProperty(new MP4BytesProperty(pTable->GetParentAtom(),"videoParameterSetNALUnit")); //cwm sps AddProperty( new MP4Integer8Property(*this,"typeOfSequenceParameterSets")); MP4BitfieldProperty *pSps = new MP4BitfieldProperty(*this,"numOfSequenceParameterSets", 16); AddProperty(pSps); /* 7 */ pTable = new SizeTableProperty(*this,"sequenceEntries", pSps); AddProperty(pTable); /* 8 */ pTable->AddProperty(new MP4Integer16Property(pTable->GetParentAtom(),"sequenceParameterSetLength")); pTable->AddProperty(new MP4BytesProperty(pTable->GetParentAtom(),"sequenceParameterSetNALUnit")); //cwm pps AddProperty( new MP4Integer8Property(*this,"typeOfPictureParameterSets")); //MP4Integer8Property *pCount2 = new MP4Integer16Property(*this,"numOfPictureParameterSets"); MP4BitfieldProperty *pPps = new MP4BitfieldProperty(*this,"numOfPictureParameterSets", 16); AddProperty(pPps); /* 9 */ pTable = new SizeTableProperty(*this,"pictureEntries", pPps); AddProperty(pTable); /* 10 */ pTable->AddProperty(new MP4Integer16Property(pTable->GetParentAtom(),"pictureParameterSetLength")); pTable->AddProperty(new MP4BytesProperty(pTable->GetParentAtom(),"pictureParameterSetNALUnit")); #else //cwm 278 MP4BitfieldProperty *pCount; MP4TableProperty *pTable; AddProperty( new MP4Integer8Property(*this,"configurationVersion")); /* 0 */ // 1B m_hvcC_version_1B AddProperty( new MP4Integer8Property(*this,"AVCProfileIndication")); /* 1 */ // 1B m_hvcC_profile_space_tier_flag_profile_idc_1B AddProperty( new MP4Integer8Property(*this,"profile_compatibility")); /* 2 */// 1B -> 4B m_hvcC_profile_compatibility_flags_4B AddProperty( new MP4Integer8Property(*this,"AVCLevelIndication")); /* 3 */ // 1B -> 4B m_hvcC_constraint_indicator_flags_4B AddProperty( new MP4BitfieldProperty(*this,"reserved", 6)); /* 4 */ AddProperty( new MP4BitfieldProperty(*this,"lengthSizeMinusOne", 2)); /* 5 */ AddProperty( new MP4BitfieldProperty(*this,"reserved1", 3)); /* 6 */ pCount = new MP4BitfieldProperty(*this,"numOfSequenceParameterSets", 5); AddProperty(pCount); /* 7 */ #if 1 //cwm 301 pTable = new SizeTableProperty(*this,"sequenceEntries", pCount); AddProperty(pTable); /* 8 */ pTable->AddProperty(new MP4Integer16Property(pTable->GetParentAtom(),"sequenceParameterSetLength")); pTable->AddProperty(new MP4BytesProperty(pTable->GetParentAtom(),"sequenceParameterSetNALUnit")); MP4Integer8Property *pCount2 = new MP4Integer8Property(*this,"numOfPictureParameterSets"); AddProperty(pCount2); /* 9 */ pTable = new SizeTableProperty(*this,"pictureEntries", pCount2); AddProperty(pTable); /* 10 */ pTable->AddProperty(new MP4Integer16Property(pTable->GetParentAtom(),"pictureParameterSetLength")); pTable->AddProperty(new MP4BytesProperty(pTable->GetParentAtom(),"pictureParameterSetNALUnit")); #endif //cwm 301 #endif //cwm 278 }
MP4SdpAtom::MP4SdpAtom() : MP4Atom("sdp ") { AddProperty( new MP4StringProperty("sdpText")); }
void CPropertiesCanvas::AddProperty(Property* p, wxPGProperty* parent_prop) { switch(p->get_property_type()){ case StringPropertyType: { wxPGProperty *new_prop = wxStringProperty(p->GetShortString(),wxPG_LABEL, ((PropertyString*)p)->m_initial_value); if(!p->property_editable())new_prop->SetFlag(wxPG_PROP_READONLY); Append( parent_prop, new_prop, p); if(p->m_highlighted)m_pg->SetPropertyBackgroundColour(new_prop->GetId(), wxColour(71, 141, 248)); } break; case DoublePropertyType: case LengthPropertyType: { wxString initial_value; initial_value << ((PropertyDouble*)p)->m_initial_value; // wxPGProperty *new_prop = wxFloatProperty(p->GetShortString(),wxPG_LABEL, ((PropertyDouble*)p)->m_initial_value); wxPGProperty *new_prop = wxStringProperty(p->GetShortString(),wxPG_LABEL, initial_value); if(!p->property_editable())new_prop->SetFlag(wxPG_PROP_READONLY); Append( parent_prop, new_prop, p); } break; case IntPropertyType: { wxPGProperty *new_prop = wxIntProperty(p->GetShortString(),wxPG_LABEL, ((PropertyInt*)p)->m_initial_value); if(!p->property_editable())new_prop->SetFlag(wxPG_PROP_READONLY); Append( parent_prop, new_prop, p); } break; case ColorPropertyType: { HeeksColor& col = ((PropertyColor*)p)->m_initial_value; wxColour wcol(col.red, col.green, col.blue); wxPGProperty *new_prop = wxColourProperty(p->GetShortString(),wxPG_LABEL, wcol); if(!p->property_editable())new_prop->SetFlag(wxPG_PROP_READONLY); Append( parent_prop, new_prop, p); } break; case ChoicePropertyType: { wxArrayString array_string; std::list< wxString >::iterator It; for(It = ((PropertyChoice*)p)->m_choices.begin(); It != ((PropertyChoice*)p)->m_choices.end(); It++){ array_string.Add(wxString(It->c_str())); } wxPGProperty *new_prop = wxEnumProperty(p->GetShortString(),wxPG_LABEL,array_string, ((PropertyChoice*)p)->m_initial_index); if(!p->property_editable())new_prop->SetFlag(wxPG_PROP_READONLY); Append( parent_prop, new_prop, p ); } break; case VertexPropertyType: { wxPGProperty* new_prop = wxParentProperty(p->GetShortString(),wxPG_LABEL); Append( parent_prop, new_prop, p ); double x[3]; unsigned int number_of_axes = 3; if(((PropertyVertex*)p)->xyOnly())number_of_axes = 2; memcpy(x, ((PropertyVertex*)p)->m_x, number_of_axes*sizeof(double)); if(((PropertyVertex*)p)->m_affected_by_view_units) { for(unsigned int i = 0; i<number_of_axes; i++)x[i] /= wxGetApp().m_view_units; } wxPGProperty* x_prop = wxFloatProperty(_("x"),wxPG_LABEL, x[0]); if(!p->property_editable())x_prop->SetFlag(wxPG_PROP_READONLY); Append( new_prop, x_prop, p ); wxPGProperty* y_prop = wxFloatProperty(_("y"),wxPG_LABEL, x[1]); if(!p->property_editable())y_prop->SetFlag(wxPG_PROP_READONLY); Append( new_prop, y_prop, p ); if(!((PropertyVertex*)p)->xyOnly()) { wxPGProperty* z_prop = wxFloatProperty(_("z"),wxPG_LABEL, x[2]); if(!p->property_editable())z_prop->SetFlag(wxPG_PROP_READONLY); new_prop->SetFlag(wxPG_PROP_READONLY); Append( new_prop, z_prop, p ); } } break; case TrsfPropertyType: { double x[3]; extract(((PropertyTrsf*)p)->m_trsf.TranslationPart(), x); gp_Dir xaxis(1, 0, 0); xaxis.Transform(((PropertyTrsf*)p)->m_trsf); gp_Dir yaxis(0, 1, 0); yaxis.Transform(((PropertyTrsf*)p)->m_trsf); double vertical_angle = 0; double horizontal_angle = 0; double twist_angle = 0; CoordinateSystem::AxesToAngles(xaxis, yaxis, vertical_angle, horizontal_angle, twist_angle); wxPGProperty* new_prop = wxParentProperty(p->GetShortString(),wxPG_LABEL); Append( parent_prop, new_prop, p ); wxPGProperty* x_prop = wxFloatProperty(_("x"),wxPG_LABEL,x[0]); if(!p->property_editable())x_prop->SetFlag(wxPG_PROP_READONLY); Append( new_prop, x_prop, p ); wxPGProperty* y_prop = wxFloatProperty(_("y"),wxPG_LABEL,x[1]); if(!p->property_editable())y_prop->SetFlag(wxPG_PROP_READONLY); Append( new_prop, y_prop, p ); wxPGProperty* z_prop = wxFloatProperty(_("z"),wxPG_LABEL,x[2]); if(!p->property_editable())z_prop->SetFlag(wxPG_PROP_READONLY); Append( new_prop, z_prop, p ); wxPGProperty* v_prop = wxFloatProperty(_("vertical angle"),wxPG_LABEL,vertical_angle); if(!p->property_editable())v_prop->SetFlag(wxPG_PROP_READONLY); Append( new_prop, v_prop, p ); wxPGProperty* h_prop = wxFloatProperty(_("horizontal angle"),wxPG_LABEL,horizontal_angle); if(!p->property_editable())h_prop->SetFlag(wxPG_PROP_READONLY); Append( new_prop, h_prop, p ); wxPGProperty* t_prop = wxFloatProperty(_("twist angle"),wxPG_LABEL,twist_angle); if(!p->property_editable())t_prop->SetFlag(wxPG_PROP_READONLY); new_prop->SetFlag(wxPG_PROP_READONLY); Append( new_prop, t_prop, p ); } break; case CheckPropertyType: { wxPGProperty* new_prop = wxBoolProperty(p->GetShortString(),wxPG_LABEL, ((PropertyCheck*)p)->m_initial_value); if(!p->property_editable())new_prop->SetFlag(wxPG_PROP_READONLY); Append( parent_prop, new_prop, p ); m_pg->SetPropertyAttribute(new_prop, wxPG_BOOL_USE_CHECKBOX, true); } break; case ListOfPropertyType: { wxPGProperty* new_prop = wxParentProperty(p->GetShortString(),wxPG_LABEL); if(!p->property_editable())new_prop->SetFlag(wxPG_PROP_READONLY); Append( parent_prop, new_prop, p ); std::list< Property* >::iterator It; for(It = ((PropertyList*)p)->m_list.begin(); It != ((PropertyList*)p)->m_list.end(); It++){ Property* p2 = *It; AddProperty(p2, new_prop); } } break; case FilePropertyType: { wxPGProperty *new_prop = wxFileProperty(p->GetShortString(),wxPG_LABEL, ((PropertyFile*)p)->m_initial_value); if(!p->property_editable())new_prop->SetFlag(wxPG_PROP_READONLY); Append( parent_prop, new_prop, p); if(p->m_highlighted)m_pg->SetPropertyBackgroundColour(new_prop->GetId(), wxColour(71, 141, 248)); } break; case DirectoryPropertyType: { wxPGProperty *new_prop = wxDirProperty(p->GetShortString(),wxPG_LABEL, ((PropertyDir*)p)->m_initial_value); if(!p->property_editable())new_prop->SetFlag(wxPG_PROP_READONLY); Append( parent_prop, new_prop, p); if(p->m_highlighted)m_pg->SetPropertyBackgroundColour(new_prop->GetId(), wxColour(71, 141, 248)); } break; } }
// Sets up the property and method identifier arrays used by the browser // via the hasProperty and hasMethod fuction pointers void GnashPluginScriptObject::initializeIdentifiers() { // log_debug("initializeIdentifiers"); // NPN_Status(nppinstance, __FUNCTION__); // http://www.adobe.com/support/flash/publishexport/scriptingwithflash/scriptingwithflash_04.html // We maintain an internal property for our version number, rather // than asking the player. AddProperty("$version", "10,1,r999"); // id and name appear to be the same tag, but differeing browsers access // one or the other, or both. // name=send_this_page_swf AddProperty("name", "Hello World"); // id=send_this_page_swf AddProperty("id", "Hello World"); // http://s.ytimg.com/yt/swf/watch-vfl161193.swf AddProperty("src", "example"); AddProperty("align", "middle"); AddProperty("quality", "high"); AddProperty("bgcolor", "#FFFFFF"); AddProperty("allowScriptAccess", "sameDomain"); AddProperty("type", "application/x-shockwave-flash"); AddProperty("codebase", "http://www.getgnash.org"); AddProperty("pluginspage", "http://www.getgnash.org"); AddProperty("classid", "2b70f2b1-fc72-4734-bb81-4eb2a7713e49"); AddProperty("movie", "unknown"); AddProperty("width", 0); AddProperty("height", 0); AddProperty("vspace", 0); AddProperty("hspace", 0); AddProperty("class", "class unknown"); AddProperty("title", "title unknown"); AddProperty("accesskey", 0); AddProperty("name", "name unknown"); AddProperty("tabindex", 8); AddProperty("FlashVars", "flashVars unknown"); // Javascript and flash events AddProperty("onafterupdate", "unknown"); AddProperty("onbeforeupdate", "unknown"); AddProperty("onblur", "unknown"); AddProperty("oncellchange", "unknown"); AddProperty("onclick", "unknown"); AddProperty("ondblClick", "unknown"); AddProperty("ondrag", "unknown"); AddProperty("ondragend", "unknown"); AddProperty("ondragenter", "unknown"); AddProperty("ondragleave", "unknown"); AddProperty("ondragover", "unknown"); AddProperty("ondrop", "unknown"); AddProperty("onfinish", "unknown"); AddProperty("onfocus", "unknown"); AddProperty("onhelp", "unknown"); AddProperty("onmousedown", "unknown"); AddProperty("onmouseup", "unknown"); AddProperty("onmouseover", "unknown"); AddProperty("onmousemove", "unknown"); AddProperty("onmouseout", "unknown"); AddProperty("onkeypress", "unknown"); AddProperty("onkeydown", "unknown"); AddProperty("onkeyup", "unknown"); AddProperty("onload", "unknown"); AddProperty("onlosecapture", "unknown"); AddProperty("onpropertychange", "unknown"); AddProperty("onreadystatechange", "unknown"); AddProperty("onrowsdelete", "unknown"); AddProperty("onrowenter", "unknown"); AddProperty("onrowexit", "unknown"); AddProperty("onrowsinserted", "unknown"); AddProperty("onstart", ""); AddProperty("onscroll", "unknown"); AddProperty("onbeforeeditfocus", "unknown"); AddProperty("onactivate", "unknown"); AddProperty("onbeforedeactivate", "unknown"); AddProperty("ondeactivate", "unknown"); // Add the default methods NPIdentifier id = NPN_GetStringIdentifier("SetVariable"); AddMethod(id, SetVariableCallback); id = NPN_GetStringIdentifier("GetVariable"); AddMethod(id, GetVariableCallback); id = NPN_GetStringIdentifier("GotoFrame"); AddMethod(id, GotoFrame); id = NPN_GetStringIdentifier("IsPlaying"); AddMethod(id, IsPlaying); id = NPN_GetStringIdentifier("LoadMovie"); AddMethod(id, LoadMovie); id = NPN_GetStringIdentifier("Pan"); AddMethod(id, Pan); id = NPN_GetStringIdentifier("PercentLoaded"); AddMethod(id, PercentLoaded); id = NPN_GetStringIdentifier("Play"); AddMethod(id, Play); id = NPN_GetStringIdentifier("Rewind"); AddMethod(id, Rewind); id = NPN_GetStringIdentifier("SetZoomRect"); AddMethod(id, SetZoomRect); id = NPN_GetStringIdentifier("StopPlay"); AddMethod(id, StopPlay); id = NPN_GetStringIdentifier("Zoom"); AddMethod(id, Zoom); id = NPN_GetStringIdentifier("TotalFrames"); AddMethod(id, TotalFrames); // id = NPN_GetStringIdentifier("TestASMethod"); // AddMethod(id, remoteCallback); };
void WidgetStyle::AddGeneralProperty(const NamedProperties& prop) { AddProperty(UI_STATE_ALL, prop); }
void PropertyList::AddSubsection(const String &subsectionName) { PropertyCellData *p = new PropertyCellData(PropertyCellData::PROP_VALUE_SUBSECTION); p->cellType = PropertyCell::PROP_CELL_SUBSECTION; AddProperty(p, subsectionName, PROPERTY_IS_READ_ONLY); }