FLTK logo

Re: [fltk.general] Re: Closer approximation of native Windows 7 look

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.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Re: Closer approximation of native Windows 7 look Greg Ercolano Jan 18, 2014  
 
On 01/18/14 10:48, kdiman wrote:
> Greg.
> 
> I have no ideas for why his building is terminating with that error.
> 
> FLTK has strcasecmp in other files (like src/filename_list.cxx, src/Fl_arg.cxx),
> thats not modified by me,
> but hi get error only after patching the distro of FLTK. |-]

	OK, had some time to look into this.

	Yes, you're right, it's just an issue with the patch.
	It introduces the use of strcasecmp() into the code that didn't
	previously use it, such as Fl_Browser_.cxx

	The patch uses strcasecmp() /mostly/ to check for the "oxy"
	scheme name, e.g.

+  bool flag_oxy = (Fl::scheme() && !strcasecmp(Fl::scheme(), "oxy"));
+  bool flag_oxy = (Fl::scheme() && !strcasecmp(Fl::scheme(), "oxy"));
+     bool flag_oxy = (Fl::scheme() && !strcasecmp(Fl::scheme(), "oxy"));
+  bool flag_oxy = (Fl::scheme() && !strcasecmp(Fl::scheme(), "oxy"));
+  bool flag_oxy = (Fl::scheme() && !strcasecmp(Fl::scheme(), "oxy"));
[etc]

	Whereas in our existing code, we check for "gtk+" with just strcmp():

src/Fl_Light_Button.cxx:	  if (Fl::scheme() && !strcmp(Fl::scheme(), "gtk+")) {
src/Fl_Light_Button.cxx:	  if (Fl::scheme() && !strcmp(Fl::scheme(), "gtk+")) {
src/Fl_Light_Button.cxx:	  if (Fl::scheme() && !strcmp(Fl::scheme(), "gtk+")) {
src/Fl_Menu.cxx:	  if (!strcmp(Fl::scheme(), "gtk+")) {
src/Fl_Menu.cxx:	if (Fl::scheme() && !strcmp(Fl::scheme(), "gtk+")) {

	So short answer: to be consistent, I think we should modify the patch
	changing its use in those cases of strcasecmp() -> strcmp() to solve.

	There's a few cases where the patch uses strcasecmp()
	that perhaps should be maintained, such as its use in the new
	Fl_Calender widget it provides.

	Though as mentioned by Albrecht, we need to pull that addition
	out of the patch as adding a widget should be separate from the
	oxy patch. (Adding widgets affects all our VS IDE files and makefiles,
	which is a rather big deal; don't want to see that hold up adopting
	the oxy patch.)

	And the patch properly handles the "case insensitive" scheme check
	on startup using fl_ascii_strcasecmp():

+    else if (!fl_ascii_strcasecmp(s, "oxy")) s = strdup("oxy");
+  } else if (scheme_ && !strcasecmp(scheme_, "oxy")) {

	..the same way our existing "gtk+" check does:

src/Fl_get_system_colors.cxx:    else if (!fl_ascii_strcasecmp(s, "gtk+")) s = strdup("gtk+");
src/Fl_get_system_colors.cxx:  } else if (scheme_ && !fl_ascii_strcasecmp(scheme_, "gtk+")) {

	So it's just those other instances throughout the widget code
	we need to modify the strcasecmp()'s -> strcmp().

	I'll follow up in the associated STR with this so that future oxy
	patches don't have this issue.

	As a related issue, the devs are deciding whether we should just switch
	all the fltk library code's use of strcasemcmp() -> fl_ascii_strcasecmp()
	just to avoid the whole issue of strcasecmp() vs. strcmpi(). We also have
	a utf8 aware version that we provide as fl_utf8_strcasecmp().

-- 
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

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'.