diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-01-19 23:22:46 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-01-19 23:22:46 +0100 |
commit | 7e5b81fe4807f89868af61ab27b53f003d607167 (patch) | |
tree | 219fa209115c2708d56be06205aff43b01279cf3 | |
parent | b75ee4aacbf41539d73f494da5aba468310b71b9 (diff) | |
download | serenity-7e5b81fe4807f89868af61ab27b53f003d607167.zip |
Make a SharedGraphics directory for classes shared between Kernel and LibGUI.
-rw-r--r-- | Kernel/GUITypes.h | 4 | ||||
-rw-r--r-- | Kernel/Makefile | 16 | ||||
-rw-r--r-- | Kernel/ProcessGUI.cpp | 2 | ||||
-rw-r--r-- | LibC/Makefile | 16 | ||||
-rw-r--r-- | SharedGraphics/.gitignore | 1 | ||||
-rw-r--r-- | SharedGraphics/CharacterBitmap.cpp (renamed from Widgets/CharacterBitmap.cpp) | 0 | ||||
-rw-r--r-- | SharedGraphics/CharacterBitmap.h (renamed from Widgets/CharacterBitmap.h) | 0 | ||||
-rw-r--r-- | SharedGraphics/Color.cpp (renamed from Widgets/Color.cpp) | 0 | ||||
-rw-r--r-- | SharedGraphics/Color.h (renamed from Widgets/Color.h) | 0 | ||||
-rw-r--r-- | SharedGraphics/Font.cpp (renamed from Widgets/Font.cpp) | 0 | ||||
-rw-r--r-- | SharedGraphics/Font.h (renamed from Widgets/Font.h) | 0 | ||||
-rw-r--r-- | SharedGraphics/GraphicsBitmap.cpp (renamed from Widgets/GraphicsBitmap.cpp) | 0 | ||||
-rw-r--r-- | SharedGraphics/GraphicsBitmap.h (renamed from Widgets/GraphicsBitmap.h) | 0 | ||||
-rw-r--r-- | SharedGraphics/Painter.cpp (renamed from Widgets/Painter.cpp) | 7 | ||||
-rw-r--r-- | SharedGraphics/Painter.h (renamed from Widgets/Painter.h) | 0 | ||||
-rw-r--r-- | SharedGraphics/Peanut8x10.h (renamed from Widgets/Peanut8x10.h) | 0 | ||||
-rw-r--r-- | SharedGraphics/Peanut8x8.h (renamed from Widgets/Peanut8x8.h) | 0 | ||||
-rw-r--r-- | SharedGraphics/Point.h (renamed from Widgets/Point.h) | 0 | ||||
-rw-r--r-- | SharedGraphics/Rect.cpp (renamed from Widgets/Rect.cpp) | 0 | ||||
-rw-r--r-- | SharedGraphics/Rect.h (renamed from Widgets/Rect.h) | 0 | ||||
-rw-r--r-- | SharedGraphics/Size.h (renamed from Widgets/Size.h) | 0 | ||||
-rw-r--r-- | Terminal/Terminal.cpp | 4 | ||||
-rw-r--r-- | Terminal/Terminal.h | 4 | ||||
-rw-r--r-- | Terminal/main.cpp | 6 | ||||
-rw-r--r-- | Userland/guitest.cpp | 4 | ||||
-rw-r--r-- | WindowServer/WSEvent.h | 4 | ||||
-rw-r--r-- | WindowServer/WSScreen.h | 6 | ||||
-rw-r--r-- | WindowServer/WSWindow.h | 4 | ||||
-rw-r--r-- | WindowServer/WSWindowManager.cpp | 4 | ||||
-rw-r--r-- | WindowServer/WSWindowManager.h | 6 | ||||
-rw-r--r-- | WindowServer/main.cpp | 2 |
31 files changed, 49 insertions, 41 deletions
diff --git a/Kernel/GUITypes.h b/Kernel/GUITypes.h index 9572c97a59..c72e3e98e7 100644 --- a/Kernel/GUITypes.h +++ b/Kernel/GUITypes.h @@ -1,7 +1,7 @@ #pragma once -#include <Widgets/Color.h> -#include <Widgets/Rect.h> +#include <SharedGraphics/Color.h> +#include <SharedGraphics/Rect.h> // GUI system call API types. diff --git a/Kernel/Makefile b/Kernel/Makefile index b18bc828b3..e5fe2846a1 100644 --- a/Kernel/Makefile +++ b/Kernel/Makefile @@ -46,13 +46,15 @@ VFS_OBJS = \ ../VirtualFileSystem/FileDescriptor.o \ ../VirtualFileSystem/SyntheticFileSystem.o +SHAREDGRAPHICS_OBJS = \ + ../SharedGraphics/Rect.o \ + ../SharedGraphics/Painter.o \ + ../SharedGraphics/Font.o \ + ../SharedGraphics/Color.o \ + ../SharedGraphics/CharacterBitmap.o \ + ../SharedGraphics/GraphicsBitmap.o + WINDOWSERVER_OBJS = \ - ../Widgets/Rect.o \ - ../Widgets/Painter.o \ - ../Widgets/Font.o \ - ../Widgets/Color.o \ - ../Widgets/CharacterBitmap.o \ - ../Widgets/GraphicsBitmap.o \ ../WindowServer/WSEventReceiver.o \ ../WindowServer/WSEventLoop.o \ ../WindowServer/WSWindow.o \ @@ -66,7 +68,7 @@ AK_OBJS = \ ../AK/StringBuilder.o \ ../AK/FileSystemPath.o -OBJS = $(KERNEL_OBJS) $(VFS_OBJS) $(AK_OBJS) $(WINDOWSERVER_OBJS) +OBJS = $(KERNEL_OBJS) $(VFS_OBJS) $(AK_OBJS) $(WINDOWSERVER_OBJS) $(SHAREDGRAPHICS_OBJS) NASM = nasm KERNEL = kernel diff --git a/Kernel/ProcessGUI.cpp b/Kernel/ProcessGUI.cpp index 25b520b43e..7ca3976622 100644 --- a/Kernel/ProcessGUI.cpp +++ b/Kernel/ProcessGUI.cpp @@ -1,7 +1,7 @@ #include "Process.h" #include "MemoryManager.h" #include <LibC/errno_numbers.h> -#include <Widgets/Font.h> +#include <SharedGraphics/Font.h> #include <WindowServer/WSScreen.h> #include <WindowServer/WSEventLoop.h> #include <WindowServer/WSWindow.h> diff --git a/LibC/Makefile b/LibC/Makefile index 5ee5958a3a..5a471c7c3b 100644 --- a/LibC/Makefile +++ b/LibC/Makefile @@ -5,13 +5,13 @@ AK_OBJS = \ ../AK/FileSystemPath.o \ ../AK/kmalloc.o -WIDGETS_OBJS = \ - ../Widgets/Painter.o \ - ../Widgets/Font.o \ - ../Widgets/Rect.o \ - ../Widgets/GraphicsBitmap.o \ - ../Widgets/CharacterBitmap.o \ - ../Widgets/Color.o +SHAREDGRAPHICS_OBJS = \ + ../SharedGraphics/Painter.o \ + ../SharedGraphics/Font.o \ + ../SharedGraphics/Rect.o \ + ../SharedGraphics/GraphicsBitmap.o \ + ../SharedGraphics/CharacterBitmap.o \ + ../SharedGraphics/Color.o LIBC_OBJS = \ stdio.o \ @@ -45,7 +45,7 @@ LIBC_OBJS = \ sys/select.o \ entry.o -OBJS = $(AK_OBJS) $(WIDGETS_OBJS) $(LIBC_OBJS) +OBJS = $(AK_OBJS) $(WIDGETS_OBJS) $(LIBC_OBJS) $(SHAREDGRAPHICS_OBJS) LIBRARY = LibC.a ARCH_FLAGS = diff --git a/SharedGraphics/.gitignore b/SharedGraphics/.gitignore new file mode 100644 index 0000000000..5761abcfdf --- /dev/null +++ b/SharedGraphics/.gitignore @@ -0,0 +1 @@ +*.o diff --git a/Widgets/CharacterBitmap.cpp b/SharedGraphics/CharacterBitmap.cpp index 3ba69c8e99..3ba69c8e99 100644 --- a/Widgets/CharacterBitmap.cpp +++ b/SharedGraphics/CharacterBitmap.cpp diff --git a/Widgets/CharacterBitmap.h b/SharedGraphics/CharacterBitmap.h index 917cff92a5..917cff92a5 100644 --- a/Widgets/CharacterBitmap.h +++ b/SharedGraphics/CharacterBitmap.h diff --git a/Widgets/Color.cpp b/SharedGraphics/Color.cpp index 6d34582ebc..6d34582ebc 100644 --- a/Widgets/Color.cpp +++ b/SharedGraphics/Color.cpp diff --git a/Widgets/Color.h b/SharedGraphics/Color.h index bf302e65bc..bf302e65bc 100644 --- a/Widgets/Color.h +++ b/SharedGraphics/Color.h diff --git a/Widgets/Font.cpp b/SharedGraphics/Font.cpp index 31c918db58..31c918db58 100644 --- a/Widgets/Font.cpp +++ b/SharedGraphics/Font.cpp diff --git a/Widgets/Font.h b/SharedGraphics/Font.h index c420b8eef9..c420b8eef9 100644 --- a/Widgets/Font.h +++ b/SharedGraphics/Font.h diff --git a/Widgets/GraphicsBitmap.cpp b/SharedGraphics/GraphicsBitmap.cpp index 00dcd3707a..00dcd3707a 100644 --- a/Widgets/GraphicsBitmap.cpp +++ b/SharedGraphics/GraphicsBitmap.cpp diff --git a/Widgets/GraphicsBitmap.h b/SharedGraphics/GraphicsBitmap.h index 050518f3ba..050518f3ba 100644 --- a/Widgets/GraphicsBitmap.h +++ b/SharedGraphics/GraphicsBitmap.h diff --git a/Widgets/Painter.cpp b/SharedGraphics/Painter.cpp index 8943d84411..486803a25a 100644 --- a/Widgets/Painter.cpp +++ b/SharedGraphics/Painter.cpp @@ -1,10 +1,13 @@ #include "Painter.h" -#include "Widget.h" #include "Font.h" #include "GraphicsBitmap.h" #include <AK/Assertions.h> #include <AK/StdLibExtras.h> +#ifdef LIBGUI +#include <LibGUI/Widget.h> +#endif + #define DEBUG_WIDGET_UNDERDRAW Painter::Painter(GraphicsBitmap& bitmap) @@ -14,6 +17,7 @@ Painter::Painter(GraphicsBitmap& bitmap) m_clip_rect = { { 0, 0 }, bitmap.size() }; } +#ifdef LIBGUI Painter::Painter(Widget& widget) : m_font(&widget.font()) { @@ -30,6 +34,7 @@ Painter::Painter(Widget& widget) fill_rect(widget.rect(), Color::Red); #endif } +#endif Painter::~Painter() { diff --git a/Widgets/Painter.h b/SharedGraphics/Painter.h index adf41a3805..adf41a3805 100644 --- a/Widgets/Painter.h +++ b/SharedGraphics/Painter.h diff --git a/Widgets/Peanut8x10.h b/SharedGraphics/Peanut8x10.h index 3a9d3a6b53..3a9d3a6b53 100644 --- a/Widgets/Peanut8x10.h +++ b/SharedGraphics/Peanut8x10.h diff --git a/Widgets/Peanut8x8.h b/SharedGraphics/Peanut8x8.h index d4e9815a0b..d4e9815a0b 100644 --- a/Widgets/Peanut8x8.h +++ b/SharedGraphics/Peanut8x8.h diff --git a/Widgets/Point.h b/SharedGraphics/Point.h index 222eddcb46..222eddcb46 100644 --- a/Widgets/Point.h +++ b/SharedGraphics/Point.h diff --git a/Widgets/Rect.cpp b/SharedGraphics/Rect.cpp index 5b01bf2e1e..5b01bf2e1e 100644 --- a/Widgets/Rect.cpp +++ b/SharedGraphics/Rect.cpp diff --git a/Widgets/Rect.h b/SharedGraphics/Rect.h index e99e6d6ded..e99e6d6ded 100644 --- a/Widgets/Rect.h +++ b/SharedGraphics/Rect.h diff --git a/Widgets/Size.h b/SharedGraphics/Size.h index 4e5a4ea811..4e5a4ea811 100644 --- a/Widgets/Size.h +++ b/SharedGraphics/Size.h diff --git a/Terminal/Terminal.cpp b/Terminal/Terminal.cpp index 8c2aeab0d7..3e7728b1ca 100644 --- a/Terminal/Terminal.cpp +++ b/Terminal/Terminal.cpp @@ -1,7 +1,7 @@ #include "Terminal.h" #include <AK/AKString.h> -#include <Widgets/Font.h> -#include <Widgets/Painter.h> +#include <SharedGraphics/Font.h> +#include <SharedGraphics/Painter.h> #include <AK/StdLibExtras.h> #include <unistd.h> #include <stdio.h> diff --git a/Terminal/Terminal.h b/Terminal/Terminal.h index 50b6ecf03f..a13511af7d 100644 --- a/Terminal/Terminal.h +++ b/Terminal/Terminal.h @@ -3,8 +3,8 @@ #include <AK/AKString.h> #include <AK/Types.h> #include <AK/Vector.h> -#include <Widgets/GraphicsBitmap.h> -#include <Widgets/Rect.h> +#include <SharedGraphics/GraphicsBitmap.h> +#include <SharedGraphics/Rect.h> class Font; diff --git a/Terminal/main.cpp b/Terminal/main.cpp index 4ee790c966..2f8f94e212 100644 --- a/Terminal/main.cpp +++ b/Terminal/main.cpp @@ -5,9 +5,9 @@ #include <stdlib.h> #include <fcntl.h> #include <assert.h> -#include <Widgets/Font.h> -#include <Widgets/GraphicsBitmap.h> -#include <Widgets/Painter.h> +#include <SharedGraphics/Font.h> +#include <SharedGraphics/GraphicsBitmap.h> +#include <SharedGraphics/Painter.h> #include <sys/ioctl.h> #include <sys/select.h> #include <gui.h> diff --git a/Userland/guitest.cpp b/Userland/guitest.cpp index 6b2caf0b7c..b923eb8f9e 100644 --- a/Userland/guitest.cpp +++ b/Userland/guitest.cpp @@ -6,8 +6,8 @@ #include <fcntl.h> #include <assert.h> #include <Kernel/Syscall.h> -#include <Widgets/GraphicsBitmap.h> -#include <Widgets/Painter.h> +#include <SharedGraphics/GraphicsBitmap.h> +#include <SharedGraphics/Painter.h> #include "gui.h" static void paint(GraphicsBitmap& bitmap, int width, int height); diff --git a/WindowServer/WSEvent.h b/WindowServer/WSEvent.h index 8a3a4ce99d..b8b817daae 100644 --- a/WindowServer/WSEvent.h +++ b/WindowServer/WSEvent.h @@ -1,7 +1,7 @@ #pragma once -#include <Widgets/Point.h> -#include <Widgets/Rect.h> +#include <SharedGraphics/Point.h> +#include <SharedGraphics/Rect.h> #include <AK/AKString.h> #include <AK/Types.h> diff --git a/WindowServer/WSScreen.h b/WindowServer/WSScreen.h index 5fa88dcb29..c75684f069 100644 --- a/WindowServer/WSScreen.h +++ b/WindowServer/WSScreen.h @@ -1,8 +1,8 @@ #pragma once -#include <Widgets/Rect.h> -#include <Widgets/Size.h> -#include <Widgets/Color.h> +#include <SharedGraphics/Rect.h> +#include <SharedGraphics/Size.h> +#include <SharedGraphics/Color.h> #include <Kernel/Keyboard.h> class WSScreen { diff --git a/WindowServer/WSWindow.h b/WindowServer/WSWindow.h index 1e2b54fb2b..2e1beb52eb 100644 --- a/WindowServer/WSWindow.h +++ b/WindowServer/WSWindow.h @@ -1,7 +1,7 @@ #pragma once -#include <Widgets/Rect.h> -#include <Widgets/GraphicsBitmap.h> +#include <SharedGraphics/Rect.h> +#include <SharedGraphics/GraphicsBitmap.h> #include <AK/AKString.h> #include <AK/InlineLinkedList.h> #include "WSEventReceiver.h" diff --git a/WindowServer/WSWindowManager.cpp b/WindowServer/WSWindowManager.cpp index 372051e090..6ce1c3c209 100644 --- a/WindowServer/WSWindowManager.cpp +++ b/WindowServer/WSWindowManager.cpp @@ -5,8 +5,8 @@ #include "Process.h" #include "MemoryManager.h" #include <Kernel/ProcFileSystem.h> -#include <Widgets/Painter.h> -#include <Widgets/CharacterBitmap.h> +#include <SharedGraphics/Painter.h> +#include <SharedGraphics/CharacterBitmap.h> #include <AK/StdLibExtras.h> //#define DEBUG_COUNTERS diff --git a/WindowServer/WSWindowManager.h b/WindowServer/WSWindowManager.h index 69a30c5ab8..c695751d32 100644 --- a/WindowServer/WSWindowManager.h +++ b/WindowServer/WSWindowManager.h @@ -1,8 +1,8 @@ #pragma once -#include <Widgets/Rect.h> -#include <Widgets/Color.h> -#include <Widgets/Painter.h> +#include <SharedGraphics/Rect.h> +#include <SharedGraphics/Color.h> +#include <SharedGraphics/Painter.h> #include <AK/HashTable.h> #include <AK/InlineLinkedList.h> #include <AK/WeakPtr.h> diff --git a/WindowServer/main.cpp b/WindowServer/main.cpp index 10dc450fbb..6497c895e6 100644 --- a/WindowServer/main.cpp +++ b/WindowServer/main.cpp @@ -1,5 +1,5 @@ #include "Process.h" -#include <Widgets/Font.h> +#include <SharedGraphics/Font.h> #include <WindowServer/WSScreen.h> #include <WindowServer/WSWindowManager.h> #include <WindowServer/WSEventLoop.h> |