Export moo_accel_translate_event() and moo_accel_check_event()

This commit is contained in:
Yevgen Muntyan 2008-06-15 01:17:01 -05:00
parent 4005f1a00a
commit 404b78881a
6 changed files with 17 additions and 21 deletions

View File

@ -1181,7 +1181,7 @@ _moo_text_view_key_press_event (GtkWidget *widget,
if (view->priv->qs.in_search)
return FALSE;
_moo_accel_translate_event (widget, event, &keyval, &mods);
moo_accel_translate_event (widget, event, &keyval, &mods);
if (keyval == GDK_KP_Enter || keyval == GDK_Return)
{

View File

@ -261,7 +261,6 @@ finish:
g_free (text);
g_free (prefix);
g_free (line);
return;
}
void
@ -470,7 +469,7 @@ popup_key_press (MooTextCompletion *cmpl,
{
GtkTreeIter iter;
if (_moo_accel_check_event (GTK_WIDGET (cmpl->priv->doc), event, GDK_Tab, 0) &&
if (moo_accel_check_event (GTK_WIDGET (cmpl->priv->doc), event, GDK_Tab, 0) &&
moo_text_completion_unique (cmpl, &iter))
{
moo_text_completion_complete (cmpl, &iter);

View File

@ -1511,7 +1511,7 @@ completion_entry_key_press (GtkEntry *entry,
g_return_val_if_fail (entry == cmpl->priv->entry, FALSE);
if (cmpl->priv->enabled &&
_moo_accel_check_event (GTK_WIDGET (entry), event, GDK_Tab, 0))
moo_accel_check_event (GTK_WIDGET (entry), event, GDK_Tab, 0))
{
completion_tab_key (cmpl);
return TRUE;

View File

@ -362,7 +362,7 @@ _moo_get_accel_label (const char *accel)
void
_moo_accel_translate_event (GtkWidget *widget,
moo_accel_translate_event (GtkWidget *widget,
GdkEventKey *event,
guint *keyval,
GdkModifierType *mods)
@ -390,14 +390,14 @@ _moo_accel_translate_event (GtkWidget *widget,
}
gboolean
_moo_accel_check_event (GtkWidget *widget,
moo_accel_check_event (GtkWidget *widget,
GdkEventKey *event,
guint keyval,
GdkModifierType mods)
{
guint ev_keyval;
GdkModifierType ev_mods;
_moo_accel_translate_event (widget, event, &ev_keyval, &ev_mods);
moo_accel_translate_event (widget, event, &ev_keyval, &ev_mods);
return keyval == ev_keyval && mods == ev_mods;
}

View File

@ -29,11 +29,11 @@ void _moo_modify_accel (const char *accel_path,
char *_moo_get_accel_label (const char *accel);
void _moo_accel_translate_event (GtkWidget *widget,
void moo_accel_translate_event (GtkWidget *widget,
GdkEventKey *event,
guint *keyval,
GdkModifierType *mods);
gboolean _moo_accel_check_event (GtkWidget *widget,
gboolean moo_accel_check_event (GtkWidget *widget,
GdkEventKey *event,
guint keyval,
GdkModifierType mods);

View File

@ -117,12 +117,9 @@ static gboolean
moo_help_key_press (GtkWidget *widget,
GdkEventKey *event)
{
guint keyval;
GdkModifierType mods;
_moo_accel_translate_event (widget, event, &keyval, &mods);
if (keyval == MOO_ACCEL_HELP_KEY && mods == MOO_ACCEL_HELP_MODS)
if (moo_accel_check_event (widget, event,
MOO_ACCEL_HELP_KEY,
MOO_ACCEL_HELP_MODS))
return moo_help_open (widget);
else
return FALSE;