Author: fejj
Date: 2007-09-27 15:53:50 -0400 (Thu, 27 Sep 2007)
New Revision: 86533
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/demo.cpp
trunk/moon/src/runtime.cpp
trunk/moon/src/runtime.h
Log:
2007-09-27 Jeffrey Stedfast <[EMAIL PROTECTED]>
* runtime.cpp (runtime_init): Don't check pango version info,
we're just gonna statically link in pango (and/or do
configure-time checks if the user decides to link to a system
pango). Implemented some preliminary environment variable parsing
action to decide if the user wnts to use ffmpeg vs ms codecs,
pango vs my "silverlight" text layout engine, etc.
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-09-27 19:40:48 UTC (rev 86532)
+++ trunk/moon/src/ChangeLog 2007-09-27 19:53:50 UTC (rev 86533)
@@ -1,5 +1,14 @@
2007-09-27 Jeffrey Stedfast <[EMAIL PROTECTED]>
+ * runtime.cpp (runtime_init): Don't check pango version info,
+ we're just gonna statically link in pango (and/or do
+ configure-time checks if the user decides to link to a system
+ pango). Implemented some preliminary environment variable parsing
+ action to decide if the user wnts to use ffmpeg vs ms codecs,
+ pango vs my "silverlight" text layout engine, etc.
+
+2007-09-27 Jeffrey Stedfast <[EMAIL PROTECTED]>
+
* runtime.cpp (runtime_init): Now takes a flags argument for
enabling/disabling features. If RUNTIME_INIT_BROWSER is not set,
then make sure pango is recent enough (if not, print a warning
Modified: trunk/moon/src/demo.cpp
===================================================================
--- trunk/moon/src/demo.cpp 2007-09-27 19:40:48 UTC (rev 86532)
+++ trunk/moon/src/demo.cpp 2007-09-27 19:53:50 UTC (rev 86533)
@@ -155,7 +155,7 @@
gtk_init (&argc, &argv);
g_thread_init (NULL);
gdk_threads_init ();
- runtime_init (0);
+ runtime_init (RUNTIME_INIT_BROWSER);
downloader_set_functions (downloader_create_state,
downloader_destroy_state,
Modified: trunk/moon/src/runtime.cpp
===================================================================
--- trunk/moon/src/runtime.cpp 2007-09-27 19:40:48 UTC (rev 86532)
+++ trunk/moon/src/runtime.cpp 2007-09-27 19:53:50 UTC (rev 86533)
@@ -1052,9 +1052,22 @@
static bool g_type_inited = false;
guint32 moonlight_flags = 0;
+static struct {
+ const char *override;
+ guint32 flag;
+ bool set;
+} overrides[] = {
+ { "text=pango", RUNTIME_INIT_PANGO_TEXT_LAYOUT, true },
+ { "text=silverlight", RUNTIME_INIT_PANGO_TEXT_LAYOUT, false },
+ { "codecs=microsoft", RUNTIME_INIT_MICROSOFT_CODECS, true },
+ { "codecs=ffmpeg", RUNTIME_INIT_MICROSOFT_CODECS, false },
+};
+
void
runtime_init (guint32 flags)
{
+ const char *env;
+
if (inited)
return;
@@ -1067,13 +1080,40 @@
printf ("*** Proceed at your own risk\n");
}
- if (!(flags & RUNTIME_INIT_BROWSER) && pango_version () <
PANGO_VERSION_ENCODE (1,16,0)) {
- printf ("*** WARNING ***\n");
- printf ("*** Pango versions < 1.16.0 may have rendering
glitches.\n");
- printf ("*** Moon was configured to use Pango version %d.%d.%d,
but\n",
- PANGO_VERSION_MAJOR, PANGO_VERSION_MINOR,
PANGO_VERSION_MICRO);
- printf ("*** is being run against version %s.\n",
pango_version_string ());
- printf ("*** It is suggested that you upgrade.\n");
+ // Allow the user to override the flags via his/her environment
+ if ((env = g_getenv ("MOONLIGHT_OVERRIDES"))) {
+ const char *flag = env;
+ const char *inptr;
+ size_t n;
+ int i;
+
+ while (*flag == ',')
+ flag++;
+
+ inptr = flag;
+
+ while (*flag) {
+ while (*inptr && *inptr != ',')
+ inptr++;
+
+ n = (inptr - flag);
+ for (i = 0; i < G_N_ELEMENTS (overrides); i++) {
+ if (n != strlen (overrides[i].override))
+ continue;
+
+ if (!strncmp (overrides[i].override, flag, n)) {
+ if (!overrides[i].set)
+ flags &= ~overrides[i].flag;
+ else
+ flags |= overrides[i].flag;
+ }
+ }
+
+ while (*inptr == ',')
+ inptr++;
+
+ flag = inptr;
+ }
}
#if OBJECT_TRACKING
Modified: trunk/moon/src/runtime.h
===================================================================
--- trunk/moon/src/runtime.h 2007-09-27 19:40:48 UTC (rev 86532)
+++ trunk/moon/src/runtime.h 2007-09-27 19:53:50 UTC (rev 86533)
@@ -35,10 +35,14 @@
#endif
enum RuntimeInitFlags {
- RUNTIME_INIT_BROWSER = 0x1,
+ RUNTIME_INIT_PANGO_TEXT_LAYOUT = 0x1,
+ RUNTIME_INIT_MICROSOFT_CODECS = 0x2,
};
+#define RUNTIME_INIT_DESKTOP (RUNTIME_INIT_PANGO_TEXT_LAYOUT)
+#define RUNTIME_INIT_BROWSER (RUNTIME_INIT_MICROSOFT_CODECS)
+
class Surface : public EventObject {
public:
Surface (int width, int height);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches