Compare commits
	
		
			2 Commits
		
	
	
		
			pureos/1.9
			...
			click
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 8c0b55d7f8 | |||
| 72da6d02ae | 
@ -23,12 +23,10 @@
 | 
				
			|||||||
 * @short_description: a #GtkWidget displaying #EekKeyboard
 | 
					 * @short_description: a #GtkWidget displaying #EekKeyboard
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef HAVE_CONFIG_H
 | 
					 | 
				
			||||||
#include "config.h"
 | 
					#include "config.h"
 | 
				
			||||||
#endif  /* HAVE_CONFIG_H */
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef HAVE_LIBCANBERRA
 | 
					#ifdef HAVE_GSOUND
 | 
				
			||||||
#include <canberra-gtk.h>
 | 
					#include <gsound.h>
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <math.h>
 | 
					#include <math.h>
 | 
				
			||||||
@ -58,6 +56,9 @@ typedef struct _EekGtkKeyboardPrivate
 | 
				
			|||||||
    EekRenderer *renderer;
 | 
					    EekRenderer *renderer;
 | 
				
			||||||
    EekKeyboard *keyboard;
 | 
					    EekKeyboard *keyboard;
 | 
				
			||||||
    EekTheme *theme;
 | 
					    EekTheme *theme;
 | 
				
			||||||
 | 
					#ifdef HAVE_GSOUND
 | 
				
			||||||
 | 
					    GSoundContext *sound_ctx;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    GdkEventSequence *sequence; // unowned reference
 | 
					    GdkEventSequence *sequence; // unowned reference
 | 
				
			||||||
} EekGtkKeyboardPrivate;
 | 
					} EekGtkKeyboardPrivate;
 | 
				
			||||||
@ -438,7 +439,16 @@ eek_gtk_keyboard_class_init (EekGtkKeyboardClass *klass)
 | 
				
			|||||||
static void
 | 
					static void
 | 
				
			||||||
eek_gtk_keyboard_init (EekGtkKeyboard *self)
 | 
					eek_gtk_keyboard_init (EekGtkKeyboard *self)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /* void */
 | 
					#if HAVE_GSOUND
 | 
				
			||||||
 | 
					    EekGtkKeyboardPrivate *priv = eek_gtk_keyboard_get_instance_private (self);
 | 
				
			||||||
 | 
					    GError *err = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    priv->sound_ctx = gsound_context_new(NULL, &err);
 | 
				
			||||||
 | 
					    if (!priv->sound_ctx) {
 | 
				
			||||||
 | 
					        g_warning ("GSound init failed: %s", err->message);
 | 
				
			||||||
 | 
					        g_clear_error (&err);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
@ -567,11 +577,11 @@ on_key_pressed (EekKey      *key,
 | 
				
			|||||||
    render_pressed_key (GTK_WIDGET(self), key);
 | 
					    render_pressed_key (GTK_WIDGET(self), key);
 | 
				
			||||||
    gtk_widget_queue_draw (GTK_WIDGET(self));
 | 
					    gtk_widget_queue_draw (GTK_WIDGET(self));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if HAVE_LIBCANBERRA
 | 
					#if HAVE_GSOUND
 | 
				
			||||||
    ca_gtk_play_for_widget (widget, 0,
 | 
					    g_return_if_fail (GSOUND_IS_CONTEXT (priv->sound_ctx));
 | 
				
			||||||
                            CA_PROP_EVENT_ID, "button-pressed",
 | 
					    gsound_context_play_simple(priv->sound_ctx, NULL, NULL,
 | 
				
			||||||
                            CA_PROP_EVENT_DESCRIPTION, "virtual key pressed",
 | 
					                               GSOUND_ATTR_EVENT_ID, "button-pressed",
 | 
				
			||||||
                            CA_PROP_APPLICATION_ID, "org.fedorahosted.Eekboard",
 | 
					                               GSOUND_ATTR_EVENT_DESCRIPTION, "Button pressed",
 | 
				
			||||||
                               NULL);
 | 
					                               NULL);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -589,11 +599,11 @@ on_key_released (EekKey      *key,
 | 
				
			|||||||
    render_released_key (GTK_WIDGET(self), key);
 | 
					    render_released_key (GTK_WIDGET(self), key);
 | 
				
			||||||
    gtk_widget_queue_draw (GTK_WIDGET(self));
 | 
					    gtk_widget_queue_draw (GTK_WIDGET(self));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if HAVE_LIBCANBERRA
 | 
					#if HAVE_GSOUND
 | 
				
			||||||
    ca_gtk_play_for_widget (widget, 0,
 | 
					    g_return_if_fail (GSOUND_IS_CONTEXT (priv->sound_ctx));
 | 
				
			||||||
                            CA_PROP_EVENT_ID, "button-released",
 | 
					    gsound_context_play_simple(priv->sound_ctx, NULL, NULL,
 | 
				
			||||||
                            CA_PROP_EVENT_DESCRIPTION, "virtual key pressed",
 | 
					                               GSOUND_ATTR_EVENT_ID, "button-released",
 | 
				
			||||||
                            CA_PROP_APPLICATION_ID, "org.fedorahosted.Eekboard",
 | 
					                               GSOUND_ATTR_EVENT_DESCRIPTION, "Button released",
 | 
				
			||||||
                               NULL);
 | 
					                               NULL);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										20
									
								
								meson.build
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								meson.build
									
									
									
									
									
								
							@ -3,12 +3,14 @@ project(
 | 
				
			|||||||
    'c', 'rust',
 | 
					    'c', 'rust',
 | 
				
			||||||
    version: '1.0.10',
 | 
					    version: '1.0.10',
 | 
				
			||||||
    license: 'GPLv3',
 | 
					    license: 'GPLv3',
 | 
				
			||||||
    meson_version: '>=0.43.0',
 | 
					    meson_version: '>=0.49.0',
 | 
				
			||||||
    default_options: [ 'warning_level=1', 'buildtype=debugoptimized', 'c_std=gnu11' ],
 | 
					    default_options: [ 'warning_level=1', 'buildtype=debugoptimized', 'c_std=gnu11' ],
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
i18n = import('i18n')
 | 
					i18n = import('i18n')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					conf_data = configuration_data()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if get_option('buildtype').startswith('debug')
 | 
					if get_option('buildtype').startswith('debug')
 | 
				
			||||||
    add_project_arguments('-DDEBUG=1', language : 'c')
 | 
					    add_project_arguments('-DDEBUG=1', language : 'c')
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
@ -26,6 +28,22 @@ else
 | 
				
			|||||||
endif
 | 
					endif
 | 
				
			||||||
dbusdir = join_paths(depdatadir, 'dbus-1/interfaces')
 | 
					dbusdir = join_paths(depdatadir, 'dbus-1/interfaces')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					gsound_dep = dependency('gsound', required : false)
 | 
				
			||||||
 | 
					if gsound_dep.found()
 | 
				
			||||||
 | 
					  conf_data.set10('HAVE_GSOUND', true)
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					summary = [
 | 
				
			||||||
 | 
					        '',
 | 
				
			||||||
 | 
					        '------------------',
 | 
				
			||||||
 | 
					        'squeekboard @0@'.format(meson.project_version()),
 | 
				
			||||||
 | 
					        '',
 | 
				
			||||||
 | 
					        '   gsound: @0@'.format(conf_data.get('HAVE_GSOUND', false)),
 | 
				
			||||||
 | 
					        '------------------',
 | 
				
			||||||
 | 
					        ''
 | 
				
			||||||
 | 
					]
 | 
				
			||||||
 | 
					message('\n'.join(summary))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
subdir('data')
 | 
					subdir('data')
 | 
				
			||||||
subdir('protocols')
 | 
					subdir('protocols')
 | 
				
			||||||
subdir('eek')
 | 
					subdir('eek')
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										6
									
								
								src/config.h.in
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								src/config.h.in
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,6 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 * Autogenerated by the Meson build system.
 | 
				
			||||||
 | 
					 * Do not edit, your changes will be lost.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#mesondefine HAVE_GSOUND
 | 
				
			||||||
@ -4,7 +4,10 @@ dbus_src = gnome.gdbus_codegen(
 | 
				
			|||||||
    join_paths(meson.source_root() / 'data' / 'dbus', 'sm.puri.OSK0.xml')
 | 
					    join_paths(meson.source_root() / 'data' / 'dbus', 'sm.puri.OSK0.xml')
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					config_h = configure_file(input: 'config.h.in', output: 'config.h',configuration: conf_data)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sources = [
 | 
					sources = [
 | 
				
			||||||
 | 
					  config_h,
 | 
				
			||||||
  'imservice.c',
 | 
					  'imservice.c',
 | 
				
			||||||
  'server-context-service.c',
 | 
					  'server-context-service.c',
 | 
				
			||||||
  'server-main.c',
 | 
					  'server-main.c',
 | 
				
			||||||
@ -60,6 +63,7 @@ deps = [
 | 
				
			|||||||
  cc.find_library('dl'),
 | 
					  cc.find_library('dl'),
 | 
				
			||||||
  cc.find_library('pthread'),
 | 
					  cc.find_library('pthread'),
 | 
				
			||||||
#  dependency('libxklavier'), # FIXME remove
 | 
					#  dependency('libxklavier'), # FIXME remove
 | 
				
			||||||
 | 
					  gsound_dep,
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Replacement for eekboard-server
 | 
					# Replacement for eekboard-server
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user