← Back to team overview

touch-packages team mailing list archive

[Bug 1322370] Re: Use of anonymous struct in MirMotionEvent makes hard to use API

 

** Also affects: mir (Ubuntu)
   Importance: Undecided
       Status: New

** Changed in: mir (Ubuntu)
   Importance: Undecided => Low

** Changed in: mir (Ubuntu)
       Status: New => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to mir in Ubuntu.
https://bugs.launchpad.net/bugs/1322370

Title:
  Use of anonymous struct in MirMotionEvent makes hard to use API

Status in Mir:
  Fix Released
Status in “mir” package in Ubuntu:
  Fix Released

Bug description:
  MirMotionEvent looks like this:

  typedef struct
  {
      MirEventType type;
      ...
      size_t pointer_count;
      struct
      {
          int id;
          ...
      } pointer_coordinates[MIR_INPUT_EVENT_MAX_POINTER_COUNT];
  } MirMotionEvent;

  If you want to iterate over pointer_coordinates you need to code
  something like this:

  MirEventMotion *e;
  for (i = 0; i < e->pointer_count; i++)
      printf ("%f, %f\n", e->pointer_coordinates[i].x, e->pointer_coordinates[i].y);

  It is desirable to be able to get a pointer to each coordinate to make
  this easier to type, i.e.

  MirEventMotion *e;
  for (i = 0; i < e->pointer_count; i++)
  {
      MirPointerCoordinate *p = &e->pointer_coordinates[i];
      printf ("%f, %f\n", p->x, p->y);
  }

  This requires the structure to have a name.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mir/+bug/1322370/+subscriptions