More typing

Robert Carr robert.carr at canonical.com
Thu Jan 22 18:53:05 UTC 2015


Hi Daniel, Daniel! (:p)

First w.r.t duflus concerns:

I guess I tend to shy away from these sort of abbreviated API's as a habit
I picked up from the GLib programming days.

My concern is that once you choose abbreviations you have to remember which
abbreviation you chose, on the other hand if the
function is always of canonical forms:

NamespaceClassFoo namespace_class_get_foo(NamespaceClass instance, size_t
foo_index)

etc

You have a fair amount of repeating yourself but each type name is easy to
guess...I guess to me this is a pretty significant advantage and im
inclined to keep it. Interested in more feedback I guess.
On Thu, Jan 22, 2015 at 12:35 AM, Daniel van Vugt <
daniel.van.vugt at canonical.com> wrote:

> Initial thoughts:
>
> "InputEvent/input_event" is mentioned too much. So:
>
>     MirInputEvent* input = mir_event_get_input_event(event);
>     MirTouchInputEvent* touch =
>         mir_input_event_get_touch_input_event(input);
>     x = mir_touch_input_event_get_touch_axis_value(
>             touch, 0, mir_touch_input_axis_x);
>
> could be easily renamed to something like:
>
>     MirInput* input = mir_event_get_input(event);
>     MirTouch* touch = mir_input_get_touch(input);
>     x = mir_touch_get_axis(touch, 0, mir_touch_axis_x);
>
> I'm not sure if we really need MirInput(Event) in there either. So it
> could be simpler again:
>
>     MirTouch* touch = mir_event_get_touch(event);
>     x = mir_touch_get_axis(touch, 0, mir_touch_axis_x);
>
> - Daniel
>
>
> On 22/01/15 16:23, Daniel van Vugt wrote:
>
>> Looking at an example of changing from the old input event API to the
>> new one in Mir 0.10:
>>
>> http://bazaar.launchpad.net/~mir-team/mir/development-
>> branch/revision/2246?compare_revid=2128#examples/fingerpaint.c
>>
>>
>> You can see it requires a lot more code now.
>>
>> I'm wondering if anyone has any thoughts on how we might make things
>> simpler for users again before this becomes the norm...?
>>
>> - Daniel
>>
>>
> --
> Mir-devel mailing list
> Mir-devel at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/mir-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/mir-devel/attachments/20150122/66dbcd4d/attachment.html>


More information about the Mir-devel mailing list