Options API
Description: C source code API documentation for the Oyranos project.
Keywords: Oyranos,Color Management,Color Management,ICC,CMS,C,doxygen,API,documentation

| Oyranos Color Management System API - Version 0.9.6

Functions
Options API
Color » Defaults Handling

The idea behind this API is to provide one layout for presenting a configuration dialog to users. The advantage is, every application, like KDE and Gnome control panels, will inherit the same logic. A user can easily use the one and the other panel without too much relearning. More...

Collaboration diagram for Options API:

## Functions
oyWIDGET_e * | oyWidgetListGet (oyGROUP_e group, int *count, oyAlloc_f allocate_func)
| all widgets of a group More...
oyWIDGET_TYPE_e | oyWidgetTitleGet (oyWIDGET_e option, const oyGROUP_e **categories, const char **name, const char **tooltip, int *flags)
| Get a special Options UI strings. More...
int | oyOptionChoicesGet (oyWIDGET_e option, int *choices, const char ***choices_string_list, int *current)
| Get a Options choices UI strings. More...
int | oyOptionChoicesGet2 (oyWIDGET_e option, uint32_t flags, int name_type, int *choices, const char ***choices_string_list, int *current)
| see oyOptionChoicesGet() More...
void | oyOptionChoicesFree (oyWIDGET_e option, const char ***list, int size)
| delete list of choices from a option More...

## Detailed Description

The idea behind this API is to provide one layout for presenting a configuration dialog to users. The advantage is, every application, like KDE and Gnome control panels, will inherit the same logic. A user can easily use the one and the other panel without too much relearning.

To illustrate a bit: In analogy to the WWW, I suggest to implement something like a minimalistic HTML display. Once the HTML alike content logic is done in Oyranos, the HTML page works and appears everywhere compareable. Smaller changes to the Oyranos HTML alike pages will appear everywhere in all HTML page display programms. To remain in the WWW analogy, CSS would be optional to adapt visually.

Functions are provided to set and query for Options layout and UI strings in Oyranos.

## Function Documentation

## ◆ oyOptionChoicesFree()

void oyOptionChoicesFree | ( | oyWIDGET_e | option,
|  | const char *** | list,
|  | int | size
| ) |  |

delete list of choices from a option

Parameters

  list | string list
  size | number of strings in the list to free

## ◆ oyOptionChoicesGet()

int oyOptionChoicesGet | ( | oyWIDGET_e | option,
|  | int * | choices,
|  | const char *** | choices_string_list,
|  | int * | current
| ) |  |

Get a Options choices UI strings.

This function is checked for double occuring profiles. Such are sorted out.

Todo:
  In the future a second choices_string_list may appear for displaying.

Parameters

  | option | merge oyBEHAVIOUR_e and oyPROFILE_e
  [out] | choices | n choices; if choices is zero then you need to optain the choices otherwise, like for profiles
  [out] | choices_strings | translated list of n choices
  [out] | current | the actual setting

Returns
  error

## ◆ oyOptionChoicesGet2()

int oyOptionChoicesGet2 | ( | oyWIDGET_e | option,
|  | uint32_t | flags,
|  | int | name_type,
|  | int * | choices,
|  | const char *** | choices_string_list,
|  | int * | current
| ) |  |

see oyOptionChoicesGet()

flags can come from oyICCProfileSelectionFlagsFromRegistration() and is for oyProfiles_Create() . Possible values for name_type come from oyNAME_e.

The flags argument relates to the option arg. For profile options see oyICCProfileSelectionFlagsFromRegistration(). The name_type argument can be a oyNAME_e .

Version
  Oyranos: 0.9.6

Date
  2014/06/13

Since
  2014/04/08 (Oyranos: 0.9.6)

## ◆ oyWidgetListGet()

oyWIDGET_e* oyWidgetListGet | ( | oyGROUP_e | group,
|  | int * | count,
|  | oyAlloc_f | allocate_func
| ) |  |

all widgets of a group

Parameters

  | group | specify which group dialog to build
  [out] | count | number of widgets contained in list

Returns
  list of widgets to create in correct order

## ◆ oyWidgetTitleGet()

oyWIDGET_TYPE_e oyWidgetTitleGet | ( | oyWIDGET_e | option,
|  | const oyGROUP_e ** | categories,
|  | const char ** | name,
|  | const char ** | tooltip,
|  | int * | flags
| ) |  |

Get a special Options UI strings.

Parameters

  | option | merges oyBEHAVIOUR_e and oyPROFILE_e
  [out] | categories | enums list, to place into the right group widget { n, first category, second c., ... , n'th c. } for widget of type oyGROUP_e this is empty
  [out] | name | transated widget title
  [out] | tooltip | transated tooltip

Returns
  widget type, gives a hint to further properties, { like choices or int/float value ranges ... }