|
wlmaker
|
#include "gen_menu.h"#include <basedir.h>#include <desktop-parser/desktop-parser.h>#include <ftw.h>#include <libbase/libbase.h>#include <libbase/plist.h>#include <locale.h>#include <stdbool.h>#include <stdlib.h>#include <string.h>#include <sys/stat.h>
Classes | |
| struct | category_menu |
| struct | menu_entry |
| struct | category_translation |
Functions | |
| static bool | add_entry_to_menu_tree (bs_avltree_t *menu_tree_ptr, struct menu_entry *menu_entry_ptr) |
| static struct category_menu * | menu_create (const char *category_ptr) |
| static int | menu_cmp (const bs_avltree_node_t *node_ptr, const void *key_ptr) |
| static void | menu_destroy (bs_avltree_node_t *node_ptr) |
| static struct menu_entry * | entry_create (struct desktop_parser *parser, const char *path_ptr) |
| static int | entry_cmp (const bs_avltree_node_t *node_ptr, const void *key_ptr) |
| static void | entry_destroy (bs_avltree_node_t *node_ptr) |
| static const char * | category_from_entry (const struct menu_entry *menu_entry_ptr) |
| static bspl_array_t * | array_from_entry (const struct desktop_entry *entry_ptr) |
| static bspl_array_t * | array_from_tree (bs_avltree_t *menu_tree_ptr) |
| int | ftw_callback (const char *path_ptr, const struct stat *statbuf_ptr, int typeflag) |
| bspl_array_t * | wlmaker_menu_generate (const char *locale_ptr, const char *path_ptr) |
Variables | |
| static const char * | category_other_ptr = "Other" |
| static const struct category_translation | category_table [] |
| struct desktop_parser * | global_parser |
| bs_avltree_t * | global_menu_tree_ptr |
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
static |
Adds the entry to the category menu. Creates a category menu, if needed.
|
static |
Returns the plist array for the menu entry.
|
static |
Creates a plist array describing the full menu.
|
static |
Looks up the category name for the menu entry.
|
static |
Comparator for the entry.
|
static |
Ctor for the entry.
|
static |
Dtor for the entry.
| int ftw_callback | ( | const char * | path_ptr, |
| const struct stat * | statbuf_ptr, | ||
| int | typeflag ) |
Attempts to parse & add each entry from the tree.
|
static |
comparator for the menu.
|
static |
ctor for the menu.
|
static |
Dtor for the menu.
| bspl_array_t * wlmaker_menu_generate | ( | const char * | locale_ptr, |
| const char * | path_ptr ) |
Generates a menu and returns the plist structure for it.
| locale_ptr | The locale for LC_MESSAGES, or NULL. |
| path_ptr |
|
static |
Category to use for any entry that is not categorized.
|
static |
Recognized categories.
| bs_avltree_t* global_menu_tree_ptr |
Global: The menu tree. Used in ftw_callback.
| struct desktop_parser* global_parser |
Global: Parser. Used in ftw_callback.