4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "bcsignals.h"
33 #include <sys/types.h>
39 #define BCTEXTLEN 1024
46 char *command_line = "ls -l -s -S -r";
47 char *arguments[MAX_ARGS];
53 char *ptr = command_line;
55 char argument[BCTEXTLEN];
59 while(*ptr != ' ' && *ptr != 0)
65 arguments[total_arguments] = new char[strlen(path) + 1];
66 strcpy(arguments[total_arguments], path);
67 //printf("%s\n", arguments[total_arguments]);
69 arguments[total_arguments] = 0;
74 argument_ptr = argument;
75 while(*ptr != ' ' && *ptr != 0)
77 *argument_ptr++ = *ptr++;
80 //printf("%s\n", argument);
82 arguments[total_arguments] = new char[strlen(argument) + 1];
83 strcpy(arguments[total_arguments], argument);
85 arguments[total_arguments] = 0;
89 stdin_fd = fdopen(filedes[1], "w");
95 dup2(filedes[0], fileno(stdin));
96 execvp(path, arguments);
103 if(waitpid(pid, &return_value, WUNTRACED) == -1)
110 printf("Finished.\n");
119 class TestWindow : public BC_Window
122 TestWindow() : BC_Window("test", 0, 0, 320, 240,
137 switch(get_keypress())
141 if(current_cursor >= XC_num_glyphs) current_cursor = 0;
146 if(current_cursor <= 0) current_cursor = XC_num_glyphs - 1;
149 printf("%d\n", current_cursor);
150 set_cursor(current_cursor, 0, 1);
151 //set_cursor(TRANSPARENT_CURSOR);
157 int main(int argc, char *argv[])
161 int angles[] = { 180, 0 };
162 float values[] = { 1, 0 };
164 window.add_tool(new BC_Pan(10, 120, 100, 1, 2, angles, -1, -1, values));
165 window.add_tool(new BC_TextBox(10, 10, 200, 5, _("Mary Egbert\nhad a little lamb.")));
167 window.add_tool(title = new BC_Title(10, 210, _("Hello world")));
168 title->update("xyz");
169 window.show_window();
172 title->update("abc");