home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / include / mk_cx_fn.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  9.0 KB  |  150 lines

  1. /* -*- Mode: C; tab-width: 4; 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. ** This file is Michael Toy's fault.  If you hate it or have troubles figuring
  21. ** it out, you should bother him about it.
  22. **
  23. ** This file generates both the fields of the front end structure, and the
  24. ** fe specific prototypes for your front end implementations, AND the
  25. ** the code to fill in the structure in your context initilization code
  26. **
  27. ** To use it:
  28. **
  29. **  #define MAKE_FE_FUNCS_STRUCT
  30. **  #include "mk_cx_fn.h"
  31. ** This will generate the field definitions for the structure.
  32. **
  33. **  #define MAKE_FE_FUNCS_PREFIX(func) prefix_##func
  34. **  #define MAKE_FE_FUNCS_ASSIGN cx->
  35. **  #include "mk_cx_fn.h"
  36. ** Substitute your naming prefix for "prefix" (e.g XFE)
  37. ** This will generate the assignment statements to fill in the structure,
  38. ** the definition of MAKE_FE_FUNCS_ASSIGN will be the left hand side of the
  39. ** assignment statement.
  40. **
  41. **  #define MAKE_FE_FUNCS_PREFIX(func) prefix_##func
  42. **  #define MAKE_FE_FUNCS_EXTERN
  43. **  #include "mk_cx_fn.h"
  44. ** This will generate the prototypes for all your front end functions.
  45. */
  46.  
  47. #if defined(MAKE_FE_FUNCS_TYPES)
  48. #define FE_DEFINE(func, returns, args) typedef returns (*MAKE_FE_TYPES_PREFIX(func)) args;
  49. #elif defined(MAKE_FE_FUNCS_STRUCT)
  50. #define FE_DEFINE(func, returns, args) returns (*func) args;
  51. #elif defined(MAKE_FE_FUNCS_EXTERN)
  52. #define FE_DEFINE(func, returns, args) extern returns MAKE_FE_FUNCS_PREFIX(func) args;
  53. #elif defined(MAKE_FE_FUNCS_ASSIGN)
  54. #define FE_DEFINE(func, returns, args) MAKE_FE_FUNCS_ASSIGN func = MAKE_FE_FUNCS_PREFIX(func);
  55. #elif !defined(FE_DEFINE)
  56. You;Should;Read;The;Header;For;This;File;Before;Including;Error;Error;Error;
  57. #endif
  58.  
  59. FE_DEFINE(CreateNewDocWindow, MWContext*, (MWContext * calling_context,URL_Struct * URL))
  60. FE_DEFINE(LayoutNewDocument, void, (MWContext *context, URL_Struct *url_struct, int32 *iWidth, int32 *iHeight, int32 *mWidth, int32 *mHeight))
  61. FE_DEFINE(SetDocTitle,void, (MWContext * context, char * title))
  62. FE_DEFINE(FinishedLayout,void, (MWContext *context))
  63. FE_DEFINE(TranslateISOText,char *, (MWContext * context, int charset, char *ISO_Text))
  64. FE_DEFINE(GetTextInfo,int, (MWContext * context, LO_TextStruct *text, LO_TextInfo *text_info))
  65. #ifdef XP_MAC
  66. FE_DEFINE(MeasureText,int, (MWContext * context, LO_TextStruct *text, short *charLocs))
  67. #endif 
  68. FE_DEFINE(GetEmbedSize,void, (MWContext * context, LO_EmbedStruct *embed_struct, NET_ReloadMethod force_reload))
  69. FE_DEFINE(GetJavaAppSize,void, (MWContext * context, LO_JavaAppStruct *java_struct, NET_ReloadMethod force_reload))
  70. FE_DEFINE(GetFormElementInfo,void, (MWContext * context, LO_FormElementStruct * form_element))
  71. FE_DEFINE(GetFormElementValue,void, (MWContext * context, LO_FormElementStruct * form_element, XP_Bool hide))
  72. FE_DEFINE(ResetFormElement,void, (MWContext * context, LO_FormElementStruct * form_element))
  73. FE_DEFINE(SetFormElementToggle,void, (MWContext * context, LO_FormElementStruct * form_element, XP_Bool toggle))
  74. FE_DEFINE(FreeEmbedElement,void, (MWContext *context, LO_EmbedStruct *))
  75. FE_DEFINE(CreateEmbedWindow, void, (MWContext *context, NPEmbeddedApp *app))
  76. FE_DEFINE(SaveEmbedWindow, void, (MWContext *context, NPEmbeddedApp *app))
  77. FE_DEFINE(RestoreEmbedWindow, void, (MWContext *context, NPEmbeddedApp *app))
  78. FE_DEFINE(DestroyEmbedWindow, void, (MWContext *context, NPEmbeddedApp *app))
  79. FE_DEFINE(FreeJavaAppElement,void, (MWContext *context, struct LJAppletData *appletData))
  80. FE_DEFINE(HideJavaAppElement,void, (MWContext *context, struct LJAppletData *))
  81. FE_DEFINE(FreeEdgeElement,void, (MWContext *context, LO_EdgeStruct *))
  82. FE_DEFINE(FormTextIsSubmit,void, (MWContext * context, LO_FormElementStruct * form_element))
  83. FE_DEFINE(DisplaySubtext,void, (MWContext * context, int iLocation, LO_TextStruct *text, int32 start_pos, int32 end_pos, XP_Bool need_bg))
  84. FE_DEFINE(DisplayText,void, (MWContext * context, int iLocation, LO_TextStruct *text, XP_Bool need_bg))
  85. FE_DEFINE(DisplayEmbed,void, (MWContext * context, int iLocation ,LO_EmbedStruct *embed_struct))
  86. FE_DEFINE(DisplayJavaApp,void, (MWContext * context, int iLocation ,LO_JavaAppStruct *java_struct))
  87. FE_DEFINE(DisplayEdge,void, (MWContext * context, int iLocation ,LO_EdgeStruct *edge_struct))
  88. FE_DEFINE(DisplayTable,void, (MWContext * context, int iLocation ,LO_TableStruct *table_struct))
  89. FE_DEFINE(DisplayCell,void, (MWContext * context, int iLocation ,LO_CellStruct *cell_struct))
  90. #ifdef XP_MAC
  91. FE_DEFINE(InvalidateEntireTableOrCell,void, (MWContext * context, LO_Element *element))
  92. FE_DEFINE(DisplayAddRowOrColBorder,void, (MWContext * context, XP_Rect* r ,XP_Bool bErase))
  93. #endif
  94. FE_DEFINE(DisplaySubDoc,void, (MWContext * context, int iLocation ,LO_SubDocStruct *subdoc_struct))
  95. FE_DEFINE(DisplayLineFeed,void, (MWContext * context, int iLocation , LO_LinefeedStruct *line_feed, XP_Bool need_bg))
  96. FE_DEFINE(DisplayHR,void, (MWContext * context, int iLocation , LO_HorizRuleStruct *HR_struct))
  97. FE_DEFINE(DisplayBullet,void, (MWContext *context, int iLocation, LO_BullettStruct *bullet))
  98. FE_DEFINE(DisplayFormElement,void, (MWContext * context, int iLocation, LO_FormElementStruct * form_element))
  99. FE_DEFINE(DisplayBorder,void, (MWContext *context, int iLocation, int x, int y, int width, int height, int bw, LO_Color *color, LO_LineStyle style))
  100. #ifdef XP_MAC
  101. FE_DEFINE(UpdateEnableStates,void, (MWContext *context))
  102. #endif
  103. FE_DEFINE(DisplayFeedback,void, (MWContext *context, int iLocation, LO_Element *element))
  104. FE_DEFINE(ClearView,void, (MWContext * context, int which))
  105. FE_DEFINE(SetDocDimension,void, (MWContext *context, int iLocation, int32 iWidth, int32 iLength))
  106. FE_DEFINE(SetDocPosition,void, (MWContext *context, int iLocation, int32 iX, int32 iY))
  107. FE_DEFINE(GetDocPosition,void, (MWContext *context, int iLocation, int32 *iX, int32 *iY))
  108. FE_DEFINE(BeginPreSection,void, (MWContext *context))
  109. FE_DEFINE(EndPreSection,void, (MWContext *context))
  110. FE_DEFINE(SetProgressBarPercent,void, (MWContext *context, int32 percent))
  111. FE_DEFINE(SetBackgroundColor,void, (MWContext *context, uint8 red, uint8 green, uint8 blue))
  112. FE_DEFINE(Progress, void, (MWContext * cx, const char *msg))
  113. FE_DEFINE(Alert, void, (MWContext * cx, const char *msg))
  114. FE_DEFINE(SetCallNetlibAllTheTime, void, (MWContext * win_id))
  115. FE_DEFINE(ClearCallNetlibAllTheTime, void, (MWContext * win_id))
  116. FE_DEFINE(GraphProgressInit, void, (MWContext *context, URL_Struct *URL_s, int32 content_length))
  117. FE_DEFINE(GraphProgressDestroy, void, (MWContext *context, URL_Struct *URL_s, int32 content_length, int32 total_bytes_read))
  118. FE_DEFINE(GraphProgress, void, (MWContext *context, URL_Struct *URL_s, int32 bytes_received, int32 bytes_since_last_time, int32 content_length))
  119. FE_DEFINE(UseFancyFTP, XP_Bool, (MWContext * window_id))
  120. FE_DEFINE(UseFancyNewsgroupListing, XP_Bool, (MWContext *window_id))
  121. FE_DEFINE(FileSortMethod, int, (MWContext * window_id))
  122. FE_DEFINE(ShowAllNewsArticles, XP_Bool, (MWContext *window_id))
  123. FE_DEFINE(Confirm, XP_Bool,(MWContext * context, const char * Msg))
  124. FE_DEFINE(Prompt,char*,(MWContext * context, const char * Msg, const char * dflt))
  125. FE_DEFINE(PromptWithCaption,char*,(MWContext * context, const char *caption, const char * Msg, const char * dflt))
  126. FE_DEFINE(PromptUsernameAndPassword, XP_Bool, (MWContext *,const char *,char **, char **))
  127. FE_DEFINE(PromptPassword,char*,(MWContext * context, const char * Msg))
  128. FE_DEFINE(EnableClicking,void,(MWContext*))
  129. FE_DEFINE(AllConnectionsComplete,void,(MWContext * context))
  130. #ifdef XP_OS2       /* performance */
  131. FE_DEFINE(GetMaxWidth,int, (MWContext * context, LO_TextStruct *text))
  132. #endif
  133. #ifdef LAYERS
  134. FE_DEFINE(EraseBackground, void, (MWContext *, int, int32, int32, uint32, uint32, LO_Color *))
  135. FE_DEFINE(SetDrawable, void, (MWContext *, CL_Drawable *))
  136. FE_DEFINE(GetTextFrame, void, (MWContext *, LO_TextStruct *, int32, int32, XP_Rect *))
  137. #ifdef XP_MAC
  138. FE_DEFINE(GetDefaultBackgroundColor, void, (MWContext* context, LO_Color* color))
  139. #endif
  140. #endif
  141. /* these functions are to allow dealyed native window applet creation and transparent applet */
  142. FE_DEFINE(HandleClippingView, void, (MWContext *pContext, struct LJAppletData *appletD, int x, int y, int width, int height))
  143. FE_DEFINE(DrawJavaApp, void, (MWContext *pContext, int iLocation, LO_JavaAppStruct *pJava))
  144.  
  145. #undef FE_DEFINE
  146. #undef MAKE_FE_FUNCS_PREFIX
  147. #undef MAKE_FE_FUNCS_ASSIGN
  148. #undef MAKE_FE_FUNCS_EXTERN
  149. #undef MAKE_FE_FUNCS_STRUCT
  150.