home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 15 / Amiga Plus Leser CD 15.iso / Tools / Development / MosaicSRC / src / HTMLP.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-03-13  |  8.8 KB  |  262 lines

  1. // MJW - THIS INFO IS PRIVATE.... SHOULD ONLY BE USED IN HTMLamiga.c 
  2. /* DON'T YOU DARE INCLUDE THIS EXCEPT FOR CODE THAT RUNS INSIDE THE 
  3.    HTML GADGET
  4. */
  5.  
  6. // MDF - PORT FROM NCSA VERSION 2.1
  7.  
  8. /****************************************************************************
  9.  * NCSA Mosaic for the X Window System                                      *
  10.  * Software Development Group                                               *
  11.  * National Center for Supercomputing Applications                          *
  12.  * University of Illinois at Urbana-Champaign                               *
  13.  * 605 E. Springfield, Champaign IL 61820                                   *
  14.  * mosaic@ncsa.uiuc.edu                                                     *
  15.  *                                                                          *
  16.  * Copyright (C) 1993, Board of Trustees of the University of Illinois      *
  17.  *                                                                          *
  18.  * NCSA Mosaic software, both binary and source (hereafter, Software) is    *
  19.  * copyrighted by The Board of Trustees of the University of Illinois       *
  20.  * (UI), and ownership remains with the UI.                                 *
  21.  *                                                                          *
  22.  * The UI grants you (hereafter, Licensee) a license to use the Software    *
  23.  * for academic, research and internal business purposes only, without a    *
  24.  * fee.  Licensee may distribute the binary and source code (if released)   *
  25.  * to third parties provided that the copyright notice and this statement   *
  26.  * appears on all copies and that no charge is associated with such         *
  27.  * copies.                                                                  *
  28.  *                                                                          *
  29.  * Licensee may make derivative works.  However, if Licensee distributes    *
  30.  * any derivative work based on or derived from the Software, then          *
  31.  * Licensee will (1) notify NCSA regarding its distribution of the          *
  32.  * derivative work, and (2) clearly notify users that such derivative       *
  33.  * work is a modified version and not the original NCSA Mosaic              *
  34.  * distributed by the UI.                                                   *
  35.  *                                                                          *
  36.  * Any Licensee wishing to make commercial use of the Software should       *
  37.  * contact the UI, c/o NCSA, to negotiate an appropriate license for such   *
  38.  * commercial use.  Commercial use includes (1) integration of all or       *
  39.  * part of the source code into a product for sale or license by or on      *
  40.  * behalf of Licensee to third parties, or (2) distribution of the binary   *
  41.  * code or source code to third parties that need it to utilize a           *
  42.  * commercial product sold or licensed by or on behalf of Licensee.         *
  43.  *                                                                          *
  44.  * UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR   *
  45.  * ANY PURPOSE.  IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED          *
  46.  * WARRANTY.  THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE    *
  47.  * USERS OF THIS SOFTWARE.                                                  *
  48.  *                                                                          *
  49.  * By using or copying this Software, Licensee agrees to abide by the       *
  50.  * copyright law and all other applicable laws of the U.S. including, but   *
  51.  * not limited to, export control laws, and the terms of this license.      *
  52.  * UI shall have the right to terminate this license immediately by         *
  53.  * written notice upon Licensee's breach of, or non-compliance with, any    *
  54.  * of its terms.  Licensee may be held legally responsible for any          *
  55.  * copyright infringement that is caused or encouraged by Licensee's        *
  56.  * failure to abide by the terms of this license.                           *
  57.  *                                                                          *
  58.  * Comments and questions are welcome and can be sent to                    *
  59.  * mosaic-x@ncsa.uiuc.edu.                                                  *
  60.  ****************************************************************************/
  61.  
  62. #ifndef HTMLP_H
  63. #define HTMLP_H
  64.  
  65. #ifdef _AMIGA
  66. #include "XtoI.h"
  67.  
  68. #include "HTML.h"
  69.  
  70. #if  (defined(_AMIGA) && defined (_STRICT_ANSI))
  71. #define bcopy(source, dest, count) memcpy(dest, source, count)
  72. #define bzero(b, len) memset(b, 0, len)
  73. #endif
  74.  
  75.  
  76. /*
  77.  * Used for special images
  78.  */
  79. #define INTERNAL_IMAGE    "internal-"
  80.  
  81. /*
  82.  * to reduce the number of MOTIF/ATHENA ifdefs around the code
  83.  * we use some generalized constants
  84.  */
  85. #if FALSE  /* can we nuke this? */
  86. #ifdef MOTIF
  87. #   define XxNx      XmNx
  88. #   define XxNy      XmNy
  89. #   define XxNwidth  XmNwidth
  90. #   define XxNheight XmNheight
  91. #   define XxNset    XmNset
  92. #   define XxNvalue  XmNvalue
  93. #else
  94. #   define XxNx      XtNx
  95. #   define XxNy      XtNy
  96. #   define XxNwidth  XtNwidth
  97. #   define XxNheight XtNheight
  98. #   define XxNset    XtNstate
  99. #   define XxNvalue  XtNstring
  100. #endif /* MOTIF */
  101. #endif
  102.  
  103.  
  104. #if 0
  105. /* ^^^ See HTML.h for details */
  106. /* HTML Gaget internal data...
  107.     must only be used by files that are called from the gadget itself */
  108. /* Class data for the HTML Gadget */
  109.  
  110. typedef struct HTMLGadClDataS
  111. {
  112.   /* Amiga-specific part */
  113.  
  114.   struct Window *win;
  115.   struct RastPort *rp;
  116.   char *inlined_image_to_load;    /* temporary hack? */
  117.   char *chosen_anchor;        /* temporary hack? */
  118.   int active;            /* hack? */
  119.  
  120.   /* Resources */
  121.   Dimension            margin_width;
  122.   Dimension            margin_height;
  123.   
  124.   Widget            view;
  125.   Widget            hbar;
  126.   Widget            vbar;
  127.   Boolean            hbar_top;
  128.   Boolean            vbar_right;
  129.   
  130.   XtCallbackList    anchor_callback;
  131.   XtCallbackList    link_callback;
  132.   XtCallbackList    form_callback;
  133.   
  134.   char                *title;
  135.   char                *raw_text;
  136.   char                *header_text;
  137.   char                *footer_text;
  138.   /*
  139.    * Without motif we have to define our own forground resource
  140.    * instead of using the manager's
  141.    */
  142. #ifndef MOTIF
  143.   Pixel                foreground;
  144.   Pixel             background_pixel; /* MDF added; "core" class */
  145. #endif
  146.   Pixel                anchor_fg;
  147.   Pixel                visitedAnchor_fg;
  148.   Pixel                activeAnchor_fg;
  149.   Pixel                activeAnchor_bg;
  150.   int                num_anchor_underlines;
  151.   int                num_visitedAnchor_underlines;
  152.   Boolean            dashed_anchor_lines;
  153.   Boolean            dashed_visitedAnchor_lines;
  154.   Boolean            fancy_selections;
  155.   Boolean            border_images;
  156.   Boolean            delay_images;
  157.   Boolean            is_index;
  158.   int                percent_vert_space;
  159.   
  160.   XFontStruct        *font;
  161.   XFontStruct        *italic_font;
  162.   XFontStruct        *bold_font;
  163.   XFontStruct        *fixed_font;
  164.   XFontStruct        *header1_font;
  165.   XFontStruct        *header2_font;
  166.   XFontStruct        *header3_font;
  167.   XFontStruct        *header4_font;
  168.   XFontStruct        *header5_font;
  169.   XFontStruct        *header6_font;
  170.   XFontStruct        *address_font;
  171.   XFontStruct        *plain_font;
  172.   XFontStruct        *listing_font;
  173.   
  174.   /*
  175.     int (*previously_visited_test)();
  176.     ImageInfo * (*resolveImage)();
  177.     */
  178.   XtPointer            previously_visited_test;
  179.   XtPointer            resolveImage;
  180.   XtPointer            resolveDelayedImage;
  181.   
  182.   XtPointer               pointer_motion_callback;
  183.   
  184.   /* PRIVATE */
  185.   Dimension            max_pre_width;
  186.   Dimension         view_left; /* MDF temp hack? */
  187.   Dimension         view_top;  /* MDF temp hack? */
  188.   Dimension            view_width;
  189.   Dimension            view_height;
  190.   int                doc_width;
  191.   int                doc_height;
  192.   int                scroll_x;
  193.   int                scroll_y;
  194.   Boolean            use_hbar;
  195.   Boolean            use_vbar;
  196.   struct ele_rec    *formatted_elements;
  197.   int                line_count;
  198.   struct ele_rec    **line_array;
  199.   struct ele_rec    *select_start;
  200.   struct ele_rec    *select_end;
  201.   int                sel_start_pos;
  202.   int                sel_end_pos;
  203.   struct ele_rec    *new_start;
  204.   struct ele_rec    *new_end;
  205.   int                new_start_pos;
  206.   int                new_end_pos;
  207.   struct ele_rec    *active_anchor;
  208.   //    GC            drawGC;
  209.   void *            drawGC;
  210.   int                press_x;
  211.   int                press_y;
  212.   Time                but_press_time;
  213.   Time                selection_time;
  214.   struct mark_up    *html_objects;
  215.   struct mark_up    *html_header_objects;
  216.   struct mark_up    *html_footer_objects;
  217.   struct ref_rec    *my_visited_hrefs;
  218.   struct delay_rec    *my_delayed_images;
  219.     WidgetInfo        *widget_list;
  220.   FormInfo            *form_list;
  221.   
  222.   struct ele_rec          *cached_tracked_ele;
  223.  
  224.   int                new_scroll_value;
  225.   int                new_scroll_dir;
  226.     Object            *SB_Vert,*SB_Horiz;
  227.     Object            *Virt;
  228.     WidgetInfo        *old_widget_list;
  229. } HTMLGadClData; /* Was HTMLRec */
  230. #endif
  231.  
  232. typedef struct HTMLTextClDataS
  233. {
  234.     HTMLGadClData *HTML_Data;
  235.     ULONG new_scroll_value;
  236.     ULONG new_scroll_dir;
  237.     ULONG Flags;
  238.  
  239. } HTMLTextClData;
  240.  
  241. typedef struct HTMLTextNClDataS
  242. {
  243.     HTMLGadClData *HTML_Data;
  244.     ULONG new_scroll_value;
  245.     ULONG new_scroll_dir;
  246.     ULONG Flags;
  247.  
  248. } HTMLTextNClData;
  249.  
  250. /* HTML gad stuff */
  251.  
  252. // mjw char **HTMLGetImageSrcs(HTMLGadClData *, int *);
  253. struct ele_rec *LocateElement(void *, int, int, int *);
  254. // struct mark_up *HTMLParse(struct mark_up *, char *) ;
  255. // char *ParseMarkTag(char *, char *, char *);
  256.  
  257. /* HTML_img.c (was img.c) */
  258.  
  259. int ImageLoadAndCache(HTMLGadClData *, char *);
  260.  
  261. #endif /* HTMLP_H */
  262.