More significant mmenu changes, couple minor fixes/additions to libpnd proper
authorskeezix <skeezix@flotsam-vm.(none)>
Fri, 26 Mar 2010 03:11:49 +0000 (23:11 -0400)
committerskeezix <skeezix@flotsam-vm.(none)>
Fri, 26 Mar 2010 03:11:49 +0000 (23:11 -0400)
deployment/etc/pandora/conf/mmenu.conf
include/pnd_discovery.h
lib/pnd_discovery.c
minimenu/TODO.txt
minimenu/mmcat.c
minimenu/mmcat.h
minimenu/mmenu.c
minimenu/mmenu.conf
minimenu/mmui.c
minimenu/skin/default/select.png
testdata/app2/battlejewels.ovr

index 5d06f8d..d8905a7 100644 (file)
@@ -71,6 +71,8 @@ text_offset_x         42      # from left edge of cell to center of text centering (ie: cent
 text_offset_y          65      # from top of cell to top of text
 text_width             75      # max width of the text
 text_clip_x            5       # offset from cell edge to left edge of text, when the text width is being clipped to fit
 text_offset_y          65      # from top of cell to top of text
 text_width             75      # max width of the text
 text_clip_x            5       # offset from cell edge to left edge of text, when the text width is being clipped to fit
+sel_offoffset_x                -5      # so selection can be a little bigger than main cell, this is selection offset relative to top corner of icon
+sel_offoffset_y                -5      # so selection can be a little bigger than main cell, this is selection offset relative to top corner of icon
 cell_width             85      # cell location is grid_offset_x + ( cell_width * column_number )
 cell_height            92      # cell location is grid_offset_y + ( cell_height * column_number )
 col_max                        5       # number of columns to render into grid
 cell_width             85      # cell location is grid_offset_x + ( cell_width * column_number )
 cell_height            92      # cell location is grid_offset_y + ( cell_height * column_number )
 col_max                        5       # number of columns to render into grid
@@ -98,7 +100,7 @@ pane_offset_y                60      # top edge of detail pane graphic
 font                   Vera.ttf
 font_ptsize            16
 cell_offset_x          488     # left edge of text cell
 font                   Vera.ttf
 font_ptsize            16
 cell_offset_x          488     # left edge of text cell
-cell_offset_y          312     # top edge of text cell
+cell_offset_y          300     # top edge of text cell
 cell_width             250     # width of cell (for text clipping)
 
 [previewpic]
 cell_width             250     # width of cell (for text clipping)
 
 [previewpic]
index 3e8138d..33513d3 100644 (file)
@@ -43,6 +43,7 @@ typedef enum {
 // 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.
 // 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.
+#define PND_DISCO_FLAG_OVR 1   // An ovr file was found for this app (not per subapp, just per .pnd)
 typedef struct {
   // base
   unsigned char object_type;   // see enum above
 typedef struct {
   // base
   unsigned char object_type;   // see enum above
@@ -50,6 +51,7 @@ typedef struct {
   char *object_filename;       // filename within object_path of the app: the PXML.xml or awesomeapp.pnd file itself
   unsigned int pnd_icon_pos;   // offset to the byte after end of PXML in a pnd file (should be icon if present)
   unsigned char subapp_number; // # of app within PXML (ie: 0, 1, 2, 3, up to the number of apps within the PXML)
   char *object_filename;       // filename within object_path of the app: the PXML.xml or awesomeapp.pnd file itself
   unsigned int pnd_icon_pos;   // offset to the byte after end of PXML in a pnd file (should be icon if present)
   unsigned char subapp_number; // # of app within PXML (ie: 0, 1, 2, 3, up to the number of apps within the PXML)
+  unsigned int object_flags;
   // 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;
   // 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;
index a2ac551..074513d 100644 (file)
@@ -317,11 +317,12 @@ static int pnd_disco_callback ( const char *fpath, const struct stat *sb,
        char key [ 100 ];
        char *v;
 
        char key [ 100 ];
        char *v;
 
+       // set the flag regardless, so its for all subapps
+       p -> object_flags |= PND_DISCO_FLAG_OVR;
+
        // title
        snprintf ( key, 100, "Application-%u.title", p -> subapp_number );
        // title
        snprintf ( key, 100, "Application-%u.title", p -> subapp_number );
-       pnd_log ( PND_LOG_DEFAULT, "find key %s\n", key );
        if ( ( v = pnd_conf_get_as_char ( ovrh, key ) ) ) {
        if ( ( v = pnd_conf_get_as_char ( ovrh, key ) ) ) {
-         pnd_log ( PND_LOG_DEFAULT, "   find key %s\n", key );
          if ( p -> title_en ) {
            free ( p -> title_en );
          }
          if ( p -> title_en ) {
            free ( p -> title_en );
          }
index 5d4db69..81be21d 100644 (file)
@@ -5,11 +5,11 @@
 
 - libpnd: appdata-dir-name?
 
 
 - libpnd: appdata-dir-name?
 
-- note in .ovr, skip showing game category if got
-- upsize selection a little, so full-size icons are still hilighted
+- add font and fontcolour control to conf
 - evmapperd.. no force off, if charging on /sys/class/power_supply/bq27500-0/current_now is +ve
 - About screen and shoutouts // konami code?
 - skinning .. mmenu.conf and then skin.conf in each skin dir?
 - evmapperd.. no force off, if charging on /sys/class/power_supply/bq27500-0/current_now is +ve
 - About screen and shoutouts // konami code?
 - skinning .. mmenu.conf and then skin.conf in each skin dir?
+  - skin picker/saver
 
 - some ultra primtive frame draw, so the 'detail menu' and any 'sub menus' can draw
   their own frame rather than depand on skin frame to exist
 
 - some ultra primtive frame draw, so the 'detail menu' and any 'sub menus' can draw
   their own frame rather than depand on skin frame to exist
index aede3ff..1c666ee 100644 (file)
@@ -22,7 +22,7 @@ unsigned char g_catmapcount = 0;
 
 extern pnd_conf_handle g_conf;
 
 
 extern pnd_conf_handle g_conf;
 
-unsigned char category_push ( char *catname, pnd_disco_t *app ) {
+unsigned char category_push ( char *catname, pnd_disco_t *app, pnd_conf_handle ovrh ) {
   mm_category_t *c;
 
   // check category list; if found, append app to the end of it.
   mm_category_t *c;
 
   // check category list; if found, append app to the end of it.
@@ -59,6 +59,7 @@ unsigned char category_push ( char *catname, pnd_disco_t *app ) {
   bzero ( ar, sizeof(mm_appref_t) );
 
   ar -> ref = app;
   bzero ( ar, sizeof(mm_appref_t) );
 
   ar -> ref = app;
+  ar -> ovrh = ovrh;
 
   // plug it into category
   //   and sort it on insert!
 
   // plug it into category
   //   and sort it on insert!
@@ -189,7 +190,7 @@ unsigned char category_map_setup ( void ) {
       {
        //pnd_log ( pndn_debug, "target(%s) from(%s)\n", k, buffer );
 
       {
        //pnd_log ( pndn_debug, "target(%s) from(%s)\n", k, buffer );
 
-       category_push ( k, NULL );
+       category_push ( k, NULL, 0 );
        g_catmaps [ g_catmapcount ].target = category_query ( k );
        g_catmaps [ g_catmapcount ].from = strdup ( buffer );
        g_catmapcount++;
        g_catmaps [ g_catmapcount ].target = category_query ( k );
        g_catmaps [ g_catmapcount ].from = strdup ( buffer );
        g_catmapcount++;
@@ -217,7 +218,7 @@ mm_category_t *category_map_query ( char *cat ) {
   return ( NULL );
 }
 
   return ( NULL );
 }
 
-unsigned char category_meta_push ( char *catname, pnd_disco_t *app ) {
+unsigned char category_meta_push ( char *catname, pnd_disco_t *app, pnd_conf_handle ovrh ) {
   mm_category_t *cat;
 
   // do we honour cat mapping at all?
   mm_category_t *cat;
 
   // do we honour cat mapping at all?
@@ -227,19 +228,19 @@ unsigned char category_meta_push ( char *catname, pnd_disco_t *app ) {
     cat = category_map_query ( catname );
 
     if ( cat ) {
     cat = category_map_query ( catname );
 
     if ( cat ) {
-      return ( category_push ( cat -> catname, app ) );
+      return ( category_push ( cat -> catname, app, ovrh ) );
     }
 
     // not mapped.. but default?
     if ( pnd_conf_get_as_int_d ( g_conf, "categories.map_default_on", 0 ) ) {
       char *def = pnd_conf_get_as_char ( g_conf, "categories.map_default_cat" );
       if ( def ) {
     }
 
     // not mapped.. but default?
     if ( pnd_conf_get_as_int_d ( g_conf, "categories.map_default_on", 0 ) ) {
       char *def = pnd_conf_get_as_char ( g_conf, "categories.map_default_cat" );
       if ( def ) {
-       return ( category_push ( def, app ) );
+       return ( category_push ( def, app, ovrh ) );
       }
     }
 
   } // cat map is desired?
 
   // not default, just do it
       }
     }
 
   } // cat map is desired?
 
   // not default, just do it
-  return ( category_push ( catname, app ) );
+  return ( category_push ( catname, app, ovrh ) );
 }
 }
index bf78b86..0c679cb 100644 (file)
@@ -4,6 +4,7 @@
 
 typedef struct _mm_appref_t {
   pnd_disco_t *ref;
 
 typedef struct _mm_appref_t {
   pnd_disco_t *ref;
+  pnd_conf_handle ovrh;
   // anything else?
   struct _mm_appref_t *next;
 } mm_appref_t;
   // anything else?
   struct _mm_appref_t *next;
 } mm_appref_t;
@@ -19,7 +20,7 @@ typedef struct {
 #define CATEGORY_ALL "All"
 
 // try to populate as many cats as necessary
 #define CATEGORY_ALL "All"
 
 // try to populate as many cats as necessary
-unsigned char category_push ( char *catname, pnd_disco_t *app ); // catname is not pulled from app, so we can make them up on the fly (ie: "All")
+unsigned char category_push ( char *catname, pnd_disco_t *app, pnd_conf_handle ovrh ); // catname is not pulled from app, so we can make them up on the fly (ie: "All")
 mm_category_t *category_query ( char *catname );
 void category_dump ( void ); // sort the apprefs
 void category_freeall ( void );
 mm_category_t *category_query ( char *catname );
 void category_dump ( void ); // sort the apprefs
 void category_freeall ( void );
@@ -32,6 +33,6 @@ typedef struct {
 
 unsigned char category_map_setup ( void ); // set up the mappings
 mm_category_t *category_map_query ( char *cat );
 
 unsigned char category_map_setup ( void ); // set up the mappings
 mm_category_t *category_map_query ( char *cat );
-unsigned char category_meta_push ( char *catname, pnd_disco_t *app );
+unsigned char category_meta_push ( char *catname, pnd_disco_t *app, pnd_conf_handle ovrh );
 
 #endif
 
 #endif
index 804a3f0..557920a 100644 (file)
  *    c) user performsn some operation (set clock, copy files, whatever) -> probably stays within the menu
  */
 
  *    c) user performsn some operation (set clock, copy files, whatever) -> probably stays within the menu
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <strings.h>
-#include <string.h>
-#include <ctype.h>
-#include <unistd.h>
+#include <stdio.h> /* for FILE etc */
+#include <stdlib.h> /* for malloc */
+#include <unistd.h> /* for unlink */
+#include <limits.h> /* for PATH_MAX */
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#define __USE_GNU /* for strcasestr */
+#include <string.h> /* for making ftw.h happy */
+#include <strings.h>
+#include <ctype.h>
 #include <sys/wait.h>
 
 #include "pnd_logger.h"
 #include <sys/wait.h>
 
 #include "pnd_logger.h"
@@ -42,6 +44,7 @@
 #include "pnd_discovery.h"
 #include "pnd_locate.h"
 #include "pnd_device.h"
 #include "pnd_discovery.h"
 #include "pnd_locate.h"
 #include "pnd_device.h"
+#include "pnd_pndfiles.h"
 
 #include "mmenu.h"
 #include "mmwrapcmd.h"
 
 #include "mmenu.h"
 #include "mmwrapcmd.h"
@@ -249,7 +252,7 @@ int main ( int argc, char *argv[] ) {
 
   // create all cat
   if ( pnd_conf_get_as_int_d ( g_conf, "categories.do_all_cat", 1 ) ) {
 
   // create all cat
   if ( pnd_conf_get_as_int_d ( g_conf, "categories.do_all_cat", 1 ) ) {
-    category_push ( g_x11_present ? CATEGORY_ALL "    (X11)" : CATEGORY_ALL "   (No X11)", NULL );
+    category_push ( g_x11_present ? CATEGORY_ALL "    (X11)" : CATEGORY_ALL "   (No X11)", NULL, 0 );
   }
 
   // set up category mappings
   }
 
   // set up category mappings
@@ -382,6 +385,26 @@ void applications_scan ( void ) {
       ui_cachescreen ( 0 /* clear screen */, IFNULL(iter->title_en,"No Name") );
     }
 
       ui_cachescreen ( 0 /* clear screen */, IFNULL(iter->title_en,"No Name") );
     }
 
+    // if an ovr was flagged by libpnd, lets go inhale it just so we've got the
+    // notes handy, since notes are not handled by libpnd proper
+    pnd_conf_handle ovrh = 0;
+    if ( iter -> object_flags & PND_DISCO_FLAG_OVR ) {
+      char ovrfile [ PATH_MAX ];
+      char *fixpxml;
+      sprintf ( ovrfile, "%s/%s", iter -> object_path, iter -> object_filename );
+      fixpxml = strcasestr ( ovrfile, PND_PACKAGE_FILEEXT );
+      strcpy ( fixpxml, PXML_SAMEPATH_OVERRIDE_FILEEXT );
+
+      ovrh = pnd_conf_fetch_by_path ( ovrfile );
+
+#if 0
+      if ( ovrh ) {
+       pnd_log ( pndn_debug, "Found ovr file for %s # %u\n", iter -> object_filename, iter -> subapp_number );
+      }
+#endif
+
+    } // ovr
+
     // cache the icon, unless deferred
     if ( pnd_conf_get_as_int_d ( g_conf, "minimenu.load_icons_later", 0 ) == 0 ) {
       if ( iter -> pnd_icon_pos &&
     // cache the icon, unless deferred
     if ( pnd_conf_get_as_int_d ( g_conf, "minimenu.load_icons_later", 0 ) == 0 ) {
       if ( iter -> pnd_icon_pos &&
@@ -411,45 +434,45 @@ void applications_scan ( void ) {
       // push to All category
       // we do this first, so first category is always All
       if ( pnd_conf_get_as_int_d ( g_conf, "categories.do_all_cat", 1 ) ) {
       // push to All category
       // we do this first, so first category is always All
       if ( pnd_conf_get_as_int_d ( g_conf, "categories.do_all_cat", 1 ) ) {
-       if ( ! category_push ( g_x11_present ? CATEGORY_ALL "    (X11)" : CATEGORY_ALL "   (No X11)", iter ) ) {
+       if ( ! category_push ( g_x11_present ? CATEGORY_ALL "    (X11)" : CATEGORY_ALL "   (No X11)", iter, ovrh ) ) {
          pnd_log ( pndn_warning, "  Couldn't categorize to All: '%s'\n", IFNULL(iter -> title_en, "No Name") );
        }
       } // all?
 
       // main categories
       if ( iter -> main_category && pnd_conf_get_as_int_d ( g_conf, "tabs.top_maincat", 1 ) ) {
          pnd_log ( pndn_warning, "  Couldn't categorize to All: '%s'\n", IFNULL(iter -> title_en, "No Name") );
        }
       } // all?
 
       // main categories
       if ( iter -> main_category && pnd_conf_get_as_int_d ( g_conf, "tabs.top_maincat", 1 ) ) {
-       if ( ! category_meta_push ( iter -> main_category, iter ) ) {
+       if ( ! category_meta_push ( iter -> main_category, iter, ovrh ) ) {
          pnd_log ( pndn_warning, "  Couldn't categorize to %s: '%s'\n", iter -> main_category, IFNULL(iter -> title_en, "No Name") );
        }
       }
 
       if ( iter -> main_category1 && pnd_conf_get_as_int_d ( g_conf, "tabs.top_maincat1", 0 ) ) {
          pnd_log ( pndn_warning, "  Couldn't categorize to %s: '%s'\n", iter -> main_category, IFNULL(iter -> title_en, "No Name") );
        }
       }
 
       if ( iter -> main_category1 && pnd_conf_get_as_int_d ( g_conf, "tabs.top_maincat1", 0 ) ) {
-       if ( ! category_meta_push ( iter -> main_category1, iter ) ) {
+       if ( ! category_meta_push ( iter -> main_category1, iter, ovrh ) ) {
          pnd_log ( pndn_warning, "  Couldn't categorize to %s: '%s'\n", iter -> main_category1, IFNULL(iter -> title_en, "No Name") );
        }
       }
 
       if ( iter -> main_category2 && pnd_conf_get_as_int_d ( g_conf, "tabs.top_maincat2", 0 ) ) {
          pnd_log ( pndn_warning, "  Couldn't categorize to %s: '%s'\n", iter -> main_category1, IFNULL(iter -> title_en, "No Name") );
        }
       }
 
       if ( iter -> main_category2 && pnd_conf_get_as_int_d ( g_conf, "tabs.top_maincat2", 0 ) ) {
-       if ( ! category_meta_push ( iter -> main_category2, iter ) ) {
+       if ( ! category_meta_push ( iter -> main_category2, iter, ovrh ) ) {
          pnd_log ( pndn_warning, "  Couldn't categorize to %s: '%s'\n", iter -> main_category2, IFNULL(iter -> title_en, "No Name") );
        }
       }
 
       // alt categories
       if ( iter -> alt_category && pnd_conf_get_as_int_d ( g_conf, "tabs.top_altcat", 0 ) ) {
          pnd_log ( pndn_warning, "  Couldn't categorize to %s: '%s'\n", iter -> main_category2, IFNULL(iter -> title_en, "No Name") );
        }
       }
 
       // alt categories
       if ( iter -> alt_category && pnd_conf_get_as_int_d ( g_conf, "tabs.top_altcat", 0 ) ) {
-       if ( ! category_meta_push ( iter -> alt_category, iter ) ) {
+       if ( ! category_meta_push ( iter -> alt_category, iter, ovrh ) ) {
          pnd_log ( pndn_warning, "  Couldn't categorize to %s: '%s'\n", iter -> alt_category, IFNULL(iter -> title_en, "No Name") );
        }
       }
 
       if ( iter -> alt_category1 && pnd_conf_get_as_int_d ( g_conf, "tabs.top_altcat1", 0 ) ) {
          pnd_log ( pndn_warning, "  Couldn't categorize to %s: '%s'\n", iter -> alt_category, IFNULL(iter -> title_en, "No Name") );
        }
       }
 
       if ( iter -> alt_category1 && pnd_conf_get_as_int_d ( g_conf, "tabs.top_altcat1", 0 ) ) {
-       if ( ! category_meta_push ( iter -> alt_category1, iter ) ) {
+       if ( ! category_meta_push ( iter -> alt_category1, iter, ovrh ) ) {
          pnd_log ( pndn_warning, "  Couldn't categorize to %s: '%s'\n", iter -> alt_category1, IFNULL(iter -> title_en, "No Name") );
        }
       }
 
       if ( iter -> alt_category2 && pnd_conf_get_as_int_d ( g_conf, "tabs.top_altcat2", 0 ) ) {
          pnd_log ( pndn_warning, "  Couldn't categorize to %s: '%s'\n", iter -> alt_category1, IFNULL(iter -> title_en, "No Name") );
        }
       }
 
       if ( iter -> alt_category2 && pnd_conf_get_as_int_d ( g_conf, "tabs.top_altcat2", 0 ) ) {
-       if ( ! category_meta_push ( iter -> alt_category2, iter ) ) {
+       if ( ! category_meta_push ( iter -> alt_category2, iter, ovrh ) ) {
          pnd_log ( pndn_warning, "  Couldn't categorize to %s: '%s'\n", iter -> alt_category2, IFNULL(iter -> title_en, "No Name") );
        }
       }
          pnd_log ( pndn_warning, "  Couldn't categorize to %s: '%s'\n", iter -> alt_category2, IFNULL(iter -> title_en, "No Name") );
        }
       }
index 1e57378..9c4369e 100644 (file)
@@ -71,6 +71,8 @@ text_offset_x         42      # from left edge of cell to center of text centering (ie: cent
 text_offset_y          65      # from top of cell to top of text
 text_width             75      # max width of the text
 text_clip_x            5       # offset from cell edge to left edge of text, when the text width is being clipped to fit
 text_offset_y          65      # from top of cell to top of text
 text_width             75      # max width of the text
 text_clip_x            5       # offset from cell edge to left edge of text, when the text width is being clipped to fit
+sel_offoffset_x                -5      # so selection can be a little bigger than main cell, this is selection offset relative to top corner of icon
+sel_offoffset_y                -5      # so selection can be a little bigger than main cell, this is selection offset relative to top corner of icon
 cell_width             85      # cell location is grid_offset_x + ( cell_width * column_number )
 cell_height            92      # cell location is grid_offset_y + ( cell_height * column_number )
 col_max                        5       # number of columns to render into grid
 cell_width             85      # cell location is grid_offset_x + ( cell_width * column_number )
 cell_height            92      # cell location is grid_offset_y + ( cell_height * column_number )
 col_max                        5       # number of columns to render into grid
@@ -98,7 +100,7 @@ pane_offset_y                60      # top edge of detail pane graphic
 font                   Vera.ttf
 font_ptsize            16
 cell_offset_x          488     # left edge of text cell
 font                   Vera.ttf
 font_ptsize            16
 cell_offset_x          488     # left edge of text cell
-cell_offset_y          312     # top edge of text cell
+cell_offset_y          300     # top edge of text cell
 cell_width             250     # width of cell (for text clipping)
 
 [previewpic]
 cell_width             250     # width of cell (for text clipping)
 
 [previewpic]
index 248846b..8fd5bf1 100644 (file)
@@ -246,7 +246,6 @@ unsigned char ui_imagecache ( char *basepath ) {
   //
 
   // scale icons
   //
 
   // scale icons
-  g_imagecache [ IMG_SELECTED_ALPHAMASK ].i = ui_scale_image ( g_imagecache [ IMG_SELECTED_ALPHAMASK ].i, pnd_conf_get_as_int_d ( g_conf, "grid.icon_max_width", 50 ), -1 );
   g_imagecache [ IMG_ICON_MISSING ].i = ui_scale_image ( g_imagecache [ IMG_ICON_MISSING ].i, pnd_conf_get_as_int_d ( g_conf, "grid.icon_max_width", 50 ), -1 );
   // scale text hilight
   g_imagecache [ IMG_SELECTED_HILITE ].i = ui_scale_image ( g_imagecache [ IMG_SELECTED_HILITE ].i, pnd_conf_get_as_int_d ( g_conf, "grid.text_width", 50 ), -1 );
   g_imagecache [ IMG_ICON_MISSING ].i = ui_scale_image ( g_imagecache [ IMG_ICON_MISSING ].i, pnd_conf_get_as_int_d ( g_conf, "grid.icon_max_width", 50 ), -1 );
   // scale text hilight
   g_imagecache [ IMG_SELECTED_HILITE ].i = ui_scale_image ( g_imagecache [ IMG_SELECTED_HILITE ].i, pnd_conf_get_as_int_d ( g_conf, "grid.text_width", 50 ), -1 );
@@ -324,6 +323,8 @@ void ui_render ( void ) {
   unsigned int icon_offset_y = pnd_conf_get_as_int ( g_conf, "grid.icon_offset_y" );
   unsigned int icon_max_width = pnd_conf_get_as_int ( g_conf, "grid.icon_max_width" );
   unsigned int icon_max_height = pnd_conf_get_as_int ( g_conf, "grid.icon_max_height" );
   unsigned int icon_offset_y = pnd_conf_get_as_int ( g_conf, "grid.icon_offset_y" );
   unsigned int icon_max_width = pnd_conf_get_as_int ( g_conf, "grid.icon_max_width" );
   unsigned int icon_max_height = pnd_conf_get_as_int ( g_conf, "grid.icon_max_height" );
+  unsigned int sel_icon_offset_x = pnd_conf_get_as_int_d ( g_conf, "grid.sel_offoffset_x", 0 );
+  unsigned int sel_icon_offset_y = pnd_conf_get_as_int_d ( g_conf, "grid.sel_offoffset_y", 0 );
 
   unsigned int text_width = pnd_conf_get_as_int ( g_conf, "grid.text_width" );
   unsigned int text_clip_x = pnd_conf_get_as_int ( g_conf, "grid.text_clip_x" );
 
   unsigned int text_width = pnd_conf_get_as_int ( g_conf, "grid.text_width" );
   unsigned int text_clip_x = pnd_conf_get_as_int ( g_conf, "grid.text_clip_x" );
@@ -577,12 +578,12 @@ void ui_render ( void ) {
     if ( ! ( render_jobs_b & R_BG ) ) {
       if ( g_imagecache [ IMG_BACKGROUND_800480 ].i ) {
        src.x = grid_offset_x;
     if ( ! ( render_jobs_b & R_BG ) ) {
       if ( g_imagecache [ IMG_BACKGROUND_800480 ].i ) {
        src.x = grid_offset_x;
-       src.y = grid_offset_y;
+       src.y = grid_offset_y + sel_icon_offset_y;
        src.w = col_max * cell_width;
        src.h = row_max * cell_height;
 
        dest -> x = grid_offset_x;
        src.w = col_max * cell_width;
        src.h = row_max * cell_height;
 
        dest -> x = grid_offset_x;
-       dest -> y = grid_offset_y;
+       dest -> y = grid_offset_y + sel_icon_offset_y;
 
        SDL_BlitSurface ( g_imagecache [ IMG_BACKGROUND_800480 ].i, &src, sdl_realscreen, dest );
        dest++;
 
        SDL_BlitSurface ( g_imagecache [ IMG_BACKGROUND_800480 ].i, &src, sdl_realscreen, dest );
        dest++;
@@ -606,10 +607,13 @@ void ui_render ( void ) {
 
            // selected? show hilights
            if ( appiter == ui_selected ) {
 
            // selected? show hilights
            if ( appiter == ui_selected ) {
+             SDL_Surface *s = g_imagecache [ IMG_SELECTED_ALPHAMASK ].i;
              // icon
              // icon
-             dest -> x = grid_offset_x + ( col * cell_width ) + icon_offset_x;
-             dest -> y = grid_offset_y + ( displayrow * cell_height ) + icon_offset_y;
-             SDL_BlitSurface ( g_imagecache [ IMG_SELECTED_ALPHAMASK ].i, NULL /* all */, sdl_realscreen, dest );
+             //dest -> x = grid_offset_x + ( col * cell_width ) + icon_offset_x + ( ( icon_max_width - s -> w ) / 2 );
+             dest -> x = grid_offset_x + ( col * cell_width ) + icon_offset_x + sel_icon_offset_x;
+             //dest -> y = grid_offset_y + ( displayrow * cell_height ) + icon_offset_y + ( ( icon_max_height - s -> h ) / 2 );
+             dest -> y = grid_offset_y + ( displayrow * cell_height ) + icon_offset_y + sel_icon_offset_y;
+             SDL_BlitSurface ( s, NULL /* all */, sdl_realscreen, dest );
              dest++;
              // text
              dest -> x = grid_offset_x + ( col * cell_width ) + text_clip_x;
              dest++;
              // text
              dest -> x = grid_offset_x + ( col * cell_width ) + text_clip_x;
@@ -722,6 +726,7 @@ void ui_render ( void ) {
     }
 
     // category
     }
 
     // category
+#if 0
     if ( ui_selected -> ref -> main_category ) {
 
       sprintf ( buffer, "Category: %s", ui_selected -> ref -> main_category );
     if ( ui_selected -> ref -> main_category ) {
 
       sprintf ( buffer, "Category: %s", ui_selected -> ref -> main_category );
@@ -740,6 +745,7 @@ void ui_render ( void ) {
       dest++;
       desty += src.h;
     }
       dest++;
       desty += src.h;
     }
+#endif
 
     // clock
     if ( ui_selected -> ref -> clockspeed ) {
 
     // clock
     if ( ui_selected -> ref -> clockspeed ) {
@@ -777,7 +783,8 @@ void ui_render ( void ) {
     }
 
     // info hint
     }
 
     // info hint
-    if ( ui_selected -> ref -> clockspeed && ui_selected -> ref -> info_filename ) {
+#if 0 // merged into hint-line
+    if ( ui_selected -> ref -> info_filename ) {
 
       sprintf ( buffer, "Documentation - hit Y" );
 
 
       sprintf ( buffer, "Documentation - hit Y" );
 
@@ -795,6 +802,38 @@ void ui_render ( void ) {
       dest++;
       desty += src.h;
     }
       dest++;
       desty += src.h;
     }
+#endif
+
+    // notes
+    if ( ui_selected -> ovrh ) {
+      char *n;
+      unsigned char i;
+      char buffer [ 50 ];
+
+      desty += 5; // a touch of spacing can't hurt
+
+      for ( i = 1; i < 4; i++ ) {
+       sprintf ( buffer, "Application-%u.note-%u", ui_selected -> ref -> subapp_number, i );
+       n = pnd_conf_get_as_char ( ui_selected -> ovrh, buffer );
+
+       if ( n ) {
+         SDL_Surface *rtext;
+         SDL_Color tmpfontcolor = { font_rgba_r, font_rgba_g, font_rgba_b, font_rgba_a };
+         rtext = TTF_RenderText_Blended ( g_detailtext_font, n, tmpfontcolor );
+         src.x = 0;
+         src.y = 0;
+         src.w = rtext -> w < cell_width ? rtext -> w : cell_width;
+         src.h = rtext -> h;
+         dest -> x = cell_offset_x;
+         dest -> y = desty;
+         SDL_BlitSurface ( rtext, &src, sdl_realscreen, dest );
+         SDL_FreeSurface ( rtext );
+         dest++;
+         desty += rtext -> h;
+       }
+      } // for
+
+    } // r_detail -> notes
 
     // preview pic
     mm_cache_t *ic = cache_query_preview ( ui_selected -> ref -> unique_id );
 
     // preview pic
     mm_cache_t *ic = cache_query_preview ( ui_selected -> ref -> unique_id );
@@ -814,13 +853,13 @@ void ui_render ( void ) {
       dest++;
     }
 
       dest++;
     }
 
-  } // selected?
+  } // r_detail && selected?
 
   // extras
   //
 
   // battery
 
   // extras
   //
 
   // battery
-  if ( 1 ) {
+  if ( render_jobs_b & R_BG ) {
     static int last_battlevel = 0;
     static unsigned char batterylevel = 0;
     char buffer [ 100 ];
     static int last_battlevel = 0;
     static unsigned char batterylevel = 0;
     char buffer [ 100 ];
@@ -844,19 +883,47 @@ void ui_render ( void ) {
 
   // hints
   if ( pnd_conf_get_as_char ( g_conf, "display.hintline" ) ) {
 
   // hints
   if ( pnd_conf_get_as_char ( g_conf, "display.hintline" ) ) {
-    char *buffer = pnd_conf_get_as_char ( g_conf, "display.hintline" );
+    char *buffer;
+    unsigned int hintx, hinty;
+    hintx = pnd_conf_get_as_int_d ( g_conf, "display.hint_x", 40 );
+    hinty = pnd_conf_get_as_int_d ( g_conf, "display.hint_y", 450 );
+    static unsigned int lastwidth = 3000;
+
+    if ( ui_selected && ui_selected -> ref -> info_filename ) {
+      buffer = "Documentation - hit Y";
+    } else {
+      buffer = pnd_conf_get_as_char ( g_conf, "display.hintline" );
+    }
+
     SDL_Surface *rtext;
     SDL_Color tmpfontcolor = { font_rgba_r, font_rgba_g, font_rgba_b, font_rgba_a };
     rtext = TTF_RenderText_Blended ( g_grid_font, buffer, tmpfontcolor );
     SDL_Surface *rtext;
     SDL_Color tmpfontcolor = { font_rgba_r, font_rgba_g, font_rgba_b, font_rgba_a };
     rtext = TTF_RenderText_Blended ( g_grid_font, buffer, tmpfontcolor );
-    dest -> x = pnd_conf_get_as_int_d ( g_conf, "display.hint_x", 40 );
-    dest -> y = pnd_conf_get_as_int_d ( g_conf, "display.hint_y", 450 );
+
+    // clear bg
+    if ( ! ( render_jobs_b & R_BG ) ) {
+      src.x = hintx;
+      src.y = hinty;
+      src.w = lastwidth;
+      src.h = rtext -> h;
+      dest -> x = hintx;
+      dest -> y = hinty;
+      SDL_BlitSurface ( g_imagecache [ IMG_BACKGROUND_TABMASK ].i, &src, sdl_realscreen, dest );
+      dest++;
+      lastwidth = rtext -> w;
+    }
+
+    // now render text
+    dest -> x = hintx;
+    dest -> y = hinty;
     SDL_BlitSurface ( rtext, NULL /* all */, sdl_realscreen, dest );
     SDL_FreeSurface ( rtext );
     dest++;
   }
 
     SDL_BlitSurface ( rtext, NULL /* all */, sdl_realscreen, dest );
     SDL_FreeSurface ( rtext );
     dest++;
   }
 
-  // hints
-  if ( pnd_conf_get_as_int_d ( g_conf, "display.clock_x", -1 ) != -1 ) {
+  // clock time
+  if ( render_jobs_b & R_BG &&
+       pnd_conf_get_as_int_d ( g_conf, "display.clock_x", -1 ) != -1 )
+  {
     char buffer [ 50 ];
 
     time_t t = time ( NULL );
     char buffer [ 50 ];
 
     time_t t = time ( NULL );
@@ -874,6 +941,8 @@ void ui_render ( void ) {
   }
 
   // update all the rects and send it all to sdl
   }
 
   // update all the rects and send it all to sdl
+  // - at this point, we could probably just do 1 rect, of the
+  //   whole screen, and be faster :/
   SDL_UpdateRects ( sdl_realscreen, dest - rects, rects );
 
 } // ui_render
   SDL_UpdateRects ( sdl_realscreen, dest - rects, rects );
 
 } // ui_render
@@ -1152,6 +1221,7 @@ void ui_process_input ( unsigned char block_p ) {
          // set env to xfce
          sprintf ( buffer, "echo startxfce4 > /tmp/gui.load" );
          system ( buffer );
          // set env to xfce
          sprintf ( buffer, "echo startxfce4 > /tmp/gui.load" );
          system ( buffer );
+         emit_and_quit ( buffer );
          //sprintf ( buffer, "sudo poweroff" );
          //system ( buffer );
          exit ( 0 );
          //sprintf ( buffer, "sudo poweroff" );
          //system ( buffer );
          exit ( 0 );
@@ -1159,6 +1229,7 @@ void ui_process_input ( unsigned char block_p ) {
          // set env to pmenu
          sprintf ( buffer, "echo pmenu > /tmp/gui.load" );
          system ( buffer );
          // set env to pmenu
          sprintf ( buffer, "echo pmenu > /tmp/gui.load" );
          system ( buffer );
+         emit_and_quit ( buffer );
          //sprintf ( buffer, "sudo poweroff" );
          //system ( buffer );
          exit ( 0 );
          //sprintf ( buffer, "sudo poweroff" );
          //system ( buffer );
          exit ( 0 );
index cdd15dc..60eec24 100644 (file)
Binary files a/minimenu/skin/default/select.png and b/minimenu/skin/default/select.png differ
index a743b7f..d32d1e5 100644 (file)
@@ -5,3 +5,6 @@ maincategorysub1        Emulator
 [Application-1]
 title                  HatariHack1
 clockspeed             200
 [Application-1]
 title                  HatariHack1
 clockspeed             200
+note-1                 Note Line One; Hello DaveC!
+note-2                 We here have another 2 note line
+note-3                 We here have another 3 note line