Merge branch 'drops' into 'master'

Drop more dead code

See merge request Librem5/squeekboard!185
This commit is contained in:
David Boddie
2019-09-29 15:00:30 +00:00
7 changed files with 0 additions and 912 deletions

View File

@ -28,7 +28,6 @@ sources = [
enums,
'../eekboard/key-emitter.c',
'../eekboard/eekboard-context-service.c',
'../eekboard/eekboard-context.c',
'../eekboard/eekboard-service.c',
# '../eekboard/eekboard-xklutil.c',
squeekboard_resources,

View File

@ -52,17 +52,6 @@ struct _ServerContextServiceClass {
G_DEFINE_TYPE (ServerContextService, server_context_service, EEKBOARD_TYPE_CONTEXT_SERVICE);
static void set_geometry (ServerContextService *context);
static void
on_monitors_changed (GdkScreen *screen,
ServerContextService *context)
{
if (context->window)
set_geometry (context);
}
static void
on_destroy (GtkWidget *widget, gpointer user_data)
{
@ -108,15 +97,6 @@ on_notify_keyboard (GObject *object,
}
}
static void
on_notify_fullscreen (GObject *object,
GParamSpec *spec,
ServerContextService *context)
{
if (context->window)
set_geometry (context);
}
static void
on_notify_map (GObject *object,
ServerContextService *context)
@ -132,49 +112,6 @@ on_notify_unmap (GObject *object,
g_object_set (context, "visible", FALSE, NULL);
}
static void
set_geometry (ServerContextService *context)
{
GdkScreen *screen = gdk_screen_get_default ();
GdkWindow *root = gdk_screen_get_root_window (screen);
GdkDisplay *display = gdk_display_get_default ();
GdkMonitor *monitor = gdk_display_get_monitor_at_window (display, root);
LevelKeyboard *keyboard = eekboard_context_service_get_keyboard (EEKBOARD_CONTEXT_SERVICE(context));
GdkRectangle rect;
gdk_monitor_get_geometry (monitor, &rect);
EekBounds bounds = squeek_view_get_bounds (level_keyboard_current(keyboard));
if (eekboard_context_service_get_fullscreen (EEKBOARD_CONTEXT_SERVICE(context))) {
gint width = rect.width;
gint height = rect.height;
if (width > height) {
width *= context->size_constraint_landscape[0];
height *= context->size_constraint_landscape[1];
} else {
width *= context->size_constraint_portrait[0];
height *= context->size_constraint_portrait[1];
}
if (width * bounds.height > height * bounds.width)
width = (height / bounds.height) * bounds.width;
else
height = (width / bounds.width) * bounds.height;
gtk_window_resize (GTK_WINDOW(context->widget), width, height);
gtk_window_move (GTK_WINDOW(context->window),
(rect.width - width) / 2,
rect.height - height);
gtk_window_set_decorated (GTK_WINDOW(context->window), FALSE);
gtk_window_set_resizable (GTK_WINDOW(context->window), FALSE);
}
}
#define KEYBOARD_HEIGHT 210
static void
make_window (ServerContextService *context)
@ -238,7 +175,6 @@ make_widget (ServerContextService *context)
gtk_widget_set_has_tooltip (context->widget, TRUE);
gtk_container_add (GTK_CONTAINER(context->window), context->widget);
gtk_widget_show (context->widget);
set_geometry (context);
}
static void
@ -365,21 +301,10 @@ server_context_service_class_init (ServerContextServiceClass *klass)
static void
server_context_service_init (ServerContextService *context)
{
GdkScreen *screen = gdk_screen_get_default ();
g_signal_connect (screen,
"monitors-changed",
G_CALLBACK(on_monitors_changed),
context);
g_signal_connect (context,
"notify::keyboard",
G_CALLBACK(on_notify_keyboard),
context);
g_signal_connect (context,
"notify::fullscreen",
G_CALLBACK(on_notify_fullscreen),
context);
}
EekboardContextService *

View File

@ -1,51 +0,0 @@
/*
* Copyright (C) 2010-2011 Daiki Ueno <ueno@unixuser.org>
* Copyright (C) 2010-2011 Red Hat, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SERVER_CONTEXT_H
#define SERVER_CONTEXT_H 1
#include <gio/gio.h>
G_BEGIN_DECLS
#define SERVER_CONTEXT_PATH "/org/fedorahosted/Eekboard/Context_%d"
#define SERVER_CONTEXT_INTERFACE "org.fedorahosted.Eekboard.Context"
#define SERVER_TYPE_CONTEXT (server_context_get_type())
#define SERVER_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SERVER_TYPE_CONTEXT, ServerContext))
#define SERVER_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SERVER_TYPE_CONTEXT, ServerContextClass))
#define SERVER_IS_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SERVER_TYPE_CONTEXT))
#define SERVER_IS_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SERVER_TYPE_CONTEXT))
#define SERVER_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SERVER_TYPE_CONTEXT, ServerContextClass))
typedef struct _ServerContext ServerContext;
ServerContext *server_context_new (const gchar *object_path,
GDBusConnection *connection);
void server_context_set_enabled (ServerContext *context,
gboolean enabled);
void server_context_set_client_connection
(ServerContext *context,
const gchar *client_connection);
const gchar *server_context_get_client_connection
(ServerContext *context);
void server_context_set_client_name
(ServerContext *context,
const gchar *client_name);
G_END_DECLS
#endif /* SERVER_CONTEXT_H */