|
wlmaker
|
#include "menu.h"#include <desktop-parser/desktop-parser.h>#include <basedir.h>#include <fts.h>#include <libbase/libbase.h>#include <libbase/plist.h>#include <libgen.h>#include <stdbool.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/stat.h>#include "item.h"
Classes | |
| struct | _category_translation |
| struct | _wlmtool_menu_add_desktop_file_arg |
Functions | |
| static bool | _wlmtool_menu_add_themes_path (struct wlmtool_menu *menu_ptr, const char *path_ptr) |
| static bool | _wlmtool_menu_add_themes_file (const char *resolved_path_ptr, const FTSENT *ftsent_ptr, void *ud_ptr) |
| static bool | _wlmtool_menu_add_desktop_path (struct wlmtool_menu *menu_ptr, const char *path_ptr, const char *locale_ptr) |
| static bool | _wlmtool_menu_add_desktop_file (const char *resolved_path_ptr, const FTSENT *ftsent_ptr, void *ud_ptr) |
| static char * | _wlmtool_menu_themes_name_from_plist_file (const char *path_ptr) |
| static const char * | _wlmtool_menu_category_from_entry (const struct desktop_entry *desktop_entry_ptr) |
| bspl_array_t * | wlmtool_menu_generate_appearance (const char *path_ptr) |
| bspl_array_t * | wlmtool_menu_generate_applications (const char *path_ptr, const char *locale_ptr) |
| static void | _wlmtool_menu_test_generate_themes (bs_test_t *test_ptr) |
| static void | _wlmtool_menu_test_generate_applications (bs_test_t *test_ptr) |
Variables | |
| static const char * | _wlmtool_action_load_theme_from_file = "ThemeLoadFromFile" |
| static const struct _category_translation | _wlmtool_menu_category_table [] |
| static const char * | _wlmtool_menu_category_other_ptr = "Other" |
| static const char * | _wlmtool_menu_terminal_command = "/usr/bin/foot" |
| static const bs_test_case_t | _wlmtool_menu_test_cases [] |
| const bs_test_set_t | wlmtool_menu_test_set |
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 a menu entry for a desktop file.
|
static |
Convenience wrapper to add desktop files from path_ptr to menu_ptr.
|
static |
Adds a menu entry for the plist Themes file at resolved_path_ptr.
|
static |
Convenience wrapper to add themes file from path_ptr to menu_ptr.
|
static |
Looks up the category name for a desktop's file menu entry.
|
static |
Tests generation of the 'Applications' menu.
|
static |
Verifies themes menu generation from the test files.
|
static |
Returns a string holding name to show in the menu for the file action.
This will attempt to load the file as a PList, and extract a string value keyed "Name" from the toplevel dict. If path_ptr is not a plist file, or does not hold a Plist dict as toplevel object, it returns NULL. If there is no "Name" entry in the toplevel dict, the function returns the basename of path_ptr.
| path_ptr |
| bspl_array_t * wlmtool_menu_generate_appearance | ( | const char * | path_ptr | ) |
Generates a menu for the Themes files found at XDG data directories.
| path_ptr | Optional: Path to read from. If NULL, use the XDG data directories. |
| bspl_array_t * wlmtool_menu_generate_applications | ( | const char * | path_ptr, |
| const char * | locale_ptr | ||
| ) |
Generates an Applications menu from parsed .desktop files.
| path_ptr | Optional: Path to read from. If NULL, use the XDG data directories. |
| locale_ptr | The locale for LC_MESSAGES, or NULL. |
|
static |
Command to load a theme file.
|
static |
Category to use for any entry that is not categorized.
|
static |
Recognized categories.
|
static |
Command to use for terminal.
|
static |
Test cases for the menu generator.
| const bs_test_set_t wlmtool_menu_test_set |
Unit tests for the menu generator.