1212string_copy_free = Base. unsafe_string
1313
1414include (" generated/libxlsxwriter_api.jl" )
15-
16- # helpers to create Cstring from String
17- Cs (mystring) = isempty (mystring) ? C_NULL : Base. unsafe_convert (Cstring, mystring)
18- Cs_ (mystring) = Base. unsafe_convert (Cstring, mystring)
19- macro Cs_str (str); Base. unsafe_convert (Cstring, str); end
20- function Cs (list:: Vector{String} )
21- ptrs = Base. unsafe_convert .(Cstring, list)
22- push! (ptrs, C_NULL )
23- Base. unsafe_convert (Ptr{Cstring}, ptrs)
24- end
25-
26-
27- lxw_button_options (; caption= " " , _macro= " " , description= " " , width= LXW_DEF_COL_WIDTH_PIXELS, height= LXW_DEF_ROW_HEIGHT_PIXELS, x_scale= 1.0 , y_scale= 1.0 , x_offset= 0 , y_offset= 0 ) =
28- Ref (lxw_button_options (Cs (caption), Cs (_macro), Cs (description), width, height, x_scale, y_scale, x_offset, y_offset))
29-
30- function lxw_chart_data_label (; value= " " , hide= 0x0 , font= C_NULL , line= C_NULL , fill= C_NULL , pattern= C_NULL )
31- Ref (lxw_chart_data_label (
32- Cs (value),
33- hide,
34- Base. unsafe_convert (Ptr{lxw_chart_font}, font),
35- Base. unsafe_convert (Ptr{lxw_chart_line}, line),
36- Base. unsafe_convert (Ptr{lxw_chart_fill}, fill),
37- Base. unsafe_convert (Ptr{lxw_chart_pattern}, pattern)
38- ))
39- end
40-
41- lxw_chart_fill (; color= 0x0 , none= 0x0 , transparency= 0x0 ) = Ref (lxw_chart_fill (color, none, transparency))
42-
43- lxw_chart_font (; name= " Arial" , size= 11.0 , bold= 0x0 , italic= 0x0 , underline= 0x0 , rotation= 0 , color= LXW_COLOR_BLACK, pitch_family= 0x0 , charset= 0x0 , baseline= 0 ) =
44- Ref (lxw_chart_font (Cs (name), size, bold, italic, underline, rotation, color, pitch_family, charset, baseline))
45-
46- lxw_chart_line (; color= 0x0 , none= 0x0 , width= 0.0 , dash_type= 0x0 , transparency= 0x0 ) = Ref (lxw_chart_line (color, none, width, dash_type, transparency))
47-
48- lxw_chart_options (; x_offset= 0 , y_offset= 0 , x_scale= 1.0 , y_scale= 1.0 , object_position= 0x0 , description= " " , decorative= 0x0 ) =
49- Ref (lxw_chart_options (x_offset, y_offset, x_scale, y_scale, object_position, Cs (description), decorative))
50-
51- lxw_chart_pattern (; fg_color= 0x0 , bg_color= 0x0 , type= LXW_PATTERN_NONE) = Ref (lxw_chart_pattern (fg_color, bg_color, type))
52-
53- function lxw_chart_point (; line= C_NULL , fill= C_NULL , pattern= C_NULL )
54- Ref (lxw_chart_point (
55- Base. unsafe_convert (Ptr{lxw_chart_line}, line),
56- Base. unsafe_convert (Ptr{lxw_chart_fill}, fill),
57- Base. unsafe_convert (Ptr{lxw_chart_pattern}, pattern)
58- ))
59- end
60-
61- lxw_comment_options (; visible= 0x0 , author= " " , width= 0 , height= 0 , x_scale= 1.0 , y_scale= 1.0 , color= LXW_COLOR_UNSET, font_name= " " , font_size= 8 , font_family= 0x2 , start_row= 0x0 , start_col= 0x0 , x_offset= 15 , y_offset= 10 ) =
62- Ref (lxw_comment_options (visible, Cs (author), width, height, x_scale, y_scale, color, Cs (font_name), font_size, font_family, start_row, start_col, x_offset, y_offset))
63-
64- lxw_data_validation (; validate= 0x0 , criteria= 0x0 , ignore_blank= 0x0 , show_input= 0x0 , show_error= 0x0 , error_type= 0x0 , dropdown= 0x0 , value_number= 0.0 , value_formula= " " ,
65- value_list= String[], value_datetime= lxw_datetime (), minimum_number= 0.0 , minimum_formula= " " , minimum_datetime= lxw_datetime (), maximum_number= 0.0 ,
66- maximum_formula= " " , maximum_datetime= lxw_datetime (), input_title= " " , input_message= " " , error_title= " " , error_message= " " ) =
67- Ref (lxw_data_validation (validate, criteria, ignore_blank, show_input, show_error, error_type, dropdown, value_number, Cs_ (value_formula),
68- Cs (value_list),
69- value_datetime. x, minimum_number, Cs_ (minimum_formula), minimum_datetime. x, maximum_number,
70- Cs_ (maximum_formula), maximum_datetime. x, Cs_ (input_title), Cs_ (input_message), Cs_ (error_title), Cs_ (error_message)))
71-
72- lxw_datetime (; year= 0 , month= 0 , day= 0 , hour= 0 , min= 0 , sec= 0 ) = Ref (lxw_datetime (year, month, day, hour, min, sec))
73-
74- lxw_doc_properties (; title= " " , subject= " " , author= " " , manager= " " , company= " " , category= " " , keywords= " " , comments= " " , status= " " , hyperlink_base= " " , created= 0 ) =
75- Ref (lxw_doc_properties (Cs (title), Cs (subject), Cs (author), Cs (manager), Cs (company), Cs (category), Cs (keywords), Cs (comments), Cs (status), Cs (hyperlink_base), created))
76-
77- lxw_filter_rule (; criteria= 0x0 , value_string= " " , value= 0.0 ) = Ref (lxw_filter_rule (criteria, Cs (value_string), value))
78-
79- lxw_header_footer_options (; margin= 0.0 , image_left= " " , image_center= " " , image_right= " " ) =
80- Ref (lxw_header_footer_options (margin, Cs (image_left), Cs (image_center), Cs (image_right)))
81-
82- function lxw_image_options (; x_offset= 0 , y_offset= 0 , x_scale= 1.0 , y_scale= 1.0 , object_position= 0x0 , description= " " , decorative= 0x0 , url= " " , tip= " " , cell_format= C_NULL )
83- Ref (lxw_image_options (Int32 (x_offset), Int32 (y_offset), Float64 (x_scale), Float64 (y_scale), object_position, Cs_ (description), decorative, Cs_ (url), Cs_ (tip),
84- Base. unsafe_convert (Ptr{lxw_format}, cell_format)
85- ))
86- end
87-
88- lxw_rich_string_tuple (; format= C_NULL , string= " " ) =
89- Ref (lxw_rich_string_tuple (Base. unsafe_convert (Ptr{lxw_format}, format), Cs (string)))
90-
91- lxw_row_col_options (; hidden= 0x0 , level= 0x0 , collapsed= 0x0 ) = Ref (lxw_row_col_options (hidden, level, collapsed))
92-
93- # utility.h
94- CELL (cell) = lxw_name_to_row (cell), lxw_name_to_col (cell)
95- COLS (cols) = lxw_name_to_col (cols), lxw_name_to_col_2 (cols)
96- RANGE (range) = lxw_name_to_row (range), lxw_name_to_col (range), lxw_name_to_row_2 (range), lxw_name_to_col_2 (range)
97-
98- # helpers for CELL
99- worksheet_data_validation_cell (worksheet, cell:: Tuple{UInt32, UInt16} , validation) = worksheet_data_validation_cell (worksheet, cell... , validation)
100- worksheet_embed_image (worksheet, cell:: Tuple{UInt32, UInt16} , filename) = worksheet_embed_image (worksheet, cell... , filename)
101- worksheet_embed_image_buffer (worksheet, cell:: Tuple{UInt32, UInt16} , image_buffer, image_size) = worksheet_embed_image_buffer (worksheet, cell... , image_buffer, image_size)
102- worksheet_insert_chart (worksheet, cell:: Tuple{UInt32, UInt16} , chart) = worksheet_insert_chart (worksheet, cell... , chart)
103- worksheet_insert_chart_opt (worksheet, cell:: Tuple{UInt32, UInt16} , chart, options) = worksheet_insert_chart_opt (worksheet, cell... , chart, options)
104- worksheet_insert_image (worksheet, cell:: Tuple{UInt32, UInt16} , filename) = worksheet_insert_image (worksheet, cell... , filename)
105- worksheet_insert_image_buffer (worksheet, cell:: Tuple{UInt32, UInt16} , image_buffer, image_size) = worksheet_insert_image_buffer (worksheet, cell... , image_buffer, image_size)
106- worksheet_insert_image_buffer_opt (worksheet, cell:: Tuple{UInt32, UInt16} , image_buffer, image_size, options) = worksheet_insert_image_buffer_opt (worksheet, cell... , image_buffer, image_size, options)
107- worksheet_write_comment (worksheet, cell:: Tuple{UInt32, UInt16} , string) = worksheet_write_comment (worksheet, cell... , string)
108- worksheet_write_comment_opt (worksheet, cell:: Tuple{UInt32, UInt16} , string, options) = worksheet_write_comment_opt (worksheet, cell... , string, options)
109- worksheet_write_datetime (worksheet, cell:: Tuple{UInt32, UInt16} , datetime, format) = worksheet_write_datetime (worksheet, cell... , datetime, format)
110- worksheet_write_dynamic_formula (worksheet, cell:: Tuple{UInt32, UInt16} , formula, format) = worksheet_write_dynamic_formula (worksheet, cell... , formula, format)
111- worksheet_write_formula (worksheet, cell:: Tuple{UInt32, UInt16} , formula, format) = worksheet_write_formula (worksheet, cell... , formula, format)
112- worksheet_write_number (worksheet, cell:: Tuple{UInt32, UInt16} , number, format) = worksheet_write_number (worksheet, cell... , number, format)
113- worksheet_write_rich_string (worksheet, cell:: Tuple{UInt32, UInt16} , rich_string, format) = worksheet_write_rich_string (worksheet, cell... , rich_string, format)
114- worksheet_write_string (worksheet, cell:: Tuple{UInt32, UInt16} , string, format) = worksheet_write_string (worksheet, cell... , string, format)
115- worksheet_write_url (worksheet, cell:: Tuple{UInt32, UInt16} , url, format) = worksheet_write_url (worksheet, cell... , url, format)
116-
117- # helper for RANGE
118- worksheet_write_array_formula (worksheet, range:: Tuple{UInt32, UInt16, UInt32, UInt16} , formula, format) = worksheet_write_array_formula (worksheet, range... , formula, format)
119-
120- # helper for COLS
121- worksheet_set_column (worksheet, column:: Tuple{UInt16, UInt16} , width, format) = worksheet_set_column (worksheet, column... , width, format)
15+ include (" helpers.jl" )
16+ include (" lxw.jl" )
12217
12318#= 1153 identifiers
12419for n in names(@__MODULE__; all=true)
@@ -128,11 +23,4 @@ for n in names(@__MODULE__; all=true)
12823end
12924=#
13025
131- function debug_list (list)
132- @ccall libxlsxwriter. _validation_list_to_csv (
133- list:: Ptr{Cstring} ,
134- ):: Cstring
135- end
136-
137-
13826end
0 commit comments