gdkcc-win32.c File Reference

#include "config.h"
#include <stdlib.h>
#include <string.h>
#include "gdkcc.h"
#include "gdkcolor.h"
#include "gdkwin32.h"

Go to the source code of this file.

Classes

struct  _GdkColorContextPrivate

Defines

#define MAX_IMAGE_COLORS   256

Typedefs

typedef _GdkColorContextPrivate GdkColorContextPrivate

Functions

static guint hash_color (gconstpointer key)
static gint compare_colors (gconstpointer a, gconstpointer b)
static void free_hash_entry (gpointer key, gpointer value, gpointer user_data)
static int pixel_sort (const void *a, const void *b)
static void my_x_query_colors (GdkColormap *colormap, GdkColor *colors, gint ncolors)
static void query_colors (GdkColorContext *cc)
static void init_bw (GdkColorContext *cc)
static void init_gray (GdkColorContext *cc)
static void init_color (GdkColorContext *cc)
static void init_true_color (GdkColorContext *cc)
static void init_palette (GdkColorContext *cc)
GdkColorContextgdk_color_context_new (GdkVisual *visual, GdkColormap *colormap)
GdkColorContextgdk_color_context_new_mono (GdkVisual *visual, GdkColormap *colormap)
void gdk_color_context_free (GdkColorContext *cc)
gulong gdk_color_context_get_pixel (GdkColorContext *cc, gushort red, gushort green, gushort blue, gint *failed)
void gdk_color_context_get_pixels (GdkColorContext *cc, gushort *reds, gushort *greens, gushort *blues, gint ncolors, gulong *colors, gint *nallocated)
void gdk_color_context_get_pixels_incremental (GdkColorContext *cc, gushort *reds, gushort *greens, gushort *blues, gint ncolors, gint *used, gulong *colors, gint *nallocated)
gint gdk_color_context_query_color (GdkColorContext *cc, GdkColor *color)
gint gdk_color_context_query_colors (GdkColorContext *cc, GdkColor *colors, gint num_colors)
gint gdk_color_context_add_palette (GdkColorContext *cc, GdkColor *palette, gint num_palette)
void gdk_color_context_init_dither (GdkColorContext *cc)
void gdk_color_context_free_dither (GdkColorContext *cc)
gulong gdk_color_context_get_pixel_from_palette (GdkColorContext *cc, gushort *red, gushort *green, gushort *blue, gint *failed)
guchar gdk_color_context_get_index_from_palette (GdkColorContext *cc, gint *red, gint *green, gint *blue, gint *failed)


Define Documentation

#define MAX_IMAGE_COLORS   256

Definition at line 72 of file gdkcc-win32.c.

Referenced by gdk_color_context_get_pixels(), and gdk_color_context_get_pixels_incremental().


Typedef Documentation

typedef struct _GdkColorContextPrivate GdkColorContextPrivate

Definition at line 74 of file gdkcc-win32.c.


Function Documentation

static gint compare_colors ( gconstpointer  a,
gconstpointer  b 
) [static]

Definition at line 89 of file gdkcc-win32.c.

References _GdkColor::blue, _GdkColor::green, and _GdkColor::red.

Referenced by gdk_color_context_get_pixel(), and init_palette().

static void free_hash_entry ( gpointer  key,
gpointer  value,
gpointer  user_data 
) [static]

Definition at line 99 of file gdkcc-win32.c.

References g_free().

Referenced by gdk_color_context_add_palette(), and init_palette().

gint gdk_color_context_add_palette ( GdkColorContext cc,
GdkColor palette,
gint  num_palette 
)

Definition at line 1301 of file gdkcc-win32.c.

References b, _GdkColor::blue, _GdkColorContext::color_hash, _GdkColorContext::fast_dither, free_hash_entry(), g, g_assert, g_hash_table_destroy(), g_hash_table_foreach(), g_new0, g_realloc(), GDK_CC_MODE_PALETTE, gdk_color_context_get_pixels(), _GdkColor::green, i, init_palette(), j, _GdkColorContext::mode, NULL, _GdkColorContext::num_palette, _GdkColorContext::palette, palette, _GdkColor::pixel, pixel_sort(), and _GdkColor::red.

void gdk_color_context_free ( GdkColorContext cc  ) 

Definition at line 514 of file gdkcc-win32.c.

References _GdkColorContext::clut, _GdkColorContext::cmap, _GdkColorContext::colormap, g_assert, g_free(), gdk_colormap_unref(), gdk_colors_free(), GDK_VISUAL_PSEUDO_COLOR, GDK_VISUAL_STATIC_COLOR, init_palette(), _GdkColorContext::need_to_free_colormap, NULL, _GdkColorContext::num_allocated, _GdkColorContext::num_colors, _GdkVisual::type, and _GdkColorContext::visual.

Referenced by TGWin32::ImgPickPalette(), TGWin32::MakeOpaqueColors(), TGWin32::QueryColor(), and TGWin32::QueryColors().

void gdk_color_context_free_dither ( GdkColorContext cc  ) 

Definition at line 1414 of file gdkcc-win32.c.

References _GdkColorContext::fast_dither, g_assert, g_free(), and NULL.

guchar gdk_color_context_get_index_from_palette ( GdkColorContext cc,
gint red,
gint green,
gint blue,
gint failed 
)

Definition at line 1478 of file gdkcc-win32.c.

References _GdkColor::blue, dr, FALSE, g_assert, _GdkColor::green, i, if(), j, NULL, _GdkColorContext::num_palette, _GdkColorContext::palette, _GdkColor::red, and TRUE.

Referenced by gdk_color_context_init_dither().

gulong gdk_color_context_get_pixel ( GdkColorContext cc,
gushort  red,
gushort  green,
gushort  blue,
gint failed 
)

Definition at line 541 of file gdkcc-win32.c.

References XStandardColormap::base_pixel, _GdkColorContext::bits, _GdkColorContext::black_pixel, _GdkColorContext::blue, XStandardColormap::blue_max, XStandardColormap::blue_mult, _GdkColorContext::clut, _GdkColorContext::color_hash, _GdkColorContext::colormap, compare_colors(), FALSE, g_assert, g_hash_table_insert(), g_hash_table_lookup(), g_hash_table_new(), g_message(), g_new, g_realloc(), GDK_CC_MODE_BW, GDK_CC_MODE_MY_GRAY, GDK_CC_MODE_PALETTE, GDK_CC_MODE_STD_CMAP, GDK_CC_MODE_TRUE, gdk_color_alloc(), gdk_color_context_get_pixel_from_palette(), GDK_NOTE, _GdkColorContext::green, XStandardColormap::green_max, XStandardColormap::green_mult, hash_color(), if(), _GdkColorContext::masks, _GdkColorContext::max_colors, _GdkColorContext::max_entry, _GdkColorContext::mode, NULL, _GdkColorContext::num_allocated, _GdkColorContext::red, XStandardColormap::red_max, XStandardColormap::red_mult, result(), _GdkColorContext::shifts, _GdkColorContextPrivate::std_cmap, TRUE, value, and _GdkColorContext::white_pixel.

Referenced by gdk_color_context_get_pixels(), and gdk_color_context_get_pixels_incremental().

gulong gdk_color_context_get_pixel_from_palette ( GdkColorContext cc,
gushort red,
gushort green,
gushort blue,
gint failed 
)

Definition at line 1425 of file gdkcc-win32.c.

References ABS, _GdkColor::blue, dr, FALSE, g_assert, _GdkColor::green, i, if(), j, NULL, _GdkColorContext::num_palette, _GdkColorContext::palette, _GdkColor::pixel, _GdkColor::red, and TRUE.

Referenced by gdk_color_context_get_pixel().

void gdk_color_context_get_pixels ( GdkColorContext cc,
gushort reds,
gushort greens,
gushort blues,
gint  ncolors,
gulong colors,
gint nallocated 
)

Definition at line 700 of file gdkcc-win32.c.

References _GdkColorContext::black_pixel, _GdkColor::blue, close, _GdkColorContext::colormap, d, FALSE, g_assert, g_message(), g_warning(), gdk_color_context_get_pixel(), GDK_NOTE, _GdkColor::green, i, j, k, MAX_IMAGE_COLORS, MIN, my_x_query_colors(), NULL, _GdkColorContext::num_allocated, _GdkColorContext::num_colors, _GdkColor::pixel, _GdkColor::red, and red.

Referenced by gdk_color_context_add_palette().

void gdk_color_context_get_pixels_incremental ( GdkColorContext cc,
gushort reds,
gushort greens,
gushort blues,
gint  ncolors,
gint used,
gulong colors,
gint nallocated 
)

Definition at line 959 of file gdkcc-win32.c.

References _GdkColorContext::black_pixel, _GdkColor::blue, close, _GdkColorContext::colormap, d, FALSE, g_assert, g_message(), g_warning(), gdk_color_context_get_pixel(), GDK_NOTE, _GdkColor::green, i, j, k, MAX_IMAGE_COLORS, MIN, my_x_query_colors(), NULL, _GdkColorContext::num_allocated, _GdkColorContext::num_colors, _GdkColor::pixel, _GdkColor::red, and red.

void gdk_color_context_init_dither ( GdkColorContext cc  ) 

Definition at line 1383 of file gdkcc-win32.c.

References FALSE, _GdkColorContext::fast_dither, _GdkColorContextDither::fast_erb, _GdkColorContextDither::fast_erg, _GdkColorContextDither::fast_err, _GdkColorContextDither::fast_rgb, g_assert, g_new, gdk_color_context_get_index_from_palette(), NULL, and Rgl::rr.

GdkColorContext* gdk_color_context_new ( GdkVisual visual,
GdkColormap colormap 
)

Definition at line 378 of file gdkcc-win32.c.

References _GdkColorContext::clut, _GdkColorContext::cmap, _GdkColorContext::color_hash, _GdkColorContext::colormap, default_colormap(), _GdkVisual::depth, FALSE, _GdkColorContext::fast_dither, g_assert, g_assert_not_reached, g_message(), g_new, g_warning(), GDK_CC_MODE_BW, GDK_CC_MODE_UNDEFINED, gdk_colormap_get_system(), gdk_colormap_new(), GDK_COLORMAP_WIN32COLORMAP, GDK_NOTE, gdk_visual_get_system(), GDK_VISUAL_GRAYSCALE, GDK_VISUAL_PSEUDO_COLOR, GDK_VISUAL_STATIC_COLOR, GDK_VISUAL_STATIC_GRAY, GDK_VISUAL_TRUE_COLOR, GDK_VISUAL_XVISUAL, init_bw(), init_color(), init_gray(), init_true_color(), _GdkColorContext::mode, _GdkColorContext::need_to_free_colormap, NULL, _GdkColorContext::num_allocated, _GdkColorContext::num_colors, _GdkColorContext::num_palette, _GdkColorContext::palette, TRUE, _GdkVisual::type, and _GdkColorContext::visual.

Referenced by TGWin32::ImgPickPalette(), TGWin32::MakeOpaqueColors(), TGWin32::QueryColor(), and TGWin32::QueryColors().

GdkColorContext* gdk_color_context_new_mono ( GdkVisual visual,
GdkColormap colormap 
)

Definition at line 489 of file gdkcc-win32.c.

References _GdkColorContext::clut, _GdkColorContext::cmap, _GdkColorContext::colormap, FALSE, g_assert, g_new, GDK_CC_MODE_UNDEFINED, init_bw(), _GdkColorContext::mode, _GdkColorContext::need_to_free_colormap, NULL, and _GdkColorContext::visual.

gint gdk_color_context_query_color ( GdkColorContext cc,
GdkColor color 
)

Definition at line 1207 of file gdkcc-win32.c.

References gdk_color_context_query_colors().

Referenced by TGWin32::QueryColor().

gint gdk_color_context_query_colors ( GdkColorContext cc,
GdkColor colors,
gint  num_colors 
)

Definition at line 1213 of file gdkcc-win32.c.

References bits, _GdkColorContext::bits, _GdkColor::blue, blue, _GdkColorContext::blue, _GdkVisual::blue_prec, _GdkColorContext::clut, _GdkColorContext::cmap, _GdkColorContext::colormap, colors, for(), g_assert, GDK_CC_MODE_BW, GDK_CC_MODE_STD_CMAP, GDK_CC_MODE_TRUE, green, _GdkColorContext::green, _GdkColor::green, _GdkVisual::green_prec, i, _GdkColorContext::masks, _GdkColorContext::mode, my_x_query_colors(), NULL, _GdkColorContext::num_colors, _GdkColor::pixel, _GdkColor::red, red, _GdkColorContext::red, _GdkVisual::red_prec, _GdkColorContext::shifts, _GdkColorContext::visual, and _GdkColorContext::white_pixel.

Referenced by gdk_color_context_query_color(), TGWin32::ImgPickPalette(), TGWin32::MakeOpaqueColors(), and TGWin32::QueryColors().

static guint hash_color ( gconstpointer  key  )  [static]

Definition at line 81 of file gdkcc-win32.c.

Referenced by gdk_color_context_get_pixel(), and init_palette().

static void init_bw ( GdkColorContext cc  )  [static]

Definition at line 140 of file gdkcc-win32.c.

References _GdkColorContext::black_pixel, _GdkColorContext::colormap, g_warning(), GDK_CC_MODE_BW, gdk_color_alloc(), _GdkColorContext::mode, _GdkColorContext::num_colors, and _GdkColorContext::white_pixel.

Referenced by gdk_color_context_new(), gdk_color_context_new_mono(), and init_gray().

static void init_color ( GdkColorContext cc  )  [static]

Definition at line 226 of file gdkcc-win32.c.

References XStandardColormap::base_pixel, _GdkColorContext::black_pixel, XStandardColormap::blue_max, XStandardColormap::blue_mult, _GdkColorContext::clut, g_new, GDK_CC_MODE_STD_CMAP, GDK_VISUAL_XVISUAL, XStandardColormap::green_max, XStandardColormap::green_mult, _GdkColorContext::max_colors, _GdkColorContext::num_colors, query_colors(), XStandardColormap::red_max, XStandardColormap::red_mult, _GdkColorContextPrivate::std_cmap, _GdkColorContext::visual, and _GdkColorContext::white_pixel.

Referenced by gdk_color_context_new().

static void init_gray ( GdkColorContext cc  )  [static]

Definition at line 166 of file gdkcc-win32.c.

References _GdkColor::blue, _GdkColorContext::clut, _GdkColorContext::colormap, g_free(), g_new, gdk_color_alloc(), gdk_colors_free(), _GdkColor::green, i, if(), init_bw(), NULL, _GdkColorContext::num_colors, and _GdkColor::red.

Referenced by gdk_color_context_new().

static void init_palette ( GdkColorContext cc  )  [static]

Definition at line 330 of file gdkcc-win32.c.

References _GdkColorContext::color_hash, compare_colors(), _GdkColorContext::fast_dither, free_hash_entry(), g_free(), g_hash_table_destroy(), g_hash_table_foreach(), g_hash_table_new(), GDK_CC_MODE_BW, GDK_CC_MODE_MY_GRAY, GDK_CC_MODE_STD_CMAP, GDK_CC_MODE_TRUE, GDK_CC_MODE_UNDEFINED, GDK_VISUAL_GRAYSCALE, GDK_VISUAL_PSEUDO_COLOR, GDK_VISUAL_STATIC_COLOR, GDK_VISUAL_STATIC_GRAY, GDK_VISUAL_TRUE_COLOR, GDK_VISUAL_XVISUAL, hash_color(), _GdkColorContext::mode, NULL, _GdkColorContext::num_palette, _GdkColorContext::palette, _GdkVisual::type, and _GdkColorContext::visual.

Referenced by gdk_color_context_add_palette(), and gdk_color_context_free().

static void init_true_color ( GdkColorContext cc  )  [static]

Definition at line 264 of file gdkcc-win32.c.

References _GdkColorContext::bits, _GdkColorContext::black_pixel, _GdkColorContext::blue, _GdkVisual::blue_mask, bmask, GDK_CC_MODE_TRUE, _GdkColorContext::green, _GdkVisual::green_mask, _GdkColorContext::masks, _GdkColorContext::mode, _GdkColorContext::num_colors, _GdkColorContext::red, _GdkVisual::red_mask, _GdkColorContext::shifts, _GdkColorContext::visual, and _GdkColorContext::white_pixel.

Referenced by gdk_color_context_new().

static void my_x_query_colors ( GdkColormap colormap,
GdkColor colors,
gint  ncolors 
) [static]

Definition at line 110 of file gdkcc-win32.c.

References COLOR_::blue, colors, GDK_COLORMAP_WIN32COLORMAP, COLOR_::green, i, palette, and COLOR_::red.

Referenced by gdk_color_context_get_pixels(), gdk_color_context_get_pixels_incremental(), gdk_color_context_query_colors(), and query_colors().

static int pixel_sort ( const void *  a,
const void *  b 
) [static]

Definition at line 104 of file gdkcc-win32.c.

Referenced by gdk_color_context_add_palette(), and query_colors().

static void query_colors ( GdkColorContext cc  )  [static]

Definition at line 125 of file gdkcc-win32.c.

References XStandardColormap::base_pixel, _GdkColorContext::clut, _GdkColorContext::cmap, _GdkColorContext::colormap, g_new, i, my_x_query_colors(), _GdkColorContext::num_colors, _GdkColor::pixel, pixel_sort(), and _GdkColorContextPrivate::std_cmap.

Referenced by init_color().


Generated on Tue Jul 5 15:58:42 2011 for ROOT_528-00b_version by  doxygen 1.5.1