jdk/src/solaris/native/sun/awt/awt_p.h
author anthony
Wed, 06 May 2009 20:06:23 +0400
changeset 2760 f038acdbdf9c
parent 2758 d2fbe9b5857a
child 2807 db01a7f6d657
permissions -rw-r--r--
6838046: Rollback 6762511 due to build failure (6838003) Reviewed-by: yan
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1175
diff changeset
     2
 * Copyright 1995-2009 Sun Microsystems, Inc.  All Rights Reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 * Motif-specific data structures for AWT Java objects.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
#ifndef _AWT_P_H_
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
#define _AWT_P_H_
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
/* turn on to do event filtering */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
#define NEW_EVENT_MODEL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
/* turn on to only filter keyboard events */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
#define KEYBOARD_ONLY_EVENTS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
#include <stdarg.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
#include <stdio.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
#include <stdlib.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
#include <string.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
#include <unistd.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
#ifndef HEADLESS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
#include <X11/Intrinsic.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
#include <X11/IntrinsicP.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
#include <X11/Shell.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
#include <X11/StringDefs.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
#include <X11/Xatom.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
#include <X11/keysym.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
#include <X11/keysymdef.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
#ifndef XAWT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
#include <Xm/CascadeB.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
#include <Xm/DrawingA.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
#include <Xm/FileSB.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
#include <Xm/BulletinB.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
#include <Xm/Form.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
#include <Xm/Frame.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
#include <Xm/Label.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
#include <Xm/PushB.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
#include <Xm/PushBG.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
#include <Xm/RowColumn.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
#include <Xm/ScrollBar.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
#include <Xm/ScrolledW.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
#include <Xm/SelectioB.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
#include <Xm/SeparatoG.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
#include <Xm/ToggleB.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
#include <Xm/TextF.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
#include <Xm/Text.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
#include <Xm/List.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
#include <Xm/Xm.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
#include <Xm/MainW.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
#endif /* !HEADLESS */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
#include "awt.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
#include "awt_util.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
#include "color.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
#include "colordata.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
#include "gdefs.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
#ifndef XAWT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
#include "GLXGraphicsConfig.h"
1175
026b52c440fe 6706121: makefile: unnecessary Motif classes compilation in JDK7
yan
parents: 2
diff changeset
    82
//#include <sun_awt_motif_MComponentPeer.h>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
#ifndef HEADLESS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
#ifndef XAWT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
#include "awt_motif.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
#ifndef min
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
#define min(a,b) ((a) <= (b)? (a):(b))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
#ifndef max
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
#define max(a,b) ((a) >= (b)? (a):(b))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
extern Pixel awt_pixel_by_name(Display *dpy, char *color, char *defaultColor);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
typedef struct DropSiteInfo* DropSitePtr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
struct WidgetInfo {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
    Widget             widget;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    Widget             origin;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    void*              peer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    jlong              event_mask;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
    struct WidgetInfo* next;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
#endif /* !HEADLESS */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
#define RepaintPending_NONE     0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
#define RepaintPending_REPAINT  (1 << 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
#define RepaintPending_EXPOSE   (1 << 1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
#define LOOKUPSIZE 32
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
typedef struct _DamageRect {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
    int x1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    int y1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    int x2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
    int y2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
} DamageRect;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
#ifndef HEADLESS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
typedef struct _AwtGraphicsConfigData  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    int         awt_depth;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    Colormap    awt_cmap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    XVisualInfo awt_visInfo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    int         awt_num_colors;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
    awtImageData *awtImage;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    int         (*AwtColorMatch)(int, int, int,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
                                 struct _AwtGraphicsConfigData *);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    XImage      *monoImage;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
    Pixmap      monoPixmap;      /* Used in X11TextRenderer_md.c */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    int         monoPixmapWidth; /* Used in X11TextRenderer_md.c */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    int         monoPixmapHeight;/* Used in X11TextRenderer_md.c */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
    GC          monoPixmapGC;    /* Used in X11TextRenderer_md.c */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
    int         pixelStride;     /* Used in X11SurfaceData.c */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
    ColorData      *color_data;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    struct _GLXGraphicsConfigInfo *glxInfo;
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1175
diff changeset
   138
    int         isTranslucencySupported; /* Uses Xrender to find this out. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
} AwtGraphicsConfigData;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
typedef AwtGraphicsConfigData* AwtGraphicsConfigDataPtr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
typedef struct _AwtScreenData {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    int numConfigs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    Window root;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    unsigned long whitepixel;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
    unsigned long blackpixel;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
    AwtGraphicsConfigDataPtr defaultConfig;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    AwtGraphicsConfigDataPtr *configs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
} AwtScreenData;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
typedef AwtScreenData* AwtScreenDataPtr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
struct ComponentData {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
    Widget      widget;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    int         repaintPending;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    DamageRect  repaintRect;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
    DamageRect  exposeRect;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    DropSitePtr dsi;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
struct MessageDialogData {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    struct ComponentData        comp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
    int                 isModal;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
struct CanvasData {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
    struct ComponentData        comp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    Widget                      shell;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
    int                         flags;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
struct MenuItemData {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    struct ComponentData        comp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
    int                         index;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
struct MenuData {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
    struct ComponentData        comp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    struct MenuItemData         itemData;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
#define W_GRAVITY_INITIALIZED 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
#define W_IS_EMBEDDED 2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
struct FrameData {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
    struct CanvasData   winData;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    int                 isModal;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
    Widget              mainWindow;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    Widget              focusProxy;     /* for all key events */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
    Widget              menuBar;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    Widget              warningWindow;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    int                 top;            /* these four are the insets... */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    int                 bottom;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    int                 left;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
    int                 right;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    int                 topGuess;       /* these four are the guessed insets */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
    int                 bottomGuess;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
    int                 leftGuess;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    int                 rightGuess;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    int                 mbHeight;       /* height of the menubar window */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
    int                 wwHeight;       /* height of the warning window */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    jint                state;          /* java.awt.Frame.state bits    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
    Boolean             reparented;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    Boolean             configure_seen;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    Boolean             shellResized;   /* frame shell has been resized */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    Boolean             canvasResized;  /* frame inner canvas resized   */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    Boolean             menuBarReset;   /* frame menu bar added/removed */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    Boolean             isResizable;    /* is this window resizable ?   */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    Boolean             isFixedSizeSet; /* is fixed size already set ?  */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    Boolean             isShowing;      /* is this window now showing ? */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
    Boolean             hasTextComponentNative;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    Boolean             need_reshape;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    Boolean             callbacksAdded; /* needed for fix for 4078176   */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
    Pixmap              iconPixmap;     /* Pixmap to hold icon image    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    int                 iconWidth;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    int                 iconHeight;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    int                 imHeight;       /* imStatusBar's height         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    Boolean             imRemove;       /* ImStatusBar is being removed */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
    Boolean             fixInsets;      /* [jk] REMINDER: remove if possible */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    int                 decor;          /* type of native decorations */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
    Boolean             initialFocus;   /* does Window take focus initially */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
    Boolean             isInputMethodWindow;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
     * Fix for BugTraq ID 4060975.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
     * firstShellEH() stores to this field handle of the widget that had
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     * focus before the shell was resized so that we can later restore it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
    Widget              focusWidget;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    int screenNum;      /* Which screen this Window is on.  Xinerama-aware. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    Boolean             isDisposeScheduled;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
    Boolean             isFocusableWindow;  /* a cache of Window.isFocusableWindow() return value */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
struct ListData {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    struct ComponentData comp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
    Widget               list;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
struct TextAreaData {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
    struct ComponentData comp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    Widget               txt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
struct TextFieldData {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
    struct ComponentData comp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
    int                  echoContextID;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
    Boolean              echoContextIDInit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
struct FileDialogData {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
    struct ComponentData comp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
    char        *file;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
typedef struct awtFontList {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
    char *xlfd;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
    int index_length;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
    int load;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
    char *charset_name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
    XFontStruct *xfont;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
} awtFontList;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
struct FontData {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
    int charset_num;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
    awtFontList *flist;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
    XFontSet xfs;       /* for TextField & TextArea */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
    XFontStruct *xfont; /* Latin1 font */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
#ifndef XAWT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
extern XmFontList getMotifFontList(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
extern XFontSet getMotifFontSet(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
extern XFontStruct *getMotifFontStruct(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
extern Boolean awt_isAwtWidget(Widget widget);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
struct ChoiceData {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
    struct ComponentData comp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
    Widget               menu;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
    Widget               *items;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
    int                  maxitems;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
    int                  n_items;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
    short                n_columns;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
/* Bug 4255631 Solaris: Size returned by Choice.getSize() does not match
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
 * actual size
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
 * y and height which Choice takes in pReshape
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
*/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
    jint                 bounds_y;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
    jint                 bounds_height;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
struct MenuList {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
    Widget menu;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
    struct MenuList* next;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
extern struct FontData *awtJNI_GetFontData(JNIEnv *env,jobject font, char **errmsg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
extern AwtGraphicsConfigDataPtr getDefaultConfig(int screen);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
extern AwtScreenDataPtr getScreenData(int screen);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
#endif /* !HEADLESS */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
/* allocated and initialize a structure */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
#define ZALLOC(T)       ((struct T *)calloc(1, sizeof(struct T)))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
#ifndef HEADLESS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
#define XDISPLAY awt_display;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
extern Boolean awt_currentThreadIsPrivileged(JNIEnv *env);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
extern void null_event_handler(Widget w, XtPointer client_data,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
                        XEvent * event, Boolean * cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
extern void awt_put_back_event(JNIEnv *env, XEvent *event);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
extern void awt_MToolkit_modalWait(int (*terminateFn)(void *data), void *data);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
extern void awt_Frame_guessInsets(struct FrameData *fdata);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
extern void awt_addWidget(Widget w, Widget origin, void *peer, jlong event_mask);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
extern void awt_delWidget(Widget w);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
extern void awt_addMenuWidget(Widget w);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
extern void awt_delMenuWidget(Widget w);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
extern int awt_allocate_colors(AwtGraphicsConfigDataPtr);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
extern void awt_allocate_systemcolors(XColor *, int, AwtGraphicsConfigDataPtr);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
extern void awt_allocate_systemrgbcolors(jint *, int, AwtGraphicsConfigDataPtr);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
extern int awtJNI_GetColor(JNIEnv *, jobject);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
extern int awtJNI_GetColorForVis (JNIEnv *, jobject, AwtGraphicsConfigDataPtr);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
extern jobject awtJNI_GetColorModel(JNIEnv *, AwtGraphicsConfigDataPtr);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
extern void awtJNI_CreateColorData (JNIEnv *, AwtGraphicsConfigDataPtr, int lock);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
extern Boolean awtJNI_isSelectionOwner(JNIEnv *env, char *sel_str);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
extern void awtJNI_notifySelectionLost(JNIEnv *env, char *sel_str);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
extern void removePopupMenus();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
extern Boolean awtMenuIsActive();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
#endif /* !HEADLESS */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
extern void awtJNI_DeleteGlobalRef(JNIEnv *env,jobject thiscomp);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
extern void awtJNI_DeleteGlobalMenuRef(JNIEnv *env,jobject thismenu);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
extern jobject awtJNI_CreateAndSetGlobalRef(JNIEnv *env,jobject thiscomp);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
extern void awtJNI_CleanupGlobalRefs(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
#ifndef HEADLESS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
/* XXX: Motif internals. Need to fix 4090493. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
#define MOTIF_XmINVALID_DIMENSION       ((Dimension) 0xFFFF)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
#define MOTIF_XmDEFAULT_INDICATOR_DIM   ((Dimension) 9)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
extern Dimension awt_computeIndicatorSize(struct FontData *fdata);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
extern Dimension awt_adjustIndicatorSizeForMenu(Dimension indSize);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
#endif /* !HEADLESS */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
#endif           /* _AWT_P_H_ */