static CMPIStatus mbModifyInstance(const CMPIBroker *mb, const CMPIContext *ctx, const CMPIObjectPath *cop, const CMPIInstance *ci,const char ** properties) { DDD(cout<<"--- mbSetInstance()"<<endl); mb=CM_BROKER; CMPIFlags flgs=ctx->ft->getEntry(ctx,CMPIInvocationFlags,NULL).value.uint32; const CIMPropertyList props=getList(properties); AutoMutex mtx(((CMPI_Broker*)mb)->mtx); try { CIMInstance cmi(*CM_Instance(ci)); cmi.setPath(*CM_ObjectPath(cop)); CM_CIMOM(mb)->modifyInstance( OperationContext(*CM_Context(ctx)), CM_ObjectPath(cop)->getNameSpace(), cmi, CM_IncludeQualifiers(flgs), props); CMReturn(CMPI_RC_OK); } catch (const CIMException &e) { DDD(cout<<"### exception: mbSetInstance - code: "<<e.getCode()<<" msg: "<<e.getMessage()<<endl); CMReturnWithString((CMPIrc)e.getCode(), (CMPIString*)string2CMPIString(e.getMessage())); } CMReturnWithChars(mb,CMPI_RC_ERROR,"Internal error - CMPIBoker.cpp-2"); }
BMenu *CreateColorMenu(const char *name, int columns, int n, rgb_color *colors, BMessage *msg) { if (columns > n) columns = n; int rows = (n + columns-1) / columns; // ceil((float)n / (float)columns) ColorMenuItem cmi(colors[0], NULL); float w, h; cmi.GetSize(w, h); BMenu *menu = new BMenu(name, columns * w, rows * h); menu->SetRadioMode(true); BRect frame; float left, top; int i = 0, x, y; BMessage *m = NULL; for (y = 0; y < rows; y++) for (x = 0; x < columns; x++) { left = x * w; top = y * h; frame.Set(left, top, left + w - 1, top + h - 1); if (msg != NULL) { m = new BMessage(*msg); ArchiveColor(NULL, m, colors[i]); } menu->AddItem(new ColorMenuItem(colors[i], m), frame); i++; if (i == n) return menu; } return menu; }
void LLNotificationsListener::listChannels(const LLSD& params) const { LLReqID reqID(params); LLSD response(reqID.makeResponse()); for (LLNotifications::ChannelMap::const_iterator cmi(mNotifications.mChannels.begin()), cmend(mNotifications.mChannels.end()); cmi != cmend; ++cmi) { LLSD channelInfo; channelInfo["parent"] = cmi->second->getParentChannelName(); response[cmi->first] = channelInfo; } LLEventPumps::instance().obtain(params["reply"]).post(response); }
void MIDIInput::configure() { ConfigureMIDIInput cmi(NULL, this); cmi.exec(); }