Skip to content
Permalink
Browse files
8239583: [AIX] simplify the native references in X input methods
Reviewed-by: clanger, itakiguchi
  • Loading branch information
mrserb committed Feb 27, 2020
1 parent fa7f53e commit 55768aa45d2b47d8a9cedb085c4279a98e23d4fc
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -183,7 +183,6 @@ static int get_next_attr(int len, unsigned long *attr);
static void draw_preedit(StatusWindow *statusWindow);
static void align_status(StatusWindow *statusWindow);
static void shrink_status(StatusWindow *statusWindow);
static GC create_gc(Window win, Bool isReverse);
static XFontSet create_fontset(void);
static Bool is_text_available(XIMText * text);
static Bool isNativeIm();
@@ -649,10 +648,12 @@ static StatusWindow *createStatusWindow(Window parent) {
XSetForeground(dpy, statusWindow->lightGC, light);
statusWindow->dimGC = XCreateGC(dpy, status, valuemask, &values);
XSetForeground(dpy, statusWindow->dimGC, dim);
statusWindow->fgGC = create_gc(status, FALSE);
statusWindow->fgGC = XCreateGC(dpy, status, valuemask, &values);
XSetForeground(dpy, statusWindow->fgGC, fg);
statusWindow->bgGC = create_gc(status, TRUE);
XSetBackground(dpy, statusWindow->fgGC, bg);
statusWindow->bgGC = XCreateGC(dpy, status, valuemask, &values);
XSetForeground(dpy, statusWindow->bgGC, bg);
XSetBackground(dpy, statusWindow->bgGC, fg);
statusWindow->status_ready = False;
wcscpy(statusWindow->status, L"");
return statusWindow;
@@ -1657,25 +1658,6 @@ static void shrink_status(StatusWindow *statusWindow)
XConfigureWindow(dpy, statusWindow->w, value_make, &xwc);
}

static GC create_gc(Window win, Bool isReverse)
{
XGCValues xgcv;
unsigned long mask;
AwtScreenDataPtr defaultScreen;

defaultScreen = getScreenData(DefaultScreen(dpy));

mask = (GCForeground | GCBackground );
if (isReverse) {
xgcv.foreground = defaultScreen->whitepixel;
xgcv.background = defaultScreen->blackpixel;
} else {
xgcv.foreground = defaultScreen->blackpixel;
xgcv.background = defaultScreen->whitepixel;
}
return XCreateGC(dpy, win, mask, &xgcv);
}

static Bool isNativeIm()
{
#define XIMMODIFIER "@im="
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -94,7 +94,6 @@ typedef struct _AwtScreenData {
typedef AwtScreenData* AwtScreenDataPtr;

extern AwtGraphicsConfigDataPtr getDefaultConfig(int screen);
extern AwtScreenDataPtr getScreenData(int screen);
#endif /* !HEADLESS */

/* allocated and initialize a structure */
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -784,11 +784,6 @@ getDefaultConfig(int screen) {
ensureConfigsInited(NULL, screen);
return x11Screens[screen].defaultConfig;
}

AwtScreenDataPtr
getScreenData(int screen) {
return &(x11Screens[screen]);
}
#endif /* !HEADLESS */

/*

0 comments on commit 55768aa

Please sign in to comment.