本文整理汇总了C++中sheet_updown函数的典型用法代码示例。如果您正苦于以下问题:C++ sheet_updown函数的具体用法?C++ sheet_updown怎么用?C++ sheet_updown使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sheet_updown函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sheet_free
void sheet_free(struct SHTCTL *ctl, struct SHEET *sht){
if(sht->height >= 0){
sheet_updown(ctl, sht, -1); // hide this sheet
}
sht->flags = 0; // indicate not using
return ;
}
示例2: sheet_free
/**
* @description 释放指定图层
* @param sht:欲释放的图层
*/
void sheet_free(struct SHEET *sht){
if (sht->height >= 0) {
sheet_updown(sht, -1); //置为隐藏
}
sht->flags = 0;
return;
}
示例3: sheet_free
// free the sheet
void sheet_free(struct SHEET *sht)
{
if (sht->height >= 0) {
sheet_updown(sht, -1); // first, let it hide
}
sht->flags = 0; // then, let it unused
return;
}
示例4: sheet_free
/////////////////////////////////////////////////////////////////////////////////////
//功能:释放已使用图层的内存的函数
//参数:
void sheet_free(struct SHEET *sht)
{
if (sht->height >= 0) {
sheet_updown(sht, -1); /* 如果处于显示状态,则先隐藏 */
}
sht->flags = 0; /* 标记为未使用 */
return;
}
示例5: sheet_free
void sheet_free(struct SHEET *sht)
{
if (sht->height >= 0) {
sheet_updown(sht, -1); /* make it invisible */
}
sht->flags = 0; /* set flag unused */
return;
}
示例6: sheet_free
void sheet_free(struct SHEET *sht) {
if(sht->height >= 0) {
/* first need to remove it from stack */
sheet_updown(sht, -1);
}
sht->flags = 0;
return;
}
示例7: sheet_free
void sheet_free(struct SHTCTL *ctl, struct SHEET *sht)
{
if (sht->height >= 0) {
sheet_updown(ctl, sht, -1);
}
sht->flags = 0;
return;
}
示例8: sheet_free
void sheet_free(struct SHTCTL *ctl, struct SHEET *sht)
{
if (sht->height >= 0) {
sheet_updown(ctl, sht, -1); /* 如果处于显示状态,则先设定为隐藏 */
}
sht->flags = 0; /* “未使用”标志 */
return;
}
示例9: sheet_free
void sheet_free(struct SHEET *sht)
{
if (sht->height >= 0) {
sheet_updown(sht, -1); /* 表示中ならまず非表示にする */
}
sht->flags = 0; /* 未使用マーク */
return;
}
示例10: sheet_free
void sheet_free(struct SHEET *sht)
{
if (sht->height >= 0) {
sheet_updown(sht, -1); /* 표시 중이라면 우선 비표시로 한다. */
}
sht->flags = 0; /* 미사용 마크 */
return;
}
示例11: task_now
int *hrb_api(int edi, int esi, int ebp, int esp, int ebx, int edx, int ecx, int eax)
{
int ds_base = *((int *) 0xfe8);
struct TASK *task = task_now();
struct CONSOLE *cons = (struct CONSOLE *) *((int *) 0x0fec);
struct SHTCTL *shtctl = (struct SHTCTL *) *((int *) 0x0fe4);
struct SHEET *sht;
int *reg = &eax + 1; /* eaxの次の番地 */
/* 保存のためのPUSHADを強引に書き換える */
/* reg[0] : EDI, reg[1] : ESI, reg[2] : EBP, reg[3] : ESP */
/* reg[4] : EBX, reg[5] : EDX, reg[6] : ECX, reg[7] : EAX */
if (edx == 1) {
cons_putchar(cons, eax & 0xff, 1);
} else if (edx == 2) {
cons_putstr0(cons, (char *) ebx + ds_base);
} else if (edx == 3) {
cons_putstr1(cons, (char *) ebx + ds_base, ecx);
} else if (edx == 4) {
return &(task->tss.esp0);
} else if (edx == 5) {
sht = sheet_alloc(shtctl);
sheet_setbuf(sht, (char *) ebx + ds_base, esi, edi, eax);
make_window8((char *) ebx + ds_base, esi, edi, (char *) ecx + ds_base, 0);
sheet_slide(sht, 100, 50);
sheet_updown(sht, 3); /* 3という高さはtask_aの上 */
reg[7] = (int) sht;
} else if (edx == 6) {
sht = (struct SHEET *) ebx;
putfonts8_asc(sht->buf, sht->bxsize, esi, edi, eax, (char *) ebp + ds_base);
sheet_refresh(sht, esi, edi, esi + ecx * 8, edi + 16);
} else if (edx == 7) {
sht = (struct SHEET *) ebx;
boxfill8(sht->buf, sht->bxsize, ebp, eax, ecx, esi, edi);
sheet_refresh(sht, eax, ecx, esi + 1, edi + 1);
} else if (edx == 8) {
memman_init((struct MEMMAN *) (ebx + ds_base));
ecx &= 0xfffffff0; /* 16バイト単位に */
memman_free((struct MEMMAN *) (ebx + ds_base), eax, ecx);
} else if (edx == 9) {
ecx = (ecx + 0x0f) & 0xfffffff0; /* 16バイト単位に切り上げ */
reg[7] = memman_alloc((struct MEMMAN *) (ebx + ds_base), ecx);
} else if (edx == 10) {
ecx = (ecx + 0x0f) & 0xfffffff0; /* 16バイト単位に切り上げ */
memman_free((struct MEMMAN *) (ebx + ds_base), eax, ecx);
} else if (edx == 11) {
sht = (struct SHEET *) ebx;
sht->buf[sht->bxsize * edi + esi] = eax;
sheet_refresh(sht, esi, edi, esi + 1, edi + 1);
}
return 0;
}
示例12: cmd_start
void cmd_start(struct CONSOLE *cons, char *cmdline, int memtotal)
{
struct SHTCTL *shtctl = (struct SHTCTL *) *((int *) 0x0fe4);
struct SHEET *sht = open_console(shtctl, memtotal);
struct FIFO32 *fifo = &sht->task->fifo;
int i;
sheet_slide(sht, 32, 4);
sheet_updown(sht, shtctl->top);
/* コマンドラインに入力された文字列を、一文字ずつ新しいコンソールに入力 */
for (i = 6; cmdline[i] != 0; i++) {
fifo32_put(fifo, cmdline[i] + 256);
}
fifo32_put(fifo, 10 + 256); /* Enter */
cons_newline(cons);
return;
}
示例13: HariMain
void HariMain(void)
{
struct BOOTINFO *binfo = (struct BOOTINFO *) ADR_BOOTINFO;
struct FIFO32 fifo;
char s[40];
int fifobuf[128];
struct TIMER *timer, *timer2, *timer3;
int mx, my, i, cursor_x, cursor_c; // cursor_x: 记录光标显示位置
unsigned int memtotal;
struct MOUSE_DEC mdec;
struct MEMMAN *memman = (struct MEMMAN *) MEMMAN_ADDR;
struct SHTCTL *shtctl;
struct SHEET *sht_back, *sht_mouse, *sht_win;
unsigned char *buf_back, buf_mouse[256], *buf_win;
static char keytable[0x54] = {
0, 0, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', 0, 0,
'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '[', ']', 0, 0, 'A', 'S',
'D', 'F', 'G', 'H', 'J', 'K', 'L', ';', ':', 0, 0, '\\', 'Z', 'X', 'C', 'V',
'B', 'N', 'M', ',', '.', '/', 0, '*', 0, ' ', 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, '7', '8', '9', '-', '4', '5', '6', '+', '1',
'2', '3', '0', '.'
};
init_gdtidt();
init_pic();
io_sti(); /* IDT/PIC的初始化结束,开启CPU中断 */
fifo32_init(&fifo, 128, fifobuf);
init_pit();
init_keyboard(&fifo, 256);
enable_mouse(&fifo, 512, &mdec);
io_out8(PIC0_IMR, 0xf8); /* 许可PIC1和键盘(11111000) */
io_out8(PIC1_IMR, 0xef); /* 许可鼠标(11101111) */
timer = timer_alloc();
timer_init(timer, &fifo, 10);
timer_settime(timer, 1000);
timer2 = timer_alloc();
timer_init(timer2, &fifo, 3);
timer_settime(timer2, 300);
timer3 = timer_alloc();
timer_init(timer3, &fifo, 1);
timer_settime(timer3, 50);
memtotal = memtest(0x00400000, 0xbfffffff); // 使用的内存空间,包含了0x00400000前已用的内存
memman_init(memman);
memman_free(memman, 0x00001000, 0x0009e000); /* 0x00001000 - 0x0009efff */
memman_free(memman, 0x00400000, memtotal - 0x00400000);
init_palette();
shtctl = shtctl_init(memman, binfo->vram, binfo->scrnx, binfo->scrny);
sht_back = sheet_alloc(shtctl);
sht_mouse = sheet_alloc(shtctl);
sht_win = sheet_alloc(shtctl);
buf_back = (unsigned char *) memman_alloc_4k(memman, binfo->scrnx * binfo->scrny);
buf_win = (unsigned char *) memman_alloc_4k(memman, 160 * 52);
sheet_setbuf(sht_back, buf_back, binfo->scrnx, binfo->scrny, -1); /* 没有透明色 */
sheet_setbuf(sht_mouse, buf_mouse, 16, 16, 99); // 透明色号99
sheet_setbuf(sht_win, buf_win, 160, 52, -1); /* 没有透明色 */
init_screen8(buf_back, binfo->scrnx, binfo->scrny);
init_mouse_cursor8(buf_mouse, 99);
make_window8(buf_win, 160, 52, "window");
make_textbox8(sht_win, 8, 28, 144, 16, COL8_FFFFFF);
cursor_x = 8;
cursor_c = COL8_FFFFFF;
sheet_slide(sht_back, 0, 0);
mx = (binfo->scrnx - 16) / 2;
my = (binfo->scrny - 28 - 16) / 2;
sheet_slide(sht_mouse, mx, my);
sheet_slide(sht_win, 80, 72);
sheet_updown(sht_back, 0);
sheet_updown(sht_win, 1);
sheet_updown(sht_mouse, 2);
sprintf(s, "(%3d, %3d)", mx, my);
putfonts8_asc_sht(sht_back, 0, 0, COL8_FFFFFF, COL8_008484, s, 10);
sprintf(s, "memory %dMB free : %dKB", memtotal / (1024 * 1024), memman_total(memman) / 1024);
putfonts8_asc_sht(sht_back, 0, 32, COL8_FFFFFF, COL8_008484, s, 40);
for (;;) {
io_cli();
if (fifo32_status(&fifo) == 0) {
/* J
char ss[10];
sprintf(ss, "%c", "J");
putfonts8_asc(binfo->vram, binfo->scrnx, 100, 100, COL8_FFFFFF, ss);
*/
io_stihlt();
} else {
i = fifo32_get(&fifo);
io_sti();
if (256 <= i && i <= 511) { /* 键盘数据 */
sprintf(s, "%02X", i - 256);
putfonts8_asc_sht(sht_back, 0, 16, COL8_FFFFFF, COL8_008484, s, 2);
if (i < 256 + 0x54) {
if (keytable[i - 256] != 0 && cursor_x < 144) { /* 通常文字 */
/* 显示1个字符就前移1次光标 */
s[0] = keytable[i - 256];
s[1] = 0;
//.........这里部分代码省略.........
示例14: HariMain
//.........这里部分代码省略.........
// Task Settings
//=====================
task_a = task_init(memman);
fifo.task = task_a;
task_run (task_a, 1, 0);
/* console sheet */
sht_cons = sheet_alloc(shtctl);
buf_cons = (unsigned char *)memman_alloc_4k(memman, 256 * 165);
sheet_setbuf (sht_cons, buf_cons, 256, 165, -1);
make_window8 (buf_cons, 256, 165, "console", 0);
make_textbox8 (sht_cons, 8, 28, 240, 128, COL8_000000);
task_cons = task_alloc ();
task_cons->tss.esp = memman_alloc_4k (memman, 64 * 1024) + 64 * 1024 - 12;
task_cons->tss.eip = (int)&console_task;
task_cons->tss.es = 1 * 8;
task_cons->tss.cs = 2 * 8;
task_cons->tss.ss = 1 * 8;
task_cons->tss.ds = 1 * 8;
task_cons->tss.fs = 1 * 8;
task_cons->tss.gs = 1 * 8;
*((int *) (task_cons->tss.esp + 4)) = (int) sht_cons;
*((int *) (task_cons->tss.esp + 8)) = (int) memtotal;
task_run (task_cons, 1, 0); /* level = 2, priority = 2 */
//=======================
// Sheet Setting
//=======================
sheet_slide (sht_back, 0, 0);
sheet_slide (sht_mouse, mx, my);
sheet_slide (sht_cons, 32, 4);
sheet_slide (sht_win, 64, 56);
sheet_updown (sht_back, 0);
sheet_updown (sht_cons, 1);
sheet_updown (sht_win, 2);
sheet_updown (sht_mouse, 3);
sheet_refresh (sht_back, 0, 0, binfo->scrnx, 48);
fifo32_put (&keycmd, KEYCMD_LED);
fifo32_put (&keycmd, key_leds);
for (;;) {
if (fifo32_status(&keycmd) > 0 && keycmd_wait < 0) {
keycmd_wait = fifo32_get(&keycmd);
wait_KBC_sendready ();
io_out8(PORT_KEYDAT, keycmd_wait);
}
io_cli();
if (fifo32_status(&fifo) == 0) {
task_sleep(task_a);
io_sti();
} else {
i = fifo32_get(&fifo);
io_sti();
if (256 <= i && i <= 511) { // Keyboard Data
// sprintf (s, "%x", i - 256);
// putfonts8_asc_sht (sht_back, 0, 16, COL8_FFFFFF, COL8_008484, s, 2);
if (i < 0x80 + 256) {
if (key_shift == 0) {
s[0] = keytable0[i - 256];
} else {
s[0] = keytable1[i - 256];
}
} else {
示例15: HariMain
void HariMain(void)
{
struct BOOTINFO *binfo = (struct BOOTINFO *) ADR_BOOTINFO;
struct SHTCTL *shtctl;
char s[40];
struct FIFO32 fifo, keycmd;
int fifobuf[128], keycmd_buf[32];
int mx, my, i, new_mx = -1, new_my = 0, new_wx = 0x7fffffff, new_wy = 0;
unsigned int memtotal;
struct MOUSE_DEC mdec;
struct MEMMAN *memman = (struct MEMMAN *) MEMMAN_ADDR;
unsigned char *buf_back, buf_mouse[256];
struct SHEET *sht_back, *sht_mouse;
struct TASK *task_a, *task;
static char keytable0[0x80] = {
0, 0, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '^', 0x08, 0,
'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '@', '[', 0x0a, 0, 'A', 'S',
'D', 'F', 'G', 'H', 'J', 'K', 'L', ';', ':', 0, 0, ']', 'Z', 'X', 'C', 'V',
'B', 'N', 'M', ',', '.', '/', 0, '*', 0, ' ', 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, '7', '8', '9', '-', '4', '5', '6', '+', '1',
'2', '3', '0', '.', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0x5c, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x5c, 0, 0
};
static char keytable1[0x80] = {
0, 0, '!', 0x22, '#', '$', '%', '&', 0x27, '(', ')', '~', '=', '~', 0x08, 0,
'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '`', '{', 0x0a, 0, 'A', 'S',
'D', 'F', 'G', 'H', 'J', 'K', 'L', '+', '*', 0, 0, '}', 'Z', 'X', 'C', 'V',
'B', 'N', 'M', '<', '>', '?', 0, '*', 0, ' ', 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, '7', '8', '9', '-', '4', '5', '6', '+', '1',
'2', '3', '0', '.', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, '_', 0, 0, 0, 0, 0, 0, 0, 0, 0, '|', 0, 0
};
int key_shift = 0, key_leds = (binfo->leds >> 4) & 7, keycmd_wait = -1;
int j, x, y, mmx = -1, mmy = -1, mmx2 = 0;
struct SHEET *sht = 0, *key_win;
init_gdtidt();
init_pic();
io_sti(); /* IDT/PICの初期化が終わったのでCPUの割り込み禁止を解除 */
fifo32_init(&fifo, 128, fifobuf, 0);
*((int *) 0x0fec) = (int) &fifo;
init_pit();
init_keyboard(&fifo, 256);
enable_mouse(&fifo, 512, &mdec);
io_out8(PIC0_IMR, 0xf8); /* PITとPIC1とキーボードを許可(11111000) */
io_out8(PIC1_IMR, 0xef); /* マウスを許可(11101111) */
fifo32_init(&keycmd, 32, keycmd_buf, 0);
memtotal = memtest(0x00400000, 0xbfffffff);
memman_init(memman);
memman_free(memman, 0x00001000, 0x0009e000); /* 0x00001000 - 0x0009efff */
memman_free(memman, 0x00400000, memtotal - 0x00400000);
init_palette();
shtctl = shtctl_init(memman, binfo->vram, binfo->scrnx, binfo->scrny);
task_a = task_init(memman);
fifo.task = task_a;
task_run(task_a, 1, 2);
*((int *) 0x0fe4) = (int) shtctl;
/* sht_back */
sht_back = sheet_alloc(shtctl);
buf_back = (unsigned char *) memman_alloc_4k(memman, binfo->scrnx * binfo->scrny);
sheet_setbuf(sht_back, buf_back, binfo->scrnx, binfo->scrny, -1); /* 透明色なし */
init_screen8(buf_back, binfo->scrnx, binfo->scrny);
/* sht_cons */
key_win = open_console(shtctl, memtotal);
/* sht_mouse */
sht_mouse = sheet_alloc(shtctl);
sheet_setbuf(sht_mouse, buf_mouse, 16, 16, 99);
init_mouse_cursor8(buf_mouse, 99);
mx = (binfo->scrnx - 16) / 2; /* 画面中央になるように座標計算 */
my = (binfo->scrny - 28 - 16) / 2;
sheet_slide(sht_back, 0, 0);
sheet_slide(key_win, 32, 4);
sheet_slide(sht_mouse, mx, my);
sheet_updown(sht_back, 0);
sheet_updown(key_win, 1);
sheet_updown(sht_mouse, 2);
keywin_on(key_win);
/* 最初にキーボード状態との食い違いがないように、設定しておくことにする */
fifo32_put(&keycmd, KEYCMD_LED);
fifo32_put(&keycmd, key_leds);
for (;;) {
if (fifo32_status(&keycmd) > 0 && keycmd_wait < 0) {
/* キーボードコントローラに送るデータがあれば、送る */
keycmd_wait = fifo32_get(&keycmd);
wait_KBC_sendready();
io_out8(PORT_KEYDAT, keycmd_wait);
}
io_cli();
if (fifo32_status(&fifo) == 0) {
/* FIFOがからっぽになったので、保留している描画があれば実行する */
//.........这里部分代码省略.........