@@ -259,7 +259,8 @@ struct nk_rect {float x,y,w,h;};
259259struct nk_recti {short x ,y ,w ,h ;};
260260typedef char nk_glyph [NK_UTF_SIZE ];
261261typedef union {void * ptr ; int id ;} nk_handle ;
262- struct nk_image {nk_handle handle ;unsigned short w ,h ;unsigned short region [4 ];};
262+ struct nk_image {nk_handle handle ; nk_ushort w , h ; nk_ushort region [4 ];};
263+ struct nk_nine_slice {struct nk_image img ; nk_ushort l , t , r , b ;};
263264struct nk_cursor {struct nk_image img ; struct nk_vec2 size , offset ;};
264265struct nk_scroll {nk_uint x , y ;};
265266
@@ -3493,9 +3494,21 @@ NK_API struct nk_image nk_image_handle(nk_handle);
34933494NK_API struct nk_image nk_image_ptr (void * );
34943495NK_API struct nk_image nk_image_id (int );
34953496NK_API nk_bool nk_image_is_subimage (const struct nk_image * img );
3496- NK_API struct nk_image nk_subimage_ptr (void * , unsigned short w , unsigned short h , struct nk_rect sub_region );
3497- NK_API struct nk_image nk_subimage_id (int , unsigned short w , unsigned short h , struct nk_rect sub_region );
3498- NK_API struct nk_image nk_subimage_handle (nk_handle , unsigned short w , unsigned short h , struct nk_rect sub_region );
3497+ NK_API struct nk_image nk_subimage_ptr (void * , nk_ushort w , nk_ushort h , struct nk_rect sub_region );
3498+ NK_API struct nk_image nk_subimage_id (int , nk_ushort w , nk_ushort h , struct nk_rect sub_region );
3499+ NK_API struct nk_image nk_subimage_handle (nk_handle , nk_ushort w , nk_ushort h , struct nk_rect sub_region );
3500+ /* =============================================================================
3501+ *
3502+ * 9-SLICE
3503+ *
3504+ * ============================================================================= */
3505+ NK_API struct nk_nine_slice nk_nine_slice_handle (nk_handle , nk_ushort l , nk_ushort t , nk_ushort r , nk_ushort b );
3506+ NK_API struct nk_nine_slice nk_nine_slice_ptr (void * , nk_ushort l , nk_ushort t , nk_ushort r , nk_ushort b );
3507+ NK_API struct nk_nine_slice nk_nine_slice_id (int , nk_ushort l , nk_ushort t , nk_ushort r , nk_ushort b );
3508+ NK_API int nk_nine_slice_is_sub9slice (const struct nk_nine_slice * img );
3509+ NK_API struct nk_nine_slice nk_sub9slice_ptr (void * , nk_ushort w , nk_ushort h , struct nk_rect sub_region , nk_ushort l , nk_ushort t , nk_ushort r , nk_ushort b );
3510+ NK_API struct nk_nine_slice nk_sub9slice_id (int , nk_ushort w , nk_ushort h , struct nk_rect sub_region , nk_ushort l , nk_ushort t , nk_ushort r , nk_ushort b );
3511+ NK_API struct nk_nine_slice nk_sub9slice_handle (nk_handle , nk_ushort w , nk_ushort h , struct nk_rect sub_region , nk_ushort l , nk_ushort t , nk_ushort r , nk_ushort b );
34993512/* =============================================================================
35003513 *
35013514 * MATH
@@ -4387,6 +4400,7 @@ NK_API void nk_fill_polygon(struct nk_command_buffer*, float*, int point_count,
43874400
43884401/* misc */
43894402NK_API void nk_draw_image (struct nk_command_buffer * , struct nk_rect , const struct nk_image * , struct nk_color );
4403+ NK_API void nk_draw_nine_slice (struct nk_command_buffer * , struct nk_rect , const struct nk_nine_slice * , struct nk_color );
43904404NK_API void nk_draw_text (struct nk_command_buffer * , struct nk_rect , const char * text , int len , const struct nk_user_font * , struct nk_color , struct nk_color );
43914405NK_API void nk_push_scissor (struct nk_command_buffer * , struct nk_rect );
43924406NK_API void nk_push_custom (struct nk_command_buffer * , struct nk_rect , nk_command_custom_callback , nk_handle usr );
@@ -4604,12 +4618,14 @@ NK_API void nk_draw_list_push_userdata(struct nk_draw_list*, nk_handle userdata)
46044618 * ===============================================================*/
46054619enum nk_style_item_type {
46064620 NK_STYLE_ITEM_COLOR ,
4607- NK_STYLE_ITEM_IMAGE
4621+ NK_STYLE_ITEM_IMAGE ,
4622+ NK_STYLE_ITEM_NINE_SLICE
46084623};
46094624
46104625union nk_style_item_data {
4611- struct nk_image image ;
46124626 struct nk_color color ;
4627+ struct nk_image image ;
4628+ struct nk_nine_slice slice ;
46134629};
46144630
46154631struct nk_style_item {
@@ -5035,8 +5051,9 @@ struct nk_style {
50355051 struct nk_style_window window ;
50365052};
50375053
5038- NK_API struct nk_style_item nk_style_item_image (struct nk_image img );
50395054NK_API struct nk_style_item nk_style_item_color (struct nk_color );
5055+ NK_API struct nk_style_item nk_style_item_image (struct nk_image img );
5056+ NK_API struct nk_style_item nk_style_item_nine_slice (struct nk_nine_slice slice );
50405057NK_API struct nk_style_item nk_style_item_hide (void );
50415058
50425059/*==============================================================
0 commit comments