• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GrMapWindow函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: new_message_common_window

void new_message_common_window(char *message)
{
	GR_SIZE width, height, base;
	int i, maxwidth;

	if (msg_wid) {
		msg_destroy_msg();
	}

	msg_gc = pz_get_gc(1);
	GrSetGCUseBackground(msg_gc, GR_FALSE);
	GrSetGCForeground(msg_gc, appearance_get_color( CS_MESSAGEFG ));

	msg_build_msg(message);
	maxwidth = 0;
	for(i=linenum; i; i--) {
		GrGetGCTextSize(msg_gc, msglines[i-1], -1, GR_TFASCII, &width,
				&height, &base);
		if(width > maxwidth)
			maxwidth = width;
	}

	msg_wid = pz_new_window((screen_info.cols - (maxwidth + 10)) >> 1,
		(screen_info.rows - (((height + 3) * linenum) + 10)) >> 1,
		maxwidth + 10, ((height + 3) * linenum) + 10,
		msg_do_draw, msg_do_keystroke);

	GrSelectEvents(msg_wid, GR_EVENT_MASK_EXPOSURE| GR_EVENT_MASK_KEY_UP|
			GR_EVENT_MASK_KEY_DOWN| GR_EVENT_MASK_TIMER);

	GrMapWindow(msg_wid);

	/* window will auto-close after 6 seconds */
	msg_timer = GrCreateTimer(msg_wid, 6000);
}
开发者ID:ProjectZeroSlackr,项目名称:Floydzilla,代码行数:35,代码来源:message.c


示例2: new_invaders_window

void new_invaders_window()
{

	invaders_gc = pz_get_gc(1);

	GrSetGCUseBackground(invaders_gc, GR_TRUE);
	GrSetGCBackground(invaders_gc, GR_RGB(255,255,255));
	GrSetGCForeground(invaders_gc, GR_RGB(0,0,0));
	
	invaders_score_pix = GrNewPixmap(screen_info.cols, 13, 0);

	invaders_wid = pz_new_window(0,
				HEADER_TOPLINE + 1,
				screen_info.cols,
				screen_info.rows - HEADER_TOPLINE - 1,
				invaders_do_draw,
				invaders_handle_event);

	GrSelectEvents(invaders_wid, GR_EVENT_MASK_TIMER |
			GR_EVENT_MASK_EXPOSURE | GR_EVENT_MASK_KEY_UP |
			GR_EVENT_MASK_KEY_DOWN);
	
	score = 0;
	level = 0;
	aliens_rows = (screen_info.rows - 40) / 20;	
	
	game_status = GAME_STATUS_PLAY;
	invaders_create_board(level);

	invaders_timer_id = GrCreateTimer(invaders_wid, 50);

	GrMapWindow(invaders_wid);
	
	draw_first();
}
开发者ID:Keripo,项目名称:ProjectZeroSlackr-SVN,代码行数:35,代码来源:invaders.c


示例3: new_video_window

void new_video_window(char *filename)
{
#ifndef IPOD
	pz_error("No video support on the desktop.");
#else /* IPOD */

	if (full_hw_version==0)
	{
		full_hw_version = ipod_get_hw_version();
	}
	outl(1, VAR_VIDEO_ON);
	outl(0, VAR_VIDEO_MODE);
	cop_wakeup();
	init_variables();
	video_status = VIDEO_CONTROL_MODE_STARTING; 
	video_curPosition = 0;
	video_gc = pz_get_gc(1);
	GrSetGCUseBackground(video_gc, GR_FALSE);
	GrSetGCForeground(video_gc, GR_RGB(0,0,0));
//nes_window("Create win");
	video_wid = pz_new_window(0, 0, screen_info.cols, screen_info.rows, video_do_draw, video_do_keystroke);

	GrSelectEvents(video_wid, 
			GR_EVENT_MASK_KEY_DOWN| GR_EVENT_MASK_KEY_UP);
	GrMapWindow(video_wid);

	GrClearWindow(video_wid, GR_FALSE);
//nes_window("Load");
	video_status_message("Loading video...");
//nes_window("Play");	
playVideo(filename);
	outl(0, VAR_VIDEO_ON);
#endif
}
开发者ID:Keripo,项目名称:ProjectZeroSlackr-SVN,代码行数:34,代码来源:video.c


示例4: new_ipobble_window

void new_ipobble_window()
{

	ipobble_gc = pz_get_gc(1);

	GrSetGCUseBackground(ipobble_gc, GR_TRUE);
	GrSetGCForeground(ipobble_gc, BLACK);
	GrSetGCBackground(ipobble_gc, WHITE);

	ipobble_wid = pz_new_window(0, HEADER_TOPLINE + 1,
			screen_info.cols,
			screen_info.rows - HEADER_TOPLINE - 1,
			ipobble_do_draw, ipobble_handle_event);

	GrSelectEvents(ipobble_wid, GR_EVENT_MASK_TIMER |
			GR_EVENT_MASK_EXPOSURE | GR_EVENT_MASK_KEY_UP |
			GR_EVENT_MASK_KEY_DOWN);
	if( screen_info.bpp > 2) {
	    ipodc=1;
	}
	
	score = 0;
	level = 0;
	game_status = GAME_STATUS_PLAY;
	ipobble_create_board(level);

	ipobble_timer_id = GrCreateTimer(ipobble_wid, DELTA_TIME);

	GrMapWindow(ipobble_wid);
	
	draw_first();
}
开发者ID:iPodLinux-Community,项目名称:podzillaz,代码行数:32,代码来源:ipobble.c


示例5: new_blackjack_window

//Create the blackjack window
void new_blackjack_window(void)
{

	srand((unsigned int)time(NULL) / 2);  //Make a seed for our random # generator

    blackjack_gc = pz_get_gc(1);       /* Get the graphics context */

    /* Open the window: */
    blackjack_wid = pz_new_window (0,
								   21,
								   screen_info.cols,
								   screen_info.rows - (HEADER_TOPLINE+1),
								   draw_header,
								   handle_event);

	GrGetWindowInfo(blackjack_wid, &wi); /* Get screen info */

    /* Select the types of events you need for your window: */
    GrSelectEvents (blackjack_wid, GR_EVENT_MASK_EXPOSURE|GR_EVENT_MASK_KEY_DOWN|GR_EVENT_MASK_KEY_UP);

    /* Display the window: */
    GrMapWindow (blackjack_wid);

	readPot();
	reset();
}
开发者ID:ProjectZeroSlackr,项目名称:Floydzilla,代码行数:27,代码来源:blackjack.c


示例6: new_tunnel_window

// Creates a new tunnel "app" window
void new_tunnel_window(void)
{
	
    tunnel_gc = pz_get_gc(1);       /* Get the graphics context */
	
    /* Open the window: */
    tunnel_wid = pz_new_window (0,
								   21,
								   screen_info.cols,
								   screen_info.rows - (HEADER_TOPLINE+1),
								   draw_header,
								   handle_event);
	
	GrGetWindowInfo(tunnel_wid, &wi); /* Get screen info */	
	
    /* Select the types of events you need for your window: */
    GrSelectEvents (tunnel_wid, GR_EVENT_MASK_TIMER|GR_EVENT_MASK_EXPOSURE|GR_EVENT_MASK_KEY_DOWN|GR_EVENT_MASK_KEY_UP);
	
	// set up pixmap 
	temp_pixmap = GrNewPixmap(screen_info.cols,
							  (screen_info.rows - (HEADER_TOPLINE + 1)),
							  NULL);
	
    /* Display the window: */
    GrMapWindow (tunnel_wid);
	draw_header();
	readHighScore();
	reset();
}
开发者ID:ProjectZeroSlackr,项目名称:Floydzilla,代码行数:30,代码来源:tunnel.c


示例7: main

int
main(int argc, char **argv)
{
	int COLS, ROWS;

	if (GrOpen() < 0) {
		fprintf(stderr, "Cannot open graphics\n");
		exit(1);
	}

	COLS = 350;
	ROWS = 300;

	g_main = GrNewWindowEx(GR_WM_PROPS_APPWINDOW, "dashdemo",
		GR_ROOT_WINDOW_ID, 100, 50, COLS - 120, ROWS - 60, BLUE);

	GrSelectEvents(g_main, GR_EVENT_MASK_EXPOSURE|GR_EVENT_MASK_CLOSE_REQ);
	GrMapWindow(g_main);

	while (1) {
		GR_EVENT event;
		GrGetNextEvent(&event);

		switch (event.type) {
		case GR_EVENT_TYPE_EXPOSURE:
			draw_screen();
			break;

		case GR_EVENT_TYPE_CLOSE_REQ:
			GrClose();
			exit(0);
		}
	}
}
开发者ID:BadrElh,项目名称:microwindows,代码行数:34,代码来源:dashdemo.c


示例8: main

int main (void)
{
    if (GrOpen() < 0)
    {
        GrError("GrOpen failed");
        return 1;
    }

    gc = GrNewGC();
    GrSetGCUseBackground (gc, GR_FALSE);
    GrSetGCForeground (gc, RED);

    wid = GrNewWindowEx (GR_WM_PROPS_APPFRAME |
                         GR_WM_PROPS_CAPTION  |
                         GR_WM_PROPS_CLOSEBOX,
                         "Hello Window",
                         GR_ROOT_WINDOW_ID, 
                         50, 50, 200, 100, WHITE);

    GrSelectEvents (wid, GR_EVENT_MASK_EXPOSURE | 
                         GR_EVENT_MASK_CLOSE_REQ);

    GrMapWindow (wid);
    GrMainLoop (event_handler);
}
开发者ID:ghaerr,项目名称:microwindows,代码行数:25,代码来源:demo-hello.c


示例9: new_lights_window

/* initialize the window */
void new_lights_window(void)
{
	/* Init randomizer */
	srand(time(NULL));

	lights_gc = pz_get_gc (1);
        GrSetGCUseBackground(lights_gc, GR_FALSE);
        GrSetGCForeground(lights_gc, GR_RGB(0,0,0));

	lights_height = (lights_screen_info.rows - (HEADER_TOPLINE + 1));

	lights_wid = pz_new_window( 0, HEADER_TOPLINE + 1,
		    screen_info.cols, lights_height,
		    lights_do_draw, lights_handle_event );

	lights_bufwid = GrNewPixmap( lights_screen_info.cols, 
					lights_height, NULL );

        GrSelectEvents( lights_wid, GR_EVENT_MASK_TIMER
					| GR_EVENT_MASK_EXPOSURE
					| GR_EVENT_MASK_KEY_UP
					| GR_EVENT_MASK_KEY_DOWN );

	lights_timer = GrCreateTimer( lights_wid, 300 );

	GrMapWindow( lights_wid );

	/* intialize game state */
	lights_new_game();
}
开发者ID:Keripo,项目名称:ProjectZeroSlackr-SVN,代码行数:31,代码来源:lights.c


示例10: new_browser_window

void new_browser_window(char *initial_path)
{
	if (initial_path) {
		chdir(initial_path);
	}
	getcwd(current_dir, sizeof(current_dir));

	browser_gc = pz_get_gc(1);
	GrSetGCUseBackground(browser_gc, GR_FALSE);
	GrSetGCBackground(browser_gc, WHITE);
	GrSetGCForeground(browser_gc, BLACK);

	browser_wid = pz_new_window(0, HEADER_TOPLINE + 2, screen_info.cols,
                                    screen_info.rows - (HEADER_TOPLINE + 2),
                                    browser_do_draw, browser_do_keystroke);

	GrSelectEvents(browser_wid, GR_EVENT_MASK_EXPOSURE |
			GR_EVENT_MASK_KEY_UP | GR_EVENT_MASK_KEY_DOWN |
			GR_EVENT_MASK_TIMER);

	browser_menu = NULL;
	browser_menu_overlay = NULL;
	browser_mscandir("./");

	GrMapWindow(browser_wid);
}
开发者ID:iPodLinux-Community,项目名称:Floydzilla,代码行数:26,代码来源:browser.c


示例11: new_cube_window

void new_cube_window( void )
{
	if (screen_info.cols==220) {
		photo = 1;
		if (!z_off) z_off = 400;
	} else if (screen_info.cols==138) {
		if (!z_off) z_off = 800;
	} else {
		if (!z_off) z_off = 600;
	}

	cube_gc = pz_get_gc(1);
	GrSetGCUseBackground(cube_gc, GR_FALSE);
	GrSetGCForeground(cube_gc, BLACK);

	cube_wid = pz_new_window(0, HEADER_TOPLINE + 1, 
	screen_info.cols, screen_info.rows - (HEADER_TOPLINE + 1), 
	cube_do_draw, cube_handle_event);

	GrSelectEvents( cube_wid, GR_EVENT_MASK_TIMER|
	GR_EVENT_MASK_EXPOSURE|GR_EVENT_MASK_KEY_UP|GR_EVENT_MASK_KEY_DOWN);

    cube_timer = GrCreateTimer( cube_wid, 100 );

	GrMapWindow( cube_wid );

	x_off = screen_info.cols/2;
	y_off = (screen_info.rows - (HEADER_TOPLINE + 1))/2;

	temp_pixmap = GrNewPixmap(screen_info.cols,
								(screen_info.rows - (HEADER_TOPLINE + 1)),
						 		NULL);
	
	cube_init();	
}
开发者ID:ProjectZeroSlackr,项目名称:Floydzilla,代码行数:35,代码来源:cube.c


示例12: malloc

struct menulist *new_ml()
{
	struct menulist *ret =
		(struct menulist *) malloc(sizeof(struct menulist));
		
	GrGetScreenInfo(&ret->screen_info);

	ret->gc = pz_get_gc(1);
	GrSetGCUseBackground(ret->gc, GR_FALSE);
	GrSetGCForeground(ret->gc, BLACK);
	GrSetGCBackground(ret->gc, BLACK);

	ret->wid = pz_new_window(0, HEADER_TOPLINE + 1, ret->screen_info.cols,
			ret->screen_info.rows - (HEADER_TOPLINE + 1),
			itunes_do_draw, itunes_do_keystroke);

	GrSelectEvents(ret->wid, GR_EVENT_MASK_EXPOSURE|GR_EVENT_MASK_KEY_DOWN|GR_EVENT_MASK_KEY_UP|GR_EVENT_MASK_TIMER);

	GrGetGCTextSize(ret->gc, "M", -1, GR_TFASCII, &ret->gr_width,
			&ret->gr_height, &ret->gr_base);

	ret->gr_height += 4;

	GrMapWindow(ret->wid);
	ret->itunes_menu = menu_init(ret->wid, "Music", 0, 0,
			screen_info.cols, screen_info.rows -
			(HEADER_TOPLINE + 1), NULL, NULL, UTF8);
	ret->init = 0;
	ret->prevml = NULL;

	return ret;
}
开发者ID:iPodLinux,项目名称:iPodLinux-SVN,代码行数:32,代码来源:itunesmenu.c


示例13: do_update

static void
do_update(GR_EVENT_UPDATE *ep)
{
	mwin *	mwp;
	mwin *	tmwp;
	GR_WINDOW_INFO winfo;

	if (IsDecoration(ep->wid)) return;

	if ((mwp = FindWindow(ep->wid)) == NULL) {
		/* We have a new window */
		if (ep->utype != GR_UPDATE_MAP) return;
		if ((mwp = NewWindow(ep->wid)) == NULL) {
			GrError("malloc failed\n");
			return;
		}
		GrGetWindowInfo(ep->wid, &winfo);
		mwp->x = ep->x - winfo.bordersize;
		mwp->y = ep->y - winfo.bordersize;
		mwp->width = ep->width + 2 * winfo.bordersize;
		GrMoveWindow(mwp->wid, mwp->x + winfo.bordersize,
					mwp->y + DEC_HEIGHT +
						2 * winfo.bordersize);
		mwp->fid = GrNewWindow(GR_ROOT_WINDOW_ID, mwp->x + 1,
				mwp->y + 1, mwp->width - 2,
				DEC_HEIGHT - 2, 1, BLUE, BLACK);
		GrSelectEvents(mwp->fid, GR_EVENT_MASK_BUTTON_DOWN |
			GR_EVENT_MASK_BUTTON_UP | GR_EVENT_MASK_MOUSE_POSITION);
		GrMapWindow(mwp->fid);
	} else {
		switch (ep->utype) {
			case GR_UPDATE_UNMAP:
				GrUnmapWindow(mwp->fid);
				GrDestroyWindow(mwp->fid);
				if (mwins == mwp) {
					mwins = mwp->next;
				} else for(tmwp = mwins; tmwp; tmwp = tmwp->next) {
					if (tmwp->next == mwp) {
						tmwp->next = mwp->next;
					}
				}
				free(mwp);
				break;
			case GR_UPDATE_MOVE:
				GrGetWindowInfo(ep->wid, &winfo);
				if ((ep->x == (mwp->x + winfo.bordersize)) &&
					(ep->y == (mwp->y + winfo.bordersize
							+ DEC_HEIGHT))) {
					return;
				}
				mwp->x = ep->x - winfo.bordersize;
				mwp->y = ep->y - winfo.bordersize - DEC_HEIGHT;
				GrMoveWindow(mwp->fid, mwp->x + 1, mwp->y + 1);
			default:
				break;
		}
	}
}
开发者ID:ghaerr,项目名称:microwindows,代码行数:58,代码来源:npanel.c


示例14: mvpw_show

void
mvpw_show(mvp_widget_t *widget)
{
	mvp_widget_t *top;

	if (widget) {
		if ((widget->type == MVPW_DIALOG) &&
		    widget->data.dialog.modal) {
			top = mvpw_get_focus();
			GrMapWindow(widget->wid);
			raise_widget(widget, top);
			if (!mvpw_visible((mvp_widget_t*)screensaver_widget))
				GrRaiseWindow(widget->wid);
			mvpw_focus(widget);
		} else {
			GrMapWindow(widget->wid);
			if(widget->show) (*widget->show)(widget, 1);
		}
	}
}
开发者ID:cgbarnwell,项目名称:mvpmc,代码行数:20,代码来源:widget.c


示例15: incall_handler

static int incall_handler(struct lgsm_handle *lh, int evt, struct gsmd_evt_auxdata *aux)
{
	printf("EVENT: Incoming call type = %u\n", aux->u.call.type);

	GrMapWindow(dialer_window);
	GrSetFocus(dialer_window);
	GrText(dialer_window, gc, 10, 10, "Incoming call", 0, 0);


	return 0;
}
开发者ID:vovan888,项目名称:linux-on-sx1,代码行数:11,代码来源:incoming.c


示例16: CoverRoot

/*
   Cover root window to erase roaches.
*/
void
CoverRoot(void)
{
    GR_WINDOW_ID roachWin;
    
    roachWin = GrNewWindow(GR_ROOT_WINDOW_ID, 0, 0, display_width, display_height,
		    0, CYAN, BLACK);
    GrLowerWindow(roachWin);
    GrMapWindow(roachWin);
    GrFlush();
}    
开发者ID:EPiCS,项目名称:reconos_v2,代码行数:14,代码来源:nxroach.c


示例17: new_mp3_window

void new_mp3_window(char *filename, char *album, char *artist, char *title, int len)
{
	if (album) {
		strncpy(current_album, album, sizeof(current_album)-1);
		current_album[sizeof(current_album)-1] = 0;
	}
	else
		current_album[0]=0;

	if (artist) {
		strncpy(current_artist, artist, sizeof(current_artist)-1);
		current_artist[sizeof(current_artist)-1] = 0;
	} else {
		current_artist[0]=0;
	}

	if (title) {
		strncpy(current_title, title, sizeof(current_title)-1);
		current_title[sizeof(current_title)-1] = 0;
	} else {
		current_title[0]=0;
	}

	sprintf(current_pos, _("Song %d of %d"), playlistpos, playlistlength);

	next_song_time = len;
	
	/* play another song when one isn't complete */
	if (window_open)
	{
	    strcpy(next_song, filename);
	    next_song_queued = 1;
	    return;
	}

	window_open = 1;

	mp3_gc = pz_get_gc(1);
	GrSetGCUseBackground(mp3_gc, GR_TRUE);
	GrSetGCBackground(mp3_gc, GR_RGB(255,255,255));
	GrSetGCForeground(mp3_gc, GR_RGB(0,0,0));

	mp3_wid = pz_new_window(0, HEADER_TOPLINE + 1, screen_info.cols, screen_info.rows - (HEADER_TOPLINE + 1), mp3_do_draw, mp3_do_keystroke);

	GrSelectEvents(mp3_wid, GR_EVENT_MASK_EXPOSURE|GR_EVENT_MASK_KEY_UP|GR_EVENT_MASK_KEY_DOWN|GR_EVENT_MASK_TIMER);

	GrMapWindow(mp3_wid);
	total_time = remaining_time = len;
	mp3_do_draw(0);

	start_mp3_playback(filename);
	window_open = 0;
}
开发者ID:Keripo,项目名称:ProjectZeroSlackr-SVN,代码行数:53,代码来源:mp3.c


示例18: NX_LeaveFullScreen

int NX_LeaveFullScreen (_THIS)
{
    if (currently_fullscreen) {
        GrUnmapWindow (FSwindow) ;
        GrMapWindow (SDL_Window) ;
        GrRaiseWindow (SDL_Window) ;
        GrSetFocus (SDL_Window) ;
        currently_fullscreen = 0 ;
    }

    return 0 ;
}
开发者ID:3bu1,项目名称:crossbridge,代码行数:12,代码来源:SDL_nxmodes.c


示例19: draw_pause_continue_button

void draw_pause_continue_button(nstate *state)
{
	if((state->running_buttons_mapped) && (state->state == STATE_STOPPED)) {
		GrUnmapWindow(state->pause_continue_button);
		GrUnmapWindow(state->anticlockwise_button);
		GrUnmapWindow(state->clockwise_button);
		GrUnmapWindow(state->left_button);
		GrUnmapWindow(state->right_button);
		GrUnmapWindow(state->drop_button);
		state->running_buttons_mapped = 0;
		return;
	}
	if((!state->running_buttons_mapped) && (state->state == STATE_RUNNING)){
		GrMapWindow(state->pause_continue_button);
		GrMapWindow(state->anticlockwise_button);
		GrMapWindow(state->clockwise_button);
		GrMapWindow(state->left_button);
		GrMapWindow(state->right_button);
		GrMapWindow(state->drop_button);
		state->running_buttons_mapped = 1;
		return;
	}
	if(!state->running_buttons_mapped) return;
	GrFillRect(state->pause_continue_button, state->buttongcb, 0, 0,
		PAUSE_CONTINUE_BUTTON_WIDTH, PAUSE_CONTINUE_BUTTON_HEIGHT);
	if(state->state == STATE_PAUSED) {
		GrText(state->pause_continue_button, state->buttongcf,
			TEXT_X_POSITION, TEXT_Y_POSITION, " Continue", 9, 0);
	} else {
		GrText(state->pause_continue_button, state->buttongcf,
			TEXT_X_POSITION, TEXT_Y_POSITION, "   Pause", 8, 0);
	}
}
开发者ID:Joel397,项目名称:Ongoing_work_files,代码行数:33,代码来源:ntetris.c


示例20: GrGetScreenInfo

nxeyes_state *init(void)
{
	nxeyes_state *state;
	GR_REGION_ID rid1, rid2;
	GR_SCREEN_INFO si;
	GR_WM_PROPERTIES props;

	if(!(state = malloc(sizeof(nxeyes_state)))) return NULL;
	state->oldx = state->oldy = state->x = state->y = 0;
	state->button_down = state->eyes_closed = state->quit = 0;
	state->olx = state->orx = EYEMASK_WIDTH / 2;
	state->oly = state->ory = EYEMASK_HEIGHT / 2;
	GrGetScreenInfo(&si);
	state->mousex = si.xpos;
	state->mousey = si.ypos;
	state->mouse_moved = 1;
	state->gc = GrNewGC();
	GrSetGCForeground(state->gc, GR_COLOR_WHITE);
	GrSetGCBackground(state->gc, GR_COLOR_BLACK);

	state->wid = GrNewWindow(GR_ROOT_WINDOW_ID, 0, 0, (EYEFG_HEIGHT * 2) +
			EYE_SPACING, EYEFG_HEIGHT, 0, GR_COLOR_WHITE, 0);

	rid1 = GrNewBitmapRegion(eyemask_bits, EYEMASK_WIDTH, EYEMASK_HEIGHT);
	rid2 = GrNewBitmapRegion(eyemask_bits, EYEMASK_WIDTH, EYEMASK_HEIGHT);
	GrOffsetRegion(rid2, EYEMASK_WIDTH + EYE_SPACING, 0);
	GrUnionRegion(rid1, rid1, rid2);
	GrSetWindowRegion(state->wid, rid1, GR_WINDOW_BOUNDING_MASK);
	GrDestroyRegion(rid1);
	GrDestroyRegion(rid2);

	props.flags = GR_WM_FLAGS_PROPS;
	props.props = GR_WM_PROPS_NODECORATE;
	GrSetWMProperties(state->wid, &props);

	GrSelectEvents(state->wid, GR_EVENT_MASK_CLOSE_REQ |
			GR_EVENT_MASK_MOUSE_POSITION |
			GR_EVENT_MASK_BUTTON_UP |
			GR_EVENT_MASK_BUTTON_DOWN |
			GR_EVENT_MASK_EXPOSURE |
			GR_EVENT_MASK_TIMER);

	GrSelectEvents(GR_ROOT_WINDOW_ID, GR_EVENT_MASK_MOUSE_POSITION);

	GrMapWindow(state->wid);

	srand(123);
#if MW_FEATURE_TIMERS
	start_blink_timer(state);
#endif	
	return state;
}
开发者ID:koujinogaku,项目名称:helloos,代码行数:52,代码来源:nxeyes.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GrPrintf函数代码示例发布时间:2022-05-30
下一篇:
C++ GrCrash函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap