亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? gdi.c

?? miniucgui1.30版本的源碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*** $Id: gdi.c,v 1.56 2003/09/04 06:02:53 weiym Exp $**** The graphics display interface module of MiniGUI.**** Copyright (C) 2003 Feynman Software.** Copyright (C) 1999 ~ 2002 Wei Yongming.**** Current maintainer: Wei Yongming.**** Create date: 1999.01.03*//*** This program is free software; you can redistribute it and/or modify** it under the terms of the GNU General Public License as published by** the Free Software Foundation; either version 2 of the License, or** (at your option) any later version.**** This program is distributed in the hope that it will be useful,** but WITHOUT ANY WARRANTY; without even the implied warranty of** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the** GNU General Public License for more details.**** You should have received a copy of the GNU General Public License** along with this program; if not, write to the Free Software** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA*//*** TODO:*/#include <stdio.h>#include <string.h>#include <malloc.h>#include "common.h"#include "minigui.h"#include "gdi.h"#include "window.h"#include "cliprect.h"#include "gal.h"#include "cursor.h"#include "internals.h"#include "inline.h"#include "memops.h"#include "ctrlclass.h"#include "dc.h"#include "sysfont.h"#include "devfont.h"#include "drawtext.h"#if defined(_LITE_VERSION) && !defined(_STAND_ALONE)    #include "ourhdr.h"    #include "client.h"    #include "sharedres.h"#endif/************************* global data define ********************************/DC __mg_screen_dc;gal_pixel SysPixelIndex [17];// This should be the standard EGA palette.const RGB SysPixelColor [] = {    {0x00, 0x00, 0x00},     // transparent   --0    {0x00, 0x00, 0x80},     // dark blue     --1    {0x00, 0x80, 0x00},     // dark green    --2    {0x00, 0x80, 0x80},     // dark cyan     --3    {0x80, 0x00, 0x00},     // dark red      --4    {0x80, 0x00, 0x80},     // dark magenta  --5    {0x80, 0x80, 0x00},     // dark yellow   --6    {0x80, 0x80, 0x80},     // dark gray     --7    {0xC0, 0xC0, 0xC0},     // light gray    --8    {0x00, 0x00, 0xFF},     // blue          --9    {0x00, 0xFF, 0x00},     // green         --10    {0x00, 0xFF, 0xFF},     // cyan          --11    {0xFF, 0x00, 0x00},     // red           --12    {0xFF, 0x00, 0xFF},     // magenta       --13    {0xFF, 0xFF, 0x00},     // yellow        --14    {0xFF, 0xFF, 0xFF},     // light white   --15    {0x00, 0x00, 0x00}      // black         --16};#ifndef _LITE_VERSION// mutex ensuring exclusive access to gdi. pthread_mutex_t __mg_gdilock;#endif/************************* global functions declaration **********************/// the following functions, which defined in other module// but used in this module.extern PGCRINFO GetGCRgnInfo (HWND hWnd);/**************************** static data ************************************/// General DCstatic DC DCSlot [DCSLOTNUMBER];#ifndef _LITE_VERSION// mutex ensuring exclusive access to DC slot. static pthread_mutex_t dcslot;#endifstatic BLOCKHEAP sg_FreeClipRectList;/************************* static functions declaration **********************/static void dc_InitClipRgnInfo (void);static void dc_InitDC (PDC pdc, HWND hWnd, BOOL bIsClient);static void dc_InitScreenDC (void);/************************** inline functions *********************************/inline void WndRect(HWND hWnd, PRECT prc){    PCONTROL pParent;    PCONTROL pCtrl;    pParent = pCtrl = (PCONTROL) hWnd;    if (hWnd == HWND_DESKTOP) {        *prc = g_rcScr;        return;    }    prc->left = pCtrl->left;    prc->top  = pCtrl->top;    prc->right = pCtrl->right;    prc->bottom = pCtrl->bottom;    while ((pParent = pParent->pParent)) {        prc->left += pParent->cl;        prc->top  += pParent->ct;        prc->right += pParent->cl;        prc->bottom += pParent->ct;    }}inline void WndClientRect(HWND hWnd, PRECT prc){    PCONTROL pCtrl;    PCONTROL pParent;    pParent = pCtrl = (PCONTROL) hWnd;    if (hWnd == HWND_DESKTOP) {        *prc = g_rcScr;        return;    }    prc->left = pCtrl->cl;    prc->top  = pCtrl->ct;    prc->right = pCtrl->cr;    prc->bottom = pCtrl->cb;    while ((pParent = pParent->pParent)) {        prc->left += pParent->cl;        prc->top  += pParent->ct;        prc->right += pParent->cl;        prc->bottom += pParent->ct;    }}static void RestrictControlECRGN (RECT* minimal, PCONTROL pCtrl){    RECT rc;    PCONTROL pRoot = (PCONTROL) (pCtrl->pMainWin);    int off_x = 0, off_y = 0;    do {        PCONTROL pParent = pCtrl;        rc.left = pRoot->cl + off_x;        rc.top  = pRoot->ct + off_y;        rc.right = pRoot->cr + off_x;        rc.bottom = pRoot->cb + off_y;        IntersectRect (minimal, minimal, &rc);        if (pRoot == pCtrl->pParent)            break;        off_x += pRoot->cl;        off_y += pRoot->ct;        while (TRUE) {            if (pRoot->children == pParent->pParent->children) {                pRoot = pParent;                break;            }            pParent = pParent->pParent;        }    } while (TRUE);}/******************* Initialization and termination of GDI *******************/BOOL InitScreenDC (void){    InitFreeClipRectList (&sg_FreeClipRectList, SIZE_CLIPRECTHEAP);        INIT_LOCK (&__mg_gdilock, NULL);    INIT_LOCK (&dcslot, NULL);    dc_InitClipRgnInfo();    dc_InitScreenDC ();    return TRUE;}void TerminateScreenDC (void){    DestroyFreeClipRectList (&sg_FreeClipRectList);    DESTROY_LOCK (&__mg_gdilock);    DESTROY_LOCK (&dcslot);}BOOL InitGDI (void){       if (!InitTextBitmapBuffer ()) {        fprintf (stderr,             "GDI: Can not initialize text bitmap buffer!\n");        goto error;    }#ifdef _RBF_SUPPORT#ifdef _INCORE_RES    if (!InitIncoreRBFonts ()) {        fprintf (stderr,             "GDI: Can not initialize incore RBF fonts!\n");        goto error;    }#endif#endif#ifdef _VBF_SUPPORT    if (!InitIncoreVBFonts ()) {        fprintf (stderr,             "GDI: Can not initialize incore VBF fonts!\n");        goto error;    }#endif#ifndef _INCORE_RES#ifdef _RBF_SUPPORT    if (!InitRawBitmapFonts ()) {        fprintf (stderr,             "GDI: Can not initialize raw bitmap fonts!\n");        goto error;    }#endif#ifdef _VBF_SUPPORT    if (!InitVarBitmapFonts ()) {        fprintf (stderr,             "GDI: Can not initialize var bitmap fonts!\n");        goto error;    }#endif#ifdef _QPF_SUPPORT    if (!InitQPFonts ()) {        fprintf (stderr,             "GDI: Can not initialize QPF fonts!\n");        goto error;    }#endif#ifndef _LITE_VERSION#ifdef _TTF_SUPPORT    if (!InitFreeTypeFonts ()) {        fprintf (stderr,             "GDI: Can not initialize TrueType fonts!\n");        goto error;    }#endif#ifdef _TYPE1_SUPPORT    if (!InitType1Fonts ()) {        fprintf (stderr,             "GDI: Can not initialize Type1 fonts!\n");        goto error;    }#endif#endif /* _LITE_VERSION */#endif /* _INCORE_RES */    /* TODO: add other font support here */#ifdef _DEBUG    dumpDevFonts ();#endif    if (!InitSysFont ()) {        fprintf (stderr,             "GDI: Can not create system fonts!\n");        goto error;    }    return TRUE;error:    return FALSE;}void TerminateGDI( void ){    TermSysFont ();    /* TODO: add other font support here */#ifndef _INCORE_RES#ifndef _LITE_VERSION#ifdef _TTF_SUPPORT    TermFreeTypeFonts ();#endif#ifdef _TYPE1_SUPPORT	TermType1Fonts();#endif#endif /* _LITE_VERSION */#ifdef _QPF_SUPPORT    TermQPFonts ();#endif#ifdef _VBF_SUPPORT    TermVarBitmapFonts ();#endif#ifdef _RBF_SUPPORT    TermRawBitmapFonts ();#endif#endif /* _INCORE_RES */#ifdef _VBF_SUPPORT    TermIncoreVBFonts ();#endif#ifdef _RBF_SUPPORT#ifdef _INCORE_RES    TermIncoreRBFonts ();#endif#endif    ResetDevFont ();    TermTextBitmapBuffer ();}/* * Function: int GUIAPI GetGDCapability( int iItem)  *      This Function return DC parameters. * Parameters: *      The element want to retrive. * Return: *      The parameter. */unsigned int GUIAPI GetGDCapability (HDC hdc, int iItem){    PDC pdc;    unsigned int iret = 0xFFFFFFFF;    pdc = dc_HDC2PDC (hdc);    LOCK (&__mg_gdilock);    switch (iItem)    {        case GDCAP_DEPTH:            iret = GAL_BitsPerPixel (pdc->surface);            break;        case GDCAP_BPP:            iret = GAL_BytesPerPixel (pdc->surface);            break;        case GDCAP_COLORNUM:            iret = GAL_BitsPerPixel (pdc->surface);            if (iret < 32)                iret = 1 << iret;            else                iret = 0xFFFFFFFF;            break;         case GDCAP_HPIXEL:            iret = GAL_Width (pdc->surface);            break;        case GDCAP_VPIXEL:            iret = GAL_Height (pdc->surface);            break;        case GDCAP_MAXX:            iret = GAL_Width (pdc->surface) - 1;            break;        case GDCAP_MAXY:            iret = GAL_Height (pdc->surface) - 1;            break;    }    UNLOCK(&__mg_gdilock);    return iret;}// This function init clip region in all DC slots.static void dc_InitClipRgnInfo(void){    int i;    for (i=0; i<DCSLOTNUMBER; i++) {        // Local clip region        InitClipRgn (&DCSlot[i].lcrgn, &sg_FreeClipRectList);        // Global clip region info        DCSlot[i].pGCRInfo = NULL;        DCSlot[i].oldage = 0;        // Effective clip region        InitClipRgn (&DCSlot[i].ecrgn, &sg_FreeClipRectList);    }   }// This function generates effective clip region from// local clip region and global clip region.// if the global clip region has a new age,// this function empty effective clip region first,// and then intersect local clip region and global clip region.BOOL dc_GenerateECRgn(PDC pdc, BOOL fForce){    PCLIPRECT pcr;    PCONTROL pCtrl;    RECT minimal;    // is global clip region is empty?    if ((!fForce) && (!dc_IsVisible (pdc)))        return FALSE;    // need regenerate?    if (fForce || (pdc->oldage != pdc->pGCRInfo->age)) {        /* copy local clipping region to effective clipping region. */        ClipRgnCopy (&pdc->ecrgn, &pdc->lcrgn);        /* transfer device coordinates to screen coordinates. */        pcr = pdc->ecrgn.head;        while (pcr) {            coor_DP2SP (pdc, &pcr->rc.left, &pcr->rc.top);            coor_DP2SP (pdc, &pcr->rc.right, &pcr->rc.bottom);                        pcr = pcr->next;        }        /* intersect with global clipping region. */        if (pdc->lcrgn.head == NULL)            ClipRgnCopy (&pdc->ecrgn, &pdc->pGCRInfo->crgn);        else {            coor_DP2SP (pdc, &pdc->ecrgn.rcBound.left, &pdc->ecrgn.rcBound.top);            coor_DP2SP (pdc, &pdc->ecrgn.rcBound.right, &pdc->ecrgn.rcBound.bottom);            ClipRgnIntersect (&pdc->ecrgn, &pdc->ecrgn, &pdc->pGCRInfo->crgn);#ifdef _REGION_DEBUG            dumpRegion (&pdc->pGCRInfo->crgn);            dumpRegion (&pdc->ecrgn);#endif        }        /*          * update pdc->DevRC, and restrict the effective          * clipping region more with pdc->DevRC.         */        if (pdc->bIsClient)            WndClientRect (pdc->hwnd, &pdc->DevRC);        else            WndRect (pdc->hwnd, &pdc->DevRC);        minimal = pdc->DevRC;        /* restrict control's effective region. */        pCtrl = Control (pdc->hwnd);        if (pCtrl && !(pCtrl->dwExStyle & WS_EX_CTRLASMAINWIN))            RestrictControlECRGN (&minimal, pCtrl);        IntersectClipRect (&pdc->ecrgn, &minimal);        pdc->oldage = pdc->pGCRInfo->age;    }    return TRUE;}PDC check_ecrgn (HDC hdc){    PDC pdc = dc_HDC2PDC(hdc);    if (dc_IsGeneralDC (pdc)) {        LOCK (&pdc->pGCRInfo->lock);        if (!dc_GenerateECRgn (pdc, FALSE)) {            UNLOCK (&pdc->pGCRInfo->lock);            return NULL;        }    }    return pdc;}int enter_drawing (PDC pdc){    BLOCK_DRAW_SEM (pdc);#ifdef _LITE_VERSION    if (CHECK_DRAWING (pdc))        goto fail;    if (CHECK_CLI_SCREEN (pdc, pdc->rc_output))        goto fail;#endif    if (!IntersectRect (&pdc->rc_output, &pdc->rc_output, &pdc->ecrgn.rcBound))        goto fail;    LOCK (&__mg_gdilock);    if (!dc_IsMemDC (pdc))        ShowCursorForGDI (FALSE, &pdc->rc_output);    return 0;fail:    UNBLOCK_DRAW_SEM (pdc);    return -1;}void enter_drawing_nocheck (PDC pdc){    BLOCK_DRAW_SEM (pdc);    LOCK (&__mg_gdilock);    if (!dc_IsMemDC (pdc))        ShowCursorForGDI (FALSE, &pdc->rc_output);}void leave_drawing(PDC pdc){    if (!dc_IsMemDC (pdc))        ShowCursorForGDI (TRUE, &pdc->rc_output);    UNLOCK (&__mg_gdilock);    UNBLOCK_DRAW_SEM (pdc);}static void _dc_set_pixel_1 (PDC pdc){    *pdc->cur_dst = (Uint8) pdc->cur_pixel;}static void _dc_set_pixel_2 (PDC pdc){    *(Uint16 *) pdc->cur_dst = (Uint16) pdc->cur_pixel;}static void _dc_set_pixel_3 (PDC pdc){    *(Uint16*) pdc->cur_dst = (Uint16) pdc->cur_pixel;    *(pdc->cur_dst + 2) = (Uint8) (pdc->cur_pixel >> 16);}static void _dc_set_pixel_4 (PDC pdc){    *(Uint32 *) pdc->cur_dst = (Uint32) pdc->cur_pixel;}static void _dc_and_pixel_1 (PDC pdc){    *pdc->cur_dst &= (Uint8) pdc->cur_pixel;}static void _dc_and_pixel_2 (PDC pdc){    *(Uint16 *) pdc->cur_dst &= (Uint16) pdc->cur_pixel;}static void _dc_and_pixel_3 (PDC pdc)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆精品精品国产自在97香蕉| www.欧美.com| 九九精品一区二区| 国产在线播放一区三区四| 日本高清成人免费播放| 国产精品久久久久影视| 男人的j进女人的j一区| 欧美三级日本三级少妇99| 日韩美女啊v在线免费观看| 国产一区二区在线观看免费| 欧美午夜精品一区| 久久久久久久久久久久久女国产乱 | 国产一区91精品张津瑜| 欧美视频精品在线观看| 亚洲美女少妇撒尿| 成人激情小说乱人伦| 91精品国产综合久久婷婷香蕉| 一区二区三区精品在线观看| 成人免费视频一区二区| 欧美高清在线一区| 国产mv日韩mv欧美| 亚洲欧美日韩国产手机在线| 色综合色狠狠综合色| 亚洲精品中文在线观看| 色综合久久综合中文综合网| 一区二区三区中文在线| 欧美日本国产一区| 婷婷夜色潮精品综合在线| 欧美人与禽zozo性伦| 久久精品国产精品青草| 日韩免费看的电影| 国产精品一区二区久激情瑜伽| 欧美v国产在线一区二区三区| 日本不卡视频一二三区| 久久久久9999亚洲精品| 韩国精品免费视频| 欧美成人三级在线| 99精品在线免费| 首页国产丝袜综合| 2017欧美狠狠色| 欧美日韩亚洲国产综合| 国产在线播放一区二区三区| 国产精品久久久久久户外露出| 欧美唯美清纯偷拍| 国产福利一区二区三区视频在线 | 欧美三级日本三级少妇99| 免费在线观看一区| 亚洲精品视频在线看| 精品精品国产高清a毛片牛牛 | 亚洲欧洲成人精品av97| 成人免费视频网站在线观看| 有坂深雪av一区二区精品| 国产欧美日韩精品一区| 日韩精品一区二区三区视频播放| 99热精品一区二区| 成人高清免费观看| 国产一区二区三区久久久| 亚洲福中文字幕伊人影院| 国产农村妇女毛片精品久久麻豆 | 亚洲图片激情小说| 日韩三级视频在线看| 69堂国产成人免费视频| 欧美一区二区视频在线观看2020| 欧美日韩二区三区| 日韩欧美成人一区| 欧美精品一区二区蜜臀亚洲| 中文在线一区二区| 亚洲美女区一区| 男人的j进女人的j一区| 精品一区二区三区免费| 3d动漫精品啪啪| 日韩一区二区三区在线观看| 精品国产91九色蝌蚪| 国产精品你懂的在线欣赏| 亚洲桃色在线一区| 六月丁香综合在线视频| 风间由美性色一区二区三区| 色欲综合视频天天天| 精品欧美一区二区久久| 中文字幕一区日韩精品欧美| 日韩高清不卡在线| 成人h动漫精品一区二| 欧美一区二区免费视频| 亚洲欧洲三级电影| 美女网站在线免费欧美精品| 不卡欧美aaaaa| 欧美亚洲丝袜传媒另类| 国产欧美va欧美不卡在线| 日韩不卡在线观看日韩不卡视频| 成人综合激情网| 精品国内二区三区| 午夜激情久久久| 色88888久久久久久影院按摩| 欧美日韩在线播放| 欧美精彩视频一区二区三区| 免费在线欧美视频| 5月丁香婷婷综合| 亚洲成在人线在线播放| 91香蕉视频黄| 亚洲三级久久久| 成人av免费网站| 国产精品女人毛片| 不卡视频在线看| 国产精品不卡视频| 91在线精品一区二区三区| 久久色视频免费观看| 国产成人亚洲综合a∨婷婷| 日韩精品专区在线| 国产精品一二三四| 国产精品入口麻豆九色| 国产成人免费在线视频| 国产精品久久久久国产精品日日| 国产99久久久精品| 国产精品黄色在线观看 | 天堂午夜影视日韩欧美一区二区| 欧美日韩美少妇| 亚洲电影在线播放| 99这里只有久久精品视频| 国产精品区一区二区三区| 91在线观看视频| 午夜视频一区在线观看| 7777女厕盗摄久久久| 国产成人av一区| 亚洲18色成人| 国产午夜亚洲精品午夜鲁丝片| 精品一区二区久久久| 亚洲特级片在线| 久久久高清一区二区三区| 在线区一区二视频| 激情综合色播激情啊| 一区二区三区四区乱视频| 精品福利av导航| 欧洲一区二区三区在线| 国产很黄免费观看久久| 手机精品视频在线观看| 亚洲另类在线视频| 国产精品麻豆欧美日韩ww| 4hu四虎永久在线影院成人| 91丨porny丨最新| 国产99久久久精品| 精品理论电影在线观看| 91亚洲资源网| 丰满少妇久久久久久久| 一区二区三区**美女毛片| 国产亚洲精品中文字幕| 欧美成人精品二区三区99精品| 欧美在线观看视频在线| 一本一本大道香蕉久在线精品 | 亚洲精品国产a| 国产精品九色蝌蚪自拍| 国产视频一区二区在线| 日韩精品一区二区三区在线| 在线不卡免费欧美| 欧美电影一区二区三区| 欧美一级午夜免费电影| 制服.丝袜.亚洲.中文.综合| 在线观看亚洲精品视频| 色综合久久综合中文综合网| 成人激情视频网站| 成人激情综合网站| 在线免费观看日韩欧美| 欧美日韩精品系列| 精品久久久影院| 国产精品国产馆在线真实露脸| 国产精品剧情在线亚洲| 亚洲欧美日韩国产综合| 亚洲资源中文字幕| 美脚の诱脚舐め脚责91 | 国产校园另类小说区| 26uuu精品一区二区三区四区在线| 亚洲精品在线观| 国产精品国产三级国产普通话三级 | 成人免费电影视频| 在线一区二区三区四区五区| 7799精品视频| 亚洲欧美综合网| 麻豆精品在线播放| 色综合欧美在线视频区| 欧美四级电影网| 久久久精品欧美丰满| 视频一区免费在线观看| 国产精品一区二区黑丝| 日本va欧美va欧美va精品| 蜜桃av噜噜一区二区三区小说| 精品在线观看免费| 色婷婷综合五月| 欧美日韩三级在线| 亚洲欧美乱综合| 99在线热播精品免费| 久久一区二区三区四区| 久久久美女毛片| 免费成人av在线| 日韩欧美你懂的| 丝瓜av网站精品一区二区 | 欧美私模裸体表演在线观看| 国产精品女人毛片| 成人av网站免费观看| 国产欧美精品日韩区二区麻豆天美| 国内精品久久久久影院一蜜桃| 欧美一区二区在线不卡|