X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=libjava%2Fgnu%2Fgcj%2Fxlib%2FnatColormap.cc;fp=libjava%2Fgnu%2Fgcj%2Fxlib%2FnatColormap.cc;h=0000000000000000000000000000000000000000;hb=6fed43773c9b0ce596dca5686f37ac3fc0fa11c0;hp=83c897e8a17bffdc3def4d5857e4a3962fe6a2d0;hpb=27b11d56b743098deb193d510b337ba22dc52e5c;p=msp430-gcc.git diff --git a/libjava/gnu/gcj/xlib/natColormap.cc b/libjava/gnu/gcj/xlib/natColormap.cc deleted file mode 100644 index 83c897e8..00000000 --- a/libjava/gnu/gcj/xlib/natColormap.cc +++ /dev/null @@ -1,147 +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 - -jlong gnu::gcj::xlib::Colormap::allocateColorPixel(XColor* color) -{ - ::Display* dpy = (::Display*) (screen->getDisplay()->display); - ::XColor* col = (::XColor*) (color->structure); - Status result = XAllocColor(dpy, xid, col); - if (result == 0) - throw new java::lang::RuntimeException( - JvNewStringLatin1("Unable to allocate color pixel.")); - - return col->pixel; -} - -typedef JArray* xcolorarray; - -xcolorarray gnu::gcj::xlib::Colormap::getSharedColors() -{ - ::Display* dpy = (::Display*) (screen->getDisplay()->display); - unsigned int nCells = CellsOfScreen(ScreenOfDisplay(dpy, screen->screenNumber)); - - typedef ::XColor xcolor; - std::vector colors(nCells); - for (unsigned int i=0; i* shared = newXColorArray(nShared); - int si=0; - for (unsigned int i=0; istructure; - ::XColor* colStruct = reinterpret_cast(colorData); - *colStruct = colors[i]; - } - - return shared; -} - -xcolorarray gnu::gcj::xlib::Colormap::getXColors() -{ - ::Display* dpy = (::Display*) (screen->getDisplay()->display); - unsigned int nCells = - CellsOfScreen(ScreenOfDisplay(dpy, screen->screenNumber)); - - typedef ::XColor xcolor; - std::vector colors(nCells); - - JArray* colArray = newXColorArray(nCells); - - for (unsigned int i=0; istructure; - ::XColor* colStruct = reinterpret_cast(colorData); - *colStruct = colors[i]; - colStruct->flags = flag; - } - - return colArray; -} -