]> Pileus Git - ~andy/gtk/blobdiff - gdk/gdkapplaunchcontext.c
GdkFrameClockIdle: don't start the tiemout/idle when in a frame
[~andy/gtk] / gdk / gdkapplaunchcontext.c
index 075f8fd8900ac250c97e97f78c097fcae00f5ec0..3fbcf7241640ca425d0757a85a8ab5af368be7e4 100644 (file)
@@ -13,9 +13,7 @@
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public
-   License along with the Gnome Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.
+   License along with this library. If not, see <http://www.gnu.org/licenses/>.
 
    Author: Alexander Larsson <alexl@redhat.com>
 */
  * screen or workspace.
  * <example>
  * <title>Launching an application</title>
+ * <informalexample>
  * <programlisting>
  * GdkAppLaunchContext *context;
  *
- * context = gdk_app_launch_context_new (<!-- -->);
+ * context = gdk_display_get_app_launch_context (display);
  *
- * gdk_app_launch_context_set_screen (my_screen);
+ * gdk_app_launch_context_set_screen (screen);
  * gdk_app_launch_context_set_timestamp (event->time);
  *
  * if (!g_app_info_launch_default_for_uri ("http://www.gtk.org", context, &error))
@@ -51,6 +50,7 @@
  *
  * g_object_unref (context);
  * </programlisting>
+ * </informalexample>
  * </example>
  */
 
@@ -66,19 +66,69 @@ static void    gdk_app_launch_context_launch_failed (GAppLaunchContext *context,
                                                      const gchar       *startup_notify_id);
 
 
+enum
+{
+  PROP_0,
+  PROP_DISPLAY
+};
+
 G_DEFINE_TYPE (GdkAppLaunchContext, gdk_app_launch_context, G_TYPE_APP_LAUNCH_CONTEXT)
 
+static void
+gdk_app_launch_context_get_property (GObject    *object,
+                                     guint       prop_id,
+                                     GValue     *value,
+                                     GParamSpec *pspec)
+{
+  GdkAppLaunchContext *context = GDK_APP_LAUNCH_CONTEXT (object);
+
+  switch (prop_id)
+    {
+    case PROP_DISPLAY:
+      g_value_set_object (value, context->display);
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+    }
+}
+
+static void
+gdk_app_launch_context_set_property (GObject      *object,
+                                     guint         prop_id,
+                                     const GValue *value,
+                                     GParamSpec   *pspec)
+{
+  GdkAppLaunchContext *context = GDK_APP_LAUNCH_CONTEXT (object);
+
+  switch (prop_id)
+    {
+    case PROP_DISPLAY:
+      context->display = g_value_dup_object (value);
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+    }
+}
+
 static void
 gdk_app_launch_context_class_init (GdkAppLaunchContextClass *klass)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
   GAppLaunchContextClass *context_class = G_APP_LAUNCH_CONTEXT_CLASS (klass);
 
+  gobject_class->set_property = gdk_app_launch_context_set_property,
+  gobject_class->get_property = gdk_app_launch_context_get_property;
+
   gobject_class->finalize = gdk_app_launch_context_finalize;
 
   context_class->get_display = gdk_app_launch_context_get_display;
   context_class->get_startup_notify_id = gdk_app_launch_context_get_startup_notify_id;
   context_class->launch_failed = gdk_app_launch_context_launch_failed;
+
+  g_object_class_install_property (gobject_class, PROP_DISPLAY,
+    g_param_spec_object ("display", P_("Display"), P_("Display"),
+                         GDK_TYPE_DISPLAY,
+                         G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
 }
 
 static void