Skip to content

Commit

Permalink
Merge branch 'master' of github.com:cppfw/ruisapp
Browse files Browse the repository at this point in the history
  • Loading branch information
igagis committed Jul 30, 2024
2 parents 27b5d45 + eb4f877 commit 92220a1
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
matrix:
include:
- {os: debian, codename: bookworm, image_owner: , package_type: deb}
- {os: debian, codename: bookworm, image_owner: arm32v7/, package_type: deb, labels: [arm,docker]}
- {os: debian, codename: bookworm, image_owner: arm32v7/, package_type: deb, labels: [arm32,docker]}
- {os: debian, codename: bookworm, image_owner: arm64v8/, package_type: deb, labels: [arm64,docker]}
runs-on: ${{ (matrix.labels == '' && 'ubuntu-latest') || matrix.labels }}
container: ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
libruisapp (0.2.104) unstable; urgency=medium

* update

-- Ivan Gagis <[email protected]> Sun, 07 Jul 2024 21:14:01 +0300

libruisapp (0.2.103) unstable; urgency=medium

* wyaland: touch events, untested
Expand Down
4 changes: 2 additions & 2 deletions examples/basic/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <ruisapp/application.hpp>

#include <ruis/widgets/label/TextLabel.hpp>
#include <ruis/widgets/button/Button.hpp>
#include <ruis/widget/label/TextLabel.hpp>
#include <ruis/widget/button/Button.hpp>


class Application : public ruisapp::application{
Expand Down
15 changes: 11 additions & 4 deletions src/ruisapp/glue/linux/glue_wayland.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <nitki/queue.hpp>
#include <opros/wait_set.hpp>
#include <papki/fs_file.hpp>
#include <ruis/widgets/widget.hpp>
#include <ruis/widget/widget.hpp>
#include <sys/mman.h>
#include <utki/destructable.hpp>
#include <utki/unicode.hpp>
Expand Down Expand Up @@ -2385,8 +2385,10 @@ int main(int argc, const char** argv)
while (!ww.quit_flag.load()) {
// std::cout << "loop" << std::endl;

// prepare wayland queue for waiting for events
while (wl_display_prepare_read(ww.display.disp) != 0) {
// there are events in wayland queue
// there are events in wayland queue, dispatch them, as we need empty queue
// when we start waiting for events on the queue
if (wl_display_dispatch_pending(ww.display.disp) < 0) {
throw std::runtime_error(utki::cat("wl_display_dispatch_pending() failed: ", strerror(errno)));
}
Expand All @@ -2410,7 +2412,13 @@ int main(int argc, const char** argv)
wait_set.change(ww.waitable, {opros::ready::read}, &ww.waitable);
}

wait_set.wait(app.gui.update());
// sequence:
// - update updateables
// - render
// - wait for events/next cycle
auto to_wait_ms = app.gui.update();
render(app);
wait_set.wait(to_wait_ms);

// std::cout << "waited" << std::endl;

Expand Down Expand Up @@ -2467,7 +2475,6 @@ int main(int argc, const char** argv)
}
}
}
render(app);
}

return 0;
Expand Down
10 changes: 7 additions & 3 deletions src/ruisapp/glue/linux/glue_xorg.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,13 @@ int main(int argc, const char** argv)
render(*app);

while (!ww.quit_flag.load()) {
wait_set.wait(app->gui.update());
// sequence:
// - update updateables
// - render
// - wait for events/next cycle
auto to_wait_ms = app->gui.update();
render(*app);
wait_set.wait(to_wait_ms);

auto triggered_events = wait_set.get_triggered();

Expand Down Expand Up @@ -1492,8 +1498,6 @@ int main(int argc, const char** argv)
if (new_win_dims.is_positive_or_zero()) {
update_window_rect(*app, ruis::rect(0, new_win_dims));
}

render(*app);
}

wait_set.remove(ww.ui_queue);
Expand Down
8 changes: 5 additions & 3 deletions src/ruisapp/glue/macosx/glue.mm
Original file line number Diff line number Diff line change
Expand Up @@ -729,10 +729,12 @@ int main(int argc, const char** argv){
}

do{
render(ruisapp::inst());

// sequence:
// - update updateables
// - render
// - wait for events/next cycle
uint32_t millis = ruisapp::inst().gui.update();

render(ruisapp::inst());
NSEvent *event = [ww.applicationObjectId
nextEventMatchingMask:NSEventMaskAny
untilDate:[NSDate dateWithTimeIntervalSinceNow:(double(millis) / 1000.0)]
Expand Down
9 changes: 5 additions & 4 deletions src/ruisapp/glue/windows/glue.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -738,9 +738,12 @@ void winmain(int argc, const char** argv)
ShowWindow(ww.hwnd, SW_SHOW);

while (!ww.quitFlag) {
// sequence:
// - update updateables
// - render
// - wait for events/next cycle
uint32_t timeout = app->gui.update();
// TRACE(<< "timeout = " << timeout << std::endl)

render(*app);
DWORD status = MsgWaitForMultipleObjectsEx(0, nullptr, timeout, QS_ALLINPUT, MWMO_INPUTAVAILABLE);

// TRACE(<< "msg" << std::endl)
Expand All @@ -758,8 +761,6 @@ void winmain(int argc, const char** argv)
DispatchMessage(&msg);
}
}

render(*app);
// TRACE(<< "loop" << std::endl)
}
}
Expand Down
40 changes: 20 additions & 20 deletions tests/app/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,30 @@

#include <ruis/config.hpp>

#include <ruis/widgets/widget.hpp>
#include <ruis/widgets/container.hpp>
#include <ruis/widgets/proxy/key_proxy.hpp>
#include <ruis/widget/widget.hpp>
#include <ruis/widget/container.hpp>
#include <ruis/widget/proxy/key_proxy.hpp>

#include <ruis/widgets/button/base/push_button.hpp>
#include <ruis/widgets/label/text.hpp>
#include <ruis/widget/button/base/push_button.hpp>
#include <ruis/widget/label/text.hpp>

#include <ruis/res/texture_2d.hpp>

#include <ruis/widgets/input/character_input_widget.hpp>
#include <ruis/widgets/group/scroll_area.hpp>
#include <ruis/widgets/proxy/mouse_proxy.hpp>
#include <ruis/widgets/slider/scroll_bar.hpp>
#include <ruis/widgets/group/list.hpp>
#include <ruis/widgets/group/tree_view.hpp>
#include <ruis/widgets/proxy/resize_proxy.hpp>
#include <ruis/widgets/proxy/click_proxy.hpp>
#include <ruis/widgets/label/color.hpp>
#include <ruis/widgets/label/image.hpp>
#include <ruis/widgets/input/text_input_line.hpp>

#include <ruis/widgets/button/drop_down_box.hpp>

#include <ruis/layouts/linear_layout.hpp>
#include <ruis/widget/input/character_input_widget.hpp>
#include <ruis/widget/group/scroll_area.hpp>
#include <ruis/widget/proxy/mouse_proxy.hpp>
#include <ruis/widget/slider/scroll_bar.hpp>
#include <ruis/widget/group/list.hpp>
#include <ruis/widget/group/tree_view.hpp>
#include <ruis/widget/proxy/resize_proxy.hpp>
#include <ruis/widget/proxy/click_proxy.hpp>
#include <ruis/widget/label/color.hpp>
#include <ruis/widget/label/image.hpp>
#include <ruis/widget/input/text_input_line.hpp>

#include <ruis/widget/button/drop_down_box.hpp>

#include <ruis/layout/linear_layout.hpp>

#ifdef assert
# undef assert
Expand Down

0 comments on commit 92220a1

Please sign in to comment.