Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
shape_manager.c File Reference
#include "develop/imageop_gui.h"
#include "develop/masks.h"
#include "develop/masks_group.h"
#include "develop/masks_gui.h"
#include "develop/masks/masks_history.h"
#include "common/logging.h"
#include "system/macros.h"
#include "common/module_versioning.h"
#include "control/redraw.h"
#include "develop/blend.h"
#include "develop/blend_gui.h"
#include "develop/develop.h"
#include "develop/imageop.h"
#include "widgets/draw.h"
#include "widgets/accelerators.h"
#include "gui/application.h"
#include "libs/lib.h"
#include "libs/lib_api.h"
#include "views/view.h"
#include "widgets/scroll_wrap.h"
#include "widgets/widget_settings.h"
#include "common/conf.h"
#include "widgets/label.h"
#include "widgets/dialog.h"
#include "widgets/togglebutton.h"
#include "control/signal.h"
#include "control/user_message.h"
+ Include dependency graph for libs/shape_manager.c:

Go to the source code of this file.

Data Structures

struct  dt_shape_manager_list_t
 
struct  dt_shape_manager_t
 
struct  _tree_row_t
 

Macros

#define DT_MASKS_PANEL_CONF_WIDTH   "plugins/darkroom/masks/windowwidth"
 
#define DT_MASKS_PANEL_CONF_X   "plugins/darkroom/masks/window_x"
 
#define DT_MASKS_PANEL_CONF_Y   "plugins/darkroom/masks/window_y"
 

Typedefs

typedef enum dt_shape_list_t dt_shape_list_t
 
typedef struct dt_shape_manager_list_t dt_shape_manager_list_t
 
typedef struct dt_shape_manager_t dt_shape_manager_t
 
typedef enum dt_masks_tree_cols_t dt_masks_tree_cols_t
 
typedef enum dt_modchooser_col_t dt_modchooser_col_t
 
typedef struct _tree_row_t _tree_row_t
 

Enumerations

enum  dt_shape_list_t {
  DT_SHAPE_LIST_SHAPES = 0 ,
  DT_SHAPE_LIST_MODULES ,
  DT_SHAPE_LIST_COUNT
}
 
enum  dt_masks_tree_cols_t {
  TREE_TEXT = 0 ,
  TREE_MODULE ,
  TREE_GROUPID ,
  TREE_FORMID ,
  TREE_EDITABLE ,
  TREE_IC_OP ,
  TREE_IC_OP_VISIBLE ,
  TREE_IC_INVERSE ,
  TREE_IC_INVERSE_VISIBLE ,
  TREE_IC_USED_VISIBLE ,
  TREE_USED_TEXT ,
  TREE_IC_DELETE_VISIBLE ,
  TREE_IC_UNLINK_VISIBLE ,
  TREE_NOTE ,
  TREE_STRIKE ,
  TREE_IS_SEPARATOR ,
  TREE_COUNT
}
 
enum  dt_modchooser_col_t {
  MODCHOOSER_CHECKED = 0 ,
  MODCHOOSER_WAS_CHECKED ,
  MODCHOOSER_SENSITIVE ,
  MODCHOOSER_NAME ,
  MODCHOOSER_NOTE ,
  MODCHOOSER_MODULE ,
  MODCHOOSER_COUNT
}
 

Functions

static void _shape_manager_recreate_list (dt_lib_module_t *self)
 
static void _shape_manager_update_list (dt_lib_module_t *self)
 
static GList * _modules_owning_group (const dt_masks_form_t *group)
 
static void _shape_manager_broadcast (dt_lib_module_t *self, const int formid, const int parentid, const dt_masks_event_t event)
 
static void _tree_edit_group_name (dt_lib_module_t *self, dt_shape_list_t which, int formid, gboolean cursor_at_end)
 
const char * name (struct dt_lib_module_t *self __attribute__((unused)))
 
const char ** views (dt_lib_module_t *self __attribute__((unused)))
 
uint32_t container (dt_lib_module_t *self __attribute__((unused)))
 
static void _shape_manager_get_values (GtkTreeModel *model, GtkTreeIter *iter, dt_iop_module_t **module, int *groupid, int *formid)
 
static void _tree_add_shape (GtkWidget *menu_item, dt_iop_module_t *module)
 
static void _tree_add_shape_menu_item (GtkWidget *menu, const dt_masks_type_t type, dt_iop_module_t *module)
 
static void _shape_manager_shape_button_started (GtkWidget *button __attribute__((unused)), dt_iop_module_t *module __attribute__((unused)), dt_masks_type_t type __attribute__((unused)), gpointer user_data __attribute__((unused)))
 
static void _refresh_owning_modules (const dt_masks_form_t *grp)
 
static void _tree_add_exist (GtkButton *button, dt_masks_form_t *grp)
 
static GList * _selected_form_ids (dt_shape_manager_list_t *list)
 
static void _tree_group (GtkButton *button __attribute__((unused)), dt_shape_manager_list_t *list)
 
static int _tree_format_form_usage_label (char *str, const size_t str_size, const dt_masks_form_t *form, const dt_iop_module_t *module)
 
static void _set_iter_name (dt_shape_manager_t *lm, dt_masks_form_t *form, int state, float opacity, GtkTreeModel *model, GtkTreeIter *iter, int index)
 
static void _tree_delete_unused (GtkButton *button __attribute__((unused)), dt_shape_manager_list_t *list)
 
static void _add_masks_history_item (dt_shape_manager_t *lm)
 
static void _tree_apply_operation (GtkWidget *menu_item, dt_shape_manager_list_t *list)
 
static void _tree_moveup (GtkButton *button __attribute__((unused)), dt_shape_manager_list_t *list)
 
static void _tree_movedown (GtkButton *button __attribute__((unused)), dt_shape_manager_list_t *list)
 
static void _tree_delete_shape (GtkButton *button __attribute__((unused)), dt_shape_manager_list_t *list)
 
static int _tree_root_formid (GtkTreeModel *model, GtkTreeIter iter)
 
static int _selected_group_in_module_list (const dt_shape_manager_t *lm)
 
static gboolean _form_can_join_group (dt_develop_t *dev, const int group_id, const int fid)
 
static gboolean _row_can_be_added (const dt_shape_manager_t *lm, GtkTreeModel *model, GtkTreeIter *iter)
 
static void _tree_add_to_group (GtkMenuItem *item, dt_shape_manager_list_t *list)
 
static void _add_cell_data_func (GtkTreeViewColumn *col __attribute__((unused)), GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer data)
 
static void _shape_manager_sync_add_sensitivity (const dt_shape_manager_t *lm)
 
static void _tree_name_editing_done (GtkCellEditable *editable __attribute__((unused)), dt_shape_manager_t *lm)
 
static void _tree_name_caret_to_end (GtkWidget *editable, gpointer user_data __attribute__((unused)))
 
static void _tree_name_editing_started (GtkCellRenderer *renderer __attribute__((unused)), GtkCellEditable *editable, const gchar *path __attribute__((unused)), dt_shape_manager_list_t *list)
 
static void _tree_start_name_editing (const dt_shape_manager_list_t *list, GtkTreeModel *model, GtkTreeIter *iter, GtkTreePath *path, const gboolean cursor_at_end)
 
static gboolean _tree_edit_group_name_idle (gpointer user_data)
 
static void _modchooser_toggled (GtkCellRendererToggle *cell __attribute__((unused)), const gchar *path_string, GtkListStore *store)
 
static gboolean _modchooser_button_pressed (GtkWidget *treeview, const GdkEventButton *event, GtkListStore *store)
 
static gboolean _modchooser_button_press (GtkWidget *dialog, const GdkEventButton *event, gpointer user_data __attribute__((unused)))
 
static void _modchooser_collect (GtkListStore *store, GList **to_attach, GList **to_detach)
 
static gboolean _modchooser_run (const dt_masks_form_t *form, GList **to_attach, GList **to_detach)
 
static dt_masks_form_t_module_create_own_mask (dt_develop_t *dev, dt_iop_module_t *module, int *own_id)
 
static void _tree_row_assign_to_modules (dt_shape_manager_list_t *list, GtkTreeModel *model, GtkTreeIter *iter)
 
static void _tree_row_add_to_group (dt_shape_manager_list_t *list, GtkTreeModel *model, GtkTreeIter *iter)
 
static void _tree_row_action (dt_shape_manager_list_t *list, GtkTreeModel *model, GtkTreeIter *iter)
 
static void _tree_duplicate_shape (GtkButton *button __attribute__((unused)), dt_shape_manager_list_t *list)
 
static void _tree_cell_edited (GtkCellRendererText *cell __attribute__((unused)), const gchar *path_string, const gchar *new_text, dt_shape_manager_list_t *list)
 
static void _show_masks_on_owning_module (GtkTreeModel *model, GtkTreeIter *iter)
 
static void _tree_selection_change (GtkTreeSelection *selection, dt_shape_manager_list_t *list)
 
static void _menu_append_separator (GtkMenuShell *menu)
 
static void _menu_append_new_shape_submenu (GtkMenuShell *menu, dt_iop_module_t *module)
 
static void _menu_append_existing_shapes (GtkMenuShell *menu, dt_masks_form_t *grp, const int grpid, dt_iop_module_t *module)
 
static void _menu_append_join_group (GtkMenuShell *menu, dt_shape_manager_list_t *list)
 
static void _menu_append_operations (GtkMenuShell *menu, dt_shape_manager_list_t *list, const int nb)
 
static GtkWidget_tree_context_menu (GtkTreeSelection *selection, GtkTreeModel *model, dt_shape_manager_list_t *list, dt_iop_module_t *module)
 
static int _tree_apply_click_selection (GtkWidget *treeview, GtkTreeSelection *selection, const GdkEventButton *event, GtkTreePath *mouse_path)
 
static int _tree_button_pressed (GtkWidget *treeview, GdkEventButton *event, dt_shape_manager_list_t *list)
 
static void _tree_row_activated (GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *column, dt_shape_manager_list_t *list)
 
static gboolean _tree_restrict_select (GtkTreeSelection *selection, GtkTreeModel *model __attribute__((unused)), GtkTreePath *path, gboolean path_currently_selected, gpointer data)
 
static const char * _tooltip_action_text (const int grid)
 
static gchar * _tooltip_assign_text (GtkTreeModel *model, GtkTreeIter *iter)
 
static gchar * _tooltip_add_text (const dt_shape_manager_t *lm, GtkTreeModel *model, GtkTreeIter *iter)
 
static gboolean _tree_button_tooltip (const dt_shape_manager_list_t *list, GtkTreeView *tree_view, const gint x, const gint y, GtkTooltip *tooltip)
 
static gboolean _tree_query_tooltip (GtkWidget *widget, gint x, gint y, gboolean keyboard_tip, GtkTooltip *tooltip, gpointer data)
 
static void _groups_naming_form (const int formid, const dt_masks_form_t *grp, char *text, const size_t text_length, int *nb)
 
static void _is_form_used (const int formid, char *text, const size_t text_length, int *nb)
 
static dt_iop_module_t_module_owning_group (const dt_masks_form_t *group)
 
static void _tree_append_row (GtkTreeStore *treestore, GtkTreeIter *toplevel, dt_shape_manager_t *lm, const _tree_row_t *row, GtkTreeIter *child)
 
static void _shape_manager_list_recurs (GtkTreeStore *treestore, GtkTreeIter *toplevel, dt_shape_manager_t *lm, const _tree_row_t *row)
 
gboolean _find_mask_iter_by_values (GtkTreeModel *model, GtkTreeIter *iter, const dt_iop_module_t *module, const int formid, const int level)
 
GList * _shape_manager_get_selected (dt_shape_manager_list_t *list)
 
static void _tree_reveal_row (dt_shape_manager_list_t *list, GtkTreeModel *model, GtkTreeIter *iter, const gboolean exclusive)
 
static gboolean _group_is_module_mask (const dt_masks_form_t *form)
 
static gboolean _tree_store_append_group_row (GtkTreeStore *treestore, dt_shape_manager_t *lm, dt_masks_form_t *form, const gboolean is_module_mask, const gboolean flat)
 
static gboolean _tree_store_add_forms (GtkTreeStore *treestore, dt_shape_manager_t *lm, const dt_shape_list_t which, const gboolean groups)
 
static gboolean _tree_row_is_separator (GtkTreeModel *model, GtkTreeIter *iter, gpointer data __attribute__((unused)))
 
static GtkTreeStore * _tree_store_new (void)
 
static GtkTreeStore * _tree_store_build (dt_shape_manager_t *lm, const dt_shape_list_t which)
 
static void _tree_restore_selection (dt_shape_manager_list_t *list, GtkTreeModel *model, const GList *selectids)
 
static gboolean _tree_select_module_group (dt_shape_manager_list_t *list, GtkTreeModel *model, const dt_masks_form_gui_t *gui)
 
static gboolean _shape_manager_is_active (void)
 
static void _shape_manager_update_item (dt_lib_module_t *self __attribute__((unused)), int formid, int parentid, dt_shape_manager_t *lm, GtkTreeModel *model, GtkTreeIter *iter)
 
static gboolean _update_foreach (GtkTreeModel *model, GtkTreePath *path __attribute__((unused)), GtkTreeIter *iter, gpointer data)
 
static gboolean _remove_foreach (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
 
static void _shape_manager_remove_item_from (const dt_shape_manager_list_t *list, int formid, int parentid)
 
static void _shape_manager_remove_item (dt_lib_module_t *self, int formid, int parentid)
 
static gboolean _shape_manager_selection_change_r (GtkTreeModel *model, GtkTreeSelection *selection, GtkTreeIter *iter, struct dt_iop_module_t *module, const int selectid, int throw_event, const int level)
 
static gboolean _shape_manager_selection_change_in (dt_shape_manager_t *lm, const dt_shape_manager_list_t *list, struct dt_iop_module_t *module, const int selectid, const int throw_event)
 
static void _shape_manager_selection_change (dt_lib_module_t *self, struct dt_iop_module_t *module, const int selectid, const int throw_event)
 
static gboolean _find_child_iter_by_formid (GtkTreeModel *model, GtkTreeIter *parent_iter, int formid, GtkTreeIter *child_iter)
 
static gboolean _find_iter_by_parentid_and_formid (GtkTreeModel *model, int parentid, int formid, GtkTreeIter *iter)
 
static gboolean _shape_manager_refresh_row (dt_lib_module_t *self, dt_shape_manager_t *lm, const int formid, const int parentid, const dt_masks_event_t event)
 
static void _shape_manager_handler_callback (gpointer instance __attribute__((unused)), const int formid, const int parentid, const dt_masks_event_t event, dt_lib_module_t *self)
 
static void _shape_manager_view_changed (gpointer instance __attribute__((unused)), dt_view_t *old_view __attribute__((unused)), dt_view_t *new_view __attribute__((unused)), dt_lib_module_t *self)
 
static void _shape_manager_modules_moved (gpointer instance __attribute__((unused)), dt_lib_module_t *self)
 
static gboolean _shape_manager_popup_position_is_usable (GtkWidget *window)
 Is this window on a backend where absolute coordinates mean anything? Wayland gives a client neither its own position nor the right to set it, so there we remember the width only.
 
static void _shape_manager_popup_save_geometry (dt_shape_manager_t *d)
 Remember where the user put the panel and how wide they made it. Called on every path that takes the window off screen, since a hidden window no longer has a position to read.
 
static void _shape_manager_popup_restore_geometry (dt_shape_manager_t *d)
 Put the panel back where it was left, before it is mapped. With nothing stored – first run, or a session that never moved it – nothing is imposed and GTK_WIN_POS_CENTER_ON_PARENT still decides, which is what puts the window on the screen the application is on.
 
static gint _shape_manager_height_ceiling (void)
 The toolbox button is the panel's only state: showing and hiding both go through its active flag, so every way of closing the panel leaves the button un-pressed. Re-entrant by design – the window-manager close path toggles the button, which comes back here.
 
static void _shape_manager_relax_height_caps (const dt_shape_manager_t *d)
 Forget how far the user last dragged each list, so the auto-sizing pass that follows measures true, full content instead of stopping at a small stale cap from a previous session.
 
static void _shape_manager_popup_button_toggled_cb (GtkWidget *button, gpointer user_data)
 
static gboolean _shape_manager_popup_delete_cb (GtkWidget *window __attribute__((unused)), GdkEvent *event __attribute__((unused)), gpointer user_data)
 Closing from the window manager hides the panel, same as the toolbox button, so its widgets and state survive. Un-pressing the button is what actually hides the window (and saves the geometry before it goes), so the two ways of closing cannot disagree.
 
static gboolean _shape_manager_is_window_visible (dt_lib_module_t *self)
 
static gboolean _shape_manager_add_popup_button_idle (gpointer user_data)
 
void gui_init (dt_lib_module_t *self)
 
void gui_cleanup (dt_lib_module_t *self)
 

Macro Definition Documentation

◆ DT_MASKS_PANEL_CONF_WIDTH

#define DT_MASKS_PANEL_CONF_WIDTH   "plugins/darkroom/masks/windowwidth"

Definition at line 3148 of file libs/shape_manager.c.

◆ DT_MASKS_PANEL_CONF_X

#define DT_MASKS_PANEL_CONF_X   "plugins/darkroom/masks/window_x"

Definition at line 3149 of file libs/shape_manager.c.

◆ DT_MASKS_PANEL_CONF_Y

#define DT_MASKS_PANEL_CONF_Y   "plugins/darkroom/masks/window_y"

Definition at line 3150 of file libs/shape_manager.c.

Typedef Documentation

◆ _tree_row_t

typedef struct _tree_row_t _tree_row_t

◆ dt_masks_tree_cols_t

◆ dt_modchooser_col_t

◆ dt_shape_list_t

◆ dt_shape_manager_list_t

◆ dt_shape_manager_t

Enumeration Type Documentation

◆ dt_masks_tree_cols_t

Enumerator
TREE_TEXT 
TREE_MODULE 
TREE_GROUPID 
TREE_FORMID 
TREE_EDITABLE 
TREE_IC_OP 
TREE_IC_OP_VISIBLE 
TREE_IC_INVERSE 
TREE_IC_INVERSE_VISIBLE 
TREE_IC_USED_VISIBLE 
TREE_USED_TEXT 
TREE_IC_DELETE_VISIBLE 
TREE_IC_UNLINK_VISIBLE 
TREE_NOTE 
TREE_STRIKE 
TREE_IS_SEPARATOR 
TREE_COUNT 

Definition at line 190 of file libs/shape_manager.c.

◆ dt_modchooser_col_t

Enumerator
MODCHOOSER_CHECKED 
MODCHOOSER_WAS_CHECKED 
MODCHOOSER_SENSITIVE 
MODCHOOSER_NAME 
MODCHOOSER_NOTE 
MODCHOOSER_MODULE 
MODCHOOSER_COUNT 

Definition at line 1005 of file libs/shape_manager.c.

◆ dt_shape_list_t

Enumerator
DT_SHAPE_LIST_SHAPES 
DT_SHAPE_LIST_MODULES 
DT_SHAPE_LIST_COUNT 

Definition at line 93 of file libs/shape_manager.c.

Function Documentation

◆ _add_cell_data_func()

static void _add_cell_data_func ( GtkTreeViewColumn *col   __attribute__(unused),
GtkCellRenderer *  renderer,
GtkTreeModel *  model,
GtkTreeIter *  iter,
gpointer  data 
)
static

◆ _add_masks_history_item()

◆ _find_child_iter_by_formid()

static gboolean _find_child_iter_by_formid ( GtkTreeModel *  model,
GtkTreeIter *  parent_iter,
int  formid,
GtkTreeIter *  child_iter 
)
static

Definition at line 2987 of file libs/shape_manager.c.

References FALSE, model, TREE_FORMID, and TRUE.

Referenced by _find_iter_by_parentid_and_formid().

◆ _find_iter_by_parentid_and_formid()

static gboolean _find_iter_by_parentid_and_formid ( GtkTreeModel *  model,
int  parentid,
int  formid,
GtkTreeIter *  iter 
)
static

Definition at line 3012 of file libs/shape_manager.c.

References _find_child_iter_by_formid(), FALSE, model, and TREE_FORMID.

Referenced by _shape_manager_refresh_row().

◆ _find_mask_iter_by_values()

gboolean _find_mask_iter_by_values ( GtkTreeModel *  model,
GtkTreeIter *  iter,
const dt_iop_module_t module,
const int  formid,
const int  level 
)

◆ _form_can_join_group()

◆ _group_is_module_mask()

static gboolean _group_is_module_mask ( const dt_masks_form_t form)
static

◆ _groups_naming_form()

static void _groups_naming_form ( const int  formid,
const dt_masks_form_t grp,
char *  text,
const size_t  text_length,
int *  nb 
)
static

◆ _is_form_used()

static void _is_form_used ( const int  formid,
char *  text,
const size_t  text_length,
int *  nb 
)
static

◆ _menu_append_existing_shapes()

static void _menu_append_existing_shapes ( GtkMenuShell *  menu,
dt_masks_form_t grp,
const int  grpid,
dt_iop_module_t module 
)
static

◆ _menu_append_join_group()

static void _menu_append_join_group ( GtkMenuShell *  menu,
dt_shape_manager_list_t list 
)
static

◆ _menu_append_new_shape_submenu()

static void _menu_append_new_shape_submenu ( GtkMenuShell *  menu,
dt_iop_module_t module 
)
static

◆ _menu_append_operations()

◆ _menu_append_separator()

static void _menu_append_separator ( GtkMenuShell *  menu)
static

Definition at line 1633 of file libs/shape_manager.c.

References IS_NULL_PTR.

Referenced by _menu_append_operations(), and _tree_context_menu().

◆ _modchooser_button_press()

static gboolean _modchooser_button_press ( GtkWidget dialog,
const GdkEventButton *  event,
gpointer user_data   __attribute__(unused) 
)
static

Definition at line 1061 of file libs/shape_manager.c.

References FALSE, IS_NULL_PTR, and TRUE.

Referenced by _modchooser_run().

◆ _modchooser_button_pressed()

static gboolean _modchooser_button_pressed ( GtkWidget treeview,
const GdkEventButton *  event,
GtkListStore *  store 
)
static

Definition at line 1034 of file libs/shape_manager.c.

References _modchooser_toggled(), dt_free, FALSE, store, and TRUE.

Referenced by _modchooser_run().

◆ _modchooser_collect()

static void _modchooser_collect ( GtkListStore *  store,
GList **  to_attach,
GList **  to_detach 
)
static

◆ _modchooser_run()

◆ _modchooser_toggled()

static void _modchooser_toggled ( GtkCellRendererToggle *cell   __attribute__(unused),
const gchar *  path_string,
GtkListStore *  store 
)
static

◆ _module_create_own_mask()

◆ _module_owning_group()

static dt_iop_module_t * _module_owning_group ( const dt_masks_form_t group)
static

Definition at line 2297 of file libs/shape_manager.c.

References _modules_owning_group(), and IS_NULL_PTR.

Referenced by _shape_manager_list_recurs().

◆ _modules_owning_group()

◆ _refresh_owning_modules()

static void _refresh_owning_modules ( const dt_masks_form_t grp)
static

◆ _remove_foreach()

static gboolean _remove_foreach ( GtkTreeModel *  model,
GtkTreePath *  path,
GtkTreeIter *  iter,
gpointer  data 
)
static

Definition at line 2833 of file libs/shape_manager.c.

References _shape_manager_get_values(), IS_NULL_PTR, and model.

Referenced by _shape_manager_remove_item_from().

◆ _row_can_be_added()

static gboolean _row_can_be_added ( const dt_shape_manager_t lm,
GtkTreeModel *  model,
GtkTreeIter *  iter 
)
static

◆ _selected_form_ids()

static GList * _selected_form_ids ( dt_shape_manager_list_t list)
static

◆ _selected_group_in_module_list()

static int _selected_group_in_module_list ( const dt_shape_manager_t lm)
static

◆ _set_iter_name()

◆ _shape_manager_add_popup_button_idle()

static gboolean _shape_manager_add_popup_button_idle ( gpointer  user_data)
static

◆ _shape_manager_broadcast()

◆ _shape_manager_get_selected()

GList * _shape_manager_get_selected ( dt_shape_manager_list_t list)

◆ _shape_manager_get_values()

◆ _shape_manager_handler_callback()

◆ _shape_manager_height_ceiling()

static gint _shape_manager_height_ceiling ( void  )
static

The toolbox button is the panel's only state: showing and hiding both go through its active flag, so every way of closing the panel leaves the button un-pressed. Re-entrant by design – the window-manager close path toggles the button, which comes back here.

The room a fresh, un-dragged dt_ui_scroll_wrap area is allowed to grow to – the same ceiling scroll_wrap.c's own ungated case uses, so raising a list's cap to this number is indistinguishable from that list never having been dragged at all.

Definition at line 3240 of file libs/shape_manager.c.

References DT_PIXEL_APPLY_DPI, and dt_widget_root_window().

Referenced by _shape_manager_relax_height_caps().

◆ _shape_manager_is_active()

static gboolean _shape_manager_is_active ( void  )
static

◆ _shape_manager_is_window_visible()

static gboolean _shape_manager_is_window_visible ( dt_lib_module_t self)
static

Definition at line 3306 of file libs/shape_manager.c.

References d, dt_lib_module_t::data, FALSE, and IS_NULL_PTR.

Referenced by gui_init().

◆ _shape_manager_list_recurs()

◆ _shape_manager_modules_moved()

static void _shape_manager_modules_moved ( gpointer instance   __attribute__(unused),
dt_lib_module_t self 
)
static

Definition at line 3141 of file libs/shape_manager.c.

References _shape_manager_recreate_list().

Referenced by gui_cleanup(), and gui_init().

◆ _shape_manager_popup_button_toggled_cb()

static void _shape_manager_popup_button_toggled_cb ( GtkWidget button,
gpointer  user_data 
)
static

◆ _shape_manager_popup_delete_cb()

static gboolean _shape_manager_popup_delete_cb ( GtkWidget *window   __attribute__(unused),
GdkEvent *event   __attribute__(unused),
gpointer  user_data 
)
static

Closing from the window manager hides the panel, same as the toolbox button, so its widgets and state survive. Un-pressing the button is what actually hides the window (and saves the geometry before it goes), so the two ways of closing cannot disagree.

Definition at line 3292 of file libs/shape_manager.c.

References d, FALSE, and TRUE.

Referenced by gui_init().

◆ _shape_manager_popup_position_is_usable()

static gboolean _shape_manager_popup_position_is_usable ( GtkWidget window)
static

Is this window on a backend where absolute coordinates mean anything? Wayland gives a client neither its own position nor the right to set it, so there we remember the width only.

Definition at line 3154 of file libs/shape_manager.c.

References TRUE, and window.

Referenced by _shape_manager_popup_restore_geometry(), and _shape_manager_popup_save_geometry().

◆ _shape_manager_popup_restore_geometry()

static void _shape_manager_popup_restore_geometry ( dt_shape_manager_t d)
static

Put the panel back where it was left, before it is mapped. With nothing stored – first run, or a session that never moved it – nothing is imposed and GTK_WIN_POS_CENTER_ON_PARENT still decides, which is what puts the window on the screen the application is on.

Definition at line 3186 of file libs/shape_manager.c.

References _shape_manager_popup_position_is_usable(), d, dt_conf_get_int(), dt_conf_key_exists(), DT_MASKS_PANEL_CONF_WIDTH, DT_MASKS_PANEL_CONF_X, DT_MASKS_PANEL_CONF_Y, height, IS_NULL_PTR, MAX, width, and x.

Referenced by _shape_manager_popup_button_toggled_cb().

◆ _shape_manager_popup_save_geometry()

static void _shape_manager_popup_save_geometry ( dt_shape_manager_t d)
static

Remember where the user put the panel and how wide they made it. Called on every path that takes the window off screen, since a hidden window no longer has a position to read.

Definition at line 3165 of file libs/shape_manager.c.

References _shape_manager_popup_position_is_usable(), d, dt_conf_set_int(), DT_MASKS_PANEL_CONF_WIDTH, DT_MASKS_PANEL_CONF_X, DT_MASKS_PANEL_CONF_Y, height, width, and x.

Referenced by _shape_manager_popup_button_toggled_cb(), and gui_cleanup().

◆ _shape_manager_recreate_list()

◆ _shape_manager_refresh_row()

static gboolean _shape_manager_refresh_row ( dt_lib_module_t self,
dt_shape_manager_t lm,
const int  formid,
const int  parentid,
const dt_masks_event_t  event 
)
static

◆ _shape_manager_relax_height_caps()

static void _shape_manager_relax_height_caps ( const dt_shape_manager_t d)
static

Forget how far the user last dragged each list, so the auto-sizing pass that follows measures true, full content instead of stopping at a small stale cap from a previous session.

There is no "erase this conf key" call, so the ceiling itself is stored in its place: as far as dt_ui_scroll_wrap()'s own sizing rule can tell, that is exactly what an un-dragged list looks like. A later manual drag overwrites it with a real choice again, same as always – this only resets what STARTUP sees.

Definition at line 3253 of file libs/shape_manager.c.

References _shape_manager_height_ceiling(), d, DT_SHAPE_LIST_COUNT, dt_widget_store_int(), dt_shape_manager_list_t::height_key, i, and IS_NULL_PTR.

Referenced by _shape_manager_popup_button_toggled_cb().

◆ _shape_manager_remove_item()

static void _shape_manager_remove_item ( dt_lib_module_t self,
int  formid,
int  parentid 
)
static

◆ _shape_manager_remove_item_from()

static void _shape_manager_remove_item_from ( const dt_shape_manager_list_t list,
int  formid,
int  parentid 
)
static

◆ _shape_manager_selection_change()

static void _shape_manager_selection_change ( dt_lib_module_t self,
struct dt_iop_module_t module,
const int  selectid,
const int  throw_event 
)
static

◆ _shape_manager_selection_change_in()

static gboolean _shape_manager_selection_change_in ( dt_shape_manager_t lm,
const dt_shape_manager_list_t list,
struct dt_iop_module_t module,
const int  selectid,
const int  throw_event 
)
static

◆ _shape_manager_selection_change_r()

static gboolean _shape_manager_selection_change_r ( GtkTreeModel *  model,
GtkTreeSelection *  selection,
GtkTreeIter *  iter,
struct dt_iop_module_t module,
const int  selectid,
int  throw_event,
const int  level 
)
static

◆ _shape_manager_shape_button_started()

static void _shape_manager_shape_button_started ( GtkWidget *button   __attribute__(unused),
dt_iop_module_t *module   __attribute__(unused),
dt_masks_type_t type   __attribute__(unused),
gpointer user_data   __attribute__(unused) 
)
static

◆ _shape_manager_sync_add_sensitivity()

◆ _shape_manager_update_item()

static void _shape_manager_update_item ( dt_lib_module_t *self   __attribute__(unused),
int  formid,
int  parentid,
dt_shape_manager_t lm,
GtkTreeModel *  model,
GtkTreeIter *  iter 
)
static

◆ _shape_manager_update_list()

static void _shape_manager_update_list ( dt_lib_module_t self)
static

◆ _shape_manager_view_changed()

static void _shape_manager_view_changed ( gpointer instance   __attribute__(unused),
dt_view_t *old_view   __attribute__(unused),
dt_view_t *new_view   __attribute__(unused),
dt_lib_module_t self 
)
static

Definition at line 3131 of file libs/shape_manager.c.

References _shape_manager_recreate_list().

Referenced by gui_cleanup(), and gui_init().

◆ _show_masks_on_owning_module()

static void _show_masks_on_owning_module ( GtkTreeModel *  model,
GtkTreeIter *  iter 
)
static

◆ _tooltip_action_text()

static const char * _tooltip_action_text ( const int  grid)
static

Definition at line 2095 of file libs/shape_manager.c.

Referenced by _tree_button_tooltip().

◆ _tooltip_add_text()

static gchar * _tooltip_add_text ( const dt_shape_manager_t lm,
GtkTreeModel *  model,
GtkTreeIter *  iter 
)
static

◆ _tooltip_assign_text()

static gchar * _tooltip_assign_text ( GtkTreeModel *  model,
GtkTreeIter *  iter 
)
static

◆ _tree_add_exist()

◆ _tree_add_shape()

◆ _tree_add_shape_menu_item()

static void _tree_add_shape_menu_item ( GtkWidget menu,
const dt_masks_type_t  type,
dt_iop_module_t module 
)
static

◆ _tree_add_to_group()

◆ _tree_append_row()

◆ _tree_apply_click_selection()

static int _tree_apply_click_selection ( GtkWidget treeview,
GtkTreeSelection *  selection,
const GdkEventButton *  event,
GtkTreePath *  mouse_path 
)
static

Definition at line 1913 of file libs/shape_manager.c.

References dt_modifier_is(), DT_PRIMARY_MASK, and IS_NULL_PTR.

Referenced by _tree_button_pressed().

◆ _tree_apply_operation()

◆ _tree_button_pressed()

◆ _tree_button_tooltip()

static gboolean _tree_button_tooltip ( const dt_shape_manager_list_t list,
GtkTreeView *  tree_view,
const gint  x,
const gint  y,
GtkTooltip *  tooltip 
)
static

◆ _tree_cell_edited()

static void _tree_cell_edited ( GtkCellRendererText *cell   __attribute__(unused),
const gchar *  path_string,
const gchar *  new_text,
dt_shape_manager_list_t list 
)
static

◆ _tree_context_menu()

◆ _tree_delete_shape()

◆ _tree_delete_unused()

◆ _tree_duplicate_shape()

◆ _tree_edit_group_name()

static void _tree_edit_group_name ( dt_lib_module_t self,
dt_shape_list_t  which,
int  formid,
gboolean  cursor_at_end 
)
static

◆ _tree_edit_group_name_idle()

◆ _tree_format_form_usage_label()

static int _tree_format_form_usage_label ( char *  str,
const size_t  str_size,
const dt_masks_form_t form,
const dt_iop_module_t module 
)
static

◆ _tree_group()

◆ _tree_movedown()

◆ _tree_moveup()

◆ _tree_name_caret_to_end()

static void _tree_name_caret_to_end ( GtkWidget editable,
gpointer user_data   __attribute__(unused) 
)
static

◆ _tree_name_editing_done()

static void _tree_name_editing_done ( GtkCellEditable *editable   __attribute__(unused),
dt_shape_manager_t lm 
)
static

◆ _tree_name_editing_started()

static void _tree_name_editing_started ( GtkCellRenderer *renderer   __attribute__(unused),
GtkCellEditable *  editable,
const gchar *path   __attribute__(unused),
dt_shape_manager_list_t list 
)
static

◆ _tree_query_tooltip()

static gboolean _tree_query_tooltip ( GtkWidget widget,
gint  x,
gint  y,
gboolean  keyboard_tip,
GtkTooltip *  tooltip,
gpointer  data 
)
static

◆ _tree_restore_selection()

static void _tree_restore_selection ( dt_shape_manager_list_t list,
GtkTreeModel *  model,
const GList *  selectids 
)
static

◆ _tree_restrict_select()

static gboolean _tree_restrict_select ( GtkTreeSelection *  selection,
GtkTreeModel *model   __attribute__(unused),
GtkTreePath *  path,
gboolean  path_currently_selected,
gpointer  data 
)
static

Definition at line 2049 of file libs/shape_manager.c.

References dt_shape_manager_t::gui_reset, items, and TRUE.

Referenced by gui_init().

◆ _tree_reveal_row()

static void _tree_reveal_row ( dt_shape_manager_list_t list,
GtkTreeModel *  model,
GtkTreeIter *  iter,
const gboolean  exclusive 
)
static

◆ _tree_root_formid()

static int _tree_root_formid ( GtkTreeModel *  model,
GtkTreeIter  iter 
)
static

Definition at line 717 of file libs/shape_manager.c.

References model, and TREE_FORMID.

Referenced by _selected_group_in_module_list().

◆ _tree_row_action()

◆ _tree_row_activated()

static void _tree_row_activated ( GtkTreeView *  treeview,
GtkTreePath *  path,
GtkTreeViewColumn *  column,
dt_shape_manager_list_t list 
)
static

Definition at line 2036 of file libs/shape_manager.c.

References _tree_start_name_editing(), FALSE, model, and dt_shape_manager_list_t::name_col.

Referenced by gui_init().

◆ _tree_row_add_to_group()

◆ _tree_row_assign_to_modules()

◆ _tree_row_is_separator()

static gboolean _tree_row_is_separator ( GtkTreeModel *  model,
GtkTreeIter *  iter,
gpointer data   __attribute__(unused) 
)
static

Definition at line 2568 of file libs/shape_manager.c.

References FALSE, model, and TREE_IS_SEPARATOR.

Referenced by gui_init().

◆ _tree_select_module_group()

static gboolean _tree_select_module_group ( dt_shape_manager_list_t list,
GtkTreeModel *  model,
const dt_masks_form_gui_t gui 
)
static

◆ _tree_selection_change()

◆ _tree_start_name_editing()

static void _tree_start_name_editing ( const dt_shape_manager_list_t list,
GtkTreeModel *  model,
GtkTreeIter *  iter,
GtkTreePath *  path,
const gboolean  cursor_at_end 
)
static

◆ _tree_store_add_forms()

◆ _tree_store_append_group_row()

static gboolean _tree_store_append_group_row ( GtkTreeStore *  treestore,
dt_shape_manager_t lm,
dt_masks_form_t form,
const gboolean  is_module_mask,
const gboolean  flat 
)
static

◆ _tree_store_build()

static GtkTreeStore * _tree_store_build ( dt_shape_manager_t lm,
const dt_shape_list_t  which 
)
static

◆ _tree_store_new()

static GtkTreeStore * _tree_store_new ( void  )
static

Definition at line 2577 of file libs/shape_manager.c.

References TREE_COUNT.

Referenced by _shape_manager_recreate_list(), and _tree_store_build().

◆ _update_foreach()

static gboolean _update_foreach ( GtkTreeModel *  model,
GtkTreePath *path   __attribute__(unused),
GtkTreeIter *  iter,
gpointer  data 
)
static

◆ container()

uint32_t container ( dt_lib_module_t *self   __attribute__(unused))

Definition at line 185 of file libs/shape_manager.c.

References DT_UI_CONTAINER_SIZE.

◆ gui_cleanup()

◆ gui_init()

void gui_init ( dt_lib_module_t self)

Definition at line 3326 of file libs/shape_manager.c.

References _add_cell_data_func(), _shape_manager_add_popup_button_idle(), _shape_manager_handler_callback(), _shape_manager_is_window_visible(), _shape_manager_modules_moved(), _shape_manager_popup_button_toggled_cb(), _shape_manager_popup_delete_cb(), _shape_manager_recreate_list(), _shape_manager_remove_item(), _shape_manager_selection_change(), _shape_manager_shape_button_started(), _shape_manager_update_list(), _shape_manager_view_changed(), _tree_button_pressed(), _tree_cell_edited(), _tree_name_editing_started(), _tree_query_tooltip(), _tree_restrict_select(), _tree_row_activated(), _tree_row_is_separator(), _tree_selection_change(), dt_shape_manager_list_t::action_col, dt_shape_manager_list_t::add_col, dt_shape_manager_list_t::assign_col, d, dt_lib_module_t::data, dt_masks_shape_buttons_config_t::dev, dt_control_signal_get_global(), DT_DEBUG_CONTROL_SIGNAL_CONNECT, dt_dev_get_global(), dt_draw_get_pixbuf_from_cairo(), DT_GUI_BOX_SPACING, dt_gui_main_window(), dt_gui_symbolic_icon_pixbuf(), DT_MASKS_SHAPE_BUTTONS_ALL, dt_masks_shape_buttons_create(), DT_MASKS_SHAPE_BUTTONS_NONE, dt_osx_disallow_fullscreen(), DT_PIXEL_APPLY_DPI, DT_SHAPE_LIST_COUNT, DT_SHAPE_LIST_MODULES, DT_SHAPE_LIST_SHAPES, DT_SIGNAL_DEVELOP_MODULE_MOVED, DT_SIGNAL_MASK_CHANGED, DT_SIGNAL_VIEWMANAGER_VIEW_CHANGED, DT_UI_RESIZE_DYNAMIC, dt_ui_scroll_wrap(), dt_ui_scroll_wrap_get_scrolled_window(), dt_ui_scroll_wrap_reserve_trailing_row(), dt_ui_section_label_new(), dtgtk_cairo_paint_masks_difference(), dtgtk_cairo_paint_masks_drawn(), dtgtk_cairo_paint_masks_exclusion(), dtgtk_cairo_paint_masks_intersection(), dtgtk_cairo_paint_masks_inverse(), dtgtk_cairo_paint_masks_union(), dtgtk_togglebutton_new(), FALSE, dt_shape_manager_list_t::height_key, i, IS_NULL_PTR, dt_develop_t::is_visible, dt_develop_t::list_change, dt_develop_t::list_remove, dt_develop_t::list_update, dt_develop_t::masks, dt_shape_manager_list_t::name_col, dt_shape_manager_list_t::name_renderer, dt_develop_t::proxy, scrolled(), dt_develop_t::selection_change, dt_shape_manager_list_t::self, tooltip, TREE_IC_DELETE_VISIBLE, TREE_IC_INVERSE, TREE_IC_INVERSE_VISIBLE, TREE_IC_OP, TREE_IC_OP_VISIBLE, TREE_IC_UNLINK_VISIBLE, TREE_IC_USED_VISIBLE, TREE_NOTE, TREE_STRIKE, TREE_TEXT, dt_shape_manager_list_t::treeview, TRUE, and dt_shape_manager_list_t::which.

◆ name()

const char * name ( struct dt_lib_module_t *self   __attribute__(unused))

Definition at line 171 of file libs/shape_manager.c.

◆ views()

const char ** views ( dt_lib_module_t *self   __attribute__(unused))

Definition at line 179 of file libs/shape_manager.c.

References v.