mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-05 16:20:10 +00:00
Fix start and end radial endpoint calculations which were totally wrong.
* 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.
This commit is contained in:
parent
0139b4a3dc
commit
0455fa3029
12
ChangeLog
12
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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
18
README.win32
18
README.win32
@ -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.
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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 :
|
||||
|
@ -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 :
|
||||
|
Loading…
Reference in New Issue
Block a user