00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef INC_MI32_XMHTMLP_H
00034 #define INC_MI32_XMHTMLP_H
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132 #ifndef _XmHTMLP_h_
00133 #define _XmHTMLP_h_
00134 #ifndef GENERATING_DOXYGEN_OUTPUT
00135
00136 #ifdef WIN32
00137
00138
00139
00140 #pragma warning (disable: 4018)
00141 #pragma warning (disable: 4761)
00142 #pragma warning (disable: 4244)
00143 #pragma warning (disable: 4305)
00144 #pragma warning (disable: 4113)
00145
00146 #pragma warning (error: 4133)
00147 #endif
00148
00149 #include <X11/Xatom.h>
00150 #include <X11/IntrinsicP.h>
00151 #include <X11/Xmu/Atoms.h>
00152
00153 #include <Xm/XmP.h>
00154 #include <Xm/ManagerP.h>
00155
00156
00157 #include <mi32/xmhtml.h>
00158
00159
00160
00161
00162
00163
00164 #ifdef VERSION
00165 # ifndef _LIBRARY
00166 # define _LIBRARY
00167 # endif
00168 #endif
00169
00170
00171
00172
00173
00174
00175
00176 #ifdef _LIBRARY
00177 # include "XCC.h"
00178 # ifdef _ZCONF_H
00179 # ifndef BYTE_ALREADY_TYPEDEFED
00180 # define BYTE_ALREADY_TYPEDEFED
00181 # endif
00182 # endif
00183 #else
00184 typedef struct _XColorContext *XCC;
00185 #endif
00186
00187 #ifndef BYTE_ALREADY_TYPEDEFED
00188 #define BYTE_ALREADY_TYPEDEFED
00189 typedef unsigned char Byte;
00190 #endif
00191
00192
00193
00194
00195
00196 #define UNMAP_FORMS 1
00197
00198 _XFUNCPROTOBEGIN
00199 #ifdef __cplusplus
00200 extern "C" {
00201 #endif
00202
00203
00204
00205
00206 typedef struct {
00207 XtPointer extension;
00208 }XmHTMLClassPart;
00209
00210 typedef struct _XmHTMLClassRec
00211 {
00212 CoreClassPart core_class;
00213 CompositeClassPart composite_class;
00214 ConstraintClassPart constraint_class;
00215 XmManagerClassPart manager_class;
00216 XmHTMLClassPart html_class;
00217 }XmHTMLClassRec;
00218
00219
00220
00221
00222
00223
00224
00225
00226 #define LINE_SOLID (1<<1)
00227 #define LINE_DASHED (1<<2)
00228 #define LINE_SINGLE (1<<3)
00229 #define LINE_DOUBLE (1<<4)
00230 #define LINE_STRIKE (1<<5)
00231 #define LINE_UNDER (1<<6)
00232 #define NO_LINE 0
00233
00234
00235
00236
00237 #define TEXT_SPACE_NONE (1<<0)
00238 #define TEXT_SPACE_LEAD (1<<1)
00239 #define TEXT_SPACE_TRAIL (1<<2)
00240 #define TEXT_ANCHOR (1<<3)
00241 #define TEXT_ANCHOR_INTERN (1<<4)
00242 #define TEXT_IMAGE (1<<5)
00243 #define TEXT_FORM (1<<6)
00244 #define TEXT_BREAK (1<<7)
00245
00246
00247
00248
00249 typedef enum{
00250 XmMARKER_NONE = 0,
00251 XmMARKER_ARABIC = 10,
00252 XmMARKER_ALPHA_LOWER,
00253 XmMARKER_ALPHA_UPPER,
00254 XmMARKER_ROMAN_LOWER,
00255 XmMARKER_ROMAN_UPPER,
00256 XmMARKER_DISC = 15,
00257 XmMARKER_SQUARE,
00258 XmMARKER_CIRCLE
00259 }Marker;
00260
00261
00262
00263
00264 typedef enum{
00265 XmHALIGN_NONE = 0,
00266 XmHALIGN_LEFT,
00267 XmHALIGN_CENTER,
00268 XmHALIGN_RIGHT,
00269 XmHALIGN_JUSTIFY,
00270 XmVALIGN_NONE = 8,
00271 XmVALIGN_TOP,
00272 XmVALIGN_MIDDLE,
00273 XmVALIGN_BOTTOM,
00274 XmVALIGN_BASELINE
00275 }Alignment;
00276
00277
00278
00279
00280
00281 typedef enum{
00282 OBJ_NONE = 0,
00283 OBJ_TEXT,
00284 OBJ_PRE_TEXT,
00285 OBJ_BULLET,
00286 OBJ_HRULE,
00287 OBJ_TABLE,
00288 OBJ_TABLE_FRAME,
00289 OBJ_IMG,
00290 OBJ_FORM,
00291 OBJ_APPLET,
00292 OBJ_BLOCK
00293 }ObjectType;
00294
00295
00296
00297
00298 #define CLEAR_NONE -1
00299 #define CLEAR_SOFT 0
00300 #define CLEAR_HARD 1
00301 #define CLEAR_ALL 2
00302
00303
00304
00305
00306 typedef enum{
00307 XmMAP_NONE = 1,
00308 XmMAP_SERVER,
00309 XmMAP_CLIENT
00310 }Imagemap;
00311
00312
00313
00314
00315
00316 #define IMG_ISBACKGROUND (1L<<1)
00317 #define IMG_ISINTERNAL (1L<<2)
00318 #define IMG_ISCOPY (1L<<3)
00319 #define IMG_ISANIM (1L<<4)
00320 #define IMG_FRAMEREFRESH (1L<<5)
00321 #define IMG_HASDIMENSIONS (1L<<6)
00322 #define IMG_HASSTATE (1L<<7)
00323 #define IMG_INFOFREED (1L<<8)
00324 #define IMG_DELAYED_CREATION (1L<<9)
00325 #define IMG_ORPHANED (1L<<10)
00326 #define IMG_PROGRESSIVE (1L<<11)
00327
00328
00329
00330
00331 #define COLOR_CLASS_GRAYSCALE 0
00332 #define COLOR_CLASS_INDEXED 1
00333 #define COLOR_CLASS_RGB 2
00334
00335
00336
00337
00338 typedef enum{
00339 FRAME_SCROLL_NONE = 1,
00340 FRAME_SCROLL_AUTO,
00341 FRAME_SCROLL_YES
00342 }FrameScrolling;
00343
00344
00345
00346
00347 typedef enum{
00348 FRAME_SIZE_FIXED = 1,
00349 FRAME_SIZE_RELATIVE,
00350 FRAME_SIZE_OPTIONAL
00351 }FrameSize;
00352
00353
00354
00355
00356 typedef enum{
00357 FRAMESET_LAYOUT_ROWS = 1,
00358 FRAMESET_LAYOUT_COLS = 2,
00359 FRAMESET_LAYOUT_ROW_COLS = 4
00360 }FramesetLayout;
00361
00362
00363
00364
00365 #define ANCHOR_UNSELECTED (Byte)0
00366 #define ANCHOR_INSELECT (Byte)1
00367 #define ANCHOR_SELECTED (Byte)2
00368
00369
00370
00371
00372 #define FONT_BOLD (1<<1)
00373 #define FONT_MEDIUM (1<<2)
00374 #define FONT_ITALIC (1<<3)
00375 #define FONT_REGULAR (1<<4)
00376 #define FONT_FIXED (1<<5)
00377 #define FONT_SCALABLE (1<<6)
00378
00379
00380
00381
00382
00383 typedef struct{
00384 Byte style;
00385 String font_name;
00386 String font_family;
00387 XFontStruct *xfont;
00388
00389
00390 int height;
00391 int lineheight;
00392 Cardinal isp;
00393 Cardinal eol_sp;
00394 int sup_xoffset;
00395 int sup_yoffset;
00396 int sub_xoffset;
00397 int sub_yoffset;
00398 int ul_offset;
00399 Cardinal ul_thickness;
00400 int st_offset;
00401 Cardinal st_thickness;
00402 short m_lbearing;
00403 short m_rbearing;
00404 short m_width;
00405 short m_ascent;
00406 short m_descent;
00407 }XmHTMLfont;
00408
00409
00410
00411
00412
00413
00414
00415
00416 typedef struct _HTEvent{
00417 int type;
00418 XtPointer data;
00419 }HTEvent;
00420
00421
00422
00423
00424
00425 typedef struct _AllEvents{
00426
00427 HTEvent *onLoad;
00428 HTEvent *onUnload;
00429
00430
00431 HTEvent *onSubmit;
00432 HTEvent *onReset;
00433 HTEvent *onFocus;
00434 HTEvent *onBlur;
00435 HTEvent *onSelect;
00436 HTEvent *onChange;
00437
00438
00439 HTEvent *onClick;
00440 HTEvent *onDblClick;
00441 HTEvent *onMouseDown;
00442 HTEvent *onMouseUp;
00443 HTEvent *onMouseOver;
00444 HTEvent *onMouseMove;
00445 HTEvent *onMouseOut;
00446 HTEvent *onKeyPress;
00447 HTEvent *onKeyDown;
00448 HTEvent *onKeyUp;
00449 }AllEvents;
00450
00451
00452
00453
00454
00455 typedef struct _XmHTMLAnchor{
00456 URLType url_type;
00457 String name;
00458 String href;
00459 String target;
00460 String rel;
00461 String rev;
00462 String title;
00463 AllEvents *events;
00464 Cardinal line;
00465 Boolean visited;
00466 struct _XmHTMLAnchor *next;
00467 }XmHTMLAnchor;
00468
00469
00470
00471
00472
00473 typedef struct _XmHTMLWord{
00474 int x;
00475 int y;
00476 Dimension width;
00477 Dimension height;
00478 Cardinal line;
00479 ObjectType type;
00480 String word;
00481 int len;
00482 XmHTMLfont *font;
00483 Byte line_data;
00484 Byte spacing;
00485 Byte posbits;
00486 AllEvents *events;
00487 struct _XmHTMLImage *image;
00488 struct _XmHTMLForm *form;
00489 struct _XmHTMLExtObj *embed;
00490 struct _XmHTMLWord *base;
00491 struct _XmHTMLWord *self;
00492 struct _XmHTMLObjectTable *owner;
00493 }XmHTMLWord;
00494
00495
00496
00497
00498 typedef struct _XmHTMLParserTag{
00499
00500 String tag;
00501 Boolean terminated;
00502 unsigned long flags;
00503 XtPointer user_data;
00504
00505
00506 int id;
00507 }XmHTMLParserTag;
00508
00509
00510
00511
00512
00513 typedef struct _XmHTMLExtObj{
00514 int x;
00515 int y;
00516 Dimension width;
00517 Dimension height;
00518 int id;
00519 String name;
00520 Widget w;
00521
00522 XmHTMLParserTag *tag;
00523 XmHTMLTagAttributes *attributes;
00524
00525
00526
00527
00528
00529 Alignment halign;
00530 Alignment valign;
00531 Dimension border;
00532 AllEvents *events;
00533
00534 XtPointer user_data;
00535
00536 Boolean scrollable;
00537 Boolean wrap;
00538 Boolean mapped;
00539
00540 struct _XmHTMLObjectTable *data;
00541 struct _XmHTMLExtObj *prev;
00542 struct _XmHTMLExtObj *next;
00543 }XmHTMLExtObj;
00544
00545
00546 typedef struct _mapArea mapArea;
00547
00548
00549
00550
00551
00552 typedef struct _XmHTMLImageMap{
00553 String name;
00554 int nareas;
00555 mapArea *areas;
00556 struct _XmHTMLImageMap *next;
00557 }XmHTMLImageMap;
00558
00559
00560
00561
00562
00563
00564
00565
00566 typedef struct _XmHTMLImage{
00567
00568 Byte magic;
00569 String url;
00570 XmImageInfo *html_image;
00571 Pixmap pixmap;
00572 Pixmap clip;
00573 unsigned long options;
00574 int width;
00575 int height;
00576 int npixels;
00577 XCC xcc;
00578
00579
00580 int swidth;
00581 int sheight;
00582 String alt;
00583 Alignment align;
00584 Imagemap map_type;
00585 String map_url;
00586 Dimension border;
00587 Dimension hspace;
00588 Dimension vspace;
00589
00590 struct _XmHTMLObjectTable *owner;
00591 struct _XmHTMLImage *child;
00592 struct _XmHTMLImage *next;
00593
00594
00595 XmImageFrame *frames;
00596 int nframes;
00597 int current_frame;
00598 int current_loop;
00599 int loop_count;
00600 XtIntervalId proc_id;
00601 XmHTMLWidget html;
00602 XtAppContext context;
00603
00604
00605 AllEvents *events;
00606 }XmHTMLImage;
00607
00608
00609
00610
00611
00612 typedef struct{
00613 char *file;
00614 Byte *buffer;
00615 Byte *curr_pos;
00616 size_t next;
00617 size_t size;
00618 Boolean may_free;
00619 unsigned char type;
00620 int depth;
00621 }ImageBuffer;
00622
00623
00624
00625
00626 typedef struct _XmHTMLForm{
00627 int x;
00628 int y;
00629 Dimension width;
00630 Dimension height;
00631 Cardinal line;
00632 Widget w;
00633 Widget child;
00634 String name;
00635 Byte type;
00636 int size;
00637 int maxlength;
00638 String value;
00639 String content;
00640 Alignment align;
00641 Boolean multiple;
00642 int selected;
00643 Boolean checked;
00644 Boolean mapped;
00645 struct _XmHTMLForm *options;
00646 struct _XmHTMLObjectTable *data;
00647 struct _XmHTMLFormData *parent;
00648 struct _XmHTMLForm *prev;
00649 struct _XmHTMLForm *next;
00650 }XmHTMLForm;
00651
00652
00653
00654
00655 typedef struct _XmHTMLFormData{
00656 Widget html;
00657 Boolean can_clip;
00658 Pixmap clip;
00659 int x;
00660 int y;
00661 Dimension width;
00662 Dimension height;
00663 String action;
00664 int method;
00665 String enctype;
00666 int ncomponents;
00667 Widget fileSB;
00668 XmHTMLForm *components;
00669 struct _XmHTMLFormData *prev;
00670 struct _XmHTMLFormData *next;
00671 }XmHTMLFormData;
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687
00688 typedef enum{
00689 TFRAME_VOID = 0,
00690 TFRAME_ABOVE,
00691 TFRAME_BELOW,
00692 TFRAME_LEFT,
00693 TFRAME_RIGHT,
00694 TFRAME_HSIDES,
00695 TFRAME_VSIDES,
00696 TFRAME_BOX,
00697 TFRAME_BORDER
00698 }TableFraming;
00699
00700
00701 typedef enum{
00702 TRULE_NONE = 0,
00703 TRULE_GROUPS,
00704 TRULE_ROWS,
00705 TRULE_COLS,
00706 TRULE_ALL
00707 }TableRuling;
00708
00709
00710
00711
00712
00713 typedef struct _TableProperties{
00714 int border;
00715 Alignment halign;
00716 Alignment valign;
00717 Pixel bg;
00718 XmHTMLImage *bg_image;
00719 TableFraming framing;
00720 TableRuling ruling;
00721 Boolean nowrap;
00722 }TableProperties;
00723
00724
00725
00726
00727 typedef struct _TableCell{
00728 Boolean header;
00729 int width;
00730 int height;
00731 int rowspan;
00732 int colspan;
00733 TableProperties *properties;
00734 struct _XmHTMLObjectTable *start;
00735 struct _XmHTMLObjectTable *end;
00736 struct _XmHTMLObjectTable *owner;
00737 struct _TableRow *parent;
00738 }TableCell;
00739
00740
00741 typedef struct _TableRow{
00742 TableCell *cells;
00743 int ncells;
00744 int lastcell;
00745 TableProperties *properties;
00746 struct _XmHTMLObjectTable *start;
00747 struct _XmHTMLObjectTable *end;
00748 struct _XmHTMLObjectTable *owner;
00749 struct _XmHTMLTable *parent;
00750 }TableRow;
00751
00752
00753
00754
00755
00756
00757 typedef struct _XmHTMLTable{
00758
00759 int width;
00760 int hmargin;
00761 int vmargin;
00762 int hpadding;
00763 int vpadding;
00764 int ncols;
00765 TableProperties *properties;
00766
00767 TableRow *caption;
00768 TableRow *rows;
00769 int nrows;
00770 int lastrow;
00771
00772 struct _XmHTMLTable *parent;
00773 struct _XmHTMLTable *childs;
00774 int nchilds;
00775 int lastchild;
00776
00777 struct _XmHTMLObjectTable *start;
00778 struct _XmHTMLObjectTable *end;
00779
00780 struct _XmHTMLObjectTable *owner;
00781
00782 struct _XmHTMLTable *next;
00783 }XmHTMLTable;
00784
00785
00786
00787
00788 typedef struct _XmHTMLObjectTable{
00789 int x;
00790 int y;
00791 Dimension width;
00792 Dimension height;
00793 Cardinal line;
00794 Cardinal id;
00795 ObjectType object_type;
00796 String text;
00797 Byte text_data;
00798 int len;
00799 int y_offset;
00800 int x_offset;
00801 XmHTMLObject *object;
00802 XmHTMLAnchor *anchor;
00803 XmHTMLWord *words;
00804 XmHTMLForm *form;
00805 XmHTMLTable *table;
00806 int n_words;
00807 Byte anchor_state;
00808 Alignment halign;
00809 int linefeed;
00810 Dimension ident;
00811 Marker marker;
00812 int list_level;
00813 XmHTMLfont *font;
00814 Pixel fg;
00815 Pixel bg;
00816 struct _XmHTMLObjectTable *next;
00817 struct _XmHTMLObjectTable *prev;
00818 }XmHTMLObjectTable, *XmHTMLObjectTableElement;
00819
00820
00821
00822
00823 typedef struct{
00824 Boolean used;
00825 int y;
00826 XmHTMLObjectTable *start;
00827 XmHTMLObjectTable *end;
00828 }XmHTMLLineTable;
00829
00830
00831
00832
00833
00834
00835
00836 typedef struct _XmHTMLSubDoc{
00837 int x;
00838 int y;
00839 Dimension width;
00840 Dimension height;
00841 Cardinal nlines;
00842 XmHTMLObject *elements;
00843 XmHTMLObjectTable *start;
00844 XmHTMLObjectTable *end;
00845 struct sd_funcs{
00846 void (*parse)();
00847 void (*format)();
00848 void (*layout)();
00849 void (*paint)();
00850 }sd;
00851 struct _XmHTMLSubDoc *child;
00852 struct _XmHTMLSubDoc *prev;
00853 struct _XmHTMLSubDoc *next;
00854 struct _ToolkitAbstraction *tka;
00855 }XmHTMLSubDoc;
00856
00857 #define LAY_SCROLLABLE (1<<1)
00858 #define LAY_FIXED (1<<2)
00859 #define LAY_FIXED_REL (1<<3)
00860 #define LAY_VISIBLE (1<<4)
00861 #define LAY_RAISE (1<<5)
00862 #define LAY_LOWER (1<<6)
00863 #define LAY_SEND_EVENTS (1<<7)
00864 #define LAY_RECV_EVENTS (1<<8)
00865 #define LAY_BG_IMAGE (1<<9)
00866 #define LAY_BG_COLOR (1<<10)
00867 #define LAY_TRANSPARENT (1<<11)
00868 #define LAY_WINDOW (1<<12)
00869 #define LAY_INPUT_OUTPUT (1<<13)
00870 #define LAY_INPUT_ONLY (1<<14)
00871 #define LAY_OUTPUT_ONLY (1<<15)
00872
00873 typedef struct _XmHTMLLayer{
00874 struct _XmHTMLLayer *self;
00875 int x;
00876 int y;
00877 Dimension width;
00878 Dimension height;
00879 unsigned long flags;
00880 unsigned long state;
00881 Byte zpos;
00882 XmHTMLImage *background;
00883 Pixel bg;
00884 Pixmap mask;
00885 Window window;
00886 XmHTMLSubDoc *subdoc;
00887
00888 struct l_funcs{
00889 void (*send_event)();
00890 void (*read_event)();
00891 void (*pass_event)();
00892 void (*refresh)();
00893 void (*raise)();
00894 void (*lower)();
00895 void (*scroll)();
00896 void (*map)();
00897 void (*unmap)();
00898 }lf;
00899
00900 struct _XmHTMLLayer *parent;
00901 struct _XmHTMLLayer *upper;
00902 struct _XmHTMLLayer *lower;
00903 struct _XmHTMLLayer *prev;
00904 struct _XmHTMLLayer *next;
00905 }XmHTMLLayer;
00906
00907
00908
00909
00910
00911
00912 struct _XmHTMLSearchableWord{
00913 String word;
00914 int len;
00915 Byte spacing;
00916 XmHTMLObjectTable *owner;
00917 int word_idx;
00918 };
00919
00920
00921
00922
00923 typedef struct _XmHTMLFrameWidget{
00924 int x;
00925 int y;
00926 Dimension width;
00927 Dimension height;
00928 Dimension size_s;
00929 FrameSize size_type;
00930 FrameScrolling scroll_type;
00931 String src;
00932 String name;
00933 Dimension margin_width;
00934 Dimension margin_height;
00935 Boolean resize;
00936 int border;
00937 Widget frame;
00938
00939
00940 int drag_x;
00941 int drag_y;
00942
00943
00944 Boolean is_frameset;
00945 struct _XmHTMLFrameWidget *frameset;
00946 struct _XmHTMLFrameWidget *next;
00947 struct _XmHTMLFrameWidget *prev;
00948 struct _XmHTMLFrameWidget *children;
00949 FramesetLayout layout;
00950 }XmHTMLFrameWidget;
00951
00952
00953
00954
00955 typedef struct _XmHTMLPage{
00956 XmHTMLObject *start;
00957 XmHTMLObject *end;
00958
00959 int page_no;
00960 Boolean redo_layout;
00961
00962 Boolean input_complete;
00963
00964
00965 Pixel anchor_fg;
00966 Pixel anchor_visited_fg;
00967 Pixel anchor_target_fg;
00968 Pixel anchor_activated_fg;
00969 Pixel anchor_activated_bg;
00970
00971
00972 Pixel body_bg;
00973 Pixel body_fg;
00974 String body_image_url;
00975 XmHTMLImage *body_image;
00976
00977
00978 int formatted_width;
00979 int formatted_height;
00980 int num_named_anchors;
00981 int anchor_words;
00982 XmHTMLWord *anchors;
00983 XmHTMLObjectTable *named_anchors;
00984 XmHTMLAnchor *anchor_data;
00985 XmHTMLObjectTable *formatted;
00986 Cardinal top_line;
00987 Cardinal nlines;
00988
00989
00990 XmHTMLTable *tables;
00991
00992
00993 XmHTMLFormData *form_data;
00994 }XmHTMLPage;
00995
00996
00997
00998
00999 typedef struct _stateStack{
01000 htmlEnum id;
01001 struct _stateStack *next;
01002 }stateStack;
01003
01004
01005
01006
01007
01008
01009
01010 typedef struct _PLC *PLCPtr;
01011
01012
01013
01014
01015
01016
01017
01018
01019
01020
01021
01022
01023
01024
01025
01026 typedef struct _AlphaChannelInfo{
01027 int fb_maxsample;
01028 int background[3];
01029 int ncolors;
01030 XColor *bg_cmap;
01031 }AlphaChannelInfo, *AlphaPtr;
01032
01033
01034
01035
01036
01037
01038
01039
01040
01041 #define GC_FILL_SOLID 0
01042 #define GC_FILL_TILED 1
01043 #define GC_FILL_STIPPLED 2
01044 #define GC_FILL_OPAQUE_STIPPLED 3
01045
01046 #define GC_CAP_NOT_LAST 0
01047 #define GC_CAP_BUTT 1
01048 #define GC_CAP_ROUND 2
01049 #define GC_CAP_PROJECTING 3
01050
01051 #define GC_LINE_SOLID 0
01052 #define GC_LINE_ON_OFF_DASH 1
01053 #define GC_LINE_DOUBLE_DASH 2
01054
01055 #define GC_JOIN_MITER 0
01056 #define GC_JOIN_ROUND 1
01057 #define GC_JOIN_BEVEL 2
01058
01059 #define GC_GXcopy 0
01060
01061 #define GC_COORDMODE_ORIGIN 0
01062 #define GC_COORDMODE_PREVIOUS 1
01063
01064 typedef struct _ToolkitAbstraction{
01065 Display *dpy;
01066 Drawable win;
01067 Window DefaultRoot;
01068 int width;
01069 int height;
01070 int widthMM;
01071 int heightMM;
01072
01073
01074
01075
01076
01077
01078 int fill_style[4];
01079 int cap_style[4];
01080 int line_style[3];
01081 int join_style[3];
01082 int gc_func[2];
01083 int coord_mode[2];
01084
01085
01086 GC (*CreateGC)();
01087 int (*FreeGC)();
01088 int (*CopyGC)();
01089 int (*SetFunction)();
01090 int (*SetClipMask)();
01091 int (*SetClipOrigin)();
01092 int (*SetTile)();
01093 int (*SetTSOrigin)();
01094 int (*SetFillStyle)();
01095 int (*SetFont)();
01096 int (*SetForeground)();
01097 int (*SetBackground)();
01098 int (*SetLineAttributes)();
01099
01100
01101 XFontStruct* (*LoadQueryFont)();
01102 int (*FreeFont)();
01103 int (*GetFontProperty)();
01104 int (*TextExtents)();
01105
01106
01107 int (*UngrabPointer)();
01108 int (*DefineCursor)();
01109 int (*UndefineCursor)();
01110 int (*FreeCursor)();
01111
01112
01113 int (*ParseColor)();
01114 int (*AllocColor)();
01115 int (*QueryColor)();
01116 int (*QueryColors)();
01117 int (*FreeColors)();
01118
01119
01120 Pixmap (*CreatePixmap)();
01121 Pixmap (*CreatePixmapFromBitmapData)();
01122 int (*FreePixmap)();
01123
01124
01125 XImage *(*CreateImage)();
01126 void (*DestroyImage)();
01127 int (*PutImage)();
01128
01129
01130 int (*TextWidth)();
01131
01132 int (*DrawString)();
01133 int (*DrawLine)();
01134 int (*DrawLines)();
01135 int (*DrawRectangle)();
01136 int (*FillRectangle)();
01137 int (*DrawArc)();
01138 int (*FillArc)();
01139
01140
01141 int (*CopyArea)();
01142 int (*ClearArea)();
01143 int (*Sync)();
01144
01145
01146
01147
01148 Boolean (*IsRealized)();
01149 Boolean (*IsManaged)();
01150 void (*ManageChild)();
01151 void (*UnmanageChild)();
01152 void (*MoveWidget)();
01153 void (*ResizeWidget)();
01154 void (*ConfigureWidget)();
01155 void (*DestroyWidget)();
01156 void (*SetMappedWhenManaged)();
01157 void (*RemoveTimeOut)();
01158 XtIntervalId (*AddTimeOut)();
01159
01160
01161
01162
01163 void (*DrawShadows)();
01164
01165
01166
01167
01168 void *data;
01169 void (*FreeData)(void*);
01170
01171 }ToolkitAbstraction;
01172
01173
01174
01175
01176 typedef struct _Parser{
01177 String source;
01178 int index;
01179 int len;
01180 int num_lines;
01181 Dimension line_len;
01182 Dimension cnt;
01183
01184
01185 void (*store_text)();
01186
01187
01188 int num_elements;
01189 int num_text;
01190 XmHTMLObject *head;
01191 XmHTMLObject *current;
01192 XmHTMLObject *last;
01193
01194 stateStack state_base;
01195 stateStack *state_stack;
01196
01197 int cstart;
01198 int cend;
01199 int inserted;
01200
01201 Cardinal err_count;
01202 Cardinal loop_count;
01203 Boolean strict_checking;
01204 Boolean have_body;
01205 Byte warn;
01206 Boolean bad_html;
01207 Boolean html32;
01208 Boolean automatic;
01209 Boolean do_icons;
01210
01211 Widget widget;
01212 }Parser;
01213
01214
01215
01216
01217 typedef struct _XmHTMLPart {
01218
01219 String value;
01220 String source;
01221 String mime_type;
01222 Byte mime_id;
01223 Boolean input_complete;
01224
01225
01226 Cursor anchor_cursor;
01227 Boolean anchor_display_cursor;
01228 Boolean anchor_buttons;
01229
01230
01231 Pixel anchor_fg;
01232 Pixel anchor_visited_fg;
01233 Pixel anchor_target_fg;
01234 Pixel anchor_activated_fg;
01235 Pixel anchor_activated_bg;
01236 Boolean highlight_on_enter;
01237
01238
01239 Byte anchor_underline_type;
01240 Byte anchor_visited_underline_type;
01241 Byte anchor_target_underline_type;
01242
01243
01244 Byte anchor_line;
01245 Byte anchor_target_line;
01246 Byte anchor_visited_line;
01247
01248 Position anchor_position_x;
01249 Position anchor_position_y;
01250 XmHTMLObjectTable *armed_anchor;
01251 XmHTMLAnchor *anchor_current_cursor_element;
01252 XmHTMLAnchorProc anchor_visited_proc;
01253
01254
01255 Boolean body_colors_enabled;
01256 Boolean body_images_enabled;
01257 Boolean allow_color_switching;
01258 Boolean allow_form_coloring;
01259 Boolean freeze_animations;
01260 Boolean icon_entities_enabled;
01261 Byte icon_valign;
01262 Pixel body_bg;
01263 Pixel body_fg;
01264 String body_image_url;
01265 String def_body_image_url;
01266 XmHTMLImage *body_image;
01267 GC bg_gc;
01268
01269
01270 String charset;
01271 String font_family;
01272 String font_family_fixed;
01273 String font_sizes;
01274 String font_sizes_fixed;
01275 XmHTMLfont *default_font;
01276 Byte string_direction;
01277 Byte alignment;
01278 Alignment default_halign;
01279 Boolean allow_font_switching;
01280 int tabwidth;
01281
01282
01283 Boolean images_enabled;
01284 int max_image_colors;
01285 float screen_gamma;
01286 XmImageProc image_proc;
01287 XmImageGifProc gif_proc;
01288 String zCmd;
01289 XmHTMLImage *images;
01290 Boolean delayed_creation;
01291 XCC xcc;
01292
01293 Byte map_to_palette;
01294 String palette;
01295
01296
01297 XmHTMLImageMap *image_maps;
01298 Pixel imagemap_fg;
01299 Boolean imagemap_draw;
01300
01301
01302 Boolean is_frame;
01303 FrameScrolling scroll_type;
01304 int frame_border;
01305 int nframes;
01306 XmHTMLFrameWidget **frames;
01307
01308
01309 Boolean strict_checking;
01310 Boolean enable_outlining;
01311 Byte bad_html_warnings;
01312 XtPointer client_data;
01313
01314
01315 Dimension margin_width;
01316 Dimension margin_height;
01317 Widget work_area;
01318 Dimension work_width;
01319 Dimension work_height;
01320
01321 Boolean resize_height;
01322 Boolean resize_width;
01323
01324
01325 PLCPtr plc_buffer;
01326 int num_plcs;
01327 int plc_def_delay;
01328 int plc_delay;
01329 int plc_min_delay;
01330 int plc_max_delay;
01331 XtIntervalId plc_proc_id;
01332 XmHTMLGetDataProc get_data;
01333 XmHTMLEndDataProc end_data;
01334 Boolean plc_suspended;
01335 GC plc_gc;
01336
01337 XmHTMLLoadType load_type;
01338
01339
01340 Byte perfect_colors;
01341
01342
01343 AlphaPtr alpha_buffer;
01344 Byte rgb_conv_mode;
01345 Byte alpha_processing;
01346
01347
01348
01349
01350
01351 Pixel anchor_fg_save;
01352 Pixel anchor_visited_fg_save;
01353 Pixel anchor_target_fg_save;
01354 Pixel anchor_activated_fg_save;
01355 Pixel anchor_activated_bg_save;
01356 Pixel body_bg_save;
01357 Pixel body_fg_save;
01358
01359
01360 Widget hsb;
01361 Widget vsb;
01362 Byte sb_policy;
01363 Byte sb_placement;
01364 int scroll_x;
01365 int scroll_y;
01366 Boolean needs_hsb;
01367 Boolean needs_vsb;
01368
01369
01370 XtCallbackList activate_callback;
01371 XtCallbackList arm_callback;
01372 XtCallbackList anchor_track_callback;
01373 XtCallbackList frame_callback;
01374 XtCallbackList form_callback;
01375 XtCallbackList input_callback;
01376 XtCallbackList link_callback;
01377 XtCallbackList motion_track_callback;
01378 XtCallbackList imagemap_callback;
01379 XtCallbackList document_callback;
01380 XtCallbackList focus_callback;
01381 XtCallbackList losing_focus_callback;
01382 XtCallbackList event_callback;
01383 XtCallbackList object_callback;
01384 XtCallbackList page_callback;
01385
01386 Boolean need_tracking;
01387
01388 XmHTMLEventProc event_proc;
01389 HTEvent *events;
01390 int nevents;
01391 AllEvents *body_events;
01392
01393
01394 int formatted_width;
01395 int formatted_height;
01396 int num_named_anchors;
01397 int anchor_words;
01398 XmHTMLWord *anchors;
01399 XmHTMLObject *elements;
01400 XmHTMLObjectTable *named_anchors;
01401 XmHTMLAnchor *anchor_data;
01402 XmHTMLObjectTable *formatted;
01403 XmHTMLObjectTable *paint_start;
01404 XmHTMLObjectTable *paint_end;
01405 int paint_x;
01406 int paint_y;
01407 int paint_width;
01408 int paint_height;
01409 Cardinal top_line;
01410 Cardinal nlines;
01411 XmHTMLLineTable *line_table;
01412
01413
01414 XmHTMLObject *first_element;
01415 XmHTMLObject *last_element;
01416 XmHTMLObjectTable *first_formatted;
01417 XmHTMLObjectTable *last_formatted;
01418
01419
01420 XmHTMLTable *tables;
01421
01422
01423 XmHTMLExtObj *embedded;
01424
01425
01426 int press_x;
01427 int press_y;
01428 Time pressed_time;
01429 Time selected_time;
01430 XmHTMLAnchor *selected;
01431 XmHTMLObjectTable *current_anchor;
01432
01433
01434 XmHTMLObjectTable *selection;
01435 int select_start;
01436 int select_end;
01437
01438
01439 XmHTMLFormData *form_data;
01440
01441
01442 int repeat_delay;
01443 Boolean smooth_scroll;
01444 GC gc;
01445 Boolean in_layout;
01446
01447
01448
01449 int visibility;
01450
01451 ToolkitAbstraction *tka;
01452
01453 #ifdef DEBUG
01454 Boolean debug_disable_warnings;
01455 Boolean debug_full_output;
01456 Boolean debug_save_clipmasks;
01457 Boolean debug_no_loopcount;
01458 String debug_prefix;
01459 String debug_levels;
01460 #endif
01461
01462 unsigned char pad[60];
01463
01464 }XmHTMLPart;
01465
01466 typedef struct _XmHTMLRec
01467 {
01468 CorePart core;
01469 CompositePart composite;
01470 ConstraintPart constraint;
01471 XmManagerPart manager;
01472 XmHTMLPart html;
01473 } XmHTMLRec;
01474
01475
01476 #define XmHTMLIndex (XmManagerIndex+1)
01477
01478 externalref XmHTMLClassRec xmHTMLClassRec;
01479
01480
01481
01482
01483
01484 XMHTMLEXPORT void _XmHTMLComputeLayout(XmHTMLWidget html);
01485 XMHTMLEXPORT void _XmHTMLPaint(XmHTMLWidget html, struct _XmHTMLObjectTable *start,
01486 struct _XmHTMLObjectTable *end);
01487
01488
01489
01490
01491 #ifdef _LIBRARY
01492 #include "XmHTMLI.h"
01493 #include "HTMLWarnings.h"
01494 #endif
01495
01496 #ifdef __cplusplus
01497 }
01498 #endif
01499 _XFUNCPROTOEND
01500
01501 #endif
01502
01503 #endif
01504
01505 #endif // INC_MI32_XMHTMLP_H