00001 /****************************************************************************** 00002 * Copyright (c) 1999-2008 ACCESS CO., LTD. All rights reserved. 00003 * Copyright (c) 2008 PalmSource, Inc (an ACCESS company). All rights reserved. 00004 *****************************************************************************/ 00014 #ifndef __ALP_COMMAND_BAR_BUTTON_H__ 00015 #define __ALP_COMMAND_BAR_BUTTON_H__ 00016 00017 #include <gdk/gdk.h> 00018 #include <gtk/gtk.h> 00019 00020 G_BEGIN_DECLS 00021 00027 /* @{ */ 00028 00029 #define ALP_TYPE_COMMAND_BAR_BUTTON (alp_command_bar_button_get_type()) 00030 #define ALP_COMMAND_BAR_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ALP_TYPE_COMMAND_BAR_BUTTON, AlpCommandBarButton)) 00031 #define ALP_COMMAND_BAR_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), ALP_TYPE_COMMAND_BAR_BUTTON, AlpCommandBarButtonClass)) 00032 #define ALP_IS_COMMAND_BAR_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ALP_TYPE_COMMAND_BAR_BUTTON)) 00033 #define ALP_IS_COMMAND_BAR_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), ALP_TYPE_COMMAND_BAR_BUTTON)) 00034 #define ALP_COMMAND_BAR_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), ALP_TYPE_COMMAND_BAR_BUTTON, AlpCommandBarButtonClass)) 00035 00036 typedef struct _AlpCommandBarButton AlpCommandBarButton; 00037 typedef struct _AlpCommandBarButtonClass AlpCommandBarButtonClass; 00038 00042 typedef void (*AlpCommandBarButtonDrawFunction) (AlpCommandBarButton* button); 00043 00044 // derive from GtkWidget 00045 struct _AlpCommandBarButtonClass { 00046 GtkWidgetClass parent_class; 00047 00048 void (* pressed) (AlpCommandBarButton *button); 00049 void (* released) (AlpCommandBarButton *button); 00050 void (* clicked) (AlpCommandBarButton *button); 00051 void (* enter) (AlpCommandBarButton *button); 00052 void (* leave) (AlpCommandBarButton *button); 00053 00054 /* Padding for future expansion */ 00055 void (*_gtk_reserved1) (void); 00056 void (*_gtk_reserved2) (void); 00057 void (*_gtk_reserved3) (void); 00058 void (*_gtk_reserved4) (void); 00059 00060 AlpCommandBarButtonDrawFunction draw; 00061 }; 00062 00063 struct _AlpCommandBarButton { 00064 GtkWidget widget; 00065 00066 gchar *label; 00067 }; 00068 00069 00075 GType alp_command_bar_button_get_type (void) G_GNUC_CONST; 00076 00081 GtkWidget* alp_command_bar_button_new (void); 00082 00083 void 00084 alp_command_bar_button_do_press(AlpCommandBarButton* button); 00085 00086 void 00087 alp_command_bar_button_do_release(AlpCommandBarButton* button); 00088 00089 void 00090 alp_command_bar_button_do_clicked(AlpCommandBarButton* button); 00091 00092 void 00093 alp_command_bar_button_do_enter(AlpCommandBarButton* button); 00094 00095 void 00096 alp_command_bar_button_do_leave(AlpCommandBarButton* button); 00097 00101 void 00102 alp_command_bar_button_set_label(AlpCommandBarButton* button, 00103 const gchar* label); 00104 00108 const gchar* 00109 alp_command_bar_button_get_label(AlpCommandBarButton* button); 00110 00111 00116 void 00117 alp_command_bar_button_set_drawing_function(AlpCommandBarButtonDrawFunction draw); 00118 00122 void 00123 alp_command_bar_button_reset_depressed(AlpCommandBarButton* button); 00124 00125 00126 /* @} */ 00127 G_END_DECLS 00128 00129 #endif /* __ALP_COMMAND_BAR_BUTTON_H__ */
Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.