Author: miguel
Date: 2007-06-12 23:57:28 -0400 (Tue, 12 Jun 2007)
New Revision: 79375
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/runtime.cpp
trunk/moon/src/runtime.h
Log:
A little bit of work to translate the cooridnates
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-06-13 03:29:01 UTC (rev 79374)
+++ trunk/moon/src/ChangeLog 2007-06-13 03:57:28 UTC (rev 79375)
@@ -47,6 +47,10 @@
(Surface): new callbacks, these are callbacks that will pass the
notification of the event to managed code.
+ * runtime.cpp (FrameworkElement): provide a default implementation
+ for inside object that works for "squares" (things with widths and
+ heights)
+
2007-06-12 Jeffrey Stedfast <[EMAIL PROTECTED]>
* ffvideo.cpp: Instead of aborting when SDL_OpenAudio() fails,
Modified: trunk/moon/src/runtime.cpp
===================================================================
--- trunk/moon/src/runtime.cpp 2007-06-13 03:29:01 UTC (rev 79374)
+++ trunk/moon/src/runtime.cpp 2007-06-13 03:57:28 UTC (rev 79375)
@@ -606,6 +606,18 @@
item->SetValue (UIElement::OpacityProperty, Value (opacity));
}
+//
+// Maps the x, y coordinate to the space of the given item
+//
+void
+uielement_transform_point (UIElement *item, double *x, double *y)
+{
+ cairo_matrix_t inverse = item->absolute_xform;
+ cairo_matrix_invert (&inverse);
+
+ cairo_matrix_transform_point (&inverse, x, y);
+}
+
bool
UIElement::inside_object (Surface *s, double x, double y)
{
@@ -858,6 +870,7 @@
Canvas::handle_motion (Surface *s, int state, double x, double y)
{
//printf ("is %g %g inside the canvas? %d\n", x, y, inside_object (s,
x, y));
+ //printf ("Bounding: %g %g %g %g\n", x1, y1, x2, y2);
//
// We need to sync the canvas size with the surface size
//if (!inside_object (s, x, y))
Modified: trunk/moon/src/runtime.h
===================================================================
--- trunk/moon/src/runtime.h 2007-06-13 03:29:01 UTC (rev 79374)
+++ trunk/moon/src/runtime.h 2007-06-13 03:57:28 UTC (rev 79375)
@@ -622,9 +622,10 @@
void item_set_render_transform (UIElement *item, Transform *transform);
void item_get_render_affine (UIElement *item, cairo_matrix_t *result);
-double uielement_get_opacity (UIElement *item);
-void uielement_set_opacity (UIElement *item, double opacity);
-
+double uielement_get_opacity (UIElement *item);
+void uielement_set_opacity (UIElement *item, double opacity);
+void uielement_transform_point (UIElement *item, double *x, double *y);
+
//
// FrameworkElement class
//
@@ -704,6 +705,9 @@
cairo_buffer_surface (NULL), cairo_buffer(NULL),
xlib_surface(NULL), cairo_xlib(NULL), pixmap(NULL),
using_cairo_xlib_surface(0), pixbuf(NULL),
+ cb_motion(NULL), cb_down(NULL), cb_up(NULL), cb_enter(NULL),
+ cb_got_focus(NULL), cb_lost_focus(NULL), cb_loaded(NULL),
cb_mouse_leave(NULL),
+ cb_keydown(NULL), cb_keyup(NULL),
cairo (NULL) {}
int width, height;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches