您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ update_cursor函数代码示例

51自学网 2021-06-03 09:15:11
  C++
这篇教程C++ update_cursor函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中update_cursor函数的典型用法代码示例。如果您正苦于以下问题:C++ update_cursor函数的具体用法?C++ update_cursor怎么用?C++ update_cursor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了update_cursor函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: cmd_end

/* Moves cursor to the end of command-line on Ctrl+E and End. */static voidcmd_end(key_info_t key_info, keys_info_t *keys_info){	input_stat.index = input_stat.len;	input_stat.curs_pos = input_stat.prompt_wid +			wcswidth(input_stat.line, (size_t)-1);	update_cursor();}
开发者ID:ackeack,项目名称:workenv,代码行数:9,


示例2: z_set_cursor

void z_set_cursor (void){    zword win = (h_version == V6) ? winarg2 () : 1;    zword y = zargs[0];    zword x = zargs[1];    flush_buffer ();    /* Supply default arguments */    if (zargc < 3)        zargs[2] = -3;    /* Handle cursor on/off */    if ((short) y < 0) {        if ((short) y == -2)            cursor = TRUE;        if ((short) y == -1)            cursor = FALSE;        return;    }    /* Convert grid positions to screen units if this is not V6 */    if (h_version != V6) {        if (cwin == 0)            return;        y = (y - 1) * h_font_height + 1;        x = (x - 1) * h_font_width + 1;    }    /* Protect the margins */    if (y == 0)                 /* use cursor line if y-coordinate is 0 */        y = wp[win].y_cursor;    if (x == 0)                 /* use cursor column if x-coordinate is 0 */        x = wp[win].x_cursor;    if (x <= wp[win].left || x > wp[win].x_size - wp[win].right)        x = wp[win].left + 1;    /* Move the cursor */    wp[win].y_cursor = y;    wp[win].x_cursor = x;    if (win == cwin)        update_cursor ();}/* z_set_cursor */
开发者ID:Hoffa,项目名称:nFrotz,代码行数:57,


示例3: putchar

int putchar(char a ){  int color = 0x07;	volatile char *video = (volatile char*)(video_vm);  if(position>=ROW*COLUMN)    scrollup(1);  if(a=='/n')  {    position = ((position/80)+1)*80;     update_cursor(position/COLUMN, position%COLUMN);    return 0;  }  *(video++ + 2*position) = a;	*video++ = color;  position++;  update_cursor(position/COLUMN, position%COLUMN);  return 1;}
开发者ID:Bhavya6187,项目名称:sbunix,代码行数:18,


示例4: cls

// Clears the consolevoid cls() {    unsigned blank = attrib | ' ';    for(int i = 0; i < CRT_SIZE; ++i)        memsetw(crt.buf, blank, CRT_SIZE);    crt.pos = 0;    update_cursor();}
开发者ID:plurmiscuous,项目名称:JinxOS,代码行数:10,


示例5: get_mouse_position

// ------------------------------------------------------------------------// window to display an adventure map// determine correct cursor to display// ------------------------------------------------------------------------void t_adventure_map_window::update_cursor(){	t_screen_point point = get_mouse_position( this );	t_screen_rect  rect = get_client_rect();	if (!is_point_in_rect( point, rect ))		return;	update_cursor( point );}
开发者ID:sundoom,项目名称:sunstudio,代码行数:13,


示例6: cc_timezone_map_state_flags_changed

static voidcc_timezone_map_state_flags_changed (GtkWidget     *widget,                                     GtkStateFlags  prev_state){  update_cursor (widget);  if (GTK_WIDGET_CLASS (cc_timezone_map_parent_class)->state_flags_changed)    GTK_WIDGET_CLASS (cc_timezone_map_parent_class)->state_flags_changed (widget, prev_state);}
开发者ID:1dot75cm,项目名称:gnome-control-center,代码行数:9,


示例7: terminal_gotoxy

void terminal_gotoxy(size_t x, size_t y){	if(x < VGA_TERMINAL_WIDTH && y < VGA_TERMINAL_HEIGHT)	{		cursor_x = x;		cursor_y = y;	}	update_cursor();}
开发者ID:DevilGladiator,项目名称:XeonOS,代码行数:9,


示例8: clear

void clear(){	uint16_t blank = 0x20 | (terminal_color << 8);	memsetw(video_memory, blank, VGA_COLS*VGA_ROWS);	terminal_row = 0;	terminal_column = 0;	update_cursor();}
开发者ID:awkwardbunny,项目名称:bsos-reborn,代码行数:9,


示例9: kclear

void kclear(){	int pos = 0;	for(int pos = 0;pos<25*80;pos++){		videoram[pos*2] = ' ';		videoram[pos*2+1] = 0x0F;	}	line_x = line_y = 0;	update_cursor();}
开发者ID:MatiasNAmendola,项目名称:OS-1,代码行数:9,


示例10: XOpenDisplay

void *cursor_motion_thread(void *targs) {    struct MCursor *this = (struct MCursor *)targs;     Display *dpy;    int xi_opcode, event, error;    XEvent ev;    dpy = XOpenDisplay(NULL);    if (!dpy) {    	MLOGE("Failed to open display./n");    	return (void *)-1;    }    if (!XQueryExtension(dpy, "XInputExtension", &xi_opcode, &event, &error)) {       MLOGE("X Input extension not available./n");       XCloseDisplay(dpy);       return (void *)-1;    }    if (!has_xi2(dpy)){        XCloseDisplay(dpy);        return (void *)-1;    }           /* select for XI2 events */    select_events(dpy, DefaultRootWindow(dpy));    while(1)     {    	XGenericEventCookie *cookie = &ev.xcookie;    	Window      	root_ret, child_ret;    	int         	root_x, root_y;    	int         	win_x, win_y;    	unsigned int    mask;    	XNextEvent(dpy, &ev);    	if (cookie->type == GenericEvent && cookie->extension == xi_opcode && XGetEventData(dpy, cookie)){                        if (cookie->evtype == XI_RawMotion) {                XQueryPointer(dpy, DefaultRootWindow(dpy), &root_ret, &child_ret, &root_x, &root_y, &win_x, &win_y, &mask);                update_cursor(dpy, this->mMdpy, &this->mBuffer, root_x, root_y);            }            XFreeEventData(dpy, cookie);        }    	    }     XCloseDisplay(dpy);    return NULL;}
开发者ID:maruos,项目名称:mflinger,代码行数:56,


示例11: memory

/*Function to clear the screen. Starts from the start of the memory (0xB8000) andfills every ASCII byte to 0x20 which is space and assigns the attribute byte to0x0 which is black.*/void cls(){       int i;       volatile char* video = (volatile char*)START_MEMORY;       for(i=0; i<(MAX_ROWS * MAX_COLUMNS); i++){               *video++ = 0x20;               *video++ = 0x0;       }       video_memory = (char *)START_MEMORY;       update_cursor();}
开发者ID:ChidambaramR,项目名称:SBUnix_X86_64,代码行数:15,


示例12: handle_mouse

// Handle mouse movementvoid handle_mouse(gl_t *state, struct input_event *event){    // Get launcher_state from gl_state    launcher_t *launcher_state = (launcher_t*)state->user_pointer;    // Initialize mouse position    static int x = 1920/2;    static int y = 1080/2;    // Handle mouse movement    switch(event->code)    {        case REL_X:            x += 2*event->value;            // Make sure not to go out of bounds            if(x < 0.0f)                x = 0.0f;            else if(x > state->screen_width)                x = state->screen_width;            update_cursor(launcher_state, x, y);            break;        case REL_Y:            y += 2*event->value;            if(y < 0.0f)                y = 0.0f;            else if(y > state->screen_height)                y = state->screen_height;            update_cursor(launcher_state, x, y);            break;        case REL_WHEEL:            if(event->value > 0.0f)                break;            else if(event->value < 0.0f)                break;            break;        case REL_HWHEEL:            if(event->value > 0.0f)                break;            else if(event->value < 0.0f)                break;            break;    }}
开发者ID:AdamSimpson,项目名称:TinyLauncher,代码行数:44,


示例13: __write

size_t __write(int fd, char buffer, size_t count){	int i =0;	((char *)(POSITION+cursor))[i]=(char)buffer;	i++;	//((char *)(POSITION+cursor))[i]=WHITE_TXT;	i++;	cursor+=2;	update_cursor();	return i;}
开发者ID:alebianITBA,项目名称:Arquitectura-de-computadoras,代码行数:10,


示例14: kcls

void kcls(){	int ir, ic;	for (ir = 0; ir < CON_ROWS; ir++)		for (ic = 0; ic < CON_COLUMNS; ic++)			kputc(' ');	cur_c->c_col = 0;	cur_c->c_row = 0;	update_cursor(0,0);}
开发者ID:kllrnohj,项目名称:kllrix,代码行数:10,


示例15: term_init

/** * The initialization of the terminal. */void term_init(void) {    uint16_t i;    int16_t * const map_start = (int16_t *)VGA_COLOR_TEXT_MAP_ADDR;    uint16_t c16 = vga_char(' ');    x = 0;    y = 0;    update_cursor();    for(i = 0; i < (COL * ROW); i++)        map_start[i] = c16;}
开发者ID:ffcactus,项目名称:os,代码行数:13,


示例16: clear

void clear(void) {    // FIXME Use string's memset here    short *pos = (short *) VGA_TEXT_BUFFER;    for (int i=0; i < MAX_COLS * MAX_ROWS; ++i) {        *pos++ = 0;    }    x = 0;    y = 0;    update_cursor();}
开发者ID:munshkr,项目名称:katmai,代码行数:10,


示例17: fill

void fill(char ch, char attr) {	unsigned int i = 0;	while (i < SCREENSIZE) {		video[i++] = ch;		video[i++] = attr;	}	current_loc = 0;	update_cursor();}
开发者ID:tmb95,项目名称:TPE-Arqui,代码行数:10,


示例18: rectangleColor

void TEdit::disp(SDL_Surface *s, TFont *myfont, int x, int y, int w,int h,  int fg, int bg, int xoptions) {  font = myfont;  font->set_utf(is_utf);  if (*menu->label) {      // Draw the static without a changing bg    TStatic::disp(s,myfont,x,y,xoptions-x,h,mymakecol(255,255,255),0,xoptions);    w -= xoptions - x;    x = xoptions;  }  rectangleColor(s,x,y,x+maxw-1,y+h-1,mymakecol(255,255,255));  // boxColor(s,x+1,y+1,x+maxw-3,y+h-3,bg_color);  if (field[0]) {      int w,h;      font->dimensions(field,&w,&h);      // -8 for the size of the cursor in the end..      int max = (pos == strlen(field) ? maxw-8 : maxw);      if (w > max) {	  unsigned int p;	  char old = 0;	  int end;	  for (p=0; p<strlen(field) && p<pos; p++) {	      font->dimensions(&field[p],&w,&h);	      if (w <= max) break;	  }	  if (w > max) {	      for (end=strlen(field)-1; end>=0; end--) {		  old = field[end];		  field[end] = 0;		  font->dimensions(&field[p],&w,&h);		  if (w <= max) break;		  field[end] = old;	      }	  }	  font->surf_string(s,x+1,y+1,&field[p],fg_color,0,0);	  if (old) field[end] = old;	  old = field[pos]; field[pos] = 0;	  font->dimensions(&field[p],&curx,&curh);	  curx += x+1;	  field[pos] = old;      } else {	  font->surf_string(s,x+1,y+1,field,fg_color,0,0);	  char old = field[pos]; field[pos] = 0;	  font->dimensions(field,&curx,&curh);	  curx += x+1;	  field[pos] = old;      }  } else {      curx = x+1; curh = h;  }  cury = y; mys = s;  if (bg && cursor_on) {    update_cursor();  }}
开发者ID:albinoz,项目名称:raine,代码行数:55,


示例19: z_print_table

void z_print_table (void){    zword addr = zargs[0];    zword x;    int i, j;    flush_buffer ();    /* Supply default arguments */    if (zargc < 3)        zargs[2] = 1;    if (zargc < 4)        zargs[3] = 0;    /* Write text in width x height rectangle */    x = cwp->x_cursor;    for (i = 0; i < zargs[2]; i++) {        if (i != 0) {            if (h_version != V6 && cwin == 0) {                new_line ();            } else {                flush_buffer ();                cwp->y_cursor += font_height;                cwp->x_cursor = x;                update_cursor ();            }        }        for (j = 0; j < zargs[1]; j++) {            zbyte c;            LOW_BYTE (addr, c)            addr++;            print_char (c);        }        addr += zargs[3];    }}/* z_print_table */
开发者ID:DavidKinder,项目名称:Windows-Frotz,代码行数:55,


示例20: puts

int puts(char* str){  int strlength=0;  while(*str)  {    putchar(*(str++));    strlength++;  }  update_cursor(position/COLUMN, position%COLUMN);  return strlength;}
开发者ID:Bhavya6187,项目名称:sbunix,代码行数:11,


示例21: putch

void putch(char c,int color){		//Print a character to the video memory	location =  VIDEO_MEM+(((Cols*2) * y_pos )+ (x_pos * 2));	char * s = (char*)(intptr_t)location;	s[0] = c;	s[1] = color;		x_pos++;	update_cursor();}
开发者ID:AnonymousUser1337,项目名称:Anmu,代码行数:11,


示例22: clear_console

void clear_console(void) {	unsigned int i = COLS * 2;	for (; i < SCREENSIZE; ) {		video[i++] = ' ';		video[i++] = DEFAULT;	}	current_loc = COLS * 2;	update_cursor();}
开发者ID:tmb95,项目名称:TPE-Arqui,代码行数:11,


示例23: clear

void clear(unsigned int color) {	char *vidptr = (char*)0xb8000;	unsigned int j = 0;	while(j < 80 * 25 * 2) {		vidptr[j] = ' ';		vidptr[j+1] = color;		j = j + 2;	}	cursorpos = 0;	update_cursor(cursorpos);}
开发者ID:noah7545,项目名称:tnyOS,代码行数:11,


示例24: clear

/* clear current screen */inline void clear(void){	char *addr = (char*) curcons->start;	int n = 0;	while (n < (SCR_SIZE * 2)) {		addr[n++] = ' ';		addr[n++] = WHITE;	}	curcons->column = curcons->row = 0;	update_cursor(curcons);}
开发者ID:abless,项目名称:flick,代码行数:13,


示例25: putc

static void putc(char c) {  if (in_escape) {    in_escape = handle_escape(c);    return;  }  int back = c_back;  int fore = c_fore;  switch (c) {  case 0x08: /* Backspace */    --cursor_x;    if (cursor_x > 80) { /* Wrapped? */      cursor_x = 0;      if (cursor_y > 0)        --cursor_y;    }    break;  case '/t':    cursor_x = (cursor_x+8) & ~7;    break;  case '/r':    cursor_x = 0;    break;  case '/n':    cursor_x = 0;    ++cursor_y;    break;  case '/033':    /* VT220 escape */    in_escape = 1;    return;  default:    /* Is the character printable? */    if (c >= ' ') {      video_memory[cursor_y*80 + cursor_x] = MAKE_CHAR(c, fore, back);      ++cursor_x;    }    break;  }  if (cursor_x >= 80) {    cursor_x -= 80;    ++cursor_y;  }  scroll();  update_cursor();}
开发者ID:rickbutton,项目名称:os,代码行数:53,


示例26: clear_screen

void clear_screen (void) {    int32_t i;    for(i=0; i<NUM_ROWS*NUM_COLS; i++) {        *(uint8_t *)(video_mem + (i << 1)) = ' ';        *(uint8_t *)(video_mem + (i << 1) + 1) = text_color;    }    screen_x[active_terminal] = 0;    screen_y[active_terminal] = 0;    update_cursor(screen_y[active_terminal], screen_x[active_terminal]);}
开发者ID:mathur,项目名称:gyaradOS,代码行数:12,


示例27: meta_cursor_renderer_set_cursor

voidmeta_cursor_renderer_set_cursor (MetaCursorRenderer  *renderer,                                 MetaCursorReference *cursor){  MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (renderer);  if (priv->displayed_cursor == cursor)    return;  priv->displayed_cursor = cursor;  update_cursor (renderer);}
开发者ID:mchalupa,项目名称:mutter,代码行数:12,


示例28: update_cursor

void DisplayChannel::set_capture_mode(bool on){    if (_capture_mouse_mode == on) {        return;    }    _capture_mouse_mode = on;    update_cursor();    if (_inputs_channel && !_capture_mouse_mode && _active_pointer) {        _inputs_channel->on_mouse_position(_pointer_pos.x, _pointer_pos.y, _buttons_state,                                           get_id());    }}
开发者ID:colama,项目名称:colama-3rdparty-tools,代码行数:12,


示例29: terminal_clear_screen

void terminal_clear_screen(void){	for(size_t y = 0; y < VGA_TERMINAL_HEIGHT; y++)	{		for (size_t x = 0; x < VGA_TERMINAL_WIDTH; x++)		{			terminal_buffer[ (VGA_TERMINAL_WIDTH * y) + x] = make_vgaentry(' ', terminal_color);		}	}	cursor_x = cursor_y = 0;	update_cursor();}
开发者ID:DevilGladiator,项目名称:XeonOS,代码行数:12,



注:本文中的update_cursor函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ update_dc函数代码示例
C++ update_count函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。