File: miscx.c

package info (click to toggle)
xball 3.0.1-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 936 kB
  • ctags: 964
  • sloc: ansic: 4,612; sh: 3,414; makefile: 521
file content (56 lines) | stat: -rw-r--r-- 1,735 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/**********************************************************************
 * miscx.c - Misc X, Xt and Xmu related functions
 *
 * Copyright 1993, David Nedde
 *
 * Permission to use, copy, modify, and distribute this software
 * and its documentation for any purpose and without fee is granted
 * provided that the above copyright notice appears in all copies.
 * It is provided "as is" without express or implied warranty.
 **********************************************************************/

/* System Headers */
#include <X11/StringDefs.h>
#include <X11/IntrinsicP.h>
#include <X11/CoreP.h>
#include <X11/Xmu/Converters.h>


/**********************************************************************
 * setupCoverters - Setup user-defined Xt type converters.
 *
 * void setupConverters()
 *
 * Description:
 *   Sets up string to widget converter.
 **********************************************************************/
void setupConverters()
{
        static XtConvertArgRec parentCvtArgs[] = {
                {XtBaseOffset, (caddr_t)XtOffset(Widget, core.parent),
                        sizeof(Widget)}
        };

        XtAddConverter(XtRString, XtRWindow, XmuCvtStringToWidget,
                parentCvtArgs, XtNumber(parentCvtArgs));
}


/**********************************************************************
 * get_toplevel - Return the toplevel widget in the widget heirarchy.
 *
 * Widget get_toplevel(Widget w)
 *
 *
 * w - Any widget in the heirarchy
 *
 **********************************************************************/
Widget get_toplevel(w)
Widget w;
{
    /* Get the toplevel shell widget to change the cursor for all windows */
    while (!XtIsTopLevelShell( w))
        w = XtParent( w);

    return w;
}