~ubuntu-branches/ubuntu/utopic/gridengine/utopic

« back to all changes in this revision

Viewing changes to source/3rdparty/qmon/Xmt310/Xmt/ConvertersP.h

  • Committer: Bazaar Package Importer
  • Author(s): Mark Hymers
  • Date: 2008-06-25 22:36:13 UTC
  • Revision ID: james.westby@ubuntu.com-20080625223613-tvd9xlhuoct9kyhm
Tags: upstream-6.2~beta2
ImportĀ upstreamĀ versionĀ 6.2~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
 * Motif Tools Library, Version 3.1
 
3
 * $Id$
 
4
 * 
 
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.
 
10
 *
 
11
 * $Log$
 
12
 * Revision 1.1.1.1  2001/07/18 11:06:02  root
 
13
 * Initial checkin.
 
14
 *
 
15
 * Revision 1.2  2001/06/12 16:25:28  andre
 
16
 * *** empty log message ***
 
17
 *
 
18
 *
 
19
 */
 
20
 
 
21
#ifndef _XmtConvertersP_h
 
22
#define _XmtConvertersP_h
 
23
 
 
24
#include <Xmt/Converters.h>
 
25
 
 
26
/*
 
27
 * The done() macro is used by all the Xt converters as the standard way
 
28
 * to correctly return their values.  Note that this macro requires
 
29
 * that the converter have an argument named 'to'.
 
30
 */
 
31
 
 
32
#define done(type, value)                         \
 
33
        {                                         \
 
34
            if (to->addr != NULL) {               \
 
35
                if (to->size < sizeof(type)) {    \
 
36
                    to->size = sizeof(type);      \
 
37
                    return False;                 \
 
38
                }                                 \
 
39
                *(type*)(to->addr) = (value);     \
 
40
            }                                     \
 
41
            else {                                \
 
42
                static type static_val;           \
 
43
                static_val = (value);             \
 
44
                to->addr = (XPointer)&static_val; \
 
45
            }                                     \
 
46
            to->size = sizeof(type);              \
 
47
            return True;                          \
 
48
        }
 
49
 
 
50
/*
 
51
 * an argument list that passes only the widget requesting the conversion.
 
52
 * used in a couple of places.
 
53
 */
 
54
externalref XtConvertArgRec _XmtWidgetConvertArg[];
 
55
 
 
56
/*
 
57
 * These variables are defined so that Xmt functions can call Xmt
 
58
 * converters directly, if and only if they have been registered by
 
59
 * the programmer.  We use this level of indirection so that the
 
60
 * pixmap converter doesn't automatically link in the colortable
 
61
 * converter, for example.
 
62
 */
 
63
externalref XtTypeConverter _XmtCallbackConverter;
 
64
externalref XtTypeConverter _XmtColorTableConverter;
 
65
 
 
66
_XFUNCPROTOBEGIN
 
67
/*
 
68
 * an XtConvertArgProc used in several places
 
69
 */
 
70
#if NeedFunctionPrototypes
 
71
extern void _XmtFetchColorTable(Widget, Cardinal *, XrmValue *);
 
72
extern void _XmtFetchRootWidget(Widget, Cardinal *, XrmValue *);
 
73
extern void _XmtFetchVisual(Widget, Cardinal *, XrmValue *);
 
74
#else
 
75
extern void _XmtFetchColorTable();
 
76
extern void _XmtFetchRootWidget();
 
77
extern void _XmtFetchVisual();
 
78
#endif
 
79
_XFUNCPROTOEND    
 
80
 
 
81
#endif