Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GFM: Properties inheritance #1548

Open
msink opened this issue Oct 12, 2020 · 2 comments
Open

GFM: Properties inheritance #1548

msink opened this issue Oct 12, 2020 · 2 comments
Labels
bug format: gfm An issue/PR related to Dokka's GFM output format

Comments

@msink
Copy link
Contributor

msink commented Oct 12, 2020

Describe the bug

Functions inheritance works (almost) correctly, but properties handled differently and wrong.

Say we have class hierarhy (simplified a little):

abstract class Disposable() {
    val disposed: Boolean
    open fun dispose()
}

abstract class Control() : Disposable() {
    override fun dispose()
    val toplevel: Boolean
    var parent: Control?

    fun isEnabled(): Boolean
    fun isEnabledToUser(): Boolean
    fun enable()
    fun disable()
    var enabled: Boolean

    fun isVisible(): Boolean
    fun show() 
    fun hide() 
    var visible: Boolean
}

class Button() : Control() {
    var text: String
    fun action(block: Button.() -> Unit) {  }
}

In 1.4.20-dev-10 Button overview translates to:

Functions

Name Summary
action fun [action](action.md)(block: [Button](README.md).() -> Unit)
disable fun [disable](../-control/disable.md)()
dispose open override fun [dispose](../-control/dispose.md)()
enable fun [enable](../-control/enable.md)()
equals open operator fun [equals](../../libui.ktx.draw/-attributed-string/README.md#kotlin%2FAny%2Fequals%2F%23kotlin.Any%3F%2FPointingToDeclaration%2F)(other: Any?): Boolean (1)
hashCode open fun [hashCode](../../libui.ktx.draw/-attributed-string/README.md#kotlin%2FAny%2FhashCode%2F%23%2FPointingToDeclaration%2F)(): Int (1)
hide fun [hide](../-control/hide.md)()<br>Hides the Control.
isEnabled fun [isEnabled](../-control/is-enabled.md)(): Boolean
isEnabledToUser fun [isEnabledToUser](../-control/is-enabled-to-user.md)(): Boolean
isVisible fun [isVisible](../-control/is-visible.md)(): Boolean
show fun [show](../-control/show.md)()
toString open fun [toString](../../libui.ktx.draw/-attributed-string/README.md#kotlin%2FAny%2FtoString%2F%23%2FPointingToDeclaration%2F)(): String (1)

Properties

Name Summary
disposed val [disposed](disposed.md): Boolean (2)
enabled var [enabled](enabled.md): Boolean (3)
parent var [parent](parent.md): [Control](../-control/README.md)? (3)
text var [text](text.md): String
toplevel val [toplevel](toplevel.md): Boolean (3)
visible var [visible](visible.md): Boolean (3)

Expected behaviour

(1) - should not be here at all (already reported in #1523)

(2) - should refer to ../-disposable/

(3) - should refer to ../-control/

@msink msink added the bug label Oct 12, 2020
@msink
Copy link
Contributor Author

msink commented Oct 15, 2020

And second issue - wrote here as #1386 was closed - seems that #1442 should to be reverted, because it is both:

  1. broken: still generated broken links
    <a name="libui.ktx/Button/action/#kotlin.Function1[libui.ktx.Button,kotlin.Unit]/PointingToDeclaration/"></a>[action](action.md)
  2. unneeded: superseded by Adding separate pages for properties #1494

@msink
Copy link
Contributor Author

msink commented May 8, 2021

Still broken in 1.4.32, here is my diff for files generatd by Dokka 0.9.17 and Dokka 1.4.32
Mor or less comparable, but links to Inherited properties broken badly.
(sources in https://github.com/msink/kotlin-libui/tree/dokka) :

 
 # Button
 
-`class Button : `[`Control`](../-control/README.md)`<`[`uiButton`](../../libui/ui-button.md)`>`
+`class `[`Button`](README.md)`(text: String) : `[`Control`](../-control/README.md)`<uiButton> `
+
+Wrapper class for uiButton - a simple button.
 
-Wrapper class for [uiButton](../../libui/ui-button.md) - a simple button.
 
 ### Constructors
 
-| Name | Summary |
+| | |
 |---|---|
-| [Button](-button.md) | `Button(text: String)`<br>Wrapper class for [uiButton](../../libui/ui-button.md) - a simple button. |
+| [Button](-button.md) | `fun `[`Button`](-button.md)`(text: String)` |
 
 ### Properties
 
 | Name | Summary |
 |---|---|
-| [text](text.md) | `var text: String`<br>The static text of the button. |
+| [text](text.md) | `var `[`text`](text.md)`: String`<br>The static text of the button. |
 
 ### Inherited properties
 
 | Name | Summary |
 |---|---|
+| [disposed](README.md#-1156166768%2FProperties%2F123127132) | `val `[`disposed`](README.md#-1156166768%2FProperties%2F123127132)`: Boolean`<br>Returns `true` if object was disposed - in this case [dispose](../-disposable/dispose.md) will do nothing, all other operations are invalid and will `throw Error("Resource is disposed")`. |
-| [enabled](../-control/enabled.md) | `var enabled: Boolean`<br>Whether the Control should be enabled or disabled. Defaults to `true`. |
+| [enabled](README.md#-1213503932%2FProperties%2F123127132) | `var `[`enabled`](README.md#-1213503932%2FProperties%2F123127132)`: Boolean`<br>Whether the Control should be enabled or disabled. |
-| [parent](../-control/parent.md) | `var parent: `[`Control`](../-control/README.md)`<*>?`<br>Returns parent of the control or `null` for detached. |
+| [parent](README.md#-2075457877%2FProperties%2F123127132) | `var `[`parent`](README.md#-2075457877%2FProperties%2F123127132)`: `[`Control`](../-control/README.md)`<*>?`<br>Returns parent of the control or `null` for detached. |
-| [toplevel](../-control/toplevel.md) | `val toplevel: Boolean`<br>Returns whether the control is a top level one or not. |
+| [toplevel](README.md#-865778266%2FProperties%2F123127132) | `val `[`toplevel`](README.md#-865778266%2FProperties%2F123127132)`: Boolean`<br>Returns whether the control is a top level one or not. |
-| [visible](../-control/visible.md) | `var visible: Boolean`<br>Whether the Control should be visible or hidden. Defaults to `true`. |
+| [visible](README.md#-1299346893%2FProperties%2F123127132) | `var `[`visible`](README.md#-1299346893%2FProperties%2F123127132)`: Boolean`<br>Whether the Control should be visible or hidden. |
 
 ### Functions
 
 | Name | Summary |
 |---|---|
-| [action](action.md) | `fun action(block: `[`Button`](README.md)`.() -> Unit): Unit`<br>Function to be run when the user clicks the Button. Only one function can be registered at a time. |
+| [action](action.md) | `fun `[`action`](action.md)`(block: `[`Button`](README.md)`.() -> Unit)`<br>Function to be run when the user clicks the Button. |
 
 ### Inherited functions
 
 | Name | Summary |
 |---|---|
-| [disable](../-control/disable.md) | `fun disable(): Unit`<br>Disables the Control. |
+| [disable](../-control/disable.md) | `fun `[`disable`](../-control/disable.md)`()`<br>Disables the Control. |
-| [dispose](../-control/dispose.md) | `open fun dispose(): Unit`<br>Dispose and free all allocated resources. |
+| [dispose](../-control/dispose.md) | `open override fun `[`dispose`](../-control/dispose.md)`()`<br>Dispose and free all allocated resources. |
-| [enable](../-control/enable.md) | `fun enable(): Unit`<br>Enables the Control. |
+| [enable](../-control/enable.md) | `fun `[`enable`](../-control/enable.md)`()`<br>Enables the Control. |
-| [getHandle](../-control/get-handle.md) | `fun getHandle(): ULong`<br>Returns the OS-level handle associated with this Control. |
+| [getHandle](../-control/get-handle.md) | `fun `[`getHandle`](../-control/get-handle.md)`(): ULong`<br>Returns the OS-level handle associated with this Control. |
-| [hide](../-control/hide.md) | `fun hide(): Unit`<br>Hides the Control. Hidden controls do not participate in layout (that is, Box, GridPane, etc. does not reserve space for hidden controls). |
+| [hide](../-control/hide.md) | `fun `[`hide`](../-control/hide.md)`()`<br>Hides the Control. |
-| [isEnabled](../-control/is-enabled.md) | `fun isEnabled(): Boolean`<br>Whether the Control is enabled. |
+| [isEnabled](../-control/is-enabled.md) | `fun `[`isEnabled`](../-control/is-enabled.md)`(): Boolean`<br>Whether the Control is enabled. |
-| [isEnabledToUser](../-control/is-enabled-to-user.md) | `fun isEnabledToUser(): Boolean`<br>Whether the Control and all parents are enabled. |
+| [isEnabledToUser](../-control/is-enabled-to-user.md) | `fun `[`isEnabledToUser`](../-control/is-enabled-to-user.md)`(): Boolean`<br>Whether the Control and all parents are enabled. |
-| [isVisible](../-control/is-visible.md) | `fun isVisible(): Boolean`<br>Whether the Control is visible. |
+| [isVisible](../-control/is-visible.md) | `fun `[`isVisible`](../-control/is-visible.md)`(): Boolean`<br>Whether the Control is visible. |
-| [show](../-control/show.md) | `fun show(): Unit`<br>Shows the Control. |
+| [show](../-control/show.md) | `fun `[`show`](../-control/show.md)`()`<br>Shows the Control. |
+

@msink msink changed the title [1-4-20-dev-10] Properties inheritance [1-4-32] Properties inheritance May 8, 2021
@msink msink changed the title [1-4-32] Properties inheritance [1.4.32] Properties inheritance May 8, 2021
@msink msink changed the title [1.4.32] Properties inheritance GFM: Properties inheritance May 8, 2021
@IgnatBeresnev IgnatBeresnev added the format: gfm An issue/PR related to Dokka's GFM output format label Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug format: gfm An issue/PR related to Dokka's GFM output format
Projects
None yet
Development

No branches or pull requests

2 participants