home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / DisplayFactory.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.4 KB  |  79 lines

  1. /* -*- Mode: C; tab-width: 8; 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.    DisplayFactory.h -- class definition for the factory class
  20.    Created: Spence Murray <spence@netscape.com>, 17-Sep-96.
  21.  */
  22.  
  23.  
  24.  
  25. #ifndef _xfe_displayfactory_h
  26. #define _xfe_displayfactory_h
  27.  
  28. #include "Frame.h"
  29. #include "xfe.h"
  30.  
  31. class XFE_DisplayFactory
  32. {
  33. public:
  34.   XFE_DisplayFactory(Widget toplevel);
  35.   virtual ~XFE_DisplayFactory();
  36.  
  37.   /* return the colormap used by the "other" windows: anything
  38.      not displaying html. In actuality, this colormap _is_
  39.      this function returns the same value every time. */
  40.   fe_colormap *getSharedColormap();
  41.  
  42.   /* return a newly allocated colormap.  This function is used
  43.      by windows that need their own colormaps (those displaying
  44.      html. */
  45.   fe_colormap *getPrivateColormap();
  46.  
  47.   /* returns the visual we want to use for this display. */
  48.   Visual *getVisual();
  49.  
  50.   /* returns the bpp of the default visual. */
  51.   int getVisualDepth();
  52.  
  53.   int getVisualPixmapDepth();
  54.  
  55.   /* use this method to get the one instance of this class. */
  56.   static XFE_DisplayFactory *theFactory();
  57.  
  58.   /* fe_DisposeColormap calls this method when it releases a colormap,
  59.      so we can set m_sharedCmap to NULL, so it'll be recreated when needed. */
  60.   void colormapGoingAway(fe_colormap *colormap);
  61.  
  62. private:
  63.   fe_colormap *m_sharedCmap;
  64.   Visual *m_visual;
  65.   int m_visualDepth;
  66.  
  67.   Widget m_toplevel;
  68.   Display *m_display;
  69.   Screen *m_screen;
  70.  
  71.   XP_Bool m_alwaysInstallCmap;
  72. };
  73.  
  74. extern "C" void fe_startDisplayFactory(Widget toplevel);
  75. extern "C" void fe_DisplayFactoryColormapGoingAway(fe_colormap *colormap);
  76. extern "C" fe_colormap * fe_GetSharedColormap(void);
  77.  
  78. #endif /* _xfe_displayfactory_h */
  79.