File: insert-event.vala

package info (click to toggle)
libzeitgeist 0.3.18-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 3,216 kB
  • ctags: 1,360
  • sloc: sh: 11,081; ansic: 7,399; makefile: 269; xml: 121; python: 64
file content (45 lines) | stat: -rw-r--r-- 1,687 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
 * Copyright (C) 2010 Canonical Ltd
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 3 as
 * published by the Free Software Foundation.
 *
 * 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/>.
 *
 * Authored by Mikkel Kamstrup Erlandsen <mikkel.kamstrup@canonical.com>
 *
 */

using Zeitgeist;
using GLib;

public class Logger
{
  public static int main (string[] args)
    {
      Zeitgeist.Log zg = new Zeitgeist.Log();
      Event ev = new Event.full (Zeitgeist.ZG_ACCESS_EVENT,
                                 Zeitgeist.ZG_USER_ACTIVITY,
                                 "app://gedit.desktop",
                                 new Subject.full("file:///tmp/foo.txt",
                                                  Zeitgeist.NFO_TEXT_DOCUMENT,
                                                  Zeitgeist.NFO_FILE_DATA_OBJECT,
                                                  "text/plain",
                                                  "file:///tmp",
                                                  "foo.txt",
                                                  "UUID=a9a17ad2-af3a-49af-ae50-5053053535cf"));
      zg.insert_events_no_reply(ev);

      MainLoop mainloop = new MainLoop(null, false);
      mainloop.run();

      return 0;
    }
}