Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# Inti::Gdk::Keyval Class Reference

A GDK key value C++ wrapper class. More...

`#include <inti/gdk/keyval.h>`

Inheritance diagram for Inti::Gdk::Keyval:

List of all members.

## Public Member Functions

Constructors

- Keyval ()
    Construct a Keyval with an initial value of GDK_VoidSymbol.
- Keyval (unsigned int keyval)
    Construct a Keyval with the value keyval.
- Keyval (const char *keyval_name)
    Construct a Keyval from a key name.
- Keyval (const String &keyval_name)
    Construct a Keyval from a key name.
- Keyval (const Keyval &src)
    Copy Constructor.
- Keyval & operator= (const Keyval &src)
    Assignment operator.

Accessors

- bool is_keyval () const
    Returns true if the Keyval's value is not zero and not GDK_VoidSymbol.
- String name () const
    Retrieves a the symbolic name for the key value.
- bool is_upper () const
    Returns true if the given key value is in upper case, or if the keyval is not subject to case conversion.
- bool is_lower () const
    Returns true if the given key value is in lower case, or if the keyval is not subject to case conversion.

Methods

- void convert_case (Keyval &lower, Keyval &upper)
    Obtains the upper-case and lower-case versions of the keyval symbol.
- Keyval to_upper () const
    Converts this key value to upper case, if applicable.
- Keyval to_lower () const
    Converts a key value to lower case, if applicable.
- G::Unichar to_unicode () const
    Converts the keyval (GDK key symbol) to the corresponding ISO10646 (Unicode) character.
- void from_unicode (const G::Unichar &wc)
    Convert from a ISO10646 (Unicode) character to a GDK key symbol.

## Detailed Description

A GDK key value C++ wrapper class.

The Keyval object represents a GDK key value. Examples of key values are GDK_a, GDK_Enter, GDK_F1, etc. The complete list of key values can be found in the <gdk/gdkkeysyms.h> header file. This header file is not included by Inti, it must be included independently, because the file is quite large.

A keyval can be converted into a string representation with name(). The reverse, a Keyval can be constructed from string. The case of key values can be determined using is_upper() and is_lower(). Key values can be converted to upper or lower case using to_upper() and to_lower(). When it makes sense, key values can be converted to and from Unicode characters with to_unicode() and from_unicode().

## Constructor & Destructor Documentation

Inti::Gdk::Keyval::Keyval | ( | unsigned int | keyval | ) |

Construct a Keyval with the value keyval.

Parameters:

  keyval | The keyval symbol; examples of keyvals are GDK_a, GDK_Enter, GDK_F1, etc.

Inti::Gdk::Keyval::Keyval | ( | const char * | keyval_name | ) |

Construct a Keyval from a key name.

Parameters:

  keyval_name | A key name.

If the key name is not a valid key the Keyval's value will be GDK_VoidSymbol.

Inti::Gdk::Keyval::Keyval | ( | const String & | keyval_name | ) |

Construct a Keyval from a key name.

Parameters:

  keyval_name | A key name.

If the key name is not a valid key the Keyval's value will be GDK_VoidSymbol.

Inti::Gdk::Keyval::Keyval | ( | const Keyval & | src | ) |

Copy Constructor.

Parameters:

  src | The source Keyval.

## Member Function Documentation

void Inti::Gdk::Keyval::convert_case | ( | Keyval & | lower,
|  | Keyval & | upper
| ) |

Obtains the upper-case and lower-case versions of the keyval symbol.

Parameters:

  lower | The return location for lowercase version of the keyval.
  upper | The return location for uppercase version of the keyval symbol.

Examples of keyvals are GDK_a, GDK_Enter, GDK_F1, etc.

void Inti::Gdk::Keyval::from_unicode | ( | const G::Unichar & | wc | ) |

Convert from a ISO10646 (Unicode) character to a GDK key symbol.

Parameters:

  wc | A ISO10646 encoded character.

If successful the keyval will be the corresponding GDK key symbol, if one exists, or GDK_VoidSymbol if there is no corresponding symbol.

String Inti::Gdk::Keyval::name | ( |  | ) | const

Retrieves a the symbolic name for the key value.

Returns:
  A String containing the name of the key, or a null String if this keyval is not a valid key.

The names are the same as those in the <gdk/gdkkeysyms.h> header file but without the leading "GDK_".

Keyval& Inti::Gdk::Keyval::operator= | ( | const Keyval & | src | ) |

Assignment operator.

Parameters:

  src | The source Keyval.

Keyval Inti::Gdk::Keyval::to_lower | ( |  | ) | const

Converts a key value to lower case, if applicable.

Returns:
  The lower case form of keyval, or keyval itself if it is already in lower case or it is not subject to case conversion.

G::Unichar Inti::Gdk::Keyval::to_unicode | ( |  | ) | const

Converts the keyval (GDK key symbol) to the corresponding ISO10646 (Unicode) character.

Returns:
  The corresponding unicode character, or 0 if there is no corresponding character.

Keyval Inti::Gdk::Keyval::to_upper | ( |  | ) | const

Converts this key value to upper case, if applicable.

Returns:
  The upper case form of keyval, or keyval itself if it is already in upper case or it is not subject to case conversion.

The documentation for this class was generated from the following file:

- keyval.h

Main Page - Footer