Skip to content

Commit

Permalink
- Some changes to fix syntax highlighting on Windows (hopefully).
Browse files Browse the repository at this point in the history
git-svn-id: https://gnusim8085.svn.sourceforge.net/svnroot/gnusim8085/trunk@124 c0c784df-5f15-0410-a540-c3e77be2c7b8
  • Loading branch information
onkarshinde committed Sep 8, 2008
1 parent c83a276 commit d800a01
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
2008-09-09 Onkar Shinde <onkarshinde@gmail.com>
* src/gui-editor.[c,h]: Use style scheme manager to set style search
path and default style.
* installer.nsi.in: Include file for style scheme "classic".

2008-09-07 Aanjhan Ranganathan <aanjhan@tuxmaniac.com>

* src/asm-id.c: Added mneumonic descriptions.
Expand Down
2 changes: 2 additions & 0 deletions installer.nsi.in
Expand Up @@ -40,6 +40,7 @@ Section "Install"
!system 'cp /usr/i586-mingw32msvc/bin/libgtksourceview-2.0-0.dll src/'
!system 'cp /usr/i586-mingw32msvc/bin/libxml2.dll src/'
!system 'cp /usr/i586-mingw32msvc/share/gtksourceview-2.0/language-specs/language.dtd data/'
!system 'cp /usr/share/gtksourceview-2.0/styles/classic.xml data/'
File AUTHORS
File ChangeLog
File COPYING
Expand All @@ -58,6 +59,7 @@ Section "Install"
!system 'rm -f src/libgtksourceview-2.0-0.dll'
!system 'rm -f src/libxml2.dll'
!system 'rm -f data/language.dtd'
!system 'rm -f data/classic.xml'
SectionEnd

# Uninstall section
Expand Down
5 changes: 5 additions & 0 deletions src/gui-editor.c
Expand Up @@ -49,6 +49,8 @@ gui_editor_new (void)

self->lang_manager = gtk_source_language_manager_new ();

self->style_scheme_manager = gtk_source_style_scheme_manager_get_default ();

dirs = g_ptr_array_new();

current_search_path = gtk_source_language_manager_get_search_path(self->lang_manager);
Expand All @@ -67,6 +69,8 @@ gui_editor_new (void)
lang_spec_search_path = (gchar **)g_ptr_array_free(dirs, FALSE);

gtk_source_language_manager_set_search_path (self->lang_manager, lang_spec_search_path);

gtk_source_style_scheme_manager_append_search_path (self->style_scheme_manager, "data");

GdkPixbuf *pixbuf;
pixbuf = gui_editor_get_stock_icon (GTK_WIDGET(self->widget), GTK_STOCK_NO, GTK_ICON_SIZE_MENU);
Expand All @@ -88,6 +92,7 @@ gui_editor_show (GUIEditor * self)
self->language = gtk_source_language_manager_get_language(self->lang_manager,"8085_asm");
if (self->language != NULL){
gtk_source_buffer_set_language (GTK_SOURCE_BUFFER(self->buffer), GTK_SOURCE_LANGUAGE(self->language));
gtk_source_buffer_set_style_scheme (GTK_SOURCE_BUFFER(self->buffer), gtk_source_style_scheme_manager_get_scheme(self->style_scheme_manager,"classic"));
gtk_source_buffer_set_highlight_syntax (GTK_SOURCE_BUFFER(self->buffer), TRUE);
}
self->mark = gtk_text_buffer_get_insert (GTK_TEXT_BUFFER(self->buffer));
Expand Down
2 changes: 2 additions & 0 deletions src/gui-editor.h
Expand Up @@ -35,6 +35,7 @@
#include <gtksourceview/gtksourcebuffer.h>
#include <gtksourceview/gtksourcelanguage.h>
#include <gtksourceview/gtksourcelanguagemanager.h>
#include <gtksourceview/gtksourcestyleschememanager.h>
#include <gtksourceview/gtksourcemark.h>

#define DEFAULT_EDITOR_FONT (const gchar*) "Monospace 12"
Expand All @@ -58,6 +59,7 @@ G_BEGIN_DECLS typedef struct
GtkTextTag *hltag;

GtkSourceLanguageManager *lang_manager;
GtkSourceStyleSchemeManager *style_scheme_manager;

GtkSourceLanguage *language;

Expand Down

0 comments on commit d800a01

Please sign in to comment.