/text/pro/POCOLIB.TXT

http://github.com/AnimatorPro/Animator-Pro · Plain Text · 409 lines · 409 code · 0 blank · 0 comment · 0 complexity · 442e7bb5eef65bfc79cdb60ccccf680b MD5 · raw file

  1. /********* User Interface library ***********/
  2. int printf(char *format, ...);
  3. void unprintf(void);
  4. void Qtext(char *format, ...);
  5. int Qchoice(char **buttons, int bcount, char *header, ...);
  6. int Qmenu(char **choices, int ccount, char *header);
  7. Boolean Qquestion(char *question, ...);
  8. Boolean Qnumber(int *num, int min, int max, char *header);
  9. Boolean Qstring(char *string, int size, char *header);
  10. Boolean Qfile(char *suffix, char *button, char *inpath, char *outpath, Boolean force_suffix, char *header);
  11. Boolean Qlist(char *choicestr, int *choice, char **items, int icount, int *ipos, char *header);
  12. int Qcolor(void);
  13. ErrCode Qerror(ErrCode err, char *format, ...);
  14. Boolean RubBox(int *x, int *y, int *w, int *h);
  15. Boolean RubCircle(int *x, int *y, int *rad);
  16. Boolean RubLine(int x1, int y1, int *x2, int *y2);
  17. int RubPoly(int **x, int **y);
  18. Boolean DragBox(int *x, int *y, int *w, int *h);
  19. void WaitClick(int *x, int *y, int *left, int *right, int *key);
  20. void PollInput(int *x, int *y, int *left, int *right, int *key);
  21. void WaitInput(int *x, int *y, int *left, int *right, int *key);
  22. Boolean GetAbort(void);
  23. Boolean SetAbort(Boolean abort);
  24. void SetAbortHandler(Boolean (*handler)(void *data), void *data);
  25. Boolean HideCursor(void);
  26. Boolean ShowCursor(void);
  27. Boolean Qscroll(int *choice, char **items, int icount, int *ipos, char **button_texts, char *header);
  28. Boolean UdQnumber(int *num, int min, int max,Errcode (*update)(void *data, int num), void *data, char *fmt,...);
  29. int Qedit(char *text_buffer, int max_size, int *cursor_position, int *top_line);
  30. int QeditFile(char *file_name, int *cursor_position, int *top_line);
  31. void PhysicalWaitClick(int *x, int *y, int *left, int *right, int *key);
  32. void PhysicalPollInput(int *x, int *y, int *left, int *right, int *key);
  33. void PhysicalWaitInput(int *x, int *y, int *left, int *right, int *key);
  34. Boolean PhysicalRubMoveBox(int *x, int *y, int *width, int *height, Boolean clip_to_screen);
  35. int QmenuWithFlags(char **choices, int ccount, short *flags, char *header);
  36. /********* Graphics library ***********/
  37. void GetSize(int *width, int *height);
  38. void GetAspectRatio(int *x, int *y);
  39. int GetColor(void);
  40. void SetColor(int color);
  41. void Clear(void);
  42. void Dot(int x, int y);
  43. int GetDot(int x, int y);
  44. void Line(int x1, int y1, int x2, int y2);
  45. void Box(int x, int y, int w, int h);
  46. void Circle(int cx, int cy, int radius);
  47. ErrCode Poly(int ptcount, int *x, int *y);
  48. ErrCode Spline(int ptcount, int *x, int *y);
  49. ErrCode Oval(double angle, int xcen, int ycen, int xrad, int yrad);
  50. ErrCode Star(double angle, int xcen, int ycen, int rad);
  51. ErrCode Petal(double angle, int xcen, int ycen, int rad);
  52. ErrCode Rpoly(double angle, int xcen, int ycen, int rad);
  53. ErrCode Spiral(double angle, int xcen, int ycen, int rad, double turns);
  54. ErrCode Fill(int x, int y);
  55. ErrCode FillTo(int x, int y, int to_color);
  56. ErrCode Edge(int color);
  57. void SetColorMap(int index, int r, int g, int b);
  58. void GetColorMap(int index, int *r, int *g, int *b);
  59. void GetScreenColorMap(Screen *s, int *maparray);
  60. void SetScreenColorMap(Screen *s, int *maparray);
  61. void GetPhysicalSize(int *width, int *height);
  62. int GetBoxBevel(void);
  63. void SetBoxBevel(int new_bevel);
  64. void SetCluster(int cluster_size, int *cluster);
  65. ErrCode GetCluster(int *cluster_size, int **cluster);
  66. void HLStoRGB(int h, int l, int s, int *r, int *g, int *b);
  67. void RGBtoHLS(int r, int g, int b, int *h, int *l, int *s);
  68. int ClosestColorInScreen(Screen *s, int r, int g, int b);
  69. ErrCode SqueezeColors(int *source_map, int source_count, int *dest_map, int dest_count);
  70. ErrCode FitScreenToColorMap(Screen *s, int *new_colors, Boolean keep_key);
  71. /********* Text library ***********/
  72. void Text(int x, int y, char *string);
  73. void WordWrap(int x, int y, int width, int height, char *text);
  74. void SetJustify(int just);
  75. int GetJustify(void);
  76. int StringWidth(char *string);
  77. int FontHeight(void);
  78. int TallestChar(void);
  79. void GetFontName(char *name);
  80. ErrCode LoadFont(char *name);
  81. void GetFontDir(char *dir);
  82. void Qfont(void);
  83. Boolean CanScaleFont(void);
  84. Errcode ScaleFont(int height);
  85. void SetFontSpacing(int spacing);
  86. int GetFontSpacing(void);
  87. void SetFontLeading(int leading);
  88. int GetFontLeading(void);
  89. int WordWrapCountLines(int width, char *text);
  90. /********* Graphics Modes library ***********/
  91. ErrCode SetInk(char *name);
  92. void GetInk(char *buf);
  93. void SetInkStrength(int percent);
  94. int GetInkStrength(void);
  95. void SetInkDither(Boolean dither);
  96. Boolean GetInkDither(void);
  97. void SetFilled(Boolean fill);
  98. Boolean GetFilled(void);
  99. void SetBrushSize(int size);
  100. int GetBrushSize(void);
  101. void SetKeyMode(Boolean clear);
  102. Boolean GetKeyMode(void);
  103. void SetKeyColor(int color);
  104. int GetKeyColor(void);
  105. void SetMaskUse(Boolean use_it);
  106. Boolean GetMaskUse(void);
  107. void SetMaskCreate(Boolean make_it);
  108. Boolean GetMaskCreate(void);
  109. void SetStarPoints(int points);
  110. int GetStarPoints(void);
  111. void SetStarRatio(int ratio);
  112. int GetStarRatio(void);
  113. void SetSplineTCB(int t, int c, int b);
  114. void GetSplineTCB(int *t, int *c, int *b);
  115. void SetTwoColorOn(Boolean setit);
  116. Boolean GetTwoColorOn(void);
  117. void SetTwoColor(int color);
  118. int GetTwoColor(void);
  119. void SetClosed(Boolean closed);
  120. Boolean GetClosed(void);
  121. void SetCycleDraw(Boolean cycle);
  122. Boolean GetCycleDraw(void);
  123. Boolean GetMultiFrame(void);
  124. void SetMultiFrame(Boolean multi);
  125. /********* Turtle Graphics library ***********/
  126. void Move(double amount);
  127. void Back(double amount);
  128. void Left(double angle);
  129. void Right(double angle);
  130. void PenUp(void);
  131. void PenDown(void);
  132. Boolean IsDown(void);
  133. void MoveTo(double x, double y, double angle);
  134. void Where(double *x, double *y, double *angle);
  135. void Home(void);
  136. /********* Time Oriented Function library ***********/
  137. long Clock1000(void);
  138. void sleep(double seconds);
  139. void NextFrame(void);
  140. void BackFrame(void);
  141. void SetFrame(int frame);
  142. int GetFrame(void);
  143. ErrCode SetFrameCount(int count);
  144. int GetFrameCount(void);
  145. void PlayFlic(long frames);
  146. void SetSpeed(int speed);
  147. int GetSpeed(void);
  148. ErrCode InsertFrames(int count);
  149. ErrCode DeleteFrames(int count);
  150. ErrCode OverTime(ErrCode (*effect)(double time, void *data), void *data);
  151. ErrCode OverAll(ErrCode (*effect)(double time, void *data), void *data);
  152. ErrCode OverSegment(ErrCode (*effect)(double time, void *data), void *data);
  153. void SetTimeSelect(Boolean is_multi);
  154. Boolean GetTimeSelect(void);
  155. void SetFSA(int fsa);
  156. int GetFSA(void);
  157. void SetSegStart(int frame);
  158. int GetSegStart(void);
  159. void SetSegEnd(int frame);
  160. int GetSegEnd(void);
  161. void SetStill(Boolean still);
  162. Boolean GetStill(void);
  163. void SetInSlow(Boolean InSlow);
  164. Boolean GetInSlow(void);
  165. void SetOutSlow(Boolean OutSlow);
  166. Boolean GetOutSlow(void);
  167. void SetPingPong(Boolean PingPong);
  168. Boolean GetPingPong(void);
  169. void SetReverse(Boolean reverse);
  170. Boolean GetReverse(void);
  171. void SetComplete(Boolean complete);
  172. Boolean GetComplete(void);
  173. /********* Cel library ***********/
  174. Boolean CelExists(void);
  175. void CelPaste(void);
  176. void CelMove(int dx, int dy);
  177. void CelMoveTo(int x, int y);
  178. void CelTurn(double angle);
  179. void CelTurnTo(double angle);
  180. ErrCode CelNextFrame(void);
  181. ErrCode CelBackFrame(void);
  182. ErrCode CelSetFrame(int frame);
  183. int CelGetFrame(void);
  184. int CelFrameCount(void);
  185. ErrCode CelWhere(int *x, int *y, double *angle);
  186. ErrCode CelGet(int x, int y, int width, int height);
  187. ErrCode CelClip(void);
  188. void CelRelease(void);
  189. ErrCode CelClipChanges(void);
  190. /********* Swap Screen library ***********/
  191. Boolean SwapExists(void);
  192. void SwapClip(void);
  193. void SwapRelease(void);
  194. ErrCode SwapTrade(void);
  195. /********* Optics library ***********/
  196. void OptClearState(void);
  197. void OptSetState(struct optState *os);
  198. void OptGetState(struct optState *os);
  199. void OptFreeState(struct optState *os);
  200. void OptClearPos(void);
  201. void OptSetPos(struct optPos *op);
  202. void OptGetPos(struct optPos *op);
  203. void OptClearPath(void);
  204. void OptSetPath(int ptcount, int *x, int *y);
  205. int OptGetPath(int **x, int **y);
  206. void OptFreePath(int **x, int **y);
  207. void OptDefaultCenters(void);
  208. void OptContinue(void);
  209. int OptGetElement(void);
  210. ErrCode OptSetElement(int el);
  211. ErrCode OptToFrame(double time);
  212. ErrCode OptToSegment(int start, int stop);
  213. ErrCode OptToAll(void);
  214. /********* Screen library ***********/
  215. Screen *GetPicScreen(void);
  216. Screen *GetSwapScreen(void);
  217. Screen *GetUndoScreen(void);
  218. Screen *GetCelScreen(void);
  219. ErrCode AllocScreen(Screen **screen, int width, int height);
  220. void FreeScreen(Screen **screen);
  221. void GetScreenSize(Screen *s, int *x, int *y);
  222. void SetPixel(Screen *s, int color, int x, int y);
  223. int GetPixel(Screen *s, int x, int y);
  224. void SetBlock(Screen *s, char *pixbuf, int x, int y, int width, int height);
  225. void GetBlock(Screen *s, char *pixbuf, int x, int y, int width, int height);
  226. void IconBlit(char *source, int snext, int sx, int sy, int width, int height, Screen *dest, int dx, int dy, int color);
  227. void Blit(Screen *source, int sx, int sy, int width, int height, Screen *dest, int dx, int dy);
  228. void KeyBlit(Screen *source, int sx, int sy, int width, int height, Screen *dest, int dx, int dy, int key_color);
  229. void CopyScreen(Screen *source, Screen *dest);
  230. void TradeScreen(Screen *a, Screen *b);
  231. void PicDirtied(void);
  232. Screen *GetPhysicalScreen(void);
  233. void SetBox(Screen *s, int color, int x, int y, int width, int height);
  234. void MenuText(Screen *screen, int color, int xoff, int yoff, char *text);
  235. int MenuTextWidth(char *text);
  236. int MenuTextHeight(void);
  237. void GetMenuColors(int *black, int *grey, int *light, int *bright, int *red);
  238. /********* Misc. Functions library ***********/
  239. void exit(ErrCode err);
  240. void NewFlic(void);
  241. ErrCode Reset(void);
  242. ErrCode ResizeReset(int width, int height);
  243. int GetChangeCount(void);
  244. int PocoVersion(void);
  245. void Redo(void);
  246. void Restore(void);
  247. int rnd(int max);
  248. int rand(void);
  249. void srand(int seed);
  250. long clock(void);
  251. Boolean IsBatchRun(void);
  252. void PocoChainTo(char *program_path);
  253. Errcode system(char *command_line);
  254. /********* Autodesk Animator File library ***********/
  255. ErrCode LoadFlic(char *name);
  256. ErrCode SaveFlic(char *name);
  257. ErrCode LoadPic(char *name);
  258. ErrCode SavePic(char *name);
  259. ErrCode LoadCel(char *name);
  260. ErrCode SaveCel(char *name);
  261. ErrCode LoadPath(char *name);
  262. ErrCode SavePath(char *name);
  263. ErrCode LoadPoly(char *name);
  264. ErrCode SavePoly(char *name);
  265. ErrCode LoadColors(char *name);
  266. ErrCode SaveColors(char *name);
  267. ErrCode LoadTitles(char *name);
  268. ErrCode SaveTitles(char *name);
  269. ErrCode LoadMask(char *name);
  270. ErrCode SaveMask(char *name);
  271. ErrCode SaveScreenPic(Screen *s, char *name);
  272. ErrCode LoadScreenPic(Screen *s, char *name);
  273. /********* (C Standard) FILE library ***********/
  274. FILE *fopen(char *name, char *mode);
  275. void fclose(FILE *f);
  276. int fread(void *buf, int size, int count, FILE *f);
  277. int fwrite(void *buf, int size, int count, FILE *f);
  278. int fprintf(FILE *f, char *format, ...);
  279. int fseek(FILE *f, long offset, int mode);
  280. long ftell(FILE *f);
  281. int fflush(FILE *f);
  282. int getc(FILE *f);
  283. int fgetc(FILE *f);
  284. int putc(int c, FILE *f);
  285. int fputc(int c, FILE *f);
  286. char *fgets(char *s, int maxlen, FILE *f);
  287. int fputs(char *s, FILE *f);
  288. int *__GetErrnoPointer(void);
  289. #define errno (*__GetErrnoPointer())
  290. /********* (C standard) String library ***********/
  291. int sprintf(char *buf, char *format, ...);
  292. int strcmp(char *a, char *b);
  293. int stricmp(char *a, char *b);
  294. int strncmp(char *a, char *b, int maxlen);
  295. int strlen(char *a);
  296. char *strcpy(char *dest, char *source);
  297. char *strncpy(char *dest, char *source, int maxlen);
  298. char *strcat(char *dest, char *source);
  299. char *strdup(char *source);
  300. char *strchr(char *source, int c);
  301. char *strrchr(char *source, int c);
  302. char *strstr(char *string, char *substring);
  303. char *stristr(char *string, char *substring);
  304. int atoi(char *string);
  305. double atof(char *string);
  306. char *strpbrk(char *string, char *breakset);
  307. int strspn(char *string, char *breakset);
  308. int strcspn(char *string, char *breakset);
  309. char *strtok(char *string, char *delimset);
  310. char *getenv(char *varname);
  311. char *strlwr(char *string);
  312. char *strupr(char *string);
  313. char *strerror(int errnum);
  314. /********* (C Standard) Memory Manager library ***********/
  315. void *malloc(int size);
  316. void *calloc(int size_el, int el_count);
  317. void free(void *pt);
  318. void *memcpy(void *dest, void *source, int size);
  319. void *memmove(void *dest, void *source, int size);
  320. int memcmp(void *a, void *b, int size);
  321. void *memset(void *dest, int fill_char, int size);
  322. void *memchr(void *a, int match_char, int size);
  323. /********* (C Standard) Math library ***********/
  324. double acos(double x);
  325. double asin(double x);
  326. double atan(double x);
  327. double atan2(double y, double x);
  328. double ceil(double x);
  329. double cos(double x);
  330. double cosh(double x);
  331. double exp(double x);
  332. double fabs(double x);
  333. double floor(double x);
  334. double fmod(double x, double y);
  335. double log(double x);
  336. double log10(double x);
  337. double pow(double x, double y);
  338. double sin(double x);
  339. double sinh(double x);
  340. double sqrt(double x);
  341. double tan(double x);
  342. double tanh(double x);
  343. /********* DOS library ***********/
  344. ErrCode fnsplit(char *path, char *device, char *dir, char *file, char *suf);
  345. ErrCode fnmerge(char *path, char *device, char *dir, char *file, char *suf);
  346. Boolean DosExists(char *filename);
  347. ErrCode DosCopy(char *source, char *dest);
  348. ErrCode DosDelete(char *filename);
  349. ErrCode DosRename(char *old, char *new);
  350. ErrCode SetDir(char *dir);
  351. ErrCode GetDir(char *dir);
  352. int DirList(char ***list, char *wild, Boolean get_dirs);
  353. void FreeDirList(char ***list);
  354. void GetResourceDir(char *dir);
  355. void GetProgramDir(char *dir);
  356. /********* Global Variable library ***********/
  357. ErrCode GlobalVarGet(char *name, char *value);
  358. ErrCode GlobalVarSet(char *name, char *value);
  359. ErrCode GlobalVarDelete(char *name);
  360. ErrCode GlobalVarFlush(void);
  361. ErrCode GlobalVarFirst(char **name, char **value);
  362. ErrCode GlobalVarNext(char **name, char **value);
  363. /********* Title library ***********/
  364. void TitleSetMovement(int movement);
  365. int TitleGetMovement(void);
  366. void TitleSetScrolling(int scrolling);
  367. int TitleGetScrolling(void);
  368. ErrCode TitleSetText(char *text);
  369. ErrCode TitleSetTextFromFile(char *file_name);
  370. char *TitleGetText(void);
  371. Boolean TitleHasText(void);
  372. void TitleSetPosition(int x, int y, int w, int h);
  373. void TitleGetPosition(int *x, int *y, int *w, int *h);
  374. void TitleEdit(void);
  375. ErrCode TitleRender(void);
  376. /********* Tween library ***********/
  377. ErrCode TweenLoad(char *file_name);
  378. ErrCode TweenSave(char *file_name);
  379. Boolean TweenExists(void);
  380. void TweenClear(void);
  381. ErrCode TweenSetStart(int ptcount, int *x, int *y);
  382. ErrCode TweenGetStart(int *ptcount, int **x, int **y);
  383. ErrCode TweenSetEnd(int ptcount, int *x, int *y);
  384. ErrCode TweenGetEnd(int *ptcount, int **x, int **y);
  385. void TweenSwapEnds(void);
  386. ErrCode TweenEndToStart(void);
  387. ErrCode TweenOneLink(int start_point, int end_point);
  388. Errcode TweenSetLinks(int link_count, int *starts, int *ends);
  389. Errcode TweenGetLinks(int *link_count, int **starts, int **ends);
  390. void TweenClearLinks(void);
  391. void TweenSetSplined(Boolean is_splined);
  392. Boolean TweenGetSplined(void);
  393. ErrCode TweenTrails(int steps);
  394. ErrCode TweenMakePoly(double time, int *ptcount, int **x, int **y);
  395. ErrCode TweenRender(void);
  396. /********* Flic Playback library ***********/
  397. typedef struct __flic_handle__ Flic;
  398. Errcode FlicInfo(char *path, int *width, int *height, int *speed, int *frames);
  399. Flic *FlicOpenInfo(char *path, int *width, int *height, int *speed, int *frames);
  400. Flic *FlicOpen(char *path);
  401. void FlicClose(Flic *theflic);
  402. void FlicRewind(Flic *theflic);
  403. void FlicSeekFrame(Flic *theflic, int theframe);
  404. void FlicOptions(Flic *theflic, int speed, int input_stops_playback, int see_mouse, Screen *playback_screen, int xoffset, int yoffset);
  405. void FlicPlay(Flic *theflic);
  406. void FlicPlayOnce(Flic *theflic);
  407. void FlicPlayTimed(Flic *theflic, int milliseconds);
  408. void FlicPlayCount(Flic *theflic, int frame_count);
  409. void FlicPlayUntil(Flic *theflic, int (*eventfunc)(Flic *flic, void *userdata, long cur_loop, long cur_frame, long num_frames), void *userdata);