forked from AuroraMiddleware/gtk
(James A <jamesa@demon.net> : gtk-jamesa-980511-4.patch)
Tue May 12 16:54:15 1998 Owen Taylor <otaylor@gtk.org> (James A <jamesa@demon.net> : gtk-jamesa-980511-4.patch) * glib.h gstring.c gmessages.c: Added some missing const to arguments. * gutils.c (g_strsignal.c): Added missing return statements. Tue May 12 16:56:35 1998 Owen Taylor <otaylor@gtk.org> (James A <jamesa@demon.net> : gtk-jamesa-980511-4.patch) * gtk/gtkbbox.h gtk/gtkcolorsel.h gtk/gtkvbbox.h: Changed #include "gtkfoo.h" to #include <gtk/gtkfoo.h> * gtk/gtkwindow.[ch]: Added const to gtk_window_set_wmclass Tue May 12 15:16:10 1998 Owen Taylor <otaylor@gtk.org> (From: Christopher James Lahey <clahey@umich.edu>) * gtk/gtkbutton.[ch] gtk/gtkenums.h gtk/gtktoolbar.[ch] gtk/testgtk.c: Added 'relief' for buttons - they can be either GTK_RELIEF_NORMAL (old style), or GTK_RELIEF_NONE - no relief in the NORMAL state. Added gtk_toolbar_{set,get}_button_relief, which set/get the default relief for the toolbars buttons. Added an toggle for the toolbar test in testgtk.c.
This commit is contained in:
parent
fe6ef6c07a
commit
c9e78a1094
20
ChangeLog
20
ChangeLog
@ -1,3 +1,23 @@
|
||||
Tue May 12 16:56:35 1998 Owen Taylor <otaylor@gtk.org>
|
||||
(James A <jamesa@demon.net> : gtk-jamesa-980511-4.patch)
|
||||
|
||||
* gtk/gtkbbox.h gtk/gtkcolorsel.h gtk/gtkvbbox.h:
|
||||
Changed #include "gtkfoo.h" to #include <gtk/gtkfoo.h>
|
||||
|
||||
* gtk/gtkwindow.[ch]: Added const to gtk_window_set_wmclass
|
||||
|
||||
Tue May 12 15:16:10 1998 Owen Taylor <otaylor@gtk.org>
|
||||
(From: Christopher James Lahey <clahey@umich.edu>)
|
||||
|
||||
* gtk/gtkbutton.[ch] gtk/gtkenums.h gtk/gtktoolbar.[ch]
|
||||
gtk/testgtk.c:
|
||||
|
||||
Added 'relief' for buttons - they can be either GTK_RELIEF_NORMAL
|
||||
(old style), or GTK_RELIEF_NONE - no relief in the NORMAL
|
||||
state. Added gtk_toolbar_{set,get}_button_relief, which set/get
|
||||
the default relief for the toolbars buttons. Added an
|
||||
toggle for the toolbar test in testgtk.c.
|
||||
|
||||
Tue May 12 00:24:59 1998 Owen Taylor <otaylor@gtk.org>
|
||||
|
||||
* docs/gtk-config.1: Rewritten and hopefully improved.
|
||||
|
@ -1,3 +1,23 @@
|
||||
Tue May 12 16:56:35 1998 Owen Taylor <otaylor@gtk.org>
|
||||
(James A <jamesa@demon.net> : gtk-jamesa-980511-4.patch)
|
||||
|
||||
* gtk/gtkbbox.h gtk/gtkcolorsel.h gtk/gtkvbbox.h:
|
||||
Changed #include "gtkfoo.h" to #include <gtk/gtkfoo.h>
|
||||
|
||||
* gtk/gtkwindow.[ch]: Added const to gtk_window_set_wmclass
|
||||
|
||||
Tue May 12 15:16:10 1998 Owen Taylor <otaylor@gtk.org>
|
||||
(From: Christopher James Lahey <clahey@umich.edu>)
|
||||
|
||||
* gtk/gtkbutton.[ch] gtk/gtkenums.h gtk/gtktoolbar.[ch]
|
||||
gtk/testgtk.c:
|
||||
|
||||
Added 'relief' for buttons - they can be either GTK_RELIEF_NORMAL
|
||||
(old style), or GTK_RELIEF_NONE - no relief in the NORMAL
|
||||
state. Added gtk_toolbar_{set,get}_button_relief, which set/get
|
||||
the default relief for the toolbars buttons. Added an
|
||||
toggle for the toolbar test in testgtk.c.
|
||||
|
||||
Tue May 12 00:24:59 1998 Owen Taylor <otaylor@gtk.org>
|
||||
|
||||
* docs/gtk-config.1: Rewritten and hopefully improved.
|
||||
|
@ -1,3 +1,23 @@
|
||||
Tue May 12 16:56:35 1998 Owen Taylor <otaylor@gtk.org>
|
||||
(James A <jamesa@demon.net> : gtk-jamesa-980511-4.patch)
|
||||
|
||||
* gtk/gtkbbox.h gtk/gtkcolorsel.h gtk/gtkvbbox.h:
|
||||
Changed #include "gtkfoo.h" to #include <gtk/gtkfoo.h>
|
||||
|
||||
* gtk/gtkwindow.[ch]: Added const to gtk_window_set_wmclass
|
||||
|
||||
Tue May 12 15:16:10 1998 Owen Taylor <otaylor@gtk.org>
|
||||
(From: Christopher James Lahey <clahey@umich.edu>)
|
||||
|
||||
* gtk/gtkbutton.[ch] gtk/gtkenums.h gtk/gtktoolbar.[ch]
|
||||
gtk/testgtk.c:
|
||||
|
||||
Added 'relief' for buttons - they can be either GTK_RELIEF_NORMAL
|
||||
(old style), or GTK_RELIEF_NONE - no relief in the NORMAL
|
||||
state. Added gtk_toolbar_{set,get}_button_relief, which set/get
|
||||
the default relief for the toolbars buttons. Added an
|
||||
toggle for the toolbar test in testgtk.c.
|
||||
|
||||
Tue May 12 00:24:59 1998 Owen Taylor <otaylor@gtk.org>
|
||||
|
||||
* docs/gtk-config.1: Rewritten and hopefully improved.
|
||||
|
@ -1,3 +1,23 @@
|
||||
Tue May 12 16:56:35 1998 Owen Taylor <otaylor@gtk.org>
|
||||
(James A <jamesa@demon.net> : gtk-jamesa-980511-4.patch)
|
||||
|
||||
* gtk/gtkbbox.h gtk/gtkcolorsel.h gtk/gtkvbbox.h:
|
||||
Changed #include "gtkfoo.h" to #include <gtk/gtkfoo.h>
|
||||
|
||||
* gtk/gtkwindow.[ch]: Added const to gtk_window_set_wmclass
|
||||
|
||||
Tue May 12 15:16:10 1998 Owen Taylor <otaylor@gtk.org>
|
||||
(From: Christopher James Lahey <clahey@umich.edu>)
|
||||
|
||||
* gtk/gtkbutton.[ch] gtk/gtkenums.h gtk/gtktoolbar.[ch]
|
||||
gtk/testgtk.c:
|
||||
|
||||
Added 'relief' for buttons - they can be either GTK_RELIEF_NORMAL
|
||||
(old style), or GTK_RELIEF_NONE - no relief in the NORMAL
|
||||
state. Added gtk_toolbar_{set,get}_button_relief, which set/get
|
||||
the default relief for the toolbars buttons. Added an
|
||||
toggle for the toolbar test in testgtk.c.
|
||||
|
||||
Tue May 12 00:24:59 1998 Owen Taylor <otaylor@gtk.org>
|
||||
|
||||
* docs/gtk-config.1: Rewritten and hopefully improved.
|
||||
|
@ -1,3 +1,23 @@
|
||||
Tue May 12 16:56:35 1998 Owen Taylor <otaylor@gtk.org>
|
||||
(James A <jamesa@demon.net> : gtk-jamesa-980511-4.patch)
|
||||
|
||||
* gtk/gtkbbox.h gtk/gtkcolorsel.h gtk/gtkvbbox.h:
|
||||
Changed #include "gtkfoo.h" to #include <gtk/gtkfoo.h>
|
||||
|
||||
* gtk/gtkwindow.[ch]: Added const to gtk_window_set_wmclass
|
||||
|
||||
Tue May 12 15:16:10 1998 Owen Taylor <otaylor@gtk.org>
|
||||
(From: Christopher James Lahey <clahey@umich.edu>)
|
||||
|
||||
* gtk/gtkbutton.[ch] gtk/gtkenums.h gtk/gtktoolbar.[ch]
|
||||
gtk/testgtk.c:
|
||||
|
||||
Added 'relief' for buttons - they can be either GTK_RELIEF_NORMAL
|
||||
(old style), or GTK_RELIEF_NONE - no relief in the NORMAL
|
||||
state. Added gtk_toolbar_{set,get}_button_relief, which set/get
|
||||
the default relief for the toolbars buttons. Added an
|
||||
toggle for the toolbar test in testgtk.c.
|
||||
|
||||
Tue May 12 00:24:59 1998 Owen Taylor <otaylor@gtk.org>
|
||||
|
||||
* docs/gtk-config.1: Rewritten and hopefully improved.
|
||||
|
@ -1,3 +1,23 @@
|
||||
Tue May 12 16:56:35 1998 Owen Taylor <otaylor@gtk.org>
|
||||
(James A <jamesa@demon.net> : gtk-jamesa-980511-4.patch)
|
||||
|
||||
* gtk/gtkbbox.h gtk/gtkcolorsel.h gtk/gtkvbbox.h:
|
||||
Changed #include "gtkfoo.h" to #include <gtk/gtkfoo.h>
|
||||
|
||||
* gtk/gtkwindow.[ch]: Added const to gtk_window_set_wmclass
|
||||
|
||||
Tue May 12 15:16:10 1998 Owen Taylor <otaylor@gtk.org>
|
||||
(From: Christopher James Lahey <clahey@umich.edu>)
|
||||
|
||||
* gtk/gtkbutton.[ch] gtk/gtkenums.h gtk/gtktoolbar.[ch]
|
||||
gtk/testgtk.c:
|
||||
|
||||
Added 'relief' for buttons - they can be either GTK_RELIEF_NORMAL
|
||||
(old style), or GTK_RELIEF_NONE - no relief in the NORMAL
|
||||
state. Added gtk_toolbar_{set,get}_button_relief, which set/get
|
||||
the default relief for the toolbars buttons. Added an
|
||||
toggle for the toolbar test in testgtk.c.
|
||||
|
||||
Tue May 12 00:24:59 1998 Owen Taylor <otaylor@gtk.org>
|
||||
|
||||
* docs/gtk-config.1: Rewritten and hopefully improved.
|
||||
|
@ -1,3 +1,23 @@
|
||||
Tue May 12 16:56:35 1998 Owen Taylor <otaylor@gtk.org>
|
||||
(James A <jamesa@demon.net> : gtk-jamesa-980511-4.patch)
|
||||
|
||||
* gtk/gtkbbox.h gtk/gtkcolorsel.h gtk/gtkvbbox.h:
|
||||
Changed #include "gtkfoo.h" to #include <gtk/gtkfoo.h>
|
||||
|
||||
* gtk/gtkwindow.[ch]: Added const to gtk_window_set_wmclass
|
||||
|
||||
Tue May 12 15:16:10 1998 Owen Taylor <otaylor@gtk.org>
|
||||
(From: Christopher James Lahey <clahey@umich.edu>)
|
||||
|
||||
* gtk/gtkbutton.[ch] gtk/gtkenums.h gtk/gtktoolbar.[ch]
|
||||
gtk/testgtk.c:
|
||||
|
||||
Added 'relief' for buttons - they can be either GTK_RELIEF_NORMAL
|
||||
(old style), or GTK_RELIEF_NONE - no relief in the NORMAL
|
||||
state. Added gtk_toolbar_{set,get}_button_relief, which set/get
|
||||
the default relief for the toolbars buttons. Added an
|
||||
toggle for the toolbar test in testgtk.c.
|
||||
|
||||
Tue May 12 00:24:59 1998 Owen Taylor <otaylor@gtk.org>
|
||||
|
||||
* docs/gtk-config.1: Rewritten and hopefully improved.
|
||||
|
@ -127,7 +127,7 @@ gdk_region_polygon (GdkPoint *points,
|
||||
GdkRegionPrivate *private;
|
||||
GdkRegion *region;
|
||||
Region xregion;
|
||||
gint xfill_rule = 0;
|
||||
gint xfill_rule = EvenOddRule;
|
||||
|
||||
g_return_val_if_fail (points != NULL, NULL);
|
||||
g_return_val_if_fail (npoints != 0, NULL); /* maybe we should check for at least three points */
|
||||
|
@ -127,7 +127,7 @@ gdk_region_polygon (GdkPoint *points,
|
||||
GdkRegionPrivate *private;
|
||||
GdkRegion *region;
|
||||
Region xregion;
|
||||
gint xfill_rule = 0;
|
||||
gint xfill_rule = EvenOddRule;
|
||||
|
||||
g_return_val_if_fail (points != NULL, NULL);
|
||||
g_return_val_if_fail (npoints != 0, NULL); /* maybe we should check for at least three points */
|
||||
|
@ -1,3 +1,12 @@
|
||||
Tue May 12 16:54:15 1998 Owen Taylor <otaylor@gtk.org>
|
||||
|
||||
( James A <jamesa@demon.net> : gtk-jamesa-980511-4.patch)
|
||||
|
||||
* glib.h gstring.c gmessages.c: Added some missing
|
||||
const to arguments.
|
||||
|
||||
* gutils.c (g_strsignal.c): Added missing return statements.
|
||||
|
||||
Mon May 11 21:11:54 1998 Owen Taylor <otaylor@gtk.org>
|
||||
|
||||
* gutils.c gmessages.c: Moved g_error, g_warning, g_message and
|
||||
|
12
glib/glib.h
12
glib/glib.h
@ -684,10 +684,10 @@ gdouble g_timer_elapsed (GTimer *timer,
|
||||
|
||||
/* Output
|
||||
*/
|
||||
void g_error (gchar *format, ...) G_GNUC_PRINTF (1, 2);
|
||||
void g_warning (gchar *format, ...) G_GNUC_PRINTF (1, 2);
|
||||
void g_message (gchar *format, ...) G_GNUC_PRINTF (1, 2);
|
||||
void g_print (gchar *format, ...) G_GNUC_PRINTF (1, 2);
|
||||
void g_error (const gchar *format, ...) G_GNUC_PRINTF (1, 2);
|
||||
void g_warning (const gchar *format, ...) G_GNUC_PRINTF (1, 2);
|
||||
void g_message (const gchar *format, ...) G_GNUC_PRINTF (1, 2);
|
||||
void g_print (const gchar *format, ...) G_GNUC_PRINTF (1, 2);
|
||||
|
||||
/* Utility functions
|
||||
*/
|
||||
@ -742,9 +742,9 @@ void g_stack_trace (const gchar *progname,
|
||||
GStringChunk* g_string_chunk_new (gint size);
|
||||
void g_string_chunk_free (GStringChunk *chunk);
|
||||
gchar* g_string_chunk_insert (GStringChunk *chunk,
|
||||
gchar* string);
|
||||
const gchar *string);
|
||||
gchar* g_string_chunk_insert_const (GStringChunk *chunk,
|
||||
gchar* string);
|
||||
const gchar *string);
|
||||
|
||||
/* Strings
|
||||
*/
|
||||
|
@ -31,7 +31,7 @@ static GPrintFunc glib_print_func = NULL;
|
||||
extern char* g_vsprintf (const gchar *fmt, va_list *args, va_list *args2);
|
||||
|
||||
void
|
||||
g_error (gchar *format, ...)
|
||||
g_error (const gchar *format, ...)
|
||||
{
|
||||
va_list args, args2;
|
||||
char *buf;
|
||||
@ -65,7 +65,7 @@ g_error (gchar *format, ...)
|
||||
}
|
||||
|
||||
void
|
||||
g_warning (gchar *format, ...)
|
||||
g_warning (const gchar *format, ...)
|
||||
{
|
||||
va_list args, args2;
|
||||
char *buf;
|
||||
@ -89,7 +89,7 @@ g_warning (gchar *format, ...)
|
||||
}
|
||||
|
||||
void
|
||||
g_message (gchar *format, ...)
|
||||
g_message (const gchar *format, ...)
|
||||
{
|
||||
va_list args, args2;
|
||||
char *buf;
|
||||
@ -113,7 +113,7 @@ g_message (gchar *format, ...)
|
||||
}
|
||||
|
||||
void
|
||||
g_print (gchar *format, ...)
|
||||
g_print (const gchar *format, ...)
|
||||
{
|
||||
va_list args, args2;
|
||||
char *buf;
|
||||
|
@ -124,7 +124,7 @@ g_string_chunk_free (GStringChunk *fchunk)
|
||||
|
||||
gchar*
|
||||
g_string_chunk_insert (GStringChunk *fchunk,
|
||||
gchar* string)
|
||||
const gchar *string)
|
||||
{
|
||||
GRealStringChunk *chunk = (GRealStringChunk*) fchunk;
|
||||
gint len = strlen (string);
|
||||
@ -160,7 +160,7 @@ g_string_chunk_insert (GStringChunk *fchunk,
|
||||
|
||||
gchar*
|
||||
g_string_chunk_insert_const (GStringChunk *fchunk,
|
||||
gchar* string)
|
||||
const gchar *string)
|
||||
{
|
||||
GRealStringChunk *chunk = (GRealStringChunk*) fchunk;
|
||||
char* lookup;
|
||||
|
@ -570,85 +570,85 @@ g_strsignal (gint signum)
|
||||
case SIGQUIT: return "Quit";
|
||||
#endif
|
||||
#ifdef SIGILL
|
||||
case SIGILL: "Illegal instruction";
|
||||
case SIGILL: return "Illegal instruction";
|
||||
#endif
|
||||
#ifdef SIGTRAP
|
||||
case SIGTRAP: "Trace/breakpoint trap";
|
||||
case SIGTRAP: return "Trace/breakpoint trap";
|
||||
#endif
|
||||
#ifdef SIGABRT
|
||||
case SIGABRT: "IOT trap/Abort";
|
||||
case SIGABRT: return "IOT trap/Abort";
|
||||
#endif
|
||||
#ifdef SIGBUS
|
||||
case SIGBUS: "Bus error";
|
||||
case SIGBUS: return "Bus error";
|
||||
#endif
|
||||
#ifdef SIGFPE
|
||||
case SIGFPE: "Floating point exception";
|
||||
case SIGFPE: return "Floating point exception";
|
||||
#endif
|
||||
#ifdef SIGKILL
|
||||
case SIGKILL: "Killed";
|
||||
case SIGKILL: return "Killed";
|
||||
#endif
|
||||
#ifdef SIGUSR1
|
||||
case SIGUSR1: "User defined signal 1";
|
||||
case SIGUSR1: return "User defined signal 1";
|
||||
#endif
|
||||
#ifdef SIGSEGV
|
||||
case SIGSEGV: "Segmentation fault";
|
||||
case SIGSEGV: return "Segmentation fault";
|
||||
#endif
|
||||
#ifdef SIGUSR2
|
||||
case SIGUSR2: "User defined signal 2";
|
||||
case SIGUSR2: return "User defined signal 2";
|
||||
#endif
|
||||
#ifdef SIGPIPE
|
||||
case SIGPIPE: "Broken pipe";
|
||||
case SIGPIPE: return "Broken pipe";
|
||||
#endif
|
||||
#ifdef SIGALRM
|
||||
case SIGALRM: "Alarm clock";
|
||||
case SIGALRM: return "Alarm clock";
|
||||
#endif
|
||||
#ifdef SIGTERM
|
||||
case SIGTERM: "Terminated";
|
||||
case SIGTERM: return "Terminated";
|
||||
#endif
|
||||
#ifdef SIGSTKFLT
|
||||
case SIGSTKFLT: "Stack fault";
|
||||
case SIGSTKFLT: return "Stack fault";
|
||||
#endif
|
||||
#ifdef SIGCHLD
|
||||
case SIGCHLD: "Child exited";
|
||||
case SIGCHLD: return "Child exited";
|
||||
#endif
|
||||
#ifdef SIGCONT
|
||||
case SIGCONT: "Continued";
|
||||
case SIGCONT: return "Continued";
|
||||
#endif
|
||||
#ifdef SIGSTOP
|
||||
case SIGSTOP: "Stopped (signal)";
|
||||
case SIGSTOP: return "Stopped (signal)";
|
||||
#endif
|
||||
#ifdef SIGTSTP
|
||||
case SIGTSTP: "Stopped";
|
||||
case SIGTSTP: return "Stopped";
|
||||
#endif
|
||||
#ifdef SIGTTIN
|
||||
case SIGTTIN: "Stopped (tty input)";
|
||||
case SIGTTIN: return "Stopped (tty input)";
|
||||
#endif
|
||||
#ifdef SIGTTOU
|
||||
case SIGTTOU: "Stopped (tty output)";
|
||||
case SIGTTOU: return "Stopped (tty output)";
|
||||
#endif
|
||||
#ifdef SIGURG
|
||||
case SIGURG: "Urgent condition";
|
||||
case SIGURG: return "Urgent condition";
|
||||
#endif
|
||||
#ifdef SIGXCPU
|
||||
case SIGXCPU: "CPU time limit exceeded";
|
||||
case SIGXCPU: return "CPU time limit exceeded";
|
||||
#endif
|
||||
#ifdef SIGXFSZ
|
||||
case SIGXFSZ: "File size limit exceeded";
|
||||
case SIGXFSZ: return "File size limit exceeded";
|
||||
#endif
|
||||
#ifdef SIGVTALRM
|
||||
case SIGVTALRM: "Virtual time alarm";
|
||||
case SIGVTALRM: return "Virtual time alarm";
|
||||
#endif
|
||||
#ifdef SIGPROF
|
||||
case SIGPROF: "Profile signal";
|
||||
case SIGPROF: return "Profile signal";
|
||||
#endif
|
||||
#ifdef SIGWINCH
|
||||
case SIGWINCH: "Window size changed";
|
||||
case SIGWINCH: return "Window size changed";
|
||||
#endif
|
||||
#ifdef SIGIO
|
||||
case SIGIO: "Possible I/O";
|
||||
case SIGIO: return "Possible I/O";
|
||||
#endif
|
||||
#ifdef SIGPWR
|
||||
case SIGPWR: "Power failure";
|
||||
case SIGPWR: return "Power failure";
|
||||
#endif
|
||||
#ifdef SIGUNUSED
|
||||
case SIGUNUSED: return "Unused signal";
|
||||
|
@ -19,7 +19,7 @@
|
||||
#ifndef __GTK_BUTTON_BOX_H__
|
||||
#define __GTK_BUTTON_BOX_H__
|
||||
|
||||
#include "gtkbox.h"
|
||||
#include <gtk/gtkbox.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -206,6 +206,7 @@ gtk_button_init (GtkButton *button)
|
||||
button->child = NULL;
|
||||
button->in_button = FALSE;
|
||||
button->button_down = FALSE;
|
||||
button->relief = GTK_RELIEF_NORMAL;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -290,6 +291,25 @@ gtk_button_leave (GtkButton *button)
|
||||
gtk_signal_emit (GTK_OBJECT (button), button_signals[LEAVE]);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_button_set_relief (GtkButton *button,
|
||||
GtkReliefStyle newrelief)
|
||||
{
|
||||
g_return_if_fail (button != NULL);
|
||||
g_return_if_fail (GTK_IS_BUTTON (button));
|
||||
|
||||
button->relief = newrelief;
|
||||
}
|
||||
|
||||
GtkReliefStyle
|
||||
gtk_button_get_relief(GtkButton *button)
|
||||
{
|
||||
g_return_val_if_fail (button != NULL, GTK_RELIEF_NORMAL);
|
||||
g_return_val_if_fail (GTK_IS_BUTTON (button), GTK_RELIEF_NORMAL);
|
||||
|
||||
return button->relief;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_button_map (GtkWidget *widget)
|
||||
{
|
||||
@ -507,7 +527,11 @@ gtk_button_paint (GtkWidget *widget,
|
||||
|
||||
if (gdk_rectangle_intersect (area, &restrict_area, &new_area))
|
||||
{
|
||||
gtk_style_set_background (widget->style, widget->window, GTK_WIDGET_STATE (widget));
|
||||
if ((GTK_WIDGET_STATE (widget) == GTK_STATE_PRELIGHT) &&
|
||||
(GTK_BUTTON (widget)->relief == GTK_RELIEF_NONE))
|
||||
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
|
||||
else
|
||||
gtk_style_set_background (widget->style, widget->window, GTK_WIDGET_STATE (widget));
|
||||
gdk_window_clear_area (widget->window,
|
||||
new_area.x, new_area.y,
|
||||
new_area.width, new_area.height);
|
||||
@ -631,10 +655,14 @@ gtk_button_draw_focus (GtkWidget *widget)
|
||||
gdk_draw_rectangle (widget->window,
|
||||
widget->style->bg_gc[GTK_WIDGET_STATE (widget)], FALSE,
|
||||
x + 1, y + 1, width - 4, height - 4);
|
||||
else
|
||||
else if (button->relief == GTK_RELIEF_NORMAL)
|
||||
gdk_draw_rectangle (widget->window,
|
||||
widget->style->bg_gc[GTK_WIDGET_STATE (widget)], FALSE,
|
||||
x + 2, y + 2, width - 5, height - 5);
|
||||
else
|
||||
gdk_draw_rectangle (widget->window,
|
||||
widget->style->bg_gc[GTK_WIDGET_STATE (widget)], FALSE,
|
||||
x, y, width - 1, height - 1);
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_STATE (widget) == GTK_STATE_ACTIVE)
|
||||
@ -642,9 +670,14 @@ gtk_button_draw_focus (GtkWidget *widget)
|
||||
else
|
||||
shadow_type = GTK_SHADOW_OUT;
|
||||
|
||||
gtk_draw_shadow (widget->style, widget->window,
|
||||
GTK_WIDGET_STATE (widget), shadow_type,
|
||||
x, y, width, height);
|
||||
if ((button->relief == GTK_RELIEF_NORMAL) ||
|
||||
((GTK_WIDGET_STATE (widget) != GTK_STATE_NORMAL) &&
|
||||
(GTK_WIDGET_STATE (widget) != GTK_STATE_INSENSITIVE)))
|
||||
{
|
||||
gtk_draw_shadow (widget->style, widget->window,
|
||||
GTK_WIDGET_STATE (widget), shadow_type,
|
||||
x, y, width, height);
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_HAS_FOCUS (widget))
|
||||
{
|
||||
@ -676,7 +709,7 @@ gtk_button_draw_default (GtkWidget *widget)
|
||||
width = widget->allocation.width - GTK_CONTAINER (widget)->border_width * 2;
|
||||
height = widget->allocation.height - GTK_CONTAINER (widget)->border_width * 2;
|
||||
|
||||
if (GTK_WIDGET_HAS_DEFAULT (widget))
|
||||
if (GTK_WIDGET_HAS_DEFAULT (widget) && gtk_button_get_relief (GTK_BUTTON (widget)) == GTK_RELIEF_NORMAL)
|
||||
{
|
||||
gtk_draw_shadow (widget->style, widget->window,
|
||||
GTK_STATE_NORMAL, GTK_SHADOW_IN,
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include <gtk/gtkcontainer.h>
|
||||
#include <gtk/gtkenums.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -47,12 +48,13 @@ struct _GtkButton
|
||||
|
||||
guint in_button : 1;
|
||||
guint button_down : 1;
|
||||
guint relief : 2;
|
||||
};
|
||||
|
||||
struct _GtkButtonClass
|
||||
{
|
||||
GtkContainerClass parent_class;
|
||||
|
||||
|
||||
void (* pressed) (GtkButton *button);
|
||||
void (* released) (GtkButton *button);
|
||||
void (* clicked) (GtkButton *button);
|
||||
@ -61,14 +63,17 @@ struct _GtkButtonClass
|
||||
};
|
||||
|
||||
|
||||
GtkType gtk_button_get_type (void);
|
||||
GtkWidget* gtk_button_new (void);
|
||||
GtkWidget* gtk_button_new_with_label (const gchar *label);
|
||||
void gtk_button_pressed (GtkButton *button);
|
||||
void gtk_button_released (GtkButton *button);
|
||||
void gtk_button_clicked (GtkButton *button);
|
||||
void gtk_button_enter (GtkButton *button);
|
||||
void gtk_button_leave (GtkButton *button);
|
||||
GtkType gtk_button_get_type (void);
|
||||
GtkWidget* gtk_button_new (void);
|
||||
GtkWidget* gtk_button_new_with_label (const gchar *label);
|
||||
void gtk_button_pressed (GtkButton *button);
|
||||
void gtk_button_released (GtkButton *button);
|
||||
void gtk_button_clicked (GtkButton *button);
|
||||
void gtk_button_enter (GtkButton *button);
|
||||
void gtk_button_leave (GtkButton *button);
|
||||
void gtk_button_set_relief (GtkButton *button,
|
||||
GtkReliefStyle newstyle);
|
||||
GtkReliefStyle gtk_button_get_relief (GtkButton *button);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -24,22 +24,22 @@
|
||||
#include <math.h>
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
#include "gtkwindow.h"
|
||||
#include "gtkvbox.h"
|
||||
#include "gtkframe.h"
|
||||
#include "gtkpreview.h"
|
||||
#include "gtkbutton.h"
|
||||
#include "gtkentry.h"
|
||||
#include "gtkhbox.h"
|
||||
#include "gtklabel.h"
|
||||
#include "gtkmain.h"
|
||||
#include "gtksignal.h"
|
||||
#include "gtkmisc.h"
|
||||
#include "gtkrange.h"
|
||||
#include "gtkscale.h"
|
||||
#include "gtkhscale.h"
|
||||
#include "gtktable.h"
|
||||
#include "gtkeventbox.h"
|
||||
#include <gtk/gtkwindow.h>
|
||||
#include <gtk/gtkvbox.h>
|
||||
#include <gtk/gtkframe.h>
|
||||
#include <gtk/gtkpreview.h>
|
||||
#include <gtk/gtkbutton.h>
|
||||
#include <gtk/gtkentry.h>
|
||||
#include <gtk/gtkhbox.h>
|
||||
#include <gtk/gtklabel.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <gtk/gtkmisc.h>
|
||||
#include <gtk/gtkrange.h>
|
||||
#include <gtk/gtkscale.h>
|
||||
#include <gtk/gtkhscale.h>
|
||||
#include <gtk/gtktable.h>
|
||||
#include <gtk/gtkeventbox.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -209,6 +209,13 @@ typedef enum
|
||||
GTK_TOOLBAR_BOTH
|
||||
} GtkToolbarStyle;
|
||||
|
||||
/* Style for buttons */
|
||||
typedef enum
|
||||
{
|
||||
GTK_RELIEF_NORMAL,
|
||||
GTK_RELIEF_NONE
|
||||
} GtkReliefStyle;
|
||||
|
||||
/* Generic visibility flags */
|
||||
typedef enum
|
||||
{
|
||||
|
@ -160,6 +160,7 @@ gtk_toolbar_init (GtkToolbar *toolbar)
|
||||
toolbar->children = NULL;
|
||||
toolbar->orientation = GTK_ORIENTATION_HORIZONTAL;
|
||||
toolbar->style = GTK_TOOLBAR_ICONS;
|
||||
toolbar->relief = GTK_RELIEF_NORMAL;
|
||||
toolbar->space_size = DEFAULT_SPACE_SIZE;
|
||||
toolbar->tooltips = gtk_tooltips_new ();
|
||||
toolbar->button_maxw = 0;
|
||||
@ -765,7 +766,10 @@ gtk_toolbar_insert_element (GtkToolbar *toolbar,
|
||||
case GTK_TOOLBAR_CHILD_TOGGLEBUTTON:
|
||||
case GTK_TOOLBAR_CHILD_RADIOBUTTON:
|
||||
if (type == GTK_TOOLBAR_CHILD_BUTTON)
|
||||
child->widget = gtk_button_new ();
|
||||
{
|
||||
child->widget = gtk_button_new ();
|
||||
gtk_button_set_relief (GTK_BUTTON (child->widget), toolbar->relief);
|
||||
}
|
||||
else if (type == GTK_TOOLBAR_CHILD_TOGGLEBUTTON)
|
||||
{
|
||||
child->widget = gtk_toggle_button_new ();
|
||||
@ -881,6 +885,40 @@ gtk_toolbar_set_tooltips (GtkToolbar *toolbar,
|
||||
gtk_tooltips_disable (toolbar->tooltips);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_toolbar_set_button_relief (GtkToolbar *toolbar,
|
||||
GtkReliefStyle relief)
|
||||
{
|
||||
GList *children;
|
||||
GtkToolbarChild *child;
|
||||
|
||||
g_return_if_fail (toolbar != NULL);
|
||||
g_return_if_fail (GTK_IS_TOOLBAR (toolbar));
|
||||
|
||||
if (toolbar->relief != relief)
|
||||
{
|
||||
toolbar->relief = relief;
|
||||
|
||||
for (children = toolbar->children; children; children = children->next)
|
||||
{
|
||||
child = children->data;
|
||||
if (child->type == GTK_TOOLBAR_CHILD_BUTTON)
|
||||
gtk_button_set_relief (GTK_BUTTON (child->widget), relief);
|
||||
}
|
||||
|
||||
gtk_widget_queue_resize (GTK_WIDGET (toolbar));
|
||||
}
|
||||
}
|
||||
|
||||
GtkReliefStyle
|
||||
gtk_toolbar_get_button_relief (GtkToolbar *toolbar)
|
||||
{
|
||||
g_return_val_if_fail (toolbar != NULL, GTK_RELIEF_NORMAL);
|
||||
g_return_val_if_fail (GTK_IS_TOOLBAR (toolbar), GTK_RELIEF_NORMAL);
|
||||
|
||||
return toolbar->relief;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_toolbar_marshal_signal_1 (GtkObject *object,
|
||||
GtkSignalFunc func,
|
||||
|
@ -75,6 +75,7 @@ struct _GtkToolbar
|
||||
|
||||
gint button_maxw;
|
||||
gint button_maxh;
|
||||
GtkReliefStyle relief;
|
||||
};
|
||||
|
||||
struct _GtkToolbarClass
|
||||
@ -178,6 +179,9 @@ void gtk_toolbar_set_space_size (GtkToolbar *toolbar,
|
||||
gint space_size);
|
||||
void gtk_toolbar_set_tooltips (GtkToolbar *toolbar,
|
||||
gint enable);
|
||||
void gtk_toolbar_set_button_relief (GtkToolbar *toolbar,
|
||||
GtkReliefStyle relief);
|
||||
GtkReliefStyle gtk_toolbar_get_button_relief (GtkToolbar *toolbar);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -20,7 +20,7 @@
|
||||
#define __GTK_VBUTTON_BOX_H__
|
||||
|
||||
|
||||
#include "gtkbbox.h"
|
||||
#include <gtk/gtkbbox.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -329,8 +329,8 @@ gtk_window_set_title (GtkWindow *window,
|
||||
|
||||
void
|
||||
gtk_window_set_wmclass (GtkWindow *window,
|
||||
gchar *wmclass_name,
|
||||
gchar *wmclass_class)
|
||||
const gchar *wmclass_name,
|
||||
const gchar *wmclass_class)
|
||||
{
|
||||
g_return_if_fail (window != NULL);
|
||||
g_return_if_fail (GTK_IS_WINDOW (window));
|
||||
|
@ -84,8 +84,8 @@ GtkWidget* gtk_window_new (GtkWindowType type);
|
||||
void gtk_window_set_title (GtkWindow *window,
|
||||
const gchar *title);
|
||||
void gtk_window_set_wmclass (GtkWindow *window,
|
||||
gchar *wmclass_name,
|
||||
gchar *wmclass_class);
|
||||
const gchar *wmclass_name,
|
||||
const gchar *wmclass_class);
|
||||
void gtk_window_set_focus (GtkWindow *window,
|
||||
GtkWidget *focus);
|
||||
void gtk_window_set_default (GtkWindow *window,
|
||||
|
@ -648,6 +648,20 @@ set_toolbar_disable (GtkWidget *widget,
|
||||
gtk_toolbar_set_tooltips (GTK_TOOLBAR (data), FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
set_toolbar_borders (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
gtk_toolbar_set_button_relief (GTK_TOOLBAR (data), GTK_RELIEF_NORMAL);
|
||||
}
|
||||
|
||||
static void
|
||||
set_toolbar_borderless (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
gtk_toolbar_set_button_relief (GTK_TOOLBAR (data), GTK_RELIEF_NONE);
|
||||
}
|
||||
|
||||
static void
|
||||
create_toolbar (void)
|
||||
{
|
||||
@ -669,6 +683,7 @@ create_toolbar (void)
|
||||
gtk_widget_realize (window);
|
||||
|
||||
toolbar = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
|
||||
gtk_toolbar_set_button_relief (GTK_TOOLBAR (toolbar), GTK_RELIEF_NONE);
|
||||
|
||||
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
|
||||
"Horizontal", "Horizontal toolbar layout", "Toolbar/Horizontal",
|
||||
@ -722,6 +737,17 @@ create_toolbar (void)
|
||||
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
|
||||
(GtkSignalFunc) set_toolbar_disable, toolbar);
|
||||
|
||||
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
|
||||
|
||||
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
|
||||
"Borders", "Show Borders", NULL,
|
||||
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
|
||||
(GtkSignalFunc) set_toolbar_borders, toolbar);
|
||||
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
|
||||
"Borderless", "Hide Borders", NULL,
|
||||
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
|
||||
(GtkSignalFunc) set_toolbar_borderless, toolbar);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (window), toolbar);
|
||||
gtk_widget_show (toolbar);
|
||||
}
|
||||
@ -741,6 +767,7 @@ make_toolbar (GtkWidget *window)
|
||||
gtk_widget_realize (window);
|
||||
|
||||
toolbar = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
|
||||
gtk_toolbar_set_button_relief (GTK_TOOLBAR (toolbar), GTK_RELIEF_NONE);
|
||||
|
||||
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
|
||||
"Horizontal", "Horizontal toolbar layout", NULL,
|
||||
@ -788,6 +815,17 @@ make_toolbar (GtkWidget *window)
|
||||
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
|
||||
(GtkSignalFunc) set_toolbar_disable, toolbar);
|
||||
|
||||
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
|
||||
|
||||
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
|
||||
"Borders", "Show Borders", NULL,
|
||||
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
|
||||
(GtkSignalFunc) set_toolbar_borders, toolbar);
|
||||
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
|
||||
"Borderless", "Hide Borders", NULL,
|
||||
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
|
||||
(GtkSignalFunc) set_toolbar_borderless, toolbar);
|
||||
|
||||
return toolbar;
|
||||
}
|
||||
|
||||
@ -1553,6 +1591,7 @@ create_handle_box (void)
|
||||
gtk_widget_show (handle_box);
|
||||
|
||||
toolbar = make_toolbar (window);
|
||||
gtk_toolbar_set_button_relief (GTK_TOOLBAR (toolbar), GTK_RELIEF_NORMAL);
|
||||
gtk_container_add (GTK_CONTAINER (handle_box), toolbar);
|
||||
gtk_widget_show (toolbar);
|
||||
|
||||
|
@ -648,6 +648,20 @@ set_toolbar_disable (GtkWidget *widget,
|
||||
gtk_toolbar_set_tooltips (GTK_TOOLBAR (data), FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
set_toolbar_borders (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
gtk_toolbar_set_button_relief (GTK_TOOLBAR (data), GTK_RELIEF_NORMAL);
|
||||
}
|
||||
|
||||
static void
|
||||
set_toolbar_borderless (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
gtk_toolbar_set_button_relief (GTK_TOOLBAR (data), GTK_RELIEF_NONE);
|
||||
}
|
||||
|
||||
static void
|
||||
create_toolbar (void)
|
||||
{
|
||||
@ -669,6 +683,7 @@ create_toolbar (void)
|
||||
gtk_widget_realize (window);
|
||||
|
||||
toolbar = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
|
||||
gtk_toolbar_set_button_relief (GTK_TOOLBAR (toolbar), GTK_RELIEF_NONE);
|
||||
|
||||
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
|
||||
"Horizontal", "Horizontal toolbar layout", "Toolbar/Horizontal",
|
||||
@ -722,6 +737,17 @@ create_toolbar (void)
|
||||
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
|
||||
(GtkSignalFunc) set_toolbar_disable, toolbar);
|
||||
|
||||
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
|
||||
|
||||
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
|
||||
"Borders", "Show Borders", NULL,
|
||||
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
|
||||
(GtkSignalFunc) set_toolbar_borders, toolbar);
|
||||
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
|
||||
"Borderless", "Hide Borders", NULL,
|
||||
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
|
||||
(GtkSignalFunc) set_toolbar_borderless, toolbar);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (window), toolbar);
|
||||
gtk_widget_show (toolbar);
|
||||
}
|
||||
@ -741,6 +767,7 @@ make_toolbar (GtkWidget *window)
|
||||
gtk_widget_realize (window);
|
||||
|
||||
toolbar = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
|
||||
gtk_toolbar_set_button_relief (GTK_TOOLBAR (toolbar), GTK_RELIEF_NONE);
|
||||
|
||||
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
|
||||
"Horizontal", "Horizontal toolbar layout", NULL,
|
||||
@ -788,6 +815,17 @@ make_toolbar (GtkWidget *window)
|
||||
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
|
||||
(GtkSignalFunc) set_toolbar_disable, toolbar);
|
||||
|
||||
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
|
||||
|
||||
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
|
||||
"Borders", "Show Borders", NULL,
|
||||
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
|
||||
(GtkSignalFunc) set_toolbar_borders, toolbar);
|
||||
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
|
||||
"Borderless", "Hide Borders", NULL,
|
||||
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
|
||||
(GtkSignalFunc) set_toolbar_borderless, toolbar);
|
||||
|
||||
return toolbar;
|
||||
}
|
||||
|
||||
@ -1553,6 +1591,7 @@ create_handle_box (void)
|
||||
gtk_widget_show (handle_box);
|
||||
|
||||
toolbar = make_toolbar (window);
|
||||
gtk_toolbar_set_button_relief (GTK_TOOLBAR (toolbar), GTK_RELIEF_NORMAL);
|
||||
gtk_container_add (GTK_CONTAINER (handle_box), toolbar);
|
||||
gtk_widget_show (toolbar);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user