Beispiel #1
0
void Pixmap::mark(bool marked){
    if(markable){
        if(this->marked != marked){
            this->marked = marked;
            emit mark_changed();
        }
    }
}
void QSanSelectableItem::mark(bool marked) {
    if (markable) {
        if (this->marked != marked) {
            this->marked = marked;
            emit mark_changed();
        }
    }
}
Beispiel #3
0
void View::draw_onto_self(const GUIImage &image_, DispPoint pos) {
    
    mark_changed();
    
    // Using SDL, perform a blit from view to self.
	SDL_Rect dest_rect = {pos.x, pos.y, image_->w, image_->h};
	SDL_BlitSurface(image_, 0, image, &dest_rect);

}
Beispiel #4
0
// NOTE: Does not delete the view, only removes it from list!
void View::remove_subview(View* view) {
    
    if (!is_subview(view))
        throw Error("view is not a subview of this!");
    
    children.remove(view);
    view->parent = 0;
    
    mark_changed();
}
Beispiel #5
0
void View::move_subview(View* view, DispPoint pos) {
    
    if (!is_subview(view))
        throw Error("view is not a subview of this!");
    
    if (view->pos == pos) return; // no need to mark change if already there!
    
    view->pos = pos;
    
    mark_changed();
}
Beispiel #6
0
View* View::remove_last_subview() {
    
    if (children.empty())
        throw Error("view has not subviews!");
    
    View *view = children.back();
    children.pop_back();
    view->parent = 0;
    
    mark_changed();
    
    return view;
}
Beispiel #7
0
void View::attach_subview(View* view, DispPoint pos) {
    if (view->parent)
        throw Error("Candidate vew is already a subview of another view.");
    
    if (view == this) 
        throw Error("Cannot attach a view to itself!");

    /// @todo Check if out of bounds? Or maybe not..?
    
    view->pos = pos;
    children.push_back(view);
    view->parent = this;
    
    mark_changed();
}
Beispiel #8
0
/* this is run once a second from WANIPConnection_Update. */
static bool update_external_address(PService psvc)
{
    PWANIPConnectionData pdata = (PWANIPConnectionData) psvc->opaque;
    PWANDevicePrivateData pdevdata = (PWANDevicePrivateData) psvc->device->parent->opaque;
    struct in_addr ipaddr = {0} ;

    if (osl_wan_isup(pdevdata->ifname)) {
	osl_ifaddr(pdevdata->ifname, &ipaddr);
    }
    if (pdata->external_ipaddr.s_addr != ipaddr.s_addr) {
	pdata->external_ipaddr = ipaddr;
	mark_changed(psvc, VAR_ExternalIPAddress);
    }

    return (pdata->external_ipaddr.s_addr != ipaddr.s_addr);
}
Beispiel #9
0
 /*----------------------------------------------**
 **	queue up all formulae and actions	**
 **	which depends on v 			**
 **----------------------------------------------*/
void
schedule_parents_of(symptr v)
{				/* builtin function */
    register symptr_ATOM P;
    register symptr_QUEUE *Q;

   /* Tell DOSTE about changes to certain observables that it is listening to [Nick] */
   if (((v->stype == 264) || (v->stype == 265))) { /* Removed  && (v->doste == 1) to always tell DOSTE [Nick] */
   	doste_trigger(v->name, v->context);
   }

    Q = &v->targets;
    FOREACH(P, Q) {
      mark_changed(P->obj); /* this target and recursively all of its
                               targets... [Ash] */
      schedule(P->obj);
    }
Beispiel #10
0
/* this is run once a second. */
static void WANIPConnection_Update(timer_t t, PService psvc)
{
    PWANIPConnectionData pdata = (PWANIPConnectionData) psvc->opaque;

    if (igd_config_generation != pdata->igd_generation) {
	pdata->igd_generation = igd_config_generation;
	mapmgr_update();
	if (pdata->nportmappings != mapmgr_port_map_count()) {
	    pdata->nportmappings = mapmgr_port_map_count();
	    mark_changed(psvc, VAR_PortMappingNumberOfEntries);
	}
    }

    update_external_address(psvc);
    update_connection_status(psvc);

    if ((psvc->flags & VAR_CHANGED) == VAR_CHANGED) {
	update_all_subscriptions(psvc);
    }
}
Beispiel #11
0
/* this is run once a second from WANIPConnection_Update. */
static bool update_connection_status(PService psvc)
{
    PWANIPConnectionData pdata = (PWANIPConnectionData) psvc->opaque;
    PWANDevicePrivateData pdevdata = (PWANDevicePrivateData) psvc->device->parent->opaque;
    ip_conn_t old_status = pdata->connection_status;
    bool wan_connected;

    wan_connected = osl_wan_isup(pdevdata->ifname);

    switch (pdata->connection_status) {
    case IP_CONNECTING: 
	{
	    if (wan_connected) {
		pdata->connection_status = IP_CONNECTED;
		pdata->connected_time = time(NULL);
	    } else if (pdata->connection_timeout-- <= 0) {
		pdata->connection_status = IP_DISCONNECTED;
	    }
	}
	break;

    case IP_CONNECTED: 
	{
	    if (!wan_connected) {
		pdata->connection_status = IP_DISCONNECTED;
	    } 
	}
	break;
    case IP_DISCONNECTING: 
	{
	    if (wan_connected) {
		pdata->connection_status = IP_CONNECTING;
	    } else {
		pdata->connection_status = IP_DISCONNECTED;
	    }
	}
	break;
	
    case IP_DISCONNECTED: 
	{
	    if (wan_connected) {
		pdata->connection_status = IP_CONNECTING;
	    }
	}
	break;
    default:
	UPNP_ERROR(("%s:%d Unexpected connection_status %d\n", __FILE__, __LINE__, pdata->connection_status));
    }

    if (old_status != pdata->connection_status)	
    {

//printf("STATUS: %d %d %d\n", pdata->connection_status, wan_connected, pdata->connection_timeout);

	tries=0;	
	mark_changed(psvc, VAR_ConnectionStatus);
    }
    else if (tries>0) 
    {
	tries--;

//printf("STATUS1: %d %d %d\n", pdata->connection_status, wan_connected, pdata->connection_timeout);

	mark_changed(psvc, VAR_ConnectionStatus);
    }


    return (old_status != pdata->connection_status);
}