X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=libjava%2Fgnu%2Fgcj%2Fxlib%2FnatWindow.cc;fp=libjava%2Fgnu%2Fgcj%2Fxlib%2FnatWindow.cc;h=0000000000000000000000000000000000000000;hb=6fed43773c9b0ce596dca5686f37ac3fc0fa11c0;hp=6600795574f5809b8a0cf300051f67c6b12500d8;hpb=27b11d56b743098deb193d510b337ba22dc52e5c;p=msp430-gcc.git diff --git a/libjava/gnu/gcj/xlib/natWindow.cc b/libjava/gnu/gcj/xlib/natWindow.cc deleted file mode 100644 index 66007955..00000000 --- a/libjava/gnu/gcj/xlib/natWindow.cc +++ /dev/null @@ -1,171 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation - - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ - -// Needed to avoid linking in libstdc++ -#ifndef __STL_USE_EXCEPTIONS -# include -# define __THROW_BAD_ALLOC throw new java::lang::OutOfMemoryError() -#endif - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -jint gnu::gcj::xlib::Window::createChildXID(java::awt::Rectangle* bounds, - jint borderWidth, - WindowAttributes* attributes, - jint windowIOClass, - Visual* visual) -{ - ::Window parentXID = xid; - - int x = bounds->x; - int y = bounds->y; - int width = bounds->width; - int height = bounds->height; - - long mask = attributes->mask; - XSetWindowAttributes* attr = (XSetWindowAttributes*) - attributes->getXSetWindowAttributesStructure(); - - ::Visual* vis = CopyFromParent; - int depth = CopyFromParent; - if (visual != 0) - { - vis = (::Visual*) visual->getVisualStructure(); - depth = visual->getDepth(); - } - - ::Window childXID = XCreateWindow((::Display*) (display->display), - parentXID, - x, y, width, height, - borderWidth, depth, windowIOClass, - vis, - mask, attr); - // no fast fail - return childXID; -} - -void gnu::gcj::xlib::Window::destroy() -{ - ::Display* dpy = (::Display*) (display->display); - ::Window window = xid; - XDestroyWindow(dpy, window); - // no fast fail -} - -void gnu::gcj::xlib::Window::setAttributes(WindowAttributes* attributes) -{ - ::Display* dpy = (::Display*) (display->display); - ::Window window = xid; - ::XSetWindowAttributes* attr = (::XSetWindowAttributes*) - attributes->getXSetWindowAttributesStructure(); - - XChangeWindowAttributes(dpy, window, attributes->mask, attr); - // no fast fail -} - -void gnu::gcj::xlib::Window::map() -{ - ::Display* dpy = (::Display*) (display->display); - ::Window window = xid; - XMapWindow(dpy, window); - // no fast fail -} - -void gnu::gcj::xlib::Window::unmap() -{ - ::Display* dpy = (::Display*) (display->display); - ::Window window = xid; - XUnmapWindow(dpy, window); - // no fast fail -} - -void gnu::gcj::xlib::Window::setProperty(jint nameAtom, jint typeAtom, - jbyteArray data) -{ - ::Display* dpy = (::Display*) (display->display); - int format = 8; - int mode = PropModeReplace; - unsigned char* pData = (unsigned char*) elements(data); - int len = data->length; - - XChangeProperty(dpy, xid, nameAtom, typeAtom, format, mode, - pData, len); - // no fast fail -} - -void gnu::gcj::xlib::Window::setWMProtocols(jintArray atoms) -{ - ::Display* dpy = (::Display*) (display->display); - - size_t length = atoms->length; - jint* atomsBegin = elements(atoms); - jint* atomsEnd = atomsBegin + length; - - // Avoid confusion between Xlib.h and Atom.java "Atom" types. - typedef ::Atom XLibAtom; - - std::vector atomVector(atomsBegin, atomsEnd); - XLibAtom* atomsArray = &(atomVector.front()); - - XSetWMProtocols(dpy, xid, atomsArray, length); - // no fail fast -} - -jintArray gnu::gcj::xlib::Window::getWMProtocols() -{ - ::Display* dpy = (::Display*) (display->display); - - ::Atom* protocolsReturn; - int countReturn; - - Status success = XGetWMProtocols(dpy, xid, &protocolsReturn, - &countReturn); - - if (!success) - throw new XException(JvNewStringLatin1("cannot get " - "WM protocols ")); - - jintArray atoms; - try - { - ::Atom* protocolsBegin = protocolsReturn; - ::Atom* protocolsEnd = protocolsBegin + countReturn; - - atoms = JvNewIntArray(countReturn); - jint* atomsBegin = elements(atoms); - - std::copy(protocolsBegin, protocolsEnd, atomsBegin); - - } - catch (...) - { - XFree(protocolsReturn); - throw; - } - XFree(protocolsReturn); - - return atoms; -} - -void gnu::gcj::xlib::Window::setBounds(jint x, jint y, - jint width, jint height) -{ - ::Display* dpy = (::Display*) (display->display); - - XMoveResizeWindow(dpy, xid, x, y, width, height); - // no fast fail -}