From 9a2c14992b24f759ae00a49953a4b814df0ccd9f Mon Sep 17 00:00:00 2001 From: "radha%netscape.com" Date: Tue, 13 Oct 1998 22:22:06 +0000 Subject: [PATCH] Create compositor for images. Fix for the bugzilla bug 1017 git-svn-id: svn://10.0.0.236/trunk@12741 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/cmd/xfe/src/Image.cpp | 42 +++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/mozilla/cmd/xfe/src/Image.cpp b/mozilla/cmd/xfe/src/Image.cpp index 578ed95b849..19d7a9ce6e9 100644 --- a/mozilla/cmd/xfe/src/Image.cpp +++ b/mozilla/cmd/xfe/src/Image.cpp @@ -23,6 +23,7 @@ #include "il_util.h" +#include "xfe.h" #include "View.h" #include "Frame.h" #include "Image.h" @@ -34,9 +35,17 @@ #endif +extern "C" { +CL_Compositor * fe_create_compositor(MWContext *context); +} + + XFE_Image::XFE_Image(XFE_Component * frame, char * imageURL, fe_colormap * cmap, Widget baseWidget) { + + struct fe_MWContext_cons *cons; + // Initializations m_urlString = strdup(imageURL); completelyLoaded = False; @@ -52,7 +61,26 @@ XFE_Image::XFE_Image(XFE_Component * frame, char * imageURL, fe_colormap * cmap, // Create new context m_imageContext = XP_NewContext(); + + cons = XP_NEW_ZAP(struct fe_MWContext_cons); + if (cons == NULL) + { + XP_FREE(m_imageContext); + return; + } + + cons->context = m_imageContext; + cons->next = fe_all_MWContexts; + fe_all_MWContexts = cons; + XP_AddContextToList (m_imageContext); + fec = XP_NEW_ZAP(fe_ContextData); + if (fec == NULL) + { + XP_FREE(cons); + XP_FREE(m_imageContext); + return ; + } if (m_imageContext && fec) @@ -66,19 +94,22 @@ XFE_Image::XFE_Image(XFE_Component * frame, char * imageURL, fe_colormap * cmap, CONTEXT_DATA(m_imageContext)->ImageComplete = (ImageCompletePtr)ImageComplete; - /* - * Stolen from Frame.cpp. - */ CONTEXT_WIDGET (m_imageContext) = baseWidget; CONTEXT_DATA (m_imageContext)->drawing_area = baseWidget; CONTEXT_DATA (m_imageContext)->colormap = cmap; + if (fec == NULL) + { + XP_FREE(cons); + XP_FREE(m_imageContext); + return ; + } + fe_InitRemoteServer (XtDisplay (baseWidget)); m_imageContext->funcs = fe_BuildDisplayFunctionTable(); m_imageContext->convertPixX = m_imageContext->convertPixY = 1; m_imageContext->is_grid_cell = FALSE; m_imageContext->grid_parent = NULL; - XP_AddContextToList(m_imageContext); fe_InitIconColors(m_imageContext); // Use colors from prefs @@ -138,6 +169,9 @@ XFE_Image::XFE_Image(XFE_Component * frame, char * imageURL, fe_colormap * cmap, fe_InitColormap (m_imageContext); cxtInitSucceeded = True; + + XtRealizeWidget(baseWidget); + m_imageContext->compositor = fe_create_compositor(m_imageContext); } else {