CStatus Register_nest_ArrayNode( PluginRegistrar& in_reg ) { ICENodeDef nodeDef; nodeDef = Application().GetFactory().CreateICENodeDef(L"nest_GetPositionArray"); CStatus st; st = nodeDef.PutThreadingModel(XSI::siICENodeSingleThreading); st.AssertSucceeded( ) ; // Add input ports and groups. st = nodeDef.AddPortGroup(Array_ID_G_100); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(Array_ID_IN_Vector,Array_ID_G_100,siICENodeDataVector3,siICENodeStructureSingle,siICENodeContextAny,L"Vector",L"Vector",CVector3f(0,0,0),Array_ID_UNDEF,Array_ID_UNDEF,Array_ID_CTXT_CNS); st.AssertSucceeded( ) ; // Add output ports and groups. st = nodeDef.AddPortGroup(Array_ID_G_300); st.AssertSucceeded( ) ; st = nodeDef.AddOutputPort(Array_ID_OUT_Result,Array_ID_G_300,siICENodeDataVector3,siICENodeStructureArray,siICENodeContextSingleton,L"Array",L"Array",Array_ID_UNDEF,Array_ID_UNDEF,Array_ID_UNDEF); st.AssertSucceeded( ) ; PluginItem nodeItem = in_reg.RegisterICENode(nodeDef); nodeItem.PutCategories(L"Array"); return CStatus::OK; }
CStatus Register_MOM_AddToCluster( PluginRegistrar& in_reg ) { ICENodeDef nodeDef; nodeDef = Application().GetFactory().CreateICENodeDef(L"MOM_AddToCluster",L"MOM_AddToCluster"); CStatus st; st = nodeDef.PutColor(255,188,102); st.AssertSucceeded( ) ; st = nodeDef.PutThreadingModel(XSI::siICENodeSingleThreading); st.AssertSucceeded( ) ; // Add input ports and groups. st = nodeDef.AddPortGroup(ID_G_100); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(ID_IN_base,ID_G_100,siICENodeDataLong,siICENodeStructureSingle,siICENodeContextComponent0D,L"base",L"base",0,0,1000000,ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(ID_IN_id,ID_G_100,siICENodeDataLong,siICENodeStructureSingle,siICENodeContextComponent0D,L"id",L"id",0,0,1000000,ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(ID_IN_cluster,ID_G_100,siICENodeDataLong,siICENodeStructureSingle,siICENodeContextComponent0D,L"cluster",L"cluster",0,0,1000000,ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; // Add output ports. st = nodeDef.AddOutputPort(ID_OUT_base,siICENodeDataLong,siICENodeStructureSingle,siICENodeContextComponent0D,L"outbase",L"outbase",ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; PluginItem nodeItem = in_reg.RegisterICENode(nodeDef); nodeItem.PutCategories(L"Custom ICENode"); return CStatus::OK; }
CStatus Register_MOM_GetContactPoints( PluginRegistrar& in_reg ) { ICENodeDef nodeDef; nodeDef = Application().GetFactory().CreateICENodeDef(L"MOM_GetContactPoints",L"MOM_GetContactPoints"); CStatus st; st = nodeDef.PutColor(255,188,102); st.AssertSucceeded( ) ; st = nodeDef.PutThreadingModel(XSI::siICENodeSingleThreading); st.AssertSucceeded( ) ; // Add input ports and groups. st = nodeDef.AddPortGroup(ID_G_100); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(ID_IN_mode,ID_G_100,siICENodeDataLong,siICENodeStructureSingle,siICENodeContextSingleton,L"mode",L"mode",0,0,2,ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(ID_IN_minImpulse_id,ID_G_100,siICENodeDataFloat,siICENodeStructureSingle,siICENodeContextSingleton,L"minImpulse",L"minImpulse",1,0,1000,ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; // Add output ports. st = nodeDef.AddOutputPort(ID_OUT_Contacts,siICENodeDataMatrix33,siICENodeStructureArray,siICENodeContextSingleton,L"Contacts",L"Contacts",ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; PluginItem nodeItem = in_reg.RegisterICENode(nodeDef); nodeItem.PutCategories(L"Custom ICENode"); return CStatus::OK; }
CStatus VDB_Node_VolumeToMesh::Register(PluginRegistrar& reg) { ICENodeDef nodeDef; Factory factory = Application().GetFactory(); nodeDef = factory.CreateICENodeDef(L"VDB_Node_VolumeToMesh", L"Volume To Mesh"); CStatus st; st = nodeDef.PutColor(110, 110, 110); st.AssertSucceeded(); st = nodeDef.PutThreadingModel(siICENodeSingleThreading); st.AssertSucceeded(); // Add custom types definition st = nodeDef.DefineCustomType(L"vdb_prim" ,L"VDB Grid", L"openvdb grid type", 155, 21, 10); st.AssertSucceeded(); // Add input ports and groups. st = nodeDef.AddPortGroup(kGroup1); st.AssertSucceeded(); // Add custom type names. CStringArray customTypes(1); customTypes[0] = L"vdb_prim"; // stupid default arguments wont work have to add ULONG_MAX st = nodeDef.AddInputPort(kVDBGrid, kGroup1, customTypes, siICENodeStructureSingle, siICENodeContextSingleton, L"VDB Grid", L"inVDBGrid",ULONG_MAX,ULONG_MAX,ULONG_MAX); st.AssertSucceeded(); st = nodeDef.AddInputPort(kIsoValue, kGroup1, siICENodeDataFloat, siICENodeStructureSingle, siICENodeContextSingleton, L"Iso Value", L"isoValue", 0.0); st.AssertSucceeded(); st = nodeDef.AddInputPort(kAdaptivity, kGroup1, siICENodeDataFloat, siICENodeStructureSingle, siICENodeContextSingleton, L"Adaptivity", L"adaptivity", 0.0); st.AssertSucceeded(); // Add output ports. st = nodeDef.AddOutputPort(kPointArray, siICENodeDataVector3, siICENodeStructureArray, siICENodeContextSingleton, L"Point Array", L"pointList"); st.AssertSucceeded(); st = nodeDef.AddOutputPort(kPolygonArray, siICENodeDataLong, siICENodeStructureArray, siICENodeContextSingleton, L"Polygon Array", L"polygonPoolList"); st.AssertSucceeded(); PluginItem nodeItem = reg.RegisterICENode(nodeDef); nodeItem.PutCategories(L"OpenVDB"); return CStatus::OK; }
CStatus RegisterToonixGetData( PluginRegistrar& in_reg ) { ICENodeDef nodeDef; nodeDef = Application().GetFactory().CreateICENodeDef(L"ToonixGetData",L"ToonixGetData"); CStatus st; st = nodeDef.PutColor(ToonixNodeR,ToonixNodeG,ToonixNodeB); st.AssertSucceeded( ) ; st = nodeDef.PutThreadingModel(siICENodeSingleThreading); st.AssertSucceeded( ) ; // Add custom types definition. st = nodeDef.DefineCustomType(L"ToonixData",L"ToonixData",L"ToonixData",ToonixDataR,ToonixDataG,ToonixDataB); st.AssertSucceeded( ) ; // Add input ports and groups. st = nodeDef.AddPortGroup(ID_G_100); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(ID_IN_Geometry,ID_G_100,siICENodeDataGeometry,siICENodeStructureSingle,siICENodeContextSingleton,L"Geometry",L"Geometry"); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(ID_IN_CameraCulling,ID_G_100,siICENodeDataBool,siICENodeStructureSingle,siICENodeContextSingleton,L"CameraCulling",L"CameraCulling",false); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(ID_IN_CameraGlobal,ID_G_100,siICENodeDataMatrix44,siICENodeStructureSingle,siICENodeContextSingleton,L"CameraGlobal",L"CameraGlobal"); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(ID_IN_CameraFov,ID_G_100,siICENodeDataFloat,siICENodeStructureSingle,siICENodeContextSingleton,L"CameraFov",L"CameraFov"); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(ID_IN_CameraAspect,ID_G_100,siICENodeDataFloat,siICENodeStructureSingle,siICENodeContextSingleton,L"CameraAspect",L"CameraAspect"); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(ID_IN_CameraNear,ID_G_100,siICENodeDataFloat,siICENodeStructureSingle,siICENodeContextSingleton,L"CameraNear",L"CameraNear",0.0); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(ID_IN_CameraFar,ID_G_100,siICENodeDataFloat,siICENodeStructureSingle,siICENodeContextSingleton,L"CameraFar",L"CameraFar",1000.0); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(ID_IN_UseOctree,ID_G_100,siICENodeDataBool,siICENodeStructureSingle,siICENodeContextSingleton,L"UseOctree",L"UseOctree",false); st.AssertSucceeded( ) ; // Add output ports. CStringArray ToonixDataCustomType(1); ToonixDataCustomType[0] = L"ToonixData"; st = nodeDef.AddOutputPort(ID_OUT_ToonixData,ToonixDataCustomType,siICENodeStructureSingle,siICENodeContextSingleton,L"ToonixData",L"ToonixData",ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; PluginItem nodeItem = in_reg.RegisterICENode(nodeDef); nodeItem.PutCategories(L"Toonix"); return CStatus::OK; }
CStatus RegisterToonixLighter( PluginRegistrar& in_reg ) { ICENodeDef nodeDef; nodeDef = Application().GetFactory().CreateICENodeDef(L"ToonixLighter",L"ToonixLighter"); CStatus st; st = nodeDef.PutColor(ToonixNodeR,ToonixNodeG,ToonixNodeB); st.AssertSucceeded( ) ; // Add custom types definition. st = nodeDef.DefineCustomType(L"ToonixData",L"ToonixData",L"ToonixData",ToonixLineR,ToonixLineG,ToonixLineB); st.AssertSucceeded( ) ; // Add input ports and groups. st = nodeDef.AddPortGroup(ID_G_100); st.AssertSucceeded( ) ; CStringArray ToonixLineCustomType(1); ToonixLineCustomType[0] = L"ToonixData"; st = nodeDef.AddInputPort(ID_IN_ToonixData,ID_G_100,ToonixLineCustomType,siICENodeStructureSingle,siICENodeContextSingleton,L"ToonixData",L"ToonixData",ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(ID_IN_ViewPosition,ID_G_100,siICENodeDataVector3,siICENodeStructureSingle,siICENodeContextSingleton,L"ViewPosition",L"ViewPosition"); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(ID_IN_LightPosition,ID_G_100,siICENodeDataVector3,siICENodeStructureAny,siICENodeContextSingleton,L"LightPosition",L"LightPosition"); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(ID_IN_LightBias,ID_G_100,siICENodeDataFloat,siICENodeStructureAny,siICENodeContextSingleton,L"LightBias",L"LightBias",0.0); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(ID_IN_LightDistance,ID_G_100,siICENodeDataFloat,siICENodeStructureAny,siICENodeContextSingleton,L"LightDistance",L"LightDistance",100.0); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(ID_IN_Revert,ID_G_100,siICENodeDataBool,siICENodeStructureSingle,siICENodeContextSingleton,L"Revert",L"Revert",false); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(ID_IN_Push,ID_G_100,siICENodeDataFloat,siICENodeStructureSingle,siICENodeContextSingleton,L"Push",L"Push",0.0); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(ID_IN_ByTriangle,ID_G_100,siICENodeDataBool,siICENodeStructureSingle,siICENodeContextSingleton,L"ByTriangle",L"ByTriangle",true); st.AssertSucceeded( ) ; // Add output ports. st = nodeDef.AddOutputPort(ID_OUT_Vertices,siICENodeDataVector3,siICENodeStructureArray,siICENodeContextSingleton,L"Vertices",L"Vertices",ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; st = nodeDef.AddOutputPort(ID_OUT_Polygons,siICENodeDataLong,siICENodeStructureArray,siICENodeContextSingleton,L"Polygons",L"Polygons",ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; PluginItem nodeItem = in_reg.RegisterICENode(nodeDef); nodeItem.PutCategories(L"Toonix"); return CStatus::OK; }
CStatus VDB_Node_FBM::Register(PluginRegistrar& reg) { ICENodeDef nodeDef; Factory factory = Application().GetFactory(); nodeDef = factory.CreateICENodeDef(L"VDB_Node_FBM", L"VDB FBM"); CStatus st; st = nodeDef.PutColor(110, 110, 110); st.AssertSucceeded(); st = nodeDef.PutThreadingModel(siICENodeSingleThreading); st.AssertSucceeded(); // Add custom types definition st = nodeDef.DefineCustomType(L"vdb_prim" ,L"VDB Grid", L"openvdb grid type", 155, 21, 10); st.AssertSucceeded(); // Add input ports and groups. st = nodeDef.AddPortGroup(kGroup1); st.AssertSucceeded(); // Add custom type names. CStringArray customTypes(1); customTypes[0] = L"vdb_prim"; st = nodeDef.AddInputPort(kInVDBGrid, kGroup1, customTypes, siICENodeStructureSingle, siICENodeContextSingleton, L"In", L"inVDBGrid",ULONG_MAX,ULONG_MAX,ULONG_MAX); st.AssertSucceeded(); st = nodeDef.AddInputPort(kOctaves, kGroup1, siICENodeDataLong, siICENodeStructureSingle, siICENodeContextSingleton, L"Octaves", L"octaves", CValue(6)); st.AssertSucceeded(); st = nodeDef.AddInputPort(kLacunarity, kGroup1, siICENodeDataFloat, siICENodeStructureSingle, siICENodeContextSingleton, L"Lacunarity", L"lacunarity", CValue(2.0)); st.AssertSucceeded(); st = nodeDef.AddInputPort(kGain, kGroup1, siICENodeDataFloat, siICENodeStructureSingle, siICENodeContextSingleton, L"Gain", L"gain", CValue(0.5)); st.AssertSucceeded(); st = nodeDef.AddOutputPort(kOutVDBGrid, customTypes, siICENodeStructureSingle, siICENodeContextSingleton, L"Out", L"outVDBGrid"); st.AssertSucceeded(); PluginItem nodeItem = reg.RegisterICENode(nodeDef); nodeItem.PutCategories(L"OpenVDB"); return CStatus::OK; }
CStatus RegisterToonixCurve(PluginRegistrar& in_reg) { ICENodeDef nodeDef; nodeDef = Application().GetFactory().CreateICENodeDef(L"ToonixCurve", L"ToonixCurve"); CStatus st; st = nodeDef.PutColor(ToonixNodeR, ToonixNodeG, ToonixNodeB); st.AssertSucceeded(); st = nodeDef.PutThreadingModel(siICENodeSingleThreading); st.AssertSucceeded(); // Add custom types definition. st = nodeDef.DefineCustomType(L"ToonixLine", L"ToonixLine", L"ToonixLine", ToonixLineR, ToonixLineG, ToonixLineB); st.AssertSucceeded(); // Add input ports and groups. st = nodeDef.AddPortGroup(ID_G_100); st.AssertSucceeded(); st = nodeDef.AddInputPort(ID_IN_Curves, ID_G_100, siICENodeDataGeometry, siICENodeStructureSingle, siICENodeContextSingleton, L"Curves", L"Curves"); st.AssertSucceeded(); st = nodeDef.AddInputPort(ID_IN_ViewPosition, ID_G_100, siICENodeDataVector3, siICENodeStructureAny, siICENodeContextSingleton, L"ViewPoint", L"ViewPoint"); st.AssertSucceeded(); st = nodeDef.AddInputPort(ID_IN_Width, ID_G_100, siICENodeDataFloat, siICENodeStructureSingle, siICENodeContextSingleton, L"Width", L"Width", 0.1); st.AssertSucceeded(); st = nodeDef.AddInputPort(ID_IN_BreakAngle, ID_G_100, siICENodeDataFloat, siICENodeStructureSingle, siICENodeContextSingleton, L"BreakAngle", L"BreakAngle", 90.0); st.AssertSucceeded(); st = nodeDef.AddInputPort(ID_IN_Extend, ID_G_100, siICENodeDataFloat, siICENodeStructureSingle, siICENodeContextSingleton, L"Extend", L"Extend", 0.0); st.AssertSucceeded(); st = nodeDef.AddInputPort(ID_IN_FilterPoints, ID_G_100, siICENodeDataFloat, siICENodeStructureSingle, siICENodeContextSingleton, L"FilterPoints", L"FilterPoints", 0.0); st.AssertSucceeded(); st = nodeDef.AddInputPort(ID_IN_Smooth, ID_G_100, siICENodeDataBool, siICENodeStructureSingle, siICENodeContextSingleton, L"SmoothSilhouette", L"SmoothSilhouette", true); st.AssertSucceeded(); // Add output ports. CStringArray ToonixLineCustomType(1); ToonixLineCustomType[0] = L"ToonixLine"; st = nodeDef.AddOutputPort(ID_OUT_ToonixLine, ToonixLineCustomType, siICENodeStructureSingle, siICENodeContextSingleton, L"ToonixLine", L"ToonixLine", ID_UNDEF, ID_UNDEF, ID_CTXT_CNS); st.AssertSucceeded(); PluginItem nodeItem = in_reg.RegisterICENode(nodeDef); nodeItem.PutCategories(L"Toonix"); return CStatus::OK; }
CStatus Register_MOM_GetAttributes( PluginRegistrar& in_reg ) { ICENodeDef nodeDef; nodeDef = Application().GetFactory().CreateICENodeDef(L"MOM_GetAttributes",L"MOM_GetAttributes"); CStatus st; st = nodeDef.PutColor(255,188,102); st.AssertSucceeded( ) ; st = nodeDef.PutThreadingModel(XSI::siICENodeSingleThreading); st.AssertSucceeded( ) ; // Add input ports and groups. st = nodeDef.AddPortGroup(ID_G_100); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(ID_IN_base,ID_G_100,siICENodeDataLong,siICENodeStructureSingle,siICENodeContextComponent0D,L"base",L"base",0,0,1000000,ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(ID_IN_id,ID_G_100,siICENodeDataLong,siICENodeStructureSingle,siICENodeContextComponent0D,L"id",L"id",0,0,1000000,ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; // Add output ports. st = nodeDef.AddOutputPort(ID_OUT_position,siICENodeDataVector3,siICENodeStructureSingle,siICENodeContextComponent0D,L"position",L"position",ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; st = nodeDef.AddOutputPort(ID_OUT_orientation,siICENodeDataVector3,siICENodeStructureSingle,siICENodeContextComponent0D,L"orientation",L"orientation",ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; st = nodeDef.AddOutputPort(ID_OUT_linvelocity,siICENodeDataVector3,siICENodeStructureSingle,siICENodeContextComponent0D,L"linvelocity",L"linvelocity",ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; st = nodeDef.AddOutputPort(ID_OUT_angvelocity,siICENodeDataVector3,siICENodeStructureSingle,siICENodeContextComponent0D,L"angvelocity",L"angvelocity",ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; st = nodeDef.AddOutputPort(ID_OUT_state,siICENodeDataLong,siICENodeStructureSingle,siICENodeContextComponent0D,L"state",L"state",ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; st = nodeDef.AddOutputPort(ID_OUT_mass,siICENodeDataFloat,siICENodeStructureSingle,siICENodeContextComponent0D,L"mass",L"mass",ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; st = nodeDef.AddOutputPort(ID_OUT_bounce,siICENodeDataFloat,siICENodeStructureSingle,siICENodeContextComponent0D,L"bounce",L"bounce",ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; st = nodeDef.AddOutputPort(ID_OUT_friction,siICENodeDataFloat,siICENodeStructureSingle,siICENodeContextComponent0D,L"friction",L"friction",ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; st = nodeDef.AddOutputPort(ID_OUT_lindamping,siICENodeDataFloat,siICENodeStructureSingle,siICENodeContextComponent0D,L"lindamping",L"lindamping",ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; st = nodeDef.AddOutputPort(ID_OUT_angdamping,siICENodeDataFloat,siICENodeStructureSingle,siICENodeContextComponent0D,L"angdamping",L"angdamping",ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; st = nodeDef.AddOutputPort(ID_OUT_lintreshold,siICENodeDataFloat,siICENodeStructureSingle,siICENodeContextComponent0D,L"lintreshold",L"lintreshold",ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; st = nodeDef.AddOutputPort(ID_OUT_angtreshold,siICENodeDataFloat,siICENodeStructureSingle,siICENodeContextComponent0D,L"angtreshold",L"angtreshold",ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; PluginItem nodeItem = in_reg.RegisterICENode(nodeDef); nodeItem.PutCategories(L"Custom ICENode"); return CStatus::OK; }
void PluginSelectDialog::init( ) { const QValueList<KDevPlugin*> loadedPlugins = PluginController::getInstance()->loadedPlugins(); QStringList loadedPluginDesktopNames; QValueList<KDevPlugin*>::ConstIterator it = loadedPlugins.begin(); while( it != loadedPlugins.end() ) { loadedPluginDesktopNames << (*it)->instance()->instanceName(); ++it; } kdDebug(9000) << " *** loadedPluginDesktopNames: " << loadedPluginDesktopNames << endl; KTrader::OfferList localOffers; if ( ProjectManager::getInstance()->projectLoaded() ) { localOffers = PluginController::getInstance()->engine().offers( PluginController::getInstance()->currentProfile(), ProfileEngine::Project ); } KTrader::OfferList globalOffers = PluginController::getInstance()->engine().offers( PluginController::getInstance()->currentProfile(), ProfileEngine::Global); KTrader::OfferList offers = localOffers + globalOffers; for (KTrader::OfferList::ConstIterator it = offers.begin(); it != offers.end(); ++it) { // parse out any existing url to make it clickable QString Comment = (*it)->comment(); QRegExp re("\\bhttp://[\\S]*"); re.search( Comment ); Comment.replace( re, "" ); QString url; if ( re.pos() > -1 ) { url = re.cap(); } PluginItem *item = new PluginItem( plugin_list, (*it)->desktopEntryName(), (*it)->genericName(), Comment, url ); item->setOn( loadedPluginDesktopNames.contains( (*it)->desktopEntryName() ) ); kdDebug(9000) << (*it)->desktopEntryName() << " : " << (loadedPluginDesktopNames.contains( (*it)->desktopEntryName() ) ? "YES" : "NO" ) << endl; } QListViewItem * first = plugin_list->firstChild(); if ( first ) { plugin_list->setSelected( first, true ); } }
QStringList PluginSelectDialog::unselectedPluginNames( ) { QStringList unselectedPlugins; QListViewItem * item = plugin_list->firstChild(); while ( item ) { PluginItem * pluginItem = static_cast<PluginItem*>( item ); if ( !pluginItem->isOn() ) { unselectedPlugins << pluginItem->name(); } item = item->nextSibling(); } return unselectedPlugins; }
void KCMKontactSummary::load() { KService::List offers = KServiceTypeTrader::self()->query( QString::fromLatin1( "Kontact/Plugin" ), QString( "[X-KDE-KontactPluginVersion] == %1" ).arg( KONTACT_PLUGIN_VERSION ) ); QStringList activeSummaries; KConfig config( "kontact_summaryrc" ); KConfigGroup grp( &config, QString() ); if ( !grp.hasKey( "ActiveSummaries" ) ) { activeSummaries << "kontact_kaddressbookplugin"; activeSummaries << "kontact_specialdatesplugin"; activeSummaries << "kontact_korganizerplugin"; activeSummaries << "kontact_todoplugin"; activeSummaries << "kontact_knotesplugin"; activeSummaries << "kontact_kmailplugin"; activeSummaries << "kontact_weatherplugin"; activeSummaries << "kontact_newstickerplugin"; activeSummaries << "kontact_plannerplugin"; } else { activeSummaries = grp.readEntry( "ActiveSummaries", QStringList() ); } mPluginView->clear(); KPluginInfo::List pluginList = KPluginInfo::fromServices( offers, KConfigGroup( &config, "Plugins" ) ); KPluginInfo::List::Iterator it; for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { it->load(); if ( !it->isPluginEnabled() ) { continue; } QVariant var = it->property( "X-KDE-KontactPluginHasSummary" ); if ( var.isValid() && var.toBool() == true ) { PluginItem *item = new PluginItem( *it, mPluginView ); if ( activeSummaries.contains( it->pluginName() ) ) { item->setCheckState( 0, Qt::Checked ); } else { item->setCheckState( 0, Qt::Unchecked ); } } } }
void PluginSelectDialog::itemSelected( QListViewItem * item ) { if ( ! item ) return; PluginItem * pitem = static_cast<PluginItem*>( item ); plugin_description_label->setText( pitem->info() ); if ( pitem->url().isEmpty() ) { urllabel->clear(); } else { urllabel->setURL( pitem->url() ); urllabel->setText( pitem->url() ); } }
void KCMKontactSummary::save() { QStringList activeSummaries; QTreeWidgetItemIterator it( mPluginView ); while ( *it ) { PluginItem *item = static_cast<PluginItem *>( *it ); if ( item->checkState( 0 ) == Qt::Checked ) { activeSummaries.append( item->pluginInfo().pluginName() ); } ++it; } KConfig config( "kontact_summaryrc" ); KConfigGroup grp( &config, QString() ); grp.writeEntry( "ActiveSummaries", activeSummaries ); }
/*! * Состояние плагина. * * \return - 0 - Состояние плагина не будет изменено после перезапуска. * - 1 - Плагин будет включен после перезапуска чата. * - 2 - Плагин будет отключен после перезапуска чата. */ int PluginsView::state(const QString &id) { PluginItem *item = ChatCore::plugins()->plugin(id); if (!item) return 0; bool enabled = ChatCore::settings()->value(LS("Plugins/") + id).toBool(); if (item->isLoaded() == enabled) return 0; if (enabled && !item->isLoaded()) return 1; if (!enabled && item->isLoaded()) return 2; return 0; }
CStatus RegisterToonixMesher( PluginRegistrar& in_reg ) { ICENodeDef nodeDef; nodeDef = Application().GetFactory().CreateICENodeDef(L"ToonixMesher",L"ToonixMesher"); CStatus st; st = nodeDef.PutColor(ToonixNodeR,ToonixNodeG,ToonixNodeB); st.AssertSucceeded( ) ; st = nodeDef.PutThreadingModel(siICENodeSingleThreading); st.AssertSucceeded( ) ; // Add custom types definition. st = nodeDef.DefineCustomType(L"ToonixLine",L"ToonixLine",L"ToonixLine",ToonixLineR,ToonixLineG,ToonixLineB); st.AssertSucceeded( ) ; // Add input ports and groups. st = nodeDef.AddPortGroup(ID_G_100); st.AssertSucceeded( ) ; CStringArray ToonixLineCustomType(1); ToonixLineCustomType[0] = L"ToonixLine"; st = nodeDef.AddInputPort(ID_IN_ToonixLine,ID_G_100,ToonixLineCustomType,siICENodeStructureSingle,siICENodeContextSingleton,L"ToonixLine",L"ToonixLine",ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(ID_IN_Subdiv,ID_G_100,siICENodeDataLong,siICENodeStructureSingle,siICENodeContextSingleton,L"Subdivisions",L"Subdivisions",6); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(ID_IN_ViewPosition,ID_G_100,siICENodeDataVector3,siICENodeStructureSingle,siICENodeContextSingleton,L"ViewPosition",L"ViewPosition"); st.AssertSucceeded( ) ; // Add output ports. st = nodeDef.AddOutputPort(ID_OUT_Vertices,siICENodeDataVector3,siICENodeStructureArray,siICENodeContextSingleton,L"Vertices",L"Vertices",ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; st = nodeDef.AddOutputPort(ID_OUT_Polygons,siICENodeDataLong,siICENodeStructureArray,siICENodeContextSingleton,L"Polygons",L"Polygons",ID_UNDEF,ID_UNDEF,ID_CTXT_CNS); st.AssertSucceeded( ) ; PluginItem nodeItem = in_reg.RegisterICENode(nodeDef); nodeItem.PutCategories(L"Toonix"); return CStatus::OK; }
void PluginsPage::settings(const QString &id) { if (!m_plugin.isEmpty()) { if (m_plugin == id) return; m_pluginName->hide(); QLayoutItem *child = m_mainLayout->takeAt(2); if (child) delete child; if (m_widget) { m_mainLayout->removeWidget(m_widget); m_widget->deleteLater(); m_widget = 0; } m_plugin.clear(); } PluginItem *plugin = ChatCore::plugins()->plugin(id); if (!plugin) return; ChatApi *api = qobject_cast<ChatApi*>(plugin->plugin()); if (!api) return; m_widget = api->settings(this); if (!m_widget) return; m_plugin = id; m_pluginName->setText(LS("<b>") + plugin->header().value(CORE_API_NAME).toString() + LS("</b>")); m_pluginName->show(); m_mainLayout->insertSpacing(2, 10); m_mainLayout->insertWidget(4, m_widget); m_view->scroll(id); }
void PluginSelectDialog::saveAsDefault() { kdDebug(9000) << k_funcinfo << endl; ProfileEngine & engine = PluginController::getInstance()->engine(); Profile * profile = engine.findProfile( PluginController::getInstance()->currentProfile() ); profile->clearList( Profile::ExplicitDisable ); QListViewItemIterator it( plugin_list ); while ( it.current() ) { PluginItem * item = static_cast<PluginItem*>( it.current() ); if ( !item->isOn() ) { profile->addEntry( Profile::ExplicitDisable, item->name() ); } ++it; } profile->save(); }
void PluginManager::AddPlugin(const char *filename) { HMODULE hModule=LoadLibrary(filename); if(hModule!=NULL) { PluginItem CurPlugin; CurPlugin.hModule=hModule; CurPlugin.Flags=0; CurPlugin.TypesNumber=0; CurPlugin.TypesInfo=NULL; CurPlugin.ConfigString[0]=0; CurPlugin.pStart=(PLUGINSTART)GetProcAddress(hModule,"Start"); CurPlugin.pExit=(PLUGINEXIT)GetProcAddress(hModule,"Exit"); CurPlugin.pMessage=(PLUGMESSAGE)GetProcAddress(hModule,"Message"); PluginItem *NewPluginsData=new PluginItem[PluginsCount+1]; for(int i=0;i<PluginsCount;i++) NewPluginsData[i]=PluginsData[i]; delete [] PluginsData; PluginsData=NewPluginsData; PluginsData[PluginsCount]=CurPlugin; PluginsCount++; AHPluginStartupInfo AHInfo; AHInfo.StructSize=sizeof(AHInfo); lstrcpy(AHInfo.ModuleName,filename); lstrcpy(AHInfo.MessageName,filename); lstrcpy(AHInfo.MessageName+lstrlen(AHInfo.MessageName)-3,"ahl"); FSF.sprintf(PluginPluginsRootKey,"%s\\Plugins",PluginRootKey); AHInfo.RootKey=PluginPluginsRootKey; AHInfo.GetMsg=api_get_message; AHInfo.ShowHelpDlgProc=api_show_help_dlg_proc; AHInfo.ShowHelpMenu=api_show_help_menu; AHInfo.Encode=api_encode; AHInfo.Decode=api_decode; if(CurPlugin.pStart) CurPlugin.pStart(&Info,&AHInfo); } return; }
CStatus Register_nest_LatticeNode( PluginRegistrar& in_reg ) { ICENodeDef nodeDef; nodeDef = Application().GetFactory().CreateICENodeDef(L"nest_LatticeDeform"); CStatus st; st = nodeDef.PutThreadingModel(XSI::siICENodeMultiThreading); st.AssertSucceeded( ) ; // Add input ports and groups. st = nodeDef.AddPortGroup(Lattice_ID_G_100); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(Lattice_ID_IN_Point,Lattice_ID_G_100,siICENodeDataVector3,siICENodeStructureAny,siICENodeContextAny,L"Point",L"Point",CVector3f(0,0,0),Lattice_ID_UNDEF,Lattice_ID_STRUCT_CNS,Lattice_ID_CTXT_CNS); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(Lattice_ID_IN_Subdivision,Lattice_ID_G_100,siICENodeDataVector3,siICENodeStructureSingle,siICENodeContextSingleton,L"Subdivision",L"Subdivision",CVector3f(1,1,1),Lattice_ID_UNDEF,Lattice_ID_UNDEF,Lattice_ID_UNDEF); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(Lattice_ID_IN_Step,Lattice_ID_G_100,siICENodeDataVector3,siICENodeStructureSingle,siICENodeContextSingleton,L"Step",L"Step",CVector3f(1,1,1),Lattice_ID_UNDEF,Lattice_ID_UNDEF,Lattice_ID_UNDEF); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(Lattice_ID_IN_Reference,Lattice_ID_G_100,siICENodeDataVector3,siICENodeStructureArray,siICENodeContextSingleton,L"References",L"References",CVector3f(1,1,1),Lattice_ID_UNDEF,Lattice_ID_UNDEF,Lattice_ID_UNDEF); st.AssertSucceeded( ) ; st = nodeDef.AddInputPort(Lattice_ID_IN_Current,Lattice_ID_G_100,siICENodeDataVector3,siICENodeStructureArray,siICENodeContextSingleton,L"Currents",L"Currents",CVector3f(1,1,1),Lattice_ID_UNDEF,Lattice_ID_UNDEF,Lattice_ID_UNDEF); st.AssertSucceeded( ) ; // Add output ports and groups. st = nodeDef.AddPortGroup(Lattice_ID_G_300); st.AssertSucceeded( ) ; st = nodeDef.AddOutputPort(Lattice_ID_OUT_Result,Lattice_ID_G_300,siICENodeDataVector3,siICENodeStructureAny,siICENodeContextAny,L"Deform",L"Deform",Lattice_ID_UNDEF,Lattice_ID_STRUCT_CNS,Lattice_ID_CTXT_CNS); st.AssertSucceeded( ) ; PluginItem nodeItem = in_reg.RegisterICENode(nodeDef); nodeItem.PutCategories(L"Custom ICENode"); return CStatus::OK; }
int SearchDialog::find() { QRegExp searchTextRegExp; QDltMsg msg; QByteArray buf; QString text; int searchLine; int searchBorder; if(file->sizeFilter()==0) return 0; //setSearchColour(QColor(0,0,0),QColor(255,255,255)); if(getMatch() || getSearchFromBeginning()==false){ QModelIndexList list = table->selectionModel()->selection().indexes(); if(list.count()<=0) { QMessageBox::critical(0, QString("DLT Viewer"),QString("No message selected")); setMatch(false); //table->clearSelection(); //setSearchColour(QColor(255,255,255),QColor(255,102,102)); return 0; } QModelIndex index; for(int num=0; num < list.count();num++) { index = list[num]; if(index.column()==0) { break; } } setStartLine(index.row()); } searchLine = getStartLine(); searchBorder = getStartLine();; if(searchBorder < 0){ if(getNextClicked()){ searchBorder = file->sizeFilter()==0?0:file->sizeFilter()-1; }else{ searchBorder = 0; } } if(getRegExp()) { searchTextRegExp.setPattern(getText()); searchTextRegExp.setCaseSensitivity(getCaseSensitive()?Qt::CaseSensitive:Qt::CaseInsensitive); if (!searchTextRegExp.isValid()) { QMessageBox::warning(0, QString("Search"), QString("Invalid regular expression!")); //setSearchColour(QColor(255,255,255),QColor(255,102,102)); return 0; } } QProgressDialog fileprogress("Searching...", "Abort", 0, file->sizeFilter(), this); fileprogress.setWindowTitle("DLT Viewer"); fileprogress.setWindowModality(Qt::WindowModal); fileprogress.show(); do { if(getNextClicked()){ searchLine++; if(searchLine >= file->sizeFilter()){ searchLine = 0; //QMessageBox::information(0, QString("Search"),QString("End of file reached. Search start from top.")); } }else{ searchLine--; if(searchLine <= -1){ searchLine = file->sizeFilter()-1; //QMessageBox::information(0, QString("Search"),QString("Top of file reached. Search start from bottom.")); } } //qDebug()<<"startLine: "<<getStartLine(); //qDebug()<<"searchBorder: "<<searchBorder; //qDebug()<<"searchLine: "<<searchLine; if(getNextClicked()){ fileprogress.setValue(searchLine+1); }else{ fileprogress.setValue(file->sizeFilter()-searchLine); } /* get the message with the selected item id */ buf = file->getMsgFilter(searchLine); msg.setMsg(buf); for(int num2 = 0; num2 < plugin->topLevelItemCount (); num2++) { PluginItem *item = (PluginItem*)plugin->topLevelItem(num2); if(item->getMode() != item->ModeDisable && item->plugindecoderinterface && item->plugindecoderinterface->isMsg(msg,1)) { item->plugindecoderinterface->decodeMsg(msg,1); break; } } bool pluginFound = false; /* search header */ if(!pluginFound || text.isEmpty()) { text += msg.toStringHeader(); } if(getHeader()) { if (getRegExp()) { if(text.contains(searchTextRegExp)) { table->selectRow(searchLine); setStartLine(searchLine); setMatch(true); break; }else { setMatch(false); } } else { if(text.contains(getText(),getCaseSensitive()? Qt::CaseSensitive : Qt::CaseInsensitive )) { table->selectRow(searchLine); setStartLine(searchLine); setMatch(true); break; }else { setMatch(false); } } } /* search payload */ text.clear(); if(!pluginFound || text.isEmpty()) { text += msg.toStringPayload(); } if(getPayload()) { if (getRegExp()) { if(text.contains(searchTextRegExp)) { table->selectRow(searchLine); setMatch(true); setStartLine(searchLine); break; }else { setMatch(false); } } else { if(text.contains(getText(),getCaseSensitive()?Qt::CaseSensitive:Qt::CaseInsensitive)) { table->selectRow(searchLine); setMatch(true); setStartLine(searchLine); break; } else { setMatch(false); } } } }while(searchBorder != searchLine); if(getMatch()) { return 1; } //table->clearSelection(); //setSearchColour(QColor(255,255,255),QColor(255,102,102)); return 0; }