[gnome-builder] libidemm: partial wrapper for IdeContext
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libidemm: partial wrapper for IdeContext
- Date: Tue, 17 May 2016 12:35:24 +0000 (UTC)
commit cd13a476144ef7ad37d8f10559676335a144c2a4
Author: Marcin Kolny <marcin kolny gmail com>
Date: Sun Apr 10 23:02:54 2016 +0200
libidemm: partial wrapper for IdeContext
libidemm/.gitignore | 2 +
libidemm/src/context.ccg | 17 +++
libidemm/src/context.hg | 58 +++++++++
libidemm/src/filelist.am | 1 +
libidemm/src/libide_signals.defs | 134 ++++++++++++++++++++
.../tools/extra_defs_gen/generate_defs_libide.cc | 3 +-
6 files changed, 214 insertions(+), 1 deletions(-)
---
diff --git a/libidemm/.gitignore b/libidemm/.gitignore
index 24f97c3..b6a0742 100644
--- a/libidemm/.gitignore
+++ b/libidemm/.gitignore
@@ -41,6 +41,8 @@ stamp-h2
/idemm/applicationaddin.h
/idemm/backforwardlist.cc
/idemm/backforwardlist.h
+/idemm/context.cc
+/idemm/context.h
/idemm/object.cc
/idemm/object.h
/idemm/recentprojects.cc
diff --git a/libidemm/src/context.ccg b/libidemm/src/context.ccg
new file mode 100644
index 0000000..3d8f60f
--- /dev/null
+++ b/libidemm/src/context.ccg
@@ -0,0 +1,17 @@
+/* context.ccg
+ *
+ * Copyright (C) 2016 Marcin Kolny <marcin kolny gmail com>
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
diff --git a/libidemm/src/context.hg b/libidemm/src/context.hg
new file mode 100644
index 0000000..2a41824
--- /dev/null
+++ b/libidemm/src/context.hg
@@ -0,0 +1,58 @@
+/* context.hg
+ *
+ * Copyright (C) 2016 Marcin Kolny <marcin kolny gmail com>
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <idemm/backforwardlist.h>
+#include <glibmm/object.h>
+#include <giomm/file.h>
+#include <gtkmm/recentmanager.h>
+
+#include <ide.h>
+
+_DEFS(idemm, libide)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Ide {
+
+class Context : public Glib::Object
+{
+protected:
+ _CLASS_GOBJECT(Context, IdeContext, IDE_CONTEXT, Glib::Object, GObject)
+ _STRUCT_NOT_HIDDEN
+
+public:
+ _WRAP_METHOD(Glib::RefPtr<Ide::BackForwardList> get_back_forward_list() const,
ide_context_get_back_forward_list, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<Gio::File> get_project_file() const, ide_context_get_project_file, refreturn)
+
+#m4 _CONVERSION(`GtkRecentManager*',`Glib::RefPtr<Gtk::RecentManager>',`Glib::wrap($3)')
+ _WRAP_METHOD(Glib::RefPtr<Gtk::RecentManager> get_recent_manager() const, ide_context_get_recent_manager,
refreturn)
+
+ _WRAP_METHOD(Glib::ustring get_root_build_dir() const, ide_context_get_root_build_dir)
+ _WRAP_METHOD(void set_root_build_dir(const Glib::ustring& root_build_dir), ide_context_set_root_build_dir)
+ _WRAP_METHOD(void hold(), ide_context_hold)
+
+#m4 _CONVERSION(`const Glib::RefPtr<Glib::Object>&',`gpointer',`Glib::unwrap($3)')
+ _WRAP_METHOD(void hold_for_object(const Glib::RefPtr<Glib::Object>& instance), ide_context_hold_for_object)
+ _WRAP_METHOD(void release(), ide_context_release);
+
+ _WRAP_SIGNAL(void loaded(), "loaded", no_default_handler)
+
+ _WRAP_PROPERTY("back_forward_list", Glib::RefPtr<Ide::BackForwardList>)
+ _WRAP_PROPERTY("project_file", Glib::RefPtr<Gio::File>)
+};
+
+}
diff --git a/libidemm/src/filelist.am b/libidemm/src/filelist.am
index 9c7ea01..7fa4241 100644
--- a/libidemm/src/filelist.am
+++ b/libidemm/src/filelist.am
@@ -12,6 +12,7 @@ idemm_files_hg = \
application.hg \
applicationaddin.hg \
backforwardlist.hg \
+ context.hg \
object.hg \
recentprojects.hg
diff --git a/libidemm/src/libide_signals.defs b/libidemm/src/libide_signals.defs
index 4cff356..9fb899e 100644
--- a/libidemm/src/libide_signals.defs
+++ b/libidemm/src/libide_signals.defs
@@ -54,3 +54,137 @@
(writable #f)
(construct-only #f)
)
+
+;; From IdeContext
+
+(define-signal loaded
+ (of-object "IdeContext")
+ (return-type "void")
+ (when "last")
+)
+
+(define-property back-forward-list
+ (of-object "IdeContext")
+ (prop-type "GParamObject")
+ (docs "Back/forward navigation history for the context.")
+ (readable #t)
+ (writable #f)
+ (construct-only #f)
+)
+
+(define-property buffer-manager
+ (of-object "IdeContext")
+ (prop-type "GParamObject")
+ (docs "The buffer manager for the context.")
+ (readable #t)
+ (writable #f)
+ (construct-only #f)
+)
+
+(define-property build-system
+ (of-object "IdeContext")
+ (prop-type "GParamObject")
+ (docs "The build system used by the context.")
+ (readable #t)
+ (writable #f)
+ (construct-only #f)
+)
+
+(define-property configuration-manager
+ (of-object "IdeContext")
+ (prop-type "GParamObject")
+ (docs "The configuration manager for the context")
+ (readable #t)
+ (writable #f)
+ (construct-only #f)
+)
+
+(define-property device-manager
+ (of-object "IdeContext")
+ (prop-type "GParamObject")
+ (docs "The device manager for the context.")
+ (readable #t)
+ (writable #f)
+ (construct-only #f)
+)
+
+(define-property project-file
+ (of-object "IdeContext")
+ (prop-type "GParamObject")
+ (docs "The project file for the context.")
+ (readable #t)
+ (writable #t)
+ (construct-only #t)
+)
+
+(define-property project
+ (of-object "IdeContext")
+ (prop-type "GParamObject")
+ (docs "The project for the context.")
+ (readable #t)
+ (writable #f)
+ (construct-only #f)
+)
+
+(define-property root-build-dir
+ (of-object "IdeContext")
+ (prop-type "GParamString")
+ (docs "The root directory to perform builds within.")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property runtime-manager
+ (of-object "IdeContext")
+ (prop-type "GParamObject")
+ (docs "Runtime Manager")
+ (readable #t)
+ (writable #f)
+ (construct-only #f)
+)
+
+(define-property script-manager
+ (of-object "IdeContext")
+ (prop-type "GParamObject")
+ (docs "The script manager for the context.")
+ (readable #t)
+ (writable #f)
+ (construct-only #f)
+)
+
+(define-property search-engine
+ (of-object "IdeContext")
+ (prop-type "GParamObject")
+ (docs "The search engine for the context.")
+ (readable #t)
+ (writable #f)
+ (construct-only #f)
+)
+
+(define-property snippets-manager
+ (of-object "IdeContext")
+ (prop-type "GParamObject")
+ (docs "The snippets manager for the context.")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property vcs
+ (of-object "IdeContext")
+ (prop-type "GParamObject")
+ (docs "The VCS for the context.")
+ (readable #t)
+ (writable #f)
+ (construct-only #f)
+)
+
+(define-property unsaved-files
+ (of-object "IdeContext")
+ (prop-type "GParamObject")
+ (docs "The unsaved files in the context.")
+ (readable #t)
+ (writable #f)
+ (construct-only #f)
+)
diff --git a/libidemm/tools/extra_defs_gen/generate_defs_libide.cc
b/libidemm/tools/extra_defs_gen/generate_defs_libide.cc
index 4c4f5aa..41225c8 100644
--- a/libidemm/tools/extra_defs_gen/generate_defs_libide.cc
+++ b/libidemm/tools/extra_defs_gen/generate_defs_libide.cc
@@ -30,7 +30,8 @@ int main (int argc, char *argv[])
std::cout << get_defs(IDE_TYPE_APPLICATION, libide_type_is_a_pointer)
<< get_defs(IDE_TYPE_OBJECT, libide_type_is_a_pointer)
- << get_defs(IDE_TYPE_BACK_FORWARD_LIST, libide_type_is_a_pointer);
+ << get_defs(IDE_TYPE_BACK_FORWARD_LIST, libide_type_is_a_pointer)
+ << get_defs(IDE_TYPE_CONTEXT, libide_type_is_a_pointer);
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]