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

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

?? gros2pm.c

?? freetype庫的應(yīng)用demo,里面包含freetype的很多實(shí)例
?? C
?? 第 1 頁 / 共 2 頁
字號(hào):
#include "grobjs.h"#include "grdevice.h"#define INCL_DOS#define INCL_WIN#define INCL_GPI#define INCL_SUB#include <os2.h>#include <stdio.h>#include <string.h>#include <stdlib.h>#include <stdarg.h>#define  DEBUGxxx#ifdef DEBUG#define LOG(x)  LogMessage##x#else#define LOG(x)  /* rien */#endif#ifdef DEBUG  static void  LogMessage( const char*  fmt, ... )  {    va_list  ap;    va_start( ap, fmt );    vfprintf( stderr, fmt, ap );    va_end( ap );  }#endif  typedef struct Translator  {    ULONG   os2key;    grKey   grkey;  } Translator;  static  Translator  key_translators[] =  {    { VK_BACKSPACE, grKeyBackSpace },    { VK_TAB,       grKeyTab       },    { VK_ENTER,     grKeyReturn    },    { VK_ESC,       grKeyEsc       },    { VK_HOME,      grKeyHome      },    { VK_LEFT,      grKeyLeft      },    { VK_UP,        grKeyUp        },    { VK_RIGHT,     grKeyRight     },    { VK_DOWN,      grKeyDown      },    { VK_PAGEUP,    grKeyPageUp    },    { VK_PAGEDOWN,  grKeyPageDown  },    { VK_END,       grKeyEnd       },    { VK_F1,        grKeyF1        },    { VK_F2,        grKeyF2        },    { VK_F3,        grKeyF3        },    { VK_F4,        grKeyF4        },    { VK_F5,        grKeyF5        },    { VK_F6,        grKeyF6        },    { VK_F7,        grKeyF7        },    { VK_F8,        grKeyF8        },    { VK_F9,        grKeyF9        },    { VK_F10,       grKeyF10       },    { VK_F11,       grKeyF11       },    { VK_F12,       grKeyF12       }  };#define MAX_PIXEL_MODES  32  static  HAB   gr_anchor;   /* device anchor block */  typedef POINTL  PMBlitPoints[4];  typedef struct grPMSurface_  {    grSurface  root;    grBitmap   image;    HAB        anchor;         /* handle to anchor block for surface's window */    HWND       frame_window;   /* handle to window's frame                    */    HWND       client_window;  /* handle to window's client                   */    HWND       title_window;   /* handle to window's title bar                */    HPS        image_ps;       /* memory presentation space used to hold */                               /* the surface's content under PM         */    HDC        image_dc;       /* memory device context for the image    */    HEV        event_lock;     /* semaphore used in listen_surface   */    HMTX       image_lock;     /* a mutex used to synchronise access */                               /* to the memory presentation space   */                               /* used to hold the surface           */    TID        message_thread; /* thread used to process this surface's */                               /* messages..                            */    PBITMAPINFO2 bitmap_header;/* os/2 bitmap descriptor                   */    HBITMAP      os2_bitmap;   /* Handle to OS/2 bitmap contained in image */    BOOL         ready;        /* ??? */    long         shades[256];  /* indices of gray levels in pixel_mode_gray */    POINTL       surface_blit[4];  /* surface blitting table   */    POINTL       magnify_blit[4];  /* magnifier blitting table */    int          magnification;    /* level of magnification   */    POINTL       magnify_center;    SIZEL        magnify_size;    grEvent      event;    PMBlitPoints blit_points;  } grPMSurface;  /* we use a static variable to pass a pointer to the PM Surface  */  /* to the client window. This is a bit ugly, but it makes things */  /* a lot more simple..                                           */  static  grPMSurface*  the_surface;  static  void  enable_os2_iostreams( void )  {    PTIB  thread_block;    PPIB  process_block;    /* XXX : This is a very nasty hack, it fools OS/2 and let the program */    /*       call PM functions, even though stdin/stdout/stderr are still */    /*       directed to the standard i/o streams..                       */    /*       The program must be compiled with WINDOWCOMPAT               */    /*                                                                    */    /*   Credits go to Michal for finding this !!                         */    /*                                                                    */    DosGetInfoBlocks( &thread_block, &process_block );    process_block->pib_ultype = 3;  }  static  int  init_device( void )  {    enable_os2_iostreams();    /* create an anchor block. This will allow this thread (i.e. the */    /* main one) to call Gpi functions..                             */    gr_anchor = WinInitialize(0);    if (!gr_anchor)    {      /* could not initialise Presentation Manager */      return -1;    }    return 0;  }  static  void  done_device( void )  {    /* Indicates that we do not use the Presentation Manager, this */    /* will also release all associated resources..                */    WinTerminate( gr_anchor );  }  /* close a given window */  static  void  done_surface( grPMSurface*  surface )  {    LOG(( "Os2PM: done_surface(%08lx)\n", (long)surface ));    if ( surface->frame_window )      WinDestroyWindow( surface->frame_window );    WinReleasePS( surface->image_ps );    grDoneBitmap( &surface->image );    grDoneBitmap( &surface->root.bitmap );  }#define LOCK(x)    DosRequestMutexSem( x, SEM_INDEFINITE_WAIT )#define UNLOCK(x)  DosReleaseMutexSem( x )  static  const int  pixel_mode_bit_count[] =  {    0,    1,   /* mono  */    4,   /* pal4  */    8,   /* pal8  */    8,   /* grays */    15,  /* rgb15 */    16,  /* rgb16 */    24,  /* rgb24 */    32   /* rgb32 */  }; /************************************************************************  *  * Technical note : how the OS/2 Presntation Manager driver works  *  * PM is, in my opinion, a bloated and over-engineered graphics  * sub-system, even though it has lots of nice features. Here are  * a few tidbits about it :  *  *  * - under PM, a "bitmap" is a device-specific object whose bits are  *   not directly accessible to the client application. This means  *   that we must use a scheme like the following to display our  *   surfaces :  *  *     - hold, for each surface, its own bitmap buffer where the  *       rest of the graph library writes directly.  *  *     - create a PM bitmap object with the same dimensions (and  *       possibly format).  *  *     - copy the content of each updated rectangle into the  *       PM bitmap with the function 'GpiSetBitmapBits'.  *  *     - finally, "blit" the PM bitmap to the screen calling  *       'GpiBlitBlt'  *  * - but there is more : you cannot directly blit a PM bitmap to the  *   screen with PM. The 'GpiBlitBlt' only works with presentation  *   spaces. This means that we also need to create, for each surface :  *  *     - a memory presentation space, used to hold the PM bitmap  *     - a "memory device context" for the presentation space  *  *   The blit is then performed from the memory presentation space  *   to the screen's presentation space..  *  *  * - because each surface creates its own event-handling thread,  *   we must protect the surface's presentation space from concurrent  *   accesses (i.e. calls to 'GpiSetBitmapBits' when drawing to the  *   surface, and calls to 'GpiBlitBlt' when drawing it on the screen  *   are performed in two different threads).  *  *   we use a simple mutex to do this.  *  *  * - we also use a semaphore to perform a rendez-vous between the  *   main and event-handling threads (needed in "listen_event").  *  ************************************************************************/  static  void  RunPMWindow( grPMSurface*  surface );  static  void  refresh_rectangle( grPMSurface* surface,                           int          x,                           int          y,                           int          w,                           int          h )  {    LOG(( "Os2PM: refresh_rectangle( %08lx, %d, %d, %d, %d )\n",          (long)surface, x, y, w, h ));    (void)x;    (void)y;    (void)w;    (void)h;    /*    convert_rectangle( surface, x, y, w, h );    */    LOCK( surface->image_lock );    GpiSetBitmapBits( surface->image_ps,                      0,                      surface->root.bitmap.rows,                      surface->root.bitmap.buffer,                      surface->bitmap_header );    UNLOCK( surface->image_lock );    WinInvalidateRect( surface->client_window, NULL, FALSE );    WinUpdateWindow( surface->frame_window );  }  static  void  set_title( grPMSurface* surface,                   const char*  title )  {    ULONG  rc;#if 1    LOG(( "Os2PM: set_title( %08lx == %08lx, %s )\n",             (long)surface, surface->client_window, title ));#endif    LOG(( "      -- frame         = %08lx\n",          (long)surface->frame_window ));    LOG(( "      -- client parent = %08lx\n",          (long)WinQueryWindow( surface->client_window, QW_PARENT ) ));    rc = WinSetWindowText( surface->client_window, (PSZ)title );    LOG(( "      -- returned rc = %ld\n",rc ));  }  static  void  listen_event( grPMSurface* surface,                      int          event_mask,                      grEvent*     grevent )  {    ULONG  ulRequestCount;    (void) event_mask;   /* ignored for now */    /* the listen_event function blocks until there is an event to process */    DosWaitEventSem( surface->event_lock, SEM_INDEFINITE_WAIT );    DosQueryEventSem( surface->event_lock, &ulRequestCount );    *grevent = surface->event;    DosResetEventSem( surface->event_lock, &ulRequestCount );    return;  }  static  grPMSurface*  init_surface( grPMSurface*  surface,                              grBitmap*     bitmap )  {    PBITMAPINFO2  bit;    SIZEL         sizl = { 0, 0 };    LONG          palette[256];    LOG(( "Os2PM: init_surface( %08lx, %08lx )\n",          (long)surface, (long)bitmap ));    LOG(( "       -- input bitmap =\n" ));    LOG(( "       --   mode   = %d\n", bitmap->mode ));    LOG(( "       --   grays  = %d\n", bitmap->grays ));    LOG(( "       --   width  = %d\n", bitmap->width ));    LOG(( "       --   height = %d\n", bitmap->rows ));    /* create the bitmap - under OS/2, we support all modes as PM */    /* handles all conversions automatically..                    */    if ( grNewBitmap( bitmap->mode,                      bitmap->grays,                      bitmap->width,                      bitmap->rows,                      bitmap ) )      return 0;    LOG(( "       -- output bitmap =\n" ));    LOG(( "       --   mode   = %d\n", bitmap->mode ));    LOG(( "       --   grays  = %d\n", bitmap->grays ));    LOG(( "       --   width  = %d\n", bitmap->width ));    LOG(( "       --   height = %d\n", bitmap->rows ));    bitmap->pitch = -bitmap->pitch;    surface->root.bitmap = *bitmap;    /* create the image and event lock */    DosCreateEventSem( NULL, &surface->event_lock, 0, TRUE  );    DosCreateMutexSem( NULL, &surface->image_lock, 0, FALSE );    /* create the image's presentation space */    surface->image_dc = DevOpenDC( gr_anchor,                                   OD_MEMORY, (PSZ)"*", 0L, 0L, 0L );    surface->image_ps = GpiCreatePS( gr_anchor,                                     surface->image_dc,                                     &sizl,                                     PU_PELS    | GPIT_MICRO |

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91福利社在线观看| 在线成人av网站| 久久综合狠狠综合久久综合88| 国产精品白丝jk白祙喷水网站| 国产亚洲人成网站| 欧美色精品在线视频| 国产一区二区三区香蕉 | 日韩美女久久久| 精品一区二区三区香蕉蜜桃| 久久毛片高清国产| 成人一级视频在线观看| 亚洲一区免费视频| 日本不卡中文字幕| 在线免费观看日韩欧美| 日韩不卡一区二区| 中文字幕 久热精品 视频在线 | 91精品国产高清一区二区三区| 欧美亚洲愉拍一区二区| 欧美亚洲综合一区| 欧美福利电影网| 成人一区在线看| 裸体一区二区三区| 日韩精品久久理论片| 中文字幕日韩精品一区| 久久精品欧美一区二区三区不卡 | 91精品在线一区二区| 久久久久久一二三区| 在线播放欧美女士性生活| 国产成人啪免费观看软件 | 777奇米四色成人影色区| 91精品在线观看入口| 久久午夜电影网| 国产精品视频线看| 亚洲激情校园春色| 麻豆成人久久精品二区三区小说| 国产一区二区免费视频| 不卡的av中国片| 欧美日韩国产美女| 久久久亚洲精品石原莉奈| 国产精品免费aⅴ片在线观看| 一区二区三区波多野结衣在线观看| 首页亚洲欧美制服丝腿| 欧美高清视频www夜色资源网| 欧美伊人久久久久久久久影院| 91麻豆精品国产无毒不卡在线观看| 欧美主播一区二区三区美女| 欧美日韩精品免费| 日韩欧美色综合| 亚洲人一二三区| 国产精品午夜在线观看| 成人免费一区二区三区在线观看| 日日摸夜夜添夜夜添亚洲女人| 极品美女销魂一区二区三区免费| 一区二区三区精品视频在线| 美女性感视频久久| 91免费看视频| 日韩精品一区二区三区视频播放 | 日韩精品亚洲一区| 亚洲国产中文字幕在线视频综合| 午夜欧美2019年伦理| 国产一区二区三区在线观看免费| 91丨九色porny丨蝌蚪| 欧美一区日本一区韩国一区| 国产精品视频一二三区| 亚洲老妇xxxxxx| 国产一区二区网址| 欧美老女人第四色| 国产精品免费网站在线观看| 麻豆成人综合网| 在线亚洲高清视频| 国产精品不卡视频| 国产精品一区在线观看乱码| 日韩午夜电影av| 亚洲福利一区二区三区| 欧美一区二区美女| 秋霞电影网一区二区| 香蕉成人啪国产精品视频综合网| 激情亚洲综合在线| 精品欧美久久久| 五月天激情小说综合| 欧美理论片在线| 欧美高清在线一区二区| 在线观看91精品国产入口| av午夜一区麻豆| 蜜臀av一级做a爰片久久| 日韩和欧美的一区| 北条麻妃一区二区三区| 亚洲与欧洲av电影| 欧美亚洲尤物久久| 丝袜诱惑制服诱惑色一区在线观看| 99久久夜色精品国产网站| 国产精品久久久久久久久晋中 | 国产精品乱码一区二三区小蝌蚪| 美洲天堂一区二卡三卡四卡视频| 99国产精品久久久久久久久久久 | 久久久久久日产精品| 欧美一区二区二区| 欧美高清视频一二三区 | 日韩情涩欧美日韩视频| 婷婷开心久久网| 欧美区在线观看| 日韩激情av在线| 精品视频在线视频| 亚洲国产裸拍裸体视频在线观看乱了| 91首页免费视频| 亚洲视频综合在线| 色婷婷精品大视频在线蜜桃视频| 欧美国产日本韩| 欧美大片一区二区| 免费国产亚洲视频| 日韩欧美一二三区| 国产原创一区二区三区| 久久久亚洲精品石原莉奈| 国产v综合v亚洲欧| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 91香蕉国产在线观看软件| 中文字幕亚洲视频| 色婷婷综合久久久久中文一区二区 | 成人毛片老司机大片| 国产精品区一区二区三区| 不卡一区二区在线| 亚洲激情图片qvod| 欧美日韩三级在线| 美腿丝袜亚洲一区| 久久久国产午夜精品| 不卡欧美aaaaa| 亚洲精品国产高清久久伦理二区| 欧洲一区二区三区在线| 视频一区视频二区中文字幕| 精品国产精品网麻豆系列| 福利视频网站一区二区三区| 国产精品久99| 欧美日韩综合不卡| 久久成人麻豆午夜电影| 国产日韩精品一区二区浪潮av| 99综合影院在线| 五月天亚洲精品| 精品国产一区久久| 中文字幕乱码久久午夜不卡 | 99re这里都是精品| 久久精品国产成人一区二区三区 | 国产精品一区二区在线观看不卡 | 午夜精品视频在线观看| 亚洲精品国产无套在线观| 亚洲人吸女人奶水| 色婷婷久久久久swag精品| 日韩电影在线观看电影| 久久久久久久综合| 91久久国产最好的精华液| 蜜臀久久99精品久久久久宅男| 国产日韩欧美亚洲| 欧美日韩激情一区二区三区| 国产一区二区三区| 亚洲高清免费在线| 久久久久88色偷偷免费| 欧美无乱码久久久免费午夜一区| 精品一区二区免费| 亚洲精品成人精品456| 久久综合色播五月| 欧美三级乱人伦电影| 成人午夜在线免费| 免费成人在线视频观看| 成人欧美一区二区三区白人 | 欧美精品自拍偷拍| 国产成人高清在线| 日本视频在线一区| 亚洲免费观看高清完整版在线| 精品日韩一区二区| 欧美三级日韩三级| 91网站在线播放| 国产精品亚洲一区二区三区妖精 | 一区二区三区精品视频| 精品美女一区二区三区| 日本高清不卡aⅴ免费网站| 国产麻豆精品在线观看| 日韩激情视频在线观看| 91久久精品国产91性色tv| 久久久久久久久97黄色工厂| 午夜欧美2019年伦理| 粉嫩在线一区二区三区视频| 欧美日韩电影一区| 国产精品久久久久国产精品日日| 精品在线视频一区| 欧美无乱码久久久免费午夜一区| 欧美精品一区二区三区久久久| 一区二区国产盗摄色噜噜| 国产成人av福利| 日韩欧美亚洲国产另类| 亚洲动漫第一页| 91理论电影在线观看| 欧美激情一区二区三区蜜桃视频 | 久久理论电影网| 日日摸夜夜添夜夜添精品视频| 精品国产露脸精彩对白 | 国产成a人亚洲精品| 欧美日韩国产综合一区二区三区 | 日日噜噜夜夜狠狠视频欧美人| 国产精品一品视频| 欧美一级高清片| 久久久久久**毛片大全|