]> Dogcows Code - chaz/openbox/blobdiff - obt/link.c
free the user's group ids
[chaz/openbox] / obt / link.c
index 9a05370716e39758a3bb677f4e27c229e0bbfb65..8a5d4dd3649519de2867801f3f1e865e16ee57c7 100644 (file)
@@ -33,6 +33,10 @@ struct _ObtLink {
     gchar *generic; /*!< Generic name for the object (eg Web Browser) */
     gchar *comment; /*!< Comment/description to display for the object */
     gchar *icon; /*!< Name/path for an icon for the object */
+    guint env_required; /*!< The environments that must be present to use this
+                          link. */
+    guint env_restricted; /*!< The environments that must _not_ be present to
+                            use this link. */
 
     union _ObtLinkData {
         struct _ObtLinkApp {
@@ -117,7 +121,15 @@ ObtLink* obt_link_from_ddfile(const gchar *ddname, GSList *paths,
     if ((v = g_hash_table_lookup(keys, "Icon")))
         link->icon = v->value.string, v->value.string = NULL;
 
-    /* XXX handle Only/NotShowIn, better know the current environment */
+    if ((v = g_hash_table_lookup(keys, "OnlyShowIn")))
+        link->env_required = v->value.environments;
+    else
+        link->env_required = 0;
+
+    if ((v = g_hash_table_lookup(keys, "NotShowIn")))
+        link->env_restricted = v->value.environments;
+    else
+        link->env_restricted = 0;
 
     if (link->type == OBT_LINK_TYPE_APPLICATION) {
         if ((v = g_hash_table_lookup(keys, "TryExec"))) {
@@ -126,6 +138,24 @@ ObtLink* obt_link_from_ddfile(const gchar *ddname, GSList *paths,
                 obt_paths_try_exec(p, v->value.string);
         }
 
+        if ((v = g_hash_table_lookup(keys, "Path"))) {
+            /* steal the string */
+            link->d.app.wdir = v->value.string;
+            v->value.string = NULL;
+        }
+
+        if ((v = g_hash_table_lookup(keys, "Terminal")))
+            link->d.app.term = v->value.boolean;
+
+        if ((v = g_hash_table_lookup(keys, "StartupNotify")))
+            link->d.app.startup = v->value.boolean ?
+                OBT_LINK_APP_STARTUP_PROTOCOL_SUPPORT :
+                OBT_LINK_APP_STARTUP_NO_SUPPORT;
+        else
+            link->d.app.startup = OBT_LINK_APP_STARTUP_LEGACY_SUPPORT;
+
+        /* XXX parse link->d.app.exec to determine link->d.app.open */
+
         /* XXX there's more app specific stuff */
     }
 
This page took 0.02061 seconds and 4 git commands to generate.