mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:37:43 +00:00
Kernel: Remove ProcessGUI.cpp, merging remainders into Process.cpp.
This commit is contained in:
parent
c4703bedea
commit
8d5ba56cf9
4 changed files with 24 additions and 49 deletions
|
@ -5,7 +5,6 @@ KERNEL_OBJS = \
|
||||||
StdLib.o \
|
StdLib.o \
|
||||||
i386.o \
|
i386.o \
|
||||||
Process.o \
|
Process.o \
|
||||||
ProcessGUI.o \
|
|
||||||
i8253.o \
|
i8253.o \
|
||||||
Keyboard.o \
|
Keyboard.o \
|
||||||
CMOS.o \
|
CMOS.o \
|
||||||
|
|
|
@ -18,7 +18,8 @@
|
||||||
#include "Scheduler.h"
|
#include "Scheduler.h"
|
||||||
#include "FIFO.h"
|
#include "FIFO.h"
|
||||||
#include "KSyms.h"
|
#include "KSyms.h"
|
||||||
#include <WindowServer/WSWindow.h>
|
#include <WindowServer/WSMessageLoop.h>
|
||||||
|
#include <Kernel/BochsVGADevice.h>
|
||||||
#include "MasterPTY.h"
|
#include "MasterPTY.h"
|
||||||
#include "elf.h"
|
#include "elf.h"
|
||||||
|
|
||||||
|
@ -48,7 +49,7 @@ void Process::initialize()
|
||||||
s_hostname = new String("courage");
|
s_hostname = new String("courage");
|
||||||
s_hostname_lock = new Lock;
|
s_hostname_lock = new Lock;
|
||||||
Scheduler::initialize();
|
Scheduler::initialize();
|
||||||
initialize_gui_statics();
|
new WSMessageLoop;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector<pid_t> Process::all_pids()
|
Vector<pid_t> Process::all_pids()
|
||||||
|
@ -2133,7 +2134,9 @@ void Process::finalize()
|
||||||
{
|
{
|
||||||
ASSERT(current == g_finalizer);
|
ASSERT(current == g_finalizer);
|
||||||
|
|
||||||
destroy_all_windows();
|
if (WSMessageLoop::the().running())
|
||||||
|
WSMessageLoop::the().notify_client_died(gui_client_id());
|
||||||
|
|
||||||
m_fds.clear();
|
m_fds.clear();
|
||||||
m_tty = nullptr;
|
m_tty = nullptr;
|
||||||
|
|
||||||
|
@ -2221,3 +2224,21 @@ bool Process::tick()
|
||||||
++m_ticks_in_kernel;
|
++m_ticks_in_kernel;
|
||||||
return --m_ticks_left;
|
return --m_ticks_left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DisplayInfo Process::set_video_resolution(int width, int height)
|
||||||
|
{
|
||||||
|
DisplayInfo info;
|
||||||
|
info.width = width;
|
||||||
|
info.height = height;
|
||||||
|
info.bpp = 32;
|
||||||
|
info.pitch = width * 4;
|
||||||
|
size_t framebuffer_size = width * height * 4 * 2;
|
||||||
|
if (!m_display_framebuffer_region) {
|
||||||
|
auto framebuffer_vmo = VMObject::create_framebuffer_wrapper(BochsVGADevice::the().framebuffer_address(), framebuffer_size);
|
||||||
|
m_display_framebuffer_region = allocate_region_with_vmo(LinearAddress(0xe0000000), framebuffer_size, move(framebuffer_vmo), 0, "framebuffer", true, true);
|
||||||
|
}
|
||||||
|
info.framebuffer = m_display_framebuffer_region->laddr().as_ptr();
|
||||||
|
|
||||||
|
BochsVGADevice::the().set_resolution(width, height);
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
|
@ -222,8 +222,6 @@ public:
|
||||||
DisplayInfo set_video_resolution(int width, int height);
|
DisplayInfo set_video_resolution(int width, int height);
|
||||||
|
|
||||||
static void initialize();
|
static void initialize();
|
||||||
static void initialize_gui_statics();
|
|
||||||
void destroy_all_windows();
|
|
||||||
|
|
||||||
void crash() NORETURN;
|
void crash() NORETURN;
|
||||||
static int reap(Process&) WARN_UNUSED_RESULT;
|
static int reap(Process&) WARN_UNUSED_RESULT;
|
||||||
|
|
|
@ -1,43 +0,0 @@
|
||||||
#include "Process.h"
|
|
||||||
#include "MemoryManager.h"
|
|
||||||
#include <LibC/errno_numbers.h>
|
|
||||||
#include <SharedGraphics/Font.h>
|
|
||||||
#include <WindowServer/WSScreen.h>
|
|
||||||
#include <WindowServer/WSMessageLoop.h>
|
|
||||||
#include <WindowServer/WSWindow.h>
|
|
||||||
#include <WindowServer/WSWindowManager.h>
|
|
||||||
#include <WindowServer/WSMenuBar.h>
|
|
||||||
#include <Kernel/BochsVGADevice.h>
|
|
||||||
|
|
||||||
//#define LOG_GUI_SYSCALLS
|
|
||||||
|
|
||||||
void Process::initialize_gui_statics()
|
|
||||||
{
|
|
||||||
new WSMessageLoop;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Process::destroy_all_windows()
|
|
||||||
{
|
|
||||||
if (!WSMessageLoop::the().running())
|
|
||||||
return;
|
|
||||||
dbgprintf("Sending death notification for client_id %d\n", gui_client_id());
|
|
||||||
WSMessageLoop::the().notify_client_died(gui_client_id());
|
|
||||||
}
|
|
||||||
|
|
||||||
DisplayInfo Process::set_video_resolution(int width, int height)
|
|
||||||
{
|
|
||||||
DisplayInfo info;
|
|
||||||
info.width = width;
|
|
||||||
info.height = height;
|
|
||||||
info.bpp = 32;
|
|
||||||
info.pitch = width * 4;
|
|
||||||
size_t framebuffer_size = width * height * 4 * 2;
|
|
||||||
if (!m_display_framebuffer_region) {
|
|
||||||
auto framebuffer_vmo = VMObject::create_framebuffer_wrapper(BochsVGADevice::the().framebuffer_address(), framebuffer_size);
|
|
||||||
m_display_framebuffer_region = allocate_region_with_vmo(LinearAddress(0xe0000000), framebuffer_size, move(framebuffer_vmo), 0, "framebuffer", true, true);
|
|
||||||
}
|
|
||||||
info.framebuffer = m_display_framebuffer_region->laddr().as_ptr();
|
|
||||||
|
|
||||||
BochsVGADevice::the().set_resolution(width, height);
|
|
||||||
return info;
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue