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

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

?? trcview.cpp

?? A Windows CE API Inecptor Tools
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/********************************************************************
Module : TrcView.cpp      - trace buffer viewer
             Written 2000,2003 by Dmitri Leman
    for an article in C/C++ journal about a tracing framework.
Purpose: A part of the tracer framework.
********************************************************************/
#ifdef TRACE_ //{

#if defined WIN32
#include <windows.h>
#include <stdio.h>
#include "HTrace.h"

#elif defined(_WIN32_WCE)

#include <windows.h>
#include "resource.h"
#include "HTrace.h"

#elif defined(__linux__)

#include <unistd.h>
#include <curses.h>
#include <malloc.h>
#include <string.h>
#include <sys/time.h>
#include "HTrace.h"

//This module was ported from WIN32 to ncurses.
//Therefore, I included few declarations, which allows
//some WIN32-specific to compile under linux.
typedef WINDOW * HDC;
typedef WINDOW * HWND;
typedef int BOOL;
#define __int64 long long
typedef struct {int left, top, right, bottom;} RECT;
void DrawText(
    WINDOW * p_pWindow, const char * p_pszBuffer,
    int p_iNumBytes, RECT * p_pPaintRect, int p_iFlags)
{
    int l_iRes = 
        mvwaddnstr(stdscr, 0,0, p_pszBuffer, p_iNumBytes);
    wclrtobot(p_pWindow);
}
static ULONG GetTickCount()
{
    clock_t l_Clock = clock();
    return (ULONG)(((__int64)l_Clock) * 1000 / CLOCKS_PER_SEC);
}
#define SB_VERT 1
#define SB_THUMBTRACK 1
#define SB_LINEUP     2
#define SB_LINEDOWN   3
#define SB_PAGEUP     4
#define SB_PAGEDOWN   5
#define SB_TOP        6
#define SB_BOTTOM     7

#define _snprintf snprintf
#endif


static const char s_szCaption[] = "Trace Viewer";

static char s_szFullINIPath[_MAX_PATH];

#define MAX_ROW_LEN     256
#define NUM_EXTRA_ROWS  2

struct BufferViewer
{
    LocalTraceBufferPointers * m_pBufferPointers;

    HWND    m_hWnd;

#ifdef WIN32
    HFONT   m_hFont;
    int     m_iFontHeight;
    int     m_iFontWidth;
    int     m_iLogicalWidthChars;
    int     m_iLogicalWidthPixels;
#endif

    LPTSTR  m_pBuffer;
    int     m_iBufferSize;
    int     m_iNumLines;
    int     m_iFirstPaintIndex;
    int     m_iNumBytesPainted;
    int     m_iFirstViewPosWhenPainted;
    int     m_iNumLinesPainted;
    int     m_iFirstRowLength;
    int     m_iTotalNumCharsWhenPainted;
    int     m_iScrollChanged;
    int     m_iScrollChangedWhenPainted;

    int     m_iHorzPos;
    int     m_iCharShownFirst;
    int     m_iLineOffset;
    bool    m_bStickToEnd;
    bool    m_bMoveToStartNextTime;

    RECT    m_ClientRect;
    RECT    m_PaintRect;
    int     m_iNumLinesInClientArea;

    BufferViewer(HWND p_hWnd)
    {
        m_hWnd = p_hWnd;
        m_pBufferPointers = NULL;
        #ifdef WIN32
        m_hFont = 0;
        m_iFontHeight = 0;
        m_iFontWidth = 0;
        m_iLogicalWidthChars = 0;
        m_iLogicalWidthPixels = 0;
        #endif
        m_pBuffer = NULL;
        m_iBufferSize = 0;
        m_iNumLines = 0;
        m_iFirstPaintIndex = -1;
        m_iNumBytesPainted = -1;
        m_iFirstViewPosWhenPainted = -1;
        m_iTotalNumCharsWhenPainted = -1;
        m_iNumLinesPainted = 0;
        m_iFirstRowLength = 0;
        m_iScrollChanged = 0;
        m_iScrollChangedWhenPainted = -1;
        m_iHorzPos = 0;
        m_iCharShownFirst = 0;
        m_iLineOffset = 0;
        m_bStickToEnd = true;
        m_bMoveToStartNextTime = false;
        m_iNumLinesInClientArea = 0;
        #ifdef __linux__
        m_iInvalidated = 0;
        m_iScrollMin = 0;
        m_iScrollMax = 0;
        m_iScrollPos = 0; 
        m_pWndStatus = NULL;
        m_pWndHelp = NULL;             
        #endif
    }
    void PaintBufferWithCopy
    (
        HDC  p_hDC,
        LPCTSTR p_pTraceBuffer,
        int p_lBufferSizeChars,
        int p_iFirstViewPos,
        int p_iLinesOffset,
        int p_iDataSizeAfterScrollPos, 
        int p_iDataSizeBeforeScrollPos
    );
    void PaintBuffer
    (
        int                 p_iFirstViewPos,
        int                 p_iLinesOffset,
        HDC                 p_hDC,
        RECT              * p_pPaintRect
    );
    void UpdateScrollPos();
    void OnPaint();
    void OnSizeChanges();
    void OnTimerMessage();
    void OnScrollMessage
    (
        int p_nScrollBarType,
        int p_nScrollCode,
        int p_nPos,
        int p_nTrackPos,
        int p_nMin,
        int p_nMax
    );
    #ifdef __linux__
    //Few more routines to allow portions of WIN32 specific
    //code to run under ncurses
    void InvalidateRect(HWND,RECT*,BOOL)
    {
        m_iInvalidated++;
    }
    void GetScrollRange(HWND, int, int * p_piMin,int * p_piMax)
    {
        *p_piMin = m_iScrollMin;
        *p_piMax = m_iScrollMax;
    } 
    void SetScrollRange(HWND, int,int p_iMin, int p_iMax,BOOL)
    {
        m_iScrollMin = p_iMin;
        m_iScrollMax = p_iMax;    
    }
    void SetScrollPos(HWND, int, int p_iPos,BOOL)
    {
        m_iScrollPos = p_iPos;
    }       
    int m_iInvalidated;
    int m_iScrollMin;
    int m_iScrollMax;
    int m_iScrollPos;
    WINDOW * m_pWndStatus;
    WINDOW * m_pWndHelp;
    #endif
};//struct BufferViewer

/*-------------------------------------------------------------

   FUNCTION: BufferViewer::PaintBufferWithCopy

   PURPOSE:  Worker routine to copy a portion of a trace buffer
    to a local display buffer and paint it to the screen.
   PARAMETERS:
    HDC  p_hDC                  - device context
    LPCTSTR p_pTraceBuffer - the whole circular buffer
    int p_lBufferSizeChars - total size of the buffer
    int p_iFirstViewPos    - current scroll position
    int p_iLinesOffset     - count p_iLinesOffset lines up or down
                            from the current scroll position to
                            find the first line to paint.
    int p_iDataSizeAfterScrollPos  - number of valid bytes in the 
                            buffer before p_iCurByte
    int p_iDataSizeBeforeScrollPos - number of valid bytes in the 
                            buffer after p_iCurByte
-------------------------------------------------------------*/
void BufferViewer::PaintBufferWithCopy
(
    HDC  p_hDC,
    LPCTSTR p_pTraceBuffer,
    int p_lBufferSizeChars,
    int p_iFirstViewPos,
    int p_iLinesOffset,
    int p_iDataSizeAfterScrollPos, 
    int p_iDataSizeBeforeScrollPos
)
{
    int l_iSize = (m_iNumLinesInClientArea + NUM_EXTRA_ROWS) * 
        MAX_ROW_LEN;
    if(m_iNumLines < m_iNumLinesInClientArea || !m_pBuffer)
    {
        //The worst uncertainty is the line width.
        //We will assume MAX_ROW_LEN = 256 byte line width.
        //Hopefully, most of lines will be shorter.
        //If most of lines will be longer than 256,
        //we will print fewer lines, than fit in window
        LPTSTR l_pBuff = (LPTSTR)malloc(l_iSize*sizeof(TCHAR));
        if(l_pBuff == NULL)
        {
            HTRACE(TG_Error, 
                _T("ERROR: malloc(%d) failed"), l_iSize);
            return;
        }
        free(m_pBuffer);
        m_pBuffer = l_pBuff;
        m_iBufferSize = l_iSize;
        m_iNumLines = m_iNumLinesInClientArea;
    }//if(m_iNumLines < m_iNumLinesInClientArea)

    //Now we need to copy memory from the trace buffer to the
    //screen buffer.
    //We need to start before the current position to find the 
    //beginning of the line, which contains the current 
    //position.
    int l_iLookBack = p_iLinesOffset < -1? 
        (-p_iLinesOffset)*MAX_ROW_LEN : MAX_ROW_LEN;
    if(l_iLookBack + p_iDataSizeAfterScrollPos < l_iSize)
    {  
        //If we have not enough data after the scroll point,
        //we need to look farther behind to avoid leaving blank
        //space (basically this means that the very last line should
        //be displayed at the bottom of the screen - not at the top)
        l_iLookBack = l_iSize - p_iDataSizeAfterScrollPos;
    }
    if(l_iLookBack > p_iDataSizeBeforeScrollPos)
       l_iLookBack = p_iDataSizeBeforeScrollPos;

    int l_iStartFromByteWithExtra = 
        (p_iFirstViewPos - l_iLookBack) % p_lBufferSizeChars;
    int l_iDisplaySize = p_iDataSizeAfterScrollPos + l_iLookBack;
    if(l_iDisplaySize > l_iSize)
       l_iDisplaySize = l_iSize;
    int l_iLookForward = l_iDisplaySize;
    if(l_iStartFromByteWithExtra + l_iLookForward > 
        p_lBufferSizeChars)
    {
        l_iLookForward = p_lBufferSizeChars - 
            l_iStartFromByteWithExtra;
        memcpy(m_pBuffer, p_pTraceBuffer + 
            l_iStartFromByteWithExtra, l_iLookForward*sizeof(TCHAR));
        //The display area continues at the beginning of buffer
        memcpy(m_pBuffer + l_iLookForward, p_pTraceBuffer, 
            (l_iDisplaySize - l_iLookForward)*sizeof(TCHAR));
    }
    else
    {
        memcpy(m_pBuffer, p_pTraceBuffer + 
            l_iStartFromByteWithExtra, l_iLookForward*sizeof(TCHAR));
    }

    int i;
    int l_iNumLines = 0;
    int l_iBeginning = l_iLookBack;

    //First count lines after the current byte, which is at the
    //position l_iLookBack in the m_pBuffer
    int l_iEnd = l_iDisplaySize;//if we will not find newlines
    int l_iFirstLineEnd = l_iEnd;
    for(i = l_iLookBack; i < l_iDisplaySize; i++)
    {
        if(m_pBuffer[i] == '\n')
        {
            l_iEnd = i;
            if(l_iNumLines == 0)
            {
                l_iFirstLineEnd = i;
            }
            l_iNumLines++;
            if(l_iNumLines >= m_iNumLinesInClientArea)
                break;
        }
    }
    //Next look back until we find the beginning of the line,
    //which the current position belongs to. And look further
    //back if we have not enough lines already to fill screen.
    int l_iCountLinesBefore = p_iLinesOffset < 0? 
        -p_iLinesOffset : 1;
    for(i = l_iLookBack-1; i >= 0; i--)
    {
        if(m_pBuffer[i] == '\n')
        {
            l_iBeginning = i+1;
            l_iNumLines++;
            if(--l_iCountLinesBefore <= 0 &&
                l_iNumLines >= m_iNumLinesInClientArea)
                break;
            l_iFirstLineEnd = i;
        }
    }
    if(i < 0)
    {//Didn't find any newlines before the current position.
        l_iBeginning = 0;
    }

    m_iFirstPaintIndex = l_iBeginning;
    m_iNumBytesPainted = l_iEnd - l_iBeginning;
    DrawText(p_hDC, m_pBuffer + m_iFirstPaintIndex, 
                    m_iNumBytesPainted, &m_PaintRect, 0);

    m_iCharShownFirst = p_iFirstViewPos - l_iLookBack + l_iBeginning;
    m_iLineOffset = 0;
    m_iFirstViewPosWhenPainted = m_iCharShownFirst;
    m_iNumLinesPainted = l_iNumLines;
    m_iFirstRowLength = 1 + l_iFirstLineEnd - l_iBeginning;
}//void BufferViewer::PaintBufferWithCopy

/*------------------------------------------------------------

   FUNCTION: BufferViewer::PaintBuffer

   PURPOSE:  Performs actual painting of the trace buffer
   PARAMETERS:
    p_iFirstViewPos - current byte (between 0 and the buffer 
        size) to be shown at the top of the window (measured 
        from the initial start of writing)
    p_iLinesOffset     - count p_iLinesOffset lines up or down
                            from the current scroll position to
                            find the first line to paint.
------------------------------------------------------------*/
void BufferViewer::PaintBuffer
(
    int                 p_iFirstViewPos,
    int                 p_iLinesOffset,
    HDC                 p_hDC,
    RECT              * p_pPaintRect
)
{
    if(!m_pBufferPointers || !m_pBufferPointers->m_pGlobalFooter ||
        !m_pBufferPointers->m_dwTextAreaSize)
        return;
    int   l_iCharsWritten = 
        m_pBufferPointers->m_pGlobalFooter->m_dwNumBytesWritten /
        sizeof(TCHAR);
    int   l_iBufferSizeChars = 
        m_pBufferPointers->m_dwTextAreaSize / sizeof(TCHAR);

    if(p_iFirstViewPos > l_iCharsWritten)
        p_iFirstViewPos = l_iCharsWritten;
        //don't show empty space

    LPTSTR l_pText = m_pBufferPointers->m_pTextArea;

    //Decide which byte in the trace buffer corresponds to the
    //scroll position. This will be the last line to be shown.

    int l_iDataSizeAfterScrollPos= l_iCharsWritten - p_iFirstViewPos;
    if(l_iDataSizeAfterScrollPos > l_iBufferSizeChars)
    {
        //The scroll position is behind the beginning of the 
        //valid data in the buffer (since the scroll position was
        //moved there the data were overwritten).
        if(m_iFirstViewPosWhenPainted == p_iFirstViewPos &&
           m_iFirstPaintIndex >= 0 && m_pBuffer != NULL)
        {
            //Fortunately, we already have the data in the 
            //display buffer
            DrawText(p_hDC, m_pBuffer + m_iFirstPaintIndex, 
                        m_iNumBytesPainted, p_pPaintRect, 0);
        }
        else
        {
            DrawText(p_hDC, _T("Data Lost"), 9, p_pPaintRect, 0);
        }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩电影一区| 成人激情黄色小说| 91精品国产色综合久久不卡电影| 亚洲自拍偷拍网站| 91激情在线视频| 亚洲成人激情av| 91精品国产美女浴室洗澡无遮挡| 奇米888四色在线精品| 2024国产精品| 色婷婷精品大在线视频| 五月婷婷久久丁香| 久久麻豆一区二区| 99在线精品视频| 午夜精品久久久久久久久| 精品少妇一区二区三区视频免付费| 国产精品123| 亚洲女性喷水在线观看一区| 欧美女孩性生活视频| 蜜臀91精品一区二区三区| 国产日产精品一区| 欧美午夜精品电影| 国内成+人亚洲+欧美+综合在线| 国产精品动漫网站| 欧美日本一区二区| 国产成人99久久亚洲综合精品| 亚洲精品伦理在线| 日韩欧美一级在线播放| 99久久久久久| 久久国产麻豆精品| 一区二区视频在线| 精品91自产拍在线观看一区| 99vv1com这只有精品| 蜜桃一区二区三区四区| 亚洲欧美视频在线观看视频| 日韩一区二区麻豆国产| 91香蕉国产在线观看软件| 免费看欧美美女黄的网站| 亚洲欧美日韩国产成人精品影院 | 欧美视频一区二区| 极品美女销魂一区二区三区免费 | 久久精品亚洲精品国产欧美kt∨| 一本久道中文字幕精品亚洲嫩| 精品一区二区免费看| 亚洲综合激情另类小说区| 久久欧美中文字幕| 欧美一级理论性理论a| 9色porny自拍视频一区二区| 国产综合久久久久久久久久久久| 亚洲国产日韩一区二区| 中文字幕精品在线不卡| 欧美一级欧美三级| 欧美日韩一二三区| 91一区二区在线观看| 国产精品亚洲专一区二区三区| 爽好久久久欧美精品| 亚洲欧美日韩一区二区| 欧美—级在线免费片| 精品福利一区二区三区| 4438x成人网最大色成网站| 色94色欧美sute亚洲线路二| 大白屁股一区二区视频| 国产又粗又猛又爽又黄91精品| 亚洲电影视频在线| 亚洲一区自拍偷拍| 亚洲综合偷拍欧美一区色| 亚洲免费观看高清| 国产精品国产三级国产普通话三级| 欧美成人aa大片| 欧美刺激脚交jootjob| 制服丝袜av成人在线看| 欧美日本在线看| 欧美日韩国产精选| 欧美精品久久99久久在免费线| 欧美三级视频在线观看| 欧美日韩激情一区二区三区| 在线视频你懂得一区| 欧美三级视频在线| 精品视频999| 欧美精品vⅰdeose4hd| 9191成人精品久久| 日韩免费高清视频| 亚洲精品一区二区精华| 久久久久亚洲蜜桃| 欧美国产精品劲爆| 亚洲天堂2016| 亚洲综合色噜噜狠狠| 偷拍与自拍一区| 久久精品久久精品| 国产成人夜色高潮福利影视| 国产不卡视频一区二区三区| 成人一区二区三区中文字幕| 91亚洲午夜精品久久久久久| 一本大道av一区二区在线播放| 91成人免费在线视频| 欧美一区二区视频免费观看| 精品国产亚洲在线| 中文字幕中文字幕在线一区| 一区二区欧美在线观看| 婷婷综合另类小说色区| 久久成人精品无人区| 福利一区二区在线| 色婷婷综合视频在线观看| 欧美日本在线看| 久久精品视频网| 亚洲自拍欧美精品| 韩国中文字幕2020精品| av电影在线观看不卡| 欧美性做爰猛烈叫床潮| 欧美成人一区二区| 国产精品美女久久久久久| 亚洲一区二区高清| 国产麻豆精品在线观看| 色狠狠综合天天综合综合| 欧美精品vⅰdeose4hd| 国产网站一区二区| 亚洲国产wwwccc36天堂| 国产一区二区视频在线| 色欧美片视频在线观看在线视频| 日韩一区二区三区视频| 国产精品福利一区二区三区| 婷婷丁香激情综合| 懂色av噜噜一区二区三区av| 8v天堂国产在线一区二区| 国产精品传媒视频| 日韩高清不卡一区二区三区| 97精品国产露脸对白| 精品国产网站在线观看| 亚洲综合在线观看视频| 国产成人在线看| 欧美一级欧美一级在线播放| 亚洲天堂av一区| 国产乱码精品1区2区3区| 欧美日韩一级黄| 中文字幕一区二区日韩精品绯色| 日本亚洲电影天堂| 日本道色综合久久| 欧美国产精品v| 欧美日韩一二区| 国产精品狼人久久影院观看方式| 日韩成人免费在线| 欧洲国内综合视频| 国产精品久久一级| 国内精品免费在线观看| 欧美日韩aaaaaa| 亚洲综合男人的天堂| 91亚洲午夜精品久久久久久| 国产色综合久久| 国产乱码一区二区三区| 日韩欧美一级精品久久| 视频一区二区三区入口| 欧美三级电影一区| 亚洲美女在线国产| 97精品久久久午夜一区二区三区 | 日韩视频永久免费| 亚洲影院理伦片| 91小视频在线| 亚洲婷婷综合色高清在线| 成人做爰69片免费看网站| 国产片一区二区三区| 国模冰冰炮一区二区| 精品日韩av一区二区| 青青国产91久久久久久| 欧美精品亚洲二区| 日韩av中文字幕一区二区三区| 欧美日韩一区 二区 三区 久久精品 | 美女被吸乳得到大胸91| 91精品欧美久久久久久动漫| 三级不卡在线观看| 欧美美女一区二区三区| 三级一区在线视频先锋 | 精品国产一区二区三区不卡 | 欧美日韩国产小视频| 丝袜诱惑制服诱惑色一区在线观看 | 在线免费观看不卡av| 亚洲一区二区三区四区在线| 欧美午夜免费电影| 日韩国产在线观看一区| 欧美一区二区国产| 国内一区二区视频| 久久精品人人爽人人爽| caoporn国产一区二区| 亚洲综合视频在线| 7777精品伊人久久久大香线蕉超级流畅 | 国产精品天干天干在线综合| www.欧美亚洲| 亚洲最大色网站| 717成人午夜免费福利电影| 激情综合网最新| 国产精品嫩草影院av蜜臀| 日本道色综合久久| 天天综合天天做天天综合| 精品蜜桃在线看| 99精品一区二区三区| 午夜精品久久久久久久久久久| 精品国产1区二区| 91色视频在线| 秋霞国产午夜精品免费视频| 国产日韩欧美a| 欧美视频日韩视频在线观看| 精品亚洲成av人在线观看|