Skip to content

Commit

Permalink
Fix CMake issue in RaspPI
Browse files Browse the repository at this point in the history
  • Loading branch information
frang75 committed Apr 3, 2024
1 parent 2828b85 commit 28f86a9
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 8 deletions.
2 changes: 1 addition & 1 deletion prj/NAppCompilers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set_property(CACHE CMAKE_ARCHITECTURE PROPERTY STRINGS arm64)

# ARM 32 bits
elseif (${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "armv7")
elseif (${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "armv7.*")
set(CMAKE_HOST_ARCHITECTURE "arm")
set(CMAKE_ARCHITECTURE "arm" CACHE STRING "Processor architecture")
set_property(CACHE CMAKE_ARCHITECTURE PROPERTY STRINGS arm)
Expand Down
2 changes: 1 addition & 1 deletion prj/NAppGCC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ macro(nap_gcc_warns)
# Disable flags
# In future try to adapt NAppGUI to remove these flags, making the code more robust
set(CFLAGS "${CFLAGS} -Wno-bad-function-cast -Wno-missing-prototypes -Wno-missing-declarations")
set(FLAGS "${FLAGS} -Wno-long-long -Wno-overlength-strings -Wno-aggregate-return -Wno-cast-qual -Wno-padded -Wno-switch-default -Wno-conversion -Wno-float-equal -Wno-format-nonliteral -Wno-switch-enum -Wno-redundant-decls -Wno-shadow -Wno-undef -Wno-missing-noreturn -Wno-stack-protector -Wno-missing-include-dirs")
set(FLAGS "${FLAGS} -Wno-long-long -Wno-overlength-strings -Wno-aggregate-return -Wno-cast-qual -Wno-padded -Wno-switch-default -Wno-conversion -Wno-float-equal -Wno-format-nonliteral -Wno-switch-enum -Wno-redundant-decls -Wno-shadow -Wno-undef -Wno-missing-noreturn -Wno-stack-protector -Wno-missing-include-dirs -Wno-cast-align")
set(CXXFLAGS "${CXXFLAGS} -Wnon-virtual-dtor -Woverloaded-virtual")

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAGS} ${CFLAGS}")
Expand Down
2 changes: 1 addition & 1 deletion prj/build.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4987
4993
24 changes: 24 additions & 0 deletions src/gui/panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,30 @@ static void i_hide_component(GuiComponent *component)

/*---------------------------------------------------------------------------*/

/*
* This function is not used in a general Layout-based composer.
* Is required for out-of-the-box uses of NAppGUI (eg. GTNAP)
*/
void _panel_dettach_component(Panel *panel, GuiComponent *component)
{
uint32_t index = UINT32_MAX;
cassert_no_null(panel);
cassert_no_null(component);

/* Prevent flickering in Windows because destroyed component new parent
will be set to NULL (Desktop HWND) when is detached from this panel. */
#if defined(__WINDOWS__)
i_hide_component(component);
#endif

_component_set_parent_window(component, NULL);
_component_detach_from_panel(&panel->component, component);
index = arrpt_find(panel->children, component, GuiComponent);
arrpt_delete(panel->children, index, NULL, GuiComponent);
}

/*---------------------------------------------------------------------------*/

void _panel_destroy_component(Panel *panel, GuiComponent *component)
{
bool_t exists = FALSE;
Expand Down
2 changes: 2 additions & 0 deletions src/gui/panel.inl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ void _panel_destroy_all(Panel **panel);

void _panel_attach_component(Panel *panel, GuiComponent *component);

void _panel_dettach_component(Panel *panel, GuiComponent *component);

void _panel_destroy_component(Panel *panel, GuiComponent *component);

void _panel_hide_all(Panel *panel);
Expand Down
8 changes: 4 additions & 4 deletions src/osgui/osx/ostext.m
Original file line number Diff line number Diff line change
Expand Up @@ -564,10 +564,10 @@ void ostext_editable(OSText *view, const bool_t is_editable)

void ostext_scroller_visible(OSText *view, const bool_t horizontal, const bool_t vertical)
{
unref(view);
unref(horizontal);
unref(vertical);
cassert(FALSE);
NSScrollView *sview = (NSScrollView *)view;
cassert_no_null(sview);
[sview setHasHorizontalScroller:(BOOL)horizontal];
[sview setHasVerticalScroller:(BOOL)vertical];
}

/*---------------------------------------------------------------------------*/
Expand Down
4 changes: 3 additions & 1 deletion src/osgui/win/osgui_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -712,8 +712,10 @@ void _osgui_remove_accelerator(WORD cmd)

arrst_foreach(accel, i_ACCELERATORS, ACCEL)
if (accel->cmd == cmd)
{
i = accel_i;
break;
break;
}
arrst_end()

cassert(i < arrst_size(i_ACCELERATORS, ACCEL));
Expand Down

0 comments on commit 28f86a9

Please sign in to comment.