]> Pileus Git - ~andy/gtk/commitdiff
Fix start and end radial endpoint calculations which were totally wrong.
authorTor Lillqvist <tml@src.gnome.org>
Mon, 16 Aug 1999 04:45:01 +0000 (04:45 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Mon, 16 Aug 1999 04:45:01 +0000 (04:45 +0000)
* gdk/win32/gdkdraw.c (gdk_draw_arc): Fix start and end radial
endpoint calculations which were totally wrong. (A little RTFMing
helps a lot ;-)

* gtk/makefile.{cygwin,msc}: Use libintl extracted from glibc
from a separate directory, not from gettext, because of licensing
issues (we want to use the LGPL version).

* README.win32: Mention the intl from glibc vs from gettext issue.

12 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
README.win32
gdk/win32/gdkdraw.c
gdk/win32/gdkdrawable-win32.c
gtk/makefile.cygwin
gtk/makefile.msc

index 4f28d8b08df3593ac541114c4bbed0393adb5ae3..eeac154479b25d732e34f5ffef9339fc77016b85 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+1999-08-16  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/win32/gdkdraw.c (gdk_draw_arc): Fix start and end radial
+       endpoint calculations which were totally wrong. (A little RTFMing
+       helps a lot ;-)
+
+       * gtk/makefile.{cygwin,msc}: Use libintl extracted from glibc
+       from a separate directory, not from gettext, because of licensing
+       issues (we want to use the LGPL version).
+
+       * README.win32: Mention the intl from glibc vs from gettext issue.
+
 1999-08-13  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/win32/gdkevents.c (gdk_event_translate): Fix a couple of bugs
index 4f28d8b08df3593ac541114c4bbed0393adb5ae3..eeac154479b25d732e34f5ffef9339fc77016b85 100644 (file)
@@ -1,3 +1,15 @@
+1999-08-16  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/win32/gdkdraw.c (gdk_draw_arc): Fix start and end radial
+       endpoint calculations which were totally wrong. (A little RTFMing
+       helps a lot ;-)
+
+       * gtk/makefile.{cygwin,msc}: Use libintl extracted from glibc
+       from a separate directory, not from gettext, because of licensing
+       issues (we want to use the LGPL version).
+
+       * README.win32: Mention the intl from glibc vs from gettext issue.
+
 1999-08-13  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/win32/gdkevents.c (gdk_event_translate): Fix a couple of bugs
index 4f28d8b08df3593ac541114c4bbed0393adb5ae3..eeac154479b25d732e34f5ffef9339fc77016b85 100644 (file)
@@ -1,3 +1,15 @@
+1999-08-16  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/win32/gdkdraw.c (gdk_draw_arc): Fix start and end radial
+       endpoint calculations which were totally wrong. (A little RTFMing
+       helps a lot ;-)
+
+       * gtk/makefile.{cygwin,msc}: Use libintl extracted from glibc
+       from a separate directory, not from gettext, because of licensing
+       issues (we want to use the LGPL version).
+
+       * README.win32: Mention the intl from glibc vs from gettext issue.
+
 1999-08-13  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/win32/gdkevents.c (gdk_event_translate): Fix a couple of bugs
index 4f28d8b08df3593ac541114c4bbed0393adb5ae3..eeac154479b25d732e34f5ffef9339fc77016b85 100644 (file)
@@ -1,3 +1,15 @@
+1999-08-16  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/win32/gdkdraw.c (gdk_draw_arc): Fix start and end radial
+       endpoint calculations which were totally wrong. (A little RTFMing
+       helps a lot ;-)
+
+       * gtk/makefile.{cygwin,msc}: Use libintl extracted from glibc
+       from a separate directory, not from gettext, because of licensing
+       issues (we want to use the LGPL version).
+
+       * README.win32: Mention the intl from glibc vs from gettext issue.
+
 1999-08-13  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/win32/gdkevents.c (gdk_event_translate): Fix a couple of bugs
index 4f28d8b08df3593ac541114c4bbed0393adb5ae3..eeac154479b25d732e34f5ffef9339fc77016b85 100644 (file)
@@ -1,3 +1,15 @@
+1999-08-16  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/win32/gdkdraw.c (gdk_draw_arc): Fix start and end radial
+       endpoint calculations which were totally wrong. (A little RTFMing
+       helps a lot ;-)
+
+       * gtk/makefile.{cygwin,msc}: Use libintl extracted from glibc
+       from a separate directory, not from gettext, because of licensing
+       issues (we want to use the LGPL version).
+
+       * README.win32: Mention the intl from glibc vs from gettext issue.
+
 1999-08-13  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/win32/gdkevents.c (gdk_event_translate): Fix a couple of bugs
index 4f28d8b08df3593ac541114c4bbed0393adb5ae3..eeac154479b25d732e34f5ffef9339fc77016b85 100644 (file)
@@ -1,3 +1,15 @@
+1999-08-16  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/win32/gdkdraw.c (gdk_draw_arc): Fix start and end radial
+       endpoint calculations which were totally wrong. (A little RTFMing
+       helps a lot ;-)
+
+       * gtk/makefile.{cygwin,msc}: Use libintl extracted from glibc
+       from a separate directory, not from gettext, because of licensing
+       issues (we want to use the LGPL version).
+
+       * README.win32: Mention the intl from glibc vs from gettext issue.
+
 1999-08-13  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/win32/gdkevents.c (gdk_event_translate): Fix a couple of bugs
index 4f28d8b08df3593ac541114c4bbed0393adb5ae3..eeac154479b25d732e34f5ffef9339fc77016b85 100644 (file)
@@ -1,3 +1,15 @@
+1999-08-16  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/win32/gdkdraw.c (gdk_draw_arc): Fix start and end radial
+       endpoint calculations which were totally wrong. (A little RTFMing
+       helps a lot ;-)
+
+       * gtk/makefile.{cygwin,msc}: Use libintl extracted from glibc
+       from a separate directory, not from gettext, because of licensing
+       issues (we want to use the LGPL version).
+
+       * README.win32: Mention the intl from glibc vs from gettext issue.
+
 1999-08-13  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/win32/gdkevents.c (gdk_event_translate): Fix a couple of bugs
index fe7ac8a722e00c7995a96eb5dffecf882a638214..e085036c7b1e00e900ddc73d595b7328ba3d2a1f 100644 (file)
@@ -17,13 +17,15 @@ The tablet support uses the Wintab API. The Wintab development kit can
 be downloaded from http://www.pointing.com. If you don't care for
 that, undefine HAVE_WINTAB in config.h.win32 before building.
 
-GTk+ wants to be built with the GNU gettext library for
+GTk+ wants to be built with the GNU "intl" library for
 internationalisation (i18n). Get the version ported to Win32 (not a
-very big deal) from tml's web site mentioned above. If you don't want
-any i18n stuff, undefine ENABLE_NLS, HAVE_GETTEXT and HAVE_LIBINTL in
-the config.h.win32 file, and remove references to the gnu-intl library
-from the makefiles.
+very big deal) from tml's web site mentioned above. We build the
+"intl" library to a DLL called gnu-intl.dll to reduce name clash
+risks. If you don't want any i18n stuff, undefine ENABLE_NLS,
+HAVE_GETTEXT and HAVE_LIBINTL in the config.h.win32 file, and remove
+references to the gnu-intl library from the makefiles.
 
-Note that GNU gettext is under the GPL, not the LGPL like GTk+ or
-GLib. So, if GPL is a problem to you, follow the above advice to
-remove the use of gettext.
+Note that while the GNU gettext package is under the GPL, the "intl"
+library part as distributed with GNU libc is under the LGPL (like GTk+
+or GLib). We want the LGPL one, even if they are the same, more or
+less.
index 6acf1e488fcc32f22da8ade00683adb549230572..8cc0c4b7ce20af40b1569a0445700ea2d7e8405a 100644 (file)
@@ -30,8 +30,8 @@
 #include <gdk/gdk.h>
 #include "gdkprivate.h"
 
-#ifndef M_TWOPI
-#define M_TWOPI         (2.0 * 3.14159265358979323846)
+#ifndef G_PI
+#define G_PI 3.14159265358979323846
 #endif
 
 void
@@ -203,22 +203,49 @@ gdk_draw_arc (GdkDrawable *drawable,
   if (height == -1)
     height = drawable_private->height;
 
-  if (width != 0 && height != 0)
+  GDK_NOTE (MISC, g_print ("gdk_draw_arc: %#x  %d,%d,%d,%d  %d %d\n",
+                          drawable_private->xwindow,
+                          x, y, width, height, angle1, angle2));
+
+  if (width != 0 && height != 0 && angle2 != 0)
     {
       hdc = gdk_gc_predraw (drawable_private, gc_private);
 
-      nXStartArc = x + width/2 + (int) (sin(angle1/64.*M_TWOPI)*width);
-      nYStartArc = y + height/2 + (int) (cos(angle1/64.*M_TWOPI)*height);
-      nXEndArc = x + width/2 + (int) (sin(angle2/64.*M_TWOPI)*width);
-      nYEndArc = y + height/2 + (int) (cos(angle2/64.*M_TWOPI)*height);
+      if (angle2 >= 360*64)
+       {
+         nXStartArc = nYStartArc = nXEndArc = nYEndArc = 0;
+       }
+      else if (angle2 > 0)
+       {
+         /* The 100. is just an arbitrary value */
+         nXStartArc = x + width/2 + 100. * cos(angle1/64.*2.*G_PI/360.);
+         nYStartArc = y + height/2 + -100. * sin(angle1/64.*2.*G_PI/360.);
+         nXEndArc = x + width/2 + 100. * cos((angle1+angle2)/64.*2.*G_PI/360.);
+         nYEndArc = y + height/2 + -100. * sin((angle1+angle2)/64.*2.*G_PI/360.);
+       }
+      else
+       {
+         nXEndArc = x + width/2 + 100. * cos(angle1/64.*2.*G_PI/360.);
+         nYEndArc = y + height/2 + -100. * sin(angle1/64.*2.*G_PI/360.);
+         nXStartArc = x + width/2 + 100. * cos((angle1+angle2)/64.*2.*G_PI/360.);
+         nYStartArc = y + height/2 + -100. * sin((angle1+angle2)/64.*2.*G_PI/360.);
+       }
 
       if (filled)
        {
+         GDK_NOTE (MISC, g_print ("...Pie(hdc,%d,%d,%d,%d,%d,%d,%d,%d)\n",
+                                  x, y, x+width, y+height,
+                                  nXStartArc, nYStartArc,
+                                  nXEndArc, nYEndArc));
          Pie (hdc, x, y, x+width, y+height,
               nXStartArc, nYStartArc, nXEndArc, nYEndArc);
        }
       else
        {
+         GDK_NOTE (MISC, g_print ("...Arc(hdc,%d,%d,%d,%d,%d,%d,%d,%d)\n",
+                                  x, y, x+width, y+height,
+                                  nXStartArc, nYStartArc,
+                                  nXEndArc, nYEndArc));
          Arc (hdc, x, y, x+width, y+height,
               nXStartArc, nYStartArc, nXEndArc, nYEndArc);
        }
index 6acf1e488fcc32f22da8ade00683adb549230572..8cc0c4b7ce20af40b1569a0445700ea2d7e8405a 100644 (file)
@@ -30,8 +30,8 @@
 #include <gdk/gdk.h>
 #include "gdkprivate.h"
 
-#ifndef M_TWOPI
-#define M_TWOPI         (2.0 * 3.14159265358979323846)
+#ifndef G_PI
+#define G_PI 3.14159265358979323846
 #endif
 
 void
@@ -203,22 +203,49 @@ gdk_draw_arc (GdkDrawable *drawable,
   if (height == -1)
     height = drawable_private->height;
 
-  if (width != 0 && height != 0)
+  GDK_NOTE (MISC, g_print ("gdk_draw_arc: %#x  %d,%d,%d,%d  %d %d\n",
+                          drawable_private->xwindow,
+                          x, y, width, height, angle1, angle2));
+
+  if (width != 0 && height != 0 && angle2 != 0)
     {
       hdc = gdk_gc_predraw (drawable_private, gc_private);
 
-      nXStartArc = x + width/2 + (int) (sin(angle1/64.*M_TWOPI)*width);
-      nYStartArc = y + height/2 + (int) (cos(angle1/64.*M_TWOPI)*height);
-      nXEndArc = x + width/2 + (int) (sin(angle2/64.*M_TWOPI)*width);
-      nYEndArc = y + height/2 + (int) (cos(angle2/64.*M_TWOPI)*height);
+      if (angle2 >= 360*64)
+       {
+         nXStartArc = nYStartArc = nXEndArc = nYEndArc = 0;
+       }
+      else if (angle2 > 0)
+       {
+         /* The 100. is just an arbitrary value */
+         nXStartArc = x + width/2 + 100. * cos(angle1/64.*2.*G_PI/360.);
+         nYStartArc = y + height/2 + -100. * sin(angle1/64.*2.*G_PI/360.);
+         nXEndArc = x + width/2 + 100. * cos((angle1+angle2)/64.*2.*G_PI/360.);
+         nYEndArc = y + height/2 + -100. * sin((angle1+angle2)/64.*2.*G_PI/360.);
+       }
+      else
+       {
+         nXEndArc = x + width/2 + 100. * cos(angle1/64.*2.*G_PI/360.);
+         nYEndArc = y + height/2 + -100. * sin(angle1/64.*2.*G_PI/360.);
+         nXStartArc = x + width/2 + 100. * cos((angle1+angle2)/64.*2.*G_PI/360.);
+         nYStartArc = y + height/2 + -100. * sin((angle1+angle2)/64.*2.*G_PI/360.);
+       }
 
       if (filled)
        {
+         GDK_NOTE (MISC, g_print ("...Pie(hdc,%d,%d,%d,%d,%d,%d,%d,%d)\n",
+                                  x, y, x+width, y+height,
+                                  nXStartArc, nYStartArc,
+                                  nXEndArc, nYEndArc));
          Pie (hdc, x, y, x+width, y+height,
               nXStartArc, nYStartArc, nXEndArc, nYEndArc);
        }
       else
        {
+         GDK_NOTE (MISC, g_print ("...Arc(hdc,%d,%d,%d,%d,%d,%d,%d,%d)\n",
+                                  x, y, x+width, y+height,
+                                  nXStartArc, nYStartArc,
+                                  nXEndArc, nYEndArc));
          Arc (hdc, x, y, x+width, y+height,
               nXStartArc, nYStartArc, nXEndArc, nYEndArc);
        }
index be2a52e9fe73ca4a3809d12b59b94d28e8e94815..a104d62eadd2d59995aaa73087cd755c125d2f57 100644 (file)
@@ -32,9 +32,9 @@ GTK_VER=1.3
 
 GDKSYSDEP = ../gdk/win32
 GLIB = ../../glib
-GETTEXT = ../../gettext-0.10.35
+INTL = ../../intl
 
-CFLAGS = $(OPTIMIZE) -I . -I .. -I $(GDKSYSDEP) -I $(GLIB) -I $(GLIB)/gmodule -I $(GETTEXT)/intl -DGTK_DISABLE_COMPAT_H
+CFLAGS = $(OPTIMIZE) -I . -I .. -I $(GDKSYSDEP) -I $(GLIB) -I $(GLIB)/gmodule -I $(INTL) -DGTK_DISABLE_COMPAT_H
 
 all : \
        ../config.h     \
@@ -320,7 +320,7 @@ gtkmarshal.h gtkmarshal.c : gtkmarshal.list genmarshal.pl
 # Linking:
 #
 gtk-$(GTK_VER).dll : generated $(gtk_OBJECTS) gtk.def
-       $(GLIB)/build-dll gtk $(GTK_VER) gtk.def $(gtk_OBJECTS) -L $(GDKSYSDEP) -lgdk-$(GTK_VER) -L$(GETTEXT)/intl -lgnu-intl -L $(GLIB) -lglib-$(GLIB_VER) -lgmodule-$(GLIB_VER) -lgdi32 -luser32
+       $(GLIB)/build-dll gtk $(GTK_VER) gtk.def $(gtk_OBJECTS) -L $(GDKSYSDEP) -lgdk-$(GTK_VER) -L$(INTL) -lgnu-intl -L $(GLIB) -lglib-$(GLIB_VER) -lgmodule-$(GLIB_VER) -lgdi32 -luser32
 
 # General rule for compiling the objects into the DLL
 .c.o :
index d4a0f9a88336626f2fb61b798e76c779cfbad332..349c0d7b4c1232f78a27a69d44cda8018e6efedd 100755 (executable)
@@ -44,9 +44,9 @@ GTK_VER=1.3
 
 GDKSYSDEP = ..\gdk\win32
 GLIB = ..\..\glib
-GETTEXT = ..\..\gettext-0.10.35
+INTL = ..\..\gettext-0.10.35
 
-CFLAGS = -I. -I.. -I$(GDKSYSDEP) -I$(GLIB) -I$(GLIB)\gmodule -I$(GETTEXT)\intl -DGTK_DISABLE_COMPAT_H
+CFLAGS = -I. -I.. -I$(GDKSYSDEP) -I$(GLIB) -I$(GLIB)\gmodule -I$(INTL) -DGTK_DISABLE_COMPAT_H
 
 all : \
        ..\config.h     \
@@ -333,7 +333,7 @@ gtkmarshal.h gtkmarshal.c : gtkmarshal.list genmarshal.pl
 # Linking:
 #
 gtk-$(GTK_VER).dll : $(gtk_OBJECTS) gtk.def
-       $(CC) $(CFLAGS) -LD -Fegtk-$(GTK_VER).dll $(gtk_OBJECTS) $(GDKSYSDEP)\gdk-$(GTK_VER).lib $(GETTEXT)\intl\gnu-intl.lib $(GLIB)\glib-$(GLIB_VER).lib $(GLIB)\gmodule-$(GLIB_VER).lib gdi32.lib user32.lib $(LDFLAGS) /def:gtk.def
+       $(CC) $(CFLAGS) -LD -Fegtk-$(GTK_VER).dll $(gtk_OBJECTS) $(GDKSYSDEP)\gdk-$(GTK_VER).lib $(INTL)\gnu-intl.lib $(GLIB)\glib-$(GLIB_VER).lib $(GLIB)\gmodule-$(GLIB_VER).lib gdi32.lib user32.lib $(LDFLAGS) /def:gtk.def
 
 # General rule for compiling the objects into the DLL
 .c.obj :