From 110a983fd1c5b2b7f6ed8ba2b34beb570e8b38fa Mon Sep 17 00:00:00 2001 From: James Liggett Date: Tue, 1 Apr 2008 16:31:53 -0700 Subject: [PATCH] Created stub git plugin. --- TODO.tasks | 56 ++++++++--------- configure.in | 1 + plugins/Makefile.am | 3 +- plugins/git/Makefile.am | 55 ++++++++++++++++ plugins/git/anjuta-git-plugin-48.png | Bin 0 -> 1867 bytes plugins/git/anjuta-git.ui | 12 ++++ plugins/git/git.plugin.in | 5 ++ plugins/git/plugin.c | 119 +++++++++++++++++++++++++++++++++++ plugins/git/plugin.h | 43 +++++++++++++ 9 files changed, 265 insertions(+), 29 deletions(-) create mode 100644 plugins/git/Makefile.am create mode 100644 plugins/git/anjuta-git-plugin-48.png create mode 100644 plugins/git/anjuta-git.ui create mode 100644 plugins/git/git.plugin.in create mode 100644 plugins/git/plugin.c create mode 100644 plugins/git/plugin.h diff --git a/TODO.tasks b/TODO.tasks index 45da6a8e..2532f420 100644 --- a/TODO.tasks +++ b/TODO.tasks @@ -613,14 +613,9 @@ Fix c++/gobject class generator to allow adding members, methods, signals, prope - - Stub plugin - Create stub AnjutaPlugin implementation, and empty menu. Steal a git icon from somewhere :-) - - Implement GitCommand class - + @@ -630,112 +625,117 @@ Fix c++/gobject class generator to allow adding members, methods, signals, prope Showing diffs of commits - + Creating branches and tags - + Cat files - + Bisecting - + Reverting commits - + Revision filtering/searching - + Committing changes - + Resolving conflicts - + Reverting uncommitted changes - + Adding files - + Removing files - + Ignoring files - + List branches and switch to selected one - + Merging branches - + Remote branch handling - + Pulling - + Fetching - + Rebasing - + Generating patch series (format-patch) - + Submit patch for testing - + Commit into SVN trunk - + Implement AnjutaSyncCommand - + + + + + Stub plugin + Create stub AnjutaPlugin implementation, and empty menu. Steal a git icon from somewhere :-) diff --git a/configure.in b/configure.in index f994ca49..d3ca9d7c 100644 --- a/configure.in +++ b/configure.in @@ -1149,6 +1149,7 @@ plugins/cvs-plugin/Makefile plugins/project-wizard/Makefile plugins/macro/Makefile plugins/subversion/Makefile +plugins/git/Makefile plugins/sourceview/Makefile plugins/tools/Makefile plugins/tools/scripts/Makefile diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 151c452b..d8404b2a 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -32,7 +32,8 @@ SUBDIRS = . \ profiler \ language-manager \ symbol-db \ - sourceview + sourceview \ + git # indent diff --git a/plugins/git/Makefile.am b/plugins/git/Makefile.am new file mode 100644 index 00000000..6151c14d --- /dev/null +++ b/plugins/git/Makefile.am @@ -0,0 +1,55 @@ +# Sample Makefile for a anjuta plugin. + +# Plugin UI file +git_uidir = $(anjuta_ui_dir) +git_ui_DATA = anjuta-git.ui + +# Plugin Icon file +git_pixmapsdir = $(anjuta_image_dir) +git_pixmaps_DATA = \ + anjuta-git-plugin-48.png + +# Plugin description file +plugin_in_files = git.plugin.in +%.plugin: %.plugin.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache + +git_plugindir = $(anjuta_plugin_dir) +git_plugin_DATA = $(plugin_in_files:.plugin.in=.plugin) + +# NOTE : +# The naming convention is very intentional +# We are forced to use the prefix 'lib' by automake and libtool +# There is probably a way to avoid it but it is not worth to effort +# to find out. +# The 'anjuta_' prfix is a safety measure to avoid conflicts where the +# plugin 'libpython.so' needs to link with the real 'libpython.so' + +# Include paths +AM_CPPFLAGS = \ + $(WARN_CFLAGS) \ + $(DEPRECATED_FLAGS) \ + $(LIBANJUTA_CFLAGS) + +# Where to install the plugin +plugindir = $(anjuta_plugin_dir) + +# The plugin +plugin_LTLIBRARIES = libanjuta-git.la + +# Plugin sources +libanjuta_git_la_SOURCES = \ + plugin.c \ + plugin.h + +libanjuta_git_la_LDFLAGS = $(ANJUTA_PLUGIN_LDFLAGS) + +# Plugin dependencies +libanjuta_git_la_LIBADD = \ + $(GTK_LIBS) \ + $(LIBANJUTA_LIBS) + +EXTRA_DIST = \ + $(plugin_in_files) \ + $(git_plugin_DATA) \ + $(git_ui_DATA) \ + $(git_pixmaps_DATA) diff --git a/plugins/git/anjuta-git-plugin-48.png b/plugins/git/anjuta-git-plugin-48.png new file mode 100644 index 0000000000000000000000000000000000000000..74596f875030f98dd4f008e47aad6259ddf11b7d GIT binary patch literal 1867 zcwPZZ2ekN!P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iODw z76Tku0woCm000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}000K2Nkl1Nt)2yCKxhnG1p zU!Hls@B4ke&%;rK5RxrRQ4|i+QaRx3_d=klBIUpl(3^=LH0|GW1ImGwklvJ#lr0ca zqNw|~R8%PhJ7vEqseLXjRZ-P_eZmi}0U2&+{T!`Na}66yOSPn;k% zJdBacvG&6ctbYA9!t;)Ir8eOSWiBQk;`#sY>esm-$zKvR((o91FY_D zj7$c5V1WAMB#WPZO8M+rw0mNPKrER=Pp65rx9^^S^nJp5{l1vM_mM%+IJsI4UrNMA z(#k@h%{>E=xZ6pBnAV9b-Y{cFb0X>r;J~;T_#J2ol>f}lER0;sQ zzn}J(UnacQ)ixw#X0t?ldjW`ac9I?*2E#y&M7G(va9tw#JXT*Hs%`Jyg~Gdc@ylhL zxjCfkLUZ(JT5uR*c6AZ$=|QzD-1&K&sVPJdY+7`)K`OeA8jBI_=^;`q;;*ja&d%bO z%fH2K#ts71Sd3V2FGenhVw$_OQ7MsO*pSFpcr!6T(RCDE2Sq^!!FKExTr){U*HJVL zDFg&Tqw8<)p1<`c!)VNFJM^hPZXb{vpZ_QJp^JE1J;;zi1O#D#uIlKjj;3m@-6;(4 z@f!uJL|S4c5*bQ7;UT0TqD4?u6;)C9mcWh54KCcg!1oK^b3A*Tk?s+CGrbs^u_JzT zdXz8!`6cOCnwR=s;@L-^-MLu?9zQMq#CLPwQC=@I(mldp#~>Z?j=d#tbL}Q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/dev/null +++ b/plugins/git/anjuta-git.ui @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/plugins/git/git.plugin.in b/plugins/git/git.plugin.in new file mode 100644 index 00000000..11f7a27c --- /dev/null +++ b/plugins/git/git.plugin.in @@ -0,0 +1,5 @@ +[Anjuta Plugin] +Location=anjuta-git:Git +Icon=anjuta-git-plugin-48.png +_Name=Git +_Description=Git version control diff --git a/plugins/git/plugin.c b/plugins/git/plugin.c new file mode 100644 index 00000000..d6865afc --- /dev/null +++ b/plugins/git/plugin.c @@ -0,0 +1,119 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ +/* + plugin.c + Copyright (C) James Liggett 2008 + + 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., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301 USA +*/ + +#include +#include +#include + +#include "plugin.h" + +#define UI_FILE PACKAGE_DATA_DIR"/ui/anjuta-git.ui" + +static gpointer parent_class; + +static GtkActionEntry actions_git[] = { + { + "ActionMenuGit", /* Action name */ + NULL, /* Stock icon, if any */ + N_("_Git"), /* Display label */ + NULL, /* short-cut */ + NULL, /* Tooltip */ + NULL /* action callback */ + }, + { + "ActionGitEmpty", /* Action name */ + NULL, /* Stock icon, if any */ + N_("_Empty menu"), /* Display label */ + NULL, /* short-cut */ + NULL, /* Tooltip */ + NULL /* action callback */ + } +}; + +static gboolean +git_activate_plugin (AnjutaPlugin *plugin) +{ + AnjutaUI *ui; + Git *git_plugin; + + DEBUG_PRINT ("Git: Activating Git plugin ..."); + git_plugin = ANJUTA_PLUGIN_GIT (plugin); + + ui = anjuta_shell_get_ui (plugin->shell, NULL); + + /* Add all our actions */ + anjuta_ui_add_action_group_entries (ui, "ActionGroupGitFile", + _("Git operations"), + actions_git, + G_N_ELEMENTS (actions_git), + GETTEXT_PACKAGE, TRUE, plugin); + git_plugin->uiid = anjuta_ui_merge (ui, UI_FILE); + + return TRUE; +} + +static gboolean +git_deactivate_plugin (AnjutaPlugin *plugin) +{ + AnjutaUI *ui = anjuta_shell_get_ui (plugin->shell, NULL); + + DEBUG_PRINT ("Git: Dectivating Git plugin ..."); + anjuta_ui_unmerge (ui, ANJUTA_PLUGIN_GIT (plugin)->uiid); + + return TRUE; +} + +static void +git_finalize (GObject *obj) +{ + /* Finalization codes here */ + G_OBJECT_CLASS (parent_class)->finalize (obj); +} + +static void +git_dispose (GObject *obj) +{ + /* Disposition codes */ + G_OBJECT_CLASS (parent_class)->dispose (obj); +} + +static void +git_instance_init (GObject *obj) +{ + Git *plugin = ANJUTA_PLUGIN_GIT (obj); + plugin->uiid = 0; +} + +static void +git_class_init (GObjectClass *klass) +{ + AnjutaPluginClass *plugin_class = ANJUTA_PLUGIN_CLASS (klass); + + parent_class = g_type_class_peek_parent (klass); + + plugin_class->activate = git_activate_plugin; + plugin_class->deactivate = git_deactivate_plugin; + klass->finalize = git_finalize; + klass->dispose = git_dispose; +} + +ANJUTA_PLUGIN_BOILERPLATE (Git, git); +ANJUTA_SIMPLE_PLUGIN (Git, git); diff --git a/plugins/git/plugin.h b/plugins/git/plugin.h new file mode 100644 index 00000000..b615c8b8 --- /dev/null +++ b/plugins/git/plugin.h @@ -0,0 +1,43 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ +/* + plugin.h + Copyright (C) James Liggett 2008 + + 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., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301 USA +*/ + + +#include + +extern GType git_get_type (GTypeModule *module); +#define ANJUTA_TYPE_PLUGIN_GIT (git_get_type (NULL)) +#define ANJUTA_PLUGIN_GIT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), ANJUTA_TYPE_PLUGIN_GIT, Git)) +#define ANJUTA_PLUGIN_GIT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), ANJUTA_TYPE_PLUGIN_GIT, GitClass)) +#define ANJUTA_IS_PLUGIN_GIT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), ANJUTA_TYPE_PLUGIN_GIT)) +#define ANJUTA_IS_PLUGIN_GIT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), ANJUTA_TYPE_PLUGIN_GIT)) +#define ANJUTA_PLUGIN_GIT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), ANJUTA_TYPE_PLUGIN_GIT, GitClass)) + +typedef struct _Git Git; +typedef struct _GitClass GitClass; + +struct _Git{ + AnjutaPlugin parent; + gint uiid; +}; + +struct _GitClass{ + AnjutaPluginClass parent_class; +}; -- 2.11.4.GIT