示例#1
0
static void
remove_control_item(HippoCanvasContextWin     *canvas_win,
                    HippoCanvasItem *item)
{
    RegisteredControlItem *citem;
    GSList *link;
    
    citem = NULL;
    for (link = canvas_win->control_items;
         link != NULL;
         link = link->next) {
        citem = (RegisteredControlItem*) link->data;
        if (citem->item == item)
            break;
    }
    if (link == NULL) {
        g_warning("removing a not-registered control item");
        return;
    }

    canvas_win->control_items = g_slist_remove(canvas_win->control_items, citem);
    
    g_signal_handlers_disconnect_by_func(G_OBJECT(citem->item),
                                         G_CALLBACK(on_item_control_changed),
                                         canvas_win);
    clear_control(citem);
    g_object_unref(citem->item);
    g_free(citem);
}
示例#2
0
int
InitScreen()
{
	char	*sb_dev, *driver;
	
	printnbits();

	sb_dev = getenv("SB_OUTDEV");   
	if(!sb_dev) sb_dev = getenv("OUTDEV");   
	if(!sb_dev) sb_dev = "/dev/crt1";

	driver = getenv("SB_OUTDRIVER");
	if(!driver) driver = getenv("OUTDRIVER");
	if (!driver ) driver = "hp98731";
	
	fildes = gopen(sb_dev,OUTDEV,driver,INIT|INT_XFORM);
	interior_style(fildes,INT_SOLID,FALSE);
	
	intvdc_extent(fildes,0,0,SIZE, SIZE);
	mapping_mode(fildes,FALSE);
	
	drawing_mode(fildes,6);	  /* xor mode */
	
	clear_control(fildes, CLEAR_VIEWPORT);
	fill_color(fildes, 1.0, 1.0, 1.0);
	
	return(fildes);
}
示例#3
0
static void
update_control(HippoCanvasContextWin   *canvas_win,
               RegisteredControlItem   *citem)
{
    HippoAbstractControl *new_control;

    new_control = NULL;
    g_object_get(G_OBJECT(citem->item), "control", &new_control, NULL);

    if (new_control == citem->control)
        return;
    
    if (new_control) {
        new_control->AddRef();
        new_control->setParent(canvas_win->canvas);
        new_control->setCanvasItem(G_OBJECT(citem->item));
    }
    
    clear_control(citem);
    
    citem->control = new_control;
}