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

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

?? cursor-lite.c

?? 這是針對 Linux (i386)平臺的 minigui 3.6.2 開發包(MiniGUI-Processes 運行模式)。
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*** $Id: cursor-lite.c,v 1.51 2004/04/16 08:39:36 weiym Exp $**** cursor-lite.c: Cursor support module for MiniGUI-Lite**                Cursor managed by server globally.**** Copyright (C) 2003 Feynman Software.** Copyright (C) 1999 ~ 2002 Wei Yongming.**** Current maintainer: Wei Yongming.**** Create date: 1999/01/06*//*** 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*/#include <stdio.h>#include <stddef.h>#include <stdlib.h>#include <malloc.h>#include <string.h>#include <errno.h>#include "common.h"#include "minigui.h"#include "gdi.h"#include "window.h"#include "cliprect.h"#include "internals.h"#include "ctrlclass.h"#include "inline.h"#include "memops.h"#include "gal.h"#include "dc.h"#include "cursor.h"#include "ial.h"#include "sharedres.h"#include "ourhdr.h"#include "client.h"#include "server.h"#include "drawsemop.h"#include "readbmp.h"int __mg_csrimgsize;int __mg_csrimgpitch;static int oldx = -1, oldy;static RECT cliprc = {0, 0, 0, 0};#ifdef _CURSOR_SUPPORT#define CSR_SAVEDBITS   ((BYTE*)mgSharedRes + (((PG_RES)mgSharedRes)->svdbitsoffset))#define CSR_CURSORX     (((PG_RES)mgSharedRes)->cursorx)#define CSR_CURSORY     (((PG_RES)mgSharedRes)->cursory)#define CSR_OLDBOXLEFT  (((PG_RES)mgSharedRes)->oldboxleft)#define CSR_OLDBOXTOP   (((PG_RES)mgSharedRes)->oldboxtop)#define CSR_CURRENT     ((PCURSOR)((PG_RES)mgSharedRes)->csr_current)#define CSR_XHOTSPOT    (((PG_RES)mgSharedRes)->xhotspot)#define CSR_YHOTSPOT    (((PG_RES)mgSharedRes)->yhotspot)#define CSR_SHOW_COUNT  (((PG_RES)mgSharedRes)->csr_show_count)static PCURSOR *sys_cursors;static HCURSOR def_cursor;static BYTE* cursorbits = NULL;#if 0 /* FIXME: I do not know why this can not work :( */Uint8* GetPixelUnderCursor (int x, int y, gal_pixel* pixel){    Uint8* dst = NULL;        lock_cursor_sem ();    if (CSR_SHOW_COUNT >= 0 && CSR_CURRENT            && x >= CSR_OLDBOXLEFT && y >= CSR_OLDBOXTOP            && (x < CSR_OLDBOXLEFT + CURSORWIDTH)            && (y < CSR_OLDBOXTOP + CURSORHEIGHT)            && get_hidecursor_sem_val () == 0) {        int _x = x - CSR_OLDBOXLEFT;        int _y = y - CSR_OLDBOXTOP;        dst = CSR_SAVEDBITS + _y * __mg_csrimgpitch                + _x * __gal_screen->format->BytesPerPixel;        *pixel = _mem_get_pixel (dst, __gal_screen->format->BytesPerPixel);    }    unlock_cursor_sem ();    return dst;}#endif// Cursor creating and destroying.static HCURSOR srvCreateCursor (int xhotspot, int yhotspot, int w, int h,                     const BYTE* pANDBits, const BYTE* pXORBits, int colornum){    PCURSOR pcsr;        if (w != CURSORWIDTH || h != CURSORHEIGHT) return 0;    if (!(pcsr = (PCURSOR)malloc (sizeof (CURSOR)))) return 0;    if (!(pcsr->AndBits = malloc (__mg_csrimgsize))) {        free(pcsr);        return 0;    }    if (!(pcsr->XorBits = malloc (__mg_csrimgsize))) {        free (pcsr->AndBits);        free (pcsr);        return 0;    }    pcsr->xhotspot = xhotspot;    pcsr->yhotspot = yhotspot;    pcsr->width = w;    pcsr->height = h;#ifdef _USE_NEWGAL    if (colornum == 1) {        ExpandMonoBitmap (HDC_SCREEN, pcsr->AndBits, __mg_csrimgpitch, pANDBits, MONOPITCH,                        w, h, MYBMP_FLOW_UP, 0, 0xFFFFFFFF);        ExpandMonoBitmap (HDC_SCREEN, pcsr->XorBits, __mg_csrimgpitch, pXORBits, MONOPITCH,                        w, h, MYBMP_FLOW_UP, 0, 0xFFFFFFFF);    }    else if (colornum == 4) {        ExpandMonoBitmap (HDC_SCREEN, pcsr->AndBits, __mg_csrimgpitch, pANDBits, MONOPITCH,                        w, h, MYBMP_FLOW_UP, 0, 0xFFFFFFFF);        Expand16CBitmap (HDC_SCREEN, pcsr->XorBits, __mg_csrimgpitch, pXORBits, MONOPITCH*4,                        w, h, MYBMP_FLOW_UP, NULL);    }#else    if (colornum == 1) {        ExpandMonoBitmap (HDC_SCREEN, w, h, pANDBits, MONOPITCH, MYBMP_FLOW_UP,                         pcsr->AndBits, __mg_csrimgpitch, 0, 0xFFFFFFFF);        ExpandMonoBitmap (HDC_SCREEN, w, h, pXORBits, MONOPITCH, MYBMP_FLOW_UP,                         pcsr->XorBits, __mg_csrimgpitch, 0, 0xFFFFFFFF);    }    else if (colornum == 4) {        ExpandMonoBitmap (HDC_SCREEN, w, h, pANDBits, MONOPITCH, MYBMP_FLOW_UP,                         pcsr->AndBits, __mg_csrimgpitch, 0, 0xFFFFFFFF);        Expand16CBitmap (HDC_SCREEN, w, h, pXORBits, MONOPITCH*4, MYBMP_FLOW_UP,                        pcsr->XorBits, __mg_csrimgpitch, NULL);    }#endif /* _USE_NEWGAL */    return (HCURSOR)pcsr;}#define _LEN_BITS   (MONOPITCH * CURSORHEIGHT)HCURSOR GUIAPI CreateCursor (int xhotspot, int yhotspot, int w, int h,                     const BYTE* pANDBits, const BYTE* pXORBits, int colornum){    if (mgIsServer) {        return srvCreateCursor (xhotspot, yhotspot, w, h,                         pANDBits, pXORBits, colornum);    }    else {        HCURSOR hcursor;        REQUEST req;        int len_and_bits, len_xor_bits;        int* tmp;        if (w != CURSORWIDTH || h != CURSORHEIGHT)            return 0;        len_and_bits = _LEN_BITS;        len_xor_bits = _LEN_BITS * ((colornum == 1) ? 1 : 4);        req.id = REQID_CREATECURSOR;        req.len_data = sizeof (int) * 6 + len_and_bits + len_xor_bits;        if ((tmp = (int*) ALLOCATE_LOCAL (req.len_data)) == NULL)                return 0;        tmp [0] = xhotspot; tmp [1] = yhotspot;        tmp [2] = w;        tmp [3] = h;        tmp [4] = colornum;        tmp [5] = _LEN_BITS;        memcpy (tmp + 6, pANDBits, len_and_bits);        memcpy ((BYTE*)(tmp + 6) + len_and_bits, pXORBits, len_xor_bits);        req.data = tmp;        if (cli_request (&req, &hcursor, sizeof (HCURSOR)) < 0)            hcursor = 0;        DEALLOCATE_LOCAL (tmp);        return hcursor;    }}static HCURSOR srvLoadCursorFromFile (const char* filename){    FILE* fp;    WORD wTemp;    int ret = 0;    int  w, h, xhot, yhot, colornum;    DWORD size, offset;    DWORD imagesize, imagew, imageh;    BYTE* image;        if( !(fp = fopen(filename, "rb")) ) return 0;    fseek(fp, sizeof(WORD), SEEK_SET);    // the cbType of struct CURSORDIR.    wTemp = MGUI_ReadLE16FP (fp);    if(wTemp != 2) goto error;    // skip the cdCount of struct CURSORDIR, we always use the first cursor.    fseek(fp, sizeof(WORD), SEEK_CUR);        // cursor info, read the members of struct CURSORDIRENTRY.    w = fgetc (fp);  // the width of first cursor.    h = fgetc (fp);  // the height of first cursor.    if (w != CURSORWIDTH || h != CURSORHEIGHT) goto error;    fseek(fp, sizeof(BYTE)*2, SEEK_CUR); // skip the bColorCount and bReserved.    wTemp = MGUI_ReadLE16FP (fp);    xhot = wTemp;    wTemp = MGUI_ReadLE16FP (fp);    yhot = wTemp;    size = MGUI_ReadLE32FP (fp);    offset = MGUI_ReadLE32FP (fp);    // read the cursor image info.    fseek(fp, offset, SEEK_SET);    fseek(fp, sizeof(DWORD), SEEK_CUR); // skip the biSize member.    imagew = MGUI_ReadLE32FP (fp);    imageh = MGUI_ReadLE32FP (fp);    // check the biPlanes member;    wTemp = MGUI_ReadLE16FP (fp);    if(wTemp != 1) goto error;    // check the biBitCount member;    wTemp = MGUI_ReadLE16FP (fp);    if(wTemp > 4) goto error;    colornum = (int)wTemp;    fseek(fp, sizeof(DWORD), SEEK_CUR); // skip the biCompression members.    imagesize = MGUI_ReadLE32FP (fp);    // skip the rest members and the color table.    fseek(fp, sizeof(DWORD)*4 + sizeof(BYTE)*(4<<colornum), SEEK_CUR);        // allocate memory for image.    if ((image = (BYTE*)ALLOCATE_LOCAL (imagesize)) == NULL)        goto error;    // read image    fread (image, imagesize, 1, fp);        ret = srvCreateCursor (xhot, yhot, w, h,                         image + (imagesize - MONOSIZE), image, colornum);    DEALLOCATE_LOCAL (image);error:    fclose (fp);    return ret;}HCURSOR GUIAPI LoadCursorFromFile (const char* filename){    if (mgIsServer) {        return srvLoadCursorFromFile (filename);    }    else {        HCURSOR hcursor;        REQUEST req;        req.id = REQID_LOADCURSOR;        req.data = filename;        req.len_data = strlen (filename) + 1;        if (cli_request (&req, &hcursor, sizeof (HCURSOR)) < 0)            return 0;        return hcursor;    }}HCURSOR GUIAPI LoadCursorFromMem (const void* area){    const Uint8* p = (Uint8*)area;    WORD wTemp;    int  w, h, xhot, yhot, colornum;    DWORD size, offset;    DWORD imagesize, imagew, imageh;        p += sizeof (WORD);    wTemp = MGUI_ReadLE16Mem (&p);    if(wTemp != 2) goto error;    // skip the cdCount of struct CURSORDIR, we always use the first cursor.    p += sizeof (WORD);        // cursor info, read the members of struct CURSORDIRENTRY.    w = *p++;  // the width of first cursor.    h = *p++;  // the height of first cursor.    if (w != CURSORWIDTH || h != CURSORHEIGHT)        goto error;    // skip the bColorCount and bReserved.    p += sizeof(BYTE)*2;    xhot = MGUI_ReadLE16Mem (&p);    yhot = MGUI_ReadLE16Mem (&p);    size = MGUI_ReadLE32Mem (&p);    offset = MGUI_ReadLE32Mem (&p);    // read the cursor image info.    p = (Uint8*)area + offset;    // skip the biSize member.    p += sizeof (DWORD);        imagew = MGUI_ReadLE32Mem (&p);    imageh = MGUI_ReadLE32Mem (&p);    // check the biPlanes member;    wTemp = MGUI_ReadLE16Mem (&p);    if (wTemp != 1) goto error;    // check the biBitCount member;    wTemp = MGUI_ReadLE16Mem (&p);    if (wTemp > 4) goto error;    colornum = wTemp;    // skip the biCompression members.    p += sizeof (DWORD);        imagesize = MGUI_ReadLE32Mem (&p);    // skip the rest members and the color table.    p += sizeof(DWORD)*4 + sizeof(BYTE)*(4<<colornum);        return CreateCursor (xhot, yhot, w, h,                         p + (imagesize - MONOSIZE), p, colornum);error:    return 0;}static BOOL srvDestroyCursor (HCURSOR hcsr){    int i;    PCURSOR pcsr = (PCURSOR)hcsr;    if (pcsr == NULL)        return TRUE;    for (i = 0; i < ((PG_RES)mgSharedRes)->csrnum; i++) {        if (pcsr == sys_cursors [i])            return FALSE;    }    free(pcsr->AndBits);    free(pcsr->XorBits);    free(pcsr);    return TRUE;}BOOL GUIAPI DestroyCursor (HCURSOR hcsr){    if (mgIsServer) {        return srvDestroyCursor (hcsr);    }    else {        REQUEST req;        BOOL ret_value;        req.id = REQID_DESTROYCURSOR;        req.data = &hcsr;        req.len_data = sizeof (HCURSOR);        if (cli_request (&req, &ret_value, sizeof (BOOL)) < 0)            return FALSE;        return ret_value;    }}static void init_system_cursor (void){    int csrid;    unsigned char* temp;    temp = mgSharedRes + ((PG_RES)mgSharedRes)->csroffset;    temp += sizeof (PCURSOR) * ((PG_RES)mgSharedRes)->csrnum;    for (csrid = 0; csrid < ((PG_RES)mgSharedRes)->csrnum; csrid++) {        if (!(sys_cursors [csrid] = (PCURSOR) malloc (sizeof(CURSOR))))            return;        sys_cursors [csrid]->xhotspot = ((PCURSOR)temp)->xhotspot;        sys_cursors [csrid]->yhotspot = ((PCURSOR)temp)->yhotspot;        sys_cursors [csrid]->width    = ((PCURSOR)temp)->width;        sys_cursors [csrid]->height   = ((PCURSOR)temp)->height;        sys_cursors [csrid]->AndBits  = temp + sizeof(CURSOR);        sys_cursors [csrid]->XorBits  = temp + sizeof(CURSOR) + __mg_csrimgsize;        temp += (sizeof(CURSOR) + 2 * __mg_csrimgsize);    }}HCURSOR GUIAPI GetSystemCursor (int csrid){    if (csrid >= ((PG_RES)mgSharedRes)->csrnum || csrid < 0)        return 0;     return (HCURSOR) (sys_cursors [csrid]);}HCURSOR GUIAPI GetDefaultCursor (void){    return def_cursor;}#ifdef _USE_NEWGALstatic BITMAP csr_bmp = {BMP_TYPE_NORMAL, 0, 0, 0, 0, CURSORWIDTH, CURSORHEIGHT};#endifBOOL InitCursor (void){    sys_cursors = mgSharedRes + ((PG_RES)mgSharedRes)->csroffset;    if (mgIsServer) {        if (!(cursorbits = malloc (__mg_csrimgsize))) {            return FALSE;        }        init_system_cursor ();        CSR_CURRENT = NULL;        CSR_SHOW_COUNT = 0;        CSR_OLDBOXLEFT  = -100;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品伊人色| 日韩午夜精品视频| 精品国产伦一区二区三区观看体验| 国产日韩av一区二区| 亚洲国产美女搞黄色| 国产精品12区| 日韩小视频在线观看专区| 亚洲黄色录像片| 成人免费毛片高清视频| 欧美成人aa大片| 亚洲国产成人tv| 99精品视频在线观看| 国产欧美日韩卡一| 国产最新精品免费| 日韩欧美第一区| 石原莉奈在线亚洲三区| 在线免费观看日本一区| 中文字幕一区二区三区乱码在线| 国产伦理精品不卡| 久久奇米777| 精品一区二区免费视频| 欧美一区二区在线看| 天天操天天色综合| 欧美图区在线视频| 亚洲午夜私人影院| 日本道色综合久久| 亚洲综合激情另类小说区| 99国产精品久久久| 亚洲欧美日韩国产综合| 不卡大黄网站免费看| 国产精品久久久久精k8| 成人激情开心网| 中文字幕一区二区三区精华液| 成人h动漫精品一区二区| 国产精品午夜电影| 91丨国产丨九色丨pron| 一区二区三区中文字幕| 欧美视频一区二区三区在线观看| 亚洲午夜视频在线观看| 7777精品伊人久久久大香线蕉超级流畅| 亚洲va韩国va欧美va精品| 777亚洲妇女| 精品一区二区三区免费视频| 久久亚洲春色中文字幕久久久| 精品亚洲国产成人av制服丝袜 | 久久精品亚洲国产奇米99| 韩国精品一区二区| 国产精品每日更新在线播放网址| 99视频精品在线| 一区二区三区国产| 欧美精品高清视频| 国内久久婷婷综合| 中文字幕制服丝袜一区二区三区| 色8久久精品久久久久久蜜| 午夜精品爽啪视频| 精品精品国产高清a毛片牛牛| 国产成人免费视| 亚洲品质自拍视频网站| 欧美一区二区三区在线视频| 国产风韵犹存在线视精品| 亚洲欧洲av在线| 91精品国产色综合久久不卡蜜臀 | 欧美视频一区二区| 激情文学综合插| 亚洲欧美日韩国产成人精品影院| 欧美视频三区在线播放| 国产精品一区二区久久不卡 | 一区二区三区四区在线播放 | 99在线精品一区二区三区| 亚洲综合在线视频| 久久亚洲欧美国产精品乐播| 91麻豆国产精品久久| 麻豆国产精品777777在线| 1区2区3区国产精品| 日韩手机在线导航| 99久久精品免费看国产| 久久69国产一区二区蜜臀| 亚洲免费av高清| 欧美刺激午夜性久久久久久久| aaa亚洲精品| 激情都市一区二区| 亚洲午夜精品在线| 中文字幕在线观看一区| 欧美成人国产一区二区| 欧美三区在线观看| 成人av中文字幕| 狠狠色丁香婷婷综合| 亚洲第一搞黄网站| 亚洲色图欧洲色图| 国产日韩欧美高清| 久久蜜桃av一区二区天堂| 欧美乱妇一区二区三区不卡视频| 不卡的电影网站| 国产成人在线视频网址| 精品在线免费观看| 日韩国产在线一| 亚洲成人综合在线| 亚洲激情成人在线| 亚洲精品自拍动漫在线| 国产目拍亚洲精品99久久精品| 日韩欧美中文字幕制服| 欧美日韩免费电影| 欧美中文字幕一二三区视频| 91麻豆国产在线观看| av电影在线观看一区| 成人av免费网站| 成人一级片在线观看| 风流少妇一区二区| 国产不卡在线一区| 福利电影一区二区| 成人av一区二区三区| 成人h动漫精品一区二| 成人伦理片在线| 99久久久精品免费观看国产蜜| 成人黄色av网站在线| 成人黄色免费短视频| a美女胸又www黄视频久久| 波多野结衣欧美| 99久久er热在这里只有精品15| aa级大片欧美| 欧美私模裸体表演在线观看| 欧美亚日韩国产aⅴ精品中极品| 欧美视频在线一区二区三区 | 久久电影国产免费久久电影| 日本不卡视频在线观看| 久久精品99国产精品日本| 久久爱www久久做| 国产精品一区专区| 不卡一二三区首页| 91国产免费观看| 欧美一区二区三区播放老司机| 日韩欧美区一区二| 欧美激情一区二区三区全黄| 亚洲免费在线播放| 无码av中文一区二区三区桃花岛| 美美哒免费高清在线观看视频一区二区 | 亚洲一区二区三区影院| 夜夜嗨av一区二区三区网页| 天堂影院一区二区| 国产精品自拍三区| 色综合天天综合网国产成人综合天 | 制服丝袜亚洲色图| 久久综合五月天婷婷伊人| 亚洲欧美怡红院| 午夜精品久久久久久久久久| 精一区二区三区| 色综合天天综合狠狠| 91精品国产麻豆| 中文字幕av一区二区三区高| 亚洲一区二区av在线| 久久精工是国产品牌吗| www.欧美日韩| 欧美一区午夜视频在线观看| 亚洲国产精品成人久久综合一区| 一区二区三区.www| 国产一区二区三区香蕉| 欧美日韩一区二区在线视频| 久久精品无码一区二区三区| 香蕉成人伊视频在线观看| 国产成人av电影| 91精品国产色综合久久ai换脸 | 美女视频黄 久久| 91在线精品一区二区三区| 日韩视频在线观看一区二区| 亚洲欧美一区二区久久| 国产一区二区三区四区五区美女| 欧美图区在线视频| 国产精品久久久久天堂| 日本va欧美va精品发布| 在线影视一区二区三区| 国产亚洲欧美激情| 日本美女一区二区三区视频| 91在线免费视频观看| 国产欧美精品区一区二区三区 | 国产日产精品一区| 日本不卡视频一二三区| 在线看一区二区| 亚洲欧美综合色| 国产精品一区一区三区| 日韩美女主播在线视频一区二区三区| 亚洲精品欧美综合四区| jizz一区二区| 久久精品一区二区三区不卡| 日本欧美大码aⅴ在线播放| 欧美午夜片在线看| 亚洲卡通动漫在线| 91在线国产福利| 久久精品夜色噜噜亚洲aⅴ| 久久超碰97中文字幕| 欧美精品免费视频| 午夜久久久久久电影| 在线观看成人免费视频| 亚洲尤物在线视频观看| 一本色道a无线码一区v| 中文字幕一区二区视频| 99久久久免费精品国产一区二区| 中文字幕av免费专区久久| 国产精品亚洲第一| 欧美极品另类videosde| 成人性生交大片免费看中文|