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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? timer.c

?? 這是針對 Linux (i386)平臺的 minigui 3.6.2 開發(fā)包(MiniGUI-Processes 運行模式)。
?? C
字號:
/*** $Id: timer.c,v 1.48 2005/01/06 09:35:00 weiym Exp $**** timer.c: The Timer module for MiniGUI-Threads.**** Copyright (C) 2003 Feynman Software.** Copyright (C) 1999 ~ 2002 Wei Yongming.**** Current maintainer: Wei Yongming.**** Create date: 1999/04/21*/ /*** 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 <stdlib.h>#include <string.h>#include "common.h"#include "minigui.h"#include "gdi.h"#include "window.h"#include "cliprect.h"#include "gal.h"#include "internals.h"#include "misc.h"#include "timer.h"unsigned int __mg_timer_counter = 0;static TIMER *timerstr[MAX_TIMERS];#if defined (__NOUNIX__) || defined (__uClinux__)BOOL InitTimer (void){    __mg_timer_counter = 0;    return TRUE;}void TerminateTimer (){    int i;#ifdef __WINBOND_SWLINUX__    pthread_detach(__mg_timer);#else    pthread_cancel (__mg_timer);#endif    for (i = 0; i < MAX_TIMERS; i++) {        if (timerstr[i] != NULL)            free ( timerstr[i] );        timerstr[i] = NULL;    }}void __mg_os_timer_loop (void){    int sem_value;    while (1) {        __mg_os_time_delay (10);        __mg_timer_counter ++;        // alert desktop        __mg_dsk_msgs.dwState |= 0x01;        sem_getvalue (&__mg_dsk_msgs.wait, &sem_value);        if (sem_value <= 0)            sem_post (&__mg_dsk_msgs.wait);    }}#else /* Linux interval timer */#include <signal.h>#include <unistd.h>#include <sys/time.h>static struct sigaction old_alarm_handler;static struct itimerval old_timer;static void itimersig_handler (int v){    int sem_value;    __mg_timer_counter++;    // alert desktop    __mg_dsk_msgs.dwState |= 0x01;    sem_getvalue (&__mg_dsk_msgs.wait, &sem_value);    if (sem_value <= 0)        sem_post (&__mg_dsk_msgs.wait);}BOOL InitTimer (void){    struct itimerval timerv;    struct sigaction siga;        sigaction (SIGALRM, NULL, &old_alarm_handler);    siga = old_alarm_handler;    siga.sa_handler = itimersig_handler;#ifndef __CYGWIN__    siga.sa_flags = SA_RESTART;#else    siga.sa_flags = SA_RESTART;#endif    sigaction (SIGALRM, &siga, NULL);    timerv.it_interval.tv_sec = 0;    timerv.it_interval.tv_usec = 10000;     // 10 ms    timerv.it_value = timerv.it_interval;    if (setitimer (ITIMER_REAL, &timerv, &old_timer)) {        fprintf(stderr, "TIMER: setitimer call failed!\n");        perror("setitimer");		return FALSE;    }    __mg_timer_counter = 0;    return TRUE;}void __mg_os_timer_loop (void){    pthread_join (__mg_desktop, NULL);}void TerminateTimer (){    int i;    if (setitimer (ITIMER_REAL, &old_timer, 0) == -1) {        fprintf( stderr, "TIMER: setitimer call failed!\n");        perror("setitimer");        return;    }    if (sigaction (SIGALRM, &old_alarm_handler, NULL) == -1) {        fprintf( stderr, "TIMER: sigaction call failed!\n");        perror("sigaction");    	return;    }    for (i=0; i<MAX_TIMERS; i++) {        if (timerstr[i] != NULL)            free ( timerstr[i] );        timerstr[i] = NULL;    }}#endif/************************* Functions run in desktop thread *******************/void DispatchTimerMessage (unsigned int inter){    PMAINWIN pWin;    PMSGQUEUE pMsgQueue;    int i, slot;    int sem_value;    for ( i=0; i<MAX_TIMERS; i++ ) {        if ( timerstr[i] ) {#if _TIMER_UNIT_10MS    	    timerstr[i]->count += inter;#else    	    timerstr[i]->count += 1<<7;#endif            if ( timerstr[i]->count >= timerstr[i]->speed ) {                pWin = GetMainWindowPtrOfControl (timerstr[i]->hWnd);                if (pWin == NULL) continue;                pMsgQueue = pWin->pMessages;                pthread_mutex_lock (&pMsgQueue->lock);                for (slot=0; slot<8; slot++) {                    if (pMsgQueue->TimerID[slot] == timerstr[i]->id                        && pMsgQueue->TimerOwner[slot] == timerstr[i]->hWnd)                        break;                }                if (slot != 8) {                    pMsgQueue->dwState |= (0x01 << slot);                    sem_getvalue (&pMsgQueue->wait, &sem_value);                    if (sem_value <= 0)                        sem_post(&pMsgQueue->wait);                }                pthread_mutex_unlock (&pMsgQueue->lock);                                timerstr[i]->count -= timerstr[i]->speed;            }        }    }}BOOL AddTimer (HWND hWnd, int id, unsigned int speed){#if 0    sigset_t sa_mask;#endif    int i;    PMAINWIN pWin;    PMSGQUEUE pMsgQueue;    int slot;    if (!(pWin = GetMainWindowPtrOfControl (hWnd))) return FALSE;#if 0    // block SIGALRM temporarily    sigemptyset (&sa_mask);    sigaddset (&sa_mask, SIGALRM);    pthread_sigmask (SIG_BLOCK, &sa_mask, NULL);#endif    pMsgQueue = pWin->pMessages;    // Is there a empty timer slot?    for (slot=0; slot<8; slot++) {        if ((pMsgQueue->TimerMask >> slot) & 0x01)            break;    }    if (slot == 8) goto badret;    for (i=0; i<MAX_TIMERS; i++)        if (timerstr[i] != NULL)            if (timerstr[i]->hWnd == hWnd && timerstr[i]->id == id)                goto badret;    for (i=0; i<MAX_TIMERS; i++)        if (timerstr[i] == NULL)            break;    if (i == MAX_TIMERS)        goto badret ;    timerstr[i] = malloc (sizeof (TIMER));#if _TIMER_UNIT_10MS    timerstr[i]->speed = speed;#else    timerstr[i]->speed = (1000<<7)/speed;#endif    timerstr[i]->hWnd = hWnd;    timerstr[i]->id = id;    timerstr[i]->count = 0;    pMsgQueue->TimerOwner[slot] = hWnd;    pMsgQueue->TimerID[slot] = id;    pMsgQueue->TimerMask &= ~(0x01 << slot);#if 0    // unblock SIGALRM    pthread_sigmask (SIG_UNBLOCK, &sa_mask, NULL);#endif    return TRUE;    badret:#if 0    // unblock SIGALRM    pthread_sigmask (SIG_UNBLOCK, &sa_mask, NULL);#endif    return FALSE;}BOOL RemoveTimer (HWND hWnd, int id){#if 0    sigset_t sa_mask;#endif    int i;    PMAINWIN pWin;    PMSGQUEUE pMsgQueue;    int slot;    void* temp;    if (!(pWin = GetMainWindowPtrOfControl (hWnd))) return FALSE;#if 0    // block SIGALRM temporarily    sigemptyset (&sa_mask);    sigaddset (&sa_mask, SIGALRM);    pthread_sigmask (SIG_BLOCK, &sa_mask, NULL);#endif        pMsgQueue = pWin->pMessages;    for (slot=0; slot<8; slot++) {        if (pMsgQueue->TimerID[slot] == id                    && pMsgQueue->TimerOwner[slot] == hWnd)            break;    }    if (slot == 8) goto badret;    for (i=0; i<MAX_TIMERS; i++)        if (timerstr[i] != NULL)            if (timerstr[i]->hWnd == hWnd && timerstr[i]->id == id)                break;    if (i == MAX_TIMERS) goto badret;        temp = timerstr[i];    timerstr[i] = NULL;    free (temp);    pMsgQueue->TimerMask |= (0x01 << slot);#if 0    // unblock SIGALRM    pthread_sigmask (SIG_UNBLOCK, &sa_mask, NULL);#endif        return TRUE;badret:#if 0    // unblock SIGALRM    pthread_sigmask (SIG_UNBLOCK, &sa_mask, NULL);#endif    return FALSE;}BOOL GUIAPI IsTimerInstalled (HWND hWnd, int id){    int i;#if 0    sigset_t sa_mask;    // block SIGALRM temporarily    sigemptyset (&sa_mask);    sigaddset (&sa_mask, SIGALRM);    pthread_sigmask (SIG_BLOCK, &sa_mask, NULL);#endif    for (i=0; i<MAX_TIMERS; i++) {        if ( timerstr[i] != NULL ) {            if ( timerstr[i]->hWnd == hWnd && timerstr[i]->id == id) {#if 0                pthread_sigmask (SIG_UNBLOCK, &sa_mask, NULL);#endif                return TRUE;            }        }    }#if 0    pthread_sigmask (SIG_UNBLOCK, &sa_mask, NULL);#endif    return FALSE;}BOOL SetTimerSpeed (HWND hWnd, int id, unsigned int speed){    int i;    #if 0    sigset_t sa_mask;    // block SIGALRM temporarily    sigemptyset (&sa_mask);    sigaddset (&sa_mask, SIGALRM);    pthread_sigmask (SIG_BLOCK, &sa_mask, NULL);#endif    for (i=0; i<MAX_TIMERS; i++)	if (timerstr[i]->hWnd == hWnd && timerstr[i]->id == id) {#if _TIMER_UNIT_10MS		timerstr[i]->speed = speed;#else		timerstr[i]->speed = (1000<<7)/speed;#endif		timerstr[i]->count = 0;#if 0        pthread_sigmask (SIG_UNBLOCK, &sa_mask, NULL);#endif        return TRUE;	}#if 0    pthread_sigmask (SIG_UNBLOCK, &sa_mask, NULL);#endif    return FALSE;}/****************** Timer Interfaces for applications ************************/unsigned int GUIAPI GetTickCount (){    return __mg_timer_counter;}BOOL GUIAPI SetTimer (HWND hWnd, int id, unsigned int speed){    TIMER timer;        timer.hWnd = hWnd;    timer.id = id;    timer.speed = speed;        return SendMessage (HWND_DESKTOP, MSG_ADDTIMER, 0, (LPARAM)&timer);}BOOL GUIAPI KillTimer (HWND hWnd, int id){    TIMER timer;        timer.hWnd = hWnd;    timer.id = id;        return SendMessage (HWND_DESKTOP, MSG_REMOVETIMER, 0, (LPARAM)&timer);}BOOL GUIAPI ResetTimer (HWND hWnd, int id, unsigned int speed){    TIMER timer;        timer.hWnd = hWnd;    timer.id = id;    timer.speed = speed;        return SendMessage (HWND_DESKTOP, MSG_RESETTIMER, 0, (LPARAM)&timer);}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕+乱码+中文字幕一区| 亚洲一区二区三区视频在线播放| 色综合天天狠狠| 日本在线播放一区二区三区| 欧美国产一区二区| 欧美精品18+| 一本久久精品一区二区| 韩国av一区二区三区四区| 伊人夜夜躁av伊人久久| 中文字幕高清不卡| 精品少妇一区二区三区| 欧美日韩精品是欧美日韩精品| 国产a视频精品免费观看| 麻豆国产精品视频| 亚洲超碰97人人做人人爱| 国产精品久久三| 欧美高清在线一区| 欧美一区二区三区播放老司机| 99re成人精品视频| 成人影视亚洲图片在线| 国产一区二区不卡在线| 日本vs亚洲vs韩国一区三区二区| 亚洲男人电影天堂| 中文字幕在线不卡一区| 国产色婷婷亚洲99精品小说| 欧美精品一区二区三区在线播放| 在线电影国产精品| 欧美三级一区二区| 欧美性极品少妇| 一本色道久久综合亚洲精品按摩| 成人午夜私人影院| 国产激情一区二区三区| 国产精品88av| 国产盗摄精品一区二区三区在线| 国产一区二区三区最好精华液| 美洲天堂一区二卡三卡四卡视频| 午夜精品123| 五月天视频一区| 日韩精品电影在线观看| 日韩**一区毛片| 裸体在线国模精品偷拍| 奇米影视在线99精品| 美国欧美日韩国产在线播放| 琪琪久久久久日韩精品| 久久精品免费观看| 极品美女销魂一区二区三区| 捆绑紧缚一区二区三区视频| 久久99精品国产麻豆婷婷洗澡| 国产一区二区在线免费观看| 国产精品1024久久| 99久久精品国产精品久久| 一本大道久久a久久综合| 色婷婷综合久久久中文一区二区| 欧美亚洲一区三区| 欧美美女一区二区三区| 欧美一级搡bbbb搡bbbb| 精品国产91久久久久久久妲己| 26uuu亚洲综合色欧美 | 精品国产乱码久久久久久1区2区| 欧美哺乳videos| 国产亚洲一区二区三区| 国产精品剧情在线亚洲| 免费人成在线不卡| 狠狠色丁香婷综合久久| 成人国产一区二区三区精品| 91成人免费在线视频| 欧美日韩成人在线一区| 久久久久国产精品麻豆ai换脸| **网站欧美大片在线观看| 亚洲国产一区二区a毛片| 麻豆国产91在线播放| 丁香激情综合国产| 欧美色涩在线第一页| 精品精品欲导航| 国产精品第四页| 日日夜夜精品免费视频| 国产精品一区二区不卡| 色88888久久久久久影院按摩| 欧美女孩性生活视频| 国产午夜精品理论片a级大结局 | 欧美一区三区四区| 国产亚洲污的网站| 亚洲最新在线观看| 久久99国产精品免费| 99久久99久久精品免费看蜜桃 | 精品999久久久| 亚洲品质自拍视频网站| 毛片一区二区三区| 91免费国产视频网站| 精品1区2区在线观看| 亚洲精品菠萝久久久久久久| 国产在线视频精品一区| 欧美日韩另类一区| 国产精品久久久久三级| 久久99精品久久久久婷婷| 在线免费观看视频一区| 久久精品夜夜夜夜久久| 日韩经典中文字幕一区| 99久精品国产| 国产清纯在线一区二区www| 日韩国产一区二| 色婷婷av一区二区三区大白胸| 久久久三级国产网站| 日韩高清不卡一区二区三区| 91久久国产最好的精华液| 国产欧美视频一区二区| 蜜桃视频免费观看一区| 欧美亚洲愉拍一区二区| 亚洲欧洲性图库| 懂色av一区二区夜夜嗨| 欧美精品一区二区三区在线| 亚洲mv大片欧洲mv大片精品| 91网址在线看| 中文字幕欧美激情| 极品少妇xxxx精品少妇| 91精品国产入口| 亚洲第四色夜色| 91久久久免费一区二区| 中文字幕在线观看不卡| 成人午夜碰碰视频| 久久蜜桃av一区精品变态类天堂 | 国产成人免费av在线| 欧美videossexotv100| 亚洲高清久久久| 欧美日韩在线播| 一区二区三区四区视频精品免费| 成人丝袜视频网| 国产精品欧美精品| 豆国产96在线|亚洲| 国产农村妇女毛片精品久久麻豆| 韩国一区二区视频| 久久综合五月天婷婷伊人| 精品一区二区三区免费观看| 日韩一区二区三区在线| 美女www一区二区| 精品国产乱码久久久久久牛牛| 秋霞午夜鲁丝一区二区老狼| 2021中文字幕一区亚洲| 另类中文字幕网| 精品国产凹凸成av人网站| 激情综合一区二区三区| 久久久久国产精品麻豆| 成人免费高清在线| 最新国产精品久久精品| 色94色欧美sute亚洲13| 亚洲国产乱码最新视频| 制服.丝袜.亚洲.另类.中文| 美女高潮久久久| 国产日产精品1区| 成人av资源下载| 亚洲夂夂婷婷色拍ww47| 欧美日韩国产精选| 久久国产成人午夜av影院| 国产日韩精品久久久| 成人av资源站| 亚洲国产美女搞黄色| 日韩一区二区在线免费观看| 国产资源在线一区| 自拍偷自拍亚洲精品播放| 在线免费不卡视频| 蜜臀av性久久久久蜜臀aⅴ| 久久日韩精品一区二区五区| 丁香桃色午夜亚洲一区二区三区| 亚洲视频图片小说| 在线播放/欧美激情| 国产在线精品不卡| 亚洲女人的天堂| 在线成人午夜影院| 国产成人亚洲综合a∨猫咪| 亚洲天天做日日做天天谢日日欢| 欧美精品在线一区二区| 国产电影一区二区三区| 一区二区三区欧美日韩| 91精品国产色综合久久久蜜香臀| 国产jizzjizz一区二区| 亚洲电影中文字幕在线观看| 久久久久久久久久久黄色| 在线免费观看不卡av| 国内精品伊人久久久久影院对白| 国产精品久久看| 日韩一区二区三区在线视频| jizzjizzjizz欧美| 视频在线观看国产精品| 国产精品美女一区二区三区| 欧美理论在线播放| 成人动漫一区二区三区| 日本亚洲一区二区| 亚洲人精品一区| 久久久精品国产免大香伊| 91福利视频在线| 粉嫩在线一区二区三区视频| 日韩福利电影在线| 自拍视频在线观看一区二区| 2019国产精品| 正在播放一区二区| 色妞www精品视频| 国产成人av电影在线| 免费观看在线综合| 亚洲精品国产一区二区精华液 | 91精品福利视频|