~ubuntu-branches/ubuntu/oneiric/apvlv/oneiric

« back to all changes in this revision

Viewing changes to src/ApvlvDir.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Ritter
  • Date: 2009-07-15 14:48:33 UTC
  • Revision ID: james.westby@ubuntu.com-20090715144833-k4hx9jqtb6vef121
Tags: upstream-0.0.6.8
ImportĀ upstreamĀ versionĀ 0.0.6.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of the apvlv package
 
3
 *
 
4
 * Copyright (C) 2008 Alf.
 
5
 *
 
6
 * Contact: Alf <naihe2010@gmail.com>
 
7
 *
 
8
 * This program is free software; you can redistribute it and/or
 
9
 * modify it under the terms of the GNU General Public License
 
10
 * as published by the Free Software Foundation; either version 2.0 of
 
11
 * the License, or (at your option) any later version.
 
12
 *
 
13
 * This program is distributed in the hope that it will be useful, but
 
14
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 
16
 * General Public License for more details.
 
17
 *
 
18
 * You should have received a copy of the GNU General Public
 
19
 * License along with this program; if not, write to the Free Software
 
20
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
21
 *
 
22
 */
 
23
/* @CFILE ApvlvDir.hpp
 
24
 *
 
25
 *  Author: Alf <naihe2010@gmail.com>
 
26
 */
 
27
/* @date Created: 2009/01/03 23:27:52 Alf*/
 
28
 
 
29
#ifndef _APVLV_DIR_
 
30
#define _APVLV_DIR_
 
31
 
 
32
#ifdef HAVE_CONFIG_H
 
33
# include "config.hpp"
 
34
#endif
 
35
 
 
36
#include "ApvlvCore.hpp"
 
37
#include "ApvlvWindow.hpp"
 
38
 
 
39
namespace apvlv
 
40
{
 
41
  class ApvlvDir;
 
42
  class ApvlvDirNode
 
43
    {
 
44
  public:
 
45
    ApvlvDirNode (gint);
 
46
    ApvlvDirNode (bool isdir, const char *, const char *);
 
47
    ~ApvlvDirNode ();
 
48
 
 
49
    //
 
50
    // Get the destination
 
51
    bool dest (const char **realpath, int *pagenum);
 
52
 
 
53
  private:
 
54
    gint mPagenum;      /* -1 means dir, 0 means file, > 0 means page num */
 
55
    char filename[0x100];
 
56
    char *realname;
 
57
    };
 
58
 
 
59
  class ApvlvDir;
 
60
  class ApvlvDirStatus: public ApvlvCoreStatus
 
61
  {
 
62
public:
 
63
  ApvlvDirStatus (ApvlvDir *);
 
64
 
 
65
  ~ApvlvDirStatus ();
 
66
 
 
67
  void active (bool act);
 
68
 
 
69
  void setsize (int, int);
 
70
 
 
71
  void show ();
 
72
 
 
73
private:
 
74
  ApvlvDir *mDoc;
 
75
#define AD_STATUS_SIZE   4
 
76
  GtkWidget *mStlab[AD_STATUS_SIZE];
 
77
  };
 
78
 
 
79
  class ApvlvDir: public ApvlvCore
 
80
  {
 
81
public:
 
82
  ApvlvDir (int w, int h);
 
83
 
 
84
  ~ApvlvDir ();
 
85
 
 
86
  bool loadfile (const char *file, bool check = true);
 
87
 
 
88
  void setactive (bool act);
 
89
 
 
90
  returnType process (int times, guint keyval);
 
91
 
 
92
private:
 
93
 
 
94
  returnType subprocess (int ct, guint key);
 
95
 
 
96
  bool reload ();
 
97
 
 
98
  bool enter (guint key);
 
99
 
 
100
  void scrollup (int times);
 
101
 
 
102
  void scrolldown (int times);
 
103
 
 
104
  void scrollleft (int times);
 
105
 
 
106
  void scrollright (int times);
 
107
 
 
108
  static void apvlv_dir_on_changed (GtkTreeSelection *, ApvlvDir *);
 
109
 
 
110
  bool walk_poppler_iter_index (GtkTreeIter *titr, PopplerIndexIter *iter);
 
111
 
 
112
  bool walk_dir_path_index (GtkTreeIter *titr, const char *path);
 
113
 
 
114
  static gboolean apvlv_dir_first_select_cb (ApvlvDir *);
 
115
 
 
116
  gint mFirstSelTimer;
 
117
 
 
118
  PopplerDocument *mDoc;
 
119
 
 
120
  GSList *mDirNodes;
 
121
 
 
122
  GtkWidget *mDirView;
 
123
  GtkTreeStore *mStore;
 
124
  GtkTreeIter mPrevIter, mCurrentIter;
 
125
  GtkTreeSelection *mSelection;
 
126
  };
 
127
 
 
128
}
 
129
 
 
130
#endif