… | |
… | |
46 | |
46 | |
47 | #include <glib/gmacros.h> |
47 | #include <glib/gmacros.h> |
48 | |
48 | |
49 | #include <pango/pango.h> |
49 | #include <pango/pango.h> |
50 | |
50 | |
51 | #if !(defined (PANGO_VERSION_CHECK) && PANGO_VERSION_CHECK (1, 15, 2)) |
51 | #ifndef PANGO_VERSION_CHECK |
|
|
52 | # define PANGO_VERSION_CHECK(a,b,c) 0 |
|
|
53 | #endif |
|
|
54 | |
|
|
55 | #if !PANGO_VERSION_CHECK (1, 15, 2) |
52 | # define pango_layout_get_line_readonly pango_layout_get_line_readonly |
56 | # define pango_layout_get_line_readonly pango_layout_get_line |
53 | # define pango_layout_get_lines_readonly pango_layout_get_lines_readonly |
57 | # define pango_layout_get_lines_readonly pango_layout_get_lines |
54 | # define pango_layout_iter_get_line_readonly pango_layout_iter_get_line_readonly |
58 | # define pango_layout_iter_get_line_readonly pango_layout_iter_get_line |
55 | # define pango_layout_iter_get_run_readonly pango_layout_iter_get_run_readonly |
59 | # define pango_layout_iter_get_run_readonly pango_layout_iter_get_run |
56 | #endif |
60 | #endif |
57 | |
61 | |
58 | #ifndef _WIN32 |
62 | #ifndef _WIN32 |
59 | # include <sys/types.h> |
63 | # include <sys/types.h> |
60 | # include <sys/socket.h> |
64 | # include <sys/socket.h> |
… | |
… | |
669 | CODE: |
673 | CODE: |
670 | { |
674 | { |
671 | opengl_fontmap = pango_opengl_font_map_new (); |
675 | opengl_fontmap = pango_opengl_font_map_new (); |
672 | pango_opengl_font_map_set_default_substitute ((PangoOpenGLFontMap *)opengl_fontmap, substitute_func, 0, 0); |
676 | pango_opengl_font_map_set_default_substitute ((PangoOpenGLFontMap *)opengl_fontmap, substitute_func, 0, 0); |
673 | opengl_context = pango_opengl_font_map_create_context ((PangoOpenGLFontMap *)opengl_fontmap); |
677 | opengl_context = pango_opengl_font_map_create_context ((PangoOpenGLFontMap *)opengl_fontmap); |
674 | #if defined (PANGO_VERSION_CHECK) && PANGO_VERSION_CHECK (1, 15, 2) |
678 | #if PANGO_VERSION_CHECK (1, 15, 2) |
675 | pango_context_set_language (opengl_context, pango_language_from_string ("en")); |
679 | pango_context_set_language (opengl_context, pango_language_from_string ("en")); |
676 | /*pango_context_set_base_dir (opengl_context, PANGO_DIRECTION_WEAK_LTR);*/ |
680 | /*pango_context_set_base_dir (opengl_context, PANGO_DIRECTION_WEAK_LTR);*/ |
677 | #endif |
681 | #endif |
678 | } |
682 | } |
679 | |
683 | |
… | |
… | |
765 | char * |
769 | char * |
766 | SDL_GetKeyName (int sym) |
770 | SDL_GetKeyName (int sym) |
767 | |
771 | |
768 | int |
772 | int |
769 | SDL_GetAppState () |
773 | SDL_GetAppState () |
|
|
774 | |
|
|
775 | int |
|
|
776 | SDL_GetModState () |
770 | |
777 | |
771 | void |
778 | void |
772 | poll_events () |
779 | poll_events () |
773 | PPCODE: |
780 | PPCODE: |
774 | { |
781 | { |
… | |
… | |
1331 | PPCODE: |
1338 | PPCODE: |
1332 | { |
1339 | { |
1333 | int line, x; |
1340 | int line, x; |
1334 | |
1341 | |
1335 | pango_layout_index_to_line_x (self->pl, index, trailing, &line, &x); |
1342 | pango_layout_index_to_line_x (self->pl, index, trailing, &line, &x); |
1336 | #if !(defined (PANGO_VERSION_CHECK) && PANGO_VERSION_CHECK (1, 17, 3)) |
1343 | #if !PANGO_VERSION_CHECK (1, 17, 3) |
1337 | /* pango bug: line is between 1..numlines, not 0..numlines-1 */ |
1344 | /* pango bug: line is between 1..numlines, not 0..numlines-1 */ |
1338 | --line; |
1345 | --line; |
1339 | #endif |
1346 | #endif |
1340 | EXTEND (SP, 2); |
1347 | EXTEND (SP, 2); |
1341 | PUSHs (sv_2mortal (newSViv (line))); |
1348 | PUSHs (sv_2mortal (newSViv (line))); |