예제 #1
0
static int new_Win32PrintingSurface (lua_State *L)
{
    HDC hdc;
    cairo_surface_t *cs;
    lua_remove(L, 1); // remove cairo.Win32PrintingSurface

    //{"create",                                   l_cairo_win32_printing_surface_create},
    hdc = (HDC) check_lightuserdata(L, 1);
    cs = cairo_win32_printing_surface_create(hdc);

    return new_Surface(L, LUACAIRO ".Win32PrintingSurface.mt", cs, CAIRO_SURFACE_TYPE_WIN32_PRINTING, 1);
}
예제 #2
0
static int new_XcbSurface (lua_State *L)
{
    lua_remove(L, 1); // remove cairo.XcbSurface

    //FIXME
    //{"create",                                   l_cairo_xcb_surface_create},
    //{"create_for_bitmap",                        l_cairo_xcb_surface_create_for_bitmap},
    //{"create_with_xrender_format",               l_cairo_xcb_surface_create_with_xrender_format},

    cairo_surface_t* cs = NULL;

    return new_Surface(L, LUACAIRO ".XcbSurface.mt", cs, CAIRO_SURFACE_TYPE_XCB, 1);
}
예제 #3
0
static int new_PsSurface (lua_State *L)
{
    lua_remove(L, 1); // remove cairo.PsSurface

    //FIXME
    //{"create_for_stream",             l_cairo_ps_surface_create_for_stream},

    //{"create",                        l_cairo_ps_surface_create},
    const char *filename = luaL_checkstring(L, 1);
    double width_in_points = luaL_checknumber(L, 2);
    double height_in_points = luaL_checknumber(L, 3);
    cairo_surface_t *cs = cairo_ps_surface_create(filename, width_in_points, height_in_points);

    return new_Surface(L, LUACAIRO ".PsSurface.mt", cs, CAIRO_SURFACE_TYPE_PS, 1);
}
예제 #4
0
static int new_Win32Surface (lua_State *L)
{
    HDC hdc;
    cairo_surface_t *cs;

    lua_remove(L, 1); // remove cairo.Win32Surface

    //FIXME
    //{"create_with_ddb",                          l_cairo_win32_surface_create_with_ddb},
    //{"create_with_dib",                          l_cairo_win32_surface_create_with_dib},

    //{"create",                                   l_cairo_win32_surface_create},
    hdc = (HDC) check_lightuserdata(L, 1);
    cs = cairo_win32_surface_create(hdc);

    return new_Surface(L, LUACAIRO ".Win32Surface.mt", cs, CAIRO_SURFACE_TYPE_WIN32, 1);
}
예제 #5
0
static int new_ImageSurface (lua_State *L)
{
	cairo_format_t format;
    int width;
    int height;
	cairo_surface_t *cs;
    
    lua_remove(L, 1); // remove cairo.ImageSurface

    //FIXME
    //{"create_for_data",                          l_cairo_image_surface_create_for_data},
    //{"create_from_png",                          l_cairo_image_surface_create_from_png},
    //{"create_from_png_stream",                   l_cairo_image_surface_create_from_png_stream},

    //{"create",                                   l_cairo_image_surface_create},
    format = (cairo_format_t) luaL_checkinteger(L, 1);
    width = (int)luaL_checkinteger(L, 2);
    height = (int)luaL_checkinteger(L, 3);
    cs = cairo_image_surface_create (format, width, height);

    return new_Surface(L, LUACAIRO ".ImageSurface.mt", cs, CAIRO_SURFACE_TYPE_IMAGE, 1);
}