ladybird/Libraries/LibHTML/Frame.h
Andreas Kling fdbad6284c LibHTML: Implement the <blink> element
Just in time for Serenity's 1st birthday, here is the <blink> element!

This patch adds a bunch of different mechanisms to enable partial
repaints of the layout tree (LayoutNode::set_needs_display()))
It also adds LayoutNode::is_visible(), which can be toggled to prevent
a LayoutNode from rendering anything (it still takes up space though.)
2019-10-09 21:25:29 +02:00

36 lines
778 B
C++

#pragma once
#include <AK/Function.h>
#include <AK/Noncopyable.h>
#include <AK/RefPtr.h>
#include <AK/Weakable.h>
#include <LibDraw/Rect.h>
#include <LibDraw/Size.h>
#include <LibHTML/TreeNode.h>
class Document;
class Frame
: public TreeNode<Frame>
, public Weakable<Frame> {
public:
static NonnullRefPtr<Frame> create() { return adopt(*new Frame); }
~Frame();
const Document* document() const { return m_document; }
Document* document() { return m_document; }
void set_document(Document*);
const Size& size() const { return m_size; }
void set_size(const Size&);
void set_needs_display(const Rect&);
Function<void(const Rect&)> on_set_needs_display;
private:
Frame();
RefPtr<Document> m_document;
Size m_size;
};