pkulchenko / wxlua

wxlua: Lua bindings for wxWidgets cross-platform GUI toolkit; supports Lua 5.1, 5.2, 5.3, 5.4, LuaJIT and wxWidgets 3.x
306 stars 59 forks source link

STC binding constants removed #4

Closed ildar closed 7 years ago

ildar commented 7 years ago

I got failure building with the latest GIT wxGTK3.1: some constants were removed from interface/wx/stc/stc.h, hence the error I experience:

/usr/src/RPM/BUILD/wxlua-2.8.12.3/modules/wxbind/src/wxstc_bind.cpp: In function 'wxLuaBindNumber* wxLuaGetDefineList_wxstc(size_t&)': /usr/src/RPM/BUILD/wxlua-2.8.12.3/modules/wxbind/src/wxstc_bind.cpp:14808:30: error: 'wxSTC_4GL_BLOCK' was not declared in this scope { "wxSTC_4GL_BLOCK", wxSTC_4GL_BLOCK }, /usr/src/RPM/BUILD/wxlua-2.8.12.3/modules/wxbind/src/wxstc_bind.cpp:14809:31: error: 'wxSTC_4GLBLOCK' was not declared in this scope { "wxSTC_4GLBLOCK", wxSTC_4GLBLOCK }, /usr/src/RPM/BUILD/wxlua-2.8.12.3/modules/wxbind/src/wxstc_bind.cpp:14810:34: error: 'wxSTC_4GL_CHARACTER' was not declared in this scope { "wxSTC_4GL_CHARACTER", wxSTC_4GL_CHARACTER },

etc etc

pkulchenko commented 7 years ago

@ildar, this doesn't seem to be related to wxGTK version, but rather to the version of wxwidgets you are using. What version are you compiling with? What build commands?

ildar commented 7 years ago

git HEAD which is https://github.com/wxWidgets/wxWidgets/commit/9662be097d9d41c4b238fd2de3460e282bf64fa6 . The reason for that is that to build wxlua the tag 3.1 is too old and git HEAD is too new :)

ildar commented 7 years ago

To be clear:

  1. I first tried to build wxlua against wxGTK 3.1, failed with missing methods (details https://bugzilla.altlinux.org/33929 )
  2. updated wxGTK to the git HEAD
  3. tried building wxlua again, failed, missing constants in wxGTK
pkulchenko commented 7 years ago

@ildar, give it a try; I updated the binding to fix the issues, but only tested on Windows so far. This should work with the current wxwidgets trunk, but may not work with earlier versions (especially those between 3.1.0 and 3.1.1).

Also, some of the constants have been removed, which I fixed in ZeroBrane Studio with the following fragment:

-- wxwidgets 3.1.1+ replaced wxSTC_SCMOD_* with wxSTC_KEYMOD_*; map both for compatibility
for _, key in ipairs({"ALT", "CTRL", "SHIFT", "META", "SUPER", "NORM"}) do
  local scmod = "wxSTC_SCMOD_"..key
  local keymod = "wxSTC_KEYMOD_"..key
  if wxstc[scmod] and not wxstc[keymod] then
    wxstc[keymod] = wxstc[scmod]
  elseif not wxstc[scmod] and wxstc[keymod] then
    wxstc[scmod] = wxstc[keymod]
  end
end
ildar commented 7 years ago

Thanks a lot! Will do it ASAP

pkulchenko commented 7 years ago

@ildar, did the updates fix the issue for you?

ildar commented 7 years ago

Yep, thanks a lot. Still investigating https://github.com/pkulchenko/wxlua/issues/5 . This one is done for now, thanks again.