void nsWidget::InitEvent(nsGUIEvent& event, nsPoint* aPoint) {  GdkEvent *ge = gtk_get_current_event();  if (aPoint == nsnull) {   if (ge != nsnull) {  event.point.x = PRInt32(ge->configure.x); event.point.y = PRInt32(ge->configure.y); } } else { event.point.x = aPoint->x; event.point.y = aPoint->y; }  event.time = gdk_event_get_time(ge);     if (ge) gdk_event_free(ge); }
inline void InitEvent(nsGUIEvent& event, PRUint32 aEventType, nsPoint* aPoint = nsnull) { if( aPoint == nsnull ) { event.point.x = 0; event.point.y = 0; } else { event.point.x = aPoint->x; event.point.y = aPoint->y; } event.widget = this; event.time = PR_IntervalNow(); event.message = aEventType; }
void nsWidget::InitEvent(nsGUIEvent& event, nsPoint* aPoint){  // This copies, and we need to call gdk_event_free.  GdkEvent *ge = gtk_get_current_event();  if (aPoint == nsnull) {     // use the point from the event    // get the message position in client coordinates and in twips    if (ge != nsnull) {      //       ::ScreenToClient(mWnd, &cpos);      event.point.x = PRInt32(ge->configure.x);      event.point.y = PRInt32(ge->configure.y);    }    }      else {                      // use the point override if provided    event.point.x = aPoint->x;    event.point.y = aPoint->y;  }  event.time = gdk_event_get_time(ge);  //    mLastPoint.x = event.point.x;  //    mLastPoint.y = event.point.y;  if (ge)    gdk_event_free(ge);}