<commit_before>/* GTK - The GIMP Toolkit
 * Copyright (C) 2002 <NAME>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 * Author: <NAME> <<EMAIL>>
 * this module is for hangul 3bul sik mode users
 */


/* we dont use this func anymore
static gunichar	im_hangul_compchoseong_to_single	(gunichar ch);
*/

static gunichar	im_hangul_pop	(GtkIMContextHangul *context_hangul);
static gunichar	im_hangul_peek	(GtkIMContextHangul *context_hangul);
static void	im_hangul_push	(GtkIMContextHangul *context_hangul, gunichar ch);

static void	im_hangul_commit_unicode(GtkIMContextHangul *context_hangul,
					 gunichar ch);

static const gunichar *keyboard_table;
/*
static gunichar (*im_hangul3_choseong)		(guint, guint);
static gunichar (*im_hangul3_jungseong)		(guint, guint);
static gunichar (*im_hangul3_jongseong)		(guint, guint);
static gunichar (*im_hangul3_punct)		(guint, guint);
static gunichar (*im_hangul3_comp_choseong)	(gunichar, gunichar);
static gunichar (*im_hangul3_comp_jungseong)	(gunichar, gunichar);
static gunichar (*im_hangul3_comp_jongseong)	(gunichar, gunichar);
*/

static void
im_hangul_push(GtkIMContextHangul *context_hangul, gunichar ch)
{
  context_hangul->stack[++context_hangul->index] = ch;
}

static gunichar
im_hangul_peek(GtkIMContextHangul *context_hangul)
{
  if (context_hangul->index < 0)
    return 0;
  return context_hangul->stack[context_hangul->index];
}

static gunichar
im_hangul_pop(GtkIMContextHangul *context_hangul)
{
  if (context_hangul->index < 0)
    return 0;
  return context_hangul->stack[context_hangul->index--];
}

static void
im_hangul_commit_unicode(GtkIMContextHangul *context_hangul, gunichar ch)
{
  int n;
  gchar buf[6];

  n = g_unichar_to_utf8(ch, buf);
  buf[n] = '\0';

  context_hangul->choseong = 0;
  context_hangul->jungseong = 0;
  context_hangul->jongseong = 0;
  context_hangul->index = -1;

  g_signal_emit_by_name(context_hangul, "commit", buf);
}

static gunichar
im_hangul3_mapping(guint keyval, guint state)
{
  if (keyboard_table == NULL)
    return 0;

  /* treat capslock, as capslock is not on */
  if (state & GDK_LOCK_MASK) {
    if (state & GDK_SHIFT_MASK) {
      if (keyval >= GDK_a && keyval <= GDK_z)
        keyval -= (GDK_a - GDK_A);
    } else {<commit_msg>Xkb� ���keysym ó�� ���<commit_after>/* GTK - The GIMP Toolkit
 * Copyright (C) 2002 <NAME>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 * Author: <NAME> <<EMAIL>>
 * this module is for hangul 3bul sik mode users
 */


/* we dont use this func anymore
static gunichar	im_hangul_compchoseong_to_single	(gunichar ch);
*/

static gunichar	im_hangul_pop	(GtkIMContextHangul *context_hangul);
static gunichar	im_hangul_peek	(GtkIMContextHangul *context_hangul);
static void	im_hangul_push	(GtkIMContextHangul *context_hangul, gunichar ch);

static void	im_hangul_commit_unicode(GtkIMContextHangul *context_hangul,
					 gunichar ch);

static const gunichar *keyboard_table;
/*
static gunichar (*im_hangul3_choseong)		(guint, guint);
static gunichar (*im_hangul3_jungseong)		(guint, guint);
static gunichar (*im_hangul3_jongseong)		(guint, guint);
static gunichar (*im_hangul3_punct)		(guint, guint);
static gunichar (*im_hangul3_comp_choseong)	(gunichar, gunichar);
static gunichar (*im_hangul3_comp_jungseong)	(gunichar, gunichar);
static gunichar (*im_hangul3_comp_jongseong)	(gunichar, gunichar);
*/

static void
im_hangul_push(GtkIMContextHangul *context_hangul, gunichar ch)
{
  context_hangul->stack[++context_hangul->index] = ch;
}

static gunichar
im_hangul_peek(GtkIMContextHangul *context_hangul)
{
  if (context_hangul->index < 0)
    return 0;
  return context_hangul->stack[context_hangul->index];
}

static gunichar
im_hangul_pop(GtkIMContextHangul *context_hangul)
{
  if (context_hangul->index < 0)
    return 0;
  return context_hangul->stack[context_hangul->index--];
}

static void
im_hangul_commit_unicode(GtkIMContextHangul *context_hangul, gunichar ch)
{
  int n;
  gchar buf[6];

  n = g_unichar_to_utf8(ch, buf);
  buf[n] = '\0';

  context_hangul->choseong = 0;
  context_hangul->jungseong = 0;
  context_hangul->jongseong = 0;
  context_hangul->index = -1;

  g_signal_emit_by_name(context_hangul, "commit", buf);
}

static gunichar
im_hangul3_mapping(guint keyval, guint state)
{
  if (keyboard_table == NULL)
    return 0;

  /*  hangul jamo keysym */
  if (keyval >= 0x01001100 && keyval <= 0x010011ff)
    return keyval & 0x0000ffff;

  /* treat capslock, as capslock is not on */
  if (state & GDK_LOCK_MASK) {
    if (state & GDK_SHIFT_MASK) {
      if (keyval >= GDK_a && keyval <= GDK_z)
        keyval -= (GDK_a - GDK_A);
    } else {
{'fraction_non_alphanumeric': 0.09633943427620632, 'fraction_numerical': 0.01680532445923461, 'mean_word_length': 4.7742555235350626, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 38, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5340676', 'n_tokens_mistral': 2258, 'n_tokens_neox': 2152, 'n_words': 612}