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
24 * (c) Copyright 1993, 1994 Hewlett-Packard Company *
25 * (c) Copyright 1993, 1994 International Business Machines Corp. *
26 * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
27 * (c) Copyright 1993, 1994 Novell, Inc. *
29 /************************************<+>*************************************
30 ****************************************************************************
34 ** RCS: $XConsortium: GetEmbed.c /main/5 1996/05/20 16:09:08 drk $
35 ** Project: DT Workspace Manager
37 ** Description: Get workspace embedded clients property.
39 ** (c) Copyright 1990, 1993 by Hewlett-Packard Company
41 ****************************************************************************
42 ************************************<+>*************************************/
45 #include <X11/Xutil.h>
49 #include <Xm/AtomMgr.h>
52 /*************************************<->*************************************
54 * int _DtGetEmbeddedClients (display, root, ppEmbeddedClients,
55 * pNumEmbeddedClients)
60 * Get the contents of the _DT_WORKSPACE_EMBEDDED_CLIENTS property
61 * from a root window. This is a array of top-level windows that are
62 * embedded in the front panel of the window manager. They would
63 * not be picked up ordinarily by a session manager in a normal
64 * search for top-level windows because they are reparented to
65 * the front panel which itself is a top-level window.
71 * root - root window to get info from
72 * ppEmbeddedClients - pointer to a pointer (to be returned)
73 * pNumEmbeddedClients - pointer to a number (to be returned)
77 * *ppEmbeddedClients - pointer to a array of window IDs (top-level
78 * windows for embedded clients)
79 * (NOTE: This should be freed using XFree)
80 * *pNumEmbeddedClients- number of window IDs in array
81 * Return - Success if property fetched ok.
82 * Failure returns are from XGetWindowProperty
86 * Use XFree to free the returned data.
88 *************************************<->***********************************/
90 _DtGetEmbeddedClients(
93 Atom **ppEmbeddedClients,
94 unsigned long *pNumEmbeddedClients )
98 unsigned long leftover;
102 *ppEmbeddedClients = NULL;
103 property = XmInternAtom (display,
104 _XA_DT_WORKSPACE_EMBEDDED_CLIENTS, False);
106 if ((rcode=XGetWindowProperty(display,
117 (unsigned char **)ppEmbeddedClients))==Success)
120 if (actualType != property)
122 /* wrong type, force failure */
123 *pNumEmbeddedClients = 0;
125 if (actualType != None)
127 XFree ((char *) *ppEmbeddedClients);