1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
|
/*
* gitg-commit.h
* This file is part of gitg - git repository viewer
*
* Copyright (C) 2009 - Jesse van den Kieboom
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GITG_COMMIT_H__
#define __GITG_COMMIT_H__
#include <glib-object.h>
#include <libgitg/gitg-repository.h>
#include <libgitg/gitg-changed-file.h>
G_BEGIN_DECLS
#define GITG_TYPE_COMMIT (gitg_commit_get_type ())
#define GITG_COMMIT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_COMMIT, GitgCommit))
#define GITG_COMMIT_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_COMMIT, GitgCommit const))
#define GITG_COMMIT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_COMMIT, GitgCommitClass))
#define GITG_IS_COMMIT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_COMMIT))
#define GITG_IS_COMMIT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_COMMIT))
#define GITG_COMMIT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_COMMIT, GitgCommitClass))
#define GITG_COMMIT_ERROR (gitg_commit_error_quark())
typedef struct _GitgCommit GitgCommit;
typedef struct _GitgCommitClass GitgCommitClass;
typedef struct _GitgCommitPrivate GitgCommitPrivate;
typedef enum
{
GITG_COMMIT_ERROR_NONE = 0,
GITG_COMMIT_ERROR_SIGNOFF,
GITG_COMMIT_ERROR_MERGE
} GitgCommitError;
struct _GitgCommit {
GObject parent;
GitgCommitPrivate *priv;
};
struct _GitgCommitClass {
GObjectClass parent_class;
void (*inserted) (GitgCommit *commit, GitgChangedFile *file);
void (*removed) (GitgCommit *commit, GitgChangedFile *file);
};
GQuark gitg_commit_error_quark (void);
GType gitg_commit_get_type (void) G_GNUC_CONST;
GitgCommit *gitg_commit_new (GitgRepository *repository);
void gitg_commit_refresh (GitgCommit *commit);
gboolean gitg_commit_stage (GitgCommit *commit,
GitgChangedFile *file,
gchar const *hunk,
GError **error);
gboolean gitg_commit_unstage (GitgCommit *commit,
GitgChangedFile *file,
gchar const *hunk,
GError **error);
gboolean gitg_commit_has_changes (GitgCommit *commit);
gboolean gitg_commit_commit (GitgCommit *commit,
gchar const *comment,
gboolean signoff,
gboolean amend,
GError **error);
gboolean gitg_commit_revert (GitgCommit *commit,
GitgRevision *from,
GitgRevision *to,
GError **error);
gboolean gitg_commit_undo (GitgCommit *commit,
GitgChangedFile *file,
gchar const *hunk,
GError **error);
gboolean gitg_commit_add_ignore (GitgCommit *commit,
GitgChangedFile *file,
GError **error);
GitgChangedFile *gitg_commit_find_changed_file (GitgCommit *commit,
GFile *file);
gchar *gitg_commit_amend_message (GitgCommit *commit);
G_END_DECLS
#endif /* __GITG_COMMIT_H__ */
|