Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
textnotes.c File Reference
#include "common/darktable.h"
#include "common/datetime.h"
#include "common/debug.h"
#include "common/image.h"
#include "common/image_cache.h"
#include "common/variables.h"
#include "control/control.h"
#include "control/jobs.h"
#include "control/signal.h"
#include "gui/gtk.h"
#include "gui/gtkentry.h"
#include "libs/lib.h"
#include "views/view.h"
#include <glib.h>
#include <glib/gstdio.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
+ Include dependency graph for textnotes.c:

Data Structures

struct  dt_lib_textnotes_t
 
struct  dt_textnotes_load_job_t
 
struct  dt_textnotes_load_result_t
 

Typedefs

typedef struct dt_lib_textnotes_t dt_lib_textnotes_t
 
typedef struct dt_textnotes_load_job_t dt_textnotes_load_job_t
 
typedef struct dt_textnotes_load_result_t dt_textnotes_load_result_t
 

Functions

const char * name (dt_lib_module_t *self)
 
const char ** views (dt_lib_module_t *self)
 
uint32_t container (dt_lib_module_t *self)
 
int position ()
 
static void _save_now (dt_lib_module_t *self)
 
static void _render_preview (dt_lib_textnotes_t *d, const char *text)
 
static void _update_for_current_image (dt_lib_module_t *self)
 
static gboolean _image_has_txt_flag (const int32_t imgid)
 
static gboolean _set_image_paths (dt_lib_textnotes_t *d, const int32_t imgid)
 
static void _clear_variables_cache (dt_lib_textnotes_t *d)
 
static gboolean _textnotes_load_finish_idle (gpointer user_data)
 
static int32_t _textnotes_load_job_run (dt_job_t *job)
 
static void _textnotes_load_job_state (dt_job_t *job, dt_job_state_t state)
 
static void _textnotes_load_job_cleanup (void *data)
 
static gchar * _get_buffer_text (GtkTextBuffer *buffer)
 
static gchar * _get_edit_text (dt_lib_textnotes_t *d)
 
static void _set_edit_text (dt_lib_textnotes_t *d, const char *text)
 
voidget_params (dt_lib_module_t *self, int *size)
 
int set_params (dt_lib_module_t *self, const void *params, int size)
 
void init_presets (dt_lib_module_t *self)
 
static int _preview_text_window_width_px (dt_lib_textnotes_t *d)
 
static void _render_preview_from_edit (dt_lib_textnotes_t *d)
 
static void _completion_hide (dt_lib_textnotes_t *d)
 
static gboolean _completion_match (const char *item, const char *prefix)
 
static void _completion_fill (dt_lib_textnotes_t *d, const char *prefix)
 
static gboolean _completion_find_prefix (dt_lib_textnotes_t *d, GtkTextIter *cursor, GtkTextIter *start_iter, gchar **prefix_out)
 
static gboolean _completion_apply_selected (dt_lib_module_t *self)
 
static void _completion_update (dt_lib_module_t *self)
 
static gboolean _completion_focus_out_idle (gpointer user_data)
 
static gboolean _edit_key_press (GtkWidget *widget, GdkEventKey *event, dt_lib_module_t *self)
 
static gboolean _edit_key_release (GtkWidget *widget, GdkEventKey *event, dt_lib_module_t *self)
 
static gboolean _edit_button_release (GtkWidget *widget, GdkEventButton *event, dt_lib_module_t *self)
 
static void _completion_row_activated (GtkTreeView *tree, GtkTreePath *path, GtkTreeViewColumn *column, dt_lib_module_t *self)
 
static void _setup_completion (dt_lib_module_t *self, GtkWidget *textview)
 
static gboolean _alloc_row_buffers (const int width, guchar **row_in, guchar **row_out)
 
static void _free_row_buffers (guchar *row_in, guchar *row_out)
 
static void _colorcorrect_row (cmsHTRANSFORM transform, guchar *src, const int width, const int n_channels, const gboolean has_alpha, guchar *row_in, guchar *row_out)
 
static void _colorcorrect_pixbuf (GdkPixbuf *pixbuf)
 
static void _toggle_mode (GtkToggleButton *button, dt_lib_module_t *self)
 
static void _load_for_image (dt_lib_module_t *self, const int32_t imgid)
 
static gboolean _refresh_preview_idle (gpointer user_data)
 
static void _open_uri (const char *uri)
 
static gchar * _expand_text_for_preview (dt_lib_textnotes_t *d, const char *source_text)
 
static void _clear_mtime_label (dt_lib_textnotes_t *d)
 
static void _update_mtime_label (dt_lib_module_t *self)
 
static void _toggle_checklist_at_line (dt_lib_module_t *self, const int line_no)
 
static gboolean _preview_button_press (GtkWidget *widget, GdkEventButton *event, dt_lib_module_t *self)
 
static void _preview_map (GtkWidget *widget, dt_lib_module_t *self)
 
static void _edit_map (GtkWidget *widget, dt_lib_module_t *self)
 
static gboolean _initial_load_idle (gpointer user_data)
 
static void _ensure_has_txt_flag (const int32_t imgid)
 
static char * _text_sidecar_save_path (dt_lib_textnotes_t *d, const int32_t imgid)
 
static void _save_and_render (dt_lib_module_t *self)
 
static gboolean _save_timeout_cb (gpointer user_data)
 
static void _textbuffer_changed (GtkTextBuffer *buffer, dt_lib_module_t *self)
 
static gboolean _textview_focus_out (GtkWidget *widget, GdkEventFocus *event, dt_lib_module_t *self)
 
static void _image_changed_callback (gpointer instance, gpointer user_data)
 
static void _mouse_over_image_callback (gpointer instance, gpointer user_data)
 
void gui_init (dt_lib_module_t *self)
 
void gui_cleanup (dt_lib_module_t *self)
 

Typedef Documentation

◆ dt_lib_textnotes_t

◆ dt_textnotes_load_job_t

◆ dt_textnotes_load_result_t

Function Documentation

◆ _alloc_row_buffers()

static gboolean _alloc_row_buffers ( const int  width,
guchar **  row_in,
guchar **  row_out 
)
static

References dt_free, FALSE, TRUE, and width.

Referenced by _colorcorrect_pixbuf().

◆ _clear_mtime_label()

static void _clear_mtime_label ( dt_lib_textnotes_t d)
static

◆ _clear_variables_cache()

static void _clear_variables_cache ( dt_lib_textnotes_t d)
static

References d, and dt_variables_params_destroy().

Referenced by _load_for_image(), and gui_cleanup().

◆ _colorcorrect_pixbuf()

◆ _colorcorrect_row()

static void _colorcorrect_row ( cmsHTRANSFORM  transform,
guchar *  src,
const int  width,
const int  n_channels,
const gboolean  has_alpha,
guchar *  row_in,
guchar *  row_out 
)
static

References d, transform(), width, and x.

Referenced by _colorcorrect_pixbuf().

◆ _completion_apply_selected()

static gboolean _completion_apply_selected ( dt_lib_module_t self)
static

◆ _completion_fill()

static void _completion_fill ( dt_lib_textnotes_t d,
const char *  prefix 
)
static

◆ _completion_find_prefix()

static gboolean _completion_find_prefix ( dt_lib_textnotes_t d,
GtkTextIter *  cursor,
GtkTextIter *  start_iter,
gchar **  prefix_out 
)
static

References d, dt_free, FALSE, p, and TRUE.

Referenced by _completion_update().

◆ _completion_focus_out_idle()

static gboolean _completion_focus_out_idle ( gpointer  user_data)
static

◆ _completion_hide()

◆ _completion_match()

static gboolean _completion_match ( const char *  item,
const char *  prefix 
)
static

References dt_free, FALSE, and TRUE.

Referenced by _completion_fill().

◆ _completion_row_activated()

static void _completion_row_activated ( GtkTreeView *  tree,
GtkTreePath *  path,
GtkTreeViewColumn *  column,
dt_lib_module_t self 
)
static

References _completion_apply_selected(), and void().

Referenced by _setup_completion().

◆ _completion_update()

◆ _edit_button_release()

static gboolean _edit_button_release ( GtkWidget widget,
GdkEventButton *  event,
dt_lib_module_t self 
)
static

References _completion_update(), FALSE, and void().

Referenced by gui_init().

◆ _edit_key_press()

static gboolean _edit_key_press ( GtkWidget widget,
GdkEventKey *  event,
dt_lib_module_t self 
)
static

◆ _edit_key_release()

static gboolean _edit_key_release ( GtkWidget widget,
GdkEventKey *  event,
dt_lib_module_t self 
)
static

References _completion_update(), FALSE, and void().

Referenced by gui_init().

◆ _edit_map()

static void _edit_map ( GtkWidget widget,
dt_lib_module_t self 
)
static

References _update_for_current_image().

Referenced by gui_init().

◆ _ensure_has_txt_flag()

◆ _expand_text_for_preview()

◆ _free_row_buffers()

static void _free_row_buffers ( guchar *  row_in,
guchar *  row_out 
)
static

References dt_free.

Referenced by _colorcorrect_pixbuf().

◆ _get_buffer_text()

static gchar * _get_buffer_text ( GtkTextBuffer *  buffer)
static

References TRUE.

Referenced by _get_edit_text(), and _toggle_checklist_at_line().

◆ _get_edit_text()

static gchar * _get_edit_text ( dt_lib_textnotes_t d)
static

◆ _image_changed_callback()

static void _image_changed_callback ( gpointer  instance,
gpointer  user_data 
)
static

References _update_for_current_image().

Referenced by gui_cleanup(), and gui_init().

◆ _image_has_txt_flag()

static gboolean _image_has_txt_flag ( const int32_t  imgid)
static

◆ _initial_load_idle()

static gboolean _initial_load_idle ( gpointer  user_data)
static

◆ _load_for_image()

◆ _mouse_over_image_callback()

static void _mouse_over_image_callback ( gpointer  instance,
gpointer  user_data 
)
static

References _update_for_current_image().

Referenced by gui_cleanup(), and gui_init().

◆ _open_uri()

static void _open_uri ( const char *  uri)
static

◆ _preview_button_press()

static gboolean _preview_button_press ( GtkWidget widget,
GdkEventButton *  event,
dt_lib_module_t self 
)
static

References _open_uri(), _toggle_checklist_at_line(), FALSE, t, TRUE, and view().

Referenced by gui_init().

◆ _preview_map()

static void _preview_map ( GtkWidget widget,
dt_lib_module_t self 
)
static

◆ _preview_text_window_width_px()

static int _preview_text_window_width_px ( dt_lib_textnotes_t d)
static

References d.

◆ _refresh_preview_idle()

static gboolean _refresh_preview_idle ( gpointer  user_data)
static

◆ _render_preview()

◆ _render_preview_from_edit()

static void _render_preview_from_edit ( dt_lib_textnotes_t d)
static

◆ _save_and_render()

◆ _save_now()

static void _save_now ( dt_lib_module_t self)
static

◆ _save_timeout_cb()

static gboolean _save_timeout_cb ( gpointer  user_data)
static

◆ _set_edit_text()

static void _set_edit_text ( dt_lib_textnotes_t d,
const char *  text 
)
static

References d, FALSE, and TRUE.

Referenced by _load_for_image(), _textnotes_load_finish_idle(), and set_params().

◆ _set_image_paths()

static gboolean _set_image_paths ( dt_lib_textnotes_t d,
const int32_t  imgid 
)
static

◆ _setup_completion()

static void _setup_completion ( dt_lib_module_t self,
GtkWidget textview 
)
static

◆ _text_sidecar_save_path()

static char * _text_sidecar_save_path ( dt_lib_textnotes_t d,
const int32_t  imgid 
)
static

◆ _textbuffer_changed()

static void _textbuffer_changed ( GtkTextBuffer *  buffer,
dt_lib_module_t self 
)
static

◆ _textnotes_load_finish_idle()

◆ _textnotes_load_job_cleanup()

static void _textnotes_load_job_cleanup ( void data)
static

References dt_free.

Referenced by _load_for_image().

◆ _textnotes_load_job_run()

static int32_t _textnotes_load_job_run ( dt_job_t job)
static

References dt_control_job_get_params(), and TRUE.

Referenced by _load_for_image().

◆ _textnotes_load_job_state()

◆ _textview_focus_out()

static gboolean _textview_focus_out ( GtkWidget widget,
GdkEventFocus *  event,
dt_lib_module_t self 
)
static

◆ _toggle_checklist_at_line()

static void _toggle_checklist_at_line ( dt_lib_module_t self,
const int  line_no 
)
static

◆ _toggle_mode()

static void _toggle_mode ( GtkToggleButton *  button,
dt_lib_module_t self 
)
static

◆ _update_for_current_image()

◆ _update_mtime_label()

◆ container()

uint32_t container ( dt_lib_module_t self)

◆ get_params()

void * get_params ( dt_lib_module_t self,
int *  size 
)

◆ gui_cleanup()

◆ gui_init()

◆ init_presets()

void init_presets ( dt_lib_module_t self)

◆ name()

const char * name ( dt_lib_module_t self)

◆ position()

int position ( )

◆ set_params()

int set_params ( dt_lib_module_t self,
const void params,
int  size 
)

◆ views()

const char ** views ( dt_lib_module_t self)

References v.