home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 123 / cdrom123.iso / edu / tux / Tuxtype2-1.5.3-installer.exe / src / scripting.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-01-30  |  2.4 KB  |  64 lines

  1. /***************************************************************************
  2.  -  file: scripting.h
  3.  -  description: types for scripting 
  4. -------------------
  5.     begin                : Sun Dec 28, 2003
  6.     copyright            : Jesse Andrews (C) 2003
  7.     email                : tuxtype-dev@tux4kids.net
  8. ***************************************************************************/
  9.  
  10. /***************************************************************************
  11. *                                                                         *
  12. *   This program is free software; you can redistribute it and/or modify  *
  13. *   it under the terms of the GNU General Public License as published by  *
  14. *   the Free Software Foundation; either version 2 of the License, or     *
  15. *   (at your option) any later version.                                   *
  16. *                                                                         *
  17. ***************************************************************************/
  18.  
  19. #include "globals.h"
  20. #include "funcs.h"
  21.  
  22. enum { itemTEXT, itemIMG, itemWAV };
  23.  
  24. /* linked list of elements for a page */
  25. struct item {
  26.         char type;        // text or img or wav enum type?
  27.         char *data;        // holds text/location for file (sound/image)
  28.         char *onclick;        // holds additional data
  29.         char size;        // holds font size if applicable
  30.         char align;             // holds 'L'eft, 'R'ight, 'C'enter for alignment
  31.         char loop;        // holds if sound files loop
  32.     int x,y;        // for absolute positioning
  33.         SDL_Color *color;       // holds text color
  34.         
  35.         struct item *next; // the linked list part ... 
  36. };
  37.  
  38. typedef struct item itemType;
  39.  
  40. /* linked list of pages for a lesson */
  41. struct page {
  42.     itemType *items;    // linked list of elements
  43.     char *background;        // background image
  44.     char *title;        // title of the page
  45.     SDL_Color *bgcolor;        // background color
  46.     SDL_Color *fgcolor;        // default text color
  47.     
  48.     struct page *next;         // the linked list part ...
  49.     struct page *prev;         // the doubly-linked list part ...
  50. };
  51.  
  52. typedef struct page pageType;
  53.  
  54. struct script {
  55.     pageType *pages;        // linked list of pages
  56.     char *title;        // title of lesson
  57.     SDL_Color *bgcolor;         // default background color for all pages
  58.     SDL_Color *fgcolor;         // default foreground color for all text
  59.     char *background;        // default background image for all pages
  60. }; 
  61.  
  62. typedef struct script scriptType;
  63.  
  64.