Squash commits for public release
This commit is contained in:
6
libs/libapi/BUILD.gn
Normal file
6
libs/libapi/BUILD.gn
Normal file
@@ -0,0 +1,6 @@
|
||||
import("//build/libs/TEMPLATE.gni")
|
||||
|
||||
xOS_static_library("libapi") {
|
||||
sources = []
|
||||
configs = [ "//build/libs:lib_flags" ]
|
||||
}
|
||||
1407
libs/libapi/include/libapi/window_server/Connections/WSConnection.h
Normal file
1407
libs/libapi/include/libapi/window_server/Connections/WSConnection.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,53 @@
|
||||
# .ipc files should be regenerated with connection compiler "PROJECT_ROOT/utils/compilers/ConnectionCompiler/connc {input} {output}"
|
||||
# or run "PROJECT_ROOT/utils/codeassistant/recompile_connections.py"
|
||||
#
|
||||
# After regeneration you have to recompile the whole project to apply changes.
|
||||
|
||||
{
|
||||
KEYPROTECTED
|
||||
NAME: BaseWindowServerDecoder
|
||||
MAGIC: 320
|
||||
GreetMessage() => GreetMessageReply(uint32_t connection_id)
|
||||
CreateWindowMessage(int type, uint32_t width, uint32_t height, int buffer_id, LIPC::StringEncoder title, LIPC::StringEncoder icon_path, LIPC::StringEncoder bundle_id, uint32_t color, uint32_t menubar_style) => CreateWindowMessageReply(uint32_t window_id)
|
||||
DestroyWindowMessage(uint32_t window_id) => DestroyWindowMessageReply(uint32_t status)
|
||||
SetBufferMessage(uint32_t window_id, int buffer_id, int format, LG::Rect bounds)
|
||||
SetBarStyleMessage(uint32_t window_id, uint32_t color, uint32_t menubar_style)
|
||||
SetTitleMessage(uint32_t window_id, LIPC::StringEncoder title)
|
||||
InvalidateMessage(uint32_t window_id, LG::Rect rect)
|
||||
AskBringToFrontMessage(uint32_t window_id, uint32_t target_window_id)
|
||||
|
||||
# MenuBar
|
||||
MenuBarCreateMenuMessage(uint32_t window_id, LIPC::StringEncoder title) => MenuBarCreateMenuMessageReply(int status, int menu_id)
|
||||
MenuBarCreateItemMessage(uint32_t window_id, int menu_id, int item_id, LIPC::StringEncoder title) => MenuBarCreateItemMessageReply(int status)
|
||||
|
||||
# Popup
|
||||
PopupShowMenuMessage(uint32_t window_id, LG::Point<int> point, LIPC::VectorEncoder<LIPC::StringEncoder> data) => PopupShowMenuMessageReply(int status, int menu_id)
|
||||
}
|
||||
{
|
||||
KEYPROTECTED
|
||||
NAME: BaseWindowClientDecoder
|
||||
MAGIC: 737
|
||||
MouseMoveMessage(int win_id, uint32_t x, uint32_t y)
|
||||
MouseActionMessage(int win_id, int type, uint32_t x, uint32_t y)
|
||||
MouseLeaveMessage(int win_id, uint32_t x, uint32_t y)
|
||||
MouseWheelMessage(int win_id, int wheel_data, uint32_t x, uint32_t y)
|
||||
KeyboardMessage(int win_id, uint32_t kbd_key)
|
||||
|
||||
# Service Messages
|
||||
DisplayMessage(LG::Rect rect)
|
||||
WindowCloseRequestMessage(int win_id)
|
||||
ResizeMessage(int win_id, LG::Rect rect)
|
||||
DisconnectMessage(int reason)
|
||||
|
||||
# MenuBar
|
||||
MenuBarActionMessage(int win_id, int menu_id, int item_id)
|
||||
|
||||
# Popup
|
||||
PopupActionMessage(int win_id, int menu_id, int item_id)
|
||||
|
||||
# Notifications
|
||||
NotifyWindowCreateMessage(int win_id, LIPC::StringEncoder bundle_id, LIPC::StringEncoder icon_path, int changed_window_id, int changed_window_type)
|
||||
NotifyWindowStatusChangedMessage(int win_id, int changed_window_id, int type)
|
||||
NotifyWindowTitleChangedMessage(int win_id, int changed_window_id, LIPC::StringEncoder title)
|
||||
NotifyWindowIconChangedMessage(int win_id, int changed_window_id, LIPC::StringEncoder icon_path)
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include <libg/Color.h>
|
||||
|
||||
struct StatusBarStyle {
|
||||
public:
|
||||
enum Mode : uint32_t {
|
||||
LightText = (1 << 0),
|
||||
HideText = (1 << 1),
|
||||
};
|
||||
|
||||
StatusBarStyle()
|
||||
: m_flags(0)
|
||||
, m_color(LG::Color::LightSystemBackground)
|
||||
{
|
||||
}
|
||||
|
||||
StatusBarStyle(uint32_t attr)
|
||||
: m_flags(attr)
|
||||
{
|
||||
}
|
||||
|
||||
StatusBarStyle(Mode attr)
|
||||
: m_flags(uint32_t(attr))
|
||||
{
|
||||
}
|
||||
|
||||
StatusBarStyle(uint32_t attr, const LG::Color& clr)
|
||||
: m_flags(attr)
|
||||
, m_color(clr)
|
||||
{
|
||||
}
|
||||
|
||||
StatusBarStyle(Mode attr, const LG::Color& clr)
|
||||
: m_flags(uint32_t(attr))
|
||||
, m_color(clr)
|
||||
{
|
||||
}
|
||||
|
||||
explicit StatusBarStyle(const LG::Color& clr)
|
||||
: m_flags(0)
|
||||
, m_color(clr)
|
||||
{
|
||||
}
|
||||
|
||||
struct StandardLightType {
|
||||
};
|
||||
static const StandardLightType StandardLight;
|
||||
StatusBarStyle(StandardLightType)
|
||||
: m_flags(0)
|
||||
, m_color(LG::Color::LightSystemBackground)
|
||||
{
|
||||
}
|
||||
|
||||
struct StandardOpaqueType {
|
||||
};
|
||||
static const StandardOpaqueType StandardOpaque;
|
||||
StatusBarStyle(StandardOpaqueType)
|
||||
: m_flags(0)
|
||||
, m_color(LG::Color::Opaque)
|
||||
{
|
||||
}
|
||||
|
||||
~StatusBarStyle() = default;
|
||||
|
||||
inline bool hide_text() const { return has_attr(Mode::HideText); }
|
||||
inline bool show_text() const { return !hide_text(); }
|
||||
|
||||
inline bool light_text() const { return has_attr(Mode::LightText); }
|
||||
inline bool dark_text() const { return !light_text(); }
|
||||
|
||||
inline StatusBarStyle& set_light_text()
|
||||
{
|
||||
set_attr(Mode::LightText);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline StatusBarStyle& set_dark_text()
|
||||
{
|
||||
rem_attr(Mode::LightText);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline StatusBarStyle& set_hide_text()
|
||||
{
|
||||
set_attr(Mode::HideText);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline StatusBarStyle& set_show_text()
|
||||
{
|
||||
rem_attr(Mode::HideText);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline uint32_t flags() const { return m_flags; }
|
||||
inline void set_flags(uint32_t attr) { m_flags = attr; }
|
||||
|
||||
inline StatusBarStyle& set_mode(Mode attr)
|
||||
{
|
||||
m_flags = (uint32_t)attr;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline const LG::Color& color() const { return m_color; }
|
||||
inline void set_color(const LG::Color& clr) { m_color = clr; }
|
||||
|
||||
private:
|
||||
inline bool has_attr(Mode mode) const { return ((m_flags & (uint32_t)mode) == (uint32_t)mode); }
|
||||
inline void set_attr(Mode mode) { m_flags |= (uint32_t)mode; }
|
||||
inline void rem_attr(Mode mode) { m_flags = m_flags & (~(uint32_t)mode); }
|
||||
|
||||
uint32_t m_flags { 0 };
|
||||
LG::Color m_color { LG::Color::LightSystemBackground };
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
enum MouseActionType {
|
||||
LeftMouseButtonPressed,
|
||||
LeftMouseButtonReleased,
|
||||
RightMouseButtonPressed,
|
||||
RightMouseButtonReleased,
|
||||
};
|
||||
|
||||
class MouseActionState {
|
||||
public:
|
||||
MouseActionState() = default;
|
||||
~MouseActionState() = default;
|
||||
|
||||
inline int state() const { return m_state; }
|
||||
inline void set(MouseActionType state) { m_state |= (int)state; }
|
||||
|
||||
private:
|
||||
int m_state { 0 };
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
enum WindowType : int {
|
||||
Standard = 0,
|
||||
Homescreen = 1,
|
||||
AppList = 2,
|
||||
};
|
||||
|
||||
enum WindowStatusUpdateType : int {
|
||||
Changed,
|
||||
Minimized,
|
||||
Removed,
|
||||
};
|
||||
Reference in New Issue
Block a user