Author: miguel
Date: 2007-06-12 17:30:36 -0400 (Tue, 12 Jun 2007)
New Revision: 79346
Modified:
trunk/moon/ChangeLog
trunk/moon/configure.ac
trunk/moon/src/runtime.cpp
Log:
Fix the SDL detection, and hook up a few things,
all my events are taken out for now
Modified: trunk/moon/ChangeLog
===================================================================
--- trunk/moon/ChangeLog 2007-06-12 21:19:54 UTC (rev 79345)
+++ trunk/moon/ChangeLog 2007-06-12 21:30:36 UTC (rev 79346)
@@ -1,3 +1,8 @@
+2007-06-10 Miguel de Icaza <[EMAIL PROTECTED]>
+
+ * configure.ac: Check for mono, prepare cflags and libs to embed
+ the Mono VM.
+
2007-06-12 Jeffrey Stedfast <[EMAIL PROTECTED]>
* configure.ac: We now use SDL for audio instead of alsa.
Modified: trunk/moon/configure.ac
===================================================================
--- trunk/moon/configure.ac 2007-06-12 21:19:54 UTC (rev 79345)
+++ trunk/moon/configure.ac 2007-06-12 21:30:36 UTC (rev 79346)
@@ -11,10 +11,9 @@
PKG_PROG_PKG_CONFIG
-LIBS_TO_CHECK="gtk+-2.0 libavcodec libavformat gthread-2.0 libswscale sdl"
-
+AC_MSG_CHECKING(Gtk+ 2.0)
if pkg-config gtk+-2.0; then
- echo Gtk+ 2.0 found
+ AC_MSG_RESULT(found)
else
echo Gtk+ 2.0 development kit is missing
exit 1
@@ -23,21 +22,45 @@
#
# these come from ffmpeg
#
+AC_MSG_CHECKING(libavcodec, libavformat libswscale)
if pkg-config libavcodec libavformat libswscale ; then
- echo ffmpeg developer installation found
+ AC_MSG_RESULT(found)
else
echo ffmpeg and its associated libraries are not installed
echo You need libavcodec, libavformat and libswscale development kits
exit 1
fi
+AC_MSG_CHECKING(Mono)
if pkg-config mono; then
- echo Found Mono
+ AC_MSG_RESULT(found)
else
echo You are missing Mono
echo I was looking for mono.pc file
fi
+use_sdlconfig=false
+AC_MSG_CHECKING(SDL)
+if sdl-config --version >& /dev/null; then
+ AC_MSG_RESULT(found)
+ use_sdlconfig=true
+else
+ if pkg-config sdl; then
+ sdl_module=sdl
+ else
+ echo Not found SDL
+ exit 1
+ fi
+fi
+
+AC_MSG_CHECKING(Olive's Silverlight)
+if pkg-config silver; then
+ AC_MSG_RESULT(found)
+else
+ echo You are missing Mono project Olive module with Silverlight support
+ echo I was looking for silver.pc file
+fi
+
AC_MSG_CHECKING(Mozilla NSPR pkg-config module name)
mozilla_nspr_pcs="nspr mozilla-nspr firefox-nspr xulrunner-nspr seamonkey-nspr"
for pc in $mozilla_nspr_pcs; do
@@ -89,9 +112,14 @@
AC_SUBST(XPIDL)
AC_SUBST(XPFLAGS)
-MOON_PKGS="gtk+-2.0 libavcodec libavformat gthread-2.0 libswscale sdl"
+MOON_PKGS="gtk+-2.0 libavcodec libavformat gthread-2.0 libswscale $sdl_module"
MOON_CFLAGS=`pkg-config --cflags $MOON_PKGS`
MOON_LIBS=`pkg-config --libs gtk+-2.0 $MOON_PKGS`
+if $use_sdlconfig; then
+ MOON_CFLAGS="$MOON_CFLAGS `sdl-config --cflags`"
+ MOON_LIBS="$MOON_LIBS `sdl-config --libs`"
+fi
+
AC_SUBST(MOON_CFLAGS)
AC_SUBST(MOON_LIBS)
Modified: trunk/moon/src/runtime.cpp
===================================================================
--- trunk/moon/src/runtime.cpp 2007-06-12 21:19:54 UTC (rev 79345)
+++ trunk/moon/src/runtime.cpp 2007-06-12 21:30:36 UTC (rev 79346)
@@ -421,11 +421,6 @@
}
}
-UIElement::~UIElement ()
-{
- printf ("FIXME: We should go through all of the attached properties and
unref them\n");
-}
-
void
UIElement::get_xform_for (UIElement *item, cairo_matrix_t *result)
{
@@ -594,6 +589,10 @@
item->SetValue (UIElement::OpacityProperty, Value (opacity));
}
+UIElement::~UIElement ()
+{
+ printf ("FIXME: We should go through all of the attached properties and
unref them\n");
+}
FrameworkElement::FrameworkElement ()
{
@@ -942,6 +941,42 @@
return TRUE;
}
+static gboolean
+motion_notify_callback (GtkWidget *widget, GdkEventMotion *event, gpointer
data)
+{
+ Surface *s = (Surface *) data;
+
+ printf ("Motion\n");
+}
+
+static gboolean
+key_press_callback (GtkWidget *widget, GdkEventKey *key, gpointer data)
+{
+ Surface *s = (Surface *) data;
+
+ printf ("key press\n");
+}
+
+static gboolean
+key_release_callback (GtkWidget *widget, GdkEventKey *key, gpointer data)
+{
+ Surface *s = (Surface *) data;
+
+ printf ("key release\n");
+}
+
+static gboolean
+button_release_callback (GtkWidget *widget, GdkEventButton *button, gpointer
data)
+{
+ printf ("%d released\n", button->button);
+}
+
+static gboolean
+button_press_callback (GtkWidget *widget, GdkEventButton *button, gpointer
data)
+{
+ printf ("%d pressed\n", button->button);
+}
+
void
Canvas::render (Surface *s, int x, int y, int width, int height)
{
@@ -985,6 +1020,13 @@
Surface *s = new Surface ();
s->drawing_area = gtk_drawing_area_new ();
+ gtk_widget_add_events (s->drawing_area,
+ GDK_POINTER_MOTION_MASK |
+ GDK_KEY_PRESS_MASK |
+ GDK_KEY_RELEASE_MASK |
+ GDK_BUTTON_PRESS_MASK |
+ GDK_BUTTON_RELEASE_MASK);
+ GTK_WIDGET_SET_FLAGS (s->drawing_area, GTK_CAN_FOCUS);
gtk_widget_set_double_buffered (s->drawing_area, FALSE);
gtk_widget_show (s->drawing_area);
@@ -1000,6 +1042,21 @@
gtk_signal_connect (GTK_OBJECT (s->drawing_area), "expose_event",
G_CALLBACK (expose_event_callback), s);
+ gtk_signal_connect (GTK_OBJECT (s->drawing_area), "motion_notify_event",
+ G_CALLBACK (motion_notify_callback), s);
+
+ gtk_signal_connect (GTK_OBJECT (s->drawing_area), "key_press_event",
+ G_CALLBACK (key_press_callback), s);
+
+ gtk_signal_connect (GTK_OBJECT (s->drawing_area), "key_release_event",
+ G_CALLBACK (key_release_callback), s);
+
+ gtk_signal_connect (GTK_OBJECT (s->drawing_area), "button_press_event",
+ G_CALLBACK (button_press_callback), s);
+
+ gtk_signal_connect (GTK_OBJECT (s->drawing_area),
"button_release_event",
+ G_CALLBACK (button_release_callback), s);
+
gtk_signal_connect (GTK_OBJECT (s->drawing_area), "realize",
G_CALLBACK (realized_callback), s);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches