// another struct? Have always intended discovery_t to have minimal members.. just enough to lead to an
// application (PXML, xecutable, name); if the apps want more details, they can use the pnd_pxml code to
// fetch the full PXML and get all the details. But I think we got out of control here :)
+// NOTE: We really need to rework disco-t so it can include non-english titles/desc; perhaps more info as optional,
+// or a name/value pairing system so it can have extra data in it, without a complex structure.
typedef struct {
// base
unsigned char object_type; // see enum above
unsigned int pnd_icon_pos; // offset to the byte after end of PXML in a pnd file (should be icon if present)
// strdup'd from PXML -- hey, who was the idiot who thought it was a reat idea not to just re-use the pxml-struct?
char *title_en;
+ char *desc_en;
char *unique_id;
char *icon;
char *exec;
char *alt_category;
char *alt_category1;
char *alt_category2;
+ char *preview_pic1;
+ char *preview_pic2;
} pnd_disco_t;
void pnd_disco_destroy ( pnd_disco_t *p ); // a function name that simply could not be avoided
if ( pnd_is_pxml_valid_app ( pxmlh ) ) {
pnd_disco_t *p;
char *fixpxml;
+ char *z;
p = pnd_box_allocinsert ( disco_box, (char*) fpath, sizeof(pnd_disco_t) );
if ( pnd_pxml_get_app_name_en ( pxmlh ) ) {
p -> title_en = strdup ( pnd_pxml_get_app_name_en ( pxmlh ) );
}
+ if ( pnd_pxml_get_description_en ( pxmlh ) ) {
+ p -> desc_en = strdup ( pnd_pxml_get_description_en ( pxmlh ) );
+ }
if ( pnd_pxml_get_icon ( pxmlh ) ) {
p -> icon = strdup ( pnd_pxml_get_icon ( pxmlh ) );
}
if ( pnd_pxml_get_altsubcategory2 ( pxmlh ) ) {
p -> alt_category2 = strdup ( pnd_pxml_get_altsubcategory2 ( pxmlh ) );
}
+ // preview pics
+ if ( ( z = pnd_pxml_get_previewpic1 ( pxmlh ) ) ) {
+ p -> preview_pic1 = strdup ( z );
+ }
+ if ( ( z = pnd_pxml_get_previewpic2 ( pxmlh ) ) ) {
+ p -> preview_pic2 = strdup ( z );
+ }
} else {
//printf ( "Invalid PXML; skipping.\n" );
printf ( " Base path: %s filename: %s\n", d -> object_path, d -> object_filename );
if ( d -> title_en ) {
- printf ( " Name: %s\n", d -> title_en );
+ printf ( " Name EN: %s\n", d -> title_en );
+ }
+ if ( d -> desc_en ) {
+ printf ( " Desc EN: %s\n", d -> desc_en );
}
if ( d -> icon ) {
printf ( " Icon: %s\n", d -> icon );
if ( d -> clockspeed ) {
printf ( " Clockspeed: %s\n", d -> clockspeed );
}
+ if ( d -> preview_pic1 ) {
+ printf ( " Preview Pic 1: %s\n", d -> preview_pic1 );
+ }
+ if ( d -> preview_pic2 ) {
+ printf ( " Preview Pic 2: %s\n", d -> preview_pic2 );
+ }
if ( do_icon ) {
if ( pnd_emit_icon ( "./testdata/dotdesktop", d ) ) {