提交 d0dcd4b4 编写于 作者: 指向BIOS的野指针's avatar 指向BIOS的野指针

add macro definition BWLAPI

上级 aafc35fe
......@@ -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;
......
......@@ -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);
};
......
......@@ -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 *);
};
};
......
......@@ -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) //帧率转间隔
};
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册