int main(void) { // // Set the clocking to run directly from the crystal. // SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ); // // Create a task to blink LED // xTaskCreate(BlinkLED, (signed portCHAR*) "Blinky", 32, NULL, 1, NULL); // // Create a task to display string on OLED // xTaskCreate(Display, (signed portCHAR*) "Display", 512, NULL, 1, NULL); // // Output the start screen // PrintInit(); // // Start FreeRTOS Task Scheduler // vTaskStartScheduler(); while(1){} }
void PrintGnome( void ) { GtkWidget *dialog; gint ret; PrintInit( ); dialog = gnome_print_dialog_new( job, (guchar*)"ClassicLadder", 0 ); ret = gtk_dialog_run( GTK_DIALOG( dialog ) ); gtk_widget_destroy( dialog ); switch( ret ) { case GNOME_PRINT_DIALOG_RESPONSE_PRINT: DrawPrint(gpc); gnome_print_job_close (job); gnome_print_job_print( job ); break; case GNOME_PRINT_DIALOG_RESPONSE_PREVIEW: PrintPreviewGnome(); break; } PrintFree( ); }
void PrintPreviewGnome( void ) { GtkWidget *preview; PrintInit( ); DrawPrint(gpc); gnome_print_job_close (job); preview = gnome_print_job_preview_new (job, (guchar*)"classicladder-preview"); // g_signal_connect (G_OBJECT (preview), "unrealize", // G_CALLBACK (gtk_main_quit), NULL); // g_signal_connect (G_OBJECT (preview), "unrealize", // GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT(preview)); gtk_window_set_modal( GTK_WINDOW(preview), TRUE ); gtk_widget_show (preview); PrintFree( ); }
void my_task_Startup() { DebugManager(1, 0x1F, 0x180000, 0x40000, 0x1C0000); dmstart(); dmProcInit(); #ifdef ENABLE_MASSIVE_DEBUG // the 2nd level is 32 flags for debug classes // the 3rd arg is log level, 0 == full debug, >0 == less debug dmSetStoreLevel(hDbgMgr, 0xFF, 0); dmSetPrintLevel(hDbgMgr, 0xFF, 0); #endif initialize(); sub_FFAFE5BC(); SetAssert(); EventProcedureServiceInit(); ShutDownProcInit(); Install3VMemory(0xF8000000); RomManagerInit(); CreateParamPubInstance(); PropertyServiceInit(); ErrorNumberListInit(); FatalErrorsProcInit(); RegisterISRs_OCH(); BlockUntilAfterTimeoutProcInit(50); sub_FFB07740(0x10, 8, 0x1BBC); ResourceNameServiceInit(); MemorySuite(0); sysClockRateSet_100(3); sub_FFB2BD6C(); InitializeSerialIO(); RtcInit(0x386D4380); AdjDefectsInit(); CameraAdjsInit(); SetAssertProc(AssertPrepare, 0); my_InitializeIntercom(); // InitializeIntercom(); AfeGainCmosParamInit(); EngineInit(); EDmacPriorityManager(); EngineResourceInit(); PowerMgrInit(0); ClockInit(1); RegisterISR_CAPREADY(); FaceSensorInit(); RemDrvInit(); ActSweepInit(); LcdInit(); DisplayInit1(); DisplayInit2(); PowerSaveProcInit(); sub_FFA03B0C(); sub_FFA05114(); InitializeImagePlayDriver(); LensNameTblInit(); LensPOTblInit(); FlyingInit(); CaptureInit(); BathtubSaturateInit(); Module_CaptureImagePass(); ClearSomeCapMem(); ColorAdjustmentsInit(); Module_PreDarkPassInit(); LoadSystemInfo(); SharedBufferInit(0x10800000, 0x18000000, 0xEE0000, 0xEE0000); FileCacheInit(); PackMemInit(); ImagePropInit(); DigPropInit(); ShootMainInit(); OlcInfoInit(); RegisterISR_EMERGENCY_CARDDOOR(); my_MainCtrlInit(); CaptureSemaphoreInit(); VShadingInit(); Module_CaptureDarkPassInit(); Module_DarkSubtractionPassInit(); BathtubInit(); Module_BathtubCorrectPassInit(); Module_VObIntegPassInit(); SetProjectionInit(); Module_DefectsDetectPassInit(); DefsInit(); WbDetectionInit(); ObInit(); Module_WbDetectionPassInit(); DefsProcInit(); Module_ObAreaCopyPassInit(); Module_AdditionVTwoLinePassInit(); VShadingProcInit(); Module_VShadingCorrectPassInit(); sub_FFA24838(); HuffmanInit(); RawToJpegPass_L_Init(); RawToJpegPass_M2_Init(); RawToJpegPass_S_Init(); YcToJpegLargeFastInit(); YcToJpegM2FastInit(); YcToJpegSFastInit(); RawToLosslessInit(); Module_YcToTwainInit(); RawToYcPass_S_Init(); RawToYPackPass_S_Init(); DvlpInit(); DecodeJpegPassInit(); HistPassInit(); RectangleColorPassInit(); RectangleCopyPassInit(); ResizeYuvPassInit(); sub_FFA35354(); LpfPassInit(); EncodeJpegPassInit(); AdjRgbGainInit(); LuckyInit(); SysInfoProcInit(); TablesInit(); ColorInit(); CtrlManRecursiveLock(); CtrlSrvInit(0x19); LangConInit(); sub_FF926E40(); CreateDispSwControlPubInstance(); CreateMemoryManagerPubInstance(); my_GUIInit(); //GUIInit(); GUIApiCalls(); InitializeImagePlayer(); ColorBarProcsInit(); LcdAdjustProcsInit(); sub_FFB29348(); CMOSParamInit(); CameraSettingsInit(); BootDiskProcsInit(); DDDInit(); TFTInit(); RegisterResourceName(hResourceName, "USR ROOT DEVICE HANDLE", 0x7B); RegisterResource_env(0xC02200B8, "U2VBUS"); RegisterResource_env(1, "USBC20 VBUS SUPPORT"); RegisterResource_env(0x14, "DEVICESPEED"); USBC20_Init(); USBC20_USBIF_Init(); USBC20_BUFCON_Init(); USBC20_CLK_Init(); USBC20_HDMAC_Init(); DCPClassFunctionsInit(); USBDriverInit(); RapiSwitcherInit(); DCPClassInit(); RAPITransportUSBInit(); PTPRespondInit(); PTPFrameworkInit(); StartupPtpResponder(); RapiTransportManagerInit(); DCPClassInit(); EventProcServerInit(); sub_FFA5D8A0(); DCPInit(); SesnMngrInit(); MemMngrInit(); InitializeRapiTransportManager(); PrintInit(); sub_FF95EC54(); SomePrintInit(); sub_FF9EB94C(); InitializeUSBDriver(); TransMemoryInit(); InitializeComCtrl(); FactoryModeInit(); DP_Init(0, 0x1B, 0, 0); return_0(); sub_FF98CF4C(); EdLedProcsInit(); CallBacksInit(); RegistNotifyConnectDT(); DPOF_Initialize(); MpuMonInit(); StartConsole(); }
/* window procedure */ LRESULT CALLBACK PlotWindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { static int x0,y0,xep,yep; int xe, ye, prevmix; static double fx0,fy0; double fxe, fye; double angle; char buf[BSIZE_SP]; char buf2[128]; char *t; HDC hdc; HPEN OldPen; HPEN NewPen; switch (uMsg) { case WM_SYSCOMMAND: { /* test command */ int cmd = wParam & ID_MASK; switch(cmd) { case ID_DRUCKEN: return PrintPlot( hwnd); case ID_DRUCKEINR: return PrintInit( hwnd); case ID_HARDCOPY: return HcpyPlot( hwnd); case ID_HARDCOPY_BW: return HcpyPlotBW( hwnd); } } goto WIN_DEFAULT; case WM_LBUTTONDOWN: { GRAPH * gr = pGraph( hwnd); xep = x0 = LOWORD (lParam); yep = y0 = HIWORD (lParam); /* generate x,y data from grid coordinates */ WIN_ScreentoData(gr, x0, y0, &fx0, &fy0); } goto WIN_DEFAULT; case WM_MOUSEMOVE: /* left mouse button: connect coordinate pair by dashed pair of x, y lines */ if (wParam & MK_LBUTTON) { hdc = GetDC (hwnd) ; if (isblack) prevmix = SetROP2(hdc, R2_XORPEN); else prevmix = SetROP2(hdc, R2_NOTXORPEN); /* Create white dashed pen */ NewPen = CreatePen( LType(12), 0, ColorTable[1] ); OldPen = SelectObject(hdc, NewPen); /* draw lines with previous coodinates -> delete old line because of XOR */ MoveToEx (hdc, x0, y0, NULL) ; LineTo (hdc, x0, yep) ; LineTo (hdc, xep, yep); /* get new end point */ xe = LOWORD (lParam); ye = HIWORD (lParam); /* draw new lines */ MoveToEx (hdc, x0, y0, NULL) ; LineTo (hdc, x0, ye) ; LineTo (hdc, xe, ye); /* restore standard color mix */ SetROP2(hdc, prevmix); OldPen = SelectObject(hdc, OldPen); DeleteObject( NewPen); ReleaseDC (hwnd, hdc) ; /* restore new to previous coordinates */ yep = ye; xep = xe; } /* right mouse button: create white (black) dashed box */ else if (wParam & MK_RBUTTON){ hdc = GetDC (hwnd) ; if (isblack) prevmix = SetROP2(hdc, R2_XORPEN); else prevmix = SetROP2(hdc, R2_NOTXORPEN); /* Create white (black) dashed pen */ NewPen = CreatePen( LType(12), 0, ColorTable[1] ); OldPen = SelectObject(hdc, NewPen); /* draw box with previous coodinates -> delete old lines because of XOR */ MoveToEx (hdc, x0, y0, NULL) ; LineTo (hdc, x0, yep) ; LineTo (hdc, xep, yep); LineTo (hdc, xep, y0) ; LineTo (hdc, x0, y0); /* get new end point */ xe = LOWORD (lParam); ye = HIWORD (lParam); /* draw new box */ MoveToEx (hdc, x0, y0, NULL) ; LineTo (hdc, x0, ye) ; LineTo (hdc, xe, ye); LineTo (hdc, xe, y0) ; LineTo (hdc, x0, y0); /* restore standard color mix */ SetROP2(hdc, prevmix); OldPen = SelectObject(hdc, OldPen); DeleteObject( NewPen); ReleaseDC (hwnd, hdc) ; /* restore new to previous coordinates */ yep = ye; xep = xe; } goto WIN_DEFAULT; /* get final coordinates upon left mouse up */ /* calculate and print out the data */ case WM_LBUTTONUP: { GRAPH * gr = pGraph( hwnd); InvalidateRect (hwnd, NULL, TRUE) ; xe = LOWORD (lParam); ye = HIWORD (lParam); WIN_ScreentoData(gr, xe, ye, &fxe, &fye); /* print it out */ if (xe == x0 && ye == y0) { /* only one location */ fprintf(stdout, "\nx0 = %g, y0 = %g\n", fx0, fy0); if (gr->grid.gridtype == GRID_POLAR || gr->grid.gridtype == GRID_SMITH || gr->grid.gridtype == GRID_SMITHGRID) { angle = RAD_TO_DEG * atan2( fy0, fx0 ); fprintf(stdout, "r0 = %g, a0 = %g\n", sqrt( fx0*fx0 + fy0*fy0 ), (angle>0)?angle:(double) 360+angle); } } else { /* need to print info about two points */ fprintf(stdout, "\nx0 = %g, y0 = %g x1 = %g, y1 = %g\n", fx0, fy0, fxe, fye); fprintf(stdout, "dx = %g, dy = %g\n", fxe-fx0, fye - fy0); if (xe != x0 && ye != y0) { /* add slope info if both dx and dy are zero, */ /* because otherwise either dy/dx or dx/dy is zero, */ /* which is uninteresting */ fprintf(stdout, "dy/dx = %g dx/dy = %g\n", (fye-fy0)/(fxe-fx0), (fxe-fx0)/(fye-fy0)); } } SetFocus( swString); } goto WIN_DEFAULT; /* get starting coordinates upon right mouse button down */ case WM_RBUTTONDOWN: { GRAPH * gr = pGraph( hwnd); x0 = xep = LOWORD (lParam); y0 = yep = HIWORD (lParam); WIN_ScreentoData(gr, x0, y0, &fx0, &fy0); } goto WIN_DEFAULT; /* get final coordinates upon right mouse button up */ /* copy xlimit, ylimit command into buf */ /* start plot loop with argument buf */ case WM_RBUTTONUP: { GRAPH * gr = pGraph( hwnd); InvalidateRect (hwnd, NULL, TRUE) ; xe = LOWORD (lParam); ye = HIWORD (lParam); /* do nothing if mouse curser is not moved in both x and y */ if ((xe == x0) || (ye == y0)) { SetFocus( swString); goto WIN_DEFAULT; } WIN_ScreentoData(gr, xe, ye, &fxe, &fye); strncpy(buf2, gr->plotname, sizeof(buf2)); if ((t = index(buf2, ':'))) /* strchr */ *t = 0; if (!eq(plot_cur->pl_typename, buf2)) { (void) sprintf(buf, // "setplot %s; %s xlimit %e %e ylimit %e %e; setplot $curplot\n", "setplot %s; %s xlimit %e %e ylimit %e %e\n", buf2, gr->commandline, fx0, fxe, fy0, fye); } else { (void) sprintf(buf, "%s xlimit %e %e ylimit %e %e\n", gr->commandline, fx0, fxe, fy0, fye); } (void) cp_evloop(buf); SetFocus( swString); } goto WIN_DEFAULT; case WM_CLOSE: /* close window */ { GRAPH * g = pGraph( hwnd); if (g) { /* if g equals currentgraph, set a new currentgraph. Otherwise gr_resize(g) might fail. */ if (g == currentgraph) currentgraph = FindGraph(g->graphid - 1); DestroyGraph(g->graphid); } } goto WIN_DEFAULT; case WM_PAINT: /* replot window (e.g. after Resize) */ { PAINTSTRUCT ps; GRAPH * g; tpWindowData wd; HDC saveDC; /* the DC from BeginPaint is different... */ HDC newDC; /* has to happen */ newDC = BeginPaint( hwnd, &ps); g = pGraph( hwnd); if (g) { wd = pWindowData(g); if (wd) { if (!wd->PaintFlag && !wd->FirstFlag) { /* avoid recursive call */ wd->PaintFlag = 1; /* get window sizes */ GetClientRect( hwnd, &(wd->Area)); g->absolute.width = wd->Area.right; g->absolute.height = wd->Area.bottom; /* switch DC */ saveDC = wd->hDC; wd->hDC = newDC; // currentgraph = g; /* plot anew */ gr_resize(g); /* switch DC */ wd->hDC = saveDC; /* ready */ wd->PaintFlag = 0; } } } /* finish */ EndPaint( hwnd, &ps); } return 0; default: WIN_DEFAULT: return DefWindowProc( hwnd, uMsg, wParam, lParam); } }