Plug same refcount leaks as in the X11 backend.

2000-05-17  Tor Lillqvist  <tml@iki.fi>

* gdk/win32/gdkevents-win32.c (gdk_event_translate): Plug same
refcount leaks as in the X11 backend.

* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_values): Logging
cosmetics.

* gdk/win32/gdkwindow-win32.c: Similar changes as in X11
backend. Add _gdk_windowing_window_destroy().

* gtk/gtkcolorsel.c: Include correct backend-specific header.
Don't use XColor unless on X11. (No GDK_VISUAL_STATIC_COLOR
either, but these probably do exist on nanox?)

* gtk/gtkhsv.c: Use G_PI (fresh from <glib.h>) instead of M_PI
which isn't necessarily defined by <math.h>.

* gtk/gtkobject.c (gtk_object_init): Don't go up the class
ancestry past GtkObject.

* gtk/gtktypeutils.h: Mark GTK_TYPE_IDENTIFIER for export/import
from DLL on Win32.

* gtk/gtk.def: Update corresponding to recent changes.

* gtk/makefile.{cygwin,msc}: Updates.
This commit is contained in:
Tor Lillqvist 2000-05-16 21:27:10 +00:00 committed by Tor Lillqvist
parent 386ae20970
commit 8596f7edc5
17 changed files with 306 additions and 207 deletions

View File

@ -1,3 +1,31 @@
2000-05-17 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Plug same
refcount leaks as in the X11 backend.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_values): Logging
cosmetics.
* gdk/win32/gdkwindow-win32.c: Similar changes as in X11
backend. Add _gdk_windowing_window_destroy().
* gtk/gtkcolorsel.c: Include correct backend-specific header.
Don't use XColor unless on X11. (No GDK_VISUAL_STATIC_COLOR
either, but these probably do exist on nanox?)
* gtk/gtkhsv.c: Use G_PI (fresh from <glib.h>) instead of M_PI
which isn't necessarily defined by <math.h>.
* gtk/gtkobject.c (gtk_object_init): Don't go up the class
ancestry past GtkObject.
* gtk/gtktypeutils.h: Mark GTK_TYPE_IDENTIFIER for export/import
from DLL on Win32.
* gtk/gtk.def: Update corresponding to recent changes.
* gtk/makefile.{cygwin,msc}: Updates.
Fri May 12 18:46:51 2000 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.4.txt: A bit of editing.

View File

@ -1,3 +1,31 @@
2000-05-17 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Plug same
refcount leaks as in the X11 backend.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_values): Logging
cosmetics.
* gdk/win32/gdkwindow-win32.c: Similar changes as in X11
backend. Add _gdk_windowing_window_destroy().
* gtk/gtkcolorsel.c: Include correct backend-specific header.
Don't use XColor unless on X11. (No GDK_VISUAL_STATIC_COLOR
either, but these probably do exist on nanox?)
* gtk/gtkhsv.c: Use G_PI (fresh from <glib.h>) instead of M_PI
which isn't necessarily defined by <math.h>.
* gtk/gtkobject.c (gtk_object_init): Don't go up the class
ancestry past GtkObject.
* gtk/gtktypeutils.h: Mark GTK_TYPE_IDENTIFIER for export/import
from DLL on Win32.
* gtk/gtk.def: Update corresponding to recent changes.
* gtk/makefile.{cygwin,msc}: Updates.
Fri May 12 18:46:51 2000 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.4.txt: A bit of editing.

View File

@ -1,3 +1,31 @@
2000-05-17 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Plug same
refcount leaks as in the X11 backend.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_values): Logging
cosmetics.
* gdk/win32/gdkwindow-win32.c: Similar changes as in X11
backend. Add _gdk_windowing_window_destroy().
* gtk/gtkcolorsel.c: Include correct backend-specific header.
Don't use XColor unless on X11. (No GDK_VISUAL_STATIC_COLOR
either, but these probably do exist on nanox?)
* gtk/gtkhsv.c: Use G_PI (fresh from <glib.h>) instead of M_PI
which isn't necessarily defined by <math.h>.
* gtk/gtkobject.c (gtk_object_init): Don't go up the class
ancestry past GtkObject.
* gtk/gtktypeutils.h: Mark GTK_TYPE_IDENTIFIER for export/import
from DLL on Win32.
* gtk/gtk.def: Update corresponding to recent changes.
* gtk/makefile.{cygwin,msc}: Updates.
Fri May 12 18:46:51 2000 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.4.txt: A bit of editing.

View File

@ -1,3 +1,31 @@
2000-05-17 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Plug same
refcount leaks as in the X11 backend.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_values): Logging
cosmetics.
* gdk/win32/gdkwindow-win32.c: Similar changes as in X11
backend. Add _gdk_windowing_window_destroy().
* gtk/gtkcolorsel.c: Include correct backend-specific header.
Don't use XColor unless on X11. (No GDK_VISUAL_STATIC_COLOR
either, but these probably do exist on nanox?)
* gtk/gtkhsv.c: Use G_PI (fresh from <glib.h>) instead of M_PI
which isn't necessarily defined by <math.h>.
* gtk/gtkobject.c (gtk_object_init): Don't go up the class
ancestry past GtkObject.
* gtk/gtktypeutils.h: Mark GTK_TYPE_IDENTIFIER for export/import
from DLL on Win32.
* gtk/gtk.def: Update corresponding to recent changes.
* gtk/makefile.{cygwin,msc}: Updates.
Fri May 12 18:46:51 2000 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.4.txt: A bit of editing.

View File

@ -1,3 +1,31 @@
2000-05-17 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Plug same
refcount leaks as in the X11 backend.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_values): Logging
cosmetics.
* gdk/win32/gdkwindow-win32.c: Similar changes as in X11
backend. Add _gdk_windowing_window_destroy().
* gtk/gtkcolorsel.c: Include correct backend-specific header.
Don't use XColor unless on X11. (No GDK_VISUAL_STATIC_COLOR
either, but these probably do exist on nanox?)
* gtk/gtkhsv.c: Use G_PI (fresh from <glib.h>) instead of M_PI
which isn't necessarily defined by <math.h>.
* gtk/gtkobject.c (gtk_object_init): Don't go up the class
ancestry past GtkObject.
* gtk/gtktypeutils.h: Mark GTK_TYPE_IDENTIFIER for export/import
from DLL on Win32.
* gtk/gtk.def: Update corresponding to recent changes.
* gtk/makefile.{cygwin,msc}: Updates.
Fri May 12 18:46:51 2000 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.4.txt: A bit of editing.

View File

@ -1,3 +1,31 @@
2000-05-17 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Plug same
refcount leaks as in the X11 backend.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_values): Logging
cosmetics.
* gdk/win32/gdkwindow-win32.c: Similar changes as in X11
backend. Add _gdk_windowing_window_destroy().
* gtk/gtkcolorsel.c: Include correct backend-specific header.
Don't use XColor unless on X11. (No GDK_VISUAL_STATIC_COLOR
either, but these probably do exist on nanox?)
* gtk/gtkhsv.c: Use G_PI (fresh from <glib.h>) instead of M_PI
which isn't necessarily defined by <math.h>.
* gtk/gtkobject.c (gtk_object_init): Don't go up the class
ancestry past GtkObject.
* gtk/gtktypeutils.h: Mark GTK_TYPE_IDENTIFIER for export/import
from DLL on Win32.
* gtk/gtk.def: Update corresponding to recent changes.
* gtk/makefile.{cygwin,msc}: Updates.
Fri May 12 18:46:51 2000 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.4.txt: A bit of editing.

View File

@ -1,3 +1,31 @@
2000-05-17 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Plug same
refcount leaks as in the X11 backend.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_values): Logging
cosmetics.
* gdk/win32/gdkwindow-win32.c: Similar changes as in X11
backend. Add _gdk_windowing_window_destroy().
* gtk/gtkcolorsel.c: Include correct backend-specific header.
Don't use XColor unless on X11. (No GDK_VISUAL_STATIC_COLOR
either, but these probably do exist on nanox?)
* gtk/gtkhsv.c: Use G_PI (fresh from <glib.h>) instead of M_PI
which isn't necessarily defined by <math.h>.
* gtk/gtkobject.c (gtk_object_init): Don't go up the class
ancestry past GtkObject.
* gtk/gtktypeutils.h: Mark GTK_TYPE_IDENTIFIER for export/import
from DLL on Win32.
* gtk/gtk.def: Update corresponding to recent changes.
* gtk/makefile.{cygwin,msc}: Updates.
Fri May 12 18:46:51 2000 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.4.txt: A bit of editing.

View File

@ -2979,6 +2979,9 @@ gdk_event_translate (GdkEvent *event,
window = gdk_window_lookup (xevent->hwnd);
orig_window = window;
event->any.window = window;
event->any.send_event = FALSE;
if (window != NULL)
gdk_drawable_ref (window);
else
@ -3013,13 +3016,14 @@ gdk_event_translate (GdkEvent *event,
{
/* Check for filters for this window */
GdkFilterReturn result;
event->any.window = window;
result = gdk_event_apply_filters
(xevent, event, ((GdkWindowPrivate *) window)->filters);
if (result != GDK_FILTER_CONTINUE)
{
return (result == GDK_FILTER_TRANSLATE) ? TRUE : FALSE;
return_val = (result == GDK_FILTER_TRANSLATE) ? TRUE : FALSE;
goto done;
}
}
@ -3104,7 +3108,7 @@ gdk_event_translate (GdkEvent *event,
event->client.data.l[1] = xevent->lParam;
break;
}
goto bypass_switch; /* Ouch */
goto done;
}
tmp_list = tmp_list->next;
}
@ -3163,8 +3167,8 @@ gdk_event_translate (GdkEvent *event,
xevent->lParam));
ignore_WM_CHAR = TRUE;
keyup_or_down:
keyup_or_down:
if (!propagate (&window, xevent,
k_grab_window, k_grab_owner_events, GDK_ALL_EVENTS_MASK,
doesnt_want_key))
@ -4265,7 +4269,7 @@ gdk_event_translate (GdkEvent *event,
xevent->wParam, xevent->lParam));
}
bypass_switch:
done:
if (return_val)
{

View File

@ -566,7 +566,6 @@ gdk_win32_gc_set_values (GdkGC *gc,
{
GDK_NOTE (MISC, g_print ("gdk_win32_gc_set_values: "));
gdk_win32_gc_values_to_win32values (values, mask, gc);
GDK_NOTE (MISC, g_print ("\n"));
}
static void

View File

@ -77,16 +77,20 @@ gdk_win32_window_destroy (GdkDrawable *drawable)
{
if (!GDK_DRAWABLE_DESTROYED (drawable))
{
if (GDK_DRAWABLE_TYPE (drawable) == GDK_WINDOW_FOREIGN)
gdk_xid_table_remove (GDK_DRAWABLE_XID (drawable));
if (GDK_DRAWABLE_TYPE (drawable) != GDK_WINDOW_FOREIGN)
{
g_warning ("losing last reference to undestroyed window");
_gdk_window_destroy (drawable, FALSE);
}
else
g_warning ("losing last reference to undestroyed window\n");
/* We use TRUE here, to keep us from actually calling
* DestroyWindow() on the window
*/
_gdk_window_destroy (drawable, TRUE);
gdk_xid_table_remove (GDK_DRAWABLE_XID (drawable));
}
if (GDK_WINDOW_WIN32DATA (drawable)->bg_type == GDK_WIN32_BG_PIXMAP
&& GDK_WINDOW_WIN32DATA (drawable)->bg_pixmap != NULL)
gdk_drawable_unref (GDK_WINDOW_WIN32DATA (drawable)->bg_pixmap);
g_free (GDK_DRAWABLE_WIN32DATA (drawable));
}
@ -529,140 +533,44 @@ gdk_window_foreign_new (guint32 anid)
return window;
}
/* Call this function when you want a window and all its children to
* disappear. When xdestroy is true, a request to destroy the window
* is sent out. When it is false, it is assumed that the window has
* been or will be destroyed by destroying some ancestor of this
* window.
*/
static void
gdk_window_internal_destroy (GdkWindow *window,
gboolean xdestroy,
gboolean our_destroy)
void
_gdk_windowing_window_destroy (GdkWindow *window,
gboolean recursing,
gboolean foreign_destroy)
{
GdkWindowPrivate *private;
GdkWindowPrivate *temp_private;
GdkWindow *temp_window;
GList *children;
GList *tmp;
GdkWindowPrivate *private = (GdkWindowPrivate *)window;
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate *) window;
GDK_NOTE (MISC, g_print ("gdk_window_internal_destroy %#x\n",
GDK_NOTE (MISC, g_print ("_gdk_windowing_window_destroy %#x\n",
GDK_DRAWABLE_XID (window)));
switch (GDK_DRAWABLE_TYPE (window))
if (private->extension_events != 0)
gdk_input_window_destroy (window);
if (private->drawable.window_type == GDK_WINDOW_FOREIGN)
{
case GDK_WINDOW_TOPLEVEL:
case GDK_WINDOW_CHILD:
case GDK_WINDOW_DIALOG:
case GDK_WINDOW_TEMP:
case GDK_WINDOW_FOREIGN:
if (!private->drawable.destroyed)
if (!foreign_destroy && (private->parent != NULL))
{
if (private->parent)
{
GdkWindowPrivate *parent_private = (GdkWindowPrivate *)private->parent;
if (parent_private->children)
parent_private->children = g_list_remove (parent_private->children, window);
}
if (GDK_DRAWABLE_TYPE (window) != GDK_WINDOW_FOREIGN)
{
children = tmp = private->children;
private->children = NULL;
while (tmp)
{
temp_window = tmp->data;
tmp = tmp->next;
temp_private = (GdkWindowPrivate*) temp_window;
if (temp_private)
gdk_window_internal_destroy (temp_window, FALSE,
our_destroy);
}
g_list_free (children);
}
if (private->extension_events != 0)
gdk_input_window_destroy (window);
if (private->filters)
{
tmp = private->filters;
while (tmp)
{
g_free (tmp->data);
tmp = tmp->next;
}
g_list_free (private->filters);
private->filters = NULL;
}
/* It's somebody else's window, but in our heirarchy,
* so reparent it to the root window, and then call
* DestroyWindow() on it.
*/
gdk_window_hide (window);
gdk_window_reparent (window, NULL, 0, 0);
if (private->drawable.window_type == GDK_WINDOW_FOREIGN)
{
if (our_destroy && (private->parent != NULL))
{
/* It's somebody elses window, but in our hierarchy,
* so reparent it to the root window, and then send
* it a delete event, as if we were a WM
*/
gdk_window_hide (window);
gdk_window_reparent (window, NULL, 0, 0);
/* Is this too drastic? Many (most?) applications
* quit if any window receives WM_QUIT I think.
* OTOH, I don't think foreign windows are much
* used, so the question is maybe academic.
*/
PostMessage (GDK_DRAWABLE_XID (window), WM_QUIT, 0, 0);
}
}
else
{
private->drawable.destroyed = TRUE;
if (xdestroy)
{
/* Calls gdk_WindowProc */
DestroyWindow (GDK_DRAWABLE_XID (window));
}
}
if (private->drawable.colormap)
gdk_colormap_unref (private->drawable.colormap);
private->mapped = FALSE;
/* Is this too drastic? Many (most?) applications
* quit if any window receives WM_QUIT I think.
* OTOH, I don't think foreign windows are much
* used, so the question is maybe academic.
*/
PostMessage (GDK_DRAWABLE_XID (window), WM_QUIT, 0, 0);
}
break;
case GDK_WINDOW_ROOT:
g_error ("attempted to destroy root window");
break;
case GDK_DRAWABLE_PIXMAP:
g_error ("called gdk_window_destroy on a pixmap (use gdk_drawable_unref)");
break;
}
else if (!recursing && !foreign_destroy)
DestroyWindow (GDK_DRAWABLE_XID (window));
}
/* Like internal_destroy, but also destroys the reference created by
gdk_window_new. */
void
gdk_window_destroy (GdkWindow *window)
{
gdk_window_internal_destroy (window, TRUE, TRUE);
gdk_drawable_unref (window);
}
/* This function is called when the window really gone. */
/* This function is called when the window really gone.
*/
void
gdk_window_destroy_notify (GdkWindow *window)
{
@ -671,7 +579,7 @@ gdk_window_destroy_notify (GdkWindow *window)
GDK_NOTE (EVENTS,
g_print ("gdk_window_destroy_notify: %#x %s\n",
GDK_DRAWABLE_XID (window),
(GDK_DRAWABLE_DESTROYED (window) ? "yes" : "no")));
(GDK_DRAWABLE_DESTROYED (window) ? "(destroyed)" : "")));
if (!GDK_DRAWABLE_DESTROYED (window))
{
@ -679,7 +587,7 @@ gdk_window_destroy_notify (GdkWindow *window)
g_warning ("window %#x unexpectedly destroyed",
GDK_DRAWABLE_XID (window));
gdk_window_internal_destroy (window, FALSE, FALSE);
_gdk_window_destroy (window, TRUE);
}
gdk_xid_table_remove (GDK_DRAWABLE_XID (window));

View File

@ -75,6 +75,7 @@ EXPORTS
GTK_TYPE_GDK_WINDOW_HINTS
GTK_TYPE_GDK_WM_DECORATION
GTK_TYPE_GDK_WM_FUNCTION
GTK_TYPE_IDENTIFIER
GTK_TYPE_JUSTIFICATION
GTK_TYPE_MATCH_TYPE
GTK_TYPE_MENU_DIRECTION_TYPE
@ -315,8 +316,9 @@ EXPORTS
gtk_color_selection_get_type
gtk_color_selection_new
gtk_color_selection_set_color
gtk_color_selection_set_opacity
gtk_color_selection_set_update_policy
gtk_color_selection_set_use_opacity
gtk_color_selection_set_use_palette
gtk_combo_disable_activate
gtk_combo_get_type
gtk_combo_new
@ -345,11 +347,9 @@ EXPORTS
gtk_container_forall
gtk_container_foreach
gtk_container_foreach_full
gtk_container_get_toplevels
gtk_container_get_type
gtk_container_query_child_args
gtk_container_queue_resize
gtk_container_register_toplevel
gtk_container_remove
gtk_container_resize_children
gtk_container_set_border_width
@ -358,7 +358,6 @@ EXPORTS
gtk_container_set_focus_vadjustment
gtk_container_set_reallocate_redraws
gtk_container_set_resize_mode
gtk_container_unregister_toplevel
gtk_ctree_collapse
gtk_ctree_collapse_recursive
gtk_ctree_collapse_to_depth
@ -562,7 +561,6 @@ EXPORTS
gtk_hscrollbar_new
gtk_hseparator_get_type
gtk_hseparator_new
gtk_identifier_get_type
gtk_idle_add
gtk_idle_add_full
gtk_idle_add_priority
@ -1164,7 +1162,6 @@ EXPORTS
gtk_tooltips_set_colors
gtk_tooltips_set_delay
gtk_tooltips_set_tip
gtk_trace_referencing
gtk_tree_append
gtk_tree_child_position
gtk_tree_clear_items
@ -1191,30 +1188,13 @@ EXPORTS
gtk_tree_unselect_child
gtk_tree_unselect_item
gtk_true
gtk_type_check_class_cast
gtk_type_check_object_cast
gtk_type_children_types
gtk_type_class
gtk_type_describe_heritage
gtk_type_describe_tree
gtk_type_enum_find_value
gtk_type_enum_get_values
gtk_type_flags_find_value
gtk_type_flags_get_values
gtk_type_free
gtk_type_from_name
gtk_type_get_varargs_type
gtk_type_init
gtk_type_is_a
gtk_type_name
gtk_type_new
gtk_type_parent
gtk_type_parent_class
gtk_type_query
gtk_type_register_enum
gtk_type_register_flags
gtk_type_set_chunk_alloc
gtk_type_set_varargs_type
gtk_type_unique
gtk_vbox_get_type
gtk_vbox_new

View File

@ -25,7 +25,15 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "gdkconfig.h"
#if defined (GDK_WINDOWING_X11)
#include "x11/gdkx.h"
#elif defined (GDK_WINDOWING_WIN32)
#include "win32/gdkwin32.h"
#elif defined (GDK_WINDOWING_NANOX)
#include "nanox/gdkprivate-nanox.h"
#endif
#include "gdk/gdkkeysyms.h"
#include "gtkcolorsel.h"
#include "gtkhsv.h"
@ -891,7 +899,9 @@ grab_color_at_mouse (GtkWidget *button,
GtkColorSelection *colorsel = data;
ColorSelectionPrivate *priv;
GdkColormap *colormap = gdk_colormap_get_system ();
#if defined (GDK_WINDOWING_X11)
XColor xcolor;
#endif
priv = colorsel->private;
@ -912,6 +922,7 @@ grab_color_at_mouse (GtkWidget *button,
priv->color[COLORSEL_GREEN] = (double)pixel/((1<<visual->depth) - 1);
priv->color[COLORSEL_BLUE] = (double)pixel/((1<<visual->depth) - 1);
break;
#if defined (GDK_WINDOWING_X11)
case GDK_VISUAL_STATIC_COLOR:
xcolor.pixel = pixel;
XQueryColor (GDK_DISPLAY (), GDK_COLORMAP_XCOLORMAP (colormap), &xcolor);
@ -919,6 +930,7 @@ grab_color_at_mouse (GtkWidget *button,
priv->color[COLORSEL_GREEN] = xcolor.green/65535.0;
priv->color[COLORSEL_BLUE] = xcolor.blue/65535.0;
break;
#endif
case GDK_VISUAL_PSEUDO_COLOR:
priv->color[COLORSEL_RED] = colormap->colors[pixel].red/(double)0xffffff;
priv->color[COLORSEL_GREEN] = colormap->colors[pixel].green/(double)0xffffff;

View File

@ -519,14 +519,14 @@ compute_triangle (GtkHSV *hsv,
center = priv->size / 2.0;
outer = priv->size / 2.0;
inner = outer - priv->ring_width;
angle = priv->h * 2.0 * M_PI;
angle = priv->h * 2.0 * G_PI;
*hx = floor (center + cos (angle) * inner + 0.5);
*hy = floor (center - sin (angle) * inner + 0.5);
*sx = floor (center + cos (angle + 2.0 * M_PI / 3.0) * inner + 0.5);
*sy = floor (center - sin (angle + 2.0 * M_PI / 3.0) * inner + 0.5);
*vx = floor (center + cos (angle + 4.0 * M_PI / 3.0) * inner + 0.5);
*vy = floor (center - sin (angle + 4.0 * M_PI / 3.0) * inner + 0.5);
*sx = floor (center + cos (angle + 2.0 * G_PI / 3.0) * inner + 0.5);
*sy = floor (center - sin (angle + 2.0 * G_PI / 3.0) * inner + 0.5);
*vx = floor (center + cos (angle + 4.0 * G_PI / 3.0) * inner + 0.5);
*vy = floor (center - sin (angle + 4.0 * G_PI / 3.0) * inner + 0.5);
}
/* Computes whether a point is inside the hue ring */
@ -673,9 +673,9 @@ compute_v (GtkHSV *hsv,
angle = atan2 (dy, dx);
if (angle < 0.0)
angle += 2.0 * M_PI;
angle += 2.0 * G_PI;
return angle / (2.0 * M_PI);
return angle / (2.0 * G_PI);
}
/* Event handlers */
@ -891,9 +891,9 @@ paint_ring (GtkHSV *hsv,
angle = atan2 (dy, dx);
if (angle < 0.0)
angle += 2.0 * M_PI;
angle += 2.0 * G_PI;
hue = angle / (2.0 * M_PI);
hue = angle / (2.0 * G_PI);
r = hue;
g = 1.0;
@ -958,8 +958,8 @@ paint_ring (GtkHSV *hsv,
gdk_draw_line (drawable, priv->gc,
-x + center, -y + center,
-x + center + cos (priv->h * 2.0 * M_PI) * center,
-y + center - sin (priv->h * 2.0 * M_PI) * center);
-x + center + cos (priv->h * 2.0 * G_PI) * center,
-y + center - sin (priv->h * 2.0 * G_PI) * center);
gdk_gc_set_clip_mask (priv->gc, NULL);
gdk_bitmap_unref (mask);

View File

@ -182,7 +182,7 @@ gtk_object_init (GtkObject *object,
needs_construction |= klass->construct_args != NULL;
klass = g_type_class_peek_parent (klass);
}
while (klass && !needs_construction);
while (klass && GTK_IS_OBJECT_CLASS (klass) && !needs_construction);
if (!needs_construction)
GTK_OBJECT_FLAGS (object) |= GTK_CONSTRUCTED;
}

View File

@ -242,8 +242,18 @@ GtkEnumValue* gtk_type_enum_find_value (GtkType enum_type,
GtkFlagValue* gtk_type_flags_find_value (GtkType flags_type,
const gchar *value_name);
#ifdef G_OS_WIN32
# ifdef GTK_COMPILATION
# define GTKTYPEUTILS_VAR __declspec(dllexport)
# else
# define GTKTYPEUTILS_VAR extern __declspec(dllimport)
# endif
#else
# define GTKTYPEUTILS_VAR extern
#endif
/* urg */
extern GType GTK_TYPE_IDENTIFIER;
GTKTYPEUTILS_VAR GType GTK_TYPE_IDENTIFIER;
#ifdef __cplusplus

View File

@ -63,6 +63,7 @@ gtk_OBJECTS = \
gtkcheckmenuitem.o\
gtkclist.o \
gtkcolorsel.o \
gtkcolorseldialog.o \
gtkcombo.o \
gtkcontainer.o \
gtkctree.o \
@ -88,6 +89,7 @@ gtk_OBJECTS = \
gtkhscale.o \
gtkhscrollbar.o \
gtkhseparator.o \
gtkhsv.o \
gtkimage.o \
gtkinputdialog.o\
gtkinvisible.o \
@ -172,6 +174,7 @@ source_headers = \
gtkcheckmenuitem.h \
gtkclist.h \
gtkcolorsel.h \
gtkcolorseldialog.h \
gtkcombo.h \
gtkcontainer.h \
gtkctree.h \
@ -199,6 +202,7 @@ source_headers = \
gtkhscale.h \
gtkhscrollbar.h \
gtkhseparator.h \
gtkhsv.h \
gtkimage.h \
gtkinputdialog.h \
gtkinvisible.h \
@ -291,10 +295,12 @@ gdk_headers = \
gtkcompat.h : gtkcompat.h.win32
cp gtkcompat.h.win32 gtkcompat.h
GENERATED = gtk.defs gtktypebuiltins.h gtktypebuiltins_vars.c gtktypebuiltins_ids.c gtktypebuiltins_evals.c gtkmarshal.h gtkmarshal.c
#
# Generated source files:
#
generated : gtk.defs gtktypebuiltins.h gtktypebuiltins_vars.c gtktypebuiltins_ids.c gtktypebuiltins_evals.c gtkmarshal.h gtkmarshal.c
generated : $(GENERATED)
gtk.defs : makeenums.pl gtk-boxed.defs $(source_headers) $(gdk_headers)
$(PERL) makeenums.pl defs $(source_headers) $(gdk_headers) >gd.tmp
@ -327,86 +333,68 @@ gtkmarshal.h gtkmarshal.c : gtkmarshal.list genmarshal.pl
#
# Linking:
#
gtk-$(GTK_VER).dll : generated $(gtk_OBJECTS) gtk.def gtk-win32res.o
$(GLIB)/build-dll gtk $(GTK_VER) gtk.def $(gtk_OBJECTS) gtk-win32res.o -L ../gdk -lgdk-$(GTK_VER) -L$(INTL) -lgnu-intl -L $(GLIB) -lglib-$(GLIB_VER) -lgmodule-$(GLIB_VER) -lgdi32 -luser32
gtk-$(GTK_VER).dll : generated $(gtk_OBJECTS) gtk.def
$(GLIB)/build-dll gtk $(GTK_VER) gtk.def $(gtk_OBJECTS) -L ../gdk -lgdk-$(GTK_VER) -L$(INTL) -lgnu-intl -L $(GLIB) -lglib-$(GLIB_VER) -L $(GLIB)/gmodule -lgmodule-$(GLIB_VER) -L $(GLIB)/gobject -lgobject-$(GLIB_VER) -luser32
.SUFFIXES: .c .o .i
# Kludge to get the path to the win32 headers
WIN32APIHEADERS = $(shell echo "\#include <winver.h>" | $(CC) -M -E - | tail -1 | sed -e 's![\\/]winver.h!!' | tr -d '\015')
gtk-win32res.o : gtk.rc gtk-build.tmp
m4 -DBUILDNUMBER=`cat gtk-build.tmp` <gtk.rc >gtk-win32res.rc
windres --include-dir $(WIN32APIHEADERS) gtk-win32res.rc gtk-win32res.o
rm gtk-build.tmp gtk-win32res.rc
# The *.stamp files aren't distributed. Thus, this takes care of only
# tml building libraries with nonzero build number.
ifeq ($(wildcard gtk-build.stamp),gtk-build.stamp)
# Magic to bump the build number
gtk-build.tmp :
bash -c "read number && echo $$[number+1]" <gtk-build.stamp >gtk-build.tmp
cp gtk-build.tmp gtk-build.stamp
else
# Use zero as build number.
gtk-build.tmp :
echo 0 >gtk-build.tmp
endif
# General rule for compiling the objects into the DLL
.c.o :
$(CC) $(CFLAGS) -c -DGTK_COMPILATION -DG_LOG_DOMAIN=\"Gtk\" $<
.c.i :
$(CC) $(CFLAGS) -E -DGDK_COMPILATION -DG_LOG_DOMAIN=\"Gdk\" $< >$@
$(CC) $(CFLAGS) -E -DGTK_COMPILATION -DG_LOG_DOMAIN=\"Gtk\" $< >$@
#
# Test programs:
#
testdnd.exe : testdnd.o
$(CC) $(CFLAGS) -o $@ testdnd.o -L . -lgtk-$(GTK_VER) -L ../gdk -lgdk-$(GTK_VER) -L $(GLIB) -lglib-$(GLIB_VER) $(LDFLAGS)
$(CC) $(CFLAGS) -o $@ testdnd.o -L . -lgtk-$(GTK_VER) -L ../gdk -lgdk-$(GTK_VER) -L $(GLIB) -lglib-$(GLIB_VER) -L $(GLIB)/gobject -lgobject-$(GLIB_VER) $(LDFLAGS)
# Must have separate rules for these objects that don't go in the DLL
testdnd.o : testdnd.c
$(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"testdnd\" testdnd.c
testgtk.exe : testgtk.o
$(CC) $(CFLAGS) -o $@ testgtk.o -L . -lgtk-$(GTK_VER) -L ../gdk -lgdk-$(GTK_VER) -L $(GLIB) -lglib-$(GLIB_VER) $(LDFLAGS)
$(CC) $(CFLAGS) -o $@ testgtk.o -L . -lgtk-$(GTK_VER) -L ../gdk -lgdk-$(GTK_VER) -L $(GLIB) -lglib-$(GLIB_VER) -L $(GLIB)/gobject -lgobject-$(GLIB_VER) $(LDFLAGS)
testgtk.o : testgtk.c
$(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"testgtk\" testgtk.c
testinput.exe : testinput.o
$(CC) $(CFLAGS) -o $@ testinput.o -L . -lgtk-$(GTK_VER) -L ../gdk -lgdk-$(GTK_VER) -L $(GLIB) -lglib-$(GLIB_VER) $(LDFLAGS)
$(CC) $(CFLAGS) -o $@ testinput.o -L . -lgtk-$(GTK_VER) -L ../gdk -lgdk-$(GTK_VER) -L $(GLIB) -lglib-$(GLIB_VER) -L $(GLIB)/gobject -lgobject-$(GLIB_VER) $(LDFLAGS)
testinput.o : testinput.c
$(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"testinput\" testinput.c
testrgb.exe : testrgb.o
$(CC) $(CFLAGS) -o $@ testrgb.o -L . -lgtk-$(GTK_VER) -L ../gdk -lgdk-$(GTK_VER) -L $(GLIB) -lglib-$(GLIB_VER) $(LDFLAGS)
$(CC) $(CFLAGS) -o $@ testrgb.o -L . -lgtk-$(GTK_VER) -L ../gdk -lgdk-$(GTK_VER) -L $(GLIB) -lglib-$(GLIB_VER) -L $(GLIB)/gobject -lgobject-$(GLIB_VER) $(LDFLAGS)
testrgb.o : testrgb.c
$(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"testrgb\" testrgb.c
testselection.exe : testselection.o
$(CC) $(CFLAGS) -o $@ testselection.o -L . -lgtk-$(GTK_VER) -L ../gdk -lgdk-$(GTK_VER) -L $(GLIB) -lglib-$(GLIB_VER) $(LDFLAGS)
$(CC) $(CFLAGS) -o $@ testselection.o -L . -lgtk-$(GTK_VER) -L ../gdk -lgdk-$(GTK_VER) -L $(GLIB) -lglib-$(GLIB_VER) -L $(GLIB)/gobject -lgobject-$(GLIB_VER) $(LDFLAGS)
testselection.o : testselection.c
$(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"testselection\" testselection.c
testthreads.exe : testthreads.o
$(CC) $(CFLAGS) -o $@ testthreads.o -L . -lgtk-$(GTK_VER) -L ../gdk -lgdk-$(GTK_VER) -L $(GLIB) -lglib-$(GLIB_VER) -lgthread-$(GLIB_VER) $(PTHREAD_LIB) $(LDFLAGS)
$(CC) $(CFLAGS) -o $@ testthreads.o -L . -lgtk-$(GTK_VER) -L ../gdk -lgdk-$(GTK_VER) -L $(GLIB) -lglib-$(GLIB_VER) -L $(GLIB)/gthread -lgthread-$(GLIB_VER) -L $(GLIB)/gobject -lgobject-$(GLIB_VER) $(PTHREAD_LIB) $(LDFLAGS)
testthreads.o : testthreads.c
$(CC) $(CFLAGS) -I$(PTHREAD_INC) -c -DG_LOG_DOMAIN=\"testthreads\" -DUSE_PTHREADS=1 testthreads.c
simple.exe : simple.o
$(CC) $(CFLAGS) -o $@ simple.o -L . -lgtk-$(GTK_VER) -L ../gdk -lgdk-$(GTK_VER) -L $(GLIB) -lglib-$(GLIB_VER) $(LDFLAGS)
$(CC) $(CFLAGS) -o $@ simple.o -L . -lgtk-$(GTK_VER) -L ../gdk -lgdk-$(GTK_VER) -L $(GLIB) -lglib-$(GLIB_VER) -L $(GLIB)/gobject -lgobject-$(GLIB_VER) $(LDFLAGS)
simple.o : simple.c
$(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"simple\" simple.c
# The rmgen target removes just the generated source files
rmgen:
-rm $(GENERATED)
# The clean target doesn't remove the generated sources
clean:
-rm *.exe *.o *.dll *.a *.exp *.base

View File

@ -81,6 +81,7 @@ gtk_OBJECTS = \
gtkcheckmenuitem.obj \
gtkclist.obj \
gtkcolorsel.obj \
gtkcolorseldialog.obj \
gtkcombo.obj \
gtkcontainer.obj \
gtkctree.obj \
@ -106,6 +107,7 @@ gtk_OBJECTS = \
gtkhscale.obj \
gtkhscrollbar.obj \
gtkhseparator.obj \
gtkhsv.obj \
gtkimage.obj \
gtkinputdialog.obj \
gtkinvisible.obj \