Skip to content

Commit

Permalink
make it compile and more similar to the X11 implementation [backward
Browse files Browse the repository at this point in the history
2004-08-06  Hans Breuer  <[email protected]>

	* gdk/win32/gdkwindow-win32.c : make it compile and more
	similar to the X11 implementation [backward compatibility
	for GDK_WINDOW_TEMP, GDK_INPUT_ONLY (fixes bug #148702),
	use the *screen* function variants, dont reparent already
	destroyed]
	(get_visible_region) : take the win32 part into account
	(_gdk_windowing_window_destroy) : remove from handle table

	* gdk/win32/gdkdisplay-win32.c : added
	gdk_display_(request|supports)_selection_notification ()
	with a currently mostly pointless implementation ;-)

	* gtk/gtkfilesystemwin32.c (*_to_path) : same changes as on *NIX,
	plugs memory leak
	(gtk_file_system_win32_render_icon) : use new GTK_STOCK_DIRECTORY

	* gtk/makefile.msc.in demos/gtk-demo/makefile.msc.in
	  gtk/stock-icons/makefile.msc tests/makefile.msc : updated

	* gdk/gdk.def gtk/gtk.def : updated externals

	* tests/testiconview.c : remove unneeded dirent.h inclusion
  • Loading branch information
Hans Breuer authored and Hans Breuer committed Aug 6, 2004
1 parent bec2974 commit 7405177
Show file tree
Hide file tree
Showing 14 changed files with 467 additions and 52 deletions.
25 changes: 25 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
2004-08-06 Hans Breuer <[email protected]>

* gdk/win32/gdkwindow-win32.c : make it compile and more
similar to the X11 implementation [backward compatibility
for GDK_WINDOW_TEMP, GDK_INPUT_ONLY (fixes bug #148702),
use the *screen* function variants, dont reparent already
destroyed]
(get_visible_region) : take the win32 part into account
(_gdk_windowing_window_destroy) : remove from handle table

* gdk/win32/gdkdisplay-win32.c : added
gdk_display_(request|supports)_selection_notification ()
with a currently mostly pointless implementation ;-)

* gtk/gtkfilesystemwin32.c (*_to_path) : same changes as on *NIX,
plugs memory leak
(gtk_file_system_win32_render_icon) : use new GTK_STOCK_DIRECTORY

* gtk/makefile.msc.in demos/gtk-demo/makefile.msc.in
gtk/stock-icons/makefile.msc tests/makefile.msc : updated

* gdk/gdk.def gtk/gtk.def : updated externals

* tests/testiconview.c : remove unneeded dirent.h inclusion

2004-08-06 Matthias Clasen <[email protected]>

* gtk/gtktreeview.c (gtk_tree_view_move_cursor_page_up_down): Fix
Expand Down
25 changes: 25 additions & 0 deletions ChangeLog.pre-2-10
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
2004-08-06 Hans Breuer <[email protected]>

* gdk/win32/gdkwindow-win32.c : make it compile and more
similar to the X11 implementation [backward compatibility
for GDK_WINDOW_TEMP, GDK_INPUT_ONLY (fixes bug #148702),
use the *screen* function variants, dont reparent already
destroyed]
(get_visible_region) : take the win32 part into account
(_gdk_windowing_window_destroy) : remove from handle table

* gdk/win32/gdkdisplay-win32.c : added
gdk_display_(request|supports)_selection_notification ()
with a currently mostly pointless implementation ;-)

* gtk/gtkfilesystemwin32.c (*_to_path) : same changes as on *NIX,
plugs memory leak
(gtk_file_system_win32_render_icon) : use new GTK_STOCK_DIRECTORY

* gtk/makefile.msc.in demos/gtk-demo/makefile.msc.in
gtk/stock-icons/makefile.msc tests/makefile.msc : updated

* gdk/gdk.def gtk/gtk.def : updated externals

* tests/testiconview.c : remove unneeded dirent.h inclusion

2004-08-06 Matthias Clasen <[email protected]>

* gtk/gtktreeview.c (gtk_tree_view_move_cursor_page_up_down): Fix
Expand Down
25 changes: 25 additions & 0 deletions ChangeLog.pre-2-6
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
2004-08-06 Hans Breuer <[email protected]>

* gdk/win32/gdkwindow-win32.c : make it compile and more
similar to the X11 implementation [backward compatibility
for GDK_WINDOW_TEMP, GDK_INPUT_ONLY (fixes bug #148702),
use the *screen* function variants, dont reparent already
destroyed]
(get_visible_region) : take the win32 part into account
(_gdk_windowing_window_destroy) : remove from handle table

* gdk/win32/gdkdisplay-win32.c : added
gdk_display_(request|supports)_selection_notification ()
with a currently mostly pointless implementation ;-)

* gtk/gtkfilesystemwin32.c (*_to_path) : same changes as on *NIX,
plugs memory leak
(gtk_file_system_win32_render_icon) : use new GTK_STOCK_DIRECTORY

* gtk/makefile.msc.in demos/gtk-demo/makefile.msc.in
gtk/stock-icons/makefile.msc tests/makefile.msc : updated

* gdk/gdk.def gtk/gtk.def : updated externals

* tests/testiconview.c : remove unneeded dirent.h inclusion

2004-08-06 Matthias Clasen <[email protected]>

* gtk/gtktreeview.c (gtk_tree_view_move_cursor_page_up_down): Fix
Expand Down
25 changes: 25 additions & 0 deletions ChangeLog.pre-2-8
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
2004-08-06 Hans Breuer <[email protected]>

* gdk/win32/gdkwindow-win32.c : make it compile and more
similar to the X11 implementation [backward compatibility
for GDK_WINDOW_TEMP, GDK_INPUT_ONLY (fixes bug #148702),
use the *screen* function variants, dont reparent already
destroyed]
(get_visible_region) : take the win32 part into account
(_gdk_windowing_window_destroy) : remove from handle table

* gdk/win32/gdkdisplay-win32.c : added
gdk_display_(request|supports)_selection_notification ()
with a currently mostly pointless implementation ;-)

* gtk/gtkfilesystemwin32.c (*_to_path) : same changes as on *NIX,
plugs memory leak
(gtk_file_system_win32_render_icon) : use new GTK_STOCK_DIRECTORY

* gtk/makefile.msc.in demos/gtk-demo/makefile.msc.in
gtk/stock-icons/makefile.msc tests/makefile.msc : updated

* gdk/gdk.def gtk/gtk.def : updated externals

* tests/testiconview.c : remove unneeded dirent.h inclusion

2004-08-06 Matthias Clasen <[email protected]>

* gtk/gtktreeview.c (gtk_tree_view_move_cursor_page_up_down): Fix
Expand Down
4 changes: 4 additions & 0 deletions demos/gtk-demo/makefile.msc.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ all : \
DEMOS = \
appwindow.c \
button_box.c \
clipboard.c \
colorsel.c \
dialog.c \
drawingarea.c \
editable_cells.c \
entry_completion.c \
expander.c \
hypertext.c \
iconview.c \
images.c \
list_store.c \
menus.c \
Expand All @@ -64,13 +66,15 @@ OBJECTS = \
appwindow.obj \
button_box.obj \
changedisplay.obj \
clipboard.obj \
colorsel.obj \
dialog.obj \
drawingarea.obj \
editable_cells.obj \
entry_completion.obj \
expander.obj \
hypertext.obj \
iconview.obj \
images.obj \
list_store.obj \
menus.obj \
Expand Down
5 changes: 5 additions & 0 deletions gdk/gdk.def
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,13 @@ EXPORTS
gdk_display_pointer_is_grabbed
gdk_display_pointer_ungrab
gdk_display_put_event
gdk_display_request_selection_notification
gdk_display_set_double_click_distance
gdk_display_set_double_click_time
gdk_display_set_pointer_hooks
gdk_display_supports_cursor_alpha
gdk_display_supports_cursor_color
gdk_display_supports_selection_notification
gdk_display_sync
gdk_drag_abort
gdk_drag_action_get_type
Expand Down Expand Up @@ -127,6 +129,7 @@ EXPORTS
gdk_draw_points
gdk_draw_polygon
gdk_draw_rectangle
gdk_draw_rectangle_alpha_libgtk_only
gdk_draw_rgb_32_image
gdk_draw_rgb_32_image_dithalign
gdk_draw_rgb_image
Expand Down Expand Up @@ -467,11 +470,13 @@ EXPORTS
gdk_window_clear
gdk_window_clear_area
gdk_window_clear_area_e
gdk_window_configure_finished
gdk_window_constrain_size
gdk_window_deiconify
gdk_window_destroy
gdk_window_destroy_notify
gdk_window_edge_get_type
gdk_window_enable_synchronized_configure
gdk_window_end_paint
gdk_window_focus
gdk_window_foreign_new
Expand Down
135 changes: 135 additions & 0 deletions gdk/win32/gdkdisplay-win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,138 @@ gdk_display_get_default_group (GdkDisplay *display)

return NULL;
}

gboolean
gdk_display_supports_selection_notification (GdkDisplay *display)
{
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);

return TRUE;
}

static HWND _hwnd_next_viewer = NULL;

/*
* maybe this should be integrated with the default message loop - or maybe not ;-)
*/
static LRESULT CALLBACK
_win32_on_clipboard_change (HWND hwnd,
UINT message,
WPARAM wparam,
LPARAM lparam)
{
switch (message)
{
case WM_DESTROY : /* remove us from chain */
{
ChangeClipboardChain (hwnd, _hwnd_next_viewer);
return 0;
}
case WM_CHANGECBCHAIN :
{
HWND hwndRemove = (HWND) wparam; /* handle of window being removed */
HWND hwndNext = (HWND) lparam; /* handle of next window in chain */
if (hwndRemove == _hwnd_next_viewer)
_hwnd_next_viewer = hwndNext == hwnd ? NULL : hwndNext;
return 0;
}
case WM_DRAWCLIPBOARD :
{
/* create the appropriate gdk events */
HWND hwndOwner = GetClipboardOwner ();
UINT nFormat = 0;
int n = 0;

if (OpenClipboard (hwnd))
{
for (; 0 != (nFormat = EnumClipboardFormats (nFormat)); )
{
char sFormat[80];
if (GetClipboardFormatName (nFormat, sFormat, 80) > 0)
g_print ("%s ", sFormat);
n++; /* do something useful ? */
}
GDK_NOTE (DND,
g_print ("WM_DRAWCLIPBOARD : formats %d owner %#lx\n", n, hwndOwner));

CloseClipboard ();
}
/* XXX: generate the apropriate GdkEventOwnerChange ... */

/* don't break the chain */
return PostMessage (_hwnd_next_viewer, message, wparam, lparam);
}
default :
return DefWindowProc (hwnd, message, wparam, lparam);
}
}

/*
* Creates a hidden window and adds it to the clipboard chain
*/
HWND
_gdk_win32_register_clipboard_notification (void)
{
WNDCLASS wclass;
HWND hwnd;
ATOM klass;

memset (&wclass, 0, sizeof(WNDCLASS));
wclass.lpszClassName = "GdkClipboardNotification";
wclass.lpfnWndProc = _win32_on_clipboard_change;
wclass.hInstance = _gdk_app_hmodule;

klass = RegisterClass (&wclass);
if (!klass)
return NULL;

hwnd = CreateWindow (MAKEINTRESOURCE(klass),
NULL, WS_POPUP,
0, 0, 0, 0, NULL, NULL,
_gdk_app_hmodule, NULL);
if (!hwnd)
{
UnregisterClass (MAKEINTRESOURCE(klass), _gdk_app_hmodule);
return NULL;
}
_hwnd_next_viewer = SetClipboardViewer (hwnd);
return hwnd;
}

/*
* The whole function would only make sense if the gdk/win32 clipboard
* model is rewritten to do delayed rendering. Currently this is only
* testcode and as noted in
* http://mail.gnome.org/archives/gtk-devel-list/2004-May/msg00113.html
* probably not worth bothering ;)
*/
gboolean
gdk_display_request_selection_notification (GdkDisplay *display,
GdkAtom selection)

{
static HWND hwndViewer = NULL;
gboolean ret = FALSE;

GDK_NOTE (DND,
g_print ("gdk_display_request_selection_notification (..., %s)",
gdk_atom_name (selection)));

if (GDK_SELECTION_CLIPBOARD == selection)
{
if (!hwndViewer)
{
hwndViewer = _gdk_win32_register_clipboard_notification ();
GDK_NOTE (DND, g_print (" registered"));
}
ret = (hwndViewer != NULL);
}
else if (GDK_SELECTION_PRIMARY == selection)
{
/* seems to work by default ? */
GDK_NOTE (DND, g_print (" by default"));
ret = TRUE;
}
GDK_NOTE (DND, g_print (" -> %s\n", ret ? "TRUE" : "FALSE"));
return ret;
}
Loading

0 comments on commit 7405177

Please sign in to comment.