2 terminatorX - realtime audio scratching software
3 Copyright (C) 1999-2002 Alexander König
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.
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.
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., 675 Mass Ave, Cambridge, MA 02139, USA.
21 Description: This implements the pixmaped buttons - based on
28 #include "tX_mastergui.h"
29 #include "tX_global.h"
31 #include "gui_icons/tx_audioengine.xpm"
32 #include "gui_icons/tx_power.xpm"
33 #include "gui_icons/tx_grab.xpm"
34 #include "gui_icons/tx_smaller_logo.xpm"
35 #include "gui_icons/tx_sequencer.xpm"
36 #include "gui_icons/tx_play.xpm"
37 #include "gui_icons/tx_stop.xpm"
38 #include "gui_icons/tx_record.xpm"
39 #include "gui_icons/tx_wave.xpm"
40 #include "gui_icons/tx_reload.xpm"
41 #include "gui_icons/tx_minimize.xpm"
42 #include "gui_icons/tX_fx_up.xpm"
43 #include "gui_icons/tX_fx_down.xpm"
44 #include "gui_icons/tX_fx_close.xpm"
45 #include "gui_icons/tX_minimize.xpm"
46 #include "gui_icons/tX_min_control.xpm"
48 gchar ** tx_icons[]={ tx_audioengine_xpm, tx_power_xpm, tx_grab_xpm, tx_smaller_logo_xpm,
49 tx_sequencer_xpm, tx_play_xpm, tx_stop_xpm, tx_record_xpm,
50 tx_wave_xpm, tx_reload_xpm, tx_minimize_xpm,
51 tX_fx_up_xpm, tX_fx_down_xpm, tX_fx_close_xpm, tX_minimize_xpm, tX_min_control_xpm };
53 GtkWidget *tx_pixmap_widget(int icon_id)
60 // printf("id: %i, addr: %08x\n", icon_id, tx_icons[icon_id]);
62 /* Get the style of the button to get the
63 * background color. */
64 style = gtk_widget_get_style(main_window);
66 /* Now on to the xpm stuff */
67 pixmap = gdk_pixmap_create_from_xpm_d(main_window->window, &mask,
68 &style->bg[GTK_STATE_NORMAL],
69 (gchar **) tx_icons[icon_id]);
70 pixmapwid = gtk_pixmap_new (pixmap, mask);
75 GtkWidget *tx_xpm_label_box(int icon_id, gchar *label_text, GtkWidget **labelwidget=NULL)
81 /* Create box for xpm and label */
82 box1 = gtk_hbox_new (FALSE, 0);
83 gtk_container_set_border_width (GTK_CONTAINER (box1), 2);
86 if (globals.button_type != BUTTON_TYPE_TEXT)
88 pixmapwid=tx_pixmap_widget(icon_id);
89 gtk_box_pack_start (GTK_BOX (box1), pixmapwid, FALSE, FALSE, 3);
90 gtk_widget_show(pixmapwid);
93 if ((globals.button_type != BUTTON_TYPE_ICON) || (labelwidget!=NULL))
95 label = gtk_label_new (label_text);
96 gtk_box_pack_start (GTK_BOX (box1), label, FALSE, FALSE, 3);
97 gtk_widget_show(label);
98 if (labelwidget!=NULL) {
106 //GtkWidget *tx_xpm_button_new(int icon_id, char *label, int toggle)
107 extern GtkWidget *tx_xpm_button_new(int icon_id, char *label, int toggle, GtkWidget **labelwidget=NULL)
112 if (toggle) button=gtk_toggle_button_new();
113 else button=gtk_button_new();
115 box=tx_xpm_label_box(icon_id, label, labelwidget);
116 gtk_widget_show(box);
117 gtk_container_add (GTK_CONTAINER (button), box);