source: projects/synaptic/trunk/gtk/gtkpkglist.h @ 280

Revision 280, 2.8 KB checked in by yasumichi, 15 years ago (diff)

first import

Line 
1/* gtkpkglist.h
2 * Copyright (C) 2003  Michael Vogt
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
18 */
19
20#ifndef GTKPKGLIST_H
21#define GTKPKGLIST_H
22
23#include <gtk/gtk.h>
24#include "rpackagelister.h"
25#include "rcacheactor.h"
26#include "rpackagelistactor.h"
27#include "rgmisc.h"
28
29
30#define GTK_TYPE_PKG_LIST                       (gtk_pkg_list_get_type ())
31#define GTK_PKG_LIST(obj)                       (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PKG_LIST, GtkPkgList))
32#define GTK_PKG_LIST_CLASS(klass)               (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_PKG_LIST, GtkPkgListClass))
33#define GTK_IS_PKG_LIST(obj)                    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PKG_LIST))
34#define GTK_IS_PKG_LIST_CLASS(klass)            (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PKG_LIST))
35#define GTK_PKG_LIST_GET_CLASS(obj)             (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PKG_LIST, GtkPkgListClass))
36
37typedef struct _GtkPkgList GtkPkgList;
38typedef struct _GtkPkgListClass GtkPkgListClass;
39
40
41struct _GtkPkgList {
42   GObject parent;
43
44   RPackageLister *_lister;
45
46   gint n_columns;
47   GType column_headers[N_COLUMNS];
48   // sortable
49   gint sort_column_id;
50   GtkSortType order;
51};
52
53struct _GtkPkgListClass {
54   GObjectClass parent_class;
55};
56
57
58GType gtk_pkg_list_get_type();
59GtkPkgList *gtk_pkg_list_new(RPackageLister *lister);
60
61class RCacheActorPkgList : public RCacheActor {
62
63   protected:
64
65   GtkPkgList *_pkgList;
66   GtkTreeView *_pkgView;
67
68   public:
69
70   virtual void run(vector<RPackage *> &List, int Action);
71
72   RCacheActorPkgList(RPackageLister *lister,
73                      GtkPkgList *pkgList,
74                      GtkTreeView *pkgView)
75      : RCacheActor(lister), _pkgList(pkgList), _pkgView(pkgView) {};
76};
77
78
79class RPackageListActorPkgList:public RPackageListActor {
80
81   protected:
82
83   GtkPkgList *_pkgList;
84   GtkTreeView *_pkgView;
85
86   public:
87
88   virtual void run(vector<RPackage *> &List, int listEvent);
89
90   RPackageListActorPkgList(RPackageLister *lister,
91                            GtkPkgList *pkgList,
92                            GtkTreeView *pkgView)
93      : RPackageListActor(lister), _pkgList(pkgList), _pkgView(pkgView) {};
94};
95
96#endif /* GTKPKGLIST_H */
97
98// vim:ts=3:sw=3:et
Note: See TracBrowser for help on using the repository browser.