Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
supervisor_window.c File Reference
#include "gui/actions/supervisor_window.h"
#include "common/darktable.h"
#include "common/image_cache.h"
#include "common/mipmap_cache.h"
#include "common/opencl.h"
#include "develop/pixelpipe_cache.h"
#include "develop/supervisor.h"
#include "gui/gtk.h"
#include <gtk/gtk.h>
#include <json-glib/json-glib.h>
+ Include dependency graph for supervisor_window.c:

Go to the source code of this file.

Data Structures

struct  _group_t
 

Macros

#define TIMELINE_MAX_ROWS   4000
 
#define POLL_INTERVAL_MS   300
 
#define MEMORY_MAX_ROWS   500
 
#define MEMORY_REFRESH_TICKS   4
 

Typedefs

typedef struct _group_t _group_t
 

Functions

static void _group_free (gpointer p)
 
static gchar * _hashhex (const uint64_t h)
 
static const char * _domain_color (const char *d)
 
static gchar * _pretty_json (const char *compact)
 
static void _run_search (const char *query)
 
static void _scroll_row_into_view (GtkWidget *row)
 
static gboolean _scroll_target_idle (gpointer u)
 
static gboolean _on_link (GtkLabel *label, gchar *uri, gpointer user_data)
 
static void _on_search_this_hash (GtkMenuItem *item, gpointer u)
 
static gboolean _on_label_button (GtkWidget *label, GdkEventButton *e, gpointer u)
 
static void _wire_hash_label (GtkWidget *label)
 
static GtkWidget_event_body_from (const char *json, GArray *links)
 
static void _on_toggle (GtkToggleButton *t, gpointer u)
 
static GtkWidget_collapsible (const char *header_markup, GtkWidget *body, const gboolean expanded)
 
static gchar * _header_markup (const dt_sv_logged_event_t *ev)
 
static void _links_free (gpointer p)
 
static GtkWidget_event_widget (const dt_sv_logged_event_t *ev)
 
static void _timeline_append (const dt_sv_logged_event_t *ev)
 
static void _timeline_trim (void)
 
static void _clear_list (GtkWidget *list)
 
static void _update_count (void)
 
static const char * _group_key (const dt_sv_logged_event_t *ev, const char *by)
 
static void _group_set_header (_group_t *g)
 
static void _grouped_append (const dt_sv_logged_event_t *ev, const char *by)
 
static void _grouped_catch_up (void)
 
static void _rebuild_grouped_now (void)
 
static void _add_usage_bar (GtkWidget *box, const char *title, const size_t cur, const size_t max)
 
static void _add_mem_item (GtkWidget *box, const char *markup, const char *trailing)
 
static gint _cmp_pixel_size (gconstpointer a, gconstpointer b)
 
static gint _cmp_mip_size (gconstpointer a, gconstpointer b)
 
static gint _cmp_image_imgid (gconstpointer a, gconstpointer b)
 
static void _rebuild_memory (void)
 
static gboolean _hex_contains (const uint64_t h, const char *needle)
 
static gboolean _event_matches (const dt_sv_logged_event_t *ev, const char *hash_needle, const char *text_needle)
 
static void _on_search_changed (GtkSearchEntry *e, gpointer u)
 
static gboolean _scroll_bottom_idle (gpointer u)
 
static gboolean _poll (gpointer u)
 
static void _full_reload (void)
 
static void _on_refresh (GtkButton *b, gpointer u)
 
static void _on_clear (GtkButton *b, gpointer u)
 
static void _on_groupby_changed (GtkComboBox *c, gpointer u)
 
static void _on_record_toggled (GtkToggleButton *t, gpointer u)
 
static void _on_page_changed (GtkNotebook *nb, GtkWidget *page, guint page_num, gpointer u)
 
static void _on_destroy (GtkWidget *w, gpointer u)
 
void dt_gui_supervisor_window_show (void)
 

Variables

struct { 
 
   GtkWidget *   window 
 
   GtkWidget *   notebook 
 
   GtkWidget *   timeline_list 
 
   GtkWidget *   timeline_scroll 
 
   GtkWidget *   grouped_list 
 
   GtkWidget *   mem_box 
 
   GtkWidget *   search_entry 
 
   GtkWidget *   search_list 
 
   GtkWidget *   count_label 
 
   GtkWidget *   groupby 
 
   GHashTable *   decl_map 
 
   GHashTable *   group_map 
 
   uint64_t   last_seq 
 
   uint64_t   grouped_last_seq 
 
   gchar *   scroll_target 
 
   guint   timer_id 
 
   guint   tick 
 
   int   page_timeline 
 
   int   page_grouped 
 
   int   page_memory 
 
   int   page_search 
 
_g = { 0 } 
 

Macro Definition Documentation

◆ MEMORY_MAX_ROWS

#define MEMORY_MAX_ROWS   500

Definition at line 35 of file supervisor_window.c.

◆ MEMORY_REFRESH_TICKS

#define MEMORY_REFRESH_TICKS   4

Definition at line 36 of file supervisor_window.c.

◆ POLL_INTERVAL_MS

#define POLL_INTERVAL_MS   300

Definition at line 34 of file supervisor_window.c.

◆ TIMELINE_MAX_ROWS

#define TIMELINE_MAX_ROWS   4000

Definition at line 33 of file supervisor_window.c.

Typedef Documentation

◆ _group_t

typedef struct _group_t _group_t

Function Documentation

◆ _add_mem_item()

static void _add_mem_item ( GtkWidget box,
const char *  markup,
const char *  trailing 
)
static

Definition at line 498 of file supervisor_window.c.

References _wire_hash_label(), FALSE, row, and TRUE.

Referenced by _rebuild_memory().

◆ _add_usage_bar()

static void _add_usage_bar ( GtkWidget box,
const char *  title,
const size_t  cur,
const size_t  max 
)
static

Definition at line 475 of file supervisor_window.c.

References FALSE, max, t, and TRUE.

Referenced by _rebuild_memory().

◆ _clear_list()

static void _clear_list ( GtkWidget list)
static

◆ _cmp_image_imgid()

static gint _cmp_image_imgid ( gconstpointer  a,
gconstpointer  b 
)
static

Definition at line 535 of file supervisor_window.c.

References x.

Referenced by _rebuild_memory().

◆ _cmp_mip_size()

static gint _cmp_mip_size ( gconstpointer  a,
gconstpointer  b 
)
static

Definition at line 529 of file supervisor_window.c.

References x.

Referenced by _rebuild_memory().

◆ _cmp_pixel_size()

static gint _cmp_pixel_size ( gconstpointer  a,
gconstpointer  b 
)
static

Definition at line 523 of file supervisor_window.c.

References x.

Referenced by _rebuild_memory().

◆ _collapsible()

static GtkWidget * _collapsible ( const char *  header_markup,
GtkWidget body,
const gboolean  expanded 
)
static

Definition at line 233 of file supervisor_window.c.

References _on_toggle(), _wire_hash_label(), FALSE, and TRUE.

Referenced by _event_widget(), and _grouped_append().

◆ _domain_color()

static const char * _domain_color ( const char *  d)
static

Definition at line 83 of file supervisor_window.c.

References d.

Referenced by _header_markup().

◆ _event_body_from()

static GtkWidget * _event_body_from ( const char *  json,
GArray *  links 
)
static

◆ _event_matches()

static gboolean _event_matches ( const dt_sv_logged_event_t ev,
const char *  hash_needle,
const char *  text_needle 
)
static

◆ _event_widget()

◆ _full_reload()

static void _full_reload ( void  )
static

◆ _group_free()

static void _group_free ( gpointer  p)
static

Definition at line 70 of file supervisor_window.c.

References g, and p.

Referenced by dt_gui_supervisor_window_show().

◆ _group_key()

static const char * _group_key ( const dt_sv_logged_event_t ev,
const char *  by 
)
static

◆ _group_set_header()

static void _group_set_header ( _group_t g)
static

Definition at line 415 of file supervisor_window.c.

References g.

Referenced by _grouped_append().

◆ _grouped_append()

static void _grouped_append ( const dt_sv_logged_event_t ev,
const char *  by 
)
static

Definition at line 426 of file supervisor_window.c.

References _collapsible(), _event_widget(), _g, _group_key(), _group_set_header(), FALSE, g, k, and row.

Referenced by _grouped_catch_up().

◆ _grouped_catch_up()

static void _grouped_catch_up ( void  )
static

◆ _hashhex()

static gchar * _hashhex ( const uint64_t  h)
static

◆ _header_markup()

◆ _hex_contains()

static gboolean _hex_contains ( const uint64_t  h,
const char *  needle 
)
static

Definition at line 629 of file supervisor_window.c.

References _hashhex(), and m.

Referenced by _event_matches().

◆ _links_free()

static void _links_free ( gpointer  p)
static

Definition at line 335 of file supervisor_window.c.

References p, and TRUE.

Referenced by _event_widget().

◆ _on_clear()

static void _on_clear ( GtkButton *  b,
gpointer  u 
)
static

Definition at line 751 of file supervisor_window.c.

References _full_reload(), and dt_supervisor_events_clear().

Referenced by dt_gui_supervisor_window_show().

◆ _on_destroy()

static void _on_destroy ( GtkWidget w,
gpointer  u 
)
static

Definition at line 777 of file supervisor_window.c.

References _g, dt_supervisor_set_recording(), and FALSE.

Referenced by dt_gui_supervisor_window_show().

◆ _on_groupby_changed()

static void _on_groupby_changed ( GtkComboBox *  c,
gpointer  u 
)
static

Definition at line 757 of file supervisor_window.c.

References _rebuild_grouped_now().

Referenced by dt_gui_supervisor_window_show().

◆ _on_label_button()

static gboolean _on_label_button ( GtkWidget label,
GdkEventButton *  e,
gpointer  u 
)
static

Definition at line 176 of file supervisor_window.c.

References _on_search_this_hash(), FALSE, and TRUE.

Referenced by _wire_hash_label().

◆ _on_link()

static gboolean _on_link ( GtkLabel *  label,
gchar *  uri,
gpointer  user_data 
)
static

Definition at line 145 of file supervisor_window.c.

References _g, _scroll_target_idle(), row, and TRUE.

Referenced by _wire_hash_label().

◆ _on_page_changed()

static void _on_page_changed ( GtkNotebook *  nb,
GtkWidget page,
guint  page_num,
gpointer  u 
)
static

Definition at line 767 of file supervisor_window.c.

References _g, _grouped_catch_up(), _rebuild_memory(), and _run_search().

Referenced by dt_gui_supervisor_window_show().

◆ _on_record_toggled()

static void _on_record_toggled ( GtkToggleButton *  t,
gpointer  u 
)
static

Definition at line 762 of file supervisor_window.c.

References dt_supervisor_set_recording(), and t.

Referenced by dt_gui_supervisor_window_show().

◆ _on_refresh()

static void _on_refresh ( GtkButton *  b,
gpointer  u 
)
static

Definition at line 749 of file supervisor_window.c.

References _full_reload().

Referenced by dt_gui_supervisor_window_show().

◆ _on_search_changed()

static void _on_search_changed ( GtkSearchEntry *  e,
gpointer  u 
)
static

Definition at line 689 of file supervisor_window.c.

References _g, and _run_search().

Referenced by dt_gui_supervisor_window_show().

◆ _on_search_this_hash()

static void _on_search_this_hash ( GtkMenuItem *  item,
gpointer  u 
)
static

Definition at line 165 of file supervisor_window.c.

References _g.

Referenced by _on_label_button().

◆ _on_toggle()

static void _on_toggle ( GtkToggleButton *  t,
gpointer  u 
)
static

Definition at line 206 of file supervisor_window.c.

References _event_body_from(), and t.

Referenced by _collapsible().

◆ _poll()

◆ _pretty_json()

static gchar * _pretty_json ( const char *  compact)
static

Definition at line 97 of file supervisor_window.c.

References g, out, p, and TRUE.

Referenced by _event_body_from().

◆ _rebuild_grouped_now()

static void _rebuild_grouped_now ( void  )
static

Definition at line 465 of file supervisor_window.c.

References _clear_list(), _g, and _grouped_catch_up().

Referenced by _full_reload(), and _on_groupby_changed().

◆ _rebuild_memory()

◆ _run_search()

static void _run_search ( const char *  query)
static

◆ _scroll_bottom_idle()

static gboolean _scroll_bottom_idle ( gpointer  u)
static

Definition at line 697 of file supervisor_window.c.

References _g.

Referenced by _poll().

◆ _scroll_row_into_view()

static void _scroll_row_into_view ( GtkWidget row)
static

Definition at line 116 of file supervisor_window.c.

References _g, double(), MAX, and row.

Referenced by _scroll_target_idle().

◆ _scroll_target_idle()

static gboolean _scroll_target_idle ( gpointer  u)
static

Definition at line 133 of file supervisor_window.c.

References _g, _scroll_row_into_view(), and row.

Referenced by _on_link().

◆ _timeline_append()

static void _timeline_append ( const dt_sv_logged_event_t ev)
static

Definition at line 365 of file supervisor_window.c.

References _event_widget(), _g, _hashhex(), dt_sv_logged_event_t::hash, dt_sv_logged_event_t::op, and row.

Referenced by _poll().

◆ _timeline_trim()

static void _timeline_trim ( void  )
static

Definition at line 380 of file supervisor_window.c.

References _g, row, and TIMELINE_MAX_ROWS.

Referenced by _poll().

◆ _update_count()

static void _update_count ( void  )
static

Definition at line 401 of file supervisor_window.c.

References _g, and dt_supervisor_events_count().

Referenced by _poll().

◆ _wire_hash_label()

static void _wire_hash_label ( GtkWidget label)
static

Definition at line 196 of file supervisor_window.c.

References _on_label_button(), _on_link(), and FALSE.

Referenced by _add_mem_item(), _collapsible(), and _event_body_from().

◆ dt_gui_supervisor_window_show()

Variable Documentation

◆ [struct]

◆ count_label

GtkWidget* count_label

Definition at line 48 of file supervisor_window.c.

◆ decl_map

GHashTable* decl_map

Definition at line 50 of file supervisor_window.c.

◆ group_map

GHashTable* group_map

Definition at line 51 of file supervisor_window.c.

◆ groupby

GtkWidget* groupby

Definition at line 49 of file supervisor_window.c.

◆ grouped_last_seq

uint64_t grouped_last_seq

Definition at line 53 of file supervisor_window.c.

◆ grouped_list

GtkWidget* grouped_list

Definition at line 44 of file supervisor_window.c.

◆ last_seq

uint64_t last_seq

Definition at line 52 of file supervisor_window.c.

◆ mem_box

GtkWidget* mem_box

Definition at line 45 of file supervisor_window.c.

◆ notebook

◆ page_grouped

int page_grouped

Definition at line 57 of file supervisor_window.c.

◆ page_memory

int page_memory

Definition at line 57 of file supervisor_window.c.

◆ page_search

int page_search

Definition at line 57 of file supervisor_window.c.

◆ page_timeline

int page_timeline

Definition at line 57 of file supervisor_window.c.

◆ scroll_target

gchar* scroll_target

Definition at line 54 of file supervisor_window.c.

◆ search_entry

GtkWidget* search_entry

Definition at line 46 of file supervisor_window.c.

Referenced by _find_and_rank_matches(), and dt_accels_search().

◆ search_list

GtkWidget* search_list

Definition at line 47 of file supervisor_window.c.

◆ tick

guint tick

Definition at line 56 of file supervisor_window.c.

◆ timeline_list

GtkWidget* timeline_list

Definition at line 42 of file supervisor_window.c.

◆ timeline_scroll

GtkWidget* timeline_scroll

Definition at line 43 of file supervisor_window.c.

◆ timer_id

guint timer_id

Definition at line 55 of file supervisor_window.c.

◆ window