|
wlmaker
|
#include "item.h"#include <stdlib.h>#include <string.h>#include <libbase/libbase.h>#include <libbase/plist.h>
Classes | |
| struct | wlmtool_item |
| struct | wlmtool_menu |
| struct | wlmtool_entry |
Functions | |
| static void | _wlmtool_item_destroy_dlnode (bs_dllist_node_t *dlnode_ptr, void *ud_ptr) |
| static int | _wlmtool_item_cmp (const bs_avltree_node_t *node_ptr, const void *key_ptr) |
| static int | _wlmtool_item_dlnode_cmp (const bs_dllist_node_t *n1, const bs_dllist_node_t *n2) |
| static bool | _wlmtool_item_dlnode_add_to_array (bs_dllist_node_t *dlnode_ptr, void *ud_ptr) |
| static void | _wlmtool_menu_destroy_item (struct wlmtool_item *item_ptr) |
| static bspl_array_t * | _wlmtool_menu_create_array (struct wlmtool_item *item_ptr) |
| static void | _wlmtool_entry_destroy (struct wlmtool_item *item_ptr) |
| static bspl_array_t * | _wlmtool_entry_create_array (struct wlmtool_item *item_ptr) |
| void | wlmtool_item_destroy (struct wlmtool_item *item_ptr) |
| bspl_array_t * | wlmtool_item_create_array (struct wlmtool_item *item_ptr) |
| struct wlmtool_menu * | wlmtool_menu_create (const char *title_ptr) |
| struct wlmtool_item * | wlmtool_item_from_menu (struct wlmtool_menu *menu_ptr) |
| bool | wlmtool_menu_add_item (struct wlmtool_menu *menu_ptr, struct wlmtool_item *item_ptr) |
| struct wlmtool_menu * | wlmtool_menu_get_or_create_submenu (struct wlmtool_menu *menu_ptr, const void *key_ptr) |
| struct wlmtool_item * | wlmtool_file_action_create (const char *title_ptr, const char *action_ptr, const char *resolved_path_ptr) |
| struct wlmtool_item * | wlmtool_entry_create (const char *key_ptr, const char **args_ptr) |
| static void | _wlmaker_item_test_create (bs_test_t *test_ptr) |
| static void | _wlmaker_item_test_array (bs_test_t *test_ptr) |
Variables | |
| static const bs_test_case_t | _wlmtool_item_test_cases [] |
| const bs_test_set_t | wlmtool_item_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 |
Tests plist array creation.
|
static |
Tests item creation and destruction.
|
static |
|
static |
Implements wlmtool_item::destroy. Dtor for the entry.
|
static |
Comparator for the AVL tree.
|
static |
Callback for bs_dllist_each(), destroy the item at dlnode_ptr.
|
static |
Creates array from item at dlnode_ptr and adds to array at ud_ptr.
|
static |
Comparator for the double-linked list.
|
static |
Creates a plist array representing the menu and it's items.
| item_ptr |
|
static |
Implements wlmtool_item::destroy.
| struct wlmtool_item * wlmtool_entry_create | ( | const char * | key_ptr, |
| const char ** | args_ptr | ||
| ) |
Adds a menu entry.
| key_ptr | Key that is expected unique within the submenu. |
| args_ptr | NULL-terminted array to build the entry from. |
| struct wlmtool_item * wlmtool_file_action_create | ( | const char * | title_ptr, |
| const char * | action_ptr, | ||
| const char * | resolved_path_ptr | ||
| ) |
Creates a "file action" menu item.
| title_ptr | Title to use for the menu entry. |
| action_ptr | Action command to use. |
| resolved_path_ptr | Fully resolved path to the file to act on. |
| bspl_array_t * wlmtool_item_create_array | ( | struct wlmtool_item * | item_ptr | ) |
Returns a plist array representing the item (or menu).
| void wlmtool_item_destroy | ( | struct wlmtool_item * | item_ptr | ) |
Destroys the item.
| struct wlmtool_item * wlmtool_item_from_menu | ( | struct wlmtool_menu * | menu_ptr | ) |
| bool wlmtool_menu_add_item | ( | struct wlmtool_menu * | menu_ptr, |
| struct wlmtool_item * | item_ptr | ||
| ) |
Adds an item to the menu.
| struct wlmtool_menu * wlmtool_menu_create | ( | const char * | title_ptr | ) |
Creates a menu.
| title_ptr |
| struct wlmtool_menu * wlmtool_menu_get_or_create_submenu | ( | struct wlmtool_menu * | menu_ptr, |
| const void * | key_ptr | ||
| ) |
Returns a submenu for key, if it exists. If not, create it.
|
static |
Test cases for the menu item classes.
| const bs_test_set_t wlmtool_item_test_set |
Unit tests for the menu item classes.