Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 1019c2462b
Fetching contributors…

Cannot retrieve contributors at this time

file 166 lines (116 sloc) 7.069 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
#
#
# Aporia - Nimrod IDE
# (c) Copyright 2011 Dominik Picheta
#
# See the file "copying.txt", included in this
# distribution, for details about the copyright.
#

import gtk2, glib2

when defined(windows):
  const lib = "libgtksourceview-2.0-0.dll"
elif defined(macosx):
  const lib = "libgtksourceview-2.0(|-0).dylib"
else:
  const lib = "libgtksourceview-2.0.so(|.0)"

type
  TSourceLanguageManager*{.pure, final.} = object
  PSourceLanguageManager* = ptr TSourceLanguageManager

  TSourceLanguage*{.pure, final.} = object
  PSourceLanguage* = ptr TSourceLanguage
  
  TSourceBuffer*{.pure, final.} = object of TTextBuffer
  PSourceBuffer* = ptr TSourceBuffer
  
  TSourceView*{.pure, final.} = object of TTextView
  PSourceView* = ptr TSourceView
  
  TSourceStyleSchemeManager*{.pure, final.} = object
  PSourceStyleSchemeManager* = ptr TSourceStyleSchemeManager
  
  TSourceStyleScheme*{.pure, final.} = object
  PSourceStyleScheme* = ptr TSourceStyleScheme
  
const
  TEXT_SEARCH_CASE_INSENSITIVE* = 1 shl 2
  
proc source_view_new*(): PSourceView {.cdecl, dynlib: lib,
  importc: "gtk_source_view_new".}

proc source_view_new*(buffer: PSourceBuffer): PSourceView {.cdecl, dynlib: lib,
  importc: "gtk_source_view_new_with_buffer".}

proc language_manager_get_default*(): PSourceLanguageManager {.cdecl, dynlib: lib,
  importc: "gtk_source_language_manager_get_default".}

proc language_manager_new*(): PSourceLanguageManager {.cdecl, dynlib: lib,
  importc: "gtk_source_language_manager_new".}

proc guess_language*(lm: PSourceLanguageManager, filename: cstring, contentType: cstring): PSourceLanguage {.cdecl, dynlib: lib,
  importc: "gtk_source_language_manager_guess_language".}

proc get_language*(lm: PSourceLanguageManager, id: cstring): PSourceLanguage {.cdecl, dynlib: lib,
  importc: "gtk_source_language_manager_get_language".}

proc get_default*(lm: PSourceLanguageManager): PSourceLanguage {.cdecl, dynlib: lib,
  importc: "gtk_source_language_manager_get_default".}

proc set_search_path*(lm: PSourceLanguageManager, dirs: cstringarray) {.cdecl, dynlib: lib,
  importc: "gtk_source_language_manager_set_search_path".}

proc get_search_path*(lm: PSourceLanguageManager): cstringarray {.cdecl, dynlib: lib,
  importc: "gtk_source_language_manager_get_search_path".}

proc set_language*(buffer: PSourceBuffer, language: PSourceLanguage) {.cdecl, dynlib: lib,
  importc: "gtk_source_buffer_set_language".}

proc set_scheme*(buffer: PSourceBuffer, scheme: PSourceStyleScheme) {.cdecl, dynlib: lib,
  importc: "gtk_source_buffer_set_style_scheme".}
  
proc set_highlight_syntax*(buffer: PSourceBuffer, highlight: gboolean) {.cdecl, dynlib: lib,
  importc: "gtk_source_buffer_set_highlight_syntax".}
  
proc set_insert_spaces_instead_of_tabs*(view: PSourceView, enable: gboolean) {.cdecl, dynlib: lib,
  importc: "gtk_source_view_set_insert_spaces_instead_of_tabs".}
  
proc set_indent_width*(view: PSourceView, width: gint) {.cdecl, dynlib: lib,
  importc: "gtk_source_view_set_indent_width".}

proc set_show_line_marks*(view: PSourceView, show: gboolean) {.cdecl, dynlib: lib,
  importc: "gtk_source_view_set_show_line_marks".}
  
proc set_highlight_current_line*(view: PSourceView, show: gboolean) {.cdecl, dynlib: lib,
  importc: "gtk_source_view_set_highlight_current_line".}
  
proc set_show_line_numbers*(view: PSourceView, show: gboolean) {.cdecl, dynlib: lib,
  importc: "gtk_source_view_set_show_line_numbers".}

proc set_auto_indent*(view: PSourceView, enable: gboolean) {.cdecl, dynlib: lib,
  importc: "gtk_source_view_set_auto_indent".}

proc set_show_right_margin*(view: PSourceView, show: gboolean) {.cdecl, dynlib: lib,
  importc: "gtk_source_view_set_show_right_margin".}
  
proc source_buffer_new*(table: PTextTagTable): PSourceBuffer {.cdecl, dynlib: lib,
  importc: "gtk_source_buffer_new".}
  
proc source_buffer_new*(language: PSourceLanguage): PSourceBuffer {.cdecl, dynlib: lib,
  importc: "gtk_source_buffer_new_with_language".}

proc set_highlight_matching_brackets*(view: PSourceBuffer, show: gboolean) {.cdecl, dynlib: lib,
  importc: "gtk_source_buffer_set_highlight_matching_brackets".}

proc get_highlight_matching_brackets*(view: PSourceBuffer): gboolean {.cdecl, dynlib: lib,
  importc: "gtk_source_buffer_get_highlight_matching_brackets".}

proc undo*(buffer: PSourceBuffer) {.cdecl, dynlib: lib,
  importc: "gtk_source_buffer_undo".}
  
proc redo*(buffer: PSourceBuffer) {.cdecl, dynlib: lib,
  importc: "gtk_source_buffer_redo".}
  
proc can_undo*(buffer: PSourceBuffer): gboolean {.cdecl, dynlib: lib,
  importc: "gtk_source_buffer_can_undo".}
  
proc can_redo*(buffer: PSourceBuffer): gboolean {.cdecl, dynlib: lib,
  importc: "gtk_source_buffer_can_redo".}

proc begin_not_undoable_action*(buffer: PSourceBuffer) {.cdecl, dynlib: lib,
  importc: "gtk_source_buffer_begin_not_undoable_action".}

proc end_not_undoable_action*(buffer: PSourceBuffer) {.cdecl, dynlib: lib,
  importc: "gtk_source_buffer_end_not_undoable_action".}

proc forward_search*(iter: PTextIter, str: cstring, flags: TTextSearchFlags,
                     match_start: PTextIter, match_end: PTextIter,
                     limit: PTextIter): gboolean {.cdecl, dynlib: lib,
  importc: "gtk_source_iter_forward_search".}
  
proc backward_search*(iter: PTextIter, str: cstring, flags: TTextSearchFlags,
                     match_start: PTextIter, match_end: PTextIter,
                     limit: PTextIter): gboolean {.cdecl, dynlib: lib,
  importc: "gtk_source_iter_backward_search".}
  
proc scheme_manager_get_default*(): PSourceStyleSchemeManager {.cdecl, dynlib: lib,
  importc: "gtk_source_style_scheme_manager_get_default".}

proc get_scheme_ids*(manager: PSourceStyleSchemeManager): cstringArray {.cdecl, dynlib: lib,
  importc: "gtk_source_style_scheme_manager_get_scheme_ids".}

proc get_scheme*(manager: PSourceStyleSchemeManager, scheme_id: cstring): PSourceStyleScheme {.cdecl, dynlib: lib,
  importc: "gtk_source_style_scheme_manager_get_scheme".}

proc set_search_path*(manager: PSourceStyleSchemeManager, dirs: cstringarray) {.cdecl, dynlib: lib,
  importc: "gtk_source_style_scheme_manager_set_search_path".}

proc append_search_path*(manager: PSourceStyleSchemeManager, dir: cstring) {.cdecl, dynlib: lib,
  importc: "gtk_source_style_scheme_manager_append_search_path".}

proc prepend_search_path*(manager: PSourceStyleSchemeManager, dir: cstring) {.cdecl, dynlib: lib,
  importc: "gtk_source_style_scheme_manager_prepend_search_path".}

proc get_search_path*(manager: PSourceStyleSchemeManager): cstringarray {.cdecl, dynlib: lib,
  importc: "gtk_source_style_scheme_manager_get_search_path".}
  
proc force_rescan*(scheme: PSourceStyleSchemeManager) {.cdecl, dynlib: lib,
  importc: "gtk_source_style_scheme_manager_force_rescan".}
  
proc get_name*(scheme: PSourceStyleScheme): cstring {.cdecl, dynlib: lib,
  importc: "gtk_source_style_scheme_get_name".}

proc get_description*(scheme: PSourceStyleScheme): cstring {.cdecl, dynlib: lib,
  importc: "gtk_source_style_scheme_get_description".}
Something went wrong with that request. Please try again.