mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:37:36 +00:00
LibGfx: Add forward declaration header
This patch adds <LibGfx/Forward.h> with forward declarations for Gfx.
This commit is contained in:
parent
184475d45a
commit
3fe2640c8c
37 changed files with 264 additions and 172 deletions
|
@ -30,6 +30,7 @@
|
|||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/MenuBar.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include <LibGUI/MenuBar.h>
|
||||
#include <LibGUI/Widget.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/MenuBar.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
*/
|
||||
|
||||
#include "HexEditorWidget.h"
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
|
|
@ -52,9 +52,9 @@ static void flood_fill(Gfx::Bitmap& bitmap, const Gfx::Point& start_position, Co
|
|||
while (!queue.is_empty()) {
|
||||
auto position = queue.dequeue();
|
||||
|
||||
if (bitmap.get_pixel<Gfx::Bitmap::Format::RGB32>(position.x(), position.y()) != target_color)
|
||||
if (bitmap.get_pixel<Gfx::BitmapFormat::RGB32>(position.x(), position.y()) != target_color)
|
||||
continue;
|
||||
bitmap.set_pixel<Gfx::Bitmap::Format::RGB32>(position.x(), position.y(), fill_color);
|
||||
bitmap.set_pixel<Gfx::BitmapFormat::RGB32>(position.x(), position.y(), fill_color);
|
||||
|
||||
if (position.x() != 0)
|
||||
queue.enqueue(position.translated(-1, 0));
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <LibGUI/Action.h>
|
||||
#include <LibGUI/Menu.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
|
||||
EraseTool::EraseTool()
|
||||
{
|
||||
|
|
|
@ -47,7 +47,7 @@ PaintableWidget::PaintableWidget(GUI::Widget* parent)
|
|||
pal.set_color(ColorRole::Window, Color::MidGray);
|
||||
set_palette(pal);
|
||||
set_background_color(Color::MidGray);
|
||||
m_bitmap = Gfx::Bitmap::create(Gfx::Bitmap::Format::RGB32, { 600, 400 });
|
||||
m_bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::RGB32, { 600, 400 });
|
||||
m_bitmap->fill(Color::White);
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ void SprayTool::paint_it()
|
|||
continue;
|
||||
if (ypos < 0 || ypos >= bitmap.height())
|
||||
continue;
|
||||
bitmap.set_pixel<Gfx::Bitmap::Format::RGB32>(xpos, ypos, m_color);
|
||||
bitmap.set_pixel<Gfx::BitmapFormat::RGB32>(xpos, ypos, m_color);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include <LibGUI/Menu.h>
|
||||
#include <LibGUI/MenuBar.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
|
|
@ -269,7 +269,7 @@ GUI::Variant ProcessModel::data(const GUI::ModelIndex& index, Role role) const
|
|||
if (thread.current_state.icon_id != -1) {
|
||||
auto icon_buffer = SharedBuffer::create_from_shared_buffer_id(thread.current_state.icon_id);
|
||||
if (icon_buffer) {
|
||||
auto icon_bitmap = Gfx::Bitmap::create_with_shared_buffer(Gfx::Bitmap::Format::RGBA32, *icon_buffer, { 16, 16 });
|
||||
auto icon_bitmap = Gfx::Bitmap::create_with_shared_buffer(Gfx::BitmapFormat::RGBA32, *icon_buffer, { 16, 16 });
|
||||
if (icon_bitmap)
|
||||
return *icon_bitmap;
|
||||
}
|
||||
|
|
|
@ -179,7 +179,7 @@ void TaskbarWindow::wm_event(GUI::WMEvent& event)
|
|||
if (auto* window = WindowList::the().window(identifier)) {
|
||||
auto buffer = SharedBuffer::create_from_shared_buffer_id(changed_event.icon_buffer_id());
|
||||
ASSERT(buffer);
|
||||
window->button()->set_icon(Gfx::Bitmap::create_with_shared_buffer(Gfx::Bitmap::Format::RGBA32, *buffer, changed_event.icon_size()));
|
||||
window->button()->set_icon(Gfx::Bitmap::create_with_shared_buffer(Gfx::BitmapFormat::RGBA32, *buffer, changed_event.icon_size()));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
*/
|
||||
|
||||
#include "TextEditorWidget.h"
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue