//static
void LLFloaterAvatarList::toggle(void*)
{
#ifdef LL_RRINTERFACE_H //MK
	if (gRRenabled && gAgent.mRRInterface.mContainsShownames)
	{
		if (sInstance && sInstance->getVisible())
		{	
			sInstance->close(false);
		}
	}
#endif //mk
	if (sInstance)
	{
		if (sInstance->getVisible())
		{
			sInstance->close(false);
		}
		else
		{
			sInstance->open();
		}
	}
	else
	{
		showInstance();
	}
}
//static
void LLFloaterReg::showFloaterInstance(const LLSD& sdname)
{
	LLSD key;
	std::string name = sdname.asString();
	parse_name_key(name, key);
	showInstance(name, key, TRUE);
}
Beispiel #3
0
int main()
{
    CMCIClient *cc;
    CMPIObjectPath * objectpath;
    CMPIEnumeration * enumeration;
    CMPIStatus status;
    char 	*cim_host, *cim_host_passwd, *cim_host_userid;

    /* Setup a connection to the CIMOM */
    cim_host = getenv("CIM_HOST");
    if (cim_host == NULL)
	cim_host = "localhost";
    cim_host_userid = getenv("CIM_HOST_USERID");
    if (cim_host_userid == NULL)
	cim_host_userid = "root";
    cim_host_passwd = getenv("CIM_HOST_PASSWD");
    if (cim_host_passwd == NULL)
	cim_host_passwd = "password";
    cc = cmciConnect(cim_host, NULL, "5988",
			       cim_host_userid, cim_host_passwd, NULL);

    /* Test references() */
    printf("\n----------------------------------------------------------\n");
    printf("--> Testing references() ...\n");

    objectpath = newCMPIObjectPath("root/cimv2", "Linux_ComputerSystem", NULL);

    printf( "--> Adding keys to object path\n" );
    CMAddKey(objectpath, "CreationClassName", "Linux_ComputerSystem", CMPI_chars);
    CMAddKey(objectpath, "Name", "localhost.localdomain", CMPI_chars);

    printf( "--> Enumerating Instances\n" );
    enumeration = cc->ft->references(cc, objectpath, NULL, NULL, 0, NULL, &status);

    printf( "--> Print the results \n" );
    printf( "--> references() rc=%d, msg=%s\n", 
            status.rc, (status.msg)? (char *)status.msg->hdl : NULL);

    if (!status.rc) {        
        printf("--> result(s):\n");

        while (enumeration->ft->hasNext(enumeration, NULL)) 
        {
            CMPIData data = enumeration->ft->getNext(enumeration, NULL);
            showInstance(data.value.inst);
        }
    }

    if (enumeration) CMRelease(enumeration);
    if (objectpath) CMRelease(objectpath);
    if (status.msg) CMRelease(status.msg);
    if (cc) CMRelease(cc);
  
    return 0;
}
//static
// returns true if the instance is visible when completed
bool LLFloaterReg::toggleInstance(const std::string& name, const LLSD& key)
{
	LLFloater* instance = findInstance(name, key); 
	if (LLFloater::isShown(instance))
	{
		instance->closeHostedFloater();
		return false;
	}
	else
	{
		return showInstance(name, key, TRUE) ? true : false;
	}
}
Beispiel #5
0
/*----------------------------------------------------------------------*/
static void showObject(int obj)
{
    char str[80];


    if (!isObject(obj)) {
        sprintf(str, "Instance %d is not an object", obj);
        output(str);
        return;
    }

    showInstance(obj);

}
//static
void LLFloaterMediaBrowser::toggle()
{
	LLFloaterMediaBrowser* self = LLFloaterMediaBrowser::getInstance();

	if(self->getVisible())
	{
		self->close();
	}
	else
	{
		//Show home url if new session, last visited if not
		std::string last_url = gSavedSettings.getString("BrowserLastVisited");
		if(last_url.empty()) 
			last_url = gSavedSettings.getString("BrowserHome");
		showInstance(last_url);
	}
}
//static
void LLFloaterReg::showInitialVisibleInstances() 
{
	// Iterate through alll registered instance names and show any with a save visible state
	for (build_map_t::iterator iter = sBuildMap.begin(); iter != sBuildMap.end(); ++iter)
	{
		const std::string& name = iter->first;
		std::string controlname = getVisibilityControlName(name);
		if (LLFloater::getControlGroup()->controlExists(controlname))
		{
			BOOL isvis = LLFloater::getControlGroup()->getBOOL(controlname);
			if (isvis)
			{
				showInstance(name, LLSD()); // keyed floaters shouldn't set save_vis to true
			}
		}
	}
}
//static
// returns true if the instance is visible when completed
bool LLFloaterReg::toggleInstance(const std::string& name, const LLSD& key)
{
	LLFloater* instance = findInstance(name, key); 
	if (LLFloater::isShown(instance))
	{
		// When toggling *visibility*, close the host instead of the floater when hosted
		if (instance->getHost())
			instance->getHost()->closeFloater();
		else
			instance->closeFloater();
		return false;
	}
	else
	{
		return showInstance(name, key, TRUE) ? true : false;
	}
}
Beispiel #9
0
//static
void LLFloaterAvatarList::toggle(void*)
{
	if (sInstance)
	{
		if (sInstance->getVisible())
		{
			sInstance->close(false);
		}
		else
		{
			sInstance->open();
		}
	}
	else
	{
		showInstance();
	}
}
//static
void LLFloaterAvatarList::toggle(void*)
{
// [RLVa:KB]
	if(gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
	{
		if(instanceExists())
			getInstance()->close();
	}
	else
// [/RLVa:KB]
	if(!instanceExists() || !getInstance()->getVisible())
	{
		showInstance();
	}
	else
	{
		getInstance()->close();
	}
}
//static
void LLFloaterAvatarList::toggle(void*)
{
	if (sInstance)
	{
		if (sInstance->getVisible()
// [RLVa:KB]
			|| gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)
// [/RLVa:KB]
			)

		{
			sInstance->close(false);
		}
		else
		{
			sInstance->open();
		}
	}
	else
	{
		showInstance();
	}
}
Beispiel #12
0
int
main()
{
  CIMCEnv        *ce;
  char           *msg = NULL;
  int             rc;
  CIMCStatus      status;
  CIMCClient     *client;
  CIMCObjectPath *op;
  CMPIConstClass *clas;
  CIMCEnumeration *enm;
  CIMCString     *path;
  CMPIString     *classname;
  CIMCData        data;
  CMPIData        cdata;
  char           *cim_host,
                 *cim_host_passwd,
                 *cim_host_userid,
                 *cim_host_port;
  int             i = 0;
  int             retc = 0;
  int             count = 0;
  int             numproperties = 0;
  CMPIString     *propertyname;
  char           *cv;

  /*
   * Setup a connection to the CIMOM 
   */
  cim_host = getenv("CIM_HOST");
  if (cim_host == NULL)
    cim_host = "localhost";
  cim_host_userid = getenv("CIM_HOST_USERID");
  if (cim_host_userid == NULL)
    cim_host_userid = "root";
  cim_host_passwd = getenv("CIM_HOST_PASSWD");
  if (cim_host_passwd == NULL)
    cim_host_passwd = "password";
  cim_host_port = getenv("CIM_HOST_PORT");
  if (cim_host_port == NULL)
    cim_host_port = "5988";

  printf(" Testing enumerateClasses for namespaces \n");

  printf(" using SfcbLocal interface : host = %s userid = %s\n",
         cim_host, cim_host_userid);
  ce = NewCIMCEnv("SfcbLocal", 0, &rc, &msg);

  if (ce == NULL) {
    printf
        (" local connect failed call to NewCIMCEnv rc = %d , message = [%s] \n",
         retc, msg);
    return 1;
  }

  client =
      ce->ft->connect(ce, cim_host, "http", cim_host_port, cim_host_userid,
                      cim_host_passwd, &status);

  op = ce->ft->newObjectPath(ce, "root/interop", "CIM_Namespace", &status);
  enm =
      client->ft->enumInstances(client, (CIMCObjectPath *) op, 0, NULL,
                                &status);

  if (!status.rc) {
    printf("results:\n");
    count = enm->ft->hasNext(enm, NULL);
    while (count > 0) {
      data = enm->ft->getNext(enm, NULL);
      showInstance(data.value.inst);
      count = enm->ft->hasNext(enm, NULL);
    }
  } else {
    printf(" we have a status.rc value of %d  \n", status.rc);

  }

  if (ce)
    ce->ft->release(ce);
  if (client)
    client->ft->release(client);
  if (op)
    op->ft->release(op);
  if (enm)
    enm->ft->release(enm);
  if (status.msg)
    CMRelease(status.msg);

  return 0;

}
Beispiel #13
0
int
main()
{
  CIMCEnv        *ce;
  char           *msg = NULL;
  int             rc;
  CIMCStatus      status;
  CIMCClient     *client;
  CIMCObjectPath *op;
  CMPIConstClass *clas;
  CIMCEnumeration *enumeration;
  CIMCString     *path;
  CMPIString     *classname;
  CIMCData        data;
  CMPIData        cdata;
  char           *cim_host,
                 *cim_host_passwd,
                 *cim_host_userid,
                 *cim_host_port;
  int             i = 0;
  int             retc = 0;
  int             count = 0;
  int             numproperties = 0;
  CMPIString     *propertyname;
  char           *cv;

  /*
   * Setup a connection to the CIMOM 
   */
  cim_host = getenv("CIM_HOST");
  if (cim_host == NULL)
    cim_host = "localhost";
  cim_host_userid = getenv("CIM_HOST_USERID");
  if (cim_host_userid == NULL)
    cim_host_userid = "root";
  cim_host_passwd = getenv("CIM_HOST_PASSWD");
  if (cim_host_passwd == NULL)
    cim_host_passwd = "password";
  cim_host_port = getenv("CIM_HOST_PORT");
  if (cim_host_port == NULL)
    cim_host_port = "5988";

  printf(" Testing Associators \n");
  printf(" using SfcbLocal interface : host = %s userid = %s\n",
         cim_host, cim_host_userid);
  ce = NewCIMCEnv("SfcbLocal", 0, &rc, &msg);

  if (ce == NULL) {
    printf
        (" local connect failed call to NewCIMCEnv rc = %d , message = [%s] \n",
         retc, msg);
    return 1;
  }

  client =
      ce->ft->connect(ce, cim_host, "http", cim_host_port, cim_host_userid,
                      cim_host_passwd, &status);

  op = ce->ft->newObjectPath(ce, "root/cimv2", "TEST_Person", &status);

  CMAddKey(op, "name", "Mike", CMPI_chars);

  enumeration =
      client->ft->associators(client, op, "TEST_Lineage", NULL, NULL, NULL,
                              0, NULL, &status);

  /*
   * Print the results 
   */
  printf("associators() rc=%d, msg=%s\n", status.rc,
         (status.msg) ? (char *) status.msg->hdl : NULL);
  if (!status.rc) {
    printf("result(s):\n");
    while (enumeration->ft->hasNext(enumeration, NULL)) {
      data = enumeration->ft->getNext(enumeration, NULL);
      showInstance(data.value.inst);
    }
  }

  if (enumeration)
    CMRelease(enumeration);
  if (op)
    CMRelease(op);
  if (status.msg)
    CMRelease(status.msg);

  return 0;
}
Beispiel #14
0
int main()
{
        CIMCEnv *ce;
    char *msg = NULL;
    int rc;
    CIMCStatus status;
    CIMCClient *client;
    CIMCObjectPath *op, *objectpath_r;
    CMPIConstClass* clas ;
    CMPIInstance *instance;
    CIMCString *path;
    CMPIString * classname ;
    CIMCData data;
    CMPIData cdata ;
    char        *cim_host, *cim_host_passwd, *cim_host_userid , *cim_host_port;
    int i = 0 ;
    int retc = 0;
    int count = 0;
    int numproperties = 0;
    CMPIString * propertyname;
    char *cv;

    /* Setup a connection to the CIMOM */
    cim_host = getenv("CIM_HOST");
    if (cim_host == NULL)
                cim_host = "localhost";
    cim_host_userid = getenv("CIM_HOST_USERID");
    if (cim_host_userid == NULL)
                cim_host_userid = "root";
    cim_host_passwd = getenv("CIM_HOST_PASSWD");
    if (cim_host_passwd == NULL)
                cim_host_passwd = "password";
    cim_host_port = getenv("CIM_HOST_PORT");
          if (cim_host_port == NULL)
             cim_host_port = "5988";

    printf(" Testing Get instance \n") ;
    printf(" using SfcbLocal interface : host = %s userid = %s\n",
                          cim_host,cim_host_userid) ;
    ce = NewCIMCEnv("SfcbLocal",0,&rc,&msg);
    if(ce == NULL) {
      printf(" local connect failed call to NewCIMCEnv rc = %d , message = [%s] \n",retc,msg) ;
      return 1;
    }

    client = ce->ft->connect(ce, cim_host , "http", cim_host_port, cim_host_userid, cim_host_passwd , &status);

    op = ce->ft->newObjectPath(ce, "root/cimv2", "Linux_ComputerSystem" , &status);

    CMAddKey(op, "CreationClassName", "Linux_ComputerSystem", CMPI_chars);
    CMAddKey(op, "Name", "localhost.localdomain", CMPI_chars);
    instance = client->ft->getInstance(client, op, 0, NULL, &status);

    /* Print the results */
    printf( "getInstance() rc=%d, msg=%s\n",
            status.rc, (status.msg)? (char *)status.msg->hdl : NULL);
    if (!status.rc) {
        printf("result:\n");
        showInstance(instance);
    }

    if (instance) CMRelease(instance);
    if (op) CMRelease(op);
    if (status.msg) CMRelease(status.msg);

    return 0;
}