Commit 83fea8cd authored by Dorota Czaplejewicz's avatar Dorota Czaplejewicz
Browse files

Drop squeek_key

parent cdf263d9
Pipeline #48047 passed with stages
in 9 minutes and 20 seconds
......@@ -334,7 +334,7 @@ render_pressed_button (GtkWidget *widget,
GdkDrawingContext *context = gdk_window_begin_draw_frame (window, region);
cairo_t *cr = gdk_drawing_context_get_cairo_context (context);
eek_renderer_render_button (priv->renderer, cr, place, 1.0, TRUE);
eek_renderer_render_button (priv->renderer, cr, place, 1.0, TRUE, FALSE);
/*
eek_renderer_render_key (priv->renderer, cr, key, 1.5, TRUE);
*/
......@@ -353,7 +353,7 @@ eek_gtk_render_locked_button (EekGtkKeyboard *self, struct button_place place)
GdkDrawingContext *context = gdk_window_begin_draw_frame (window, region);
cairo_t *cr = gdk_drawing_context_get_cairo_context (context);
eek_renderer_render_button (priv->renderer, cr, &place, 1.0, TRUE);
eek_renderer_render_button (priv->renderer, cr, &place, 1.0, FALSE, TRUE);
gdk_window_end_draw_frame (window, context);
......
......@@ -34,8 +34,6 @@
#include "eekboard/eekboard-context-service.h"
#include "eekboard/key-emitter.h"
#include "keymap.h"
#include "src/keyboard.h"
#include "eek-keyboard.h"
void level_keyboard_deinit(LevelKeyboard *self) {
......
......@@ -426,18 +426,23 @@ eek_renderer_render_button_label (EekRenderer *self,
*
* Renders a key separately from the normal keyboard rendering.
*/
static void
eek_renderer_real_render_button (EekRenderer *self,
void
eek_renderer_render_button (EekRenderer *self,
cairo_t *cr,
struct button_place *place,
gdouble scale,
gboolean rotate)
gboolean is_pressed,
gboolean is_locked)
{
g_return_if_fail (EEK_IS_RENDERER(self));
g_return_if_fail (place);
g_return_if_fail (scale >= 0.0);
EekRendererPrivate *priv = eek_renderer_get_instance_private (self);
EekBounds bounds;
EekBounds view_bounds = squeek_view_get_bounds (level_keyboard_current(priv->keyboard));
eek_renderer_get_button_bounds (view_bounds, place, &bounds, rotate);
eek_renderer_get_button_bounds (view_bounds, place, &bounds, TRUE);
cairo_save (cr);
/* Because this function is called separately from the keyboard rendering
......@@ -446,12 +451,11 @@ eek_renderer_real_render_button (EekRenderer *self,
cairo_scale (cr, priv->scale, priv->scale);
cairo_translate (cr, bounds.x, bounds.y);
eek_renderer_apply_transformation_for_button (cr, view_bounds, place, scale, rotate);
struct squeek_key *key = squeek_button_get_key(place->button);
eek_renderer_apply_transformation_for_button (cr, view_bounds, place, scale, TRUE);
render_button (
self, cr, view_bounds, place,
squeek_key_is_pressed(key) != 0,
squeek_key_is_locked (key) != 0
is_pressed,
is_locked
);
cairo_restore (cr);
}
......@@ -560,7 +564,6 @@ eek_renderer_class_init (EekRendererClass *klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GParamSpec *pspec;
klass->render_button = eek_renderer_real_render_button;
klass->render_keyboard = eek_renderer_real_render_keyboard;
gobject_class->set_property = eek_renderer_set_property;
......@@ -823,21 +826,6 @@ eek_renderer_get_icon_surface (const gchar *icon_name,
return surface;
}
void
eek_renderer_render_button (EekRenderer *renderer,
cairo_t *cr,
struct button_place *place,
gdouble scale,
gboolean rotate)
{
g_return_if_fail (EEK_IS_RENDERER(renderer));
g_return_if_fail (place);
g_return_if_fail (scale >= 0.0);
EEK_RENDERER_GET_CLASS(renderer)->
render_button (renderer, cr, place, scale, rotate);
}
void
eek_renderer_render_keyboard (EekRenderer *renderer,
cairo_t *cr)
......
......@@ -36,12 +36,6 @@ struct _EekRendererClass
{
GObjectClass parent_class;
void (* render_button) (EekRenderer *self,
cairo_t *cr,
struct button_place *place,
gdouble scale,
gboolean rotate);
void (* render_keyboard) (EekRenderer *self,
cairo_t *cr);
......@@ -77,8 +71,7 @@ void eek_renderer_set_scale_factor (EekRenderer *renderer,
void eek_renderer_render_button (EekRenderer *renderer,
cairo_t *cr,
struct button_place *place,
gdouble scale,
gboolean rotate);
gdouble scale, gboolean is_pressed, gboolean is_locked);
cairo_surface_t *eek_renderer_get_icon_surface(const gchar *icon_name,
gint size,
......
......@@ -24,7 +24,6 @@
#include "config.h"
#include "eek-keyboard.h"
#include "src/keyboard.h"
#include "src/layout.h"
#include "eek-xml-layout.h"
......
#ifndef __KEYBOARD_H
#define __KEYBOARD_H
#include "inttypes.h"
#include "stdbool.h"
#include "virtual-keyboard-unstable-v1-client-protocol.h"
struct squeek_key;
uint32_t squeek_key_is_pressed(struct squeek_key *key);
uint32_t squeek_key_is_locked(struct squeek_key *key);
#endif
......@@ -10,30 +10,6 @@ use ::action::Action;
use std::io::Write;
use std::iter::{ FromIterator, IntoIterator };
use ::util::CloneOwned;
/// Gathers stuff defined in C or called by C
pub mod c {
use super::*;
use ::util::c;
pub type CKeyState = c::Wrapped<KeyState>;
// The following defined in Rust. TODO: wrap naked pointers to Rust data inside RefCells to prevent multiple writers
#[no_mangle]
pub extern "C"
fn squeek_key_is_pressed(key: CKeyState) -> u32 {
//let key = unsafe { Rc::from_raw(key.0) };
return key.clone_owned().pressed as u32;
}
#[no_mangle]
pub extern "C"
fn squeek_key_is_locked(key: CKeyState) -> u32 {
return key.clone_owned().locked as u32;
}
}
#[derive(Debug, Clone, Copy)]
pub enum PressType {
......
......@@ -6,7 +6,6 @@
#include "eek/eek-element.h"
#include "eek/eek-gtk-keyboard.h"
#include "eek/eek-types.h"
#include "src/keyboard.h"
#include "virtual-keyboard-unstable-v1-client-protocol.h"
enum squeek_arrangement_kind {
......@@ -40,9 +39,6 @@ const char *squeek_button_get_icon_name(const struct squeek_button*);
const char *squeek_button_get_name(const struct squeek_button*);
const char *squeek_button_get_outline_name(const struct squeek_button*);
struct squeek_key *squeek_button_get_key(const struct squeek_button*);
uint32_t *squeek_button_has_key(const struct squeek_button* button,
const struct squeek_key *key);
void squeek_button_print(const struct squeek_button* button);
......
......@@ -129,16 +129,6 @@ pub mod c {
button.bounds.clone()
}
/// Borrow a new reference to key state. Doesn't need freeing
#[no_mangle]
pub extern "C"
fn squeek_button_get_key(
button: *const ::layout::Button
) -> ::keyboard::c::CKeyState {
let button = unsafe { &*button };
::keyboard::c::CKeyState::wrap(button.state.clone())
}
#[no_mangle]
pub extern "C"
fn squeek_button_get_label(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment