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.4 - (show annotations) (download)
Sat Nov 25 14:28:17 2006 UTC (17 years, 4 months ago) by aloha
Branch: MAIN
Changes since 1.3: +21 -0 lines
add 11 xyzzy lisp API (see shiki.h or xyzzylisp.stub)

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

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