old_size = (GtkAllocation *) gtk_object_get_data(GTK_OBJECT(w), "mozilla.old_size");   if (!old_size) { old_size = (GtkAllocation *) g_malloc(sizeof(GtkAllocation)); old_size->x = alloc->x; old_size->y = alloc->y; old_size->width = alloc->width; old_size->height = alloc->height; gtk_object_set_data(GTK_OBJECT(w), "mozilla.old_size", old_size); send_event = PR_TRUE; }  else if ((old_size->x != alloc->x) || (old_size->y != alloc->y) || (old_size->width != alloc->width) || (old_size->height != alloc->height)) { old_size->x = alloc->x; old_size->y = alloc->y; old_size->width = alloc->width; old_size->height = alloc->height; send_event = PR_TRUE; }  if (send_event == PR_TRUE) { eventinfo = (EventInfo *)g_malloc(sizeof(struct EventInfo)); eventinfo->rect = new nsRect(); eventinfo->rect->x = alloc->x; eventinfo->rect->y = alloc->y; eventinfo->rect->width = alloc->width; eventinfo->rect->height = alloc->height; eventinfo->widget = widget; NS_ADDREF(widget); gtk_idle_add(idle_resize_cb, eventinfo); }
InitAllocationEvent(alloc, p, event, NS_SIZE); NS_ADDREF(widget); widget->OnResize(event); NS_RELEASE(widget);
void handle_size_allocate(GtkWidget *w, GtkAllocation *alloc, gpointer p){  nsWindow *widget = (nsWindow *)p;  EventInfo *eventinfo = 0;  GtkAllocation *old_size = 0;  PRBool send_event = PR_FALSE;  old_size = (GtkAllocation *) gtk_object_get_data(GTK_OBJECT(w), "mozilla.old_size");  // see if we need to allocate this - this may be the first time  // the size allocation has happened.  if (!old_size) {     old_size = (GtkAllocation *) g_malloc(sizeof(GtkAllocation));    old_size->x = alloc->x;    old_size->y = alloc->y;    old_size->width = alloc->width;    old_size->height = alloc->height;    gtk_object_set_data(GTK_OBJECT(w), "mozilla.old_size", old_size);    send_event = PR_TRUE;  }  // only send an event if we've actually changed sizes.  else if ((old_size->x != alloc->x) ||           (old_size->y != alloc->y) ||           (old_size->width != alloc->width) ||           (old_size->height != alloc->height)) {    old_size->x = alloc->x;    old_size->y = alloc->y;    old_size->width = alloc->width;    old_size->height = alloc->height;    send_event = PR_TRUE;  }  // send it out.  if (send_event == PR_TRUE) {    eventinfo = (EventInfo *)g_malloc(sizeof(struct EventInfo));    eventinfo->rect = new nsRect();    eventinfo->rect->x = alloc->x;    eventinfo->rect->y = alloc->y;    eventinfo->rect->width = alloc->width;    eventinfo->rect->height = alloc->height;    eventinfo->widget = widget;    NS_ADDREF(widget);    gtk_idle_add(idle_resize_cb, eventinfo);  }}