Mercurial > audlegacy
annotate src/audacious/ui_skinned_button.h @ 3021:e3d7490ffd15 trunk
branch merge
author | Tomasz Mon <desowin@gmail.com> |
---|---|
date | Tue, 10 Jul 2007 11:33:37 +0200 |
parents | 3c4ed53a685f |
children | 1912eba1004b |
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 | |
2918
4e71092ab29b
remove evil GPL3 upgrade phrase
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
7 * the Free Software Foundation; under version 2 of the License. |
2822 | 8 * |
9 * This program is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License | |
15 * along with this program; if not, write to the Free Software | |
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
17 */ | |
18 | |
2842
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
19 #ifndef UISKINNEDBUTTON_H |
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
20 #define UISKINNEDBUTTON_H |
2822 | 21 |
22 #include <gdk/gdk.h> | |
23 #include <gtk/gtkbin.h> | |
24 #include <gtk/gtkenums.h> | |
2842
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
25 #include "widgets/skin.h" |
2822 | 26 |
2842
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
27 #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
|
28 #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
|
29 #define UI_SKINNED_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UI_TYPE_SKINNED_BUTTON, UiSkinnedButtonClass)) |
2995
934c1a79904f
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2964
diff
changeset
|
30 #define UI_SKINNED_IS_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UI_TYPE_SKINNED_BUTTON)) |
2842
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
31 #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
|
32 #define UI_SKINNED_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UI_TYPE_SKINNED_BUTTON, GtkFlatButtonClass)) |
2822 | 33 |
2842
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
34 typedef struct _UiSkinnedButton UiSkinnedButton; |
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
35 typedef struct _UiSkinnedButtonClass UiSkinnedButtonClass; |
2822 | 36 |
37 enum { | |
2843
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
38 TYPE_NOT_SET, |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
39 TYPE_PUSH, |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
40 TYPE_TOGGLE, |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
41 TYPE_SMALL |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
42 }; |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
43 |
2842
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
44 struct _UiSkinnedButton { |
2995
934c1a79904f
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2964
diff
changeset
|
45 GtkWidget widget; |
2822 | 46 |
47 GdkWindow *event_window; | |
48 | |
49 gboolean button_down : 1; | |
50 gboolean pressed : 1; | |
51 gboolean hover : 1; | |
2843
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
52 gboolean inside : 1; |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
53 gint type; |
2833 | 54 |
3006
3c4ed53a685f
use ui_skinned_set_push_button_data instead accessing values directly
Tomasz Mon <desowin@gmail.com>
parents:
3005
diff
changeset
|
55 gint x, y; |
2822 | 56 }; |
57 | |
2842
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
58 struct _UiSkinnedButtonClass { |
2995
934c1a79904f
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2964
diff
changeset
|
59 GtkWidgetClass parent_class; |
2964
7926d46872c8
right click on mainwin_about brings menu
Tomasz Mon <desowin@gmail.com>
parents:
2918
diff
changeset
|
60 void (* pressed) (UiSkinnedButton *button); |
7926d46872c8
right click on mainwin_about brings menu
Tomasz Mon <desowin@gmail.com>
parents:
2918
diff
changeset
|
61 void (* released) (UiSkinnedButton *button); |
7926d46872c8
right click on mainwin_about brings menu
Tomasz Mon <desowin@gmail.com>
parents:
2918
diff
changeset
|
62 void (* clicked) (UiSkinnedButton *button); |
7926d46872c8
right click on mainwin_about brings menu
Tomasz Mon <desowin@gmail.com>
parents:
2918
diff
changeset
|
63 void (* right_clicked) (UiSkinnedButton *button); |
7926d46872c8
right click on mainwin_about brings menu
Tomasz Mon <desowin@gmail.com>
parents:
2918
diff
changeset
|
64 void (* doubled) (UiSkinnedButton *button); |
7926d46872c8
right click on mainwin_about brings menu
Tomasz Mon <desowin@gmail.com>
parents:
2918
diff
changeset
|
65 void (* redraw) (UiSkinnedButton *button); |
2822 | 66 }; |
67 | |
2842
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2834
diff
changeset
|
68 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
|
69 GtkWidget* ui_skinned_button_new(); |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
2998
diff
changeset
|
70 void ui_skinned_push_button_setup(GtkWidget *button, GtkWidget *fixed, gint x, gint y, gint w, gint h, gint nx, gint ny, gint px, gint py, SkinPixmapId si); |
2853
bec320cfcc12
use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents:
2844
diff
changeset
|
71 void ui_skinned_set_push_button_data(GtkWidget *button, gint nx, gint ny, gint px, gint py); |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
2998
diff
changeset
|
72 void ui_skinned_toggle_button_setup(GtkWidget *button, GtkWidget *fixed, 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); |
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
2998
diff
changeset
|
73 void ui_skinned_small_button_setup(GtkWidget *button, GtkWidget *fixed, gint x, gint y, gint w, gint h); |
2853
bec320cfcc12
use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents:
2844
diff
changeset
|
74 void ui_skinned_button_set_skin_index(GtkWidget *button, SkinPixmapId si); |
bec320cfcc12
use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents:
2844
diff
changeset
|
75 void ui_skinned_button_set_skin_index1(GtkWidget *button, SkinPixmapId si); |
bec320cfcc12
use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents:
2844
diff
changeset
|
76 void ui_skinned_button_set_skin_index2(GtkWidget *button, SkinPixmapId si); |
2901
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2853
diff
changeset
|
77 void ui_skinned_button_move_relative(GtkWidget *button, gint x, gint y); |
2822 | 78 |
79 #endif |