57 const gboolean empty_history)
59 gboolean all_ok =
TRUE;
68 " VALUES (?1, ?2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)",
69 snap_id, imgid, SQLITE_DONE);
77 " SELECT ?1, imgid, num, module, operation, op_params, enabled, "
78 " blendop_params, blendop_version, multi_priority, multi_name "
81 snap_id, imgid, SQLITE_DONE);
87 all_ok = all_ok &&
_run_snap_imgid(
"INSERT INTO memory.undo_masks_history"
88 " SELECT ?1, imgid, num, formid, form, name, version,"
89 " points, points_count, source"
90 " FROM main.masks_history"
92 snap_id, imgid, SQLITE_DONE);
95 all_ok = all_ok &&
_run_snap_imgid(
"INSERT INTO memory.undo_module_order"
96 " SELECT ?1, imgid, version, iop_list"
97 " FROM main.module_order"
99 snap_id, imgid, SQLITE_DONE);
115 " SELECT imgid, num, module, operation, op_params, enabled, "
116 " blendop_params, blendop_version, multi_priority, multi_name "
117 " FROM memory.undo_history"
118 " WHERE imgid=?2 AND id=?1",
119 snap_id, imgid, SQLITE_DONE);
124 " SELECT imgid, num, formid, form, name, version, "
125 " points, points_count, source"
126 " FROM memory.undo_masks_history"
127 " WHERE imgid=?2 AND id=?1",
128 snap_id, imgid, SQLITE_DONE) && all_ok;
131 " SELECT imgid, version, iop_list"
132 " FROM memory.undo_module_order"
133 " WHERE imgid=?2 AND id=?1",
134 snap_id, imgid, SQLITE_DONE) && all_ok;
gboolean dt_history_snapshot_repository_restore(const int snap_id, const int32_t imgid)
Copy snapshot snap_id of imgid back over the live history tables.
void dt_history_snapshot_repository_clear(const int snap_id, const int32_t imgid)
Drop snapshot snap_id of imgid from all three undo tables.
gboolean dt_history_snapshot_repository_create(const int snap_id, const int32_t imgid, const gboolean empty_history)
Copy imgid's history, masks history and module order into the undo tables.
int dt_history_snapshot_repository_next_id(const int32_t imgid)
The id the next snapshot of imgid should use: one past the highest taken.
static gboolean _run_snap_imgid(const char *query, const int snap_id, const int32_t imgid, const int expected)
memory.undo_history, memory.undo_masks_history, memory.undo_module_order.