#include /* Kinescope for X windows */ #include #include #include #include #include #include #include extern Display *display; extern Window draw_win,main_win,info_pop; extern int DCURY; extern GC gc_graph; #define MAXFILM 250 int ks_ncycle=1; int ks_speed=50; extern char *info_message,*kin_hint[]; extern int screen; int mov_ind; typedef struct { unsigned int h,w; Pixmap xi; } MOVIE; MOVIE movie[MAXFILM]; do_movie_com(int c) { /* XDestroyWindow(display,temp); draw_help(); XFlush(display); */ switch(c){ case 0: if(film_clip()==0) respond_box("Okay","Out of film!"); break; case 1: reset_film(); break; case 2: play_back(); break; case 3: auto_play(); break; case 4: save_kine(); break; case 5: make_anigif(); break; } } reset_film() { int i; if(mov_ind==0)return; for(i=0;i=MAXFILM)return(0); XGetGeometry(display,draw_win,&root,&x,&y,&w,&h,&bw,&d); movie[mov_ind].h=h; movie[mov_ind].w=w; movie[mov_ind].xi=XCreatePixmap(display,RootWindow(display,screen),w,h, DefaultDepth(display,screen)); XCopyArea(display,draw_win,movie[mov_ind].xi,gc_graph,0,0,w,h,0,0); mov_ind++; return 1; } play_back() { int x,y; unsigned int h,w,bw,d; char ch; Window root; XEvent ev; int i=0; XGetGeometry(display,draw_win,&root,&x,&y,&w,&h,&bw,&d); if(mov_ind==0)return; if(h=mov_ind)i=0; if(h0) save_movie(base,fmat); } make_anigif() { int i=0; int x,y; FILE *fp; Window root; unsigned int h,w,bw,d; XGetGeometry(display,draw_win,&root,&x,&y,&w,&h,&bw,&d); if(mov_ind==0)return; if(h0) { XNextEvent(display,&ev); switch(ev.type){ case ButtonPress: return; break; case KeyPress: key=get_key_press(&ev); if(key==27)return; if(key==','){ ks_speed-=dt; if(ks_speedsmax)ks_speed=smax; } break; } } /* done checking now increment pix */ waitasec(ks_speed); i++; if(i>=mov_ind){cycle++; i=0;} if(h=ks_ncycle)return; } /* Big loop */ } too_small() { respond_box("Okay","Window too small for film!"); }