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

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

?? lowgdiw.cpp

?? 做為linux下圖形用戶界面支持系統之一的MicroWindows采用C++設計
?? CPP
字號:
/*****************************************************************************
 *
 * Lowgdi.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;
    MoveTo (_winDC, x1, y1);
    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, _lgColorPen[_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);
    MoveTo (_winDC, x1, y1);
    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, 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)
{
    if (!_winUsingDC) return (0);
    SelectObject (_winDC, GetStockObject (SYSTEM_FIXED_FONT));
    DWORD ext = GetTextExtent (_winDC, text, strlen(text));
    return (LOWORD(ext));
}

int _lgTextHeight (char *text)
{
    if (!_winUsingDC) return (0);
    SelectObject (_winDC, GetStockObject (SYSTEM_FIXED_FONT));
    DWORD ext = GetTextExtent (_winDC, text, strlen(text));
    return (HIWORD(ext));
}

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  x3, y3, x4, y4, 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热| 日本欧美在线观看| 日本不卡在线视频| 成人爽a毛片一区二区免费| 在线中文字幕一区| 国产欧美一区二区三区在线老狼| 午夜精品久久久久久久蜜桃app| 国产精品18久久久久久久久| 欧美日本免费一区二区三区| 国产精品久久久久久久久久久免费看| 蜜桃av噜噜一区二区三区小说| 色综合久久久网| 国产精品视频线看| 国产主播一区二区| 欧美一区二区视频免费观看| 亚洲午夜日本在线观看| 高潮精品一区videoshd| 日韩欧美一级片| 日韩二区三区在线观看| 欧美视频在线观看一区二区| 亚洲欧美中日韩| 99久久精品一区二区| 国产精品青草久久| 国产精品69毛片高清亚洲| 26uuu国产日韩综合| 韩国三级中文字幕hd久久精品| 欧美美女一区二区| 亚洲成人免费av| 欧美日韩一卡二卡三卡| 亚洲国产精品一区二区尤物区| 91一区二区三区在线观看| 国产精品理伦片| a级高清视频欧美日韩| 国产精品视频第一区| 成人黄色软件下载| 国产精品久久久久久亚洲伦| 从欧美一区二区三区| 国产精品久久久一本精品| 成人avav在线| 亚洲制服丝袜在线| 欧美高清视频不卡网| 久久99久久精品| 国产欧美一区二区精品婷婷| 成人国产亚洲欧美成人综合网| 中文字幕巨乱亚洲| 日本乱码高清不卡字幕| 亚洲第一二三四区| 欧美电影免费观看高清完整版在线| 九九国产精品视频| 欧美国产1区2区| 日本高清不卡视频| 日本中文字幕不卡| 久久精品一区二区| 色中色一区二区| 欧美bbbbb| 中文字幕色av一区二区三区| 欧美亚一区二区| 久久99九九99精品| 综合久久给合久久狠狠狠97色| 欧美日韩综合在线免费观看| 久久91精品国产91久久小草| 中文字幕人成不卡一区| 欧美系列亚洲系列| 国产麻豆91精品| 一区二区三区中文字幕精品精品| 555www色欧美视频| jizz一区二区| 人禽交欧美网站| 国产精品国产成人国产三级 | 久久66热re国产| 欧美国产一区二区| 欧美美女网站色| 成人午夜av在线| 蜜臀av性久久久久av蜜臀妖精| 国产精品丝袜一区| 欧美不卡视频一区| 在线观看一区二区精品视频| 韩国成人福利片在线播放| 亚洲一区二区欧美| 国产精品天美传媒沈樵| 欧美一区二区三区日韩| 91亚洲精品久久久蜜桃网站| 狠狠色丁香久久婷婷综合_中| 亚洲精品自拍动漫在线| 亚洲精品一区二区三区在线观看| 色噜噜偷拍精品综合在线| 精品一区中文字幕| 日韩成人午夜电影| 一区二区三区波多野结衣在线观看 | 亚洲韩国精品一区| 亚洲国产精品黑人久久久| 日韩一级大片在线观看| 91麻豆精品在线观看| 国产在线观看免费一区| 石原莉奈在线亚洲三区| 亚洲综合色区另类av| 亚洲图片你懂的| 国产亚洲va综合人人澡精品| 欧美一区二区三区视频在线观看| 日本大香伊一区二区三区| 99在线精品一区二区三区| 国产成人在线视频网址| 国产综合久久久久久久久久久久| 日本va欧美va精品| 日本欧美一区二区在线观看| 亚洲影院在线观看| 一区二区成人在线| 亚洲欧美经典视频| 亚洲色图色小说| 亚洲欧美乱综合| 亚洲女人****多毛耸耸8| 国产精品午夜春色av| 国产精品久久久久毛片软件| 国产精品无人区| 国产精品超碰97尤物18| 亚洲色图丝袜美腿| 一级特黄大欧美久久久| 亚洲一级二级在线| 日日夜夜免费精品| 久久机这里只有精品| 免费观看91视频大全| 久久国产夜色精品鲁鲁99| 精品制服美女久久| 国产成人av电影在线| www.99精品| 欧美性猛交xxxx黑人交| 91片在线免费观看| av电影天堂一区二区在线| 婷婷开心久久网| 亚洲日本欧美天堂| 奇米精品一区二区三区在线观看一| 久久久亚洲高清| 国产午夜久久久久| 日韩理论电影院| 亚洲午夜激情网站| 婷婷开心激情综合| 精品一区二区三区香蕉蜜桃| 国精产品一区一区三区mba视频 | 欧美一区二区女人| 欧美精品一区二区三区四区| 欧美激情中文字幕| 亚洲综合在线观看视频| 日韩国产精品久久久久久亚洲| 久久99国产精品麻豆| jizzjizzjizz欧美| 91麻豆精品国产91久久久资源速度| 欧美岛国在线观看| 国产精品免费久久久久| 亚洲日本中文字幕区| 91丨porny丨中文| 国产一区二区美女| 色婷婷精品久久二区二区蜜臀av | 九一久久久久久| 成人亚洲精品久久久久软件| 在线欧美一区二区| 2024国产精品| 亚洲一线二线三线视频| 国产揄拍国内精品对白| 日本乱人伦aⅴ精品| 精品久久一二三区| 亚洲精品少妇30p| 国产精品自产自拍| 欧美日韩一级大片网址| 国产欧美日韩三级| 天天综合色天天综合| av不卡在线播放| 欧美www视频| 亚洲午夜一二三区视频| 丁香亚洲综合激情啪啪综合| 欧美日韩国产一级二级| 日韩理论片网站| 国产99精品国产| 欧美肥妇毛茸茸| 一区二区三区在线免费播放| 国产精品一级片| 天天亚洲美女在线视频| 欧美男男青年gay1069videost| 亚洲精品一区在线观看| 亚洲最大的成人av| 91色视频在线| 欧洲精品视频在线观看| 中文字幕高清不卡| 久久99蜜桃精品| 欧美一区三区四区| 亚洲h动漫在线| 91久久免费观看| 国产精品久久久久aaaa| 国产成人av一区二区| 日韩精品在线一区| 日韩二区三区在线观看| 欧美日本视频在线| 亚洲最新视频在线观看| 色偷偷久久一区二区三区| 国产精品久久久久久久久免费樱桃 | 亚洲丝袜美腿综合| 高清在线成人网| 欧美高清在线一区| 不卡一区中文字幕| 久久久夜色精品亚洲| 国产日韩成人精品|