Re: [PATCH wayland-protocols v7] text: Create second version of text input protocol

2016-10-12 Thread Bryce Harrington
On Wed, Jul 06, 2016 at 12:26:28AM +0200, Jan Arne Petersen wrote:
> On Thu, Jun 9, 2016 at 1:01 PM Carlos Garnacho  wrote:
> 
> Hi Carlos,
> 
> Thanks for the feedback.
> 
> >
> > Chiming in, and kinda late at that... hopefully we'll get this moving :).
> 
> I do not think we want to change text_input_unstable_v2 version 1 anymore
> (since it already got shipped in Qt 5.7.0 and Plasma 5.7.0). Sorry for that.
> But I already started to  work on text_input_unstable_v2 version 2 and also
> text_input_unstable_v3 where I like to include the feedback.
>
> > First of all, I'm aware that some of my comments are directed towards
> > stuff that's unchanged between v1 and v2, so please bear with me, I
> > hope the feedback is useful.
> 
> Sure that is perfectly fine, I think that is the idea of the unstable 
> protocols
> anyways that we can still change everything and adapt them with real
> world experience.

> > On Mon, May 30, 2016 at 11:41 AM, Jan Arne Petersen  
> > wrote:
> > > There were some shortcomings in the first version of the protocol which
> > > makes it not really useful in real world applications. It is not really
> > > possible to fix them in a compatible way so introduce a new v2 of the
> > > protocol.
> > >
> > > Fixes some shortcomings of the first version:
> > >
> > > * Use only one wp_text_input per wl_seat (client side should be
> > >   handled by client toolkit)
> > > * Allow focus tracking without wl_keyboard present
> > > * Improve update state handling and better define state handling

I'd love to see a re-rev of this patch.  Looking at a diff between v1
and v2, those three changes seem quite suitable, although I'd like to
see an exact minimal diff of the changes so holding off on detailed
review.  But worth an acked by at least:

Acked-by: Bryce Harrington 


The input-method and text-input protocols both deal with similar
functionality (text input).  I'm not sure if we already have a high
level description somewhere that describes their relationship, but at a
minimum I think the protocols ought to cross-reference each other.  (For
instance, something like, "See also the input-method protocol, which
provides ...")  When I first looked at the two protocols, just reading
their descriptions it wasn't obvious at all how they related; it only
clicked after studying the weston code.

Bryce

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston 3/3] simple-im: Rename source file to be consistent with other client tools

2016-10-12 Thread Bryce Harrington
On Wed, Oct 12, 2016 at 09:43:00AM +0200, Jan Arne Petersen wrote:
> Hi,
> 
> This series looks good:
> Reviewed-by: Jan Arne Petersen 

Thanks, pushed the set:

To ssh://git.freedesktop.org/git/wayland/weston
   e57b6a1..c6a899d  master -> master
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston 3/3] simple-im: Rename source file to be consistent with other client tools

2016-10-12 Thread Bryce Harrington
On Wed, Oct 12, 2016 at 05:33:19PM +0100, Emil Velikov wrote:
> Hi Bryce,
> 
> On 12 October 2016 at 00:33, Bryce Harrington  wrote:
> > Except for weston-info, client source files are not prefixed "weston-".
> >
> > Signed-off-by: Bryce Harrington 
> > ---
> >  Makefile.am|   2 +-
> >  clients/simple-im.c| 524 
> > +
> >  clients/weston-simple-im.c | 524 
> > -
> 
> If you set the following git will produce nice (zero diff) patches ;-)
> $ git config --global diff.renames true
> 
> You can use either true or copy.
> -Emil

Ah, thanks.

Bryce
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston 3/3] simple-im: Rename source file to be consistent with other client tools

2016-10-12 Thread Emil Velikov
Hi Bryce,

On 12 October 2016 at 00:33, Bryce Harrington  wrote:
> Except for weston-info, client source files are not prefixed "weston-".
>
> Signed-off-by: Bryce Harrington 
> ---
>  Makefile.am|   2 +-
>  clients/simple-im.c| 524 
> +
>  clients/weston-simple-im.c | 524 
> -

If you set the following git will produce nice (zero diff) patches ;-)
$ git config --global diff.renames true

You can use either true or copy.
-Emil
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston 3/3] simple-im: Rename source file to be consistent with other client tools

2016-10-12 Thread Jan Arne Petersen
Hi,

On Tue, 2016-10-11 at 16:33 -0700, Bryce Harrington wrote:
> Except for weston-info, client source files are not prefixed "weston-
> ".
> 
> Signed-off-by: Bryce Harrington 
> ---
>  Makefile.am|   2 +-
>  clients/simple-im.c| 524
> +
>  clients/weston-simple-im.c | 524 -
> 
>  3 files changed, 525 insertions(+), 525 deletions(-)
>  create mode 100644 clients/simple-im.c
>  delete mode 100644 clients/weston-simple-im.c
> 
> diff --git a/Makefile.am b/Makefile.am
> index c94c211..b08ce71 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -779,7 +779,7 @@ nodist_weston_keyboard_SOURCES =  
>   \
>  weston_keyboard_LDADD = libtoytoolkit.la
>  weston_keyboard_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
>  
> -weston_simple_im_SOURCES = clients/weston-simple-im.c
> +weston_simple_im_SOURCES = clients/simple-im.c
>  nodist_weston_simple_im_SOURCES =\
>   protocol/input-method-unstable-v1-protocol.c
> \
>   protocol/input-method-unstable-v1-client-protocol.h
> diff --git a/clients/simple-im.c b/clients/simple-im.c
> new file mode 100644
> index 000..280589b
> --- /dev/null
> +++ b/clients/simple-im.c
> @@ -0,0 +1,524 @@
> +/*
> + * Copyright © 2012 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person
> obtaining a
> + * copy of this software and associated documentation files (the
> "Software"),
> + * to deal in the Software without restriction, including without
> limitation
> + * the rights to use, copy, modify, merge, publish, distribute,
> sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom
> the
> + * Software is furnished to do so, subject to the following
> conditions:
> + *
> + * The above copyright notice and this permission notice (including
> the next
> + * paragraph) shall be included in all copies or substantial
> portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO
> EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
> OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> OTHER
> + * DEALINGS IN THE SOFTWARE.
> + */
> +
> +#include "config.h"
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +
> +#include "window.h"
> +#include "input-method-unstable-v1-client-protocol.h"
> +#include "shared/helpers.h"
> +
> +enum compose_state {
> + state_normal,
> + state_compose
> +};
> +
> +struct compose_seq {
> + uint32_t keys[4];
> +
> + const char *text;
> +};
> +
> +struct simple_im;
> +
> +typedef void (*keyboard_input_key_handler_t)(struct simple_im
> *keyboard,
> +  uint32_t serial,
> +  uint32_t time, uint32_t
> key, uint32_t unicode,
> +  enum
> wl_keyboard_key_state state);
> +
> +struct simple_im {
> + struct zwp_input_method_v1 *input_method;
> + struct zwp_input_method_context_v1 *context;
> + struct wl_display *display;
> + struct wl_registry *registry;
> + struct wl_keyboard *keyboard;
> + enum compose_state compose_state;
> + struct compose_seq compose_seq;
> +
> + struct xkb_context *xkb_context;
> +
> + uint32_t modifiers;
> +
> + struct xkb_keymap *keymap;
> + struct xkb_state *state;
> + xkb_mod_mask_t control_mask;
> + xkb_mod_mask_t alt_mask;
> + xkb_mod_mask_t shift_mask;
> +
> + keyboard_input_key_handler_t key_handler;
> +
> + uint32_t serial;
> +};
> +
> +static const struct compose_seq compose_seqs[] = {
> + { { XKB_KEY_quotedbl, XKB_KEY_A, 0 },  "Ä" },
> + { { XKB_KEY_quotedbl, XKB_KEY_O, 0 },  "Ö" },
> + { { XKB_KEY_quotedbl, XKB_KEY_U, 0 },  "Ü" },
> + { { XKB_KEY_quotedbl, XKB_KEY_a, 0 },  "ä" },
> + { { XKB_KEY_quotedbl, XKB_KEY_o, 0 },  "ö" },
> + { { XKB_KEY_quotedbl, XKB_KEY_u, 0 },  "ü" },
> + { { XKB_KEY_apostrophe, XKB_KEY_A, 0 },  "Á" },
> + { { XKB_KEY_apostrophe, XKB_KEY_a, 0 },  "á" },
> + { { XKB_KEY_slash, XKB_KEY_O, 0 }, "Ø" },
> + { { XKB_KEY_slash, XKB_KEY_o, 0 }, "ø" },
> + { { XKB_KEY_less, XKB_KEY_3, 0 },  "♥" },
> + { { XKB_KEY_A, XKB_KEY_A, 0 },  "Å" },
> + { { XKB_KEY_A, XKB_KEY_E, 0 },  "Æ" },
> + { { XKB_KEY_O, XKB_KEY_C, 0 },  "©" },
> + { { XKB_KEY_O, XKB_KEY_R, 0 },  "®" },
> + { { XKB_KEY_s, XKB_KEY_s, 0 },  "ß" },
> + { { XKB_KEY_a, XKB_KEY_e, 0 },  "æ" },
> + { { XKB_KEY_a, XKB_KEY_a, 0 },  "å" },
> +};
> +
> +static const