This is completely evil:

2008-06-28  Michael Natterer  <mitch@gimp.org>

	This is completely evil:

	* app/widgets/Makefile.am
	* app/widgets/gimpscalebutton.[ch]: copy GtkScaleButton from GTK+
	upstream trunk and hack around until symbol conflicts are gone
	and it builds.

	* app/widgets/gimppropwidgets.c
	* app/widgets/gtkscalebutton.[ch]: use the hacked version instead
	of the one from GTK+. Set the orientation to horizontal.


svn path=/trunk/; revision=26013
This commit is contained in:
Michael Natterer 2008-06-28 19:01:25 +00:00 committed by Michael Natterer
parent 4a7f395eae
commit 07197c4880
7 changed files with 1710 additions and 5 deletions

View File

@ -1,3 +1,16 @@
2008-06-28 Michael Natterer <mitch@gimp.org>
This is completely evil:
* app/widgets/Makefile.am
* app/widgets/gimpscalebutton.[ch]: copy GtkScaleButton from GTK+
upstream trunk and hack around until symbol conflicts are gone
and it builds.
* app/widgets/gimppropwidgets.c
* app/widgets/gtkscalebutton.[ch]: use the hacked version instead
of the one from GTK+. Set the orientation to horizontal.
2008-06-28 Michael Natterer <mitch@gimp.org>
* plug-ins/common/animation-play.c

View File

@ -341,6 +341,8 @@ libappwidgets_a_sources = \
gimpwidgets-utils.h \
gimpwindow.c \
gimpwindow.h \
gtkscalebutton.c \
gtkscalebutton.h \
gtkwrapbox.c \
gtkwrapbox.h \
gtkhwrapbox.c \

View File

@ -25,6 +25,9 @@
#include <string.h>
#include <stdlib.h>
#define __GTK_SCALE_BUTTON_H__
#define __GTK_VOLUME_BUTTON_H__
#include <gtk/gtk.h>
#include "libgimpcolor/gimpcolor.h"
@ -433,7 +436,7 @@ gimp_prop_scale_button_notify (GObject *config,
gimp_prop_scale_button_callback,
config);
gtk_scale_button_set_value (GTK_SCALE_BUTTON (button), value);
gimp_gtk_scale_button_set_value (GTK_SCALE_BUTTON (button), value);
g_signal_handlers_unblock_by_func (button,
gimp_prop_scale_button_callback,

View File

@ -21,6 +21,9 @@
#include "config.h"
#define __GTK_SCALE_BUTTON_H__
#define __GTK_VOLUME_BUTTON_H__
#include <gtk/gtk.h>
#include "widgets-types.h"
@ -88,7 +91,7 @@ gimp_scale_button_update_tooltip (GimpScaleButton *button)
GtkAdjustment *adj;
gchar *text;
adj = gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (button));
adj = gimp_gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (button));
/* use U+2009 THIN SPACE to seperate the percent sign from the number */
@ -114,7 +117,7 @@ gimp_scale_button_image_expose (GtkWidget *widget,
steps = MIN (widget->allocation.width, widget->allocation.height) / 2;
adj = gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (button));
adj = gimp_gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (button));
if (steps < 1)
return TRUE;
@ -181,7 +184,8 @@ gimp_scale_button_new (gdouble value,
adj = gtk_adjustment_new (value, min, max, step, step, 0);
return g_object_new (GIMP_TYPE_SCALE_BUTTON,
"adjustment", adj,
"size", GTK_ICON_SIZE_MENU,
"orientation", GTK_ORIENTATION_HORIZONTAL,
"adjustment", adj,
"size", GTK_ICON_SIZE_MENU,
NULL);
}

View File

@ -23,6 +23,9 @@
#define __GIMP_SCALE_BUTTON_H__
#include "gtkscalebutton.h"
#define GIMP_TYPE_SCALE_BUTTON (gimp_scale_button_get_type ())
#define GIMP_SCALE_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_SCALE_BUTTON, GimpScaleButton))
#define GIMP_SCALE_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_SCALE_BUTTON, GimpScaleButtonClass))

1580
app/widgets/gtkscalebutton.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,100 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2005 Ronald S. Bultje
* Copyright (C) 2006, 2007 Christian Persch
* Copyright (C) 2006 Jan Arne Petersen
* Copyright (C) 2007 Red Hat, Inc.
*
* Authors:
* - Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* - Bastien Nocera <bnocera@redhat.com>
* - Jan Arne Petersen <jpetersen@jpetersen.org>
* - Christian Persch <chpe@svn.gnome.org>
*
* 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 2 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, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GTK+ Team and others 2007. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __GIMP_GTK_SCALE_BUTTON_H__
#define __GIMP_GTK_SCALE_BUTTON_H__
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define GTK_TYPE_SCALE_BUTTON (gimp_gtk_scale_button_get_type ())
#define GTK_SCALE_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SCALE_BUTTON, GtkScaleButton))
#define GTK_SCALE_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SCALE_BUTTON, GtkScaleButtonClass))
#define GTK_IS_SCALE_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SCALE_BUTTON))
#define GTK_IS_SCALE_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SCALE_BUTTON))
#define GTK_SCALE_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SCALE_BUTTON, GtkScaleButtonClass))
typedef struct _GtkScaleButton GtkScaleButton;
typedef struct _GtkScaleButtonClass GtkScaleButtonClass;
typedef struct _GtkScaleButtonPrivate GtkScaleButtonPrivate;
struct _GtkScaleButton
{
GtkButton parent;
GtkWidget *GSEAL (plus_button);
GtkWidget *GSEAL (minus_button);
/*< private >*/
GtkScaleButtonPrivate *GSEAL (priv);
};
struct _GtkScaleButtonClass
{
GtkButtonClass parent_class;
/* signals */
void (* value_changed) (GtkScaleButton *button,
gdouble value);
/* Padding for future expansion */
void (*_gtk_reserved1) (void);
void (*_gtk_reserved2) (void);
void (*_gtk_reserved3) (void);
void (*_gtk_reserved4) (void);
};
GType gimp_gtk_scale_button_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_gtk_scale_button_new (GtkIconSize size,
gdouble min,
gdouble max,
gdouble step,
const gchar **icons);
void gimp_gtk_scale_button_set_icons (GtkScaleButton *button,
const gchar **icons);
gdouble gimp_gtk_scale_button_get_value (GtkScaleButton *button);
void gimp_gtk_scale_button_set_value (GtkScaleButton *button,
gdouble value);
GtkAdjustment * gimp_gtk_scale_button_get_adjustment (GtkScaleButton *button);
void gimp_gtk_scale_button_set_adjustment (GtkScaleButton *button,
GtkAdjustment *adjustment);
GtkOrientation gimp_gtk_scale_button_get_orientation (GtkScaleButton *button);
void gimp_gtk_scale_button_set_orientation (GtkScaleButton *button,
GtkOrientation orientation);
G_END_DECLS
#endif /* __GTK_SCALE_BUTTON_H__ */