42 #ifndef _MGNCS_RENDER_H 43 #define _MGNCS_RENDER_H 59 #define NCS_TYPE_MASK WE_ATTR_TYPE_MASK 60 #define NCS_TYPE_COLOR_MASK WE_ATTR_TYPE_COLOR_MASK 61 #define NCS_TYPE_INDEX_MASK WE_ATTR_TYPE_INDEX_MASK 63 #define NCS_TYPE_METRICS 0x6000 64 #define NCS_TYPE_COLOR 0x7000 65 #define NCS_TYPE_IMAGE 0x8000 66 #define NCS_TYPE_INT 0x9000 67 #define NCS_TYPE_FGC NCS_TYPE_COLOR 68 #define NCS_TYPE_BGC (NCS_TYPE_COLOR | 0x0100) 70 #define NCS_TYPE_IS_IMAGE(id) (((id) & NCS_TYPE_MASK) == NCS_TYPE_IMAGE) 72 #define NCS_METRICS_BASEID (NCS_TYPE_METRICS | 0) 73 #define NCS_FGC_BASEID (NCS_TYPE_FGC | 0) 74 #define NCS_BGC_BASEID (NCS_TYPE_BGC | 0) 75 #define NCS_INT_BASEID (NCS_TYPE_INT | 0) 76 #define NCS_IMAGE_BASEID (NCS_TYPE_IMAGE | 0) 78 #define NCS_FONT_NUMBER 0 79 #define NCS_METRICS_NUMBER 2 80 #define NCS_COLORS_NUMBER 9 81 #define NCS_IMAGE_NUMBER 17 82 #define NCS_INT_NUMBER 5 85 #define NCS_FGC_3DBODY NCS_FGC_BASEID 86 #define NCS_BGC_3DBODY NCS_BGC_BASEID 88 #define NCS_FGC_WINDOW NCS_FGC_BASEID + 1 89 #define NCS_BGC_WINDOW NCS_BGC_BASEID + 1 91 #define NCS_FGC_SELECTED_ITEM NCS_FGC_BASEID + 2 92 #define NCS_BGC_SELECTED_ITEM NCS_BGC_BASEID + 2 94 #define NCS_FGC_HILIGHT_ITEM NCS_FGC_BASEID + 3 95 #define NCS_BGC_HILIGHT_ITEM NCS_BGC_BASEID + 3 97 #define NCS_FGC_DISABLED_ITEM NCS_FGC_BASEID + 4 98 #define NCS_BGC_DISABLED_ITEM NCS_BGC_BASEID + 4 100 #define NCS_BGC_SELITEM_NOFOCUS NCS_BGC_BASEID + 5 102 #define NCS_IMAGE_BKGND NCS_IMAGE_BASEID 103 #define NCS_MODE_BKIMAGE NCS_INT_BASEID 106 #define NCS_METRICS_BORDER_WIDTH (NCS_METRICS_BASEID) 107 #define NCS_METRICS_BORDER_RADIUS (NCS_METRICS_BASEID + 1) 110 #define NCS_METRICS_3DBODY_ROUNDX (NCS_METRICS_BASEID) 111 #define NCS_METRICS_3DBODY_ROUNDY (NCS_METRICS_BASEID + 1) 112 #define NCS_MODE_BGC NCS_INT_BASEID + 1 113 #define NCS_MODE_FGC NCS_INT_BASEID + 2 114 #define NCS_MODE_ITEM NCS_INT_BASEID + 3 115 #define NCS_MODE_USEFLAT NCS_INT_BASEID + 4 118 #define NCS_BGC_PRGBAR_CHUNK NCS_BGC_BASEID + 6 120 #define NCS_BGC_TRKBAR_SLIDER NCS_BGC_BASEID + 7 121 #define NCS_BGC_TRKBAR_THUMB NCS_BGC_BASEID + 8 124 #define NCS_BGC_PRPSHT_NMLTAB NCS_BGC_BASEID + 9 127 #define NCS_IMAGE_ARROWS NCS_IMAGE_BASEID + 1 128 #define NCS_IMAGE_ARROWSHELL NCS_IMAGE_BASEID + 2 130 #define NCS_IMAGE_BUTTON NCS_IMAGE_BASEID + 3 132 #define NCS_IMAGE_CHKBTN NCS_IMAGE_BASEID + 4 134 #define NCS_IMAGE_RDOBTN NCS_IMAGE_BASEID + 5 136 #define NCS_IMAGE_LISTV_TREE NCS_IMAGE_BASEID + 6 137 #define NCS_IMAGE_LISTV_HDR NCS_IMAGE_BASEID + 7 139 #define NCS_IMAGE_PRPSHT_TAB NCS_IMAGE_BASEID + 8 141 #define NCS_IMAGE_PRGBAR_HCHUNK NCS_IMAGE_BASEID + 9 142 #define NCS_IMAGE_PRGBAR_VCHUNK NCS_IMAGE_BASEID + 10 143 #define NCS_IMAGE_PRGBAR_HSLIDER NCS_IMAGE_BASEID + 11 144 #define NCS_IMAGE_PRGBAR_VSLIDER NCS_IMAGE_BASEID + 12 146 #define NCS_IMAGE_TRKBAR_HSLIDER NCS_IMAGE_BASEID + 13 147 #define NCS_IMAGE_TRKBAR_VSLIDER NCS_IMAGE_BASEID + 14 148 #define NCS_IMAGE_TRKBAR_HTHUMB NCS_IMAGE_BASEID + 15 149 #define NCS_IMAGE_TRKBAR_VTHUMB NCS_IMAGE_BASEID + 16 224 typedef struct _NCS_RDR_ID_NAME {
230 MGNCS_EXPORT BOOL ncsLoadRdrElementsFromEtcFile(
const char* etcfile,
const char** rdrNames,
int count, NCS_RDR_ID_NAME * id_names);
232 MGNCS_EXPORT BOOL ncsLoadRdrElementsFromEtcHandle(GHANDLE hEtc,
const char** rdrNames,
int count, NCS_RDR_ID_NAME* id_names);
242 MGNCS_EXPORT GHANDLE
ncsLoadRdrEtcFile (
const char* etcfile,
const char** rdrName,
int count);
256 MGNCS_EXPORT
extern GHANDLE g_ncsEtcHandle;
265 static inline void ncsSetEtcHandle(GHANDLE hEtc)
267 g_ncsEtcHandle = hEtc;
276 #define ncsGetElement(self, id) \ 277 ncsGetElementEx((mWidget*)self, NULL, id) 283 #define ncsSetElement(self, id, value) \ 284 ncsSetElementEx((mWidget*)self, NULL, id, value) 314 MGNCS_EXPORT BOOL
ncsRegisterCtrlRDR (
const char *rendererName,
const char *className,
408 #define INVALID_RDR_VALUE ((DWORD)-1) 410 static inline gal_pixel ncsColor2Pixel(HDC hdc, DWORD color)
412 return RGBA2Pixel(hdc,GetRValue(color),
418 MGNCS_EXPORT
void ncsCommRDRDrawFocusFrame(HWND hWnd, HDC hdc,
const RECT *rc);
419 MGNCS_EXPORT BOOL ncsCommRDRDrawBkgnd(HWND hWnd, HDC hdc,
const RECT* inv_rc);
421 MGNCS_EXPORT
void ncsCommRDRDraw3dbox(HDC hdc,
const RECT* rc, DWORD color, DWORD flag);
422 MGNCS_EXPORT
void ncsCommRDRDraw3DRoundBox(HDC hdc,
const RECT *rc,
int rx,
int ry, DWORD color, DWORD flag);
424 #define NCS_ROUND_CORNER_LEFT_TOP (0x1) 425 #define NCS_ROUND_CORNER_LEFT_BOTTOM (0x2) 426 #define NCS_ROUND_CORNER_RIGHT_TOP (0x4) 427 #define NCS_ROUND_CORNER_RIGHT_BOTTOM (0x8) 428 #define NCS_ROUND_CORNER_LEFTS (NCS_ROUND_CORNER_LEFT_TOP|NCS_ROUND_CORNER_LEFT_BOTTOM) 429 #define NCS_ROUND_CORNER_RIGHTS (NCS_ROUND_CORNER_RIGHT_TOP|NCS_ROUND_CORNER_RIGHT_BOTTOM) 430 #define NCS_ROUND_CORNER_TOPS (NCS_ROUND_CORNER_LEFT_TOP|NCS_ROUND_CORNER_RIGHT_TOP) 431 #define NCS_ROUND_CORNER_BOTTOMS (NCS_ROUND_CORNER_LEFT_BOTTOM|NCS_ROUND_CORNER_RIGHT_BOTTOM) 432 #define NCS_ROUND_CORNER_ALL (NCS_ROUND_CORNER_LEFT_TOP|NCS_ROUND_CORNER_LEFT_BOTTOM| \ 433 NCS_ROUND_CORNER_RIGHT_TOP|NCS_ROUND_CORNER_RIGHT_BOTTOM) 434 #define NCS_BORDER_LEFT 0x1000 435 #define NCS_BORDER_RIGHT 0x2000 436 #define NCS_BORDER_TOP 0x4000 437 #define NCS_BORDER_BOTTOM 0x8000 438 #define NCS_BORDER_ALL (NCS_BORDER_LEFT|NCS_BORDER_RIGHT|NCS_BORDER_TOP|NCS_BORDER_BOTTOM) 440 MGNCS_EXPORT
void ncsCommRDRDraw3DHalfRoundBox(HDC hdc,
const RECT *rc,
int rx,
int ry, DWORD color, DWORD flag, DWORD part_flag);
441 MGNCS_EXPORT
void ncsCommRDRDrawHalfRoundRect(HDC hdc,
const RECT *rc,
int rx,
int ry, DWORD color, DWORD part_flag);
443 MGNCS_EXPORT
void ncsCommRDRFillHalfRoundRect(HDC hdc,
const RECT *rc,
int rx,
int ry, DWORD color, DWORD part_flag);
445 MGNCS_EXPORT
void ncsCommRDRDraw3DEllipse(HDC hdc,
const RECT *rc, DWORD color1, DWORD color2, DWORD flag);
447 MGNCS_EXPORT
void ncsCommRDRDrawCheckbox(HDC hdc,
const RECT* rc, DWORD fgcolor, DWORD bgcolor, DWORD discolor, DWORD flag);
449 MGNCS_EXPORT
void ncsCommRDRDrawRadio(HDC hdc,
const RECT* rc, DWORD fgcolor, DWORD bgcolor, DWORD discolor,DWORD flag);
451 MGNCS_EXPORT
void ncsCommRDRDrawArrow(HDC hdc,
const RECT* rc,
int arrow,DWORD color, BOOL bFill);
453 MGNCS_EXPORT
void ncsCommRDRDrawItem(HDC hdc,
const RECT* rc, DWORD color);
455 MGNCS_EXPORT
void ncsCommRDRDrawSmallHalfRoundBox(HDC hdc,
const RECT *rc, DWORD flags, BOOL bFill);
457 enum ncsCommRDRColorCalc {
458 NCSR_COLOR_DARKER = -100,
459 NCSR_COLOR_DARKEST = -200 ,
460 NCSR_COLOR_LIGHTER = 100 ,
461 NCSR_COLOR_LIGHTEST = 200
464 MGNCS_EXPORT DWORD ncsCommRDRCalc3dboxColor(DWORD color,
int degree);
468 #define DI_FILL_TILE 0x01 469 #define DI_FILL_STRETCH 0x02 472 typedef struct _DRAWINFO
478 unsigned int nr_line;
484 unsigned int idx_line;
487 unsigned int idx_col;
490 unsigned int margin1;
493 unsigned int margin2;
512 MGNCS_EXPORT
void ncsSkinDraw(HDC hdc,
const RECT* rc,
const DRAWINFO *di);
MGNCS_EXPORT const char * ncsGetSystemRenderer(void)
get the system renderer name
MGNCS_EXPORT void ncsUnregisterCtrlRDRs(const char *rdrName, const char *className)
unregister a special rdr
MGNCS_EXPORT BOOL ncsSetSystemRenderer(const char *name)
Set the System renderer. If a system renderer would be used by all the controls who haven't been set ...
MGNCS_EXPORT GHANDLE ncsLoadRdrEtcFile(const char *etcfile, const char **rdrName, int count)
Load renderer configure file from file system or incore mode.
MGNCS_EXPORT DWORD ncsSetElementEx(mWidget *self, const char *rdrName, int id, DWORD value)
Set the value of element id in specified window or renderer.
MGNCS_EXPORT DWORD ncsGetElementEx(mWidget *self, const char *rdrName, int id)
Get the value of element id in specified window or renderer.
MGNCS_EXPORT mWidgetRenderer * ncsRetriveCtrlRDR(const char *rendererName, const char *className)
get a renderer of special control
MGNCS_EXPORT BOOL ncsRegisterCtrlRDRs(const char *rendererName, NCS_RDR_ENTRY *entries, int count)
register a group of renderers into system
struct _NCS_RDR_ENTRY NCS_RDR_ENTRY
MGNCS_EXPORT int ncsUnloadRdrEtcFile(GHANDLE hEtcFile)
Unload renderer configuration file.
MGNCS_EXPORT BOOL ncsRegisterCtrlRDR(const char *rendererName, const char *className, mWidgetRenderer *renderer)
register one of implemention of a special control into system
mWidgetRenderer * renderer