fix typo for GTK_VER; define HAVE_CONFIG_H cause gtkprogressbar.c has

2005-09-18  Hans Breuer  <hans@breuer.org>

	* gtk/makefile.msc.in : fix typo for GTK_VER; define HAVE_CONFIG_H
	cause gtkprogressbar.c has #include <config.h> conditionally; less
	noise from generated gtk.def
	* gtk/stock-icons/makefile.msc gdk/makefile.msc tests/makefile.msc : updated

	* gtk/gtktrayicon-win32.c : dummy implmentation to make gtk compile.
	For me it works as well as the *NIX implemenation, that is not at all.

	* gdk/win32/gdkproperty-win32.c : implement gdk_atom_intern_static_string()

	* gdk/win32/gdkwindow-win32.c(gdk_window_set_urgency_hint) : only use
	only use (WINVER >= 0x0500) when available from the SDK. Otherwise fall
	back to true dynamic linking of FlashWindowEx. Makes gtk+ work on NT4.0
	again - if compiled properly.

	* tests/teststatusicon.c : don't use GNOME icons for testing, but icons
	already coming with Gtk+. Makes it compile on win32.
This commit is contained in:
Hans Breuer 2005-09-18 12:28:42 +00:00 committed by Hans Breuer
parent 1127a03f71
commit e5d06c7ca9
10 changed files with 164 additions and 17 deletions

View File

@ -1,3 +1,23 @@
2005-09-18 Hans Breuer <hans@breuer.org>
* gtk/makefile.msc.in : fix typo for GTK_VER; define HAVE_CONFIG_H
cause gtkprogressbar.c has #include <config.h> conditionally; less
noise from generated gtk.def
* gtk/stock-icons/makefile.msc gdk/makefile.msc tests/makefile.msc : updated
* gtk/gtktrayicon-win32.c : dummy implmentation to make gtk compile.
For me it works as well as the *NIX implemenation, that is not at all.
* gdk/win32/gdkproperty-win32.c : implement gdk_atom_intern_static_string()
* gdk/win32/gdkwindow-win32.c(gdk_window_set_urgency_hint) : only use
only use (WINVER >= 0x0500) when available from the SDK. Otherwise fall
back to true dynamic linking of FlashWindowEx. Makes gtk+ work on NT4.0
again - if compiled properly.
* tests/teststatusicon.c : don't use GNOME icons for testing, but icons
already coming with Gtk+. Makes it compile on win32.
2005-09-18 Guilherme de S. Pastore <gpastore@cvs.gnome.org>
* README.cvs-commits: fixed some tiny typos

View File

@ -1,3 +1,23 @@
2005-09-18 Hans Breuer <hans@breuer.org>
* gtk/makefile.msc.in : fix typo for GTK_VER; define HAVE_CONFIG_H
cause gtkprogressbar.c has #include <config.h> conditionally; less
noise from generated gtk.def
* gtk/stock-icons/makefile.msc gdk/makefile.msc tests/makefile.msc : updated
* gtk/gtktrayicon-win32.c : dummy implmentation to make gtk compile.
For me it works as well as the *NIX implemenation, that is not at all.
* gdk/win32/gdkproperty-win32.c : implement gdk_atom_intern_static_string()
* gdk/win32/gdkwindow-win32.c(gdk_window_set_urgency_hint) : only use
only use (WINVER >= 0x0500) when available from the SDK. Otherwise fall
back to true dynamic linking of FlashWindowEx. Makes gtk+ work on NT4.0
again - if compiled properly.
* tests/teststatusicon.c : don't use GNOME icons for testing, but icons
already coming with Gtk+. Makes it compile on win32.
2005-09-18 Guilherme de S. Pastore <gpastore@cvs.gnome.org>
* README.cvs-commits: fixed some tiny typos

View File

@ -154,7 +154,9 @@ gdkaliasdef.c: gdk.symbols
gdk.def: gdk.symbols
echo EXPORTS > gdk.def
cl /EP -DINCLUDE_VARIABLES -DG_OS_WIN32 -DGDK_WINDOWING_WIN32 -DALL_FILES gdk.symbols >> gdk.def
cl /EP -DINCLUDE_VARIABLES -DG_OS_WIN32 -DGDK_WINDOWING_WIN32 -DALL_FILES \
-DG_GNUC_CONST= \
gdk.symbols >> gdk.def
libgdk-win32-$(GTK_VER)-0.dll : $(gdk_OBJECTS) gdk.def win32\gdk-win32.lib
$(CC) $(CFLAGS) -LD -Fe$@ $(gdk_OBJECTS) win32\gdk-win32.lib $(EXTRALIBS) \

View File

@ -84,6 +84,15 @@ gdk_atom_intern (const gchar *atom_name,
return retval;
}
GdkAtom
gdk_atom_intern_static_string (const gchar *atom_name)
{
/* on X11 this is supposed to save memory. On win32 there seems to be
* no way to make a difference ?
*/
return gdk_atom_intern (atom_name, FALSE);
}
gchar *
gdk_atom_name (GdkAtom atom)
{

View File

@ -29,9 +29,6 @@
#include <config.h>
#include <stdlib.h>
#define _WIN32_WINNT 0x0500
#define WINVER _WIN32_WINNT
#include "gdk.h" /* gdk_rectangle_intersect */
#include "gdkevents.h"
#include "gdkpixmap.h"
@ -1574,6 +1571,8 @@ void
gdk_window_set_urgency_hint (GdkWindow *window,
gboolean urgent)
{
#if (WINVER >= 0x0500)
FLASHWINFO flashwinfo;
g_return_if_fail (GDK_IS_WINDOW (window));
@ -1592,6 +1591,35 @@ gdk_window_set_urgency_hint (GdkWindow *window,
flashwinfo.dwTimeout = 0;
FlashWindowEx (&flashwinfo);
#else
struct _FLASHWINDOW
{
UINT cbSize;
HWND hwnd;
DWORD dwFlags;
UINT uCount;
DWORD dwTimeout;
} flashwindow = { sizeof(flashwindow), GDK_WINDOW_HWND (window), urgent ? 0x07 : 0x0, 0, 0 };
typedef BOOL (*PFN_FlashWindowEx) (struct _FLASHWINDOW);
PFN_FlashWindowEx flashWindowEx = NULL;
gboolean once = TRUE;
g_return_if_fail (GDK_IS_WINDOW (window));
g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD);
if (GDK_WINDOW_DESTROYED (window))
return;
if (once)
{
flashWindowEx = (PFN_FlashWindowEx)GetProcAddress (GetModuleHandle ("user32.dll"), "FlashWindowEx");
once = FALSE;
}
if (flashWindowEx)
flashWindowEx(flashwindow);
else
FlashWindow (GDK_WINDOW_HWND (window), urgent);
#endif
}
void

64
gtk/gtktrayicon-win32.c Normal file
View File

@ -0,0 +1,64 @@
/* gtktrayicon.c
* Copyright (C) 2002 Anders Carlsson <andersca@gnu.org>
* Copyright (C) 2005 Hans Breuer <hans@breuer.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* This is an implementation of the gtktrayicon interface *not*
* following the freedesktop.org "system tray" spec,
* http://www.freedesktop.org/wiki/Standards/systemtray-spec
*/
#include <config.h>
#include <string.h>
#include <libintl.h>
#include "gtkintl.h"
#include "gtkprivate.h"
#include "gtktrayicon.h"
#include "gtkalias.h"
G_DEFINE_TYPE (GtkTrayIcon, gtk_tray_icon, GTK_TYPE_PLUG);
static void
gtk_tray_icon_class_init (GtkTrayIconClass *class)
{
}
static void
gtk_tray_icon_init (GtkTrayIcon *icon)
{
}
GtkTrayIcon *
_gtk_tray_icon_new (const gchar *name)
{
return g_object_new (GTK_TYPE_TRAY_ICON,
"title", name,
NULL);
}
GtkOrientation
_gtk_tray_icon_get_orientation (GtkTrayIcon *icon)
{
g_return_val_if_fail (GTK_IS_TRAY_ICON (icon), GTK_ORIENTATION_HORIZONTAL);
//FIXME: should we deliver the orientation of the tray ??
return GTK_ORIENTATION_VERTICAL;
}

View File

@ -455,7 +455,9 @@ generated : $(GENERATED)
gtk.def: gtk.symbols makefile.msc
echo EXPORTS > gtk.def
cl /EP -DINCLUDE_VARIABLES -DG_OS_WIN32 -DALL_FILES gtk.symbols >> gtk.def
cl /EP -DINCLUDE_VARIABLES -DG_OS_WIN32 -DALL_FILES \
-DG_GNUC_CONST= -DG_GNUC_NULL_TERMINATED= \
gtk.symbols >> gtk.def
gtkalias.h: gtk.symbols
cl /EP -DG_OS_WIN32 -DGTK_WINDOWING_WIN32 -DINCLUDE_INTERNAL_SYMBOLS gtk.symbols | $(PERL) makegtkalias.pl > gtkalias.h

View File

@ -143,6 +143,8 @@ VARIABLES2 = \
stock_search_24 stock_search_24.png \
stock_search_replace_16 stock_search_replace_16.png \
stock_search_replace_24 stock_search_replace_24.png \
stock_select_all_16 stock_select_all_16.png \
stock_select_all_24 stock_select_all_24.png \
stock_sort_ascending_16 stock_sort_ascending_16.png \
stock_sort_ascending_24 stock_sort_ascending_24.png \
stock_sort_descending_16 stock_sort_descending_16.png \

View File

@ -53,7 +53,7 @@ TESTAPPS = \
testtext testtextbuffer testtoolbar \
testtreecolumns testtreeedit testtreeflow testtreefocus \
testtreesort testtreeview treestoretest \
testsocket testsocket_child \
testsocket testsocket_child teststatusicon \
testthreads testxinerama \
simple

View File

@ -25,11 +25,11 @@
typedef enum
{
TEST_STATUS_FILE,
TEST_STATUS_DIRECTORY
TEST_STATUS_INFO,
TEST_STATUS_QUESTION
} TestStatus;
static TestStatus status = TEST_STATUS_FILE;
static TestStatus status = TEST_STATUS_INFO;
static gint timeout = 0;
static void
@ -38,15 +38,15 @@ update_icon (GtkStatusIcon *status_icon)
gchar *icon_name;
gchar *tooltip;
if (status == TEST_STATUS_FILE)
if (status == TEST_STATUS_INFO)
{
icon_name = "gnome-fs-regular";
tooltip = "Regular File";
icon_name = GTK_STOCK_DIALOG_INFO;
tooltip = "Some Infromation ...";
}
else
{
icon_name = "gnome-fs-directory";
tooltip = "Directory";
icon_name = GTK_STOCK_DIALOG_QUESTION;
tooltip = "Some Question ...";
}
gtk_status_icon_set_from_icon_name (status_icon, icon_name);
@ -58,10 +58,10 @@ timeout_handler (gpointer data)
{
GtkStatusIcon *icon = GTK_STATUS_ICON (data);
if (status == TEST_STATUS_FILE)
status = TEST_STATUS_DIRECTORY;
if (status == TEST_STATUS_INFO)
status = TEST_STATUS_QUESTION;
else
status = TEST_STATUS_FILE;
status = TEST_STATUS_INFO;
update_icon (icon);