Back to index

im-sdk  12.3.91
gtkflatbutton.h
Go to the documentation of this file.
00001 /* GTK - The GIMP Toolkit
00002  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the
00016  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017  * Boston, MA 02111-1307, USA.
00018  */
00019 
00020 /*
00021  * Modified by the GTK+ Team and others 1997-2001.  See the AUTHORS
00022  * file for a list of people on the GTK+ Team.  See the ChangeLog
00023  * files for a list of changes.  These files are distributed with
00024  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
00025  */
00026 
00027 #ifndef __GTK_FLAT_BUTTON_H__
00028 #define __GTK_FLAT_BUTTON_H__
00029 
00030 
00031 #include <gdk/gdk.h>
00032 #include <gtk/gtkbin.h>
00033 #include <gtk/gtkenums.h>
00034 
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif /* __cplusplus */
00039 
00040 #define GTK_TYPE_FLAT_BUTTON                 (gtk_flat_button_get_type ())
00041 #define GTK_FLAT_BUTTON(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FLAT_BUTTON, GtkFlatButton))
00042 #define GTK_FLAT_BUTTON_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_FLAT_BUTTON, GtkFlatButtonClass))
00043 #define GTK_IS_FLAT_BUTTON(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_FLAT_BUTTON))
00044 #define GTK_IS_FLAT_BUTTON_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FLAT_BUTTON))
00045 #define GTK_FLAT_BUTTON_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_FLAT_BUTTON, GtkFlatButtonClass))
00046 
00047 typedef struct _GtkFlatButton        GtkFlatButton;
00048 typedef struct _GtkFlatButtonClass   GtkFlatButtonClass;
00049 
00050 struct _GtkFlatButton
00051 {
00052   GtkBin bin;
00053 
00054   GdkWindow *event_window;
00055 
00056   gchar *label_text;
00057 
00058   guint activate_timeout;
00059 
00060   guint constructed : 1;
00061   guint in_button : 1;
00062   guint button_down : 1;
00063   guint relief : 2;
00064   guint use_underline : 1;
00065   guint use_stock : 1;
00066   guint depressed : 1;
00067   guint depress_on_activate : 1;
00068   guint focus_on_click : 1;
00069 };
00070 
00071 struct _GtkFlatButtonClass
00072 {
00073   GtkBinClass        parent_class;
00074   
00075   void (* pressed)  (GtkFlatButton *button);
00076   void (* released) (GtkFlatButton *button);
00077   void (* clicked)  (GtkFlatButton *button);
00078   void (* enter)    (GtkFlatButton *button);
00079   void (* leave)    (GtkFlatButton *button);
00080   void (* activate) (GtkFlatButton *button);
00081   
00082   /* Padding for future expansion */
00083   void (*_gtk_reserved1) (void);
00084   void (*_gtk_reserved2) (void);
00085   void (*_gtk_reserved3) (void);
00086   void (*_gtk_reserved4) (void);
00087 };
00088 
00089 
00090 GType          gtk_flat_button_get_type          (void) G_GNUC_CONST;
00091 GtkWidget*     gtk_flat_button_new               (void);
00092 GtkWidget*     gtk_flat_button_new_with_label    (const gchar    *label);
00093 GtkWidget*     gtk_flat_button_new_from_stock    (const gchar    *stock_id);
00094 GtkWidget*     gtk_flat_button_new_with_mnemonic (const gchar    *label);
00095 void           gtk_flat_button_pressed           (GtkFlatButton      *button);
00096 void           gtk_flat_button_released          (GtkFlatButton      *button);
00097 void           gtk_flat_button_clicked           (GtkFlatButton      *button);
00098 void           gtk_flat_button_enter             (GtkFlatButton      *button);
00099 void           gtk_flat_button_leave             (GtkFlatButton      *button);
00100 
00101 void                  gtk_flat_button_set_relief         (GtkFlatButton      *button,
00102                                                GtkReliefStyle  newstyle);
00103 GtkReliefStyle        gtk_flat_button_get_relief         (GtkFlatButton      *button);
00104 void                  gtk_flat_button_set_label          (GtkFlatButton      *button,
00105                                                const gchar    *label);
00106 G_CONST_RETURN gchar *gtk_flat_button_get_label          (GtkFlatButton      *button);
00107 void                  gtk_flat_button_set_use_underline  (GtkFlatButton      *button,
00108                                                gboolean        use_underline);
00109 gboolean              gtk_flat_button_get_use_underline  (GtkFlatButton      *button);
00110 void                  gtk_flat_button_set_use_stock      (GtkFlatButton      *button,
00111                                                gboolean        use_stock);
00112 gboolean              gtk_flat_button_get_use_stock      (GtkFlatButton      *button);
00113 void                  gtk_flat_button_set_focus_on_click (GtkFlatButton      *button,
00114                                                gboolean        focus_on_click);
00115 gboolean              gtk_flat_button_get_focus_on_click (GtkFlatButton      *button);
00116 void                  gtk_flat_button_set_alignment      (GtkFlatButton      *button,
00117                                                gfloat          xalign,
00118                                                gfloat          yalign);
00119 void                  gtk_flat_button_get_alignment      (GtkFlatButton      *button,
00120                                                gfloat         *xalign,
00121                                                gfloat         *yalign);
00122 
00123 
00124 void _gtk_flat_button_set_depressed             (GtkFlatButton     *button,
00125                                        gboolean       depressed);
00126 void _gtk_flat_button_paint                     (GtkFlatButton     *button,
00127                                        GdkRectangle  *area,
00128                                        GtkStateType   state_type,
00129                                        GtkShadowType  shadow_type,
00130                                        const gchar   *main_detail,
00131                                        const gchar   *default_detail);
00132 
00133 #ifdef __cplusplus
00134 }
00135 #endif /* __cplusplus */
00136 
00137 
00138 #endif /* __GTK_FLAT_BUTTON_H__ */