wlmaker
Loading...
Searching...
No Matches
Functions | Variables
item.h File Reference
#include <libbase/libbase.h>
#include <libbase/plist.h>
#include <stdbool.h>
Include dependency graph for item.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void wlmtool_item_destroy (struct wlmtool_item *item_ptr)
 
bspl_array_t * wlmtool_item_create_array (struct wlmtool_item *item_ptr)
 
struct wlmtool_menuwlmtool_menu_create (const char *title_ptr)
 
struct wlmtool_itemwlmtool_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_menuwlmtool_menu_get_or_create_submenu (struct wlmtool_menu *menu_ptr, const void *key_ptr)
 
struct wlmtool_itemwlmtool_file_action_create (const char *title_ptr, const char *action_ptr, const char *resolved_path_ptr)
 
struct wlmtool_itemwlmtool_entry_create (const char *key_ptr, const char **args_ptr)
 

Variables

const bs_test_set_t wlmtool_item_test_set
 

Detailed Description

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.

Function Documentation

◆ wlmtool_entry_create()

struct wlmtool_item * wlmtool_entry_create ( const char *  key_ptr,
const char **  args_ptr 
)

Adds a menu entry.

Parameters
key_ptrKey that is expected unique within the submenu.
args_ptrNULL-terminted array to build the entry from.
Returns
Menu item, or NULL on error.

◆ wlmtool_file_action_create()

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.

Parameters
title_ptrTitle to use for the menu entry.
action_ptrAction command to use.
resolved_path_ptrFully resolved path to the file to act on.
Returns
Menu item, or NULL on error.

◆ wlmtool_item_create_array()

bspl_array_t * wlmtool_item_create_array ( struct wlmtool_item item_ptr)

Returns a plist array representing the item (or menu).

◆ wlmtool_item_destroy()

void wlmtool_item_destroy ( struct wlmtool_item item_ptr)

Destroys the item.

◆ wlmtool_item_from_menu()

struct wlmtool_item * wlmtool_item_from_menu ( struct wlmtool_menu menu_ptr)
Returns
the parent item handle for the menu.

◆ wlmtool_menu_add_item()

bool wlmtool_menu_add_item ( struct wlmtool_menu menu_ptr,
struct wlmtool_item item_ptr 
)

Adds an item to this menu.

Parameters
menu_ptr
item_ptrThe item to add. The menu will take ownership.
Returns
true on success.

Adds an item to the menu.

◆ wlmtool_menu_create()

struct wlmtool_menu * wlmtool_menu_create ( const char *  title_ptr)

Creates a menu.

Parameters
title_ptr
Returns
The menu, or NULL on failure. To release associates, the function wlmtool_item_destroy must be called, on the menu's item (
See also
wlmtool_item_from_menu).

◆ wlmtool_menu_get_or_create_submenu()

struct wlmtool_menu * wlmtool_menu_get_or_create_submenu ( struct wlmtool_menu menu_ptr,
const void *  key_ptr 
)

Obtain (or create) the submenu with the provided key within a menu.

Parameters
menu_ptr
key_ptr
Returns
The submenu, or NULL on error.

Returns a submenu for key, if it exists. If not, create it.

Variable Documentation

◆ wlmtool_item_test_set

const bs_test_set_t wlmtool_item_test_set
extern

Unit tests for the menu item classes.