cDBusRecordingsConst::cDBusRecordingsConst(void) :cDBusObject("/Recordings", cDBusRecordingsHelper::_xmlNodeInfoConst) { AddMethod("Get", cDBusRecordingsHelper::Get); AddMethod("List", cDBusRecordingsHelper::List); AddMethod("ListExtraVideoDirectories", cDBusRecordingsHelper::ListExtraVideoDirectories); }
void PDirectory::InitMethods(void) { PMethodInterface pmi; pmi.AddArg("path", B_STRING_TYPE, " A relative path or filename", 0); pmi.AddArg("type", B_INT32_TYPE, " An optional node type", 0); pmi.AddReturnValue("value", B_BOOL_TYPE, " True if the directory (or a subdirectory) constains the path"); AddMethod(new PMethod("Contains", PDirectoryContains, &pmi)); pmi.MakeEmpty(); pmi.AddArg("path", B_STRING_TYPE, " A relative path", 0); pmi.AddReturnValue("path", B_STRING_TYPE, " The full path of the created directory"); pmi.AddReturnValue("status", B_INT32_TYPE, " The error status of the call"); AddMethod(new PMethod("CreateDirectory", PDirectoryCreateDirectory, &pmi)); pmi.MakeEmpty(); pmi.AddArg("path", B_STRING_TYPE, " A relative path", 0); pmi.AddArg("dontclobber", B_BOOL_TYPE, " Fail if the file already exists if true", 0); pmi.AddReturnValue("status", B_INT32_TYPE, " The error status of the call"); AddMethod(new PMethod("CreateFile", PDirectoryCreateFile, &pmi)); pmi.MakeEmpty(); pmi.AddArg("path", B_STRING_TYPE, " A relative path", 0); pmi.AddArg("target", B_STRING_TYPE, " Path of the link's target", 0); pmi.AddReturnValue("status", B_INT32_TYPE, " The error status of the call"); AddMethod(new PMethod("CreateSymLink", PDirectoryCreateSymLink, &pmi)); pmi.MakeEmpty(); pmi.AddReturnValue("entries", B_LIST_TYPE, " A list of filenames in the directory"); AddMethod(new PMethod("GetEntries", PDirectoryGetEntries, &pmi)); pmi.MakeEmpty(); }
cDBusRecordingsConst::cDBusRecordingsConst(const char *NodeInfo) :cDBusObject("/Recordings", NodeInfo) { AddMethod("Get", cDBusRecordingsHelper::Get); AddMethod("List", cDBusRecordingsHelper::List); AddMethod("ListExtraVideoDirectories", cDBusRecordingsHelper::ListExtraVideoDirectories); }
cDBusPlugin::cDBusPlugin(const char *Path) :cDBusObject(Path, cDBusPluginsHelper::_xmlNodeInfoPlugin) { AddMethod("List", cDBusPluginsHelper::List); AddMethod("SVDRPCommand", cDBusPluginsHelper::SVDRPCommand); AddMethod("Service", cDBusPluginsHelper::Service); }
cDBusSkin::cDBusSkin(void) :cDBusObject("/Skin", cDBusSkinHelper::_xmlNodeInfo) { AddMethod("CurrentSkin", cDBusSkinHelper::CurrentSkin); AddMethod("ListSkins", cDBusSkinHelper::ListSkins); AddMethod("SetSkin", cDBusSkinHelper::SetSkin); AddMethod("QueueMessage", cDBusSkinHelper::QueueMessage); }
cDBusRecordings::cDBusRecordings(void) :cDBusRecordingsConst(cDBusRecordingsHelper::_xmlNodeInfo) { AddMethod("Update", cDBusRecordingsHelper::Update); AddMethod("Play", cDBusRecordingsHelper::Play); AddMethod("AddExtraVideoDirectory", cDBusRecordingsHelper::AddExtraVideoDirectory); AddMethod("ClearExtraVideoDirectories", cDBusRecordingsHelper::ClearExtraVideoDirectories); AddMethod("DeleteExtraVideoDirectory", cDBusRecordingsHelper::DeleteExtraVideoDirectory); }
void Class::Load(yaml::MapNode *node) { for (const yaml::MapNode::value_type &ent : *node) { yaml::MapNode *root = dynamic_cast<yaml::MapNode*>(ent.second); if (root != NULL) { const std::string &methodName = ent.first; // Determine the type of method. std::string type; root->ReadString("type", type); MethodPtr method; if (type == "event") { method = std::make_shared<Event>(methodName); } else if (type == "method") { method = std::make_shared<Method>(methodName); } else { //TODO continue; } method->Load(root); AddMethod(method); } } }
void Register(lua_State* state) { LUA->PushCFunction(CreateModule); LUA->SetField(-2, "Const"); LUA->CreateMetaTableType("NoiseConst", GarrysMod::Lua::Type::USERDATA); LUA->Push(-1); LUA->SetField(-2, "__index"); LUA->PushString("NoiseConst"); LUA->SetField(-2, "__type"); AddMethod(state, GetValue, "GetValue"); AddMethod(state, GetSourceModuleCount, "GetSourceModuleCount"); AddMethod(state, GetConstValue, "GetConstValue"); AddMethod(state, SetConstValue, "SetConstValue"); LUA->Pop(); }
Handler::Handler() { /* add a RPC method that list the actual RPC methods contained in the Handler */ Json::Value root; root["description"] = "List the RPC methods available"; root["parameters"] = Json::Value::null; root["returns"] = "Object that contains description of all methods registered"; AddMethod(new RpcMethod<Handler>(*this, &Handler::SystemDescribe, std::string("system.describe"), root)); }
void CGroupingDlg::OnDelete() { for ( int nItem = m_wndList.GetNextItem(-1, LVIS_SELECTED); nItem != -1; nItem = m_wndList.GetNextItem(-1, LVIS_SELECTED) ) { CXMLElement* pXML = (CXMLElement*)m_wndList.GetItemData( nItem ); AddMethod( pXML, METHOD_DELETE ); m_wndList.DeleteItem( nItem ); pXML->Delete(); } }
void PMenuItem::InitMethods(void) { PMethodInterface pmi; pmi.AddReturnValue("shortcut", B_CHAR_TYPE, " the item's shortcut character"); pmi.AddReturnValue("modifiers", B_INT32_TYPE, " the item's shortcut modifier keys"); AddMethod(new PMethod("GetShortcut", PMenuItemGetShortcut, &pmi)); pmi.MakeEmpty(); pmi.AddArg("shortcut", B_CHAR_TYPE, " character to define as the item's shortcut", 0); pmi.AddArg("modifiers", B_INT32_TYPE, " constants for modifier keys, like the Control key.", 0); AddMethod(new PMethod("SetShortcut", PMenuItemSetShortcut, &pmi)); pmi.MakeEmpty(); pmi.AddReturnValue("id", B_INT64_TYPE, " object ID of the owning menu, if there is one."); AddMethod(new PMethod("Submenu", PMenuItemSubmenu, &pmi)); pmi.MakeEmpty(); }
TimerObject::TimerObject(const char *name, int interval, bool autostart):DynamicObject(name) { this->interval = interval; this->enabled = false; this->autostart = autostart; this->type = TYPE_TIMER; this->timer_id = 0; this->defaultevent = "OnTimer"; MemberFunctionProperty < TimerObject > *mp; mp = new MemberFunctionProperty < TimerObject > ("enabled", this, &TimerObject::pget_Enabled, &TimerObject::pset_Enabled, false); AddProperty(mp); mp = new MemberFunctionProperty < TimerObject > ("interval", this, &TimerObject::pget_Interval, &TimerObject::pset_Interval, false); AddProperty(mp); MemberMethodHandler < TimerObject > *mh; mh = new MemberMethodHandler < TimerObject > ("start", this, 0, &TimerObject::m_Start); AddMethod(mh); mh = new MemberMethodHandler < TimerObject > ("stop", this, 0, &TimerObject::m_Stop); AddMethod(mh); }
WebBrowserObject::WebBrowserObject(const char *name): GUI_Widget(name, 0, 0, 0, 0) { type = TYPE_WEBBROWSER; status = 0; mozilla = 0; toplevel = 0; location = 0; loadPercent = 0; bytesLoaded = 0; maxBytesLoaded = 0; toolbar_flag = 1; char *mhome = getenv("HOME"); char *muser = (char*)systemObject->configGetValue("user_name","lmbox"); char *mpath = g_strdup_printf("%s/%s", mhome ? mhome : "/tmp", ".mozilla"); gtk_moz_embed_set_profile_path(mpath, muser); MemberFunctionProperty < WebBrowserObject > *mp; mp = new MemberFunctionProperty < WebBrowserObject > ("location", this, &WebBrowserObject::pget_Location, &WebBrowserObject::pset_Location, false); AddProperty(mp); mp = new MemberFunctionProperty < WebBrowserObject > ("status", this, &WebBrowserObject::pget_Status, NULL, false); AddProperty(mp); mp = new MemberFunctionProperty < WebBrowserObject > ("version", this, &WebBrowserObject::pget_Version, NULL, false); AddProperty(mp); MemberMethodHandler < WebBrowserObject > *mh; mh = new MemberMethodHandler < WebBrowserObject > ("data", this, 1, &WebBrowserObject::m_Data); AddMethod(mh); mh = new MemberMethodHandler < WebBrowserObject > ("back", this, 0, &WebBrowserObject::m_Back); AddMethod(mh); mh = new MemberMethodHandler < WebBrowserObject > ("open", this, 0, &WebBrowserObject::m_Open); AddMethod(mh); mh = new MemberMethodHandler < WebBrowserObject > ("stop", this, 0, &WebBrowserObject::m_Stop); AddMethod(mh); mh = new MemberMethodHandler < WebBrowserObject > ("forward", this, 0, &WebBrowserObject::m_Forward); AddMethod(mh); mh = new MemberMethodHandler < WebBrowserObject > ("reload", this, 0, &WebBrowserObject::m_Reload); AddMethod(mh); mh = new MemberMethodHandler < WebBrowserObject > ("refresh", this, 0, &WebBrowserObject::m_Refresh); AddMethod(mh); mh = new MemberMethodHandler < WebBrowserObject > ("close", this, 0, &WebBrowserObject::m_Close); AddMethod(mh); mh = new MemberMethodHandler < WebBrowserObject > ("event", this, 2, &WebBrowserObject::m_Event); AddMethod(mh); }
/*! Set up proxy classes and basic methods at class creation time This ensures that they are processed before the registered flext messages */ void flext_base::Setup(t_classid id) { t_class *c = getClass(id); #if FLEXT_SYS == FLEXT_SYS_MAX if(!IsLib(id)) #endif AddMessageMethods(c,IsDSP(id),HasDSPIn(id)); if(HasAttributes(id)) { AddMethod(id,0,"getattributes",cb_ListAttrib); AddMethod(id,0,"getmethods",cb_ListMethods); #if FLEXT_SYS == FLEXT_SYS_PD && !defined(FLEXT_NOATTREDIT) AddMethod(id,0,"attributedialog",cb_AttrDialog); #endif } #if FLEXT_SYS == FLEXT_SYS_PD SetGfx(id); #endif }
/** Adds a new property. * \relates adbus_Interface */ adbus_Member* adbus_iface_addproperty( adbus_Interface* i, const char* name, int namesize, const char* sig, int sigsize) { adbus_Member* m = AddMethod(i, ADBUSI_PROPERTY, name, namesize); m->propertyType = (sigsize >= 0) ? adbusI_strndup(sig, sigsize) : adbusI_strdup(sig); return m; }
void CGroupingDlg::OnEndLabelEditList(LV_DISPINFO* pNotify, LRESULT* pResult) { static LPCTSTR pszInfo[] = { _T("xphone"), _T("xname") }; if ( pNotify->item.pszText && *pNotify->item.pszText ) { m_wndList.SetItemText( pNotify->item.iItem, m_pHitInfo.iSubItem, pNotify->item.pszText ); m_pEdit.UnsubclassWindow(); CXMLElement* pXML = (CXMLElement*)pNotify->item.lParam; if ( ! pXML ) { pXML = new CXMLElement( NULL, _T("SyncOrder") ); pXML->AddAttribute( pszInfo[m_pHitInfo.iSubItem], pNotify->item.pszText ); CString strValue; m_wndGroup.GetWindowText( strValue ); strValue.TrimLeft(); strValue.TrimRight(); ASSERT( ! strValue.IsEmpty() ); pXML->AddAttribute( _T("xgroupname"), strValue ); m_pXML->AddElement( pXML ); AddMethod( pXML, METHOD_INSERT ); } else { CXMLElement* pXMLSwap = new CXMLElement( NULL, _T("SyncOrder") ); pXMLSwap->AddAttribute( pszInfo[m_pHitInfo.iSubItem], pNotify->item.pszText ); AddMethod( pXML, METHOD_UPDATE, pXMLSwap ); pXML->AddAttribute( pszInfo[m_pHitInfo.iSubItem], pNotify->item.pszText ); } m_wndList.SetItemData( pNotify->item.iItem, (DWORD)pXML ); } *pResult = 0; }
DynamicObject::DynamicObject(const char *name):Object(name) { this->type = TYPE_DYNAMICOBJECT; this->defaultproperty = 0; this->defaultevent = 0; this->timer_id = 0; this->timer_script = 0; this->data = 0; pthread_cond_init(&msgcond, 0); pthread_mutex_init(&msglock, 0); MemberFunctionProperty < DynamicObject > *mp; mp = new MemberFunctionProperty < DynamicObject > ("name", this, &DynamicObject::pget_Name, NULL, false); AddProperty(mp); mp = new MemberFunctionProperty < DynamicObject > ("type", this, &DynamicObject::pget_Type, NULL, false); AddProperty(mp); mp = new MemberFunctionProperty < DynamicObject > ("methodcount", this, &DynamicObject::pget_MethodCount, NULL, false); AddProperty(mp); mp = new MemberFunctionProperty < DynamicObject > ("flags", this, &DynamicObject::pget_Flags, &DynamicObject::pset_Flags, false); AddProperty(mp); mp = new MemberFunctionProperty < DynamicObject > ("timerinterval", this, &DynamicObject::pget_TimerInterval, NULL, false); AddProperty(mp); mp = new MemberFunctionProperty < DynamicObject > ("timerscript", this, &DynamicObject::pget_TimerScript, NULL, false); AddProperty(mp); mp = new MemberFunctionProperty < DynamicObject > ("data", this, &DynamicObject::pget_Data, &DynamicObject::pset_Data, false); AddProperty(mp); mp = new MemberFunctionProperty < DynamicObject > ("events", this, &DynamicObject::pget_EventHandlers, NULL, false); AddProperty(mp); mp = new MemberFunctionProperty < DynamicObject > ("objects", this, &DynamicObject::pget_Objects, NULL, false); AddProperty(mp); mp = new MemberFunctionProperty < DynamicObject > ("properties", this, &DynamicObject::pget_Properties, NULL, false); AddProperty(mp); MemberMethodHandler < DynamicObject > *mh; mh = new MemberMethodHandler < DynamicObject > ("getproperty", this, 1, &DynamicObject::m_GetProperty); AddMethod(mh); mh = new MemberMethodHandler < DynamicObject > ("getmethod", this, 1, &DynamicObject::m_GetMethod); AddMethod(mh); mh = new MemberMethodHandler < DynamicObject > ("settimer", this, 2, &DynamicObject::m_SetTimer); AddMethod(mh); mh = new MemberMethodHandler < DynamicObject > ("firetimer", this, 0, &DynamicObject::m_FireTimer); AddMethod(mh); mh = new MemberMethodHandler < DynamicObject > ("addeventhandler", this, 2, &DynamicObject::m_AddEventHandler); AddMethod(mh); mh = new MemberMethodHandler < DynamicObject > ("removeeventhandler", this, 1, &DynamicObject::m_RemoveEventHandler); AddMethod(mh); mh = new MemberMethodHandler < DynamicObject > ("message", this, 2, &DynamicObject::m_Message); AddMethod(mh); }
void ShaderObject::DeserializeMethods(const wxXmlNode& root) { wxXmlNode *child = root.GetChildren(); while (child != NULL) { if (child->GetName() == wxT("method")) { wxString name = XML::GetStringAttribute(*child, wxT("name")); wxString target = XML::GetStringAttribute(*child, wxT("target")); wxString type = XML::GetStringAttribute(*child, wxT("type")); Method *method = DeserializeMethod(*child); AddMethod(name, target, method); } child = child->GetNext(); } }
/************************************** * XmlHandler * Constructor *************************************/ XmlHandler::XmlHandler(XmlHandlerCmd *cmd,void *user_data) { xmlrpc_env env; //Build the enviroment xmlrpc_env_init(&env); //Creamos el registro registry = xmlrpc_registry_new(&env); //Append commands while (cmd && cmd->name) { //Append methods AddMethod(cmd->name,cmd->func,user_data); //Next cmd++; } }
/* * Make a value type. */ static void MakeValueType(ILGenInfo *info, ILImage *image, const char *name, ILClass *parent, ILClass *stringClass) { ILClass *newClass; ABORT_IF(newClass, ILClassCreate(ILClassGlobalScope(image), 0, name, "System", parent)); ILClassSetAttrs(newClass, ~0, IL_META_TYPEDEF_PUBLIC | IL_META_TYPEDEF_VALUE_TYPE | IL_META_TYPEDEF_LAYOUT_SEQUENTIAL | IL_META_TYPEDEF_SERIALIZABLE | IL_META_TYPEDEF_BEFORE_FIELD_INIT | IL_META_TYPEDEF_SEALED); if(!AddMethod(newClass, "ToString", ILType_FromClass(stringClass), ILType_Void, ILType_Void, IL_META_METHODDEF_VIRTUAL)) { ILGenOutOfMemory(info); } }
void PTextView::InitMethods(void) { PMethodInterface pmi; pmi.AddArg("chars", B_STRING_TYPE, " The set of characters to allow", 0); AddMethod(new PMethod("AllowChars", PTextViewAllowChars, &pmi)); pmi.MakeEmpty(); pmi.AddArg("offset", B_INT32_TYPE, " Offset of the byte to get.", 0); pmi.AddReturnValue("value", B_CHAR_TYPE, " 1-byte character at the specified offset."); AddMethod(new PMethod("ByteAt", PTextViewByteAt, &pmi)); pmi.MakeEmpty(); pmi.AddArg("offset", B_INT32_TYPE, " Offset to test for line ending", 0); pmi.AddReturnValue("value", B_BOOL_TYPE, " True if the character can be the last one on a line."); AddMethod(new PMethod("CanEndLine", PTextViewCanEndLine, &pmi)); pmi.MakeEmpty(); pmi.AddArg("clipid", B_INT64_TYPE, " The id of a clipboard object", 0); AddMethod(new PMethod("Copy", PTextViewCopy, &pmi)); pmi.MakeEmpty(); pmi.AddArg("clipid", B_INT64_TYPE, " The id of a clipboard object", 0); AddMethod(new PMethod("Cut", PTextViewCut, &pmi)); pmi.MakeEmpty(); pmi.AddArg("start", B_INT32_TYPE, " Starting offset of the range to delete.", 0); pmi.AddArg("end", B_INT32_TYPE, " Ending offset of the range to delete.", 0); AddMethod(new PMethod("Delete", PTextViewDelete, &pmi)); pmi.MakeEmpty(); pmi.AddArg("chars", B_STRING_TYPE, " The set of characters to disallow", 0); AddMethod(new PMethod("DisallowChars", PTextViewDisallowChars, &pmi)); pmi.MakeEmpty(); pmi.AddArg("offset", B_INT32_TYPE, " Starting point for searching for a word", 0); pmi.AddReturnValue("start", B_INT32_TYPE, " Starting offset of the next word"); pmi.AddReturnValue("end", B_INT32_TYPE, " Ending offset of the next word"); AddMethod(new PMethod("FindWord", PTextViewFindWord, &pmi)); pmi.MakeEmpty(); pmi.AddReturnValue("left", B_FLOAT_TYPE, " Left inset"); pmi.AddReturnValue("top", B_FLOAT_TYPE, " Top inset"); pmi.AddReturnValue("right", B_FLOAT_TYPE, " Right inset"); pmi.AddReturnValue("bottom", B_FLOAT_TYPE, " Bottom inset"); AddMethod(new PMethod("GetInsets", PTextViewGetInsets, &pmi)); pmi.MakeEmpty(); pmi.AddReturnValue("start", B_INT32_TYPE, " Starting offset of the selection"); pmi.AddReturnValue("end", B_INT32_TYPE, " Ending offset of the selection"); AddMethod(new PMethod("GetSelection", PTextViewGetSelection, &pmi)); pmi.MakeEmpty(); pmi.AddArg("start", B_INT32_TYPE, " Starting offset of the text", 0); pmi.AddArg("end", B_INT32_TYPE, " Ending offset of the text", 0); AddMethod(new PMethod("GetText", PTextViewGetText, &pmi)); pmi.MakeEmpty(); pmi.AddArg("start", B_INT32_TYPE, " Starting offset of the text to highlight", 0); pmi.AddArg("end", B_INT32_TYPE, " Ending offset of the text to highlight", 0); AddMethod(new PMethod("Highlight", PTextViewHighlight, &pmi)); pmi.MakeEmpty(); pmi.AddArg("text", B_STRING_TYPE, " The text to insert", 0); pmi.AddArg("length", B_INT32_TYPE, " How much of the string to insert", 0); AddMethod(new PMethod("Insert", PTextViewInsert, &pmi)); pmi.MakeEmpty(); pmi.AddArg("offset", B_INT32_TYPE, " Offset to find the line for", 0); pmi.AddReturnValue("line", B_INT32_TYPE, " Line for the specified offset"); AddMethod(new PMethod("LineAtOffset", PTextViewLineAtOffset, &pmi)); pmi.MakeEmpty(); pmi.AddArg("point", B_POINT_TYPE, " Point to find the line for", 0); pmi.AddReturnValue("pointline", B_INT32_TYPE, " Line for the specified point."); AddMethod(new PMethod("LineAtPoint", PTextViewLineAtPoint, &pmi)); pmi.MakeEmpty(); pmi.AddArg("clipid", B_INT64_TYPE, " Object ID of a PClipboard object", 0); AddMethod(new PMethod("Paste", PTextViewPaste, &pmi)); pmi.MakeEmpty(); pmi.AddArg("offset", B_INT32_TYPE, " Offset to get the point for", 0); pmi.AddReturnValue("point", B_POINT_TYPE, " Point for the offset specified"); pmi.AddReturnValue("height", B_FLOAT_TYPE, " Height of the line at the specified offset"); AddMethod(new PMethod("PointAt", PTextViewPointAt, &pmi)); pmi.MakeEmpty(); pmi.AddArg("offset", B_INT32_TYPE, " Offset to scroll to", 0); AddMethod(new PMethod("ScrollToOffset", PTextViewScrollToOffset, &pmi)); pmi.MakeEmpty(); AddMethod(new PMethod("ScrollToSelection", PTextViewScrollToSelection, &pmi)); pmi.MakeEmpty(); pmi.AddArg("start", B_INT32_TYPE, " Starting offset of the next word", 0); pmi.AddArg("end", B_INT32_TYPE, " Ending offset of the next word", 0); AddMethod(new PMethod("Select", PTextViewSelect, &pmi)); pmi.MakeEmpty(); AddMethod(new PMethod("SelectAll", PTextViewSelectAll, &pmi)); pmi.MakeEmpty(); pmi.AddArg("left", B_FLOAT_TYPE, " Left inset", 0); pmi.AddArg("top", B_FLOAT_TYPE, " Top inset", 0); pmi.AddArg("right", B_FLOAT_TYPE, " Right inset", 0); pmi.AddArg("bottom", B_FLOAT_TYPE, " Bottom inset", 0); AddMethod(new PMethod("SetInsets", PTextViewSetInsets, &pmi)); pmi.MakeEmpty(); pmi.AddArg("text", B_STRING_TYPE, " Text to set the Text View to", 0); pmi.AddArg("length", B_INT32_TYPE, " Length of the text to insert", 0); AddMethod(new PMethod("SetText", PTextViewSetText, &pmi)); pmi.MakeEmpty(); pmi.AddArg("start", B_INT32_TYPE, " Starting offset of the text to highlight", 0); pmi.AddArg("end", B_INT32_TYPE, " Ending offset of the text to highlight", 0); pmi.AddReturnValue("height", B_FLOAT_TYPE, " Total height of the lines specified by the given offsets"); AddMethod(new PMethod("TextHeight", PTextViewTextHeight, &pmi)); pmi.MakeEmpty(); pmi.AddArg("clipid", B_INT64_TYPE, " Object ID of a PClipboard object", 0); AddMethod(new PMethod("Undo", PTextViewUndo, &pmi)); pmi.MakeEmpty(); }
// 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 PRoster::InitMethods(void) { PMethodInterface pmi; pmi.AddArg("team", B_INT32_TYPE, "Team ID of the app to activate"); pmi.AddReturnValue("status", B_INT32_TYPE, "Error status of the call"); AddMethod(new PMethod("ActivateApp", PRosterActivateApp, &pmi)); pmi.MakeEmpty(); pmi.AddArg("message", B_LIST_TYPE, "Argument list containing the message data"); pmi.AddReturnValue("status", B_INT32_TYPE, "Error status of the call"); AddMethod(new PMethod("Broadcast", PRosterBroadcast, &pmi)); pmi.MakeEmpty(); pmi.AddArg("signature", B_STRING_TYPE, "MIME type of the desired app", PMIFLAG_OPTIONAL); pmi.AddArg("path", B_STRING_TYPE, "path of the desired app", PMIFLAG_OPTIONAL); pmi.AddReturnValue("entry_ref", B_LIST_TYPE, "List containing entry_ref information"); pmi.AddReturnValue("status", B_INT32_TYPE, "Error status of the call"); AddMethod(new PMethod("FindApp", PRosterFindApp, &pmi)); pmi.MakeEmpty(); pmi.AddArg("signature", B_STRING_TYPE, "MIME type of the desired app", PMIFLAG_OPTIONAL); pmi.AddArg("path", B_STRING_TYPE, "path of the desired app", PMIFLAG_OPTIONAL); pmi.AddReturnValue("info_list", B_LIST_TYPE, "List of lists containing the app_info information"); pmi.AddReturnValue("status", B_INT32_TYPE, "Error status of the call"); AddMethod(new PMethod("GetAppInfo", PRosterGetAppInfo, &pmi)); pmi.MakeEmpty(); pmi.AddArg("signature", B_STRING_TYPE, "Optional MIME type of a running app", PMIFLAG_OPTIONAL); pmi.AddReturnValue("teams", B_LIST_TYPE, "List of team_id values"); AddMethod(new PMethod("GetAppList", PRosterGetAppList, &pmi)); pmi.MakeEmpty(); pmi.AddReturnValue("app_info", B_LIST_TYPE, "List containing the app_info information"); pmi.AddReturnValue("status", B_INT32_TYPE, "Error status of the call"); AddMethod(new PMethod("GetActiveAppInfo", PRosterGetActiveAppInfo, &pmi)); pmi.MakeEmpty(); pmi.AddArg("signature", B_STRING_TYPE, "MIME type of the possibly running app", PMIFLAG_OPTIONAL); pmi.AddArg("path", B_STRING_TYPE, "path of the possibly running app", PMIFLAG_OPTIONAL); pmi.AddReturnValue("value", B_BOOL_TYPE, "True if the specified app is running"); AddMethod(new PMethod("IsRunning", PRosterIsRunning, &pmi)); pmi.MakeEmpty(); pmi.AddArg("signature", B_STRING_TYPE, "MIME type of the desired app", PMIFLAG_OPTIONAL); pmi.AddArg("path", B_STRING_TYPE, "path of the desired app", PMIFLAG_OPTIONAL); pmi.AddReturnValue("value", B_INT32_TYPE, "team_id of the specified app"); AddMethod(new PMethod("TeamFor", PRosterTeamFor, &pmi)); pmi.MakeEmpty(); pmi.AddArg("path", B_STRING_TYPE, "Path of the document to add to the recent list."); pmi.AddArg("signature", B_STRING_TYPE, "MIME type of the app used to open the document.", PMIFLAG_OPTIONAL); AddMethod(new PMethod("AddToRecentDocuments", PRosterAddToRecentDocuments, &pmi)); pmi.MakeEmpty(); pmi.AddArg("path", B_STRING_TYPE, "Path of the folder to add to the recent list."); pmi.AddArg("signature", B_STRING_TYPE, "MIME type of the app used to open the folder.", PMIFLAG_OPTIONAL); AddMethod(new PMethod("AddToRecentFolders", PRosterAddToRecentFolders, &pmi)); pmi.MakeEmpty(); pmi.AddArg("maxcount", B_INT32_TYPE, "The maximum number of recent apps to retrieve."); pmi.AddReturnValue("refs", B_LIST_TYPE, "List of entry_refs to recently-run applications"); AddMethod(new PMethod("GetRecentApps", PRosterGetRecentApps, &pmi)); pmi.MakeEmpty(); pmi.AddArg("maxcount", B_INT32_TYPE, "The maximum number of recent documents to retrieve."); pmi.AddArg("types", B_LIST_TYPE, "List of mimetypes desired.", PMIFLAG_OPTIONAL); pmi.AddArg("signature", B_STRING_TYPE, "MIME type of the application used to open the " "specified documents.", PMIFLAG_OPTIONAL); pmi.AddReturnValue("refs", B_LIST_TYPE, "List of entry_refs to recently-used documents"); AddMethod(new PMethod("GetRecentDocuments", PRosterGetRecentDocuments, &pmi)); pmi.MakeEmpty(); pmi.AddArg("maxcount", B_INT32_TYPE, "The maximum number of recent documents to retrieve."); pmi.AddArg("signature", B_STRING_TYPE, "MIME type of the application used to open the " "specified documents.", PMIFLAG_OPTIONAL); pmi.AddReturnValue("refs", B_LIST_TYPE, "List of entry_refs to recently-used folders"); AddMethod(new PMethod("GetRecentFolders", PRosterGetRecentFolders, &pmi)); pmi.MakeEmpty(); pmi.AddArg("team", B_INT32_TYPE, "TeamID of the desired application"); pmi.AddReturnValue("app_info", B_LIST_TYPE, "List containing the app_info information"); pmi.AddReturnValue("status", B_INT32_TYPE, "Error status of the call"); AddMethod(new PMethod("GetRunningAppInfo", PRosterGetRunningAppInfo, &pmi)); pmi.MakeEmpty(); pmi.AddArg("signature", B_STRING_TYPE, "MIME signature of the application to launch"); pmi.AddArg("arglist", B_LIST_TYPE, "List of string arguments (argc)", PMIFLAG_OPTIONAL); pmi.AddReturnValue("status", B_INT32_TYPE, "Error status of the call"); pmi.AddReturnValue("team", B_INT32_TYPE, "Team ID of the launched process"); AddMethod(new PMethod("Launch", PRosterLaunch, &pmi)); }
cDBusOsdObject::cDBusOsdObject(void) :cDBusObject("/OSD", cDBusOsdObjectHelper::_xmlNodeInfo) { AddMethod("CreateProvider", cDBusOsdObjectHelper::CreateProvider); AddMethod("DeleteProvider", cDBusOsdObjectHelper::DeleteProvider); }
void PListView::InitMethods(void) { PMethodInterface pmi; pmi.AddArg("label", B_STRING_TYPE, " Text label of the new item. Optional.", 0); pmi.AddArg("index", B_INT32_TYPE, " Index to insert the new item. If omitted, item is inserted at the end of the list.", 0); pmi.AddReturnValue("value", B_BOOL_TYPE, " True if successful"); AddMethod(new PMethod("AddItem", PListViewAddItem, &pmi)); pmi.MakeEmpty(); pmi.AddArg("label", B_STRING_TYPE, " List of labels for the new items", 0); pmi.AddArg("index", B_INT32_TYPE, " Index to insert the new item. If omitted, item is inserted at the end of the list.", 0); AddMethod(new PMethod("AddItems", PListViewAddItems, &pmi)); pmi.MakeEmpty(); pmi.AddArg("index", B_INT32_TYPE, "", 0); AddMethod(new PMethod("Deselect", PListViewDeselect, &pmi)); pmi.MakeEmpty(); AddMethod(new PMethod("DeselectAll", PListViewDeselectAll, &pmi)); pmi.MakeEmpty(); pmi.AddArg("from", B_INT32_TYPE, "", 0); pmi.AddArg("to", B_INT32_TYPE, "", 0); AddMethod(new PMethod("DeselectExcept", PListViewDeselectExcept, &pmi)); pmi.MakeEmpty(); pmi.AddArg("point", B_POINT_TYPE, "", 0); AddMethod(new PMethod("IndexOf", PListViewIndexOf, &pmi)); pmi.MakeEmpty(); pmi.AddArg("index", B_INT32_TYPE, "", 0); AddMethod(new PMethod("InvalidateItem", PListViewInvalidateItem, &pmi)); pmi.MakeEmpty(); pmi.AddArg("message", B_INT32_TYPE, " The optional message constant to send", 0); AddMethod(new PMethod("Invoke", PListViewInvoke, &pmi)); pmi.MakeEmpty(); pmi.AddArg("index", B_INT32_TYPE, "", 0); pmi.AddReturnValue("value", B_BOOL_TYPE, ""); AddMethod(new PMethod("IsItemSelected", PListViewIsItemSelected, &pmi)); pmi.MakeEmpty(); pmi.AddArg("index", B_INT32_TYPE, "", 0); pmi.AddReturnValue("value", B_RECT_TYPE, ""); AddMethod(new PMethod("ItemFrame", PListViewItemFrame, &pmi)); pmi.MakeEmpty(); AddMethod(new PMethod("MakeEmpty", PListViewMakeEmpty, &pmi)); pmi.MakeEmpty(); pmi.AddArg("from", B_INT32_TYPE, " Index of the item to move", 0); pmi.AddArg("to", B_INT32_TYPE, " Index to move the item to", 0); pmi.AddReturnValue("value", B_BOOL_TYPE, " True if successful"); AddMethod(new PMethod("MoveItem", PListViewMoveItem, &pmi)); pmi.MakeEmpty(); pmi.AddArg("index", B_INT32_TYPE, " Index of the item to remove", 0); pmi.AddReturnValue("value", B_BOOL_TYPE, ""); AddMethod(new PMethod("RemoveItem", PListViewRemoveItem, &pmi)); pmi.MakeEmpty(); pmi.AddArg("index", B_INT32_TYPE, " Starting index of first item to remove", 0); pmi.AddArg("count", B_INT32_TYPE, " Number of items to remove", 0); pmi.AddReturnValue("value", B_BOOL_TYPE, ""); AddMethod(new PMethod("RemoveItems", PListViewRemoveItems, &pmi)); pmi.MakeEmpty(); pmi.AddArg("x", B_FLOAT_TYPE, "", 0); pmi.AddArg("y", B_FLOAT_TYPE, "", 0); AddMethod(new PMethod("ScrollTo", PListViewScrollTo, &pmi)); pmi.MakeEmpty(); pmi.AddArg("pt", B_POINT_TYPE, "", 0); AddMethod(new PMethod("ScrollToPoint", PListViewScrollToPoint, &pmi)); pmi.MakeEmpty(); AddMethod(new PMethod("ScrollToSelection", PListViewScrollToSelection, &pmi)); pmi.MakeEmpty(); pmi.AddArg("index", B_INT32_TYPE, " Index of the item to select.", 0); pmi.AddArg("extend", B_BOOL_TYPE, " True: add the item to the selection. False: Replace the selection with the item.", 0); AddMethod(new PMethod("Select", PListViewSelect, &pmi)); pmi.MakeEmpty(); pmi.AddArg("from", B_INT32_TYPE, "", 0); pmi.AddArg("to", B_INT32_TYPE, "", 0); pmi.AddArg("extend", B_BOOL_TYPE, " True: add the item to the selection. False: Replace the selection with the item.", 0); AddMethod(new PMethod("SelectRange", PListViewSelectRange, &pmi)); pmi.MakeEmpty(); pmi.AddArg("first", B_INT32_TYPE, " Index of the first item to swap", 0); pmi.AddArg("second", B_INT32_TYPE, " Index of the second item to swap", 0); pmi.AddReturnValue("value", B_BOOL_TYPE, " True if successful"); AddMethod(new PMethod("SwapItems", PListViewSwapItems, &pmi)); pmi.MakeEmpty(); }
/** Adds a new signal. * \relates adbus_Interface */ adbus_Member* adbus_iface_addsignal(adbus_Interface* i, const char* name, int size) { return AddMethod(i, ADBUSI_SIGNAL, name, size); }
void WfCustomType::AddMember(const WString& name, Ptr<WfMethodBase> value) { AddMethod(name, value); }
/** Adds a new method. * \relates adbus_Interface */ adbus_Member* adbus_iface_addmethod(adbus_Interface* i, const char* name, int size) { return AddMethod(i, ADBUSI_METHOD, name, size); }
/** * @brief RemoveMethod::undo */ void RemoveMethod::undo() { AddMethod(m_Model, m_Component, m_Pos).redo(); }
int InitImage( PSENTIENT ps, PENTITY pe, PTEXT parameters ) { INDEX idx; for( idx = 0; idx < NUM_IMAGE_VARS; idx++ ) { PTEXT saveparms = parameters; PTEXT arg; Image parent = GetLink( &FindContainer( pe )->pPlugin, iImage ); arg = GetParam( ps, ¶meters ); if( IsNumber( arg ) ) { PTEXT arg2 = GetParam( ps, ¶meters ); if( IsNumber( arg2 ) ) { Image image; if( parent ) image = MakeSubImage( parent , 0, 0 // need other 2 arguments. , atoi( GetText( arg ) ) , atoi( GetText( arg2 ) ) ); else image = MakeImageFile( atoi( GetText( arg ) ) , atoi( GetText( arg2 ) ) ); SetLink( &pe->pPlugin, iImage, image ); if( ps->CurrentMacro ) ps->CurrentMacro->state.flags.bSuccess = TRUE; else { DECLTEXT( msg, "Invalid second parameter, expecting a number" ); EnqueLink( &ps->Command->Output, &msg ); } // if more args - warn? } } else { Image image; // expect that the remainder is a name.. parameters = saveparms; arg = GetFileName( ps, ¶meters ); // loaded image file doesn't care for parent status... image = LoadImageFile( GetText( arg ) ); if( image ) { SetLink( &pe->pPlugin, iImage, image ); if( ps->CurrentMacro ) ps->CurrentMacro->state.flags.bSuccess = TRUE; else { DECLTEXT( msg, "Failed to load image..." ); EnqueLink( &ps->Command->Output, &msg ); } } } AddVolatileVariable( pe, ImageVars + idx, 0 ); { int n; for( n = 0; n < NUM_METHODS; n++ ) AddMethod( pe, ImageMethods + n ); } } return 0; // return success }