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

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

?? lowgdiw32.cpp

?? 做為linux下圖形用戶界面支持系統之一的MicroWindows采用C++設計
?? CPP
字號:
/*****************************************************************************
 *
 * Lowgdi.c: 低階繪圖介面
 *
 ****************************************************************************/

extern "C" {
#include <windows.h>
}

#include "lowgdiw.h"
#include "wincntlr.h"

/* global variables */
int     _lgClipX1 = 0, _lgClipY1 = 0, _lgClipX2 = 639, _lgClipY2 = 479;
BOOL    _lgClipOut = FALSE;
int     _lgRX1 = 0, _lgRY1 = 0, _lgRX2 = 0, _lgRY2 = 0;
int     _lgColor = 15, _lgBgColor = 0;
BOOL    _lgXOR = FALSE;
BOOL    _lgMouseHide = FALSE;

#define _lgClipAccept(a, b)     (a|b)
#define _lgClipReject(a, b)     (a&b)
#define _lgClipTop              0x08
#define _lgClipBottom           0x04
#define _lgClipRight            0x02
#define _lgClipLeft             0x01
#define _lgClipInside           0x00

void _lgLineClipper(int x1, int y1, int x2, int y2);
void _lgRectClipper(int x1, int y1, int x2, int y2);
int  _lgClipOutcode(int x , int y);

HPEN    _lgColorPen[16];
HBRUSH  _lgColorBrush[16];
COLORREF _lgColorIndex[16] = {
    RGB(0, 0, 0), RGB(0, 0, 128), RGB(0, 128, 0), RGB(0, 128, 128),
    RGB(128, 0, 0), RGB(128, 0, 128), RGB(128, 128, 0), RGB(192, 192, 192),
    RGB(128, 128, 128), RGB(0, 0, 255), RGB(0, 255, 0), RGB(0, 255, 255),
    RGB(255, 0, 0), RGB(255, 0, 255), RGB(255, 255, 0), RGB(255, 255, 255)};

#define createPenBrush(cell, color)     \
    _lgColorPen[cell] = CreatePen(PS_SOLID, 1, color); \
    _lgColorBrush[cell] = CreateSolidBrush(color);


BOOL    _lgOpenGraphics()
{
    for (int x = 0; x < 16; x++)
    {
        createPenBrush (x, _lgColorIndex[x]);
    }

    return (TRUE);
}

BOOL    _lgCloseGraphics()
{
    for (int x = 0; x < 16; x ++)
    {
        DeleteObject (_lgColorPen[x]);
        DeleteObject (_lgColorBrush[x]);
    }
    return (TRUE);
}

void    _lgRect     (int x1, int y1, int x2, int y2)
{
    if (!_winUsingDC) return;
    MoveToEx (_winDC, x1, y1, NULL);
    LineTo (_winDC, x2, y1);
    LineTo (_winDC, x2, y2);
    LineTo (_winDC, x1, y2);
    LineTo (_winDC, x1, y1);
}

void    _lgPoint    (int x, int y)
{
    if (!_winUsingDC) return;
//  if (x < _lgClipX1 || x > _lgClipX2 ||
//      y < _lgClipY1 || y > _lgClipY2) return;
    SetPixel (_winDC, x, y, _lgColorIndex[_lgColor]);
}

void    _lgLine     (int x1, int y1, int x2, int y2)
{
    if (!_winUsingDC) return;
//  _lgLineClipper (x1, y1, x2, y2);
//  MoveTo (_winDC, _lgRX1, _lgRY1);
//  LineTo (_winDC, _lgRX2, _lgRY2);
    MoveToEx (_winDC, x1, y1, NULL);
    LineTo (_winDC, x2, y2);
}

void    _lgSolidRect(int x1, int y1, int x2, int y2)
{
    if (!_winUsingDC) return;
//  _lgRectClipper (x1, y1, x2, y2);
//  Rectangle (_winDC, _lgRX1, _lgRY1, _lgRX2, _lgRY2);
    Rectangle (_winDC, x1, y1, x2 + 1, y2 + 1);
}

void _lgDrawText (int x, int y, char *text)
{
    if (!_winUsingDC) return;
    SelectObject (_winDC, GetStockObject (SYSTEM_FIXED_FONT));
    TextOut (_winDC, x, y, text, (int)strlen(text));
}

int     _lgGetScreenWidth()
{
    return (_winScrWidth);
}

int     _lgGetScreenHeight()
{
    return (_winScrHeight);
}

int     _lgGetColor ()
{
    return (_lgColor);
}

int     _lgGetBgColor ()
{
    return (_lgBgColor);
}

BOOL    _lgGetXOR ()
{
    return (_lgXOR);
}

BOOL _lgIsMouseActive()
{
    return (TRUE);
}

void    _lgSetColor (int c)
{
    _lgColor = c % 16;
    if (_winUsingDC)
    {
        SelectObject (_winDC, _lgColorPen[_lgColor]);
        SelectObject (_winDC, _lgColorBrush[_lgColor]);
        SetTextColor (_winDC, _lgColorIndex[_lgColor]);
    }
}

void    _lgSetBgColor (int c)
{
    _lgBgColor = c % 16;
    if (_winUsingDC) SetBkColor (_winDC, _lgColorIndex[_lgBgColor]);
}

void    _lgSetXOR (BOOL xor)
{
    if (!_winUsingDC) return;

    _lgXOR = xor;

    if (xor == TRUE)
    {
        SetROP2 (_winDC, R2_XORPEN);
    }
    else
    {
        SetROP2 (_winDC, R2_COPYPEN);
    }
}

void    _lgResetClipping()
{
//  _lgClipX1 = 0;
//  _lgClipY1 = 0;
//  _lgClipX2 = _winScrWidth - 1;
//  _lgClipY2 = _winScrHeight - 1;
    _lgSetClippingRect (0, 0, _winScrWidth - 1, _winScrHeight -1);
}

void    _lgSetClippingRect (int x1, int y1, int x2, int y2)
{
//  _lgClipX1 = x1;
//  _lgClipY1 = y1;
//  _lgClipX2 = x2;
//  _lgClipY2 = y2;
    if (!_winUsingDC) return;
    HRGN r= CreateRectRgn (x1, y1, x2 + 1, y2 + 1);
    SelectClipRgn (_winDC, r);
    DeleteObject (r);
}

BYTE _lgGetMouseButton ()
{
    BYTE btn = _winMouseButton;
    if (btn == LGM_BUTTONUP) _winMouseButton = 0;
    return (btn);
}

int  _lgGetMouseX ()
{
    return (_winMouseX);
}

int  _lgGetMouseY ()
{
    return (_winMouseY);
}

int _lgTextWidth  (char *text)
{
    SIZE ext;
    if (!_winUsingDC) return (0);
    SelectObject (_winDC, GetStockObject (SYSTEM_FIXED_FONT));
    GetTextExtentPoint (_winDC, text, (int)strlen(text), &ext);
    return ext.cx;
}

int _lgTextHeight (char *text)
{
    SIZE ext;
    if (!_winUsingDC) return (0);
    SelectObject (_winDC, GetStockObject (SYSTEM_FIXED_FONT));
    GetTextExtentPoint (_winDC, text, (int)strlen(text), &ext);
    return ext.cy;
}

void _lgHideMouse ()
{
    if (_lgMouseHide == TRUE) return;
    ShowCursor (FALSE);
    _lgMouseHide = TRUE;
}

void _lgShowMouse ()
{
    if (_lgMouseHide == FALSE) return;
    ShowCursor (TRUE);
    _lgMouseHide = FALSE;
}

BOOL _lgIsMouseHide (void)
{
    return (_lgMouseHide);
}

void _lgLineClipper(int x1, int y1, int x2, int y2)
{
    int  tmp;
    int  outcode1=_lgClipOutcode(x1, y1), outcode2=_lgClipOutcode(x2, y2);
    int  swap=0;
    long buf, dx, dy;

    _lgClipOut=1;

    while (_lgClipAccept(outcode1, outcode2))
    {
        if (_lgClipReject (outcode1, outcode2)) break;
        if (outcode1==_lgClipInside)
        {
            tmp=x2; x2=x1; x1=tmp;
            tmp=y2; y2=y1; y1=tmp;
            tmp=outcode2; outcode2=outcode1; outcode1=tmp;
            swap=1;
        }

        dx=x2-x1;
        dy=y2-y1;

        if (outcode1 & _lgClipTop)
        {
            if (dy) buf=dx*(long)(_lgClipY1-y1)/dy;
            x1+=buf;
            y1 =_lgClipY1;
        }
        else if (outcode1 & _lgClipBottom)
        {
            if (dy) buf=dx*(long)(_lgClipY2-y1)/dy;
            x1+=buf;
            y1 =_lgClipY2;
        }
        else if (outcode1 & _lgClipRight)
        {
            if (dx) buf=dy*(long)(_lgClipX2-x1)/dx;
            y1+=buf;
            x1 =_lgClipX2;
        }
        else if (outcode1 & _lgClipLeft)
        {
            if (dx) buf=dy*(long)(_lgClipX1-x1)/dx;
            y1+=buf;
            x1 =_lgClipX1;
        }
        outcode1=_lgClipOutcode(x1, y1);
    }

    if (!_lgClipAccept(outcode1, outcode2))
    {
        if (swap)
        {
            _lgRX1=x2;
            _lgRY1=y2;
            _lgRX2=x1;
            _lgRY2=y1;
        }
        else
        {
            _lgRX1=x1;
            _lgRY1=y1;
            _lgRX2=x2;
            _lgRY2=y2;
        }
        _lgClipOut=0;   /* still a drawable line */
    }
}

void _lgRectClipper(int x1, int y1, int x2, int y2)
{
    int tmp;
    int outcode1=_lgClipOutcode(x1, y1), outcode2=_lgClipOutcode(x2, y2);
    int x3, y3, x4, y4;

    _lgClipOut=1;
    while (_lgClipAccept(outcode1, outcode2))
    {
        if (_lgClipReject (outcode1, outcode2)) break;
        if (outcode1==_lgClipInside)
        {
            tmp=x2; x2=x1; x1=tmp;
            tmp=y2; y2=y1; y1=tmp;
            tmp=outcode2; outcode2=outcode1; outcode1=tmp;
        }

        if (outcode1 & _lgClipTop)
        {
            y1 =_lgClipY1;
        }
        else if (outcode1 & _lgClipBottom)
        {
            y1 =_lgClipY2;
        }
        else if (outcode1 & _lgClipRight)
        {
            x1 =_lgClipX2;
        }
        else if (outcode1 & _lgClipLeft)
        {
            x1 =_lgClipX1;
        }
        outcode1=_lgClipOutcode(x1, y1);
    }

    if (!_lgClipAccept(outcode1, outcode2))
    {
        x3=x1; x4=x2; y3=y1; y4=y2;
        if (x1>x2)
        {
            x3=x2;
            x4=x1;
        }
        if (y1>y2)
        {
            y3=y2;
            y4=y1;
        }

        _lgRX1=x3;
        _lgRY1=y3;
        _lgRX2=x4;
        _lgRY2=y4;
        _lgClipOut=0;
    }
}

/**********************************************************
 *
 *      1001 | 1000 | 1010
 *     ------+------+------
 *      0001 | 0000 | 0010      Cohen-Sutherland's outcode
 *     ------+------+------
 *      0101 | 0100 | 0110
 *
 *********************************************************/

int  _lgClipOutcode(int x , int y)
{
    int out;
    if (y<_lgClipY1) out=_lgClipTop;
    else if (y>_lgClipY2) out=_lgClipBottom;
    else out=_lgClipInside;

    if (x<_lgClipX1) out|=_lgClipLeft;
    else if (x>_lgClipX2) out|=_lgClipRight;

    return (out);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕乱码日本亚洲一区二区| 亚洲欧美自拍偷拍| 国产欧美日韩综合| 午夜久久久影院| 99久久综合99久久综合网站| 欧美成人video| 日本一区中文字幕| 欧美影院一区二区| 日韩毛片精品高清免费| 国产一区二区三区最好精华液| 欧美日韩精品一区视频| 亚洲男人天堂一区| 国产一区二区三区国产| 中文无字幕一区二区三区| 午夜精品福利久久久| 日韩一区二区电影在线| 日韩中文字幕不卡| 欧美人伦禁忌dvd放荡欲情| 免费看日韩a级影片| 欧美久久久久中文字幕| 午夜国产不卡在线观看视频| 欧美videos中文字幕| 国产91富婆露脸刺激对白| 久久久久国产精品麻豆ai换脸 | 麻豆专区一区二区三区四区五区| 色狠狠色狠狠综合| 亚洲欧美国产高清| 欧美二区乱c少妇| 国产a区久久久| 亚洲成人av在线电影| 欧美日韩一区二区三区四区| 亚洲丰满少妇videoshd| 欧美日韩一二三| 国产91精品一区二区| 三级一区在线视频先锋| 欧美经典一区二区| 欧美精品久久一区二区三区| 丁香另类激情小说| 国产精品传媒入口麻豆| 99精品久久只有精品| 亚洲制服丝袜av| 91精品一区二区三区久久久久久| 日韩精品91亚洲二区在线观看 | 成人av动漫网站| 1区2区3区精品视频| 欧美成人综合网站| 在线观看91精品国产入口| 五月天激情综合网| 日韩码欧中文字| 欧美经典一区二区| 欧美xxxxxxxx| 884aa四虎影成人精品一区| 成人精品国产一区二区4080| 久久精品99久久久| 久久久精品免费免费| 午夜精品久久久久久久 | 精品盗摄一区二区三区| 日韩av二区在线播放| **性色生活片久久毛片| 久久婷婷国产综合精品青草| 白白色 亚洲乱淫| 国内精品伊人久久久久av影院| 国产人妖乱国产精品人妖| 69久久99精品久久久久婷婷| 色婷婷综合久久久中文字幕| 日本在线观看不卡视频| 不卡电影免费在线播放一区| 国产毛片精品国产一区二区三区| 日本在线不卡一区| 日本三级亚洲精品| 亚洲成av人**亚洲成av**| 伊人婷婷欧美激情| 精品国产乱码久久久久久免费| 欧美顶级少妇做爰| 欧美一区二区三区在线视频| 99视频一区二区| 成人av电影在线播放| eeuss国产一区二区三区| 国产精品91xxx| 日韩国产精品大片| 蜜臀av性久久久久蜜臀aⅴ| 日韩精品亚洲一区二区三区免费| 无码av中文一区二区三区桃花岛| 亚洲一区二区三区在线| 亚洲bt欧美bt精品777| 亚洲成人tv网| 免费的成人av| 国产在线精品视频| 福利视频网站一区二区三区| 成人网在线播放| 色综合久久久久网| 欧美亚洲另类激情小说| 7878成人国产在线观看| 精品国产乱码久久久久久免费 | 欧美精品自拍偷拍动漫精品| 3d动漫精品啪啪一区二区竹菊| 欧美精品黑人性xxxx| 亚洲精品在线观看网站| 国产精品久久久久影院亚瑟| 亚洲精品中文在线观看| 丝袜美腿亚洲综合| 国产一区二区三区在线观看免费| 国产福利精品一区二区| 久久99在线观看| 国产99久久久久| 欧美网站一区二区| 精品免费视频.| 国产精品久久久久久久久快鸭| 亚洲精品国产第一综合99久久| 色伊人久久综合中文字幕| 欧美性极品少妇| 26uuu国产日韩综合| 日韩一区欧美一区| 日韩精品一级中文字幕精品视频免费观看| 久久精品国产精品亚洲红杏| 成人黄色在线看| 这里只有精品电影| 国产精品久久久久天堂| 日韩和欧美一区二区| 国产成人免费网站| 欧美精选午夜久久久乱码6080| 国产欧美视频在线观看| 天天影视涩香欲综合网| 成人av中文字幕| 欧美一区二区三区白人 | 亚洲精品网站在线观看| 日本aⅴ亚洲精品中文乱码| 成人福利在线看| 日韩欧美电影一区| 久久久久久久久久久久久夜| 一区二区三区四区乱视频| 亚洲成人激情av| k8久久久一区二区三区| 欧美精品一区二区三区在线 | 国产三级一区二区| 中文字幕在线不卡| 久久99久久久欧美国产| 欧洲视频一区二区| 最新日韩av在线| 欧美精品第1页| 有坂深雪av一区二区精品| 国产成人精品免费在线| 欧美成人精品福利| 五月婷婷综合激情| 在线观看日韩一区| 自拍偷拍欧美激情| 成人一区二区在线观看| 精品国产不卡一区二区三区| 婷婷综合另类小说色区| 欧美亚洲另类激情小说| 亚洲欧美激情小说另类| 国产成人精品1024| 精品999在线播放| 久久草av在线| 欧美电影免费观看高清完整版在| 午夜精品久久久| 精品污污网站免费看| 一区二区欧美国产| 在线亚洲人成电影网站色www| 中文字幕制服丝袜一区二区三区| 国产成人精品一区二区三区网站观看| 久久综合九色综合97_久久久| 麻豆国产精品视频| 精品国产一区二区精华| 国产制服丝袜一区| 精品国产一区二区三区av性色 | 日本一区二区三区dvd视频在线| 日本不卡高清视频| 91精品国产免费| 蜜桃精品视频在线| 欧美成人在线直播| 国产美女视频91| 国产精品美女久久久久高潮| 成人av网址在线观看| 中文字幕在线观看不卡| 91免费观看国产| 精品剧情在线观看| 国产一区二区三区美女| 国产欧美精品国产国产专区| 成人精品小蝌蚪| 樱桃视频在线观看一区| 欧美日韩激情在线| 玖玖九九国产精品| 国产午夜精品在线观看| jiyouzz国产精品久久| 一区二区三区四区不卡在线| 欧美三级在线播放| 久久99国内精品| 欧美精品久久一区| 国产一区二区三区免费播放| 欧美国产成人在线| 欧美视频一区二区在线观看| 日韩精品电影在线| 欧美高清在线视频| 日本高清不卡视频| 男女激情视频一区| 国产精品久久久久三级| 欧美日韩成人综合| 国产电影精品久久禁18| 一区二区三区免费网站|