BBitmap *ChatWindow::IconForHandler(const char *type, int32 size) { entry_ref handlerRef; if (be_roster->FindApp(type, &handlerRef) != B_OK) { LOG("im_emoclient", liMedium, "Failed to get icon for %s", type); // this isn't what we should be doing, but it might be better than nothing. handlerRef = fEntry; }; BPath handlerPath(&handlerRef); return ReadNodeIcon(handlerPath.Path(), size); };
CIMObjectPath _getSubscriptionPath( const String& filterName, const String& handlerName) { Array<CIMKeyBinding> filterKeyBindings; filterKeyBindings.append(CIMKeyBinding("SystemCreationClassName", System::getSystemCreationClassName(), CIMKeyBinding::STRING)); filterKeyBindings.append(CIMKeyBinding("SystemName", System::getFullyQualifiedHostName(), CIMKeyBinding::STRING)); filterKeyBindings.append(CIMKeyBinding("CreationClassName", PEGASUS_CLASSNAME_INDFILTER.getString(), CIMKeyBinding::STRING)); filterKeyBindings.append(CIMKeyBinding("Name", filterName, CIMKeyBinding::STRING)); CIMObjectPath filterPath("", CIMNamespaceName(), PEGASUS_CLASSNAME_INDFILTER, filterKeyBindings); Array<CIMKeyBinding> handlerKeyBindings; handlerKeyBindings.append(CIMKeyBinding("SystemCreationClassName", System::getSystemCreationClassName(), CIMKeyBinding::STRING)); handlerKeyBindings.append(CIMKeyBinding("SystemName", System::getFullyQualifiedHostName(), CIMKeyBinding::STRING)); handlerKeyBindings.append(CIMKeyBinding("CreationClassName", PEGASUS_CLASSNAME_LSTNRDST_CIMXML.getString(), CIMKeyBinding::STRING)); handlerKeyBindings.append(CIMKeyBinding("Name", handlerName, CIMKeyBinding::STRING)); CIMObjectPath handlerPath("", CIMNamespaceName(), PEGASUS_CLASSNAME_LSTNRDST_CIMXML, handlerKeyBindings); Array<CIMKeyBinding> subscriptionKeyBindings; subscriptionKeyBindings.append(CIMKeyBinding("Filter", filterPath.toString(), CIMKeyBinding::REFERENCE)); subscriptionKeyBindings.append(CIMKeyBinding("Handler", handlerPath.toString(), CIMKeyBinding::REFERENCE)); return CIMObjectPath( "", CIMNamespaceName(), PEGASUS_CLASSNAME_INDSUBSCRIPTION, subscriptionKeyBindings); }
bool DBusObjectManager::handleMessage(const DBusMessage& dbusMessage) { const char* objectPath = dbusMessage.getObjectPath(); const char* interfaceName = dbusMessage.getInterface(); assert(objectPath); assert(interfaceName); DBusInterfaceHandlerPath handlerPath(objectPath, interfaceName); objectPathLock_.lock(); auto handlerIterator = dbusRegisteredObjectsTable_.find(handlerPath); const bool foundDBusInterfaceHandler = handlerIterator != dbusRegisteredObjectsTable_.end(); bool dbusMessageHandled = false; if (foundDBusInterfaceHandler) { std::shared_ptr<DBusInterfaceHandler> dbusStubAdapterBase = handlerIterator->second; dbusMessageHandled = dbusStubAdapterBase->onInterfaceDBusMessage(dbusMessage); } else if (dbusMessage.hasInterfaceName("org.freedesktop.DBus.Introspectable")) { dbusMessageHandled = onIntrospectableInterfaceDBusMessage(dbusMessage); } objectPathLock_.unlock(); return dbusMessageHandled; }