[Monodevelop-patches-list] r2419 - in trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor: . Gui Gui/OptionPanels Services
John Luke <jluke@cfl.rr.com>
jluke at mono-cvs.ximian.com
Sat Apr 2 21:27:33 EST 2005
Author: jluke
Date: 2005-04-02 21:27:33 -0500 (Sat, 02 Apr 2005)
New Revision: 2419
Added:
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels/SyntaxHighlightingPanel.cs
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Services/
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Services/SourceViewService.cs
Modified:
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/EditorBindings.glade
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels/GeneralTextEditorPanel.cs
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorBuffer.cs
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Makefile.am
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/MonoDevelopEditor.addin.xml
Log:
allow customization of highlighting style/color
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog 2005-04-02 11:04:24 UTC (rev 2418)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog 2005-04-03 02:27:33 UTC (rev 2419)
@@ -1,3 +1,16 @@
+2005-04-02 John Luke <john.luke at gmail.com>
+
+ * EditorBindings.glade: add glade part of new Panel
+ * Services/SourceViewService.cs: new service to share
+ the SourceLanguagesManager info
+ * Gui/SourceEditorBuffer.cs: use service
+ * Gui/OptionPanels/SyntaxHighlightingPanel.cs: new panel
+ for controlling all things about syntax highlighting
+ * Gui/OptionPanels/GeneralTextEditorPanel.cs: move enable syntax
+ highlighting to its own panel
+ * Makefile.am: add new files
+ * MonoDevelopEditor.addin.xml: add service
+
2005-03-14 Lluis Sanchez Gual <lluis at novell.com>
* Gui/SourceEditorWidget.cs: Added IntPtr constructor. Nullify
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/EditorBindings.glade
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/EditorBindings.glade 2005-04-02 11:04:24 UTC (rev 2418)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/EditorBindings.glade 2005-04-03 02:27:33 UTC (rev 2419)
@@ -17,6 +17,7 @@
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
<child>
<widget class="GtkVBox" id="vbox13">
@@ -47,6 +48,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
@@ -124,6 +129,8 @@
<child>
<widget class="GtkComboBox" id="groupCombo">
<property name="visible">True</property>
+ <property name="add_tearoffs">False</property>
+ <property name="focus_on_click">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
@@ -165,6 +172,9 @@
<property name="rules_hint">False</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
+ <property name="fixed_height_mode">False</property>
+ <property name="hover_selection">False</property>
+ <property name="hover_expand">False</property>
</widget>
</child>
</widget>
@@ -298,6 +308,7 @@
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
<child>
<widget class="GtkVBox" id="vbox37">
@@ -324,6 +335,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -351,6 +366,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -403,24 +422,6 @@
<property name="fill">False</property>
</packing>
</child>
- <child>
- <widget class="GtkCheckButton" id="enableSyntaxHighlighting">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Enable syntax highlighting</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
</widget>
<packing>
<property name="padding">0</property>
@@ -462,6 +463,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -489,6 +494,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -588,6 +597,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -666,6 +679,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -693,6 +710,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -720,6 +741,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -731,6 +756,8 @@
<child>
<widget class="GtkComboBox" id="textEncodingComboBox">
<property name="visible">True</property>
+ <property name="add_tearoffs">False</property>
+ <property name="focus_on_click">True</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -776,6 +803,7 @@
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
<child>
<widget class="GtkVBox" id="vbox45">
@@ -802,6 +830,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -829,6 +861,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -940,6 +976,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -967,6 +1007,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -1020,6 +1064,10 @@
<property name="xpad">1</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">showVRulerCheckBox</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -1091,6 +1139,7 @@
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
<child>
<widget class="GtkVBox" id="vbox54">
@@ -1117,6 +1166,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -1144,6 +1197,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -1172,6 +1229,10 @@
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">noneIndentStyle</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -1199,6 +1260,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -1290,6 +1355,10 @@
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">indentAndTabSizeSpinButton</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -1311,6 +1380,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -1333,6 +1406,10 @@
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">indentAndTabSizeSpinButton</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -1427,6 +1504,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -1454,6 +1535,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -1530,4 +1615,294 @@
</child>
</widget>
+<widget class="GtkWindow" id="SyntaxHighlightingPanel">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">window1</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+
+ <child>
+ <widget class="GtkVBox" id="vbox61">
+ <property name="border_width">6</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">12</property>
+
+ <child>
+ <widget class="GtkCheckButton" id="enableSyntaxHighlighting">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Enable syntax highlighting</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="OnHighlightingToggled" last_modification_time="Sat, 02 Apr 2005 17:17:08 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="childrenVBox">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkComboBox" id="sourceLanguages">
+ <property name="visible">True</property>
+ <property name="add_tearoffs">False</property>
+ <property name="focus_on_click">True</property>
+ <signal name="changed" handler="OnLanguageSelected" last_modification_time="Sat, 02 Apr 2005 05:35:28 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label58">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Elements</b></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">True</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox32">
+ <property name="visible">True</property>
+ <property name="homogeneous">True</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow5">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+ <child>
+ <widget class="GtkTreeView" id="stylesTreeView">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ <property name="rules_hint">False</property>
+ <property name="reorderable">False</property>
+ <property name="enable_search">True</property>
+ <property name="fixed_height_mode">False</property>
+ <property name="hover_selection">False</property>
+ <property name="hover_expand">False</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox62">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox33">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkToggleButton" id="boldToggle">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-bold</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <signal name="toggled" handler="OnButtonToggled" last_modification_time="Sat, 02 Apr 2005 17:18:07 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkToggleButton" id="italicToggle">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-italic</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <signal name="toggled" handler="OnButtonToggled" last_modification_time="Sat, 02 Apr 2005 17:18:23 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkToggleButton" id="underlineToggle">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-underline</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <signal name="toggled" handler="OnButtonToggled" last_modification_time="Sat, 02 Apr 2005 17:18:38 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkToggleButton" id="strikeToggle">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-strikethrough</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <signal name="toggled" handler="OnButtonToggled" last_modification_time="Sat, 02 Apr 2005 17:18:53 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkColorButton" id="fgColorButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="use_alpha">False</property>
+ <property name="focus_on_click">True</property>
+ <signal name="color_set" handler="OnColorSet" last_modification_time="Sat, 02 Apr 2005 17:17:34 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkColorButton" id="bgColorButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="use_alpha">False</property>
+ <property name="focus_on_click">True</property>
+ <signal name="color_set" handler="OnColorSet" last_modification_time="Sat, 02 Apr 2005 17:17:48 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="restoreDefaultButton">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Restore default</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <signal name="clicked" handler="OnRestoreClicked" last_modification_time="Sat, 02 Apr 2005 06:54:14 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
</glade-interface>
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels/GeneralTextEditorPanel.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels/GeneralTextEditorPanel.cs 2005-04-02 11:04:24 UTC (rev 2418)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels/GeneralTextEditorPanel.cs 2005-04-03 02:27:33 UTC (rev 2419)
@@ -49,8 +49,7 @@
[Glade.Widget] Label genOptions, fontOptions;
// encOptions, encVBox; // if you uncoment change to "," above
- [Glade.Widget] CheckButton enableCodeCompletionCheckBox,
- enableFoldingCheckBox, enableSyntaxHighlighting;
+ [Glade.Widget] CheckButton enableCodeCompletionCheckBox, enableFoldingCheckBox;
// [Glade.Widget] ComboBox textEncodingComboBox;
[Glade.Widget] FontButton fontNameDisplayTextBox;
[Glade.Widget] VBox encodingBox;
@@ -63,7 +62,6 @@
"EnableCodeCompletion", true);
enableFoldingCheckBox.Active = ((IProperties) CustomizationObject).GetProperty("EnableFolding", true);
- enableSyntaxHighlighting.Active = ((IProperties) CustomizationObject).GetProperty("SyntaxHighlight", true);
string font_name = ((IProperties) CustomizationObject).GetProperty("DefaultFont", "__default_monospace").ToString ();
@@ -118,8 +116,6 @@
"EnableCodeCompletion", enableCodeCompletionCheckBox.Active);
((IProperties) CustomizationObject).SetProperty (
"EnableFolding", enableFoldingCheckBox.Active);
- ((IProperties) CustomizationObject).SetProperty (
- "SyntaxHighlight", enableSyntaxHighlighting.Active);
string font_name;
if (use_monospace.Active)
Added: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels/SyntaxHighlightingPanel.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels/SyntaxHighlightingPanel.cs 2005-04-02 11:04:24 UTC (rev 2418)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels/SyntaxHighlightingPanel.cs 2005-04-03 02:27:33 UTC (rev 2419)
@@ -0,0 +1,165 @@
+using System;
+using System.IO;
+using System.Collections;
+using System.Text;
+using Gtk;
+using Gnome;
+using Pango;
+using GtkSourceView;
+
+using MonoDevelop.Core.Properties;
+using MonoDevelop.Services;
+using MonoDevelop.Core.Services;
+using MonoDevelop.Core.AddIns.Codons;
+using MonoDevelop.Internal.ExternalTool;
+using MonoDevelop.Gui.Dialogs;
+using MonoDevelop.Gui.Widgets;
+
+namespace MonoDevelop.EditorBindings.Gui.OptionPanels
+{
+ public class SyntaxHighlightingPanel : AbstractOptionPanel
+ {
+ SyntaxHighlightingPanelWidget widget;
+
+ public override void LoadPanelContents()
+ {
+ Add (widget = new SyntaxHighlightingPanelWidget ((IProperties) CustomizationObject));
+ }
+
+ public override bool StorePanelContents()
+ {
+ widget.Store ((IProperties) CustomizationObject);
+ return true;
+ }
+
+ class SyntaxHighlightingPanelWidget : GladeWidgetExtract
+ {
+ [Glade.Widget] CheckButton enableSyntaxHighlighting;
+ [Glade.Widget] ComboBox sourceLanguages;
+ [Glade.Widget] Gtk.TreeView stylesTreeView;
+ [Glade.Widget] ToggleButton boldToggle;
+ [Glade.Widget] ToggleButton italicToggle;
+ [Glade.Widget] ToggleButton underlineToggle;
+ [Glade.Widget] ToggleButton strikeToggle;
+ [Glade.Widget] ColorButton fgColorButton;
+ [Glade.Widget] ColorButton bgColorButton;
+ [Glade.Widget] Button restoreDefaultButton;
+ [Glade.Widget] VBox childrenVBox;
+
+ SourceViewService svs = (SourceViewService) ServiceManager.GetService (typeof (SourceViewService));
+ SourceLanguage currentLanguage;
+ SourceTagStyle currentStyle;
+ string styleid;
+
+ public SyntaxHighlightingPanelWidget (IProperties CustomizationObject) : base ("EditorBindings.glade", "SyntaxHighlightingPanel")
+ {
+ enableSyntaxHighlighting.Active = ((IProperties) CustomizationObject).GetProperty ("SyntaxHighlight", true);
+
+ // add available sourceLanguages
+ ListStore store = new ListStore (typeof (string));
+ foreach (SourceLanguage sl in svs.AvailableLanguages)
+ store.AppendValues (sl.Name);
+ store.SetSortColumnId (0, SortType.Ascending);
+ sourceLanguages.Model = store;
+
+ CellRendererText cr = new CellRendererText ();
+ sourceLanguages.PackStart (cr, true);
+ sourceLanguages.AddAttribute (cr, "text", 0);
+ sourceLanguages.Active = 0;
+
+ stylesTreeView.AppendColumn ("styles", new CellRendererText (), "text", 0);
+ stylesTreeView.Selection.Changed += OnStyleChanged;
+ }
+
+ public void Store (IProperties CustomizationObject)
+ {
+ ((IProperties) CustomizationObject).SetProperty ("SyntaxHighlight", enableSyntaxHighlighting.Active);
+ }
+
+ void SetCurrentLanguage (string name)
+ {
+ currentLanguage = svs.FindLanguage (name);
+ SetTreeValues ();
+ }
+
+ void SetSourceTagStyle ()
+ {
+ SourceTagStyle sts = currentStyle;
+ boldToggle.Active = sts.Bold;
+ italicToggle.Active = sts.Italic;
+ underlineToggle.Active = sts.Underline;
+ strikeToggle.Active = sts.Strikethrough;
+ fgColorButton.Color = sts.Foreground;
+ bgColorButton.Color = sts.Background;
+ restoreDefaultButton.Sensitive = !sts.IsDefault;
+ }
+
+ void SetTreeValues ()
+ {
+ // name, id
+ ListStore store = new ListStore (typeof (string), typeof (string));
+ foreach (SourceTag t in currentLanguage.Tags)
+ store.AppendValues (t.Name, t.Id);
+ stylesTreeView.Model = store;
+
+ TreeIter first;
+ store.GetIterFirst (out first);
+ stylesTreeView.Selection.SelectIter (first);
+ }
+
+ private void OnButtonToggled (object sender, EventArgs a)
+ {
+ SourceTagStyle sts = currentStyle;
+ sts.Bold = boldToggle.Active;
+ sts.Italic = italicToggle.Active;
+ sts.Underline = underlineToggle.Active;
+ sts.Strikethrough = strikeToggle.Active;
+ currentLanguage.SetTagStyle (styleid, sts);
+ restoreDefaultButton.Sensitive = true;
+ }
+
+ private void OnColorSet (object sender, EventArgs a)
+ {
+ SourceTagStyle sts = currentStyle;
+ sts.Foreground = fgColorButton.Color;
+ sts.Background = bgColorButton.Color;
+ currentLanguage.SetTagStyle (styleid, sts);
+ restoreDefaultButton.Sensitive = true;
+ }
+
+ private void OnHighlightingToggled (object sender, EventArgs a)
+ {
+ CheckButton cb = sender as CheckButton;
+ childrenVBox.Sensitive = cb.Active;
+ }
+
+ private void OnLanguageSelected (object sender, EventArgs a)
+ {
+ TreeIter iter;
+ if (sourceLanguages.GetActiveIter (out iter)) {
+ SetCurrentLanguage ((string) sourceLanguages.Model.GetValue (iter, 0));
+ }
+ }
+
+ private void OnRestoreClicked (object sender, EventArgs a)
+ {
+ currentLanguage = svs.RestoreDefaults (currentLanguage);
+ SetSourceTagStyle ();
+ }
+
+ private void OnStyleChanged (object sender, EventArgs a)
+ {
+ TreeIter iter;
+ TreeModel model;
+ TreeSelection selection = sender as TreeSelection;
+
+ if (selection.GetSelected (out model, out iter)) {
+ styleid = (string) model.GetValue (iter, 1);
+ currentStyle = currentLanguage.GetTagStyle (styleid);
+ SetSourceTagStyle ();
+ }
+ }
+ }
+ }
+}
+
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorBuffer.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorBuffer.cs 2005-04-02 11:04:24 UTC (rev 2418)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorBuffer.cs 2005-04-03 02:27:33 UTC (rev 2419)
@@ -5,8 +5,8 @@
using MonoDevelop.Internal.Project;
using MonoDevelop.Core.Properties;
using MonoDevelop.Core.AddIns;
+using MonoDevelop.Services;
using MonoDevelop.Core.Services;
-using MonoDevelop.Services;
using MonoDevelop.Core.AddIns.Codons;
using MonoDevelop.Internal.Parser;
@@ -65,7 +65,7 @@
public class SourceEditorBuffer : SourceBuffer, IClipboardHandler
{
- SourceLanguagesManager slm = new SourceLanguagesManager ();
+ SourceViewService svs = ServiceManager.GetService (typeof (SourceViewService)) as SourceViewService;
TextTag markup;
TextTag complete_ahead;
TextTag compilation_error;
@@ -256,7 +256,7 @@
public void LoadText (string text, string mime)
{
- SourceLanguage lang = slm.GetLanguageFromMimeType (mime);
+ SourceLanguage lang = svs.GetLanguageFromMimeType (mime);
if (lang != null)
Language = lang;
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Makefile.am
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Makefile.am 2005-04-02 11:04:24 UTC (rev 2418)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Makefile.am 2005-04-03 02:27:33 UTC (rev 2419)
@@ -23,6 +23,7 @@
Gui/OptionPanels/MarkersTextEditorPanel.cs \
Gui/OptionPanels/CodeTemplatePanel.cs \
Gui/OptionPanels/GeneralTextEditorPanel.cs \
+Gui/OptionPanels/SyntaxHighlightingPanel.cs \
Gui/Dialogs/EditTemplateGroupDialog.cs \
Gui/Dialogs/GotoLineNumberDialog.cs \
Gui/Dialogs/ReplaceDialog.cs \
@@ -73,7 +74,8 @@
Search/TextIterator/ForwardTextFileIterator.cs \
Search/TextIterator/ForwardTextIterator.cs \
Search/TextIterator/ExtendedStreamReader.cs \
-Search/ITextBufferStrategy.cs
+Search/ITextBufferStrategy.cs \
+Services/SourceViewService.cs
build_sources = $(addprefix $(srcdir)/, $(FILES))
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/MonoDevelopEditor.addin.xml
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/MonoDevelopEditor.addin.xml 2005-04-02 11:04:24 UTC (rev 2418)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/MonoDevelopEditor.addin.xml 2005-04-03 02:27:33 UTC (rev 2419)
@@ -10,6 +10,10 @@
<!-- <Import assembly="../bin/MonoDevelop.TextEditor.dll"/> -->
<!-- <Import assembly="../bin/MonoDevelop.DefaultTexteditor.dll"/> -->
</Runtime>
+
+ <Extension path = "/Workspace/Services">
+ <Class id = "SourceViewService" class="MonoDevelop.Services.SourceViewService" />
+ </Extension>
<Extension path = "/SharpDevelop/Dialogs/OptionsDialog/CodingOptions">
<DialogPanel id = "CodeTemplates"
@@ -342,6 +346,9 @@
<DialogPanel id = "Behavior"
_label = "Behavior"
class = "MonoDevelop.EditorBindings.Gui.OptionPanels.BehaviorTextEditorPanel"/>
+ <DialogPanel id = "SyntaxHighlighting"
+ _label = "Syntax highlighting"
+ class = "MonoDevelop.EditorBindings.Gui.OptionPanels.SyntaxHighlightingPanel"/>
</Extension>
<Extension path = "/SharpDevelop/Dialogs/OptionsDialog">
@@ -358,6 +365,9 @@
<DialogPanel id = "Behavior"
_label = "Behavior"
class = "MonoDevelop.EditorBindings.Gui.OptionPanels.BehaviorTextEditorPanel"/>
+ <DialogPanel id = "SyntaxHighlighting"
+ _label = "Syntax highlighting"
+ class = "MonoDevelop.EditorBindings.Gui.OptionPanels.SyntaxHighlightingPanel"/>
</DialogPanel>
</Extension>
Added: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Services/SourceViewService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Services/SourceViewService.cs 2005-04-02 11:04:24 UTC (rev 2418)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Services/SourceViewService.cs 2005-04-03 02:27:33 UTC (rev 2419)
@@ -0,0 +1,163 @@
+using System;
+using System.Globalization;
+using System.IO;
+using System.Text;
+using System.Xml;
+using GtkSourceView;
+
+using MonoDevelop.Core.Services;
+using MonoDevelop.Services;
+
+namespace MonoDevelop.Services
+{
+ public class SourceViewService : AbstractService
+ {
+ SourceLanguagesManager slm;
+ static readonly string file = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), ".config/MonoDevelop/SyntaxHighlighting.xml");
+
+ public SourceViewService ()
+ {
+ slm = new SourceLanguagesManager ();
+ }
+
+ public SourceLanguage FindLanguage (string name)
+ {
+ foreach (SourceLanguage sl in AvailableLanguages)
+ {
+ if (sl.Name == name)
+ return sl;
+ }
+ // not found
+ return null;
+ }
+
+ public SourceLanguage GetLanguageFromMimeType (string mimetype)
+ {
+ return slm.GetLanguageFromMimeType (mimetype);
+ }
+
+ public override void InitializeService ()
+ {
+ base.InitializeService ();
+
+ if (!File.Exists (file))
+ return;
+
+ // restore values
+ XmlTextReader reader = new XmlTextReader (file);
+ SourceLanguage lang = null;
+
+ while (reader.Read ()) {
+ if (reader.IsStartElement ()) {
+ switch (reader.Name) {
+ case "SourceTag":
+ string name = reader.GetAttribute ("name");
+ SourceTagStyle sts = lang.GetTagStyle (name);
+ sts.Bold = bool.Parse (reader.GetAttribute ("bold"));
+ sts.Italic = bool.Parse (reader.GetAttribute ("italic"));
+ sts.Underline = bool.Parse (reader.GetAttribute ("underline"));
+ sts.Strikethrough = bool.Parse (reader.GetAttribute ("strikethrough"));
+ ParseColor (reader.GetAttribute ("foreground"), ref sts.Foreground);
+ ParseColor (reader.GetAttribute ("background"), ref sts.Background);
+ lang.SetTagStyle (name, sts);
+ break;
+ case "SourceLanguage":
+ lang = FindLanguage (reader.GetAttribute ("name"));
+ break;
+ case "SyntaxHighlighting":
+ default:
+ break;
+ }
+ }
+ }
+ reader.Close ();
+ }
+
+ void ParseColor (string color, ref Gdk.Color col)
+ {
+ if (color.StartsWith ("rgb:")) {
+ string[] parts = color.Substring (4).Split ('/');
+ col.Red = ushort.Parse (parts[0], NumberStyles.HexNumber);
+ col.Green = ushort.Parse (parts[1], NumberStyles.HexNumber);
+ col.Blue = ushort.Parse (parts[2], NumberStyles.HexNumber);
+ }
+ else {
+ Gdk.Color.Parse (color, ref col);
+ }
+ }
+
+ public SourceLanguage RestoreDefaults (SourceLanguage lang)
+ {
+ foreach (SourceTag tag in lang.Tags)
+ {
+ lang.SetTagStyle (tag.Name, lang.GetTagDefaultStyle (tag.Name));
+ }
+ return lang;
+ }
+
+ public override void UnloadService ()
+ {
+ XmlTextWriter writer = new XmlTextWriter (file, Encoding.UTF8);
+ writer.Formatting = Formatting.Indented;
+ writer.WriteStartDocument ();
+ writer.WriteStartElement (null, "SyntaxHighlighting", null);
+
+ foreach (SourceLanguage sl in slm.AvailableLanguages)
+ {
+ writer.WriteStartElement (null, "SourceLanguage", null);
+ writer.WriteStartAttribute (null, "name", null);
+ writer.WriteString (sl.Name);
+ writer.WriteEndAttribute ();
+
+ foreach (SourceTag tag in sl.Tags)
+ {
+ writer.WriteStartElement (null, "SourceTag", null);
+
+ writer.WriteStartAttribute (null, "name", null);
+ writer.WriteString (tag.Name);
+ writer.WriteEndAttribute ();
+
+ writer.WriteStartAttribute (null, "bold", null);
+ writer.WriteString (tag.TagStyle.Bold.ToString ());
+ writer.WriteEndAttribute ();
+
+ writer.WriteStartAttribute (null, "italic", null);
+ writer.WriteString (tag.TagStyle.Italic.ToString ());
+ writer.WriteEndAttribute ();
+
+ writer.WriteStartAttribute (null, "underline", null);
+ writer.WriteString (tag.TagStyle.Underline.ToString ());
+ writer.WriteEndAttribute ();
+
+ writer.WriteStartAttribute (null, "strikethrough", null);
+ writer.WriteString (tag.TagStyle.Strikethrough.ToString ());
+ writer.WriteEndAttribute ();
+
+ writer.WriteStartAttribute (null, "foreground", null);
+ writer.WriteString (tag.TagStyle.Foreground.ToString ());
+ writer.WriteEndAttribute ();
+
+ writer.WriteStartAttribute (null, "background", null);
+ writer.WriteString (tag.TagStyle.Background.ToString ());
+ writer.WriteEndAttribute ();
+
+ writer.WriteEndElement ();
+ }
+
+ writer.WriteEndElement ();
+ }
+
+ writer.WriteEndElement ();
+ writer.WriteEndDocument ();
+ writer.Flush ();
+ writer.Close ();
+
+ base.UnloadService ();
+ }
+
+ public SourceLanguage[] AvailableLanguages {
+ get { return slm.AvailableLanguages; }
+ }
+ }
+}
+
More information about the Monodevelop-patches-list
mailing list