Re: [waffle] [PATCH 07/10] waffle: add full screen window request

2015-04-24 Thread Chad Versace
On Thu 23 Apr 2015, Emil Velikov wrote:
> On 22 April 2015 at 20:26, Chad Versace wrote:
> > On Fri 10 Apr 2015, Emil Velikov wrote:
> >> On 09/04/15 22:48, Chad Versace wrote:
> >> > On Mon 30 Mar 2015, Frank Henigman wrote:
> 
> >> >> diff --git a/include/waffle/waffle.h b/include/waffle/waffle.h
> >> >> index 297a487..df0218e 100644
> >> >> --- a/include/waffle/waffle.h
> >> >> +++ b/include/waffle/waffle.h
> >> >> @@ -172,6 +172,7 @@ enum waffle_enum {
> >> >>
> >> >> WAFFLE_WINDOW_WIDTH = 
> >> >> 0x0310,
> >> >> WAFFLE_WINDOW_HEIGHT= 
> >> >> 0x0311,
> >> >> +WAFFLE_WINDOW_FULLSCREEN=
> >> >> 0x0312,
> >> >
> >> > wcore_enum_to_string must be taught about the new enum.
> >> >
> >> Hi Chad,
> >>
> >> Should one wrap the new enum in #if WAFFLE_API_VERSION >= 0x1070 ? Or it
> >> only makes sense for new entry points into the waffle library ?
> >> Considering that WAFFLE_WINDOW_{WIDTH,HEIGHT} went in without the API
> >> guard, I'm leaning towards the latter.
> >
> > I'm unsure. Other libraries that use feature test macros, what do they
> > do? For the record, when adding WAFFLE_CONTEXT_FORWARD_COMPATIBLE and
> > WAFFLE_CONTEXT_DEBUG, I guarded those with 0x0130. But I'm open to
> > guarding only entry points if that makes more sense.
> >
> That's the key that brought us here in the first place ;-) From a
> quick look at my /usr/include all of the feature test macros are used
> to guard structs (be that new ones or ABI changes) and functions
> prototypes. Haven't seen one guarding enums/defines.
> 
> > I think we should research what other libraries do before committing to
> > a decision.
> >
> Personally I would opt for dropping the guards in enums
>  - GDK, xfixes, jpeglib guards only structs/functions,
>  - anyone can provide a dummy/invalid value, it's up-to the API to
> disregard/ignore it :-)

Ok, then that's the policy going forward. Guard structs and functions,
but not enums. Thanks for doing the research, Emil.
___
waffle mailing list
waffle@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/waffle


Re: [waffle] [PATCH 07/10] waffle: add full screen window request

2015-04-23 Thread Emil Velikov
On 22 April 2015 at 20:26, Chad Versace wrote:
> On Fri 10 Apr 2015, Emil Velikov wrote:
>> On 09/04/15 22:48, Chad Versace wrote:
>> > On Mon 30 Mar 2015, Frank Henigman wrote:

>> >> diff --git a/include/waffle/waffle.h b/include/waffle/waffle.h
>> >> index 297a487..df0218e 100644
>> >> --- a/include/waffle/waffle.h
>> >> +++ b/include/waffle/waffle.h
>> >> @@ -172,6 +172,7 @@ enum waffle_enum {
>> >>
>> >> WAFFLE_WINDOW_WIDTH = 0x0310,
>> >> WAFFLE_WINDOW_HEIGHT= 0x0311,
>> >> +WAFFLE_WINDOW_FULLSCREEN=
>> >> 0x0312,
>> >
>> > wcore_enum_to_string must be taught about the new enum.
>> >
>> Hi Chad,
>>
>> Should one wrap the new enum in #if WAFFLE_API_VERSION >= 0x1070 ? Or it
>> only makes sense for new entry points into the waffle library ?
>> Considering that WAFFLE_WINDOW_{WIDTH,HEIGHT} went in without the API
>> guard, I'm leaning towards the latter.
>
> I'm unsure. Other libraries that use feature test macros, what do they
> do? For the record, when adding WAFFLE_CONTEXT_FORWARD_COMPATIBLE and
> WAFFLE_CONTEXT_DEBUG, I guarded those with 0x0130. But I'm open to
> guarding only entry points if that makes more sense.
>
That's the key that brought us here in the first place ;-) From a
quick look at my /usr/include all of the feature test macros are used
to guard structs (be that new ones or ABI changes) and functions
prototypes. Haven't seen one guarding enums/defines.

> I think we should research what other libraries do before committing to
> a decision.
>
Personally I would opt for dropping the guards in enums
 - GDK, xfixes, jpeglib guards only structs/functions,
 - anyone can provide a dummy/invalid value, it's up-to the API to
disregard/ignore it :-)

>> Speaking of which what is the status of waffle_display_print_info() ?
>> Mostly curious than anything else.
>
> I CC'd you today on the relevant thread.
My humble question has served its purpose - the discussion is back on :-)


Cheers
Emil
___
waffle mailing list
waffle@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/waffle


Re: [waffle] [PATCH 07/10] waffle: add full screen window request

2015-04-22 Thread Chad Versace
On Fri 10 Apr 2015, Emil Velikov wrote:
> On 09/04/15 22:48, Chad Versace wrote:
> > On Mon 30 Mar 2015, Frank Henigman wrote:
> >> You can now put WAFFLE_WINDOW_FULLSCREEN in the attribute list passed
> >> to waffle_window_create2() and get a full screen window.
> >> Only glx and x11_egl implemented so far.
> > 
> > I like the idea of WAFFLE_WINDOW_FULLSCREEN. Comments below.
> > 
> >> Signed-off-by: Frank Henigman 
> >> ---
> >> include/waffle/waffle.h|  1 +
> >> src/waffle/api/waffle_window.c | 69
> >> ++
> >> src/waffle/glx/glx_window.c| 12 ++--
> >> src/waffle/xegl/xegl_window.c  | 13 ++--
> >> 4 files changed, 59 insertions(+), 36 deletions(-)
> >>
> >> diff --git a/include/waffle/waffle.h b/include/waffle/waffle.h
> >> index 297a487..df0218e 100644
> >> --- a/include/waffle/waffle.h
> >> +++ b/include/waffle/waffle.h
> >> @@ -172,6 +172,7 @@ enum waffle_enum {
> >>
> >> WAFFLE_WINDOW_WIDTH = 0x0310,
> >> WAFFLE_WINDOW_HEIGHT= 0x0311,
> >> +WAFFLE_WINDOW_FULLSCREEN=
> >> 0x0312,
> > 
> > wcore_enum_to_string must be taught about the new enum.
> > 
> Hi Chad,
> 
> Should one wrap the new enum in #if WAFFLE_API_VERSION >= 0x1070 ? Or it
> only makes sense for new entry points into the waffle library ?
> Considering that WAFFLE_WINDOW_{WIDTH,HEIGHT} went in without the API
> guard, I'm leaning towards the latter.

I'm unsure. Other libraries that use feature test macros, what do they
do? For the record, when adding WAFFLE_CONTEXT_FORWARD_COMPATIBLE and
WAFFLE_CONTEXT_DEBUG, I guarded those with 0x0130. But I'm open to
guarding only entry points if that makes more sense.

I think we should research what other libraries do before committing to
a decision.

> Speaking of which what is the status of waffle_display_print_info() ?
> Mostly curious than anything else.

I CC'd you today on the relevant thread.
___
waffle mailing list
waffle@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/waffle


Re: [waffle] [PATCH 07/10] waffle: add full screen window request

2015-04-22 Thread Chad Versace
On Thu 16 Apr 2015, Frank Henigman wrote:
> On Thu, Apr 9, 2015 at 6:48 PM, Chad Versace  wrote:
> > On Mon 30 Mar 2015, Frank Henigman wrote:
> >>
> >> You can now put WAFFLE_WINDOW_FULLSCREEN in the attribute list passed
> >> to waffle_window_create2() and get a full screen window.
> >> Only glx and x11_egl implemented so far.
> >
> >
> > I like the idea of WAFFLE_WINDOW_FULLSCREEN. Comments below.
> 
> >> +WAFFLE_WINDOW_FULLSCREEN= 0x0312,
> >
> >
> > wcore_enum_to_string must be taught about the new enum.
> 
> Done in v2 (sent separately).  Docs updated too.

Ok, I'll take a look at v2.

> On the topic of queries, I'd like to be able to query a window after
> creation, particularly to get the size that resulted from a full
> screen request, but other queries might be useful too.  How about
> analogues to eglQueryContext and eglQuerySurface?

Analogues to eglQueryContext and eglQuerySurface would indeed be useful.
___
waffle mailing list
waffle@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/waffle


Re: [waffle] [PATCH 07/10] waffle: add full screen window request

2015-04-16 Thread Frank Henigman
On Thu, Apr 9, 2015 at 6:48 PM, Chad Versace  wrote:
> On Mon 30 Mar 2015, Frank Henigman wrote:
>>
>> You can now put WAFFLE_WINDOW_FULLSCREEN in the attribute list passed
>> to waffle_window_create2() and get a full screen window.
>> Only glx and x11_egl implemented so far.
>
>
> I like the idea of WAFFLE_WINDOW_FULLSCREEN. Comments below.

>> +WAFFLE_WINDOW_FULLSCREEN= 0x0312,
>
>
> wcore_enum_to_string must be taught about the new enum.

Done in v2 (sent separately).  Docs updated too.

>
>> +if (!wcore_attrib_list_get(attrib_list_filtered,
>> +   WAFFLE_WINDOW_FULLSCREEN, &unused)) {
>
>
> Instead of ignoring the value of WAFFLE_WINDOW_FULLSCREEN, it should be a
> boolean value whose default value is false, like WAFFLE_CONTEXT_DEBUG.

done

> Non-X11 platforms will reject WAFFLE_WINDOW_FULLSCREEN with the error
> message
> "bad attribute 0x312", and the user has no way to dynamically query which
> Waffle platforms support fullscreen and which don't. I really wish Waffle
> had
> an API for capability queries. But since it doesn't, users will just need to
> know
> when it's safe and when it isn't to request fullscreen.

I decided to put all the attribute parsing/checking in
waffle_window_create2() to avoid duplication in the platforms, and now
just pass -1x-1 to the platform window create function to request full
screen.  If the platform doesn't handle that it sets the error and
since it no longer sees the full screen attribute, "bad attribute"
seems wrong.  I changed it to WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM.

On the topic of queries, I'd like to be able to query a window after
creation, particularly to get the size that resulted from a full
screen request, but other queries might be useful too.  How about
analogues to eglQueryContext and eglQuerySurface?
___
waffle mailing list
waffle@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/waffle