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

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

?? region.c

?? miniucgui1.30版本的源碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*** $Id: region.c,v 1.17 2003/09/04 06:02:53 weiym Exp $**** region.c: Device-independent multi-rectangle clipping routines.** ** Copyright (C) 2003 Feynman Software** Copyright (C) 2001 ~ 2002 Wei Yongming.**** GDI region objects. Shamelessly ripped out from the X11 distribution** Thanks for the nice licence.**** Copyright 1993, 1994, 1995 Alexandre Julliard** Modifications and additions: Copyright 1998 Huw Davies**** Current maintainer: Wei Yongming.**** Create date: 2001/10/17**** Derived from old file: ../kernel/cliprect.c*//*** 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*//************************************************************************Copyright (c) 1987, 1988  X ConsortiumPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THEX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER INAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR INCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.Except as contained in this notice, the name of the X Consortium shall not beused in advertising or otherwise to promote the sale, use or other dealingsin this Software without prior written authorization from the X Consortium.Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.                        All Rights ReservedPermission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and thatboth that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not beused in advertising or publicity pertaining to distribution of thesoftware without specific, written prior permission.  DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THISSOFTWARE.************************************************************************//* * The functions in this file implement the Region abstraction, similar to one * used in the X11 sample server. A Region is simply an area, as the name * implies, and is implemented as a "y-x-banded" array of rectangles. To * explain: Each Region is made up of a certain number of rectangles sorted * by y coordinate first, and then by x coordinate. * * Furthermore, the rectangles are banded such that every rectangle with a * given upper-left y coordinate (y1) will have the same lower-right y * coordinate (y2) and vice versa. If a rectangle has scanlines in a band, it * will span the entire vertical distance of the band. This means that some * areas that could be merged into a taller rectangle will be represented as * several shorter rectangles to account for shorter rectangles to its left * or right but within its "vertical scope". * * An added constraint on the rectangles is that they must cover as much * horizontal area as possible. E.g. no two rectangles in a band are allowed * to touch. * * Whenever possible, bands will be merged together to cover a greater vertical * distance (and thus reduce the number of rectangles). Two bands can be merged * only if the bottom of one touches the top of the other and they have * rectangles in the same places (of the same width, of course). This maintains * the y-x-banding that's so nice to have... *//* * Modify records: * *  Who             When        Where       For What                Status *----------------------------------------------------------------------------- * * TODO: */#include <stdio.h>#include <stdlib.h>#include <errno.h>#include "common.h"#include "gdi.h"#include "cliprect.h"#include "gal.h"#include "blockheap.h"typedef void (*voidProcp1)(CLIPRGN *region, const CLIPRECT *r1, const CLIPRECT *r1End,                          const CLIPRECT *r2, const CLIPRECT *r2End, int top, int bottom);typedef void (*voidProcp2)(CLIPRGN *region, const CLIPRECT *r, const CLIPRECT *rEnd,                          int top, int bottom);/*  1 if two RECTs overlap. *  0 if two RECTs do not overlap. */#define EXTENTCHECK(r1, r2) \        ((r1)->right > (r2)->left && \         (r1)->left < (r2)->right && \         (r1)->bottom > (r2)->top && \         (r1)->top < (r2)->bottom)/* * Allocate a new clipping rect and add it to the region. */#define NEWCLIPRECT(region, rect) \       {\            rect = ClipRectAlloc(region->heap);\            rect->next = NULL;\            rect->prev = region->tail;\            if (region->tail)\                region->tail->next = rect;\            region->tail = rect;\            if (region->head == NULL)\                region->head = rect;\       }#define REGION_NOT_EMPTY(region) region->head#define INRECT(r, x, y) \      ( ( ((r).right >  x)) && \        ( ((r).left <= x)) && \        ( ((r).bottom >  y)) && \        ( ((r).top <= y)) )/* return TRUE if point is in region*/BOOL GUIAPI PtInRegion (PCLIPRGN region, int x, int y){    int top;    PCLIPRECT cliprect = region->head;    /* check with bounding rect of clipping region */    if (y >= region->tail->rc.bottom || y < region->head->rc.top)        return FALSE;    /* find the ban in which this point lies */    cliprect = region->head;    while (cliprect && y >= cliprect->rc.bottom) {        cliprect = cliprect->next;    }    if (!cliprect) return FALSE;    /* check in this ban */    top = cliprect->rc.top;    while (cliprect && cliprect->rc.top == top) {        if (INRECT (cliprect->rc, x, y))            return TRUE;        cliprect = cliprect->next;    }    return FALSE;}/* Returns TRUE if rect is at least partly inside region */BOOL GUIAPI RectInRegion (PCLIPRGN region, const RECT* rect){    PCLIPRECT cliprect = region->head;    BOOL ret = FALSE;    if (cliprect && EXTENTCHECK (&region->rcBound, rect)) {        while (cliprect) {            if (cliprect->rc.bottom <= rect->top) {                cliprect = cliprect->next;                continue;             /* not far enough down yet */            }            if (cliprect->rc.top >= rect->bottom) {                ret = FALSE;          /* too far down */                break;            }            if (cliprect->rc.right <= rect->left) {                cliprect = cliprect->next;                continue;              /* not far enough over yet */            }            if (cliprect->rc.left >= rect->right) {                cliprect = cliprect->next;                continue;            }            ret = TRUE;            break;        }    }    return ret;}/* Init a region */void GUIAPI InitClipRgn (PCLIPRGN pRgn, PBLOCKHEAP heap){     pRgn->type = NULLREGION;     SetRectEmpty (&pRgn->rcBound);     pRgn->head = NULL;     pRgn->tail = NULL;     pRgn->heap = heap;   // read-only field.}/* return bound rect of a region */void GUIAPI GetClipRgnBoundRect (PCLIPRGN pRgn, PRECT pRect){     *pRect = pRgn->rcBound;}BOOL GUIAPI IsEmptyClipRgn (const CLIPRGN* pRgn){     if (pRgn->head == NULL)         return TRUE;     return FALSE;}void GUIAPI EmptyClipRgn (PCLIPRGN pRgn){    PCLIPRECT pCRect, pTemp;    pCRect = pRgn->head;    while (pCRect) {        pTemp = pCRect->next;        FreeClipRect (pRgn->heap, pCRect);        pCRect = pTemp;    }    pRgn->type = NULLREGION;    SetRectEmpty (&pRgn->rcBound);    pRgn->head = NULL;    pRgn->tail = NULL;}/* Reset a region */BOOL GUIAPI SetClipRgn (PCLIPRGN pRgn, const RECT* pRect){    PCLIPRECT pClipRect;    if (IsRectEmpty (pRect))        return FALSE;    // empty rgn first    EmptyClipRgn (pRgn);    // get a new clip rect from free list    pClipRect = ClipRectAlloc (pRgn->heap);    if (pClipRect == NULL)        return FALSE;    // set clip rect    pClipRect->rc = *pRect;    pClipRect->next = NULL;    pClipRect->prev = NULL;    pRgn->type = SIMPLEREGION;    pRgn->head = pRgn->tail = pClipRect;    pRgn->rcBound = *pRect;    return TRUE;} BOOL GUIAPI ClipRgnCopy (PCLIPRGN pDstRgn, const CLIPRGN* pSrcRgn){    PCLIPRECT pcr;    PCLIPRECT pnewcr, prev;    // return false if the destination region is not an empty one.    if (pDstRgn == pSrcRgn)        return FALSE;    EmptyClipRgn (pDstRgn);    if (!(pcr = pSrcRgn->head))        return TRUE;    pnewcr = ClipRectAlloc (pDstRgn->heap);    pDstRgn->head = pnewcr;    pnewcr->rc = pcr->rc;    prev = NULL;    while (pcr->next) {        pnewcr->next = ClipRectAlloc (pDstRgn->heap);        pnewcr->prev = prev;        prev = pnewcr;        pcr = pcr->next;        pnewcr = pnewcr->next;        pnewcr->rc = pcr->rc;    }    pnewcr->prev = prev;    pnewcr->next = NULL;    pDstRgn->tail = pnewcr;    pDstRgn->type = pSrcRgn->type;    pDstRgn->rcBound = pSrcRgn->rcBound;     return TRUE;}/* Re-calculate the rcBound of a region */static void REGION_SetExtents (CLIPRGN *region){    PCLIPRECT cliprect;    RECT *pExtents;    if (region->head == NULL) {        region->rcBound.left = 0; region->rcBound.top = 0;        region->rcBound.right = 0; region->rcBound.bottom = 0;        return;    }    pExtents = &region->rcBound;    /*     * Since head is the first rectangle in the region, it must have the     * smallest top and since tail is the last rectangle in the region,     * it must have the largest bottom, because of banding. Initialize left and     * right from head and tail, resp., as good things to initialize them     * to...     */    pExtents->left = region->head->rc.left;    pExtents->top = region->head->rc.top;    pExtents->right = region->tail->rc.right;    pExtents->bottom = region->tail->rc.bottom;    cliprect = region->head;    while (cliprect) {        if (cliprect->rc.left < pExtents->left)            pExtents->left = cliprect->rc.left;        if (cliprect->rc.right > pExtents->right)            pExtents->right = cliprect->rc.right;        cliprect = cliprect->next;    }}#ifdef _REGION_DEBUGvoid dumpRegion (CLIPRGN* region){    CLIPRECT *cliprect;    if (!(cliprect = region->head)) {        fprintf (stderr, "region: %p is a null region.\n", region);    }    else {        fprintf (stderr, "start of region: %p.\n", region);        fprintf (stderr, "head of region: %p.\n", region->head);        fprintf (stderr, "tail of region: %p.\n", region->tail);        fprintf (stderr, "Bound of region: (%d, %d, %d, %d)\n",                         region->rcBound.left,                        region->rcBound.top,                        region->rcBound.right,                        region->rcBound.bottom);        while (cliprect) {            fprintf (stderr, "cliprect %p: (%d, %d, %d, %d)\n", cliprect,                             cliprect->rc.left, cliprect->rc.top,                            cliprect->rc.right,                            cliprect->rc.bottom);            cliprect = cliprect->next;        }        fprintf (stderr, "end of region: %p.\n", region);    }}#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆视频观看网址久久| 国产人妖乱国产精品人妖| 欧美一三区三区四区免费在线看| 欧美电影在哪看比较好| 精品国产91洋老外米糕| 国产精品女主播av| 亚洲第四色夜色| 久久99国内精品| 91亚洲精品久久久蜜桃| 欧美久久久影院| 国产婷婷精品av在线| 一个色综合网站| 久久国产夜色精品鲁鲁99| 95精品视频在线| 777午夜精品视频在线播放| 国产天堂亚洲国产碰碰| 偷拍与自拍一区| 成人性视频免费网站| 欧美色老头old∨ideo| 久久日韩粉嫩一区二区三区| 久久久无码精品亚洲日韩按摩| 亚洲精品亚洲人成人网| 久久国产精品99精品国产| 成人aa视频在线观看| 69精品人人人人| 国产精品短视频| 美女免费视频一区二区| 色综合久久综合网欧美综合网| 精品美女被调教视频大全网站| 亚洲欧美一区二区在线观看| 老司机免费视频一区二区三区| 一本到三区不卡视频| 国产午夜精品在线观看| 日韩成人免费看| 91免费看`日韩一区二区| 亚洲精品在线电影| 午夜精品久久久久久| av午夜一区麻豆| 亚洲精品一区二区三区福利| 亚洲午夜免费福利视频| 不卡区在线中文字幕| 久久一二三国产| 日韩高清国产一区在线| 日韩精品一区二区三区视频播放 | 香蕉乱码成人久久天堂爱免费| 国产精品一区二区你懂的| 在线不卡欧美精品一区二区三区| 亚洲私人黄色宅男| 国产精品18久久久久久久久久久久| 欧美巨大另类极品videosbest | 色一情一乱一乱一91av| 欧美韩日一区二区三区| 久久99久久99| 日韩一区二区视频| 亚欧色一区w666天堂| 91啪在线观看| 国产精品福利一区| 国产suv精品一区二区883| 久久伊99综合婷婷久久伊| 久久精品二区亚洲w码| 欧美无人高清视频在线观看| 1000部国产精品成人观看| 成人黄色一级视频| 国产欧美一区在线| 国产成人精品免费| 久久亚洲私人国产精品va媚药| 美女网站一区二区| 91精品国产美女浴室洗澡无遮挡| 亚洲二区视频在线| 欧美日韩午夜在线| 亚洲曰韩产成在线| 欧美无人高清视频在线观看| 亚洲综合在线免费观看| 色婷婷av一区二区三区之一色屋| 国产精品成人免费| av在线免费不卡| 中文字幕亚洲欧美在线不卡| caoporen国产精品视频| 国产精品久久久99| 91香蕉视频mp4| 亚洲精品自拍动漫在线| 色婷婷久久久综合中文字幕 | 精品视频123区在线观看| 亚洲综合久久av| 欧美三级一区二区| 天天综合天天做天天综合| 91精品国产aⅴ一区二区| 日本vs亚洲vs韩国一区三区| 精品国产伦一区二区三区免费| 韩国三级在线一区| 久久精品人人做人人爽97| 国产999精品久久久久久绿帽| 国产精品美日韩| 欧美专区日韩专区| 日本vs亚洲vs韩国一区三区二区| 精品国产三级a在线观看| 国产激情视频一区二区在线观看 | 成人午夜av在线| 亚洲欧美一区二区不卡| 精品视频资源站| 麻豆传媒一区二区三区| 久久久久久久久久美女| 成人高清免费在线播放| 亚洲精品久久7777| 欧美一区2区视频在线观看| 国内精品第一页| 国产精品伦理一区二区| 精品视频全国免费看| 国产在线精品一区在线观看麻豆| 国产精品你懂的在线| 欧美色图天堂网| 久久精品噜噜噜成人av农村| 国产欧美一区二区精品性| 一本久久精品一区二区| 日韩在线一区二区三区| 久久久影视传媒| 日本道色综合久久| 精品一区二区三区的国产在线播放| 国产日产欧美一区| 欧美日韩久久久久久| 国内不卡的二区三区中文字幕| 国产免费观看久久| 555www色欧美视频| 不卡的电视剧免费网站有什么| 香蕉加勒比综合久久| 欧美国产日韩精品免费观看| 欧美天堂一区二区三区| 国产精品亚洲一区二区三区妖精| 亚洲精品大片www| 久久免费看少妇高潮| 欧美视频中文一区二区三区在线观看| 国产一区二区视频在线播放| 亚洲综合色噜噜狠狠| 国产精品网友自拍| 日韩三级伦理片妻子的秘密按摩| 色婷婷综合激情| 国产精品自拍av| 日韩精品免费专区| 亚洲视频精选在线| 26uuu精品一区二区| 欧美亚洲综合色| 成人福利在线看| 九一九一国产精品| 香蕉成人啪国产精品视频综合网| 国产精品理论在线观看| 欧美不卡视频一区| 欧美男女性生活在线直播观看| 成人高清免费在线播放| 六月丁香婷婷色狠狠久久| 亚洲精品一二三| 欧美三级日韩在线| 99精品在线免费| 久88久久88久久久| 伊人婷婷欧美激情| 久久久欧美精品sm网站| 欧美图片一区二区三区| 成人a免费在线看| 国产麻豆精品在线观看| 亚洲mv在线观看| 亚洲欧洲av另类| 2023国产精品| 精品国产成人在线影院| 欧美群妇大交群中文字幕| 99精品1区2区| 免费看日韩精品| 日韩不卡一区二区| 亚洲精品亚洲人成人网| 亚洲国产精品成人久久综合一区| 日韩一区二区三区av| 欧美在线一二三四区| 本田岬高潮一区二区三区| 久久99最新地址| 加勒比av一区二区| 日韩精品乱码免费| 一区二区高清免费观看影视大全 | 久久久久久毛片| 精品理论电影在线观看| 欧美女孩性生活视频| 在线观看日韩精品| 91亚洲精品久久久蜜桃网站| 91视频精品在这里| 风间由美中文字幕在线看视频国产欧美| 奇米精品一区二区三区在线观看| 亚洲啪啪综合av一区二区三区| 自拍偷自拍亚洲精品播放| 国产欧美日韩精品在线| 精品国产123| 欧美日本不卡视频| 欧美一级欧美三级| 91精品国产综合久久精品app| 欧美日韩亚洲丝袜制服| 91精品国产全国免费观看| 91麻豆精品国产91久久久久久久久| 色爱区综合激月婷婷| 91麻豆swag| 欧美色视频在线| 欧美剧情片在线观看| 欧美一三区三区四区免费在线看 | 亚洲欧洲精品一区二区三区不卡| 国产欧美日韩视频一区二区|