[go: up one dir, main page]

Skip to content

Commit

Permalink
all: add pub access modifier to publicly used struct fields (#572)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm authored Apr 6, 2024
1 parent bde4279 commit f1c219b
Show file tree
Hide file tree
Showing 60 changed files with 72 additions and 7 deletions.
1 change: 1 addition & 0 deletions component/accordion.v
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub mut:

@[params]
pub struct AccordionParams {
pub:
id string
titles []string
children []ui.Widget
Expand Down
1 change: 1 addition & 0 deletions component/alpha.v
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub mut:

@[params]
pub struct AlphaParams {
pub:
id string
alpha int
direction ui.Direction = .column
Expand Down
1 change: 1 addition & 0 deletions component/colorbox.v
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ pub mut:

@[params]
pub struct ColorBoxParams {
pub:
id string
light bool
hsl bool
Expand Down
1 change: 1 addition & 0 deletions component/colorbutton.v
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub mut:

@[params]
pub struct ColorButtonParams {
pub:
id string
text string
height int
Expand Down
1 change: 1 addition & 0 deletions component/colorpalette.v
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub mut:

@[params]
pub struct ColorPaletteParams {
pub:
id string
title string
items []string
Expand Down
1 change: 1 addition & 0 deletions component/colorsliders.v
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pub mut:

@[params]
pub struct ColorSlidersParams {
pub:
id string
color gx.Color = gx.white
orientation ui.Orientation = .vertical
Expand Down
1 change: 1 addition & 0 deletions component/demo.v
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub mut:

@[params]
pub struct DemoParams {
pub:
id string = 'demo'
}

Expand Down
1 change: 1 addition & 0 deletions component/double_listbox.v
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub mut:

@[params]
pub struct DoubleListBoxParams {
pub:
id string
title string
items []string
Expand Down
1 change: 1 addition & 0 deletions component/filebrowser.v
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub mut:

@[params]
pub struct FileBrowserParams {
pub:
id string
dirs []string = [os.expand_tilde_to_home('~'), '/']
text_ok string = 'Ok'
Expand Down
1 change: 1 addition & 0 deletions component/fontbutton.v
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub mut:

@[params]
pub struct FontButtonParams {
pub:
id string
dtw ui.DrawTextWidget = ui.canvas_plus()
text string
Expand Down
1 change: 1 addition & 0 deletions component/fontchooser.v
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub mut:

@[params]
pub struct FontChooserParams {
pub:
id string = component.fontchooser_lb_id
draw_lines bool = true
dtw ui.DrawTextWidget = ui.canvas_plus() // since it requires an intialisation
Expand Down
1 change: 1 addition & 0 deletions component/gg_app.v
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub mut:

@[params]
pub struct GGComponentParams {
pub:
id string = 'gg_app'
app ui.GGApplication
z_index int
Expand Down
1 change: 1 addition & 0 deletions component/grid.v
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ pub mut:

@[params]
pub struct GridParams {
pub:
vars map[string]GridData
formulas map[string]string
width int = 100
Expand Down
1 change: 1 addition & 0 deletions component/grid_data.v
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub mut:
@[params]
pub struct DataGridParams {
GridParams // for settings prepended by settings_
pub:
settings_bg_color gx.Color = gx.light_blue
settings_z_index int = 100
}
Expand Down
1 change: 1 addition & 0 deletions component/grid_tools.v
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub mut:

@[params]
pub struct GridSettingsParams {
pub:
id string
bg_color gx.Color = gx.light_blue
grid &GridComponent = unsafe { nil }
Expand Down
1 change: 1 addition & 0 deletions component/hideable.v
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub mut:

@[params]
pub struct HideableParams {
pub:
id string
bg_color gx.Color
layout &ui.Stack = unsafe { nil }
Expand Down
1 change: 1 addition & 0 deletions component/menufile.v
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub mut:

@[params]
pub struct MenuFileParams {
pub:
id string
hidden_files bool
dirs []string
Expand Down
1 change: 1 addition & 0 deletions component/messagebox.v
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub struct MessageBoxComponent {

@[params]
pub struct MessageBoxParams {
pub:
id string
text string
on_click MessageBoxFn = MessageBoxFn(0)
Expand Down
1 change: 1 addition & 0 deletions component/rasterview.v
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ pub mut:

@[params]
pub struct RasterViewParams {
pub:
id string
width int = 16
height int = 16
Expand Down
1 change: 1 addition & 0 deletions component/settings.v
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ mut:

@[params]
pub struct SettingFontParams {
pub:
id string
param string
text string
Expand Down
1 change: 1 addition & 0 deletions component/splitpanel.v
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub mut:

@[params]
pub struct SplitPanelParams {
pub:
id string
child1 &ui.Widget = unsafe { nil }
child2 &ui.Widget = unsafe { nil }
Expand Down
1 change: 1 addition & 0 deletions component/subwindow_filebrowser.v
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const newfilebrowser_subwindow_id = '_sw_newfilebrowser'
@[params]
pub struct FileBrowserSubWindowParams {
FileBrowserParams
pub:
x int
y int
}
Expand Down
1 change: 1 addition & 0 deletions component/subwindow_messagebox.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import ui

@[params]
pub struct MessageBoxSubWindowParams {
pub:
id string
text string
shortcut string = 'ctrl + h'
Expand Down
1 change: 1 addition & 0 deletions component/tabs.v
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pub mut:

@[params]
pub struct TabsParams {
pub:
id string
mode TabsMode = .vertical
active int
Expand Down
2 changes: 2 additions & 0 deletions component/treeview.v
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ pub mut:

@[params]
pub struct TreeViewParams {
pub:
id string
trees []Tree
icons map[string]string
Expand Down Expand Up @@ -205,6 +206,7 @@ pub fn treeview_stack(c TreeViewParams) &ui.Stack {

@[params]
pub struct TreeViewDirParams {
pub:
id string = 'tvd'
trees []string
icons map[string]string
Expand Down
1 change: 1 addition & 0 deletions libvg/raster.v
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub mut:

@[params]
pub struct RasterParams {
pub:
width int = 16
height int = 16
channels int = 4
Expand Down
1 change: 1 addition & 0 deletions libvg/raster_tool.v
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ fn color_multiply_alpha(c gx.Color, a f64) gx.Color {

@[params]
pub struct TextBlockParams {
pub:
x int // x postion of the left high corner
y int // y postion of the left high corner
w int // width of the text block
Expand Down
1 change: 1 addition & 0 deletions libvg/raster_ttf.v
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pub fn (r &Raster) get_info_string() {

@[params]
pub struct SetFontSizeParams {
pub:
font_size int
device_dpi int = 72
}
Expand Down
2 changes: 2 additions & 0 deletions libvg/svg.v
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub mut:

@[params]
pub struct SvgParams {
pub:
height int
width int
}
Expand Down Expand Up @@ -60,6 +61,7 @@ pub fn (mut s Svg) save(filepath string) ! {

@[params]
pub struct Params {
pub:
stroke string = 'none'
strokewidth int
fill string = 'none'
Expand Down
2 changes: 2 additions & 0 deletions src/button.v
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type ButtonMouseMoveFn = fn (&Button, &MouseMoveEvent)
@[heap]
pub struct Button {
// init size read-only
pub:
width_ int
height_ int
pub mut:
Expand Down Expand Up @@ -89,6 +90,7 @@ pub mut:
@[params]
pub struct ButtonParams {
ButtonStyleParams
pub:
id string
text string
icon_path string
Expand Down
1 change: 1 addition & 0 deletions src/canvas.v
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ mut:

@[params]
pub struct CanvasParams {
pub:
id string
width int
height int
Expand Down
8 changes: 7 additions & 1 deletion src/chunkview.v
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const para_style_delim = '|'

@[params]
pub struct Offset {
mut:
pub mut:
x int
y int
}
Expand Down Expand Up @@ -60,6 +60,7 @@ mut:

@[params]
pub struct TextChunkParams {
pub:
x int
y int
text string
Expand Down Expand Up @@ -167,6 +168,7 @@ mut:

@[params]
pub struct ParaChunkParams {
pub:
x int
y int
margin int
Expand Down Expand Up @@ -374,6 +376,7 @@ pub mut:

@[params]
pub struct AlignChunkParams {
pub:
x int
y int
spacing int = 10
Expand All @@ -384,6 +387,7 @@ pub struct AlignChunkParams {
@[params]
pub struct VerticalAlignChunkParams {
AlignChunkParams
pub:
align f32 // in [0,1]
}

Expand Down Expand Up @@ -624,6 +628,7 @@ pub mut:

@[params]
pub struct RowChunkParams {
pub:
x int
y int
chunks []ChunkContent
Expand Down Expand Up @@ -776,6 +781,7 @@ pub mut:

@[params]
pub struct ChunkViewParams {
pub:
id string
chunks []ChunkContent
clipping bool = true
Expand Down
1 change: 1 addition & 0 deletions src/draw_device_bitmap.v
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub mut:

@[params]
pub struct DrawDeviceBitmapParams {
pub:
id string = 'dd_bitmap'
}

Expand Down
1 change: 1 addition & 0 deletions src/draw_device_print.v
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ struct DrawDevicePrint {

@[params]
pub struct DrawDevicePrintParams {
pub:
id string = 'dd_print'
filename string
}
Expand Down
1 change: 1 addition & 0 deletions src/dropdown.v
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ pub mut:
@[params]
pub struct DropdownParams {
DropdownStyleParams
pub:
id string
def_text string
x int
Expand Down
1 change: 1 addition & 0 deletions src/extra_size.v
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ pub mut:

// for Config
pub struct Margin {
pub:
top f64
right f64
bottom f64
Expand Down
1 change: 1 addition & 0 deletions src/grid.v
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub mut:

@[params]
pub struct GridParams {
pub:
header []string
body [][]string
height int = 200
Expand Down
1 change: 1 addition & 0 deletions src/interface_application.v
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub fn (mut app Application) add_window(p WindowParams) {

@[params]
pub struct WindowCallbackParams {
pub:
on_click WindowMouseFn = unsafe { nil }
on_mouse_down WindowMouseFn = unsafe { nil }
on_mouse_up WindowMouseFn = unsafe { nil }
Expand Down
1 change: 1 addition & 0 deletions src/label.v
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ pub mut:
@[params]
pub struct LabelParams {
LabelStyleParams
pub:
id string
width int
height int
Expand Down
1 change: 1 addition & 0 deletions src/layout_canvas.v
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ mut:
@[params]
pub struct CanvasLayoutParams {
CanvasLayoutStyleParams
pub:
id string
width int
height int
Expand Down
Loading

0 comments on commit f1c219b

Please sign in to comment.