/*************************************************************************** * Copyright (c) 2002-2006, Broadcom Corporation * All Rights Reserved * Confidential Property of Broadcom Corporation * * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. * * $brcm_Workfile: bccwinlib.h $ * $brcm_Revision: 9 $ * $brcm_Date: 9/15/06 12:06p $ * * Module Description: * * Revision History: * * $brcm_Log: /BSEAV/lib/ccgfx/winlib/bccwinlib.h $ * * 9 9/15/06 12:06p btosi * PR22275: added support for font edges * * 8 9/12/06 10:15a btosi * PR22275: added support for clipping the CC window to the framebuffer * * 7 8/17/06 1:12p btosi * PR22275: modifications to support dynamically loading/unloading fonts * * 6 7/27/06 9:41a btosi * PR22275: cleaned up scrolling logic, added support for managing the * framebuffer directly * * 5 7/7/06 12:32p btosi * PR22275: added logic to redraw the framebuffer less frequently * * 4 5/24/06 6:45p shyam * PR 8365 : Reorganized calls depending on the gfx sub-system (removed * init) * * 3 5/17/05 7:49p shyam * PR 8365 : Making it work at runtime * ***************************************************************************/ #ifndef BCCWINLIB_H #define BCCWINLIB_H #include "bsettop.h" #include "bdcc.h" #include "bdcc_kernel.h" #ifdef CONFIG_GFX_ARGB32 /* data is from g_eia708_palette */ #define DCCGFX_COLOR_CLEAR 0x00000000 #define DCCGFX_COLOR_BLACK 0xff000000 #define DCCGFX_COLOR_WHITE 0xff7e7e7e #define DCCGFX_COLOR_RED 0xff7d00ff #define DCCGFX_COLOR_GREEN 0xff007f00 #define DCCGFX_COLOR_BLUE 0xffff007c #define DCCGFX_COLOR_YELLOW 0xff7e7eff #define DCCGFX_COLOR_MAGENTA 0xff7d007d #define DCCGFX_COLOR_CYAN 0xff007e7c #define DCCGFX_COLOR_TL_BLACK 0x5f000000 #define DCCGFX_COLOR_TL_WHITE 0x5f7e7e7e #define DCCGFX_COLOR_TL_RED 0x5f7d00ff #define DCCGFX_COLOR_TL_GREEN 0x5f007f00 #define DCCGFX_COLOR_TL_BLUE 0x5fff007c #define DCCGFX_COLOR_TL_YELLOW 0x5f7e7eff #define DCCGFX_COLOR_TL_MAGENTA 0x5f7d007d #else #define DCCGFX_COLOR_CLEAR 0 #define DCCGFX_COLOR_BLACK 1 #define DCCGFX_COLOR_WHITE 2 #define DCCGFX_COLOR_RED 3 #define DCCGFX_COLOR_GREEN 4 #define DCCGFX_COLOR_BLUE 5 #define DCCGFX_COLOR_YELLOW 6 #define DCCGFX_COLOR_MAGENTA 7 #define DCCGFX_COLOR_CYAN 8 #define DCCGFX_COLOR_TL_BLACK 9 #define DCCGFX_COLOR_TL_WHITE 10 #define DCCGFX_COLOR_TL_RED 11 #define DCCGFX_COLOR_TL_GREEN 12 #define DCCGFX_COLOR_TL_BLUE 13 #define DCCGFX_COLOR_TL_YELLOW 14 #define DCCGFX_COLOR_TL_MAGENTA 15 #endif /* For 4:3 display */ #define DCCGFX_MAX_CELL_WIDTH 20 #define DCCGFX_MAX_CELL_HEIGHT 28 #define BDCC_Max_Edge_Width 5 #define CCGFX_NUM_WNDS 8 #ifdef __cplusplus extern "C" { #endif typedef void (*bccgfx_update_cb_t)(void * data, int param); /* get wide_aspect_ratio so that we can decide anchor point based on wide_aspect_ratio from Closed Caption descriptor */ typedef int (*bccgfx_get_wide_aspect_ratio_cb_t)(void); /*************************************************************************** Summary: The CCGfx handle to the CCGfx object Description: The CCGfx handle to the CCGfx object See Also: ****************************************************************************/ typedef struct BCCGFX_WINLIB_P_Object *BCCGFX_WINLIB_P_Handle; /*************************************************************************** Summary: The CCGfx handle to the CCGfx window Description: The CCGfx handle to the CCGfx window See Also: ****************************************************************************/ typedef struct BCCGFX_WINLIB_P_Window *BCCGFX_WINLIB_P_hWin; /*************************************************************************** Summary: The CCGfx handle to the CCGfx window font Description: The CCGfx handle to the CCGfx window font See Also: ****************************************************************************/ typedef struct BCCGFX_WINLIB_P_FontInfo *BCCGFX_WINLIB_P_Font; /*************************************************************************** Summary: The CCGfx Errors Description: The CCGfx Errors See Also: ****************************************************************************/ typedef enum BCCGFX_WINLIB_P_ErrCode { BCCGFX_WINLIB_P_SUCCESS, BCCGFX_WINLIB_P_ERROR_NO_MEMORY } BCCGFX_WINLIB_P_ErrCode; /*************************************************************************** Summary: The CCGfx rectangle Description: The CCGfx rectangle See Also: ****************************************************************************/ typedef struct BCCGFX_WINLIB_P_Rect { int x; /* can be < 0 */ int y; /* can be < 0 */ int width; int height; } BCCGFX_WINLIB_P_Rect; typedef struct BCCGFX_WINLIB_P_FrameBufferSettings { int iWidth; int iHeight; } BCCGFX_WINLIB_P_FrameBufferSettings; typedef struct BCCGFX_WINLIB_P_SurfaceSettings { int iWidth; int iHeight; } BCCGFX_WINLIB_P_SurfaceSettings; /* Removed Init call and put it in bccwinlib_plat.h as it uses settopapi * handles, other platforms may have their own handles and implementation */ BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_OpenWindow(BCCGFX_WINLIB_P_Handle hWinLibHandle, BCCGFX_WINLIB_P_hWin *win, uint32_t width, uint32_t height); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_CloseWindow(BCCGFX_WINLIB_P_hWin win); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_SetZorder(BCCGFX_WINLIB_P_hWin win, int zorder); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_Show(BCCGFX_WINLIB_P_hWin win); bool BCCGFX_WINLIB_P_IsShown(BCCGFX_WINLIB_P_hWin win); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_Hide(BCCGFX_WINLIB_P_hWin win); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_SetPosition(BCCGFX_WINLIB_P_hWin win, uint32_t x, uint32_t y); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_GetPenPosition(BCCGFX_WINLIB_P_hWin win, uint32_t *px, uint32_t *py); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_SetPenPosition(BCCGFX_WINLIB_P_hWin win, uint32_t x, uint32_t y); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_SetForegroundColor(BCCGFX_WINLIB_P_hWin win, uint32_t ForeGroundColor); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_SetBackgroundColor(BCCGFX_WINLIB_P_hWin win, uint32_t BackGroundColor); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_SetEdgeColor(BCCGFX_WINLIB_P_hWin win, uint32_t EdgeColor); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_SetEdgeType(BCCGFX_WINLIB_P_hWin win, BDCC_Edge EdgeType ); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_SetEdgeWidth(BCCGFX_WINLIB_P_hWin win, uint32_t EdgeWidth ); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_FillRect(BCCGFX_WINLIB_P_hWin win, const BCCGFX_WINLIB_P_Rect *rect, uint32_t color); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_SetViewRect(BCCGFX_WINLIB_P_hWin win, const BCCGFX_WINLIB_P_Rect *pRect); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_GetRect(BCCGFX_WINLIB_P_hWin win, BCCGFX_WINLIB_P_Rect *pRect); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_LoadFont(BCCGFX_WINLIB_P_Handle hWinLibHandle, const char *pFontFile, int iFontSize, BCCGFX_WINLIB_P_Font *phFont); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_SetFont(BCCGFX_WINLIB_P_hWin win, BCCGFX_WINLIB_P_Font hFont, int italics, int underline); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_GetFontHandle(BCCGFX_WINLIB_P_hWin win, BCCGFX_WINLIB_P_Font *pFontHandle ); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_DrawString(BCCGFX_WINLIB_P_hWin win, const char *str); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_Copy(BCCGFX_WINLIB_P_hWin src, BCCGFX_WINLIB_P_hWin dst, const BCCGFX_WINLIB_P_Rect *pSrcRect, const BCCGFX_WINLIB_P_Rect *pDstRect ); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_DrawHLine( BCCGFX_WINLIB_P_hWin win, uint32_t x, uint32_t y, uint32_t wide, uint32_t length, uint32_t FgColor); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_GetGlyphMetrics( BCCGFX_WINLIB_P_Font hFont, const char ch, int *pWidth, int * pHeight ); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_UnloadFont(BCCGFX_WINLIB_P_Font font); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_RedrawScreen(BCCGFX_WINLIB_P_Handle win); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_FillFrameBuffer(BCCGFX_WINLIB_P_Handle hWinLibHandle, const BCCGFX_WINLIB_P_Rect *rect, uint32_t color ); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_CopyToFrameBuffer( BCCGFX_WINLIB_P_hWin src, BCCGFX_WINLIB_P_Handle hWinLibHandle, const BCCGFX_WINLIB_P_Rect *pSrcRect, const BCCGFX_WINLIB_P_Rect *pDstRect ); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_SetRect(BCCGFX_WINLIB_P_hWin win, BCCGFX_WINLIB_P_Rect *pRect ); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_GetFrameBufferSettings(BCCGFX_WINLIB_P_Handle hWinLibHandle, BCCGFX_WINLIB_P_FrameBufferSettings * pSettings ); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_GetSurfaceSettings( BCCGFX_WINLIB_P_hWin pSurface, BCCGFX_WINLIB_P_SurfaceSettings * pSettings ); BCCGFX_WINLIB_P_ErrCode BCCGFX_WINLIB_P_SetClipState(BCCGFX_WINLIB_P_hWin win, bool bClipState ); bool BCCGFX_WINLIB_P_GetClipState(BCCGFX_WINLIB_P_hWin win ); int BDCC_WINLIB_P_GetActiveWindowSettings(BCCGFX_WINLIB_P_Handle phWinLibHandle, unsigned int *colors, unsigned int *style); int BCCGFX_WINLIB_GetWideAspectRatio(BCCGFX_WINLIB_P_Handle hWinLibHandle); #ifdef __cplusplus } #endif #endif /* BCCWINLIB_H */