mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:07:35 +00:00
PixelPaint: Expose the GUI event loop from the ImageEditor
This allows processing threads to call back into the GUI.
This commit is contained in:
parent
056b081e2d
commit
9483adee46
2 changed files with 6 additions and 0 deletions
|
@ -30,6 +30,7 @@ constexpr int marching_ant_length = 4;
|
||||||
ImageEditor::ImageEditor(NonnullRefPtr<Image> image)
|
ImageEditor::ImageEditor(NonnullRefPtr<Image> image)
|
||||||
: m_image(move(image))
|
: m_image(move(image))
|
||||||
, m_title("Untitled")
|
, m_title("Untitled")
|
||||||
|
, m_gui_event_loop(Core::EventLoop::current())
|
||||||
{
|
{
|
||||||
set_focus_policy(GUI::FocusPolicy::StrongFocus);
|
set_focus_policy(GUI::FocusPolicy::StrongFocus);
|
||||||
m_undo_stack.push(make<ImageUndoCommand>(*m_image, String()));
|
m_undo_stack.push(make<ImageUndoCommand>(*m_image, String()));
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "Image.h"
|
#include "Image.h"
|
||||||
#include "Selection.h"
|
#include "Selection.h"
|
||||||
#include <AK/Variant.h>
|
#include <AK/Variant.h>
|
||||||
|
#include <LibCore/EventLoop.h>
|
||||||
#include <LibGUI/AbstractZoomPanWidget.h>
|
#include <LibGUI/AbstractZoomPanWidget.h>
|
||||||
#include <LibGUI/Frame.h>
|
#include <LibGUI/Frame.h>
|
||||||
#include <LibGUI/UndoStack.h>
|
#include <LibGUI/UndoStack.h>
|
||||||
|
@ -114,6 +115,8 @@ public:
|
||||||
void draw_marching_ants(Gfx::Painter&, Gfx::IntRect const&) const;
|
void draw_marching_ants(Gfx::Painter&, Gfx::IntRect const&) const;
|
||||||
void draw_marching_ants(Gfx::Painter&, Mask const&) const;
|
void draw_marching_ants(Gfx::Painter&, Mask const&) const;
|
||||||
|
|
||||||
|
Core::EventLoop& gui_event_loop() { return m_gui_event_loop; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit ImageEditor(NonnullRefPtr<Image>);
|
explicit ImageEditor(NonnullRefPtr<Image>);
|
||||||
|
|
||||||
|
@ -179,6 +182,8 @@ private:
|
||||||
int m_marching_ants_offset { 0 };
|
int m_marching_ants_offset { 0 };
|
||||||
|
|
||||||
void draw_marching_ants_pixel(Gfx::Painter&, int x, int y) const;
|
void draw_marching_ants_pixel(Gfx::Painter&, int x, int y) const;
|
||||||
|
|
||||||
|
Core::EventLoop& m_gui_event_loop;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue