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 librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* Copyright (c) 1994 FUJITSU LIMITED */
24 /* All Rights Reserved */
27 * $XConsortium: SearchResultsMgr.cc /main/5 1996/06/11 16:27:43 cde-hal $
29 * Copyright (c) 1991 HaL Computer Systems, Inc. All rights reserved.
30 * UNPUBLISHED -- rights reserved under the Copyright Laws of the United
31 * States. Use of a copyright notice is precautionary only and does not
32 * imply publication or disclosure.
34 * This software contains confidential information and trade secrets of HaL
35 * Computer Systems, Inc. Use, disclosure, or reproduction is prohibited
36 * without the prior express written permission of HaL Computer Systems, Inc.
38 * RESTRICTED RIGHTS LEGEND
39 * Use, duplication, or disclosure by the Government is subject to
40 * restrictions as set forth in subparagraph (c)(l)(ii) of the Rights in
41 * Technical Data and Computer Software clause at DFARS 252.227-7013.
42 * HaL Computer Systems, Inc.
43 * 1315 Dell Avenue, Campbell, CA 95008
51 #define C_SearchResultsMgr
54 #define C_NodeListAgent
55 #define C_SearchResultsAgent
60 LONG_LIVED_CC(SearchResultsMgr,search_results_mgr);
62 // /////////////////////////////////////////////////////////////////
64 // /////////////////////////////////////////////////////////////////
66 SearchResultsMgr::SearchResultsMgr()
71 SearchResultsMgr::~SearchResultsMgr()
73 g_search_results_mgr = NULL;
77 // /////////////////////////////////////////////////////////////////
79 // /////////////////////////////////////////////////////////////////
82 SearchResultsMgr::display (ResultID *results)
84 SearchResultsAgent *sra = get_agent();
86 // NOTE: error checking
87 // NOTE: save in f_active_agents
88 sra->display (results);
93 // /////////////////////////////////////////////////////////////////
95 // /////////////////////////////////////////////////////////////////
98 SearchResultsMgr::get_agent ()
102 // First try a non-retained visible window.
103 ale = (AgentListEntry *)
104 f_active_agents.iterate (&SearchResultsMgr::check_entry, NULL);
106 // If none are available, try the inactive list.
108 ale = (AgentListEntry *) next_inactive ();
110 // Finally, if none are available for reuse we have to create one.
113 ON_DEBUG (printf ("Creating a new results agent...take cover!\n");)
114 SearchResultsAgent *sra = new SearchResultsAgent();
116 ale = new AgentListEntry (sra);
117 sra->set_agent_list_entry (ale);
121 return ((SearchResultsAgent *) ale->agent());
125 // /////////////////////////////////////////////////////////////////
127 // /////////////////////////////////////////////////////////////////
130 SearchResultsMgr::check_entry (ListEntry *le, void *)
132 AgentListEntry *ale = (AgentListEntry *) le;
133 SearchResultsAgent *sra = (SearchResultsAgent *) ale->agent();