Landing SHACK changes from RDF branch.

This commit is contained in:
hyatt%netscape.com 1998-07-23 17:44:04 +00:00
parent 905edcc482
commit d3d979d411
20 changed files with 43 additions and 80 deletions

View File

@ -26,7 +26,8 @@ CSRCS = bullet.c \
clipline.c \
layarena.c \
layblock.c \
laycell.c \
laybuiltin.c \
laycell.c \
laycols.c \
laydisp.c \
layembed.c \
@ -49,7 +50,7 @@ CSRCS = bullet.c \
laylayer.c \
layrelay.c \
laytrav.c \
$(NULL)
$(NULL)
REQUIRES = parse style js layer applet nspr security dbm img util jtools edtplug java hook pref libfont lay rdf network htmldlgs
@ -72,11 +73,6 @@ CSRCS += layedit.c \
layutil.c \
$(NULL)
ifdef SHACK
CSRCS += laybuiltin.c \
$(NULL)
endif
CPPSRCS = streams.cpp \
fsfile.cpp \
editor.cpp \

View File

@ -234,12 +234,10 @@ lo_duplicate_element(MWContext *context, lo_DocState *state,
XP_BCOPY((char *)eptr, (char *)(ret_eptr),
sizeof(LO_EmbedStruct));
break;
#ifdef SHACK
case LO_BUILTIN:
XP_BCOPY((char *)eptr, (char *)(ret_eptr),
sizeof(LO_BuiltinStruct));
break;
#endif /* SHACK */
#ifdef JAVA
case LO_JAVA:
XP_BCOPY((char *)eptr, (char *)(ret_eptr),

View File

@ -203,9 +203,7 @@ void edt_InitBitArrays() {
P_NOLAYER, //cmanske - added 9/4/97
P_COLORMAP,
P_EMBED,
#ifdef SHACK
P_BUILTIN,
#endif /* SHACK */
P_FORM,
P_INPUT,
P_OPTION,
@ -339,9 +337,7 @@ void edt_InitBitArrays() {
P_INLINEINPUTTHICK,
P_INLINEINPUTDOTTED,
P_NOLAYER,
#ifdef SHACK
P_BUILTIN,
#endif /* SHACK */
BIT_ARRAY_END );
edt_setTextContainer = new CBitArray( size,
@ -1083,9 +1079,7 @@ static char *loTypeNames[] = {
"LO_TABLE",
"LO_CELL",
"LO_EMBED",
#ifdef SHACK
"LO_BUILTIN",
#endif /* SHACK */
};
//

View File

@ -851,10 +851,8 @@ static char* TagString(int32 tagType)
return "block"; // PT_BLOCK
case P_NOLAYER:
return PT_NOLAYER; // (?) jrm 97/03/08 according to instructions below.
#ifdef SHACK
case P_BUILTIN:
return PT_BUILTIN;
#endif
default:
// If we get here, then it's a new tag that's been added to lib\libparse\pa_tags.h
// The fix is to add this new tag to the case statement above.

View File

@ -84,6 +84,24 @@ lo_FormatBuiltin (MWContext *context, lo_DocState *state, PA_Tag *tag)
lo_FormatBuiltinInternal (context, state, tag, builtin, FALSE, FALSE);
}
void
lo_appendParams (LO_BuiltinStruct *builtin, uint32 param_count,
char **param_names, char **param_values) {
int32 newcount = builtin->attribute_cnt + param_count;
int32 n = builtin->attribute_cnt;
builtin->attribute_list = (char**)XP_REALLOC(builtin->attribute_list,
newcount * sizeof(char*));
builtin->value_list = (char**)XP_REALLOC(builtin->value_list,
newcount * sizeof(char*));
while (n < newcount) {
*(builtin->attribute_list + n) = XP_STRDUP(*(param_names + n - builtin->attribute_cnt));
*(builtin->value_list + n) = XP_STRDUP(*(param_values + n - builtin->attribute_cnt));
n++;
}
builtin->attribute_cnt = builtin->attribute_cnt + param_count;
}
void
lo_FormatBuiltinObject (MWContext *context, lo_DocState* state,
PA_Tag* tag , LO_BuiltinStruct *builtin, Bool streamStarted,
@ -104,6 +122,7 @@ lo_FormatBuiltinObject (MWContext *context, lo_DocState* state,
builtin->attribute_cnt = PA_FetchAllNameValues (tag,
&(builtin->attribute_list), &(builtin->value_list), CS_FE_ASCII);
if (param_count > 0) lo_appendParams(builtin, param_count, param_names, param_values);
lo_FormatBuiltinInternal (context, state, tag, builtin, TRUE, streamStarted);
}
@ -124,7 +143,7 @@ lo_FillInBuiltinGeometry(lo_DocState *state,
doc_width = state->right_margin - state->left_margin;
/*
* Get the width parameter, in absolute or percentage.
* Get the width parameter, in absolute or percentage.
* If percentage, make it absolute.
*/

View File

@ -318,7 +318,6 @@ lo_DisplayEmbed(MWContext *context, LO_EmbedStruct *embed)
}
}
#ifdef SHACK
void
lo_DisplayBuiltin(MWContext *context, LO_BuiltinStruct *builtin)
{
@ -345,7 +344,6 @@ lo_DisplayBuiltin(MWContext *context, LO_BuiltinStruct *builtin)
builtin->ele_attrmask |= LO_ELE_DRAWN;
}
}
#endif /* SHACK */
#ifdef JAVA
void
@ -750,11 +748,9 @@ lo_DisplayElement(MWContext *context, LO_Element *tptr,
lo_DisplayEmbed(context, (LO_EmbedStruct *)tptr);
break;
#ifdef SHACK
case LO_BUILTIN:
lo_DisplayBuiltin(context, (LO_BuiltinStruct *)tptr);
break;
#endif /* SHACK */
#ifdef JAVA
case LO_JAVA:

View File

@ -1745,9 +1745,7 @@ lo_PrintLayoutElement(MWContext *pContext, lo_TopState* top_state,
"LO_HEADING",
"LO_SPAN",
"LO_DIV",
#ifdef SHACK
"LO_BUILTIN",
#endif /* SHACK */
"LO_SPACER"
};
type = eptr->lo_any.type;

View File

@ -562,12 +562,10 @@ lo_ScrapeElement(MWContext *context, LO_Element *element, Bool freeTableOrCellSt
element->lo_embed.objTag.embed_index);
element->lo_embed.objTag.session_data = NULL;
break;
#ifdef SHACK
case LO_BUILTIN:
FE_FreeBuiltinElement (context, (LO_BuiltinStruct *)element);
/* maybe other stuff here */
break;
#endif /* SHACK */
#ifdef JAVA
case LO_JAVA:

View File

@ -2604,7 +2604,8 @@ static void
lo_image_pixmap_update(MWContext *context, LO_ImageStruct *lo_image,
IL_Rect *update_rect)
{
#if defined(XP_WIN) || defined(XP_MAC)
#if defined(XP_WIN) || defined(XP_MAC) || defined(XP_UNIX)
IL_ImageReq *image_req = NULL; // See below at the end of the function.
#endif
@ -2638,15 +2639,18 @@ lo_image_pixmap_update(MWContext *context, LO_ImageStruct *lo_image,
}
}
#if defined(XP_WIN) || defined(XP_MAC)
// This is a hack in the update event to allow RDF images to get updates
// even though they have no compositors in their contexts.
#if defined(XP_WIN) || defined(XP_MAC) || defined(XP_UNIX)
/*
* This is a hack in the update event to allow RDF images to get updates
* even though they have no compositors in their contexts.
*/
if (context->type == MWContextIcon)
{
image_req = lo_image->image_req;
if (image_req)
IL_DisplaySubImage(image_req, 0, 0, 0, 0, 1, 1); // Forces a DisplayPixmap update.
if (image_req) {
/* Forces a DisplayPixmap update. */
IL_DisplaySubImage(image_req, 0, 0, 0, 0, 1, 1);
}
}
#endif
}

View File

@ -131,7 +131,6 @@ lo_element_info(LO_Element *ele_list, NET_StreamClass *stream)
}
}
break;
#ifdef SHACK
case LO_BUILTIN:
{
LO_BuiltinStruct *builtin;
@ -171,7 +170,6 @@ lo_element_info(LO_Element *ele_list, NET_StreamClass *stream)
}
}
break;
#endif /* SHACK */
#ifdef JAVA
case LO_JAVA:

View File

@ -2103,11 +2103,9 @@ lo_update_embedded_object_window(CL_Layer *layer)
case LO_EMBED:
FE_DisplayEmbed(context, FE_VIEW, &tptr->lo_embed);
break;
#ifdef SHACK
case LO_BUILTIN:
FE_DisplayBuiltin(context, FE_VIEW, &tptr->lo_builtin);
break;
#endif /* SHACK */
#ifdef JAVA
case LO_JAVA:
FE_DisplayJavaApp(context, FE_VIEW, &tptr->lo_java);
@ -2160,12 +2158,10 @@ lo_window_layer_visibility_changed(CL_Layer *layer,
tptr->lo_embed.objTag.ele_attrmask &= ~LO_ELE_INVISIBLE;
tptr->lo_embed.objTag.ele_attrmask |= LO_ELE_INVISIBLE * !visible;
break;
#ifdef SHACK
case LO_BUILTIN:
tptr->lo_builtin.ele_attrmask &= ~LO_ELE_INVISIBLE;
tptr->lo_builtin.ele_attrmask |= LO_ELE_INVISIBLE * !visible;
break;
#endif /* SHACK */
#ifdef JAVA
case LO_JAVA:
tptr->lo_java.objTag.ele_attrmask &= ~LO_ELE_INVISIBLE;
@ -2248,7 +2244,6 @@ lo_CreateEmbeddedObjectLayer(MWContext *context,
hspace = tptr->lo_embed.objTag.border_horiz_space;
is_window = PR_FALSE;
break;
#ifdef SHACK
case LO_BUILTIN:
name = "_BUILTIN";
tptr->lo_builtin.ele_attrmask |= LO_ELE_INVISIBLE;
@ -2256,7 +2251,6 @@ lo_CreateEmbeddedObjectLayer(MWContext *context,
hspace = tptr->lo_builtin.border_horiz_space;
is_window = PR_TRUE;
break;
#endif
#ifdef JAVA
case LO_JAVA:
name = "_JAVA_APPLET";

View File

@ -282,7 +282,6 @@ lo_FormatObject(MWContext* context, lo_DocState* state, PA_Tag* tag)
}
#endif /* if 0 */
#ifdef SHACK
if (XP_STRNCASECMP(str, "builtin", 7) == 0)
{
if (type == LO_NONE)
@ -290,7 +289,6 @@ lo_FormatObject(MWContext* context, lo_DocState* state, PA_Tag* tag)
else if (type != LO_BUILTIN)
type = LO_UNKNOWN;
}
#endif /* SHACK */
PA_UNLOCK(buff);
XP_FREE(buff);
@ -331,12 +329,10 @@ lo_FormatObject(MWContext* context, lo_DocState* state, PA_Tag* tag)
{
object->lo_element.lo_plugin.type = LO_EMBED;
}
#ifdef SHACK
else if (type == LO_BUILTIN)
{
object->lo_element.type = LO_BUILTIN;
}
#endif
#ifdef JAVA
else if (type == LO_JAVA)
{
@ -907,7 +903,6 @@ lo_ProcessObjectTag(MWContext* context, lo_DocState* state, PA_Tag* tag, XP_Bool
top->param_values = NULL;
#endif /* OJI */
}
#ifdef SHACK
else if (object->lo_element.type == LO_BUILTIN)
{
lo_FormatBuiltinObject(context,
@ -931,7 +926,6 @@ lo_ProcessObjectTag(MWContext* context, lo_DocState* state, PA_Tag* tag, XP_Bool
top->param_values = NULL;
#endif /* OJI */
}
#endif /* SHACK */
#ifdef JAVA
else if (object->lo_element.lo_plugin.type == LO_JAVA)

View File

@ -7589,12 +7589,10 @@ void lo_UpdateStateWhileFlushingLine( MWContext *context, lo_DocState *state )
border_width = tptr->lo_java.objTag.border_width;
break;
#endif
#ifdef SHACK
case LO_BUILTIN:
layer = tptr->lo_builtin.layer;
border_width = tptr->lo_builtin.border_width;
break;
#endif
case LO_EMBED:
layer = tptr->lo_embed.objTag.layer;
border_width = tptr->lo_embed.objTag.border_width;

View File

@ -1184,9 +1184,7 @@ extern Bool lo_SetNamedSpan(lo_DocState *, PA_Block);
#endif
extern void lo_AddNameList(lo_DocState *, lo_DocState *);
#ifdef SHACK
extern void lo_DisplayBuiltin(MWContext *, LO_BuiltinStruct *);
#endif
extern void lo_CheckNameList(MWContext *, lo_DocState *, int32);
extern int32 lo_StripTextWhitespace(char *, int32);
extern int32 lo_StripTextNewlines(char *, int32);
@ -1242,10 +1240,8 @@ extern void lo_RegionToLines (MWContext *, lo_DocState *, int32 x, int32 y,
uint32 width, uint32 height, Bool dontCrop,
int32* topLine, int32* bottomLine);
extern int32 lo_PointToLine (MWContext *, lo_DocState *, int32 x, int32 y);
#ifdef SHACK
extern void lo_FormatBuiltinObject(MWContext*, lo_DocState*, PA_Tag*, LO_BuiltinStruct*, Bool,
uint32 count, char** names, char** values);
#endif
extern void lo_GetLineEnds(MWContext *, lo_DocState *,
int32 line, LO_Element** retBegin, LO_Element** retEnd);
extern void lo_CalcAlignOffsets(lo_DocState *, LO_TextInfo *, intn,
@ -1320,10 +1316,8 @@ extern void lo_UpdateStateAfterJavaAppLayout( lo_DocState *state, LO_JavaAppStru
extern void lo_FillInEmbedGeometry(lo_DocState *state, LO_EmbedStruct *embed, Bool relayout);
extern void lo_LayoutInflowEmbed(MWContext *context, lo_DocState *state, LO_EmbedStruct *embed,
Bool inRelayout, int32 *line_inc, int32 *baseline_inc);
#ifdef SHACK
void lo_LayoutInflowBuiltin(MWContext *context, lo_DocState *state, LO_BuiltinStruct *builtin,
extern void lo_LayoutInflowBuiltin(MWContext *context, lo_DocState *state, LO_BuiltinStruct *builtin,
Bool inRelayout, int32 *line_inc, int32 *baseline_inc);
#endif
extern void lo_LayoutFloatEmbed(MWContext *context, lo_DocState *state, LO_EmbedStruct *embed, Bool updateFE);
extern void lo_UpdateStateAfterEmbedLayout( lo_DocState *state, LO_EmbedStruct *embed,
int32 line_inc, int32 baseline_inc );

View File

@ -82,9 +82,7 @@ static LO_Element * lo_rl_FitFormEle( lo_RelayoutState *relay_state, LO_Element
static LO_Element * lo_rl_FitTable( lo_RelayoutState *relay_state, LO_Element *lo_ele );
static LO_Element * lo_rl_FitCell( lo_RelayoutState *relay_state, LO_Element *lo_ele );
static LO_Element * lo_rl_FitEmbed( lo_RelayoutState *relay_state, LO_Element *lo_ele );
#ifdef SHACK
static LO_Element * lo_rl_FitBuiltin( lo_RelayoutState *relay_state, LO_Element *lo_ele );
#endif /* SHACK */
static LO_Element * lo_rl_FitJava( lo_RelayoutState *relay_state, LO_Element *lo_ele );
static LO_Element * lo_rl_FitObject( lo_RelayoutState *relay_state, LO_Element *lo_ele );
static LO_Element * lo_rl_FitParagraph( lo_RelayoutState *relay_state, LO_Element *lo_ele );
@ -132,13 +130,17 @@ static lo_FitFunction lo_rl_FitFunctionTable[] = {
lo_rl_FitHeading, /* LO_HEADING */
lo_rl_FitSpan, /* LO_SPAN */
lo_rl_FitDiv, /* LO_DIV */
#ifdef SHACK
lo_rl_FitBuiltin, /* LO_BUILTIN */
#endif /* SHACK */
lo_rl_FitSpacer /* LO_SPACER */
};
void lo_FillInBuiltinGeometry(lo_DocState *state, LO_BuiltinStruct *builtin,
Bool relayout);
void lo_UpdateStateAfterBuiltinLayout (lo_DocState *state, LO_BuiltinStruct *builtin,
int32 line_inc, int32 baseline_inc);
/* NRA - 10/3/97: Main Relayout Entry Point
* This function walks through the layout element list and re-lays out
* the elements to fit into a window of the specified width and height.
@ -1164,7 +1166,6 @@ lo_rl_FitEmbed( lo_RelayoutState *relay_state, LO_Element *lo_ele )
return next;
}
#ifdef SHACK
static LO_Element *
lo_rl_FitBuiltin( lo_RelayoutState *relay_state, LO_Element *lo_ele )
{
@ -1179,7 +1180,6 @@ lo_rl_FitBuiltin( lo_RelayoutState *relay_state, LO_Element *lo_ele )
return next;
}
#endif /* SHACK */
static LO_Element *
lo_rl_FitJava( lo_RelayoutState *relay_state, LO_Element *lo_ele )
@ -1438,7 +1438,6 @@ lo_rl_FitFloat( lo_RelayoutState *relay_state, LO_Element *lo_ele )
layer = embed->objTag.layer;
}
#ifdef SHACK
else if (lo_ele->lo_float.float_ele->lo_any.type == LO_BUILTIN) {
LO_BuiltinStruct *builtin = (LO_BuiltinStruct *)lo_ele->lo_float.float_ele;
@ -1451,7 +1450,6 @@ lo_rl_FitFloat( lo_RelayoutState *relay_state, LO_Element *lo_ele )
layer = builtin->layer;
}
#endif /* SHACK */
else if (lo_ele->lo_float.float_ele->lo_any.type == LO_TABLE) {
LO_TableStruct *table_ele = (LO_TableStruct *)lo_ele->lo_float.float_ele;
lo_DocState *state = relay_state->doc_state;

View File

@ -7067,10 +7067,8 @@ LO_isTabableElement(MWContext *context, LO_TabFocusData *pCurrentFocus )
#endif
case LO_SCRIPT : /* 13 */
break;
#ifdef SHACK
case LO_BUILTIN : /* 28 */
break;
#endif /* SHACK */
default : /* something wrong!! */
bIsTabable = FALSE;
break;

View File

@ -6673,6 +6673,8 @@ XP_TRACE(("lo_LayoutTag(%d)\n", tag->type));
char *rdfURL = NULL;
char *str = NULL;
if (buff2 == NULL) buff2 = lo_FetchParamValue(context, tag, PARAM_HREF);
if (buff2 != NULL)
{
PA_LOCK(str, char *, buff2);

View File

@ -104,7 +104,6 @@ lo_GetElementBbox(LO_Element *element, XP_Rect *rect)
}
break;
#ifdef SHACK
case LO_BUILTIN:
{
LO_BuiltinStruct *builtin = &element->lo_builtin;
@ -112,7 +111,6 @@ lo_GetElementBbox(LO_Element *element, XP_Rect *rect)
rect->bottom += 2 * (builtin->border_width + builtin->border_vert_space);
}
break;
#endif /* SHACK */
#ifdef JAVA
case LO_JAVA:
@ -1992,11 +1990,9 @@ lo_NewElement(MWContext *context, lo_DocState *state, intn type,
case LO_TABLE:
size = sizeof(LO_TableStruct);
break;
#ifdef SHACK
case LO_BUILTIN:
size = sizeof(LO_BuiltinStruct);
break;
#endif
case LO_CELL:
size = sizeof(LO_CellStruct);
break;
@ -3778,11 +3774,9 @@ Bool LO_IsWithinSpan( LO_Element *ele )
case LO_JAVA:
isInSpan = ele->lo_java.ele_attrmask & LO_ELE_IN_SPAN ? TRUE : FALSE;
break;
#ifdef SHACK
case LO_BUILTIN:
isInSpan = ele->lo_builtin.ele_attrmask & LO_ELE_IN_SPAN ? TRUE : FALSE;
break;
#endif
}
}
return isInSpan;

View File

@ -59,10 +59,8 @@ typedef struct fe_functions {
int32 start_pos, int32 end_pos, XP_Bool need_bg);
void (*DisplayEmbed)(void *fe_context,
int iLocation, LO_EmbedStruct *embed);
#ifdef SHACK
void (*DisplayBuiltin)(void *fe_context,
int iLocation, LO_BuiltinStruct *builtin);
#endif
void (*DisplayJavaApp)(void *fe_context,
int iLocation, LO_JavaAppStruct *java_app);
void (*DisplayImage)(void *fe_context,
@ -104,10 +102,8 @@ typedef struct fe_functions {
LO_EdgeStruct *edge);
void (*FreeEmbedElement)(void *fe_context,
LO_EmbedStruct *embed);
#ifdef SHACK
void (*FreeBuiltinElement)(void *fe_context,
LO_BuiltlinStruct *builtin);
#endif
void (*HideJavaAppElement)(void *fe_context,
void *session_data);
void (*FreeImageElement)(void *fe_context,

View File

@ -50,10 +50,8 @@ extern void shim_FE_DisplaySubtext(DocumentContext context,
int32 start_pos, int32 end_pos, XP_Bool need_bg);
extern void shim_FE_DisplayEmbed(DocumentContext context,
int iLocation, LO_EmbedStruct *embed);
#ifdef SHACK
extern void shim_FE_DisplayBuiltin(DocumentContext context,
int iLocation, LO_BuiltinStruct *builtin);
#endif
extern void shim_FE_DisplayJavaApp(DocumentContext context,
int iLocation, LO_JavaAppStruct *java_app);
extern void shim_FE_DisplayImage(DocumentContext context,
@ -95,10 +93,8 @@ extern void shim_FE_FreeEdgeElement(DocumentContext context,
LO_EdgeStruct *edge);
extern void shim_FE_FreeEmbedElement(DocumentContext context,
LO_EmbedStruct *embed);
#ifdef SHACK
extern void shim_FE_FreeBuiltinElement(DocumentContext context,
LO_BuiltinStruct *builtin);
#endif
extern void shim_FE_HideJavaAppElement(DocumentContext context,
void *session_data);
extern void shim_FE_FreeImageElement(DocumentContext context,