int ColorModel::command(int argc, const char*const* argv) { Tcl& tcl = Tcl::instance(); if (argc == 2) { if (strcmp(argv[1], "alloc-colors") == 0) { tcl.result(allocate() < 0 ? "0" : "1"); return (TCL_OK); } if (strcmp(argv[1], "free-colors") == 0) { free_colors(); return (TCL_OK); } } else if (argc == 3) { if (strcmp(argv[1], "visual") == 0) { Tk_Window tk = Tk_NameToWindow(tcl.interp(), (char*)argv[2], tcl.tkmain()); setvisual(Tk_Visual(tk), Tk_Colormap(tk), Tk_Depth(tk)); return (TCL_OK); } if (strcmp(argv[1], "gamma") == 0) { double v = atof(argv[2]); if (v < 0) tcl.result("0"); gamma_ = v; tcl.result("1"); return (TCL_OK); } } return (TclObject::command(argc, argv)); }
static int initscreen(void) { int r=0; union REGS Regs; Regs.x.ax=0x1a00; int86(0x10,&Regs,&Regs); if (Regs.h.al==0x1a) { _AH=0; _AL=0x13; geninterrupt(0x10); outportb(0x3ce,GRAPHICS_MODE); outportb(0x3cf,inportb(0x3cf)&0xef); outportb(0x3ce,MISCELL_MODE); outportb(0x3cf,inportb(0x3cf)&0xfd); outportb(0x3c4,MEM_MODE); outportb(0x3c5,(inportb(0x3c5)&0xf7)|4); memset((void *)0xa0000000L,0,0xffff); #ifdef DOUBLELIGNES outportb(0x3d4,MAX_SCAN); outportb(0x3d5,inportb(0x3d5)&0x70); #endif outportb(0x3d4,UNDERLINE); outportb(0x3d5,inportb(0x3d5)&0xbf); outportb(0x3d4,MODE_CTRL); outportb(0x3d5,inportb(0x3d5)|0x40); settravail(1-vp); setvisual(vp); setpalette(egapal); r=1; } return r; }
static void map (Ihandle* self, Ihandle* parent) { iupCpiDefaultMap(self,parent); /* call default method */ setvisual(self); }