Skip to content

Commit

Permalink
src: Update IBusInputPurpose and IBusInputHints in ibustypes.h
Browse files Browse the repository at this point in the history
Copy IBUS_INPUT_PURPOSE_TERMINAL, IBUS_INPUT_PURPOSE_PIN,
IBUS_INPUT_PURPOSE_TERMINAL from GTK 3.24.14
  • Loading branch information
fujiwarat committed Nov 20, 2020
1 parent aa558de commit b72efea
Showing 1 changed file with 53 additions and 24 deletions.
77 changes: 53 additions & 24 deletions src/ibustypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* vim:set et sts=4: */
/* ibus - The Input Bus
* Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
* Copyright (C) 2008-2015 Red Hat, Inc.
* Copyright (C) 2008-2020 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -241,29 +241,46 @@ typedef void (* IBusFreeFunc) (gpointer object);
* @IBUS_INPUT_PURPOSE_EMAIL: Edited field expects email address
* @IBUS_INPUT_PURPOSE_NAME: Edited field expects the name of a person
* @IBUS_INPUT_PURPOSE_PASSWORD: Like @IBUS_INPUT_PURPOSE_FREE_FORM,
* but characters are hidden
* but characters are hidden
* @IBUS_INPUT_PURPOSE_PIN: Like @IBUS_INPUT_PURPOSE_DIGITS, but
* characters are hidden
* characters are hidden
* @IBUS_INPUT_PURPOSE_TERMINAL: Allow any character, in addition to control
* codes. Since 1.5.24
*
* Describes primary purpose of the input context. This information
* is particularly useful to implement intelligent behavior in
* engines, such as automatic input-mode switch and text prediction.
*
* Note that the purpose is not meant to impose a totally strict rule
* about allowed characters, and does not replace input validation.
* It is fine for an on-screen keyboard to let the user override the
* character set restriction that is expressed by the purpose. The
* application is expected to validate the entry contents, even if
* it specified a purpose.
*
* The difference between @IBUS_INPUT_PURPOSE_DIGITS and
* @IBUS_INPUT_PURPOSE_NUMBER is that the former accepts only digits
* while the latter also some punctuation (like commas or points, plus,
* minus) and “e” or “E” as in 3.14E+000.
*
* This enumeration may be extended in the future; engines should
* interpret unknown values as 'free form'.
*
* Since: 1.5.4
*/
typedef enum
{
IBUS_INPUT_PURPOSE_FREE_FORM,
IBUS_INPUT_PURPOSE_ALPHA,
IBUS_INPUT_PURPOSE_DIGITS,
IBUS_INPUT_PURPOSE_NUMBER,
IBUS_INPUT_PURPOSE_PHONE,
IBUS_INPUT_PURPOSE_URL,
IBUS_INPUT_PURPOSE_EMAIL,
IBUS_INPUT_PURPOSE_NAME,
IBUS_INPUT_PURPOSE_PASSWORD,
IBUS_INPUT_PURPOSE_PIN
IBUS_INPUT_PURPOSE_FREE_FORM,
IBUS_INPUT_PURPOSE_ALPHA,
IBUS_INPUT_PURPOSE_DIGITS,
IBUS_INPUT_PURPOSE_NUMBER,
IBUS_INPUT_PURPOSE_PHONE,
IBUS_INPUT_PURPOSE_URL,
IBUS_INPUT_PURPOSE_EMAIL,
IBUS_INPUT_PURPOSE_NAME,
IBUS_INPUT_PURPOSE_PASSWORD,
IBUS_INPUT_PURPOSE_PIN,
IBUS_INPUT_PURPOSE_TERMINAL
} IBusInputPurpose;

/**
Expand All @@ -280,24 +297,36 @@ typedef enum
* first word of each sentence
* @IBUS_INPUT_HINT_INHIBIT_OSK: Suggest to not show an onscreen keyboard
* (e.g for a calculator that already has all the keys).
* @IBUS_INPUT_HINT_VERTICAL_WRITING: The text is vertical.
* @IBUS_INPUT_HINT_VERTICAL_WRITING: The text is vertical. Since 1.5.11
* @IBUS_INPUT_HINT_EMOJI: Suggest offering Emoji support. Since 1.5.24
* @IBUS_INPUT_HINT_NO_EMOJI: Suggest not offering Emoji support. Since 1.5.24
*
* Describes hints that might be taken into account by engines. Note
* that engines may already tailor their behaviour according to the
* #IBusInputPurpose of the entry.
*
* Some common sense is expected when using these flags - mixing
* @IBUS_INPUT_HINT_LOWERCASE with any of the uppercase hints makes no sense.
*
* This enumeration may be extended in the future; engines should
* ignore unknown values.
*
* Since: 1.5.4
*/
typedef enum
{
IBUS_INPUT_HINT_NONE = 0,
IBUS_INPUT_HINT_SPELLCHECK = 1 << 0,
IBUS_INPUT_HINT_NO_SPELLCHECK = 1 << 1,
IBUS_INPUT_HINT_WORD_COMPLETION = 1 << 2,
IBUS_INPUT_HINT_LOWERCASE = 1 << 3,
IBUS_INPUT_HINT_UPPERCASE_CHARS = 1 << 4,
IBUS_INPUT_HINT_UPPERCASE_WORDS = 1 << 5,
IBUS_INPUT_HINT_UPPERCASE_SENTENCES = 1 << 6,
IBUS_INPUT_HINT_INHIBIT_OSK = 1 << 7,
IBUS_INPUT_HINT_VERTICAL_WRITING = 1 << 8
IBUS_INPUT_HINT_NONE = 0,
IBUS_INPUT_HINT_SPELLCHECK = 1 << 0,
IBUS_INPUT_HINT_NO_SPELLCHECK = 1 << 1,
IBUS_INPUT_HINT_WORD_COMPLETION = 1 << 2,
IBUS_INPUT_HINT_LOWERCASE = 1 << 3,
IBUS_INPUT_HINT_UPPERCASE_CHARS = 1 << 4,
IBUS_INPUT_HINT_UPPERCASE_WORDS = 1 << 5,
IBUS_INPUT_HINT_UPPERCASE_SENTENCES = 1 << 6,
IBUS_INPUT_HINT_INHIBIT_OSK = 1 << 7,
IBUS_INPUT_HINT_VERTICAL_WRITING = 1 << 8,
IBUS_INPUT_HINT_EMOJI = 1 << 9,
IBUS_INPUT_HINT_NO_EMOJI = 1 << 10
} IBusInputHints;

#endif
Expand Down

0 comments on commit b72efea

Please sign in to comment.