2002-11-03 Tor Lillqvist <tml@iki.fi>
* Makefile.am (SUBDIRS): Do include docs.
(EXTRA_DIST): Include config.h.win32.
* configure.in: Must call AM_CONDITIONAL for XINPUT_GXI and
XINPUT_XFREE (setting them to falce) also in the win32 branch.
* gdk/gdkdnd.h: Fix lint, put the "extra tokens" inside comment
after the #endif.
* gdk/win32/gdkdrawable-win32.c: A couple of logging fixes.
* gdk/win32/gdkevents-win32.c (gdk_event_translate):
WM_SYSKEYDOWN, WM_SYSKEYUP: Need to handle F10 specially here in
order to be able to handle it normally in the application.
* gdk/win32/gdkpixmap-win32.c: Minor logging changes.
* gdk/win32/gdkwindow-win32.c (gdk_window_get_geometry): Return
the window's coordintes relative to the *parent*.
* gtk/gtkmain.c (gtk_init_check): Don't need to call
bind_textdomain_codeset() for glib20, GLib handles that itself.
2002-10-04 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkfont-win32.c (gdk_font_load_internal): If the font
supports Latin scripts, assume it has the currency symbols, even
if the fsUsb doesn't say so. At least for Arial this is true, it
contains the Euro sign. This is a gross hack, but better than the
Euro not showing up even though the font does contain it.
2002-09-21 Tor Lillqvist <tml@iki.fi>
* gtk/gtktext.c (find_char_width): Fix from gtk-1-2: Tue Feb 13
13:56:58 2001 Owen Taylor <otaylor@redhat.com> Fix problems with
characters < 256 in wide character locales. (Patch from Yoichi
Imai.)
2002-09-05 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkproperty-win32.c (gdk_property_change): Fix typo,
actually do check each char, not just the first one, as looping
through the text looking to insert CR in front of LF. Bug noticed
and fix by Florent Duguet.
2002-08-24 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Let the
system handle Alt-Space, too. Thanks to Tim Evans (#91477).
Fix for #81831 by Tim Evans:
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Don't call
_gdk_event_button_generate() here, it would append the double- or
triple-click events too early, before the single-click event.
(inner_window_proc): If we got a single-click event, call
_gdk_event_button_generate() to perhaps append the double- or
triple-click event after that.
2002-08-01 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkinput-win32.c (gdk_input_init): Use
GetSystemMetrics (SM_C[XY]SCREEN) instead of
gdk_screen_{width,height}().
* gtk/gtkmain.c (gtk_init_check): Call bind_textdomain_codeset()
also for glib20.
2002-08-01 Tor Lillqvist <tml@iki.fi>
* Makefile.am: Remove gtk+.spec stuff, not needed in this (Win32
only) branch.
* gtk+-zip.sh: Use /tmp, not /g/tmp.
* gdk/win32/gdkdrawable-win32.c: (gdk_win32_draw_segments,
gdk_win32_draw_lines): Check for IS_WIN_NT before drawing end
pixel separately, as already done in another place.
2002-08-01 Tor Lillqvist <tml@iki.fi>
Fix for problem reported by Mark Raine: When Windows is set up not
to have any Explorer desktop (icons), dragging the mouse from a
popped-down menu onto the "root" window causes a crash.
* gdk/win32/gdkevents-win32.c (propagate): Check for parent being
NULL before trying to propagate to it, and return FALSE in that
case. (If parent is NULL, we are handling gdk_parent_root, and
probably should have noticed that and bailed out earlier. But
better late than never.)
(synthesize_crossing_events): Check for curWnd being non-NULL
before gdk_window_ref'ing it.
2002-03-22 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_dashes): Backport from
HEAD: Don't clear all of the pen_style, just the PS_STYLE_MASK.
Fixes at least the special case of one-pixel wide one-pixel on-off
dotted lines, for instance as in ctrees. To fully implement
generic X11 style dashed lines a major rewrite would be needed.
2002-03-20 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkselection-win32.c (gdk_selection_convert): Don't
use return value from GlobalSize() as length of string when
calling MultiByteToWideChar(). Pass -1 instead (zero-terminated
string). Thanks to Iwasa Kazmi.
2002-03-13 Tor Lillqvist <tml@iki.fi>
* configure.in: Output the Makefiles in the build subdirectory.
* gdk/win32/Makefile.am (EXTRA_DIST): Move bdfcursor.c here, it is
not part of the library sources.
* gdk/gdkwindow.c (gdk_window_get_toplevel): Fix silly bug,
actually return the toplevel found, not the original
parameter. (Backport from HEAD.)
* gdk/win32/gdkdnd-win32.c (gdk_drag_find_window): Use
gdk_window_get_toplevel(), as it is the top-level windows that are
registered for DND. This fixes drag-and-drop of layers from GIMP's
L,C&P dialog to GIMP's toolbox, for instance.
2002-02-28 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkgc-win32.c (gdk_win32_colormap_color_pack): In the
bitmap case, use just the LSB of the pixel value.
2002-02-24 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkwindow-win32.c (gdk_window_foreign_new): Do accept
window handle zero, as that is in fact HWND_DESKTOP.
2002-02-18 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkevents-win32.c
(gdk_event_translate:WM_QUERYNEWPALETTE): Don't do anything if the
system visual is static color, i.e. the user has told GDK to use
just the 16 static colors. In that case no need to redraw
anything, as the colors are static and by definition always
correctly mapped in the system palette.
(WM_PALETTECHANGED): Ditto, no need to call UpdateColors() either.
2002-02-17 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkcolor-win32.c (free_colors): Less verbose debugging
output.
* gdk/win32/gdkevents-win32.c (gdk_event_translate:WM_PALETTE):
Just check if it was *this* window that caused the palette change.
This means that we call UpdateColors() also if window(s) under
another top-level window of the same application has realized its
palette.
2002-02-16 Tor Lillqvist <tml@iki.fi>
* gdk/win32/rc/Makefile.am (gdk-win32res.lo): Depend on gtk.ico.
* gdk/win32/rc/gtk.ico: Use the real GTK logo. Thanks to Jernej
Simoncic for providing the multi-resolution .ico file.
2002-02-16 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap): No
need to create new images to scan with gdk_image_get(). Use the
GdkImage view of the GdkPixmap always present nowadays with the
unified GdkPixmap-GdkImage implementation.
* gdk/win32/rc/Makefile.am (gdk-win32res.lo): Depend on gtk.ico.
* gdk/win32/rc/gtk.ico: Use the real GTK logo. Thanks to Jernej
Simoncic for providing the nice multi-resolution .ico file.
2002-02-10 Tor Lillqvist <tml@iki.fi>
* gtk/gtk.def: Add a couple of missing entry points.
* gdk/win32/gdkcolor-win32.c (gdk_colormap_free_colors): Don't
unnecessarily use a GdkColormapPrivateWin32 pointer.
* gdk/win32/gdkpixmap-win32.c (gdk_pixmap_create_from_data): Use
gdk_win32_blit(), not gdk_draw_drawable().
2002-02-09 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkcolor-win32.c: Remove the actually unused
colormap_hash table and add_colormap() and remove_colormap()
functions. Move the sync_colormap() function inline to the only
place where it was called. (Its semantics didn't match the
corresponding function on X11 anyway. On Windows the entries in a
logical palette don't change behind the curtain. Logical palettes
are private to the application.)
* gdk/win32/gdkprivate-win32.h: Remove the now unnecessary
include of <time.h>.
(struct _GdkColormapPrivateWin32): Remove the now unused
last_sync_time.
2002-02-06 Tor Lillqvist <tml@iki.fi>
A batch of changes mainly with improvements to 256-color mode. Add
possibility for the user to override size of palette used with
either the GDK_WIN32_MAX_COLORS environment variable, or a
-max-colors command line option. Plug some memory leaks.
* gdk/gdkrgb.c: More debugging output added here and there, some
very verbose. I tried hard to also come up with a color cube and a
GdkRgbConvFunc that would use all the 16 static VGA colors if the
visual is such, but no. Will have to make do with the 2x2x2 color
cube in that case.
(gdk_rgb_cmap_fail): Drop the message argument, instead use
explicit GDK_NOTE calls before calling this function.
(gdk_rgb_do_colormaps): Use G_N_ELEMENTS().
(gdk_rgb_init): Use the 2x2x2 color cube only for depths 3 and 4.
Check return value from gdk_rgb_do_colormaps(), call g_error() if
fails.
(gdk_rgb_convert_4_pack): New GdkRgbConvFunc, for 4 bits-per-pixel
static color visuals.
(gdk_rgb_select_conv): Use correct bpp for 4 < depth < 8. Choose
gdk_rgb_convert_8() also for depth < 8. Choose
gdk_rgb_convert_4_pack() when bpp == depth == 4. Call g_error() if
no suitable conv function was found.
* gdk/win32/gdkcolor-win32.c: Minor debugging output
changes. Remove #if 0 code.
(create_colormap): If the visual indicates the static 16 VGA
colors only, use only those in the palette (and not the four
colors in the middle of the default palette).
* gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap):
Debugging output improvements.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_blit): New function,
bulk of code from the old gdk_win32_draw_drawable(), with one
extra parameter use_fg_bg to indicate whether to use the fg and bg
pixel values (indexes) from the GC when blitting from bitmaps, or
0 and 1. The values from the GC are used only when being called
from gdk_image_put(). (Compare to XCopyArea(), XGetImage() and
XPutImage().)
Plug memory leak: always delete the outside_rgn HRGN.
(gdk_win32_draw_drawable): Just call gdk_win32_blit().
(blit_from_pixmap, blit_inside_window, blit_from_window): New
functions, containing code sections moved out from (what is now)
gdk_win32_blit().
(blit_from_pixmap): Gets passed the use_fg_bg parameter of
gdk_win32_blit(). Call gdk_win32_clear_hdc_cache_for_hwnd() for
the source bitmap to make sure it isn't selected into a DC in the
DC cache. Combine the branches for 1-bit and 8-bit bitmaps: Set
the source DIB section's color table appropriately before calling
BitBlt(), restore afterwards.
* gdk/win32/gdkgc-win32.c: Only cosmetics and debugging output changes.
* gdk/win32/gdkglobals-win32.c: New global variable: gdk_max_colors.
* gdk/win32/gdkimage-win32.c (gdk_image_get): Call
gdk_win32_blit() with use_fg_bg FALSE.
(gdk_image_get_pixel, gdk_image_put_pixel): Handle depth == 4 case
(two packed pixels per byte).
* gdk/win32/gdkmain-win32.c: New command-line option -max-colors.
* gdk/win32/gdkpixmap-win32.c (setup_pixmap_image): Handle also
depths 4, 5, 6 and 7, with depth 4 meaning two pixels per byte,
and 5, 6 and 7 meaning one pixel per byte, but restricting pixel
values to said number of bits.
(gdk_win32_pixmap_new, showpixmap): Ditto.
* gdk/win32/gdkprivate-win32.h: Declate gdk_win32_blit() and
gdk_max_colors.
* gdk/win32/gdkselection-win32.c (gdk_text_property_to_text_list): Fix lint.
* gdk/win32/gdkvisual-win32.c (gdk_visual_init): Look for a
GDK_WIN32_MAX_COLORS environment variable, and check the
gdk_max_colors variable possibly set by the command-line
option. They can be used to override the number of colormap
entries for 256-color "pseudocolor" mode. Set depth of visual
accordingly. If restricted to 16-color, say it's "static
color". Call gdk_rgb_min_colors() with an appropriate value for
the restricted colormaps.
* gdk/win32/gdkwindow-win32.c (gdk_window_shape_combine_mask):
Plug memory leak: Delete temporary HRGN after use.
2002-01-28 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkcolor-win32.c (match_color): Don't square the diffs
of the colour components before summing, might overflow. Use sum
of absolute diffs like in the X11 backend. Rename the max variable
to min, as it tracks the minimum sum, not maximum...
(alloc_color): Mimic XAllocColor() better: do return false if
failure, don't just use the closest entry. It's the callers who
then search for a best match if necessary.
(free_colors): If we have freed the last entry or entries in the
palette, resize the palette down. Mark unused palette slots in the
middle with PC_EXPLICIT so that they won't be matched and realized
unnecessarily, worsening the colour flashing. (This is just a
hunch, haven't done any actual testing to confirm that this
helps.)
(alloc1, gdk_colormap_alloc_colors): Handle failure from
alloc_color() like failure from XAllocColor() in the X11 backend.
(alloc_private): Fix logic a bit in the case when the colour will
fit in the colormap. Set the entry in the colormap's color table,
too, if we successfully changes one palette entry.
(alloc_shared): Typo fix backported from HEAD.
2002-01-27 Tor Lillqvist <tml@iki.fi>
* gdk/gdkimage.h: Remove declaration of gdk_image_bitmap_new(),
the fuinction was removed already earlier.
* gdk/win32/gdkdrawable-win32.c: Make gdk_win32_draw_drawable()
public (but not exported from DLL).
* gdk/win32/gdkgc-win32.c (gdk_win32_colormap_color_unpack):
Remove unused variables. Don't return value from void function.
* gdk/win32/gdkimage-win32.c: (gdk_image_get): Simplify by using
gdk_win32_draw_drawable.
(gdk_image_put): Use gdk_win32_draw_drawable() directly instead of
gdk_draw_drawable().
(gdk_image_get_pixel): Call GdiFlush(). Cosmetics.
(gdk_image_put_pixel): Call GdiFlush().
* gdk/win32/gdkpixmap-win32.c: (showpixmap): Improve this verbose
debugging function (which isn't even compiled normally, though).
* gdk/win32/gdkprivate-win32.h: Declare gdk_win32_draw_drawable().
2002-01-27 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h: Unify GdkPixmap and GdkImage
implementation: For each GdkPixmap, allocate a GdkImage, and vice
versa. GdkDrawableWin32Data has a pointer to the GdkImage.
GdkImagePrivateWin32 has a pointer to the GdkPixmap. Declare new
and renamed functions (see below).
* gdk/win32/gdkcolor-win32.c (gdk_colormap_alloc_colors): Cosmetics.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_drawable_type_to_string,
gdk_win32_drawable_description): New debugging functions.
(gdk_win32_draw_drawable): Revamp the from-pixmap case: Use
foreground and background in the GC correctly when drawing
bitmaps. (The 0 bits select the background, the 1 bits the
foreground.) Still need to handle blitting from 8-bit pixmaps in
general correctly: Now we let the BitBlt convert colours (if it
thinks that is necessary), we should change the colour table of
the source to match that of the destination before blitting, so
that just the indexes are copied, like X11 does.
* gdk/win32/gdkgc-win32.c (gdk_win32_colormap_color_pack): Rename
from gdk_colormap_color.
(gdk_win32_colormap_color_unpack): New function, kinda inverse of
gdk_win32_colormap_color_pack. Actually not used, though.
(gdk_win32_bitmap_to_region): Simplify greatly, now that
GdkPixmaps always have the DIB section bits available. Take a
GdkPixmap parameter.
* gdk/win32/gdkimage-win32.c: Change according to the
GdkPixmap-GdkImage unification. Many function reduced a lot:
(gdk_image_new_bitmap, gdk_image_new, gdk_image_get): Use
gdk_win32_pixmap_new().
(gdk_image_put): Use gdk_draw_drawable().
gdk_image_get() should probably be changed to use
gdk_draw_drawable(), too.
* gdk/win32/gdkinput-win32.c: Fix problems if !HAVE_WINTAB_H.
* gdk/win32/gdkpixmap-win32.c: Change according to the
GdkPixmap-GdkImage unification.
(setup_pixmap_image): New function, initialises the GdkImage
attached to a GdkPixmap.
(gdk_win32_pixmap_new): New function, that handles all creations
of the unified GdkPixmap-GdkImage DIB section. Yes, only one call
to CreateDIBsection() left in the code.
(_gdk_pixmap_create_from_xpm): No need to create the resulting
pixmap separately and gdk_draw_image() into it. Just use the
GdkPixmap view of the GdkImage that we have been storing pixels
into.
* gdk/win32/gdkvisual-win32.c (gdk_visual_init): Don't error out
if on palettized display any longer.
2002-01-24 Tor Lillqvist <tml@iki.fi>
* gdk/gdkpixmap.h: Remove gdk_pixmap_create_on_shared_image()
declaration.
2002-01-24 Tor Lillqvist <tml@iki.fi>
Committing now to get a huge amount of changes checked in. There
might be some silly debugging printouts left, or stuff like
that. But everything does seem to work as well as before. Much
cleanup and refactoring still do to.
* gdk/gdkprivate.h: There is no gdk_debug_level variable.
* gdk/gdkimage.h (enum GdkImageType): Remove GDK_IMAGE_SHARED_PIXMAP.
Was used by the long abandoned gdk-imlib port.
* gdk/gdk.def
* gdk/win32/gdkimage-win32.c
* gdk/win32/gdkpixmap-win32.c: Remove gdk_image_bitmap_new() and
gdk_pixmap_create_on_shared_image() which also were used only by
the gdk-imlib port.
* gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap): Add
verbose debugging output of the source and mask images.
* gtk/Makefile.am: Let gtk-win32res.lo depend on gtk.def and the
libgtk_la_OBJECTS.
* gtk/gtk.def: Export the private (but still used by some apps)
_gtk_private_signals and _gtk_private_n_signals. Re-sort the file.
* gtk/gtkfilesel.c: Silence some gcc -Wall warnings.
* gtk/gtkmain.c: If we HAVE_BIND_TEXTDOMAIN_CODESET, tell libintl
to use UTF-8.
2002-01-22 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkgc-win32.c (gdk_colormap_color): For (single-bit
depth) bitmaps (recognized by having a null colormap), use
DIBINDEX.
* gdk/win32/*.c: Always use format %p instead of %#x in debugging
output of GDI HANDLEs.
2002-01-21 Tor Lillqvist <tml@iki.fi>
Big cleanups and fixes to 256-colour mode: Too many changes to
list here in detail, partial list below. All GIMP features now
seem to work as previously in 16- and 32-bit colour mode, plus
also in 256-colour mode.
The Win32 pixmap and image code is still very ugly. Lots of
duplicated code snippets that create DIB sections, select and
realize palettes, etc. Now when I finally got 256-colour mode
working, I really need to go through the code and factorize out
such common snippets.
Probably it would be a good idea to keep the pointer to the DIB
section's pixels also for GdkPixmaps, and not just GdkImages
(where it of course is visible to the application, even). Maybe
even have a GdkImage struct as such as a part of the private data
for Win32 GdkPixmaps? Having the pixel data accessible would
simplify gdk_win32_bitmap_to_region() a lot. Perhaps
gdk_image_get() and _put() between pixmaps and images, too, and
maybe even gdk_win32_draw_drawable(). We could skip all the HDC
and palette setup and the BitBlt, and just copy the bits
ourselves. Hmm. It might seem silly to roll your own BitBlt, but
if we did that, we wouldn't have to bother about HDCs and palettes
at all when blitting between bitmaps (pixmaps and/or images).
OTOH, when blitting to/from a window, we still would need the
palette setup. Maybe just some nice refactoring.
* gdk/win32/gdkprivate-win32.h: Remove definitions of the X11
structs ColormapStruct, Visual and XStandardColormap.
(GdkGCWin32Data): Add field holdpal to hold the previous palette
selected into the DC.
(GdkVisualPrivate): No need for a poiner to an X11 Visual
emulating struct.
(GdkWin32PalEntryState): New enum, describing the state of logical
palette entries: static (the 20 static colours), available or in
use.
(GdkColormapPrivateWin32): Instead of the X11 emulation Colormap
struct pointer, store the Windows logical palette HPALETTE
directly here, plus its current size and the state of its entries.
* gdk/win32/gdkcc-win32.c: Don't use the removed XStandardColormap
or Visual structs.
* gdk/win32/gdkcolor-win32.c: Rename static functions to shorter
names. Add much debugging output.
(create_colormap): As we implement both "shared" and "private"
colormaps identically on Win32, always allocate a Windows logical
palette containing the (presumably 20) static colours from the
system palette, marked as such.
(gdk_win32_print_paletteentries, gdk_win32_print_system_palette,
gdk_win32_print_hpalette): New debugging functions.
(gdk_colormap_free_colors): Instead of keeping two essentially
identical functions "in sync" (this and gdk_colors_free()), build
a table of the pixel values and call gdk_colors_free from here...
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_drawable): In
256-colour mode, when blitting from a window, select and realize
palette.
* gdk/win32/gdkevents-win32.c (update_colors): New function. Call
UpdateColors() on a window and all its descendants.
(synthesize_expose_events_children): New function: Synthesize
expose events for a window and all its descendants, in order to
realize our palettes and redraw everything.
(gdk_event_translate): Handle WM_QUERYNEWPALETTE: Call
synthesize_expose_events_children().
Handle WM_PALETTECHANGED: Call update_colors(), or if we have done
that three times already (a randomly chosen limit), generate
expose events.
* gdk/win32/gdkwindow-win32.c (gdk_window_get_children):
Implement, using EnumChildWindows().
2002-01-21 Tor Lillqvist <tml@iki.fi>
* gdk/gdkprivate.h: Add new flags to GdkDebugFlag:
GDK_DEBUG_COLORMAP, GDKRGB, GC, PIXMAP, IMAGE, INPUT and CURSOR.
* gdk/gdk.c: Handle them.
(gdk_init_check): Check also for '/'-delimited argv[0].
* gdk/gdkrgb.c: Indentation fixups. Add some logging messages
using GDK_NOTE (GDKRGB, ...). Seg gdk_rgb_verbose if
GDK_DEBUG_GDKRGB is turned on.
* gdk/win32/gdkcursor-win32.c
* gdk/win32/gdkgc-win32.c
* gdk/win32/gdkinput-win32.c
* gdk/win32/gdkimage-win32.c
* gdk/win32/gdkpixmap-win32.c: Use the new flags instead of MISC.
2002-01-13 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkgc-win32.c (get_bw_palette): New function, factored
out from:
(predraw_set_foreground, BitmapToRegion): Use it.
* gtk/Makefile.am (gtk-win32res.lo): Depend on gtk.def and
libgtk_la_OBJECTS.
* gtk/gtk.def: Add _gtk_private_signals and _gtk_private_n_signals
to really export them. Some applications apparently use these
private variables.
2002-01-24 Tor Lillqvist <tml@iki.fi>
Committing now to get a huge amount of changes checked
in. There might be some silly debugging printouts left, or
stuff like that. But everything does seem to work as well as
before. Much cleanup and refactoring still do to.
* gdk/gdkprivate.h: There is no gdk_debug_level variable.
* gdk/gdkimage.h (enum GdkImageType): Remove GDK_IMAGE_SHARED_PIXMAP.
Was used by the long abandoned gdk-imlib port.
* gdk/gdk.def
* gdk/win32/gdkimage-win32.c
* gdk/win32/gdkpixmap-win32.c: Remove gdk_image_bitmap_new() and
gdk_pixmap_create_on_shared_image() which also were used only by
the gdk-imlib port.
* gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap): Add
verbose debugging output of the source and mask images.
* gtk/Makefile.am: Let gtk-win32res.lo depend on gtk.def and the
libgtk_la_OBJECTS.
* gtk/gtk.def: Export the private (but still used by some apps)
_gtk_private_signals and _gtk_private_n_signals. Re-sort the file.
* gtk/gtkfilesel.c: Silence some gcc -Wall warnings.
* gtk/gtkmain.c: If we HAVE_BIND_TEXTDOMAIN_CODESET, tell libintl
to use UTF-8.
2002-01-22 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkgc-win32.c (gdk_colormap_color): For (single-bit
depth) bitmaps (recognized by having a null colormap), use
DIBINDEX.
* gdk/win32/*.c: Always use format %p instead of %#x in debugging
output of GDI HANDLEs.
2002-01-21 Tor Lillqvist <tml@iki.fi>
Big cleanups and fixes to 256-colour mode: Too many changes to
list here in detail, partial list below. All GIMP features now
seem to work as previously in 16- and 32-bit colour mode, plus
also in 256-colour mode.
The Win32 pixmap and image code is still very ugly. Lots of
duplicated code snippets that create DIB sections, select and
realize palettes, etc. Now when I finally got 256-colour mode
working, I really need to go through the code and factorize out
such common snippets.
Probably it would be a good idea to keep the pointer to the DIB
section's pixels also for GdkPixmaps, and not just GdkImages
(where it of course is visible to the application, even). Maybe
even have a GdkImage struct as such as a part of the private data
for Win32 GdkPixmaps? Having the pixel data accessible would
simplify gdk_win32_bitmap_to_region() a lot. Perhaps
gdk_image_get() and _put() between pixmaps and images, too, and
maybe even gdk_win32_draw_drawable(). We could skip all the HDC
and palette setup and the BitBlt, and just copy the bits
ourselves. Hmm. It might seem silly to roll your own BitBlt, but
if we did that, we wouldn't have to bother about HDCs and palettes
at all when blitting between bitmaps (pixmaps and/or images).
OTOH, when blitting to/from a window, we still would need the
palette setup. Maybe just some nice refactoring.
* gdk/win32/gdkprivate-win32.h: Remove definitions of the X11
structs ColormapStruct, Visual and XStandardColormap.
(GdkGCWin32Data): Add field holdpal to hold the previous palette
selected into the DC.
(GdkVisualPrivate): No need for a poiner to an X11 Visual
emulating struct.
(GdkWin32PalEntryState): New enum, describing the state of logical
palette entries: static (the 20 static colours), available or in
use.
(GdkColormapPrivateWin32): Instead of the X11 emulation Colormap
struct pointer, store the Windows logical palette HPALETTE
directly here, plus its current size and the state of its entries.
* gdk/win32/gdkcc-win32.c: Don't use the removed XStandardColormap
or Visual structs.
* gdk/win32/gdkcolor-win32.c: Rename static functions to shorter
names. Add much debugging output.
(create_colormap): As we implement both "shared" and "private"
colormaps identically on Win32, always allocate a Windows logical
palette containing the (presumably 20) static colours from the
system palette, marked as such.
(gdk_win32_print_paletteentries, gdk_win32_print_system_palette,
gdk_win32_print_hpalette): New debugging functions.
(gdk_colormap_free_colors): Instead of keeping two essentially
identical functions "in sync" (this and gdk_colors_free()), build
a table of the pixel values and call gdk_colors_free from here...
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_drawable): In
256-colour mode, when blitting from a window, select and realize
palette.
* gdk/win32/gdkevents-win32.c (update_colors): New function. Call
UpdateColors() on a window and all its descendants.
(synthesize_expose_events_children): New function: Synthesize
expose events for a window and all its descendants, in order to
realize our palettes and redraw everything.
(gdk_event_translate): Handle WM_QUERYNEWPALETTE: Call
synthesize_expose_events_children().
Handle WM_PALETTECHANGED: Call update_colors(), or if we have done
that three times already (a randomly chosen limit), generate
expose events.
* gdk/win32/gdkwindow-win32.c (gdk_window_get_children):
Implement, using EnumChildWindows().
2002-01-21 Tor Lillqvist <tml@iki.fi>
* gdk/gdkprivate.h: Add new flags to GdkDebugFlag:
GDK_DEBUG_COLORMAP, GDKRGB, GC, PIXMAP, IMAGE, INPUT and CURSOR.
* gdk/gdk.c: Handle them.
(gdk_init_check): Check also for '/'-delimited argv[0].
* gdk/gdkrgb.c: Indentation fixups. Add some logging messages
using GDK_NOTE (GDKRGB, ...). Seg gdk_rgb_verbose if
GDK_DEBUG_GDKRGB is turned on.
* gdk/win32/gdkcursor-win32.c
* gdk/win32/gdkgc-win32.c
* gdk/win32/gdkinput-win32.c
* gdk/win32/gdkimage-win32.c
* gdk/win32/gdkpixmap-win32.c: Use the new flags instead of MISC.
2002-01-13 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkgc-win32.c (get_bw_palette): New function, factored
out from:
(predraw_set_foreground, BitmapToRegion): Use it.
* gtk/Makefile.am (gtk-win32res.lo): Depend on gtk.def and
libgtk_la_OBJECTS.
* gtk/gtk.def: Add _gtk_private_signals and _gtk_private_n_signals
to really export them. Some applications apparently use these
private variables.
2002-01-12 Tor Lillqvist <tml@iki.fi>
Palettized mode improvements by Stephan R.A. Deibel
<sdeibel@archaeopteryx.com>:
* win32/gdkevents-win32.c (gdk_win32_erase_background)
* win32/gdkgc-win32.c (gdk_colormap_color, predraw_set_foreground)
* win32/gdkimage-win32.c (gdk_image_put): Improve support for
palettized (256-colour) mode.
* win32/gdkvisual-win32.c (gdk_visual_init): But still require the
GDK_WIN32_ENABLE_BROKEN_PSEUDOCOLOR_VISUAL environment variable,
as the palettized mode support is unusable for the GIMP, for
instance (IMHO).
2002-01-12 Tor Lillqvist <tml@iki.fi>
* win32/gdkcolor-win32.c: Silence gcc -Wall. Mark
gdk_colormap_sync() static.
* gdk/win32/gdkdnd-win32.c: Silence gcc -Wall.
2002-01-12 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkselection-win32.c (gdk_selection_convert): Report
failure to requestor also if we cannot handle the target asked
for.
* gdk/win32/gdkdnd-win32.c: Some indentation fixes.
Applying more of the Archaeopteryx Software patches:
* gdk/win32/gdkgc-win32.c (predraw_set_foreground): Better error
checking.
2002-01-09 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkglobals-win32.c
* gdk/win32/gdkmain-win32.c
* gdk/win32/gdkevents-win32.c: Remove declaration, definition,
initialisation and handling of gdk_selection_notify_msg,
gdk_selection_request_msg and gdk_selection_clear_msg. They aren't
generated any longer.
2002-01-09 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkevents-win32.c (event_mask_string, print_event,
print_event_state): Use nifty macros.
(print_event_mask): Remove, use event_mask_string().
* gdk/win32/gdkselection-win32.c (gdk_text_property_to_text_list,
gdk_free_text_list, gdk_string_to_compound_text,
gdk_free_compound_text): Implement trivially, always as
single-element text list or single-component compound text.
2002-01-09 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkselection-win32.c (gdk_selection_convert): Fix
non-ASCII paste from the clipboard: Try getting the same formats
from the Windows clipboard that gdk_property_change() puts there:
CF_UNICODETEXT, UTF8_STRING or CF_TEXT+CF_LOCALE.
2002-01-09 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkselection-win32.c (gdk_selection_owner_set)
* gdk/win32/gdkselection-win32.c (gdk_selection_owner_get): Do
support PRIMARY. Seems to work fine after all (intra-app).
2002-01-09 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkglobals-win32.c: New global variables
compound_text_atom, cf_rtf and cf_utf8_string.
* gdk/win32/gdkprivate-win32.h: Declare them.
* gdk/win32/gdkmain-win32.c: Initialise them.
* gdk/win32/gdkproperty-win32.c
* gdk/win32/gdkselection-win32.c: Use them.
2002-01-09 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkselection-win32.c (gdk_selection_owner_set,
gdk_selection_send_notify, generate_selection_notify): Don't use
SendMessage to generate events for the same app, instead use
gdk_event_put().
* gdk/win32/gdkevents-win32.c (gdk_event_translate):
Correspondingly, for the messages that shouldn't come in any
longer, assert if one does. Will remove the
gdk_selection_*_msg variables and handling code completely
after a while.
2002-01-09 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkim-win32.c (gdk_nwchar_ts_to_mbs): New function,
converts from a wchar_t string to UTF-8.
* gdk/win32/gdkprivate-win32.h: Declare it.
* gdk/win32/gdkevents-win32.c (build_keypress_event): Use it.
2002-01-08 Tor Lillqvist <tml@iki.fi>
Solve the Unicode issue with copying text to the Windows
clipboard. (Still need to add code for pasting from the
clipboard. That will be easy, but I'm tired now.)
* gdk/win32/gdkproperty-win32.c (gdk_property_change): When
storing text on the clipboard, handle non-ASCII text
correctly. The logic is as follows:
If we have only ASCII characters, use CF_TEXT.
Else, if we are on NT, use CF_UNICODETEXT.
Else (we are on Win9x), if all the characters are present in the
code page of some installed locale, use CF_TEXT and also set
CF_LOCALE to that locale.
Else (still on Win9x) store as RTF. We use a very simple RTF
string, just the text, no fonts or other crap, with the non-ASCII
characters as Unicode \uN keywords. Additionally, also store the
UTF-8 string as such, under the format "UTF8_STRING", so that GDK
can also paste from the Clipboard what it has copied there. (Thus
no need to implement any RTF parser.)
(find_common_locale): New function, implements the search for a
locale for case 3 above.
(gdk_property_delete): Don't declare gdk_selection_property_delete()
here.
* gdk/win32/gdkprivate-win32.h: Declare
gdk_selection_property_delete() here instead.
* gdk/win32/gdkselection-win32.c: Remove some unnecessary logging.
2002-01-06 Tor Lillqvist <tml@iki.fi>
Some bug fixes and cleanup of selection and DND functionality. Now
cut&paste inside an application works again. Removed attempts at
supporting the X11 PRIMARY selection -style cut&paste, can't be
made to work correctly anyway, and is "non-Windowsish".
There are still things that need to be fixed regarding the
clipboard and DND:
- Unicode issues. We currently bluntly store UTF-8 text as
CF_TEXT, and expect CF_TEXT to be UTF-8. This is very wrong, just
try to copy-paste non-ASCII text between a GTK+ app and Notepad,
for instance. Instead we should use CF_UNICODETEXT if we are on
NT. If on 9x, when storing into the clipboard, check if the string
can be represented in a single code page, and in that case use
that. Also, store CF_LOCALE data in the clipboard to (indirectly)
indicate that code page.
Problem: How to elegantly check what code page, if any, contains
all the Unicode characters in a string? What if there is no such
code page, don't store anything then?
Problem: In order to store CF_LOCALE data, how does one find a
language that uses the code page in question? Build a reverse
mapping table once, use that?
- Handling of non-text data in the clipboard. Not that I think
any relevant GTK+ application even tries to handle much else
than text on the clipboard?
- Need to add Archaeopteryx Software's OLE2 DND support.
* gdk/win32/gdkdnd-win32.c: Plug memory leaks, the
gdk_drag_context_ref() was called unnecessarily in a couple of
places, meaning drag contexts were never freed.
(gdk_drop_reply): For WIN32_DROPFILES drops, free the temporarily
stored file list.
* gdk/win32/gdkproperty-win32.c
* gdk/win32/gdkselection-win32.c: Now we don't try to support the
X11 PRIMARY selection -style cut&paste at all, it won't fit anyway
in the Windows cut&paste model. Only support CLIPBOARD style
cut&paste, which matches nicely with Windows Clipboard.
Clear up the use of the sel_prop_table. Now it is used only for
storing the GDK_SELECTION "properties".
The file names dropped with WM_DROPFILES -style DND is stored
temporarily (between the drop and the target picking them up) in a
separate place.
Have a separate hash table to map selection atoms to owner
windows. This used to be quite mixed up.
(sel_prop_store): Now static.
(gdk_win32_dropfiles_store): New function, to store the dropped
file list for the drop target to possibly fetch, and clear it
afterwards, from gdk_drop_reply().
(gdk_selection_owner_get): Much simplified now.
* gdkprivate-win32.h: Declare gdk_win32_dropfiles_store.
* gdkglobals-win32.c
* gdkmain-win32.c: gdk_selection_property is a GdkAtom, not
ATOM. Declare also text_uri_list_atom globally, initialise.
* gdkwindow-win32.c: Some lint cleanup (ambiguous else, unused
variables).
2001-12-28 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkfont-win32.c: Use G_N_ELEMENTS().
(unicode_classify): Don't fail with an assertion on encountering
an unclassified character, but punt and return U_BASIC_LATIN.
2001-12-23 Tor Lillqvist <tml@iki.fi>
* gdk/win32/*.c: Lint cleanup.
Changes contributed by Archaeopteryx Software: This is the
first batch of their changes. Will commit more later.
* gdk/gdk.def: Add gdk_add_client_message_filter.
* gdk/gdkgc.c (gdk_gc_unref): Plug memory leak: g_free() the gc
after calling the destroy function.
* gdk/win32/*.c: Add more checks for failed GDI calls. If a call
fails, don't use bogus values.
* gdk/win32/gdkcursor-win32.c (_gdk_win32_data_to_wcursor): Plug
memory leak: g_free() the AND and XOR bitmaps after use.
(_gdk_cursor_destroy): Set the current cursor to none if we are
destroying it.
* gdk/win32/gdkevents-win32.c: Remove superfluous duplicate
definition of client_filters.
* gdk/win32/gdkwindow-win32.c (gdk_win32_window_destroy): If the
window has a cursor, and it is the current cursor, before
destroying it set the current cursor to none.
(gdk_window_foreign_new): If the window id is 0, return NULL.
(gdk_window_clear_area): Report ReleaseDC failure.
(gdk_window_set_cursor): Also here, set current cursor to none if
destroying the current cursor.
(gdk_window_get_pointer): Revamp logic.
2001-11-14 Tor Lillqvist <tml@iki.fi>
* gdk/gdkdrawable.h
* gdk/gdkdraw.c: Change gdk_drawable_get_data to return the data,
like in HEAD.
* gdk/gdkdnd.h
* gdk/win32/gdkdnd-win32.c: Implement GDK_DRAG_PROTO_LOCAL
(backport from HEAD).
* gdk/win32/gdkselection-win32.c: Also here some backported
changes for GDK_DRAG_PROTO_LOCAL.
2001-11-10 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkgc-win32.c: Decrease size of pen and DC cache to 3
(from 5). Otherwise we get "ReleaseDC failed" errors on Win9x.
2001-11-08 Tor Lillqvist <tml@iki.fi>
* README.win32: Add headers. Add section about ActiveIMM.
* configure.in: Add --with-ie55 flag to specify the location of
the "IE55 libs and headers" package downloadable from Microsoft,
which contains, among other things, the Active IMM header dimm.h
and UUID library uuid.lib. Use test -f instead of AC_CHECK_FILE.
Require GLib 1.3.10.
* acconfig.h: Add HAVE_DIMM_H.
* config.h.win32: Add comment regarding dimm.h.
* gdk/Makefile.am
* gdk/win32/Makefile.am: Handle the uuid library from the IE55 lib.
* gdk/win32/gdkevents-win32.c: Conditionalize ActiveIMM stuff.
* gdk/win32/surrogate-dimm.h: Remove, use real dimm.h instead (if
available).
* gdk/win32/libie55uuid.la: New file, handwritten libtool wrapper
for uuid.lib. (Does it really have to be this hard to use an
existing library with libtool? Probably I am missing something.)
2001-11-06 Tor Lillqvist <tml@iki.fi>
* gtk+-zip.sh: Separate runtime and developer packages.
The following seems to fix Bug#60620:
* gdk/win32/gdkprivate-win32.h (struct _GdkWindowWin32Data): Add
owner thread id.
* gdk/win32/gdkwindow-win32.c (gdk_window_clear_area): Instead of
calling sending WM_ERASEBKGND to the window, call the window
procedure directly. Clean out the #if 0 cruft.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_drawable): If the
window is owned by another thread, don't call UpdateWindow(), but
post WM_PAINT to the thread.
2001-10-30 Tor Lillqvist <tml@iki.fi>
* gtk+-1.3-win32-production.pc.in
* gdk-1.3-win32-production.pc.in: Should not use @prefix@ elsewhere
than in definition of the 'prefix' variable. @exec_prefix@,
@libdir@ and @includedir@ are defined by configure to include
'${prefix}' (literally like that), so everything will work as
if by magic.
2001-10-28 Tor Lillqvist <tml@iki.fi>
* gdk-1.3-win32-production.pc.in (Cflags): Use correct
path to platform-dependent includes: ${libdir}/gtk+/include.