From 6f9746f3041217574205137cba1f279afa5b2a13 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Thu, 30 Nov 2006 13:34:21 +1100 Subject: Move twin demo binaries to twin_demos/ This change moved the twin demo binaries to the twin_demos subdirectory. Also, don't include these demos in the install - they can be run from the build directory instead. Signed-off-by: Jeremy Kerr Signed-off-by: Benjamin Herrenschmidt --- Makefile.am | 36 +++++++++++------ ftwin.c | 105 ------------------------------------------------ ftwin.cursor | Bin 10004 -> 0 bytes twin_demos/ftwin.c | 105 ++++++++++++++++++++++++++++++++++++++++++++++++ twin_demos/ftwin.cursor | Bin 0 -> 10004 bytes twin_demos/xtwin.c | 70 ++++++++++++++++++++++++++++++++ xtwin.c | 70 -------------------------------- 7 files changed, 198 insertions(+), 188 deletions(-) delete mode 100644 ftwin.c delete mode 100644 ftwin.cursor create mode 100644 twin_demos/ftwin.c create mode 100644 twin_demos/ftwin.cursor create mode 100644 twin_demos/xtwin.c delete mode 100644 xtwin.c diff --git a/Makefile.am b/Makefile.am index 3c001df..90581e0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,19 +1,17 @@ AM_CFLAGS = @WARN_CFLAGS@ -EXTRA_PROGRAMS = xtwin ftwin twin_ttf +EXTRA_PROGRAMS = bin_PROGRAMS = lib_LTLIBRARIES = libtwin.la pkginclude_HEADERS = twin.h twin_def.h if TWIN_X11 -bin_PROGRAMS += xtwin lib_LTLIBRARIES += libtwin-x11.la pkginclude_HEADERS += twin_x11.h endif if TWIN_FB -bin_PROGRAMS += ftwin lib_LTLIBRARIES += libtwin-fbdev.la pkginclude_HEADERS += twin_fbdev.h endif @@ -63,22 +61,32 @@ libtwin_x11_la_CPPFLAGS = @X_CFLAGS@ libtwin_x11_la_LDFLAGS = -version-info @LIB_VERSION@ libtwin_x11_la_SOURCES = twin_x11.c -xtwin_SOURCES = xtwin.c -xtwin_CPPFLAGS = @X_CFLAGS@ -I$(top_srcdir)/twin_demos -xtwin_LDADD = twin_demos/libtwin_demos.a \ - libtwin.la libtwin-x11.la @X_LIBS@ -lm - libtwin_fbdev_la_LDFLAGS = -version-info @LIB_VERSION@ libtwin_fbdev_la_SOURCES = twin_fbdev.c -ftwin_SOURCES = ftwin.c -ftwin_CPPFLAGS = -I$(top_srcdir)/twin_demos -ftwin_LDADD = twin_demos/libtwin_demos.a \ - libtwin.la libtwin-fbdev.la libtwin-mouse.la -lm - # demo twin applications +EXTRA_PROGRAMS += twin_demos/xtwin twin_demos/ftwin +noinst_PROGRAMS = noinst_LIBRARIES = twin_demos/libtwin_demos.a +if TWIN_X11 +noinst_PROGRAMS += twin_demos/xtwin +endif + +if TWIN_FB +noinst_PROGRAMS += twin_demos/ftwin +endif + +twin_demos_xtwin_SOURCES = twin_demos/xtwin.c +twin_demos_xtwin_CPPFLAGS = @X_CFLAGS@ -I$(top_srcdir)/twin_demos +twin_demos_xtwin_LDADD = twin_demos/libtwin_demos.a \ + libtwin.la libtwin-x11.la @X_LIBS@ -lm + +twin_demos_ftwin_SOURCES = twin_demos/ftwin.c +twin_demos_ftwin_CPPFLAGS = -I$(top_srcdir)/twin_demos +twin_demos_ftwin_LDADD = twin_demos/libtwin_demos.a \ + libtwin.la libtwin-fbdev.la libtwin-mouse.la -lm + twin_demos_libtwin_demos_a_CFLAGS = @WARN_CFLAGS@ -I$(top_srcdir)/twin_demos twin_demos_libtwin_demos_a_SOURCES = \ twin_demos/twin_calc.c twin_demos/twin_calc.h \ @@ -90,6 +98,8 @@ twin_demos_libtwin_demos_a_SOURCES = \ twin_demos/twin_text.c twin_demos/twin_text.h # twin_ttf +EXTRA_PROGRAMS += twin_ttf/twin_ttf + if TWIN_TTF bin_PROGRAMS += twin_ttf/twin_ttf endif diff --git a/ftwin.c b/ftwin.c deleted file mode 100644 index 1d5c487..0000000 --- a/ftwin.c +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Test shell for twin fbdev & linux mouse driver - * - * Copyright 2006 Benjamin Herrenschmidt - * - * This Library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This Library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with the Twin Library; see the file COPYING. If not, - * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "twin_fbdev.h" -#include "twin_linux_mouse.h" - -twin_fbdev_t *tf; - -static void exitfunc(void) -{ - if (tf) - twin_fbdev_destroy(tf); - tf = NULL; -} - -static void sigint(int sig) -{ - exitfunc(); - syscall(__NR_exit); -} - -int main (int argc, char **argv) -{ - int hx, hy; - twin_pixmap_t *cur; - - tf = twin_fbdev_create(-1, SIGUSR1); - if (tf == NULL) - return 1; - - atexit(exitfunc); - signal(SIGINT, sigint); - - twin_linux_mouse_create(NULL, tf->screen); - - cur = twin_load_X_cursor("ftwin.cursor", 0, &hx, &hy); - if (cur == NULL) - cur = twin_get_default_cursor(&hx, &hy); - if (cur != NULL) - twin_screen_set_cursor(tf->screen, cur, hx, hy); - twin_screen_set_background (tf->screen, twin_make_pattern ()); -#if 0 - twin_demo_start (tf->screen, "Demo", 100, 100, 400, 400); -#endif -#if 0 - twin_text_start (tf->screen, "Gettysburg Address", 0, 0, 300, 300); -#endif -#if 0 - twin_hello_start (tf->screen, "Hello, World", 0, 0, 200, 200); -#endif -#if 1 - twin_clock_start (tf->screen, "Clock", 10, 10, 200, 200); -#endif -#if 1 - twin_calc_start (tf->screen, "Calculator", 100, 100, 200, 200); -#endif -#if 1 - twin_demoline_start (tf->screen, "Demo Line", 0, 0, 400, 400); -#endif -#if 1 - twin_demospline_start (tf->screen, "Demo Spline", 20, 20, 400, 400); -#endif - - twin_fbdev_activate(tf); - - twin_dispatch (); - - return 0; -} diff --git a/ftwin.cursor b/ftwin.cursor deleted file mode 100644 index 785a7e4..0000000 Binary files a/ftwin.cursor and /dev/null differ diff --git a/twin_demos/ftwin.c b/twin_demos/ftwin.c new file mode 100644 index 0000000..1d5c487 --- /dev/null +++ b/twin_demos/ftwin.c @@ -0,0 +1,105 @@ +/* + * Test shell for twin fbdev & linux mouse driver + * + * Copyright 2006 Benjamin Herrenschmidt + * + * This Library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This Library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with the Twin Library; see the file COPYING. If not, + * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "twin_fbdev.h" +#include "twin_linux_mouse.h" + +twin_fbdev_t *tf; + +static void exitfunc(void) +{ + if (tf) + twin_fbdev_destroy(tf); + tf = NULL; +} + +static void sigint(int sig) +{ + exitfunc(); + syscall(__NR_exit); +} + +int main (int argc, char **argv) +{ + int hx, hy; + twin_pixmap_t *cur; + + tf = twin_fbdev_create(-1, SIGUSR1); + if (tf == NULL) + return 1; + + atexit(exitfunc); + signal(SIGINT, sigint); + + twin_linux_mouse_create(NULL, tf->screen); + + cur = twin_load_X_cursor("ftwin.cursor", 0, &hx, &hy); + if (cur == NULL) + cur = twin_get_default_cursor(&hx, &hy); + if (cur != NULL) + twin_screen_set_cursor(tf->screen, cur, hx, hy); + twin_screen_set_background (tf->screen, twin_make_pattern ()); +#if 0 + twin_demo_start (tf->screen, "Demo", 100, 100, 400, 400); +#endif +#if 0 + twin_text_start (tf->screen, "Gettysburg Address", 0, 0, 300, 300); +#endif +#if 0 + twin_hello_start (tf->screen, "Hello, World", 0, 0, 200, 200); +#endif +#if 1 + twin_clock_start (tf->screen, "Clock", 10, 10, 200, 200); +#endif +#if 1 + twin_calc_start (tf->screen, "Calculator", 100, 100, 200, 200); +#endif +#if 1 + twin_demoline_start (tf->screen, "Demo Line", 0, 0, 400, 400); +#endif +#if 1 + twin_demospline_start (tf->screen, "Demo Spline", 20, 20, 400, 400); +#endif + + twin_fbdev_activate(tf); + + twin_dispatch (); + + return 0; +} diff --git a/twin_demos/ftwin.cursor b/twin_demos/ftwin.cursor new file mode 100644 index 0000000..785a7e4 Binary files /dev/null and b/twin_demos/ftwin.cursor differ diff --git a/twin_demos/xtwin.c b/twin_demos/xtwin.c new file mode 100644 index 0000000..82381db --- /dev/null +++ b/twin_demos/xtwin.c @@ -0,0 +1,70 @@ +/* + * Twin - A Tiny Window System + * Copyright © 2004 Keith Packard + * All rights reserved. + * + * This Library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This Library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with the Twin Library; see the file COPYING. If not, + * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "twin_x11.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define WIDTH 512 +#define HEIGHT 512 + +int +main (int argc, char **argv) +{ + Display *dpy = XOpenDisplay (0); + twin_x11_t *x11 = twin_x11_create (dpy, WIDTH, HEIGHT); + + twin_screen_set_background (x11->screen, twin_make_pattern ()); +#if 0 + twin_demo_start (x11->screen, "Demo", 100, 100, 400, 400); +#endif +#if 0 + twin_text_start (x11->screen, "Gettysburg Address", 0, 0, 300, 300); +#endif +#if 0 + twin_hello_start (x11->screen, "Hello, World", 0, 0, 200, 200); +#endif +#if 1 + twin_clock_start (x11->screen, "Clock", 10, 10, 200, 200); +#endif +#if 1 + twin_calc_start (x11->screen, "Calculator", 100, 100, 200, 200); +#endif +#if 1 + twin_demoline_start (x11->screen, "Demo Line", 0, 0, 400, 400); +#endif +#if 1 + twin_demospline_start (x11->screen, "Demo Spline", 20, 20, 400, 400); +#endif + twin_dispatch (); + return 0; +} diff --git a/xtwin.c b/xtwin.c deleted file mode 100644 index 82381db..0000000 --- a/xtwin.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Twin - A Tiny Window System - * Copyright © 2004 Keith Packard - * All rights reserved. - * - * This Library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This Library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with the Twin Library; see the file COPYING. If not, - * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "twin_x11.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define WIDTH 512 -#define HEIGHT 512 - -int -main (int argc, char **argv) -{ - Display *dpy = XOpenDisplay (0); - twin_x11_t *x11 = twin_x11_create (dpy, WIDTH, HEIGHT); - - twin_screen_set_background (x11->screen, twin_make_pattern ()); -#if 0 - twin_demo_start (x11->screen, "Demo", 100, 100, 400, 400); -#endif -#if 0 - twin_text_start (x11->screen, "Gettysburg Address", 0, 0, 300, 300); -#endif -#if 0 - twin_hello_start (x11->screen, "Hello, World", 0, 0, 200, 200); -#endif -#if 1 - twin_clock_start (x11->screen, "Clock", 10, 10, 200, 200); -#endif -#if 1 - twin_calc_start (x11->screen, "Calculator", 100, 100, 200, 200); -#endif -#if 1 - twin_demoline_start (x11->screen, "Demo Line", 0, 0, 400, 400); -#endif -#if 1 - twin_demospline_start (x11->screen, "Demo Spline", 20, 20, 400, 400); -#endif - twin_dispatch (); - return 0; -} -- cgit v1.2.3