[gedit] Add column position to python bindings.
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Add column position to python bindings.
- Date: Tue, 27 Apr 2010 11:39:02 +0000 (UTC)
commit d7edc948fa38479893de3dfeabf035e1978bed0b
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Mon Apr 26 00:58:06 2010 +0200
Add column position to python bindings.
plugin-loaders/python/bindings/gedit.defs | 2 ++
plugin-loaders/python/bindings/geditcommands.defs | 2 ++
.../python/bindings/geditcommands.override | 18 ++++++++++--------
plugins/quickopen/quickopen/windowhelper.py | 2 +-
4 files changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/plugin-loaders/python/bindings/gedit.defs b/plugin-loaders/python/bindings/gedit.defs
index 916a61f..f54bb2e 100644
--- a/plugin-loaders/python/bindings/gedit.defs
+++ b/plugin-loaders/python/bindings/gedit.defs
@@ -312,6 +312,7 @@
'("GFile*" "location")
'("const-GeditEncoding*" "encoding")
'("gint" "line_pos")
+ '("gint" "column_pos")
'("gboolean" "create")
)
)
@@ -897,6 +898,7 @@
'("GFile*" "location")
'("const-GeditEncoding*" "encoding" (null-ok))
'("gint" "line_pos")
+ '("gint" "column_pos")
'("gboolean" "create")
'("gboolean" "jump_to")
)
diff --git a/plugin-loaders/python/bindings/geditcommands.defs b/plugin-loaders/python/bindings/geditcommands.defs
index 530c83a..f5ad9ba 100644
--- a/plugin-loaders/python/bindings/geditcommands.defs
+++ b/plugin-loaders/python/bindings/geditcommands.defs
@@ -13,6 +13,7 @@
'("GFile*" "location")
'("const-GeditEncoding*" "encoding")
'("gint" "line_pos")
+ '("gint" "column_pos")
)
)
@@ -24,6 +25,7 @@
'("const-GSList*" "locations")
'("const-GeditEncoding*" "encoding")
'("gint" "line_pos")
+ '("gint" "column_pos")
)
)
diff --git a/plugin-loaders/python/bindings/geditcommands.override b/plugin-loaders/python/bindings/geditcommands.override
index 45157f7..3a9f57e 100644
--- a/plugin-loaders/python/bindings/geditcommands.override
+++ b/plugin-loaders/python/bindings/geditcommands.override
@@ -25,17 +25,18 @@ override gedit_commands_load_location kwargs
static PyObject *
_wrap_gedit_commands_load_location (PyObject *self, PyObject *args, PyObject *kwargs)
{
- static char *kwlist[] = { "window", "location", "encoding", "line_pos", NULL };
+ static char *kwlist[] = { "window", "location", "encoding", "line_pos", "column_pos", NULL };
PyGObject *window;
PyGObject *location;
int line_pos = 0;
+ int column_pos = 0;
PyObject *py_encoding = NULL;
GeditEncoding *encoding = NULL;
- if (!PyArg_ParseTupleAndKeywords (args, kwargs, "O!O!|Oi:load_location",
+ if (!PyArg_ParseTupleAndKeywords (args, kwargs, "O!O!|Oii:load_location",
kwlist, &PyGeditWindow_Type,
&window, &PyGFile_Type, &location,
- &py_encoding, &line_pos))
+ &py_encoding, &line_pos, &column_pos))
return NULL;
if (py_encoding != NULL && py_encoding != Py_None)
@@ -51,7 +52,7 @@ _wrap_gedit_commands_load_location (PyObject *self, PyObject *args, PyObject *kw
}
gedit_commands_load_location (GEDIT_WINDOW (window->obj), G_FILE (location->obj),
- encoding, line_pos);
+ encoding, line_pos, column_pos);
Py_INCREF (Py_None);
return Py_None;
}
@@ -60,10 +61,11 @@ override gedit_commands_load_locations kwargs
static PyObject *
_wrap_gedit_commands_load_locations (PyObject *self, PyObject *args, PyObject *kwargs)
{
- static char *kwlist[] = { "window", "locations", "encoding", "line_pos", NULL };
+ static char *kwlist[] = { "window", "locations", "encoding", "line_pos", "column_pos", NULL };
PyGObject *window;
GSList *locations = NULL;
int line_pos = 0;
+ int column_pos = 0;
PyObject *py_encoding = NULL;
PyObject *list;
PyObject *item;
@@ -71,10 +73,10 @@ _wrap_gedit_commands_load_locations (PyObject *self, PyObject *args, PyObject *k
int len;
int i;
- if (!PyArg_ParseTupleAndKeywords (args, kwargs, "O!O|Oi:load_locations",
+ if (!PyArg_ParseTupleAndKeywords (args, kwargs, "O!O|Oii:load_locations",
kwlist, &PyGeditWindow_Type,
&window, &list, &py_encoding,
- &line_pos))
+ &line_pos, &column_pos))
return NULL;
if (py_encoding != NULL && py_encoding != Py_None)
@@ -115,7 +117,7 @@ _wrap_gedit_commands_load_locations (PyObject *self, PyObject *args, PyObject *k
locations = g_slist_reverse (locations);
gedit_commands_load_locations (GEDIT_WINDOW (window->obj), locations,
- encoding, line_pos);
+ encoding, line_pos, column_pos);
g_slist_free (locations);
Py_INCREF (Py_None);
diff --git a/plugins/quickopen/quickopen/windowhelper.py b/plugins/quickopen/quickopen/windowhelper.py
index 30cefae..6b62eaa 100644
--- a/plugins/quickopen/quickopen/windowhelper.py
+++ b/plugins/quickopen/quickopen/windowhelper.py
@@ -189,7 +189,7 @@ class WindowHelper:
self._popup = None
def on_activated(self, gfile):
- gedit.commands.load_location(self._window, gfile, None, -1)
+ gedit.commands.load_location(self._window, gfile, None, -1, -1)
return True
# ex:ts=8:et:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]