geany  1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
  Fossies Dox: geany-1.38.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

navqueue.c File Reference
#include "navqueue.h"
#include "document.h"
#include "geanyobject.h"
#include "sciwrappers.h"
#include "toolbar.h"
#include "utils.h"
#include <gtk/gtk.h>
Include dependency graph for navqueue.c:

Go to the source code of this file.


struct  filepos


void navqueue_init (void)
void navqueue_free (void)
static void adjust_buttons (void)
static gboolean queue_pos_matches (guint queue_pos, const gchar *fname, gint pos)
static void add_new_position (const gchar *utf8_filename, gint pos)
gboolean navqueue_goto_line (GeanyDocument *old_doc, GeanyDocument *new_doc, gint line)
 Adds old file position and new file position to the navqueue, then goes to the new position. More...
static gboolean goto_file_pos (const gchar *file, gint pos)
void navqueue_go_back (void)
void navqueue_go_forward (void)
static gint find_by_filename (gconstpointer a, gconstpointer b)
void navqueue_remove_file (const gchar *filename)


static GQueue * navigation_queue
static guint nav_queue_pos
static GtkAction * navigation_buttons [2]

Function Documentation

◆ add_new_position()

static void add_new_position ( const gchar *  utf8_filename,
gint  pos 

◆ adjust_buttons()

static void adjust_buttons ( void  )

◆ find_by_filename()

static gint find_by_filename ( gconstpointer  a,
gconstpointer  b 

Definition at line 252 of file navqueue.c.

References utils_str_equal().

Referenced by navqueue_remove_file().

◆ goto_file_pos()

static gboolean goto_file_pos ( const gchar *  file,
gint  pos 

◆ navqueue_free()

void navqueue_free ( void  )

Definition at line 67 of file navqueue.c.

References navigation_queue.

Referenced by do_main_quit().

◆ navqueue_go_back()

◆ navqueue_go_forward()

void navqueue_go_forward ( void  )

TODO: add option to re open the file

Definition at line 228 of file navqueue.c.

References adjust_buttons(), filepos::file, goto_file_pos(), nav_queue_pos, navigation_queue, and filepos::pos.

Referenced by cb_func_goto_action(), and on_toolbutton_forward_activate().

◆ navqueue_goto_line()

gboolean navqueue_goto_line ( GeanyDocument old_doc,
GeanyDocument new_doc,
gint  line 

Adds old file position and new file position to the navqueue, then goes to the new position.

old_docThe document of the previous position, if set as invalid (NULL) then no old position is set
new_docThe document of the new position, must be valid.
linethe line number of the new position. It is counted with 1 as the first line, not 0.
TRUE if the cursor has changed the position to line or FALSE otherwise.

Definition at line 151 of file navqueue.c.

References add_new_position(), DOC_VALID, GeanyDocument::editor, editor_goto_pos(), GeanyDocument::file_name, GeanyDocument::is_valid, line, NULL, pos, GeanyEditor::sci, sci_get_current_position(), and sci_get_position_from_line().

Referenced by goto_compiler_file_line(), goto_tag(), msgwin_goto_messages_file_line(), on_goto_popup_item_activate(), and taglist_go_to_selection().

◆ navqueue_init()

void navqueue_init ( void  )

Definition at line 54 of file navqueue.c.

References nav_queue_pos, navigation_buttons, navigation_queue, and toolbar_get_action_by_name().

Referenced by main_lib().

◆ navqueue_remove_file()

void navqueue_remove_file ( const gchar *  filename)

Definition at line 262 of file navqueue.c.

References adjust_buttons(), filename, find_by_filename(), match(), navigation_queue, and NULL.

Referenced by remove_page().

◆ queue_pos_matches()

static gboolean queue_pos_matches ( guint  queue_pos,
const gchar *  fname,
gint  pos 

Definition at line 102 of file navqueue.c.

References filepos::file, navigation_queue, pos, filepos::pos, and utils_str_equal().

Referenced by add_new_position().

Variable Documentation

◆ nav_queue_pos

guint nav_queue_pos

◆ navigation_buttons

GtkAction* navigation_buttons[2]

Definition at line 50 of file navqueue.c.

Referenced by adjust_buttons(), and navqueue_init().

◆ navigation_queue