/*
* gauche-sdl-ttf.c - Gauche SDL_ttf binding
*
* Copyright(C) 2003 by Michael Vess (mvess@michaelvess.com)
*
* Permission to use, copy, modify, distribute this software and
* accompanying documentation for any purpose is hereby granted,
* provided that existing copyright notices are retained in all
* copies and that this notice is included verbatim in all
* distributions.
* This software is provided as is, without express or implied
* warranty. In no circumstances the author(s) shall be liable
* for any damages arising out of the use of this software.
*
* $Id: gauche-sdl-ttf.c,v 1.3 2003/02/25 02:23:14 mikiso Exp $
*/
#include <gauche.h>
#include <gauche/extend.h>
#include "gauche-sdl-ttf.h"
/*****************************************************************************
* Font
*/
/* Font */
void ttf_font_finalize(ScmObj obj, void *data)
{
TTF_CloseFont(SCM_TTF_FONT(obj));
}
static void ttf_font_print(ScmObj obj, ScmPort *out, ScmWriteContext *ctx)
{
Scm_Printf(out, "#<ttf-font>");
}
SCM_DEFINE_BUILTIN_CLASS(Scm_TtfFontClass,
ttf_font_print, NULL, NULL, NULL,
SCM_CLASS_DEFAULT_CPL);
/*****************************************************************************
* Initialization
*/
extern void Scm_Init_sdl_ttf_lib(ScmModule *mod);
extern void Scm_Init_sdl_ttf_sysms(ScmModule *mod);
void Scm_Init_gauche_sdl_ttf(void)
{
ScmModule *mod;
SCM_INIT_EXTENSION(gauche_sdl_ttf);
mod = SCM_MODULE(SCM_FIND_MODULE("sdl.ttf", TRUE));
Scm_InitBuiltinClass(&Scm_TtfFontClass, "<ttf-font>",
NULL, sizeof(Scm_TtfFontClass)/sizeof(ScmObj),
mod);
Scm_Init_sdl_ttf_lib(mod);
Scm_Init_sdl_ttf_syms(mod);
}
syntax highlighted by Code2HTML, v. 0.9.1