PIKApp/libpikawidgets/pikacolorselector.h

188 lines
8.2 KiB
C
Raw Permalink Normal View History

2023-09-26 00:35:21 +02:00
/* LIBPIKA - The PIKA Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* pikacolorselector.h
* Copyright (C) 2002 Michael Natterer <mitch@gimp.org>
*
* based on:
* Colour selector module
* Copyright (C) 1999 Austin Donnelly <austin@greenend.org.uk>
*
* This library is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <https://www.gnu.org/licenses/>.
*/
#if !defined (__PIKA_WIDGETS_H_INSIDE__) && !defined (PIKA_WIDGETS_COMPILATION)
#error "Only <libpikawidgets/pikawidgets.h> can be included directly."
#endif
#ifndef __PIKA_COLOR_SELECTOR_H__
#define __PIKA_COLOR_SELECTOR_H__
G_BEGIN_DECLS
/* For information look at the html documentation */
/**
* PIKA_COLOR_SELECTOR_SIZE:
*
* The suggested size for a color area in a #PikaColorSelector
* implementation.
**/
#define PIKA_COLOR_SELECTOR_SIZE 150
/**
* PIKA_COLOR_SELECTOR_BAR_SIZE:
*
* The suggested width for a color bar in a #PikaColorSelector
* implementation.
**/
#define PIKA_COLOR_SELECTOR_BAR_SIZE 15
#define PIKA_TYPE_COLOR_SELECTOR (pika_color_selector_get_type ())
#define PIKA_COLOR_SELECTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PIKA_TYPE_COLOR_SELECTOR, PikaColorSelector))
#define PIKA_COLOR_SELECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PIKA_TYPE_COLOR_SELECTOR, PikaColorSelectorClass))
#define PIKA_IS_COLOR_SELECTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PIKA_TYPE_COLOR_SELECTOR))
#define PIKA_IS_COLOR_SELECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PIKA_TYPE_COLOR_SELECTOR))
#define PIKA_COLOR_SELECTOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PIKA_TYPE_COLOR_SELECTOR, PikaColorSelectorClass))
typedef struct _PikaColorSelectorPrivate PikaColorSelectorPrivate;
typedef struct _PikaColorSelectorClass PikaColorSelectorClass;
struct _PikaColorSelector
{
GtkBox parent_instance;
PikaColorSelectorPrivate *priv;
/* FIXME MOVE TO PRIVATE */
gboolean toggles_visible;
gboolean toggles_sensitive;
gboolean show_alpha;
PikaRGB rgb;
PikaHSV hsv;
PikaColorSelectorChannel channel;
};
struct _PikaColorSelectorClass
{
GtkBoxClass parent_class;
const gchar *name;
const gchar *help_id;
const gchar *icon_name;
/* virtual functions */
void (* set_toggles_visible) (PikaColorSelector *selector,
gboolean visible);
void (* set_toggles_sensitive) (PikaColorSelector *selector,
gboolean sensitive);
void (* set_show_alpha) (PikaColorSelector *selector,
gboolean show_alpha);
void (* set_color) (PikaColorSelector *selector,
const PikaRGB *rgb,
const PikaHSV *hsv);
void (* set_channel) (PikaColorSelector *selector,
PikaColorSelectorChannel channel);
void (* set_model_visible) (PikaColorSelector *selector,
PikaColorSelectorModel model,
gboolean visible);
void (* set_config) (PikaColorSelector *selector,
PikaColorConfig *config);
void (* set_simulation) (PikaColorSelector *selector,
PikaColorProfile *profile,
PikaColorRenderingIntent intent,
gboolean bpc);
/* signals */
void (* color_changed) (PikaColorSelector *selector,
const PikaRGB *rgb,
const PikaHSV *hsv);
void (* channel_changed) (PikaColorSelector *selector,
PikaColorSelectorChannel channel);
void (* model_visible_changed) (PikaColorSelector *selector,
PikaColorSelectorModel model,
gboolean visible);
/* Padding for future expansion */
void (* _pika_reserved1) (void);
void (* _pika_reserved2) (void);
void (* _pika_reserved3) (void);
void (* _pika_reserved4) (void);
void (* _pika_reserved5) (void);
void (* _pika_reserved6) (void);
void (* _pika_reserved7) (void);
void (* _pika_reserved8) (void);
};
GType pika_color_selector_get_type (void) G_GNUC_CONST;
GtkWidget * pika_color_selector_new (GType selector_type,
const PikaRGB *rgb,
const PikaHSV *hsv,
PikaColorSelectorChannel channel);
void pika_color_selector_set_toggles_visible (PikaColorSelector *selector,
gboolean visible);
gboolean pika_color_selector_get_toggles_visible (PikaColorSelector *selector);
void pika_color_selector_set_toggles_sensitive (PikaColorSelector *selector,
gboolean sensitive);
gboolean pika_color_selector_get_toggles_sensitive (PikaColorSelector *selector);
void pika_color_selector_set_show_alpha (PikaColorSelector *selector,
gboolean show_alpha);
gboolean pika_color_selector_get_show_alpha (PikaColorSelector *selector);
void pika_color_selector_set_color (PikaColorSelector *selector,
const PikaRGB *rgb,
const PikaHSV *hsv);
void pika_color_selector_get_color (PikaColorSelector *selector,
PikaRGB *rgb,
PikaHSV *hsv);
void pika_color_selector_set_channel (PikaColorSelector *selector,
PikaColorSelectorChannel channel);
PikaColorSelectorChannel
pika_color_selector_get_channel (PikaColorSelector *selector);
void pika_color_selector_set_model_visible (PikaColorSelector *selector,
PikaColorSelectorModel model,
gboolean visible);
gboolean pika_color_selector_get_model_visible (PikaColorSelector *selector,
PikaColorSelectorModel model);
void pika_color_selector_emit_color_changed (PikaColorSelector *selector);
void pika_color_selector_emit_channel_changed (PikaColorSelector *selector);
void pika_color_selector_emit_model_visible_changed (PikaColorSelector *selector,
PikaColorSelectorModel model);
void pika_color_selector_set_config (PikaColorSelector *selector,
PikaColorConfig *config);
void pika_color_selector_set_simulation (PikaColorSelector *selector,
PikaColorProfile *profile,
PikaColorRenderingIntent intent,
gboolean bpc);
G_END_DECLS
#endif /* __PIKA_COLOR_SELECTOR_H__ */