~ubuntu-branches/ubuntu/trusty/ocamlnet/trusty

« back to all changes in this revision

Viewing changes to src/equeue-gtk1/uq_gtk.ml

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu
  • Date: 2011-09-02 14:12:33 UTC
  • mfrom: (18.2.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110902141233-zbj0ygxb92u6gy4z
Tags: 3.4-1
* New upstream release
  - add a new NetcgiRequire directive to ease dependency management
    (Closes: #637147)
  - remove patches that were applied upstream:
    + Added-missing-shebang-lines-in-example-shell-scripts
    + Try-also-ocamlc-for-POSIX-threads

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
(* $Id: uq_gtk.ml 924 2006-06-19 16:57:05Z gerd $ *)
 
1
(* $Id: uq_gtk.ml 1230 2009-05-11 00:37:38Z gerd $ *)
2
2
 
3
3
open Equeue
4
4
open Unixqueue
5
5
 
6
 
(* Ugly hack required to compile under OCaml 3.10.  This unmarshals
7
 
 * `IN.  IN is a reserved word for Camlp4.Macro.
8
 
 *)
9
 
let __in = (Marshal.from_string "\132\149\166\190\000\000\000\003\000\000\000\000\000\000\000\000\000\000\000\000\001?\229" 0 : GMain.Io.condition)
10
 
 
11
6
IFDEF GTK1 THEN
12
7
  type event_id = GMain.Io.event_source
13
8
ELSE
30
25
 
31
26
class gtk_event_system ?(run : runner option) () =
32
27
object (self)
33
 
  inherit unix_event_system() as super
 
28
  inherit Unixqueue_select.select_based_event_system() as super
34
29
 
35
30
  val mutable gtk_attaching = false
36
31
  val mutable gtk_run_soon = false
152
147
               gtk_event_source_hup = None; } in
153
148
         ( match g.gtk_event_source_in with
154
149
               None when i ->
155
 
                 g.gtk_event_source_in <- Some(mk_handler __in [fd] [] []);
 
150
                 g.gtk_event_source_in <- Some(mk_handler Uq_gtk_helper._in [fd] [] []);
156
151
             | Some s when not i ->
157
152
                 dest_handler s;
158
153
                 g.gtk_event_source_in <- None
279
274
    with
280
275
        any ->
281
276
          prerr_endline("Uq_gtk: Internal uncaught exception: " ^
282
 
                        Printexc.to_string any);
 
277
                        Netexn.to_string any);
283
278
          raise any;
284
279
          keep
285
280
 
320
315
    with
321
316
        any ->
322
317
          prerr_endline ("Uq_gtk: Uncaught exception: " ^
323
 
                         Printexc.to_string any
 
318
                         Netexn.to_string any
324
319
                        );
325
320
    end;
326
321
    gtk_is_running <- false;