Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
filter.c File Reference
#include "common/collection.h"
#include "common/selection.h"
#include "common/darktable.h"
#include "control/conf.h"
#include "control/control.h"
#include "develop/develop.h"
#include "gui/gtk.h"
#include "dtgtk/button.h"
#include "libs/lib.h"
#include "libs/lib_api.h"
#include "bauhaus/bauhaus.h"
+ Include dependency graph for filter.c:

Data Structures

struct  dt_lib_tool_filter_t
 

Macros

#define NB_ITEMS   (sizeof(items) / sizeof(dt_collection_sort_t))
 

Typedefs

typedef struct dt_lib_tool_filter_t dt_lib_tool_filter_t
 

Functions

static void _lib_filter_sort_combobox_changed (GtkWidget *widget, gpointer user_data)
 
static void _lib_filter_reverse_button_changed (GtkDarktableToggleButton *widget, gpointer user_data)
 
static void _lib_filter_update_query (dt_lib_module_t *self, dt_collection_properties_t changed_property)
 
static void _lib_filter_set_tag_order (dt_lib_module_t *self)
 
static void _lib_filter_images_order_change (gpointer instance, int order, dt_lib_module_t *self)
 
static gboolean _show_popover_menu (dt_lib_module_t *self, GtkWidget *w)
 
static int _filter_get_items (const dt_collection_sort_t sort)
 
const char * name (struct dt_lib_module_t *self)
 
const char ** views (dt_lib_module_t *self)
 
uint32_t container (dt_lib_module_t *self)
 
int expandable (dt_lib_module_t *self)
 
int position ()
 
static void _set_widget_dimmed (GtkWidget *widget, const gboolean dimmed)
 
static char * _encode_text_filter (const char *entry)
 
static char * _decode_text_filter (const char *text)
 
static gboolean _text_entry_changed_wait (gpointer user_data)
 
static void _launch_text_query (dt_lib_module_t *self)
 
static void _text_entry_changed (GtkEntry *entry, dt_lib_module_t *self)
 
static void _reset_text_filter (dt_lib_module_t *self)
 
static void _reset_text_entry (GtkButton *button, dt_lib_module_t *self)
 
gboolean _focus_search_action (GtkAccelGroup *accel_group, GObject *accelerable, guint keyval, GdkModifierType modifier, gpointer data)
 
static void _dtgtk_button_set_active (GtkWidget *w, gboolean active)
 
static void _update_colors_filter (dt_lib_module_t *self)
 
static gboolean _colorlabel_clicked (GtkWidget *w, GdkEventButton *e, dt_lib_module_t *self)
 
static void _update_altered_filters (dt_lib_module_t *self)
 
static gboolean _altered_clicked (GtkWidget *w, GdkEventButton *e, dt_lib_module_t *self)
 
static gboolean _unaltered_clicked (GtkWidget *w, GdkEventButton *e, dt_lib_module_t *self)
 
static void _culling_mode (GtkWidget *widget, gpointer data)
 
static void _refresh_collection_callback (GtkButton *button, gpointer user_data)
 
void _widget_align_left (GtkWidget *widget)
 
static void _update_rating_filter (dt_lib_module_t *self)
 
static gboolean _rating_clicked (GtkWidget *w, GdkEventButton *e, dt_lib_module_t *self)
 
static void _select_all_callback (GtkWidget *widget, dt_lib_module_t *self)
 
static void _select_none_callback (GtkWidget *widget, dt_lib_module_t *self)
 
void gui_init (dt_lib_module_t *self)
 
void gui_cleanup (dt_lib_module_t *self)
 

Variables

const dt_collection_sort_t items []
 
static const char * _sort_names []
 
const dt_collection_filter_flag_t colors [6]
 
const dt_collection_filter_flag_t ratings [7]
 

Macro Definition Documentation

◆ NB_ITEMS

#define NB_ITEMS   (sizeof(items) / sizeof(dt_collection_sort_t))

Typedef Documentation

◆ dt_lib_tool_filter_t

Function Documentation

◆ _altered_clicked()

◆ _colorlabel_clicked()

◆ _culling_mode()

◆ _decode_text_filter()

static char * _decode_text_filter ( const char *  text)
static

Referenced by gui_init().

◆ _dtgtk_button_set_active()

static void _dtgtk_button_set_active ( GtkWidget *  w,
gboolean  active 
)
static

◆ _encode_text_filter()

static char * _encode_text_filter ( const char *  entry)
static

◆ _filter_get_items()

static int _filter_get_items ( const dt_collection_sort_t  sort)
static

References items, and NB_ITEMS.

Referenced by _lib_filter_images_order_change(), and gui_init().

◆ _focus_search_action()

gboolean _focus_search_action ( GtkAccelGroup *  accel_group,
GObject *  accelerable,
guint  keyval,
GdkModifierType  modifier,
gpointer  data 
)

◆ _launch_text_query()

◆ _lib_filter_images_order_change()

static void _lib_filter_images_order_change ( gpointer  instance,
int  order,
dt_lib_module_t self 
)
static

◆ _lib_filter_reverse_button_changed()

◆ _lib_filter_set_tag_order()

◆ _lib_filter_sort_combobox_changed()

static void _lib_filter_sort_combobox_changed ( GtkWidget *  widget,
gpointer  user_data 
)
static

◆ _lib_filter_update_query()

◆ _rating_clicked()

◆ _refresh_collection_callback()

static void _refresh_collection_callback ( GtkButton *  button,
gpointer  user_data 
)
static

◆ _reset_text_entry()

static void _reset_text_entry ( GtkButton *  button,
dt_lib_module_t self 
)
static

◆ _reset_text_filter()

◆ _select_all_callback()

◆ _select_none_callback()

◆ _set_widget_dimmed()

static void _set_widget_dimmed ( GtkWidget *  widget,
const gboolean  dimmed 
)
static

◆ _show_popover_menu()

static gboolean _show_popover_menu ( dt_lib_module_t self,
GtkWidget *  w 
)
static

show a context menu on right click allowing to reset filters

References dt_lib_module_t::data, dt_lib_tool_filter_t::menu, and TRUE.

Referenced by _altered_clicked(), _colorlabel_clicked(), _rating_clicked(), and _unaltered_clicked().

◆ _text_entry_changed()

static void _text_entry_changed ( GtkEntry *  entry,
dt_lib_module_t self 
)
static

References _launch_text_query().

Referenced by gui_init().

◆ _text_entry_changed_wait()

◆ _unaltered_clicked()

◆ _update_altered_filters()

◆ _update_colors_filter()

◆ _update_rating_filter()

◆ _widget_align_left()

void _widget_align_left ( GtkWidget *  widget)

References FALSE, and TRUE.

Referenced by gui_init().

◆ container()

uint32_t container ( dt_lib_module_t self)

◆ expandable()

int expandable ( dt_lib_module_t self)

◆ gui_cleanup()

◆ gui_init()

void gui_init ( dt_lib_module_t self)

References _altered_clicked(), _colorlabel_clicked(), _culling_mode(), _decode_text_filter(), _filter_get_items(), _focus_search_action(), _lib_filter_images_order_change(), _lib_filter_reverse_button_changed(), _lib_filter_sort_combobox_changed(), _rating_clicked(), _refresh_collection_callback(), _reset_text_entry(), _select_all_callback(), _select_none_callback(), _sort_names, _text_entry_changed(), _unaltered_clicked(), _update_altered_filters(), _update_colors_filter(), _update_rating_filter(), _widget_align_left(), dt_gui_gtk_t::accels, dt_lib_tool_filter_t::altered, darktable_t::collection, dt_lib_tool_filter_t::colors, CPF_DIRECTION_DOWN, CPF_DIRECTION_UP, dt_lib_tool_filter_t::culling, darktable, dt_lib_module_t::data, dt_collection_params_t::descending, dt_accels_build_path(), dt_accels_disconnect_on_text_input(), dt_accels_new_lighttable_action, dt_accels_new_widget_shortcut(), dt_collection_get_sort_descending(), dt_collection_get_sort_field(), dt_collection_get_text_filter(), DT_COLORLABELS_BLUE, DT_COLORLABELS_GREEN, DT_COLORLABELS_LAST, DT_COLORLABELS_PURPLE, DT_COLORLABELS_RED, DT_COLORLABELS_YELLOW, DT_DEBUG_CONTROL_SIGNAL_CONNECT, dt_gui_add_class(), DT_SIGNAL_IMAGES_ORDER_CHANGE, dtgtk_button_new(), dtgtk_cairo_paint_altered(), dtgtk_cairo_paint_label_sel(), dtgtk_cairo_paint_refresh(), dtgtk_cairo_paint_reject(), dtgtk_cairo_paint_sortby(), dtgtk_cairo_paint_star(), dtgtk_cairo_paint_unaltered(), dtgtk_cairo_paint_unratestar(), DTGTK_TOGGLEBUTTON, dtgtk_togglebutton_new(), dtgtk_togglebutton_set_paint(), FALSE, darktable_t::gui, dt_accels_t::lighttable_accels, dt_lib_tool_filter_t::menu, NB_ITEMS, dt_collection_t::params, dt_lib_tool_filter_t::refresh, dt_lib_tool_filter_t::reverse, darktable_t::signals, dt_lib_tool_filter_t::sort, dt_lib_tool_filter_t::stars, dt_lib_tool_filter_t::text, TRUE, dt_lib_tool_filter_t::unaltered, and dt_lib_module_t::widget.

◆ name()

const char * name ( struct dt_lib_module_t self)

◆ position()

int position ( )

◆ views()

const char ** views ( dt_lib_module_t self)

Variable Documentation

◆ _sort_names

const char* _sort_names[]
static
Initial value:
= { N_("filename"),
N_("captured"),
N_("imported"),
N_("modified"),
N_("exported"),
N_("printed"),
N_("rating"),
N_("id"),
N_("color label"),
N_("group"),
N_("full path"),
N_("title"),
NULL }

Referenced by gui_init().

◆ colors

const dt_collection_filter_flag_t colors[6]
Initial value:
=
{
}
@ COLLECTION_FILTER_GREEN
Definition collection.h:52
@ COLLECTION_FILTER_MAGENTA
Definition collection.h:54
@ COLLECTION_FILTER_BLUE
Definition collection.h:53
@ COLLECTION_FILTER_YELLOW
Definition collection.h:51
@ COLLECTION_FILTER_RED
Definition collection.h:50
@ COLLECTION_FILTER_WHITE
Definition collection.h:55

Referenced by _colorlabel_clicked(), _process_vectorscope(), _update_colors_filter(), dt_colorlabels_get_labels(), dt_colorlabels_set_labels(), lin_interpolate(), vng_interpolate(), and wavelet_denoise().

◆ items

const dt_collection_sort_t items[]
Initial value:
=
{
}
@ DT_COLLECTION_SORT_EXPORT_TIMESTAMP
Definition collection.h:65
@ DT_COLLECTION_SORT_IMPORT_TIMESTAMP
Definition collection.h:63
@ DT_COLLECTION_SORT_DATETIME
Definition collection.h:62
@ DT_COLLECTION_SORT_GROUP
Definition collection.h:70
@ DT_COLLECTION_SORT_FILENAME
Definition collection.h:61
@ DT_COLLECTION_SORT_RATING
Definition collection.h:67
@ DT_COLLECTION_SORT_PATH
Definition collection.h:71
@ DT_COLLECTION_SORT_TITLE
Definition collection.h:72
@ DT_COLLECTION_SORT_CHANGE_TIMESTAMP
Definition collection.h:64
@ DT_COLLECTION_SORT_PRINT_TIMESTAMP
Definition collection.h:66
@ DT_COLLECTION_SORT_ID
Definition collection.h:68
@ DT_COLLECTION_SORT_COLOR
Definition collection.h:69

Referenced by _filter_get_items(), _gui_styles_dialog_run(), _gui_styles_select_all_items(), _lib_filter_set_tag_order(), _lib_filter_sort_combobox_changed(), _lib_masks_get_selected(), _tree_delete_shape(), _tree_difference(), _tree_duplicate_shape(), _tree_exclusion(), _tree_group(), _tree_intersection(), _tree_inverse(), _tree_movedown(), _tree_moveup(), _tree_restrict_select(), _tree_selection_change(), _tree_union(), dt_gui_hist_dialog_new(), dt_history_get_items_as_string(), dt_styles_get_item_list_as_string(), dt_util_glist_to_str(), dt_util_glist_uniq(), style_getnumber(), and style_length().

◆ ratings

const dt_collection_filter_flag_t ratings[7]
Initial value:
=
{
@ COLLECTION_FILTER_2_STAR
Definition collection.h:46
@ COLLECTION_FILTER_0_STAR
Definition collection.h:44
@ COLLECTION_FILTER_1_STAR
Definition collection.h:45
@ COLLECTION_FILTER_5_STAR
Definition collection.h:49
@ COLLECTION_FILTER_REJECTED
Definition collection.h:43
@ COLLECTION_FILTER_4_STAR
Definition collection.h:48
@ COLLECTION_FILTER_3_STAR
Definition collection.h:47

Referenced by _pop_undo(), _rating_clicked(), and _update_rating_filter().