VLC 4.0.0-dev
vlc_extensions.h File Reference
Include dependency graph for vlc_extensions.h:

Go to the source code of this file.

Data Structures

struct  extension_t
 Extension descriptor: name, title, author, ... More...
 
struct  extensions_manager_t
 Extensions manager object. More...
 
struct  extension_dialog_command_t
 Command to pass to the extension dialog owner. More...
 
struct  extension_dialog_t
 Dialog descriptor for extensions. More...
 
struct  extension_widget_t
 Widget descriptor for extensions. More...
 
struct  extension_widget_t::extension_widget_value_t
 

Macros

#define extension_Activate(mgr, ext)    extension_Control( mgr, EXTENSION_ACTIVATE, ext )
 Activate or trigger an extension. More...
 
#define extension_Trigger(mgr, ext)    extension_Control( mgr, EXTENSION_TRIGGER, ext )
 Trigger the extension. More...
 
#define extension_Deactivate(mgr, ext)    extension_Control( mgr, EXTENSION_DEACTIVATE, ext )
 Deactivate an extension. More...
 
#define extension_IsActivated(mgr, ext)    vlc_extension_GetBool( mgr, ext, EXTENSION_IS_ACTIVATED, false )
 Is this extension activated? More...
 
#define extension_HasMenu(mgr, ext)    vlc_extension_GetBool( mgr, ext, EXTENSION_HAS_MENU, false )
 Does this extension have a sub-menu? More...
 
#define extension_TriggerOnly(mgr, ext)    vlc_extension_GetBool( mgr, ext, EXTENSION_TRIGGER_ONLY, false )
 Can this extension only be triggered but not activated? Not compatible with HasMenu. More...
 
#define extension_DialogClosed(dlg)    extension_DialogCommand( dlg, EXTENSION_EVENT_CLOSE, NULL )
 Close the dialog. More...
 
#define extension_WidgetClicked(dlg, wdg)    extension_DialogCommand( dlg, EXTENSION_EVENT_CLICK, wdg )
 Forward a click on a widget. More...
 

Typedefs

typedef struct extensions_manager_sys_t extensions_manager_sys_t
 
typedef struct extensions_manager_t extensions_manager_t
 
typedef struct extension_t extension_t
 Extension descriptor: name, title, author, ... More...
 
typedef struct extension_dialog_t extension_dialog_t
 
typedef struct extension_widget_t extension_widget_t
 

Enumerations

enum  {
  EXTENSION_ACTIVATE , EXTENSION_DEACTIVATE , EXTENSION_IS_ACTIVATED , EXTENSION_HAS_MENU ,
  EXTENSION_GET_MENU , EXTENSION_TRIGGER_ONLY , EXTENSION_TRIGGER , EXTENSION_TRIGGER_MENU ,
  EXTENSION_SET_INPUT , EXTENSION_PLAYING_CHANGED , EXTENSION_META_CHANGED
}
 
enum  extension_dialog_event_e { EXTENSION_EVENT_CLICK , EXTENSION_EVENT_CLOSE }
 User interface event types. More...
 
enum  extension_widget_type_e {
  EXTENSION_WIDGET_LABEL , EXTENSION_WIDGET_BUTTON , EXTENSION_WIDGET_IMAGE , EXTENSION_WIDGET_HTML ,
  EXTENSION_WIDGET_TEXT_FIELD , EXTENSION_WIDGET_PASSWORD , EXTENSION_WIDGET_DROPDOWN , EXTENSION_WIDGET_LIST ,
  EXTENSION_WIDGET_CHECK_BOX , EXTENSION_WIDGET_SPIN_ICON
}
 Widget types. More...
 

Functions

static int extension_Control (extensions_manager_t *p_mgr, int i_control, extension_t *ext,...)
 Control function for extensions. More...
 
static bool vlc_extension_GetBool (extensions_manager_t *p_mgr, extension_t *p_ext, int i_flag, bool b_default)
 Helper for extension_HasMenu, extension_IsActivated... Do not use. More...
 
static int extension_GetMenu (extensions_manager_t *p_mgr, extension_t *p_ext, char ***pppsz, uint16_t **ppi)
 Get this extension's sub-menu. More...
 
static int extension_TriggerMenu (extensions_manager_t *p_mgr, extension_t *p_ext, uint16_t i)
 Trigger an entry of the extension menu. More...
 
static int extension_SetInput (extensions_manager_t *p_mgr, extension_t *p_ext, input_item_t *p_item)
 Trigger an entry of the extension menu. More...
 
static int extension_PlayingChanged (extensions_manager_t *p_mgr, extension_t *p_ext, int state)
 
static int extension_MetaChanged (extensions_manager_t *p_mgr, extension_t *p_ext)
 
static int extension_DialogCommand (extension_dialog_t *p_dialog, extension_dialog_event_e event, void *data)
 Send a command to an Extension dialog. More...
 

Macro Definition Documentation

◆ extension_Activate

#define extension_Activate (   mgr,
  ext 
)     extension_Control( mgr, EXTENSION_ACTIVATE, ext )

Activate or trigger an extension.

◆ extension_Deactivate

#define extension_Deactivate (   mgr,
  ext 
)     extension_Control( mgr, EXTENSION_DEACTIVATE, ext )

Deactivate an extension.

◆ extension_DialogClosed

#define extension_DialogClosed (   dlg)     extension_DialogCommand( dlg, EXTENSION_EVENT_CLOSE, NULL )

Close the dialog.

Parameters
dlgThe dialog

◆ extension_HasMenu

#define extension_HasMenu (   mgr,
  ext 
)     vlc_extension_GetBool( mgr, ext, EXTENSION_HAS_MENU, false )

Does this extension have a sub-menu?

◆ extension_IsActivated

#define extension_IsActivated (   mgr,
  ext 
)     vlc_extension_GetBool( mgr, ext, EXTENSION_IS_ACTIVATED, false )

Is this extension activated?

◆ extension_Trigger

#define extension_Trigger (   mgr,
  ext 
)     extension_Control( mgr, EXTENSION_TRIGGER, ext )

Trigger the extension.

Attention: NOT multithreaded!

◆ extension_TriggerOnly

#define extension_TriggerOnly (   mgr,
  ext 
)     vlc_extension_GetBool( mgr, ext, EXTENSION_TRIGGER_ONLY, false )

Can this extension only be triggered but not activated? Not compatible with HasMenu.

◆ extension_WidgetClicked

#define extension_WidgetClicked (   dlg,
  wdg 
)     extension_DialogCommand( dlg, EXTENSION_EVENT_CLICK, wdg )

Forward a click on a widget.

Parameters
dlgThe dialog
wdgThe widget (button, ...)

Typedef Documentation

◆ extension_dialog_t

◆ extension_t

typedef struct extension_t extension_t

Extension descriptor: name, title, author, ...

◆ extension_widget_t

◆ extensions_manager_sys_t

◆ extensions_manager_t

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
EXTENSION_ACTIVATE 

arg1: extension_t*

EXTENSION_DEACTIVATE 

arg1: extension_t*

EXTENSION_IS_ACTIVATED 

arg1: extension_t*, arg2: bool*

EXTENSION_HAS_MENU 

arg1: extension_t*

EXTENSION_GET_MENU 

arg1: extension_t*, arg2: char***, arg3: uint16_t**

EXTENSION_TRIGGER_ONLY 

arg1: extension_t*, arg2: bool*

EXTENSION_TRIGGER 

arg1: extension_t*

EXTENSION_TRIGGER_MENU 

arg1: extension_t*, int (uint16_t)

EXTENSION_SET_INPUT 

arg1: extension_t*, arg2 (input_item_t*)

EXTENSION_PLAYING_CHANGED 

arg1: extension_t*, arg2 int( playing status )

EXTENSION_META_CHANGED 

arg1: extension_t*, arg2 (input_item_t*)

◆ extension_dialog_event_e

User interface event types.

Enumerator
EXTENSION_EVENT_CLICK 

Click on a widget: data = widget.

EXTENSION_EVENT_CLOSE 

Close the dialog: no data.

◆ extension_widget_type_e

Widget types.

Enumerator
EXTENSION_WIDGET_LABEL 

Text label.

EXTENSION_WIDGET_BUTTON 

Clickable button.

EXTENSION_WIDGET_IMAGE 

Image label (psz_text is local URI)

EXTENSION_WIDGET_HTML 

HTML or rich text area (non editable)

EXTENSION_WIDGET_TEXT_FIELD 

Editable text line for user input.

EXTENSION_WIDGET_PASSWORD 

Editable password input (******)

EXTENSION_WIDGET_DROPDOWN 

Drop-down box.

EXTENSION_WIDGET_LIST 

Vertical list box (of strings)

EXTENSION_WIDGET_CHECK_BOX 

Checkable box with label.

EXTENSION_WIDGET_SPIN_ICON 

A "loading..." spinning icon.

Function Documentation

◆ extension_Control()

static int extension_Control ( extensions_manager_t p_mgr,
int  i_control,
extension_t ext,
  ... 
)
inlinestatic

Control function for extensions.

Every GUI -> extension command will go through this function.

References extensions_manager_t::pf_control.

Referenced by extension_GetMenu(), extension_MetaChanged(), extension_PlayingChanged(), extension_SetInput(), extension_TriggerMenu(), and vlc_extension_GetBool().

◆ extension_DialogCommand()

static int extension_DialogCommand ( extension_dialog_t p_dialog,
extension_dialog_event_e  event,
void *  data 
)
inlinestatic

Send a command to an Extension dialog.

Parameters
p_dialogThe dialog
event
See also
extension_dialog_event_e for a list of possible events
Parameters
dataOptional opaque data,
See also
extension_dialog_event_e
Returns
VLC error code

References extension_dialog_command_t::event, extension_dialog_command_t::p_data, extension_dialog_command_t::p_dlg, extension_dialog_t::p_object, var_SetAddress(), and VLC_SUCCESS.

◆ extension_GetMenu()

static int extension_GetMenu ( extensions_manager_t p_mgr,
extension_t p_ext,
char ***  pppsz,
uint16_t **  ppi 
)
inlinestatic

Get this extension's sub-menu.

References extension_Control(), and EXTENSION_GET_MENU.

◆ extension_MetaChanged()

static int extension_MetaChanged ( extensions_manager_t p_mgr,
extension_t p_ext 
)
inlinestatic

◆ extension_PlayingChanged()

static int extension_PlayingChanged ( extensions_manager_t p_mgr,
extension_t p_ext,
int  state 
)
inlinestatic

◆ extension_SetInput()

static int extension_SetInput ( extensions_manager_t p_mgr,
extension_t p_ext,
input_item_t p_item 
)
inlinestatic

Trigger an entry of the extension menu.

References extension_Control(), and EXTENSION_SET_INPUT.

◆ extension_TriggerMenu()

static int extension_TriggerMenu ( extensions_manager_t p_mgr,
extension_t p_ext,
uint16_t  i 
)
inlinestatic

Trigger an entry of the extension menu.

References extension_Control(), and EXTENSION_TRIGGER_MENU.

◆ vlc_extension_GetBool()

static bool vlc_extension_GetBool ( extensions_manager_t p_mgr,
extension_t p_ext,
int  i_flag,
bool  b_default 
)
inlinestatic

Helper for extension_HasMenu, extension_IsActivated... Do not use.

References extension_Control(), and VLC_SUCCESS.