Logo Search packages:      
Sourcecode: manedit version File versions  Download package


                              Manual Page Viewer

      Displays parsed groff output for finished apperance of manual


#ifndef VIEWER_H
#define VIEWER_H

#include <gtk/gtk.h>

typedef struct _viewer_struct             viewer_struct;
typedef struct _viewer_index_item_struct  viewer_index_item_struct;

 *    VIewer Index Item Types:
typedef enum {
} viewer_index_item_type;

 *    Viewer Index Item:
struct _viewer_index_item_struct {

      viewer_index_item_type  type;
      gchar       *full_path;

#define VIEWER_INDEX_ITEM(p)  ((viewer_index_item_struct *)(p))

 *    Viewer:
struct _viewer_struct {

      gboolean    initialized,
      gint        stop_count;

      gpointer    core_ptr;   /* Pointer back to core */
      gint        editor_num; /* Editor number on core struct that
                               * called this viewer, can be -1 for
                               * none */

      GtkWidget   *toplevel,

      /* Currently selected page on main_notebook, can be one of
       * ViewerPageNum* */
#define ViewerPageNumView           0
#define ViewerPageNumIndex          1
#define ViewerPageNumSearch         2
      gint        current_page;

      /* GtkText widget which displays current manual page contents */
      GtkWidget   *view_text;

      /* Index listing of available manual pages, each branch has
       * an item data of type viewer_index_item_struct.
       * There are 4 columns; name, lines, read, short description
      GtkWidget   *index_ctree;

      /* Selected branch on index_ctree, can be NULL */
      GtkCTreeNode      *selected_index_branch;

      /* Buttons on index ctree page */
      GtkWidget   *index_parent_btn,

      /* Combos on manpage view panel */
      GtkWidget   *manpage_combo,

      /* Important menu items */
      GtkWidget   *file_mh,




      /* Tool bar buttons */
      GtkWidget   *open_btn,

      /* Right click menu over view_text */
      GtkWidget   *view_menu,

      /* Right click menu over index_ctree */
      GtkWidget   *index_menu,

        /* Status bar */
        GtkWidget       *status_bar_dock,
                        *status_bar_toplevel,   /* An hbox */

      /* Last progress position value from 0.0 to 1.0 */
      gfloat            status_bar_progress_pos_last;

      /* Currently loaded manual page path (if any) */
      gchar       *cur_manpage_path;

      /* Name of current manpage, this is to match up to see if
       * newly loaded manpage is the same. Note that this is not
       * the file name, rather it should be the name from the
       * manual page's header */
      gchar       *cur_manpage_name;

      /* Last scroll positions */
      gfloat            last_scroll_hpos, /* Not used */

      /* Last manual page output file opened path */
      gchar       *last_open_path;

#define VIEWER(p) ((viewer_struct *)(p))

extern viewer_index_item_struct *ViewerIndexItemNew(
      viewer_index_item_type type, const gchar *full_path
extern void ViewerIndexItemDelete(viewer_index_item_struct *item);
extern void ViewerBranchSelect(
        viewer_struct *v, GtkCTreeNode *branch

extern void ViewerTextInsertPosition(viewer_struct *v, gint start_pos);
extern void ViewerTextInsert(
      viewer_struct *v, const gchar *buf, gint buf_len,
      gpointer client_data, gint (*func_cb)(glong, glong, gpointer)
extern void ViewerTextDelete(viewer_struct *v, gint start_pos, gint end_pos); 
extern void ViewerIndexDoLoad(
        viewer_struct *v,
      gint total_paths, char **path, gchar **name

extern gboolean ViewerDoFind(
        viewer_struct *v, GtkText *text,
        gchar *haystack, gchar *needle,
        gint haystack_len, gint start_pos,
        gboolean case_sensitive,
        gboolean move_to,
        gboolean *search_wrapped

extern void ViewerViewTextRecordScrollPositions(viewer_struct *v);

extern void ViewerSetBusy(viewer_struct *v);
extern void ViewerSetReady(viewer_struct *v);

extern viewer_struct *ViewerNew(gpointer core_ptr, gint editor_num);
extern void ViewerUpdateMenus(viewer_struct *v);
extern void ViewerSetStatusPosition(viewer_struct *v, gint row, gint column);
extern void ViewerSetStatusMessage(viewer_struct *v, const gchar *mesg);
extern void ViewerSetStatusProgress(viewer_struct *v, gfloat percent);
extern void ViewerRecordPositions(viewer_struct *v);
extern void ViewerReset(viewer_struct *v, gboolean need_unmap);
extern void ViewerMap(viewer_struct *v);
extern void ViewerUnmap(viewer_struct *v);
extern void ViewerDelete(viewer_struct *v);

#endif      /* VIEWER_H */

Generated by  Doxygen 1.6.0   Back to index