Mercurial > audlegacy
annotate src/audacious/ui_skinned_textbox.h @ 2980:d58560be5a4c trunk
draw directly instead using embeded GtkImage
author | Tomasz Mon <desowin@gmail.com> |
---|---|
date | Wed, 04 Jul 2007 16:35:27 +0200 |
parents | 830fdbec31be |
children | a2eb970ca669 |
rev | line source |
---|---|
2911 | 1 /* |
2 * Audacious - a cross-platform multimedia player | |
3 * Copyright (c) 2007 Audacious development team. | |
4 * | |
2980
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
5 * Based on: |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
6 * BMP - Cross-platform multimedia player |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
7 * Copyright (C) 2003-2004 BMP development team. |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
8 * XMMS: |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
9 * Copyright (C) 1998-2003 XMMS development team. |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
10 * |
2911 | 11 * This program is free software; you can redistribute it and/or modify |
12 * 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:
2911
diff
changeset
|
13 * the Free Software Foundation; under version 2 of the License. |
2911 | 14 * |
15 * This program is distributed in the hope that it will be useful, | |
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 * GNU General Public License for more details. | |
19 * | |
20 * You should have received a copy of the GNU General Public License | |
21 * along with this program; if not, write to the Free Software | |
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
23 */ | |
24 | |
25 #ifndef UISKINNEDTEXTBOX_H | |
26 #define UISKINNEDTEXTBOX_H | |
27 | |
28 #include <gdk/gdk.h> | |
2980
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
29 #include <gtk/gtkadjustment.h> |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
30 #include <gtk/gtkwidget.h> |
2911 | 31 |
2980
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
32 #ifdef __cplusplus |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
33 extern "C" { |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
34 #endif /* __cplusplus */ |
2943
a8f2c99727eb
replace Textbox in playlistwin with UiSkinnedTextbox, textbox.c no longer needed, temporary comment out g_usleep in textbox_scroll as it needs to be run as new thread
Tomasz Mon <desowin@gmail.com>
parents:
2942
diff
changeset
|
35 |
2980
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
36 #define UI_SKINNED_TEXTBOX(obj) GTK_CHECK_CAST (obj, ui_skinned_textbox_get_type (), UiSkinnedTextbox) |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
37 #define UI_SKINNED_TEXTBOX_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, ui_skinned_textbox_get_type (), UiSkinnedTextboxClass) |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
38 #define UI_SKINNED_IS_TEXTBOX(obj) GTK_CHECK_TYPE (obj, ui_skinned_textbox_get_type ()) |
2911 | 39 |
2980
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
40 typedef struct _UiSkinnedTextbox UiSkinnedTextbox; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
41 typedef struct _UiSkinnedTextboxClass UiSkinnedTextboxClass; |
2911 | 42 |
43 struct _UiSkinnedTextbox { | |
2980
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
44 GtkWidget widget; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
45 |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
46 gint x, y, width, height; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
47 gchar *text; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
48 gboolean redraw; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
49 GdkPixmap *img; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
50 GdkGC *gc; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
51 SkinPixmapId skin_index; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
52 GtkWidget *fixed; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
53 gboolean double_size; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
54 gboolean scroll_back; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
55 gint nominal_y, nominal_height; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
56 gint scroll_timeout; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
57 gint font_ascent, font_descent; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
58 PangoFontDescription *font; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
59 gchar *fontname; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
60 gchar *pixmap_text; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
61 gint skin_id; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
62 gint drag_x, drag_off, offset; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
63 gboolean is_scrollable, is_dragging; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
64 gint pixmap_width; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
65 GdkPixmap *pixmap; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
66 gboolean scroll_allowed, scroll_enabled; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
67 gint scroll_dummy; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
68 gint resize_width, resize_height; |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
69 gint move_x, move_y; |
2911 | 70 }; |
71 | |
72 struct _UiSkinnedTextboxClass { | |
2980
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
73 GtkWidgetClass parent_class; |
2942
1a59a0ced6a8
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
Tomasz Mon <desowin@gmail.com>
parents:
2918
diff
changeset
|
74 void (* clicked) (UiSkinnedTextbox *textbox); |
2911 | 75 void (* double_clicked) (UiSkinnedTextbox *textbox); |
2942
1a59a0ced6a8
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
Tomasz Mon <desowin@gmail.com>
parents:
2918
diff
changeset
|
76 void (* right_clicked) (UiSkinnedTextbox *textbox); |
2911 | 77 void (* doubled) (UiSkinnedTextbox *textbox); |
78 void (* redraw) (UiSkinnedTextbox *textbox); | |
79 }; | |
80 | |
2980
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
81 GtkWidget* ui_skinned_textbox_new (GtkWidget *fixed, GdkPixmap * parent, GdkGC * gc, gint x, gint y, gint w, gboolean allow_scroll, SkinPixmapId si); |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
82 GtkType ui_skinned_textbox_get_type(void); |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
83 void ui_skinned_textbox_set_xfont(GtkWidget *widget, gboolean use_xfont, const gchar * fontname); |
2911 | 84 void ui_skinned_textbox_set_text(GtkWidget *widget, const gchar *text); |
85 void ui_skinned_textbox_set_scroll(GtkWidget *widget, gboolean scroll); | |
2943
a8f2c99727eb
replace Textbox in playlistwin with UiSkinnedTextbox, textbox.c no longer needed, temporary comment out g_usleep in textbox_scroll as it needs to be run as new thread
Tomasz Mon <desowin@gmail.com>
parents:
2942
diff
changeset
|
86 void ui_skinned_textbox_move_relative(GtkWidget *widget, gint x, gint y); |
2945
09c216d437b2
Backed out changeset 3c66c8d03c534692d1606ed3ed79634e227f7bd2
William Pitcock <nenolod@atheme.org>
parents:
2944
diff
changeset
|
87 void ui_skinned_textbox_resize_relative(GtkWidget *widget, gint w, gint h); |
2911 | 88 |
2980
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
89 #ifdef __cplusplus |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
90 } |
2911 | 91 #endif |
2980
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
92 |
d58560be5a4c
draw directly instead using embeded GtkImage
Tomasz Mon <desowin@gmail.com>
parents:
2948
diff
changeset
|
93 #endif |