home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / cxicon.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.4 KB  |  97 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. #ifndef CXIcon_H
  20. #define CXIcon_H
  21. #include "cxdc.h"
  22. void Icon_GetUrlExitRoutine(URL_Struct *pUrl, int iStatus, MWContext *pContext);  
  23. class CXIcon;
  24.  
  25. class CCustomImageObject
  26. {
  27. public:
  28.     virtual void LoadComplete(HT_Resource r) = 0;
  29. };
  30.  
  31. struct CIconCallbackInfo
  32. {
  33.     HT_Resource pResource;
  34.     CCustomImageObject* pObject;
  35.  
  36.     CIconCallbackInfo(CCustomImageObject* pObj, HT_Resource pRes)
  37.         :pObject(pObj), pResource(pRes) {}
  38. };
  39.  
  40.  
  41. class NSNavCenterImage {
  42. public:
  43.  
  44.     char *pUrl;
  45.     BOOL m_bCompletelyLoaded;
  46.     BITMAPINFO *bmpInfo;
  47.     void XP_HUGE *bits;
  48.     void XP_HUGE *maskbits;
  49.     HDC hSubDC;
  50.     
  51.     static HBITMAP m_hBadImageBitmap;
  52.     static int refCount;
  53.     CXIcon* iconContext;
  54.     BOOL m_BadImage;
  55.  
  56.     CPtrList resourceList;
  57.     HT_Resource m_HTResource;
  58.     
  59.     NSNavCenterImage(char * pUrl, CIconCallbackInfo* iconCallbackInfo);
  60.     virtual ~NSNavCenterImage();
  61.     
  62.     void ProcessIcon();
  63.     void CompleteCallback();
  64.     BOOL CompletelyLoaded();
  65.     void DestroyContext();
  66.  
  67. };
  68.  
  69. class CXIcon : public CDCCX {
  70.  
  71. public:
  72.     CXIcon(){}
  73.     CXIcon(NSNavCenterImage* image);
  74.     virtual ~CXIcon();
  75.  
  76. private:
  77.     CPtrList imageList;
  78.     HDC m_hDC;
  79.     NI_Pixmap* m_image;
  80.     NI_Pixmap* m_mask;
  81.  
  82.     NSNavCenterImage* m_icon;
  83.  
  84. public:
  85.     virtual HDC GetContextDC() { return m_hDC; }
  86.     void SubstituteDC(HDC hdc) { m_hDC = hdc; }
  87.     virtual BOOL IsDeviceDC() { return TRUE; }
  88.     virtual HDC GetAttribDC() { return m_hDC; }
  89.     virtual BITMAPINFO *NewPixmap(NI_Pixmap *pImage, BOOL mask);
  90.     void DeleteContextDC() { DeleteDC(m_hDC); }
  91.     void ReleaseContextDC(HDC pDC) {}
  92.     virtual void ImageComplete(NI_Pixmap* image);
  93.     //    Don't display partial images.
  94.     virtual void AllConnectionsComplete(MWContext *pContext);
  95. };
  96. #endif
  97.