Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Interface work #37

Merged
merged 11 commits into from
Mar 2, 2018
Merged

Interface work #37

merged 11 commits into from
Mar 2, 2018

Conversation

decriptor
Copy link
Contributor

@decriptor decriptor commented Mar 2, 2018

Fixes #35

  • Interface members are now public
  • Methods have parameters shown now
  • Methods are flagged as obsolete w/ doc-deprecated text
  • Basic signal stubs

Problems

  • Instance parameters are included
  • Array doesn't have Type set so you get
    static void Append ( array, guint8 data, guint len);
  • Not all deprecated versions have a version. Sometimes it seems to be in the doc-deprecated message
  • Signal isn't being populated
  • Parameters don't take ref, out, etc into account

@decriptor decriptor requested review from Therzok and sundermann March 2, 2018 04:18
@@ -20,8 +20,8 @@ public sealed class GenerationOptions
#endregion

#region Generation toggles
readonly bool compat;
public bool GenerateDocumentation { get { return !compat; } }
public bool Compat { get; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this compat bool back into a field and expose different generation toggles? It makes more sense to say:
if (opts.GenerateInterfacesWithIPrefix) rather than if (opts.Compat)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -157,7 +157,7 @@ public interface IComponent
/// a handler id which can be used in atk_component_remove_focus_handler()
/// or zero if the handler was already added.
///</returns>
uint AddFocusHandler PARAMS
Copy link
Contributor

@Therzok Therzok Mar 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, if a parent of a method is an interface, we need to generate the function definition without the body. public modifier is extraneous. We also should not generate pinvoke imports.

@@ -71,7 +71,9 @@ public static void GenerateCallableDefinition(this ICallable callable, IndentWri
var returnType = callable.GetReturnCSharpType(writer);

// generate ReturnValue then Parameters
writer.Write(string.Format("{0} {1} {2}", returnType, callable.Name.ToCSharp (), "PARAMS"));
// FIXME, probably don't need the instance parameters?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can get the type from the symbol table, since Array exposes a CType. We can probably make Array an ISymbol and implement it.

@@ -34,15 +34,15 @@ public void TestClassIsGenerated()
///</summary>
public class BufferedOutputStream : Seekable
{
static extern OutputStream g_buffered_output_stream_new (OutputStream base_stream)
static extern OutputStream g_buffered_output_stream_new (OutputStream base_stream);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

@@ -153,6 +153,8 @@ public interface IComponent
/// when this object receives focus events (in or out). If the handler is
/// already added it is not added again
///</summary>
[Obsolete (""(Version: 2.9.4) If you need to track when an object gains or
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure how we wanted this to look, but I figured we could fix up the formatting later

@Therzok Therzok merged commit 255db11 into master Mar 2, 2018
@Therzok Therzok deleted the interface-work branch March 2, 2018 10:34
@knocte
Copy link

knocte commented Mar 4, 2018

Good work! I didn't have time to report the "I" interface prefix as an issue :D

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants