IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 27, 2005, 3:23:01 PM (21 years ago)
Author:
eugene
Message:

substantial work to move kii/kapa call into libkapa, unify RotFont, bDraw functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libkapa/include/kapa.h

    r5848 r5852  
    11# ifndef KAPA_H
    22# define KAPA_H
     3
     4# include <X11/Xlib.h>
     5# include <png.h>
    36
    47typedef struct {
     
    3437} KiiOverlayType;
    3538
     39typedef struct {
     40  char *name;
     41  float x;
     42  float y;
     43  float dx;
     44  float dy;
     45} KapaSection;
     46
     47typedef struct {
     48  double xmin, xmax, ymin, ymax;
     49  int style, ptype, ltype, etype, ebar, color;
     50  double lweight, size;
     51  Coords coords;
     52  int flipeast, flipnorth;
     53  char axis[8], labels[8], ticks[8];
     54} Graphdata;
     55
     56typedef struct {
     57  int dx, dy, ascent;
     58  unsigned char *bits;
     59} RotFont;
     60
     61typedef struct {
     62  RotFont *font;
     63  char name[64];
     64  int size;
     65} FontSet;
     66
     67typedef png_byte bDrawColor;
     68
     69typedef struct {
     70  int Nx, Ny;
     71  bDrawColor **pixels;
     72} bDrawBuffer;
     73
    3674/* IOfuncs.c */
    3775int KiiSendMessage (int device, char *format, ...);
    3876int KiiSendCommand (int device, int length, char *format, ...);
    3977int KiiSendCommandV (int device, int length, char *format, va_list argp);
     78int KiiScanMessage (int device, char *format, ...);
     79int KiiSendData (int device, char *data, int Nbytes);
     80char *KiiRecvData (int device);
    4081
    4182/* KiiOpen.c */
    4283int KiiOpen (char *kii_exec, char *name);
    4384int KiiClose (int socket);
     85int KiiWait (char *sockpath);
    4486
    4587/* KiiPicture.c */
    4688int KiiNewPicture1D (int fd, KiiImage *image, KiiDisplayMode *mode, Coords *coords);
    4789int KiiNewPicture2D (int fd, KiiImage *image, KiiDisplayMode *mode, Coords *coords);
    48 int KiiResize (int fd, int Nx, int Ny);
    49 int KiiCenter (int fd, double x, double y, int zoom);
    5090
    5191/* KiiOverlay.c */
     
    5898
    5999/* KiiConvert.c */
    60 int KiiJpeg (int fd, char *filename);
    61100int KiiPS (int fd, int scale, int raw, char *filename);
     101int KiiJPEG (int fd, char *filename);
     102int KapaPNG (int fd, char *filename);
     103int KapaPPM (int fd, char *filename);
    62104
    63105/* KiiCursor.c */
     
    66108int KiiCursorRead (int fd, double *x, double *y, char *key);
    67109
     110/* KapaWindow.c */
     111int KiiResize (int fd, int Nx, int Ny);
     112int KiiCenter (int fd, double x, double y, int zoom);
     113int KapaBox (int fd, Graphdata *graphdata);
     114int KapaClear (int fd, int ClearSection);
     115int KapaSetFont (int fd, char *name, int size);
     116int KapaSendLabel (int fd, char *string, int mode);
     117int KapaSendTextline (int fd, char *string, float x, float y, float angle);
     118int KapaSetLimits (int fd, Graphdata *graphmode);
     119int KapaSetSection (int fd, KapaSection *section);
     120int KapaSelectSection (int fd, char *name);
     121int KapaGetSection (int fd, char *name);
     122
     123/* KapaColors */
     124int KapaColorByName (char *name);
     125int KapaColormapSize ();
     126char *KapaColorRGBString (int N);
     127png_color *KapaPNGPalette (int *Npalette);
     128unsigned long *KapaX11colors (Display *display, Colormap colormap, unsigned long default_color, int *Ncolors);
     129
     130/* RotFont.c */
     131void InitRotFonts PROTO(());
     132int SetRotFont PROTO((char *name, int size));
     133char *GetRotFont PROTO((int *size));
     134RotFont *GetRotFontData (double *scale);
     135int RotStrlen PROTO((char *c));
     136
     137/* DrawRotString.c */
     138int DrawRotText PROTO((int x, int y, char *string, int pos, double angle));
     139int DrawRotBitmap PROTO((int x, int y, int dx, int dy, unsigned char *bitmap, int mode, double angle, double scale));
     140int DrawRotTextInit (Display *display, Window window, GC gc, unsigned long fore, unsigned long back);
     141
     142
     143/* PSRotFont.c */
     144void PSRotText PROTO((FILE *f, int x, int y, char *string, int pos, double angle));
     145void PSDumpRotSegment PROTO((FILE *f, char *segment, int *Nseg));
     146void PSSetFont PROTO((FILE *f, char *name, int size));
     147
     148/* bDrawFuncs.c */
     149bDrawBuffer *bDrawBufferCreate (int Nx, int Ny);
     150void bDrawBufferFree (bDrawBuffer *buffer);
     151void bDrawSetBuffer (bDrawBuffer *buffer);
     152void bDrawSetStyle (bDrawColor color, int lw, int lt);
     153void bDrawPoint (int x, int y);
     154void bDrawPointf (float x, float y);
     155
     156void bDrawArc (double Xc, double Yc, double Xr, double Yr, double Ts, double Te);
     157void bDrawCircle (double Xc, double Yc, double radius);
     158void bDrawCircleFill (double xc, double yc, double radius);
     159
     160void bDrawLine (double x1, double y1, double x2, double y2);
     161void bDrawLineWeight (int X1, int Y1, int X2, int Y2, int swapcoords);
     162void bDrawLineBresen (int X1, int Y1, int X2, int Y2, int swapcoords);
     163void bDrawLineHorizontal (int X1, int X2, int Y);
     164void bDrawLineVertical (int X, int Y1, int Y2);
     165
     166void bDrawRectOpen (double x1, double y1, double x2, double y2);
     167void bDrawRectFill (double x1, double y1, double x2, double y2);
     168void bDrawTriOpen (double x1, double y1, double x2, double y2, double x3, double y3);
     169void bDrawTriFill (double x1, double y1, double x2, double y2, double x3, double y3);
     170
     171/* bDrawRotFont.c */
     172int bDrawRotText (int x, int y, char *string, int pos, double angle);
     173int bDrawRotBitmap (int x, int y, int dx, int dy, unsigned char *bitmap, int mode, double angle, double scale);
     174
    68175# endif
Note: See TracChangeset for help on using the changeset viewer.