Exemple #1
0
void
CBHTMLStyler::InitMustacheTypeStyles()
{
	JColormap* colormap = GetColormap();

	SetTypeStyle(kMustacheCommand - kWhitespace, JFontStyle(colormap->GetDarkGreenColor()));
}
Exemple #2
0
void
CBHTMLStyler::InitJavaScriptTypeStyles()
{
	JColormap* colormap = GetColormap();

	SetTypeStyle(kJSReservedKeyword    - kWhitespace, JFontStyle(colormap->GetDarkGreenColor()));
	SetTypeStyle(kJSString             - kWhitespace, JFontStyle(colormap->GetDarkRedColor()));
	SetTypeStyle(kJSRegexSearch        - kWhitespace, JFontStyle(colormap->GetDarkGreenColor()));
	SetTypeStyle(kDocCommentHTMLTag    - kWhitespace, JFontStyle(colormap->GetBlueColor()));
	SetTypeStyle(kDocCommentSpecialTag - kWhitespace, JFontStyle(kJFalse, kJFalse, 1, kJFalse));
}
Exemple #3
0
void
CBHTMLStyler::InitJSPTypeStyles()
{
	JColormap* colormap = GetColormap();

	SetTypeStyle(kJSPStartEnd         - kWhitespace, JFontStyle(kJTrue, kJFalse, 0, kJFalse, colormap->GetDarkGreenColor()));
	SetTypeStyle(kJSPComment          - kWhitespace, JFontStyle(colormap->GetGrayColor(50)));
	SetTypeStyle(kJavaReservedKeyword - kWhitespace, JFontStyle(colormap->GetDarkGreenColor()));
	SetTypeStyle(kJavaBuiltInDataType - kWhitespace, JFontStyle(colormap->GetDarkGreenColor()));
	SetTypeStyle(kJavaString          - kWhitespace, JFontStyle(colormap->GetDarkRedColor()));
	SetTypeStyle(kJavaCharConst       - kWhitespace, JFontStyle(colormap->GetDarkRedColor()));
}
CBCShellStyler::CBCShellStyler()
    :
    CBStylerBase(kCurrentTypeListVersion, kTypeCount, kTypeNames,
                kEditDialogTitle, kCBCShellStyleID, kCBCShellFT),
    CBCShellScanner()
{
    JFontStyle blankStyle;
    for (JIndex i=1; i<=kTypeCount; i++)
    {
        SetTypeStyle(i, blankStyle);
    }

    JColormap* colormap = GetColormap();

    SetTypeStyle(kVariable          - kWhitespace, JFontStyle(colormap->GetBlueColor()));
    SetTypeStyle(kReservedWord      - kWhitespace, JFontStyle(colormap->GetDarkGreenColor()));
    SetTypeStyle(kBuiltInCommand    - kWhitespace, JFontStyle(colormap->GetDarkGreenColor()));
    SetTypeStyle(kSingleQuoteString - kWhitespace, JFontStyle(colormap->GetBrownColor()));
    SetTypeStyle(kDoubleQuoteString - kWhitespace, JFontStyle(colormap->GetDarkRedColor()));
    SetTypeStyle(kExecString        - kWhitespace, JFontStyle(colormap->GetPinkColor()));
    SetTypeStyle(kComment           - kWhitespace, JFontStyle(colormap->GetGrayColor(50)));
    SetTypeStyle(kError             - kWhitespace, JFontStyle(colormap->GetRedColor()));

    JPrefObject::ReadPrefs();
}
CBCSharpStyler::CBCSharpStyler()
	:
	CBStylerBase(kCurrentTypeListVersion, kTypeCount, kTypeNames,
				 kEditDialogTitle, kCBCSharpStyleID, kCBCSharpFT),
	CBCSharpScanner()
{
	JFontStyle blankStyle;
	for (JIndex i=1; i<=kTypeCount; i++)
		{
		SetTypeStyle(i, blankStyle);
		}

	JColormap* colormap   = GetColormap();
	const JColorIndex red = colormap->GetRedColor();

	SetTypeStyle(kReservedCKeyword   - kWhitespace, JFontStyle(colormap->GetDarkGreenColor()));
	SetTypeStyle(kBuiltInDataType    - kWhitespace, JFontStyle(colormap->GetDarkGreenColor()));

	SetTypeStyle(kString             - kWhitespace, JFontStyle(colormap->GetDarkRedColor()));
	SetTypeStyle(kCharConst          - kWhitespace, JFontStyle(colormap->GetDarkRedColor()));

	SetTypeStyle(kComment            - kWhitespace, JFontStyle(colormap->GetGrayColor(50)));
	SetTypeStyle(kDocComment         - kWhitespace, JFontStyle(colormap->GetGrayColor(50)));
	SetTypeStyle(kPPDirective        - kWhitespace, JFontStyle(colormap->GetBlueColor()));

	SetTypeStyle(kError              - kWhitespace, JFontStyle(red));

	SetWordStyle("goto", JFontStyle(kJTrue, kJFalse, 0, kJFalse, red));

	JPrefObject::ReadPrefs();
}
CBPythonStyler::CBPythonStyler()
	:
	CBStylerBase(kCurrentTypeListVersion, kTypeCount, kTypeNames,
				 kEditDialogTitle, kCBPythonStyleID, kCBPythonFT),
	CBPythonScanner()
{
	JFontStyle blankStyle;
	for (JIndex i=1; i<=kTypeCount; i++)
		{
		SetTypeStyle(i, blankStyle);
		}

	JColormap* colormap   = GetColormap();
	const JColorIndex red = colormap->GetRedColor();

	SetTypeStyle(kReservedKeyword - kWhitespace, JFontStyle(colormap->GetDarkGreenColor()));
	SetTypeStyle(kString          - kWhitespace, JFontStyle(colormap->GetDarkRedColor()));
	SetTypeStyle(kComment         - kWhitespace, JFontStyle(colormap->GetGrayColor(50)));
	SetTypeStyle(kError           - kWhitespace, JFontStyle(red));

	JPrefObject::ReadPrefs();
}
void
JXMesaCamera::HWSetVertexColor
	(
	const JColormap&	colormap,
	const JColorIndex	color
	)
{
	JSize r,g,b;
	colormap.GetRGB(color, &r, &g, &b);
	glColor3f(r/kJMaxRGBValueF,
			  g/kJMaxRGBValueF,
			  b/kJMaxRGBValueF);
}
Exemple #8
0
void
CBHTMLStyler::InitPHPTypeStyles()
{
	JColormap* colormap = GetColormap();

	SetTypeStyle(kPHPStartEnd          - kWhitespace, JFontStyle(kJTrue, kJFalse, 0, kJFalse, colormap->GetDarkRedColor()));
	SetTypeStyle(kPHPReservedKeyword   - kWhitespace, JFontStyle(colormap->GetDarkGreenColor()));
	SetTypeStyle(kPHPBuiltInDataType   - kWhitespace, JFontStyle(colormap->GetDarkGreenColor()));
	SetTypeStyle(kPHPSingleQuoteString - kWhitespace, JFontStyle(colormap->GetBrownColor()));
	SetTypeStyle(kPHPDoubleQuoteString - kWhitespace, JFontStyle(colormap->GetDarkRedColor()));
	SetTypeStyle(kPHPHereDocString     - kWhitespace, JFontStyle(colormap->GetDarkRedColor()));
	SetTypeStyle(kPHPExecString        - kWhitespace, JFontStyle(colormap->GetPinkColor()));
	SetTypeStyle(kComment              - kWhitespace, JFontStyle(colormap->GetGrayColor(50)));
}
Exemple #9
0
CBHTMLStyler::CBHTMLStyler()
	:
	CBStylerBase(kCurrentTypeListVersion, kTypeCount, kTypeNames,
				 kEditDialogTitle, kCBHTMLStyleID, kCBPHPFT),
	CBHTMLScanner()
{
	JFontStyle blankStyle;
	for (JIndex i=1; i<=kTypeCount; i++)
		{
		SetTypeStyle(i, blankStyle);
		}

	JColormap* colormap = GetColormap();

	SetTypeStyle(kHTMLTag            - kWhitespace, JFontStyle(colormap->GetBlueColor()));
	SetTypeStyle(kHTMLScript         - kWhitespace, JFontStyle(colormap->GetDarkRedColor()));
	SetTypeStyle(kHTMLNamedCharacter - kWhitespace, JFontStyle(kJFalse, kJFalse, 1, kJFalse));
	SetTypeStyle(kHTMLComment        - kWhitespace, JFontStyle(colormap->GetGrayColor(50)));
	SetTypeStyle(kError              - kWhitespace, JFontStyle(colormap->GetRedColor()));

	InitMustacheTypeStyles();
	InitPHPTypeStyles();
	InitJSPTypeStyles();
	InitJavaScriptTypeStyles();

	const JColorIndex red = colormap->GetRedColor();
	for (JIndex i=0; i<kUnusedJavaKeywordCount; i++)
		{
		SetWordStyle(kUnusedJavaKeyword[i], JFontStyle(red));
		}
	for (JIndex i=0; i<kUnusedJSKeywordCount; i++)
		{
		SetWordStyle(kUnusedJSKeyword[i], JFontStyle(red));
		}

	JPrefObject::ReadPrefs();

	JFontStyle style;
	if (GetWordStyle("?php", &style))
		{
		RemoveWordStyle("?php");
		}
}
CBTCLStyler::CBTCLStyler()
	:
	CBStylerBase(kCurrentTypeListVersion, kTypeCount, kTypeNames,
				 kEditDialogTitle, kCBTCLStyleID, kCBTCLFT),
	CBTCLScanner()
{
	JFontStyle blankStyle;
	for (JIndex i=1; i<=kTypeCount; i++)
		{
		SetTypeStyle(i, blankStyle);
		}

	JColormap* colormap = GetColormap();

	SetTypeStyle(kPredefinedWord - kWhitespace, JFontStyle(colormap->GetDarkGreenColor()));
	SetTypeStyle(kVariable       - kWhitespace, JFontStyle(colormap->GetBlueColor()));
	SetTypeStyle(kString         - kWhitespace, JFontStyle(colormap->GetDarkRedColor()));
	SetTypeStyle(kComment        - kWhitespace, JFontStyle(colormap->GetGrayColor(50)));
	SetTypeStyle(kError          - kWhitespace, JFontStyle(colormap->GetRedColor()));

	JPrefObject::ReadPrefs();
}
Exemple #11
0
void
CBHTMLStyler::UpgradeTypeList
	(
	const JFileVersion	vers,
	JArray<JFontStyle>*	typeStyles
	)
{
	JColormap* cmap = GetColormap();

	if (vers < 1)
		{
		typeStyles->InsertElementAtIndex(2, JFontStyle(cmap->GetDarkRedColor()));
		}

	if (vers < 2)
		{
		typeStyles->InsertElementAtIndex(1, JFontStyle());

		for (JIndex i=1; i<=16; i++)
			{
			typeStyles->InsertElementAtIndex(6, JFontStyle());
			}
		}

	if (vers < 3)
		{
		typeStyles->InsertElementAtIndex(22, JFontStyle());
		typeStyles->InsertElementAtIndex(22, JFontStyle());

		typeStyles->InsertElementAtIndex(17, JFontStyle());
		typeStyles->InsertElementAtIndex(17, JFontStyle());
		typeStyles->InsertElementAtIndex(17, JFontStyle());
		typeStyles->InsertElementAtIndex(17, JFontStyle());
		typeStyles->InsertElementAtIndex(17, JFontStyle());
		}

	if (vers < 4)
		{
		typeStyles->InsertElementAtIndex(22, JFontStyle(cmap->GetDarkGreenColor()));
		}

	if (vers < 5)
		{
		for (JIndex i=1; i<=9; i++)
			{
			typeStyles->InsertElementAtIndex(17, JFontStyle());
			}
		}

	if (vers < 6)
		{
		typeStyles->InsertElementAtIndex(6, JFontStyle());
		}

	if (vers < 7)
		{
		typeStyles->InsertElementAtIndex(6, JFontStyle());
		}

	// set new values after all new slots have been created

	if (vers < 2)
		{
		InitPHPTypeStyles();
		}

	if (vers < 3)
		{
		InitJavaScriptTypeStyles();
		}

	if (vers < 5)
		{
		InitJSPTypeStyles();
		}

	if (vers < 6)
		{
		InitMustacheTypeStyles();
		}
}