if (x < 0) { math_view->hadjustment->value -= math_view->hadjustment->step_increment; gtk_adjustment_value_changed(math_view->hadjustment); } else if (x > widget->allocation.width) { math_view->hadjustment->value += math_view->hadjustment->step_increment; gtk_adjustment_value_changed(math_view->hadjustment); }  if (y < 0) { math_view->vadjustment->value -= math_view->vadjustment->step_increment; gtk_adjustment_value_changed(math_view->vadjustment); } else if (y > widget->allocation.height) { math_view->vadjustment->value += math_view->vadjustment->step_increment; gtk_adjustment_value_changed(math_view->vadjustment); }
gtk_math_view_motion_notify_event(GtkWidget* widget, GdkEventMotion* event){  g_return_val_if_fail(widget != NULL, FALSE);  g_return_val_if_fail(event != NULL, FALSE);  g_return_val_if_fail(GTK_IS_MATH_VIEW(widget), FALSE);  GtkMathView* math_view = GTK_MATH_VIEW(widget);  g_return_val_if_fail(math_view->view, FALSE);  GdkModifierType mods;  gint x = (gint) event->x;  gint y = (gint) event->y;  // using GDK hints is convenient since this handler is rather heavy  // this way we notify GDK when we are ready to process another event  if (event->is_hint || (event->window != widget->window))    gdk_window_get_pointer(widget->window, &x, &y, &mods);  if (x < 0) {    math_view->hadjustment->value -= math_view->hadjustment->step_increment;    gtk_adjustment_value_changed(math_view->hadjustment);  } else if (x > widget->allocation.width) {    math_view->hadjustment->value += math_view->hadjustment->step_increment;    gtk_adjustment_value_changed(math_view->hadjustment);  }  if (y < 0) {    math_view->vadjustment->value -= math_view->vadjustment->step_increment;    gtk_adjustment_value_changed(math_view->vadjustment);  } else if (y > widget->allocation.height) {    math_view->vadjustment->value += math_view->vadjustment->step_increment;    gtk_adjustment_value_changed(math_view->vadjustment);  }#if GTKMATHVIEW_USES_GMETADOM  GdomeException exc = 0;#endif  GtkMathViewModelId elem = NULL;  GTKMATHVIEW_METHOD_NAME(get_element_at)(math_view, x, y, &elem, NULL, NULL);  GtkMathViewModelEvent me;  me.id = elem;  me.x = x;  me.y = y;  me.state = event->state;  if (math_view->button_pressed == TRUE &&      (math_view->select_state == SELECT_STATE_YES ||       fabs(math_view->button_press_x - x) > CLICK_SPACE_RANGE ||       fabs(math_view->button_press_y - y) > CLICK_SPACE_RANGE ||       abs(math_view->button_press_time - event->time) > CLICK_TIME_RANGE))    {      if (math_view->select_state == SELECT_STATE_NO)	{	  g_signal_emit(GTK_OBJECT(math_view), select_begin_signal, 0, &me);	  math_view->select_state = SELECT_STATE_YES;	}      else if (math_view->select_state == SELECT_STATE_YES && math_view->current_elem != elem)	g_signal_emit(GTK_OBJECT(math_view), select_over_signal, 0, &me);    }  if (math_view->current_elem != elem)    {#if GTKMATHVIEW_USES_GMETADOM      if (math_view->current_elem != NULL)	{	  gdome_el_unref(math_view->current_elem, &exc);	  g_assert(exc == 0);	}#endif // GTKMATHVIEW_USES_GMETADOM      math_view->current_elem = elem;#if GTKMATHVIEW_USES_GMETADOM      if (math_view->current_elem != NULL)	{	  gdome_el_ref(math_view->current_elem, &exc);	  g_assert(exc == 0);	}#endif // GTKMATHVIEW_USES_GMETADOM      g_signal_emit(GTK_OBJECT(math_view), element_over_signal, 0, &me);    }#if GTKMATHVIEW_USES_GMETADOM  if (elem != NULL)    {      gdome_el_unref(elem, &exc);      g_assert(exc == 0);    }#endif // GTKMATHVIEW_USES_GMETADOM  return FALSE;}