2
* Motif Tools Library, Version 3.1
5
* Written by David Flanagan.
6
* Copyright (c) 1992-2001 by David Flanagan.
7
* All Rights Reserved. See the file COPYRIGHT for details.
8
* This is open source software. See the file LICENSE for details.
9
* There is no warranty for this software. See NO_WARRANTY for details.
12
* Revision 1.1.1.1 2001/07/18 11:06:03 root
15
* Revision 1.2 2001/06/12 16:25:28 andre
16
* *** empty log message ***
22
#include <Xmt/ScreenP.h>
23
#include <Xmt/AppResP.h>
25
#include <X11/IntrinsicP.h>
29
#if NeedFunctionPrototypes
30
static void DestroyCallback(Widget w, XtPointer tag, XtPointer data)
32
static void DestroyCallback(w, tag, data)
38
XmtPerScreenInfo *info = (XmtPerScreenInfo *)tag;
39
XmtAppResources *app = XmtGetApplicationResources(w);
41
/* remove the info structure from the per-screen hash table */
42
XmtHashTableDelete(app->screen_table, (XtPointer)XtScreen(w));
45
* Free array of dialogs.
46
* The dialogs themselves will be destroyed by whatever destroyed
49
XtFree((char *)info->help_dialog_cache.dialogs);
51
/* free the info structure itself */
56
* We cache dialogs by appshell and by screen.
57
* XXX a 2D hashtable would be nice here, so we don't do a double lookup.
59
#if NeedFunctionPrototypes
60
XmtPerScreenInfo *XmtGetPerScreenInfo(Widget w)
62
XmtPerScreenInfo *XmtGetPerScreenInfo(w)
66
XmtAppResources *app = XmtGetApplicationResources(w);
67
XmtPerScreenInfo *info;
68
Screen *screen = XtScreenOfObject(w);
72
status = XmtHashTableLookup(app->screen_table,
77
info = (XmtPerScreenInfo *) XtCalloc(1, sizeof(XmtPerScreenInfo));
79
* the info->topmost_shell field is the highest level shell on this
80
* screen within the widget hierarchy. It might be the root shell or
81
* it might not be. I assert that the algorithm below always yields
82
* a shell widget, but it doesn't really matter.
84
for(shell=NULL; w; shell = w, w = XtParent(w)) {
85
if (!XtIsWidget(w)) continue;
86
if (w->core.screen != screen) break;
89
info->topmost_shell = shell;
90
XtAddCallback(shell, XtNdestroyCallback,
91
DestroyCallback, (XtPointer) info);
92
XmtHashTableStore(app->screen_table,