Develop and Download Open Source Software

Browse CVS Repository

Contents of /shiki/shiki/xyzzylisp.stub

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.5 - (show annotations) (download)
Sun Nov 26 00:41:57 2006 UTC (17 years, 4 months ago) by aloha
Branch: MAIN
Changes since 1.4: +9 -0 lines
add (selected-buffer) xyzzy lisp API

1 "#include \"shiki.h\""
2
3 (define-type <buffer> "GtkTextBuffer*" "buffer"
4 "SHIKI_BUFFER_P" "SHIKI_BUFFER_UNBOX" "SHIKI_BUFFER_BOX")
5
6 (define-cproc selected-buffer ()
7 (body <buffer>
8 " g_object_ref(Shiki_CURRENT_TEXT_BUFFER);
9 SCM_RESULT = Shiki_CURRENT_TEXT_BUFFER;"))
10
11 (define-cproc buffer-substring (start::<int> end::<int>)
12 (body <string>?
13 " gchar *substr = Shiki_buffer_substring(start, end);
14 if(substr)
15 SCM_RESULT = SCM_STRING(SCM_MAKE_STR_COPYING(substr));
16 else
17 SCM_RESULT = SCM_STRING(SCM_FALSE);
18 g_free(substr);"))
19
20 (define-cproc delete-region (start::<int> end::<int>)(call <void> "Shiki_delete_region"))
21
22 (define-cproc insert (char_or_string::<top>)
23 (body <void>
24 "if(SCM_CHARP(char_or_string)) {
25 gunichar u = SCM_CHAR_VALUE(char_or_string);
26 gchar *str = g_ucs4_to_utf8(&u, 1, NULL, NULL, NULL);
27 gtk_text_buffer_insert_at_cursor(Shiki_CURRENT_TEXT_BUFFER, str, -1);
28 g_free(str);
29 } else if(SCM_STRINGP(char_or_string))
30 gtk_text_buffer_insert_at_cursor(Shiki_CURRENT_TEXT_BUFFER, SCM_STRING_CONST_CSTRING(char_or_string), -1);"))
31
32 (define-cproc point () (call <int> "Shiki_point"))
33 (define-cproc point-max () (call <int> "Shiki_point_max"))
34 (define-cproc point-min () (call <int> "Shiki_point_min"))
35 (define-cproc goto-char (offset::<int>) (call <void> "Shiki_goto_char"))
36 (define-cproc forward-char () (call <void> "Shiki_forward_char"))
37 (define-cproc backward-char () (call <void> "Shiki_backward_char"))
38 (define-cproc goto-line (line::<int>) (call <void> "Shiki_goto_line"))
39 (define-cproc goto-bol () (call <void> "Shiki_goto_bol"))
40 (define-cproc goto-eol () (call <void> "Shiki_goto_eol"))

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26