2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
24 * $XConsortium: NodeDisplayDataTml.cc /main/3 1996/06/11 16:20:36 cde-hal $
26 * Copyright (c) 1992 HaL Computer Systems, Inc. All rights reserved.
27 * UNPUBLISHED -- rights reserved under the Copyright Laws of the United
28 * States. Use of a copyright notice is precautionary only and does not
29 * imply publication or disclosure.
31 * This software contains confidential information and trade secrets of HaL
32 * Computer Systems, Inc. Use, disclosure, or reproduction is prohibited
33 * without the prior express written permission of HaL Computer Systems, Inc.
35 * RESTRICTED RIGHTS LEGEND
36 * Use, duplication, or disclosure by the Government is subject to
37 * restrictions as set forth in subparagraph (c)(l)(ii) of the Rights in
38 * Technical Data and Computer Software clause at DFARS 252.227-7013.
39 * HaL Computer Systems, Inc.
40 * 1315 Dell Avenue, Campbell, CA 95008
44 #define C_NodeDisplayData
56 #include <tml/tml_objects.hxx>
59 // /////////////////////////////////////////////////////////////////
60 // the_model - return the model, creating if necessary
61 // /////////////////////////////////////////////////////////////////
64 NodeDisplayData::the_model()
67 // MUST start counting at 1!! DJB
68 static u_int next_serial = 1;
71 f_model = f_node_object.node_manager().node_parser().load (f_node_object);
72 f_model_serial = next_serial++;
75 // NOTE: error checking required
82 // /////////////////////////////////////////////////////////////////
84 // /////////////////////////////////////////////////////////////////
86 // FYI: this function could easily be extended to implement a model cache.
89 NodeDisplayData::not_displayed()
91 return; // commented out to test code below
92 // NOTE: Return for now - improves performance, but uses more memory.
93 // If you remove the return statement above you MUST tell me
94 // or user marks will break!! DJB 10/28/92
98 f_locator_table.remove_all (TRUE);
100 graphics_mgr().remove(f_node_object);
105 // /////////////////////////////////////////////////////////////////
107 // /////////////////////////////////////////////////////////////////
109 NodeDisplayData::~NodeDisplayData()
112 printf ("~~~ NodeDisplayData Destructed ~~~\n");
114 f_locator_table.remove_all (TRUE);
116 ON_DEBUG(cerr << f_node_object.locator() << endl);
118 graphics_mgr().remove(f_node_object);
123 // /////////////////////////////////////////////////////////////////
125 // /////////////////////////////////////////////////////////////////
128 NodeDisplayData::update_fonts(unsigned int serial_number)
131 // NOTE: f_font_serial number could be way less than serial_number
132 // as this could have been on the history list with no node displayed,
133 // therefore f_font_serial would not have been updated
134 // during other font changes, as the update_fonts is done only to visible
137 assert(f_font_serial <= serial_number);
139 // see if we have already dealt with this model
140 if (f_font_serial == serial_number)
143 f_font_serial = serial_number ;
146 f_model->update_fonts();