![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include <glib.h>
#include "bauhaus/bauhaus.h"
#include "common/darktable.h"
#include "develop/imageop_gui.h"
#include "dtgtk/button.h"
#include "gui/guides.h"
#include "gui/draw.h"
#include "control/control.h"
Data Structures | |
struct | dt_QRect_t |
struct | _guides_settings_t |
Macros | |
#define | DEFAULT_GUIDE_NAME "rules of thirds" |
#define | PERSPECTIVE_LINES 16 |
#define | X_LINES 49 |
#define | Y_LINES 33 |
#define | CROSSES 6 |
#define | RADIANS(degrees) ((degrees) * (M_PI / 180.)) |
Typedefs | |
typedef enum dt_golden_type_t | dt_golden_type_t |
typedef struct dt_QRect_t | dt_QRect_t |
typedef struct _guides_settings_t | _guides_settings_t |
Enumerations | |
enum | dt_golden_type_t { GOLDEN_SECTION = 0 , GOLDEN_SPIRAL , GOLDEN_SPIRAL_SECTION , GOLDEN_ALL } |
Functions | |
static void | dt_guides_q_rect (dt_QRect_t *R1, float left, float top, float width, float height) |
static int | _guides_get_value (gchar *name) |
static gchar * | _conf_get_path (gchar *module_name, gchar *property_1, gchar *property_2) |
static dt_guides_t * | _conf_get_guide (gchar *module_name) |
static gchar * | _conf_get_guide_name (gchar *module_name) |
static void | dt_guides_draw_grid (cairo_t *cr, const float x, const float y, const float w, const float h, float zoom_scale, void *data) |
static void | _grid_horizontal_changed (GtkWidget *w, void *data) |
static void | _grid_vertical_changed (GtkWidget *w, void *data) |
static void | _grid_subdiv_changed (GtkWidget *w, void *data) |
static GtkWidget * | _guides_gui_grid (dt_iop_module_t *self, void *user_data) |
static void | dt_guides_draw_diagonal_method (cairo_t *cr, const float x, const float y, const float w, const float h) |
static void | dt_guides_draw_rules_of_thirds (cairo_t *cr, const float left, const float top, const float width, const float height) |
static void | dt_guides_draw_harmonious_triangles (cairo_t *cr, const float left, const float top, const float width, const float height) |
static void | dt_guides_draw_perspective (cairo_t *cr, const float x, const float y, const float w, const float h) |
static void | dt_guides_draw_metering (cairo_t *cr, const float x, const float y, const float w, const float h) |
static void | dt_guides_draw_golden_mean (cairo_t *cr, dt_QRect_t *R1, dt_QRect_t *R2, dt_QRect_t *R3, dt_QRect_t *R4, dt_QRect_t *R5, dt_QRect_t *R6, dt_QRect_t *R7, gboolean goldenSection, gboolean goldenTriangle, gboolean goldenSpiralSection, gboolean goldenSpiral) |
static void | _guides_draw_grid (cairo_t *cr, const float x, const float y, const float w, const float h, const float zoom_scale, void *user_data) |
static void | _guides_draw_rules_of_thirds (cairo_t *cr, const float x, const float y, const float w, const float h, const float zoom_scale, void *user_data) |
static void | _guides_draw_metering (cairo_t *cr, const float x, const float y, const float w, const float h, const float zoom_scale, void *user_data) |
static void | _guides_draw_perspective (cairo_t *cr, const float x, const float y, const float w, const float h, const float zoom_scale, void *user_data) |
static void | _guides_draw_diagonal_method (cairo_t *cr, const float x, const float y, const float w, const float h, const float zoom_scale, void *user_data) |
static void | _guides_draw_harmonious_triangles (cairo_t *cr, const float x, const float y, const float w, const float h, const float zoom_scale, void *user_data) |
static void | _guides_draw_golden_mean (cairo_t *cr, const float x, const float y, const float w, const float h, const float zoom_scale, void *user_data) |
static void | _guides_add_guide (GList **list, const char *name, dt_guides_draw_callback draw, dt_guides_widget_callback widget, void *user_data, GDestroyNotify free, gboolean support_flip) |
void | dt_guides_add_guide (const char *name, dt_guides_draw_callback draw, dt_guides_widget_callback widget, void *user_data, GDestroyNotify free) |
GList * | dt_guides_init () |
static void | _settings_update_visibility (_guides_settings_t *gw) |
static void | _settings_flip_update (_guides_settings_t *gw) |
static void | _settings_guides_changed (GtkWidget *w, _guides_settings_t *gw) |
static void | _settings_flip_changed (GtkWidget *w, _guides_settings_t *gw) |
void | dt_guides_set_overlay_colors () |
static void | _settings_colors_changed (GtkWidget *combo, _guides_settings_t *gw) |
static void | _settings_contrast_changed (GtkWidget *slider, _guides_settings_t *gw) |
GtkWidget * | dt_guides_popover (dt_view_t *self, GtkWidget *button) |
void | dt_guides_update_button_state () |
void | dt_guides_button_toggled (gboolean active) |
void | dt_guides_draw (cairo_t *cr, const float left, const float top, const float width, const float height, const float zoom_scale) |
static void | free_guide (void *data) |
void | dt_guides_cleanup (GList *guides) |
void | dt_guides_update_popover_values () |
Variables | |
static const char * | _guide_names [] |
#define CROSSES 6 |
#define DEFAULT_GUIDE_NAME "rules of thirds" |
#define PERSPECTIVE_LINES 16 |
#define RADIANS | ( | degrees | ) | ((degrees) * (M_PI / 180.)) |
#define X_LINES 49 |
#define Y_LINES 33 |
typedef struct _guides_settings_t _guides_settings_t |
typedef enum dt_golden_type_t dt_golden_type_t |
typedef struct dt_QRect_t dt_QRect_t |
enum dt_golden_type_t |
|
static |
References _conf_get_path(), _guides_get_value(), darktable, DEFAULT_GUIDE_NAME, dt_conf_get_string(), dt_conf_key_exists(), dt_conf_set_string(), darktable_t::guides, and key.
Referenced by _conf_get_guide_name(), and dt_guides_draw().
|
static |
References _conf_get_guide(), and dt_guides_t::name.
Referenced by dt_guides_draw_grid().
|
static |
References darktable, dt_util_dstrcat(), dt_view_darkroom_get_layout(), dt_view_manager_get_current_view(), dt_view_t::module_name, and darktable_t::view_manager.
Referenced by _conf_get_guide(), _grid_horizontal_changed(), _grid_subdiv_changed(), _grid_vertical_changed(), _guides_add_guide(), _guides_gui_grid(), _settings_flip_changed(), _settings_flip_update(), _settings_guides_changed(), dt_guides_button_toggled(), dt_guides_draw(), dt_guides_draw_grid(), dt_guides_update_button_state(), and dt_guides_update_popover_values().
References _conf_get_path(), dt_bauhaus_slider_get(), dt_conf_set_int(), dt_control_queue_redraw_center(), and key.
Referenced by _guides_gui_grid().
References _conf_get_path(), dt_bauhaus_slider_get(), dt_conf_set_int(), dt_control_queue_redraw_center(), and key.
Referenced by _guides_gui_grid().
References _conf_get_path(), dt_bauhaus_slider_get(), dt_conf_set_int(), dt_control_queue_redraw_center(), and key.
Referenced by _guides_gui_grid().
|
static |
References _conf_get_path(), _guides_get_value(), darktable, dt_guides_t::draw, draw(), dt_bauhaus_combobox_set(), dt_conf_get_string(), dt_guides_t::free, dt_view_manager_t::guides, key, name, dt_guides_t::name, dt_guides_t::support_flip, dt_guides_t::user_data, darktable_t::view_manager, and dt_guides_t::widget.
Referenced by dt_guides_add_guide(), and dt_guides_init().
|
static |
References dt_guides_draw_diagonal_method().
Referenced by dt_guides_init().
|
static |
References dt_QRect_t::bottom, dt_guides_draw_golden_mean(), dt_guides_q_rect(), FALSE, GOLDEN_ALL, GOLDEN_SECTION, GOLDEN_SPIRAL, GOLDEN_SPIRAL_SECTION, dt_QRect_t::height, INVPHI, dt_QRect_t::left, dt_QRect_t::right, dt_QRect_t::top, and dt_QRect_t::width.
Referenced by dt_guides_init().
|
static |
References dt_guides_draw_grid().
Referenced by dt_guides_init().
|
static |
References dt_guides_draw_harmonious_triangles().
Referenced by dt_guides_init().
|
static |
References dt_guides_draw_metering().
Referenced by dt_guides_init().
|
static |
References dt_guides_draw_perspective().
Referenced by dt_guides_init().
|
static |
References dt_guides_draw_rules_of_thirds().
Referenced by dt_guides_init().
|
static |
References darktable, darktable_t::guides, name, and dt_guides_t::name.
Referenced by _conf_get_guide(), _guides_add_guide(), and dt_guides_update_popover_values().
|
static |
References _conf_get_path(), _grid_horizontal_changed(), _grid_subdiv_changed(), _grid_vertical_changed(), darktable_t::bauhaus, darktable, dt_bauhaus_slider_new_with_range(), dt_bauhaus_slider_set(), dt_bauhaus_slider_set_hard_max(), DT_BAUHAUS_SPACE, dt_bauhaus_widget_set_label(), dt_conf_get_int(), dt_conf_key_exists(), DT_GUI_MODULE, key, and TRUE.
Referenced by dt_guides_init().
|
static |
References dt_bauhaus_combobox_get(), dt_conf_set_int(), dt_control_queue_redraw_center(), and dt_guides_set_overlay_colors().
Referenced by dt_guides_popover().
|
static |
References dt_bauhaus_slider_get(), dt_conf_set_float(), dt_control_queue_redraw_center(), and dt_guides_set_overlay_colors().
Referenced by dt_guides_popover().
|
static |
|
static |
References _conf_get_path(), darktable, dt_bauhaus_combobox_get(), dt_bauhaus_combobox_set(), dt_conf_get_int(), _guides_settings_t::g_flip, darktable_t::gui, darktable_t::guides, dt_view_manager_t::guides, key, dt_guides_t::name, dt_gui_gtk_t::reset, dt_guides_t::support_flip, and darktable_t::view_manager.
Referenced by _settings_guides_changed().
|
static |
References _conf_get_path(), _settings_flip_update(), _settings_update_visibility(), darktable, dt_bauhaus_combobox_get(), dt_conf_set_string(), dt_control_queue_redraw_center(), dt_guides_update_button_state(), darktable_t::guides, dt_view_manager_t::guides, key, dt_guides_t::name, and darktable_t::view_manager.
Referenced by dt_guides_popover().
|
static |
References darktable, dt_bauhaus_combobox_get(), _guides_settings_t::g_flip, _guides_settings_t::g_widgets, darktable_t::guides, dt_view_manager_t::guides, dt_guides_t::support_flip, dt_guides_t::user_data, darktable_t::view_manager, and dt_guides_t::widget.
Referenced by _settings_guides_changed().
void dt_guides_add_guide | ( | const char * | name, |
dt_guides_draw_callback | draw, | ||
dt_guides_widget_callback | widget, | ||
void * | user_data, | ||
GDestroyNotify | free | ||
) |
References _guides_add_guide(), darktable, draw(), dt_bauhaus_combobox_add(), darktable_t::guides, dt_view_manager_t::guides, name, TRUE, and darktable_t::view_manager.
Referenced by register_guide().
void dt_guides_button_toggled | ( | gboolean | active | ) |
References _conf_get_path(), dt_conf_set_bool(), and key.
Referenced by _guides_quickbutton_clicked().
void dt_guides_cleanup | ( | GList * | guides | ) |
References free_guide().
Referenced by dt_cleanup().
void dt_guides_draw | ( | cairo_t * | cr, |
const float | left, | ||
const float | top, | ||
const float | width, | ||
const float | height, | ||
const float | zoom_scale | ||
) |
References _conf_get_guide(), _conf_get_path(), dt_guides_t::draw, dt_conf_get_bool(), dt_conf_get_int(), dt_conf_key_exists(), dt_draw_set_color_overlay(), DT_PIXEL_APPLY_DPI, FALSE, flip(), height, key, dt_guides_t::name, dt_guides_t::support_flip, TRUE, dt_guides_t::user_data, and width.
Referenced by expose(), and gui_post_expose().
|
static |
References dt_draw_line().
Referenced by _guides_draw_diagonal_method().
|
static |
References dt_QRect_t::bottom, dt_draw_line(), dt_QRect_t::height, dt_QRect_t::left, RADIANS, dt_QRect_t::right, dt_QRect_t::top, and dt_QRect_t::width.
Referenced by _guides_draw_golden_mean().
|
static |
References _conf_get_guide_name(), _conf_get_path(), dt_conf_get_int(), dt_conf_key_exists(), dt_draw_horizontal_lines(), dt_draw_set_color_overlay(), dt_draw_vertical_lines(), FALSE, key, and TRUE.
Referenced by _guides_draw_grid().
|
static |
References dt_draw_line(), height, and width.
Referenced by _guides_draw_harmonious_triangles().
|
static |
References CROSSES, dt_draw_line(), MIN, X_LINES, and Y_LINES.
Referenced by _guides_draw_metering().
|
static |
References dt_draw_line(), M_PI, and PERSPECTIVE_LINES.
Referenced by _guides_draw_perspective().
|
static |
References dt_draw_line(), height, and width.
Referenced by _guides_draw_rules_of_thirds().
GList * dt_guides_init | ( | ) |
References _guide_names, _guides_add_guide(), _guides_draw_diagonal_method(), _guides_draw_golden_mean(), _guides_draw_grid(), _guides_draw_harmonious_triangles(), _guides_draw_metering(), _guides_draw_perspective(), _guides_draw_rules_of_thirds(), _guides_gui_grid(), FALSE, GOLDEN_ALL, GOLDEN_SECTION, GOLDEN_SPIRAL, GOLDEN_SPIRAL_SECTION, and TRUE.
Referenced by dt_init().
GtkWidget * dt_guides_popover | ( | dt_view_t * | self, |
GtkWidget * | button | ||
) |
References _guide_names, _settings_colors_changed(), _settings_contrast_changed(), _settings_flip_changed(), _settings_guides_changed(), darktable_t::bauhaus, darktable, DT_BAUHAUS_COMBOBOX_NEW_FULL, dt_bauhaus_combobox_new_full(), dt_bauhaus_slider_new_with_range(), dt_bauhaus_slider_set(), dt_bauhaus_widget_set_label(), dt_conf_get_float(), dt_conf_get_int(), dt_gui_add_class(), DT_GUI_MODULE, _guides_settings_t::g_flip, _guides_settings_t::g_widgets, dt_view_manager_t::guides, dt_view_manager_t::guides_colors, dt_view_manager_t::guides_contrast, TRUE, and darktable_t::view_manager.
Referenced by gui_init().
|
static |
References dt_QRect_t::bottom, height, dt_QRect_t::height, dt_QRect_t::left, dt_QRect_t::right, dt_QRect_t::top, width, and dt_QRect_t::width.
Referenced by _guides_draw_golden_mean().
void dt_guides_set_overlay_colors | ( | ) |
References darktable, dt_conf_get_float(), dt_conf_get_int(), DT_DEV_OVERLAY_CYAN, DT_DEV_OVERLAY_GRAY, DT_DEV_OVERLAY_GREEN, DT_DEV_OVERLAY_MAGENTA, DT_DEV_OVERLAY_RED, DT_DEV_OVERLAY_YELLOW, darktable_t::gui, dt_gui_gtk_t::overlay_blue, dt_gui_gtk_t::overlay_contrast, dt_gui_gtk_t::overlay_green, and dt_gui_gtk_t::overlay_red.
Referenced by _settings_colors_changed(), _settings_contrast_changed(), and dt_gui_gtk_init().
void dt_guides_update_button_state | ( | ) |
References _conf_get_path(), darktable, dt_conf_get_bool(), dt_view_manager_t::guides_toggle, key, and darktable_t::view_manager.
Referenced by _guides_view_changed(), and _settings_guides_changed().
void dt_guides_update_popover_values | ( | ) |
References _conf_get_path(), _guides_get_value(), darktable, DEFAULT_GUIDE_NAME, dt_bauhaus_combobox_set(), dt_bauhaus_slider_set(), dt_conf_get_float(), dt_conf_get_int(), dt_conf_get_string(), dt_conf_key_exists(), dt_conf_set_string(), dt_view_manager_t::guides, dt_view_manager_t::guides_colors, dt_view_manager_t::guides_contrast, key, and darktable_t::view_manager.
Referenced by _toolbar_show_popup().
References dt_guides_t::free, and dt_guides_t::user_data.
Referenced by dt_guides_cleanup().
|
static |
Referenced by dt_guides_init(), and dt_guides_popover().