@@ -83,6 +83,10 @@ ZEND_BEGIN_ARG_INFO_EX(format_background_arginfo, 0, 0, 2)
8383 ZEND_ARG_INFO (0 , pattern )
8484 ZEND_ARG_INFO (0 , color )
8585ZEND_END_ARG_INFO ()
86+
87+ ZEND_BEGIN_ARG_INFO_EX (format_border_arginfo , 0 , 0 , 1 )
88+ ZEND_ARG_INFO (0 , style )
89+ ZEND_END_ARG_INFO ()
8690/* }}} */
8791
8892/** {{{ \Vtiful\Kernel\Format::__construct()
@@ -295,6 +299,26 @@ PHP_METHOD(vtiful_format, wrap)
295299}
296300/* }}} */
297301
302+ /** {{{ \Vtiful\Kernel\Format::toResource()
303+ */
304+ PHP_METHOD (vtiful_format , border )
305+ {
306+ zend_long style ;
307+
308+ ZEND_PARSE_PARAMETERS_START (1 , 1 )
309+ Z_PARAM_LONG (style )
310+ ZEND_PARSE_PARAMETERS_END ();
311+
312+ ZVAL_COPY (return_value , getThis ());
313+
314+ format_object * obj = Z_FORMAT_P (getThis ());
315+
316+ if (obj -> ptr .format ) {
317+ format_set_border (obj -> ptr .format , style );
318+ }
319+ }
320+ /* }}} */
321+
298322/** {{{ \Vtiful\Kernel\Format::toResource()
299323 */
300324PHP_METHOD (vtiful_format , toResource )
@@ -313,6 +337,7 @@ zend_function_entry format_methods[] = {
313337 PHP_ME (vtiful_format , wrap , NULL , ZEND_ACC_PUBLIC )
314338 PHP_ME (vtiful_format , bold , NULL , ZEND_ACC_PUBLIC )
315339 PHP_ME (vtiful_format , italic , NULL , ZEND_ACC_PUBLIC )
340+ PHP_ME (vtiful_format , border , format_border_arginfo , ZEND_ACC_PUBLIC )
316341 PHP_ME (vtiful_format , align , format_align_arginfo , ZEND_ACC_PUBLIC )
317342 PHP_ME (vtiful_format , number , format_number_arginfo , ZEND_ACC_PUBLIC )
318343 PHP_ME (vtiful_format , fontColor , format_color_arginfo , ZEND_ACC_PUBLIC )
@@ -393,6 +418,20 @@ VTIFUL_STARTUP_FUNCTION(format) {
393418 REGISTER_CLASS_CONST_LONG (vtiful_format_ce , "PATTERN_GRAY_125" , LXW_PATTERN_GRAY_125 )
394419 REGISTER_CLASS_CONST_LONG (vtiful_format_ce , "PATTERN_GRAY_0625" , LXW_PATTERN_GRAY_0625 )
395420
421+ REGISTER_CLASS_CONST_LONG (vtiful_format_ce , "BORDER_THIN" , LXW_BORDER_THIN )
422+ REGISTER_CLASS_CONST_LONG (vtiful_format_ce , "BORDER_MEDIUM" , LXW_BORDER_MEDIUM )
423+ REGISTER_CLASS_CONST_LONG (vtiful_format_ce , "BORDER_DASHED" , LXW_BORDER_DASHED )
424+ REGISTER_CLASS_CONST_LONG (vtiful_format_ce , "BORDER_DOTTED" , LXW_BORDER_DOTTED )
425+ REGISTER_CLASS_CONST_LONG (vtiful_format_ce , "BORDER_THICK" , LXW_BORDER_THICK )
426+ REGISTER_CLASS_CONST_LONG (vtiful_format_ce , "BORDER_DOUBLE" , LXW_BORDER_DOUBLE )
427+ REGISTER_CLASS_CONST_LONG (vtiful_format_ce , "BORDER_HAIR" , LXW_BORDER_HAIR )
428+ REGISTER_CLASS_CONST_LONG (vtiful_format_ce , "BORDER_MEDIUM_DASHED" , LXW_BORDER_MEDIUM_DASHED )
429+ REGISTER_CLASS_CONST_LONG (vtiful_format_ce , "BORDER_DASH_DOT" , LXW_BORDER_DASH_DOT )
430+ REGISTER_CLASS_CONST_LONG (vtiful_format_ce , "BORDER_MEDIUM_DASH_DOT" , LXW_BORDER_MEDIUM_DASH_DOT )
431+ REGISTER_CLASS_CONST_LONG (vtiful_format_ce , "BORDER_DASH_DOT_DOT" , LXW_BORDER_DASH_DOT_DOT )
432+ REGISTER_CLASS_CONST_LONG (vtiful_format_ce , "BORDER_MEDIUM_DASH_DOT_DOT" , LXW_BORDER_MEDIUM_DASH_DOT_DOT )
433+ REGISTER_CLASS_CONST_LONG (vtiful_format_ce , "BORDER_SLANT_DASH_DOT" , LXW_BORDER_SLANT_DASH_DOT )
434+
396435 return SUCCESS ;
397436}
398437/* }}} */
0 commit comments