all: ${SOLIB} ${LIB} conftest discotest evdevtest notifytest pndnotifyd rawpxmltest pndvalidator loggertest dbusnotifytest pnd_run pndevmapperd pnd_info evtest mmenu mmwrapper
clean:
- ${RM} -f ${ALLOBJ} ${XMLOBJ} ${LIB} ${SOLIB1} locatetest.o bin/locatetest conftest.o bin/conftest discotest.o evdevtest.o bin/evdevtest bin/discotest dbusnotifytest.o bin/dbusnotifytest loggertest.o bin/loggertest bin/notifytest notifytest.o bin/rawpxmltest rawpxmltest.o bin/pnd_run pnd_run.o pnd_info.o bin/pnd_info bin/pndevmapperd pndevmapperd.o bin/pndnotifyd pndnotifyd.o ${SOLIB} testdata/dotdesktop/*.desktop testdata/menu/*.desktop testdata/apps/*.pnd testdata/dotdesktop/*.png deployment/usr/lib/libpnd* deployment/usr/bin/pndnotifyd deployment/usr/bin/pnd_run deployment/usr/bin/pnd_info deployment/usr/pandora/scripts/* deployment/etc/sudoers deployment/etc/init.d/pndnotifyd bin/pndvalidator pndvalidator.o deployment/usr/bin/pndevmapperd testdata/menuicons/* evtest.o bin/evtest bin/mmenu bin/mmwrapper mmenu.o mmwrapper.o deployment/usr/bin/mmenu deployment/usr/bin/mmwrapper mmcache.o mmui.o mmcat.o mmconf.o
+ ${RM} -f ${ALLOBJ} ${XMLOBJ} ${LIB} ${SOLIB1} locatetest.o bin/locatetest conftest.o bin/conftest discotest.o evdevtest.o bin/evdevtest bin/discotest dbusnotifytest.o bin/dbusnotifytest loggertest.o bin/loggertest bin/notifytest notifytest.o bin/rawpxmltest rawpxmltest.o bin/pnd_run pnd_run.o pnd_info.o bin/pnd_info bin/pndevmapperd pndevmapperd.o bin/pndnotifyd pndnotifyd.o ${SOLIB} testdata/dotdesktop/*.desktop testdata/menu/*.desktop testdata/apps/*.pnd testdata/dotdesktop/*.png deployment/usr/lib/libpnd* deployment/usr/bin/pndnotifyd deployment/usr/bin/pnd_run deployment/usr/bin/pnd_info deployment/usr/pandora/scripts/* deployment/etc/sudoers deployment/etc/init.d/pndnotifyd bin/pndvalidator pndvalidator.o deployment/usr/bin/pndevmapperd testdata/menuicons/* evtest.o bin/evtest bin/mmenu bin/mmwrapper mmenu.o mmwrapper.o deployment/usr/bin/mmenu deployment/usr/bin/mmwrapper mmcache.o mmui.o mmcat.o mmconf.o freedsktop_cats.o
${RM} -rf deployment/media deployment/etc/pandora/mmenu
find . -name "*~*" -exec rm {} \; -print
pndevmapperd: pndevmapperd.o ${SOLIB1}
${CC} -lstdc++ -o bin/pndevmapperd pndevmapperd.o ${SOLIB1}
-mmenu: mmenu.o mmui.o mmcache.o mmcat.o mmconf.o ${SOLIB1}
- ${CC} -lstdc++ -o bin/mmenu mmenu.o mmui.o mmcache.o mmcat.o mmconf.o ${SOLIB1} -L${PNDSTUFF}/usr/lib -lSDL -lSDL_image -lSDL_ttf -lSDL_gfx
+mmenu: mmenu.o mmui.o mmcache.o mmcat.o mmconf.o freedesktop_cats.o ${SOLIB1}
+ ${CC} -lstdc++ -o bin/mmenu mmenu.o mmui.o mmcache.o mmcat.o mmconf.o freedesktop_cats.o ${SOLIB1} -L${PNDSTUFF}/usr/lib -lSDL -lSDL_image -lSDL_ttf -lSDL_gfx
mmwrapper: mmwrapper.o ${SOLIB1}
${CC} -lstdc++ -o bin/mmwrapper mmwrapper.o ${SOLIB1}
--- /dev/null
+
+#include <stdio.h>
+#include <strings.h>
+
+#include "freedesktop_cats.h"
+
+// folks want to limit categories to official ones, so okay.
+// http://standards.freedesktop.org/menu-spec/latest/apa.html
+//
+
+char *freedesktop_approved_cats[] = {
+ "AudioVideo",
+ "Audio",
+ "Video",
+ "Development",
+ "Education",
+ "Game",
+ "Graphics",
+ "Network",
+ "Office",
+ "Settings",
+ "System",
+ "Utility",
+ "Building",
+ "Debugger",
+ "IDE",
+ "GUIDesigner",
+ "Profiling",
+ "RevisionControl",
+ "Translation",
+ "Calendar",
+ "ContactManagement",
+ "Database",
+ "Dictionary",
+ "Chart",
+ "Email",
+ "Finance",
+ "FlowChart",
+ "PDA",
+ "ProjectManagement",
+ "Presentation",
+ "Spreadsheet",
+ "WordProcessor",
+ "2DGraphics",
+ "VectorGraphics",
+ "RasterGraphics",
+ "3DGraphics",
+ "Scanning",
+ "OCR",
+ "Photography",
+ "Publishing",
+ "Viewer",
+ "TextTools",
+ "DesktopSettings",
+ "HardwareSettings",
+ "Printing",
+ "PackageManager",
+ "Dialup",
+ "InstantMessaging",
+ "Chat",
+ "IRCClient",
+ "FileTransfer",
+ "HamRadio",
+ "News",
+ "P2P",
+ "RemoteAccess",
+ "Telephony",
+ "TelephonyTools",
+ "VideoConference",
+ "WebBrowser",
+ "WebDevelopment",
+ "Midi",
+ "Mixer",
+ "Sequencer",
+ "Tuner",
+ "TV",
+ "AudioVideoEditing",
+ "Player",
+ "Recorder",
+ "DiscBurning",
+ "ActionGame",
+ "AdventureGame",
+ "ArcadeGame",
+ "BoardGame",
+ "BlocksGame",
+ "CardGame",
+ "KidsGame",
+ "LogicGame",
+ "RolePlaying",
+ "Simulation",
+ "SportsGame",
+ "StrategyGame",
+ "Art",
+ "Construction",
+ "Music",
+ "Languages",
+ "Science",
+ "ArtificialIntelligence",
+ "Astronomy",
+ "Biology",
+ "Chemistry",
+ "ComputerScience",
+ "DataVisualization",
+ "Economy",
+ "Electricity",
+ "Geography",
+ "Geology",
+ "Geoscience",
+ "History",
+ "ImageProcessing",
+ "Literature",
+ "Math",
+ "NumericalAnalysis",
+ "MedicalSoftware",
+ "Physics",
+ "Robotics",
+ "Sports",
+ "ParallelComputing",
+ "Amusement",
+ "Archiving",
+ "Compression",
+ "Electronics",
+ "Emulator",
+ "Engineering",
+ "FileTools",
+ "FileManager",
+ "TerminalEmulator",
+ "Filesystem",
+ "Monitor",
+ "Security",
+ "Accessibility",
+ "Calculator",
+ "Clock",
+ "TextEditor",
+ "Documentation",
+ "Core",
+ "KDE",
+ "GNOME",
+ "GTK",
+ "Qt",
+ "Motif",
+ "Java",
+ "ConsoleOnly",
+ "Screensaver",
+ "TrayIcon",
+ "Applet",
+ "Shell",
+ NULL
+};
+
+unsigned char freedesktop_check_cat ( char *name ) {
+ char **p = freedesktop_approved_cats;
+
+ while ( *p ) {
+
+ if ( strcasecmp ( *p, name ) == 0 ) {
+ return ( 1 );
+ }
+
+ p++;
+ }
+
+ return ( 0 );
+}
+
+#if 0
+int main ( void ) {
+
+ printf ( "check Applet (should be 1) -> %d\n", freedesktop_check_cat ( "Applet" ) );
+ printf ( "check Education (should be 1) -> %d\n", freedesktop_check_cat ( "Education" ) );
+ printf ( "check Mofo (should be 0) -> %d\n", freedesktop_check_cat ( "Mofo" ) );
+
+ return ( 0 );
+}
+#endif
--- /dev/null
+
+#ifndef h_freedesktop_cats_h
+#define h_freedesktop_cats_h
+
+unsigned char freedesktop_check_cat ( char *name );
+
+extern char *freedesktop_approved_cats[];
+
+#define BADCATNAME "Other" /* irony: Other is itself not a freedesktop category */
+
+#endif
#include "mmenu.h"
#include "mmcache.h"
#include "mmcat.h"
+#include "freedesktop_cats.h"
// all categories known -- visible, hidden, subcats, whatever.
pnd_box_handle m_categories = NULL;
//fprintf ( stderr, "meta push: '%s'\n", catname );
+ // push bad categories into Other (if we're not targeting All right now)
+ if ( pnd_conf_get_as_int_d ( g_conf, "categories.good_cats_only", 1 ) ) {
+
+ // don't audit All
+ if ( strncmp ( catname, "All ", 4 ) != 0 ) {
+
+ // if this is a parent cat..
+ if ( catname && ! parentcatname ) {
+
+ // if bad, shove it to Other
+ if ( ! freedesktop_check_cat ( catname ) ) {
+ parentcatname = NULL;
+ catname = BADCATNAME;
+ visiblep = cat_is_visible ( g_conf, catname );
+ }
+
+ } else if ( catname && parentcatname ) {
+ // this is a subcat
+
+ // if parent is bad, then we probably already pushed it over, so don't do it again.
+ // if its parent is okay, but subcat is bad, push it to other. (ie: lets avoid duplication in Other)
+ if ( ! freedesktop_check_cat ( parentcatname ) ) {
+ // skip
+ return ( 1 );
+
+ } else if ( ! freedesktop_check_cat ( catname ) ) {
+ parentcatname = NULL;
+ catname = BADCATNAME;
+ visiblep = cat_is_visible ( g_conf, catname );
+ }
+
+ } // parent or child cat?
+
+ } // not All
+
+ } // good cats only?
+
// if invisible, and a parent category name is known, prepend it for ease of use
if ( ! visiblep && parentcatname ) {
snprintf ( catnamebuffer, 500, "%s.%s", parentcatname, catname );
{ "Sub-categories as folders?", "If no, uses tabs instead of folders within tabs.", "1", "tabs.subcat_as_folders", ct_boolean },
{ "Start with app selected", "Whethor selection is placed by default or not", "0", "minimenu.start_selected", ct_boolean },
{ "Auto discover pnd apps?", "If no, turn on diectory browser to manually find apps", "1", "filesystem.do_pnd_disco", ct_boolean },
+ { "Keep bad categories in Other?", "Lazy dev! Put broken categories into Other to keep clean", "1", "categories.good_cats_only", ct_boolean },
{ "Set CPU speed when leaving", "Whether the next setting is applied or not", "0", "minimenu.use_run_speed", ct_boolean },
{ "CPU speed when leaving", "Before running app, set this speed; app may override.", "500", "minimenu.run_speed", ct_cpu_speed },
{ "Wrap tab change", "Changing tab left or right, does it wrap around?", "0", "tabs.wraparound", ct_boolean },
pnd_conf_handle g_skinconf = NULL;
void sigquit_handler ( int n );
-unsigned char cat_is_visible ( pnd_conf_handle h, char *catname );
unsigned char app_is_visible ( pnd_conf_handle h, char *uniqueid );
int main ( int argc, char *argv[] ) {
void setup_notifications ( void );
+unsigned char cat_is_visible ( pnd_conf_handle h, char *catname );
+
#endif