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