2006-06-26 09:47:22 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
|
|
|
*
|
|
|
|
* gimpselectbutton.c
|
|
|
|
* Copyright (C) 2003 Sven Neumann <sven@gimp.org>
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This library is free software: you can redistribute it and/or
|
2006-06-26 09:47:22 +08:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* 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.
|
2006-06-26 09:47:22 +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
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
2006-06-26 09:47:22 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2008-05-24 04:38:52 +08:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2006-06-26 09:47:22 +08:00
|
|
|
#include "gimp.h"
|
2008-05-24 04:38:52 +08:00
|
|
|
|
2006-06-26 09:47:22 +08:00
|
|
|
#include "gimpuitypes.h"
|
|
|
|
#include "gimpselectbutton.h"
|
|
|
|
|
|
|
|
|
2010-07-07 17:48:10 +08:00
|
|
|
/**
|
|
|
|
* SECTION: gimpselectbutton
|
|
|
|
* @title: GimpSelectButton
|
|
|
|
* @short_description: The base class of the data select buttons.
|
|
|
|
*
|
|
|
|
* The base class of the brush, pattern, gradient, palette and font
|
|
|
|
* select buttons.
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
2006-06-26 09:47:22 +08:00
|
|
|
/* local function prototypes */
|
|
|
|
|
2010-10-15 18:17:10 +08:00
|
|
|
static void gimp_select_button_dispose (GObject *object);
|
2006-06-26 09:47:22 +08:00
|
|
|
|
|
|
|
|
|
|
|
G_DEFINE_TYPE (GimpSelectButton, gimp_select_button, GTK_TYPE_HBOX)
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_select_button_class_init (GimpSelectButtonClass *klass)
|
|
|
|
{
|
2010-10-15 18:17:10 +08:00
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
2006-06-26 09:47:22 +08:00
|
|
|
|
2010-10-15 18:17:10 +08:00
|
|
|
object_class->dispose = gimp_select_button_dispose;
|
2006-06-26 09:47:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_select_button_init (GimpSelectButton *select_button)
|
|
|
|
{
|
|
|
|
select_button->temp_callback = NULL;
|
|
|
|
}
|
|
|
|
|
2010-10-15 18:17:10 +08:00
|
|
|
static void
|
|
|
|
gimp_select_button_dispose (GObject *object)
|
|
|
|
{
|
|
|
|
gimp_select_button_close_popup (GIMP_SELECT_BUTTON (object));
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (gimp_select_button_parent_class)->dispose (object);
|
|
|
|
}
|
|
|
|
|
2006-06-26 09:47:22 +08:00
|
|
|
/**
|
|
|
|
* gimp_select_button_close_popup:
|
2006-06-28 18:35:22 +08:00
|
|
|
* @button: A #GimpSelectButton
|
2006-06-26 09:47:22 +08:00
|
|
|
*
|
2006-06-28 18:35:22 +08:00
|
|
|
* Closes the popup window associated with @button.
|
2006-06-26 09:47:22 +08:00
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
|
|
|
*/
|
|
|
|
void
|
2006-06-28 18:35:22 +08:00
|
|
|
gimp_select_button_close_popup (GimpSelectButton *button)
|
2006-06-26 09:47:22 +08:00
|
|
|
{
|
2006-06-28 18:35:22 +08:00
|
|
|
g_return_if_fail (GIMP_IS_SELECT_BUTTON (button));
|
|
|
|
|
|
|
|
if (button->temp_callback)
|
2006-06-26 09:47:22 +08:00
|
|
|
{
|
2006-09-22 17:24:41 +08:00
|
|
|
GimpSelectButtonClass *klass = GIMP_SELECT_BUTTON_GET_CLASS (button);
|
|
|
|
|
|
|
|
klass->select_destroy (button->temp_callback);
|
2006-06-28 18:35:22 +08:00
|
|
|
|
|
|
|
button->temp_callback = NULL;
|
2006-06-26 09:47:22 +08:00
|
|
|
}
|
|
|
|
}
|