Blame modules/input/gtkimcontextmultipress.h

Packit Service fb6fa5
/* Copyright (C) 2006 Openismus GmbH
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * This library is free software; you can redistribute it and/or
Packit Service fb6fa5
 * modify it under the terms of the GNU Lesser General Public
Packit Service fb6fa5
 * License as published by the Free Software Foundation; either
Packit Service fb6fa5
 * version 2 of the License, or (at your option) any later version.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * This library is distributed in the hope that it will be useful,
Packit Service fb6fa5
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service fb6fa5
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service fb6fa5
 * Lesser General Public License for more details.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * You should have received a copy of the GNU Lesser General Public
Packit Service fb6fa5
 * License along with this library; if not, write to the
Packit Service fb6fa5
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Packit Service fb6fa5
 * Boston, MA 02111-1307, USA.
Packit Service fb6fa5
 */
Packit Service fb6fa5
Packit Service fb6fa5
#ifndef __GTK_IM_CONTEXT_MULTIPRESS_H__
Packit Service fb6fa5
#define __GTK_IM_CONTEXT_MULTIPRESS_H__
Packit Service fb6fa5
Packit Service fb6fa5
#include <gtk/gtk.h>
Packit Service fb6fa5
Packit Service fb6fa5
G_BEGIN_DECLS
Packit Service fb6fa5
Packit Service fb6fa5
#define GTK_TYPE_IM_CONTEXT_MULTIPRESS            (gtk_im_context_multipress_get_type ())
Packit Service fb6fa5
#define GTK_IM_CONTEXT_MULTIPRESS(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_IM_CONTEXT_MULTIPRESS, GtkImContextMultipress))
Packit Service fb6fa5
#define GTK_IM_CONTEXT_MULTIPRESS_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_IM_CONTEXT_MULTIPRESS, GtkImContextMultipressClass))
Packit Service fb6fa5
#define GTK_IS_IM_CONTEXT_MULTIPRESS(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_IM_CONTEXT_MULTIPRESS))
Packit Service fb6fa5
#define GTK_IS_IM_CONTEXT_MULTIPRESS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IM_CONTEXT_MULTIPRESS))
Packit Service fb6fa5
#define GTK_IM_CONTEXT_MULTIPRESS_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_IM_CONTEXT_MULTIPRESS, GtkImContextMultipressClass))
Packit Service fb6fa5
Packit Service fb6fa5
typedef struct _GtkImContextMultipress GtkImContextMultipress;
Packit Service fb6fa5
Packit Service fb6fa5
/* This input method allows multi-press character input, like that found on
Packit Service fb6fa5
 * mobile phones.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * This is based on GtkImContextSimple, which allows "compose" based on
Packit Service fb6fa5
 * sequences of characters.  But instead the character sequences are defined
Packit Service fb6fa5
 * by lists of characters for a key, so that repeated pressing of the same key
Packit Service fb6fa5
 * can cycle through the possible output characters, with automatic choosing
Packit Service fb6fa5
 * of the character after a time delay.
Packit Service fb6fa5
 */
Packit Service fb6fa5
struct _GtkImContextMultipress
Packit Service fb6fa5
{
Packit Service fb6fa5
  /*< private >*/
Packit Service fb6fa5
  GtkIMContext parent;
Packit Service fb6fa5
Packit Service fb6fa5
  /* Sequence information, loaded from the configuration file: */
Packit Service fb6fa5
  GHashTable* key_sequences;
Packit Service fb6fa5
  gsize dummy; /* ABI-preserving placeholder */
Packit Service fb6fa5
Packit Service fb6fa5
  /* The last character entered so far during a compose.
Packit Service fb6fa5
   * If this is NULL then we are not composing yet.
Packit Service fb6fa5
   */
Packit Service fb6fa5
  guint key_last_entered;
Packit Service fb6fa5
  
Packit Service fb6fa5
  /* The position of the compose in the possible sequence.
Packit Service fb6fa5
   *  For instance, this is 2 if aa has been pressed to show b (from abc0).
Packit Service fb6fa5
   */
Packit Service fb6fa5
  guint compose_count; 
Packit Service fb6fa5
  guint timeout_id;
Packit Service fb6fa5
Packit Service fb6fa5
  /* The character(s) that will be used if it the current character(s) is accepted: */
Packit Service fb6fa5
  const gchar *tentative_match;
Packit Service fb6fa5
};
Packit Service fb6fa5
Packit Service fb6fa5
Packit Service fb6fa5
typedef struct _GtkImContextMultipressClass  GtkImContextMultipressClass;
Packit Service fb6fa5
Packit Service fb6fa5
struct _GtkImContextMultipressClass
Packit Service fb6fa5
{
Packit Service fb6fa5
  GtkIMContextClass parent_class;
Packit Service fb6fa5
};
Packit Service fb6fa5
Packit Service fb6fa5
void gtk_im_context_multipress_register_type (GTypeModule* type_module);
Packit Service fb6fa5
GType gtk_im_context_multipress_get_type (void);
Packit Service fb6fa5
GtkIMContext *gtk_im_context_multipress_new (void);
Packit Service fb6fa5
Packit Service fb6fa5
G_END_DECLS
Packit Service fb6fa5
Packit Service fb6fa5
#endif /* __GTK_IM_CONTEXT_MULTIPRESS_H__ */