wlmaker
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions | Variables
menu_item.h File Reference
#include <libbase/libbase.h>
#include "buffer.h"
#include "element.h"
#include "env.h"
#include "style.h"
Include dependency graph for menu_item.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _wlmtk_menu_item_style_t
 
struct  _wlmtk_menu_item_vmt_t
 
struct  _wlmtk_menu_item_t
 
struct  wlmtk_fake_menu_item_t
 

Typedefs

typedef struct _wlmtk_menu_item_t wlmtk_menu_item_t
 
typedef struct _wlmtk_menu_item_vmt_t wlmtk_menu_item_vmt_t
 
typedef struct _wlmtk_menu_item_style_t wlmtk_menu_item_style_t
 

Enumerations

enum  wlmtk_menu_item_state_t { MENU_ITEM_ENABLED , MENU_ITEM_HIGHLIGHTED , MENU_ITEM_DISABLED }
 

Functions

bool wlmtk_menu_item_init (wlmtk_menu_item_t *menu_item_ptr, const wlmtk_menu_item_style_t *style_ptr, wlmtk_env_t *env_ptr)
 
wlmtk_menu_item_vmt_t wlmtk_menu_item_extend (wlmtk_menu_item_t *menu_item_ptr, const wlmtk_menu_item_vmt_t *menu_item_vmt_ptr)
 
void wlmtk_menu_item_fini (wlmtk_menu_item_t *menu_item_ptr)
 
bool wlmtk_menu_item_set_text (wlmtk_menu_item_t *menu_item_ptr, const char *text_ptr)
 
void wlmtk_menu_item_set_enabled (wlmtk_menu_item_t *menu_item_ptr, bool enabled)
 
bs_dllist_node_t * wlmtk_dlnode_from_menu_item (wlmtk_menu_item_t *menu_item_ptr)
 
wlmtk_menu_item_twlmtk_menu_item_from_dlnode (bs_dllist_node_t *dlnode_ptr)
 
wlmtk_element_twlmtk_menu_item_element (wlmtk_menu_item_t *menu_item_ptr)
 
wlmtk_fake_menu_item_twlmtk_fake_menu_item_create (void)
 
void wlmtk_fake_menu_item_destroy (wlmtk_fake_menu_item_t *fake_menu_item_ptr)
 

Variables

const bs_test_case_t wlmtk_menu_item_test_cases []
 

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.

Typedef Documentation

◆ wlmtk_menu_item_style_t

Forward declaration: Style of a menu item.

◆ wlmtk_menu_item_t

Forward declaration: State of the menu item.

◆ wlmtk_menu_item_vmt_t

Forward declaration: Virtual method table of the menu item.

Enumeration Type Documentation

◆ wlmtk_menu_item_state_t

States a menu item can be in.

Function Documentation

◆ wlmtk_dlnode_from_menu_item()

bs_dllist_node_t * wlmtk_dlnode_from_menu_item ( wlmtk_menu_item_t * menu_item_ptr)

Returns pointer to wlmtk_menu_item_t::dlnode.

◆ wlmtk_fake_menu_item_create()

wlmtk_fake_menu_item_t * wlmtk_fake_menu_item_create ( void )

Ctor for the fake menu item.

◆ wlmtk_fake_menu_item_destroy()

void wlmtk_fake_menu_item_destroy ( wlmtk_fake_menu_item_t * fake_menu_item_ptr)

Dtor for the fake menu item.

◆ wlmtk_menu_item_element()

wlmtk_element_t * wlmtk_menu_item_element ( wlmtk_menu_item_t * menu_item_ptr)

Returns a pointer to the superclass wlmtk_element_t.

◆ wlmtk_menu_item_extend()

wlmtk_menu_item_vmt_t wlmtk_menu_item_extend ( wlmtk_menu_item_t * menu_item_ptr,
const wlmtk_menu_item_vmt_t * menu_item_vmt_ptr )

Extends the menu item's virtual methods.

Parameters
menu_item_ptr
menu_item_vmt_ptr
Returns
The previous virtual method table.

◆ wlmtk_menu_item_fini()

void wlmtk_menu_item_fini ( wlmtk_menu_item_t * menu_item_ptr)

Un-initializes the menu item.

Parameters
menu_item_ptr

◆ wlmtk_menu_item_from_dlnode()

wlmtk_menu_item_t * wlmtk_menu_item_from_dlnode ( bs_dllist_node_t * dlnode_ptr)

Returns the base wlmtk_menu_item_t from dlnode_ptr.

◆ wlmtk_menu_item_init()

bool wlmtk_menu_item_init ( wlmtk_menu_item_t * menu_item_ptr,
const wlmtk_menu_item_style_t * style_ptr,
wlmtk_env_t * env_ptr )

Initializes the menu item.

Note: Menu items are created as visible elements.

Parameters
menu_item_ptr
style_ptr
env_ptr
Returns
true iff the initialization succeeded.

◆ wlmtk_menu_item_set_enabled()

void wlmtk_menu_item_set_enabled ( wlmtk_menu_item_t * menu_item_ptr,
bool enabled )

Sets whether the menu item is enabled or disabled.

Parameters
menu_item_ptr
enabled

◆ wlmtk_menu_item_set_text()

bool wlmtk_menu_item_set_text ( wlmtk_menu_item_t * menu_item_ptr,
const char * text_ptr )

Sets or updates the text for the menu item.

Parameters
menu_item_ptr
text_ptr

Variable Documentation

◆ wlmtk_menu_item_test_cases

const bs_test_case_t wlmtk_menu_item_test_cases[]
extern

Unit test cases.