FLTK logo

Re: [fltk.coredev] RFC: API for screen sizes on mobile devices

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.coredev  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: RFC: API for screen sizes on mobile devices "'melcher.... Sep 02, 2020  
 

Albrecht Schlosser schrieb am Mittwoch, 2. September 2020 um 13:27:49 UTC+2:
On 9/2/20 10:21 AM 'melcher...' via fltk.coredev wrote:
I'm -1 on such API's as Fl::hint(int, int, int...). They are confusing
and hard to implement (need switch(..) etc.). Also, extension of the API
using other datatypes would be possible but less obvious.

I'd propose to introduce a new (static?) object type like Fl_Screen or
similar with virtual methods that can easily be extended (one method per
logical function).

An Fl_Screen class array with some accessor would also solve the increasing number of Fl::screen_...() methods.
 
The methods above could then be:

Fl_Screen::format(FL_SCREEN::LANDSCAPE_ONLY);
Fl_Screen::landscape_width(1024);

Preferably inside a if (platform==Android) { ... }. On a desktop machine, those calls alone would be misleading, even if they are not implemented in the driver. But yeah, ok. I see your point.

The device type would not be necessary because it would be "known" by
the (virtual) method implementation.
(...) 
This is consistent with the current driver model and getter methods
would be very simple to call, supposedly only in driver related code parts.

OK, makes sense. I'll have to implement an automated version of this first anyway, and then I will get back to a possible API.
 

--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/d6bc2010-ab73-42ab-ac45-7b162481ae67n%40googlegroups.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.