org.gnu.gdk
Class Colormap

java.lang.Object
  extended byorg.gnu.glib.GObject
      extended byorg.gnu.gdk.Colormap

public class Colormap
extends GObject

This object stores the mapping between the color values stored in memory and the RGB values that are used to display color values.


Field Summary
 
Fields inherited from class org.gnu.glib.GObject
eventsInitialized
 
Constructor Summary
Colormap()
          Create a Colormap initialized to the system's default colormap.
Colormap(Handle handle)
          Create a new Colormap from a handle to a native resource.
Colormap(Visual v, boolean allocate)
          Creates a new colormap for the given visual.
 
Method Summary
 boolean allocateColor(Color color, boolean writable, boolean bestMatch)
          Allocates a single color from a colormap.
 boolean[] allocateColors(Color[] colors, boolean writable, boolean bestMatch)
          Allocates colors from a colormap.
 void freeColors(Color[] colors)
          Frees previously allocated Colors.
protected static boolean gdk_colormap_alloc_color(Handle colormap, Handle color, boolean writable, boolean best_match)
           
protected static int gdk_colormap_alloc_colors(Handle colormap, Handle[] colors, boolean writable, boolean bestMatch, boolean[] success)
           
protected static void gdk_colormap_free_colors(Handle colormap, Handle[] colors)
           
protected static Handle gdk_colormap_get_screen(Handle colormap)
           
protected static Handle gdk_colormap_get_system()
           
protected static int gdk_colormap_get_type()
           
protected static Handle gdk_colormap_get_visual(Handle colormap)
           
protected static Handle gdk_colormap_new(Handle visual, boolean allocate)
           
protected static void gdk_colormap_query_color(Handle colormap, long pixel, Handle result)
           
 Screen getScreen()
          Returns the screen for which the colormap was created.
static Colormap getSystem()
          Returns the system's default colormap.
 Visual getVisual()
          Returns the visual for which the colormap was created.
 Color queryColor(long pixel)
          Locates the RGB color corresponding to the given hardware pixel.
 
Methods inherited from class org.gnu.glib.GObject
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addListener, equals, freezeNotify, getBooleanProperty, getData, getData, getDoubleProperty, getEventListenerClass, getEventType, getFloatProperty, getGObjectFromHandle, getHandle, getIntFromHandle, getIntProperty, getJavaObjectProperty, getLongProperty, getNullHandle, getPixbufProperty, getProperty, getStringFromHandle, getStringProperty, hashCode, hasProperty, instantiateJGObjectFromGType, notify, removeEventHandler, removeListener, retrieveGObject, setBooleanProperty, setData, setData, setDoubleProperty, setFloatProperty, setHandle, setIntProperty, setJavaObjectProperty, setLongProperty, setPixbufProperty, setProperty, setStringProperty, thawNotify
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Colormap

public Colormap()
Create a Colormap initialized to the system's default colormap.


Colormap

public Colormap(Handle handle)
Create a new Colormap from a handle to a native resource.


Colormap

public Colormap(Visual v,
                boolean allocate)
Creates a new colormap for the given visual.

Method Detail

getSystem

public static Colormap getSystem()
Returns the system's default colormap.


getVisual

public Visual getVisual()
Returns the visual for which the colormap was created.


getScreen

public Screen getScreen()
Returns the screen for which the colormap was created.


allocateColor

public boolean allocateColor(Color color,
                             boolean writable,
                             boolean bestMatch)
Allocates a single color from a colormap.

Parameters:
color - The color to allocate
writable - If true the color is allocated writable.
bestMatch - If true GDK will attempt to do matching against existing colors if the color cannot be allocated as requested.

allocateColors

public boolean[] allocateColors(Color[] colors,
                                boolean writable,
                                boolean bestMatch)
Allocates colors from a colormap.

Parameters:
colors -
writable -
bestMatch -

freeColors

public void freeColors(Color[] colors)
Frees previously allocated Colors.

Parameters:
colors -

queryColor

public Color queryColor(long pixel)
Locates the RGB color corresponding to the given hardware pixel. The pixel must be a valid pixel in the colormap.

Parameters:
pixel -

gdk_colormap_get_type

protected static final int gdk_colormap_get_type()

gdk_colormap_new

protected static final Handle gdk_colormap_new(Handle visual,
                                               boolean allocate)

gdk_colormap_get_system

protected static final Handle gdk_colormap_get_system()

gdk_colormap_alloc_colors

protected static final int gdk_colormap_alloc_colors(Handle colormap,
                                                     Handle[] colors,
                                                     boolean writable,
                                                     boolean bestMatch,
                                                     boolean[] success)

gdk_colormap_alloc_color

protected static final boolean gdk_colormap_alloc_color(Handle colormap,
                                                        Handle color,
                                                        boolean writable,
                                                        boolean best_match)

gdk_colormap_free_colors

protected static final void gdk_colormap_free_colors(Handle colormap,
                                                     Handle[] colors)

gdk_colormap_query_color

protected static final void gdk_colormap_query_color(Handle colormap,
                                                     long pixel,
                                                     Handle result)

gdk_colormap_get_visual

protected static final Handle gdk_colormap_get_visual(Handle colormap)

gdk_colormap_get_screen

protected static final Handle gdk_colormap_get_screen(Handle colormap)