<commit_before>/*
 * Copyright (C) 2010, Intel Corporation.
 *
 * Author: <NAME> <<EMAIL>>
 * 
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * version 2.1 as published by the Free Software Foundation.
 * 
 * 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
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA
 */

#include "debug.h"
#include <QEvent>
#include <QKeyEvent>

#include "qt-keysym-map.h"
#include "qt-gtk-translate.h"


GdkEventKey *
compose_gdk_keyevent(GdkEventType type, guint keyval, guint state, GdkWindow *window)
{
	GdkEventKey *event = NULL;

	if ((type != GDK_KEY_PRESS) && (type != GDK_KEY_RELEASE))
		return NULL;

	event = (GdkEventKey *)(gdk_event_new(type));
	event->length = 0;
	event->string = 0;
	event->is_modifier = 0;
	event->time = GDK_CURRENT_TIME;
	event->state = state;
	if (type == GDK_KEY_RELEASE)<commit_msg>Workaround a build issue for glib >= 2.25<commit_after>/*
 * Copyright (C) 2010, Intel Corporation.
 *
 * Author: <NAME> <<EMAIL>>
 * 
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * version 2.1 as published by the Free Software Foundation.
 * 
 * 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
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA
 */

#include "debug.h"
#include <QEvent>
#include <QKeyEvent>

#include "qt-keysym-map.h"

// To workaround glib >= 2.25 where signals is used, while QT already define it as C++ keyword: protected
#ifdef signals
#undef signals
#endif
#include "qt-gtk-translate.h"


GdkEventKey *
compose_gdk_keyevent(GdkEventType type, guint keyval, guint state, GdkWindow *window)
{
	GdkEventKey *event = NULL;

	if ((type != GDK_KEY_PRESS) && (type != GDK_KEY_RELEASE))
		return NULL;

	event = (GdkEventKey *)(gdk_event_new(type));
	event->length = 0;
	event->string = 0;
	event->is_modifier = 0;
	event->time = GDK_CURRENT_TIME;
	event->state = state;
	if (type == GDK_KEY_RELEASE)
{'fraction_non_alphanumeric': 0.09985683607730853, 'fraction_numerical': 0.0164638511095204, 'mean_word_length': 4.166358595194085, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3307467', 'n_tokens_mistral': 914, 'n_tokens_neox': 850, 'n_words': 345}