Esempio n. 1
0
Bool
Window_ownerIcon( Handle self, Bool set, Bool ownerIcon)
{
   if ( !set)
      return is_opt( optOwnerIcon);
   opt_assign( optOwnerIcon, ownerIcon);
   if ( is_opt( optOwnerIcon) && var-> owner) {
      Handle icon = ( var-> owner == application) ?
         CApplication( application)-> get_icon( application) :
         CWindow(      var-> owner)-> get_icon( var-> owner);
      my-> set_icon( self, icon);
      opt_set( optOwnerIcon);
   }
   return false;
}
Esempio n. 2
0
int
Widget_hintVisible( Handle self, Bool set, int hintVisible)
{
    Bool wantVisible;
    if ( !set)
        return PApplication( application)-> hintVisible;
    if ( var-> stage >= csDead) return false;
    wantVisible = ( hintVisible != 0);
    if ( wantVisible == PApplication( application)-> hintVisible) return false;
    if ( wantVisible) {
        if ( strlen( var-> hint) == 0) return false;
        if ( hintVisible > 0) PApplication(application)-> hintActive = -1; /* immediate */
    }
    CApplication( application)-> set_hint_action( application, self, wantVisible, false);
    return false;
}
Esempio n. 3
0
      int CDatabase::addApp(const std::string & launchInfo, const std::list<Service::Uid> & services)
      {
         LOG4CPLUS_TRACE_METHOD(msLogger, __PRETTY_FUNCTION__ );

         std::string trimmedLaunchInfo = mLaunchInfoProcessor->trimLaunchInfo(launchInfo);
         if (hasApp(trimmedLaunchInfo))
         {
            return -1;
         }

         mpMutex->lock();
         int id = genId();
         mApplications[id] = CApplication(trimmedLaunchInfo, services);
         saveWithNoLocks();
         mpMutex->unlock();
         return id;
      }
Esempio n. 4
0
 void CDatabase::addApplicationAndServices(const std::string& launchInfo, const std::list<Service::Uid> & services)
 {
    LOG4CPLUS_TRACE_METHOD(msLogger, __PRETTY_FUNCTION__ );
    bool needSave = false;
    std::string trimmedLaunchInfo = mLaunchInfoProcessor->trimLaunchInfo(launchInfo);
    if (!mLaunchInfoProcessor->isLaunchInfoValid(trimmedLaunchInfo))
    {
       LOG4CPLUS_WARN(msLogger, "Invalid launch info provided: " + trimmedLaunchInfo);
       return;
    }
    mpMutex->lock();
    if (!hasAppWithNoLocks(trimmedLaunchInfo))
    {
       LOG4CPLUS_INFO(msLogger, "addApplicationAndServices(): a new application! " + trimmedLaunchInfo);
       needSave = true;
       int id = genId();
       mApplications[id] = CApplication(trimmedLaunchInfo);
    }
    else
    {
       LOG4CPLUS_INFO(msLogger, "addApplicationAndServices(): application already registered! " + trimmedLaunchInfo);
    }
    std::map<int, CApplication>::iterator appsIterator;
    for ( appsIterator = mApplications.begin(); mApplications.end() != appsIterator; ++appsIterator)
    {
       if (appsIterator->second.launchInfo() == trimmedLaunchInfo)
       {
          break;
       }
    }
    std::list<Service::Uid>::const_iterator servicesIterator;
    for (servicesIterator = services.begin(); servicesIterator != services.end(); servicesIterator ++)
    {
       LOG4CPLUS_INFO(msLogger, "addApplicationAndServices(): service " + (*servicesIterator).value());
       needSave = appsIterator->second.addService(*servicesIterator) || needSave;
    }
    if (needSave)
    {
       LOG4CPLUS_INFO(msLogger, "addApplicationAndServices(): database changed! " + trimmedLaunchInfo);
       saveWithNoLocks();
    }
    mpMutex->unlock();
 }