本文整理汇总了C++中showcursor函数的典型用法代码示例。如果您正苦于以下问题:C++ showcursor函数的具体用法?C++ showcursor怎么用?C++ showcursor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了showcursor函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: r_core_visual_hud
static int r_core_visual_hud(RCore *core) {
const char *f = R2_LIBDIR"/radare2/"R2_VERSION"/hud/main";
char *homehud = r_str_home (R2_HOMEDIR"/hud");
char *res = NULL;
char *p = 0;
showcursor (core, R_TRUE);
if (homehud)
res = r_cons_hud_file (homehud);
if (!res) {
if (r_file_exists (f))
res = r_cons_hud_file (f);
else r_cons_message ("Cannot find hud file");
}
r_cons_clear ();
if (res) {
p = strchr (res, '\t');
core->printidx = 1;
r_cons_printf ("%s\n", res);
r_cons_flush ();
if (p) r_core_cmd0 (core, p+1);
free (res);
}
showcursor (core, R_FALSE);
r_cons_flush ();
free (homehud);
return (int)(size_t)p;
}
开发者ID:revskills,项目名称:radare2,代码行数:28,代码来源:visual.c
示例2: r_core_visual_hud
R_API int r_core_visual_hud(RCore *core) {
const char *c = r_config_get (core->config, "hud.path");
const char *f = R2_LIBDIR"/radare2/"R2_VERSION"/hud/main";
char *homehud = r_str_home (R2_HOMEDIR"/hud");
char *res = NULL;
char *p = 0;
showcursor (core, true);
if (c && *c && r_file_exists (c))
res = r_cons_hud_file (c);
if (!res && homehud)
res = r_cons_hud_file (homehud);
if (!res && r_file_exists (f))
res = r_cons_hud_file (f);
if (!res)
r_cons_message ("Cannot find hud file");
r_cons_clear ();
if (res) {
p = strchr (res, '\t');
r_cons_printf ("%s\n", res);
r_cons_flush ();
if (p) r_core_cmd0 (core, p+1);
free (res);
}
showcursor (core, false);
r_cons_flush ();
free (homehud);
return (int)(size_t)p;
}
开发者ID:xuwenbo,项目名称:radare2,代码行数:30,代码来源:visual.c
示例3: r_core_visual_prompt
R_API int r_core_visual_prompt (RCore *core) {
char buf[1024];
int ret;
#if __UNIX__
r_line_set_prompt (Color_RESET":> ");
#else
r_line_set_prompt (":> ");
#endif
showcursor (core, true);
r_cons_fgets (buf, sizeof (buf), 0, NULL);
if (!strcmp (buf, "q")) {
ret = false;
} else if (*buf) {
r_line_hist_add (buf);
r_core_cmd (core, buf, 0);
r_cons_flush ();
ret = true;
} else {
ret = false;
//r_cons_any_key (NULL);
r_cons_clear00 ();
showcursor (core, false);
}
return ret;
}
开发者ID:xuwenbo,项目名称:radare2,代码行数:25,代码来源:visual.c
示例4: r_core_visual_prompt
R_API int r_core_visual_prompt (RCore *core) {
char buf[1024];
int ret;
ut64 oseek = core->offset;
#if __UNIX__
r_line_set_prompt (Color_RESET":> ");
#else
r_line_set_prompt (":> ");
#endif
showcursor (core, R_TRUE);
r_cons_fgets (buf, sizeof (buf), 0, NULL);
if (*buf) {
r_line_hist_add (buf);
r_core_cmd (core, buf, 0);
r_cons_flush ();
ret = R_TRUE;
} else {
ret = R_FALSE;
//r_cons_any_key ();
r_cons_clear00 ();
showcursor (core, R_FALSE);
}
if (curset) r_core_seek (core, oseek, 1);
return ret;
}
开发者ID:revskills,项目名称:radare2,代码行数:25,代码来源:visual.c
示例5: main
/// Main loop and input handling
int main() {
hidecursor();
gen(level);
setColor(2);
printf("Welcome! Use WASD to move.\n");
setColor(6);
printf("Hit any key to start.\n");
anykey();
draw();
while (1) {
// Input
if (kbhit()) {
char k = getch();
int oldx = x, oldy = y;
if (k == 'a') { --x; ++moves; }
else if (k == 'd') { ++x; ++moves; }
else if (k == 'w') { --y; ++moves; }
else if (k == 's') { ++y; ++moves; }
else if (k == 27) break;
// Collisions
if (lvl[x][y] & WALL) { x = oldx; y = oldy; }
else if (lvl[x][y] & COIN) { coins++; lvl[x][y] ^= COIN; }
else if (lvl[x][y] & TORCH) { torch+=20; lvl[x][y] ^= TORCH; }
else if (lvl[x][y] & STAIRS_DOWN) gen(++level);
// Drawing
draw();
// Die
if (--torch <= 0) break;
}
}
showcursor();
return 0;
}
开发者ID:J-Robinson,项目名称:rlutil,代码行数:35,代码来源:example.c
示例6: cursor_stay
void cursor_stay()
{
if ((cursor_shown == FALSE) || (in_startup_mode == TRUE)) {
cursor_shown = TRUE;
showcursor(TRUE);
}
}
开发者ID:Ircher,项目名称:CBoE,代码行数:7,代码来源:bladpced.cpp
示例7: fatal
void fatal(const char *s, ...) // failure exit
{
if(++errors <= 2) // print up to one extra recursive error
{
defvformatbigstring(msg, s, s);
if(logfile) logoutf("%s", msg);
#ifndef WIN32
fprintf(stderr, "%s\n", msg);
#endif
if(errors <= 1) // avoid recursion
{
if(SDL_WasInit(SDL_INIT_VIDEO))
{
showcursor(true);
SDL_WM_GrabInput(SDL_GRAB_OFF);
cleargamma();
}
#ifdef WIN32
defformatstring(cap, "%s: Error", VERSION_NAME);
MessageBox(NULL, msg, cap, MB_OK|MB_SYSTEMMODAL);
#endif
SDL_Quit();
}
}
exit(EXIT_FAILURE);
}
开发者ID:qreeves,项目名称:redeclipse-base,代码行数:26,代码来源:main.cpp
示例8: visual_search
// TODO: integrate in '/' command with search.inblock ?
static void visual_search (RCore *core) {
const ut8 *p;
int len, d = cursor;
char str[128], buf[258];
r_line_set_prompt ("search byte/string in block: ");
r_cons_fgets (str, sizeof (str), 0, NULL);
len = r_hex_str2bin (str, (ut8*)buf);
if (*str=='"') {
char *e = strncpy (buf, str+1, sizeof (buf)-1);
if (e) { --e; if (*e=='"') *e=0; }
len = strlen (buf);
} else
if (len<1) {
strncpy (buf, str, sizeof (buf)-1);
len = strlen (str);
}
p = r_mem_mem (core->block+d, core->blocksize-d,
(const ut8*)buf, len);
if (p) {
cursor = (int)(size_t)(p-core->block);
if (len>1) {
ocursor = cursor+len-1;
} else ocursor = -1;
showcursor (core, true);
eprintf ("FOUND IN %d\n", cursor);
r_cons_any_key (NULL);
} else {
eprintf ("Cannot find bytes\n");
r_cons_any_key (NULL);
r_cons_clear00 ();
}
}
开发者ID:xuwenbo,项目名称:radare2,代码行数:34,代码来源:visual.c
示例9: cursor_stay
void cursor_stay()
{
if ((cursor_shown == false) || (in_startup_mode == true))
{
cursor_shown = true;
showcursor(true);
}
}
开发者ID:Ircher,项目名称:CBoE,代码行数:8,代码来源:boe.main.cpp
示例10: cursor_go
void cursor_go()
{
if (in_startup_mode == TRUE)
return;
if (cursor_shown == TRUE) {
cursor_shown = FALSE;
showcursor(FALSE);
}
}
开发者ID:Ircher,项目名称:CBoE,代码行数:9,代码来源:bladpced.cpp
示例11: quit
void quit(World *world) {
//cls();
locate(1, 1);
setColor(WHITE);
printf("GAME OVER\nRESULTS:[LEVEL: %d HP:%d LIFE:%d]\n", world->level.level,
world->player.hp, world->player.life);
showcursor();
exit(EXIT_SUCCESS);
}
开发者ID:tom91136,项目名称:TouhouC,代码行数:9,代码来源:main.c
示例12: inputgrab
void inputgrab(bool on)
{
#ifndef WIN32
if(!(screen->flags & SDL_FULLSCREEN)) SDL_WM_GrabInput(SDL_GRAB_OFF);
else
#endif
SDL_WM_GrabInput(on ? SDL_GRAB_ON : SDL_GRAB_OFF);
showcursor(!on);
}
开发者ID:qreeves,项目名称:redeclipse-base,代码行数:9,代码来源:main.cpp
示例13: cursor_go
void cursor_go()
{
if (in_startup_mode == true) return;
if (cursor_shown == true)
{
cursor_shown = false;
showcursor(false);
}
}
开发者ID:Ircher,项目名称:CBoE,代码行数:10,代码来源:boe.main.cpp
示例14: check_game_done
void check_game_done()
{
through_sending();
if (All_Done == true)
{
lose_graphics();
showcursor(true);
PostQuitMessage(0);
}
}
开发者ID:Ircher,项目名称:CBoE,代码行数:11,代码来源:boe.main.cpp
示例15: tty_fix
int tty_fix (void)
{
if (!havemodes)
{
return 0;
}
showcursor();
/* "stty sane" */
return tcsetattr(fileno(stdin), TCSANOW, &savemodes);
}
开发者ID:LiftnLearn,项目名称:tetris,代码行数:12,代码来源:tetris.cpp
示例16: max_window
void max_window(HWND window)
{
RECT main_rect,wind_rect;
short width,height;
cursor_shown = true;
showcursor(true);
GetWindowRect(GetDesktopWindow(),&main_rect);
GetWindowRect(window,&wind_rect);
width = main_rect.right - main_rect.left;
height = main_rect.bottom - main_rect.top;
MoveWindow(window,0,0,width,height,true);
}
开发者ID:PBrookfield,项目名称:cboe-msvc,代码行数:14,代码来源:boe.dlgutil.cpp
示例17: findNextWord
static void findNextWord (RCore *core) {
int i, d = curset? cursor: 0;
for (i = d+1; i<core->blocksize; i++) {
switch (core->block[i]) {
case ' ':
case '.':
case '\t':
case '\n':
if (curset) {
cursor = i+1;
ocursor = -1;
showcursor (core, true);
} else {
r_core_seek (core, core->offset + i + 1, 1);
}
return;
}
}
}
开发者ID:xuwenbo,项目名称:radare2,代码行数:19,代码来源:visual.c
示例18: cleanup
void cleanup()
{
recorder::stop();
cleanupserver();
showcursor(true);
//#ifdef FAKESHOWCURSOR
// if(scursor) SDL_FreeCursor(scursor);
// scursor = ncursor = NULL;
//#endif
SDL_WM_GrabInput(SDL_GRAB_OFF);
cleargamma();
freeocta(worldroot);
extern void clear_command(); clear_command();
extern void clear_console(); clear_console();
extern void clear_mdls(); clear_mdls();
stopsound();
closelogfile();
SDL_Quit();
}
开发者ID:qreeves,项目名称:redeclipse-base,代码行数:19,代码来源:main.cpp
示例19: findPrevWord
static void findPrevWord (RCore *core) {
int i = curset? cursor: 0;
while (i>1) {
if (isSpace (core->block[i]))
i--;
else if (isSpace (core->block[i-1]))
i-=2;
else break;
}
for (; i>=0; i--) {
if (isSpace (core->block[i])) {
if (curset) {
cursor = i+1;
ocursor = -1;
showcursor (core, true);
} else {
// r_core_seek (core, core->offset + i + 1, 1);
}
break;
}
}
}
开发者ID:xuwenbo,项目名称:radare2,代码行数:22,代码来源:visual.c
示例20: findPair
static void findPair (RCore *core) {
ut8 buf[256];
int i, len, d = cursor+1;
int delta = 0;
const ut8 *p, *q = NULL;
const char *keys = "{}[]()<>";
ut8 ch = core->block[cursor];
p = (const ut8*)strchr (keys, ch);
if (p) {
delta = (size_t)(p-(const ut8*)keys);
ch = (delta%2)? p[-1]: p[1];
}
len = 1;
buf[0] = ch;
if (p && (delta%2)) {
for (i = d-1; i>=0; i--) {
if (core->block[i] == ch) {
q = core->block + i;
break;
}
}
} else {
q = r_mem_mem (core->block+d, core->blocksize-d,
(const ut8*)buf, len);
if (!q) {
q = r_mem_mem (core->block, R_MIN (core->blocksize, d),
(const ut8*)buf, len);
}
}
if (q) {
cursor = (int)(size_t)(q-core->block);
ocursor = -1;
showcursor (core, true);
}
}
开发者ID:xuwenbo,项目名称:radare2,代码行数:37,代码来源:visual.c
注:本文中的showcursor函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论