367
374
(double)color.Blue / ushort.MaxValue);
377
public static Cairo.Color ToCairoColor (Gdk.Color color, double alpha)
379
return new Cairo.Color ((double)color.Red / ushort.MaxValue,
380
(double)color.Green / ushort.MaxValue,
381
(double)color.Blue / ushort.MaxValue,
370
385
protected Style ()
372
SetStyle (DefaultString, new ChunkStyle (new Gdk.Color (0, 0, 0), new Gdk.Color (255, 255, 255)));
387
SetStyle (DefaultString, 0, 0, 0, 255, 255, 255);
373
388
GetChunkStyle (DefaultString).ChunkProperties |= ChunkProperties.TransparentBackground;
375
SetStyle (CaretString, new ReferencedChunkStyle (this, DefaultString));
377
SetStyle (LineNumberString, new ChunkStyle (new Gdk.Color (172, 168, 153), new Gdk.Color (255, 255, 255)));
378
SetStyle (LineNumberFgHighlightedString, new ChunkStyle (new Gdk.Color (122, 118, 103)));
380
SetStyle (IconBarBgString, new ChunkStyle (new Gdk.Color (255, 255, 255)));
381
SetStyle (IconBarSeperatorString, new ChunkStyle (new Gdk.Color (172, 168, 153)));
383
SetStyle (FoldLineString, new ReferencedChunkStyle (this, LineNumberString));
384
SetStyle (FoldLineHighlightedString, new ReferencedChunkStyle (this, IconBarSeperatorString));
385
SetStyle (FoldToggleMarkerString, new ReferencedChunkStyle (this, DefaultString));
387
SetStyle (LineDirtyBgString, new ChunkStyle (new Gdk.Color (255, 238, 98)));
388
SetStyle (LineChangedBgString, new ChunkStyle (new Gdk.Color (108, 226, 108)));
390
SetStyle (SelectionString, new ChunkStyle (new Gdk.Color (255, 255, 255), new Gdk.Color (96, 87, 210)));
392
SetStyle (LineMarkerString, new ChunkStyle (new Gdk.Color (200, 255, 255)));
393
SetStyle (RulerString, new ChunkStyle (new Gdk.Color (187, 187, 187)));
394
SetStyle (WhitespaceMarkerString, new ReferencedChunkStyle (this, RulerString));
396
SetStyle (InvalidLineMarkerString, new ChunkStyle (new Gdk.Color (210, 0, 0)));
398
SetStyle (BreakpointString, new ChunkStyle (new Gdk.Color (255, 255, 255), new Gdk.Color (125, 0, 0)));
400
SetStyle (BreakpointMarkerColor1String, new ChunkStyle (new Gdk.Color (255, 255, 255)));
401
SetStyle (BreakpointMarkerColor2String, new ChunkStyle (new Gdk.Color (125, 0, 0)));
403
SetStyle (DisabledBreakpointBgString, new ChunkStyle (new Gdk.Color (237, 220, 220)));
405
SetStyle (CurrentDebugLineString, new ChunkStyle (new Gdk.Color (0, 0, 0), new Gdk.Color (255, 255, 0)));
406
SetStyle (CurrentDebugLineMarkerColor1String, new ChunkStyle (new Gdk.Color (255, 255, 0)));
407
SetStyle (CurrentDebugLineMarkerColor2String, new ChunkStyle (new Gdk.Color (255, 255, 204)));
408
SetStyle (CurrentDebugLineMarkerBorderString, new ChunkStyle (new Gdk.Color (102, 102, 0)));
410
SetStyle (DebugStackLineString, new ChunkStyle (new Gdk.Color (0, 0, 0), new Gdk.Color (128, 255, 128)));
411
SetStyle (DebugStackLineMarkerColor1String, new ChunkStyle (new Gdk.Color (128, 255, 128)));
412
SetStyle (DebugStackLineMarkerColor2String, new ChunkStyle (new Gdk.Color (204, 255, 204)));
413
SetStyle (DebugStackLineMarkerBorderString, new ChunkStyle (new Gdk.Color (51, 102, 51)));
415
SetStyle (InvalidBreakpointBgString, new ChunkStyle (new Gdk.Color (237, 220, 220)));
416
SetStyle (InvalidBreakpointMarkerColor1String, new ChunkStyle (new Gdk.Color (237, 220, 220)));
417
SetStyle (InvalidBreakpointMarkerBorderString, new ChunkStyle (new Gdk.Color (125, 0, 0)));
418
SetStyle (SearchTextBgString, new ChunkStyle (new Gdk.Color (250, 250, 0)));
420
SetStyle (BracketHighlightRectangleString, new ChunkStyle (new Gdk.Color (128, 128, 128), new Gdk.Color (196, 196, 196)));
422
SetStyle (BookmarkColor1String, new ChunkStyle (new Gdk.Color (255, 255, 255)));
423
SetStyle (BookmarkColor2String, new ChunkStyle (new Gdk.Color (105, 156, 235)));
425
SetStyle (ErrorUnderlineString, new ChunkStyle (new Gdk.Color (255, 0, 0)));
426
SetStyle (WarningUnderlineString, new ChunkStyle (new Gdk.Color (30, 30, 255)));
428
SetStyle ("diff.line-added", new Mono.TextEditor.ChunkStyle (new Gdk.Color (0, 0x8B, 0x8B), ChunkProperties.None));
429
SetStyle ("diff.line-removed", new Mono.TextEditor.ChunkStyle (new Gdk.Color (0x6A, 0x5A, 0xCD), ChunkProperties.None));
430
SetStyle ("diff.line-changed", new ReferencedChunkStyle (this, "text.preprocessor"));
431
SetStyle ("diff.header", new Mono.TextEditor.ChunkStyle (new Gdk.Color (0, 128, 0), ChunkProperties.Bold));
432
SetStyle ("diff.header-seperator", new Mono.TextEditor.ChunkStyle (new Gdk.Color (0, 0, 255)));
433
SetStyle ("diff.header-oldfile", new ReferencedChunkStyle (this, "diff.header"));
434
SetStyle ("diff.header-newfile", new ReferencedChunkStyle (this, "diff.header"));
435
SetStyle ("diff.location", new ReferencedChunkStyle (this, "keyword.misc"));
437
SetStyle (PrimaryTemplateColorString, new ChunkStyle (new Gdk.Color (0xB4, 0xE4, 0xB4), new Gdk.Color (0xB4, 0xE4, 0xB4)));
438
SetStyle (PrimaryTemplateHighlightedColorString, new ChunkStyle (new Gdk.Color (0, 0, 0), new Gdk.Color (0xB4, 0xE4, 0xB4)));
440
SetStyle (SecondaryTemplateColorString, new ChunkStyle (new Gdk.Color (0xFF, 0xFF, 0xFF), new Gdk.Color (0xFF, 0xFF, 0xFF)));
441
SetStyle (SecondaryTemplateHighlightedColorString, new ChunkStyle (new Gdk.Color (0x7F, 0x7F, 0x7F), new Gdk.Color (0xFF, 0xFF, 0xFF)));
390
SetStyle (CaretString, DefaultString);
392
SetStyle (LineNumberString, 172, 168, 153, 255, 255, 255);
393
SetStyle (LineNumberFgHighlightedString, 122, 118, 103);
395
SetStyle (IconBarBgString, 255, 255, 255);
396
SetStyle (IconBarSeperatorString, 172, 168, 153);
398
SetStyle (FoldLineString, LineNumberString);
399
SetStyle (FoldLineHighlightedString, IconBarSeperatorString);
400
SetStyle (FoldToggleMarkerString, DefaultString);
402
SetStyle (LineDirtyBgString, 255, 238, 98);
403
SetStyle (LineChangedBgString, 108, 226, 108);
405
SetStyle (SelectionString, 255, 255, 255, 96, 87, 210);
407
SetStyle (LineMarkerString, 200, 255, 255);
408
SetStyle (RulerString, 187, 187, 187);
409
SetStyle (WhitespaceMarkerString, RulerString);
411
SetStyle (InvalidLineMarkerString, 210, 0, 0);
413
SetStyle (BreakpointString, 255, 255, 255, 125, 0, 0);
415
SetStyle (BreakpointMarkerColor1String, 255, 255, 255);
416
SetStyle (BreakpointMarkerColor2String, 125, 0, 0);
418
SetStyle (DisabledBreakpointBgString, 237, 220, 220);
420
SetStyle (CurrentDebugLineString, 0, 0, 0, 255, 255, 0);
421
SetStyle (CurrentDebugLineMarkerColor1String, 255, 255, 0);
422
SetStyle (CurrentDebugLineMarkerColor2String, 255, 255, 204);
423
SetStyle (CurrentDebugLineMarkerBorderString, 102, 102, 0);
425
SetStyle (DebugStackLineString, 0, 0, 0, 128, 255, 128);
426
SetStyle (DebugStackLineMarkerColor1String, 128, 255, 128);
427
SetStyle (DebugStackLineMarkerColor2String, 204, 255, 204);
428
SetStyle (DebugStackLineMarkerBorderString, 51, 102, 51);
430
SetStyle (InvalidBreakpointBgString, 237, 220, 220);
431
SetStyle (InvalidBreakpointMarkerColor1String, 237, 220, 220);
432
SetStyle (InvalidBreakpointMarkerBorderString, 125, 0, 0);
433
SetStyle (SearchTextBgString, 255, 226, 185);
434
SetStyle (SearchTextMainBgString, 243, 221, 72);
436
SetStyle (BracketHighlightRectangleString, 128, 128, 128, 196, 196, 196);
438
SetStyle (BookmarkColor1String, 255, 255, 255);
439
SetStyle (BookmarkColor2String, 105, 156, 235);
441
SetStyle (ErrorUnderlineString, 255, 0, 0);
442
SetStyle (WarningUnderlineString, 30, 30, 255);
444
SetStyle ("diff.line-added", 0, 0x8B, 0x8B, ChunkProperties.None);
445
SetStyle ("diff.line-removed", 0x6A, 0x5A, 0xCD, ChunkProperties.None);
446
SetStyle ("diff.line-changed", "text.preprocessor");
447
SetStyle ("diff.header", 0, 128, 0, BOLD);
448
SetStyle ("diff.header-seperator", 0, 0, 255);
449
SetStyle ("diff.header-oldfile", "diff.header");
450
SetStyle ("diff.header-newfile", "diff.header");
451
SetStyle ("diff.location", "keyword.misc");
453
SetStyle (PrimaryTemplateColorString, 0xB4, 0xE4, 0xB4, 0xB4, 0xE4, 0xB4);
454
SetStyle (PrimaryTemplateHighlightedColorString, 0, 0, 0, 0xB4, 0xE4, 0xB4);
456
SetStyle (SecondaryTemplateColorString, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
457
SetStyle (SecondaryTemplateHighlightedColorString, 0x7F, 0x7F, 0x7F, 0xFF, 0xFF, 0xFF);
459
SetStyle ("bubble.error.text", 0, 0, 0);
461
SetStyleFromWeb ("bubble.warning.light.color1", "#fbf7eb");
462
SetStyleFromWeb ("bubble.warning.light.color2", "#f4eeda");
463
SetStyleFromWeb ("bubble.warning.dark.color1", "#f5eed8");
464
SetStyleFromWeb ("bubble.warning.dark.color2", "#eadebb");
465
SetStyleFromWeb ("bubble.warning.line.top", "#e5e3dd");
466
SetStyleFromWeb ("bubble.warning.line.bottom", "#d3cdba");
467
SetStyleFromWeb ("bubble.warning.text", "black");
469
SetStyleFromWeb ("bubble.inactive.warning.light.color1", "#fbfbfb");
470
SetStyleFromWeb ("bubble.inactive.warning.light.color2", "#f5f3ed");
471
SetStyleFromWeb ("bubble.inactive.warning.dark.color1", "#f7f7f7");
472
SetStyleFromWeb ("bubble.inactive.warning.dark.color2", "#ece7dd");
473
SetStyleFromWeb ("bubble.inactive.warning.line.top", "#f2f2f2");
474
SetStyleFromWeb ("bubble.inactive.warning.line.bottom", "#eceae6");
476
SetStyleFromWeb ("bubble.error.light.color1", "#faf2f0");
477
SetStyleFromWeb ("bubble.error.light.color2", "#f5eae7");
478
SetStyleFromWeb ("bubble.error.dark.color1", "#f6e6e2");
479
SetStyleFromWeb ("bubble.error.dark.color2", "#ead7d2");
480
SetStyleFromWeb ("bubble.error.line.top", "#e5e0e0");
481
SetStyleFromWeb ("bubble.error.line.bottom", "#cfc6c4");
482
SetStyleFromWeb ("bubble.error.text", "black");
484
SetStyleFromWeb ("bubble.inactive.error.light.color1", "#fcfcfc");
485
SetStyleFromWeb ("bubble.inactive.error.light.color2", "#f5f4f3");
486
SetStyleFromWeb ("bubble.inactive.error.dark.color1", "#f9f9f9");
487
SetStyleFromWeb ("bubble.inactive.error.dark.color2", "#ebe8e6");
488
SetStyleFromWeb ("bubble.inactive.error.line.top", "#f2f2f2");
489
SetStyleFromWeb ("bubble.inactive.error.line.bottom", "#eceaea");
444
492
protected void PopulateDefaults ()
446
SetStyle ("text", new Mono.TextEditor.ChunkStyle (new Gdk.Color (0, 0, 0)));
447
SetStyle ("text.punctuation", new Mono.TextEditor.ChunkStyle (new Gdk.Color (0, 0, 0)));
448
SetStyle ("text.link", new Mono.TextEditor.ChunkStyle (new Gdk.Color (0, 0, 255)));
449
SetStyle ("text.preprocessor", new Mono.TextEditor.ChunkStyle (new Gdk.Color (0, 128 , 0)));
450
SetStyle ("text.preprocessor.keyword", new Mono.TextEditor.ChunkStyle (new Gdk.Color (0, 128, 0), ChunkProperties.Bold));
451
SetStyle ("text.markup", new Mono.TextEditor.ChunkStyle (new Gdk.Color (0, 0x8A , 0x8C)));
452
SetStyle ("text.markup.tag", new Mono.TextEditor.ChunkStyle (new Gdk.Color (0x6A, 0x5A, 0xCD)));
454
SetStyle ("comment", new Mono.TextEditor.ChunkStyle (new Gdk.Color (0, 0, 255)));
455
SetStyle ("comment.line", new Mono.TextEditor.ChunkStyle (new Gdk.Color (0, 0, 255)));
456
SetStyle ("comment.block", new Mono.TextEditor.ChunkStyle (new Gdk.Color (0, 0, 255)));
457
SetStyle ("comment.doc", new Mono.TextEditor.ChunkStyle (new Gdk.Color (0, 0, 255)));
458
SetStyle ("comment.tag", new Mono.TextEditor.ChunkStyle (new Gdk.Color (128, 128, 128), ChunkProperties.Italic));
459
SetStyle ("comment.tag.line", new Mono.TextEditor.ChunkStyle (new Gdk.Color (128, 128, 128), ChunkProperties.Italic));
460
SetStyle ("comment.tag.block", new Mono.TextEditor.ChunkStyle (new Gdk.Color (128, 128, 128), ChunkProperties.Italic));
461
SetStyle ("comment.tag.doc", new Mono.TextEditor.ChunkStyle (new Gdk.Color (128, 128, 128), ChunkProperties.Italic));
462
SetStyle ("comment.keyword", new Mono.TextEditor.ChunkStyle (new Gdk.Color (0, 0,255), ChunkProperties.Italic));
463
SetStyle ("comment.keyword.todo", new Mono.TextEditor.ChunkStyle (new Gdk.Color (0, 0, 255), ChunkProperties.Bold));
465
SetStyle ("constant", new Mono.TextEditor.ChunkStyle (new Gdk.Color (255, 0, 255)));
466
SetStyle ("constant.digit", new Mono.TextEditor.ChunkStyle (new Gdk.Color (255, 0, 255)));
467
SetStyle ("constant.language", new Mono.TextEditor.ChunkStyle (new Gdk.Color (165, 42, 42), ChunkProperties.Bold));
468
SetStyle ("constant.language.void", new Mono.TextEditor.ChunkStyle (new Gdk.Color (165, 42, 42), ChunkProperties.Bold));
470
SetStyle ("string", new Mono.TextEditor.ChunkStyle (new Gdk.Color (255, 0, 255)));
471
SetStyle ("string.single", new Mono.TextEditor.ChunkStyle (new Gdk.Color (255, 0, 255)));
472
SetStyle ("string.double", new Mono.TextEditor.ChunkStyle (new Gdk.Color (255, 0, 255)));
473
SetStyle ("string.other", new Mono.TextEditor.ChunkStyle (new Gdk.Color (255, 0, 255)));
475
SetStyle ("keyword.semantic.type", new Mono.TextEditor.ChunkStyle (new Gdk.Color (0, 0x8A , 0x8C)));
477
SetStyle ("keyword", new Mono.TextEditor.ChunkStyle (new Gdk.Color (0, 0, 0), ChunkProperties.Bold));
479
SetStyle ("keyword.access", new Mono.TextEditor.ChunkStyle (new Gdk.Color (165, 42, 42), ChunkProperties.Bold));
480
SetStyle ("keyword.operator", new Mono.TextEditor.ChunkStyle (new Gdk.Color (165, 42, 42), ChunkProperties.Bold));
481
SetStyle ("keyword.operator.declaration", new Mono.TextEditor.ChunkStyle (new Gdk.Color (165, 42, 42), ChunkProperties.Bold));
482
SetStyle ("keyword.selection", new Mono.TextEditor.ChunkStyle (new Gdk.Color (165, 42, 42), ChunkProperties.Bold));
483
SetStyle ("keyword.iteration", new Mono.TextEditor.ChunkStyle (new Gdk.Color (165, 42, 42), ChunkProperties.Bold));
484
SetStyle ("keyword.jump", new Mono.TextEditor.ChunkStyle (new Gdk.Color (165, 42, 42), ChunkProperties.Bold));
485
SetStyle ("keyword.context", new Mono.TextEditor.ChunkStyle (new Gdk.Color (165, 42, 42), ChunkProperties.Bold));
486
SetStyle ("keyword.exceptions", new Mono.TextEditor.ChunkStyle (new Gdk.Color (165, 42, 42), ChunkProperties.Bold));
487
SetStyle ("keyword.modifier", new Mono.TextEditor.ChunkStyle (new Gdk.Color (165, 42, 42), ChunkProperties.Bold));
488
SetStyle ("keyword.type", new Mono.TextEditor.ChunkStyle (new Gdk.Color ( 46, 139, 87), ChunkProperties.Bold));
489
SetStyle ("keyword.namespace", new Mono.TextEditor.ChunkStyle (new Gdk.Color (165, 42, 42), ChunkProperties.Bold));
490
SetStyle ("keyword.property", new Mono.TextEditor.ChunkStyle (new Gdk.Color (165, 42, 42), ChunkProperties.Bold));
491
SetStyle ("keyword.declaration", new Mono.TextEditor.ChunkStyle (new Gdk.Color (165, 42, 42), ChunkProperties.Bold));
492
SetStyle ("keyword.parameter", new Mono.TextEditor.ChunkStyle (new Gdk.Color (165, 42, 42), ChunkProperties.Bold));
493
SetStyle ("keyword.misc", new Mono.TextEditor.ChunkStyle (new Gdk.Color (165, 42, 42), ChunkProperties.Bold));
494
SetStyle ("text", 0, 0, 0);
495
SetStyle ("text.punctuation", 0, 0, 0);
496
SetStyle ("text.link", 0, 0, 255);
497
SetStyle ("text.preprocessor", 0, 128, 0);
498
SetStyle ("text.preprocessor.keyword", 0, 128, 0, BOLD);
499
SetStyle ("text.markup", 0, 0x8A, 0x8C);
500
SetStyle ("text.markup.tag", 0x6A, 0x5A, 0xCD);
502
SetStyle ("comment", 0, 0, 255);
503
SetStyle ("comment.line", 0, 0, 255);
504
SetStyle ("comment.block", 0, 0, 255);
505
SetStyle ("comment.doc", 0, 0, 255);
506
SetStyle ("comment.tag", 128, 128, 128, ITALIC);
507
SetStyle ("comment.tag.line", 128, 128, 128, ITALIC);
508
SetStyle ("comment.tag.block" , 128, 128, 128, ITALIC);
509
SetStyle ("comment.tag.doc", 128, 128, 128, ITALIC);
510
SetStyle ("comment.keyword", 0, 0, 255, ITALIC);
511
SetStyle ("comment.keyword.todo", 0, 0, 255, BOLD);
513
SetStyle ("constant", 255, 0, 255);
514
SetStyle ("constant.digit", 255, 0, 255);
515
SetStyle ("constant.language", 165, 42, 42, BOLD);
516
SetStyle ("constant.language.void", 165, 42, 42, BOLD);
518
SetStyle ("string", 255, 0, 255);
519
SetStyle ("string.single", 255, 0, 255);
520
SetStyle ("string.double", 255, 0, 255);
521
SetStyle ("string.other", 255, 0, 255);
523
SetStyle ("keyword.semantic.type", 0, 0x8A , 0x8C);
525
SetStyle ("keyword", 0, 0, 0, BOLD);
527
SetStyle ("keyword.access", 165, 42, 42, BOLD);
528
SetStyle ("keyword.operator", 165, 42, 42, BOLD);
529
SetStyle ("keyword.operator.declaration", 165, 42, 42, BOLD);
530
SetStyle ("keyword.selection", 165, 42, 42, BOLD);
531
SetStyle ("keyword.iteration", 165, 42, 42, BOLD);
532
SetStyle ("keyword.jump", 165, 42, 42, BOLD);
533
SetStyle ("keyword.context", 165, 42, 42, BOLD);
534
SetStyle ("keyword.exceptions", 165, 42, 42, BOLD);
535
SetStyle ("keyword.modifier", 165, 42, 42, BOLD);
536
SetStyle ("keyword.type", 46, 139, 87, BOLD);
537
SetStyle ("keyword.namespace", 165, 42, 42, BOLD);
538
SetStyle ("keyword.property", 165, 42, 42, BOLD);
539
SetStyle ("keyword.declaration", 165, 42, 42, BOLD);
540
SetStyle ("keyword.parameter", 165, 42, 42, BOLD);
541
SetStyle ("keyword.misc", 165, 42, 42, BOLD);
544
const ChunkProperties BOLD = ChunkProperties.Bold;
545
const ChunkProperties ITALIC = ChunkProperties.Bold;
497
547
void SetStyle (string name, ChunkStyle style)
499
549
styleLookupTable[name] = style;
552
void SetStyle (string name, string referencedStyleName)
554
styleLookupTable[name] = new ReferencedChunkStyle (this, referencedStyleName);
557
void SetStyle (string name, byte r, byte g, byte b)
559
SetStyle (name, new ChunkStyle (new Gdk.Color (r, g, b)));
562
void SetStyleFromWeb (string name, string colorString)
564
Gdk.Color color = new Color ();
565
if (!Gdk.Color.Parse (colorString, ref color))
566
throw new Exception ("Can't parse color: " + colorString);
567
SetStyle (name, new ChunkStyle (color));
570
void SetStyle (string name, byte r, byte g, byte b, byte bg_r, byte bg_g, byte bg_b)
572
SetStyle (name, new ChunkStyle (new Gdk.Color (r, g, b), new Gdk.Color (bg_r, bg_g, bg_b)));
575
void SetStyle (string name, byte r, byte g, byte b, ChunkProperties properties)
577
SetStyle (name, new ChunkStyle (new Gdk.Color (r, g, b), properties));
580
/* void SetStyle (string name, byte r, byte g, byte b, byte bg_r, byte bg_g, byte bg_b, ChunkProperties properties)
582
SetStyle (name, new ChunkStyle (new Gdk.Color (r, g, b), new Gdk.Color (bg_r, bg_g, bg_b), properties));
502
585
public ChunkStyle GetDefaultChunkStyle ()
504
587
ChunkStyle style;