Esempio n. 1
0
void
rig_selection_tool_set_active(rig_selection_tool_t *tool, bool active)
{
    rig_editor_t *editor = rig_engine_get_editor(tool->view->engine);
    rig_objects_selection_t *selection =
        rig_editor_get_objects_selection(editor);
    c_llist_t *l;

    if (tool->active == active)
        return;

    tool->active = active;

    if (active) {
        tool->objects_selection_closure =
            rig_objects_selection_add_event_callback(selection,
                                                     objects_selection_event_cb,
                                                     tool,
                                                     NULL); /* destroy notify */

        for (l = selection->objects; l; l = l->next) {
            objects_selection_event_cb(
                selection, RIG_OBJECTS_SELECTION_ADD_EVENT, l->data, tool);
        }
    } else {
        for (l = selection->objects; l; l = l->next) {
            objects_selection_event_cb(
                selection, RIG_OBJECTS_SELECTION_REMOVE_EVENT, l->data, tool);
        }

        rut_closure_disconnect_FIXME(tool->objects_selection_closure);
        tool->objects_selection_closure = NULL;
    }
}
Esempio n. 2
0
/* When this is called we know that the frontend is in sync with the
 * simulator which has just sent the frontend a ui-update that has
 * been applied and so we can apply edits without fear of conflicting
 * with the simulator...
 */
static void
ui_load_cb(rig_frontend_t *frontend, void *user_data)
{
    rig_slave_t *slave = user_data;

    rut_closure_disconnect_FIXME(slave->ui_load_closure);
    slave->ui_load_closure = NULL;
    load_ui(slave);
}