int luaopen_pattern(lua_State * L) { luaL_newlib(L, l_pattern); /* cairo_extend_t */ luahelper_set_intfield(L, "EXTEND_NONE", CAIRO_EXTEND_NONE); luahelper_set_intfield(L, "EXTEND_REPEAT", CAIRO_EXTEND_REPEAT); luahelper_set_intfield(L, "EXTEND_REFLECT", CAIRO_EXTEND_REFLECT); luahelper_set_intfield(L, "EXTEND_PAD", CAIRO_EXTEND_PAD); /* cairo_filter_t */ luahelper_set_intfield(L, "FILTER_FAST", CAIRO_FILTER_FAST); luahelper_set_intfield(L, "FILTER_GOOD", CAIRO_FILTER_GOOD); luahelper_set_intfield(L, "FILTER_BEST", CAIRO_FILTER_BEST); luahelper_set_intfield(L, "FILTER_NEAREST", CAIRO_FILTER_NEAREST); luahelper_set_intfield(L, "FILTER_BILINEAR", CAIRO_FILTER_BILINEAR); luahelper_set_intfield(L, "FILTER_GAUSSIAN", CAIRO_FILTER_GAUSSIAN); luahelper_create_metatable(L, MT_PATTERN, m_pattern); return 1; }
int luaopen_hardware_gpio(lua_State * L) { luaL_newlib(L, l_hardware_gpio); /* gpio_pull_t */ luahelper_set_intfield(L, "GPIO_PULL_UP", GPIO_PULL_UP); luahelper_set_intfield(L, "GPIO_PULL_DOWN", GPIO_PULL_DOWN); luahelper_set_intfield(L, "GPIO_PULL_NONE", GPIO_PULL_NONE); /* gpio_drv_t */ luahelper_set_intfield(L, "GPIO_DRV_LOW", GPIO_DRV_LOW); luahelper_set_intfield(L, "GPIO_DRV_MEDIAN", GPIO_DRV_MEDIAN); luahelper_set_intfield(L, "GPIO_DRV_HIGH", GPIO_DRV_HIGH); /* gpio_rate_t */ luahelper_set_intfield(L, "GPIO_RATE_FAST", GPIO_RATE_FAST); luahelper_set_intfield(L, "GPIO_RATE_SLOW", GPIO_RATE_SLOW); /* gpio_direction_t */ luahelper_set_intfield(L, "GPIO_DIRECTION_INPUT", GPIO_DIRECTION_INPUT); luahelper_set_intfield(L, "GPIO_DIRECTION_OUTPUT", GPIO_DIRECTION_OUTPUT); luahelper_set_intfield(L, "GPIO_DIRECTION_UNKOWN", GPIO_DIRECTION_UNKOWN); luahelper_create_metatable(L, MT_NAME_HARDWARE_GPIO, m_hardware_gpio); return 1; }
int luaopen_hardware_gpio(lua_State * L) { luaL_newlib(L, l_gpio); /* gpio_pull_t */ luahelper_set_intfield(L, "PULL_UP", GPIO_PULL_UP); luahelper_set_intfield(L, "PULL_DOWN", GPIO_PULL_DOWN); luahelper_set_intfield(L, "PULL_NONE", GPIO_PULL_NONE); /* gpio_drv_t */ luahelper_set_intfield(L, "DRV_WEAK)", GPIO_DRV_WEAK); luahelper_set_intfield(L, "DRV_WEAKER)", GPIO_DRV_WEAKER); luahelper_set_intfield(L, "DRV_STRONGER)", GPIO_DRV_STRONGER); luahelper_set_intfield(L, "DRV_STRONG)", GPIO_DRV_STRONG); /* gpio_rate_t */ luahelper_set_intfield(L, "RATE_SLOW", GPIO_RATE_SLOW); luahelper_set_intfield(L, "RATE_FAST", GPIO_RATE_FAST); /* gpio_direction_t */ luahelper_set_intfield(L, "DIR_INPUT", GPIO_DIRECTION_INPUT); luahelper_set_intfield(L, "DIR_OUTPUT", GPIO_DIRECTION_OUTPUT); luahelper_create_metatable(L, MT_HARDWARE_GPIO, m_gpio); return 1; }
int luaopen_object(lua_State * L) { luaL_newlib(L, l_object); /* enum alignment_t */ luahelper_set_intfield(L, "ALIGN_NONE", ALIGN_NONE); luahelper_set_intfield(L, "ALIGN_LEFT", ALIGN_LEFT); luahelper_set_intfield(L, "ALIGN_TOP", ALIGN_TOP); luahelper_set_intfield(L, "ALIGN_RIGHT", ALIGN_RIGHT); luahelper_set_intfield(L, "ALIGN_BOTTOM", ALIGN_BOTTOM); luahelper_set_intfield(L, "ALIGN_LEFT_TOP", ALIGN_LEFT_TOP); luahelper_set_intfield(L, "ALIGN_RIGHT_TOP", ALIGN_RIGHT_TOP); luahelper_set_intfield(L, "ALIGN_LEFT_BOTTOM", ALIGN_LEFT_BOTTOM); luahelper_set_intfield(L, "ALIGN_RIGHT_BOTTOM", ALIGN_RIGHT_BOTTOM); luahelper_set_intfield(L, "ALIGN_LEFT_CENTER", ALIGN_LEFT_CENTER); luahelper_set_intfield(L, "ALIGN_TOP_CENTER", ALIGN_TOP_CENTER); luahelper_set_intfield(L, "ALIGN_RIGHT_CENTER", ALIGN_RIGHT_CENTER); luahelper_set_intfield(L, "ALIGN_BOTTOM_CENTER", ALIGN_BOTTOM_CENTER); luahelper_set_intfield(L, "ALIGN_HORIZONTAL_CENTER", ALIGN_HORIZONTAL_CENTER); luahelper_set_intfield(L, "ALIGN_VERTICAL_CENTER", ALIGN_VERTICAL_CENTER); luahelper_set_intfield(L, "ALIGN_CENTER", ALIGN_CENTER); luahelper_set_intfield(L, "ALIGN_LEFT_FILL", ALIGN_LEFT_FILL); luahelper_set_intfield(L, "ALIGN_TOP_FILL", ALIGN_TOP_FILL); luahelper_set_intfield(L, "ALIGN_RIGHT_FILL", ALIGN_RIGHT_FILL); luahelper_set_intfield(L, "ALIGN_BOTTOM_FILL", ALIGN_BOTTOM_FILL); luahelper_set_intfield(L, "ALIGN_HORIZONTAL_FILL", ALIGN_HORIZONTAL_FILL); luahelper_set_intfield(L, "ALIGN_VERTICAL_FILL", ALIGN_VERTICAL_FILL); luahelper_set_intfield(L, "ALIGN_CENTER_FILL", ALIGN_CENTER_FILL); luahelper_create_metatable(L, MT_OBJECT, m_object); return 1; }