if (XP_STRNCASECMP (tptr->lo_embed.value_list[0], "builtin/", 8) == 0) { is_window = PR_TRUE; } #endif
case LO_BUILTIN: name = "_BUILTIN"; tptr->lo_builtin.ele_attrmask |= LO_ELE_INVISIBLE; vspace = tptr->lo_builtin.border_vert_space; hspace = tptr->lo_builtin.border_horiz_space; is_window = PR_TRUE;
lo_CreateEmbeddedObjectLayer(MWContext *context,                             lo_DocState *state, LO_Element *tptr){    PRBool is_window;    LO_Any *any = &tptr->lo_any;    CL_Layer *layer, *parent_layer, *doc_layer;    char *name;    XP_Rect bbox;    lo_EmbeddedObjectClosure *closure;    CL_LayerVTable vtable;    int vspace, hspace;    int32 layer_x_offset, layer_y_offset;    /* Layer is initially hidden, until lo_DisplayWhatever is called. */    uint32 flags = CL_DONT_ENUMERATE | CL_HIDDEN;    if (! context->compositor)        return NULL;    /* These types of elements aren't truly layers (they're embedded       windows), so we can't hide them directly through the layer API.       We need to set a flag so that the FE knows not to draw the       window initially. */    switch (tptr->type) {    case LO_FORM_ELE:	name = "_FORM_ELEMENT";	tptr->lo_form.ele_attrmask  |= LO_ELE_INVISIBLE;	vspace = tptr->lo_form.border_vert_space;	hspace = tptr->lo_form.border_horiz_space;	is_window = PR_TRUE;	break;    case LO_EMBED:	name = "_PLUGIN";	tptr->lo_embed.ele_attrmask |= LO_ELE_INVISIBLE;	/* We don't commit to the type of a plugin layer until	   it's known whether or not the plugin is windowless. */	vspace = tptr->lo_embed.border_vert_space;	hspace = tptr->lo_embed.border_horiz_space;	is_window = PR_FALSE;#ifdef SHACK	if (XP_STRNCASECMP (tptr->lo_embed.value_list[0], "builtin/", 8) == 0) {		is_window = PR_TRUE;	}#endif /* SHACK */	break;#ifdef JAVA    case LO_JAVA:	name = "_JAVA_APPLET";	tptr->lo_java.ele_attrmask  |= LO_ELE_INVISIBLE;	vspace = tptr->lo_java.border_vert_space;	hspace = tptr->lo_java.border_horiz_space;	is_window = PR_TRUE;	break;#endif    default:	XP_ASSERT(0);	return NULL;    }    /* The layer is the size of the layout element.     (For a plugin, this may not *really* reflect the size of the element,     but it will get resized later.) */    layer_x_offset = any->x + any->x_offset + hspace;    layer_y_offset = any->y + any->y_offset + vspace;    bbox.left   = 0;    bbox.top    = 0;    bbox.right  = any->width  - 2 * hspace;    bbox.bottom = any->height - 2 * vspace;        closure = XP_NEW_ZAP(lo_EmbeddedObjectClosure);    closure->type = LO_EMBEDDED_OBJECT_LAYER;    closure->context = context;    closure->element = tptr;    XP_BZERO(&vtable, sizeof(CL_LayerVTable));        if (is_window) {        if (context->type != MWContextPrint)            flags |= CL_CUTOUT;        closure->is_windowed = PR_TRUE;    }    vtable.visibility_changed_func = lo_window_layer_visibility_changed;    vtable.position_changed_func = lo_window_layer_position_changed;    vtable.destroy_func = (CL_DestroyFunc)lo_html_destroy_func;    if (context->type == MWContextPrint)        vtable.painter_func = (CL_PainterFunc)lo_embedded_object_painter_func;    layer = CL_NewLayer(name, layer_x_offset, layer_y_offset,						&bbox, &vtable, flags, (void *)closure);    /*     * XXX I don't really like this. For embeds that     * are part of the _BASE layer, we need to special case     * the parent layer of the embed layer, since     * the _DOCUMENT layer (and not the _BASE layer) is on     * the layer stack.     * This code exists for cell bg creation, too.     */    doc_layer = CL_GetCompositorRoot(context->compositor);    parent_layer = lo_CurrentLayer(state);    if (parent_layer == doc_layer) {        lo_TopState *top_state = lo_get_layer_top_state(layer);        parent_layer = top_state->body_layer;    }    XP_ASSERT(parent_layer);	if (parent_layer)  	    CL_InsertChildByZ(parent_layer, layer, Z_CONTENT_LAYERS);    return layer;}