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

New function, copied from X11 version.

2001-02-11  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkcolor-win32.c (gdk_colormap_query_color): New
	function, copied from X11 version.

	* gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): Eliminate
	DestroyCursor failures. The reason for the problem (despite the
	inconsistent messages from GetLastError()) was that
	DestroyCursor() cannot be called while a cursor is set in a
	window. Set the new cursor first and then destroy the old one.
	Thanks to jpe@archaeopteryx.com.

	* gdk/win32/gdkcc-win32.c: Removed.

	* gdk/gdk.def
	* gdk/makefile.mingw.in: Update. Godbye GdkColorContext.

	* gtk/gtk.def
	* gtk/makefile.mingw.in: Updates.
parent dbb03428
2001-02-11 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkcolor-win32.c (gdk_colormap_query_color): New
function, copied from X11 version.
* gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): Eliminate
DestroyCursor failures. The reason for the problem (despite the
inconsistent messages from GetLastError()) was that
DestroyCursor() cannot be called while a cursor is set in a
window. Set the new cursor first and then destroy the old one.
Thanks to jpe@archaeopteryx.com.
* gdk/win32/gdkcc-win32.c: Removed.
* gdk/gdk.def
* gdk/makefile.mingw.in: Update. Godbye GdkColorContext.
* gtk/gtk.def
* gtk/makefile.mingw.in: Updates.
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtkbin.c (gtk_bin_add): better error message if you try to
......
2001-02-11 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkcolor-win32.c (gdk_colormap_query_color): New
function, copied from X11 version.
* gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): Eliminate
DestroyCursor failures. The reason for the problem (despite the
inconsistent messages from GetLastError()) was that
DestroyCursor() cannot be called while a cursor is set in a
window. Set the new cursor first and then destroy the old one.
Thanks to jpe@archaeopteryx.com.
* gdk/win32/gdkcc-win32.c: Removed.
* gdk/gdk.def
* gdk/makefile.mingw.in: Update. Godbye GdkColorContext.
* gtk/gtk.def
* gtk/makefile.mingw.in: Updates.
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtkbin.c (gtk_bin_add): better error message if you try to
......
2001-02-11 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkcolor-win32.c (gdk_colormap_query_color): New
function, copied from X11 version.
* gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): Eliminate
DestroyCursor failures. The reason for the problem (despite the
inconsistent messages from GetLastError()) was that
DestroyCursor() cannot be called while a cursor is set in a
window. Set the new cursor first and then destroy the old one.
Thanks to jpe@archaeopteryx.com.
* gdk/win32/gdkcc-win32.c: Removed.
* gdk/gdk.def
* gdk/makefile.mingw.in: Update. Godbye GdkColorContext.
* gtk/gtk.def
* gtk/makefile.mingw.in: Updates.
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtkbin.c (gtk_bin_add): better error message if you try to
......
2001-02-11 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkcolor-win32.c (gdk_colormap_query_color): New
function, copied from X11 version.
* gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): Eliminate
DestroyCursor failures. The reason for the problem (despite the
inconsistent messages from GetLastError()) was that
DestroyCursor() cannot be called while a cursor is set in a
window. Set the new cursor first and then destroy the old one.
Thanks to jpe@archaeopteryx.com.
* gdk/win32/gdkcc-win32.c: Removed.
* gdk/gdk.def
* gdk/makefile.mingw.in: Update. Godbye GdkColorContext.
* gtk/gtk.def
* gtk/makefile.mingw.in: Updates.
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtkbin.c (gtk_bin_add): better error message if you try to
......
2001-02-11 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkcolor-win32.c (gdk_colormap_query_color): New
function, copied from X11 version.
* gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): Eliminate
DestroyCursor failures. The reason for the problem (despite the
inconsistent messages from GetLastError()) was that
DestroyCursor() cannot be called while a cursor is set in a
window. Set the new cursor first and then destroy the old one.
Thanks to jpe@archaeopteryx.com.
* gdk/win32/gdkcc-win32.c: Removed.
* gdk/gdk.def
* gdk/makefile.mingw.in: Update. Godbye GdkColorContext.
* gtk/gtk.def
* gtk/makefile.mingw.in: Updates.
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtkbin.c (gtk_bin_add): better error message if you try to
......
2001-02-11 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkcolor-win32.c (gdk_colormap_query_color): New
function, copied from X11 version.
* gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): Eliminate
DestroyCursor failures. The reason for the problem (despite the
inconsistent messages from GetLastError()) was that
DestroyCursor() cannot be called while a cursor is set in a
window. Set the new cursor first and then destroy the old one.
Thanks to jpe@archaeopteryx.com.
* gdk/win32/gdkcc-win32.c: Removed.
* gdk/gdk.def
* gdk/makefile.mingw.in: Update. Godbye GdkColorContext.
* gtk/gtk.def
* gtk/makefile.mingw.in: Updates.
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtkbin.c (gtk_bin_add): better error message if you try to
......
2001-02-11 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkcolor-win32.c (gdk_colormap_query_color): New
function, copied from X11 version.
* gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): Eliminate
DestroyCursor failures. The reason for the problem (despite the
inconsistent messages from GetLastError()) was that
DestroyCursor() cannot be called while a cursor is set in a
window. Set the new cursor first and then destroy the old one.
Thanks to jpe@archaeopteryx.com.
* gdk/win32/gdkcc-win32.c: Removed.
* gdk/gdk.def
* gdk/makefile.mingw.in: Update. Godbye GdkColorContext.
* gtk/gtk.def
* gtk/makefile.mingw.in: Updates.
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtkbin.c (gtk_bin_add): better error message if you try to
......
......@@ -10,19 +10,6 @@ EXPORTS
gdk_color_alloc
gdk_color_black
gdk_color_change
gdk_color_context_add_palette
gdk_color_context_free
gdk_color_context_free_dither
gdk_color_context_get_index_from_palette
gdk_color_context_get_pixel
gdk_color_context_get_pixel_from_palette
gdk_color_context_get_pixels
gdk_color_context_get_pixels_incremental
gdk_color_context_init_dither
gdk_color_context_new
gdk_color_context_new_mono
gdk_color_context_query_color
gdk_color_context_query_colors
gdk_color_copy
gdk_color_equal
gdk_color_free
......@@ -35,7 +22,9 @@ EXPORTS
gdk_colormap_free_colors
gdk_colormap_get_system
gdk_colormap_get_system_size
gdk_colormap_get_type
gdk_colormap_get_visual
gdk_colormap_query_color
gdk_colormap_new
gdk_colormap_ref
gdk_colormap_unref
......@@ -222,9 +211,12 @@ EXPORTS
gdk_list_visuals
gdk_mbstowcs
gdk_null_window_warnings
gdk_pango_attr_embossed_new
gdk_pango_attr_stipple_new
gdk_pango_context_get
gdk_pango_context_set_colormap
gdk_parent_root
gdk_pixbuf_get_from_drawable
gdk_pixbuf_render_pixmap_and_mask
gdk_pixbuf_render_threshold_alpha
gdk_pixbuf_render_to_drawable
......@@ -368,6 +360,7 @@ EXPORTS
gdk_window_set_background
gdk_window_set_child_shapes
gdk_window_set_cursor
gdk_window_set_debug_updates
gdk_window_set_decorations
gdk_window_set_events
gdk_window_set_functions
......
This diff is collapsed.
......@@ -2150,6 +2150,42 @@ gdk_colormap_alloc_colors (GdkColormap *colormap,
return nremaining;
}
void
gdk_colormap_query_color (GdkColormap *colormap,
gulong pixel,
GdkColor *result)
{
GdkVisual *visual;
g_return_if_fail (GDK_IS_COLORMAP (colormap));
visual = gdk_colormap_get_visual (colormap);
switch (visual->type) {
case GDK_VISUAL_DIRECT_COLOR:
case GDK_VISUAL_TRUE_COLOR:
result->red = 65535. * (double)((pixel & visual->red_mask) >> visual->red_shift) / ((1 << visual->red_prec) - 1);
result->green = 65535. * (double)((pixel & visual->green_mask) >> visual->green_shift) / ((1 << visual->green_prec) - 1);
result->blue = 65535. * (double)((pixel & visual->blue_mask) >> visual->blue_shift) / ((1 << visual->blue_prec) - 1);
break;
case GDK_VISUAL_STATIC_GRAY:
case GDK_VISUAL_GRAYSCALE:
result->red = result->green = result->blue = 65535. * (double)pixel/((1<<visual->depth) - 1);
break;
case GDK_VISUAL_STATIC_COLOR:
g_assert_not_reached ();
break;
case GDK_VISUAL_PSEUDO_COLOR:
result->red = colormap->colors[pixel].red;
result->green = colormap->colors[pixel].green;
result->blue = colormap->colors[pixel].blue;
break;
default:
g_assert_not_reached ();
break;
}
}
gboolean
gdk_color_change (GdkColormap *colormap,
GdkColor *color)
......
......@@ -186,7 +186,6 @@ gdk_wcstombs (const GdkWChar *src)
while (*wcp)
{
int first;
int i;
GdkWChar c = *wcp++;
if (c < 0x80)
......
......@@ -1531,6 +1531,7 @@ gdk_window_set_cursor (GdkWindow *window,
GdkWindowImplWin32 *impl;
GdkCursorPrivate *cursor_private;
HCURSOR hcursor;
HCURSOR hprevcursor;
POINT pt;
g_return_if_fail (window != NULL);
......@@ -1549,15 +1550,10 @@ gdk_window_set_cursor (GdkWindow *window,
GDK_NOTE (MISC, g_print ("gdk_window_set_cursor: %#x %#x\n",
(guint) GDK_WINDOW_HWND (window),
(guint) hcursor));
if (impl->hcursor != NULL)
{
GDK_NOTE (MISC, g_print ("...DestroyCursor (%#x)\n",
(guint) impl->hcursor));
DestroyCursor (impl->hcursor);
impl->hcursor = NULL;
}
if (hcursor != NULL)
hprevcursor = impl->hcursor;
if (hcursor == NULL)
impl->hcursor = NULL;
else
{
/* We must copy the cursor as it is OK to destroy the GdkCursor
* while still in use for some window. See for instance
......@@ -1572,6 +1568,16 @@ gdk_window_set_cursor (GdkWindow *window,
GetCursorPos (&pt);
if (ChildWindowFromPoint (GDK_WINDOW_HWND (window), pt) == GDK_WINDOW_HWND (window))
SetCursor (impl->hcursor);
if (hprevcursor != NULL)
{
GDK_NOTE (MISC, g_print ("...DestroyCursor (%#x)\n",
(guint) hprevcursor));
if (!DestroyCursor (hprevcursor))
WIN32_API_FAILED ("DestroyCursor");
impl->hcursor = NULL;
}
}
}
}
......
......@@ -26,7 +26,6 @@ all: \
libwntab32x.a
gdk_win32_OBJECTS = \
gdkcc-win32.o \
gdkcolor-win32.o \
gdkcursor-win32.o \
gdkdnd-win32.o \
......
......@@ -28,7 +28,6 @@ EXPORTS
GTK_TYPE_GDK_BYTE_ORDER
GTK_TYPE_GDK_CAP_STYLE
GTK_TYPE_GDK_COLOR
GTK_TYPE_GDK_COLOR_CONTEXT_MODE
GTK_TYPE_GDK_CROSSING_MODE
GTK_TYPE_GDK_CURSOR_TYPE
GTK_TYPE_GDK_DRAG_ACTION
......@@ -250,8 +249,6 @@ EXPORTS
gtk_cell_renderer_text_new
gtk_cell_renderer_text_pixbuf_get_type
gtk_cell_renderer_text_pixbuf_new
gtk_cell_renderer_toggle_get_active
gtk_cell_renderer_toggle_set_active
gtk_check_button_get_type
gtk_check_button_new
gtk_check_button_new_with_label
......@@ -522,6 +519,7 @@ EXPORTS
gtk_entry_prepend_text
gtk_entry_select_region
gtk_entry_set_editable
gtk_entry_set_has_frame
gtk_entry_set_invisible_char
gtk_entry_set_max_length
gtk_entry_set_position
......@@ -1067,7 +1065,9 @@ EXPORTS
gtk_selection_convert
gtk_selection_data_copy
gtk_selection_data_free
gtk_selection_data_get_tree_row
gtk_selection_data_set
gtk_selection_data_set_tree_row
gtk_selection_incr_event
gtk_selection_notify
gtk_selection_owner_set
......@@ -1305,6 +1305,11 @@ EXPORTS
gtk_tree_append
gtk_tree_child_position
gtk_tree_clear_items
gtk_tree_drag_dest_drag_data_received
gtk_tree_drag_dest_get_type
gtk_tree_drag_dest_row_drop_possible
gtk_tree_drag_source_drag_data_get
gtk_tree_drag_source_get_type
gtk_tree_get_type
gtk_tree_insert
gtk_tree_item_collapse
......@@ -1388,7 +1393,6 @@ EXPORTS
gtk_tree_view_column_set_cell_data
gtk_tree_view_column_set_cell_renderer
gtk_tree_view_column_set_clickable
gtk_tree_view_column_set_justification
gtk_tree_view_column_set_max_width
gtk_tree_view_column_set_min_width
gtk_tree_view_column_set_sizing
......@@ -1408,7 +1412,6 @@ EXPORTS
gtk_tree_view_get_type
gtk_tree_view_get_vadjustment
gtk_tree_view_insert_column
gtk_tree_view_move_to
gtk_tree_view_new
gtk_tree_view_new_with_model
gtk_tree_view_remove_column
......
......@@ -54,7 +54,6 @@ all : \
gtk_OBJECTS = \
fnmatch.o \
gdk-pixbuf-loader.o \
gtkaccelgroup.o \
gtkaccellabel.o \
gtkadjustment.o \
......@@ -178,6 +177,7 @@ gtk_OBJECTS = \
gtktree.o \
gtktreeitem.o \
gtktreedatalist.o \
gtktreednd.o \
gtktreemodel.o \
gtktreemodelsimple.o \
gtktreemodelsort.o \
......@@ -221,7 +221,6 @@ gtk_public_h_sources = \
gtkcolorsel.h \
gtkcolorseldialog.h \
gtkcombo.h \
gtkcompat.h \
gtkcontainer.h \
gtkctree.h \
gtkcurve.h \
......@@ -282,7 +281,6 @@ gtk_public_h_sources = \
gtkoptionmenu.h \
gtkpacker.h \
gtkpaned.h \
gdk-pixbuf-loader.h \
gtkpixmap.h \
gtkplug.h \
gtkpreview.h \
......@@ -322,11 +320,13 @@ gtk_public_h_sources = \
gtktoolbar.h \
gtktooltips.h \
gtktree.h \
gtktreednd.h \
gtktreeitem.h \
gtktreemodel.h \
gtktreemodelsimple.h \
gtktreemodelsort.h \
gtktreeselection.h \
gtktreesortable.h \
gtktreestore.h \
gtktreeview.h \
gtktreeviewcolumn.h \
......@@ -344,7 +344,6 @@ gtk_public_h_sources = \
# More headers to use when autogenerating.
gdk_headers = \
../gdk/gdkcc.h \
../gdk/gdkcolor.h \
../gdk/gdkcursor.h \
../gdk/gdkdnd.h \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment