<commit_before>type t = Cocoa.OGWindowController.t

(* Create the application on first window *)
let init_app =
  let launched = ref false in
  fun () ->
    if not !launched then begin
      Cocoa.(
        (* Create an application and its delegate *)
        OGApplication.init (OGApplicationDelegate.create ()) ;
        (* Creating an AutoReleasePool *)
        init_arp ()
      ) ;
      launched := true
    end

let create ~width ~height =
  init_app () ;

  (* Rect for setting the size -- offset is ignored we will center *)
  let rect = Cocoa.NSRect.create 0 0 width height in

  (* Now creating an NSWindow *)
  let window = Cocoa.NSWindow.(
    create ~frame:rect
            (* Might good to be modifiable later *)
            ~style_mask:[Titled;Closable;Miniaturizable;Resizable]
            ~backing:Buffered
            ~defer:false ()
  ) in

  (* Various settings *)
  Cocoa.(
    NSWindow.set_background_color window (NSColor.green ()) ;
    (* NSWindow.make_key_and_order_front window; *)
    NSWindow.center window ;
    (* NSWindow.make_main window ; *)
    (* Set some delegate for the window? *)
    NSWindow.set_for_events window ;
    NSWindow.set_autodisplay window true
  );

  (* Creating the delegate which we will return *)
  Cocoa.OGWindowController.init_with_window window

let close win =
  (* Cocoa.NSWindow.perform_close win *)
  ()

let destroy win = ()

let size win =
  (* let i = int_of_float in
  Cocoa.(
    let (_,_,w,h) = NSRect.get (Cocoa.NSWindow.frame win)
    in i w, i h
  ) *)
  0,0

let is_open win = true<commit_msg>Restablished makeKeyAndOrderFront, fixed everything?<commit_after>type t = Cocoa.OGWindowController.t

(* Create the application on first window *)
let init_app =
  let launched = ref false in
  fun () ->
    if not !launched then begin
      Cocoa.(
        (* Create an application and its delegate *)
        OGApplication.init (OGApplicationDelegate.create ()) ;
        (* Creating an AutoReleasePool *)
        init_arp ()
      ) ;
      launched := true
    end

let create ~width ~height =
  init_app () ;

  (* Rect for setting the size -- offset is ignored we will center *)
  let rect = Cocoa.NSRect.create 0 0 width height in

  (* Now creating an NSWindow *)
  let window = Cocoa.NSWindow.(
    create ~frame:rect
            (* Might good to be modifiable later *)
            ~style_mask:[Titled;Closable;Miniaturizable;Resizable]
            ~backing:Buffered
            ~defer:false ()
  ) in

  (* Various settings *)
  Cocoa.(
    NSWindow.set_background_color window (NSColor.green ()) ;
    NSWindow.make_key_and_order_front window;
    NSWindow.center window ;
    (* NSWindow.make_main window ; *)
    (* Set some delegate for the window? *)
    NSWindow.set_for_events window ;
    NSWindow.set_autodisplay window true
  );

  (* Creating the delegate which we will return *)
  Cocoa.OGWindowController.init_with_window window

let close win =
  (* Cocoa.NSWindow.perform_close win *)
  ()

let destroy win = ()

let size win =
  (* let i = int_of_float in
  Cocoa.(
    let (_,_,w,h) = NSRect.get (Cocoa.NSWindow.frame win)
    in i w, i h
  ) *)
  0,0

let is_open win = true
{'fraction_non_alphanumeric': 0.10085092971950835, 'fraction_numerical': 0.0025212732429877086, 'mean_word_length': 2.7253521126760565, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5871884', 'n_tokens_mistral': 1008, 'n_tokens_neox': 978, 'n_words': 290}