Mercurial > dwindows
view gtk/browser.cpp @ 1527:9bab702bd6c1
A bunch of Mac drawing updates to correct issues and improve performance.
Switched to using a different (faster) method for drawing rectangles.
Fixed subpixel drawing issues related to the fact that drawing occurs centered on the coordinate so adding 0.5 draws at a pixel itself instead of spanning two pixels.
And related to that removing the incorrect workaround I had previously used of setting the line width to 0.5.
Also added DW_DRAW_NOAA support when drawing to windows.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 03 Jan 2012 15:59:00 +0000 |
parents | fb59f9eeeecd |
children |
line wrap: on
line source
#ifdef HAVE_CONFIG_H # include <config.h> #endif #define MOZILLA_INTERNAL_API #include <gtk/gtk.h> #include <gtkmozembed.h> #include <gtkmozembed_internal.h> #include "nsIDOMMouseEvent.h" /** * Takes a pointer to a mouse event and returns the mouse * button number or -1 on error. */ extern "C" gint mozilla_get_mouse_event_button(gpointer event) { gint button = 0; glong x,y; g_return_val_if_fail (event, -1); /* the following lines were found in the Galeon source */ nsIDOMMouseEvent *aMouseEvent = (nsIDOMMouseEvent *) event; aMouseEvent->GetButton ((PRUint16 *) &button); aMouseEvent->GetClientX ((PRInt32 *) &x); aMouseEvent->GetClientY ((PRInt32 *) &y); /* for some reason we get different numbers on PPC, this fixes * that up... -- MattA */ if (button == 65536) { button = 1; } else if (button == 131072) { button = 2; } return button; } extern "C" gint mozilla_get_mouse_location( gpointer event, glong *x, glong *y) { g_return_val_if_fail (event, -1); /* the following lines were found in the Galeon source */ nsIDOMMouseEvent *aMouseEvent = (nsIDOMMouseEvent *) event; aMouseEvent->GetClientX ((PRInt32 *) x); aMouseEvent->GetClientY ((PRInt32 *) y); return 0; }