Ejemplo n.º 1
0
void AnnotWriter::DoFreeText(FreeTextAnnot* a){
	GString appearance;
	char buf[250];
	PDFFont* font;
	GfxRGB* color;
	// build appearance string
	font = a->GetFont();
	color = a->GetFontColor();
	appearance.clear();
	// color
	sprintf(buf, "[%g %g %g] rg ", colToDbl(color->r), colToDbl(color->g), colToDbl(color->b));
	appearance.append(buf);

	// font and size
	sprintf(buf, "/%s %g Tf", font->GetShortName(), a->GetFontSize());
	appearance.append(buf);
	a->SetAppearance(&appearance);

	DoStyledAnnot(a);
	AddAnnotSubtype("FreeText");
	AddAnnotContents(a);
	AddString(&mAnnot, "DA", a->GetAppearance());
	if (a->GetJustification() != left_justify) {
		AddInteger(&mAnnot, "Q", a->GetJustification());
	}

	WriteFont(a->GetFont());
}
Ejemplo n.º 2
0
void TextComp::Write (ostream& out) {
    GraphicComp::Write(out);
    TextGraphic* text = GetText();

    out << text->GetLineHeight() << "\n";
    WriteString(text->GetOriginal(), out);

    WriteBgFilled(text->BgFilled(), out);
    WriteColor(text->GetFgColor(), out);
    WriteColor(text->GetBgColor(), out);
    WriteFont(text->GetFont(), out);
    WriteTransformer(text->GetTransformer(), out);
}
Ejemplo n.º 3
0
void WriteXYLabelSpec(const PSC_XYLabelSpec& labelSpec)
{
    const int specVer = 3;  // start at 3 for conmpatibility
    WriteInt(specVer);
    WriteLine();

    WriteInt(labelSpec.labelPen);
    WriteFont(labelSpec.labelFont);

    WriteInt(int(labelSpec.horizontalPos));
    WriteInt(int(labelSpec.verticalPos));

    WriteInt(labelSpec.pixelOffset);
    WriteBool(labelSpec.clipToAxes);
    WriteLine();

}
Ejemplo n.º 4
0
//
//  FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
//
//  PURPOSE:  Processes messages for the main window.
//
//  WM_COMMAND	- process the application menu
//  WM_PAINT	- Paint the main window
//  WM_DESTROY	- post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	int wmId, wmEvent;
	PAINTSTRUCT ps;
	HDC hdc;
	TCHAR szHello[MAX_LOADSTRING];
	LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING);

	switch (message) 
	{
		case WM_COMMAND:
			wmId    = LOWORD(wParam); 
			wmEvent = HIWORD(wParam); 
			// Parse the menu selections:
			switch (wmId)
			{
				case IDM_ABOUT:
				   DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
				   break;
				case IDM_EXIT:
				   DestroyWindow(hWnd);
				   break;
				case IDM_SAVE:
					WriteFont(hWnd);
					break;
				default:
				   return DefWindowProc(hWnd, message, wParam, lParam);
			}
			break;
		case WM_PAINT:
			hdc = BeginPaint(hWnd, &ps);
			// TODO: Add any drawing code here...
			RECT rt;
			GetClientRect(hWnd, &rt);
			//DrawText(hdc, szHello, strlen(szHello), &rt, DT_CENTER);
			EndPaint(hWnd, &ps);
			break;
		case WM_DESTROY:
			PostQuitMessage(0);
			break;
		default:
			return DefWindowProc(hWnd, message, wParam, lParam);
   }
   return 0;
}
Ejemplo n.º 5
0
void WriteTA(Setting& s, TextAttributes& taResult)
{
	UpdateSetting(s,"position", (int&)taResult.position, Setting::TypeInt);
	UpdateSetting(s,"posType", (int&)taResult.posType, Setting::TypeInt);
	UpdateSetting(s,"xPosRatio", taResult.xPosRatio, Setting::TypeInt);
	UpdateSetting(s,"yPosRatio", taResult.yPosRatio, Setting::TypeInt);
	std::string text(taResult.text);
	UpdateSetting(s,"text", text, Setting::TypeString);
	UpdateSetting(s,"backgroundColor", (int&)taResult.backgroundColor, Setting::TypeInt);
	UpdateSetting(s,"textColor", (int&)taResult.textColor, Setting::TypeInt);
	UpdateSetting(s,"isFontSelected", taResult.isFontSelected, Setting::TypeInt);
	Setting* sf;
	if (s.exists("Font"))
		sf = &(s["Font"]);
	else
		sf = &(s.add("Font", Setting::TypeGroup));
	WriteFont(*sf, taResult.logfont);
}
Ejemplo n.º 6
0
void WriteXYZLabelSpec(const PSC_XYZLabelSpec& labelSpec)
{
    const int specVer = 1; // add clip to axes
//    const int specVer = 0;
    WriteInt(specVer);
    WriteLine();

    WriteInt(labelSpec.labelPen);
    WriteFont(labelSpec.labelFont);

    WriteInt(int(labelSpec.labelAttitude));
    WriteBool(labelSpec.autoLabelRotation);
    WriteDouble(labelSpec.rotationAngle);

    WriteInt(int(labelSpec.horizontalPos));
    WriteInt(int(labelSpec.verticalPos));
    WriteBool(labelSpec.clipToAxes);
    WriteLine();
}
Ejemplo n.º 7
0
void PPO_DataLabels::WriteToFile()
{
    const int objMajVer = 1;   // increased max data labels to 16
//    const int objMajVer = 0;
    const int objMinVer = 0;

    WriteObjectHeader(objMajVer, objMinVer);
    PPO_AnnoBase::WriteToFile();

    WriteFuncObjRef(penSetObjRef);

    for ( int i = 0; i < PFO_DataLabels::maxDataLabels; i++)
    {
        WriteFuncObjRef(labelData[i].labelObjRef);
        WriteBool(labelData[i].doLabel);
        WriteInt(int(labelData[i].labAlign));

        WriteBool(labelData[i].overrideFormat);
        WriteInt(int(labelData[i].labelFormat.format));
        WriteInt(labelData[i].labelFormat.digitsPrecision);
        WriteBool(labelData[i].overrideMainLabel);
        WriteLine();

        WriteText(labelData[i].mainLabel);
        WriteText(labelData[i].unitsLabel);
    }

    SetRealConvFormat(SC_RealFormat(ncf_Decimal, 3));
    WriteDouble(ulLocation.pX);
    WriteDouble(ulLocation.pY);
    WriteLine();

    WriteText(legendTitle);

    WriteBool(frameLegend);
    WriteInt (frameThick);
    WriteBool(opaqueBackground);
    WriteInt (legendPen);
    WriteInt (minDataFieldWidth);
    WriteLine();

    WriteFont(legendFont);
}
Ejemplo n.º 8
0
void WriteAnnoSpec(const PSC_AnnoSpec& annoSpec)
{
    const int specVer = 0;
    WriteInt(specVer);
    WriteLine();

    SetRealConvFormat(SC_RealFormat(ncf_Decimal, 3));
    WriteDouble(annoSpec.ulLocation.pX);
    WriteDouble(annoSpec.ulLocation.pY);
    WriteLine();

    WriteText(annoSpec.legendTitle);

    WriteBool(annoSpec.frameLegend);
    WriteInt (annoSpec.frameThick);
    WriteBool(annoSpec.opaqueBackground);
    WriteInt (annoSpec.legendPen);

    WriteFont(annoSpec.legendFont);
}
Ejemplo n.º 9
0
void PPO_SeriesLegend::WriteToFile()
{
    const int objMajVer = 1; // upped max to 12 from 6
//    const int objMajVer = 0;
    const int objMinVer = 0;

    WriteObjectHeader(objMajVer, objMinVer);
    PPO_AnnoBase::WriteToFile();

    WriteFuncObjRef(penSetObjRef);

    WriteInt(PFO_SeriesLegend::maxSeriesLegend);
    WriteLine();
    for ( int i = 0; i < PFO_SeriesLegend::maxSeriesLegend; i++)
    {
        WriteFuncObjRef(legendData[i].seriesObjRef);
        WriteBool(legendData[i].doSeries);
        WriteLine();
    }

    SetRealConvFormat(SC_RealFormat(ncf_Decimal, 3));
    WriteDouble(ulLocation.pX);
    WriteDouble(ulLocation.pY);
    WriteLine();

    WriteDouble(seriesSize);
    WriteInt(seriesNpts);
    WriteLine();

    WriteText(legendTitle);

    WriteBool(frameLegend);
    WriteInt (frameThick);
    WriteBool(opaqueBackground);
    WriteInt (legendPen);
    WriteLine();

    WriteFont(legendFont);
}
Ejemplo n.º 10
0
void DrawRawFont(int x, int y, char *message) {
  WriteFont(x, y, message);
}
Ejemplo n.º 11
0
void settings_draw_page(int page_num, int option, file_handle *file) {
    doBackdrop();
    DrawEmptyBox(20,60, vmode->fbWidth-20, 460, COLOR_BLACK);

    // Save Settings to current device (**Shown on all tabs**)
    /** Global Settings (Page 1/) */
    // IPL/Game Language [English/German/French/Spanish/Italian/Dutch]
    // IPL/Game Audio [Mono/Stereo]
    // SD/IDE Speed [16/32 MHz]
    // Swiss Video Mode [576i (PAL 50Hz), 480i (NTSC 60Hz), 480p (NTSC 60Hz)]
    // Stop DVD Motor on startup [Yes/No]

    /** Advanced Settings (Page 2/) */
    // Enable USB Gecko Debug via Slot B [Yes/No]
    // Force No DVD Drive Mode [Yes/No]
    // Hide Unknown file types [Yes/No]	// TO BE IMPLEMENTED

    /** Current Game Settings - only if a valid GCM file is highlighted (Page 3/) */
    // Force Video Mode [576i (PAL 50Hz), 480i (NTSC 60Hz), 480p (NTSC 60Hz), Auto]
    // Mute Audio Streaming [Yes/No]
    // Try to mute audio stutter [Yes/No]

    if(!page_num) {
        WriteFont(30, 65, "Global Settings (1/3):");
        WriteFontStyled(30, 120, "IPL/Game Language:", 1.0f, false, defaultColor);
        DrawSelectableButton(400, 120, -1, 150, getSramLang(swissSettings.sramLanguage), option == 0 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 160, "IPL/Game Audio:", 1.0f, false, defaultColor);
        DrawSelectableButton(400, 160, -1, 190, swissSettings.sramStereo ? "Stereo":"Mono", option == 1 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 200, "SD/IDE Speed:", 1.0f, false, defaultColor);
        DrawSelectableButton(400, 200, -1, 230, swissSettings.exiSpeed ? "32 MHz":"16 MHz", option == 2 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 240, "Swiss Video Mode:", 1.0f, false, defaultColor);
        DrawSelectableButton(400, 240, -1, 270, uiVModeStr[swissSettings.uiVMode], option == 3 ? B_SELECTED:B_NOSELECT,-1);
    }
    else if(page_num == 1) {
        WriteFont(30, 65, "Advanced Settings (2/3):");
        WriteFontStyled(30, 120, "Enable USB Gecko Debug via Slot B:", 1.0f, false, defaultColor);
        DrawSelectableButton(500, 120, -1, 150, swissSettings.debugUSB ? "Yes":"No", option == 0 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 160, "Force No DVD Drive Mode:", 1.0f, false, defaultColor);
        DrawSelectableButton(500, 160, -1, 190, swissSettings.hasDVDDrive ? "No":"Yes", option == 1 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 200, "Hide Unknown file types:", 1.0f, false, defaultColor);
        DrawSelectableButton(500, 200, -1, 230, swissSettings.hideUnknownFileTypes ? "Yes":"No", option == 2 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 240, "Stop DVD Motor on startup:", 1.0f, false, defaultColor);
        DrawSelectableButton(500, 240, -1, 270, swissSettings.stopMotor ? "Yes":"No", option == 3 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 280, "Enable WiiRD debugging in Games:", 1.0f, false, defaultColor);
        DrawSelectableButton(500, 280, -1, 310, swissSettings.wiirdDebug ? "Yes":"No", option == 4 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 320, "Enable File Management:", 1.0f, false, defaultColor);
        DrawSelectableButton(500, 320, -1, 350, swissSettings.enableFileManagement ? "Yes":"No", option == 5 ? B_SELECTED:B_NOSELECT,-1);
    }
    else if(page_num == 2) {
        WriteFont(30, 65, "Current Game Settings (3/3):");
        WriteFontStyled(30, 110, "Force Video Mode:", 1.0f, false, file != NULL ? defaultColor : disabledColor);
        DrawSelectableButton(480, 110, -1, 135, gameVModeStr[swissSettings.gameVMode], option == 0 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 140, "If Progressive, Soften:", 1.0f, false, file != NULL ? defaultColor : disabledColor);
        DrawSelectableButton(480, 140, -1, 165, softProgressiveStr[swissSettings.softProgressive], option == 1 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 170, "Force Widescreen:", 1.0f, false, file != NULL ? defaultColor : disabledColor);
        DrawSelectableButton(480, 170, -1, 195, forceWidescreenStr[swissSettings.forceWidescreen], option == 2 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 200, "Force Anisotropy:", 1.0f, false, file != NULL ? defaultColor : disabledColor);
        DrawSelectableButton(480, 200, -1, 225, swissSettings.forceAnisotropy ? "Yes":"No", option == 3 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 230, "Disable Audio Streaming:", 1.0f, false, file != NULL ? defaultColor : disabledColor);
        DrawSelectableButton(480, 230, -1, 255, swissSettings.muteAudioStreaming ? "Yes":"No", option == 4 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 260, "Force Encoding:", 1.0f, false, file != NULL ? defaultColor : disabledColor);
        DrawSelectableButton(480, 260, -1, 285, forceEncodingStr[swissSettings.forceEncoding], option == 5 ? B_SELECTED:B_NOSELECT,-1);
    }
    if(page_num != 0) {
        DrawSelectableButton(40, 390, -1, 420, "Back",
                             option == settings_count_pp[page_num]-(page_num != 2 ? 3:2) ? B_SELECTED:B_NOSELECT,-1);
    }
    if(page_num != 2) {
        DrawSelectableButton(510, 390, -1, 420, "Next",
                             option == settings_count_pp[page_num]-2 ? B_SELECTED:B_NOSELECT,-1);
    }
    DrawSelectableButton(100, 425, -1, 455, "Save & Exit", option == settings_count_pp[page_num]-1 ? B_SELECTED:B_NOSELECT,-1);
    DrawSelectableButton(320, 425, -1, 455, "Discard & Exit", option ==  settings_count_pp[page_num] ? B_SELECTED:B_NOSELECT,-1);
    DrawFrameFinish();
}
Ejemplo n.º 12
0
void info_draw_page(int page_num) {
	doBackdrop();
	DrawEmptyBox(20,60, vmode->fbWidth-20, 420, COLOR_BLACK);
	syssram* sram = __SYS_LockSram();
	__SYS_UnlockSram(0);
	
	// System Info (Page 1/3)
	if(!page_num) {
		WriteFont(30, 65, "System Info (1/3):");
		// Model
		if(is_gamecube()) {
			if(*(u32*)&driveVersion[0] == 0x20010831) {
				sprintf(topStr, "Panasonic Q SL-GC10-S");
			}
			else if(IPLInfo[0x55]=='M') {							// MPAL 1.1 (Brazil)
				sprintf(topStr, "Nintendo GameCube DOL-002 (BRA)");
			}
			else if((!IPLInfo[0x55])									// NTSC 1.0 
					|| (IPLInfo[0x55] == 'P' && IPLInfo[0x65]=='0')		// PAL 1.0 
					|| (IPLInfo[0x55] != 'P' && IPLInfo[0x65]=='1')) {	// NTSC 1.1
				sprintf(topStr, "Nintendo GameCube DOL-001");
			}
			else if((IPLInfo[0x55] == 'P' && IPLInfo[0x65]=='0')	// PAL 1.1
					|| IPLInfo[0x65]=='2') {						// NTSC 1.2
				sprintf(topStr, "Nintendo GameCube DOL-101");
			}
		}
		else {
			sprintf(topStr, "Nintendo Wii");
		}
		WriteFontStyled(640/2, 110, topStr, 1.0f, true, defaultColor);
		// IPL version string
		if(is_gamecube()) {
			if(!IPLInfo[0x55]) {
				sprintf(topStr, "NTSC Revision 1.0");
			}
			else {
				sprintf(topStr, "%s", &IPLInfo[0x55]);
			}
		}
		else {
			sprintf(topStr, "Wii IPL");
		}
		WriteFontStyled(640/2, 140, topStr, 1.0f, true, defaultColor);
		if(swissSettings.hasDVDDrive) {
			if((!__wkfSpiReadId() || (__wkfSpiReadId() == 0xFFFFFFFF))) {
				sprintf(topStr, "DVD Drive %02X %02X%02X/%02X (%02X)",driveVersion[2],driveVersion[0],driveVersion[1],driveVersion[3],driveVersion[4]);
			} else {
				sprintf(topStr, "WKF Serial %s",wkfGetSerial());
			}
		}
		else
			sprintf(topStr, "No DVD Drive present");
		WriteFontStyled(640/2, 170, topStr, 1.0f, true, defaultColor);
		sprintf(topStr, "%s",videoStr);
		WriteFontStyled(640/2, 200, topStr, 1.0f, true, defaultColor);
		sprintf(topStr,"%s / %s",getSramLang(sram->lang), sram->flags&4 ? "Stereo":"Mono");
		WriteFontStyled(640/2, 230, topStr, 1.0f, true, defaultColor);
		sprintf(topStr,"PVR %08X ECID %08X:%08X:%08X",mfpvr(),mfspr(0x39C),mfspr(0x39D),mfspr(0x39E));
		WriteFontStyled(640/2, 260, topStr, 0.75f, true, defaultColor);
	}
	else if(page_num == 1) {
		WriteFont(30, 65, "Device Info (2/3):");
		sprintf(topStr,"BBA: %s", bba_exists ? "Installed":"Not Present");
		WriteFont(30, 110, topStr);
		if(exi_bba_exists()) {
			sprintf(topStr,"IP: %s", net_initialized ? bba_ip:"Not Available");
		}
		else {
			sprintf(topStr,"IP: Not Available");
		}
		WriteFont(270, 110, topStr);
		sprintf(topStr,"Component Cable Plugged in: %s",VIDEO_HaveComponentCable()?"Yes":"No");
		WriteFont(30, 140, topStr);
		if(usb_isgeckoalive(0)||usb_isgeckoalive(1)) {
			sprintf(topStr,"USB Gecko: Installed in %s",usb_isgeckoalive(0)?"Slot A":"Slot B");
		}
		else {
			sprintf(topStr,"USB Gecko: Not Present");
		}
		WriteFont(30, 170, topStr);
		if (!deviceHandler_initial) {
			sprintf(topStr, "Current Device: No Device Selected");
		}
		else if(deviceHandler_initial == &initial_SD0 || deviceHandler_initial == &initial_SD1) {
			int slot = (deviceHandler_initial->name[2] == 'b');
			sprintf(topStr, "Current Device: %s Card in %s @ %s",!SDHCCard?"SDHC":"SD",!slot?"Slot A":"Slot B",!swissSettings.exiSpeed?"16Mhz":"32Mhz");
		}
		else if(deviceHandler_initial == &initial_DVD) {
			sprintf(topStr, "Current Device: %s DVD Disc",dvdDiscTypeStr);
		}
		else if(deviceHandler_initial == &initial_IDE0 || deviceHandler_initial == &initial_IDE1) {
			int slot = (deviceHandler_initial->name[3] == 'b');
			sprintf(topStr, "Current Device: %d GB HDD in %s",ataDriveInfo.sizeInGigaBytes,!slot?"Slot A":"Slot B");
		}
		else if(deviceHandler_initial == &initial_Qoob) {
			sprintf(topStr, "Current Device: Qoob IPL Replacement");
		}
		else if(deviceHandler_initial == &initial_WODE) {
			sprintf(topStr, "Current Device: Wode Jukebox");
		}
		else if(deviceHandler_initial == &initial_CARDA || deviceHandler_initial == &initial_CARDB) {
			sprintf(topStr, "Current Device: Memory Card in %s",!deviceHandler_initial->fileBase?"Slot A":"Slot B");
		}
		else if(deviceHandler_initial == &initial_USBGecko) {
			sprintf(topStr, "Current Device: USB Gecko");
		}
		else if(deviceHandler_initial == &initial_WKF) {
			sprintf(topStr, "Current Device: Wiikey Fusion");
		}
		else if(deviceHandler_initial == &initial_SYS) {
			sprintf(topStr, "Current Device: System");
		}
		WriteFont(30, 200, topStr);
	}
	else if(page_num == 2) {
		WriteFont(30, 65, "Credits (3/3):");
		WriteFontStyled(640/2, 115, "Swiss ver 0.4", 1.0f, true, defaultColor);
		WriteFontStyled(640/2, 140, "by emu_kidid 2015", 0.75f, true, defaultColor);
		sprintf(txtbuffer, "Commit %s Revision %s SD Gecko Slot B Cheats Mod", GITREVISION, GITVERSION);
		WriteFontStyled(640/2, 165, txtbuffer, 0.75f, true, defaultColor);
		WriteFontStyled(640/2, 210, "Thanks to", 0.75f, true, defaultColor);
		WriteFontStyled(640/2, 228, "Testers & libOGC/dkPPC authors", 0.75f, true, defaultColor);
		WriteFontStyled(640/2, 246, "sepp256 for GX / FIX94 for Audio Streaming", 0.75f, true, defaultColor);
		WriteFontStyled(640/2, 264, "Extrems for video patches / Megalomaniac for builds", 0.75f, true, defaultColor);
        WriteFontStyled(640/2, 282, "Fishaman P for cheats support with all devices", 0.75f, true, defaultColor);
		WriteFontStyled(640/2, 318, "Web/Support http://www.gc-forever.com/", 0.75f, true, defaultColor);
		WriteFontStyled(640/2, 336, "Source at https://github.com/emukidid/swiss-gc", 0.75f, true, defaultColor);
		WriteFontStyled(640/2, 354, "Visit us at #gc-forever on EFNet", 0.75f, true, defaultColor);
	}
	if(page_num != 2) {
		WriteFont(520, 390, "->");
	}
	if(page_num != 0) {
		WriteFont(100, 390, "<-");
	}
	WriteFontStyled(640/2, 400, "Press A to return", 1.0f, true, defaultColor);
	DrawFrameFinish();
}