]> Pileus Git - ~andy/gtk/blobdiff - gdk/gdk.c
Add optional colord support to the CUPS print module
[~andy/gtk] / gdk / gdk.c
index e7c7a0c49d21a8ef975c53ee5d3cf90e8fe7336e..16b4e74ca536081f30644c2b26cfdfc69b143b54 100644 (file)
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
  * The #GDK_WINDOWING_X11 macro is defined if the X11 backend
  * is supported.
  *
- * Use this macro to guard code that is specific to the X11-backend.
- * Since GDK may be configured with multiple backends, an additional
- * runtime check for the used backend is recommended:
- *
- * |[
- * #ifdef GDK_WINDOWING_X11
- *   if (GDK_IS_X11_DISPLAY (display))
- *     {
- *       /* make X11-specific calls here */
- *     }
- *   else
- * #endif
- * #ifdef GDK_WINDOWING_QUARTZ
- *   if (GDK_IS_QUARTZ_DISPLAY (display))
- *     {
- *       /* make Quartz-specific calls here &ast/
- *     }
- *   else
- * #endif
- *   g_error ("Unsupported GDK backend");
- * ]|
+ * Use this macro to guard code that is specific to the X11 backend.
  */
 
 /**
@@ -82,6 +62,8 @@
  *
  * The #GDK_WINDOWING_WIN32 macro is defined if the Win32 backend
  * is supported.
+ *
+ * Use this macro to guard code that is specific to the Win32 backend.
  */
 
 /**
@@ -89,6 +71,8 @@
  *
  * The #GDK_WINDOWING_QUARTZ macro is defined if the Quartz backend
  * is supported.
+ *
+ * Use this macro to guard code that is specific to the Quartz backend.
  */
 
 typedef struct _GdkPredicate  GdkPredicate;
@@ -129,7 +113,6 @@ static const GDebugKey gdk_debug_keys[] = {
   {"dnd",           GDK_DEBUG_DND},
   {"xim",           GDK_DEBUG_XIM},
   {"nograbs",       GDK_DEBUG_NOGRABS},
-  {"colormap",      GDK_DEBUG_COLORMAP},
   {"input",         GDK_DEBUG_INPUT},
   {"cursor",        GDK_DEBUG_CURSOR},
   {"multihead",     GDK_DEBUG_MULTIHEAD},
@@ -232,6 +215,8 @@ gdk_add_option_entries_libgtk_only (GOptionGroup *group)
 void
 gdk_pre_parse_libgtk_only (void)
 {
+  const char *rendering_mode;
+
   gdk_initialized = TRUE;
 
   /* We set the fallback program class here, rather than lazily in
@@ -253,11 +238,22 @@ gdk_pre_parse_libgtk_only (void)
 
   if (getenv ("GDK_NATIVE_WINDOWS"))
     {
-      _gdk_native_windows = TRUE;
-      /* Ensure that this is not propagated to spawned applications */
+      g_warning ("The GDK_NATIVE_WINDOWS environment variable is not supported in GTK3.\n"
+                 "See the documentation for gdk_window_ensure_native() on how to get native windows.");
       g_unsetenv ("GDK_NATIVE_WINDOWS");
     }
 
+  rendering_mode = g_getenv ("GDK_RENDERING");
+  if (rendering_mode)
+    {
+      if (g_str_equal (rendering_mode, "similar"))
+        _gdk_rendering_mode = GDK_RENDERING_MODE_SIMILAR;
+      else if (g_str_equal (rendering_mode, "image"))
+        _gdk_rendering_mode = GDK_RENDERING_MODE_IMAGE;
+      else if (g_str_equal (rendering_mode, "recording"))
+        _gdk_rendering_mode = GDK_RENDERING_MODE_RECORDING;
+    }
+
   g_type_init ();
 
   /* Do any setup particular to the windowing system */
@@ -268,7 +264,7 @@ gdk_pre_parse_libgtk_only (void)
 /**
  * gdk_parse_args:
  * @argc: the number of command line arguments.
- * @argv: the array of command line arguments.
+ * @argv: (inout) (array length=argc): the array of command line arguments.
  * 
  * Parse command line arguments, and store for future
  * use by calls to gdk_display_open().
@@ -707,7 +703,7 @@ gdk_threads_init (void)
 }
 
 /**
- * gdk_threads_set_lock_functions:
+ * gdk_threads_set_lock_functions: (skip)
  * @enter_fn:   function called to guard GDK
  * @leave_fn: function called to release the guard
  *
@@ -777,7 +773,7 @@ gdk_threads_dispatch_free (gpointer data)
 /**
  * gdk_threads_add_idle_full:
  * @priority: the priority of the idle source. Typically this will be in the
- *            range btweeen #G_PRIORITY_DEFAULT_IDLE and #G_PRIORITY_HIGH_IDLE
+ *            range between #G_PRIORITY_DEFAULT_IDLE and #G_PRIORITY_HIGH_IDLE
  * @function: function to call
  * @data:     data to pass to @function
  * @notify: (allow-none):   function to call when the idle is removed, or %NULL
@@ -827,6 +823,7 @@ gdk_threads_dispatch_free (gpointer data)
  * Return value: the ID (greater than 0) of the event source.
  *
  * Since: 2.12
+ * Rename to: gdk_threads_add_idle
  */
 guint
 gdk_threads_add_idle_full (gint           priority,
@@ -850,7 +847,7 @@ gdk_threads_add_idle_full (gint           priority,
 }
 
 /**
- * gdk_threads_add_idle:
+ * gdk_threads_add_idle: (skip)
  * @function: function to call
  * @data:     data to pass to @function
  *
@@ -929,6 +926,7 @@ gdk_threads_add_idle (GSourceFunc    function,
  * Return value: the ID (greater than 0) of the event source.
  * 
  * Since: 2.12
+ * Rename to: gdk_threads_add_timeout
  */
 guint
 gdk_threads_add_timeout_full (gint           priority,
@@ -954,7 +952,7 @@ gdk_threads_add_timeout_full (gint           priority,
 }
 
 /**
- * gdk_threads_add_timeout:
+ * gdk_threads_add_timeout: (skip)
  * @interval: the time between calls to the function, in milliseconds
  *             (1/1000ths of a second)
  * @function: function to call
@@ -986,15 +984,16 @@ gdk_threads_add_timeout (guint       interval,
  * @interval: the time between calls to the function, in seconds
  * @function: function to call
  * @data:     data to pass to @function
- * @notify: (allow-none):   function to call when the timeout is removed, or %NULL
+ * @notify: (allow-none): function to call when the timeout is removed, or %NULL
  *
- * A variant of gdk_threads_add_timout_full() with second-granularity.
+ * A variant of gdk_threads_add_timeout_full() with second-granularity.
  * See g_timeout_add_seconds_full() for a discussion of why it is
  * a good idea to use this function if you don't need finer granularity.
  *
  *  Return value: the ID (greater than 0) of the event source.
  * 
  * Since: 2.14
+ * Rename to: gdk_threads_add_timeout_seconds
  */
 guint
 gdk_threads_add_timeout_seconds_full (gint           priority,
@@ -1020,7 +1019,7 @@ gdk_threads_add_timeout_seconds_full (gint           priority,
 }
 
 /**
- * gdk_threads_add_timeout_seconds:
+ * gdk_threads_add_timeout_seconds: (skip)
  * @interval: the time between calls to the function, in seconds
  * @function: function to call
  * @data:     data to pass to @function