home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / macfe / central / mimages.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.3 KB  |  96 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. #pragma once
  20.  
  21. #include "ntypes.h"
  22. #include "structs.h"
  23. #include "cstring.h"
  24. #include "Netscape_Constants.h"
  25. #include "libimg.h"
  26.  
  27. class CBrowserContext;
  28.  
  29. XP_BEGIN_PROTOS
  30.  
  31.  
  32. void    ImageGroupObserver(XP_Observable observable,
  33.             XP_ObservableMsg message,
  34.             void* message_data,
  35.             void* closure);
  36.  
  37. /*
  38.  * Macros that are here for historic reasons
  39.  */
  40. #define TRUNC_TO_MAX(LVALUE,MAX)    ((LVALUE > MAX)? (LVALUE = MAX): LVALUE)
  41. #define TRUNC_TO_MIN(LVALUE,MAX)    ((LVALUE > MAX)? (LVALUE = MAX): LVALUE)
  42.  
  43.  
  44. /*
  45.  * High Level FE Palette Management
  46.  */
  47. void        CreateImageContext (
  48.                     MWContext *            context );
  49.  
  50. void        DestroyImageContext (
  51.                     MWContext *            context );
  52.  
  53. void        SetImageContextBackgroundColor (
  54.                     MWContext *            context,
  55.                     Uint8                 inRed,
  56.                     Uint8                inGreen,
  57.                     Uint8                 inBlue);
  58.  
  59. GDHandle    GetDeepestDevice (
  60.                     void );
  61.  
  62. Boolean        VerifyDisplayContextColorSpace (
  63.                     MWContext * context );
  64.                     
  65.  
  66. /*
  67.  * High level FE functions for image management.
  68.  */
  69. EClickKind    FindImagePart (
  70.                     MWContext *            context,
  71.                     LO_ImageStruct *    image,
  72.                     SPoint32 *            where,
  73.                     cstring *            url,
  74.                     cstring *            target,
  75.                     LO_AnchorData * &        anchor );
  76.                             
  77. BOOL        IsImageComplete (
  78.                     LO_ImageStruct *    image );
  79.  
  80. PicHandle    ConvertImageElementToPICT(
  81.                     LO_ImageStruct *    inElement);
  82.  
  83. cstring        GetURLFromImageElement(
  84.                     CBrowserContext *        inOwningContext,
  85.                     LO_ImageStruct *    inElement);
  86.  
  87.  
  88. /*
  89.  * Inline Utilities
  90.  */
  91. inline short GetDepth (GDHandle h) {
  92.     return (* (*h)->gdPMap)->pixelSize;
  93. }
  94.  
  95. XP_END_PROTOS
  96.