1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | //画点函数 void gdk_draw_point (GdkDrawable *drawable, GdkGC *gc, gint x, gint y); //画线函数 void gdk_draw_line (GdkDrawable *drawable, GdkGC *gc, gint x1_, gint y1_, gint x2_, gint y2_); //画矩形函数 void gdk_draw_rectangle (GdkDrawable *drawable, GdkGC *gc, gboolean filled, gint x, gint y, gint width, gint height); //画弧线函数 void gdk_draw_arc (GdkDrawable *drawable, GdkGC *gc, gboolean filled, gint x, gint y, gint width, gint height, gint angle1, gint angle2); //绘制字符串函数 void gdk_draw_layout (GdkDrawable *drawable, GdkGC *gc, gint x, gint y, PangoLayout *layout); //画多边形函数 void gdk_draw_polygon (GdkDrawable *drawable, GdkGC *gc, gboolean filled, GdkPoint *points, gint npoints); |
1 2 3 4 | struct GdkPoint { gint x; gint y; }; |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | //tt.c #include <libguile.h> int main(int argc, char *argv[]) { char *ver = "(display \"Guile version \")(display (version))"; char *newline = "(newline)"; char *lambda = "(define newdisplay (lambda (n) (display n) (display \"\t\")))"; char *call = "(for-each newdisplay '(Tom Bob Peter Jim Lucy))"; scm_init_guile(); scm_c_eval_string(ver); scm_c_eval_string(newline); scm_c_eval_string(lambda); scm_c_eval_string(call); scm_c_eval_string(newline); return 0; } //the end |
1 2 3 4 5 6 | CC = gcc CFLAGS = `guile-config compile` LIBS = `guile-config link` all: $(CC) $(CFLAGS) -c tt.c $(CC) $(LIBS) tt.o -o tt |
1 2 | Guile version 1.6.4 Tom Bob Peter Jim Lucy |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |