Blame modules/input/gtkimcontextmultipress.h

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