Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
gui_throttle.h
Go to the documentation of this file.
1#ifndef DT_DEVELOP_GUI_THROTTLE_H
2#define DT_DEVELOP_GUI_THROTTLE_H
3
4#include <glib.h>
5
6G_BEGIN_DECLS
7
8
9/* Which render this timing belongs to. Deliberately NOT the pipeline's own enum: the throttle
10 * only ever distinguishes the main view from the preview, and taking develop/pixelpipe.h for
11 * that would make a widget depend on the pixel pipeline. The caller maps its pipe to a slot. */
18
19typedef void (*dt_gui_throttle_callback_t)(gpointer user_data);
20
21/* The throttle adapts to how long redraws actually take, and remembers that across sessions.
22 * Both the user's timeout preference and the remembered runtime are configuration, so the
23 * host supplies one and collects the other rather than this module reading conf itself. */
24
26void dt_gui_throttle_init(int saved_runtime_us);
27
30void dt_gui_throttle_set_timeout_ms(guint timeout_ms);
31
32
34
35void dt_gui_throttle_record_runtime(dt_throttle_slot_t slot, gint64 runtime_us);
40
41void dt_gui_throttle_queue(gpointer source, dt_gui_throttle_callback_t callback, gpointer user_data);
42void dt_gui_throttle_cancel(gpointer source);
43G_END_DECLS
44
45#endif // DT_DEVELOP_GUI_THROTTLE_H
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
dt_throttle_slot_t
@ DT_THROTTLE_SLOT_MAIN
@ DT_THROTTLE_SLOT_PREVIEW
@ DT_THROTTLE_SLOT_OTHER
gint64 dt_gui_throttle_get_timeout_us(void)
void dt_gui_throttle_cancel(gpointer source)
void(* dt_gui_throttle_callback_t)(gpointer user_data)
void dt_gui_throttle_set_timeout_ms(guint timeout_ms)
int dt_gui_throttle_get_pipe_runtime_us(dt_throttle_slot_t slot)
void dt_gui_throttle_record_runtime(dt_throttle_slot_t slot, gint64 runtime_us)
void dt_gui_throttle_init(int saved_runtime_us)
int dt_gui_throttle_get_runtime_us(void)
void dt_gui_throttle_cleanup(void)
guint dt_gui_throttle_get_timeout_ms(void)
void dt_gui_throttle_queue(gpointer source, dt_gui_throttle_callback_t callback, gpointer user_data)