int layout_add(struct TrayIcon *ti) { if (grid_add(ti)) { grid_update(ti, True); return SUCCESS; } else return FAILURE; }
Object& Objects::add(Object_ptr new_object) { // add to grid grid_add(new_object->getPosition(), new_object.get()); if (!free_objects.empty()) { auto id = free_objects.back(); free_objects.pop_back(); new_object->set_id(id); objs[id] = std::move(new_object); return *objs[id]; } new_object->set_id(objs.size()); objs.push_back(std::move(new_object)); return *objs.back(); }