# for the mmenu 'minimenu'
#
+# Note on overriding whats in a .pnd-application/PXML.xml
# Note that you can perform icon name, clockspeed setting and category overrides via an .ovr file
# Note that the icon can be overridden for a pnd-file by making a same-name .png file, in the same location
+# "Notes" can be added to an icon using the .ovr file, as well.
+
+# Skins
+# There is a a searchpath to find skin subdirs in; built in skins are in /etc/pandora/mmenu/skins,
+# so any subdirectory of that is a skin-name. (ie: /etc/pandora/mmenu/skins/default is skin named 'default')
+# Each skin will have its own mmskin.conf file defining how the skin works. All other options should be
+# here, so that skin-changes do not break user preferences
[minimenu]
-static_art_searchpath /etc/pandora/mmenu/skins/default:./minimenu/skin/default
-font Vera.ttf
-font_ptsize 24
+skin_searchpath /media/*/pandora/mmenu/skins:/etc/pandora/mmenu/skins:./minimenu/skin
+skin_selected ~/.mmenuskinchoice
+skin_confname mmskin.conf
pndrun /usr/pandora/scripts:./testdata/scripts # searchpath to locate "pnd_run.sh"; why aren't I looking in /etc/pandora/conf/apps for this?
load_previews_now 0 # if >0, will try to load preview pics from pnds at boot time, not defer till later
load_previews_later 1 # if >0, will try to load preview pics sometime (see defer_timer_ms as well)
[display]
fullscreen 1 # 0 for windowed, >0 for fullscreen
screen_width 800 # for some calculations
-detail_bg_alpha 100 # when rendering the detail panel background, how transparent?
-font_rgba_r 220 # RGBA for the display text
-font_rgba_g 220 # RGBA for the display text
-font_rgba_b 220 # RGBA for the display text
-font_rgba_a 20 # RGBA for the display text
-battery_x 10 # (x,y) for battery level
-battery_y 450 # (x,y) for battery level
-hintline Push SELECT for options # shown at bottom of screen
-hint_x 300 # (x,y) for hint line
-hint_y 450 # (x,y) for hint line
-clock_x 650 # (x,y) for clock
-clock_y 450 # (x,y) for clock
[tabs]
top_maincat 1 # include maincat in top tab bar
top_altcat1 0 # include alt cat subcat 1 in top tab bar
top_altcat2 0 # include alt cat subcat 1 in top tab bar
wraparound 0 # if 1, last tab wraps around to first when going right; going left from first tab goes to last
-font Vera.ttf
-font_ptsize 16
-tab_offset_x 4 # from left screen to first tab left
-tab_offset_y 3 # from top of screen to first tab top
-tab_width 132 # width of tab
-tab_height 35 # height of tab (for vertical clip)
-tab_selheight 39 # height of tab when its selected (for vertical clip)
-text_offset_x 10 # from left edge of tab to left edge of text
-text_offset_y 10 # from top edge of tab to top edge of text
-text_width 110 # clip text to this width
[grid]
-font Vera.ttf
-font_ptsize 12
-icon_max_width 60 # scale icons to..
-icon_max_height 60 # scale icons to..
-grid_offset_x 17 # from left screen to first cell column
-grid_offset_y 60 # from top screen to first cell row
-icon_offset_x 12 # from left edge of cell to left edge of icon in cell
-icon_offset_y 0 # from top edge of cell to top edge of icon in cell
-text_offset_x 42 # from left edge of cell to center of text centering (ie: center of icon presumably)
-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
-row_max 4 # number of rows to display before we stop rendering
-text_hilite_offset_y 62 # from top of cell to top of hilight
scroll_increment 4 # number of rows to scroll when jumping up or down (recommend 1, or same as row_max for full page jump)
-arrow_up_x 450 # left edge of up-arrow showing more icons scrolled away
-arrow_up_y 80 # top edge of up-arrow showing more icons scrolled away
-arrow_down_x 450 # left edge of down-arrow showing more icons scrolled away
-arrow_down_y 380 # top edge of down-arrow showing more icons scrolled away
-arrow_bar_x 455 # left edge of scrollbar
-arrow_bar_y 100 # top edge of scrollbar
-arrow_bar_clip_w 10 # clip scrollbar artwork to width-X
-arrow_bar_clip_h 274 # clip scrollbar artwork to height-X
-scale_up_bool 1 # if 0, will not try to scale up icons
wrap_horiz_samerow 1 # if 0, wraps to prev/next row; if 1, stays on same row
wrap_vert_stop 0 # if 0, wrap to other end; if 1, stops at top/bottom
-[detailpane]
-show 1 # if 0, don't show detail pane artwork at all
-pane_offset_x 475 # left edge of detail pane graphic
-pane_offset_y 60 # top edge of detail pane graphic
-
-[detailtext]
-font Vera.ttf
-font_ptsize 16
-cell_offset_x 488 # left edge of text cell
-cell_offset_y 300 # top edge of text cell
-cell_width 250 # width of cell (for text clipping)
-
[previewpic]
defer_timer_ms 1500 # after setting selection, how long to wait before we try to load the previewpic
-cell_offset_x 480 # left edge of text cell
-cell_offset_y 90 # top edge of text cell
-cell_width 285
-cell_height 180
-scale_up_bool 1 # if 0, will not try to scale up preview
do_cache 1 # if 1, will try to cache previews to SD, for performance boost
cache_searchpath /media/mmcblk[12]p? # devices to consider for caching to, in order
cache_minfree 500 # if free space is less than this (in KB), move to next device
cache_path /pandora/appdata/mmenu.pvwcache # where to write cached images to
cache_findpath /media/mmcblk[12]p?/pandora/appdata/mmenu.pvwcache # where to look for cached preview pics
-[graphics]
-IMG_BACKGROUND_800480 800480_6.png
-IMG_BACKGROUND_TABMASK tab1mask.png
-IMG_DETAIL_PANEL detailpane2.png
-IMG_DETAIL_BG detailpanebg.png
-IMG_SELECTED_ALPHAMASK select.png
-IMG_SELECTED_HILITE hilite.png
-IMG_TAB_SEL tab_sel_tall.png
-IMG_TAB_UNSEL tab_unsel.png
-IMG_TAB_LINE tabline.png # line under the unselected tab, but not left/right corners
-IMG_TAB_LINEL tablinel.png # line under unselected tab on far left
-IMG_TAB_LINER tabliner.png # line under unselected tab on far right
-IMG_ICON_MISSING pandora60.png
-IMG_PREVIEW_MISSING pandora60.png
-IMG_ARROW_UP arrowup.png
-IMG_ARROW_DOWN arrowdown.png
-IMG_ARROW_SCROLLBAR arrowscroller.png
-IMG_HOURGLASS hourglass.png
-
[categories]
do_all_cat 1 # if >0, will show an All category; if 0, skip it, just your cats.
# Normally for mmenu, an encountered category is just used as is. 5 cats exist, you get 5 tabs.
- libpnd: appdata-dir-name?
+- BJ dpad for demo
- add font and fontcolour control to conf
- 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
pnd_conf_handle g_desktopconf = 0;
char *pnd_run_script = NULL;
-char *g_skinpath = NULL;
unsigned char g_x11_present = 1; // >0 if X is present
unsigned char g_catmap = 0; // if 1, we're doing category mapping
unsigned char g_pvwcache = 0; // if 1, we're trying to do preview caching
+char g_skin_selected [ 100 ] = "default";
+char *g_skinpath = NULL; // where 'skin_selected' is located .. the fullpath including skin-dir-name
+pnd_conf_handle g_skinconf = NULL;
+
int main ( int argc, char *argv[] ) {
int logall = -1; // -1 means normal logging rules; >=0 means log all!
int i;
pnd_log ( pndn_rem, "Found pnd_run.sh at '%s'\n", pnd_run_script );
- // figure out skin path
- if ( ! pnd_conf_get_as_char ( g_conf, MMENU_ARTPATH ) ||
- ! pnd_conf_get_as_char ( g_conf, "minimenu.font" )
- )
- {
- pnd_log ( pndn_error, "ERROR: Couldn't set up skin!\n" );
- emit_and_quit ( MM_QUIT );
+ // figure out what skin is selected (or default)
+ FILE *f;
+ char *s = strdup ( pnd_conf_get_as_char ( g_conf, "minimenu.skin_selected" ) );
+ s = pnd_expand_tilde ( s );
+ if ( ( f = fopen ( s, "r" ) ) ) {
+ char buffer [ 100 ];
+ if ( fgets ( buffer, 100, f ) ) {
+ // see if that dir can be located
+ if ( strchr ( buffer, '\n' ) ) {
+ * strchr ( buffer, '\n' ) = '\0';
+ }
+ char *found = pnd_locate_filename ( pnd_conf_get_as_char ( g_conf, "minimenu.skin_searchpath" ), buffer );
+ if ( found ) {
+ strncpy ( g_skin_selected, buffer, 100 );
+ g_skinpath = strdup ( found );
+ } else {
+ pnd_log ( pndn_warning, "Couldn't locate skin named '%s' so falling back.\n", buffer );
+ }
+ }
+ fclose ( f );
}
+ free ( s );
- g_skinpath = pnd_locate_filename ( pnd_conf_get_as_char ( g_conf, MMENU_ARTPATH ),
- pnd_conf_get_as_char ( g_conf, "minimenu.font" ) );
+ if ( g_skinpath ) {
+ pnd_log ( pndn_rem, "Skin is selected: '%s'\n", g_skin_selected );
+ } else {
+ pnd_log ( pndn_rem, "Skin falling back to: '%s'\n", g_skin_selected );
+
+ char *found = pnd_locate_filename ( pnd_conf_get_as_char ( g_conf, "minimenu.skin_searchpath" ),
+ g_skin_selected );
+ if ( found ) {
+ g_skinpath = strdup ( found );
+ } else {
+ pnd_log ( pndn_error, "Couldn't locate skin named '%s'.\n", g_skin_selected );
+ emit_and_quit ( MM_QUIT );
+ }
- if ( ! g_skinpath ) {
- pnd_log ( pndn_error, "ERROR: Couldn't locate skin font!\n" );
- emit_and_quit ( MM_QUIT );
}
+ pnd_log ( pndn_rem, "Skin path determined to be: '%s'\n", g_skinpath );
- g_skinpath = strdup ( g_skinpath ); // so we don't lose it next pnd_locate
+ // lets see if this skin-path actually has a skin conf
+ {
+ char fullpath [ PATH_MAX ];
+ sprintf ( fullpath, "%s/%s", g_skinpath, pnd_conf_get_as_char ( g_conf, "minimenu.skin_confname" ) );
+ g_skinconf = pnd_conf_fetch_by_path ( fullpath );
+ }
- * strstr ( g_skinpath, pnd_conf_get_as_char ( g_conf, "minimenu.font" ) ) = '\0';
+ // figure out skin path if we didn't get it already
+ if ( ! g_skinconf ) {
+ pnd_log ( pndn_error, "ERROR: Couldn't set up skin!\n" );
+ emit_and_quit ( MM_QUIT );
+ }
- pnd_log ( pndn_debug, "Looks like skin is at '%s'\n", g_skinpath );
+ // lets just merge the skin conf onto the regular conf, so it just magicly works
+ pnd_box_append ( g_conf, g_skinconf );
// attempt to set up UI
if ( ! ui_setup() ) {
g_active_appcount = pnd_box_get_size ( g_active_apps );
unsigned char maxwidth, maxheight;
- maxwidth = pnd_conf_get_as_int_d ( g_conf, MMENU_DISP_ICON_MAX_WIDTH, 50 );
- maxheight = pnd_conf_get_as_int_d ( g_conf, MMENU_DISP_ICON_MAX_HEIGHT, 50 );
+ maxwidth = pnd_conf_get_as_int_d ( g_conf, "grid.icon_max_width", 50 );
+ maxheight = pnd_conf_get_as_int_d ( g_conf, "grid.icon_max_height", 50 );
// show cache screen
ui_cachescreen ( 1 /* clear screen */, NULL );
# for the mmenu 'minimenu'
#
+# Note on overriding whats in a .pnd-application/PXML.xml
# Note that you can perform icon name, clockspeed setting and category overrides via an .ovr file
# Note that the icon can be overridden for a pnd-file by making a same-name .png file, in the same location
+# "Notes" can be added to an icon using the .ovr file, as well.
+
+# Skins
+# There is a a searchpath to find skin subdirs in; built in skins are in /etc/pandora/mmenu/skins,
+# so any subdirectory of that is a skin-name. (ie: /etc/pandora/mmenu/skins/default is skin named 'default')
+# Each skin will have its own mmskin.conf file defining how the skin works. All other options should be
+# here, so that skin-changes do not break user preferences
[minimenu]
-static_art_searchpath /etc/pandora/mmenu/skins/default:./minimenu/skin/default
-font Vera.ttf
-font_ptsize 24
+skin_searchpath /media/*/pandora/mmenu/skins:/etc/pandora/mmenu/skins:./minimenu/skin
+skin_selected ~/.mmenuskinchoice
+skin_confname mmskin.conf
pndrun /usr/pandora/scripts:./testdata/scripts # searchpath to locate "pnd_run.sh"; why aren't I looking in /etc/pandora/conf/apps for this?
load_previews_now 0 # if >0, will try to load preview pics from pnds at boot time, not defer till later
load_previews_later 0 # if >0, will try to load preview pics sometime (see defer_timer_ms as well)
[display]
fullscreen 0 # 0 for windowed, >0 for fullscreen
screen_width 800 # for some calculations
-detail_bg_alpha 100 # when rendering the detail panel background, how transparent?
-font_rgba_r 220 # RGBA for the display text
-font_rgba_g 220 # RGBA for the display text
-font_rgba_b 220 # RGBA for the display text
-font_rgba_a 20 # RGBA for the display text
-battery_x 10 # (x,y) for battery level
-battery_y 450 # (x,y) for battery level
-hintline Push SELECT for options # shown at bottom of screen
-hint_x 300 # (x,y) for hint line
-hint_y 450 # (x,y) for hint line
-clock_x 650 # (x,y) for clock
-clock_y 450 # (x,y) for clock
[tabs]
top_maincat 1 # include maincat in top tab bar
top_altcat1 0 # include alt cat subcat 1 in top tab bar
top_altcat2 0 # include alt cat subcat 1 in top tab bar
wraparound 0 # if 1, last tab wraps around to first when going right; going left from first tab goes to last
-font Vera.ttf
-font_ptsize 16
-tab_offset_x 4 # from left screen to first tab left
-tab_offset_y 3 # from top of screen to first tab top
-tab_width 132 # width of tab
-tab_height 35 # height of tab (for vertical clip)
-tab_selheight 39 # height of tab when its selected (for vertical clip)
-text_offset_x 10 # from left edge of tab to left edge of text
-text_offset_y 10 # from top edge of tab to top edge of text
-text_width 110 # clip text to this width
[grid]
-font Vera.ttf
-font_ptsize 12
-icon_max_width 60 # scale icons to..
-icon_max_height 60 # scale icons to..
-grid_offset_x 17 # from left screen to first cell column
-grid_offset_y 60 # from top screen to first cell row
-icon_offset_x 12 # from left edge of cell to left edge of icon in cell
-icon_offset_y 0 # from top edge of cell to top edge of icon in cell
-text_offset_x 42 # from left edge of cell to center of text centering (ie: center of icon presumably)
-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
-row_max 4 # number of rows to display before we stop rendering
-text_hilite_offset_y 62 # from top of cell to top of hilight
scroll_increment 4 # number of rows to scroll when jumping up or down (recommend 1, or same as row_max for full page jump)
-arrow_up_x 450 # left edge of up-arrow showing more icons scrolled away
-arrow_up_y 80 # top edge of up-arrow showing more icons scrolled away
-arrow_down_x 450 # left edge of down-arrow showing more icons scrolled away
-arrow_down_y 380 # top edge of down-arrow showing more icons scrolled away
-arrow_bar_x 455 # left edge of scrollbar
-arrow_bar_y 100 # top edge of scrollbar
-arrow_bar_clip_w 10 # clip scrollbar artwork to width-X
-arrow_bar_clip_h 274 # clip scrollbar artwork to height-X
-scale_up_bool 1 # if 0, will not try to scale up icons
wrap_horiz_samerow 1 # if 0, wraps to prev/next row; if 1, stays on same row
wrap_vert_stop 0 # if 0, wrap to other end; if 1, stops at top/bottom
-[detailpane]
-show 1 # if 0, don't show detail pane artwork at all
-pane_offset_x 475 # left edge of detail pane graphic
-pane_offset_y 60 # top edge of detail pane graphic
-
-[detailtext]
-font Vera.ttf
-font_ptsize 16
-cell_offset_x 488 # left edge of text cell
-cell_offset_y 300 # top edge of text cell
-cell_width 250 # width of cell (for text clipping)
-
[previewpic]
defer_timer_ms 1500 # after setting selection, how long to wait before we try to load the previewpic
-cell_offset_x 480 # left edge of text cell
-cell_offset_y 90 # top edge of text cell
-cell_width 285
-cell_height 180
-scale_up_bool 1 # if 0, will not try to scale up preview
do_cache 1 # if 1, will try to cache previews to SD, for performance boost
cache_searchpath /media/mmcblk[12]p? # devices to consider for caching to, in order
cache_minfree 500 # if free space is less than this (in KB), move to next device
cache_path /pandora/appdata/mmenu.pvwcache # where to write cached images to
cache_findpath /media/mmcblk[12]p?/pandora/appdata/mmenu.pvwcache # where to look for cached preview pics
-[graphics]
-IMG_BACKGROUND_800480 800480_6.png
-IMG_BACKGROUND_TABMASK tab1mask.png
-IMG_DETAIL_PANEL detailpane2.png
-IMG_DETAIL_BG detailpanebg.png
-IMG_SELECTED_ALPHAMASK select.png
-IMG_SELECTED_HILITE hilite.png
-IMG_TAB_SEL tab_sel_tall.png
-IMG_TAB_UNSEL tab_unsel.png
-IMG_TAB_LINE tabline.png # line under the unselected tab, but not left/right corners
-IMG_TAB_LINEL tablinel.png # line under unselected tab on far left
-IMG_TAB_LINER tabliner.png # line under unselected tab on far right
-IMG_ICON_MISSING pandora60.png
-IMG_PREVIEW_MISSING pandora60.png
-IMG_ARROW_UP arrowup.png
-IMG_ARROW_DOWN arrowdown.png
-IMG_ARROW_SCROLLBAR arrowscroller.png
-IMG_HOURGLASS hourglass.png
-
[categories]
do_all_cat 1 # if >0, will show an All category; if 0, skip it, just your cats.
# Normally for mmenu, an encountered category is just used as is. 5 cats exist, you get 5 tabs.
#define MMENU_CONF "mmenu.conf"
#define MMENU_CONF_SEARCHPATH "/etc/pandora/conf:./minimenu"
-// keys
-#define MMENU_ARTPATH "minimenu.static_art_searchpath"
-
-#define MMENU_GRID_FONT "grid.font"
-#define MMENU_GRID_FONTSIZE "grid.font_ptsize"
-
-#define MMENU_DISP_COLMAX "grid.col_max"
-#define MMENU_DISP_ROWMAX "grid.row_max"
-#define MMENU_DISP_ICON_MAX_WIDTH "grid.icon_max_width"
-#define MMENU_DISP_ICON_MAX_HEIGHT "grid.icon_max_height"
-
typedef enum {
pndn_debug = 0,
pndn_rem, // will set default log level to here, so 'debug' is omitted
#include "SDL_gfxPrimitives.h"
#include "SDL_rotozoom.h"
#include "SDL_thread.h"
+#include <sys/types.h>
+#include <dirent.h>
#include "pnd_conf.h"
#include "pnd_logger.h"
#include "pnd_discovery.h"
#include "pnd_apps.h"
#include "pnd_device.h"
+#include "../lib/pnd_pathiter.h"
+#include "pnd_utility.h"
#include "mmenu.h"
#include "mmcat.h"
}
// grid font
- sprintf ( fullpath, "%s/%s", g_skinpath, pnd_conf_get_as_char ( g_conf, MMENU_GRID_FONT ) );
- g_grid_font = TTF_OpenFont ( fullpath, pnd_conf_get_as_int_d ( g_conf, MMENU_GRID_FONTSIZE, 10 ) );
+ sprintf ( fullpath, "%s/%s", g_skinpath, pnd_conf_get_as_char ( g_conf, "grid.font" ) );
+ g_grid_font = TTF_OpenFont ( fullpath, pnd_conf_get_as_int_d ( g_conf, "grid.font_ptsize", 10 ) );
if ( ! g_grid_font ) {
pnd_log ( pndn_error, "ERROR: Couldn't load font '%s' for size %u\n",
- pnd_conf_get_as_char ( g_conf, MMENU_GRID_FONT ), pnd_conf_get_as_int_d ( g_conf, MMENU_GRID_FONTSIZE, 10 ) );
+ pnd_conf_get_as_char ( g_conf, "grid.font" ), pnd_conf_get_as_int_d ( g_conf, "grid.font_ptsize", 10 ) );
return ( 0 ); // couldn't set up SDL TTF
}
unsigned int screen_width = pnd_conf_get_as_int_d ( g_conf, "display.screen_width", 800 );
- unsigned char row_max = pnd_conf_get_as_int_d ( g_conf, MMENU_DISP_ROWMAX, 4 );
- unsigned char col_max = pnd_conf_get_as_int_d ( g_conf, MMENU_DISP_COLMAX, 5 );
+ unsigned char row_max = pnd_conf_get_as_int_d ( g_conf, "grid.row_max", 4 );
+ unsigned char col_max = pnd_conf_get_as_int_d ( g_conf, "grid.col_max", 5 );
unsigned int font_rgba_r = pnd_conf_get_as_int_d ( g_conf, "display.font_rgba_r", 200 );
unsigned int font_rgba_g = pnd_conf_get_as_int_d ( g_conf, "display.font_rgba_g", 200 );
"Exit and run xfce4",
"Exit and run pmenu",
"Quit (<- beware)",
+ "Select a Minimenu skin",
"About Minimenu"
};
- int sel = ui_modal_single_menu ( opts, 9, "Minimenu", "Enter to select; other to return." );
+ int sel = ui_modal_single_menu ( opts, 11, "Minimenu", "Enter to select; other to return." );
char buffer [ 100 ];
if ( sel == 0 ) {
} else if ( sel == 8 ) {
emit_and_quit ( MM_QUIT );
} else if ( sel == 9 ) {
+ // select skin
+ if ( ui_pick_skin() ) {
+ emit_and_quit ( MM_RESTART );
+ }
+ } else if ( sel == 10 ) {
// about
}
}
void ui_push_up ( void ) {
- unsigned char col_max = pnd_conf_get_as_int ( g_conf, MMENU_DISP_COLMAX );
+ unsigned char col_max = pnd_conf_get_as_int ( g_conf, "grid.col_max" );
if ( ! ui_selected ) {
return;
// scroll down to show it
int r = ui_determine_row ( ui_selected ) - 1;
- if ( r - pnd_conf_get_as_int ( g_conf, MMENU_DISP_ROWMAX ) > 0 ) {
+ if ( r - pnd_conf_get_as_int ( g_conf, "grid.row_max" ) > 0 ) {
ui_rows_scrolled_down = (unsigned int) r;
}
}
void ui_push_down ( void ) {
- unsigned char col_max = pnd_conf_get_as_int ( g_conf, MMENU_DISP_COLMAX );
+ unsigned char col_max = pnd_conf_get_as_int ( g_conf, "grid.col_max" );
if ( ui_selected ) {
pnd_box_handle h = g_active_apps;
unsigned char maxwidth, maxheight;
- maxwidth = pnd_conf_get_as_int_d ( g_conf, MMENU_DISP_ICON_MAX_WIDTH, 50 );
- maxheight = pnd_conf_get_as_int_d ( g_conf, MMENU_DISP_ICON_MAX_HEIGHT, 50 );
+ maxwidth = pnd_conf_get_as_int_d ( g_conf, "grid.icon_max_width", 50 );
+ maxheight = pnd_conf_get_as_int_d ( g_conf, "grid.icon_max_height", 50 );
pnd_disco_t *iter = pnd_box_get_head ( h );
return;
}
+
+unsigned char ui_pick_skin ( void ) {
+#define MAXSKINS 10
+ char *skins [ MAXSKINS ];
+ unsigned char iter;
+
+ char *searchpath = pnd_conf_get_as_char ( g_conf, "minimenu.skin_searchpath" );
+ char tempname [ 100 ];
+
+ iter = 0;
+
+ skins [ iter++ ] = "No skin change";
+
+ SEARCHPATH_PRE
+ {
+ DIR *d = opendir ( buffer );
+
+ if ( d ) {
+ struct dirent *dd;
+
+ while ( ( dd = readdir ( d ) ) ) {
+
+ if ( dd -> d_name [ 0 ] == '.' ) {
+ // ignore
+ } else if ( ( dd -> d_type == DT_DIR || dd -> d_type == DT_UNKNOWN ) &&
+ iter < MAXSKINS )
+ {
+ snprintf ( tempname, 100, "Skin: %s", dd -> d_name );
+ skins [ iter++ ] = strdup ( tempname );
+ }
+
+ }
+
+ closedir ( d );
+ }
+
+ }
+ SEARCHPATH_POST
+
+ int sel = ui_modal_single_menu ( skins, iter, "Skins", "Enter to select; other to return." );
+
+ // did they pick one?
+ if ( sel > 0 ) {
+ FILE *f;
+
+ char *s = strdup ( pnd_conf_get_as_char ( g_conf, "minimenu.skin_selected" ) );
+ s = pnd_expand_tilde ( s );
+
+ f = fopen ( s, "w" );
+
+ free ( s );
+
+ if ( f ) {
+ fprintf ( f, "%s\n", skins [ sel ] + 6 );
+ fclose ( f );
+ }
+
+ return ( 1 );
+ }
+
+ return ( 0 );
+}
unsigned char ui_setup ( void );
unsigned char ui_imagecache ( char *basepath );
+unsigned char ui_pick_skin ( void ); // return >0 if skin has changed
void ui_render ( void );
#define MM_QUIT "--->quit"
#define MM_RUN "--->run"
+#define MM_RESTART "--->restart"
#endif
--- /dev/null
+
+#
+# mmskin.conf -- defines the art filenames, artwork positioning and other skin-related parameters.
+# Everything user-configurable should be in mmenu.conf, so they can switch skins without breaking their
+# functionality.
+#
+
+[minimenu]
+font Vera.ttf
+font_ptsize 24
+
+[display]
+detail_bg_alpha 100 # when rendering the detail panel background, how transparent?
+font_rgba_r 220 # RGBA for the display text
+font_rgba_g 220 # RGBA for the display text
+font_rgba_b 220 # RGBA for the display text
+font_rgba_a 20 # RGBA for the display text
+battery_x 10 # (x,y) for battery level
+battery_y 450 # (x,y) for battery level
+hintline Push SELECT for options # shown at bottom of screen
+hint_x 300 # (x,y) for hint line
+hint_y 450 # (x,y) for hint line
+clock_x 650 # (x,y) for clock
+clock_y 450 # (x,y) for clock
+
+[tabs]
+font Vera.ttf
+font_ptsize 16
+tab_offset_x 4 # from left screen to first tab left
+tab_offset_y 3 # from top of screen to first tab top
+tab_width 132 # width of tab
+tab_height 35 # height of tab (for vertical clip)
+tab_selheight 39 # height of tab when its selected (for vertical clip)
+text_offset_x 10 # from left edge of tab to left edge of text
+text_offset_y 10 # from top edge of tab to top edge of text
+text_width 110 # clip text to this width
+
+[grid]
+font Vera.ttf
+font_ptsize 12
+icon_max_width 60 # scale icons to..
+icon_max_height 60 # scale icons to..
+grid_offset_x 17 # from left screen to first cell column
+grid_offset_y 60 # from top screen to first cell row
+icon_offset_x 12 # from left edge of cell to left edge of icon in cell
+icon_offset_y 0 # from top edge of cell to top edge of icon in cell
+text_offset_x 42 # from left edge of cell to center of text centering (ie: center of icon presumably)
+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
+row_max 4 # number of rows to display before we stop rendering
+text_hilite_offset_y 62 # from top of cell to top of hilight
+arrow_up_x 450 # left edge of up-arrow showing more icons scrolled away
+arrow_up_y 80 # top edge of up-arrow showing more icons scrolled away
+arrow_down_x 450 # left edge of down-arrow showing more icons scrolled away
+arrow_down_y 380 # top edge of down-arrow showing more icons scrolled away
+arrow_bar_x 455 # left edge of scrollbar
+arrow_bar_y 100 # top edge of scrollbar
+arrow_bar_clip_w 10 # clip scrollbar artwork to width-X
+arrow_bar_clip_h 274 # clip scrollbar artwork to height-X
+scale_up_bool 1 # if 0, will not try to scale up icons
+
+[detailpane]
+show 1 # if 0, don't show detail pane artwork at all
+pane_offset_x 475 # left edge of detail pane graphic
+pane_offset_y 60 # top edge of detail pane graphic
+
+[detailtext]
+font Vera.ttf
+font_ptsize 16
+cell_offset_x 488 # left edge of text cell
+cell_offset_y 300 # top edge of text cell
+cell_width 250 # width of cell (for text clipping)
+
+[previewpic]
+cell_offset_x 480 # left edge of text cell
+cell_offset_y 90 # top edge of text cell
+cell_width 285
+cell_height 180
+scale_up_bool 1 # if 0, will not try to scale up preview
+
+[graphics]
+IMG_BACKGROUND_800480 800480_6.png
+IMG_BACKGROUND_TABMASK tab1mask.png
+IMG_DETAIL_PANEL detailpane2.png
+IMG_DETAIL_BG detailpanebg.png
+IMG_SELECTED_ALPHAMASK select.png
+IMG_SELECTED_HILITE hilite.png
+IMG_TAB_SEL tab_sel_tall.png
+IMG_TAB_UNSEL tab_unsel.png
+IMG_TAB_LINE tabline.png # line under the unselected tab, but not left/right corners
+IMG_TAB_LINEL tablinel.png # line under unselected tab on far left
+IMG_TAB_LINER tabliner.png # line under unselected tab on far right
+IMG_ICON_MISSING pandora60.png
+IMG_PREVIEW_MISSING pandora60.png
+IMG_ARROW_UP arrowup.png
+IMG_ARROW_DOWN arrowdown.png
+IMG_ARROW_SCROLLBAR arrowscroller.png
+IMG_HOURGLASS hourglass.png