virtual void mapped_() { L("Canvas mapped"); cdInitContextPlus(); cdUseContextPlus(1); canvas_ = cdCreateCanvas(CD_IUP, *this); cdCanvasForeground(canvas_, CD_BLUE); cdCanvasSetAttribute(canvas_, "ANTIALIAS", "0"); //cdUseContextPlus(0); }
static void iuplua_openlibs(lua_State *L) { lua_pushliteral(L, LUA_COPYRIGHT); lua_setglobal(L, "_COPYRIGHT"); /* set global _COPYRIGHT */ /* iuplua initialization */ iuplua_open(L); #ifdef USE_STATIC /* disable require */ iuplua_dostring(L, "function require() end ", "static_require"); #ifdef IUPLUA_IMGLIB luaopen_iupluaimglib(L); #endif #ifdef IUPLUA_TUIO iuptuiolua_open(L); #endif #ifdef IUPLUA_WEB iupweblua_open(L); #endif #ifdef IUPLUA_SCINTILLA iup_scintillalua_open(L); #endif /* luaopen_lfs(L); */ #ifndef IUPLUA_NO_GL iupgllua_open(L); iupglcontrolslua_open(L); #ifdef USE_LUAGL luaopen_luagl(L); #endif #endif #ifndef IUPLUA_NO_CD iupcontrolslua_open(L); iupmatrixexlua_open(L); iup_plotlua_open(L); cdlua_open(L); cdluaiup_open(L); cdInitContextPlus(); #endif #ifndef IUPLUA_NO_IM iupimlua_open(L); imlua_open(L); imlua_open_process(L); #endif #ifndef IUPLUA_NO_IM #ifndef IUPLUA_NO_CD cdluaim_open(L); #endif #endif #endif }
static int cdluacairo_open (lua_State *L) { cdluaLuaState* cdL = cdlua_getstate(L); cdInitContextPlus(); luaL_register(L, "cd", cdlib); /* leave "cd" table at the top of the stack */ cdlua_addcontext(L, cdL, &cdluapdfctx); cdlua_addcontext(L, cdL, &cdluapsctx); cdlua_addcontext(L, cdL, &cdluasvgctx); cdlua_addcontext(L, cdL, &cdluaimagergbctx); return 1; }
static void iuplua_openlibs (lua_State *L) { lua_pushliteral(L, LUA_COPYRIGHT); lua_setglobal(L, "_COPYRIGHT"); /* set global _COPYRIGHT */ #ifdef USE_STATIC /* iuplua initialization */ iuplua_open(L); #ifdef IUPLUA_IMGLIB luaopen_iupluaimglib(L); #endif #ifdef IUPLUA_TUIO iuptuiolua_open(L); #endif /* luaopen_lfs(L); */ #ifndef IUPLUA_NO_GL iupgllua_open(L); /* luaopen_luagl(L); */ #endif #ifndef IUPLUA_NO_CD iupcontrolslua_open(L); iup_pplotlua_open(L); cdlua_open(L); cdluaiup_open(L); cdInitContextPlus(); #endif #ifndef IUPLUA_NO_IM iupimlua_open(L); imlua_open(L); imlua_open_process(L); #endif #ifndef IUPLUA_NO_IM #ifndef IUPLUA_NO_CD cdluaim_open(L); #endif #endif #endif }
static int cdluacontextplus_open (lua_State *L) { cdInitContextPlus(); luaL_register(L, "cd", cdlib); /* leave "cd" table at the top of the stack */ return 1; }
static int cdlua5_initcontextplus(lua_State *L) { (void)L; cdInitContextPlus(); return 0; }
void cdInitGdiPlus(void) { cdInitContextPlus(); }
int main(int argc, char** argv) { IupOpen(&argc, &argv); #ifdef USE_CONTEXTPLUS cdInitContextPlus(); #endif #ifdef USE_OPENGL IupGLCanvasOpen(); #endif simple_loadled(); #ifdef USE_OPENGL { Ihandle* dialog = IupGetHandle("SimpleDialog"); Ihandle* canvas = IupGetHandle("SimpleCanvas"); IupDestroy(canvas); canvas = IupGLCanvas("SimpleRepaint"); IupSetAttribute(canvas, "BUFFER", "DOUBLE"); IupSetHandle("SimpleCanvas", canvas); IupAppend(dialog, canvas); } #endif IupSetAttribute(IupGetHandle("SimpleDialog"), "SIZE", "HALFxHALF"); IupSetAttribute(IupGetHandle("SimpleDialog"), "PLACEMENT", "MAXIMIZED"); IupShow(IupGetHandle("SimpleDialog")); IupSetAttribute(IupGetHandle("SimpleDialog"), "SIZE", NULL); SimpleCreateCanvas((char*)IupGetHandle("SimpleCanvas")); IupSetFunction("cmdExit", (Icallback) cmdExit); IupSetFunction("SimplePlayClipboard", (Icallback) SimplePlayClipboard); IupSetFunction("SimplePlayCGMText", (Icallback) SimplePlayCGMText); IupSetFunction("SimplePlayCGMBin", (Icallback) SimplePlayCGMBin); IupSetFunction("SimplePlayMetafile", (Icallback) SimplePlayMetafile); IupSetFunction("SimplePlayWMF", (Icallback) SimplePlayWMF); IupSetFunction("SimplePlayEMF", (Icallback) SimplePlayEMF); IupSetFunction("SimpleDrawDebug", (Icallback) SimpleDrawDebug); IupSetFunction("SimpleDrawWindow", (Icallback) SimpleDrawWindow); IupSetFunction("SimpleDrawCGMText", (Icallback) SimpleDrawCGMText); IupSetFunction("SimpleDrawCGMBin", (Icallback) SimpleDrawCGMBin); IupSetFunction("SimpleDrawDXF", (Icallback) SimpleDrawDXF); IupSetFunction("SimpleDrawDGN", (Icallback) SimpleDrawDGN); IupSetFunction("SimpleDrawEMF", (Icallback) SimpleDrawEMF); IupSetFunction("SimpleDrawMetafile", (Icallback) SimpleDrawMetafile); IupSetFunction("SimpleDrawPDF", (Icallback) SimpleDrawPDF); IupSetFunction("SimpleDrawPS", (Icallback) SimpleDrawPS); IupSetFunction("SimpleDrawEPS", (Icallback) SimpleDrawEPS); IupSetFunction("SimpleDrawSVG", (Icallback) SimpleDrawSVG); IupSetFunction("SimpleDrawWMF", (Icallback)SimpleDrawWMF); IupSetFunction("SimpleDrawPPTX", (Icallback)SimpleDrawPPTX); IupSetFunction("SimpleDrawPrint", (Icallback)SimpleDrawPrint); IupSetFunction("SimpleDrawPrintDialog", (Icallback) SimpleDrawPrintDialog); IupSetFunction("SimpleDrawClipboardBitmap", (Icallback) SimpleDrawClipboardBitmap); IupSetFunction("SimpleDrawClipboardMetafile", (Icallback) SimpleDrawClipboardMetafile); IupSetFunction("SimpleDrawClipboardEMF", (Icallback) SimpleDrawClipboardEMF); IupSetFunction("SimpleDrawImage", (Icallback) SimpleDrawImage); IupSetFunction("SimpleDrawImageRGB", (Icallback) SimpleDrawImageRGB); IupSetFunction("SimpleDrawSimulate", (Icallback) SimpleDrawSimulate); #ifdef USE_OPENGL IupSetFunction("SimpleDrawGL", (Icallback) SimpleDrawGL); #endif IupSetFunction("SimpleNotXor", (Icallback) SimpleNotXor); IupSetFunction("SimpleXor", (Icallback) SimpleXor); IupSetFunction("SimpleReplace", (Icallback) SimpleReplace); IupSetFunction("SimpleClippingOff", (Icallback) SimpleClippingOff); IupSetFunction("SimpleClippingArea", (Icallback) SimpleClippingArea); IupSetFunction("SimpleClippingPolygon", (Icallback) SimpleClippingPolygon); IupSetFunction("SimpleClippingRegion", (Icallback) SimpleClippingRegion); IupSetFunction("SimpleContextPlus", (Icallback) SimpleContextPlus); IupSetFunction("SimpleTransform", (Icallback) SimpleTransform); IupSetFunction("SimpleAll", (Icallback) SimpleAll); IupSetFunction("SimpleTextAlign", (Icallback)SimpleTextAlign); IupSetFunction("SimpleTextFonts", (Icallback)SimpleTextFonts); IupSetFunction("SimpleTest", (Icallback) SimpleTest); IupSetFunction("SimpleRepaint", (Icallback) SimpleRepaint); SimpleDrawWindow(); #ifdef USE_OPENGL SimpleUpdateSize(NULL); IupUpdate(IupGetHandle("SimpleCanvas")); #endif IupMainLoop(); SimpleKillCanvas(); #ifdef USE_CONTEXTPLUS cdFinishContextPlus(); #endif IupClose(); return EXIT_SUCCESS; }