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

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

?? grmac.c

?? Demo for Free type 2.2.1
?? C
字號:
/*******************************************************************
 *
 *  grmac.c  graphics driver for MacOS platform.
 *
 *  This is the driver for displaying inside a window under MacOS,
 *  used by the graphics utility of the FreeType test suite.
 *
 *  Largely written by Just van Rossum, but derived from grwin32.c.
 *  Copyright 1999-2000, 2004 by Just van Rossum, Antoine Leca,
 *  David Turner, Robert Wilhelm, and Werner Lemberg.
 *
 *  Borrowing liberally from the other FreeType drivers.
 *
 *  This file is part of the FreeType project, and may only be used
 *  modified and distributed under the terms of the FreeType project
 *  license, LICENSE.TXT. By continuing to use, modify or distribute
 *  this file you indicate that you have read the license and
 *  understand and accept it fully.
 *
 ******************************************************************/

/* ANSI C */
#include <string.h>

/* Mac Toolbox */
#include <MacWindows.h>

/* FT graphics subsystem */
#include "grobjs.h"
#include "grdevice.h"

#ifdef __MWERKS__
/* CodeWarrior's poor excuse for a console */
#include <SIOUX.h>
#endif

/*  Mac function key definitions. The 0x100 is a kludge, see listen_event(). */
#define        KEY_F1        (0x7A | 0x100)
#define        KEY_F2        (0x78 | 0x100)
#define        KEY_F3        (0x63 | 0x100)
#define        KEY_F4        (0x76 | 0x100)
#define        KEY_F5        (0x60 | 0x100)
#define        KEY_F6        (0x61 | 0x100)
#define        KEY_F7        (0x62 | 0x100)
#define        KEY_F8        (0x64 | 0x100)
#define        KEY_F9        (0x65 | 0x100)
#define        KEY_F10       (0x6D | 0x100)
#define        KEY_F11       (0x67 | 0x100)
#define        KEY_F12       (0x6F | 0x100)
#define        KEY_F13       (0x69 | 0x100)
#define        KEY_F14       (0x6B | 0x100)
#define        KEY_F15       (0x71 | 0x100)


/* Mac to FT key mapping */

  typedef struct  _Translator
  {
    short   mackey;
    grKey   grkey;

  } Translator;

  static
  Translator  key_translators[] =
  {
    { kBackspaceCharCode,   grKeyBackSpace },
    { kTabCharCode,         grKeyTab       },
    { kReturnCharCode,      grKeyReturn    },
    { kEscapeCharCode,      grKeyEsc       },
    { kHomeCharCode,        grKeyHome      },
    { kLeftArrowCharCode,   grKeyLeft      },
    { kUpArrowCharCode,     grKeyUp        },
    { kRightArrowCharCode,  grKeyRight     },
    { kDownArrowCharCode,   grKeyDown      },
    { kPageUpCharCode,      grKeyPageUp    },
    { kPageDownCharCode,    grKeyPageDown  },
    { kEndCharCode,         grKeyEnd       },
    { kHelpCharCode,        grKeyF1        }, /* map Help key to F1... */
    { KEY_F1,               grKeyF1        },
    { KEY_F2,               grKeyF2        },
    { KEY_F3,               grKeyF3        },
    { KEY_F4,               grKeyF4        },
    { KEY_F5,               grKeyF5        },
    { KEY_F6,               grKeyF6        },
    { KEY_F7,               grKeyF7        },
    { KEY_F8,               grKeyF8        },
    { KEY_F9,               grKeyF9        },
    { KEY_F10,              grKeyF10       },
    { KEY_F11,              grKeyF11       },
    { KEY_F12,              grKeyF12       }
  };


  /* This is a minimalist driver, it is only able to display */
  /* a _single_ window. Moreover, only monochrome and gray   */
  /* bitmaps are supported..                                 */

  /* pointer to the window. */
  static WindowPtr   theWindow = NULL;

  /* the pixmap */
  static PixMap thePixMap;


  /* destroys the window */
  static
  void done_window(  )
  {
    if ( theWindow )
    {
      DisposeWindow ( theWindow );
    }
    theWindow = NULL;
  }

  /* destroys the surface*/
  static
  void done_surface( grSurface*  surface )
  {
    /* ick! this never gets called... */
    done_window();
    grDoneBitmap( &surface->bitmap );
  }

  static
  void  refresh_rectangle( grSurface*  surface,
                           int         x,
                           int         y,
                           int         w,
                           int         h )
  {
    Rect bounds;
    SetRect( &bounds, x, y, x+w, y+h );
    if ( theWindow ) {
      GrafPtr windowPort = GetWindowPort(theWindow);
      RgnHandle visRgn = GetPortVisibleRegion(windowPort, NewRgn());
      SetPort(windowPort);
      CopyBits( (BitMap*)&thePixMap, GetPortBitMapForCopyBits(windowPort),
                &bounds, &bounds, srcCopy, visRgn);
      DisposeRgn(visRgn);
  }
  }

  static
  void set_title( grSurface* surface, const char* title )
  {
    Str255 pTitle;
    strcpy( (char*)pTitle+1, title );
    pTitle[0] = strlen( title );
    if ( theWindow )
        SetWTitle( theWindow, pTitle );
  }

  static
  void listen_event( grSurface*  surface,
                     int         event_mask,
                     grEvent*    grevent )
  {
    grEvent  our_grevent;
    EventRecord mac_event;

    our_grevent.type = gr_event_none;
    our_grevent.key = grKeyNone;

    for ( ;; )
    /* The event loop. Sorry, but I'm too lazy to split the various events
       to proper event handler functions. This whole app is rather ad hoc
       anyway, so who cares ;-) */
    {
      if ( WaitNextEvent( everyEvent, &mac_event, 10, NULL ) )
      {
        switch ( mac_event.what )
        {
        case autoKey:
        case keyDown:
          {
            int           count = sizeof( key_translators ) / sizeof( key_translators[0] );
            Translator*   trans = key_translators;
            Translator*   limit = trans + count;
            short         char_code;

            char_code = mac_event.message & charCodeMask;
            if ( char_code == kFunctionKeyCharCode )
                /* Le kluge. Add a flag to differentiate the F-keys from normal keys. */
                char_code = 0x100 | ((mac_event.message & keyCodeMask) >> 8);

            our_grevent.key = char_code;

            for ( ; trans < limit; trans++ )
              /* see if the key maps to a special "gr" key */
              if ( char_code == trans->mackey )
              {
                our_grevent.key = trans->grkey;
              }
              our_grevent.type = gr_event_key;
            }
            if ( our_grevent.key == grKEY('q') || our_grevent.key == grKeyEsc )
              /* destroy the window here, since done_surface() doesn't get called */
              done_window();
            *grevent = our_grevent;
            return;
          case updateEvt:
            if ( theWindow && (WindowPtr)mac_event.message == theWindow )
            {
              SetPortWindowPort( theWindow );
              BeginUpdate( theWindow );
              refresh_rectangle( surface,
                                 0, 0,
                                 thePixMap.bounds.right, thePixMap.bounds.bottom );
              EndUpdate( theWindow );
            }
#ifdef __MWERKS__
            else
            {
              SIOUXHandleOneEvent( &mac_event );
            }
#endif
            break;
          case mouseDown:
            {
              short part;
              WindowPtr wid;

              part = FindWindow( mac_event.where, &wid );
              if ( wid == theWindow )
              {
                if ( theWindow && part == inDrag) {
#if TARGET_API_MAC_CARBON
#define screenBounds NULL
#else
                  Rect *screenBounds = &qd.screenBits.bounds;
#endif
                  DragWindow( wid, mac_event.where, screenBounds);
                }
                else if (part == inGoAway)
                {
                  if ( TrackGoAway( theWindow, mac_event.where ) )
                  {
                    /* The user clicked the window away, emulate quit event */
                    done_window();
                    our_grevent.type = gr_event_key;
                    our_grevent.key = grKeyEsc;
                    *grevent = our_grevent;
                    return;
                  }
                }
                else if (part == inContent)
                {
                  SelectWindow( theWindow );
                }
              }
#ifdef __MWERKS__
              else
              {
                SIOUXHandleOneEvent( &mac_event );
              }
#endif
            }
            break;
          default:
            InitCursor();
            break;
          }
        }
    }
  }


static
grSurface*  init_surface( grSurface*  surface,
                          grBitmap*   bitmap )
{
  PixMapPtr pixMap = &thePixMap;

  Rect bounds;
  SetRect(&bounds, 0, 0, bitmap->width, bitmap->rows);

  switch (bitmap->mode)
  {
  case gr_pixel_mode_rgb24:
    bitmap->mode = gr_pixel_mode_rgb32;
    break;

  default:
    bitmap->mode = gr_pixel_mode_mono;
    bitmap->grays = 0;
    break;
  }

  /* create the bitmap - under MacOS, we support all modes as the GDI */
  /* handles all conversions automatically..                          */
  if ( grNewBitmap( bitmap->mode,
                    bitmap->grays,
                    bitmap->width,
                    bitmap->rows,
                    bitmap ) )
    return 0;

  surface->bitmap = *bitmap;

  /* initialize the PixMap to appropriate values */
  pixMap->baseAddr = (char*)bitmap->buffer;
  pixMap->rowBytes = bitmap->pitch;
  if (pixMap->rowBytes < 0)
     pixMap->rowBytes = -pixMap->rowBytes;
  pixMap->rowBytes |= 0x8000; /* flag indicating it's a PixMap, not a BitMap */
  pixMap->bounds = bounds;
  pixMap->pmVersion = baseAddr32; /* pixmap base address is 32-bit address */
  pixMap->packType = 0;
  pixMap->packSize = 0;
  pixMap->hRes = 72 << 16;
  pixMap->vRes = 72 << 16;
  pixMap->pmTable = 0;
#if OLDPIXMAPSTRUCT
  pixMap->planeBytes = 0;
  pixMap->pmReserved = 0;
#else
  pixMap->pixelFormat = 0;
  pixMap->pmExt = 0;
#endif

  switch ( bitmap->mode )
  {
  case gr_pixel_mode_mono:
  case gr_pixel_mode_gray:

    pixMap->pixelType = 0;   /* indexed color */
    pixMap->cmpCount = 1;

    if (bitmap->mode == gr_pixel_mode_mono)
    {
      pixMap->pixelSize = 1;
    }
    else
    {
      pixMap->pixelSize = 8;
      pixMap->pmTable = GetCTable(256); /* color palette matching FT's idea */
      break;                            /* of grayscale. See ftview.rsrc */
    }
    pixMap->cmpSize = pixMap->pixelSize;
    break;

  case gr_pixel_mode_rgb32:
    pixMap->pixelSize = 32;
    pixMap->pixelType = RGBDirect;
    pixMap->cmpCount = 3;
    pixMap->cmpSize = 8;
    pixMap->baseAddr -= 1;  /*SHH: goofy hack to reinterpret bitmap's RGBx -> xRGB */
    break;

  default:
    return 0;    /* Unknown mode */
  }

  /* create the window */
  OffsetRect(&bounds, 10, 44); /* place it at a decent location */
  theWindow = NewCWindow(NULL, &bounds, "\p???", 1, 0, (WindowRef)-1, 1, 0);

  /* fill in surface interface */
  surface->done         = (grDoneSurfaceFunc) done_surface;
  surface->refresh_rect = (grRefreshRectFunc) refresh_rectangle;
  surface->set_title    = (grSetTitleFunc)    set_title;
  surface->listen_event = (grListenEventFunc) listen_event;

  return surface;
}


  static int init_device( void )
  {
    return 0;
  }

  static void done_device( void )
  {
    /* won't get called either :-( */
  }

  grDevice  gr_mac_device =
  {
    sizeof( grSurface ),
    "mac",

    init_device,
    done_device,

    (grDeviceInitSurfaceFunc) init_surface,

    0,
    0
  };


/* End */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美日韩一区二区三区在线观看| 亚洲不卡在线观看| 一区二区在线观看免费| 亚洲丶国产丶欧美一区二区三区| 免费人成在线不卡| 懂色av噜噜一区二区三区av| 在线视频欧美区| 精品日韩在线一区| 一区二区三区在线视频播放| 美女在线观看视频一区二区| 99久久久精品免费观看国产蜜| 欧美日韩电影一区| 国产精品国产自产拍高清av王其| 青娱乐精品在线视频| 欧美日韩中文字幕一区二区| 中文字幕亚洲一区二区av在线| 国产毛片精品一区| 欧美大白屁股肥臀xxxxxx| 男女性色大片免费观看一区二区| 日本精品裸体写真集在线观看 | 国产亚洲精品精华液| 日日嗨av一区二区三区四区| 色婷婷一区二区| 亚洲男人的天堂av| 91玉足脚交白嫩脚丫在线播放| 中文av一区二区| 丁香六月久久综合狠狠色| 欧美极品美女视频| 成人精品免费网站| 亚洲欧洲国产日本综合| 成人黄色片在线观看| 国产精品久久久久久久久免费丝袜| 国产一区欧美二区| 中文字幕的久久| 99久久综合狠狠综合久久| 国产精品天干天干在观线| 成人一区二区三区视频| 中文字幕欧美一| 色拍拍在线精品视频8848| 亚洲最新在线观看| 欧美三级日韩三级国产三级| 日韩激情av在线| 欧美一二三区在线| 国产精品资源在线看| 欧美国产精品劲爆| 在线影视一区二区三区| 亚洲成人1区2区| 欧美tk—视频vk| www.亚洲精品| 午夜精品免费在线| 精品国产乱码久久久久久1区2区| 国产成人精品亚洲午夜麻豆| 国产精品的网站| 欧美情侣在线播放| 狠狠色丁香久久婷婷综合_中| 国产欧美日韩麻豆91| 色婷婷精品久久二区二区蜜臂av | 久久97超碰色| 综合久久综合久久| 51精品久久久久久久蜜臀| 狠狠久久亚洲欧美| 亚洲激情中文1区| 日韩欧美激情四射| 成人av小说网| 老色鬼精品视频在线观看播放| 国产欧美一区二区精品秋霞影院| 在线观看欧美精品| 看国产成人h片视频| ●精品国产综合乱码久久久久| 9191国产精品| 色综合久久久久综合体桃花网| 视频在线观看一区| 综合色天天鬼久久鬼色| 日韩免费高清电影| 色94色欧美sute亚洲13| 国产一区999| 日韩高清在线观看| 伊人色综合久久天天人手人婷| 日韩丝袜情趣美女图片| 色综合久久天天| 国产乱码精品1区2区3区| 亚洲午夜私人影院| 中文字幕久久午夜不卡| 日韩一二三区不卡| 欧美性淫爽ww久久久久无| 国产电影精品久久禁18| 日韩**一区毛片| 一区二区三区中文字幕精品精品 | 国产69精品久久久久777| 日韩—二三区免费观看av| 亚洲免费在线视频| 国产午夜精品在线观看| 精品福利视频一区二区三区| 欧美视频完全免费看| 92国产精品观看| 国产精品影视网| 久久99在线观看| 日韩中文字幕麻豆| 亚洲国产视频一区| 一区二区三区视频在线观看| 久久天堂av综合合色蜜桃网| 日韩视频免费观看高清完整版| 精品视频免费在线| 在线免费观看日本欧美| 99精品视频在线观看| 成人免费视频caoporn| 国产精品一品二品| 国产精品资源在线| 国产不卡高清在线观看视频| 激情综合亚洲精品| 久久se这里有精品| 久久爱另类一区二区小说| 久久se这里有精品| 狠狠色丁香婷婷综合| 国产一区二区三区免费播放| 麻豆精品久久久| 国产真实乱子伦精品视频| 美国一区二区三区在线播放| 美女一区二区视频| 国产自产视频一区二区三区| 国产麻豆成人精品| 国产成人精品综合在线观看| 成人亚洲精品久久久久软件| 成人av电影免费观看| 一本到三区不卡视频| 色综合色综合色综合| 日本高清不卡aⅴ免费网站| 欧美性受xxxx黑人xyx| 欧美日韩精品三区| 精品国产髙清在线看国产毛片| 久久人人爽爽爽人久久久| 国产拍揄自揄精品视频麻豆| 一区二区中文字幕在线| 亚洲精品国产第一综合99久久| 亚洲一卡二卡三卡四卡五卡| 蜜桃传媒麻豆第一区在线观看| 麻豆国产91在线播放| 成人午夜激情影院| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 欧美日韩高清在线| 久久综合色综合88| 综合亚洲深深色噜噜狠狠网站| 亚洲图片自拍偷拍| 精品一区二区免费| 91免费看`日韩一区二区| 欧美日本韩国一区二区三区视频| xvideos.蜜桃一区二区| 综合欧美一区二区三区| 美女国产一区二区| 91首页免费视频| 亚洲精品在线三区| 亚洲午夜久久久| 国产美女精品人人做人人爽| 9191成人精品久久| 成人欧美一区二区三区黑人麻豆 | 成人aaaa免费全部观看| 欧美精选在线播放| 国产视频在线观看一区二区三区| 亚洲成人激情综合网| 成人动漫一区二区三区| 日韩一区二区三区免费看| 国产精品理伦片| 久久99精品久久只有精品| 在线观看日韩一区| 国产精品国产精品国产专区不蜜| 免费观看在线综合色| 欧美中文字幕一区| 亚洲国产精品精华液ab| 久久成人18免费观看| 欧美三区在线视频| 亚洲欧美电影一区二区| 国产在线播放一区| 欧美一区二区三区爱爱| 亚洲精品福利视频网站| 成人一级片网址| 久久精品亚洲国产奇米99| 美腿丝袜在线亚洲一区| 欧美日韩在线播放| 亚洲综合色在线| 99精品视频一区二区| 中文字幕 久热精品 视频在线| 蜜桃视频第一区免费观看| 欧美日韩亚洲综合在线| 一区二区三区在线观看欧美| 国产一区二区三区在线观看精品 | 国产视频一区在线观看| 精品在线亚洲视频| 日韩一卡二卡三卡国产欧美| 午夜视频在线观看一区二区| 91麻豆国产福利在线观看| 18成人在线观看| 色综合天天综合网天天狠天天| 中文字幕不卡一区| 99久久伊人精品| 亚洲美女一区二区三区| 欧洲av在线精品| 日韩精品成人一区二区在线| 欧美视频在线一区二区三区 | 色综合久久中文综合久久牛| 成人免费在线播放视频|