Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BadOS Project
BWL
提交
d0dcd4b4
B
BWL
项目概览
BadOS Project
/
BWL
通知
0
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
BWL
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
d0dcd4b4
编写于
7月 22, 2022
作者:
指向BIOS的野指针
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add macro definition BWLAPI
上级
aafc35fe
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
43 addition
and
37 deletion
+43
-37
includes/bsv.hh
includes/bsv.hh
+21
-21
includes/bwl.hh
includes/bwl.hh
+3
-3
includes/pipe.hh
includes/pipe.hh
+11
-9
includes/syscfg.hh
includes/syscfg.hh
+6
-4
includes/types.hh
includes/types.hh
+2
-0
未找到文件。
includes/bsv.hh
浏览文件 @
d0dcd4b4
...
...
@@ -13,14 +13,14 @@ namespace bwl
const
uint32_t
MAX_OWNERS
=
512
;
const
uint32_t
MAX_FRAMES
=
512
;
enum
colorspace
//色彩空间
enum
BWLAPI
colorspace
//色彩空间
{
rgb
,
hsv
,
cmyk
,
};
struct
__frame
struct
BWLAPI
__frame
{
id_t
fid
;
//窗口id
pid_t
owner
;
//所属进程
...
...
@@ -49,7 +49,7 @@ namespace bwl
char
name
[
0
];
//窗口名
};
struct
__page
struct
BWLAPI
__page
{
id_t
pgid
;
//页id
pid_t
owners
[
MAX_OWNERS
];
//所有所属进程
...
...
@@ -72,13 +72,13 @@ namespace bwl
* @return __page*
*/
#define CREATE_PAGE_FAULT (__page *)(-2)
__page
*
createPage
(
id_t
pgid
);
__page
*
BWLAPI
createPage
(
id_t
pgid
);
/**
* @brief 销毁页
*
*/
void
deletePage
(
__page
*
);
void
BWLAPI
deletePage
(
__page
*
);
/**
* @brief 创建窗口
...
...
@@ -94,13 +94,13 @@ namespace bwl
*/
#define CREATE_FRAME_FAULT (__frame *)(-2)
#define TRUNCATE_SHM_FAULT (__frame *)(-3)
__frame
*
createFrame
(
id_t
fid
,
__page
*
page
,
std
::
string
name
,
uint64_t
width
,
uint64_t
height
,
int64_t
x
,
int64_t
y
);
__frame
*
BWLAPI
createFrame
(
id_t
fid
,
__page
*
page
,
std
::
string
name
,
uint64_t
width
,
uint64_t
height
,
int64_t
x
,
int64_t
y
);
/**
* @brief 销毁窗口
*
*/
void
deleteFrame
(
__frame
*
);
void
BWLAPI
deleteFrame
(
__frame
*
);
#ifndef __bwl_hh_ //用户库中没有此函数
...
...
@@ -111,7 +111,7 @@ namespace bwl
* @param height
* @param pix_depth
*/
void
setmonitor
(
int
width
,
int
height
,
int
pix_depth
);
void
BWLAPI
setmonitor
(
int
width
,
int
height
,
int
pix_depth
);
#endif
/**
...
...
@@ -119,34 +119,34 @@ namespace bwl
*
* @return uint64_t
*/
uint64_t
getBgBuffSize
();
uint64_t
BWLAPI
getBgBuffSize
();
/**
* @brief 获取显示器宽
*
* @return uint64_t
*/
uint64_t
getMonitorWidth
();
uint64_t
BWLAPI
getMonitorWidth
();
/**
* @brief 获取显示器高
*
* @return uint64_t
*/
uint64_t
getMonitorHeight
();
uint64_t
BWLAPI
getMonitorHeight
();
/**
* @brief 获取像素深度
*
* @return int
*/
int
getPixDepth
();
int
BWLAPI
getPixDepth
();
/* client-server exchange
用户-服务器信息交流
*/
enum
requests
enum
BWLAPI
requests
{
create_page
,
//创建页
del_page
,
//删除页
...
...
@@ -157,7 +157,7 @@ namespace bwl
wakeup
,
//唤醒使服务器刷新屏幕
};
struct
arg_req_creafra
struct
BWLAPI
arg_req_creafra
{
id_t
pgid
;
uint64_t
size
[
2
];
...
...
@@ -167,33 +167,33 @@ namespace bwl
colorspace
space
;
};
struct
arg_req_delfra
struct
BWLAPI
arg_req_delfra
{
id_t
fid
;
};
struct
arg_req_creapg
struct
BWLAPI
arg_req_creapg
{
colorspace
bgspace
;
};
struct
arg_req_delpg
struct
BWLAPI
arg_req_delpg
{
id_t
pgid
;
};
struct
arg_req_switch
struct
BWLAPI
arg_req_switch
{
id_t
pgid
;
id_t
fid
;
};
struct
arg_req_jmppage
struct
BWLAPI
arg_req_jmppage
{
id_t
pgid
;
};
union
arg_req_t
union
BWLAPI
arg_req_t
{
arg_req_creafra
a_create_frame
;
arg_req_delfra
a_del_frame
;
...
...
@@ -212,7 +212,7 @@ namespace bwl
* 魔数(防止其它程序向管道乱发数据,魔数没有对应则扔掉此请求)
*
*/
struct
req_pack
struct
BWLAPI
req_pack
{
requests
request
;
pid_t
pid
;
...
...
includes/bwl.hh
浏览文件 @
d0dcd4b4
...
...
@@ -17,7 +17,7 @@ namespace bwl
*
* @param __monitor_device
*/
void
initBadWayland
(
std
::
string
__monitor_device
);
void
BWLAPI
initBadWayland
(
std
::
string
__monitor_device
);
/**
* @brief 获得一个页
...
...
@@ -25,7 +25,7 @@ namespace bwl
* @param pgid
* @return void*
*/
__page
*
getPage
(
id_t
pgid
);
__page
*
BWLAPI
getPage
(
id_t
pgid
);
/**
* @brief 获得一个窗口
...
...
@@ -33,7 +33,7 @@ namespace bwl
* @param fid
* @return void*
*/
__frame
*
getFrame
(
id_t
fid
);
__frame
*
BWLAPI
getFrame
(
id_t
fid
);
};
...
...
includes/pipe.hh
浏览文件 @
d0dcd4b4
...
...
@@ -3,6 +3,8 @@
#include <iostream>
#include "types.hh"
/**
* @brief 管道
*
...
...
@@ -12,7 +14,7 @@
namespace
bwl
{
class
Pipe
class
BWLAPI
Pipe
{
private:
int
fd
;
...
...
@@ -23,17 +25,17 @@ namespace bwl
static
const
int
in
=
055
;
static
const
int
out
=
077
;
Pipe
();
Pipe
(
std
::
string
,
int
mode
);
~
Pipe
();
BWLAPI
Pipe
();
BWLAPI
Pipe
(
std
::
string
,
int
mode
);
BWLAPI
~
Pipe
();
int
read
(
char
*
buffer
,
int
size
);
int
write
(
char
*
buffer
,
int
size
);
int
BWLAPI
read
(
char
*
buffer
,
int
size
);
int
BWLAPI
write
(
char
*
buffer
,
int
size
);
void
open
(
std
::
string
path
,
int
mode
);
void
close
();
void
BWLAPI
open
(
std
::
string
path
,
int
mode
);
void
BWLAPI
close
();
Pipe
*
operator
<<
(
void
*
);
Pipe
*
BWLAPI
operator
<<
(
void
*
);
};
};
...
...
includes/syscfg.hh
浏览文件 @
d0dcd4b4
...
...
@@ -3,6 +3,8 @@
#include <iostream>
#include "types.hh"
namespace
bwl
{
namespace
server
...
...
@@ -15,21 +17,21 @@ namespace bwl
*
* @param opt
*/
void
loadCfgFromFs
(
uint64_t
opt
);
void
BWLAPI
loadCfgFromFs
(
uint64_t
opt
);
/**
* @brief 获取系统帧率
*
* @return uint32_t
*/
_Float64x
getFPS
();
_Float64x
BWLAPI
getFPS
();
/**
* @brief 设置帧率
*
* @param fps
*/
void
setFPS
(
_Float64x
fps
);
void
BWLAPI
setFPS
(
_Float64x
fps
);
/**
* @brief 获取显示器大小
...
...
@@ -37,7 +39,7 @@ namespace bwl
* @param width
* @param height
*/
void
getMoniSize
(
uint64_t
*
width
,
uint64_t
*
height
);
void
BWLAPI
getMoniSize
(
uint64_t
*
width
,
uint64_t
*
height
);
#define interval(fps) (1000 / fps) //帧率转间隔
};
...
...
includes/types.hh
浏览文件 @
d0dcd4b4
...
...
@@ -11,6 +11,8 @@
extern
std
::
string
monitor_device
;
#endif
#define BWLAPI
#define SIGBWLREQ 38
#define SIGREQRECV 35
#define REQMAGIC 0xa68c5cce7be74433
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录