Mercurial > audlegacy
annotate src/audacious/ui_skinned_button.h @ 2843:91ef09fe7936 trunk
UiSkinnedButton can now work as TButton
| author | Tomasz Mon <desowin@gmail.com> |
|---|---|
| date | Sun, 17 Jun 2007 15:53:59 +0200 |
| parents | c2622a939e9e |
| children | 22da7cd0eca0 |
| rev | line source |
|---|---|
| 2822 | 1 /* |
| 2 * Audacious - a cross-platform multimedia player | |
| 3 * Copyright (c) 2007 Audacious development team. | |
| 4 * | |
| 5 * This program is free software; you can redistribute it and/or modify | |
| 6 * it under the terms of the GNU General Public License as published by | |
| 7 * the Free Software Foundation; either version 2 of the License, or | |
| 8 * (at your option) any later version. | |
| 9 * | |
| 10 * This program is distributed in the hope that it will be useful, | |
| 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 13 * GNU General Public License for more details. | |
| 14 * | |
| 15 * You should have received a copy of the GNU General Public License | |
| 16 * along with this program; if not, write to the Free Software | |
| 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
| 18 */ | |
| 19 | |
|
2842
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
20 #ifndef UISKINNEDBUTTON_H |
|
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
21 #define UISKINNEDBUTTON_H |
| 2822 | 22 |
| 23 #include <gdk/gdk.h> | |
| 24 #include <gtk/gtkbin.h> | |
| 25 #include <gtk/gtkenums.h> | |
|
2842
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
26 #include "widgets/skin.h" |
| 2822 | 27 |
|
2842
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
28 #define UI_TYPE_SKINNED_BUTTON (ui_skinned_button_get_type()) |
|
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
29 #define UI_SKINNED_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UI_TYPE_SKINNED_BUTTON, UiSkinnedButton)) |
|
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
30 #define UI_SKINNED_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UI_TYPE_SKINNED_BUTTON, UiSkinnedButtonClass)) |
|
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
31 #define UI_IS_SKINNED_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UI_TYPE_SKINNED_BUTTON)) |
|
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
32 #define UI_IS_SKINNED_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UI_TYPE_SKINNED_BUTTON)) |
|
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
33 #define UI_SKINNED_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UI_TYPE_SKINNED_BUTTON, GtkFlatButtonClass)) |
| 2822 | 34 |
|
2842
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
35 typedef struct _UiSkinnedButton UiSkinnedButton; |
|
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
36 typedef struct _UiSkinnedButtonClass UiSkinnedButtonClass; |
| 2822 | 37 |
| 38 enum { | |
| 39 PRESSED, | |
| 40 RELEASED, | |
| 41 CLICKED, | |
| 42 DOUBLED, | |
|
2829
4eda78b785ed
[svn] - draw_main_window redraws custom gtk widgets
desowin
parents:
2822
diff
changeset
|
43 REDRAW, |
| 2822 | 44 LAST_SIGNAL |
| 45 }; | |
| 46 | |
|
2843
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
47 enum { |
|
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
48 TYPE_NOT_SET, |
|
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
49 TYPE_PUSH, |
|
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
50 TYPE_TOGGLE, |
|
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
51 TYPE_SMALL |
|
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
52 }; |
|
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
53 |
|
2842
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
54 struct _UiSkinnedButton { |
| 2822 | 55 GtkBin bin; |
| 56 | |
| 57 GdkWindow *event_window; | |
| 58 | |
| 59 gboolean button_down : 1; | |
| 60 gboolean pressed : 1; | |
| 61 gboolean hover : 1; | |
|
2843
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
62 gboolean inside : 1; |
|
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
63 gint type; |
| 2822 | 64 //Skinned part, used in ui_playlist.c |
| 65 gint x, y, nx, ny, px, py; | |
| 2833 | 66 |
|
2843
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
67 //Toogle button needs also those |
|
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
68 gint pnx, pny, ppx, ppy; |
|
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
69 |
| 2833 | 70 gboolean redraw; |
| 2822 | 71 }; |
| 72 | |
|
2842
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
73 struct _UiSkinnedButtonClass { |
| 2822 | 74 GtkBinClass parent_class; |
|
2842
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
75 void (* pressed) (UiSkinnedButton *button); |
|
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
76 void (* released) (UiSkinnedButton *button); |
|
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
77 void (* clicked) (UiSkinnedButton *button); |
|
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
78 void (* doubled) (UiSkinnedButton *button); |
|
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
79 void (* redraw) (UiSkinnedButton *button); |
| 2822 | 80 }; |
| 81 | |
|
2842
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
82 GType ui_skinned_button_get_type(void) G_GNUC_CONST; |
|
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
83 GtkWidget* ui_skinned_button_new(); |
|
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
84 void ui_skinned_push_button_setup(GtkWidget *button, GtkWidget *fixed, GdkPixmap * parent, GdkGC * gc, gint x, gint y, gint w, gint h, gint nx, gint ny, gint px, gint py, SkinPixmapId si); |
|
2843
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
85 void ui_skinned_toggle_button_setup(GtkWidget *button, GtkWidget *fixed, GdkPixmap *parent, GdkGC *gc, gint x, gint y, gint w, gint h, gint nx, gint ny, gint px, gint py, gint pnx, gint pny, gint ppx, gint ppy, SkinPixmapId si); |
| 2822 | 86 |
| 87 #endif |
