Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 784242fd20 |
@@ -1,35 +1,3 @@
|
||||
Overview of Changes in GTK+ 3.23.2
|
||||
==================================
|
||||
|
||||
* Emoji chooser improvements
|
||||
- Try harder to avoid fallback rendering
|
||||
- Avoid hex boxes
|
||||
- Use icons for sections
|
||||
|
||||
* Color chooser improvements
|
||||
- Allow picking colors from the screen again. The current
|
||||
implementation can use either the screnshot portal or
|
||||
a recent gnome-shell API
|
||||
|
||||
* GtkPlacesSidebar now shows a spinner during mount operations
|
||||
|
||||
* Wayland
|
||||
- Support both gtk-text-input and text-input-unstable-v3 as
|
||||
input protocol
|
||||
|
||||
* Bug fixes:
|
||||
#628 TextView: spaces acting as non-breaking whitespace...
|
||||
!248 win32: Correct handling of transient state changes
|
||||
!272 Replace gtk_text_input with text_input_unstable_v3 support
|
||||
|
||||
* Translation updates:
|
||||
- German
|
||||
- Lithuanian
|
||||
- Polish
|
||||
- Spanish
|
||||
- Turkish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.23.1
|
||||
==================================
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
m4_define([gtk_major_version], [3])
|
||||
m4_define([gtk_minor_version], [23])
|
||||
m4_define([gtk_micro_version], [2])
|
||||
m4_define([gtk_micro_version], [1])
|
||||
m4_define([gtk_interface_age], [0])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
|
||||
@@ -1085,11 +1085,17 @@ gdk_win32_window_destroy (GdkWindow *window,
|
||||
_gdk_remove_modal_window (window);
|
||||
|
||||
/* Remove all our transient children */
|
||||
while (window_impl->transient_children != NULL)
|
||||
tmp = window_impl->transient_children;
|
||||
while (tmp != NULL)
|
||||
{
|
||||
GdkWindow *child = window_impl->transient_children->data;
|
||||
gdk_window_set_transient_for (child, NULL);
|
||||
GdkWindow *child = tmp->data;
|
||||
GdkWindowImplWin32 *child_impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW (child)->impl);
|
||||
|
||||
child_impl->transient_owner = NULL;
|
||||
tmp = tmp->next;
|
||||
}
|
||||
g_slist_free (window_impl->transient_children);
|
||||
window_impl->transient_children = NULL;
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
display = GDK_WIN32_DISPLAY (gdk_window_get_display (window));
|
||||
@@ -2121,29 +2127,27 @@ gdk_win32_window_set_transient_for (GdkWindow *window,
|
||||
return;
|
||||
}
|
||||
|
||||
if (window_impl->transient_owner == parent)
|
||||
return;
|
||||
|
||||
if (GDK_IS_WINDOW (window_impl->transient_owner))
|
||||
if (parent == NULL)
|
||||
{
|
||||
GdkWindowImplWin32 *trans_impl = GDK_WINDOW_IMPL_WIN32 (window_impl->transient_owner->impl);
|
||||
item = g_slist_find (trans_impl->transient_children, window);
|
||||
item->data = NULL;
|
||||
trans_impl->transient_children = g_slist_delete_link (trans_impl->transient_children, item);
|
||||
trans_impl->num_transients--;
|
||||
|
||||
if (!trans_impl->num_transients)
|
||||
if (trans_impl->transient_children != NULL)
|
||||
{
|
||||
trans_impl->transient_children = NULL;
|
||||
}
|
||||
item = g_slist_find (trans_impl->transient_children, window);
|
||||
item->data = NULL;
|
||||
trans_impl->transient_children = g_slist_delete_link (trans_impl->transient_children, item);
|
||||
trans_impl->num_transients--;
|
||||
|
||||
if (!trans_impl->num_transients)
|
||||
{
|
||||
trans_impl->transient_children = NULL;
|
||||
}
|
||||
}
|
||||
g_object_unref (G_OBJECT (window_impl->transient_owner));
|
||||
g_object_unref (G_OBJECT (window));
|
||||
|
||||
window_impl->transient_owner = NULL;
|
||||
}
|
||||
|
||||
if (parent)
|
||||
else
|
||||
{
|
||||
parent_impl = GDK_WINDOW_IMPL_WIN32 (parent->impl);
|
||||
|
||||
|
||||
@@ -398,9 +398,6 @@ gtk_private_h_sources = \
|
||||
gtkclipboardprivate.h \
|
||||
gtkcolorswatchprivate.h \
|
||||
gtkcoloreditorprivate.h \
|
||||
gtkcolorpickerprivate.h \
|
||||
gtkcolorpickerportalprivate.h \
|
||||
gtkcolorpickershellprivate.h \
|
||||
gtkcolorplaneprivate.h \
|
||||
gtkcolorscaleprivate.h \
|
||||
gtkcolorchooserprivate.h \
|
||||
@@ -678,9 +675,6 @@ gtk_base_c_sources = \
|
||||
gtkcolorchooserwidget.c \
|
||||
gtkcolorchooserdialog.c \
|
||||
gtkcoloreditor.c \
|
||||
gtkcolorpicker.c \
|
||||
gtkcolorpickerportal.c \
|
||||
gtkcolorpickershell.c \
|
||||
gtkcolorplane.c \
|
||||
gtkcolorscale.c \
|
||||
gtkcolorswatch.c \
|
||||
@@ -1326,7 +1320,7 @@ gtk.gresource.xml: Makefile.am inspector/Makefile.inc
|
||||
echo " <file preprocess='xml-stripblanks'>ui/$$n</file>" >> $@; \
|
||||
done; \
|
||||
for s in 16x16 22x22 24x24 32x32 48x48; do \
|
||||
for c in actions status categories; do \
|
||||
for c in actions status; do \
|
||||
for f in $(srcdir)/icons/$$s/$$c/*.png; do \
|
||||
test "$$f" = "$(srcdir)/icons/$$s/$$c/*.png" && continue; \
|
||||
n=`basename $$f`; \
|
||||
|
||||
@@ -24,9 +24,7 @@
|
||||
#include "gtkcolorscaleprivate.h"
|
||||
#include "gtkcolorswatchprivate.h"
|
||||
#include "gtkcolorutils.h"
|
||||
#include "gtkcolorpickerprivate.h"
|
||||
#include "gtkgrid.h"
|
||||
#include "gtkbutton.h"
|
||||
#include "gtkintl.h"
|
||||
#include "gtkorientable.h"
|
||||
#include "gtkentry.h"
|
||||
@@ -63,9 +61,6 @@ struct _GtkColorEditorPrivate
|
||||
GtkAdjustment *v_adj;
|
||||
GtkAdjustment *a_adj;
|
||||
|
||||
GtkWidget *picker_button;
|
||||
GtkColorPicker *picker;
|
||||
|
||||
gint popup_position;
|
||||
|
||||
guint text_changed : 1;
|
||||
@@ -358,36 +353,6 @@ popup_draw (GtkWidget *popup,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
color_picked (GObject *source,
|
||||
GAsyncResult *res,
|
||||
gpointer data)
|
||||
{
|
||||
GtkColorPicker *picker = GTK_COLOR_PICKER (source);
|
||||
GtkColorEditor *editor = data;
|
||||
GError *error = NULL;
|
||||
GdkRGBA *color;
|
||||
|
||||
color = gtk_color_picker_pick_finish (picker, res, &error);
|
||||
if (color == NULL)
|
||||
{
|
||||
g_warning ("Picking color failed: %s", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (editor), color);
|
||||
gdk_rgba_free (color);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
pick_color (GtkButton *button,
|
||||
GtkColorEditor *editor)
|
||||
{
|
||||
gtk_color_picker_pick (editor->priv->picker, color_picked, editor);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_editor_init (GtkColorEditor *editor)
|
||||
{
|
||||
@@ -429,10 +394,6 @@ gtk_color_editor_init (GtkColorEditor *editor)
|
||||
gtk_overlay_add_overlay (GTK_OVERLAY (editor->priv->overlay), editor->priv->a_popup);
|
||||
|
||||
gtk_style_context_remove_class (gtk_widget_get_style_context (editor->priv->swatch), "activatable");
|
||||
|
||||
editor->priv->picker = gtk_color_picker_new ();
|
||||
if (editor->priv->picker == NULL)
|
||||
gtk_widget_hide (editor->priv->picker_button);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -441,7 +402,6 @@ gtk_color_editor_dispose (GObject *object)
|
||||
GtkColorEditor *editor = GTK_COLOR_EDITOR (object);
|
||||
|
||||
dismiss_current_popup (editor);
|
||||
g_clear_object (&editor->priv->picker);
|
||||
|
||||
G_OBJECT_CLASS (gtk_color_editor_parent_class)->dispose (object);
|
||||
}
|
||||
@@ -544,7 +504,6 @@ gtk_color_editor_class_init (GtkColorEditorClass *class)
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkColorEditor, s_adj);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkColorEditor, v_adj);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkColorEditor, a_adj);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkColorEditor, picker_button);
|
||||
|
||||
gtk_widget_class_bind_template_callback (widget_class, hsv_changed);
|
||||
gtk_widget_class_bind_template_callback (widget_class, popup_draw);
|
||||
@@ -555,7 +514,6 @@ gtk_color_editor_class_init (GtkColorEditorClass *class)
|
||||
gtk_widget_class_bind_template_callback (widget_class, entry_apply);
|
||||
gtk_widget_class_bind_template_callback (widget_class, entry_focus_out);
|
||||
gtk_widget_class_bind_template_callback (widget_class, popup_edit);
|
||||
gtk_widget_class_bind_template_callback (widget_class, pick_color);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2018, Red Hat, Inc
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gtkcolorpickerprivate.h"
|
||||
#include "gtkcolorpickerportalprivate.h"
|
||||
#include "gtkcolorpickershellprivate.h"
|
||||
#include "gtkprivate.h"
|
||||
#include <gio/gio.h>
|
||||
|
||||
|
||||
G_DEFINE_INTERFACE_WITH_CODE (GtkColorPicker, gtk_color_picker, G_TYPE_OBJECT,
|
||||
g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_INITABLE);)
|
||||
|
||||
static void
|
||||
gtk_color_picker_default_init (GtkColorPickerInterface *iface)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
gtk_color_picker_pick (GtkColorPicker *picker,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
GTK_COLOR_PICKER_GET_INTERFACE (picker)->pick (picker, callback, user_data);
|
||||
}
|
||||
|
||||
GdkRGBA *
|
||||
gtk_color_picker_pick_finish (GtkColorPicker *picker,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
return GTK_COLOR_PICKER_GET_INTERFACE (picker)->pick_finish (picker, res, error);
|
||||
}
|
||||
|
||||
GtkColorPicker *
|
||||
gtk_color_picker_new (void)
|
||||
{
|
||||
GtkColorPicker *picker;
|
||||
|
||||
if (gtk_should_use_portal ())
|
||||
picker = gtk_color_picker_portal_new ();
|
||||
else
|
||||
picker = gtk_color_picker_shell_new ();
|
||||
|
||||
if (picker)
|
||||
g_debug ("Using %s for picking colors", g_type_name_from_instance (picker));
|
||||
else
|
||||
g_debug ("No suitable GtkColorPicker implementation\n");
|
||||
|
||||
return picker;
|
||||
}
|
||||
|
||||
@@ -1,240 +0,0 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2018, Red Hat, Inc
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gtkcolorpickerportalprivate.h"
|
||||
#include <gio/gio.h>
|
||||
|
||||
struct _GtkColorPickerPortal
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
GDBusProxy *portal_proxy;
|
||||
guint portal_signal_id;
|
||||
GTask *task;
|
||||
};
|
||||
|
||||
struct _GtkColorPickerPortalClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
static GInitableIface *initable_parent_iface;
|
||||
static void gtk_color_picker_portal_initable_iface_init (GInitableIface *iface);
|
||||
static void gtk_color_picker_portal_iface_init (GtkColorPickerInterface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkColorPickerPortal, gtk_color_picker_portal, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, gtk_color_picker_portal_initable_iface_init)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_COLOR_PICKER, gtk_color_picker_portal_iface_init))
|
||||
|
||||
static gboolean
|
||||
gtk_color_picker_portal_initable_init (GInitable *initable,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
GtkColorPickerPortal *picker = GTK_COLOR_PICKER_PORTAL (initable);
|
||||
char *owner;
|
||||
GVariant *ret;
|
||||
guint version;
|
||||
|
||||
picker->portal_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
|
||||
G_DBUS_PROXY_FLAGS_NONE,
|
||||
NULL,
|
||||
"org.freedesktop.portal.Desktop",
|
||||
"/org/freedesktop/portal/desktop",
|
||||
"org.freedesktop.portal.Screenshot",
|
||||
NULL,
|
||||
error);
|
||||
|
||||
if (picker->portal_proxy == NULL)
|
||||
{
|
||||
g_debug ("Failed to create screnshot portal proxy");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
owner = g_dbus_proxy_get_name_owner (picker->portal_proxy);
|
||||
if (owner == NULL)
|
||||
{
|
||||
g_debug ("org.freedesktop.portal.Screenshot not provided");
|
||||
g_clear_object (&picker->portal_proxy);
|
||||
return FALSE;
|
||||
}
|
||||
g_free (owner);
|
||||
|
||||
ret = g_dbus_proxy_get_cached_property (picker->portal_proxy, "version");
|
||||
g_variant_get (ret, "u", &version);
|
||||
g_variant_unref (ret);
|
||||
if (version != 2)
|
||||
{
|
||||
g_debug ("Screenshot portal version: %u", version);
|
||||
g_clear_object (&picker->portal_proxy);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_picker_portal_initable_iface_init (GInitableIface *iface)
|
||||
{
|
||||
initable_parent_iface = g_type_interface_peek_parent (iface);
|
||||
iface->init = gtk_color_picker_portal_initable_init;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_picker_portal_init (GtkColorPickerPortal *picker)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_picker_portal_finalize (GObject *object)
|
||||
{
|
||||
GtkColorPickerPortal *picker = GTK_COLOR_PICKER_PORTAL (object);
|
||||
|
||||
g_clear_object (&picker->portal_proxy);
|
||||
|
||||
G_OBJECT_CLASS (gtk_color_picker_portal_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_picker_portal_class_init (GtkColorPickerPortalClass *class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
|
||||
object_class->finalize = gtk_color_picker_portal_finalize;
|
||||
}
|
||||
|
||||
GtkColorPicker *
|
||||
gtk_color_picker_portal_new (void)
|
||||
{
|
||||
return GTK_COLOR_PICKER (g_initable_new (GTK_TYPE_COLOR_PICKER_PORTAL, NULL, NULL, NULL));
|
||||
}
|
||||
|
||||
static void
|
||||
portal_response_received (GDBusConnection *connection,
|
||||
const char *sender_name,
|
||||
const char *object_path,
|
||||
const char *interface_name,
|
||||
const char *signal_name,
|
||||
GVariant *parameters,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkColorPickerPortal *picker = user_data;
|
||||
guint32 response;
|
||||
GVariant *ret;
|
||||
|
||||
g_dbus_connection_signal_unsubscribe (connection, picker->portal_signal_id);
|
||||
picker->portal_signal_id = 0;
|
||||
|
||||
g_variant_get (parameters, "(u@a{sv})", &response, &ret);
|
||||
|
||||
if (response == 0)
|
||||
{
|
||||
GdkRGBA c;
|
||||
|
||||
c.alpha = 1.0;
|
||||
if (g_variant_lookup (ret, "color", "(ddd)", &c.red, &c.green, &c.blue))
|
||||
g_task_return_pointer (picker->task, gdk_rgba_copy (&c), (GDestroyNotify)gdk_rgba_free);
|
||||
else
|
||||
g_task_return_new_error (picker->task,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_FAILED,
|
||||
"No color received");
|
||||
}
|
||||
else
|
||||
g_task_return_new_error (picker->task,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_FAILED,
|
||||
"PickColor error");
|
||||
|
||||
g_variant_unref (ret);
|
||||
|
||||
g_clear_object (&picker->task);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_picker_portal_pick (GtkColorPicker *cp,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkColorPickerPortal *picker = GTK_COLOR_PICKER_PORTAL (cp);
|
||||
GVariantBuilder options;
|
||||
char *token;
|
||||
GDBusConnection *connection;
|
||||
char *sender;
|
||||
char *handle;
|
||||
int i;
|
||||
|
||||
if (picker->task)
|
||||
return;
|
||||
|
||||
picker->task = g_task_new (picker, NULL, callback, user_data);
|
||||
|
||||
connection = g_dbus_proxy_get_connection (picker->portal_proxy);
|
||||
|
||||
token = g_strdup_printf ("gtk%d", g_random_int_range (0, G_MAXINT));
|
||||
sender = g_strdup (g_dbus_connection_get_unique_name (connection) + 1);
|
||||
for (i = 0; sender[i]; i++)
|
||||
if (sender[i] == '.')
|
||||
sender[i] = '_';
|
||||
|
||||
handle = g_strdup_printf ("/org/freedesktop/portal/desktop/request/%s/%s", sender, token);
|
||||
picker->portal_signal_id = g_dbus_connection_signal_subscribe (connection,
|
||||
"org.freedesktop.portal.Desktop",
|
||||
"org.freedesktop.portal.Request",
|
||||
"Response",
|
||||
handle,
|
||||
NULL,
|
||||
G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE,
|
||||
portal_response_received,
|
||||
picker,
|
||||
NULL);
|
||||
|
||||
g_free (handle);
|
||||
g_free (sender);
|
||||
|
||||
g_variant_builder_init (&options, G_VARIANT_TYPE_VARDICT);
|
||||
g_variant_builder_add (&options, "{sv}", "handle_token", g_variant_new_string (token));
|
||||
g_free (token);
|
||||
|
||||
g_dbus_proxy_call (picker->portal_proxy,
|
||||
"PickColor",
|
||||
g_variant_new ("(sa{sv})", "", &options),
|
||||
0,
|
||||
-1,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static GdkRGBA *
|
||||
gtk_color_picker_portal_pick_finish (GtkColorPicker *cp,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
g_return_val_if_fail (g_task_is_valid (res, cp), NULL);
|
||||
|
||||
return g_task_propagate_pointer (G_TASK (res), error);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_picker_portal_iface_init (GtkColorPickerInterface *iface)
|
||||
{
|
||||
iface->pick = gtk_color_picker_portal_pick;
|
||||
iface->pick_finish = gtk_color_picker_portal_pick_finish;
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2018 Red Hat, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This Library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GTK_COLOR_PICKER_PORTAL_H__
|
||||
#define __GTK_COLOR_PICKER_PORTAL_H__
|
||||
|
||||
|
||||
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gtk/gtkcolorpickerprivate.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
#define GTK_TYPE_COLOR_PICKER_PORTAL gtk_color_picker_portal_get_type ()
|
||||
G_DECLARE_FINAL_TYPE (GtkColorPickerPortal, gtk_color_picker_portal, GTK, COLOR_PICKER_PORTAL, GObject)
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GtkColorPicker * gtk_color_picker_portal_new (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_COLOR_PICKER_PORTAL_H__ */
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2018 Red Hat, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This Library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GTK_COLOR_PICKER_H__
|
||||
#define __GTK_COLOR_PICKER_H__
|
||||
|
||||
|
||||
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gtk/gtkwindow.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
#define GTK_TYPE_COLOR_PICKER (gtk_color_picker_get_type ())
|
||||
#define GTK_COLOR_PICKER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_COLOR_PICKER, GtkColorPicker))
|
||||
#define GTK_IS_COLOR_PICKER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_COLOR_PICKER))
|
||||
#define GTK_COLOR_PICKER_GET_INTERFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GTK_TYPE_COLOR_PICKER, GtkColorPickerInterface))
|
||||
|
||||
|
||||
typedef struct _GtkColorPicker GtkColorPicker;
|
||||
typedef struct _GtkColorPickerInterface GtkColorPickerInterface;
|
||||
|
||||
struct _GtkColorPickerInterface {
|
||||
GTypeInterface g_iface;
|
||||
|
||||
void (* pick) (GtkColorPicker *picker,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
GdkRGBA * (* pick_finish) (GtkColorPicker *picker,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
};
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gtk_color_picker_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GtkColorPicker * gtk_color_picker_new (void);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_color_picker_pick (GtkColorPicker *picker,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkRGBA * gtk_color_picker_pick_finish (GtkColorPicker *picker,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_COLOR_PICKER_H__ */
|
||||
@@ -1,183 +0,0 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2018, Red Hat, Inc
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gtkcolorpickershellprivate.h"
|
||||
#include <gio/gio.h>
|
||||
|
||||
struct _GtkColorPickerShell
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
GDBusProxy *shell_proxy;
|
||||
GTask *task;
|
||||
};
|
||||
|
||||
struct _GtkColorPickerShellClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
static GInitableIface *initable_parent_iface;
|
||||
static void gtk_color_picker_shell_initable_iface_init (GInitableIface *iface);
|
||||
static void gtk_color_picker_shell_iface_init (GtkColorPickerInterface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkColorPickerShell, gtk_color_picker_shell, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, gtk_color_picker_shell_initable_iface_init)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_COLOR_PICKER, gtk_color_picker_shell_iface_init))
|
||||
|
||||
static gboolean
|
||||
gtk_color_picker_shell_initable_init (GInitable *initable,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
GtkColorPickerShell *picker = GTK_COLOR_PICKER_SHELL (initable);
|
||||
char *owner;
|
||||
|
||||
picker->shell_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
|
||||
G_DBUS_PROXY_FLAGS_NONE,
|
||||
NULL,
|
||||
"org.gnome.Shell.Screenshot",
|
||||
"/org/gnome/Shell/Screenshot",
|
||||
"org.gnome.Shell.Screenshot",
|
||||
NULL,
|
||||
error);
|
||||
|
||||
if (picker->shell_proxy == NULL)
|
||||
{
|
||||
g_debug ("Failed to create shell screenshot proxy");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
owner = g_dbus_proxy_get_name_owner (picker->shell_proxy);
|
||||
if (owner == NULL)
|
||||
{
|
||||
g_debug ("org.gnome.Shell.Screenshot not provided");
|
||||
g_clear_object (&picker->shell_proxy);
|
||||
return FALSE;
|
||||
}
|
||||
g_free (owner);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_picker_shell_initable_iface_init (GInitableIface *iface)
|
||||
{
|
||||
initable_parent_iface = g_type_interface_peek_parent (iface);
|
||||
iface->init = gtk_color_picker_shell_initable_init;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_picker_shell_init (GtkColorPickerShell *picker)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_picker_shell_finalize (GObject *object)
|
||||
{
|
||||
GtkColorPickerShell *picker = GTK_COLOR_PICKER_SHELL (object);
|
||||
|
||||
g_clear_object (&picker->shell_proxy);
|
||||
|
||||
G_OBJECT_CLASS (gtk_color_picker_shell_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_picker_shell_class_init (GtkColorPickerShellClass *class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
|
||||
object_class->finalize = gtk_color_picker_shell_finalize;
|
||||
}
|
||||
|
||||
GtkColorPicker *
|
||||
gtk_color_picker_shell_new (void)
|
||||
{
|
||||
return GTK_COLOR_PICKER (g_initable_new (GTK_TYPE_COLOR_PICKER_SHELL, NULL, NULL, NULL));
|
||||
}
|
||||
|
||||
static void
|
||||
color_picked (GObject *source,
|
||||
GAsyncResult *res,
|
||||
gpointer data)
|
||||
{
|
||||
GtkColorPickerShell *picker = GTK_COLOR_PICKER_SHELL (data);
|
||||
GError *error = NULL;
|
||||
GVariant *ret;
|
||||
|
||||
ret = g_dbus_proxy_call_finish (picker->shell_proxy, res, &error);
|
||||
|
||||
if (ret == NULL)
|
||||
{
|
||||
g_task_return_error (picker->task, error);
|
||||
}
|
||||
else
|
||||
{
|
||||
GdkRGBA c;
|
||||
|
||||
c.alpha = 1;
|
||||
if (!g_variant_lookup (ret, "color", "(ddd)", &c.red, &c.green, &c.blue))
|
||||
g_task_return_new_error (picker->task, G_IO_ERROR, G_IO_ERROR_FAILED, "No color received");
|
||||
else
|
||||
g_task_return_pointer (picker->task, gdk_rgba_copy (&c), (GDestroyNotify)gdk_rgba_free);
|
||||
|
||||
g_variant_unref (ret);
|
||||
}
|
||||
|
||||
g_clear_object (&picker->task);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_picker_shell_pick (GtkColorPicker *cp,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkColorPickerShell *picker = GTK_COLOR_PICKER_SHELL (cp);
|
||||
|
||||
if (picker->task)
|
||||
return;
|
||||
|
||||
picker->task = g_task_new (picker, NULL, callback, user_data);
|
||||
|
||||
g_dbus_proxy_call (picker->shell_proxy,
|
||||
"PickColor",
|
||||
NULL,
|
||||
0,
|
||||
-1,
|
||||
NULL,
|
||||
color_picked,
|
||||
picker);
|
||||
}
|
||||
|
||||
static GdkRGBA *
|
||||
gtk_color_picker_shell_pick_finish (GtkColorPicker *cp,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
g_return_val_if_fail (g_task_is_valid (res, cp), NULL);
|
||||
|
||||
return g_task_propagate_pointer (G_TASK (res), error);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_picker_shell_iface_init (GtkColorPickerInterface *iface)
|
||||
{
|
||||
iface->pick = gtk_color_picker_shell_pick;
|
||||
iface->pick_finish = gtk_color_picker_shell_pick_finish;
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2018 Red Hat, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This Library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GTK_COLOR_PICKER_SHELL_H__
|
||||
#define __GTK_COLOR_PICKER_SHELL_H__
|
||||
|
||||
|
||||
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gtk/gtkcolorpickerprivate.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
#define GTK_TYPE_COLOR_PICKER_SHELL gtk_color_picker_shell_get_type ()
|
||||
G_DECLARE_FINAL_TYPE (GtkColorPickerShell, gtk_color_picker_shell, GTK, COLOR_PICKER_SHELL, GObject)
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GtkColorPicker * gtk_color_picker_shell_new (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_COLOR_PICKER_SHELL_H__ */
|
||||
@@ -622,15 +622,19 @@ static void
|
||||
setup_section (GtkEmojiChooser *chooser,
|
||||
EmojiSection *section,
|
||||
const char *first,
|
||||
const char *icon)
|
||||
gunichar label)
|
||||
{
|
||||
char text[14];
|
||||
char *p;
|
||||
GtkAdjustment *adj;
|
||||
GtkWidget *image;
|
||||
|
||||
section->first = first;
|
||||
|
||||
image = gtk_bin_get_child (GTK_BIN (section->button));
|
||||
gtk_image_set_from_icon_name (GTK_IMAGE (image), icon, GTK_ICON_SIZE_BUTTON);
|
||||
p = text;
|
||||
p += g_unichar_to_utf8 (label, p);
|
||||
p += g_unichar_to_utf8 (0xfe0e, p);
|
||||
p[0] = 0;
|
||||
gtk_button_set_label (GTK_BUTTON (section->button), text);
|
||||
|
||||
adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (chooser->scrolled_window));
|
||||
|
||||
@@ -690,16 +694,16 @@ gtk_emoji_chooser_init (GtkEmojiChooser *chooser)
|
||||
adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (chooser->scrolled_window));
|
||||
g_signal_connect (adj, "value-changed", G_CALLBACK (adj_value_changed), chooser);
|
||||
|
||||
setup_section (chooser, &chooser->recent, NULL, "emoji-recent-symbolic");
|
||||
setup_section (chooser, &chooser->people, "grinning face", "emoji-people-symbolic");
|
||||
setup_section (chooser, &chooser->body, "selfie", "emoji-body-symbolic");
|
||||
setup_section (chooser, &chooser->nature, "monkey face", "emoji-nature-symbolic");
|
||||
setup_section (chooser, &chooser->food, "grapes", "emoji-food-symbolic");
|
||||
setup_section (chooser, &chooser->travel, "globe showing Europe-Africa", "emoji-travel-symbolic");
|
||||
setup_section (chooser, &chooser->activities, "jack-o-lantern", "emoji-activities-symbolic");
|
||||
setup_section (chooser, &chooser->objects, "muted speaker", "emoji-objects-symbolic");
|
||||
setup_section (chooser, &chooser->symbols, "ATM sign", "emoji-symbols-symbolic");
|
||||
setup_section (chooser, &chooser->flags, "chequered flag", "emoji-flags-symbolic");
|
||||
setup_section (chooser, &chooser->recent, NULL, 0x1f557);
|
||||
setup_section (chooser, &chooser->people, "grinning face", 0x1f642);
|
||||
setup_section (chooser, &chooser->body, "selfie", 0x1f44d);
|
||||
setup_section (chooser, &chooser->nature, "monkey face", 0x1f337);
|
||||
setup_section (chooser, &chooser->food, "grapes", 0x1f374);
|
||||
setup_section (chooser, &chooser->travel, "globe showing Europe-Africa", 0x2708);
|
||||
setup_section (chooser, &chooser->activities, "jack-o-lantern", 0x1f3c3);
|
||||
setup_section (chooser, &chooser->objects, "muted speaker", 0x1f514);
|
||||
setup_section (chooser, &chooser->symbols, "ATM sign", 0x2764);
|
||||
setup_section (chooser, &chooser->flags, "chequered flag", 0x1f3f4);
|
||||
|
||||
populate_emoji_chooser (chooser);
|
||||
populate_recent_section (chooser);
|
||||
|
||||
@@ -4106,6 +4106,24 @@ gtk_icon_info_load_icon (GtkIconInfo *icon_info,
|
||||
return icon_info->proxy_pixbuf;
|
||||
}
|
||||
|
||||
GdkPixbuf *
|
||||
gtk_icon_info_load_icon_thread_safe (GtkIconInfo *icon_info,
|
||||
GError **error)
|
||||
{
|
||||
GtkIconInfo *dup;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
g_return_val_if_fail (icon_info != NULL, NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
dup = icon_info_dup (icon_info);
|
||||
pixbuf = gtk_icon_info_load_icon (dup, error);
|
||||
|
||||
g_object_unref (dup);
|
||||
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_icon_info_load_surface:
|
||||
* @icon_info: a #GtkIconInfo from gtk_icon_theme_lookup_icon()
|
||||
|
||||
@@ -300,6 +300,9 @@ gboolean gtk_icon_info_is_symbolic (GtkIconInfo *icon_info
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkPixbuf * gtk_icon_info_load_icon (GtkIconInfo *icon_info,
|
||||
GError **error);
|
||||
GDK_AVAILABLE_IN_3_24
|
||||
GdkPixbuf * gtk_icon_info_load_icon_thread_safe (GtkIconInfo *icon_info,
|
||||
GError **error);
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
cairo_surface_t * gtk_icon_info_load_surface (GtkIconInfo *icon_info,
|
||||
GdkWindow *for_window,
|
||||
|
||||
@@ -697,14 +697,6 @@ match_backend (GtkIMContextInfo *context)
|
||||
{
|
||||
#ifdef GDK_WINDOWING_WAYLAND
|
||||
if (g_strcmp0 (context->context_id, "wayland") == 0)
|
||||
{
|
||||
GdkDisplay *display = gdk_display_get_default ();
|
||||
|
||||
return GDK_IS_WAYLAND_DISPLAY (display) &&
|
||||
gdk_wayland_display_query_registry (display,
|
||||
"zwp_text_input_manager_v3");
|
||||
}
|
||||
if (g_strcmp0 (context->context_id, "waylandgtk") == 0)
|
||||
{
|
||||
GdkDisplay *display = gdk_display_get_default ();
|
||||
|
||||
|
||||
@@ -1907,17 +1907,10 @@ gtk_settings_create_for_display (GdkDisplay *display)
|
||||
if (GDK_IS_WAYLAND_DISPLAY (display))
|
||||
{
|
||||
if (gdk_wayland_display_query_registry (display,
|
||||
"zwp_text_input_manager_v3"))
|
||||
{
|
||||
settings = g_object_new (GTK_TYPE_SETTINGS,
|
||||
"gtk-im-module", "wayland",
|
||||
NULL);
|
||||
}
|
||||
else if (gdk_wayland_display_query_registry (display,
|
||||
"gtk_text_input_manager"))
|
||||
{
|
||||
settings = g_object_new (GTK_TYPE_SETTINGS,
|
||||
"gtk-im-module", "waylandgtk",
|
||||
"gtk-im-module", "wayland",
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -8612,11 +8612,6 @@ gtk_window_focus (GtkWidget *widget,
|
||||
{
|
||||
if (gtk_widget_child_focus (child, direction))
|
||||
return TRUE;
|
||||
else if (priv->title_box != NULL &&
|
||||
priv->title_box != child &&
|
||||
gtk_widget_child_focus (priv->title_box, direction))
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
||||
|
Before Width: | Height: | Size: 417 B |
|
Before Width: | Height: | Size: 280 B |
|
Before Width: | Height: | Size: 156 B |
|
Before Width: | Height: | Size: 248 B |
|
Before Width: | Height: | Size: 262 B |
|
Before Width: | Height: | Size: 155 B |
|
Before Width: | Height: | Size: 223 B |
|
Before Width: | Height: | Size: 351 B |
|
Before Width: | Height: | Size: 230 B |
|
Before Width: | Height: | Size: 235 B |
|
Before Width: | Height: | Size: 607 B |
|
Before Width: | Height: | Size: 409 B |
|
Before Width: | Height: | Size: 258 B |
|
Before Width: | Height: | Size: 374 B |
|
Before Width: | Height: | Size: 438 B |
|
Before Width: | Height: | Size: 267 B |
|
Before Width: | Height: | Size: 325 B |
|
Before Width: | Height: | Size: 590 B |
|
Before Width: | Height: | Size: 329 B |
|
Before Width: | Height: | Size: 357 B |
|
Before Width: | Height: | Size: 851 B |
|
Before Width: | Height: | Size: 496 B |
|
Before Width: | Height: | Size: 237 B |
|
Before Width: | Height: | Size: 388 B |
|
Before Width: | Height: | Size: 462 B |
|
Before Width: | Height: | Size: 236 B |
|
Before Width: | Height: | Size: 359 B |
|
Before Width: | Height: | Size: 729 B |
|
Before Width: | Height: | Size: 430 B |
|
Before Width: | Height: | Size: 422 B |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 706 B |
|
Before Width: | Height: | Size: 328 B |
|
Before Width: | Height: | Size: 608 B |
|
Before Width: | Height: | Size: 686 B |
|
Before Width: | Height: | Size: 319 B |
|
Before Width: | Height: | Size: 566 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 626 B |
|
Before Width: | Height: | Size: 639 B |
@@ -40,27 +40,6 @@
|
||||
<property name="margin-end">30</property>
|
||||
<property name="row-spacing">12</property>
|
||||
<property name="column-spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="picker_button">
|
||||
<property name="visible">1</property>
|
||||
<property name="no-show-all">1</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">1</property>
|
||||
<property name="icon-name">color-select-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<property name="tooltip-text" translatable="yes">Pick a color from the screen</property>
|
||||
<signal name="clicked" handler="pick_color"/>
|
||||
<style>
|
||||
<class name="circular"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorSwatch" id="swatch">
|
||||
<property name="visible">True</property>
|
||||
|
||||
@@ -198,11 +198,6 @@
|
||||
<style>
|
||||
<class name="emoji-section"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage" id="recent.icon">
|
||||
<property name="visible">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
@@ -213,11 +208,6 @@
|
||||
<style>
|
||||
<class name="emoji-section"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage" id="people.icon">
|
||||
<property name="visible">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
@@ -228,11 +218,6 @@
|
||||
<style>
|
||||
<class name="emoji-section"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage" id="body.icon">
|
||||
<property name="visible">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
@@ -243,11 +228,6 @@
|
||||
<style>
|
||||
<class name="emoji-section"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage" id="nature.icon">
|
||||
<property name="visible">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
@@ -258,11 +238,6 @@
|
||||
<style>
|
||||
<class name="emoji-section"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage" id="food.icon">
|
||||
<property name="visible">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
@@ -273,11 +248,6 @@
|
||||
<style>
|
||||
<class name="emoji-section"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage" id="travel.icon">
|
||||
<property name="visible">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
@@ -288,11 +258,6 @@
|
||||
<style>
|
||||
<class name="emoji-section"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage" id="activities.icon">
|
||||
<property name="visible">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
@@ -303,11 +268,6 @@
|
||||
<style>
|
||||
<class name="emoji-section"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage" id="objects.icon">
|
||||
<property name="visible">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
@@ -318,11 +278,6 @@
|
||||
<style>
|
||||
<class name="emoji-section"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage" id="symbols.icon">
|
||||
<property name="visible">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
@@ -333,11 +288,6 @@
|
||||
<style>
|
||||
<class name="emoji-section"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage" id="flags.icon">
|
||||
<property name="visible">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
@@ -175,8 +175,8 @@ endif
|
||||
endif
|
||||
|
||||
protocol_built_sources = \
|
||||
text-input-unstable-v3-protocol.c \
|
||||
text-input-unstable-v3-client-protocol.h
|
||||
gtk-text-input-protocol.c \
|
||||
gtk-text-input-client-protocol.h
|
||||
|
||||
im_wayland_la_CPPFLAGS = $(AM_CPPFLAGS)
|
||||
im_wayland_la_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined)
|
||||
@@ -191,23 +191,6 @@ WAYLAND_MODULE = im-wayland.la
|
||||
endif
|
||||
endif
|
||||
|
||||
protocol_built_sources_gtk = \
|
||||
gtk-text-input-protocol.c \
|
||||
gtk-text-input-client-protocol.h
|
||||
|
||||
im_waylandgtk_la_CPPFLAGS = $(AM_CPPFLAGS)
|
||||
im_waylandgtk_la_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined)
|
||||
im_waylandgtk_la_SOURCES = imwaylandgtk.c $(protocol_built_sources_gtk)
|
||||
libstatic_im_waylandgtk_la_SOURCES = $(im_waylandgtk_la_SOURCES)
|
||||
im_waylandgtk_la_LIBADD = $(LDADDS)
|
||||
if INCLUDE_IM_WAYLAND
|
||||
STATIC_WAYLANDGTK_MODULE = libstatic-im-waylandgtk.la
|
||||
else
|
||||
if USE_WAYLAND
|
||||
WAYLANDGTK_MODULE = im-waylandgtk.la
|
||||
endif
|
||||
endif
|
||||
|
||||
multipress_defs = -DMULTIPRESS_LOCALEDIR=\""$(mplocaledir)"\" -DMULTIPRESS_CONFDIR=\""$(sysconfdir)/gtk-3.0"\"
|
||||
im_multipress_la_CPPFLAGS = $(AM_CPPFLAGS) $(multipress_defs)
|
||||
libstatic_im_multipress_la_CPPFLAGS = $(im_multipress_la_CPPFLAGS)
|
||||
@@ -270,7 +253,6 @@ module_LTLIBRARIES = \
|
||||
$(QUARTZ_MODULE) \
|
||||
$(BROADWAY_MODULE) \
|
||||
$(WAYLAND_MODULE) \
|
||||
$(WAYLANDGTK_MODULE) \
|
||||
$(THAI_MODULE) \
|
||||
$(TI_ER_MODULE) \
|
||||
$(TI_ET_MODULE) \
|
||||
@@ -290,7 +272,6 @@ noinst_LTLIBRARIES = \
|
||||
$(STATIC_QUARTZ_MODULE) \
|
||||
$(STATIC_BROADWAY_MODULE) \
|
||||
$(STATIC_WAYLAND_MODULE) \
|
||||
$(STATIC_WAYLANDGTK_MODULE) \
|
||||
$(STATIC_THAI_MODULE) \
|
||||
$(STATIC_TI_ER_MODULE) \
|
||||
$(STATIC_TI_ET_MODULE) \
|
||||
@@ -303,8 +284,8 @@ immodules.cache: Makefile.am $(module_LTLIBRARIES)
|
||||
$(AM_V_GEN) $(top_builddir)/gtk/gtk-query-immodules-3.0$(EXEEXT) $(module_LTLIBRARIES) > immodules.cache
|
||||
|
||||
if USE_WAYLAND
|
||||
BUILT_SOURCES = $(protocol_built_sources) $(protocol_built_sources_gtk)
|
||||
EXTRA_DIST += $(protocol_built_sources) $(protocol_built_sources_gtk)
|
||||
BUILT_SOURCES = $(protocol_built_sources)
|
||||
EXTRA_DIST += $(protocol_built_sources)
|
||||
endif
|
||||
|
||||
EXTRA_DIST += README.multipress
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2017 Red Hat, Inc.
|
||||
* Copyright (C) 2018 Purism SPC
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -26,7 +25,7 @@
|
||||
#include "gtk/gtkimmodule.h"
|
||||
|
||||
#include "gdk/wayland/gdkwayland.h"
|
||||
#include "text-input-unstable-v3-client-protocol.h"
|
||||
#include "gtk-text-input-client-protocol.h"
|
||||
|
||||
typedef struct _GtkIMContextWaylandGlobal GtkIMContextWaylandGlobal;
|
||||
typedef struct _GtkIMContextWayland GtkIMContextWayland;
|
||||
@@ -37,8 +36,9 @@ struct _GtkIMContextWaylandGlobal
|
||||
struct wl_display *display;
|
||||
struct wl_registry *registry;
|
||||
uint32_t text_input_manager_wl_id;
|
||||
struct zwp_text_input_manager_v3 *text_input_manager;
|
||||
struct zwp_text_input_v3 *text_input;
|
||||
struct gtk_text_input_manager *text_input_manager;
|
||||
struct gtk_text_input *text_input;
|
||||
uint32_t enter_serial;
|
||||
|
||||
GtkIMContext *current;
|
||||
};
|
||||
@@ -48,17 +48,6 @@ struct _GtkIMContextWaylandClass
|
||||
GtkIMContextSimpleClass parent_class;
|
||||
};
|
||||
|
||||
struct preedit {
|
||||
gchar *text;
|
||||
gint cursor_begin;
|
||||
gint cursor_end;
|
||||
};
|
||||
|
||||
struct surrounding_delete {
|
||||
guint before_length;
|
||||
guint after_length;
|
||||
};
|
||||
|
||||
struct _GtkIMContextWayland
|
||||
{
|
||||
GtkIMContextSimple parent_instance;
|
||||
@@ -72,19 +61,12 @@ struct _GtkIMContextWayland
|
||||
struct {
|
||||
gchar *text;
|
||||
gint cursor_idx;
|
||||
gint anchor_idx;
|
||||
} surrounding;
|
||||
|
||||
enum zwp_text_input_v3_change_cause surrounding_change;
|
||||
|
||||
guint serial;
|
||||
|
||||
struct surrounding_delete pending_surrounding_delete;
|
||||
|
||||
struct preedit current_preedit;
|
||||
struct preedit pending_preedit;
|
||||
|
||||
gchar *pending_commit;
|
||||
struct {
|
||||
gchar *text;
|
||||
gint cursor_idx;
|
||||
} preedit;
|
||||
|
||||
cairo_rectangle_int_t cursor_rect;
|
||||
guint use_preedit : 1;
|
||||
@@ -117,182 +99,102 @@ static const GtkIMContextInfo *info_list[] =
|
||||
#endif
|
||||
|
||||
static void
|
||||
notify_external_change (GtkIMContextWayland *context)
|
||||
reset_preedit (GtkIMContextWayland *context)
|
||||
{
|
||||
gboolean result;
|
||||
if (context->preedit.text == NULL)
|
||||
return;
|
||||
|
||||
context->surrounding_change = ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_OTHER;
|
||||
g_signal_emit_by_name (global->current, "retrieve-surrounding", &result);
|
||||
g_clear_pointer (&context->preedit.text, g_free);
|
||||
context->preedit.cursor_idx = 0;
|
||||
g_signal_emit_by_name (context, "preedit-changed");
|
||||
}
|
||||
|
||||
static void
|
||||
text_input_enter (void *data,
|
||||
struct zwp_text_input_v3 *text_input,
|
||||
struct gtk_text_input *text_input,
|
||||
uint32_t serial,
|
||||
struct wl_surface *surface)
|
||||
{}
|
||||
{
|
||||
GtkIMContextWaylandGlobal *global = data;
|
||||
|
||||
global->enter_serial = serial;
|
||||
}
|
||||
|
||||
static void
|
||||
text_input_leave (void *data,
|
||||
struct zwp_text_input_v3 *text_input,
|
||||
struct gtk_text_input *text_input,
|
||||
uint32_t serial,
|
||||
struct wl_surface *surface)
|
||||
{
|
||||
/*
|
||||
GtkIMContextWayland *context;
|
||||
|
||||
if (!global->current)
|
||||
return;
|
||||
|
||||
context = GTK_IM_CONTEXT_WAYLAND (global->current);
|
||||
TODO: does this clear text input or modify text?
|
||||
reset_preedit (context);
|
||||
*/
|
||||
}
|
||||
|
||||
static void
|
||||
text_input_preedit (void *data,
|
||||
struct zwp_text_input_v3 *text_input,
|
||||
struct gtk_text_input *text_input,
|
||||
const char *text,
|
||||
gint cursor_begin,
|
||||
gint cursor_end)
|
||||
{
|
||||
GtkIMContextWayland *context;
|
||||
GtkIMContextWaylandGlobal *global = data;
|
||||
|
||||
if (!global->current)
|
||||
return;
|
||||
|
||||
context = GTK_IM_CONTEXT_WAYLAND (global->current);
|
||||
|
||||
g_free (context->pending_preedit.text);
|
||||
context->pending_preedit.text = g_strdup (text);
|
||||
context->pending_preedit.cursor_begin = cursor_begin;
|
||||
context->pending_preedit.cursor_end = cursor_end;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
text_input_preedit_apply (GtkIMContextWaylandGlobal *global)
|
||||
guint cursor)
|
||||
{
|
||||
GtkIMContextWayland *context;
|
||||
gboolean state_change;
|
||||
struct preedit defaults = {0};
|
||||
|
||||
if (!global->current)
|
||||
return;
|
||||
|
||||
context = GTK_IM_CONTEXT_WAYLAND (global->current);
|
||||
if (!text && !context->preedit.text)
|
||||
return;
|
||||
|
||||
state_change = ((context->pending_preedit.text == NULL)
|
||||
!= (context->current_preedit.text == NULL));
|
||||
state_change = ((text == NULL) != (context->preedit.text == NULL));
|
||||
|
||||
if (state_change && !context->current_preedit.text)
|
||||
if (state_change && !context->preedit.text)
|
||||
g_signal_emit_by_name (context, "preedit-start");
|
||||
|
||||
g_free (context->current_preedit.text);
|
||||
context->current_preedit = context->pending_preedit;
|
||||
context->pending_preedit = defaults;
|
||||
g_free (context->preedit.text);
|
||||
context->preedit.text = g_strdup (text);
|
||||
context->preedit.cursor_idx = cursor;
|
||||
|
||||
g_signal_emit_by_name (context, "preedit-changed");
|
||||
|
||||
if (state_change && !context->current_preedit.text)
|
||||
if (state_change && !context->preedit.text)
|
||||
g_signal_emit_by_name (context, "preedit-end");
|
||||
}
|
||||
|
||||
static void
|
||||
text_input_commit (void *data,
|
||||
struct zwp_text_input_v3 *text_input,
|
||||
struct gtk_text_input *text_input,
|
||||
const char *text)
|
||||
{
|
||||
GtkIMContextWaylandGlobal *global = data;
|
||||
GtkIMContextWayland *context;
|
||||
|
||||
if (!global->current)
|
||||
return;
|
||||
|
||||
context = GTK_IM_CONTEXT_WAYLAND (global->current);
|
||||
|
||||
g_free (context->pending_commit);
|
||||
context->pending_commit = g_strdup (text);
|
||||
}
|
||||
|
||||
static void
|
||||
text_input_commit_apply (GtkIMContextWaylandGlobal *global, gboolean valid)
|
||||
{
|
||||
GtkIMContextWayland *context;
|
||||
context = GTK_IM_CONTEXT_WAYLAND (global->current);
|
||||
if (context->pending_commit && valid)
|
||||
g_signal_emit_by_name (global->current, "commit", context->pending_commit);
|
||||
g_free (context->pending_commit);
|
||||
context->pending_commit = NULL;
|
||||
if (global->current && text)
|
||||
g_signal_emit_by_name (global->current, "commit", text);
|
||||
}
|
||||
|
||||
static void
|
||||
text_input_delete_surrounding_text (void *data,
|
||||
struct zwp_text_input_v3 *text_input,
|
||||
uint32_t before_length,
|
||||
uint32_t after_length)
|
||||
struct gtk_text_input *text_input,
|
||||
uint32_t offset,
|
||||
uint32_t len)
|
||||
{
|
||||
GtkIMContextWaylandGlobal *global = data;
|
||||
GtkIMContextWayland *context;
|
||||
|
||||
if (!global->current)
|
||||
return;
|
||||
|
||||
context = GTK_IM_CONTEXT_WAYLAND (global->current);
|
||||
|
||||
context->pending_surrounding_delete.before_length = before_length;
|
||||
context->pending_surrounding_delete.after_length = after_length;
|
||||
if (global->current)
|
||||
g_signal_emit_by_name (global->current, "delete-surrounding", offset, len);
|
||||
}
|
||||
|
||||
static void
|
||||
text_input_delete_surrounding_text_apply (GtkIMContextWaylandGlobal *global,
|
||||
gboolean valid)
|
||||
{
|
||||
GtkIMContextWayland *context;
|
||||
|
||||
gint len;
|
||||
struct surrounding_delete defaults = {0};
|
||||
|
||||
context = GTK_IM_CONTEXT_WAYLAND (global->current);
|
||||
|
||||
len = context->pending_surrounding_delete.after_length
|
||||
+ context->pending_surrounding_delete.before_length;
|
||||
if (len > 0 && valid)
|
||||
g_signal_emit_by_name (global->current, "delete-surrounding",
|
||||
-context->pending_surrounding_delete.before_length,
|
||||
len);
|
||||
context->pending_surrounding_delete = defaults;
|
||||
}
|
||||
|
||||
static void
|
||||
text_input_done (void *data,
|
||||
struct zwp_text_input_v3 *text_input,
|
||||
uint32_t serial)
|
||||
{
|
||||
GtkIMContextWayland *context;
|
||||
GtkIMContextWaylandGlobal *global = data;
|
||||
gboolean result;
|
||||
gboolean valid;
|
||||
|
||||
if (!global->current)
|
||||
return;
|
||||
|
||||
context = GTK_IM_CONTEXT_WAYLAND (global->current);
|
||||
|
||||
valid = serial == context->serial;
|
||||
text_input_delete_surrounding_text_apply(global, valid);
|
||||
text_input_commit_apply(global, valid);
|
||||
g_signal_emit_by_name (global->current, "retrieve-surrounding", &result);
|
||||
text_input_preedit_apply(global);
|
||||
}
|
||||
|
||||
static const struct zwp_text_input_v3_listener text_input_listener = {
|
||||
static const struct gtk_text_input_listener text_input_listener = {
|
||||
text_input_enter,
|
||||
text_input_leave,
|
||||
text_input_preedit,
|
||||
text_input_commit,
|
||||
text_input_delete_surrounding_text,
|
||||
text_input_done,
|
||||
text_input_delete_surrounding_text
|
||||
};
|
||||
|
||||
static void
|
||||
@@ -305,17 +207,17 @@ registry_handle_global (void *data,
|
||||
GtkIMContextWaylandGlobal *global = data;
|
||||
GdkSeat *seat = gdk_display_get_default_seat (gdk_display_get_default ());
|
||||
|
||||
if (strcmp (interface, "zwp_text_input_manager_v3") == 0)
|
||||
if (strcmp (interface, "gtk_text_input_manager") == 0)
|
||||
{
|
||||
global->text_input_manager_wl_id = id;
|
||||
global->text_input_manager =
|
||||
wl_registry_bind (global->registry, global->text_input_manager_wl_id,
|
||||
&zwp_text_input_manager_v3_interface, 1);
|
||||
>k_text_input_manager_interface, 1);
|
||||
global->text_input =
|
||||
zwp_text_input_manager_v3_get_text_input (global->text_input_manager,
|
||||
gdk_wayland_seat_get_wl_seat (seat));
|
||||
zwp_text_input_v3_add_listener (global->text_input,
|
||||
&text_input_listener, global);
|
||||
gtk_text_input_manager_get_text_input (global->text_input_manager,
|
||||
gdk_wayland_seat_get_wl_seat (seat));
|
||||
gtk_text_input_add_listener (global->text_input,
|
||||
&text_input_listener, global);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,8 +231,8 @@ registry_handle_global_remove (void *data,
|
||||
if (id != global->text_input_manager_wl_id)
|
||||
return;
|
||||
|
||||
g_clear_pointer(&global->text_input, zwp_text_input_v3_destroy);
|
||||
g_clear_pointer(&global->text_input_manager, zwp_text_input_manager_v3_destroy);
|
||||
g_clear_pointer(&global->text_input, gtk_text_input_destroy);
|
||||
g_clear_pointer(&global->text_input_manager, gtk_text_input_manager_destroy);
|
||||
}
|
||||
|
||||
static const struct wl_registry_listener registry_listener = {
|
||||
@@ -360,12 +262,10 @@ notify_surrounding_text (GtkIMContextWayland *context)
|
||||
if (!context->surrounding.text)
|
||||
return;
|
||||
|
||||
zwp_text_input_v3_set_surrounding_text (global->text_input,
|
||||
context->surrounding.text,
|
||||
context->surrounding.cursor_idx,
|
||||
context->surrounding.anchor_idx);
|
||||
zwp_text_input_v3_set_text_change_cause (global->text_input,
|
||||
context->surrounding_change);
|
||||
gtk_text_input_set_surrounding_text (global->text_input,
|
||||
context->surrounding.text,
|
||||
context->surrounding.cursor_idx,
|
||||
context->surrounding.cursor_idx);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -384,9 +284,9 @@ notify_cursor_location (GtkIMContextWayland *context)
|
||||
gdk_window_get_root_coords (context->window, rect.x, rect.y,
|
||||
&rect.x, &rect.y);
|
||||
|
||||
zwp_text_input_v3_set_cursor_rectangle (global->text_input,
|
||||
rect.x, rect.y,
|
||||
rect.width, rect.height);
|
||||
gtk_text_input_set_cursor_rectangle (global->text_input,
|
||||
rect.x, rect.y,
|
||||
rect.width, rect.height);
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
@@ -396,23 +296,23 @@ translate_hints (GtkInputHints input_hints,
|
||||
uint32_t hints = 0;
|
||||
|
||||
if (input_hints & GTK_INPUT_HINT_SPELLCHECK)
|
||||
hints |= ZWP_TEXT_INPUT_V3_CONTENT_HINT_SPELLCHECK;
|
||||
hints |= GTK_TEXT_INPUT_CONTENT_HINT_SPELLCHECK;
|
||||
if (input_hints & GTK_INPUT_HINT_WORD_COMPLETION)
|
||||
hints |= ZWP_TEXT_INPUT_V3_CONTENT_HINT_COMPLETION;
|
||||
hints |= GTK_TEXT_INPUT_CONTENT_HINT_COMPLETION;
|
||||
if (input_hints & GTK_INPUT_HINT_LOWERCASE)
|
||||
hints |= ZWP_TEXT_INPUT_V3_CONTENT_HINT_LOWERCASE;
|
||||
hints |= GTK_TEXT_INPUT_CONTENT_HINT_LOWERCASE;
|
||||
if (input_hints & GTK_INPUT_HINT_UPPERCASE_CHARS)
|
||||
hints |= ZWP_TEXT_INPUT_V3_CONTENT_HINT_UPPERCASE;
|
||||
hints |= GTK_TEXT_INPUT_CONTENT_HINT_UPPERCASE;
|
||||
if (input_hints & GTK_INPUT_HINT_UPPERCASE_WORDS)
|
||||
hints |= ZWP_TEXT_INPUT_V3_CONTENT_HINT_TITLECASE;
|
||||
hints |= GTK_TEXT_INPUT_CONTENT_HINT_TITLECASE;
|
||||
if (input_hints & GTK_INPUT_HINT_UPPERCASE_SENTENCES)
|
||||
hints |= ZWP_TEXT_INPUT_V3_CONTENT_HINT_AUTO_CAPITALIZATION;
|
||||
hints |= GTK_TEXT_INPUT_CONTENT_HINT_AUTO_CAPITALIZATION;
|
||||
|
||||
if (purpose == GTK_INPUT_PURPOSE_PIN ||
|
||||
purpose == GTK_INPUT_PURPOSE_PASSWORD)
|
||||
{
|
||||
hints |= (ZWP_TEXT_INPUT_V3_CONTENT_HINT_HIDDEN_TEXT |
|
||||
ZWP_TEXT_INPUT_V3_CONTENT_HINT_SENSITIVE_DATA);
|
||||
hints |= (GTK_TEXT_INPUT_CONTENT_HINT_HIDDEN_TEXT |
|
||||
GTK_TEXT_INPUT_CONTENT_HINT_SENSITIVE_DATA);
|
||||
}
|
||||
|
||||
return hints;
|
||||
@@ -424,28 +324,28 @@ translate_purpose (GtkInputPurpose purpose)
|
||||
switch (purpose)
|
||||
{
|
||||
case GTK_INPUT_PURPOSE_FREE_FORM:
|
||||
return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NORMAL;
|
||||
return GTK_TEXT_INPUT_CONTENT_PURPOSE_NORMAL;
|
||||
case GTK_INPUT_PURPOSE_ALPHA:
|
||||
return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_ALPHA;
|
||||
return GTK_TEXT_INPUT_CONTENT_PURPOSE_ALPHA;
|
||||
case GTK_INPUT_PURPOSE_DIGITS:
|
||||
return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_DIGITS;
|
||||
return GTK_TEXT_INPUT_CONTENT_PURPOSE_DIGITS;
|
||||
case GTK_INPUT_PURPOSE_NUMBER:
|
||||
return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NUMBER;
|
||||
return GTK_TEXT_INPUT_CONTENT_PURPOSE_NUMBER;
|
||||
case GTK_INPUT_PURPOSE_PHONE:
|
||||
return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_PHONE;
|
||||
return GTK_TEXT_INPUT_CONTENT_PURPOSE_PHONE;
|
||||
case GTK_INPUT_PURPOSE_URL:
|
||||
return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_URL;
|
||||
return GTK_TEXT_INPUT_CONTENT_PURPOSE_URL;
|
||||
case GTK_INPUT_PURPOSE_EMAIL:
|
||||
return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_EMAIL;
|
||||
return GTK_TEXT_INPUT_CONTENT_PURPOSE_EMAIL;
|
||||
case GTK_INPUT_PURPOSE_NAME:
|
||||
return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NAME;
|
||||
return GTK_TEXT_INPUT_CONTENT_PURPOSE_NAME;
|
||||
case GTK_INPUT_PURPOSE_PASSWORD:
|
||||
return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_PASSWORD;
|
||||
return GTK_TEXT_INPUT_CONTENT_PURPOSE_PASSWORD;
|
||||
case GTK_INPUT_PURPOSE_PIN:
|
||||
return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_PIN;
|
||||
return GTK_TEXT_INPUT_CONTENT_PURPOSE_PIN;
|
||||
}
|
||||
|
||||
return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NORMAL;
|
||||
return GTK_TEXT_INPUT_CONTENT_PURPOSE_NORMAL;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -462,9 +362,9 @@ notify_content_type (GtkIMContextWayland *context)
|
||||
"input-purpose", &purpose,
|
||||
NULL);
|
||||
|
||||
zwp_text_input_v3_set_content_type (global->text_input,
|
||||
translate_hints (hints, purpose),
|
||||
translate_purpose (purpose));
|
||||
gtk_text_input_set_content_type (global->text_input,
|
||||
translate_hints (hints, purpose),
|
||||
translate_purpose (purpose));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -472,15 +372,23 @@ commit_state (GtkIMContextWayland *context)
|
||||
{
|
||||
if (global->current != GTK_IM_CONTEXT (context))
|
||||
return;
|
||||
context->serial++;
|
||||
zwp_text_input_v3_commit (global->text_input);
|
||||
context->surrounding_change = ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_INPUT_METHOD;
|
||||
gtk_text_input_commit (global->text_input);
|
||||
}
|
||||
|
||||
static void
|
||||
enable_text_input (GtkIMContextWayland *context)
|
||||
enable_text_input (GtkIMContextWayland *context,
|
||||
gboolean toggle_panel)
|
||||
{
|
||||
zwp_text_input_v3_enable (global->text_input);
|
||||
guint flags = 0;
|
||||
|
||||
if (context->use_preedit)
|
||||
flags |= GTK_TEXT_INPUT_ENABLE_FLAGS_CAN_SHOW_PREEDIT;
|
||||
if (toggle_panel)
|
||||
flags |= GTK_TEXT_INPUT_ENABLE_FLAGS_TOGGLE_INPUT_PANEL;
|
||||
|
||||
gtk_text_input_enable (global->text_input,
|
||||
global->enter_serial,
|
||||
flags);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -516,7 +424,6 @@ released_cb (GtkGestureMultiPress *gesture,
|
||||
GtkIMContextWayland *context)
|
||||
{
|
||||
GtkInputHints hints;
|
||||
gboolean result;
|
||||
|
||||
if (!global->current)
|
||||
return;
|
||||
@@ -530,9 +437,7 @@ released_cb (GtkGestureMultiPress *gesture,
|
||||
context->press_y,
|
||||
x, y))
|
||||
{
|
||||
enable_text_input (GTK_IM_CONTEXT_WAYLAND (context));
|
||||
g_signal_emit_by_name (global->current, "retrieve-surrounding", &result);
|
||||
commit_state (context);
|
||||
enable_text_input (GTK_IM_CONTEXT_WAYLAND (context), TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -583,12 +488,7 @@ gtk_im_context_wayland_get_preedit_string (GtkIMContext *context,
|
||||
GtkIMContextWayland *context_wayland = GTK_IM_CONTEXT_WAYLAND (context);
|
||||
gchar *preedit_str;
|
||||
|
||||
if (attrs)
|
||||
*attrs = NULL;
|
||||
|
||||
GTK_IM_CONTEXT_CLASS (parent_class)->get_preedit_string (context,
|
||||
str, attrs,
|
||||
cursor_pos);
|
||||
GTK_IM_CONTEXT_CLASS (parent_class)->get_preedit_string (context, str, attrs, cursor_pos);
|
||||
|
||||
/* If the parent implementation returns a len>0 string, go with it */
|
||||
if (str && *str)
|
||||
@@ -600,28 +500,18 @@ gtk_im_context_wayland_get_preedit_string (GtkIMContext *context,
|
||||
}
|
||||
|
||||
preedit_str =
|
||||
context_wayland->current_preedit.text ? context_wayland->current_preedit.text : "";
|
||||
context_wayland->preedit.text ? context_wayland->preedit.text : "";
|
||||
|
||||
if (str)
|
||||
*str = g_strdup (preedit_str);
|
||||
if (cursor_pos)
|
||||
*cursor_pos = context_wayland->current_preedit.cursor_begin;
|
||||
*cursor_pos = context_wayland->preedit.cursor_idx;
|
||||
|
||||
if (attrs)
|
||||
{
|
||||
if (!*attrs)
|
||||
*attrs = pango_attr_list_new ();
|
||||
*attrs = pango_attr_list_new ();
|
||||
pango_attr_list_insert (*attrs,
|
||||
pango_attr_underline_new (PANGO_UNDERLINE_SINGLE));
|
||||
if (context_wayland->current_preedit.cursor_begin
|
||||
!= context_wayland->current_preedit.cursor_end)
|
||||
{
|
||||
/* FIXME: Oh noes, how to highlight while taking into account user preferences? */
|
||||
PangoAttribute *cursor = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
|
||||
cursor->start_index = context_wayland->current_preedit.cursor_begin;
|
||||
cursor->end_index = context_wayland->current_preedit.cursor_end;
|
||||
pango_attr_list_insert (*attrs, cursor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -637,7 +527,6 @@ static void
|
||||
gtk_im_context_wayland_focus_in (GtkIMContext *context)
|
||||
{
|
||||
GtkIMContextWayland *context_wayland = GTK_IM_CONTEXT_WAYLAND (context);
|
||||
gboolean result;
|
||||
|
||||
if (global->current == context)
|
||||
return;
|
||||
@@ -645,9 +534,9 @@ gtk_im_context_wayland_focus_in (GtkIMContext *context)
|
||||
return;
|
||||
|
||||
global->current = context;
|
||||
enable_text_input (context_wayland);
|
||||
g_signal_emit_by_name (global->current, "retrieve-surrounding", &result);
|
||||
enable_text_input (context_wayland, FALSE);
|
||||
notify_content_type (context_wayland);
|
||||
notify_surrounding_text (context_wayland);
|
||||
notify_cursor_location (context_wayland);
|
||||
commit_state (context_wayland);
|
||||
}
|
||||
@@ -655,22 +544,17 @@ gtk_im_context_wayland_focus_in (GtkIMContext *context)
|
||||
static void
|
||||
gtk_im_context_wayland_focus_out (GtkIMContext *context)
|
||||
{
|
||||
GtkIMContextWayland *context_wayland;
|
||||
|
||||
if (global->current != context)
|
||||
return;
|
||||
|
||||
context_wayland = GTK_IM_CONTEXT_WAYLAND (context);
|
||||
|
||||
zwp_text_input_v3_disable (global->text_input);
|
||||
commit_state (context_wayland);
|
||||
gtk_text_input_disable (global->text_input);
|
||||
global->current = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_im_context_wayland_reset (GtkIMContext *context)
|
||||
{
|
||||
notify_external_change (GTK_IM_CONTEXT_WAYLAND (context));
|
||||
reset_preedit (GTK_IM_CONTEXT_WAYLAND (context));
|
||||
|
||||
GTK_IM_CONTEXT_CLASS (parent_class)->reset (context);
|
||||
}
|
||||
@@ -710,15 +594,9 @@ gtk_im_context_wayland_set_surrounding (GtkIMContext *context,
|
||||
g_free (context_wayland->surrounding.text);
|
||||
context_wayland->surrounding.text = g_strdup (text);
|
||||
context_wayland->surrounding.cursor_idx = cursor_index;
|
||||
/* Anchor is not exposed via the set_surrounding interface, emulating. */
|
||||
context_wayland->surrounding.anchor_idx = cursor_index;
|
||||
|
||||
notify_surrounding_text (context_wayland);
|
||||
/* State changes coming from reset don't have any other opportunity to get
|
||||
* committed. */
|
||||
if (context_wayland->surrounding_change !=
|
||||
ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_INPUT_METHOD)
|
||||
commit_state (context_wayland);
|
||||
commit_state (context_wayland);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
||||
@@ -1,703 +0,0 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2017 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <wayland-client-protocol.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "gtk/gtkintl.h"
|
||||
#include "gtk/gtkimmodule.h"
|
||||
|
||||
#include "gdk/wayland/gdkwayland.h"
|
||||
#include "gtk-text-input-client-protocol.h"
|
||||
|
||||
typedef struct _GtkIMContextWaylandGlobal GtkIMContextWaylandGlobal;
|
||||
typedef struct _GtkIMContextWayland GtkIMContextWayland;
|
||||
typedef struct _GtkIMContextWaylandClass GtkIMContextWaylandClass;
|
||||
|
||||
struct _GtkIMContextWaylandGlobal
|
||||
{
|
||||
struct wl_display *display;
|
||||
struct wl_registry *registry;
|
||||
uint32_t text_input_manager_wl_id;
|
||||
struct gtk_text_input_manager *text_input_manager;
|
||||
struct gtk_text_input *text_input;
|
||||
uint32_t enter_serial;
|
||||
|
||||
GtkIMContext *current;
|
||||
};
|
||||
|
||||
struct _GtkIMContextWaylandClass
|
||||
{
|
||||
GtkIMContextSimpleClass parent_class;
|
||||
};
|
||||
|
||||
struct _GtkIMContextWayland
|
||||
{
|
||||
GtkIMContextSimple parent_instance;
|
||||
GdkWindow *window;
|
||||
GtkWidget *widget;
|
||||
|
||||
GtkGesture *gesture;
|
||||
gdouble press_x;
|
||||
gdouble press_y;
|
||||
|
||||
struct {
|
||||
gchar *text;
|
||||
gint cursor_idx;
|
||||
} surrounding;
|
||||
|
||||
struct {
|
||||
gchar *text;
|
||||
gint cursor_idx;
|
||||
} preedit;
|
||||
|
||||
cairo_rectangle_int_t cursor_rect;
|
||||
guint use_preedit : 1;
|
||||
};
|
||||
|
||||
GType type_wayland = 0;
|
||||
static GObjectClass *parent_class;
|
||||
static GtkIMContextWaylandGlobal *global = NULL;
|
||||
|
||||
static const GtkIMContextInfo imwayland_info =
|
||||
{
|
||||
"waylandgtk", /* ID */
|
||||
NC_("input method menu", "Waylandgtk"), /* Human readable name */
|
||||
GETTEXT_PACKAGE, /* Translation domain */
|
||||
GTK_LOCALEDIR, /* Dir for bindtextdomain (not strictly needed for "gtk+") */
|
||||
"", /* Languages for which this module is the default */
|
||||
};
|
||||
|
||||
static const GtkIMContextInfo *info_list[] =
|
||||
{
|
||||
&imwayland_info,
|
||||
};
|
||||
|
||||
#define GTK_IM_CONTEXT_WAYLAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), type_wayland, GtkIMContextWayland))
|
||||
|
||||
#ifndef INCLUDE_IM_wayland
|
||||
#define MODULE_ENTRY(type,function) G_MODULE_EXPORT type im_module_ ## function
|
||||
#else
|
||||
#define MODULE_ENTRY(type, function) type _gtk_immodule_wayland_ ## function
|
||||
#endif
|
||||
|
||||
static void
|
||||
reset_preedit (GtkIMContextWayland *context)
|
||||
{
|
||||
if (context->preedit.text == NULL)
|
||||
return;
|
||||
|
||||
g_clear_pointer (&context->preedit.text, g_free);
|
||||
context->preedit.cursor_idx = 0;
|
||||
g_signal_emit_by_name (context, "preedit-changed");
|
||||
}
|
||||
|
||||
static void
|
||||
text_input_enter (void *data,
|
||||
struct gtk_text_input *text_input,
|
||||
uint32_t serial,
|
||||
struct wl_surface *surface)
|
||||
{
|
||||
GtkIMContextWaylandGlobal *global = data;
|
||||
|
||||
global->enter_serial = serial;
|
||||
}
|
||||
|
||||
static void
|
||||
text_input_leave (void *data,
|
||||
struct gtk_text_input *text_input,
|
||||
uint32_t serial,
|
||||
struct wl_surface *surface)
|
||||
{
|
||||
GtkIMContextWayland *context;
|
||||
|
||||
if (!global->current)
|
||||
return;
|
||||
|
||||
context = GTK_IM_CONTEXT_WAYLAND (global->current);
|
||||
reset_preedit (context);
|
||||
}
|
||||
|
||||
static void
|
||||
text_input_preedit (void *data,
|
||||
struct gtk_text_input *text_input,
|
||||
const char *text,
|
||||
guint cursor)
|
||||
{
|
||||
GtkIMContextWayland *context;
|
||||
gboolean state_change;
|
||||
|
||||
if (!global->current)
|
||||
return;
|
||||
|
||||
context = GTK_IM_CONTEXT_WAYLAND (global->current);
|
||||
if (!text && !context->preedit.text)
|
||||
return;
|
||||
|
||||
state_change = ((text == NULL) != (context->preedit.text == NULL));
|
||||
|
||||
if (state_change && !context->preedit.text)
|
||||
g_signal_emit_by_name (context, "preedit-start");
|
||||
|
||||
g_free (context->preedit.text);
|
||||
context->preedit.text = g_strdup (text);
|
||||
context->preedit.cursor_idx = cursor;
|
||||
|
||||
g_signal_emit_by_name (context, "preedit-changed");
|
||||
|
||||
if (state_change && !context->preedit.text)
|
||||
g_signal_emit_by_name (context, "preedit-end");
|
||||
}
|
||||
|
||||
static void
|
||||
text_input_commit (void *data,
|
||||
struct gtk_text_input *text_input,
|
||||
const char *text)
|
||||
{
|
||||
GtkIMContextWaylandGlobal *global = data;
|
||||
|
||||
if (global->current && text)
|
||||
g_signal_emit_by_name (global->current, "commit", text);
|
||||
}
|
||||
|
||||
static void
|
||||
text_input_delete_surrounding_text (void *data,
|
||||
struct gtk_text_input *text_input,
|
||||
uint32_t offset,
|
||||
uint32_t len)
|
||||
{
|
||||
GtkIMContextWaylandGlobal *global = data;
|
||||
|
||||
if (global->current)
|
||||
g_signal_emit_by_name (global->current, "delete-surrounding", offset, len);
|
||||
}
|
||||
|
||||
static const struct gtk_text_input_listener text_input_listener = {
|
||||
text_input_enter,
|
||||
text_input_leave,
|
||||
text_input_preedit,
|
||||
text_input_commit,
|
||||
text_input_delete_surrounding_text
|
||||
};
|
||||
|
||||
static void
|
||||
registry_handle_global (void *data,
|
||||
struct wl_registry *registry,
|
||||
uint32_t id,
|
||||
const char *interface,
|
||||
uint32_t version)
|
||||
{
|
||||
GtkIMContextWaylandGlobal *global = data;
|
||||
GdkSeat *seat = gdk_display_get_default_seat (gdk_display_get_default ());
|
||||
|
||||
if (strcmp (interface, "gtk_text_input_manager") == 0)
|
||||
{
|
||||
global->text_input_manager_wl_id = id;
|
||||
global->text_input_manager =
|
||||
wl_registry_bind (global->registry, global->text_input_manager_wl_id,
|
||||
>k_text_input_manager_interface, 1);
|
||||
global->text_input =
|
||||
gtk_text_input_manager_get_text_input (global->text_input_manager,
|
||||
gdk_wayland_seat_get_wl_seat (seat));
|
||||
gtk_text_input_add_listener (global->text_input,
|
||||
&text_input_listener, global);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
registry_handle_global_remove (void *data,
|
||||
struct wl_registry *registry,
|
||||
uint32_t id)
|
||||
{
|
||||
GtkIMContextWaylandGlobal *global = data;
|
||||
|
||||
if (id != global->text_input_manager_wl_id)
|
||||
return;
|
||||
|
||||
g_clear_pointer(&global->text_input, gtk_text_input_destroy);
|
||||
g_clear_pointer(&global->text_input_manager, gtk_text_input_manager_destroy);
|
||||
}
|
||||
|
||||
static const struct wl_registry_listener registry_listener = {
|
||||
registry_handle_global,
|
||||
registry_handle_global_remove
|
||||
};
|
||||
|
||||
static void
|
||||
gtk_im_context_wayland_global_init (GdkDisplay *display)
|
||||
{
|
||||
g_return_if_fail (global == NULL);
|
||||
|
||||
global = g_new0 (GtkIMContextWaylandGlobal, 1);
|
||||
global->display = gdk_wayland_display_get_wl_display (display);
|
||||
global->registry = wl_display_get_registry (global->display);
|
||||
|
||||
wl_registry_add_listener (global->registry, ®istry_listener, global);
|
||||
}
|
||||
|
||||
static void
|
||||
notify_surrounding_text (GtkIMContextWayland *context)
|
||||
{
|
||||
if (!global || !global->text_input)
|
||||
return;
|
||||
if (global->current != GTK_IM_CONTEXT (context))
|
||||
return;
|
||||
if (!context->surrounding.text)
|
||||
return;
|
||||
|
||||
gtk_text_input_set_surrounding_text (global->text_input,
|
||||
context->surrounding.text,
|
||||
context->surrounding.cursor_idx,
|
||||
context->surrounding.cursor_idx);
|
||||
}
|
||||
|
||||
static void
|
||||
notify_cursor_location (GtkIMContextWayland *context)
|
||||
{
|
||||
cairo_rectangle_int_t rect;
|
||||
|
||||
if (!global || !global->text_input)
|
||||
return;
|
||||
if (global->current != GTK_IM_CONTEXT (context))
|
||||
return;
|
||||
if (!context->window)
|
||||
return;
|
||||
|
||||
rect = context->cursor_rect;
|
||||
gdk_window_get_root_coords (context->window, rect.x, rect.y,
|
||||
&rect.x, &rect.y);
|
||||
|
||||
gtk_text_input_set_cursor_rectangle (global->text_input,
|
||||
rect.x, rect.y,
|
||||
rect.width, rect.height);
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
translate_hints (GtkInputHints input_hints,
|
||||
GtkInputPurpose purpose)
|
||||
{
|
||||
uint32_t hints = 0;
|
||||
|
||||
if (input_hints & GTK_INPUT_HINT_SPELLCHECK)
|
||||
hints |= GTK_TEXT_INPUT_CONTENT_HINT_SPELLCHECK;
|
||||
if (input_hints & GTK_INPUT_HINT_WORD_COMPLETION)
|
||||
hints |= GTK_TEXT_INPUT_CONTENT_HINT_COMPLETION;
|
||||
if (input_hints & GTK_INPUT_HINT_LOWERCASE)
|
||||
hints |= GTK_TEXT_INPUT_CONTENT_HINT_LOWERCASE;
|
||||
if (input_hints & GTK_INPUT_HINT_UPPERCASE_CHARS)
|
||||
hints |= GTK_TEXT_INPUT_CONTENT_HINT_UPPERCASE;
|
||||
if (input_hints & GTK_INPUT_HINT_UPPERCASE_WORDS)
|
||||
hints |= GTK_TEXT_INPUT_CONTENT_HINT_TITLECASE;
|
||||
if (input_hints & GTK_INPUT_HINT_UPPERCASE_SENTENCES)
|
||||
hints |= GTK_TEXT_INPUT_CONTENT_HINT_AUTO_CAPITALIZATION;
|
||||
|
||||
if (purpose == GTK_INPUT_PURPOSE_PIN ||
|
||||
purpose == GTK_INPUT_PURPOSE_PASSWORD)
|
||||
{
|
||||
hints |= (GTK_TEXT_INPUT_CONTENT_HINT_HIDDEN_TEXT |
|
||||
GTK_TEXT_INPUT_CONTENT_HINT_SENSITIVE_DATA);
|
||||
}
|
||||
|
||||
return hints;
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
translate_purpose (GtkInputPurpose purpose)
|
||||
{
|
||||
switch (purpose)
|
||||
{
|
||||
case GTK_INPUT_PURPOSE_FREE_FORM:
|
||||
return GTK_TEXT_INPUT_CONTENT_PURPOSE_NORMAL;
|
||||
case GTK_INPUT_PURPOSE_ALPHA:
|
||||
return GTK_TEXT_INPUT_CONTENT_PURPOSE_ALPHA;
|
||||
case GTK_INPUT_PURPOSE_DIGITS:
|
||||
return GTK_TEXT_INPUT_CONTENT_PURPOSE_DIGITS;
|
||||
case GTK_INPUT_PURPOSE_NUMBER:
|
||||
return GTK_TEXT_INPUT_CONTENT_PURPOSE_NUMBER;
|
||||
case GTK_INPUT_PURPOSE_PHONE:
|
||||
return GTK_TEXT_INPUT_CONTENT_PURPOSE_PHONE;
|
||||
case GTK_INPUT_PURPOSE_URL:
|
||||
return GTK_TEXT_INPUT_CONTENT_PURPOSE_URL;
|
||||
case GTK_INPUT_PURPOSE_EMAIL:
|
||||
return GTK_TEXT_INPUT_CONTENT_PURPOSE_EMAIL;
|
||||
case GTK_INPUT_PURPOSE_NAME:
|
||||
return GTK_TEXT_INPUT_CONTENT_PURPOSE_NAME;
|
||||
case GTK_INPUT_PURPOSE_PASSWORD:
|
||||
return GTK_TEXT_INPUT_CONTENT_PURPOSE_PASSWORD;
|
||||
case GTK_INPUT_PURPOSE_PIN:
|
||||
return GTK_TEXT_INPUT_CONTENT_PURPOSE_PIN;
|
||||
}
|
||||
|
||||
return GTK_TEXT_INPUT_CONTENT_PURPOSE_NORMAL;
|
||||
}
|
||||
|
||||
static void
|
||||
notify_content_type (GtkIMContextWayland *context)
|
||||
{
|
||||
GtkInputHints hints;
|
||||
GtkInputPurpose purpose;
|
||||
|
||||
if (global->current != GTK_IM_CONTEXT (context))
|
||||
return;
|
||||
|
||||
g_object_get (context,
|
||||
"input-hints", &hints,
|
||||
"input-purpose", &purpose,
|
||||
NULL);
|
||||
|
||||
gtk_text_input_set_content_type (global->text_input,
|
||||
translate_hints (hints, purpose),
|
||||
translate_purpose (purpose));
|
||||
}
|
||||
|
||||
static void
|
||||
commit_state (GtkIMContextWayland *context)
|
||||
{
|
||||
if (global->current != GTK_IM_CONTEXT (context))
|
||||
return;
|
||||
gtk_text_input_commit (global->text_input);
|
||||
}
|
||||
|
||||
static void
|
||||
enable_text_input (GtkIMContextWayland *context,
|
||||
gboolean toggle_panel)
|
||||
{
|
||||
guint flags = 0;
|
||||
|
||||
if (context->use_preedit)
|
||||
flags |= GTK_TEXT_INPUT_ENABLE_FLAGS_CAN_SHOW_PREEDIT;
|
||||
if (toggle_panel)
|
||||
flags |= GTK_TEXT_INPUT_ENABLE_FLAGS_TOGGLE_INPUT_PANEL;
|
||||
|
||||
gtk_text_input_enable (global->text_input,
|
||||
global->enter_serial,
|
||||
flags);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_im_context_wayland_finalize (GObject *object)
|
||||
{
|
||||
GtkIMContextWayland *context = GTK_IM_CONTEXT_WAYLAND (object);
|
||||
|
||||
g_clear_object (&context->window);
|
||||
g_clear_object (&context->gesture);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
pressed_cb (GtkGestureMultiPress *gesture,
|
||||
gint n_press,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
GtkIMContextWayland *context)
|
||||
{
|
||||
if (n_press == 1)
|
||||
{
|
||||
context->press_x = x;
|
||||
context->press_y = y;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
released_cb (GtkGestureMultiPress *gesture,
|
||||
gint n_press,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
GtkIMContextWayland *context)
|
||||
{
|
||||
GtkInputHints hints;
|
||||
|
||||
if (!global->current)
|
||||
return;
|
||||
|
||||
g_object_get (context, "input-hints", &hints, NULL);
|
||||
|
||||
if (n_press == 1 &&
|
||||
(hints & GTK_INPUT_HINT_INHIBIT_OSK) == 0 &&
|
||||
!gtk_drag_check_threshold (context->widget,
|
||||
context->press_x,
|
||||
context->press_y,
|
||||
x, y))
|
||||
{
|
||||
enable_text_input (GTK_IM_CONTEXT_WAYLAND (context), TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_im_context_wayland_set_client_window (GtkIMContext *context,
|
||||
GdkWindow *window)
|
||||
{
|
||||
GtkIMContextWayland *context_wayland = GTK_IM_CONTEXT_WAYLAND (context);
|
||||
GtkWidget *widget = NULL;
|
||||
|
||||
if (window == context_wayland->window)
|
||||
return;
|
||||
|
||||
if (window)
|
||||
gdk_window_get_user_data (window, (gpointer*) &widget);
|
||||
|
||||
if (context_wayland->widget && context_wayland->widget != widget)
|
||||
g_clear_object (&context_wayland->gesture);
|
||||
|
||||
g_set_object (&context_wayland->window, window);
|
||||
|
||||
if (context_wayland->widget != widget)
|
||||
{
|
||||
context_wayland->widget = widget;
|
||||
|
||||
if (widget)
|
||||
{
|
||||
GtkGesture *gesture;
|
||||
|
||||
gesture = gtk_gesture_multi_press_new (widget);
|
||||
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture),
|
||||
GTK_PHASE_CAPTURE);
|
||||
g_signal_connect (gesture, "pressed",
|
||||
G_CALLBACK (pressed_cb), context);
|
||||
g_signal_connect (gesture, "released",
|
||||
G_CALLBACK (released_cb), context);
|
||||
context_wayland->gesture = gesture;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_im_context_wayland_get_preedit_string (GtkIMContext *context,
|
||||
gchar **str,
|
||||
PangoAttrList **attrs,
|
||||
gint *cursor_pos)
|
||||
{
|
||||
GtkIMContextWayland *context_wayland = GTK_IM_CONTEXT_WAYLAND (context);
|
||||
gchar *preedit_str;
|
||||
|
||||
if (attrs)
|
||||
*attrs = NULL;
|
||||
|
||||
GTK_IM_CONTEXT_CLASS (parent_class)->get_preedit_string (context, str, attrs, cursor_pos);
|
||||
|
||||
/* If the parent implementation returns a len>0 string, go with it */
|
||||
if (str && *str)
|
||||
{
|
||||
if (**str)
|
||||
return;
|
||||
|
||||
g_free (*str);
|
||||
}
|
||||
|
||||
preedit_str =
|
||||
context_wayland->preedit.text ? context_wayland->preedit.text : "";
|
||||
|
||||
if (str)
|
||||
*str = g_strdup (preedit_str);
|
||||
if (cursor_pos)
|
||||
*cursor_pos = context_wayland->preedit.cursor_idx;
|
||||
|
||||
if (attrs)
|
||||
{
|
||||
if (!*attrs)
|
||||
*attrs = pango_attr_list_new ();
|
||||
pango_attr_list_insert (*attrs,
|
||||
pango_attr_underline_new (PANGO_UNDERLINE_SINGLE));
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_im_context_wayland_filter_keypress (GtkIMContext *context,
|
||||
GdkEventKey *key)
|
||||
{
|
||||
/* This is done by the compositor */
|
||||
return GTK_IM_CONTEXT_CLASS (parent_class)->filter_keypress (context, key);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_im_context_wayland_focus_in (GtkIMContext *context)
|
||||
{
|
||||
GtkIMContextWayland *context_wayland = GTK_IM_CONTEXT_WAYLAND (context);
|
||||
|
||||
if (global->current == context)
|
||||
return;
|
||||
if (!global->text_input)
|
||||
return;
|
||||
|
||||
global->current = context;
|
||||
enable_text_input (context_wayland, FALSE);
|
||||
notify_content_type (context_wayland);
|
||||
notify_surrounding_text (context_wayland);
|
||||
notify_cursor_location (context_wayland);
|
||||
commit_state (context_wayland);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_im_context_wayland_focus_out (GtkIMContext *context)
|
||||
{
|
||||
if (global->current != context)
|
||||
return;
|
||||
|
||||
gtk_text_input_disable (global->text_input);
|
||||
global->current = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_im_context_wayland_reset (GtkIMContext *context)
|
||||
{
|
||||
reset_preedit (GTK_IM_CONTEXT_WAYLAND (context));
|
||||
|
||||
GTK_IM_CONTEXT_CLASS (parent_class)->reset (context);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_im_context_wayland_set_cursor_location (GtkIMContext *context,
|
||||
GdkRectangle *rect)
|
||||
{
|
||||
GtkIMContextWayland *context_wayland;
|
||||
|
||||
context_wayland = GTK_IM_CONTEXT_WAYLAND (context);
|
||||
|
||||
context_wayland->cursor_rect = *rect;
|
||||
notify_cursor_location (context_wayland);
|
||||
commit_state (context_wayland);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_im_context_wayland_set_use_preedit (GtkIMContext *context,
|
||||
gboolean use_preedit)
|
||||
{
|
||||
GtkIMContextWayland *context_wayland = GTK_IM_CONTEXT_WAYLAND (context);
|
||||
|
||||
context_wayland->use_preedit = !!use_preedit;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_im_context_wayland_set_surrounding (GtkIMContext *context,
|
||||
const gchar *text,
|
||||
gint len,
|
||||
gint cursor_index)
|
||||
{
|
||||
GtkIMContextWayland *context_wayland;
|
||||
|
||||
context_wayland = GTK_IM_CONTEXT_WAYLAND (context);
|
||||
|
||||
g_free (context_wayland->surrounding.text);
|
||||
context_wayland->surrounding.text = g_strdup (text);
|
||||
context_wayland->surrounding.cursor_idx = cursor_index;
|
||||
|
||||
notify_surrounding_text (context_wayland);
|
||||
commit_state (context_wayland);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_im_context_wayland_get_surrounding (GtkIMContext *context,
|
||||
gchar **text,
|
||||
gint *cursor_index)
|
||||
{
|
||||
GtkIMContextWayland *context_wayland;
|
||||
|
||||
context_wayland = GTK_IM_CONTEXT_WAYLAND (context);
|
||||
|
||||
if (!context_wayland->surrounding.text)
|
||||
return FALSE;
|
||||
|
||||
*text = context_wayland->surrounding.text;
|
||||
*cursor_index = context_wayland->surrounding.cursor_idx;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_im_context_wayland_class_init (GtkIMContextWaylandClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GtkIMContextClass *im_context_class = GTK_IM_CONTEXT_CLASS (klass);
|
||||
|
||||
object_class->finalize = gtk_im_context_wayland_finalize;
|
||||
|
||||
im_context_class->set_client_window = gtk_im_context_wayland_set_client_window;
|
||||
im_context_class->get_preedit_string = gtk_im_context_wayland_get_preedit_string;
|
||||
im_context_class->filter_keypress = gtk_im_context_wayland_filter_keypress;
|
||||
im_context_class->focus_in = gtk_im_context_wayland_focus_in;
|
||||
im_context_class->focus_out = gtk_im_context_wayland_focus_out;
|
||||
im_context_class->reset = gtk_im_context_wayland_reset;
|
||||
im_context_class->set_cursor_location = gtk_im_context_wayland_set_cursor_location;
|
||||
im_context_class->set_use_preedit = gtk_im_context_wayland_set_use_preedit;
|
||||
im_context_class->set_surrounding = gtk_im_context_wayland_set_surrounding;
|
||||
im_context_class->get_surrounding = gtk_im_context_wayland_get_surrounding;
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
}
|
||||
|
||||
static void
|
||||
on_content_type_changed (GtkIMContextWayland *context)
|
||||
{
|
||||
notify_content_type (context);
|
||||
commit_state (context);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_im_context_wayland_init (GtkIMContextWayland *context)
|
||||
{
|
||||
context->use_preedit = TRUE;
|
||||
g_signal_connect_swapped (context, "notify::input-purpose",
|
||||
G_CALLBACK (on_content_type_changed), context);
|
||||
g_signal_connect_swapped (context, "notify::input-hints",
|
||||
G_CALLBACK (on_content_type_changed), context);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_im_context_wayland_register_type (GTypeModule *module)
|
||||
{
|
||||
const GTypeInfo object_info = {
|
||||
sizeof (GtkIMContextWaylandClass),
|
||||
NULL, NULL,
|
||||
(GClassInitFunc) gtk_im_context_wayland_class_init,
|
||||
NULL, NULL,
|
||||
sizeof (GtkIMContextWayland),
|
||||
0,
|
||||
(GInstanceInitFunc) gtk_im_context_wayland_init,
|
||||
};
|
||||
|
||||
type_wayland = g_type_module_register_type (module,
|
||||
GTK_TYPE_IM_CONTEXT_SIMPLE,
|
||||
"GtkIMContextWayland",
|
||||
&object_info, 0);
|
||||
}
|
||||
|
||||
MODULE_ENTRY (void, init) (GTypeModule * module)
|
||||
{
|
||||
gtk_im_context_wayland_register_type (module);
|
||||
gtk_im_context_wayland_global_init (gdk_display_get_default ());
|
||||
}
|
||||
|
||||
MODULE_ENTRY (void, exit) (void)
|
||||
{
|
||||
}
|
||||
|
||||
MODULE_ENTRY (void, list) (const GtkIMContextInfo *** contexts, int *n_contexts)
|
||||
{
|
||||
*contexts = info_list;
|
||||
*n_contexts = G_N_ELEMENTS (info_list);
|
||||
}
|
||||
|
||||
MODULE_ENTRY (GtkIMContext *, create) (const gchar * context_id)
|
||||
{
|
||||
if (strcmp (context_id, "waylandgtk") == 0)
|
||||
return g_object_new (type_wayland, NULL);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
@@ -1,441 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<protocol name="text_input_unstable_v3">
|
||||
<copyright>
|
||||
Copyright © 2012, 2013 Intel Corporation
|
||||
Copyright © 2015, 2016 Jan Arne Petersen
|
||||
Copyright © 2017, 2018 Red Hat, Inc.
|
||||
Copyright © 2018 Purism SPC
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation for any purpose is hereby granted
|
||||
without fee, provided that the above copyright notice appear in
|
||||
all copies and that both that copyright notice and this permission
|
||||
notice appear in supporting documentation, and that the name of
|
||||
the copyright holders not be used in advertising or publicity
|
||||
pertaining to distribution of the software without specific,
|
||||
written prior permission. The copyright holders make no
|
||||
representations about the suitability of this software for any
|
||||
purpose. It is provided "as is" without express or implied
|
||||
warranty.
|
||||
|
||||
THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
|
||||
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
|
||||
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
||||
THIS SOFTWARE.
|
||||
</copyright>
|
||||
|
||||
<description summary="Protocol for composing text">
|
||||
This protocol allows compositors to act as input methods and to send text
|
||||
to applications. A text input object is used to manage state of what are
|
||||
typically text entry fields in the application.
|
||||
|
||||
This document adheres to the RFC 2119 when using words like "must",
|
||||
"should", "may", etc.
|
||||
|
||||
Warning! The protocol described in this file is experimental and
|
||||
backward incompatible changes may be made. Backward compatible changes
|
||||
may be added together with the corresponding interface version bump.
|
||||
Backward incompatible changes are done by bumping the version number in
|
||||
the protocol and interface names and resetting the interface version.
|
||||
Once the protocol is to be declared stable, the 'z' prefix and the
|
||||
version number in the protocol and interface names are removed and the
|
||||
interface version number is reset.
|
||||
</description>
|
||||
|
||||
<interface name="zwp_text_input_v3" version="1">
|
||||
<description summary="text input">
|
||||
The zwp_text_input_v3 interface represents text input and input methods
|
||||
associated with a seat. It provides enter/leave events to follow the
|
||||
text input focus for a seat.
|
||||
|
||||
Requests are used to enable/disable the text-input object and set
|
||||
state information like surrounding and selected text or the content type.
|
||||
The information about the entered text is sent to the text-input object
|
||||
via the preedit_string and commit_string events.
|
||||
|
||||
Text is valid UTF-8 encoded, indices and lengths are in bytes. Indices
|
||||
must not point to middle bytes inside a code point: they must either
|
||||
point to the first byte of a code point or to the end of the buffer.
|
||||
Lengths must be measured between two valid indices.
|
||||
|
||||
Focus moving throughout surfaces will result in the emission of
|
||||
zwp_text_input_v3.enter and zwp_text_input_v3.leave events. The focused
|
||||
surface must commit zwp_text_input_v3.enable and
|
||||
zwp_text_input_v3.disable requests as the keyboard focus moves across
|
||||
editable and non-editable elements of the UI. Those two requests are not
|
||||
expected to be paired with each other, the compositor must be able to
|
||||
handle consecutive series of the same request.
|
||||
|
||||
State is sent by the state requests (set_surrounding_text,
|
||||
set_content_type and set_cursor_rectangle) and a commit request. After an
|
||||
enter event or disable request all state information is invalidated and
|
||||
needs to be resent by the client.
|
||||
</description>
|
||||
|
||||
<request name="destroy" type="destructor">
|
||||
<description summary="Destroy the wp_text_input">
|
||||
Destroy the wp_text_input object. Also disables all surfaces enabled
|
||||
through this wp_text_input object.
|
||||
</description>
|
||||
</request>
|
||||
|
||||
<request name="enable">
|
||||
<description summary="Request text input to be enabled">
|
||||
Requests text input on the surface previously obtained from the enter
|
||||
event.
|
||||
|
||||
This request must be issued every time the active text input changes
|
||||
to a new one, including within the current surface. Use
|
||||
zwp_text_input_v3.disable when there is no longer any input focus on
|
||||
the current surface.
|
||||
|
||||
This request resets all state associated with previous enable, disable,
|
||||
set_surrounding_text, set_text_change_cause, set_content_type, and
|
||||
set_cursor_rectangle requests, as well as the state associated with
|
||||
preedit_string, commit_string, and delete_surrounding_text events.
|
||||
|
||||
The set_surrounding_text, set_content_type and set_cursor_rectangle
|
||||
requests must follow if the text input supports the necessary
|
||||
functionality.
|
||||
|
||||
State set with this request is double-buffered. It will get applied on
|
||||
the next zwp_text_input_v3.commit request, and stay valid until the
|
||||
next committed enable or disable request.
|
||||
|
||||
The changes must be applied by the compositor after issuing a
|
||||
zwp_text_input_v3.commit request.
|
||||
</description>
|
||||
</request>
|
||||
|
||||
<request name="disable">
|
||||
<description summary="Disable text input on a surface">
|
||||
Explicitly disable text input on the current surface (typically when
|
||||
there is no focus on any text entry inside the surface).
|
||||
|
||||
State set with this request is double-buffered. It will get applied on
|
||||
the next zwp_text_input_v3.commit request.
|
||||
</description>
|
||||
</request>
|
||||
|
||||
<request name="set_surrounding_text">
|
||||
<description summary="sets the surrounding text">
|
||||
Sets the surrounding plain text around the input, excluding the preedit
|
||||
text.
|
||||
|
||||
The client should notify the compositor of any changes in any of the
|
||||
values carried with this request, including changes caused by handling
|
||||
incoming text-input events as well as changes caused by other
|
||||
mechanisms like keyboard typing.
|
||||
|
||||
If the client is unaware of the text around the cursor, it should not
|
||||
issue this request, to signify lack of support to the compositor.
|
||||
|
||||
Text is UTF-8 encoded, and should include the cursor position, the
|
||||
complete selection and additional characters before and after them.
|
||||
There is a maximum length of wayland messages, so text can not be
|
||||
longer than 4000 bytes.
|
||||
|
||||
Cursor is the byte offset of the cursor within text buffer.
|
||||
|
||||
Anchor is the byte offset of the selection anchor within text buffer.
|
||||
If there is no selected text, anchor is the same as cursor.
|
||||
|
||||
If any preedit text is present, it is replaced with a cursor for the
|
||||
purpose of this event.
|
||||
|
||||
Values set with this request are double-buffered. They will get applied
|
||||
on the next zwp_text_input_v3.commit request, and stay valid until the
|
||||
next committed enable or disable request.
|
||||
|
||||
The initial state for affected fields is empty, meaning that the text
|
||||
input does not support sending surrounding text. If the empty values
|
||||
get applied, subsequent attempts to change them may have no effect.
|
||||
</description>
|
||||
<arg name="text" type="string"/>
|
||||
<arg name="cursor" type="int"/>
|
||||
<arg name="anchor" type="int"/>
|
||||
</request>
|
||||
|
||||
<enum name="change_cause">
|
||||
<description summary="text change reason">
|
||||
Reason for the change of surrounding text or cursor posision.
|
||||
</description>
|
||||
<entry name="input_method" value="0" summary="input method caused the change"/>
|
||||
<entry name="other" value="1" summary="something else than the input method caused the change"/>
|
||||
</enum>
|
||||
|
||||
<request name="set_text_change_cause">
|
||||
<description summary="indicates the cause of surrounding text change">
|
||||
Tells the compositor why the text surrounding the cursor changed.
|
||||
|
||||
Whenever the client detects an external change in text, cursor, or
|
||||
anchor posision, it must issue this request to the compositor. This
|
||||
request is intended to give the input method a chance to update the
|
||||
preedit text in an appropriate way, e.g. by removing it when the user
|
||||
starts typing with a keyboard.
|
||||
|
||||
cause describes the source of the change.
|
||||
|
||||
The value set with this request is double-buffered. It must be applied
|
||||
and reset to initial at the next zwp_text_input_v3.commit request.
|
||||
|
||||
The initial value of cause is input_method.
|
||||
</description>
|
||||
<arg name="cause" type="uint" enum="change_cause"/>
|
||||
</request>
|
||||
|
||||
<enum name="content_hint" bitfield="true">
|
||||
<description summary="content hint">
|
||||
Content hint is a bitmask to allow to modify the behavior of the text
|
||||
input.
|
||||
</description>
|
||||
<entry name="none" value="0x0" summary="no special behavior"/>
|
||||
<entry name="completion" value="0x1" summary="suggest word completions"/>
|
||||
<entry name="spellcheck" value="0x2" summary="suggest word corrections"/>
|
||||
<entry name="auto_capitalization" value="0x4" summary="switch to uppercase letters at the start of a sentence"/>
|
||||
<entry name="lowercase" value="0x8" summary="prefer lowercase letters"/>
|
||||
<entry name="uppercase" value="0x10" summary="prefer uppercase letters"/>
|
||||
<entry name="titlecase" value="0x20" summary="prefer casing for titles and headings (can be language dependent)"/>
|
||||
<entry name="hidden_text" value="0x40" summary="characters should be hidden"/>
|
||||
<entry name="sensitive_data" value="0x80" summary="typed text should not be stored"/>
|
||||
<entry name="latin" value="0x100" summary="just Latin characters should be entered"/>
|
||||
<entry name="multiline" value="0x200" summary="the text input is multiline"/>
|
||||
</enum>
|
||||
|
||||
<enum name="content_purpose">
|
||||
<description summary="content purpose">
|
||||
The content purpose allows to specify the primary purpose of a text
|
||||
input.
|
||||
|
||||
This allows an input method to show special purpose input panels with
|
||||
extra characters or to disallow some characters.
|
||||
</description>
|
||||
<entry name="normal" value="0" summary="default input, allowing all characters"/>
|
||||
<entry name="alpha" value="1" summary="allow only alphabetic characters"/>
|
||||
<entry name="digits" value="2" summary="allow only digits"/>
|
||||
<entry name="number" value="3" summary="input a number (including decimal separator and sign)"/>
|
||||
<entry name="phone" value="4" summary="input a phone number"/>
|
||||
<entry name="url" value="5" summary="input an URL"/>
|
||||
<entry name="email" value="6" summary="input an email address"/>
|
||||
<entry name="name" value="7" summary="input a name of a person"/>
|
||||
<entry name="password" value="8" summary="input a password (combine with sensitive_data hint)"/>
|
||||
<entry name="pin" value="9" summary="input is a numeric password (combine with sensitive_data hint)"/>
|
||||
<entry name="date" value="10" summary="input a date"/>
|
||||
<entry name="time" value="11" summary="input a time"/>
|
||||
<entry name="datetime" value="12" summary="input a date and time"/>
|
||||
<entry name="terminal" value="13" summary="input for a terminal"/>
|
||||
</enum>
|
||||
|
||||
<request name="set_content_type">
|
||||
<description summary="set content purpose and hint">
|
||||
Sets the content purpose and content hint. While the purpose is the
|
||||
basic purpose of an input field, the hint flags allow to modify some of
|
||||
the behavior.
|
||||
|
||||
Values set with this request are double-buffered. They will get applied
|
||||
on the next zwp_text_input_v3.commit request.
|
||||
Subsequent attempts to update them may have no effect. The values
|
||||
remain valid until the next committed enable or disable request.
|
||||
|
||||
The initial value for hint is none, and the initial value for purpose
|
||||
is normal.
|
||||
</description>
|
||||
<arg name="hint" type="uint" enum="content_hint"/>
|
||||
<arg name="purpose" type="uint" enum="content_purpose"/>
|
||||
</request>
|
||||
|
||||
<request name="set_cursor_rectangle">
|
||||
<description summary="set cursor position">
|
||||
Marks an area around the cursor as a x, y, width, height rectangle in
|
||||
surface local coordinates.
|
||||
|
||||
Allows the compositor to put a window with word suggestions near the
|
||||
cursor, without obstructing the text being input.
|
||||
|
||||
If the client is unaware of the position of edited text, it should not
|
||||
issue this request, to signify lack of support to the compositor.
|
||||
|
||||
Values set with this request are double-buffered. They will get applied
|
||||
on the next zwp_text_input_v3.commit request, and stay valid until the
|
||||
next committed enable or disable request.
|
||||
|
||||
The initial values describing a cursor rectangle are empty. That means
|
||||
the text input does not support describing the cursor area. If the
|
||||
empty values get applied, subsequent attempts to change them may have
|
||||
no effect.
|
||||
</description>
|
||||
<arg name="x" type="int"/>
|
||||
<arg name="y" type="int"/>
|
||||
<arg name="width" type="int"/>
|
||||
<arg name="height" type="int"/>
|
||||
</request>
|
||||
|
||||
<request name="commit">
|
||||
<description summary="commit state">
|
||||
Atomically applies state changes recently sent to the compositor.
|
||||
|
||||
The commit request establishes and updates the state of the client, and
|
||||
must be issued after any changes to apply them.
|
||||
|
||||
Text input state (enabled status, content purpose, content hint,
|
||||
surrounding text and change cause, cursor rectangle) is conceptually
|
||||
double-buffered within the context of a text input, i.e. between a
|
||||
committed enable request and the following committed enable or disable
|
||||
request.
|
||||
|
||||
Protocol requests modify the pending state, as opposed to the current
|
||||
state in use by the input method. A commit request atomically applies
|
||||
all pending state, replacing the current state. After commit, the new
|
||||
pending state is as documented for each related request.
|
||||
|
||||
Requests are applied in the order of arrival.
|
||||
|
||||
Neither current nor pending state are modified unless noted otherwise.
|
||||
|
||||
The compositor must count the number of commit requests coming from
|
||||
each zwp_text_input_v3 object and use the count as the serial in done
|
||||
events.
|
||||
</description>
|
||||
</request>
|
||||
|
||||
<event name="enter">
|
||||
<description summary="enter event">
|
||||
Notification that this seat's text-input focus is on a certain surface.
|
||||
|
||||
When the seat has the keyboard capability the text-input focus follows
|
||||
the keyboard focus. This event sets the current surface for the
|
||||
text-input object.
|
||||
</description>
|
||||
<arg name="surface" type="object" interface="wl_surface"/>
|
||||
</event>
|
||||
|
||||
<event name="leave">
|
||||
<description summary="leave event">
|
||||
Notification that this seat's text-input focus is no longer on a
|
||||
certain surface. The client should reset any preedit string previously
|
||||
set.
|
||||
|
||||
The leave notification clears the current surface. It is sent before
|
||||
the enter notification for the new focus.
|
||||
|
||||
When the seat has the keyboard capability the text-input focus follows
|
||||
the keyboard focus.
|
||||
</description>
|
||||
<arg name="surface" type="object" interface="wl_surface"/>
|
||||
</event>
|
||||
|
||||
<event name="preedit_string">
|
||||
<description summary="pre-edit">
|
||||
Notify when a new composing text (pre-edit) should be set at the
|
||||
current cursor position. Any previously set composing text must be
|
||||
removed. Any previously existing selected text must be removed.
|
||||
|
||||
The argument text contains the pre-edit string buffer.
|
||||
|
||||
The parameters cursor_begin and cursor_end are counted in bytes
|
||||
relative to the beginning of the submitted text buffer. Cursor should
|
||||
be hidden when both are equal to -1.
|
||||
|
||||
They could be represented by the client as a line if both values are
|
||||
the same, or as a text highlight otherwise.
|
||||
|
||||
Values set with this event are double-buffered. They must be applied
|
||||
and reset to initial on the next zwp_text_input_v3.done event.
|
||||
|
||||
The initial value of text is an empty string, and cursor_begin,
|
||||
cursor_end and cursor_hidden are all 0.
|
||||
</description>
|
||||
<arg name="text" type="string" allow-null="true"/>
|
||||
<arg name="cursor_begin" type="int"/>
|
||||
<arg name="cursor_end" type="int"/>
|
||||
</event>
|
||||
|
||||
<event name="commit_string">
|
||||
<description summary="text commit">
|
||||
Notify when text should be inserted into the editor widget. The text to
|
||||
commit could be either just a single character after a key press or the
|
||||
result of some composing (pre-edit).
|
||||
|
||||
Values set with this event are double-buffered. They must be applied
|
||||
and reset to initial on the next zwp_text_input_v3.done event.
|
||||
|
||||
The initial value of text is an empty string.
|
||||
</description>
|
||||
<arg name="text" type="string" allow-null="true"/>
|
||||
</event>
|
||||
|
||||
<event name="delete_surrounding_text">
|
||||
<description summary="delete surrounding text">
|
||||
Notify when the text around the current cursor position should be
|
||||
deleted.
|
||||
|
||||
Before_length and after_length are the number of bytes before and after
|
||||
the current cursor index (excluding the selection) to delete.
|
||||
|
||||
If a preedit text is present, in effect before_length is counted from
|
||||
the beginning of it, and after_length from its end (see done event
|
||||
sequence).
|
||||
|
||||
Values set with this event are double-buffered. They must be applied
|
||||
and reset to initial on the next zwp_text_input_v3.done event.
|
||||
|
||||
The initial values of both before_length and after_length are 0.
|
||||
</description>
|
||||
<arg name="before_length" type="uint" summary="length of text before current cursor position"/>
|
||||
<arg name="after_length" type="uint" summary="length of text after current cursor position"/>
|
||||
</event>
|
||||
|
||||
<event name="done">
|
||||
<description summary="apply changes">
|
||||
Instruct the application to apply changes to state requested by the
|
||||
preedit_string, commit_string and delete_surrounding_text events. The
|
||||
state relating to these events is double-buffered, and each one
|
||||
modifies the pending state. This event replaces the current state with
|
||||
the pending state.
|
||||
|
||||
The application must proceed by evaluating the changes in the following
|
||||
order:
|
||||
|
||||
1. Replace existing preedit string with the cursor.
|
||||
2. Delete requested surrounding text.
|
||||
3. Insert commit string with the cursor at its end.
|
||||
4. Calculate surrounding text to send.
|
||||
5. Insert new preedit text in cursor position.
|
||||
6. Place cursor inside preedit text.
|
||||
|
||||
The serial number reflects the last state of the zwp_text_input_v3
|
||||
object known to the compositor. The value of the serial argument must
|
||||
be equal to the number of commit requests already issued on that object.
|
||||
When the client receives a done event with a serial different than the
|
||||
number of past commit requests, it must proceed as normal, except it
|
||||
should not change the current state of the zwp_text_input_v3 object.
|
||||
</description>
|
||||
<arg name="serial" type="uint"/>
|
||||
</event>
|
||||
</interface>
|
||||
|
||||
<interface name="zwp_text_input_manager_v3" version="1">
|
||||
<description summary="text input manager">
|
||||
A factory for text-input objects. This object is a global singleton.
|
||||
</description>
|
||||
|
||||
<request name="destroy" type="destructor">
|
||||
<description summary="Destroy the wp_text_input_manager">
|
||||
Destroy the wp_text_input_manager object.
|
||||
</description>
|
||||
</request>
|
||||
|
||||
<request name="get_text_input">
|
||||
<description summary="create a new text input object">
|
||||
Creates a new text-input object for a given seat.
|
||||
</description>
|
||||
<arg name="id" type="new_id" interface="zwp_text_input_v3"/>
|
||||
<arg name="seat" type="object" interface="wl_seat"/>
|
||||
</request>
|
||||
</interface>
|
||||
</protocol>
|
||||
@@ -345,7 +345,6 @@ modules/input/imti-er.c
|
||||
modules/input/imti-et.c
|
||||
modules/input/imviqr.c
|
||||
modules/input/imwayland.c
|
||||
modules/input/imwaylandgtk.c
|
||||
modules/input/imxim.c
|
||||
modules/printbackends/cloudprint/gtkprintbackendcloudprint.c
|
||||
modules/printbackends/cloudprint/gtkprintercloudprint.c
|
||||
|
||||
@@ -16,8 +16,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gtk+-properties\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-07-29 13:05+0000\n"
|
||||
"PO-Revision-Date: 2018-07-29 20:24+0200\n"
|
||||
"POT-Creation-Date: 2018-06-10 13:21+0000\n"
|
||||
"PO-Revision-Date: 2018-06-10 15:30+0200\n"
|
||||
"Last-Translator: Piotr Drąg <piotrdrag@gmail.com>\n"
|
||||
"Language-Team: Polish <community-poland@mozilla.org>\n"
|
||||
"Language: pl\n"
|
||||
@@ -1066,8 +1066,8 @@ msgstr ""
|
||||
"przycisku opcji"
|
||||
|
||||
#: gtk/deprecated/gtktoggleaction.c:135 gtk/gtkcellrendererspinner.c:125
|
||||
#: gtk/gtkcheckmenuitem.c:209 gtk/gtkmenu.c:632 gtk/gtkmodelbutton.c:1189
|
||||
#: gtk/gtkmodelbutton.c:1190 gtk/gtkspinner.c:221 gtk/gtkswitch.c:895
|
||||
#: gtk/gtkcheckmenuitem.c:209 gtk/gtkmenu.c:632 gtk/gtkmodelbutton.c:1151
|
||||
#: gtk/gtkmodelbutton.c:1152 gtk/gtkspinner.c:221 gtk/gtkswitch.c:895
|
||||
#: gtk/gtktogglebutton.c:188 gtk/gtktoggletoolbutton.c:130
|
||||
msgid "Active"
|
||||
msgstr "Aktywny"
|
||||
@@ -2320,7 +2320,7 @@ msgid "Whether the rendered pixbuf should be colorized according to the state"
|
||||
msgstr ""
|
||||
"Określa, czy rysowany bufor pikseli powinien mieć kolor zgodny ze stanem"
|
||||
|
||||
#: gtk/gtkcellrendererpixbuf.c:281 gtk/gtkimage.c:358 gtk/gtkmodelbutton.c:1144
|
||||
#: gtk/gtkcellrendererpixbuf.c:281 gtk/gtkimage.c:358 gtk/gtkmodelbutton.c:1122
|
||||
#: gtk/gtkshortcutsshortcut.c:550 gtk/gtkwindow.c:838
|
||||
msgid "Icon"
|
||||
msgstr "Ikona"
|
||||
@@ -2331,7 +2331,7 @@ msgstr "Wartość paska postępu"
|
||||
|
||||
#: gtk/gtkcellrendererprogress.c:156 gtk/gtkcellrenderertext.c:255
|
||||
#: gtk/gtkentrybuffer.c:350 gtk/gtkentry.c:953 gtk/gtkmessagedialog.c:214
|
||||
#: gtk/gtkmodelbutton.c:1158 gtk/gtkprogressbar.c:287 gtk/gtktextbuffer.c:218
|
||||
#: gtk/gtkmodelbutton.c:1136 gtk/gtkprogressbar.c:287 gtk/gtktextbuffer.c:218
|
||||
msgid "Text"
|
||||
msgstr "Tekst"
|
||||
|
||||
@@ -2371,7 +2371,7 @@ msgid "The vertical text alignment, from 0 (top) to 1 (bottom)."
|
||||
msgstr "Wyrównanie pionowe, od 0 (góra) do 1 (dół)."
|
||||
|
||||
#: gtk/gtkcellrendererprogress.c:226 gtk/gtklevelbar.c:1097
|
||||
#: gtk/gtkmodelbutton.c:1220 gtk/gtkprogressbar.c:264 gtk/gtkrange.c:441
|
||||
#: gtk/gtkmodelbutton.c:1182 gtk/gtkprogressbar.c:264 gtk/gtkrange.c:441
|
||||
msgid "Inverted"
|
||||
msgstr "Odwrócony"
|
||||
|
||||
@@ -3651,7 +3651,7 @@ msgstr "Podpowiedzi dla zachowania pola tekstowego"
|
||||
msgid "A list of style attributes to apply to the text of the label"
|
||||
msgstr "Lista atrybutów stylu stosowanych do tekstu etykiety"
|
||||
|
||||
#: gtk/gtkentry.c:1508 gtk/gtkplacessidebar.c:4857 gtk/gtktextview.c:1045
|
||||
#: gtk/gtkentry.c:1508 gtk/gtkplacessidebar.c:4837 gtk/gtktextview.c:1045
|
||||
msgid "Populate all"
|
||||
msgstr "Umieszczanie we wszystkich"
|
||||
|
||||
@@ -3809,10 +3809,6 @@ msgstr "Etap rozprowadzania"
|
||||
msgid "Propagation phase at which this controller is run"
|
||||
msgstr "Etap rozprowadzania, na którym uruchomiony jest ten kontroler"
|
||||
|
||||
#: gtk/gtkeventcontrollerscroll.c:374 gtk/gtkeventcontrollerscroll.c:375
|
||||
msgid "Flags"
|
||||
msgstr "Flagi"
|
||||
|
||||
#: gtk/gtkexpander.c:300
|
||||
msgid "Expanded"
|
||||
msgstr "Rozwinięty"
|
||||
@@ -3826,14 +3822,13 @@ msgstr ""
|
||||
msgid "Text of the expander's label"
|
||||
msgstr "Tekst etykiety elementu rozwijającego"
|
||||
|
||||
#: gtk/gtkexpander.c:324 gtk/gtklabel.c:819 gtk/gtkmodelbutton.c:1174
|
||||
#: gtk/gtkexpander.c:324 gtk/gtklabel.c:819
|
||||
msgid "Use markup"
|
||||
msgstr "Użycie znaczników"
|
||||
|
||||
#: gtk/gtkexpander.c:325 gtk/gtklabel.c:820
|
||||
msgid "The text of the label includes XML markup. See pango_parse_markup()"
|
||||
msgstr ""
|
||||
"Tekst etykiety zawiera znaczniki XML. Proszę zobaczyć pango_parse_markup()"
|
||||
msgstr "Tekst etykiety zawiera znaczniki XML. Zobacz pango_parse_markup()"
|
||||
|
||||
#: gtk/gtkexpander.c:342
|
||||
msgid "Space to put between the label and the child"
|
||||
@@ -3912,7 +3907,7 @@ msgstr "Filtr"
|
||||
msgid "The current filter for selecting which files are displayed"
|
||||
msgstr "Bieżący filtr służący do zaznaczania wyświetlanych plików"
|
||||
|
||||
#: gtk/gtkfilechooser.c:388 gtk/gtkplacessidebar.c:4823
|
||||
#: gtk/gtkfilechooser.c:388 gtk/gtkplacessidebar.c:4803
|
||||
#: gtk/gtkplacesview.c:2262
|
||||
msgid "Local Only"
|
||||
msgstr "Tylko lokalne"
|
||||
@@ -5250,52 +5245,47 @@ msgid "GtkBox that holds the dialog's primary and secondary labels"
|
||||
msgstr ""
|
||||
"GtkBox przechowujący podstawowe i drugorzędne etykiety okna dialogowego"
|
||||
|
||||
#: gtk/gtkmodelbutton.c:1128
|
||||
#: gtk/gtkmodelbutton.c:1106
|
||||
msgid "Role"
|
||||
msgstr "Rola"
|
||||
|
||||
#: gtk/gtkmodelbutton.c:1129
|
||||
#: gtk/gtkmodelbutton.c:1107
|
||||
msgid "The role of this button"
|
||||
msgstr "Rola tego przycisku"
|
||||
|
||||
#: gtk/gtkmodelbutton.c:1145
|
||||
#: gtk/gtkmodelbutton.c:1123
|
||||
msgid "The icon"
|
||||
msgstr "Ikona"
|
||||
|
||||
#: gtk/gtkmodelbutton.c:1159
|
||||
#: gtk/gtkmodelbutton.c:1137
|
||||
msgid "The text"
|
||||
msgstr "Tekst"
|
||||
|
||||
#: gtk/gtkmodelbutton.c:1175
|
||||
msgid "The text of the button includes XML markup. See pango_parse_markup()"
|
||||
msgstr ""
|
||||
"Tekst przycisku zawiera znaczniki XML. Proszę zobaczyć pango_parse_markup()"
|
||||
|
||||
#: gtk/gtkmodelbutton.c:1204
|
||||
#: gtk/gtkmodelbutton.c:1166
|
||||
msgid "Menu name"
|
||||
msgstr "Nazwa menu"
|
||||
|
||||
#: gtk/gtkmodelbutton.c:1205
|
||||
#: gtk/gtkmodelbutton.c:1167
|
||||
msgid "The name of the menu to open"
|
||||
msgstr "Nazwa menu do otwarcia"
|
||||
|
||||
#: gtk/gtkmodelbutton.c:1221
|
||||
#: gtk/gtkmodelbutton.c:1183
|
||||
msgid "Whether the menu is a parent"
|
||||
msgstr "Określa, czy menu jest elementem nadrzędnym"
|
||||
|
||||
#: gtk/gtkmodelbutton.c:1235
|
||||
#: gtk/gtkmodelbutton.c:1197
|
||||
msgid "Centered"
|
||||
msgstr "Wyśrodkowane"
|
||||
|
||||
#: gtk/gtkmodelbutton.c:1236
|
||||
#: gtk/gtkmodelbutton.c:1198
|
||||
msgid "Whether to center the contents"
|
||||
msgstr "Określa, czy wyśrodkować zawartość"
|
||||
|
||||
#: gtk/gtkmodelbutton.c:1251
|
||||
#: gtk/gtkmodelbutton.c:1213
|
||||
msgid "Iconic"
|
||||
msgstr "Ikony"
|
||||
|
||||
#: gtk/gtkmodelbutton.c:1252
|
||||
#: gtk/gtkmodelbutton.c:1214
|
||||
msgid "Whether to prefer the icon over text"
|
||||
msgstr "Określa, czy preferować ikony zamiast tekstu"
|
||||
|
||||
@@ -5644,19 +5634,19 @@ msgstr "Zmniejszanie"
|
||||
msgid "If TRUE, the child can be made smaller than its requisition"
|
||||
msgstr "Określa, czy element potomny może być mniejszy od swoich wymagań"
|
||||
|
||||
#: gtk/gtkplacessidebar.c:4786
|
||||
#: gtk/gtkplacessidebar.c:4766
|
||||
msgid "Location to Select"
|
||||
msgstr "Położenie do wybrania"
|
||||
|
||||
#: gtk/gtkplacessidebar.c:4787
|
||||
#: gtk/gtkplacessidebar.c:4767
|
||||
msgid "The location to highlight in the sidebar"
|
||||
msgstr "Położenie do wyróżnienia na panelu bocznym"
|
||||
|
||||
#: gtk/gtkplacessidebar.c:4792 gtk/gtkplacesview.c:2283
|
||||
#: gtk/gtkplacessidebar.c:4772 gtk/gtkplacesview.c:2283
|
||||
msgid "Open Flags"
|
||||
msgstr "Flagi otwarcia"
|
||||
|
||||
#: gtk/gtkplacessidebar.c:4793 gtk/gtkplacesview.c:2284
|
||||
#: gtk/gtkplacessidebar.c:4773 gtk/gtkplacesview.c:2284
|
||||
msgid ""
|
||||
"Modes in which the calling application can open locations selected in the "
|
||||
"sidebar"
|
||||
@@ -5664,29 +5654,29 @@ msgstr ""
|
||||
"Tryby, w których wywołujący program może otwierać położenia wybrane na "
|
||||
"panelu bocznym"
|
||||
|
||||
#: gtk/gtkplacessidebar.c:4799
|
||||
#: gtk/gtkplacessidebar.c:4779
|
||||
msgid "Show recent files"
|
||||
msgstr "Wyświetlanie elementu „Ostatnio używane pliki”"
|
||||
|
||||
#: gtk/gtkplacessidebar.c:4800
|
||||
#: gtk/gtkplacessidebar.c:4780
|
||||
msgid "Whether the sidebar includes a builtin shortcut for recent files"
|
||||
msgstr ""
|
||||
"Określa, czy panel boczny zawiera wbudowany skrót do ostatnio używanych "
|
||||
"plików"
|
||||
|
||||
#: gtk/gtkplacessidebar.c:4805
|
||||
#: gtk/gtkplacessidebar.c:4785
|
||||
msgid "Show 'Desktop'"
|
||||
msgstr "Wyświetlanie elementu „Pulpit”"
|
||||
|
||||
#: gtk/gtkplacessidebar.c:4806
|
||||
#: gtk/gtkplacessidebar.c:4786
|
||||
msgid "Whether the sidebar includes a builtin shortcut to the Desktop folder"
|
||||
msgstr "Określa, czy panel boczny zawiera wbudowany skrót do katalogu Pulpit"
|
||||
|
||||
#: gtk/gtkplacessidebar.c:4811
|
||||
#: gtk/gtkplacessidebar.c:4791
|
||||
msgid "Show 'Connect to Server'"
|
||||
msgstr "Wyświetlanie elementu „Połącz z serwerem”"
|
||||
|
||||
#: gtk/gtkplacessidebar.c:4812
|
||||
#: gtk/gtkplacessidebar.c:4792
|
||||
msgid ""
|
||||
"Whether the sidebar includes a builtin shortcut to a 'Connect to server' "
|
||||
"dialog"
|
||||
@@ -5694,50 +5684,50 @@ msgstr ""
|
||||
"Określa, czy panel boczny zawiera wbudowany skrót do okna dialogowego "
|
||||
"„Połącz z serwerem”"
|
||||
|
||||
#: gtk/gtkplacessidebar.c:4817
|
||||
#: gtk/gtkplacessidebar.c:4797
|
||||
msgid "Show 'Enter Location'"
|
||||
msgstr "Wyświetlanie elementu „Wprowadź położenie”"
|
||||
|
||||
#: gtk/gtkplacessidebar.c:4818
|
||||
#: gtk/gtkplacessidebar.c:4798
|
||||
msgid ""
|
||||
"Whether the sidebar includes a builtin shortcut to manually enter a location"
|
||||
msgstr ""
|
||||
"Określa, czy panel boczny zawiera wbudowany skrót do ręcznego wprowadzania "
|
||||
"położenia"
|
||||
|
||||
#: gtk/gtkplacessidebar.c:4824 gtk/gtkplacesview.c:2263
|
||||
#: gtk/gtkplacessidebar.c:4804 gtk/gtkplacesview.c:2263
|
||||
msgid "Whether the sidebar only includes local files"
|
||||
msgstr "Określa, czy panel boczny zawiera tylko lokalne pliki"
|
||||
|
||||
#: gtk/gtkplacessidebar.c:4829
|
||||
#: gtk/gtkplacessidebar.c:4809
|
||||
msgid "Show 'Trash'"
|
||||
msgstr "Wyświetlanie elementu „Kosz”"
|
||||
|
||||
#: gtk/gtkplacessidebar.c:4830
|
||||
#: gtk/gtkplacessidebar.c:4810
|
||||
msgid "Whether the sidebar includes a builtin shortcut to the Trash location"
|
||||
msgstr "Określa, czy panel boczny zawiera wbudowany skrót do kosza"
|
||||
|
||||
#: gtk/gtkplacessidebar.c:4835
|
||||
#: gtk/gtkplacessidebar.c:4815
|
||||
msgid "Show 'Other locations'"
|
||||
msgstr "Wyświetlanie elementu „Inne położenia”"
|
||||
|
||||
#: gtk/gtkplacessidebar.c:4836
|
||||
#: gtk/gtkplacessidebar.c:4816
|
||||
msgid "Whether the sidebar includes an item to show external locations"
|
||||
msgstr ""
|
||||
"Określa, czy panel boczny zawiera wbudowany skrót do wyświetlania "
|
||||
"zewnętrznych położeń"
|
||||
|
||||
#: gtk/gtkplacessidebar.c:4841
|
||||
#: gtk/gtkplacessidebar.c:4821
|
||||
msgid "Show “Starred Location”"
|
||||
msgstr "Wyświetlanie elementu „Ulubione”"
|
||||
|
||||
#: gtk/gtkplacessidebar.c:4842
|
||||
#: gtk/gtkplacessidebar.c:4822
|
||||
msgid "Whether the sidebar includes an item to show starred files"
|
||||
msgstr ""
|
||||
"Określa, czy panel boczny zawiera wbudowany skrót do wyświetlania ulubionych "
|
||||
"plików"
|
||||
|
||||
#: gtk/gtkplacessidebar.c:4858
|
||||
#: gtk/gtkplacessidebar.c:4838
|
||||
msgid "Whether to emit ::populate-popup for popups that are not menus"
|
||||
msgstr ""
|
||||
"Określa, czy wysyłać sygnał ::populate-popup dla wyskakujących okien, które "
|
||||
|
||||
@@ -396,7 +396,6 @@ modules/input/imti-er.c
|
||||
modules/input/imti-et.c
|
||||
modules/input/imviqr.c
|
||||
modules/input/imwayland.c
|
||||
modules/input/imwaylandgtk.c
|
||||
modules/input/imxim.c
|
||||
modules/printbackends/cloudprint/gtkprintbackendcloudprint.c
|
||||
modules/printbackends/cloudprint/gtkprintercloudprint.c
|
||||
|
||||
@@ -907,21 +907,6 @@ window1
|
||||
action 1 description: Activates the color
|
||||
action 2 name: customize
|
||||
action 2 description: Customizes the color
|
||||
picker_button
|
||||
"push button"
|
||||
parent: grid
|
||||
index: 5
|
||||
state: enabled focusable sensitive
|
||||
toolkit: gtk
|
||||
<AtkComponent>
|
||||
layer: widget
|
||||
alpha: 1
|
||||
<AtkImage>
|
||||
image size: -1 x -1
|
||||
image description: (null)
|
||||
<AtkAction>
|
||||
action 0 name: click
|
||||
action 0 description: Clicks the button
|
||||
sv_popup
|
||||
"filler"
|
||||
parent: overlay
|
||||
|
||||