diff options
Diffstat (limited to 'src/editing_tools/RGBHistogramManipulator.c')
-rw-r--r-- | src/editing_tools/RGBHistogramManipulator.c | 1596 |
1 files changed, 1596 insertions, 0 deletions
diff --git a/src/editing_tools/RGBHistogramManipulator.c b/src/editing_tools/RGBHistogramManipulator.c new file mode 100644 index 0000000..ffbf0b8 --- /dev/null +++ b/src/editing_tools/RGBHistogramManipulator.c @@ -0,0 +1,1596 @@ +/* RGBHistogramManipulator.c generated by valac 0.36.6, the Vala compiler + * generated from RGBHistogramManipulator.vala, do not modify */ + +/* Copyright 2016 Software Freedom Conservancy Inc. + * + * This software is licensed under the GNU LGPL (version 2.1 or later). + * See the COPYING file in this distribution. + */ + +#include <glib.h> +#include <glib-object.h> +#include <gtk/gtk.h> +#include "shotwell-graphics-processor.h" +#include <gdk/gdk.h> +#include <cairo.h> +#include <string.h> +#include <float.h> +#include <math.h> +#include <gdk-pixbuf/gdk-pixbuf.h> + + +#define TYPE_RGB_HISTOGRAM_MANIPULATOR (rgb_histogram_manipulator_get_type ()) +#define RGB_HISTOGRAM_MANIPULATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_RGB_HISTOGRAM_MANIPULATOR, RGBHistogramManipulator)) +#define RGB_HISTOGRAM_MANIPULATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_RGB_HISTOGRAM_MANIPULATOR, RGBHistogramManipulatorClass)) +#define IS_RGB_HISTOGRAM_MANIPULATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_RGB_HISTOGRAM_MANIPULATOR)) +#define IS_RGB_HISTOGRAM_MANIPULATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_RGB_HISTOGRAM_MANIPULATOR)) +#define RGB_HISTOGRAM_MANIPULATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_RGB_HISTOGRAM_MANIPULATOR, RGBHistogramManipulatorClass)) + +typedef struct _RGBHistogramManipulator RGBHistogramManipulator; +typedef struct _RGBHistogramManipulatorClass RGBHistogramManipulatorClass; +typedef struct _RGBHistogramManipulatorPrivate RGBHistogramManipulatorPrivate; + +#define RGB_HISTOGRAM_MANIPULATOR_TYPE_LOCATION_CODE (rgb_histogram_manipulator_location_code_get_type ()) +#define _rgb_histogram_unref0(var) ((var == NULL) ? NULL : (var = (rgb_histogram_unref (var), NULL))) +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +enum { + RGB_HISTOGRAM_MANIPULATOR_NUB_POSITION_CHANGED_SIGNAL, + RGB_HISTOGRAM_MANIPULATOR_LAST_SIGNAL +}; +static guint rgb_histogram_manipulator_signals[RGB_HISTOGRAM_MANIPULATOR_LAST_SIGNAL] = {0}; +#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); +#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; } +#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; } +#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); + +struct _RGBHistogramManipulator { + GtkDrawingArea parent_instance; + RGBHistogramManipulatorPrivate * priv; +}; + +struct _RGBHistogramManipulatorClass { + GtkDrawingAreaClass parent_class; +}; + +struct _RGBHistogramManipulatorPrivate { + gint left_nub_max; + gint right_nub_min; + RGBHistogram* histogram; + gint left_nub_position; + gint right_nub_position; + gboolean is_left_nub_tracking; + gboolean is_right_nub_tracking; + gint track_start_x; + gint track_nub_start_position; + gint offset; +}; + +typedef enum { + RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_LEFT_NUB, + RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_RIGHT_NUB, + RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_LEFT_TROUGH, + RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_RIGHT_TROUGH, + RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_INSENSITIVE_AREA +} RGBHistogramManipulatorLocationCode; + + +static gpointer rgb_histogram_manipulator_parent_class = NULL; +static GtkWidgetPath* rgb_histogram_manipulator_slider_draw_path; +static GtkWidgetPath* rgb_histogram_manipulator_slider_draw_path = NULL; +static GtkWidgetPath* rgb_histogram_manipulator_frame_draw_path; +static GtkWidgetPath* rgb_histogram_manipulator_frame_draw_path = NULL; +static gboolean rgb_histogram_manipulator_paths_setup; +static gboolean rgb_histogram_manipulator_paths_setup = FALSE; + +GType rgb_histogram_manipulator_get_type (void) G_GNUC_CONST; +#define RGB_HISTOGRAM_MANIPULATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_RGB_HISTOGRAM_MANIPULATOR, RGBHistogramManipulatorPrivate)) +enum { + RGB_HISTOGRAM_MANIPULATOR_DUMMY_PROPERTY +}; +static GType rgb_histogram_manipulator_location_code_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +#define RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE 13 +#define RGB_HISTOGRAM_MANIPULATOR_NUB_HALF_WIDTH (RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE / 2) +#define RGB_HISTOGRAM_MANIPULATOR_NUB_V_NUDGE 4 +#define RGB_HISTOGRAM_MANIPULATOR_TROUGH_WIDTH (256 + (2 * RGB_HISTOGRAM_MANIPULATOR_NUB_HALF_WIDTH)) +#define RGB_HISTOGRAM_MANIPULATOR_TROUGH_HEIGHT 4 +#define RGB_HISTOGRAM_MANIPULATOR_TROUGH_BOTTOM_OFFSET 1 +#define RGB_HISTOGRAM_MANIPULATOR_CONTROL_WIDTH (RGB_HISTOGRAM_MANIPULATOR_TROUGH_WIDTH + 2) +#define RGB_HISTOGRAM_MANIPULATOR_CONTROL_HEIGHT 118 +#define RGB_HISTOGRAM_MANIPULATOR_NUB_V_POSITION (((((RGB_HISTOGRAM_MANIPULATOR_CONTROL_HEIGHT - RGB_HISTOGRAM_MANIPULATOR_TROUGH_HEIGHT) - RGB_HISTOGRAM_MANIPULATOR_TROUGH_BOTTOM_OFFSET) - ((RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE - RGB_HISTOGRAM_MANIPULATOR_TROUGH_HEIGHT) / 2)) - RGB_HISTOGRAM_MANIPULATOR_NUB_V_NUDGE) - 2) +RGBHistogramManipulator* rgb_histogram_manipulator_new (void); +RGBHistogramManipulator* rgb_histogram_manipulator_construct (GType object_type); +static gboolean rgb_histogram_manipulator_on_button_press (RGBHistogramManipulator* self, GdkEventButton* event_record); +static gboolean _rgb_histogram_manipulator_on_button_press_gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self); +static gboolean rgb_histogram_manipulator_on_button_release (RGBHistogramManipulator* self, GdkEventButton* event_record); +static gboolean _rgb_histogram_manipulator_on_button_release_gtk_widget_button_release_event (GtkWidget* _sender, GdkEventButton* event, gpointer self); +static gboolean rgb_histogram_manipulator_on_button_motion (RGBHistogramManipulator* self, GdkEventMotion* event_record); +static gboolean _rgb_histogram_manipulator_on_button_motion_gtk_widget_motion_notify_event (GtkWidget* _sender, GdkEventMotion* event, gpointer self); +static void rgb_histogram_manipulator_on_size_allocate (RGBHistogramManipulator* self, GtkAllocation* region); +static void _rgb_histogram_manipulator_on_size_allocate_gtk_widget_size_allocate (GtkWidget* _sender, GtkAllocation* allocation, gpointer self); +static RGBHistogramManipulatorLocationCode rgb_histogram_manipulator_hit_test_point (RGBHistogramManipulator* self, gint x, gint y); +static void rgb_histogram_manipulator_force_update (RGBHistogramManipulator* self); +static void rgb_histogram_manipulator_update_nub_extrema (RGBHistogramManipulator* self); +static gboolean rgb_histogram_manipulator_real_focus_out_event (GtkWidget* base, GdkEventFocus* event); +static gboolean rgb_histogram_manipulator_real_key_press_event (GtkWidget* base, GdkEventKey* event); +static gboolean rgb_histogram_manipulator_real_draw (GtkWidget* base, cairo_t* ctx); +static void rgb_histogram_manipulator_draw_histogram (RGBHistogramManipulator* self, cairo_t* ctx, GdkRectangle* area); +static void rgb_histogram_manipulator_draw_nub (RGBHistogramManipulator* self, cairo_t* ctx, GdkRectangle* area, gint position); +void rgb_histogram_manipulator_update_histogram (RGBHistogramManipulator* self, GdkPixbuf* source_pixbuf); +gint rgb_histogram_manipulator_get_left_nub_position (RGBHistogramManipulator* self); +gint rgb_histogram_manipulator_get_right_nub_position (RGBHistogramManipulator* self); +void rgb_histogram_manipulator_set_left_nub_position (RGBHistogramManipulator* self, gint user_nub_pos); +void rgb_histogram_manipulator_set_right_nub_position (RGBHistogramManipulator* self, gint user_nub_pos); +static void rgb_histogram_manipulator_finalize (GObject * obj); + + +static GType rgb_histogram_manipulator_location_code_get_type (void) { + static volatile gsize rgb_histogram_manipulator_location_code_type_id__volatile = 0; + if (g_once_init_enter (&rgb_histogram_manipulator_location_code_type_id__volatile)) { + static const GEnumValue values[] = {{RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_LEFT_NUB, "RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_LEFT_NUB", "left-nub"}, {RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_RIGHT_NUB, "RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_RIGHT_NUB", "right-nub"}, {RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_LEFT_TROUGH, "RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_LEFT_TROUGH", "left-trough"}, {RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_RIGHT_TROUGH, "RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_RIGHT_TROUGH", "right-trough"}, {RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_INSENSITIVE_AREA, "RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_INSENSITIVE_AREA", "insensitive-area"}, {0, NULL, NULL}}; + GType rgb_histogram_manipulator_location_code_type_id; + rgb_histogram_manipulator_location_code_type_id = g_enum_register_static ("RGBHistogramManipulatorLocationCode", values); + g_once_init_leave (&rgb_histogram_manipulator_location_code_type_id__volatile, rgb_histogram_manipulator_location_code_type_id); + } + return rgb_histogram_manipulator_location_code_type_id__volatile; +} + + +static gboolean _rgb_histogram_manipulator_on_button_press_gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self) { + gboolean result; + result = rgb_histogram_manipulator_on_button_press ((RGBHistogramManipulator*) self, event); +#line 57 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + return result; +#line 144 "RGBHistogramManipulator.c" +} + + +static gboolean _rgb_histogram_manipulator_on_button_release_gtk_widget_button_release_event (GtkWidget* _sender, GdkEventButton* event, gpointer self) { + gboolean result; + result = rgb_histogram_manipulator_on_button_release ((RGBHistogramManipulator*) self, event); +#line 58 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + return result; +#line 153 "RGBHistogramManipulator.c" +} + + +static gboolean _rgb_histogram_manipulator_on_button_motion_gtk_widget_motion_notify_event (GtkWidget* _sender, GdkEventMotion* event, gpointer self) { + gboolean result; + result = rgb_histogram_manipulator_on_button_motion ((RGBHistogramManipulator*) self, event); +#line 59 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + return result; +#line 162 "RGBHistogramManipulator.c" +} + + +static void _rgb_histogram_manipulator_on_size_allocate_gtk_widget_size_allocate (GtkWidget* _sender, GtkAllocation* allocation, gpointer self) { +#line 61 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + rgb_histogram_manipulator_on_size_allocate ((RGBHistogramManipulator*) self, allocation); +#line 169 "RGBHistogramManipulator.c" +} + + +RGBHistogramManipulator* rgb_histogram_manipulator_construct (GType object_type) { + RGBHistogramManipulator * self = NULL; + gboolean _tmp0_; +#line 36 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self = (RGBHistogramManipulator*) g_object_new (object_type, NULL); +#line 37 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + gtk_widget_set_size_request (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), RGB_HISTOGRAM_MANIPULATOR_CONTROL_WIDTH, RGB_HISTOGRAM_MANIPULATOR_CONTROL_HEIGHT); +#line 38 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_object_set (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), "can-focus", TRUE, NULL); +#line 40 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp0_ = rgb_histogram_manipulator_paths_setup; +#line 40 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (!_tmp0_) { +#line 186 "RGBHistogramManipulator.c" + GtkWidgetPath* _tmp1_; + GtkWidgetPath* _tmp2_; + GtkWidgetPath* _tmp3_; + GtkWidgetPath* _tmp4_; + GtkWidgetPath* _tmp5_; +#line 41 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp1_ = rgb_histogram_manipulator_slider_draw_path; +#line 41 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + gtk_widget_path_append_type (_tmp1_, gtk_scale_get_type ()); +#line 42 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp2_ = rgb_histogram_manipulator_slider_draw_path; +#line 42 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + gtk_widget_path_iter_add_class (_tmp2_, 0, "scale"); +#line 43 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp3_ = rgb_histogram_manipulator_slider_draw_path; +#line 43 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + gtk_widget_path_iter_add_class (_tmp3_, 0, "range"); +#line 45 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp4_ = rgb_histogram_manipulator_frame_draw_path; +#line 45 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + gtk_widget_path_append_type (_tmp4_, gtk_frame_get_type ()); +#line 46 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp5_ = rgb_histogram_manipulator_frame_draw_path; +#line 46 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + gtk_widget_path_iter_add_class (_tmp5_, 0, "default"); +#line 48 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + rgb_histogram_manipulator_paths_setup = TRUE; +#line 214 "RGBHistogramManipulator.c" + } +#line 51 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + gtk_widget_add_events (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), (gint) GDK_BUTTON_PRESS_MASK); +#line 52 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + gtk_widget_add_events (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), (gint) GDK_BUTTON_RELEASE_MASK); +#line 53 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + gtk_widget_add_events (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), (gint) GDK_BUTTON_MOTION_MASK); +#line 54 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + gtk_widget_add_events (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), (gint) GDK_FOCUS_CHANGE_MASK); +#line 55 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + gtk_widget_add_events (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), (gint) GDK_KEY_PRESS_MASK); +#line 57 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), "button-press-event", (GCallback) _rgb_histogram_manipulator_on_button_press_gtk_widget_button_press_event, self, 0); +#line 58 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), "button-release-event", (GCallback) _rgb_histogram_manipulator_on_button_release_gtk_widget_button_release_event, self, 0); +#line 59 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), "motion-notify-event", (GCallback) _rgb_histogram_manipulator_on_button_motion_gtk_widget_motion_notify_event, self, 0); +#line 61 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), "size-allocate", (GCallback) _rgb_histogram_manipulator_on_size_allocate_gtk_widget_size_allocate, self, 0); +#line 36 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + return self; +#line 236 "RGBHistogramManipulator.c" +} + + +RGBHistogramManipulator* rgb_histogram_manipulator_new (void) { +#line 36 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + return rgb_histogram_manipulator_construct (TYPE_RGB_HISTOGRAM_MANIPULATOR); +#line 243 "RGBHistogramManipulator.c" +} + + +static void rgb_histogram_manipulator_on_size_allocate (RGBHistogramManipulator* self, GtkAllocation* region) { + GtkAllocation _tmp0_; + gint _tmp1_; +#line 64 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self)); +#line 64 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_if_fail (region != NULL); +#line 65 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp0_ = *region; +#line 65 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp1_ = _tmp0_.width; +#line 65 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->offset = ((_tmp1_ - RGB_HISTOGRAM_GRAPHIC_WIDTH) - RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE) / 2; +#line 260 "RGBHistogramManipulator.c" +} + + +static RGBHistogramManipulatorLocationCode rgb_histogram_manipulator_hit_test_point (RGBHistogramManipulator* self, gint x, gint y) { + RGBHistogramManipulatorLocationCode result = 0; + gint _tmp0_; + gboolean _tmp1_ = FALSE; + gint _tmp2_; + gint _tmp3_; + gboolean _tmp6_ = FALSE; + gint _tmp7_; + gint _tmp8_; + gint _tmp11_; + gint _tmp12_; + gint _tmp13_; + gint _tmp14_; + gint _tmp15_; + gint _tmp16_; + gint _tmp17_; + gint _tmp18_; + gint _tmp19_; +#line 68 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_val_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self), 0); +#line 69 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp0_ = y; +#line 69 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (_tmp0_ < RGB_HISTOGRAM_MANIPULATOR_NUB_V_POSITION) { +#line 70 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + result = RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_INSENSITIVE_AREA; +#line 70 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + return result; +#line 292 "RGBHistogramManipulator.c" + } +#line 72 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp2_ = x; +#line 72 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp3_ = self->priv->left_nub_position; +#line 72 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (_tmp2_ > _tmp3_) { +#line 300 "RGBHistogramManipulator.c" + gint _tmp4_; + gint _tmp5_; +#line 72 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp4_ = x; +#line 72 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp5_ = self->priv->left_nub_position; +#line 72 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp1_ = _tmp4_ < (_tmp5_ + RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE); +#line 309 "RGBHistogramManipulator.c" + } else { +#line 72 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp1_ = FALSE; +#line 313 "RGBHistogramManipulator.c" + } +#line 72 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (_tmp1_) { +#line 73 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + result = RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_LEFT_NUB; +#line 73 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + return result; +#line 321 "RGBHistogramManipulator.c" + } +#line 75 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp7_ = x; +#line 75 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp8_ = self->priv->right_nub_position; +#line 75 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (_tmp7_ > _tmp8_) { +#line 329 "RGBHistogramManipulator.c" + gint _tmp9_; + gint _tmp10_; +#line 75 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp9_ = x; +#line 75 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp10_ = self->priv->right_nub_position; +#line 75 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp6_ = _tmp9_ < (_tmp10_ + RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE); +#line 338 "RGBHistogramManipulator.c" + } else { +#line 75 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp6_ = FALSE; +#line 342 "RGBHistogramManipulator.c" + } +#line 75 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (_tmp6_) { +#line 76 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + result = RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_RIGHT_NUB; +#line 76 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + return result; +#line 350 "RGBHistogramManipulator.c" + } +#line 78 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp11_ = y; +#line 78 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (_tmp11_ < ((RGB_HISTOGRAM_MANIPULATOR_NUB_V_POSITION + RGB_HISTOGRAM_MANIPULATOR_NUB_V_NUDGE) + 1)) { +#line 79 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + result = RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_INSENSITIVE_AREA; +#line 79 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + return result; +#line 360 "RGBHistogramManipulator.c" + } +#line 81 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp12_ = x; +#line 81 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp13_ = self->priv->left_nub_position; +#line 81 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp14_ = x; +#line 81 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp15_ = self->priv->left_nub_position; +#line 81 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp16_ = x; +#line 81 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp17_ = self->priv->right_nub_position; +#line 81 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp18_ = x; +#line 81 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp19_ = self->priv->right_nub_position; +#line 81 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (((_tmp12_ - _tmp13_) * (_tmp14_ - _tmp15_)) < ((_tmp16_ - _tmp17_) * (_tmp18_ - _tmp19_))) { +#line 83 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + result = RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_LEFT_TROUGH; +#line 83 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + return result; +#line 384 "RGBHistogramManipulator.c" + } else { +#line 85 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + result = RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_RIGHT_TROUGH; +#line 85 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + return result; +#line 390 "RGBHistogramManipulator.c" + } +} + + +static gboolean rgb_histogram_manipulator_on_button_press (RGBHistogramManipulator* self, GdkEventButton* event_record) { + gboolean result = FALSE; + GdkEventButton* _tmp0_; + GdkEventButton* _tmp1_; + gdouble _tmp2_; + gint _tmp3_; + RGBHistogramManipulatorLocationCode loc = 0; + GdkEventButton* _tmp4_; + gdouble _tmp5_; + GdkEventButton* _tmp6_; + gdouble _tmp7_; + RGBHistogramManipulatorLocationCode _tmp8_; + gboolean retval = FALSE; + RGBHistogramManipulatorLocationCode _tmp9_; + GdkEventButton* _tmp26_; + GdkEventButton* _tmp27_; + gdouble _tmp28_; + gint _tmp29_; +#line 88 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_val_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self), FALSE); +#line 88 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_val_if_fail (event_record != NULL, FALSE); +#line 91 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp0_ = event_record; +#line 91 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp1_ = event_record; +#line 91 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp2_ = _tmp1_->x; +#line 91 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp3_ = self->priv->offset; +#line 91 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp1_->x = _tmp2_ - _tmp3_; +#line 92 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp4_ = event_record; +#line 92 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp5_ = _tmp4_->x; +#line 92 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp6_ = event_record; +#line 92 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp7_ = _tmp6_->y; +#line 92 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp8_ = rgb_histogram_manipulator_hit_test_point (self, (gint) _tmp5_, (gint) _tmp7_); +#line 92 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + loc = _tmp8_; +#line 93 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + retval = TRUE; +#line 95 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp9_ = loc; +#line 95 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + switch (_tmp9_) { +#line 95 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + case RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_LEFT_NUB: +#line 447 "RGBHistogramManipulator.c" + { + GdkEventButton* _tmp10_; + gdouble _tmp11_; + gint _tmp12_; +#line 97 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp10_ = event_record; +#line 97 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp11_ = _tmp10_->x; +#line 97 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->track_start_x = (gint) _tmp11_; +#line 98 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp12_ = self->priv->left_nub_position; +#line 98 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->track_nub_start_position = _tmp12_; +#line 99 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->is_left_nub_tracking = TRUE; +#line 100 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + break; +#line 466 "RGBHistogramManipulator.c" + } +#line 95 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + case RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_RIGHT_NUB: +#line 470 "RGBHistogramManipulator.c" + { + GdkEventButton* _tmp13_; + gdouble _tmp14_; + gint _tmp15_; +#line 103 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp13_ = event_record; +#line 103 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp14_ = _tmp13_->x; +#line 103 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->track_start_x = (gint) _tmp14_; +#line 104 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp15_ = self->priv->right_nub_position; +#line 104 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->track_nub_start_position = _tmp15_; +#line 105 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->is_right_nub_tracking = TRUE; +#line 106 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + break; +#line 489 "RGBHistogramManipulator.c" + } +#line 95 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + case RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_LEFT_TROUGH: +#line 493 "RGBHistogramManipulator.c" + { + GdkEventButton* _tmp16_; + gdouble _tmp17_; + gint _tmp18_; + gint _tmp19_; + gint _tmp20_; +#line 109 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp16_ = event_record; +#line 109 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp17_ = _tmp16_->x; +#line 109 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->left_nub_position = ((gint) _tmp17_) - RGB_HISTOGRAM_MANIPULATOR_NUB_HALF_WIDTH; +#line 110 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp18_ = self->priv->left_nub_position; +#line 110 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp19_ = self->priv->left_nub_max; +#line 110 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp20_ = CLAMP (_tmp18_, 0, _tmp19_); +#line 110 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->left_nub_position = _tmp20_; +#line 111 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + rgb_histogram_manipulator_force_update (self); +#line 112 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_signal_emit (self, rgb_histogram_manipulator_signals[RGB_HISTOGRAM_MANIPULATOR_NUB_POSITION_CHANGED_SIGNAL], 0); +#line 113 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + rgb_histogram_manipulator_update_nub_extrema (self); +#line 114 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + break; +#line 522 "RGBHistogramManipulator.c" + } +#line 95 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + case RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_RIGHT_TROUGH: +#line 526 "RGBHistogramManipulator.c" + { + GdkEventButton* _tmp21_; + gdouble _tmp22_; + gint _tmp23_; + gint _tmp24_; + gint _tmp25_; +#line 117 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp21_ = event_record; +#line 117 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp22_ = _tmp21_->x; +#line 117 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->right_nub_position = ((gint) _tmp22_) - RGB_HISTOGRAM_MANIPULATOR_NUB_HALF_WIDTH; +#line 118 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp23_ = self->priv->right_nub_position; +#line 118 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp24_ = self->priv->right_nub_min; +#line 118 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp25_ = CLAMP (_tmp23_, _tmp24_, 255); +#line 118 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->right_nub_position = _tmp25_; +#line 119 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + rgb_histogram_manipulator_force_update (self); +#line 120 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_signal_emit (self, rgb_histogram_manipulator_signals[RGB_HISTOGRAM_MANIPULATOR_NUB_POSITION_CHANGED_SIGNAL], 0); +#line 121 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + rgb_histogram_manipulator_update_nub_extrema (self); +#line 122 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + break; +#line 555 "RGBHistogramManipulator.c" + } + default: + { +#line 125 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + retval = FALSE; +#line 126 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + break; +#line 563 "RGBHistogramManipulator.c" + } + } +#line 130 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp26_ = event_record; +#line 130 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp27_ = event_record; +#line 130 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp28_ = _tmp27_->x; +#line 130 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp29_ = self->priv->offset; +#line 130 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp27_->x = _tmp28_ + _tmp29_; +#line 132 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + result = retval; +#line 132 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + return result; +#line 580 "RGBHistogramManipulator.c" +} + + +static gboolean rgb_histogram_manipulator_on_button_release (RGBHistogramManipulator* self, GdkEventButton* event_record) { + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + gboolean _tmp1_; +#line 135 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_val_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self), FALSE); +#line 135 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_val_if_fail (event_record != NULL, FALSE); +#line 136 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp1_ = self->priv->is_left_nub_tracking; +#line 136 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (_tmp1_) { +#line 136 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp0_ = TRUE; +#line 598 "RGBHistogramManipulator.c" + } else { + gboolean _tmp2_; +#line 136 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp2_ = self->priv->is_right_nub_tracking; +#line 136 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp0_ = _tmp2_; +#line 605 "RGBHistogramManipulator.c" + } +#line 136 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (_tmp0_) { +#line 137 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_signal_emit (self, rgb_histogram_manipulator_signals[RGB_HISTOGRAM_MANIPULATOR_NUB_POSITION_CHANGED_SIGNAL], 0); +#line 138 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + rgb_histogram_manipulator_update_nub_extrema (self); +#line 613 "RGBHistogramManipulator.c" + } +#line 141 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->is_left_nub_tracking = FALSE; +#line 142 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->is_right_nub_tracking = FALSE; +#line 144 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + result = FALSE; +#line 144 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + return result; +#line 623 "RGBHistogramManipulator.c" +} + + +static gboolean rgb_histogram_manipulator_on_button_motion (RGBHistogramManipulator* self, GdkEventMotion* event_record) { + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + gboolean _tmp1_; + GdkEventMotion* _tmp3_; + GdkEventMotion* _tmp4_; + gdouble _tmp5_; + gint _tmp6_; + gboolean _tmp7_; + GdkEventMotion* _tmp24_; + GdkEventMotion* _tmp25_; + gdouble _tmp26_; + gint _tmp27_; +#line 147 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_val_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self), FALSE); +#line 147 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_val_if_fail (event_record != NULL, FALSE); +#line 148 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp1_ = self->priv->is_left_nub_tracking; +#line 148 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (!_tmp1_) { +#line 648 "RGBHistogramManipulator.c" + gboolean _tmp2_; +#line 148 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp2_ = self->priv->is_right_nub_tracking; +#line 148 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp0_ = !_tmp2_; +#line 654 "RGBHistogramManipulator.c" + } else { +#line 148 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp0_ = FALSE; +#line 658 "RGBHistogramManipulator.c" + } +#line 148 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (_tmp0_) { +#line 149 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + result = FALSE; +#line 149 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + return result; +#line 666 "RGBHistogramManipulator.c" + } +#line 151 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp3_ = event_record; +#line 151 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp4_ = event_record; +#line 151 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp5_ = _tmp4_->x; +#line 151 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp6_ = self->priv->offset; +#line 151 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp4_->x = _tmp5_ - _tmp6_; +#line 152 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp7_ = self->priv->is_left_nub_tracking; +#line 152 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (_tmp7_) { +#line 682 "RGBHistogramManipulator.c" + gint track_x_delta = 0; + GdkEventMotion* _tmp8_; + gdouble _tmp9_; + gint _tmp10_; + gint _tmp11_; + gint _tmp12_; + gint _tmp13_; + gint _tmp14_; + gint _tmp15_; +#line 153 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp8_ = event_record; +#line 153 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp9_ = _tmp8_->x; +#line 153 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp10_ = self->priv->track_start_x; +#line 153 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + track_x_delta = ((gint) _tmp9_) - _tmp10_; +#line 154 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp11_ = self->priv->track_nub_start_position; +#line 154 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp12_ = track_x_delta; +#line 154 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->left_nub_position = _tmp11_ + _tmp12_; +#line 155 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp13_ = self->priv->left_nub_position; +#line 155 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp14_ = self->priv->left_nub_max; +#line 155 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp15_ = CLAMP (_tmp13_, 0, _tmp14_); +#line 155 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->left_nub_position = _tmp15_; +#line 714 "RGBHistogramManipulator.c" + } else { + gint track_x_delta = 0; + GdkEventMotion* _tmp16_; + gdouble _tmp17_; + gint _tmp18_; + gint _tmp19_; + gint _tmp20_; + gint _tmp21_; + gint _tmp22_; + gint _tmp23_; +#line 157 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp16_ = event_record; +#line 157 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp17_ = _tmp16_->x; +#line 157 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp18_ = self->priv->track_start_x; +#line 157 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + track_x_delta = ((gint) _tmp17_) - _tmp18_; +#line 158 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp19_ = self->priv->track_nub_start_position; +#line 158 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp20_ = track_x_delta; +#line 158 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->right_nub_position = _tmp19_ + _tmp20_; +#line 159 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp21_ = self->priv->right_nub_position; +#line 159 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp22_ = self->priv->right_nub_min; +#line 159 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp23_ = CLAMP (_tmp21_, _tmp22_, 255); +#line 159 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->right_nub_position = _tmp23_; +#line 747 "RGBHistogramManipulator.c" + } +#line 162 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + rgb_histogram_manipulator_force_update (self); +#line 163 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp24_ = event_record; +#line 163 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp25_ = event_record; +#line 163 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp26_ = _tmp25_->x; +#line 163 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp27_ = self->priv->offset; +#line 163 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp25_->x = _tmp26_ + _tmp27_; +#line 165 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + result = TRUE; +#line 165 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + return result; +#line 765 "RGBHistogramManipulator.c" +} + + +static gboolean rgb_histogram_manipulator_real_focus_out_event (GtkWidget* base, GdkEventFocus* event) { + RGBHistogramManipulator * self; + gboolean result = FALSE; + GdkEventFocus* _tmp0_; + gboolean _tmp1_; +#line 168 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_RGB_HISTOGRAM_MANIPULATOR, RGBHistogramManipulator); +#line 168 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_val_if_fail (event != NULL, FALSE); +#line 169 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp0_ = event; +#line 169 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp1_ = GTK_WIDGET_CLASS (rgb_histogram_manipulator_parent_class)->focus_out_event (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_drawing_area_get_type (), GtkDrawingArea), gtk_widget_get_type (), GtkWidget), _tmp0_); +#line 169 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (_tmp1_) { +#line 170 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + result = TRUE; +#line 170 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + return result; +#line 788 "RGBHistogramManipulator.c" + } +#line 173 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + gtk_widget_queue_draw (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget)); +#line 175 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + result = FALSE; +#line 175 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + return result; +#line 796 "RGBHistogramManipulator.c" +} + + +static gboolean rgb_histogram_manipulator_real_key_press_event (GtkWidget* base, GdkEventKey* event) { + RGBHistogramManipulator * self; + gboolean result = FALSE; + GdkEventKey* _tmp0_; + gboolean _tmp1_; + gint delta = 0; + gboolean _tmp2_ = FALSE; + GdkEventKey* _tmp3_; + guint _tmp4_; + gboolean _tmp7_ = FALSE; + GdkEventKey* _tmp8_; + guint _tmp9_; + GdkEventKey* _tmp12_; + GdkModifierType _tmp13_; + gint _tmp15_; + GdkEventKey* _tmp16_; + GdkModifierType _tmp17_; +#line 178 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_RGB_HISTOGRAM_MANIPULATOR, RGBHistogramManipulator); +#line 178 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_val_if_fail (event != NULL, FALSE); +#line 179 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp0_ = event; +#line 179 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp1_ = GTK_WIDGET_CLASS (rgb_histogram_manipulator_parent_class)->key_press_event (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_drawing_area_get_type (), GtkDrawingArea), gtk_widget_get_type (), GtkWidget), _tmp0_); +#line 179 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (_tmp1_) { +#line 180 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + result = TRUE; +#line 180 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + return result; +#line 831 "RGBHistogramManipulator.c" + } +#line 183 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + delta = 0; +#line 185 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp3_ = event; +#line 185 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp4_ = _tmp3_->keyval; +#line 185 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (_tmp4_ == ((guint) GDK_KEY_Left)) { +#line 185 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp2_ = TRUE; +#line 843 "RGBHistogramManipulator.c" + } else { + GdkEventKey* _tmp5_; + guint _tmp6_; +#line 185 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp5_ = event; +#line 185 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp6_ = _tmp5_->keyval; +#line 185 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp2_ = _tmp6_ == ((guint) GDK_KEY_Up); +#line 853 "RGBHistogramManipulator.c" + } +#line 185 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (_tmp2_) { +#line 186 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + delta = -1; +#line 859 "RGBHistogramManipulator.c" + } +#line 189 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp8_ = event; +#line 189 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp9_ = _tmp8_->keyval; +#line 189 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (_tmp9_ == ((guint) GDK_KEY_Right)) { +#line 189 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp7_ = TRUE; +#line 869 "RGBHistogramManipulator.c" + } else { + GdkEventKey* _tmp10_; + guint _tmp11_; +#line 189 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp10_ = event; +#line 189 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp11_ = _tmp10_->keyval; +#line 189 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp7_ = _tmp11_ == ((guint) GDK_KEY_Down); +#line 879 "RGBHistogramManipulator.c" + } +#line 189 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (_tmp7_) { +#line 190 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + delta = 1; +#line 885 "RGBHistogramManipulator.c" + } +#line 193 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp12_ = event; +#line 193 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp13_ = _tmp12_->state; +#line 193 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (!((_tmp13_ & GDK_CONTROL_MASK) == GDK_CONTROL_MASK)) { +#line 893 "RGBHistogramManipulator.c" + gint _tmp14_; +#line 194 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp14_ = delta; +#line 194 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + delta = _tmp14_ * 5; +#line 899 "RGBHistogramManipulator.c" + } +#line 197 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp15_ = delta; +#line 197 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (_tmp15_ == 0) { +#line 198 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + result = FALSE; +#line 198 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + return result; +#line 909 "RGBHistogramManipulator.c" + } +#line 201 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp16_ = event; +#line 201 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp17_ = _tmp16_->state; +#line 201 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if ((_tmp17_ & GDK_SHIFT_MASK) == GDK_SHIFT_MASK) { +#line 917 "RGBHistogramManipulator.c" + gint _tmp18_; + gint _tmp19_; + gint _tmp20_; + gint _tmp21_; + gint _tmp22_; +#line 202 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp18_ = self->priv->right_nub_position; +#line 202 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp19_ = delta; +#line 202 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->right_nub_position = _tmp18_ + _tmp19_; +#line 203 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp20_ = self->priv->right_nub_position; +#line 203 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp21_ = self->priv->right_nub_min; +#line 203 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp22_ = CLAMP (_tmp20_, _tmp21_, 255); +#line 203 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->right_nub_position = _tmp22_; +#line 937 "RGBHistogramManipulator.c" + } else { + gint _tmp23_; + gint _tmp24_; + gint _tmp25_; + gint _tmp26_; + gint _tmp27_; +#line 205 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp23_ = self->priv->left_nub_position; +#line 205 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp24_ = delta; +#line 205 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->left_nub_position = _tmp23_ + _tmp24_; +#line 206 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp25_ = self->priv->left_nub_position; +#line 206 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp26_ = self->priv->left_nub_max; +#line 206 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp27_ = CLAMP (_tmp25_, 0, _tmp26_); +#line 206 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->left_nub_position = _tmp27_; +#line 958 "RGBHistogramManipulator.c" + } +#line 210 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_signal_emit (self, rgb_histogram_manipulator_signals[RGB_HISTOGRAM_MANIPULATOR_NUB_POSITION_CHANGED_SIGNAL], 0); +#line 211 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + rgb_histogram_manipulator_update_nub_extrema (self); +#line 212 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + rgb_histogram_manipulator_force_update (self); +#line 214 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + result = TRUE; +#line 214 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + return result; +#line 970 "RGBHistogramManipulator.c" +} + + +static gboolean rgb_histogram_manipulator_real_draw (GtkWidget* base, cairo_t* ctx) { + RGBHistogramManipulator * self; + gboolean result = FALSE; + GtkBorder padding = {0}; + GtkStyleContext* _tmp0_; + GtkBorder _tmp1_ = {0}; + GdkRectangle area = {0}; + GtkBorder _tmp2_; + gint16 _tmp3_; + gint _tmp4_; + GtkBorder _tmp5_; + gint16 _tmp6_; + GtkBorder _tmp7_; + gint16 _tmp8_; + GtkBorder _tmp9_; + gint16 _tmp10_; + gboolean _tmp11_; + gboolean _tmp12_; + cairo_t* _tmp23_; + GdkRectangle _tmp24_; + cairo_t* _tmp25_; + GdkRectangle _tmp26_; + gint _tmp27_; + cairo_t* _tmp28_; + GdkRectangle _tmp29_; + gint _tmp30_; +#line 217 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_RGB_HISTOGRAM_MANIPULATOR, RGBHistogramManipulator); +#line 217 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_val_if_fail (ctx != NULL, FALSE); +#line 218 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp0_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget)); +#line 218 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + gtk_style_context_get_padding (_tmp0_, GTK_STATE_FLAG_NORMAL, &_tmp1_); +#line 218 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + padding = _tmp1_; +#line 220 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + memset (&area, 0, sizeof (GdkRectangle)); +#line 221 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp2_ = padding; +#line 221 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp3_ = _tmp2_.left; +#line 221 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp4_ = self->priv->offset; +#line 221 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + area.x = _tmp3_ + _tmp4_; +#line 222 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp5_ = padding; +#line 222 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp6_ = _tmp5_.top; +#line 222 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + area.y = (gint) _tmp6_; +#line 223 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp7_ = padding; +#line 223 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp8_ = _tmp7_.right; +#line 223 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + area.width = RGB_HISTOGRAM_GRAPHIC_WIDTH + _tmp8_; +#line 224 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp9_ = padding; +#line 224 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp10_ = _tmp9_.bottom; +#line 224 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + area.height = RGB_HISTOGRAM_GRAPHIC_HEIGHT + _tmp10_; +#line 226 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_object_get (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), "has-focus", &_tmp11_, NULL); +#line 226 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp12_ = _tmp11_; +#line 226 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (_tmp12_) { +#line 1044 "RGBHistogramManipulator.c" + GtkStyleContext* _tmp13_; + cairo_t* _tmp14_; + GdkRectangle _tmp15_; + gint _tmp16_; + GdkRectangle _tmp17_; + gint _tmp18_; + GdkRectangle _tmp19_; + gint _tmp20_; + GdkRectangle _tmp21_; + gint _tmp22_; +#line 227 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp13_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget)); +#line 227 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp14_ = ctx; +#line 227 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp15_ = area; +#line 227 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp16_ = _tmp15_.x; +#line 227 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp17_ = area; +#line 227 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp18_ = _tmp17_.y; +#line 227 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp19_ = area; +#line 227 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp20_ = _tmp19_.width; +#line 227 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp21_ = area; +#line 227 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp22_ = _tmp21_.height; +#line 227 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + gtk_render_focus (_tmp13_, _tmp14_, (gdouble) _tmp16_, (gdouble) _tmp18_, (gdouble) (_tmp20_ + RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE), (gdouble) ((_tmp22_ + RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE) + RGB_HISTOGRAM_MANIPULATOR_NUB_HALF_WIDTH)); +#line 1077 "RGBHistogramManipulator.c" + } +#line 232 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp23_ = ctx; +#line 232 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp24_ = area; +#line 232 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + rgb_histogram_manipulator_draw_histogram (self, _tmp23_, &_tmp24_); +#line 233 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp25_ = ctx; +#line 233 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp26_ = area; +#line 233 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp27_ = self->priv->left_nub_position; +#line 233 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + rgb_histogram_manipulator_draw_nub (self, _tmp25_, &_tmp26_, _tmp27_); +#line 234 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp28_ = ctx; +#line 234 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp29_ = area; +#line 234 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp30_ = self->priv->right_nub_position; +#line 234 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + rgb_histogram_manipulator_draw_nub (self, _tmp28_, &_tmp29_, _tmp30_); +#line 236 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + result = TRUE; +#line 236 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + return result; +#line 1105 "RGBHistogramManipulator.c" +} + + +static void rgb_histogram_manipulator_draw_histogram (RGBHistogramManipulator* self, cairo_t* ctx, GdkRectangle* area) { + RGBHistogram* _tmp0_; + GdkPixbuf* histogram_graphic = NULL; + RGBHistogram* _tmp1_; + GdkPixbuf* _tmp2_; + cairo_t* _tmp3_; + GdkPixbuf* _tmp4_; + GdkRectangle _tmp5_; + gint _tmp6_; + GdkRectangle _tmp7_; + gint _tmp8_; + cairo_t* _tmp9_; + gint _tmp10_; + gint _tmp22_; +#line 239 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self)); +#line 239 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_if_fail (ctx != NULL); +#line 239 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_if_fail (area != NULL); +#line 240 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp0_ = self->priv->histogram; +#line 240 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (_tmp0_ == NULL) { +#line 241 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + return; +#line 1135 "RGBHistogramManipulator.c" + } +#line 243 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp1_ = self->priv->histogram; +#line 243 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp2_ = rgb_histogram_get_graphic (_tmp1_); +#line 243 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + histogram_graphic = _tmp2_; +#line 245 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp3_ = ctx; +#line 245 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp4_ = histogram_graphic; +#line 245 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp5_ = *area; +#line 245 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp6_ = _tmp5_.x; +#line 245 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp7_ = *area; +#line 245 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp8_ = _tmp7_.y; +#line 245 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + gdk_cairo_set_source_pixbuf (_tmp3_, _tmp4_, (gdouble) (_tmp6_ + RGB_HISTOGRAM_MANIPULATOR_NUB_HALF_WIDTH), (gdouble) (_tmp8_ + 2)); +#line 246 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp9_ = ctx; +#line 246 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + cairo_paint (_tmp9_); +#line 248 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp10_ = self->priv->left_nub_position; +#line 248 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (_tmp10_ > 0) { +#line 1165 "RGBHistogramManipulator.c" + cairo_t* _tmp11_; + GdkRectangle _tmp12_; + gint _tmp13_; + GdkRectangle _tmp14_; + gint _tmp15_; + gint _tmp16_; + GdkPixbuf* _tmp17_; + gint _tmp18_; + gint _tmp19_; + cairo_t* _tmp20_; + cairo_t* _tmp21_; +#line 249 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp11_ = ctx; +#line 249 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp12_ = *area; +#line 249 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp13_ = _tmp12_.x; +#line 249 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp14_ = *area; +#line 249 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp15_ = _tmp14_.y; +#line 249 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp16_ = self->priv->left_nub_position; +#line 249 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp17_ = histogram_graphic; +#line 249 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp18_ = gdk_pixbuf_get_height (_tmp17_); +#line 249 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp19_ = _tmp18_; +#line 249 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + cairo_rectangle (_tmp11_, (gdouble) (_tmp13_ + RGB_HISTOGRAM_MANIPULATOR_NUB_HALF_WIDTH), (gdouble) (_tmp15_ + 2), (gdouble) _tmp16_, (gdouble) _tmp19_); +#line 252 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp20_ = ctx; +#line 252 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + cairo_set_source_rgba (_tmp20_, 0.0, 0.0, 0.0, 0.45); +#line 253 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp21_ = ctx; +#line 253 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + cairo_fill (_tmp21_); +#line 1205 "RGBHistogramManipulator.c" + } +#line 256 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp22_ = self->priv->right_nub_position; +#line 256 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (_tmp22_ < 255) { +#line 1211 "RGBHistogramManipulator.c" + cairo_t* _tmp23_; + GdkRectangle _tmp24_; + gint _tmp25_; + gint _tmp26_; + GdkRectangle _tmp27_; + gint _tmp28_; + GdkPixbuf* _tmp29_; + gint _tmp30_; + gint _tmp31_; + gint _tmp32_; + GdkPixbuf* _tmp33_; + gint _tmp34_; + gint _tmp35_; + cairo_t* _tmp36_; + cairo_t* _tmp37_; +#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp23_ = ctx; +#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp24_ = *area; +#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp25_ = _tmp24_.x; +#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp26_ = self->priv->right_nub_position; +#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp27_ = *area; +#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp28_ = _tmp27_.y; +#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp29_ = histogram_graphic; +#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp30_ = gdk_pixbuf_get_width (_tmp29_); +#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp31_ = _tmp30_; +#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp32_ = self->priv->right_nub_position; +#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp33_ = histogram_graphic; +#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp34_ = gdk_pixbuf_get_height (_tmp33_); +#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp35_ = _tmp34_; +#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + cairo_rectangle (_tmp23_, (gdouble) ((_tmp25_ + _tmp26_) + RGB_HISTOGRAM_MANIPULATOR_NUB_HALF_WIDTH), (gdouble) (_tmp28_ + 2), (gdouble) (_tmp31_ - _tmp32_), (gdouble) _tmp35_); +#line 261 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp36_ = ctx; +#line 261 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + cairo_set_source_rgba (_tmp36_, 1.0, 1.0, 1.0, 0.45); +#line 262 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp37_ = ctx; +#line 262 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + cairo_fill (_tmp37_); +#line 1263 "RGBHistogramManipulator.c" + } +#line 239 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _g_object_unref0 (histogram_graphic); +#line 1267 "RGBHistogramManipulator.c" +} + + +static void rgb_histogram_manipulator_draw_nub (RGBHistogramManipulator* self, cairo_t* ctx, GdkRectangle* area, gint position) { + cairo_t* _tmp0_; + GdkRectangle _tmp1_; + gint _tmp2_; + gint _tmp3_; + GdkRectangle _tmp4_; + gint _tmp5_; + cairo_t* _tmp6_; + GdkRectangle _tmp7_; + gint _tmp8_; + gint _tmp9_; + GdkRectangle _tmp10_; + gint _tmp11_; + cairo_t* _tmp12_; + GdkRectangle _tmp13_; + gint _tmp14_; + gint _tmp15_; + GdkRectangle _tmp16_; + gint _tmp17_; + cairo_t* _tmp18_; + cairo_t* _tmp19_; + cairo_t* _tmp20_; +#line 266 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self)); +#line 266 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_if_fail (ctx != NULL); +#line 266 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_if_fail (area != NULL); +#line 267 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp0_ = ctx; +#line 267 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp1_ = *area; +#line 267 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp2_ = _tmp1_.x; +#line 267 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp3_ = position; +#line 267 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp4_ = *area; +#line 267 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp5_ = _tmp4_.y; +#line 267 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + cairo_move_to (_tmp0_, (gdouble) (_tmp2_ + _tmp3_), (gdouble) ((_tmp5_ + RGB_HISTOGRAM_MANIPULATOR_NUB_V_POSITION) + RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE)); +#line 268 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp6_ = ctx; +#line 268 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp7_ = *area; +#line 268 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp8_ = _tmp7_.x; +#line 268 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp9_ = position; +#line 268 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp10_ = *area; +#line 268 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp11_ = _tmp10_.y; +#line 268 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + cairo_line_to (_tmp6_, (gdouble) ((_tmp8_ + _tmp9_) + RGB_HISTOGRAM_MANIPULATOR_NUB_HALF_WIDTH), (gdouble) (_tmp11_ + RGB_HISTOGRAM_MANIPULATOR_NUB_V_POSITION)); +#line 269 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp12_ = ctx; +#line 269 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp13_ = *area; +#line 269 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp14_ = _tmp13_.x; +#line 269 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp15_ = position; +#line 269 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp16_ = *area; +#line 269 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp17_ = _tmp16_.y; +#line 269 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + cairo_line_to (_tmp12_, (gdouble) ((_tmp14_ + _tmp15_) + RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE), (gdouble) ((_tmp17_ + RGB_HISTOGRAM_MANIPULATOR_NUB_V_POSITION) + RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE)); +#line 270 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp18_ = ctx; +#line 270 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + cairo_close_path (_tmp18_); +#line 271 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp19_ = ctx; +#line 271 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + cairo_set_source_rgb (_tmp19_, 0.333, 0.333, 0.333); +#line 272 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp20_ = ctx; +#line 272 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + cairo_fill (_tmp20_); +#line 1353 "RGBHistogramManipulator.c" +} + + +static void rgb_histogram_manipulator_force_update (RGBHistogramManipulator* self) { + GdkWindow* _tmp0_; +#line 275 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self)); +#line 276 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp0_ = gtk_widget_get_window (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget)); +#line 276 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + gdk_window_invalidate_rect (_tmp0_, NULL, TRUE); +#line 1365 "RGBHistogramManipulator.c" +} + + +static void rgb_histogram_manipulator_update_nub_extrema (RGBHistogramManipulator* self) { + gint _tmp0_; + gint _tmp1_; +#line 279 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self)); +#line 280 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp0_ = self->priv->left_nub_position; +#line 280 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->right_nub_min = (_tmp0_ + RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE) + 1; +#line 281 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp1_ = self->priv->right_nub_position; +#line 281 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->left_nub_max = (_tmp1_ - RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE) - 1; +#line 1382 "RGBHistogramManipulator.c" +} + + +void rgb_histogram_manipulator_update_histogram (RGBHistogramManipulator* self, GdkPixbuf* source_pixbuf) { + GdkPixbuf* _tmp0_; + RGBHistogram* _tmp1_; +#line 286 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self)); +#line 286 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_if_fail (GDK_IS_PIXBUF (source_pixbuf)); +#line 287 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp0_ = source_pixbuf; +#line 287 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp1_ = rgb_histogram_new (_tmp0_); +#line 287 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _rgb_histogram_unref0 (self->priv->histogram); +#line 287 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->histogram = _tmp1_; +#line 288 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + rgb_histogram_manipulator_force_update (self); +#line 1403 "RGBHistogramManipulator.c" +} + + +gint rgb_histogram_manipulator_get_left_nub_position (RGBHistogramManipulator* self) { + gint result = 0; + gint _tmp0_; +#line 291 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_val_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self), 0); +#line 292 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp0_ = self->priv->left_nub_position; +#line 292 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + result = _tmp0_; +#line 292 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + return result; +#line 1418 "RGBHistogramManipulator.c" +} + + +gint rgb_histogram_manipulator_get_right_nub_position (RGBHistogramManipulator* self) { + gint result = 0; + gint _tmp0_; +#line 295 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_val_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self), 0); +#line 296 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp0_ = self->priv->right_nub_position; +#line 296 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + result = _tmp0_; +#line 296 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + return result; +#line 1433 "RGBHistogramManipulator.c" +} + + +void rgb_histogram_manipulator_set_left_nub_position (RGBHistogramManipulator* self, gint user_nub_pos) { + gboolean _tmp0_ = FALSE; + gint _tmp1_; + gint _tmp3_; + gint _tmp4_; + gint _tmp5_; +#line 299 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self)); +#line 300 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp1_ = user_nub_pos; +#line 300 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (_tmp1_ >= 0) { +#line 1449 "RGBHistogramManipulator.c" + gint _tmp2_; +#line 300 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp2_ = user_nub_pos; +#line 300 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp0_ = _tmp2_ <= 255; +#line 1455 "RGBHistogramManipulator.c" + } else { +#line 300 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp0_ = FALSE; +#line 1459 "RGBHistogramManipulator.c" + } +#line 300 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _vala_assert (_tmp0_, "(user_nub_pos >= 0) && (user_nub_pos <= 255)"); +#line 301 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp3_ = user_nub_pos; +#line 301 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp4_ = self->priv->left_nub_max; +#line 301 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp5_ = CLAMP (_tmp3_, 0, _tmp4_); +#line 301 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->left_nub_position = _tmp5_; +#line 302 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + rgb_histogram_manipulator_update_nub_extrema (self); +#line 1473 "RGBHistogramManipulator.c" +} + + +void rgb_histogram_manipulator_set_right_nub_position (RGBHistogramManipulator* self, gint user_nub_pos) { + gboolean _tmp0_ = FALSE; + gint _tmp1_; + gint _tmp3_; + gint _tmp4_; + gint _tmp5_; +#line 305 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_return_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self)); +#line 306 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp1_ = user_nub_pos; +#line 306 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + if (_tmp1_ >= 0) { +#line 1489 "RGBHistogramManipulator.c" + gint _tmp2_; +#line 306 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp2_ = user_nub_pos; +#line 306 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp0_ = _tmp2_ <= 255; +#line 1495 "RGBHistogramManipulator.c" + } else { +#line 306 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp0_ = FALSE; +#line 1499 "RGBHistogramManipulator.c" + } +#line 306 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _vala_assert (_tmp0_, "(user_nub_pos >= 0) && (user_nub_pos <= 255)"); +#line 307 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp3_ = user_nub_pos; +#line 307 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp4_ = self->priv->right_nub_min; +#line 307 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp5_ = CLAMP (_tmp3_, _tmp4_, 255); +#line 307 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->right_nub_position = _tmp5_; +#line 308 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + rgb_histogram_manipulator_update_nub_extrema (self); +#line 1513 "RGBHistogramManipulator.c" +} + + +static void rgb_histogram_manipulator_class_init (RGBHistogramManipulatorClass * klass) { + GtkWidgetPath* _tmp0_; + GtkWidgetPath* _tmp1_; +#line 7 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + rgb_histogram_manipulator_parent_class = g_type_class_peek_parent (klass); +#line 7 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + g_type_class_add_private (klass, sizeof (RGBHistogramManipulatorPrivate)); +#line 7 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + ((GtkWidgetClass *) klass)->focus_out_event = (gboolean (*) (GtkWidget *, GdkEventFocus*)) rgb_histogram_manipulator_real_focus_out_event; +#line 7 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + ((GtkWidgetClass *) klass)->key_press_event = (gboolean (*) (GtkWidget *, GdkEventKey*)) rgb_histogram_manipulator_real_key_press_event; +#line 7 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + ((GtkWidgetClass *) klass)->draw = (gboolean (*) (GtkWidget *, cairo_t*)) rgb_histogram_manipulator_real_draw; +#line 7 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + G_OBJECT_CLASS (klass)->finalize = rgb_histogram_manipulator_finalize; +#line 7 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + rgb_histogram_manipulator_signals[RGB_HISTOGRAM_MANIPULATOR_NUB_POSITION_CHANGED_SIGNAL] = g_signal_new ("nub-position-changed", TYPE_RGB_HISTOGRAM_MANIPULATOR, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); +#line 23 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp0_ = gtk_widget_path_new (); +#line 23 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + rgb_histogram_manipulator_slider_draw_path = _tmp0_; +#line 24 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _tmp1_ = gtk_widget_path_new (); +#line 24 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + rgb_histogram_manipulator_frame_draw_path = _tmp1_; +#line 1542 "RGBHistogramManipulator.c" +} + + +static void rgb_histogram_manipulator_instance_init (RGBHistogramManipulator * self) { +#line 7 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv = RGB_HISTOGRAM_MANIPULATOR_GET_PRIVATE (self); +#line 20 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->left_nub_max = (255 - RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE) - 1; +#line 21 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->right_nub_min = RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE + 1; +#line 27 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->histogram = NULL; +#line 28 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->left_nub_position = 0; +#line 29 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->right_nub_position = 255; +#line 30 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->is_left_nub_tracking = FALSE; +#line 31 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->is_right_nub_tracking = FALSE; +#line 32 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->track_start_x = 0; +#line 33 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->track_nub_start_position = 0; +#line 34 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self->priv->offset = 0; +#line 1569 "RGBHistogramManipulator.c" +} + + +static void rgb_histogram_manipulator_finalize (GObject * obj) { + RGBHistogramManipulator * self; +#line 7 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_RGB_HISTOGRAM_MANIPULATOR, RGBHistogramManipulator); +#line 27 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + _rgb_histogram_unref0 (self->priv->histogram); +#line 7 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala" + G_OBJECT_CLASS (rgb_histogram_manipulator_parent_class)->finalize (obj); +#line 1581 "RGBHistogramManipulator.c" +} + + +GType rgb_histogram_manipulator_get_type (void) { + static volatile gsize rgb_histogram_manipulator_type_id__volatile = 0; + if (g_once_init_enter (&rgb_histogram_manipulator_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (RGBHistogramManipulatorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rgb_histogram_manipulator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RGBHistogramManipulator), 0, (GInstanceInitFunc) rgb_histogram_manipulator_instance_init, NULL }; + GType rgb_histogram_manipulator_type_id; + rgb_histogram_manipulator_type_id = g_type_register_static (gtk_drawing_area_get_type (), "RGBHistogramManipulator", &g_define_type_info, 0); + g_once_init_leave (&rgb_histogram_manipulator_type_id__volatile, rgb_histogram_manipulator_type_id); + } + return rgb_histogram_manipulator_type_id__volatile; +} + + + |