Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
masks_history.c File Reference
+ Include dependency graph for masks_history.c:

Go to the source code of this file.

Functions

dt_masks_form_tdt_masks_form_ref (dt_masks_form_t *form)
 
void dt_masks_form_unref (dt_masks_form_t *form)
 
dt_masks_form_tdt_masks_cow_touch (dt_develop_t *dev, dt_masks_form_t *form)
 
void dt_masks_replace_current_forms (dt_develop_t *dev, GList *forms)
 
GList * dt_masks_snapshot_current_forms (dt_develop_t *dev, gboolean reset_changed)
 

Function Documentation

◆ dt_masks_cow_touch()

dt_masks_form_t * dt_masks_cow_touch ( struct dt_develop_t dev,
dt_masks_form_t form 
)

Ensure form is private to dev->forms before mutating it in place: if anything else still references it (refcount > 1, e.g. a history snapshot), clone it, splice the clone into dev->forms (and dev->form_gui->form_visible if it pointed at the old object) in its place, and release the old reference. Returns the form to mutate: either the original (fast path, refcount == 1) or the fresh clone. No-op (returns form unchanged) if form is not found in dev->forms (e.g. a transient, not-yet-appended in-creation shape).

Definition at line 38 of file masks_history.c.

References dt_atomic_get_int(), dt_masks_dup_masks_form(), dt_masks_form_unref(), dt_pthread_rwlock_unlock(), dt_pthread_rwlock_wrlock(), dt_develop_t::form_gui, dt_masks_form_gui_t::form_visible, dt_develop_t::forms, IS_NULL_PTR, dt_develop_t::masks_mutex, and dt_masks_form_t::refcount.

Referenced by _blendop_masks_all_toggled(), _blendop_masks_group_move_by_index(), _blendop_masks_group_operation_callback(), _masks_move_up_down_callback(), _masks_remove_or_delete_finish(), _masks_remove_shape(), _menu_add_exist(), _tree_add_exist(), _tree_duplicate_shape(), _tree_movedown(), _tree_moveup(), dt_masks_events_button_pressed(), dt_masks_events_button_released(), dt_masks_events_key_pressed(), dt_masks_events_mouse_moved(), dt_masks_events_mouse_scrolled(), dt_masks_form_change_opacity(), dt_masks_form_delete(), dt_masks_group_ungroup(), dt_masks_gui_form_save_creation(), dt_masks_iop_use_same_as(), and dt_masks_remove_node().

◆ dt_masks_form_ref()

dt_masks_form_t * dt_masks_form_ref ( dt_masks_form_t form)

take a reference on a form (increments its refcount); returns the same pointer

Definition at line 24 of file masks_history.c.

References dt_atomic_add_int(), IS_NULL_PTR, and dt_masks_form_t::refcount.

Referenced by _dt_dev_history_item_duplicate_one(), dt_history_duplicate(), dt_masks_append_form(), dt_masks_replace_current_forms(), and dt_masks_snapshot_current_forms().

◆ dt_masks_form_unref()

void dt_masks_form_unref ( dt_masks_form_t form)

release a reference on a form; frees it once the last reference is dropped. Signature matches GDestroyNotify for use with g_list_free_full().

Definition at line 31 of file masks_history.c.

References dt_atomic_sub_int(), dt_masks_free_form(), IS_NULL_PTR, and dt_masks_form_t::refcount.

Referenced by dt_dev_cleanup(), dt_dev_free_history_item(), dt_dev_history_item_update_from_params(), dt_dev_pixelpipe_cleanup(), dt_dev_pixelpipe_process(), dt_masks_cow_touch(), dt_masks_remove_form(), and dt_masks_replace_current_forms().

◆ dt_masks_replace_current_forms()

void dt_masks_replace_current_forms ( struct dt_develop_t dev,
GList *  forms 
)

◆ dt_masks_snapshot_current_forms()

GList * dt_masks_snapshot_current_forms ( struct dt_develop_t dev,
gboolean  reset_changed 
)

snapshot current dev->forms: shares references, does not deep-copy. Optionally reset dev->forms_changed.

Definition at line 101 of file masks_history.c.

References dt_masks_form_ref(), dt_pthread_rwlock_rdlock(), dt_pthread_rwlock_unlock(), FALSE, dt_develop_t::forms, dt_develop_t::forms_changed, and dt_develop_t::masks_mutex.

Referenced by dt_dev_add_history_item_ext(), dt_dev_history_item_from_source_history_item(), and dt_dev_pixelpipe_process().