2 * $XConsortium: PixmapGraphic.hh /main/5 1996/09/06 15:32:15 cde-hal $
4 * Copyright (c) 1992 HaL Computer Systems, Inc. All rights reserved.
5 * UNPUBLISHED -- rights reserved under the Copyright Laws of the United
6 * States. Use of a copyright notice is precautionary only and does not
7 * imply publication or disclosure.
9 * This software contains confidential information and trade secrets of HaL
10 * Computer Systems, Inc. Use, disclosure, or reproduction is prohibited
11 * without the prior express written permission of HaL Computer Systems, Inc.
13 * RESTRICTED RIGHTS LEGEND
14 * Use, duplication, or disclosure by the Government is subject to
15 * restrictions as set forth in subparagraph (c)(l)(ii) of the Rights in
16 * Technical Data and Computer Software clause at DFARS 252.227-7013.
17 * HaL Computer Systems, Inc.
18 * 1315 Dell Avenue, Campbell, CA 95008
23 // #include "Managers/GraphicsMgr.hh"
27 class GraphicsHandler ;
31 #include <X11/Intrinsic.h>
33 #include <DtI/GraphicsP.h>
36 // Message Classed for informing ViewportAgents about attaching and detaching
41 GraphicsMessage( UAS_Pointer<Graphic> &gr )
45 UAS_Pointer<Graphic> &graphic()
46 { return f_graphic ; }
49 UAS_Pointer<Graphic> f_graphic ;
52 class DetachGraphic : public GraphicsMessage
55 DetachGraphic(UAS_Pointer<Graphic> &gr,
57 : GraphicsMessage(gr),
61 GraphicAgent *agent() { return f_graphic_agent ; }
64 GraphicAgent *f_graphic_agent ;
67 class ReAttachGraphic : public GraphicsMessage
71 ReAttachGraphic( UAS_Pointer<Graphic> &gr)
79 DisplayGraphic( UAS_Pointer<Graphic> &g)
82 UAS_Pointer<Graphic> &graphic() { return f_graphic ;}
84 UAS_Pointer<Graphic> f_graphic ;
87 class PixmapGraphic : public UAS_Sender<DetachGraphic>,
88 public UAS_Sender<ReAttachGraphic>
91 enum PixmapFlag { NORMAL, DETACHED_PIXMAP, DEFAULT_PIXMAP, PRESERVE } ;
93 PixmapGraphic (Pixmap pixmap,
94 Dimension width, Dimension height,
97 virtual ~PixmapGraphic();
99 void set_colormap( Colormap, int, Pixel *, _DtGrContext * );
101 virtual bool isPostScriptGraphic() const { return FALSE ; }
103 // member access functions
104 Pixmap pixmap() const
107 Dimension width() const
110 Dimension height() const
115 bool is_detached() const { return f_flag == DETACHED_PIXMAP ; }
117 void set_type(PixmapFlag f) { f_flag = f ; }
119 void register_handler(GraphicsHandler *);
121 GraphicAgent *agent() { return f_agent; }
122 GraphicAgent *agent(GraphicAgent *agent)
123 { f_agent = agent ; return agent; }
127 PixmapGraphic(const PixmapGraphic *);
129 protected: // variables
134 GraphicAgent *f_agent ;
136 // colormap info allocated for the above f_pixmap:
137 Colormap f_colormap; // containing colormap
138 int f_num_colors; // num colors allocated
139 Pixel *f_colors; // colors allocated
140 _DtGrContext *f_tiff_context; // colors if tiff type graphic