FLTK logo

[fltk.coredev] RFC: Removal of FL_CFG_* macros and config_lib.h

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 ]

RFC: Removal of FL_CFG_* macros and config_lib.h Albrecht Schlosser Feb 18, 2021  
 
All (not only devs),

in another post I wrote:

> Generally I *believe* ...that all these
> FL_CFG_GFX_* definitions should not be necessary and
> *maybe* the entire [file] 'config_lib.h' could be
> removed. ... But that's something that needs some
> time for investigation...

First of all, a BIG THANK YOU to Manolo who reorganized the remaining (?) driver stuff and removed the majority of the usages of these FL_CFG_* config macros. It's obviously been a lot of work and many commits.

Today I removed the remaining references of config_lib.h except those in src/Fl.cxx which are still needed to implement the static assignment of runtime configuration variables (documented here):

https://www.fltk.org/doc-1.4/group__cfg__gfx.html
https://www.fltk.org/doc-1.4/group__cfg__prn.html
https://www.fltk.org/doc-1.4/group__cfg__win.html
https://www.fltk.org/doc-1.4/group__cfg__sys.html

I'd like to keep these runtime configuration /features/ but I'd prefer to turn them into functions like, for instance

  int Fl::cfg_gfx_cairo()

and

  int Fl::cfg_gfx_opengl()

rather than referencing global (static) class variables. IMHO such static variables lack C++ (i.e. OO) features, we'd be better with private variables and corresponding getter methods which would enable us to implement features we don't even know of yet.

These runtime configuration features *can* be useful although I'm not sure what they can be used for exactly. There is only one example in the FLTK sources in cube.cxx:

cube.cxx-234-
cube.cxx-235-#if HAVE_GL
cube.cxx-236-  // try to overlay a button onto an OpenGL window
cube.cxx:237:  if (Fl::cfg_gfx_opengl) {
cube.cxx-238-    lt_cube->begin();
cube.cxx-239-    Fl_Button *test = new Fl_Button(35, 105, 100, 30, "Test");
cube.cxx-240-    test->box(FL_ROUND_UP_BOX);
cube.cxx-241-    lt_cube->end();
cube.cxx-242-  }
cube.cxx-243-#endif // HAVE_GL

As you can see the usage is inside "#if HAVE_GL" anyway, hence I think it wouldn't make much difference if the runtime test was not available in /this/ case.

But there may be other usages...

As always, all comments and suggestions would be very much appreciated. TIA.

Question 1: keep these runtime features?

Question 2: turn them into functions?

--
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/b90c05a2-497c-e70c-13b5-d5a8a6d029d1%40online.de.
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'.