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

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

?? gros2pm.c

?? freetype庫的應用demo,里面包含freetype的很多實例
?? C
?? 第 1 頁 / 共 2 頁
字號:
#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 |

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
风间由美性色一区二区三区| 色婷婷久久综合| 成人激情文学综合网| 9i在线看片成人免费| 91高清视频在线| 日韩精品专区在线影院观看| 国产欧美日韩精品在线| 爽爽淫人综合网网站| 免费成人性网站| 成人激情免费视频| 欧美精品久久99久久在免费线 | 欧美电影一区二区| 国产亚洲一区二区三区四区| 亚洲午夜电影在线观看| 精品在线一区二区三区| 99久久综合色| 亚洲精品一区在线观看| 亚洲美女偷拍久久| 国产91色综合久久免费分享| 欧美日韩一区二区欧美激情| 国产精品欧美精品| 精品中文字幕一区二区| 欧美日韩国产片| 成人欧美一区二区三区黑人麻豆| 麻豆成人免费电影| 欧美三级电影网| 亚洲欧美另类小说视频| 欧美一个色资源| 盗摄精品av一区二区三区| 欧美一区在线视频| 日韩在线播放一区二区| 欧美三级视频在线| 夜夜精品视频一区二区| 91亚洲男人天堂| 国产精品沙发午睡系列990531| 美女诱惑一区二区| 东方aⅴ免费观看久久av| 欧美精品1区2区| 亚洲激情六月丁香| 成人h版在线观看| 国产亚洲成av人在线观看导航| 日本三级亚洲精品| 欧美天天综合网| 一区二区三区在线影院| 99国产欧美另类久久久精品| 国产精品天美传媒沈樵| 国产精品羞羞答答xxdd| 欧美xxx久久| 久久精品国产网站| 精品久久久久久最新网址| 久久精品二区亚洲w码| 亚洲裸体xxx| 99视频有精品| 亚洲伊人伊色伊影伊综合网| 色国产综合视频| 亚洲一区在线视频观看| 欧美日韩久久久| 久久精品国产一区二区三区免费看| 欧美一区二区性放荡片| 午夜精品123| 日韩精品一区二区在线观看| 精品中文av资源站在线观看| 国产清纯白嫩初高生在线观看91| 国产99久久久久久免费看农村| 日韩女同互慰一区二区| 国产91综合网| 亚洲一区二区在线播放相泽| 欧美成人在线直播| 成人性色生活片免费看爆迷你毛片| 一色屋精品亚洲香蕉网站| 欧美日韩一区中文字幕| 国内精品免费**视频| 精品国产伦理网| 91在线高清观看| 极品少妇xxxx偷拍精品少妇| 精品剧情在线观看| 粉嫩在线一区二区三区视频| 专区另类欧美日韩| 欧美一级片免费看| 一本到不卡免费一区二区| 毛片基地黄久久久久久天堂| 欧美国产精品专区| 日韩欧美成人激情| 懂色av一区二区三区免费观看| 成人一区在线观看| 奇米一区二区三区av| 亚洲欧洲www| 国产精品久久久久久久久果冻传媒 | 成人亚洲精品久久久久软件| 日韩va欧美va亚洲va久久| 亚洲欧美影音先锋| 国产精品久久久久一区二区三区 | 亚洲视频免费看| 国产欧美日韩视频一区二区| 精品国产一区二区三区久久久蜜月| 97成人超碰视| 色综合久久中文字幕综合网| 岛国一区二区在线观看| 国产传媒欧美日韩成人| 黄一区二区三区| 美脚の诱脚舐め脚责91| 麻豆精品国产传媒mv男同| 日韩精品免费视频人成| 五月婷婷激情综合网| 日本不卡123| 日韩av中文在线观看| 国产一二精品视频| 精品综合久久久久久8888| 蜜臀av性久久久久蜜臀aⅴ四虎 | 欧美一区二区在线免费观看| 99v久久综合狠狠综合久久| 成人va在线观看| 欧洲av一区二区嗯嗯嗯啊| 欧美午夜一区二区三区免费大片| 精品视频一区二区三区免费| 69堂精品视频| 久久亚洲捆绑美女| 国产精品国模大尺度视频| 亚洲免费av高清| 麻豆成人久久精品二区三区红| 国内精品免费**视频| av亚洲精华国产精华精华| 91麻豆成人久久精品二区三区| 日本韩国视频一区二区| 欧美精品久久久久久久多人混战| 亚洲精品在线观看网站| 亚洲欧洲美洲综合色网| 午夜av一区二区| 国产成人午夜精品影院观看视频| 成人福利视频网站| 91国偷自产一区二区三区成为亚洲经典 | 欧美电影免费观看高清完整版 | 日韩av中文字幕一区二区三区| 国产麻豆午夜三级精品| 欧美亚州韩日在线看免费版国语版| 久久精子c满五个校花| 亚洲精品你懂的| 国产一区高清在线| 777a∨成人精品桃花网| 精品国产自在久精品国产| 伊人性伊人情综合网| 另类综合日韩欧美亚洲| 在线观看三级视频欧美| 久久久久久97三级| 日韩福利视频网| 欧美性淫爽ww久久久久无| 中文字幕一区二区三区精华液| 日本亚洲最大的色成网站www| 成人黄色国产精品网站大全在线免费观看| 欧美一区二区三区四区久久| 一区二区三区在线播放| 波多野结衣91| 国产精品国产三级国产aⅴ无密码| 久久99久久99精品免视看婷婷 | 欧美日韩另类一区| 亚洲乱码国产乱码精品精的特点 | 国产成人av一区| 国产午夜精品在线观看| 国产一区二区三区久久悠悠色av| 91精品麻豆日日躁夜夜躁| 夜夜嗨av一区二区三区网页| 91在线观看下载| 18成人在线观看| av在线一区二区三区| 亚洲人成精品久久久久久| 欧美亚洲国产bt| 精品亚洲aⅴ乱码一区二区三区| 精品电影一区二区三区| 97国产一区二区| 另类专区欧美蜜桃臀第一页| 欧美精品一区二区三区很污很色的 | 欧美国产日韩精品免费观看| 色综合久久六月婷婷中文字幕| 午夜精品视频在线观看| 2017欧美狠狠色| 欧美午夜不卡在线观看免费| 六月婷婷色综合| 亚洲一区二区在线免费观看视频 | 久久精品国产99久久6| 日韩美女久久久| 日韩精品一区二区三区中文不卡| 色综合久久久久综合99| 久久99精品视频| 婷婷一区二区三区| 国产精品女同互慰在线看| 91精品国产入口在线| 日本电影欧美片| 国产激情视频一区二区在线观看| 亚欧色一区w666天堂| 亚洲欧美日韩系列| 国产精品嫩草影院av蜜臀| 日韩精品一区二区三区三区免费| 欧美日韩第一区日日骚| 91猫先生在线| 99综合电影在线视频| 国产老女人精品毛片久久| 日韩精彩视频在线观看| 亚洲bt欧美bt精品777| 亚洲精品久久久久久国产精华液| 国产精品天美传媒沈樵|