PXML support for file associations, and spitting out extra .desktop files for them...
[pandora-libraries.git] / include / pnd_desktop.h
index 94bc2eb..0729aaa 100644 (file)
@@ -14,7 +14,9 @@ extern "C" {
 #define PND_DOTDESKTOP_HEADER "[Desktop Entry]"
 #define PND_DOTDESKTOP_SOURCE "X-Pandora-Source=libpnd"
 unsigned char pnd_emit_dotdesktop ( char *targetpath, char *pndrun, pnd_disco_t *p );
-pnd_disco_t *pnd_parse_dotdesktop ( char *ddpath );
+
+#define PND_DOTDESKTOP_LIBPND_ONLY 1 /* convenience flag; caller can do this himself as well */
+pnd_disco_t *pnd_parse_dotdesktop ( char *ddpath, unsigned int flags ); // sets object_flag PND_DISCO_LIBPND_DD for libpnd-origin
 
 // emit_dotinfo() will spit out a .desktop 'info entry', similar to the way emit_dotdesktop does its thing
 // - rather than slide this into emit_dotdesktop(), we wish to allow apps to do this or not by calling this
@@ -22,6 +24,14 @@ pnd_disco_t *pnd_parse_dotdesktop ( char *ddpath );
 //   extra fields to emit_dotdesktop()'s function and breaking apps, or annoying callers down the road
 unsigned char pnd_emit_dotinfo ( char *targetpath, char *pndrun, pnd_disco_t *p );
 
+// emit_dotassoc() will spit out a .desktop executable entry (more or less similar to the emit_dotdesktop above)
+// however in this variation the executable line is set up for invokation of a file association instead of the
+// normal executable line.
+// - lame code is a copy from emit_dotdesktop() .. I really need to clean this up and paramterize a subfunction..
+// - this function will emit all file association .desktops (not just one of them)
+unsigned char pnd_emit_dotassoc ( char *targetpath, char *pndrun, pnd_disco_t *p );
+unsigned char _pnd_emit_dotassoc ( char *targetpath, char *pndrun, pnd_disco_t *p, unsigned char i ); // will only emit the requested assoc 1, 2, 3
+
 // emit_icon() will attempt to copy the icon from a PXML directory, or from a pnd file if appended,
 // to the given directory; returns 1 on sucess, otherwise is a fail.
 unsigned char pnd_emit_icon ( char *targetpath, pnd_disco_t *p );