⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gdkcursor-xynth.c

📁 超强的嵌入式GUI系统
💻 C
📖 第 1 页 / 共 2 页
字号:
	{top_left_corner_mask_bits, top_left_corner_mask_width, top_left_corner_mask_height, top_left_corner_mask_x_hot, top_left_corner_mask_y_hot},	{top_right_corner_bits, top_right_corner_width, top_right_corner_height, top_right_corner_x_hot, top_right_corner_y_hot},	{top_right_corner_mask_bits, top_right_corner_mask_width, top_right_corner_mask_height, top_right_corner_mask_x_hot, top_right_corner_mask_y_hot},	{top_side_bits, top_side_width, top_side_height, top_side_x_hot, top_side_y_hot},	{top_side_mask_bits, top_side_mask_width, top_side_mask_height, top_side_mask_x_hot, top_side_mask_y_hot},	{top_tee_bits, top_tee_width, top_tee_height, top_tee_x_hot, top_tee_y_hot},	{top_tee_mask_bits, top_tee_mask_width, top_tee_mask_height, top_tee_mask_x_hot, top_tee_mask_y_hot},	{trek_bits, trek_width, trek_height, trek_x_hot, trek_y_hot},	{trek_mask_bits, trek_mask_width, trek_mask_height, trek_mask_x_hot, trek_mask_y_hot},	{ul_angle_bits, ul_angle_width, ul_angle_height, ul_angle_x_hot, ul_angle_y_hot},	{ul_angle_mask_bits, ul_angle_mask_width, ul_angle_mask_height, ul_angle_mask_x_hot, ul_angle_mask_y_hot},	{umbrella_bits, umbrella_width, umbrella_height, umbrella_x_hot, umbrella_y_hot},	{umbrella_mask_bits, umbrella_mask_width, umbrella_mask_height, umbrella_mask_x_hot, umbrella_mask_y_hot},	{ur_angle_bits, ur_angle_width, ur_angle_height, ur_angle_x_hot, ur_angle_y_hot},	{ur_angle_mask_bits, ur_angle_mask_width, ur_angle_mask_height, ur_angle_mask_x_hot, ur_angle_mask_y_hot},	{watch_bits, watch_width, watch_height, watch_x_hot, watch_y_hot},	{watch_mask_bits, watch_mask_width, watch_mask_height, watch_mask_x_hot, watch_mask_y_hot},	{xterm_bits, xterm_width, xterm_height, xterm_x_hot, xterm_y_hot},	{xterm_mask_bits, xterm_mask_width, xterm_mask_height, xterm_mask_x_hot, xterm_mask_y_hot}};GdkCursor * gdk_cursor_new_for_display (GdkDisplay *display, GdkCursorType cursor_type){	GdkCursor *cursor;	GdkDisplayXYNTH *xynth_display  = GDK_DISPLAY_XYNTH(display);	ENTER();	if (cursor_type >= sizeof(stock_cursors) / sizeof(stock_cursors[0])) {		LEAVE();		return NULL;	}	cursor = stock_cursors[cursor_type].cursor;	if (!cursor) {		GdkCursorXYNTH *private;		int width      = stock_cursors[cursor_type + 1].width;		int height     = stock_cursors[cursor_type + 1].height;		{			gint x, y;			gint mx, my;			gint  p = ((stock_cursors[cursor_type].width + 7) / 8) * 8;			gint mp = ((stock_cursors[cursor_type + 1].width + 7) / 8) * 8;			const guchar *src;			const guchar *mask;			src  = stock_cursors[cursor_type].bits;			mask = stock_cursors[cursor_type+1].bits;			mx = stock_cursors[cursor_type + 1].hotx - stock_cursors[cursor_type].hotx;			my = stock_cursors[cursor_type + 1].hoty - stock_cursors[cursor_type].hoty;			for (y = 0; y < height; y++) {				for (x = 0; x < width; x++) {					gint  bit = x - mx + (y - my) * p;					gint mbit = x + y * mp;					unsigned int color = (x - mx < 0 || y - my < 0 || x-mx >= stock_cursors[cursor_type].width || y - my >= stock_cursors[cursor_type].height) ? 0x00FFFFFF : (src[bit/8] & (1 << bit%8) ? 0 : 0x00FFFFFF);					unsigned int  a     = color ? 0xE0 : 0xFF;					unsigned int alpha = mask[mbit / 8] & (1 << mbit % 8) ? (a << 24) : 0;#if XYNTH_DEBUG_LEVEL > 0					printf("%08X ", alpha | color);#endif					}#if XYNTH_DEBUG_LEVEL > 0				printf("\n");#endif			}		}		width  += 2;		height += 2;			private = g_new0(GdkCursorXYNTH, 1);		cursor = (GdkCursor *) private;		cursor->type = GDK_CURSOR_IS_PIXMAP;		cursor->ref_count = 1;				private->hot_x = stock_cursors[cursor_type].hotx;		private->hot_y = stock_cursors[cursor_type].hoty;				stock_cursors[cursor_type].cursor = cursor;	}	LEAVE();	return gdk_cursor_ref (cursor);}void _gdk_cursor_destroy (GdkCursor *cursor){	ENTER();	NIY();	ASSERT();	LEAVE();}GdkDisplay * gdk_cursor_get_display (GdkCursor *cursor){	ENTER();	NIY();	ASSERT();	LEAVE();	return NULL;}GdkPixbuf * gdk_cursor_get_image (GdkCursor *cursor){	ENTER();	NIY();	ASSERT();	LEAVE();	return NULL;}GdkCursor * gdk_cursor_new_from_name (GdkDisplay *display, const gchar *name){	ENTER();	NIY();	ASSERT();	LEAVE();	return NULL;}GdkCursor * gdk_cursor_new_from_pixmap (GdkPixmap *source, GdkPixmap *mask, const GdkColor *fg, const GdkColor *bg, gint x, gint y){	ENTER();	NIY();	ASSERT();	LEAVE();	return NULL;}GdkCursor * gdk_cursor_new_from_pixbuf (GdkDisplay *display, GdkPixbuf *pixbuf, gint x, gint y){	ENTER();	NIY();	ASSERT();	LEAVE();	return NULL;}void gdk_display_get_maximal_cursor_size (GdkDisplay *display, guint *width, guint *height){	ENTER();	NIY();	ASSERT();	LEAVE();}gboolean gdk_display_supports_cursor_alpha (GdkDisplay *display){	ENTER();	NIY();	ASSERT();	LEAVE();	return 0;}gboolean gdk_display_supports_cursor_color (GdkDisplay *display){	ENTER();	NIY();	ASSERT();	LEAVE();	return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -