Mercurial > audlegacy
annotate Plugins/General/lirc/about.c @ 496:e52d8e22e718 trunk
[svn] Input buffers are always 3 seconds ahead of what you hear... compensate for this.
author | nenolod |
---|---|
date | Tue, 24 Jan 2006 21:47:40 -0800 |
parents | 085b94826d27 |
children | 3312c831db3e |
rev | line source |
---|---|
156 | 1 /* LIRC Plugin |
2 | |
3 Copyright (C) 2005 Audacious development team | |
4 | |
5 Copyright (c) 1998-1999 Carl van Schaik (carl@leg.uct.ac.za) | |
6 code from gtuner lirc plugin | |
7 cRadio, kTuner, gtuner (c) 1998-1999 Carl van Schaik | |
8 | |
9 Copyright (C) 2000 Christoph Bartelmus (xmms@bartelmus.de) | |
10 | |
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 | |
13 the Free Software Foundation; either version 2 of the License, or | |
14 (at your option) any later version. | |
15 | |
16 This program is distributed in the hope that it will be useful, | |
17 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 GNU General Public License for more details. | |
20 | |
21 You should have received a copy of the GNU General Public License | |
22 along with this program; if not, write to the Free Software | |
23 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
24 */ | |
25 | |
26 #ifdef HAVE_CONFIG_H | |
27 # include "config.h" | |
28 #endif | |
29 | |
30 #include <gtk/gtk.h> | |
31 | |
32 #include "lirc.h" | |
33 #include "lirc_image.h" | |
34 #include "lirc_mini.xpm" | |
35 | |
36 #include <gdk/gdkx.h> | |
37 | |
38 static void win_set_icon (GtkWidget *win, char** image); | |
39 | |
40 static GtkWidget *dialog = NULL; | |
41 static GdkPixmap *icon; | |
42 static GdkBitmap *icon_mask; | |
43 | |
44 void about_close_cb(GtkWidget *w,gpointer data) | |
45 { | |
46 gtk_widget_destroy(dialog); | |
47 gdk_pixmap_unref(icon); | |
48 gdk_bitmap_unref(icon_mask); | |
49 } | |
50 | |
51 void about(void) | |
52 { | |
53 GdkPixmap *pixmap; | |
54 GtkWidget *bbox,*about_credits_logo_box,*about_credits_logo_frame; | |
55 GtkWidget *about_credits_logo; | |
56 GtkWidget *button,*label; | |
57 | |
58 if(dialog) return; | |
59 | |
60 dialog=gtk_dialog_new(); | |
61 gtk_window_set_title(GTK_WINDOW(dialog), | |
62 "About LIRC xmms-plugin " VERSION); | |
63 g_signal_connect(G_OBJECT(dialog),"destroy", | |
64 G_CALLBACK(gtk_widget_destroyed), | |
65 &dialog); | |
66 gtk_widget_realize(dialog); | |
67 | |
68 pixmap=gdk_pixmap_create_from_xpm_d(dialog->window, | |
69 NULL, NULL, lirc_image); | |
70 | |
71 about_credits_logo_box = gtk_hbox_new(TRUE, 0); | |
72 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), | |
73 about_credits_logo_box, FALSE, FALSE, 0); | |
74 about_credits_logo_frame = gtk_frame_new(NULL); | |
75 gtk_frame_set_shadow_type(GTK_FRAME(about_credits_logo_frame), | |
76 GTK_SHADOW_OUT); | |
77 gtk_box_pack_start(GTK_BOX(about_credits_logo_box), | |
78 about_credits_logo_frame, FALSE, FALSE, 0); | |
79 | |
80 about_credits_logo = gtk_pixmap_new(pixmap, NULL); | |
81 gdk_pixmap_unref(pixmap); | |
82 | |
83 gtk_container_add(GTK_CONTAINER(about_credits_logo_frame), | |
84 about_credits_logo); | |
85 | |
86 gtk_container_border_width(GTK_CONTAINER(dialog),5); | |
87 | |
88 label=gtk_label_new("LIRC Plugin " VERSION "\n\ | |
89 A simple plugin that lets you control\n\ | |
90 audacious using the LIRC remote control daemon\n\n\ | |
91 Adapted for audacious usage by Tony Vroon <chainsaw@gentoo.org>\n\ | |
92 from the XMMS LIRC plugin by:\n\ | |
93 Carl van Schaik <carl@leg.uct.ac.za>\n\ | |
94 Christoph Bartelmus <xmms@bartelmus.de>\n\ | |
95 You can get LIRC information at:\n\ | |
96 http://fsinfo.cs.uni-sb.de/~columbus/lirc/index.html" | |
97 ); | |
98 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox),label, | |
99 TRUE,TRUE,10); | |
100 | |
101 bbox = gtk_hbutton_box_new(); | |
102 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END); | |
103 gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5); | |
104 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), | |
105 bbox, FALSE, FALSE, 0); | |
106 | |
107 button = gtk_button_new_with_label(("Close")); | |
108 g_signal_connect_object(G_OBJECT(button), "clicked", | |
109 G_CALLBACK(about_close_cb), NULL,G_CONNECT_SWAPPED) ; | |
110 | |
111 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); | |
112 gtk_box_pack_start(GTK_BOX(bbox), button, TRUE, TRUE, 0); | |
113 gtk_widget_grab_default(button); | |
114 gtk_widget_grab_focus(button); | |
115 | |
116 win_set_icon(dialog, lirc_mini_xpm); | |
117 | |
118 gtk_widget_show_all(dialog); | |
119 } | |
120 | |
121 static void win_set_icon (GtkWidget *win, char** image) | |
122 { | |
252
085b94826d27
[svn] Use GdkAtom instead of a regular Atom. 3 characters inserted cure 3 warnings; good return on investment...
chainsaw
parents:
156
diff
changeset
|
123 GdkAtom icon_atom; |
156 | 124 glong data[2]; |
125 | |
126 icon=gdk_pixmap_create_from_xpm_d(win->window, &icon_mask, | |
127 &win->style->bg[GTK_STATE_NORMAL], | |
128 image); | |
129 data[0] = GDK_WINDOW_XWINDOW(icon); | |
130 data[1] = GDK_WINDOW_XWINDOW(icon_mask); | |
131 | |
132 icon_atom = gdk_atom_intern ("KWM_WIN_ICON", FALSE); | |
133 gdk_property_change (win->window, icon_atom, icon_atom, 32, | |
134 GDK_PROP_MODE_REPLACE, (guchar *)data, 2); | |
135 } |