1 /* gstyle-color-plane.h
2  *
3  * based on : gtk-color-plane
4  *   GTK - The GIMP Toolkit
5  *   Copyright 2012 Red Hat, Inc.
6  *
7  * Copyright 2016 sebastien lafargue <slafargue@gnome.org>
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21  *
22  * SPDX-License-Identifier: GPL-3.0-or-later
23  */
24 
25 #pragma once
26 
27 #include <glib-object.h>
28 #include <gtk/gtk.h>
29 #include <gdk/gdk.h>
30 
31 #include "gstyle-color.h"
32 #include "gstyle-color-component.h"
33 #include "gstyle-color-convert.h"
34 #include "gstyle-color-filter.h"
35 #include "gstyle-xyz.h"
36 
37 G_BEGIN_DECLS
38 
39 #define GSTYLE_TYPE_COLOR_PLANE (gstyle_color_plane_get_type())
40 #define GSTYLE_TYPE_COLOR_PLANE_MODE (gstyle_color_plane_mode_get_type())
41 
42 G_DECLARE_DERIVABLE_TYPE (GstyleColorPlane, gstyle_color_plane, GSTYLE, COLOR_PLANE, GtkDrawingArea)
43 
44 typedef enum
45 {
46   GSTYLE_COLOR_PLANE_MODE_HUE,
47   GSTYLE_COLOR_PLANE_MODE_SATURATION,
48   GSTYLE_COLOR_PLANE_MODE_BRIGHTNESS,
49   GSTYLE_COLOR_PLANE_MODE_CIELAB_L,
50   GSTYLE_COLOR_PLANE_MODE_CIELAB_A,
51   GSTYLE_COLOR_PLANE_MODE_CIELAB_B,
52   GSTYLE_COLOR_PLANE_MODE_RED,
53   GSTYLE_COLOR_PLANE_MODE_GREEN,
54   GSTYLE_COLOR_PLANE_MODE_BLUE,
55   GSTYLE_COLOR_PLANE_MODE_NONE
56 } GstyleColorPlaneMode;
57 
58 struct _GstyleColorPlaneClass
59 {
60   GtkDrawingAreaClass parent;
61 };
62 
63 GType                  gstyle_color_plane_mode_get_type                 (void);
64 
65 GstyleColorPlane      *gstyle_color_plane_new                           (void);
66 GtkAdjustment         *gstyle_color_plane_get_component_adjustment      (GstyleColorPlane       *self,
67                                                                          GstyleColorComponent    comp);
68 GstyleColorFilterFunc  gstyle_color_plane_get_filter_func               (GstyleColorPlane       *self);
69 void                   gstyle_color_plane_get_filtered_rgba             (GstyleColorPlane       *self,
70                                                                          GdkRGBA                *rgba);
71 void                   gstyle_color_plane_get_rgba                      (GstyleColorPlane       *self,
72                                                                          GdkRGBA                *rgba);
73 void                   gstyle_color_plane_get_xyz                       (GstyleColorPlane       *self,
74                                                                          GstyleXYZ              *xyz);
75 void                   gstyle_color_plane_set_filter_func               (GstyleColorPlane       *self,
76                                                                          GstyleColorFilterFunc   filter_cb,
77                                                                          gpointer                user_data);
78 void                   gstyle_color_plane_set_mode                      (GstyleColorPlane       *self,
79                                                                          GstyleColorPlaneMode    mode);
80 void                   gstyle_color_plane_set_preferred_unit            (GstyleColorPlane       *self,
81                                                                          GstyleColorUnit         preferred_unit);
82 void                   gstyle_color_plane_set_rgba                      (GstyleColorPlane       *self,
83                                                                          const GdkRGBA          *rgba);
84 void                   gstyle_color_plane_set_xyz                       (GstyleColorPlane       *self,
85                                                                          const GstyleXYZ        *xyz);
86 
87 G_END_DECLS
88