Commit c50941c8 authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist

Change GDK_WINDOWING_WIN32 usage to #ifdef also here.

1999-10-03  Tor Lillqvist  <tml@iki.fi>

* gdk/gdkimage.h gdk/gdkpixmap.h: Change GDK_WINDOWING_WIN32 usage
to #ifdef also here.

* gdk/win32/*.h gdk/win32/*.c: Make corresponding changes as those
Owen did to the X11 backend.

* gdk/win32/gdkdraw.c (gdk_draw_pixmap): Fix it again, don't use
ScrollWindowEx when blitting inside a window, it can't be correct
in the general case.

* gdk/win32/gdkevents.c: Don't handle WM_SIZING, handling
WM_GETMINMAXINFO is easier.

* gdk/win32/gdkimage.c (gdk_image_new): Create new image with
depth equal to the bitspixel value, not the visual's depth.

* gdk/win32/gdkvisual.c (gdk_visual_init): Set the visual's depth
to 24 even if the bitspixel value is 32.

* gdk/gdkrgb.c (gdk_rgb_select_conv): After the above change, no
need to check for depth==32 when bpp==32, depth will always be 24.
parent b196167d
1999-10-03 Tor Lillqvist <tml@iki.fi>
* gdk/gdkimage.h gdk/gdkpixmap.h: Change GDK_WINDOWING_WIN32 usage
to #ifdef also here.
* gdk/win32/*.h gdk/win32/*.c: Make corresponding changes as those
Owen did to the X11 backend.
* gdk/win32/gdkdraw.c (gdk_draw_pixmap): Fix it again, don't use
ScrollWindowEx when blitting inside a window, it can't be correct
in the general case.
* gdk/win32/gdkevents.c: Don't handle WM_SIZING, handling
WM_GETMINMAXINFO is easier.
* gdk/win32/gdkimage.c (gdk_image_new): Create new image with
depth equal to the bitspixel value, not the visual's depth.
* gdk/win32/gdkvisual.c (gdk_visual_init): Set the visual's depth
to 24 even if the bitspixel value is 32.
* gdk/gdkrgb.c (gdk_rgb_select_conv): After the above change, no
need to check for depth==32 when bpp==32, depth will always be 24.
Fri Oct 1 18:03:36 1999 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.4.txt: Started
......
1999-10-03 Tor Lillqvist <tml@iki.fi>
* gdk/gdkimage.h gdk/gdkpixmap.h: Change GDK_WINDOWING_WIN32 usage
to #ifdef also here.
* gdk/win32/*.h gdk/win32/*.c: Make corresponding changes as those
Owen did to the X11 backend.
* gdk/win32/gdkdraw.c (gdk_draw_pixmap): Fix it again, don't use
ScrollWindowEx when blitting inside a window, it can't be correct
in the general case.
* gdk/win32/gdkevents.c: Don't handle WM_SIZING, handling
WM_GETMINMAXINFO is easier.
* gdk/win32/gdkimage.c (gdk_image_new): Create new image with
depth equal to the bitspixel value, not the visual's depth.
* gdk/win32/gdkvisual.c (gdk_visual_init): Set the visual's depth
to 24 even if the bitspixel value is 32.
* gdk/gdkrgb.c (gdk_rgb_select_conv): After the above change, no
need to check for depth==32 when bpp==32, depth will always be 24.
Fri Oct 1 18:03:36 1999 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.4.txt: Started
......
1999-10-03 Tor Lillqvist <tml@iki.fi>
* gdk/gdkimage.h gdk/gdkpixmap.h: Change GDK_WINDOWING_WIN32 usage
to #ifdef also here.
* gdk/win32/*.h gdk/win32/*.c: Make corresponding changes as those
Owen did to the X11 backend.
* gdk/win32/gdkdraw.c (gdk_draw_pixmap): Fix it again, don't use
ScrollWindowEx when blitting inside a window, it can't be correct
in the general case.
* gdk/win32/gdkevents.c: Don't handle WM_SIZING, handling
WM_GETMINMAXINFO is easier.
* gdk/win32/gdkimage.c (gdk_image_new): Create new image with
depth equal to the bitspixel value, not the visual's depth.
* gdk/win32/gdkvisual.c (gdk_visual_init): Set the visual's depth
to 24 even if the bitspixel value is 32.
* gdk/gdkrgb.c (gdk_rgb_select_conv): After the above change, no
need to check for depth==32 when bpp==32, depth will always be 24.
Fri Oct 1 18:03:36 1999 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.4.txt: Started
......
1999-10-03 Tor Lillqvist <tml@iki.fi>
* gdk/gdkimage.h gdk/gdkpixmap.h: Change GDK_WINDOWING_WIN32 usage
to #ifdef also here.
* gdk/win32/*.h gdk/win32/*.c: Make corresponding changes as those
Owen did to the X11 backend.
* gdk/win32/gdkdraw.c (gdk_draw_pixmap): Fix it again, don't use
ScrollWindowEx when blitting inside a window, it can't be correct
in the general case.
* gdk/win32/gdkevents.c: Don't handle WM_SIZING, handling
WM_GETMINMAXINFO is easier.
* gdk/win32/gdkimage.c (gdk_image_new): Create new image with
depth equal to the bitspixel value, not the visual's depth.
* gdk/win32/gdkvisual.c (gdk_visual_init): Set the visual's depth
to 24 even if the bitspixel value is 32.
* gdk/gdkrgb.c (gdk_rgb_select_conv): After the above change, no
need to check for depth==32 when bpp==32, depth will always be 24.
Fri Oct 1 18:03:36 1999 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.4.txt: Started
......
1999-10-03 Tor Lillqvist <tml@iki.fi>
* gdk/gdkimage.h gdk/gdkpixmap.h: Change GDK_WINDOWING_WIN32 usage
to #ifdef also here.
* gdk/win32/*.h gdk/win32/*.c: Make corresponding changes as those
Owen did to the X11 backend.
* gdk/win32/gdkdraw.c (gdk_draw_pixmap): Fix it again, don't use
ScrollWindowEx when blitting inside a window, it can't be correct
in the general case.
* gdk/win32/gdkevents.c: Don't handle WM_SIZING, handling
WM_GETMINMAXINFO is easier.
* gdk/win32/gdkimage.c (gdk_image_new): Create new image with
depth equal to the bitspixel value, not the visual's depth.
* gdk/win32/gdkvisual.c (gdk_visual_init): Set the visual's depth
to 24 even if the bitspixel value is 32.
* gdk/gdkrgb.c (gdk_rgb_select_conv): After the above change, no
need to check for depth==32 when bpp==32, depth will always be 24.
Fri Oct 1 18:03:36 1999 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.4.txt: Started
......
1999-10-03 Tor Lillqvist <tml@iki.fi>
* gdk/gdkimage.h gdk/gdkpixmap.h: Change GDK_WINDOWING_WIN32 usage
to #ifdef also here.
* gdk/win32/*.h gdk/win32/*.c: Make corresponding changes as those
Owen did to the X11 backend.
* gdk/win32/gdkdraw.c (gdk_draw_pixmap): Fix it again, don't use
ScrollWindowEx when blitting inside a window, it can't be correct
in the general case.
* gdk/win32/gdkevents.c: Don't handle WM_SIZING, handling
WM_GETMINMAXINFO is easier.
* gdk/win32/gdkimage.c (gdk_image_new): Create new image with
depth equal to the bitspixel value, not the visual's depth.
* gdk/win32/gdkvisual.c (gdk_visual_init): Set the visual's depth
to 24 even if the bitspixel value is 32.
* gdk/gdkrgb.c (gdk_rgb_select_conv): After the above change, no
need to check for depth==32 when bpp==32, depth will always be 24.
Fri Oct 1 18:03:36 1999 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.4.txt: Started
......
1999-10-03 Tor Lillqvist <tml@iki.fi>
* gdk/gdkimage.h gdk/gdkpixmap.h: Change GDK_WINDOWING_WIN32 usage
to #ifdef also here.
* gdk/win32/*.h gdk/win32/*.c: Make corresponding changes as those
Owen did to the X11 backend.
* gdk/win32/gdkdraw.c (gdk_draw_pixmap): Fix it again, don't use
ScrollWindowEx when blitting inside a window, it can't be correct
in the general case.
* gdk/win32/gdkevents.c: Don't handle WM_SIZING, handling
WM_GETMINMAXINFO is easier.
* gdk/win32/gdkimage.c (gdk_image_new): Create new image with
depth equal to the bitspixel value, not the visual's depth.
* gdk/win32/gdkvisual.c (gdk_visual_init): Set the visual's depth
to 24 even if the bitspixel value is 32.
* gdk/gdkrgb.c (gdk_rgb_select_conv): After the above change, no
need to check for depth==32 when bpp==32, depth will always be 24.
Fri Oct 1 18:03:36 1999 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.4.txt: Started
......
......@@ -51,7 +51,7 @@ GdkImage* gdk_image_new (GdkImageType type,
GdkVisual *visual,
gint width,
gint height);
#if GDK_WINDOWING == GDK_WINDOWING_WIN32
#ifdef GDK_WINDOWING_WIN32
GdkImage* gdk_image_bitmap_new(GdkImageType type,
GdkVisual *visual,
gint width,
......
......@@ -13,7 +13,7 @@ GdkPixmap* gdk_pixmap_new (GdkWindow *window,
gint width,
gint height,
gint depth);
#if GDK_WINDOWING == GDK_WINDOWING_WIN32
#ifdef GDK_WINDOWING_WIN32
GdkPixmap* gdk_pixmap_create_on_shared_image
(GdkImage **image_return,
GdkWindow *window,
......
......@@ -2772,7 +2772,7 @@ gdk_rgb_select_conv (GdkImage *image)
else if (bpp == 32 && depth == 24 && vtype == GDK_VISUAL_TRUE_COLOR &&
(mask_rgb && byte_order == GDK_MSB_FIRST))
conv = gdk_rgb_convert_0888_br;
else if (bpp == 32 && (depth == 32 || depth == 24) && vtype == GDK_VISUAL_TRUE_COLOR &&
else if (bpp == 32 && depth == 24 && vtype == GDK_VISUAL_TRUE_COLOR &&
(mask_rgb && byte_order == GDK_LSB_FIRST))
conv = gdk_rgb_convert_0888;
else if (bpp == 32 && depth == 24 && vtype == GDK_VISUAL_TRUE_COLOR &&
......
......@@ -257,11 +257,6 @@ EXPORTS
gdk_threads_enter
gdk_threads_leave
gdk_threads_mutex
gdk_time_get
gdk_timer_disable
gdk_timer_enable
gdk_timer_get
gdk_timer_set
gdk_visual_get_best
gdk_visual_get_best_depth
gdk_visual_get_best_type
......
......@@ -33,11 +33,10 @@
#include <limits.h>
#include <io.h>
#include <gdk/gdk.h>
#include <gdk/gdkkeysyms.h>
#include <gdk/gdki18n.h>
#include "gdkx.h"
#include "gdkinput.h"
#include "gdk.h"
#include "gdkprivate.h"
#include "gdkinputprivate.h"
#include "gdkkeysyms.h"
static void gdkx_XConvertCase (KeySym symbol,
KeySym *lower,
......@@ -52,15 +51,6 @@ static void gdk_exit_func (void);
static int gdk_initialized = 0; /* 1 if the library is initialized,
* 0 otherwise.
*/
static guint start; /* We use the millisecond
* timestamps from GetTickCount
*/
static gboolean timerp = TRUE; /* If TRUE use timeouts when waiting
* for Windows messages
*/
static guint32 timer_val = 20; /* Timeout in milliseconds.
*/
#ifdef G_ENABLE_DEBUG
static const GDebugKey gdk_debug_keys[] = {
{"events", GDK_DEBUG_EVENTS},
......@@ -118,8 +108,6 @@ gdk_init_check (int *argc,
if (g_thread_supported ())
gdk_threads_mutex = g_mutex_new ();
start = GetTickCount ();
#ifdef G_ENABLE_DEBUG
{
gchar *debug_string = getenv("GDK_DEBUG");
......@@ -325,113 +313,6 @@ gdk_get_use_xshm (void)
return TRUE;
}
/*
*--------------------------------------------------------------
* gdk_time_get
*
* Get the number of milliseconds since the library was
* initialized.
*
* Arguments:
*
* Results:
* The time since the library was initialized is returned.
* This time value is accurate to milliseconds even though
* a more accurate time down to the microsecond could be
* returned.
*
* Side effects:
*
*--------------------------------------------------------------
*/
guint32
gdk_time_get (void)
{
guint32 milliseconds;
guint32 end = GetTickCount ();
if (end < start)
milliseconds = 0xFFFFFFFF - (start - end) + 1;
else
milliseconds = end - start;
return milliseconds;
}
/*
*--------------------------------------------------------------
* gdk_timer_get
*
* Returns the current timer.
*
* Arguments:
*
* Results:
* Returns the current timer interval. This interval is
* in units of milliseconds.
*
* Side effects:
*
*--------------------------------------------------------------
*/
guint32
gdk_timer_get (void)
{
return timer_val;
}
/*
*--------------------------------------------------------------
* gdk_timer_set
*
* Sets the timer interval.
*
* Arguments:
* "milliseconds" is the new value for the timer.
*
* Results:
*
* Side effects:
* Calls to "gdk_event_get" will last for a maximum
* of time of "milliseconds". However, a value of 0
* milliseconds will cause "gdk_event_get" to block
* indefinately until an event is received.
*
*--------------------------------------------------------------
*/
void
gdk_timer_set (guint32 milliseconds)
{
timer_val = milliseconds;
#ifdef USE_PEEKNAMEDPIPE
/* When using PeekNamedPipe, can't have too long timeouts.
*/
if (timer_val > 10)
timer_val = 10;
else if (timer_val == 0)
timer_val = 0;
#endif
}
void
gdk_timer_enable (void)
{
timerp = TRUE;
}
void
gdk_timer_disable (void)
{
#ifdef USE_PEEKNAMEDPIPE
/* Can't disable timeouts when using PeekNamedPipe */
#else
timerp = FALSE;
#endif
}
/*
*--------------------------------------------------------------
* gdk_screen_width
......
......@@ -257,11 +257,6 @@ EXPORTS
gdk_threads_enter
gdk_threads_leave
gdk_threads_mutex
gdk_time_get
gdk_timer_disable
gdk_timer_enable
gdk_timer_get
gdk_timer_set
gdk_visual_get_best
gdk_visual_get_best_depth
gdk_visual_get_best_type
......
......@@ -65,10 +65,19 @@
#include <stdlib.h>
#include <string.h>
#include "gdkcc.h"
#include "gdkcolor.h"
#include "gdkx.h"
#define MAX_IMAGE_COLORS 256
typedef struct _GdkColorContextPrivate GdkColorContextPrivate;
struct _GdkColorContextPrivate
{
GdkColorContext color_context;
XStandardColormap std_cmap;
};
static guint
hash_color (gconstpointer key)
......@@ -102,16 +111,11 @@ pixel_sort (const void *a, const void *b)
return ((GdkColor *) a)->pixel - ((GdkColor *) b)->pixel;
}
/* XXX: This function does an XQueryColors() the hard way, because there is
* no corresponding function in Gdk.
*/
static void
my_x_query_colors (GdkColormap *colormap,
GdkColor *colors,
gint ncolors)
{
XColor *xcolors;
gint i;
for (i = 0; i < ncolors; i++)
......@@ -175,6 +179,7 @@ init_gray (GdkColorContext *cc)
gdouble dinc;
cc->num_colors = 256; /* Bogus, but will never get here anyway? */
cc->clut = g_new (gulong, cc->num_colors);
cstart = g_new (GdkColor, cc->num_colors);
......@@ -379,8 +384,9 @@ init_palette (GdkColorContext *cc)
if (cc->color_hash)
{
/* XXX: quick-and-dirty way to remove everything */
g_hash_table_foreach (cc->color_hash,
free_hash_entry,
NULL);
g_hash_table_destroy (cc->color_hash);
cc->color_hash = g_hash_table_new (hash_color, compare_colors);
}
......@@ -456,6 +462,7 @@ gdk_color_context_new (GdkVisual *visual,
init_bw (cc);
else
init_gray (cc);
break;
case GDK_VISUAL_TRUE_COLOR: /* shifts */
......@@ -497,11 +504,6 @@ gdk_color_context_new (GdkVisual *visual,
g_message ("gdk_color_context_new: screen depth is %i, no. of colors is %i\n",
cc->visual->depth, cc->num_colors));
/* check if we need to initialize a hash table */
if ((cc->mode == GDK_CC_MODE_STD_CMAP) || (cc->mode == GDK_CC_MODE_UNDEFINED))
cc->color_hash = g_hash_table_new (hash_color, compare_colors);
return (GdkColorContext *) cc;
}
......@@ -555,17 +557,9 @@ gdk_color_context_free (GdkColorContext *cc)
gdk_colormap_unref (cc->colormap);
/* free any palette that has been associated with this GdkColorContext */
init_palette (cc);
if (cc->color_hash)
{
g_hash_table_foreach (cc->color_hash,
free_hash_entry,
NULL);
g_hash_table_destroy (cc->color_hash);
}
g_free (cc);
}
......@@ -581,7 +575,7 @@ gdk_color_context_get_pixel (GdkColorContext *cc,
g_assert (failed != NULL);
*failed = FALSE;
switch (cc->mode)
{
case GDK_CC_MODE_BW:
......@@ -658,13 +652,14 @@ gdk_color_context_get_pixel (GdkColorContext *cc,
default:
{
GdkColor color;
GdkColor *result;
GdkColor *result = NULL;
color.red = red;
color.green = green;
color.blue = blue;
result = g_hash_table_lookup (cc->color_hash, &color);
if (cc->color_hash)
result = g_hash_table_lookup (cc->color_hash, &color);
if (!result)
{
......@@ -709,6 +704,9 @@ gdk_color_context_get_pixel (GdkColorContext *cc,
cnew = g_new (GdkColor, 1);
*cnew = color;
if (!cc->color_hash)
cc->color_hash = g_hash_table_new (hash_color, compare_colors);
g_hash_table_insert (cc->color_hash, cnew, cnew);
cc->clut[cc->num_allocated] = color.pixel;
......@@ -1367,27 +1365,14 @@ gdk_color_context_add_palette (GdkColorContext *cc,
/* restore previous mode if we aren't adding a new palette */
if (num_palette == 0)
{
/* GDK_CC_MODE_STD_CMAP uses a hash table, so we'd better initialize one */
/* XXX: here, the hash table is already initialized */
return 0;
}
/* Initialize a hash table for this palette (we need one for allocating
* the pixels in the palette using the current settings)
*/
if (cc->color_hash == NULL)
cc->color_hash = g_hash_table_new (hash_color, compare_colors);
return 0;
/* copy incoming palette */
cc->palette = g_new0(GdkColor, num_palette);
j = 0;
for (i = 0; i < num_palette; i++)
{
erg = 0;
......@@ -1427,6 +1412,9 @@ gdk_color_context_add_palette (GdkColorContext *cc,
if (cc->color_hash)
{
g_hash_table_foreach (cc->color_hash,
free_hash_entry,
NULL);
g_hash_table_destroy (cc->color_hash);
cc->color_hash = NULL;
}
......
......@@ -31,7 +31,8 @@
#include <string.h>
#include <time.h>
#include "gdkx.h"
#include "gdkcolor.h"
#include "gdkprivate.h"
static gint gdk_colormap_match_color (GdkColormap *cmap,
GdkColor *color,
......@@ -173,7 +174,7 @@ terms specified in this license.
static int
alloc_color(Colormap colormap,
XColor *color,
guint *pixelp)
gulong *pixelp)
{
PALETTEENTRY entry, closeEntry;
HDC hdc;
......
......@@ -31,7 +31,8 @@
#include <string.h>
#include <time.h>
#include "gdkx.h"
#include "gdkcolor.h"
#include "gdkprivate.h"
static gint gdk_colormap_match_color (GdkColormap *cmap,
GdkColor *color,
......@@ -173,7 +174,7 @@ terms specified in this license.
static int
alloc_color(Colormap colormap,
XColor *color,
guint *pixelp)
gulong *pixelp)
{
PALETTEENTRY entry, closeEntry;
HDC hdc;
......
......@@ -19,7 +19,7 @@
#include "config.h"
#include <gdk/gdk.h>
#include "gdkcursor.h"
#include "gdkprivate.h"
static const struct { const char *name; int type; } cursors[] = {
......
......@@ -19,7 +19,7 @@
#include "config.h"
#include <gdk/gdk.h>
#include "gdkcursor.h"