Пример #1
0
static void
ide_editor_frame__source_view_focus_location (IdeEditorFrame    *self,
                                              IdeSourceLocation *location,
                                              IdeSourceView     *source_view)
{
  IdeWorkbench *workbench;
  IdePerspective *editor;

  g_assert (IDE_IS_EDITOR_FRAME (self));
  g_assert (location != NULL);
  g_assert (IDE_IS_SOURCE_VIEW (source_view));

  workbench = ide_widget_get_workbench (GTK_WIDGET (self));
  editor = ide_workbench_get_perspective_by_name (workbench, "editor");

  ide_editor_perspective_focus_location (IDE_EDITOR_PERSPECTIVE (editor), location);
}
Пример #2
0
static void
ide_editor_frame_actions_spellcheck (GSimpleAction *action,
                                     GVariant      *variant,
                                     gpointer       user_data)
{
  IdeEditorFrame *self = user_data;
  IdeWorkbench *workbench;
  IdePerspective *editor;
  gboolean state;

  g_assert (IDE_IS_EDITOR_FRAME (self));

  state = !!g_variant_get_int32 (variant);
  if (state == TRUE)
    {
  if (IDE_IS_SOURCE_VIEW (self->source_view) &&
      NULL != (workbench = ide_widget_get_workbench (GTK_WIDGET (self))) &&
      NULL != (editor = ide_workbench_get_perspective_by_name (workbench, "editor")))
    ide_editor_perspective_show_spellchecker (IDE_EDITOR_PERSPECTIVE (editor), self->source_view);
    }
  else
    gtk_widget_grab_focus (GTK_WIDGET (self->source_view));
}