]> Pileus Git - ~andy/gtk/commitdiff
fix typo for GTK_VER; define HAVE_CONFIG_H cause gtkprogressbar.c has
authorHans Breuer <hans@breuer.org>
Sun, 18 Sep 2005 12:28:42 +0000 (12:28 +0000)
committerHans Breuer <hans@src.gnome.org>
Sun, 18 Sep 2005 12:28:42 +0000 (12:28 +0000)
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.

ChangeLog
ChangeLog.pre-2-10
gdk/makefile.msc
gdk/win32/gdkproperty-win32.c
gdk/win32/gdkwindow-win32.c
gtk/gtktrayicon-win32.c [new file with mode: 0644]
gtk/makefile.msc.in
gtk/stock-icons/makefile.msc
tests/makefile.msc
tests/teststatusicon.c

index 62b6a330d4ff76611d48de0c9d89047097435fe8..82f53a424dbcdf605677240bc849bdfea8f941a8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 62b6a330d4ff76611d48de0c9d89047097435fe8..82f53a424dbcdf605677240bc849bdfea8f941a8 100644 (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
index 66bb791d2a0eac0ce9431e4eee2745be30256bbe..bb8d147151959d734bb3fa46c1eb0e1979b3850c 100644 (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) \
index 21ca464d2df4607ffc05e974beced39542b59e7c..5eff72add0fce4d233ed42a1e5104661f6dbbfbd 100644 (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)
 {
index 81d764cc40e5f6cf617bd021b4611f0a5366d67b..5c2f5a095ea4b3ba984d841587f1129b7a0045d9 100644 (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 
diff --git a/gtk/gtktrayicon-win32.c b/gtk/gtktrayicon-win32.c
new file mode 100644 (file)
index 0000000..d89fe0b
--- /dev/null
@@ -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;
+}
+
index ef14f651e58f68c32efe30d3c72dc1fe194ee669..3573c7fbe6b773861e59c9c127908487b6de1de8 100644 (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
index b27a387f18b3385156dd826517ed876ecdcf1948..1913e46a5471d6b6e1c14f8f58cd347d2dc48933 100644 (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    \
index f0891c2c1b1cd88329fcb33eb02c7162ae83ddea..778db5e3c8c435477d47a9d10379914874a662f4 100644 (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 
 
index 467baf5dd5f70e624d3edb7ddb20925f76f4cc1f..738181d30d983cdf7538a9e6dd6b45d22d3e0f97 100755 (executable)
 
 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);