[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Re: Missing sip and/or QScintilla feature
From:       Detlev Offenbach <detlev () die-offenbachs ! de>
Date:       2008-12-27 12:01:25
Message-ID: 200812271301.25407.detlev () die-offenbachs ! de
[Download RAW message or body]

Hi,

attached please find a patch to sip export.c to support the feature mentioned 
below.

Regards,
Detlev

On Montag, 22. Dezember 2008, Phil Thompson wrote:
> On Mon, 22 Dec 2008 19:41:54 +0100, Detlev Offenbach
>
> <detlev@die-offenbachs.de> wrote:
> > Hi,
> >
> > the QScintilla QsciAPIs documentation states:
> >
> > "A function name may be followed by a `?' and a number. The number is
>
> used
>
> > by
> > auto-completion to display a registered QPixmap with the function name."
> >
> > However, I cannot find a way to enable the generation of such markers in
> > sip.
> > Is there a convention, which IDs should be used for which type of
> > identifire
> > (e.g. classes, methods, functions, attributes, ...)?
> >
> > If this feature is missing, I think it should be added soon because it
> > makes a
> > plus to all applications showing autocompletions. If it is supported,
> > please
> > let me know how to activate it. I checked the API files installed by
> > QScintilla and PyQt4 and didn't find such markers.
>
> The API files generated by SIP don't support the feature.
>
> Phil
> _______________________________________________
> PyQt mailing list    PyQt@riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt



-- 
Detlev Offenbach
detlev@die-offenbachs.de

["export.c.diff" (text/x-diff)]

--- export.c.orig	2008-11-17 14:41:06.000000000 +0100
+++ export.c	2008-12-27 12:24:12.000000000 +0100
@@ -22,6 +22,12 @@
 #define XML_VERSION_NR  0       /* The schema version number. */
 
 
+#define CLASS_ID    1
+#define METHOD_ID   4
+#define VARIABLE_ID 7
+#define ENUM_ID     10
+
+
 static void apiEnums(sipSpec *pt, moduleDef *mod, classDef *scope, FILE *fp);
 static void apiVars(sipSpec *pt, moduleDef *mod, classDef *scope, FILE *fp);
 static int apiCtor(moduleDef *mod, classDef *scope, ctorDef *ct, int sec,
@@ -127,7 +133,7 @@
     /* Do the callable type form. */
     fprintf(fp, "%s.", mod->name);
     prScopedPythonName(fp, scope->ecd, scope->pyname);
-    fprintf(fp, "(");
+    fprintf(fp, "?%d(", CLASS_ID);
 
     need_comma = FALSE;
 
@@ -146,7 +152,7 @@
     /* Do the call __init__ form. */
     fprintf(fp, "%s.", mod->name);
     prScopedPythonName(fp, scope->ecd, scope->pyname);
-    fprintf(fp, ".__init__(self");
+    fprintf(fp, ".__init__?%d(self",CLASS_ID);
 
     for (a = 0; a < ct->pysig.nrArgs; ++a)
         apiArgument(&ct->pysig.args[a], FALSE, TRUE, sec, fp);
@@ -178,14 +184,14 @@
         {
             fprintf(fp, "%s.", mod->name);
             prScopedPythonName(fp, ed->ecd, ed->pyname->text);
-            fprintf(fp, "\n");
+            fprintf(fp, "?%d\n", ENUM_ID);
         }
 
         for (emd = ed->members; emd != NULL; emd = emd->next)
         {
             fprintf(fp, "%s.", mod->name);
             prScopedPythonName(fp, ed->ecd, emd->pyname->text);
-            fprintf(fp, "\n");
+            fprintf(fp, "?%d\n", ENUM_ID);
         }
     }
 }
@@ -208,7 +214,7 @@
 
         fprintf(fp, "%s.", mod->name);
         prScopedPythonName(fp, vd->ecd, vd->pyname->text);
-        fprintf(fp, "\n");
+        fprintf(fp, "?%d\n", VARIABLE_ID);
     }
 }
 
@@ -223,7 +229,7 @@
 
     fprintf(fp, "%s.", mod->name);
     prScopedPythonName(fp, scope, od->common->pyname->text);
-    fprintf(fp, "(");
+    fprintf(fp, "?%d(", METHOD_ID);
 
     nr_out = 0;
 


_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic