NS_ADDREF(anEvent.widget);
void InitMouseEvent(GdkEventButton *aGEB,                            gpointer   p,                            nsMouseEvent &anEvent,                            PRUint32   aEventType){  anEvent.message = aEventType;  anEvent.widget  = (nsWidget *) p;  NS_ADDREF(anEvent.widget);  anEvent.eventStructType = NS_MOUSE_EVENT;  if (aGEB != NULL) {    anEvent.point.x = nscoord(aGEB->x);    anEvent.point.y = nscoord(aGEB->y);    anEvent.isShift = (aGEB->state & GDK_SHIFT_MASK) ? PR_TRUE : PR_FALSE;    anEvent.isControl = (aGEB->state & GDK_CONTROL_MASK) ? PR_TRUE : PR_FALSE;    anEvent.isAlt = (aGEB->state & GDK_MOD1_MASK) ? PR_TRUE : PR_FALSE;    anEvent.time = aGEB->time;    switch(aGEB->type)      {      case GDK_BUTTON_PRESS:        anEvent.clickCount = 1;        break;      case GDK_2BUTTON_PRESS:        anEvent.clickCount = 2;        break;      case GDK_3BUTTON_PRESS:  /* Clamp to double-click */        anEvent.clickCount = 2;        break;      default:        anEvent.clickCount = 1;    }  }}