Annotation of OpenXM_contrib2/windows/engine2000/if_canvas.c, Revision 1.1
1.1 ! ohara 1: #include <windows.h>
! 2: #include "gmp.h"
! 3: #include "ca.h"
! 4: #include "ifplot.h"
! 5: #include "if_canvas.h"
! 6:
! 7: void canvas_toggle_noaxis(struct canvas *can)
! 8: {
! 9: can->noaxis = !can->noaxis;
! 10: }
! 11:
! 12: void canvas_toggle_wide(struct canvas *can)
! 13: {
! 14: can->wide = !can->wide;
! 15: }
! 16:
! 17: void canvas_toggle_precise(struct canvas *can)
! 18: {
! 19: can->precise = !can->precise;
! 20: }
! 21:
! 22: int canvas_percentage(struct canvas *can)
! 23: {
! 24: return can->percentage;
! 25: }
! 26:
! 27: int canvas_height(struct canvas *can)
! 28: {
! 29: return can->height;
! 30: }
! 31:
! 32: int canvas_width(struct canvas *can)
! 33: {
! 34: return can->width;
! 35: }
! 36:
! 37: int canvas_index(struct canvas *can)
! 38: {
! 39: return can->index;
! 40: }
! 41:
! 42: char canvas_precise(struct canvas *can)
! 43: {
! 44: return can->precise;
! 45: }
! 46:
! 47: char canvas_wide(struct canvas *can)
! 48: {
! 49: return can->wide;
! 50: }
! 51:
! 52: char canvas_noaxis(struct canvas *can)
! 53: {
! 54: return can->noaxis;
! 55: }
! 56:
! 57: char *canvas_prefix(struct canvas *can)
! 58: {
! 59: return can->prefix;
! 60: }
! 61:
! 62: char *canvas_wname(struct canvas *can)
! 63: {
! 64: return can->wname;
! 65: }
! 66:
! 67: void *canvas_window(struct canvas *can)
! 68: {
! 69: return can->window;
! 70: }
! 71:
! 72: double canvas_xmin(struct canvas *can)
! 73: {
! 74: return can->xmin;
! 75: }
! 76:
! 77: double canvas_xmax(struct canvas *can)
! 78: {
! 79: return can->xmax;
! 80: }
! 81:
! 82: double canvas_ymin(struct canvas *can)
! 83: {
! 84: return can->ymin;
! 85: }
! 86:
! 87: double canvas_ymax(struct canvas *can)
! 88: {
! 89: return can->ymax;
! 90: }
! 91:
! 92: HDC canvas_pix(struct canvas *can)
! 93: {
! 94: return can->pix;
! 95: }
! 96:
! 97: struct pa* canvas_pa(struct canvas *can)
! 98: {
! 99: return can->pa;
! 100: }
! 101:
! 102: void canvas_bitblt(struct canvas *can, HDC dest,int dx, int dy)
! 103: {
! 104: BitBlt(dest,dx,dy,can->width,can->height,can->pix,0,0,SRCCOPY);
! 105: }
! 106:
! 107: int canvas_is_plot(struct canvas *can)
! 108: {
! 109: int mode = can->mode;
! 110: return mode == modeNO(PLOT);
! 111: }
! 112:
! 113: int canvas_is_ifplot(struct canvas *can)
! 114: {
! 115: int mode = can->mode;
! 116: return mode == modeNO(IFPLOT) || mode == modeNO(CONPLOT);
! 117: }
! 118:
! 119: int canvas_is_interactive(struct canvas *can)
! 120: {
! 121: int mode = can->mode;
! 122: return mode == modeNO(INTERACTIVE);
! 123: }
! 124:
! 125: void canvas_set_handle(struct canvas *can, HWND hwnd)
! 126: {
! 127: can->hwnd = hwnd;
! 128: }
! 129:
! 130: void canvas_set_window(struct canvas *can, void *window)
! 131: {
! 132: can->window= window;
! 133: }
! 134:
! 135: void **canvas_history(struct canvas *can, int *len)
! 136: {
! 137: void **p = NULL;
! 138: int i;
! 139: NODE n;
! 140: for ( i=0, n=can->history; n; i++, n=NEXT(n) ) {
! 141: }
! 142: *len = i;
! 143: if( *len ) {
! 144: p = (void **)MALLOC(sizeof(void *)*(*len));
! 145: for ( i=0, n=can->history; n; i++, n=NEXT(n) ) {
! 146: p[i] = n->body;
! 147: }
! 148: }
! 149: return p;
! 150: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>