home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / xfe.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  72.9 KB  |  2,024 lines

  1. /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. /*
  20.    xfe.h --- X-specific headers for the front end.
  21.    Created: Jamie Zawinski <jwz@netscape.com>, 22-Jun-94.
  22.  */
  23.  
  24. #define M12N
  25.  
  26. #ifndef _XFE_H_
  27. #define _XFE_H_
  28.  
  29. #ifdef    __cplusplus
  30. extern "C" {
  31. #endif
  32.  
  33. #include <sys/errno.h>
  34.  
  35. #undef TRUE /* OSF1 version of X conflicts... */
  36.  
  37. #include <X11/Intrinsic.h>
  38. /*
  39.  *    X11/Xlib.h "define"s Bool to be int. 
  40.  *    So.. Undef it here, so that the XP type
  41.  *    gets used...djw
  42.  */
  43. #ifdef Bool
  44. #undef Bool
  45. #endif
  46.  
  47. #include <X11/Shell.h>
  48.  
  49. #include <Xm/Xm.h>
  50. #include <Xm/CascadeB.h>
  51. #include <Xm/CascadeBG.h>
  52. #include <Xm/DragDrop.h>
  53. #include <Xm/Separator.h>
  54. #include <Xm/SeparatoG.h>
  55. #include <Xm/DialogS.h>
  56. #include <Xm/DrawingA.h>
  57. #include <Xm/Form.h>
  58. #include <Xm/PanedW.h>
  59. /*#include <Xm/Label.h>*/
  60. #include <Xm/LabelG.h>
  61. #include <Xm/PushB.h>
  62. #include <Xm/PushBG.h>
  63. #include <Xm/ToggleB.h>
  64. #include <Xm/ToggleBG.h>
  65. #include <Xm/RowColumn.h>
  66. #include <Xm/ScrollBar.h>
  67. #include <Xm/ScrolledW.h>
  68. #include <Xm/TextF.h>
  69. #include <Xm/Text.h>
  70. #include <Xm/MessageB.h>
  71. #include <Xm/SelectioB.h>
  72. #include <Xm/List.h>
  73. #include <Xm/FileSB.h>
  74. #include <Xm/Frame.h>
  75. #include <Xm/Protocols.h>
  76.  
  77. #include "menu.h"
  78.  
  79. #include "fe_rgn.h"
  80.  
  81. #ifndef TRUE /* OSF1 version of X conflicts... */
  82. #define TRUE 1
  83. #endif
  84.  
  85. #define X11STRING_LIMIT 600
  86.  
  87. #define NO_HELP
  88.  
  89. /* and again*/
  90. #ifdef Bool
  91. #undef Bool
  92. #endif
  93.  
  94. #include "prefs.h"
  95. #include "icondata.h"
  96.  
  97. #define BookmarkStruct HotlistStruct
  98. #define HOT_GetBookmarkList HOT_GetHotlistList
  99. #define HOT_SaveBookmark HOT_SaveHotlist
  100. #define HOT_SearchBookmark HOT_SearchHotlist
  101. #define HOT_ReadBookmarkFromDisk HOT_ReadHotlistFromDisk
  102. #define HOT_FreeBookmarks HOT_FreeHotlist
  103.  
  104. #define PERFECT_SCROLL
  105.  
  106. extern Atom WM_SAVE_YOURSELF;
  107.  
  108. typedef struct fe_colormap fe_colormap;
  109.  
  110. /* Platform-specific part of a compositor drawable, which consists of
  111.    a drawing target, an XY offset and a clipping region. */
  112. typedef struct fe_Drawable 
  113. {
  114.     Drawable xdrawable;         /* X11 drawable */
  115.     int xdrawable_serial_num;   /* Serial number for offscreen pixmap */
  116.     int32 x_origin;
  117.     int32 y_origin;
  118.     FE_Region clip_region;
  119. } fe_Drawable;
  120.  
  121. /* if not found in binpath, _long will contain full-path exec name */ 
  122. /* if FOUND in binpath, fe_progname_long == fe_progname */
  123. extern const char *fe_progname_long; 
  124. extern const char *fe_progname;
  125. extern const char *fe_progclass;
  126. extern const char fe_BuildDate[];
  127. extern MWContext *someGlobalContext;
  128. extern FILE *real_stderr, *real_stdout;
  129. extern XtAppContext fe_XtAppContext;
  130. extern Display *fe_display;
  131. extern int fe_WindowCount;
  132. extern XtResource fe_Resources[], fe_GlobalResources[];
  133. extern Cardinal fe_ResourcesSize, fe_GlobalResourcesSize;
  134. extern char *sploosh;
  135. extern Boolean fe_ImagesCantWork;
  136.  
  137. extern const char fe_BuildConfiguration[];
  138. extern const char fe_version[];
  139. extern const char fe_long_version[];
  140. extern char *fe_version_and_locale;
  141. extern int fe_SecurityVersion;
  142. extern int fe_HaveDNS;
  143. extern int fe_VendorAnim;
  144. extern char *fe_pidlock;
  145.  
  146. XP_BEGIN_PROTOS
  147.  
  148. void fe_SetAcceptLanguage(char *new_accept_lang);
  149.  
  150. XP_END_PROTOS
  151.  
  152. /*
  153.  *  Right Justification of labels
  154.  *
  155.  * There is a Motif form widget bug related to right aligning widgets
  156.  * This but is generally encountered when lining up labels.  
  157.  *
  158.  *      +-------------------------------------------+
  159.  *      |                                           |
  160.  *      | label1 text1                              |
  161.  *      |                                           |
  162.  *    longlabel2 text                               |
  163.  *      |                                           |
  164.  *      |                                           |
  165.  *      +-------------------------------------------+
  166.  *
  167.  * If a child widget (longlabel2) is attached on the right (say to label1) 
  168.  * and not on the left (the default if attached on the right and not 
  169.  * specified on the left) and the x position ends up negative as in
  170.  * the diagram above the form will try to grow to make the x position
  171.  * positive.
  172.  *
  173.  * If the right position is not a function of the forms width, as in
  174.  * this example, the form does not stop trying and hence ends up
  175.  * getting stuck in a "10,000 iterations" loop trying to grow
  176.  * in the futile hope that the x position will become positive
  177.  * which never will happen since the right position is not a function
  178.  * of the width.
  179.  *
  180.  * This situation is made worse when translating the labels to another
  181.  * language as the relative lengths of the labels probably change.
  182.  * What worked in English probably will not work in every other language.
  183.  *
  184.  * So:
  185.  * WARNING: do not right justify using 
  186.  *       XmNrightAttachment = XmATTACH_WIDGET or XmATTACH_OPPOSITE_WIDGET
  187.  *       XmNleftAttachment  = XmATTACH_NONE (or not specified)
  188.  * because if the left edge ends up negative the form will complain:
  189.  *
  190.  *  "Bailed out of edge synchronization after 10,000 iterations
  191.  *   Check for contradictory constrastraints on children of this form"
  192.  *
  193.  * Instead use fe_GetWidestWidgetVa (label1, longlabel2, NULL); 
  194.  * to get the width of the labels and then use RIGHT_JUSTIFY_VA_ARGS
  195.  * to position the labels. This visually right justifies but actually 
  196.  * 'under the hood' left justifies. Negative x positions are allowed.
  197.  */
  198. #define RIGHT_JUSTIFY_VA_ARGS(widget,rightEdge) \
  199.         XmNleftAttachment, XmATTACH_FORM, \
  200.         XmNleftOffset, (rightEdge) - XfeWidth(widget), \
  201.         XmNrightAttachment, XmATTACH_NONE
  202.  
  203. XP_BEGIN_PROTOS
  204.  
  205. extern void fe_copy_context_settings(MWContext *to, MWContext *from);
  206. extern void fe_wm_save_self_cb(Widget w, XtPointer clientData, XtPointer callData);
  207. extern Boolean fe_add_session_manager(MWContext *context);
  208. extern char *xfe_get_netscape_home_page_url (void);
  209.  
  210. extern URL_Struct *fe_GetBrowserStartupUrlStruct(void);
  211. extern void fe_InitCommandActions (void);
  212. extern void fe_InitMouseActions (void);
  213. extern void fe_InitKeyActions (void);
  214. extern void fe_HackTranslations (MWContext *, Widget);
  215. extern void fe_HackTextTranslations(Widget);
  216. extern void fe_HackDialogTranslations(Widget);
  217. extern void fe_EventLoop (void);
  218. extern int fe_GetURL (MWContext *context, URL_Struct *url_struct,
  219.             Boolean skip_get_url);
  220. extern int fe_GetSecondaryURL (MWContext *context, URL_Struct *url_struct,
  221.                int output_format, void *call_data,
  222.                    Boolean skip_get_url);
  223. extern char *fe_GetURLAsText (MWContext *context, URL_Struct *url,
  224.                   const char *prefix,
  225.                   unsigned long *data_size_ret);
  226. extern char *fe_GetURLAsPostscript (MWContext *context, URL_Struct *url,
  227.                     unsigned long *data_size_ret);
  228. extern char *fe_GetURLAsSource (MWContext *context, URL_Struct *url,
  229.                 unsigned long *data_size_ret);
  230. extern MWContext* fe_BrowserGetURL(MWContext* context, char* address);
  231. extern void fe_SaveURL (MWContext *context, URL_Struct *url);
  232. extern void fe_InitializeGlobalResources (Widget toplevel);
  233. extern MWContext *fe_MakeWindow (Widget toplevel, MWContext *context_to_copy,
  234.                  URL_Struct *url, char *window_name,
  235.                  MWContextType type, Boolean skip_get_url);
  236. extern MWContext * fe_MakeNewWindow(Widget toplevel, MWContext *context_to_copy,
  237.                         URL_Struct *url, char *window_name, MWContextType type,
  238.                         Boolean skip_get_url, Chrome *decor);
  239. void fe_MakeChromeWidgets (Widget shell, MWContext *context);
  240. extern void fe_MakeSaveToDiskContextWidgets (Widget toplevel,
  241.                         MWContext *context);
  242. extern void fe_MakeWidgets (Widget toplevel, MWContext *context);
  243. extern Widget fe_MakeMenubar (Widget parent, MWContext *context);
  244. extern Widget fe_MakeToolbar (Widget parent, MWContext *context,
  245.                   Boolean urls_p);
  246. extern Widget fe_MakeToolbarFromSpec (Widget parent, MWContext *context,
  247.                       fe_button *tb, int tb_size, Boolean directory_buttons_p,
  248.                       Boolean name_for_pixmap_lookups_p);
  249. extern void fe_GetSashGeometry(char *geom_str, int pane_config,
  250.                    unsigned int *w, unsigned int *h);
  251. extern void fe_RebuildWindow (MWContext *context);
  252. extern void fe_GenerateBookmarkMenu (MWContext *context);
  253. extern void fe_GenerateWindowsMenu (MWContext *context);
  254. extern void fe_InvalidateAllBookmarkMenus (void);
  255. extern Boolean fe_ImportBookmarks (char *filename);
  256. extern Boolean fe_LoadBookmarks (char *filename);
  257. extern Boolean fe_SaveBookmarks (void);
  258. extern void fe_AddToBookmark (MWContext *, const char *title, URL_Struct *,
  259.                   time_t time);
  260. extern Widget fe_MakeScrolledWindow (MWContext *, Widget, const char *);
  261. extern void fe_SensitizeMenus (MWContext *context);
  262. extern void fe_MsgSensitizeChildren(Widget, XtPointer, XtPointer);
  263. extern void fe_DestroyContext (MWContext *context);
  264. extern void fe_DestroySaveToDiskContext (MWContext *context);
  265. extern void fe_DestroyLayoutData (MWContext *context);
  266. extern void fe_LoadDelayedImages (MWContext *context);
  267. extern void fe_LoadDelayedImage (MWContext *context, const char *url);
  268. extern void fe_ReLayout (MWContext *context, NET_ReloadMethod force_reload);
  269. extern void fe_AbortCallback (Widget, XtPointer, XtPointer);
  270. extern void fe_QuitCallback (Widget, XtPointer, XtPointer);
  271. extern void fe_SaveAsCallback (Widget, XtPointer, XtPointer);
  272. extern void fe_OpenURLDialog(MWContext* context);
  273. extern void fe_OpenURLChooseFileDialog (MWContext *context);
  274. extern void fe_NetscapeCallback (Widget, XtPointer, XtPointer);
  275. extern void fe_SearchCallback (Widget, XtPointer, XtPointer);
  276. extern void fe_GuideCallback (Widget, XtPointer, XtPointer);
  277. #ifdef __sgi
  278. extern void fe_SGICallback (Widget, XtPointer, XtPointer);
  279. #endif /* __sgi */
  280. extern void fe_RefreshAllAnchors (void);
  281. extern void fe_ScrollTo (MWContext *context, unsigned long x, unsigned long y);
  282. extern void fe_SetDocPosition (MWContext *, unsigned long x, unsigned long y);
  283. extern void fe_SetCursor (MWContext *context, Boolean over_link_p);
  284. extern void fe_EventLOCoords (MWContext *context, XEvent *event,
  285.                   unsigned long *x, unsigned long *y);
  286. extern void fe_SyncExposures(MWContext* context);
  287. extern void fe_RefreshArea(MWContext*, int32 x, int32 y, uint32 w, uint32 h);
  288.  
  289. extern void fe_ScrollForms (MWContext *context, int x_off, int y_off);
  290. extern void fe_GravityCorrectForms (MWContext *context, int x_off, int y_off);
  291. extern void fe_SetFormsGravity (MWContext *context, int gravity);
  292. extern void fe_NukeBackingStore (Widget widget);
  293.  
  294. extern void fe_StartProgressGraph (MWContext *context);
  295. extern void fe_StopProgressGraph (MWContext *context);
  296. extern void fe_SetURLString (MWContext *context, URL_Struct *url);
  297. extern void fe_perror (MWContext *context, const char *message);
  298. extern void fe_stderr (MWContext *context, const char *message);
  299. extern void fe_Message (MWContext *context, const char *message);
  300. extern char *fe_Basename (const char *string);
  301. extern XP_Bool fe_StrEndsWith(char *string, char *endString);
  302. extern void fe_MidTruncatedProgress (MWContext *context, const char *message);
  303. extern Boolean fe_ContextHasPopups(MWContext* context);
  304. extern void *fe_prompt (MWContext *context, Widget parent, 
  305.                         const char *title, const char *message, 
  306.                         XP_Bool question_p, const char *text,
  307.                         XP_Bool wait_p, XP_Bool select_p,
  308.                         char **passwd);
  309. extern void *fe_dialog (Widget parent, const char *title,
  310.             const char *message, XP_Bool question_p,
  311.             const char *text, XP_Bool wait_p, XP_Bool select_p,
  312.             char **passwd);
  313. extern Boolean fe_Confirm_2 (Widget parent, const char *message);
  314. extern void fe_Alert_2 (Widget parent, const char *message);
  315. extern void fe_perror_2 (Widget parent, const char *message);
  316. extern void fe_UpdateGraph (MWContext *context, Boolean update_text);
  317. extern GC fe_GetGC (Widget, unsigned long flags, XGCValues *gcv);
  318. extern GC fe_GetClipGC(Widget widget, unsigned long flags, XGCValues *gcv,
  319.                        Region clip_region);
  320. extern GC fe_GetGCfromDW(Display* dpy, Window win, unsigned long flags,
  321.                          XGCValues *gcv, Region clip_region);
  322. extern void fe_FlushGCCache (Widget widget, unsigned long flags);
  323. extern void fe_GetMargin(MWContext*, int32 *marginw_ptr, int32 *marginh_ptr);
  324.  
  325. extern Pixel fe_GetPermanentPixel (MWContext *context, int r, int g, int b);
  326. extern Pixel fe_GetPixel (MWContext *context, int r, int g, int b);
  327. extern Pixel fe_GetImagePixel (MWContext *context, int r, int g, int b);
  328. extern void fe_QueryColor (MWContext *context, XColor *color);
  329. extern Colormap fe_MakeNewColormap (MWContext *new_context,
  330.                     MWContext *context_to_copy);
  331. extern void fe_DisposeColormap(MWContext *context);
  332. extern fe_colormap *fe_NewColormap(Screen *screen, Visual *visual,
  333.                                     Colormap cmap, Boolean private_p);
  334. extern Colormap fe_cmap(MWContext *context);
  335. extern void fe_DefaultColormapAndVisual(Colormap *colormap, Visual *visual);
  336. extern void fe_InitColormap (MWContext *context);
  337. extern void fe_FreeTransientColors(MWContext *context);
  338. extern Status fe_AllocColor(fe_colormap *colormap, XColor *color_in_out);
  339. extern void fe_AllocClosestColor (fe_colormap *colormap,
  340.                                   XColor *color_in_out);
  341. extern int fe_ColorDepth(fe_colormap * colormap);
  342. extern Pixel *fe_ColormapMapping(MWContext *context);
  343.  
  344. /* Set the transparent pixel color.  The transparent pixel is passed into
  345.    calls to IL_GetImage for image requests that do not use a mask. */
  346. extern XP_Bool fe_SetTransparentPixel(MWContext *context, uint8 red,
  347.                                       uint8 green, uint8 blue,
  348.                                       Pixel server_index);
  349.  
  350. extern void fe_InitIconColors (MWContext *context);
  351. extern void fe_InitIcons (MWContext *context, MSG_BIFF_STATE state);
  352. extern void fe_IconSize (int icon_number, long *width, long *height);
  353. extern Pixmap fe_ToolbarPixmap (MWContext *context, int i, Boolean disabled_p,
  354.                 Boolean urls_p);
  355. /* used for the mail window, where integer indexes just don't work. */
  356. extern Pixmap fe_ToolbarPixmapByName (MWContext *context, char *pixmap_name, Boolean disabled_p,
  357.                       Boolean urls_p);
  358. #ifndef NO_SECURITY
  359. extern Pixmap fe_SecurityPixmap (MWContext *context,
  360.                  Dimension *w, Dimension *h,
  361.                  int type);
  362. #endif
  363.  
  364. extern Boolean plonk (MWContext *context);
  365. extern void fe_RegisterConverters (void);
  366. extern void fe_RegisterPluginConverters (void);
  367. extern void fe_DrawShadows (MWContext *cx, fe_Drawable *drawable, int x, int y,
  368.                 int width, int height,
  369.                 int shadow_width, int shadow_style);
  370. extern void fe_HistoryDialog (MWContext *context);
  371. extern void fe_RegenerateHistoryMenu (MWContext *context);
  372. extern void fe_HistoryItemAction (Widget, XEvent *, String *, Cardinal *);
  373. extern MWContext * fe_findcommand_context();
  374. extern void fe_unset_findcommand_context();
  375. extern void fe_FindDialog (MWContext *context, Boolean really_do_it_p);
  376. extern void fe_FindReset (MWContext *context);
  377. extern void fe_PrintDialog (MWContext *context);
  378. extern void fe_Print (MWContext *context, URL_Struct *url,
  379.             Boolean toFile, char *filename);
  380. extern void fe_DocInfoDialog (MWContext *context);
  381. extern void fe_UpdateDocInfoDialog (MWContext *context);
  382. extern void fe_AddBookmark (MWContext *context,
  383.                const char *url, const char *title);
  384. extern void fe_AddBookmarkCallback (Widget, XtPointer, XtPointer);
  385. extern void fe_ViewBookmarkCallback (Widget, XtPointer, XtPointer);
  386. extern void fe_GotoBookmarkCallback (Widget, XtPointer, XtPointer);
  387. extern void fe_PropertyTextDialog (MWContext *context);
  388. extern void fe_PropertyImageDialog (MWContext *context);
  389. extern void fe_GeneralPrefsDialog (MWContext *context);
  390. extern void fe_MailNewsPrefsDialog (MWContext *context);
  391. extern void fe_NetworkPrefsDialog (MWContext *context);
  392. extern void fe_SecurityPrefsDialog (MWContext *context);
  393. extern void fe_InstallPreferences (MWContext *context);
  394. extern Widget fe_ViewSourceDialog (MWContext *context,
  395.                    const char *title, const char *url);
  396. extern void fe_LicenseDialog (MWContext *context);
  397. extern void fe_url_exit (URL_Struct *url, int status, MWContext *context);
  398. extern void fe_RaiseSynchronousURLDialog (MWContext *context,
  399.                       Widget parent,
  400.                       const char *title);
  401. extern void fe_LowerSynchronousURLDialog (MWContext *context);
  402. extern void fe_DefaultUserInfo (char **uid, char **name,
  403.                 Boolean really_default_p);
  404. extern void fe_VerifyDiskCache (MWContext *context);
  405. /* spider begin */
  406. extern void fe_VerifySARDiskCache (MWContext *context);
  407. extern void fe_VerifyDiskCacheExistence(MWContext *contect, char * cache_directory) ; 
  408. /* spider end */
  409. extern Boolean fe_CheckUnsentMail (void);
  410. extern Boolean fe_CheckDeferredMail (void);
  411. extern void fe_SetString(Widget widget, const char* propname, char* str);
  412. extern int  fe_MoveMail(MWContext *context, char *from, char *to);
  413.  
  414. #ifdef OSF1
  415. extern Widget fe_CreateTextField(Widget parent, char *name, Arg *av, int ac);
  416. #else
  417. extern Widget fe_CreateTextField(Widget parent, const char *name, Arg *av, int ac);
  418. #endif
  419.  
  420. extern void fe_TextFieldSetString(Widget widget, char* value, Boolean notify);
  421. extern Widget fe_CreateText(Widget parent, const char *name, Arg *av, int ac);
  422. extern Widget fe_CreateOptionMenu(Widget parent, char* name, Arg* p_argv, Cardinal p_argc);
  423. extern Widget fe_CreatePulldownMenu(Widget parent, char* name, Arg*, Cardinal);
  424. extern Widget fe_CreatePromptDialog(MWContext *context, char* name,
  425.                              Boolean ok, Boolean cancel, Boolean apply,
  426.                              Boolean separator, Boolean modal);
  427. extern Widget fe_CreateTabForm(Widget parent, char* name, Arg*, Cardinal);
  428. extern Widget fe_CreateColorPicker(Widget parent, char* name, Arg*, Cardinal);
  429. extern void   fe_ColorPickerSetColor(Widget picker, LO_Color* color);
  430. extern void   fe_ColorPickerGetColor(Widget picker, LO_Color* color);
  431. typedef enum {
  432.     XFE_COLOR_PICKER_SWATCHES,
  433.     XFE_COLOR_PICKER_RGB,
  434.     XFE_COLOR_PICKER_LAST
  435. } fe_ColorPickerTabType;
  436. extern void   fe_ColorPickerSetActiveTab(Widget, fe_ColorPickerTabType);
  437. extern Widget fe_CreateColorPickerDialog(Widget, char* name, Arg*, Cardinal);
  438. extern void   fe_ColorPickerDialogSetColor(Widget dialog, LO_Color* color);
  439. extern void   fe_ColorPickerDialogGetColor(Widget dialog, LO_Color* color);
  440. extern void   fe_ColorPickerDialogSetActiveTab(Widget, fe_ColorPickerTabType);
  441. extern int    fe_SwatchMatrixGetColor(Widget, Position p_x, Position p_y,
  442.                         XColor* color_r);
  443. extern Widget fe_CreateSwatchMatrix(Widget parent, char* name, Arg*, Cardinal);
  444. extern void fe_AddSwatchMatrixCallback(Widget matrix, char* name, XtCallbackProc, XtPointer);
  445.  
  446. extern Boolean fe_contextIsValid( MWContext *context );
  447. extern void fe_SetGridFocus (MWContext *context);
  448. extern void fe_MochaFocusNotify (MWContext *context, LO_Element *element);
  449. extern void fe_MochaBlurNotify (MWContext *context, LO_Element *element);
  450. extern MWContext *fe_GetFocusGridOfContext (MWContext *context);
  451. extern Boolean fe_IsGridParent (MWContext *context);
  452. extern void fe_forms_clean_text(MWContext *context, int charset,
  453.                 char *text, Boolean newlines_too_p);
  454. extern Boolean fe_HandleHREF (MWContext *context, LO_Element *xref,
  455.                   Boolean save_p, Boolean other_p,
  456.                   CL_Event *layer_event,
  457.                   CL_Layer *layer);
  458. extern void fe_getVisualOfContext(MWContext *context, Visual **v_ptr,
  459.                 Colormap *cmap_ptr, Cardinal *depth_ptr);
  460.  
  461. /* Address Book routines */
  462. extern void FE_InitAddrBook(void);
  463.  
  464. /* File status routines */
  465. extern XP_Bool fe_isFileChanged(char *filename, time_t mtime, time_t *new_mtime);
  466. extern Boolean fe_isFileExist(char *filename);
  467. extern Boolean fe_isFileReadable(char *filename);
  468. extern Boolean fe_isDir(char *dirname);
  469.  
  470. extern Boolean fe_MovemailWarning(MWContext* context);
  471.  
  472. /* Components related */
  473. extern XP_Bool fe_IsConferenceInstalled(void);
  474. extern XP_Bool fe_IsCalendarInstalled(void);
  475. extern XP_Bool fe_IsHostOnDemandInstalled(void);
  476. extern XP_Bool fe_IsPolarisInstalled(void);
  477.  
  478. XP_END_PROTOS
  479.  
  480. #include "xp_str.h"
  481.  
  482.  
  483. struct fe_file_type_data
  484. {
  485.   Widget options[10];
  486.   int selected_option;
  487. #ifdef NEW_DECODERS
  488.   Boolean conversion_allowed_p;
  489.   Widget fileb;
  490.   const char *orig_url;
  491. #endif /* NEW_DECODERS */
  492. };
  493.  
  494. XP_BEGIN_PROTOS
  495.  
  496. int16    XFE_GetDefaultCSID(void);
  497.  
  498. extern void fe_Exit (int status);
  499. extern void fe_MinimalNoUICleanup(void);
  500. extern char *fe_ReadFileName_2 (MWContext *context,
  501.                   Widget parent,
  502.                   Widget *filebp,
  503.                   struct fe_file_type_data **ftdp,
  504.                   const char *title,
  505.                   const char *default_url,
  506.                   Boolean must_exist,
  507.                   int *save_as_type);
  508. extern char *fe_ReadFileName (MWContext *context,
  509.                   const char *title,
  510.                   const char *default_url,
  511.                   Boolean must_exist,
  512.                   int *save_as_type);
  513. extern Widget fe_CreateFileSelectionBox(Widget, char*, Arg*, Cardinal);
  514. extern Widget fe_CreateFileSelectionDialog(Widget, String, Arg*, Cardinal);
  515. extern MWContext *fe_WidgetToMWContext (Widget widget);
  516. extern MWContext *fe_MotionWidgetToMWContext (Widget widget);
  517. extern void fe_UserActivity (MWContext *context);
  518. extern void fe_DrawIcon (MWContext *context, LO_ImageStruct *lo_image,
  519.              int icon_number);
  520.  
  521. extern void fe_config_eh (Widget, XtPointer, XEvent *);
  522. extern void fe_InitScrolling (MWContext *context);
  523. extern void fe_DisableScrolling (MWContext *context);
  524. extern void fe_SetGuffaw (MWContext *context, Boolean on);
  525. extern void fe_ClearAreaWithExposures(MWContext *context,
  526.           int x, int y, unsigned int w, unsigned int h, Boolean exposures);
  527. extern int fe_WindowGravityWorks (Widget, Widget);
  528. extern void fe_FormatDocTitle (const char *title, const char *url,
  529.                    char *output, int size);
  530. extern void fe_NeutralizeFocus (MWContext *context);
  531.  
  532. XP_END_PROTOS
  533.  
  534. /* context layout functions
  535.  */
  536. #define MAKE_FE_FUNCS_PREFIX(func) XFE##_##func
  537. #define MAKE_FE_FUNCS_EXTERN
  538. #include "mk_cx_fn.h"
  539.  
  540. XP_BEGIN_PROTOS
  541.  
  542. extern ContextFuncs * fe_BuildDisplayFunctionTable(void);
  543.  
  544. extern Visual *fe_ParseVisual (Screen *screen, const char *v);
  545. extern char *fe_VisualDescription (Screen *screen, Visual *visual);
  546. extern int fe_ScreenNumber (Screen *screen);
  547. extern Visual *fe_ReadVisual (MWContext *context);
  548. extern void fe_ChangeVisualCallback (Widget, XtPointer, XtPointer);
  549. extern int fe_VisualDepth (Display *dpy, Visual *visual);
  550. extern int fe_VisualPixmapDepth (Display *dpy, Visual *visual);
  551. extern int fe_VisualCells (Display *dpy, Visual *visual);
  552.  
  553. extern void fe_SetupPasswdText (Widget text_field, int max_length);
  554. extern char *fe_GetPasswdText (Widget text_field);
  555.  
  556. /* can only be called after fe_SetupPasswdText(), above. */
  557. extern void fe_MarkPasswdTextAsFormElement(Widget text_field);
  558. extern Boolean fe_IsPasswdTextFormElement(Widget text_field);
  559.  
  560. extern char *fe_StringTrim (char *string);
  561.  
  562. extern void fe_clipboard_link_cb (Widget widget, XtPointer closure, 
  563.                                   XtPointer call_data, URL_Struct *url);
  564. extern void fe_clipboard_image_link_cb (Widget widget, XtPointer closure, 
  565.                                         XtPointer call_data, URL_Struct *url,
  566.                                         URL_Struct *img);
  567. extern void fe_clipboard_image_cb (Widget widget, XtPointer closure, 
  568.                                    XtPointer call_data, URL_Struct *url);
  569.  
  570. extern void fe_InitRemoteServerWindow (MWContext *context);
  571. extern void fe_InitRemoteServer (Display *dpy);
  572. extern int fe_RemoteCommands (Display *dpy, Window window, char **commands);
  573.  
  574. extern XtActionsRec fe_CommandActions [], fe_MailNewsActions [];
  575. extern int fe_CommandActionsSize, fe_MailNewsActionsSize;
  576. extern void fe_UnmanageChild_safe (Widget w);
  577. extern void fe_DestroyWidgetTree(Widget *kids, int nkids);
  578.  
  579. /*
  580.  * Context protection/destruction releated routines
  581.  */
  582. void fe_ProtectContext(MWContext *context);
  583. void fe_UnProtectContext(MWContext *context);
  584. Boolean fe_IsContextProtected(MWContext *context);
  585. Boolean fe_IsContextDestroyed(MWContext *context);
  586.  
  587. /*
  588.  *    Tool tip support.
  589.  */
  590. typedef struct {
  591.     int     reason;
  592.     XEvent* event;
  593.     String* string;
  594.     int     x, y;
  595. } XFE_TipStringCallbackStruct;
  596.  
  597. #define XFE_TIPSTRING 1
  598. #define XFE_DOCSTRING 2
  599.  
  600. void    fe_AddTipStringCallback(Widget, XtCallbackProc, XtPointer);
  601. void    fe_ButtonAddDocStringCallback(MWContext*, Widget,
  602.                                       XtCallbackProc, XtPointer);
  603.  
  604. typedef Boolean (*fe_ToolTipGadgetCheckProc)(Widget widget);
  605. void    fe_ManagerAddGadgetToolTips(Widget manager, fe_ToolTipGadgetCheckProc);
  606. void    fe_WidgetAddToolTips(Widget widget);
  607. Widget  fe_CreateToolTipsDemoToggle(Widget, char*, Arg* args, Cardinal n);
  608. Boolean fe_ManagerCheckGadgetToolTips(Widget, fe_ToolTipGadgetCheckProc);
  609. void fe_WidgetAddDocumentString(MWContext *context, Widget widget);
  610.  
  611. extern void fe_PrimarySelectionFetchURL(MWContext *context);
  612.  
  613. /*
  614.  * Search Callback
  615.  */
  616.  
  617. typedef void (*fe_searchFinishedFunction)(
  618.                   MWContext* context
  619.                   );
  620. typedef void (*fe_searchOutlineChangeFunction)(
  621.                   MWContext* context,
  622.               int index,
  623.           int32 num,
  624.           int totallines    
  625.                   );
  626.  
  627. /*
  628.  *    Widget tree walking routine.
  629.  */
  630. typedef XtPointer (*fe_WidgetTreeWalkMappee)(Widget widget, XtPointer data);
  631. XtPointer fe_WidgetTreeWalk(Widget widget, fe_WidgetTreeWalkMappee callback,
  632.           XtPointer data);
  633. XtPointer fe_WidgetTreeWalkChildren(Widget widget,
  634.                     fe_WidgetTreeWalkMappee callback,
  635.                     XtPointer data);
  636. Widget    fe_FindWidget(Widget top, char* name); /* find widget by name */
  637.  
  638. XP_END_PROTOS
  639.  
  640. #define countof(x) (sizeof(x) / sizeof (*x))
  641.  
  642. /*
  643.  * Drag'n'drop for Mail compose
  644.  */
  645. #include "dragdrop.h"
  646.  
  647. XP_BEGIN_PROTOS
  648.  
  649. /*
  650.  * Mail compose: Attachments
  651.  */
  652. # define XFE_MAX_ATTACHMENTS    128
  653. struct fe_mail_attach_data
  654. {
  655.   MWContext* context;
  656.   MSG_Pane* comppane;
  657.   Widget shell;
  658.   Widget list;
  659.   Widget attach_file, delete_attach;
  660.   Widget text_p, source_p, postscript_p;
  661.  
  662.   Widget file_shell;
  663.  
  664.   Widget location_shell;
  665.   Widget location_text;
  666.  
  667.   int nattachments;
  668.   struct MSG_AttachmentData attachments[XFE_MAX_ATTACHMENTS];
  669. };
  670.  
  671. /*
  672.  * Mail/News/Browser find
  673.  */
  674.  
  675. typedef struct
  676. {
  677.   MWContext *context;
  678.   MWContext *context_to_find;    /* used for which frame cell to find in. */
  679.   Boolean find_in_headers;
  680.   Boolean case_sensitive_p, backward_p;
  681.   char *string;
  682.   Widget shell, text, case_sensitive, backward, msg_head, msg_body;
  683.   LO_Element *start_element, *end_element;
  684.   int32 start_pos, end_pos;
  685. } fe_FindData;
  686.  
  687.  
  688. /*
  689.  * Context data has subparts. Parts that only specific contexts will need.
  690.  * fe_ContextData
  691.  *    ...all data common to most contexts...
  692.  *    fe_NewsContextData *news;
  693.  *    fe_MailContextData *news;
  694.  *    fe_ComposeContextData *news;
  695.  */
  696.  
  697. /* Pane specific context data */
  698. typedef struct fe_PaneData {
  699.   Widget folderform;        /* Form that holds the folderlist. */
  700.   Widget messageform;        /* Form that holds the messagelist. */
  701.   Widget folderlist;        /* List of mail folders. */
  702.   Widget messagelist;        /* List of mail messages. */
  703.  
  704.   /* used in the mail stuff if the user sets the preference item to 
  705.      display messages in the mail window -- not in a message window. */
  706.   Widget drawing_area;
  707.   Widget scrolled;
  708.   Widget hscroll;
  709.   Widget vscroll;
  710. } fe_PaneData;
  711.  
  712.  
  713. #define NUMMAILTABS 1
  714.  
  715. /* tabs on the mail news window. */
  716. enum {
  717.   NO_TAB = -1,
  718.  
  719.   INBOX_TAB = 0
  720. };
  721.  
  722. typedef struct fe_MailTabData {
  723.   fe_PaneData *panedata;
  724.  
  725.   WidgetList tab_specific_toolbar;
  726.   int tab_specific_toolbar_count;
  727.  
  728.   MSG_Pane *threadpane;
  729.   MSG_FolderInfo *folderinfo; /* the folder displayed in this tab. */
  730.   XP_List *selected_folders;
  731.   XP_List *selected_messages;
  732. } fe_MailTabData;
  733.  
  734. /* Mail context specific context data */
  735. typedef struct fe_MailNewsContextData {
  736.   Widget folder;
  737.  
  738.   fe_MailTabData **mailtabs;
  739.  
  740.   WidgetList msgwindow_tb; /* the buttons we need that are normally in the msgwindow. */
  741.   int msgwindow_tb_count;
  742.  
  743.   /* for keeping track of which view we're displaying. */
  744.   int active_tab;
  745.  
  746.   MSG_Pane *folderpane;
  747.   MSG_Pane *messagepane;
  748.  
  749.   /* For open news host dialog */
  750.   Widget openNewsHost_shell;
  751.   Widget openNewsHost_host;
  752.   Widget openNewsHost_port;
  753.   Widget openNewsHost_secure;
  754.   ReadFileNameCallbackFunction openNewsHost_fn;
  755.   void *openNewsHost_fnClosure;
  756.   
  757. } fe_MailNewsContextData;
  758.  
  759. typedef struct fe_MsgWindowContextData {
  760.   MSG_Pane *messagepane;
  761. } fe_MsgWindowContextData;
  762.  
  763. typedef struct fe_ArticleWindowContextData {
  764.   MSG_Pane *messagepane;
  765. } fe_ArticleWindowContextData;
  766.  
  767. typedef struct fe_caret_data
  768. {
  769.   int      x;
  770.   int      y;
  771.   unsigned width;
  772.   unsigned height;
  773.   int      time;
  774.   XtIntervalId timer_id;
  775.   Bool     showing;
  776.   Bool     running;
  777.   Pixmap   backing_store;
  778. } fe_EditorCaretData;
  779.  
  780. typedef struct fe_EditorAscrollData
  781. {
  782.     XtIntervalId timer_id;
  783.     int x;
  784.     int y;
  785.     int delta_x;
  786.     int delta_y;
  787. } fe_EditorAscrollData;
  788.  
  789. typedef struct fe_EditorContextData {
  790.     fe_EditorCaretData caret_data; /* caret stuff */
  791.     fe_EditorAscrollData ascroll_data;
  792.  
  793.     /*
  794.      *    Toolbar widgets.
  795.      */
  796.     Widget toolbar_browse;
  797.     Widget toolbar_publish;
  798.  
  799.     Widget toolbar_cut;
  800.     Widget toolbar_copy;
  801.     Widget toolbar_paste;
  802.  
  803.     Widget toolbar_smaller;
  804.     Widget toolbar_bigger;
  805.     Widget toolbar_size;
  806.  
  807.     Widget toolbar_bold;
  808.     Widget toolbar_italic;
  809.     Widget toolbar_fixed;
  810.     Widget toolbar_color;
  811.     Widget toolbar_link;
  812.     Widget toolbar_plain;
  813.  
  814.     Widget toolbar_target;
  815.     Widget toolbar_image;
  816.     Widget toolbar_hrule;
  817.     Widget toolbar_props;
  818.  
  819.     Widget toolbar_style;
  820.     Widget toolbar_list;
  821.     Widget toolbar_numbers;
  822.     
  823.     Widget toolbar_outdent;
  824.     Widget toolbar_indent;
  825.  
  826.     Widget toolbar_left;
  827.     Widget toolbar_center;
  828.     Widget toolbar_right;
  829.  
  830. } fe_EditorContextData;
  831.  
  832. /*
  833.  *   Simple dependency mechanism package...djw.
  834.  */
  835. typedef unsigned fe_Dependency;
  836.  
  837. #define FE_MAKE_DEPENDENCY(x) ((fe_Dependency)(x))
  838.  
  839. typedef struct fe_DependentList {
  840.     struct fe_DependentList* next;
  841.  
  842.     Widget        widget;   /* that's me */
  843.     XtCallbackRec callback;
  844.     fe_Dependency mask;     /* call me back if match this mask */
  845. } fe_DependentList;
  846.  
  847. #if defined(OSF1) && defined(__cplusplus)
  848. struct fe_source_data;
  849. struct fe_docinfo_data;
  850. struct fe_blinker;
  851. struct fe_bookmark_data;
  852. struct fe_MailComposeContextData;
  853. struct fe_addrbk_data;
  854. struct fe_search_data;
  855. struct fe_ldapsearch_data;
  856. struct fe_mailfilt_data;
  857. struct fe_prefs_data;
  858. #endif
  859.  
  860. typedef struct fe_ContextData
  861. {
  862.   void *view;  /* a pointer to the view associated with this context. */
  863.  
  864.   Widget widget;        /* The main shell widget for this window. */
  865.  
  866.   Widget url_label;        /* Label indicating what mode the url_text */
  867.                 /* is (either "Location:" or "Go To") */
  868.   Widget url_text;        /* Text field displaying the current URL (or */
  869.                 /* a URL that the user is typing in) */
  870.   Widget back_button;        /* Toolbar button to go back in history. */
  871.   Widget forward_button;    /* Toolbar button to go forward in history. */
  872.   Widget home_button;        /* Toolbar button to load home page. */
  873.  
  874.   Widget back_menuitem;        /* Menuitem to go back in history. */
  875.   Widget forward_menuitem;    /* Menuitem to go foreward in history. */
  876.   Widget home_menuitem;        /* Menuitem to load home page. */
  877.   Widget delete_menuitem;    /* Menuitem to delete this window. */
  878.  
  879.   Widget back_popupitem;    /* Popup menuitem to go back in history. */
  880.   Widget forward_popupitem;    /* Popup menuitem to go foreward in history. */
  881.  
  882.   Widget cut_menuitem, copy_menuitem, paste_menuitem, paste_quoted_menuitem;
  883.                 /* Menuitems to cut/copy/paste. */
  884.  
  885.   Widget findAgain_menuitem;    /* Menuitems to findAgain. */
  886.   Widget reloadFrame_menuitem;    /* Menuitems to reload selected Frame. */
  887.   Widget frameSource_menuitem;    /* Menuitem to view source of selected Frame. */
  888.   Widget frameInfo_menuitem;    /* Menuitem to view info of selected Frame. */
  889.  
  890.   Widget mailto_menuitem;    /* Menuitem to mail this URL to someone. */
  891.   Widget saveAs_menuitem;    /* Menuitem to save this URL as */
  892.   Widget uploadFile_menuitem;   /* Menuitem to upload a file to an FTP site */
  893.   Widget print_menuitem;    /* Menuitem to print this URL. */
  894.   Widget refresh_menuitem;    /* Menuitem to refresh this URL. */
  895.   Widget print_button;        /* Toolbar button to print this URL. */
  896.  
  897.   Widget bookmark_menu;        /* Menu containing the bookmark entries. */
  898.   Widget windows_menu;        /* Menu containing the list of windows. */
  899.   Widget history_menu;        /* Menu containing the URL history. */
  900.   Widget delayed_menuitem;    /* Menuitem to load in delayed images. */
  901.   Widget delayed_button;    /* Toolbar button to load in delayed images. */
  902.   Widget abort_menuitem;    /* Menuitem to abort downloads. */
  903.   Widget abort_button;        /* Toolbar button to abort downloads. */
  904.   Widget menubar;        /* Menubar, containing all menu buttons. */
  905.   Widget top_area;        /* Form containing the toolbar, current URL */
  906.                 /* info, directory buttons, and logo. */
  907.   Widget toolbar;        /* RowColumn containing the toolbar buttons. */
  908.   Widget character_toolbar;    /* RowColumn containing editor char buttons. */
  909.   Widget paragraph_toolbar;    /* RowColumn containing editor para buttons. */
  910.   Widget dashboard;        /* Form containing the security/thermometer */
  911.                 /* info at bottom of window.*/
  912. #ifdef LEDGES
  913.   Widget top_ledge, bottom_ledge; /* Half-implemented fixed areas that */
  914.                   /* display other URLs. */
  915. #endif
  916. #ifndef NO_SECURITY
  917.   Widget security_bar;        /* Drawing area for colored security bar. */
  918.   Widget security_logo;        /* Label gadget containing security "key" */
  919.                 /* icon.*/
  920. #endif
  921. #ifdef JAVA
  922.   Widget show_java;
  923. #endif
  924.   Widget main_pane;        /* PanedWindow that contains the main
  925.                    drawing area, as well as any scrolling
  926.                    lists for mail or news. */
  927.   Widget drawing_area;        /* The main drawing area */
  928.   Widget scrolled;        /* scroller (see scroller.h) containing */
  929.                 /* the main drawing area and its scrollbars. */
  930.   Widget hscroll, vscroll;    /* Scrollbars for the main drawining area. */
  931.   Widget wholine;        /* Label at bottom of window displaying */
  932.                 /* info about current pointing URL, etc. */
  933.   Widget bifficon;        /* Button indicating whether we have new
  934.                    mail. */
  935.  
  936.   MSG_Pane* comppane;    /* If this is a composition, the libmsg data
  937.                structure. */
  938.  
  939.   int hysteresis;        /* "stickiness" of mouse-selection. */
  940.  
  941.   /* Widgets for the mail folder menu */
  942.   Widget foldermenu;
  943.   Widget move_selected_to_folder;
  944.   Widget copy_selected_to_folder;
  945.   Boolean doingMove;            /* move and copy share the same
  946.                        foldermenu */
  947.   /* Widgets for mail popup menus */
  948.   Widget mailPopupBody;
  949.   Widget mailPopupMessage;
  950.   Widget mailPopupFolder;
  951.  
  952.   /* Widgets and things that appear only in MessageComposition windows: */
  953.   Widget mcFrom;
  954.   Widget mcReplyTo;
  955.   Widget mcTo;
  956.   Widget mcCc;
  957.   Widget mcBcc;
  958.   Widget mcFcc;
  959.   Widget mcNewsgroups;
  960.   Widget mcFollowupTo;
  961.   Widget mcSubject;
  962.   Widget mcAttachments;
  963.   Widget mcBodyText;
  964.   Widget deliverNow_menuitem;
  965.   Widget deliverLater_menuitem;
  966.   XP_Bool mcCitedAndUnedited;
  967.   XP_Bool mcEdited;
  968.   Boolean compose_wrap_lines_p;
  969.   struct fe_mail_attach_data *mad;
  970.  
  971.  
  972.   /* Pixels allocated per window. */
  973.   XColor *color_data;
  974.   int color_size;
  975.   int color_fp;
  976.  
  977.   /* Dialogs of which there is only one per context. */
  978.   Widget history_dialog, file_dialog;
  979.   struct fe_file_type_data *ftd;
  980.   struct fe_source_data *sd;
  981.   struct fe_docinfo_data *did;
  982.  
  983.   /* The dialog used when doing something synchronously per context,
  984.      like downloading a file or delivering mail. */
  985.   Widget synchronous_url_dialog;
  986.   int synchronous_url_exit_status;
  987.  
  988.   Dimension sb_w, sb_h;        /* Width & height of the main scrollbars. */
  989.  
  990.   Pixel fg_pixel;
  991.   Pixel bg_pixel;
  992.   Pixel top_shadow_pixel;
  993.   Pixel bottom_shadow_pixel;
  994.   Pixel text_bg_pixel;          /* enabled text background color */
  995.  
  996.   int bg_red;                           /* Nominal background color */
  997.   int bg_green;
  998.   int bg_blue;
  999.  
  1000.   Boolean icon_colors_initialized;
  1001.   struct fe_colormap *colormap;
  1002.  
  1003.   Pixmap backdrop_pixmap;
  1004.  
  1005.   int active_url_count;            /* Number of transfers in progress. */
  1006.   Boolean clicking_blocked;        /* Save me from myself! */
  1007.   Boolean save_next_mode_p;        /* "Save Next" prompt in progress */
  1008.  
  1009.   LO_Element *current_edge;        /* The grid edge being moved */
  1010.   Boolean focus_grid;            /* The grid with focus */
  1011.   int8 grid_scrolling;            /* Grid scrolling policy */
  1012.  
  1013.   unsigned long document_width;        /* Actual size of whole document. */
  1014.   unsigned long document_height;
  1015.   unsigned long scrolled_width;        /* drawing_area size @ last repaint */
  1016.   unsigned long scrolled_height;
  1017.   fe_Drawable *drawable;                /* Target for drawing.  Either
  1018.                                            a window or offscreen pixmap */
  1019.   Boolean relayout_required;        /* Set when size change occurs before
  1020.                        document has been completely layed
  1021.                        out the first time. */
  1022.   const char *force_load_images;    /* Hack for "Load Images" command. */
  1023.   unsigned long document_x;
  1024.   unsigned long document_y;
  1025.   unsigned long line_height;
  1026.   time_t doc_size_last_update_time;    /* So FE_SetDocSize() can be lazy. */
  1027.  
  1028.   int16 xfe_doc_csid;
  1029.  
  1030.   Boolean bookmark_menu_up_to_date_p;
  1031.   Boolean windows_menu_up_to_date_p;
  1032.  
  1033.   int expose_x1;
  1034.   int expose_y1;
  1035.   int expose_x2;
  1036.   int expose_y2;
  1037.   Boolean held_expose;
  1038.   int expose_x_offset;
  1039.   int expose_y_offset;
  1040.   unsigned long expose_serial;
  1041.  
  1042.   /* Data used by thermo.c for status notification:
  1043.    */
  1044.   XtIntervalId thermo_timer_id;        /* timer running the animation */
  1045.   time_t thermo_start_time;        /* when transfer started (requested) */
  1046.   time_t thermo_data_start_time;    /* when transfer REALLY started */
  1047.   time_t thermo_last_update_time;    /* time we last printed text message */
  1048.  
  1049.   Boolean thermo_size_unknown_count;    /* The number of transfers in progress
  1050.                        whose content-length is not known */
  1051.   int thermo_current;            /* total bytes-so-far */
  1052.   int thermo_total;            /* total content-length of all docs
  1053.                        whose sizes are known. */
  1054.   int thermo_lo_percent;        /* percent of layout complete */
  1055.  
  1056.   int thermo_cylon;            /* if !thermo_size_known_p, this is the
  1057.                        last pixel position of the cylon
  1058.                        thingy.  It's negative if it is in
  1059.                        motion backwards. */
  1060.  
  1061.   Boolean logo_animation_running;    /* logo animation running ?  */
  1062.  
  1063.   XtIntervalId blink_timer_id;        /* timer for blinking (gag) */
  1064.   struct fe_blinker *blinkers;
  1065.   Boolean blinking_enabled_p;
  1066.  
  1067.   Boolean loading_images_p;     /* TRUE if images are loading. */
  1068.   Boolean looping_images_p;     /* TRUE if images are looping. */
  1069.   Boolean delayed_images_p;
  1070.  
  1071.   /* Data for that FE_SetRefreshURLTimer() repulsive kludge. */
  1072.   XtIntervalId refresh_url_timer;
  1073.   uint32 refresh_url_timer_secs;
  1074.   char *refresh_url_timer_url;
  1075.  
  1076.  
  1077.   /* X Selection data
  1078.    */
  1079.   char *selection;
  1080.   char *clipboard;
  1081.   Time selection_time;
  1082.   Time clipboard_time;
  1083.  
  1084.   /* Things initialized from the resource database:
  1085.    */
  1086.   Pixel link_pixel;
  1087.   Pixel vlink_pixel;
  1088.   Pixel alink_pixel;
  1089.   Pixel select_fg_pixel;
  1090.   Pixel select_bg_pixel;
  1091.   Pixel default_fg_pixel;
  1092.   Pixel default_bg_pixel;
  1093. #ifndef NO_SECURITY
  1094.   Pixel secure_document_pixel;
  1095.   Pixel insecure_document_pixel;
  1096. #endif
  1097.  
  1098.   char *default_background_image;
  1099.  
  1100.   XmString unedited_label_string;
  1101.   XmString edited_label_string;
  1102.   XmString netsite_label_string;
  1103.  
  1104.   Boolean confirm_exit_p;
  1105.   Boolean show_url_p;
  1106.   Boolean show_toolbar_p;
  1107.   Boolean show_toolbar_icons_p;
  1108.   Boolean show_toolbar_text_p;
  1109.   Boolean show_directory_buttons_p;
  1110.   Boolean show_menubar_p;
  1111.   Boolean show_bottom_status_bar_p;
  1112.   Boolean show_character_toolbar_p;
  1113.   Boolean show_paragraph_toolbar_p;
  1114.   Boolean autoload_images_p;
  1115.   Boolean fancy_ftp_p;
  1116. #ifndef NO_SECURITY
  1117.   Boolean show_security_bar_p;
  1118. #endif
  1119. #ifdef JAVA
  1120.   Boolean show_java_console_p;
  1121. #endif
  1122.  
  1123.   int progress_interval;    /* How quickly %-done text updates */
  1124.   int busy_blink_rate;        /* How quickly light blinks (microseconds) */
  1125.  
  1126.   Cursor link_cursor;
  1127.   Cursor busy_cursor;
  1128.  
  1129.   Cursor save_next_link_cursor;
  1130.   Cursor save_next_nonlink_cursor;
  1131.   Cursor editable_text_cursor;     /* maybe others want to use this */
  1132.  
  1133.   Cursor tab_sel_cursor;    /* new table cursors... */
  1134.   Cursor row_sel_cursor;
  1135.   Cursor col_sel_cursor;
  1136.   Cursor cel_sel_cursor;
  1137.   Cursor resize_col_cursor;
  1138.   Cursor resize_tab_cursor;
  1139.   Cursor add_col_cursor;
  1140.   Cursor add_row_cursor;
  1141.  
  1142.   struct fe_bookmark_data* bmdata; /* Bookmark data (used only by hot.c) */
  1143.   struct fe_MailComposeContextData* mailcomposer;  /*mail compose data*/
  1144.   struct fe_addrbk_data* abdata; 
  1145.                    /* Address book data 
  1146.                                                  (used only by addrbk.c) */
  1147.   struct fe_search_data* searchdata; /* Search data (used by search.c) */
  1148.   struct fe_ldapsearch_data* ldapsearchdata; 
  1149.   struct fe_mailfilt_data* filtdata; /* Mail filter data (used only by 
  1150.                     mailfilter.c) */
  1151.  
  1152.   fe_searchOutlineChangeFunction  searchOutlineChangeFunc;
  1153.   fe_searchFinishedFunction         searchFinishedFunc;
  1154.   Boolean hasCustomChrome;
  1155.   Chrome chrome;
  1156.  
  1157.   /* a handle to the current pref dialog being displayed. this
  1158.      is useful if you need to create a modal html dialog as it's
  1159.      child, as in the case of the security prefs.
  1160.      */
  1161.   Widget currentPrefDialog;
  1162.   struct fe_prefs_data *fep;
  1163.  
  1164.   /* If this context is a full page plugin, then this flag gets set.
  1165.      Because of this, resize events are passed on to the plugin.
  1166.   */
  1167.   Boolean is_fullpage_plugin;
  1168.  
  1169.   Boolean being_destroyed;
  1170.  
  1171.   /* If dont_free_context_memory  is non-zero on the context,
  1172.    * fe_DestroyContext() will not release the
  1173.    * memory for the context although it will go ahead and do all other
  1174.    * destroy stuff like destroying the widgets etc. Just the memory for
  1175.    * both the context and the context-data is retained.
  1176.    *
  1177.    * delete_response is used to store the XmNdeleteResponse of the context
  1178.    * while the context is in a protected state. During protected state,
  1179.    * the context's XmNdeleteResponse will be forced to XmDO_NOTHING, indicating
  1180.    * that the user cannot destroy this context using the window manager
  1181.    * delete menu item. Once the context is completely unprotected, the
  1182.    * XmNdeleteResponse will be restored to the stored delete_response value.
  1183.    *
  1184.    *********** DO NOT ACCESS THESE VARAIBLES DIRECTLY.
  1185.    * WARNING * Use this via fe_ProtectContext(), fe_UnProtectContext() and
  1186.    *********** fe_IsContextProtected().
  1187.    */
  1188.   int dont_free_context_memory;
  1189.   unsigned char delete_response;
  1190.  
  1191.   /* If a context is destroyed and dont_free_context_memory is set,
  1192.    * then this will be set indicating that the context was destroyed but
  1193.    * the context and context-data memory was not reclaimed. It will be the
  1194.    * responsibility of the module that set dont_free_context_memory to
  1195.    * reclaim the context memory if this is set on the context.
  1196.    *
  1197.    * The situation this is happen is
  1198.    *     1. when a synchronous_url_dialog is up
  1199.    *    2. when a popup on a say frame-context is up and before we can
  1200.    *       bring the popup down, the frame-context gets destroyed with a
  1201.    *       JavaScript timer.
  1202.    */
  1203.   Boolean destroyed;
  1204.  
  1205.   fe_FindData *find_data;
  1206.  
  1207.   fe_MailNewsContextData *mailnews_part;
  1208.   fe_MsgWindowContextData *msg_part;
  1209.   fe_ArticleWindowContextData *article_part;
  1210.  
  1211.   fe_EditorContextData editor;     /* editor stuff */
  1212.   char *save_file_url;
  1213.   int  file_save_status;
  1214.   XP_Bool is_file_saving;
  1215.  
  1216.   fe_DependentList* dependents;    /* dependency list */
  1217.   Widget            posted_msg_box;
  1218.   XP_Bool are_scrollbars_active;
  1219.   XP_Bool stealth_cmd;
  1220.  
  1221.   XP_Bool is_resizing; /* Don't change URLbar for a resize. */
  1222.                        /* You may have needed more typing room. */
  1223.  
  1224.   struct {
  1225.     int32 x,y;
  1226.   } cachedPos;
  1227.  
  1228. } fe_ContextData;
  1229.  
  1230. #define EDITOR_CONTEXT_DATA(context)    ((&CONTEXT_DATA(context)->editor))
  1231.  
  1232.  
  1233. /* Magic value used in fe_ContextData->force_load_images to mean "load all." */
  1234. #define FORCE_LOAD_ALL_IMAGES ((char *)1)
  1235.  
  1236.  
  1237. typedef struct
  1238. {
  1239.   /* Stuff from the resource database that is not per-window. */
  1240.  
  1241.   XtIntervalId save_history_id;        /* timer for periodically saving
  1242.                        the history and bookmark files. */
  1243.   int save_history_interval;        /* Every N seconds. */
  1244.  
  1245.   Visual *default_visual;
  1246.   struct fe_colormap *common_colormap; /* If private colormap, colormap for
  1247.                                           "simple" contexts, else common
  1248.                                           colormap for all contexts. */
  1249.  
  1250.   struct fe_colormap *default_colormap; /* fe wrapper around X default
  1251.                                            colormap */
  1252.  
  1253.   Boolean always_install_cmap;
  1254. #ifdef USE_NONSHARED_COLORMAPS
  1255.   Boolean windows_share_cmap;
  1256. #endif
  1257.   Boolean force_mono_p;
  1258.   char*   wm_icon_policy;
  1259.  
  1260.   Boolean document_beats_user_p;    /* #### move to prefs */
  1261.   const char *language_region_list;    /* #### move to prefs */
  1262.   const char *invalid_lang_tag_format_msg;/* #### move to prefs */
  1263.   const char *invalid_lang_tag_format_dialog_title;/* #### move to prefs */
  1264.  
  1265. #ifdef __sgi
  1266.   Boolean sgi_mode_p;
  1267. #endif /* __sgi */
  1268.  
  1269.   int max_image_colors;        /* Max color cells to gobble up. */
  1270.  
  1271.   int fe_guffaw_scroll;        /* Brokenness of server WindowGravity */
  1272.  
  1273.   const char *user_prefs_file;
  1274.  
  1275.   Boolean stderr_dialog_p;
  1276.   Boolean stdout_dialog_p;
  1277.  
  1278.   const char *encoding_filters;
  1279.  
  1280.   XtTranslations terminal_text_translations;
  1281.   XtTranslations nonterminal_text_translations;
  1282.   XtTranslations global_translations;
  1283.   XtTranslations global_text_field_translations;
  1284.   XtTranslations global_nontext_translations;
  1285.  
  1286.   XtTranslations editing_translations;
  1287.   XtTranslations single_line_editing_translations;
  1288.   XtTranslations multi_line_editing_translations;
  1289.   XtTranslations form_elem_editing_translations;
  1290.  
  1291.   XtTranslations browser_global_translations;
  1292.   XtTranslations bm_global_translations;
  1293.   XtTranslations ab_global_translations;
  1294.   XtTranslations gh_global_translations;
  1295.   XtTranslations mailnews_global_translations;
  1296.   XtTranslations mnsearch_global_translations;
  1297.   XtTranslations messagewin_global_translations;
  1298.   XtTranslations mailcompose_global_translations;
  1299.   XtTranslations address_outliner_traverse_translations;
  1300.   XtTranslations address_outliner_key_translations;
  1301.   XtTranslations dialog_global_translations;
  1302.   XtTranslations editor_global_translations;
  1303.  
  1304.   /* Random error messages and things.
  1305.    */
  1306.   const char *options_saved_message;
  1307.   const char *click_to_save_message;
  1308.   const char *click_to_save_cancelled_message;
  1309.   const char *no_url_loaded_message;
  1310.   const char *no_next_url_message;
  1311.   const char *no_previous_url_message;
  1312.   const char *no_home_url_message;
  1313.   const char *not_over_image_message;
  1314.   const char *not_over_link_message;
  1315.   const char *no_search_string_message;
  1316.   const char *wrap_search_message;
  1317.   const char *wrap_search_backward_message;
  1318.   const char *wrap_search_not_found_message;
  1319.   const char *no_addresses_message;
  1320.   const char *no_file_message;
  1321.   const char *no_print_command_message;
  1322.   const char *bookmarks_changed_message;
  1323.   const char *bookmark_conflict_message;
  1324.   const char *bookmarks_no_forms_message;
  1325.   const char *create_cache_dir_message;
  1326.   const char *created_cache_dir_message;
  1327.   const char *cache_not_dir_message;
  1328.   const char *cache_suffix_message;
  1329.   const char *cube_too_small_message;
  1330.   const char *really_quit_message;
  1331.   const char *double_inclusion_message;
  1332.   const char *expire_now_message;
  1333.   const char *clear_mem_cache_message;
  1334.   const char *clear_disk_cache_message;
  1335.   const char *rename_files_message;
  1336.   const char *overwrite_file_message;
  1337.   const char *unsent_mail_message;
  1338.   const char *binary_document_message;
  1339.   const char *empty_message_message;
  1340.   const char *default_mailto_text;
  1341.   const char *default_url_charset;
  1342.   const char *helper_app_delete_message; /* For Helper App Delete */
  1343.  
  1344.   /*
  1345.    * Enterprise Kit stuff
  1346.    */
  1347.   #define MAX_DIRECTORY_BUTTONS    6
  1348.   #define MAX_DIRECTORY_MENU_ITEMS 25
  1349.   #define MAX_HELP_MENU_ITEMS      25
  1350.  
  1351.   char* homePage;
  1352.   int numDirectoryButtons;
  1353.   int numDirectoryMenuItems;
  1354.   int numHelpMenuItems;
  1355.   char* directoryButtonUrls[MAX_DIRECTORY_BUTTONS];
  1356.   char* directoryMenuUrls[MAX_DIRECTORY_MENU_ITEMS];
  1357.   char* helpMenuUrls[MAX_HELP_MENU_ITEMS];
  1358.  
  1359. #ifdef NSPR_SPLASH
  1360.   /* this is not the normal splash screen shown in the html window.  It is
  1361.      the new, nspr-threads-and-X
  1362.      splash screen. */
  1363.   Boolean show_splash;
  1364. #endif
  1365.  
  1366.   /* Startup component flags */
  1367. #ifdef MOZ_TASKBAR
  1368.   Boolean startup_component_bar;
  1369. #endif
  1370. #ifdef MOZ_MAIL_NEWS
  1371.   Boolean startup_composer;
  1372.   Boolean startup_mail;
  1373.   Boolean startup_news;
  1374. #endif
  1375.  
  1376.   Boolean startup_history;
  1377.   Boolean startup_bookmarks;
  1378.   Boolean startup_nethelp;
  1379.   Boolean startup_netcaster;
  1380.  
  1381.   /* Session Management on/off */
  1382.   Boolean session_management;
  1383.  
  1384.   /* IRIX Session Management */
  1385.   Boolean irix_session_management;
  1386.  
  1387.   /* Dont do about:splash on startup */
  1388.   Boolean startup_no_about_splash;
  1389.  
  1390.   /* Dont force window stacking (ie chrome topmost & bottommost) */
  1391.   Boolean dont_force_window_stacking;
  1392.  
  1393.   /* Startup iconic */
  1394.   Boolean startup_iconic;
  1395.  
  1396.   /* Startup geometry */
  1397.   String startup_geometry;
  1398.  
  1399.   /* Dont save geometry prefs */
  1400.   Boolean dont_save_geom_prefs;
  1401.  
  1402.   /* Ignore geometry prefs */
  1403.   Boolean ignore_geom_prefs;
  1404.  
  1405.   /*
  1406.    * Enterprise Kit Proxy information is put in fe_globalPrefs
  1407.    */
  1408.  
  1409.   /* More global data that aren't resource related */
  1410.   time_t privateMimetypeFileModifiedTime;
  1411.   time_t privateMailcapFileModifiedTime;
  1412.  
  1413.   Boolean editor_im_input_enabled;
  1414.  
  1415.   /* We need to keep track of this for the Global History. */
  1416.   /* If the databases are locked, we need to disable the window. */
  1417.   Boolean all_databases_locked;
  1418.  
  1419.   Cardinal editor_update_delay;
  1420. } fe_GlobalData;
  1421.  
  1422. extern fe_GlobalData   fe_globalData;
  1423. extern XFE_GlobalPrefs fe_globalPrefs;
  1424. extern XFE_GlobalPrefs fe_defaultPrefs;
  1425.  
  1426. extern MSG_Prefs* fe_mailNewsPrefs;
  1427. extern MSG_Master *fe_getMNMaster(void);
  1428.  
  1429. struct fe_MWContext_cons
  1430. {
  1431.   MWContext *context;
  1432.   struct fe_MWContext_cons *next;
  1433. };
  1434.  
  1435. extern struct fe_MWContext_cons *fe_all_MWContexts;
  1436.  
  1437.  
  1438. #define CONTEXT_WIDGET(context)    ((CONTEXT_DATA (context))->widget)
  1439. #define CONTEXT_DATA(context)    ((context)->fe.data)
  1440. #define MAILNEWS_CONTEXT_DATA(context) ((fe_ContextData *)CONTEXT_DATA(context))->mailnews_part
  1441. #define MSG_CONTEXT_DATA(context) ((fe_ContextData *)CONTEXT_DATA(context))->msg_part
  1442. #define ARTICLE_CONTEXT_DATA(context) ((fe_ContextData *)CONTEXT_DATA(context))->article_part
  1443. #define MAILTAB(context,tab) MAILNEWS_CONTEXT_DATA(context)->mailtabs[tab]
  1444. #define ACTIVE_MAILTAB(context) MAILTAB(context, MAILNEWS_CONTEXT_DATA(context)->active_tab)
  1445.  
  1446. #define fe_FILE_TYPE_NONE        1
  1447. #define fe_FILE_TYPE_TEXT        2
  1448. #define fe_FILE_TYPE_FORMATTED_TEXT    3
  1449. #define fe_FILE_TYPE_HTML        4
  1450. #define fe_FILE_TYPE_HTML_AND_IMAGES    5
  1451. #define fe_FILE_TYPE_PS            6
  1452. #define fe_FILE_TYPE_URL_ONLY        7
  1453.  
  1454. /* Saving to disk
  1455.  */
  1456.  
  1457. struct save_as_data
  1458. {
  1459.   MWContext *context;
  1460.   char *name;
  1461.   FILE *file;
  1462.   int type;
  1463.   int insert_base_tag;
  1464.   Boolean use_dialog_p;
  1465.   void (*done)(struct save_as_data *);
  1466.   void* data;
  1467.   int content_length;
  1468.   int bytes_read;
  1469.   URL_Struct *url;
  1470. };
  1471.  
  1472.  
  1473. /* icons */
  1474.  
  1475. extern Pixel fe_gray_map [256];
  1476.  
  1477.  
  1478. /*
  1479.  * Mocha can destroy the document while we do a LM_Send call.
  1480.  * We protect againsta this by storing the doc_id before the call
  1481.  * and checking this against the new doc_id after the call.
  1482.  *
  1483.  * In general any call to Mocha to send events (LM_Send*()) should
  1484.  * be like this:
  1485.  *    CALLING_MOCHA(context);
  1486.  *    LM_Send*(context, form);
  1487.  *    if (IS_DOCUMENT_DESTROYED(context)) return FALSE/TRUE/what-ever;
  1488.  *
  1489.  */
  1490. extern int32 _doc_id_before_calling_mocha;
  1491. #define CALLING_MOCHA(context) \
  1492.         (_doc_id_before_calling_mocha = XP_DOCID(context))
  1493. #define IS_FORM_DESTROYED(context) \
  1494.         (_doc_id_before_calling_mocha != XP_DOCID(context))
  1495.  
  1496. /*
  1497.  * Mail Compose Callbacks in XFE
  1498.  */
  1499. typedef enum {
  1500.     ComposeSelectAllText_cb,
  1501.     ComposeClearAllText_cb
  1502. } fe_MailComposeCallback;
  1503.  
  1504. void
  1505. fe_mailcompose_obeycb(MWContext *context, fe_MailComposeCallback cbid,
  1506.             void *call_data);
  1507.  
  1508. void
  1509. fe_key_input_cb (Widget widget, XtPointer closure, XtPointer call_data);
  1510.  
  1511.  
  1512. /* fe data for address book */
  1513. /* shared by addrbook and mailcompose */
  1514.  
  1515. typedef enum {
  1516.     feAddressBook,
  1517.     feAddressingWindow
  1518. } feABtype;
  1519.  
  1520.  
  1521.  
  1522. /* mail compose window fe data */
  1523.  
  1524. typedef struct fe_MailComposeContextData
  1525. {
  1526.   int tab_number;
  1527.  
  1528.   Widget parent;
  1529.  
  1530.   Widget parentFolder;
  1531.   Widget container;
  1532.  
  1533.   Widget address;
  1534.   Widget attach;
  1535.   Widget compose;
  1536.  
  1537.   Widget address_tab;
  1538.   Widget attach_tab;
  1539.   Widget compose_tab;
  1540.  
  1541.   struct fe_addrbk_data* abdata;
  1542.  
  1543. } fe_MailComposeContextData;
  1544.  
  1545.  
  1546. #define IL_ICON_BACK         (IL_MSG_LAST+1)
  1547. #define IL_ICON_BACK_GREY     (IL_ICON_BACK+1)
  1548. #define IL_ICON_FWD         (IL_ICON_BACK+2)
  1549. #define IL_ICON_FWD_GREY     (IL_ICON_BACK+3)
  1550. #define IL_ICON_HOME         (IL_ICON_BACK+4)
  1551. #define IL_ICON_HOME_GREY     (IL_ICON_BACK+5)
  1552.  
  1553. #define IL_ICON_RELOAD         (IL_ICON_HOME_GREY+1)
  1554. #define IL_ICON_RELOAD_GREY     (IL_ICON_RELOAD+1)
  1555. #define IL_ICON_LOAD         (IL_ICON_RELOAD+2)
  1556. #define IL_ICON_LOAD_GREY     (IL_ICON_RELOAD+3)
  1557. #define IL_ICON_OPEN         (IL_ICON_RELOAD+4)
  1558. #define IL_ICON_OPEN_GREY     (IL_ICON_RELOAD+5)
  1559. #define IL_ICON_PRINT          (IL_ICON_RELOAD+6)
  1560. #define IL_ICON_PRINT_GREY     (IL_ICON_RELOAD+7)
  1561. #define IL_ICON_FIND         (IL_ICON_RELOAD+8)
  1562. #define IL_ICON_FIND_GREY     (IL_ICON_RELOAD+9)
  1563.  
  1564. #define IL_ICON_STOP         (IL_ICON_FIND_GREY+1)
  1565. #define IL_ICON_STOP_GREY     (IL_ICON_STOP+1)
  1566.  
  1567. #define IL_ICON_NETSCAPE     (IL_ICON_STOP_GREY+1)
  1568.  
  1569. #define IL_ICON_BACK_PT         (IL_ICON_NETSCAPE+1)
  1570. #define IL_ICON_BACK_PT_GREY     (IL_ICON_BACK_PT+1)
  1571. #define IL_ICON_FWD_PT         (IL_ICON_BACK_PT+2)
  1572. #define IL_ICON_FWD_PT_GREY     (IL_ICON_BACK_PT+3)
  1573. #define IL_ICON_HOME_PT         (IL_ICON_BACK_PT+4)
  1574. #define IL_ICON_HOME_PT_GREY     (IL_ICON_BACK_PT+5)
  1575.  
  1576. #define IL_ICON_RELOAD_PT     (IL_ICON_HOME_PT_GREY+1)
  1577. #define IL_ICON_RELOAD_PT_GREY     (IL_ICON_RELOAD_PT+1)
  1578. #define IL_ICON_LOAD_PT         (IL_ICON_RELOAD_PT+2)
  1579. #define IL_ICON_LOAD_PT_GREY     (IL_ICON_RELOAD_PT+3)
  1580. #define IL_ICON_OPEN_PT         (IL_ICON_RELOAD_PT+4)
  1581. #define IL_ICON_OPEN_PT_GREY     (IL_ICON_RELOAD_PT+5)
  1582. #define IL_ICON_PRINT_PT      (IL_ICON_RELOAD_PT+6)
  1583. #define IL_ICON_PRINT_PT_GREY     (IL_ICON_RELOAD_PT+7)
  1584. #define IL_ICON_FIND_PT         (IL_ICON_RELOAD_PT+8)
  1585. #define IL_ICON_FIND_PT_GREY     (IL_ICON_RELOAD_PT+9)
  1586.  
  1587. #define IL_ICON_STOP_PT         (IL_ICON_FIND_PT_GREY+1)
  1588. #define IL_ICON_STOP_PT_GREY     (IL_ICON_STOP_PT+1)
  1589.  
  1590. #define IL_ICON_NETSCAPE_PT      (IL_ICON_STOP_PT_GREY+1)
  1591.  
  1592. #define IL_ICON_SECURITY_ON     (IL_ICON_NETSCAPE_PT+1)
  1593. #define IL_ICON_SECURITY_OFF     (IL_ICON_SECURITY_ON+1)
  1594. #define IL_ICON_SECURITY_HIGH     (IL_ICON_SECURITY_OFF+1)
  1595. #ifndef FORTEZZA
  1596. #define IL_ICON_SECURITY_MIXED   (IL_ICON_SECURITY_HIGH+1)
  1597. #else
  1598. #define IL_ICON_SECURITY_FORTEZZA (IL_ICON_SECURITY_HIGH+1)
  1599. #define IL_ICON_SECURITY_MIXED   (IL_ICON_SECURITY_FORTEZZA+1)
  1600. #endif
  1601.  
  1602. #define IL_DIRECTORY_ICON_FIRST  (IL_ICON_SECURITY_MIXED+1)
  1603. #define IL_ICON_TOUR         (IL_DIRECTORY_ICON_FIRST)
  1604. #define IL_ICON_WHATS_NEW     (IL_ICON_TOUR+1)
  1605. #define IL_ICON_INET_INDEX     (IL_ICON_TOUR+2)
  1606. #define IL_ICON_INET_SEARCH     (IL_ICON_TOUR+3)
  1607. #define IL_ICON_FAQ         (IL_ICON_TOUR+4)
  1608. #define IL_ICON_NEWSRC         (IL_ICON_TOUR+5)
  1609. #define IL_DIRECTORY_ICON_LAST   (IL_ICON_NEWSRC)
  1610.  
  1611. #define IL_ICON_DESKTOP_NAVIGATOR    (IL_DIRECTORY_ICON_LAST+1)
  1612. #define IL_ICON_DESKTOP_ABOOK         (IL_ICON_DESKTOP_NAVIGATOR+1)
  1613. #define IL_ICON_DESKTOP_BOOKMARK    (IL_ICON_DESKTOP_ABOOK+1)
  1614. #define IL_ICON_DESKTOP_NEWS         (IL_ICON_DESKTOP_BOOKMARK+1)
  1615. #define IL_ICON_DESKTOP_NOMAIL         (IL_ICON_DESKTOP_NEWS+1)
  1616. #define IL_ICON_DESKTOP_YESMAIL         (IL_ICON_DESKTOP_NOMAIL+1)
  1617. #define IL_ICON_DESKTOP_EDITOR         (IL_ICON_DESKTOP_YESMAIL+1)
  1618. #define IL_ICON_DESKTOP_COMMUNICATOR (IL_ICON_DESKTOP_EDITOR+1)
  1619. #define IL_ICON_DESKTOP_CONFERENCE    (IL_ICON_DESKTOP_COMMUNICATOR+1)
  1620. #define IL_ICON_DESKTOP_CALENDAR    (IL_ICON_DESKTOP_CONFERENCE+1)
  1621. #define IL_ICON_DESKTOP_IBM             (IL_ICON_DESKTOP_CALENDAR+1)
  1622. #define IL_ICON_DESKTOP_ADMINKIT    (IL_ICON_DESKTOP_IBM+1)
  1623. #define IL_ICON_DESKTOP_NETCASTER    (IL_ICON_DESKTOP_ADMINKIT+1)
  1624. #define IL_ICON_DESKTOP_HISTORY        (IL_ICON_DESKTOP_NETCASTER+1)
  1625. #define IL_ICON_DESKTOP_JAVACONSOLE    (IL_ICON_DESKTOP_HISTORY+1)
  1626. #define IL_ICON_DESKTOP_MSGCENTER    (IL_ICON_DESKTOP_JAVACONSOLE+1)
  1627. #define IL_ICON_DESKTOP_MSGCOMPOSE    (IL_ICON_DESKTOP_MSGCENTER+1)
  1628. #define IL_ICON_DESKTOP_SEARCH        (IL_ICON_DESKTOP_MSGCOMPOSE+1)
  1629.  
  1630. #define IL_MSG_HIER_ARTICLE            (IL_ICON_DESKTOP_SEARCH+1)
  1631. #define IL_MSG_HIER_FOLDER_CLOSED    (IL_MSG_HIER_ARTICLE+1)
  1632. #define IL_MSG_HIER_FOLDER_OPEN        (IL_MSG_HIER_FOLDER_CLOSED+1)
  1633. #define IL_MSG_HIER_NEWSGROUP        (IL_MSG_HIER_FOLDER_OPEN+1)
  1634. #define IL_MSG_HIER_MESSAGE            (IL_MSG_HIER_NEWSGROUP+1)
  1635.  
  1636. #define IL_MSG_HIER_SUBSCRIBED        (IL_MSG_HIER_MESSAGE+1)
  1637. #define IL_MSG_HIER_UNSUBSCRIBED    (IL_MSG_HIER_SUBSCRIBED+1)
  1638. #define IL_MSG_HIER_READ        (IL_MSG_HIER_UNSUBSCRIBED+1)
  1639. #define IL_MSG_HIER_UNREAD        (IL_MSG_HIER_READ+1)
  1640. #define IL_MSG_HIER_MARKED        (IL_MSG_HIER_UNREAD+1)
  1641. #define IL_MSG_HIER_UNMARKED        (IL_MSG_HIER_MARKED+1)
  1642.  
  1643. #define IL_MSG_DELETE            (IL_MSG_HIER_UNMARKED+1)
  1644. #define IL_MSG_DELETE_GREY        (IL_MSG_DELETE+1)
  1645. #define IL_MSG_DELETE_PT        (IL_MSG_DELETE_GREY+1)
  1646. #define IL_MSG_DELETE_PT_GREY        (IL_MSG_DELETE_PT+1)
  1647. #define IL_MSG_GET_MAIL            (IL_MSG_DELETE_PT_GREY+1)
  1648. #define IL_MSG_GET_MAIL_GREY        (IL_MSG_GET_MAIL+1)
  1649. #define IL_MSG_GET_MAIL_PT        (IL_MSG_GET_MAIL_GREY+1)
  1650. #define IL_MSG_GET_MAIL_PT_GREY        (IL_MSG_GET_MAIL_PT+1)
  1651. #define IL_MSG_MARK_ALL_READ        (IL_MSG_GET_MAIL_PT_GREY+1)
  1652. #define IL_MSG_MARK_ALL_READ_GREY    (IL_MSG_MARK_ALL_READ+1)
  1653. #define IL_MSG_MARK_ALL_READ_PT        (IL_MSG_MARK_ALL_READ_GREY+1)
  1654. #define IL_MSG_MARK_ALL_READ_PT_GREY    (IL_MSG_MARK_ALL_READ_PT+1)
  1655. #define IL_MSG_MARK_THREAD_READ        (IL_MSG_MARK_ALL_READ_PT_GREY+1)
  1656. #define IL_MSG_MARK_THREAD_READ_GREY    (IL_MSG_MARK_THREAD_READ+1)
  1657. #define IL_MSG_MARK_THREAD_READ_PT    (IL_MSG_MARK_THREAD_READ_GREY+1)
  1658. #define IL_MSG_MARK_THREAD_READ_PT_GREY    (IL_MSG_MARK_THREAD_READ_PT+1)
  1659. #define IL_MSG_FORWARD_MSG        (IL_MSG_MARK_THREAD_READ_PT_GREY+1)
  1660. #define IL_MSG_FORWARD_MSG_GREY        (IL_MSG_FORWARD_MSG+1)
  1661. #define IL_MSG_FORWARD_MSG_PT        (IL_MSG_FORWARD_MSG_GREY+1)
  1662. #define IL_MSG_FORWARD_MSG_PT_GREY    (IL_MSG_FORWARD_MSG_PT+1)
  1663. #define IL_MSG_NEW_MSG            (IL_MSG_FORWARD_MSG_PT_GREY+1)
  1664. #define IL_MSG_NEW_MSG_GREY        (IL_MSG_NEW_MSG+1)
  1665. #define IL_MSG_NEW_MSG_PT        (IL_MSG_NEW_MSG_GREY+1)
  1666. #define IL_MSG_NEW_MSG_PT_GREY        (IL_MSG_NEW_MSG_PT+1)
  1667. #define IL_MSG_NEW_POST            (IL_MSG_NEW_MSG_PT_GREY+1)
  1668. #define IL_MSG_NEW_POST_GREY        (IL_MSG_NEW_POST+1)
  1669. #define IL_MSG_NEW_POST_PT        (IL_MSG_NEW_POST_GREY+1)
  1670. #define IL_MSG_NEW_POST_PT_GREY        (IL_MSG_NEW_POST_PT+1)
  1671. #define IL_MSG_FOLLOWUP            (IL_MSG_NEW_POST_PT_GREY+1)
  1672. #define IL_MSG_FOLLOWUP_GREY        (IL_MSG_FOLLOWUP+1)
  1673. #define IL_MSG_FOLLOWUP_PT        (IL_MSG_FOLLOWUP_GREY+1)
  1674. #define IL_MSG_FOLLOWUP_PT_GREY        (IL_MSG_FOLLOWUP_PT+1)
  1675. #define IL_MSG_FOLLOWUP_AND_REPLY    (IL_MSG_FOLLOWUP_PT_GREY+1)
  1676. #define IL_MSG_FOLLOWUP_AND_REPLY_GREY    (IL_MSG_FOLLOWUP_AND_REPLY+1)
  1677. #define IL_MSG_FOLLOWUP_AND_REPLY_PT    (IL_MSG_FOLLOWUP_AND_REPLY_GREY+1)
  1678. #define IL_MSG_FOLLOWUP_AND_REPLY_PT_GREY (IL_MSG_FOLLOWUP_AND_REPLY_PT+1)
  1679. #define IL_MSG_REPLY_TO_SENDER        (IL_MSG_FOLLOWUP_AND_REPLY_PT_GREY+1)
  1680. #define IL_MSG_REPLY_TO_SENDER_GREY    (IL_MSG_REPLY_TO_SENDER+1)
  1681. #define IL_MSG_REPLY_TO_SENDER_PT    (IL_MSG_REPLY_TO_SENDER_GREY+1)
  1682. #define IL_MSG_REPLY_TO_SENDER_PT_GREY    (IL_MSG_REPLY_TO_SENDER_PT+1)
  1683. #define IL_MSG_REPLY_TO_ALL        (IL_MSG_REPLY_TO_SENDER_PT_GREY+1)
  1684. #define IL_MSG_REPLY_TO_ALL_GREY    (IL_MSG_REPLY_TO_ALL+1)
  1685. #define IL_MSG_REPLY_TO_ALL_PT        (IL_MSG_REPLY_TO_ALL_GREY+1)
  1686. #define IL_MSG_REPLY_TO_ALL_PT_GREY    (IL_MSG_REPLY_TO_ALL_PT+1)
  1687. #define IL_MSG_NEXT_UNREAD        (IL_MSG_REPLY_TO_ALL_PT_GREY+1)
  1688. #define IL_MSG_NEXT_UNREAD_GREY        (IL_MSG_NEXT_UNREAD+1)
  1689. #define IL_MSG_NEXT_UNREAD_PT        (IL_MSG_NEXT_UNREAD_GREY+1)
  1690. #define IL_MSG_NEXT_UNREAD_PT_GREY    (IL_MSG_NEXT_UNREAD_PT+1)
  1691. #define IL_MSG_PREV_UNREAD        (IL_MSG_NEXT_UNREAD_PT_GREY+1)
  1692. #define IL_MSG_PREV_UNREAD_GREY        (IL_MSG_PREV_UNREAD+1)
  1693. #define IL_MSG_PREV_UNREAD_PT        (IL_MSG_PREV_UNREAD_GREY+1)
  1694. #define IL_MSG_PREV_UNREAD_PT_GREY    (IL_MSG_PREV_UNREAD_PT+1)
  1695.  
  1696. #define IL_COMPOSE_SEND             (IL_MSG_PREV_UNREAD_PT_GREY+1)
  1697. #define IL_COMPOSE_SEND_GREY         (IL_COMPOSE_SEND+1)
  1698. #define IL_COMPOSE_SEND_PT        (IL_COMPOSE_SEND_GREY+1)
  1699. #define IL_COMPOSE_SEND_PT_GREY         (IL_COMPOSE_SEND_PT+1)
  1700. #define IL_COMPOSE_ATTACH        (IL_COMPOSE_SEND_PT_GREY+1)
  1701. #define IL_COMPOSE_ATTACH_GREY         (IL_COMPOSE_ATTACH+1)
  1702. #define IL_COMPOSE_ATTACH_PT         (IL_COMPOSE_ATTACH_GREY+1)
  1703. #define IL_COMPOSE_ATTACH_PT_GREY    (IL_COMPOSE_ATTACH_PT+1)
  1704. #define IL_COMPOSE_ADDRESSBOOK        (IL_COMPOSE_ATTACH_PT_GREY+1)
  1705. #define IL_COMPOSE_ADDRESSBOOK_GREY    (IL_COMPOSE_ADDRESSBOOK+1)
  1706. #define IL_COMPOSE_ADDRESSBOOK_PT    (IL_COMPOSE_ADDRESSBOOK_GREY+1)
  1707. #define IL_COMPOSE_ADDRESSBOOK_PT_GREY    (IL_COMPOSE_ADDRESSBOOK_PT+1)
  1708. #define IL_COMPOSE_QUOTE        (IL_COMPOSE_ADDRESSBOOK_PT_GREY+1)
  1709. #define IL_COMPOSE_QUOTE_GREY        (IL_COMPOSE_QUOTE+1)
  1710. #define IL_COMPOSE_QUOTE_PT        (IL_COMPOSE_QUOTE_GREY+1)
  1711. #define IL_COMPOSE_QUOTE_PT_GREY    (IL_COMPOSE_QUOTE_PT+1)
  1712. #define IL_COMPOSE_SENDLATER        (IL_COMPOSE_QUOTE_PT_GREY+1)
  1713. #define IL_COMPOSE_SENDLATER_GREY    (IL_COMPOSE_SENDLATER+1)
  1714. #define IL_COMPOSE_SENDLATER_PT        (IL_COMPOSE_SENDLATER_GREY+1)
  1715. #define IL_COMPOSE_SENDLATER_PT_GREY    (IL_COMPOSE_SENDLATER_PT+1)
  1716.  
  1717. /*FIXME need to do greys */
  1718. #define IL_EDITOR_GROUP         (IL_COMPOSE_SENDLATER_PT_GREY+1)
  1719. #define IL_EDITOR_NEW        (IL_EDITOR_GROUP+0)
  1720. #define IL_EDITOR_NEW_GREY    (IL_EDITOR_GROUP+1)
  1721. #define IL_EDITOR_NEW_PT    (IL_EDITOR_GROUP+2)
  1722. #define IL_EDITOR_NEW_PT_GREY    (IL_EDITOR_GROUP+3)
  1723. #define IL_EDITOR_OPEN        (IL_EDITOR_GROUP+4)
  1724. #define IL_EDITOR_OPEN_GREY    (IL_EDITOR_GROUP+5)
  1725. #define IL_EDITOR_OPEN_PT    (IL_EDITOR_GROUP+6)
  1726. #define IL_EDITOR_OPEN_PT_GREY    (IL_EDITOR_GROUP+7)
  1727. #define IL_EDITOR_SAVE        (IL_EDITOR_GROUP+8)
  1728. #define IL_EDITOR_SAVE_GREY    (IL_EDITOR_GROUP+9)
  1729. #define IL_EDITOR_SAVE_PT    (IL_EDITOR_GROUP+10)
  1730. #define IL_EDITOR_SAVE_PT_GREY    (IL_EDITOR_GROUP+11)
  1731. #define IL_EDITOR_BROWSE    (IL_EDITOR_GROUP+12)
  1732. #define IL_EDITOR_BROWSE_GREY    (IL_EDITOR_GROUP+13)
  1733. #define IL_EDITOR_BROWSE_PT    (IL_EDITOR_GROUP+14)
  1734. #define IL_EDITOR_BROWSE_PT_GREY (IL_EDITOR_GROUP+15)
  1735. #define IL_EDITOR_CUT        (IL_EDITOR_GROUP+16)
  1736. #define IL_EDITOR_CUT_GREY    (IL_EDITOR_GROUP+17)
  1737. #define IL_EDITOR_CUT_PT    (IL_EDITOR_GROUP+18)
  1738. #define IL_EDITOR_CUT_PT_GREY    (IL_EDITOR_GROUP+19)
  1739. #define IL_EDITOR_COPY        (IL_EDITOR_GROUP+20)
  1740. #define IL_EDITOR_COPY_GREY        (IL_EDITOR_GROUP+21)
  1741. #define IL_EDITOR_COPY_PT    (IL_EDITOR_GROUP+22)
  1742. #define IL_EDITOR_COPY_PT_GREY    (IL_EDITOR_GROUP+23)
  1743. #define IL_EDITOR_PASTE        (IL_EDITOR_GROUP+24)
  1744. #define IL_EDITOR_PASTE_GREY        (IL_EDITOR_GROUP+25)
  1745. #define IL_EDITOR_PASTE_PT    (IL_EDITOR_GROUP+26)
  1746. #define IL_EDITOR_PASTE_PT_GREY    (IL_EDITOR_GROUP+27)
  1747. #define IL_EDITOR_PRINT        (IL_EDITOR_GROUP+28)
  1748. #define IL_EDITOR_PRINT_GREY        (IL_EDITOR_GROUP+29)
  1749. #define IL_EDITOR_PRINT_PT    (IL_EDITOR_GROUP+30)
  1750. #define IL_EDITOR_PRINT_PT_GREY    (IL_EDITOR_GROUP+31)
  1751. #define IL_EDITOR_FIND        (IL_EDITOR_GROUP+32)
  1752. #define IL_EDITOR_FIND_GREY        (IL_EDITOR_GROUP+33)
  1753. #define IL_EDITOR_FIND_PT    (IL_EDITOR_GROUP+34)
  1754. #define IL_EDITOR_FIND_PT_GREY    (IL_EDITOR_GROUP+35)
  1755. #define IL_EDITOR_PUBLISH    (IL_EDITOR_GROUP+36)
  1756. #define IL_EDITOR_PUBLISH_GREY    (IL_EDITOR_GROUP+37)
  1757. #define IL_EDITOR_PUBLISH_PT    (IL_EDITOR_GROUP+38)
  1758. #define IL_EDITOR_PUBLISH_PT_GREY    (IL_EDITOR_GROUP+39)
  1759. #define IL_EDITOR_EDIT          (IL_EDITOR_GROUP+40)
  1760. #define IL_EDITOR_EDIT_GREY          (IL_EDITOR_GROUP+41)
  1761. #define IL_EDITOR_EDIT_PT    (IL_EDITOR_GROUP+42)
  1762. #define IL_EDITOR_EDIT_PT_GREY    (IL_EDITOR_GROUP+43)
  1763.  
  1764. #define IL_EDITOR_CHARACTER_TOOLBAR_ID 44
  1765. #define IL_EDITOR_OTHER_GROUP   (IL_EDITOR_EDIT_PT_GREY+1)
  1766. #define IL_EDITOR_CHARACTER_GROUP (IL_EDITOR_OTHER_GROUP)
  1767. #define IL_EDITOR_SHRINK        (IL_EDITOR_CHARACTER_GROUP+0)
  1768. #define IL_EDITOR_SHRINK_GREY   (IL_EDITOR_CHARACTER_GROUP+1)
  1769. #define IL_EDITOR_GROW          (IL_EDITOR_CHARACTER_GROUP+2)
  1770. #define IL_EDITOR_GROW_GREY     (IL_EDITOR_CHARACTER_GROUP+3)
  1771. #define IL_EDITOR_BOLD          (IL_EDITOR_CHARACTER_GROUP+4)
  1772. #define IL_EDITOR_BOLD_GREY     (IL_EDITOR_CHARACTER_GROUP+5)
  1773. #define IL_EDITOR_ITALIC        (IL_EDITOR_CHARACTER_GROUP+6)
  1774. #define IL_EDITOR_ITALIC_GREY   (IL_EDITOR_CHARACTER_GROUP+7)
  1775. #define IL_EDITOR_FIXED         (IL_EDITOR_CHARACTER_GROUP+8)
  1776. #define IL_EDITOR_FIXED_GREY    (IL_EDITOR_CHARACTER_GROUP+9)
  1777. #define IL_EDITOR_COLOR         (IL_EDITOR_CHARACTER_GROUP+10)
  1778. #define IL_EDITOR_COLOR_GREY    (IL_EDITOR_CHARACTER_GROUP+11)
  1779. #define IL_EDITOR_LINK          (IL_EDITOR_CHARACTER_GROUP+12)
  1780. #define IL_EDITOR_LINK_GREY     (IL_EDITOR_CHARACTER_GROUP+13)
  1781. #define IL_EDITOR_CLEAR         (IL_EDITOR_CHARACTER_GROUP+14)
  1782. #define IL_EDITOR_CLEAR_GREY    (IL_EDITOR_CHARACTER_GROUP+15)
  1783. #define IL_EDITOR_TARGET        (IL_EDITOR_CHARACTER_GROUP+16)
  1784. #define IL_EDITOR_TARGET_GREY   (IL_EDITOR_CHARACTER_GROUP+17)
  1785. #define IL_EDITOR_IMAGE         (IL_EDITOR_CHARACTER_GROUP+18)
  1786. #define IL_EDITOR_IMAGE_GREY    (IL_EDITOR_CHARACTER_GROUP+19)
  1787. #define IL_EDITOR_HRULE         (IL_EDITOR_CHARACTER_GROUP+20)
  1788. #define IL_EDITOR_HRULE_GREY    (IL_EDITOR_CHARACTER_GROUP+21)
  1789. #define IL_EDITOR_TABLE         (IL_EDITOR_CHARACTER_GROUP+22)
  1790. #define IL_EDITOR_TABLE_GREY    (IL_EDITOR_CHARACTER_GROUP+23)
  1791. #define IL_EDITOR_PROPS         (IL_EDITOR_CHARACTER_GROUP+24)
  1792. #define IL_EDITOR_PROPS_GREY    (IL_EDITOR_CHARACTER_GROUP+25)
  1793.  
  1794. /* why? #define IL_EDITOR_PARAGRAPH_TOOLBAR_ID 70 */
  1795. #define IL_EDITOR_PARAGRAPH_GROUP (IL_EDITOR_CHARACTER_GROUP+26)
  1796. #define IL_EDITOR_BULLET        (IL_EDITOR_PARAGRAPH_GROUP+0)
  1797. #define IL_EDITOR_BULLET_GREY   (IL_EDITOR_PARAGRAPH_GROUP+1)
  1798. #define IL_EDITOR_NUMBER        (IL_EDITOR_PARAGRAPH_GROUP+2)
  1799. #define IL_EDITOR_NUMBER_GREY   (IL_EDITOR_PARAGRAPH_GROUP+3)
  1800. #define IL_EDITOR_OUTDENT       (IL_EDITOR_PARAGRAPH_GROUP+4)
  1801. #define IL_EDITOR_OUTDENT_GREY  (IL_EDITOR_PARAGRAPH_GROUP+5)
  1802. #define IL_EDITOR_INDENT        (IL_EDITOR_PARAGRAPH_GROUP+6)
  1803. #define IL_EDITOR_INDENT_GREY   (IL_EDITOR_PARAGRAPH_GROUP+7)
  1804. #define IL_EDITOR_LEFT          (IL_EDITOR_PARAGRAPH_GROUP+8)
  1805. #define IL_EDITOR_LEFT_GREY     (IL_EDITOR_PARAGRAPH_GROUP+9)
  1806. #define IL_EDITOR_CENTER        (IL_EDITOR_PARAGRAPH_GROUP+10)
  1807. #define IL_EDITOR_CENTER_GREY   (IL_EDITOR_PARAGRAPH_GROUP+11)
  1808. #define IL_EDITOR_RIGHT         (IL_EDITOR_PARAGRAPH_GROUP+12)
  1809. #define IL_EDITOR_RIGHT_GREY    (IL_EDITOR_PARAGRAPH_GROUP+13)
  1810.  
  1811. #define IL_EDITOR_ALIGN_GROUP   (IL_EDITOR_PARAGRAPH_GROUP+14)
  1812. #define IL_ALIGN1_RAISED        (IL_EDITOR_ALIGN_GROUP+0)
  1813. #define IL_ALIGN1_DEPRESSED     (IL_EDITOR_ALIGN_GROUP+1)
  1814. #define IL_ALIGN2_RAISED        (IL_EDITOR_ALIGN_GROUP+2)
  1815. #define IL_ALIGN2_DEPRESSED     (IL_EDITOR_ALIGN_GROUP+3)
  1816. #define IL_ALIGN3_RAISED        (IL_EDITOR_ALIGN_GROUP+4)
  1817. #define IL_ALIGN3_DEPRESSED     (IL_EDITOR_ALIGN_GROUP+5)
  1818. #define IL_ALIGN4_RAISED        (IL_EDITOR_ALIGN_GROUP+6)
  1819. #define IL_ALIGN4_DEPRESSED     (IL_EDITOR_ALIGN_GROUP+7)
  1820. #define IL_ALIGN5_RAISED        (IL_EDITOR_ALIGN_GROUP+8)
  1821. #define IL_ALIGN5_DEPRESSED     (IL_EDITOR_ALIGN_GROUP+9)
  1822. #define IL_ALIGN6_RAISED        (IL_EDITOR_ALIGN_GROUP+10)
  1823. #define IL_ALIGN6_DEPRESSED     (IL_EDITOR_ALIGN_GROUP+11)
  1824. #define IL_ALIGN7_RAISED        (IL_EDITOR_ALIGN_GROUP+12)
  1825. #define IL_ALIGN7_DEPRESSED     (IL_EDITOR_ALIGN_GROUP+13)
  1826.  
  1827. #define IL_ICON_LOGO        (IL_ALIGN7_DEPRESSED+1)
  1828.  
  1829. /* Wrapper for LO_RefreshArea.  Allows refreshing through compositor when
  1830.    LAYERS is defined. */
  1831.  
  1832. extern void fe_RefreshArea(MWContext *, int32, int32, uint32, uint32);
  1833. extern void fe_RefreshAreaRequest(MWContext *, int32, int32, uint32, uint32);
  1834.  
  1835. /* Mouse actions. */
  1836. typedef enum fe_MouseActionEnum
  1837. {
  1838.     FE_INVALID_MOUSE_ACTION=0,
  1839.     FE_ARM_LINK,
  1840.     FE_DISARM_LINK,
  1841.     FE_ACTIVATE_LINK,
  1842.     FE_DISARM_LINK_IF_MOVED,
  1843.     FE_EXTEND_SELECTION,
  1844.     FE_DESCRIBE_LINK,
  1845.     FE_POPUP_MENU,
  1846.     FE_KEY_UP,
  1847.     FE_KEY_DOWN
  1848. } fe_MouseActionEnum;
  1849.  
  1850. /*#define LAYERS_FULL_FE_EVENT*/
  1851.  
  1852. #ifdef LAYERS_FULL_FE_EVENT
  1853. /* Arguments for mouse action callback functions. */
  1854. typedef struct fe_EventStruct
  1855. {
  1856.     XEvent *event;
  1857.     String *av;
  1858.     Cardinal *ac;
  1859.     fe_MouseActionEnum mouse_action;
  1860.     void *data;
  1861. } fe_EventStruct;
  1862. #else
  1863.  
  1864. typedef enum {
  1865.   fe_EventActivateKindNone=0,
  1866.   fe_EventActivateKindNormal,
  1867.   fe_EventActivateKindSaveOnly,
  1868.   fe_EventActivateKindNewWindow
  1869. } fe_EventActivateKind;
  1870.  
  1871. typedef struct fe_EventStruct {
  1872.   struct {
  1873.     int type;
  1874.     struct {
  1875.       struct {
  1876.     int x,y;
  1877.       } win,root;
  1878.     } pos;
  1879.     union {
  1880.       struct {
  1881.     Window root;
  1882.       } button;
  1883.       struct {
  1884.     unsigned int state,keycode;
  1885.       } key;
  1886.     } arg;
  1887.       
  1888.     Time time;
  1889.   } compressedEvent;
  1890.  
  1891.   void* data;       /* must be a pointer that's going to survive until after
  1892.              *  the event completes, even if the completion routine
  1893.              *  never gets called.
  1894.              */
  1895.  
  1896.   fe_EventActivateKind activateKind;
  1897.  
  1898.   fe_MouseActionEnum mouse_action;
  1899. } fe_EventStruct;
  1900.  
  1901. int xfeToLayerModifiers(int state);
  1902.  
  1903. void fe_event_stuff(MWContext* context,
  1904.             fe_EventStruct* fe_event,
  1905.             const XEvent* event,
  1906.             const String* av,
  1907.             const Cardinal* ac,
  1908.             fe_MouseActionEnum mouse_action);
  1909. XEvent* fe_event_extract(const fe_EventStruct* fe_event,
  1910.              String** av,
  1911.              Cardinal** ac,
  1912.              fe_MouseActionEnum* mouse_action);
  1913. #endif
  1914.  
  1915. /* Layer-based mouse actions. */
  1916. extern void
  1917. fe_arm_link_action_for_layer(MWContext *context, CL_Layer *layer,
  1918.                              CL_Event *layer_event);
  1919. extern void
  1920. fe_disarm_link_action_for_layer(MWContext *context, CL_Layer *layer,
  1921.                                 CL_Event *layer_event);
  1922. extern void
  1923. fe_disarm_link_if_moved_action_for_layer(MWContext *context, CL_Layer *layer,
  1924.                                          CL_Event *layer_event);
  1925. extern void
  1926. fe_activate_link_action_for_layer(MWContext *context, CL_Layer *layer,
  1927.                                   CL_Event *layer_event);
  1928. extern void
  1929. fe_describe_link_action_for_layer(MWContext *context, CL_Layer *layer,
  1930.                                   CL_Event *layer_event);
  1931. extern void
  1932. fe_extend_selection_action_for_layer(MWContext *context, CL_Layer *layer,
  1933.                                      CL_Event *layer_event);
  1934. extern void
  1935. fe_popup_menu_action_for_layer(MWContext *context, CL_Layer *layer,
  1936.                                CL_Event *layer_event);
  1937.  
  1938. /* Layer-based key actions. */
  1939. extern void
  1940. fe_key_up_in_text_action_for_layer(MWContext *context, CL_Layer *layer,
  1941.                    CL_Event *layer_event);
  1942. extern void
  1943. fe_key_down_in_text_action_for_layer(MWContext *context, CL_Layer *layer,
  1944.                      CL_Event *layer_event);
  1945.  
  1946. /* Create and initialize the Image Library JMC callback interface.
  1947.    Also create an IL_GroupContext for the current context. */
  1948. extern XP_Bool
  1949. fe_init_image_callbacks(MWContext *context);
  1950.  
  1951. /* Image group observer callback. */
  1952. extern void
  1953. fe_ImageGroupObserver(XP_Observable observable, XP_ObservableMsg message,
  1954.                       void *message_data, void *closure);
  1955.  
  1956. /* Returns TRUE if this is a context whose activity can be stopped. */
  1957. extern Boolean
  1958. fe_IsContextStoppable(MWContext *context);
  1959. extern Boolean
  1960. fe_IsContextLooping(MWContext *context);
  1961. extern void
  1962. FE_UpdateStopState(MWContext *context);  /* in src/context_funcs.cpp */
  1963.  
  1964. /*
  1965.  * Needed so we can popup dialogs early on.
  1966.  */
  1967. extern void FE_SetToplevelWidget(Widget toplevel);
  1968. extern Widget FE_GetToplevelWidget(void);
  1969.  
  1970. XP_END_PROTOS
  1971.  
  1972. /* Move up from editor.c so that others can share the code*/
  1973.  
  1974. typedef struct fe_OptionMenuItemDescription {
  1975.     char* name;  /* of widget               */
  1976.     char* label; /* delete me */
  1977.     void* data;  /* gets passed as userdata */
  1978. } fe_OptionMenuItemDescription;
  1979.  
  1980. Widget
  1981. fe_OptionMenuSetHistory(Widget menu, unsigned index);
  1982.  
  1983. Time fe_GetTimeFromEvent(XEvent* event);
  1984.  
  1985. extern XP_Bool fe_IsEditorDisabled(void);
  1986.  
  1987. extern void fe_CacheWindowOffset (MWContext *pContext, int32 sx, int32 sy);
  1988.  
  1989. extern void fe_textModifyVerifyCallback(Widget w,
  1990.                     XtPointer closure,
  1991.                     XtPointer call_data);
  1992. extern void fe_textMotionVerifyCallback(Widget w,
  1993.                     XtPointer closure,
  1994.                     XtPointer call_data);
  1995. extern int fe_isTextModifyVerifyCallbackInhibited(void);
  1996.  
  1997. extern XP_Bool fe_GetCommandLineDone(void);
  1998. extern int fe_GetSavedArgc(void);
  1999. extern char ** fe_GetSavedArgv(void);
  2000. extern XP_Bool fe_UseAsyncDNS(void);
  2001.  
  2002. /*
  2003.  * Keep track of tooltip mapping to avoid conflict with fascist shells
  2004.  * that insist on raising themselves - like taskbar and netcaster webtop
  2005.  */
  2006. extern Boolean fe_ToolTipIsShowing(void);
  2007.  
  2008. /* Get URL for referral if there is one. */
  2009. extern char *fe_GetURLForReferral(History_entry *he);
  2010.  
  2011.  
  2012. /* This func is basically XP_FindContextOfType but only returns
  2013.  * a top-level non-nethelp browser context
  2014.  */
  2015. extern MWContext* fe_FindNonCustomBrowserContext(MWContext *context);
  2016.  
  2017. extern void fe_DisplayFactoryColormapGoingAway(fe_colormap *);
  2018.  
  2019. #ifdef    __cplusplus
  2020. }
  2021. #endif
  2022.  
  2023. #endif /* _XFE_H_ */
  2024.