65 dt_pthread_mutex_lock(&self->mutex); self->locked = TRUE
68 self->locked = FALSE; dt_pthread_mutex_unlock(&self->mutex)
92 void (*free_data)(gpointer data))
98 if(free_data) free_data(data);
165 void (*free_data)(gpointer data))
172 return GPOINTER_TO_INT(a) - GPOINTER_TO_INT(b);
190 action ==
DT_ACTION_UNDO?
"UNDO":
"DO", filter, g_list_length(*from), g_list_length(*to));
192 for(GList *l = *from; l; l = g_list_next(l))
196 if(item->
type & filter)
200 gboolean is_group =
FALSE;
202 GList *next = g_list_next(l);
205 *from = g_list_remove(*from, item);
206 *to = g_list_prepend(*to, item);
208 while((l = next) && !is_group)
211 next = g_list_next(l);
214 *from = g_list_remove(*from, item);
223 *to = g_list_prepend(*to, item);
228 const double first_item_ts = item->
ts;
229 gboolean in_group =
FALSE;
235 GList *next = g_list_next(l);
238 *from = g_list_remove(*from, item);
241 in_group = !in_group;
247 *to = g_list_prepend(*to, item);
251 }
while (l && (item->
type & filter) && (in_group || (fabs(item->
ts - first_item_ts) <
MAX_TIME_PERIOD)));
263 for(
const GList *img = imgs; img; img = g_list_next(img))
264 while(img->next && img->data == img->next->data)
265 imgs = g_list_delete_link(imgs, img->next);
285 gboolean found_something =
FALSE;
291 for(GList *l = *from; l; l = g_list_next(l))
294 if(item->
type & filter)
296 found_something =
TRUE;
303 return found_something;
321 for(GList *l = *list; l; l = next)
324 next = g_list_next(l);
325 if(item->
type & filter)
328 *list = g_list_remove(*list, item);
334 filter, g_list_length(*list));
354 for(GList *l = list; l; l = g_list_next(l))
359 apply(user_data, item->
type, item->
data);
static const dt_aligned_pixel_simd_t const dt_adaptation_t const float p
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
void dt_image_synch_xmps(const GList *img)
void dt_print(dt_debug_thread_t thread, const char *msg,...)
static double dt_get_wtime(void)
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
static int dt_pthread_mutex_init(dt_pthread_mutex_t *mutex, const pthread_mutexattr_t *mutexattr)
static int dt_pthread_mutex_destroy(dt_pthread_mutex_t *mutex)
void(* free_data)(gpointer data)
void(* undo)(gpointer user_data, dt_undo_type_t type, dt_undo_data_t data, dt_undo_action_t action, GList **imgs)
void dt_undo_disable_next(dt_undo_t *self)
void dt_undo_do_redo(dt_undo_t *self, uint32_t filter)
static void _undo_iterate(GList *list, uint32_t filter, gpointer user_data, void(*apply)(gpointer user_data, dt_undo_type_t type, dt_undo_data_t item))
gboolean dt_is_redo_list_populated(dt_undo_t *self, uint32_t filter)
static void _undo_clear_list(GList **list, uint32_t filter)
void dt_undo_end_group(dt_undo_t *self)
static void _undo_record(dt_undo_t *self, gpointer user_data, dt_undo_type_t type, dt_undo_data_t data, gboolean is_group, void(*undo)(gpointer user_data, dt_undo_type_t type, dt_undo_data_t item, dt_undo_action_t action, GList **imgs), void(*free_data)(gpointer data))
gint _images_list_cmp(gconstpointer a, gconstpointer b)
const double MAX_TIME_PERIOD
void dt_undo_cleanup(dt_undo_t *self)
void dt_undo_clear(dt_undo_t *self, uint32_t filter)
void dt_undo_iterate_internal(dt_undo_t *self, uint32_t filter, gpointer user_data, void(*apply)(gpointer user_data, dt_undo_type_t type, dt_undo_data_t item))
void dt_undo_iterate(dt_undo_t *self, uint32_t filter, gpointer user_data, void(*apply)(gpointer user_data, dt_undo_type_t type, dt_undo_data_t item))
void dt_undo_start_group(dt_undo_t *self, dt_undo_type_t type)
static void _free_undo_data(void *p)
static gboolean _is_do_undo_list_populated(dt_undo_t *self, uint32_t filter, dt_undo_action_t action)
void dt_undo_do_undo(dt_undo_t *self, uint32_t filter)
static void _undo_do_undo_redo(dt_undo_t *self, uint32_t filter, dt_undo_action_t action)
dt_undo_t * dt_undo_init(void)
void dt_undo_record(dt_undo_t *self, gpointer user_data, dt_undo_type_t type, dt_undo_data_t data, void(*undo)(gpointer user_data, dt_undo_type_t type, dt_undo_data_t item, dt_undo_action_t action, GList **imgs), void(*free_data)(gpointer data))
gboolean dt_is_undo_list_populated(dt_undo_t *self, uint32_t filter)