~ubuntu-branches/ubuntu/trusty/fennec/trusty

« back to all changes in this revision

Viewing changes to mobile/modules/linuxTypes.jsm

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2011-01-26 20:31:40 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110126203140-zcg54f8ost2vmrxr
Tags: 4.0~b3-0ubuntu1
* New upstream release v4.0 B3 (FENNEC_4_0b3_RELEASE)

* Update build-depends for xulrunner-2.0
  - update debian/control
* Update mozclient to point to the mobile-browser repo
  - update debian/mozclient/fennec.conf
* Build with "--with-system-libxul"
  - update debian/rules
* Add launcher script, based on the one used in Firefox but with the
  unnecessary bits stripped out
  - add debian/fennec.sh
  - update debian/rules
* Refresh patches for new version
  - update debian/patches/bump_gecko_versions_in_application.ini.patch
  - update debian/patches/ubuntu_codes_google.patch
  - update debian/patches/installer.patch
* Drop unneeded patches
  - remove debian/patches/nspr_flags_by_pkg_config_hack.patch
  - remove debian/patches/xul191_l10n.patch
  - update debian/patches/series

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ***** BEGIN LICENSE BLOCK *****
 
2
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
3
 *
 
4
 * The contents of this file are subject to the Mozilla Public License Version
 
5
 * 1.1 (the "License"); you may not use this file except in compliance with
 
6
 * the License. You may obtain a copy of the License at
 
7
 * http://www.mozilla.org/MPL/
 
8
 *
 
9
 * Software distributed under the License is distributed on an "AS IS" basis,
 
10
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 
11
 * for the specific language governing rights and limitations under the
 
12
 * License.
 
13
 *
 
14
 * The Original Code is Mozilla Mobile Browser.
 
15
 *
 
16
 * The Initial Developer of the Original Code is Mozilla.
 
17
 * Portions created by the Initial Developer are Copyright (C) 2010
 
18
 * the Initial Developer. All Rights Reserved.
 
19
 *
 
20
 * Contributor(s):
 
21
 *  Mark Finkle <mfinkle@mozilla.com>
 
22
 *
 
23
 * Alternatively, the contents of this file may be used under the terms of
 
24
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 
25
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 
26
 * in which case the provisions of the GPL or the LGPL are applicable instead
 
27
 * of those above. If you wish to allow use of your version of this file only
 
28
 * under the terms of either the GPL or the LGPL, and not to allow others to
 
29
 * use your version of this file under the terms of the MPL, indicate your
 
30
 * decision by deleting the provisions above and replace them with the notice
 
31
 * and other provisions required by the GPL or the LGPL. If you do not delete
 
32
 * the provisions above, a recipient may use your version of this file under
 
33
 * the terms of any one of the MPL, the GPL or the LGPL.
 
34
 *
 
35
 * ***** END LICENSE BLOCK ***** */
 
36
 
 
37
let EXPORTED_SYMBOLS = ["GLib", "EBook"];
 
38
 
 
39
const Cu = Components.utils;
 
40
 
 
41
Cu.import("resource://gre/modules/ctypes.jsm");
 
42
 
 
43
let GLib = {
 
44
  lib: null,
 
45
 
 
46
  init: function glib_init() {
 
47
    if (this.lib)
 
48
      return;
 
49
 
 
50
    this.lib = true; // TODO hook up the real glib
 
51
    
 
52
    this.GError = new ctypes.StructType("GError", [
 
53
      {"domain": ctypes.int32_t},
 
54
      {"code": ctypes.int32_t},
 
55
      {"message": ctypes.char.ptr}
 
56
    ]);
 
57
 
 
58
    this.GList = new ctypes.StructType("GList", [
 
59
      {"data": ctypes.voidptr_t},
 
60
      {"next": ctypes.voidptr_t},
 
61
      {"prev": ctypes.voidptr_t}
 
62
    ]);
 
63
  }
 
64
};
 
65
 
 
66
let EBook = {
 
67
  lib: null,
 
68
  
 
69
  E_CONTACT_FULL_NAME: 4,
 
70
  E_CONTACT_EMAIL_1: 8,
 
71
  E_CONTACT_EMAIL_2: 9,
 
72
  E_CONTACT_EMAIL_3: 10,
 
73
  E_CONTACT_EMAIL_4: 11,
 
74
  E_CONTACT_PHONE_BUSINESS: 17,
 
75
  E_CONTACT_PHONE_BUSINESS_2: 18,
 
76
  E_CONTACT_PHONE_HOME: 23,
 
77
  E_CONTACT_PHONE_HOME_2: 24,
 
78
  E_CONTACT_PHONE_MOBILE: 27,
 
79
 
 
80
  E_CONTACT_EMAIL_FIRST: 8,
 
81
  E_CONTACT_EMAIL_LAST: 11,
 
82
  E_CONTACT_PHONE_FIRST: 16,
 
83
  E_CONTACT_PHONE_LAST: 34,
 
84
 
 
85
  init: function ebook_init() {
 
86
    if (this.lib)
 
87
      return;
 
88
 
 
89
    GLib.init();
 
90
 
 
91
    try {
 
92
      // Shipping on N900
 
93
      this.lib = ctypes.open("libebook-1.2.so.5");
 
94
    } catch (e) {
 
95
      try {
 
96
        // Shipping on Ubuntu
 
97
        this.lib = ctypes.open("libebook-1.2.so.9");
 
98
      } catch (e) {
 
99
        Cu.reportError("EBook: couldn't load libebook:\n" + e)
 
100
        this.lib = null;
 
101
        return;
 
102
      }
 
103
    }
 
104
 
 
105
    this.EBook = new ctypes.StructType("EBook");
 
106
    this.EQuery = new ctypes.StructType("EQuery");
 
107
 
 
108
    this.openSystem = this.lib.declare("e_book_new_system_addressbook", ctypes.default_abi, EBook.EBook.ptr, GLib.GError.ptr.ptr);
 
109
    this.openBook = this.lib.declare("e_book_open", ctypes.default_abi, ctypes.bool, EBook.EBook.ptr, ctypes.bool, GLib.GError.ptr.ptr);
 
110
 
 
111
    this.queryAnyFieldContains = this.lib.declare("e_book_query_any_field_contains", ctypes.default_abi, EBook.EQuery.ptr, ctypes.char.ptr);
 
112
 
 
113
    this.getContacts = this.lib.declare("e_book_get_contacts", ctypes.default_abi, ctypes.bool, EBook.EBook.ptr, EBook.EQuery.ptr, GLib.GList.ptr.ptr, GLib.GError.ptr.ptr);
 
114
    this.getContactField = this.lib.declare("e_contact_get_const", ctypes.default_abi, ctypes.char.ptr, ctypes.voidptr_t, ctypes.uint32_t);
 
115
  }
 
116
};