Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wxwidgets now at 3.2 #144

Open
ben2talk opened this issue Jul 16, 2022 · 7 comments
Open

wxwidgets now at 3.2 #144

ben2talk opened this issue Jul 16, 2022 · 7 comments

Comments

@ben2talk
Copy link

In file included from /usr/include/wx-3.2/wx/bitmap.h:318,
                 from /usr/include/wx-3.2/wx/generic/panelg.h:14,
                 from /usr/include/wx-3.2/wx/panel.h:69,
                 from /usr/include/wx-3.2/wx/wx.h:40,
                 from /home/ben/guayadeque/src/misc/Utils.h:25,
                 from /home/ben/guayadeque/src/ui/aui/AuiNotebook.h:25,
                 from /home/ben/guayadeque/src/ui/aui/AuiNotebook.cpp:22:
/usr/include/wx-3.2/wx/gtk/bitmap.h:63:24: note: candidate: ‘wxBitmap& wxBitmap::operator=(const wxBitmap&)’
   63 | class WXDLLIMPEXP_CORE wxBitmap: public wxBitmapBase
      |                        ^~~~~~~~
/usr/include/wx-3.2/wx/gtk/bitmap.h:63:24: note:   no known conversion for argument 1 from ‘wxBitmapBundle’ to ‘const wxBitmap&’

Wow, a sad day for me.
Is something like Appimage feasible?

@sluedecke
Copy link

sluedecke commented Jul 30, 2022

I have a different error message related to src/ui/aui/AuiNotebook.cpp. There was a migration from wxBitmap to wxBitmapBundle in wxWidgets around October 2021 / version 3.1.x and this is not yet reflected in guayadeque. The patch below makes it compile for me, but it still starts with an error dialog (message: /usr/src/debug/wxWidgets-3.2.0/src/generic/imaglist.cpp(56): assert "m_size != wxSize(0, 0)" failed in GetImageCount(): Invalid image list - I can click continue until guayadeque starts[only for debug builds] and now I can play music again.

A simplistic patch, but maybe someone can use it as a start (pull it here:https://github.com/sluedecke/guayadeque/tree/sl/wxwidgets-3.2):

diff --git a/src/ui/aui/AuiNotebook.cpp b/src/ui/aui/AuiNotebook.cpp
index f8178e4c..9c85f685 100644
--- a/src/ui/aui/AuiNotebook.cpp
+++ b/src/ui/aui/AuiNotebook.cpp
@@ -293,7 +293,7 @@ void guAuiTabArt::DrawTab(wxDC &dc, wxWindow * wnd, const wxAuiNotebookPage &pag
     int close_button_width = 0;
     if( close_button_state != wxAUI_BUTTON_STATE_HIDDEN )
     {
-        close_button_width = m_activeCloseBmp.GetWidth();
+      close_button_width = m_activeCloseBmp.GetDefaultSize().GetWidth();
     }
 
 
@@ -303,12 +303,12 @@ void guAuiTabArt::DrawTab(wxDC &dc, wxWindow * wnd, const wxAuiNotebookPage &pag
         bitmap_offset = tab_x + 8;
 
         // draw bitmap
-        dc.DrawBitmap(page.bitmap,
+        dc.DrawBitmap(page.bitmap.GetBitmap(page.bitmap.GetDefaultSize()), //  page.bitmap,
                       bitmap_offset,
-                      drawn_tab_yoff + (drawn_tab_height/2) - (page.bitmap.GetHeight()/2),
+                      drawn_tab_yoff + (drawn_tab_height/2) - (page.bitmap.GetDefaultSize().GetHeight()/2),
                       true);
 
-        text_offset = bitmap_offset + page.bitmap.GetWidth();
+        text_offset = bitmap_offset + page.bitmap.GetDefaultSize().GetWidth();
         text_offset += 3; // bitmap padding
     }
      else
@@ -331,12 +331,12 @@ void guAuiTabArt::DrawTab(wxDC &dc, wxWindow * wnd, const wxAuiNotebookPage &pag
     // draw close button if necessary
     if (close_button_state != wxAUI_BUTTON_STATE_HIDDEN)
     {
-        wxBitmap bmp = m_disabledCloseBmp;
+      wxBitmap bmp = m_disabledCloseBmp.GetBitmap(m_disabledCloseBmp.GetDefaultSize());
 
         if (close_button_state == wxAUI_BUTTON_STATE_HOVER ||
             close_button_state == wxAUI_BUTTON_STATE_PRESSED)
         {
-            bmp = m_activeCloseBmp;
+          bmp = m_activeCloseBmp.GetBitmap(m_activeCloseBmp.GetDefaultSize());
         }
 
         wxRect rect(tab_x + tab_width - close_button_width - 1,

@ben2talk
Copy link
Author

ben2talk commented Aug 1, 2022

Thanks for the tip - failed build for me.
/home/ben/guayadeque/src/ui/aui/AuiNotebook.cpp: In member function ‘virtual void Guayadeque::guAuiTabArt::DrawTab(wxDC&, wxWindow*, const wxAuiNotebookPage&, const wxRect&, int, wxRect*, wxRect*, int*)’: /home/ben/guayadeque/src/ui/aui/AuiNotebook.cpp:296:47: error: ‘class wxBitmapBundle’ has no member named ‘GetWidth’ 296 | close_button_width = m_activeCloseBmp.GetWidth(); | ^~~~~~~~ /home/ben/guayadeque/src/ui/aui/AuiNotebook.cpp:308:76: error: ‘const class wxBitmapBundle’ has no member named ‘GetHeight’ 308 | drawn_tab_yoff + (drawn_tab_height/2) - (page.bitmap.GetHeight()/2), | ^~~~~~~~~ /home/ben/guayadeque/src/ui/aui/AuiNotebook.cpp:311:51: error: ‘const class wxBitmapBundle’ has no member named ‘GetWidth’ 311 | text_offset = bitmap_offset + page.bitmap.GetWidth(); | ^~~~~~~~ /home/ben/guayadeque/src/ui/aui/AuiNotebook.cpp:334:24: error: conversion from ‘wxBitmapBundle’ to non-scalar type ‘wxBitmap’ requested 334 | wxBitmap bmp = m_disabledCloseBmp; | ^~~~~~~~~~~~~~~~~~ /home/ben/guayadeque/src/ui/aui/AuiNotebook.cpp:339:19: error: no match for ‘operator=’ (operand types are ‘wxBitmap’ and ‘wxBitmapBundle’) 339 | bmp = m_activeCloseBmp; | ^~~~~~~~~~~~~~~~ In file included from /usr/include/wx-3.2/wx/bitmap.h:318, from /usr/include/wx-3.2/wx/generic/panelg.h:14, from /usr/include/wx-3.2/wx/panel.h:69, from /usr/include/wx-3.2/wx/wx.h:40, from /home/ben/guayadeque/src/misc/Utils.h:25, from /home/ben/guayadeque/src/ui/aui/AuiNotebook.h:25, from /home/ben/guayadeque/src/ui/aui/AuiNotebook.cpp:22: /usr/include/wx-3.2/wx/gtk/bitmap.h:63:24: note: candidate: ‘wxBitmap& wxBitmap::operator=(const wxBitmap&)’ 63 | class WXDLLIMPEXP_CORE wxBitmap: public wxBitmapBase | ^~~~~~~~ /usr/include/wx-3.2/wx/gtk/bitmap.h:63:24: note: no known conversion for argument 1 from ‘wxBitmapBundle’ to ‘const wxBitmap&’ make[2]: *** [src/CMakeFiles/guayadeque.dir/build.make:720: src/CMakeFiles/guayadeque.dir/ui/aui/AuiNotebook.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:698: src/CMakeFiles/guayadeque.dir/all] Error 2 make: *** [Makefile:136: all] Error 2

@JohnyPeaN
Copy link

Thanks @sluedecke. Can confirm this works on arch linux. Used guayadeque-git PKGBUILD with patch and corrected build flags for wx 3.2.

@Strubbl
Copy link
Contributor

Strubbl commented Aug 1, 2022

@JohnyPeaN if you want, you could open a PR against https://github.com/Strubbl/aur-guayadeque-git so that i can update the aur package

@ben2talk
Copy link
Author

ben2talk commented Aug 2, 2022

Guayadeque-git built from AUR this morning - Thanks

@martinkg
Copy link

martinkg commented Aug 13, 2022

.

@marillat
Copy link

marillat commented Mar 7, 2023

Build fine with this patch under Debian unstable amd64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants