Commits

Bob Ippolito committed 8b874ff

SyncServices

Comments (0)

Files changed (8)

Lib/SyncServices/__init__.py

+from _SyncServices import *
+import objc as _objc
+if _objc.platform == 'MACOSX':
+    _objc.loadBundle(
+        "SyncServices",
+        globals(),
+        bundle_identifier=u'com.apple.SyncServices',
+    )
+import protocols

Lib/SyncServices/protocols.py

+# generated from '/System/Library/Frameworks/SyncServices.framework'
+import objc as _objc
+
+
+ISyncFiltering = _objc.informal_protocol(
+    "ISyncFiltering",
+    [
+# (BOOL)isEqual:(id)anotherFilter
+        _objc.selector(
+            None,
+            selector='isEqual:',
+            signature='c@:@',
+            isRequired=0,
+        ),
+# (BOOL)shouldApplyRecord:(NSDictionary *)record withRecordIdentifier:(NSString *)recordId
+        _objc.selector(
+            None,
+            selector='shouldApplyRecord:withRecordIdentifier:',
+            signature='c@:@@',
+            isRequired=0,
+        ),
+# (NSArray /* NSString */ *)supportedEntityNames
+        _objc.selector(
+            None,
+            selector='supportedEntityNames',
+            signature='@@:',
+            isRequired=0,
+        ),
+    ]
+)
+

Modules/SyncServices/_SyncServices.m

+/*
+ * Mapping of static items in the SyncServices framework
+ */
+#include <Python.h>
+
+#import <SyncServices/SyncServices.h>
+#import <CoreFoundation/CoreFoundation.h>
+
+#include "pyobjc-api.h"
+#include "wrapper-const-table.h"
+
+static PyMethodDef ib_methods[] = {
+	{ 0, 0, 0, 0 }
+};
+
+
+PyDoc_STRVAR(ib_doc,
+"SyncServices._SyncServices defines constants, types and global functions used by "
+"SyncServices"
+);
+
+
+#include "_SyncServices_Enum.inc"
+#include "_SyncServices_Str.inc"
+
+void init_SyncServices(void);
+
+void init_SyncServices(void)
+{
+	PyObject *m, *d;
+	CFBundleRef bundle;
+
+	m = Py_InitModule4("_SyncServices", ib_methods, 
+		ib_doc, NULL, PYTHON_API_VERSION);
+	if (!m) return;
+
+	d = PyModule_GetDict(m);
+	if (!d) return;
+
+	if (PyObjC_ImportAPI(m) < 0) {
+		return;
+	}
+
+	bundle = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.SyncServices"));
+
+	if (register_ints(d, enum_table) < 0) return;
+	if (register_variableList(d, bundle, string_table, 
+		(sizeof(string_table)/sizeof(string_table[0]))-1) < 0) return;
+
+	//CFRelease(bundle);
+}
 <li><code><span>AppKitScripting</span></code></li>
 <li><code><span>Automator</span></code></li>
 <li><code><span>CoreData</span></code></li>
+<li><code><span>SyncServices</span></code></li>
 <li><code><span>XgridFoundation</span></code></li>
 </ul>
 <p>Documentation and tests not yet written.</p>
   - ``AppKitScripting``
   - ``Automator``
   - ``CoreData``
+  - ``SyncServices``
   - ``XgridFoundation``
 
   Documentation and tests not yet written.

Scripts/CodeGenerators/cocoa_generator.py

     APPKITSCRIPTING_HDRS=pathjoin(FRAMEWORKS, "AppKitScripting.framework", "Headers")
     AUTOMATOR_HDRS=pathjoin(FRAMEWORKS, "Automator.framework", "Headers")
     COREDATA_HDRS=pathjoin(FRAMEWORKS, "CoreData.framework", "Headers")
+    SYNCSERVICES_HDRS=pathjoin(FRAMEWORKS, "SyncServices.framework", "Headers")
     XGRIDFOUNDATION_HDRS=pathjoin(FRAMEWORKS, "XgridFoundation.framework", "Headers")
 
     EXCHND_HDRS=pathjoin(FRAMEWORKS, "ExceptionHandling.framework", "Headers")
     APPKITSCRIPTING_HDRS=None
     AUTOMATOR_HDRS=None
     COREDATA_HDRS=None
+    SYNCSERVICES_HDRS=None
     XGRIDFOUNDATION_HDRS=None
 
 
                                 'build/codegen/_CoreData_Str.inc',
                                 ignore=())
 
+if SYNCSERVICES_HDRS is not None:
+    enum_generator.generate(
+            SYNCSERVICES_HDRS,
+            'build/codegen/_SyncServices_Enum.inc',
+                ignore_files=[])
+
+    strconst_generator.generate(SYNCSERVICES_HDRS,
+                                'build/codegen/_SyncServices_Str.inc',
+                                ignore=())
+
+
 if XGRIDFOUNDATION_HDRS is not None:
     enum_generator.generate(
             XGRIDFOUNDATION_HDRS,

Scripts/gen_all_protocols.py

 for framework in [
         "WebKit", "ExceptionHandling", "SecurityInterface", "AppleScriptKit",
         "AppKitScripting", "Automator", "CoreData", "XgridFoundation",
+        "SyncServices",
         ]:
     path = "/System/Library/Frameworks/%s.framework" % framework
     protfile = file(os.path.join(libdir, framework, "protocols.py"), "w")
 AppKitScriptingDepends = dict(depends=INCFILES)
 AutomatorDepends = dict(depends=INCFILES)
 CoreDataDepends = dict(depends=INCFILES)
+SyncServicesDepends = dict(depends=INCFILES)
 XgridFoundationDepends = dict(depends=INCFILES)
 
 FoundationPackages, FoundationExtensions = \
                       ),
         ], headername="CoreData.h")
 
+SyncServicesPackages, SyncServicesExtensions = \
+        IfFrameWork('SyncServices.framework', [ 'SyncServices' ], [
+            Extension('SyncServices._SyncServices',
+                      [ 'Modules/SyncServices/_SyncServices.m' ],
+                      extra_compile_args=[
+                        '-IModules/objc',
+                      ] + CFLAGS,
+                      extra_link_args=frameworks(
+                        'SyncServices',
+                        'Foundation'
+                      ),
+                      **SyncServicesDepends
+                      ),
+        ], headername="SyncServices.h")
+
 AutomatorPackages, AutomatorExtensions = \
         IfFrameWork('Automator.framework', [ 'Automator' ], [
             Extension('Automator._Automator',
     AppKitScriptingPackages +
     AutomatorPackages +
     CoreDataPackages +
+    SyncServicesPackages +
     XgridFoundationPackages +
 
     [
        + AppKitScriptingExtensions
        + AutomatorExtensions
        + CoreDataExtensions
+       + SyncServicesExtensions
        + XgridFoundationExtensions
 
     ),