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

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

?? xdriver.c

?? 一個占星術算命游戲
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*
** Astrolog (Version 4.00) File: xdriver.c
**
** IMPORTANT NOTICE: the graphics database and chart display routines
** used in this program are Copyright (C) 1991-1993 by Walter D. Pullen
** (cruiser1@stein.u.washington.edu). Permission is granted to freely
** use and distribute these routines provided one doesn't sell,
** restrict, or profit from them in any way. Modification is allowed
** provided these notices remain with any altered or edited versions of
** the program.
**
** The main planetary calculation routines used in this program have
** been Copyrighted and the core of this program is basically a
** conversion to C of the routines created by James Neely as listed in
** Michael Erlewine's 'Manual of Computer Programming for Astrologers',
** available from Matrix Software. The copyright gives us permission to
** use the routines for personal use but not to sell them or profit from
** them in any way.
**
** The PostScript code within the core graphics routines are programmed
** and Copyright (C) 1992-1993 by Brian D. Willoughby
** (brianw@sounds.wa.com). Conditions are identical to those above.
**
** The extended accurate ephemeris databases and formulas are from the
** calculation routines in the program "Placalc" and are programmed and
** Copyright (C) 1989,1991,1993 by Astrodienst AG and Alois Treindl
** (alois@azur.ch). The use of that source code is subject to
** regulations made by Astrodienst Zurich, and the code is not in the
** public domain. This copyright notice must not be changed or removed
** by any user of this program.
**
** Initial programming 8/28,30, 9/10,13,16,20,23, 10/3,6,7, 11/7,10,21/1991.
** X Window graphics initially programmed 10/23-29/1991.
** PostScript graphics initially programmed 11/29-30/1992.
** Last code change made 12/31/1993.
*/

#include "astrolog.h"

#ifdef GRAPH

#ifdef X11
/* Size of the Astrolog X11 icon. These values are defined in xdata.c too. */

#define icon_width 63
#define icon_height 32
#endif

#ifdef MSG
/* PC specific global variables. */

int hiresmode = DEFHIRESMODE;    /* 'High-resolution' graphics mode. */
int loresmode = DEFLORESMODE;    /* 'Flicker-free' graphics mode.    */
int xscreen   = -1000;           /* Current graphics mode.           */
struct videoconfig config;       /* State of current graphics mode.  */
#endif


/*
******************************************************************************
** Interactive Screen Graphics Routines.
******************************************************************************
*/

#ifdef X11
/* Allocate a color from the present colormap. Given a string like "red" or */
/* "blue" allocate this color and return a value specifying it.             */

colrgb XMakeColor(name)
char *name;
{
  XColor col;
  XParseColor(disp, cmap, name, &col);
  XAllocColor(disp, cmap, &col);
  return col.pixel;
}
#endif


/* Set up all the colors used by the program, i.e. the foreground and   */
/* background colors, and all the colors in the object arrays, based on */
/* whether or not we are in monochrome and/or reverse video mode.       */

void XColorInit()
{
  int i;

#ifdef X11
  if (!xfile) {
    cmap = XDefaultColormap(disp, screen);
    for (i = 0; i < 16; i++)
      rgbind[i] = XMakeColor(rgbname[i]);
  }
#endif
  on  = mainansi[!xreverse];
  off = mainansi[xreverse];
  hilite = xcolor ? mainansi[2+xreverse] : on;
  gray   = xcolor ? mainansi[3-xreverse] : on;
  for (i = 0; i <= 6; i++)
    maincolor[i]    = xcolor ? mainansi[i]    : on;
  for (i = 0; i <= 7; i++)
    rainbowcolor[i] = xcolor ? rainbowansi[i] : on;
  for (i = 0; i < 4; i++)
    elemcolor[i]    = xcolor ? elemansi[i]    : on;
  for (i = 0; i <= ASPECTS; i++)
    aspectcolor[i]  = xcolor ? aspectansi[i]  : on;
  for (i = 0; i <= total; i++)
    objectcolor[i]  = xcolor ? objectansi[i]  : on;
#ifdef X11
  if (!xfile) {
    XSetBackground(disp, gc,   rgbind[off]);  /* Initialize X window colors. */
    XSetForeground(disp, pmgc, rgbind[off]);
  }
#endif
}


#ifdef ISG
/* This routine opens up and initializes a window and prepares it to be */
/* drawn upon, and gets various information about the display, too.     */

void XBegin()
{
#ifdef X11
  disp = XOpenDisplay(dispname);
  if (!disp) {
    PrintError("Can't open display.");
    Terminate(_FATAL);
  }
  screen = DefaultScreen(disp);
  bg = BlackPixel(disp, screen);
  fg = WhitePixel(disp, screen);
  hint.x = offsetx; hint.y = offsety;
  hint.width = chartx; hint.height = charty;
  hint.min_width = BITMAPX1; hint.min_height = BITMAPY1;
  hint.max_width = BITMAPX;  hint.max_height = BITMAPY;
  hint.flags = PPosition | PSize | PMaxSize | PMinSize;
#if FALSE
  wmhint = XGetWMHints(disp, window);
  wmhint->input = True;
  XSetWMHints(disp, window, wmhint);
#endif
  depth = DefaultDepth(disp, screen);
  if (depth < 5) {
    xmono = TRUE;      /* Is this a monochrome monitor? */
    xcolor = FALSE;
  }
  root = RootWindow(disp, screen);
  if (xroot)
    window = root;     /* If -XB in effect, we'll use the root window. */
  else
    window = XCreateSimpleWindow(disp, DefaultRootWindow(disp),
      hint.x, hint.y, hint.width, hint.height, 5, fg, bg);
  pixmap = XCreatePixmap(disp, window, chartx, charty, depth);
  icon = XCreateBitmapFromData(disp, DefaultRootWindow(disp),
    icon_bits, icon_width, icon_height);
  if (!xroot)
    XSetStandardProperties(disp, window, appname, appname, icon,
      (char PTR PTR)xkey, 0, &hint);

  /* We have two graphics workareas. One is what the user currently sees in */
  /* the window, and the other is what we are currently drawing on. When    */
  /* done, we can quickly copy this to the viewport for a smooth look.      */

  gc = XCreateGC(disp, window, 0, 0);
  XSetGraphicsExposures(disp, gc, 0);
  pmgc = XCreateGC(disp, window, 0, 0);
  XColorInit();                            /* Go set up colors. */
  if (!xroot)
    XSelectInput(disp, window, KeyPressMask | StructureNotifyMask |
      ExposureMask | ButtonPressMask | ButtonReleaseMask | ButtonMotionMask);
  XMapRaised(disp, window);
  XSync(disp, 0);
  XFillRectangle(disp, pixmap, pmgc, 0, 0, chartx, charty);

#else /* MSG */

  if (!IsValidResmode(xscreen))    /* Initialize graphics mode to hi-res. */
    xscreen = hiresmode;
  _setvideomode(xscreen);
  if (_grstatus()) {
    PrintError("Can't enter graphics mode.");
    Terminate(_FATAL);
  }
  _getvideoconfig((struct videoconfig far *) &config);
  if (config.numcolors < 16) {
    xmono = TRUE;
    xcolor = FALSE;
  }
  _remapallpalette((long FAR *) rgb);
  _setactivepage(0);
  _setvisualpage(0);
  XColorInit();
#ifdef MOUSE
  if (MouseInit() > 0)
    SetPtrVis(SHOW);
#endif
  textrows = abs(textrows);    /* Make sure we reset textrows upon restart. */
#endif /* MSG */
}


/* Add a certain amount of time to the current hour/day/month/year quantity */
/* defining the present chart. This is used by the chart animation feature. */
/* We can add or subtract anywhere from 1 to 9 seconds, minutes, hours,     */
/* days, months, years, decades, centuries, or millenia in any one call.    */
/* This is mainly just addition to the appropriate quantity, but we have    */
/* to check for overflows, e.g. Dec 30 + 3 days = Jan 2 of Current year + 1 */

void AddTime(mode, toadd)
int mode, toadd;
{
  int d;
  real h, m;

  h = floor(TT);
  m = FRACT(TT)*100.0;
  if (mode == 1)
    m += 1.0/60.0*(real)toadd;    /* Add seconds. */
  else if (mode == 2)
    m += (real)toadd;             /* add minutes. */

  /* Add hours, either naturally or if minute value overflowed. */

  if (m < 0.0 || m >= 60.0 || mode == 3) {
    if (m >= 60.0) {
      m -= 60.0; toadd = SGN(toadd);
    } else if (m < 0.0) {
      m += 60.0; toadd = SGN(toadd);
    }
    h += (real)toadd;
  }

  /* Add days, either naturally or if hour value overflowed. */

  if (h >= 24.0 || h < 0.0 || mode == 4) {
    if (h >= 24.0) {
      h -= 24.0; toadd = SGN(toadd);
    } else if (h < 0.0) {
      h += 24.0; toadd = SGN(toadd);
    }
    DD += toadd;
  }

  /* Add months, either naturally or if day value overflowed. */

  if (DD > (d = DayInMonth(MM, YY)) || DD < 1 || mode == 5) {
    if (DD > d) {
      DD -= d; toadd = SGN(toadd);
    } else if (DD < 1) {
      DD += DayInMonth(Mod12(MM - 1), YY);
      toadd = SGN(toadd);
    }
    MM += toadd;
  }

  /* Add years, either naturally or if month value overflowed. */

  if (MM > 12 || MM < 1 || mode == 6) {
    if (MM > 12) {
      MM -= 12; toadd = SGN(toadd);
    } else if (MM < 1) {
      MM += 12; toadd = SGN(toadd);
    }
    YY += toadd;
  }
  if (mode == 7)
    YY += 10 * toadd;      /* Add decades.   */
  else if (mode == 8)
    YY += 100 * toadd;     /* Add centuries. */
  else if (mode == 9)
    YY += 1000 * toadd;    /* Add millenia.  */
  TT = h+m/100.0;          /* Recalibrate hour time. */
}


/* Animate the current chart based on the given values indicating how much  */
/* to update by. We update and recast the current chart info appropriately. */

void Animate(mode, toadd)
int mode, toadd;
{
  if (modex == MODEW || modex == MODEG || modex == MODEP) {
    degree += toadd;
    if (degree >= DEGR)     /* For animating globe display, add */
      degree -= DEGR;       /* in appropriate degree value.     */
    else if (degree < 0)
      degree += DEGR;
  } else {
    if (mode == 10) {
#ifdef TIME
      /* For the continuous chart update to present moment */
      /* animation mode, go get whatever time it is now.   */
      InputData("now");
#else
      SetCore(Mon, Day, Yea, Tim, Zon, Lon, Lat);
      AddTime(1, toadd);
#endif
    } else {  /* Otherwise add on appropriate time vector to chart info. */
      SetCore(Mon, Day, Yea, Tim, Zon, Lon, Lat);
      AddTime(mode, toadd);
    }
    SetMain(MM, DD, YY, TT, ZZ, OO, AA);
    if (relation)
      CastRelation(FALSE);
    else
      CastChart(TRUE);
  }
}


/* Print a list of every key that one can press in an X window to do a */
/* certain function, and a description of what it does. This list gets */
/* displayed whenever one presses the 'H' or '?' key in the window.    */

void XDisplayKeys()
{
  char string[STRING];

  sprintf(string, "\n%s window keypress options (version %s):", appname,
    VERSION);
  Prints(string);
  Prints(" Press 'H' or '?' to display this list of key options.");
  Prints(" Press 'p' to toggle pause status on or off.");
  Prints(" Press 'x' to toggle fg/bg colors on screen.");
  Prints(" Press 'm' to toggle color/monochrome display on screen.");
  Prints(" Press 'i' to toggle status of the minor chart modification.");
  Prints(" Press 'T' to toggle header info on current chart on screen.");
  Prints(" Press 'b' to toggle drawing of a border around the chart.");
  Prints(" Press 'l' to toggle labeling of object points in chart.");
  Prints(" Press 'v' to display current chart positions on text screen.");
  Prints(" Press 'R', 'C', 'u', 'U' to toggle restriction status of minor");
  Prints("       objects, minor house cusps, uranian planets, and stars.");
  Prints(" Press 'c' to toggle relationship comparison chart mode.");
  Prints(" Press 's', 'h', 'f', 'F' to toggle status of sidereal zodiac,");
  Prints("       heliocentric charts, domal charts, and decan charts.");
  Prints(" Press 'O' and 'o' to recall/store a previous chart from memory.");
#ifdef X11
  Prints(" Press 'B' to dump current window contents to root background.");
#else
  Prints(" Press 'B' to resize chart display to full size of screen.");
#endif
  Prints(" Press 'Q' to resize chart display to a square.");
  Prints(" Press '<' and '>' to decrease/increase the scale size of the");
  Prints("       glyphs and the size of world map.");
  Prints(" Press '[' and ']' to decrease/increase tilt in globe display.");
  Prints(" Press '+' and '-' to add/subtract a day from current chart.");
#ifdef TIME
  Prints(" Press 'n' to set chart information to current time now.");
#endif
  Prints(" Press 'N' to toggle animation status on or off. Charts will");
  Prints("       be updated to current status and globe will rotate.");
  Prints(" Press '!'-'(' to begin updating current chart by adding times.");
  Prints("       !: seconds, @: minutes, #: hours, $: days, %: months,");
  Prints("       ^: years, &: years*10, *: years*100, (: years*1000.");
  Prints(" Press 'r' to reverse direction of time-lapse or animation.");
  Prints(" Press '1'-'9' to set rate of animation to 'n' degrees, etc.");
#ifdef MSG
  Prints(" Press '1'-'9' to determine section of chart to show if clipped.");
#endif
  Prints(
    " Press 'V','L','A','Z','S','E','W','G','P' to switch to normal (_v),");
  Prints(
    "       astro-graph (_L), grid (_g), local (_Z), space (_S), ephemeris");
  Prints("       (_E), world map (_XW), globe (_XG), and polar (_XP) modes.");
  Prints(" Press '0' to toggle between _Z,_Z0 & _XW,_XW0 & _E,_Ey modes.");
  Prints(" Press 'space' to force update of current graphics display.");
#ifdef MSG
  Prints(" Press 'tab' to toggle between graphics resolutions.");
#endif
  Prints(" Press 'q' to terminate the window and program.");
#ifdef MOUSE
  printl();
#ifdef X11
  Prints(" Left   mouse button: Draw line strokes on chart in window.");
  Prints(" Middle mouse button: Print coordinates of pointer on world map.");
  Prints(" Right  mouse button: Terminate the window and program.");
#endif
#ifdef MSG
  Prints(" Left  mouse button: Draw line strokes on chart in screen.");
  Prints(" Right mouse button: Set coordinates to pointer on world map.");
#endif
#endif /* MOUSE */
}


/* This routine gets called after an X window is brought up and displayed   */
/* on the screen. It loops, processing key presses, mouse clicks, etc, that */
/* the window receives, until the user specifies they want to exit program. */

void XSpin()
{
#ifdef X11
  XEvent event;
  int xresize = FALSE, xredraw = TRUE;
#else
#ifdef MOUSE
  EVENT event;
#endif
  int xresize = TRUE, xredraw = FALSE;
#endif
  int xbreak = FALSE, xpause = FALSE, xcast = FALSE, xcorner = 7,
    buttonx = -1, buttony = -1, dir = 1, length, i;
  colpal coldrw = hilite;

  xnow = -xnow;
  while (!xbreak) {

    /* Some chart windows, like the world maps and aspect grids, should */
    /* always be a certian size, so correct if a resize was attempted.  */

    if (modex == MODEL || modex == MODEW) {
      length = DEGR*SCALE+2;
      if (chartx != length) {
        chartx = length;
        xresize = TRUE;
      }
      length = (90*2+1)*SCALE+2;
      if (charty != length) {
        charty = length;
        xresize = TRUE;
      }
    } else if (modex == MODEg) {
      if (chartx !=
        (length = (gridobjects + (relation <= DASHr0))*CELLSIZE*SCALE+1)) {
        chartx = length;
        xresize = TRUE;
      } if (charty != length) {
        charty = length;
        xresize = TRUE;
      }

    /* Make sure the window isn't too large or too small. */

    } else {
	    if (chartx < BITMAPX1) {
	      chartx = BITMAPX1;
	      xresize = TRUE;
	    } else if (chartx > BITMAPX) {
	      chartx = BITMAPX;
	      xresize = TRUE;
	    }
	    if (charty < BITMAPY1) {
	      charty = BITMAPY1;
	      xresize = TRUE;
	    } else if (charty > BITMAPY) {
	      charty = BITMAPY;
	      xresize = TRUE;
	    }
		}

    /* If in animation mode, ensure we are in the flicker free resolution. */

    if (xnow < 0) {
      xnow = -xnow;
#ifdef MSG
      if (xscreen == hiresmode) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
秋霞国产午夜精品免费视频| 99这里只有久久精品视频| 久热成人在线视频| 91原创在线视频| 26uuu国产一区二区三区| 亚洲一区二区三区美女| 国产成人免费高清| 91精品国产福利在线观看 | 99re热视频精品| 欧美xfplay| 午夜精品久久久久久久久| 99re6这里只有精品视频在线观看| 欧美肥胖老妇做爰| 一区二区三区高清不卡| www.欧美色图| 国产日韩av一区二区| 久久国产综合精品| 日韩一区二区三区在线视频| 亚洲国产精品久久久男人的天堂| 色女孩综合影院| 亚洲欧美在线高清| aaa欧美大片| 国产精品污网站| 成人av网址在线观看| 国产亚洲欧美在线| 国产一区91精品张津瑜| 日韩欧美在线网站| 男女男精品视频| 精品国产一区二区精华| 久久se精品一区精品二区| 日韩你懂的电影在线观看| 另类专区欧美蜜桃臀第一页| 欧美一区二区视频在线观看| 日本欧美一区二区| 精品欧美久久久| 成人一区二区三区视频在线观看| 欧美激情在线看| 99久久亚洲一区二区三区青草| 国产精品免费网站在线观看| 99久久婷婷国产综合精品电影 | 色网站国产精品| 亚洲私人影院在线观看| 91在线国内视频| 亚洲码国产岛国毛片在线| 欧美视频在线一区二区三区 | 一区二区久久久久| 欧美在线视频全部完| 午夜视频在线观看一区| 欧美一区二区三区的| 国产一区二区三区日韩| 国产精品无遮挡| 欧美老肥妇做.爰bbww视频| 日本伊人色综合网| 久久久久久久一区| 91福利国产成人精品照片| 午夜精品久久久久久不卡8050| 欧美一区二区人人喊爽| 国产最新精品免费| 亚洲男人电影天堂| 91精品国产一区二区三区蜜臀| 激情小说欧美图片| 一区二区三区欧美| 欧美成人免费网站| 日韩女优制服丝袜电影| 国产一区二区三区av电影 | 91丨九色porny丨蝌蚪| 亚洲国产一区二区三区青草影视| 欧美一级在线免费| 99久久精品国产精品久久| 午夜激情一区二区三区| 国产精品视频在线看| 欧美日韩精品一区二区三区| 国产精品资源在线| 亚洲一区影音先锋| 国产亚洲精品aa| 在线播放欧美女士性生活| 国产精品一区二区三区乱码| 亚洲一卡二卡三卡四卡五卡| 国产亚洲一本大道中文在线| 欧美色精品在线视频| 国产成人免费高清| 麻豆精品视频在线观看免费| 一区二区三区欧美久久| 国产精品色一区二区三区| 日韩欧美久久久| 欧美日韩国产大片| 色综合久久久久久久| 国产超碰在线一区| 紧缚奴在线一区二区三区| 午夜久久久久久久久久一区二区| 国产精品欧美一区喷水| 久久青草欧美一区二区三区| 51精品久久久久久久蜜臀| 在线视频你懂得一区二区三区| 国产精品资源在线| 韩国女主播成人在线| 日日欢夜夜爽一区| 亚洲福利电影网| 亚洲va中文字幕| 亚洲卡通动漫在线| 中文字幕中文乱码欧美一区二区| 亚洲精品一区在线观看| 日韩女优av电影在线观看| 日韩欧美一区二区免费| 在线电影国产精品| 91精品国产综合久久久久| 欧美欧美午夜aⅴ在线观看| 欧美亚洲动漫制服丝袜| 91激情五月电影| 色老汉av一区二区三区| 色久优优欧美色久优优| 一道本成人在线| 欧美视频一区二区三区四区 | 日日夜夜精品免费视频| 亚洲成人一区二区| 亚洲成av人**亚洲成av**| 亚洲午夜免费电影| 午夜视频一区二区| 日本视频一区二区| 国产一区二区电影| 成人免费观看视频| 在线观看亚洲精品视频| 欧美在线观看一二区| 欧美一区二区精美| 337p粉嫩大胆噜噜噜噜噜91av| 久久综合网色—综合色88| 欧美精品一区二区高清在线观看 | 国产福利精品一区| 风间由美一区二区三区在线观看 | 欧美日韩国产另类不卡| 欧美日韩免费观看一区三区| 91麻豆精品国产综合久久久久久| 91精品国产综合久久婷婷香蕉| 日韩精品一区二区在线| 久久久久久电影| 亚洲色图.com| 性做久久久久久久久| 经典三级视频一区| 色域天天综合网| 91精品国产aⅴ一区二区| 久久久精品国产99久久精品芒果| 国产精品少妇自拍| 偷拍一区二区三区四区| 狠狠色综合色综合网络| av网站一区二区三区| 欧美美女一区二区在线观看| 亚洲精品一区二区三区蜜桃下载 | 国产经典欧美精品| 91丝袜国产在线播放| 制服丝袜亚洲播放| 国产日韩欧美不卡| 天天色天天操综合| 盗摄精品av一区二区三区| 欧美色窝79yyyycom| 国产亚洲精品中文字幕| 亚洲一区二区三区自拍| 国产伦精品一区二区三区免费 | 亚洲精品日韩一| 美国十次综合导航| av亚洲精华国产精华精| 欧美成人a视频| 亚洲精品视频一区| 国产福利精品导航| 日韩精品一区二区三区三区免费| 国产精品高潮呻吟| 国产一区二区不卡在线| 欧美日韩国产123区| 国产精品美女一区二区| 91丨九色丨蝌蚪丨老版| 精品国产一区二区三区久久影院| 亚洲精品美国一| 国产91清纯白嫩初高中在线观看| 欧美人与禽zozo性伦| 国产精品国产成人国产三级| 国产一区视频导航| 欧美一区二区私人影院日本| 亚洲欧美激情插 | 麻豆成人久久精品二区三区红 | 亚洲国产乱码最新视频 | 欧美精品一区二区三区一线天视频 | 亚洲精品视频观看| 成人动漫一区二区三区| 久久久夜色精品亚洲| 日本不卡视频在线观看| 欧美丝袜丝nylons| 亚洲成人你懂的| 91免费看`日韩一区二区| 国产日韩成人精品| 国产成人精品免费网站| 亚洲精品一区二区三区蜜桃下载 | 一本大道久久精品懂色aⅴ| 久久精品人人做| 国产呦精品一区二区三区网站| 91精品国产色综合久久| 日韩和欧美一区二区三区| 91网页版在线| 一区二区三区美女视频| 日本精品裸体写真集在线观看| 亚洲女性喷水在线观看一区| 一本久道中文字幕精品亚洲嫩|