Merge branch 'fix_tests' into reparse

This commit is contained in:
Dorota Czaplejewicz
2019-09-11 12:03:24 +00:00
5 changed files with 24 additions and 17 deletions

View File

@ -11,4 +11,4 @@ serde_yaml = "0.8"
[lib] [lib]
name = "rs" name = "rs"
path = "src/lib.rs" path = "src/lib.rs"
crate-type = ["staticlib"] crate-type = ["staticlib", "rlib"]

View File

@ -80,7 +80,8 @@ eek_gtk_keyboard_real_realize (GtkWidget *self)
GDK_KEY_RELEASE_MASK | GDK_KEY_RELEASE_MASK |
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_BUTTON_MOTION_MASK); GDK_BUTTON_MOTION_MASK |
GDK_TOUCH_MASK);
GTK_WIDGET_CLASS (eek_gtk_keyboard_parent_class)->realize (self); GTK_WIDGET_CLASS (eek_gtk_keyboard_parent_class)->realize (self);
} }
@ -273,27 +274,27 @@ handle_touch_event (GtkWidget *widget,
EekGtkKeyboard *self = EEK_GTK_KEYBOARD (widget); EekGtkKeyboard *self = EEK_GTK_KEYBOARD (widget);
EekGtkKeyboardPrivate *priv = eek_gtk_keyboard_get_instance_private (self); EekGtkKeyboardPrivate *priv = eek_gtk_keyboard_get_instance_private (self);
/* For each new touch, release the previous one and record the new event
sequence. */
if (event->type == GDK_TOUCH_BEGIN) { if (event->type == GDK_TOUCH_BEGIN) {
if (priv->sequence) { release(self, event->time);
// Ignore second and following touch points
return FALSE;
}
priv->sequence = event->sequence; priv->sequence = event->sequence;
depress(self, event->x, event->y, event->time); depress(self, event->x, event->y, event->time);
return TRUE; return TRUE;
} }
if (priv->sequence != event->sequence) { /* Only allow the latest touch point to be dragged. */
return FALSE; if (event->type == GDK_TOUCH_UPDATE && event->sequence == priv->sequence) {
}
if (event->type == GDK_TOUCH_UPDATE) {
drag(self, event->x, event->y, event->time); drag(self, event->x, event->y, event->time);
} }
if (event->type == GDK_TOUCH_END || event->type == GDK_TOUCH_CANCEL) { else if (event->type == GDK_TOUCH_END || event->type == GDK_TOUCH_CANCEL) {
// TODO: can the event have different coords than the previous update event? // TODO: can the event have different coords than the previous update event?
release(self, event->time); /* Only respond to the release of the latest touch point. Previous
priv->sequence = NULL; touches have already been released. */
if (event->sequence == priv->sequence) {
release(self, event->time);
priv->sequence = NULL;
}
} }
return TRUE; return TRUE;
} }

View File

@ -5,6 +5,10 @@
/* Adapted from https://github.com/notriddle/rust-float-ord revision e995165f /* Adapted from https://github.com/notriddle/rust-float-ord revision e995165f
* maintained by Michael Howell <michael@notriddle.com> * maintained by Michael Howell <michael@notriddle.com>
* licensed under MIT / Apache-2.0 licenses * licensed under MIT / Apache-2.0 licenses
*
* This version drops any dependency on rand.
* Caution: Don't pull the version from crates.io
* before making sure rand is optional.
*/ */
extern crate core; extern crate core;
@ -67,6 +71,7 @@ float_ord_impl!(f64, u64, 64);
/// # Example /// # Example
/// ///
/// ``` /// ```
/// use rs::float_ord;
/// let mut v = [-5.0, 4.0, 1.0, -3.0, 2.0]; /// let mut v = [-5.0, 4.0, 1.0, -3.0, 2.0];
/// ///
/// float_ord::sort(&mut v); /// float_ord::sort(&mut v);

View File

@ -226,7 +226,8 @@ bitflags!{
/// Map to `text_input_unstable_v3.content_purpose` values /// Map to `text_input_unstable_v3.content_purpose` values
/// ///
/// ``` /// ```
/// assert_eq!(ContentPurpose::Alpha as u32, 0); /// use rs::imservice::ContentPurpose;
/// assert_eq!(ContentPurpose::Alpha as u32, 1);
/// ``` /// ```
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub enum ContentPurpose { pub enum ContentPurpose {

View File

@ -5,8 +5,8 @@ extern crate maplit;
extern crate serde; extern crate serde;
mod data; mod data;
mod float_ord; pub mod float_ord;
mod imservice; pub mod imservice;
mod keyboard; mod keyboard;
mod layout; mod layout;
mod resources; mod resources;