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

📄 nativegui.h

📁 一个操作系统源代码 用于嵌入式设备 在Vc++环境下仿真 成功移植到多款处理器上
💻 H
字号:
/*
 * @(#)nativeGUI.h	1.15 01/07/23
 * Copyright (c)1999-2001 Sun Microsystems, Inc. All Rights Reserved.
 * 
 * This software is the confidential and proprietary information of Sun
 * Microsystems, Inc. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Sun.
 * 
 * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
 * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
 * THIS SOFTWARE OR ITS DERIVATIVES.
 * 
 */

#ifndef NATIVEGUI_H_INCLUDED
#define NATIVEGUI_H_INCLUDED

#include <MIDP\defaultLCDUI.h>

//#include <windows.h>
#include <sys\gpc.h>
#include <ppsm.h>

#include <ctype.h>

/*
 * Defines screen size
 */
#define DISPLAY_WIDTH    96
#define DISPLAY_HEIGHT   128

/*
 * This (x,y) coordinate pair refers to the offset of the upper 
 * left corner of the display screen within the MIDP phone handset
 * graphic window 
 */
#define X_SCREEN_OFFSET 0//50
#define Y_SCREEN_OFFSET 0//70

/* The max number of characters in a command menu item */
#define MAX_COMMAND_LENGTH 127


#define GRAPHICS_SETUP(filled)                                            \
    DWORD pGC;											\
	int bFill	=	filled;								\
	pGC=SysGetGC();										\

#define GRAPHICS_CLEANUP()                                        


#define Polyline(hDC, pts, numbers) \
	{								\
	int i;						\
	for(i=0;i<numbers-1;i++)	\
			SysDrawLine(pGC, pixel, (U8)pts[i].x, (U8)pts[i].y, (U8)pts[i+1].x, (U8)pts[i+1].y,GPC_SOLID_LINE,GPC_REPLACE_STYLE);	\
	}			
	

#define Rectangle(hDC, x1, y1, x2 , y2)  	 \
	if(bFill)									\
		SysClearRec(pGC,(U32)pixel,(U16)x1,(U16)y1,(U16)(x2-x1+1),(U16)(y2-y1+1),GPC_REPLACE_STYLE);	\
	else																\
		SysDrawRec(pGC, (U32)pixel, (U16)x1, (U16)y1, (U16)x2, (U16)y2,dotted?GPC_DASH_LINE : GPC_SOLID_LINE,GPC_REPLACE_STYLE)

#define RoundRect(hdc, x1, y1, x2, y2, arcWidth, arcHeight)  	 \
	if(bFill)									\
		SysClearRec(pGC, (U32)pixel, (U16)x1, (U16)y1, (U16)(x2-x1+1),(U16)(y2-y1+1),GPC_REPLACE_STYLE);	\
	else																\
		SysDrawRec(pGC, (U32)pixel, (U16)x1, (U16)y1, (U16)x2, (U16)y2,dotted?GPC_DASH_LINE : GPC_SOLID_LINE,GPC_REPLACE_STYLE)

#define TextOutW(hDC, x, y, chararray, n)		\
	SysTextOutU(pGC,(U32)pixel,(U16)x,(U16)y,chararray,(U16)n)

#define Ellipse(hdc, x1, y1, x2, y2);
#define Arc(hdc, x1, y1, x2 , y2 , startX, startY, endX, endY);
#define Pie(hdc, x1, y1, x2 , y2 , startX, startY, endX, endY);
#define setupFont(hdc, FONTPARAMS);


extern bool_t        doubleBuffer;
extern void refreshWholePaintWindow();
extern void SysTextOutU(DWORD pGC,DWORD rgb,U8 nXStart, U8 nYStart, char* lpString,U16 cbString);
extern void refreshPaintWindow(int x1, int y1, int x2, int y2);
/*
#define GRAPHICS_SETUP(filled)                                            \
    HDC hdc;                                                              \
    HPEN hPen     = NULL;                                                 \
    HBRUSH hBrush = NULL;                                                 \
    DWORD pGC;											\
	int bFill	=	filled;								\
	pGC=SysGetGC();										\
														\
														\
    hdc = getBitmapDC(dst);                                               \
    setupClip(hdc, dst, clip);                                            \
    if (filled) {                                                         \
        hBrush = setBrush(hdc, pixel);                                    \
        hPen   = setPen(hdc, pixel, 0);                                   \
    } else {                                                              \
        hPen   = setPen(hdc, pixel, dotted);                              \
        SelectObject(hdc, GetStockObject(HOLLOW_BRUSH));                  \
    }

#define GRAPHICS_CLEANUP()                                        \
    if (hPen != NULL) DeleteObject(SelectObject(hdc, hPen));      \
    if (hBrush != NULL) DeleteObject(SelectObject(hdc, hBrush));  \
    releaseBitmapDC(hdc);

#define Polyline(hDC, pts, numbers) \
	{								\
	int i;						\
	for(i=0;i<numbers-1;i++)	\
			SysDrawLine(pGC, pixel, pts[i].x, pts[i].y, pts[i+1].x, pts[i+1].y,GPC_SOLID_LINE,GPC_REPLACE_STYLE);	\
	}			\
	Polyline(hDC, pts, numbers)

#define Rectangle(hDC, x1, y1, x2 , y2)  	 \
	Rectangle(hDC,x1,y1,x2,y2);				\
	if(bFill)									\
		SysClearRec(pGC,pixel,x1,y1,x2-x1+1,y2-y1+1,GPC_REPLACE_STYLE);	\
	else																\
		SysDrawRec(pGC, pixel, x1, y1, x2, y2,dotted?GPC_DASH_LINE : GPC_SOLID_LINE,GPC_REPLACE_STYLE)

#define TextOutW(hDC, x, y, chararray, n)		\
	TextOutW(hDC, x, y, chararray, n);		\
	SysTextOutU(pGC,pixel,x,y,chararray,n)

extern HWND          hMainWindow;
extern HBRUSH        BACKGROUND_BRUSH;
extern HPEN          BACKGROUND_PEN;
extern int           numColors;
extern bool_t        doubleBuffer;
extern int           backgroundColor;

extern HBRUSH setBrush(HDC hdc, int pixel);
extern HPEN setPen(HDC hdc, int pixel, int dotted);
extern HDC getBitmapDC(void *imageData);
extern void releaseBitmapDC(HDC hdcMem);

extern void setupFont(HDC hdc, FONTPARAMS_PROTO);
extern void setupClip(HDC hdc, void *imageData, short *clip);
extern void refreshWholePaintWindow();

extern void DrawBitmap(HDC hdc, HBITMAP hBitmap, int x, int y, int rop);
extern void refreshPaintWindow(int x1, int y1, int x2, int y2);
extern void setupClip(HDC hdc, void *imageData, short *clip);

#ifdef SLOW_DRAWING
extern drawingInterval;

#ifndef SLEEP
  #define SLEEP(x) Sleep(x/1000)
#endif

#endif


*/
#endif

⌨️ 快捷键说明

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