2003-11-11 09:55:45 -08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
2001-11-16 06:13:10 -08:00
|
|
|
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
1999-10-31 13:00:32 -08:00
|
|
|
*
|
2000-02-25 19:41:06 -08:00
|
|
|
* gimpcolorbutton.h
|
2001-01-10 14:49:45 -08:00
|
|
|
* Copyright (C) 1999-2001 Sven Neumann
|
1999-10-31 13:00:32 -08:00
|
|
|
*
|
2009-01-17 14:28:01 -08:00
|
|
|
* This library is free software: you can redistribute it and/or
|
1999-11-17 13:13:50 -08:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1999-10-31 13:00:32 -08:00
|
|
|
* License as published by the Free Software Foundation; either
|
2009-01-17 14:28:01 -08:00
|
|
|
* version 3 of the License, or (at your option) any later version.
|
2003-11-11 09:55:45 -08:00
|
|
|
*
|
|
|
|
|
* 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
|
1999-12-25 23:54:39 -08:00
|
|
|
* Lesser General Public License for more details.
|
1999-10-31 13:00:32 -08:00
|
|
|
*
|
1999-11-17 13:13:50 -08:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2009-01-17 14:28:01 -08:00
|
|
|
* License along with this library. If not, see
|
2018-07-11 14:27:07 -07:00
|
|
|
* <https://www.gnu.org/licenses/>.
|
1999-10-31 13:00:32 -08:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* This provides a button with a color preview. The preview
|
|
|
|
|
* can handle transparency by showing the checkerboard.
|
|
|
|
|
* On click, a color selector is opened, which is already
|
|
|
|
|
* fully functional wired to the preview button.
|
|
|
|
|
*/
|
|
|
|
|
|
2011-04-28 05:30:41 -07:00
|
|
|
#if !defined (__GIMP_WIDGETS_H_INSIDE__) && !defined (GIMP_WIDGETS_COMPILATION)
|
|
|
|
|
#error "Only <libgimpwidgets/gimpwidgets.h> can be included directly."
|
|
|
|
|
#endif
|
|
|
|
|
|
2025-08-13 15:18:34 -07:00
|
|
|
#ifndef __GIMP_COLOR_BUTTON_H__
|
|
|
|
|
#define __GIMP_COLOR_BUTTON_H__
|
|
|
|
|
|
2001-09-21 03:47:19 -07:00
|
|
|
#include <libgimpwidgets/gimpbutton.h>
|
2001-01-14 22:24:24 -08:00
|
|
|
|
2001-11-22 15:46:13 -08:00
|
|
|
G_BEGIN_DECLS
|
1999-10-31 13:00:32 -08:00
|
|
|
|
2025-07-13 03:23:24 -07:00
|
|
|
|
2025-08-13 15:18:34 -07:00
|
|
|
#define GIMP_TYPE_COLOR_BUTTON (gimp_color_button_get_type ())
|
|
|
|
|
G_DECLARE_DERIVABLE_TYPE (GimpColorButton, gimp_color_button, GIMP, COLOR_BUTTON, GimpButton)
|
2001-01-14 22:24:24 -08:00
|
|
|
|
1999-10-31 13:00:32 -08:00
|
|
|
struct _GimpColorButtonClass
|
|
|
|
|
{
|
2001-09-21 03:47:19 -07:00
|
|
|
GimpButtonClass parent_class;
|
1999-10-31 13:00:32 -08:00
|
|
|
|
2004-11-04 04:15:49 -08:00
|
|
|
/* signals */
|
|
|
|
|
void (* color_changed) (GimpColorButton *button);
|
|
|
|
|
|
|
|
|
|
/* virtual functions */
|
|
|
|
|
GType (* get_action_type) (GimpColorButton *button);
|
2004-01-28 16:21:33 -08:00
|
|
|
|
|
|
|
|
/* Padding for future expansion */
|
2024-10-31 12:23:24 -07:00
|
|
|
void (* _gimp_reserved0) (void);
|
2010-12-31 08:35:10 -08:00
|
|
|
void (* _gimp_reserved1) (void);
|
2004-01-28 16:21:33 -08:00
|
|
|
void (* _gimp_reserved2) (void);
|
|
|
|
|
void (* _gimp_reserved3) (void);
|
|
|
|
|
void (* _gimp_reserved4) (void);
|
2018-05-03 03:51:36 -07:00
|
|
|
void (* _gimp_reserved5) (void);
|
|
|
|
|
void (* _gimp_reserved6) (void);
|
|
|
|
|
void (* _gimp_reserved7) (void);
|
|
|
|
|
void (* _gimp_reserved8) (void);
|
2024-10-31 12:23:24 -07:00
|
|
|
void (* _gimp_reserved9) (void);
|
1999-10-31 13:00:32 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2016-09-06 17:22:57 -07:00
|
|
|
GtkWidget * gimp_color_button_new (const gchar *title,
|
|
|
|
|
gint width,
|
|
|
|
|
gint height,
|
2023-11-24 06:35:50 -08:00
|
|
|
GeglColor *color,
|
2016-09-06 17:22:57 -07:00
|
|
|
GimpColorAreaType type);
|
|
|
|
|
|
|
|
|
|
void gimp_color_button_set_title (GimpColorButton *button,
|
|
|
|
|
const gchar *title);
|
|
|
|
|
const gchar * gimp_color_button_get_title (GimpColorButton *button);
|
|
|
|
|
|
|
|
|
|
void gimp_color_button_set_color (GimpColorButton *button,
|
2023-11-24 06:35:50 -08:00
|
|
|
GeglColor *color);
|
|
|
|
|
GeglColor * gimp_color_button_get_color (GimpColorButton *button);
|
2016-09-06 17:22:57 -07:00
|
|
|
|
|
|
|
|
gboolean gimp_color_button_has_alpha (GimpColorButton *button);
|
|
|
|
|
void gimp_color_button_set_type (GimpColorButton *button,
|
|
|
|
|
GimpColorAreaType type);
|
|
|
|
|
|
|
|
|
|
gboolean gimp_color_button_get_update (GimpColorButton *button);
|
|
|
|
|
void gimp_color_button_set_update (GimpColorButton *button,
|
|
|
|
|
gboolean continuous);
|
|
|
|
|
|
|
|
|
|
void gimp_color_button_set_color_config (GimpColorButton *button,
|
|
|
|
|
GimpColorConfig *config);
|
|
|
|
|
|
2025-08-13 15:18:34 -07:00
|
|
|
GSimpleActionGroup * gimp_color_button_get_action_group (GimpColorButton *button);
|
|
|
|
|
|
1999-10-31 13:00:32 -08:00
|
|
|
|
2001-11-22 16:15:42 -08:00
|
|
|
G_END_DECLS
|
2025-08-13 15:18:34 -07:00
|
|
|
|
|
|
|
|
#endif /* __GIMP_COLOR_BUTTON_H__ */
|