Skip to content

Commit

Permalink
Add allowFullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishmack committed Jul 18, 2015
1 parent 3747a1e commit 418f78c
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 6 deletions.
6 changes: 4 additions & 2 deletions Graphics/UI/Gtk/OSX.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module Graphics.UI.Gtk.OSX (
module Graphics.UI.Gtk.OSX.Application
) where
module Graphics.UI.Gtk.OSX.Application
, module Graphics.UI.Gtk.OSX.Window
) where

import Graphics.UI.Gtk.OSX.Application
import Graphics.UI.Gtk.OSX.Window
12 changes: 12 additions & 0 deletions Graphics/UI/Gtk/OSX/Window.chs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{-# LANGUAGE CPP #-}
module Graphics.UI.Gtk.OSX.Window (
allowFullscreen
) where

import System.Glib.FFI
{#import Graphics.UI.Gtk.OSX.Types#}

allowFullscreen window =
{# call unsafe gtk2hs_osx_allow_fullscreen #}
(toDrawWindow window)

11 changes: 11 additions & 0 deletions Graphics/UI/Gtk/OSX/extra.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <gtk/gtk.h>
#include <gdk/gdkquartz.h>

void gtk2hs_osx_allow_fullscreen(GdkWindow *wnd)
{
if (wnd != NULL)
{
NSWindow *native = gdk_quartz_window_get_nswindow (wnd);
[native setCollectionBehavior: [native collectionBehavior] | NSWindowCollectionBehaviorFullScreenPrimary];
}
}
6 changes: 4 additions & 2 deletions gtk-mac-integration.cabal-renamed
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: gtk-mac-integration
Version: 0.3.0.2
Version: 0.3.1.0
License: LGPL-2.1
License-file: COPYING
Copyright: (c) 2001-2010 The Gtk2Hs Team
Expand Down Expand Up @@ -35,7 +35,7 @@ x-Types-Hierarchy: hierarchy.list

Source-Repository head
type: git
location: https://github.com/gtk2hs/ige-mac-integration
location: https://github.com/gtk2hs/gtk-mac-integration.git

Library
build-depends: base >= 4 && < 5, array -any, containers -any, mtl -any,
Expand All @@ -48,6 +48,7 @@ Library
exposed-modules:
Graphics.UI.Gtk.OSX
Graphics.UI.Gtk.OSX.Application
Graphics.UI.Gtk.OSX.Window
other-modules:
Graphics.UI.Gtk.OSX.Types
Graphics.UI.Gtk.OSX.Signals
Expand All @@ -56,6 +57,7 @@ Library

include-dirs: .
cpp-options: -DDISABLE_DEPRECATED -U__BLOCKS__ -D__attribute__(A)=
c-sources: Graphics/UI/Gtk/OSX/extra.m

x-Signals-File: Graphics/UI/Gtk/OSX/Signals.chs
x-Signals-Modname: Graphics.UI.Gtk.OSX.Signals
Expand Down
6 changes: 4 additions & 2 deletions gtk3-mac-integration.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: gtk3-mac-integration
Version: 0.3.0.3
Version: 0.3.1.0
License: LGPL-2.1
License-file: COPYING
Copyright: (c) 2001-2010 The Gtk2Hs Team
Expand Down Expand Up @@ -35,7 +35,7 @@ x-Types-Hierarchy: hierarchy.list

Source-Repository head
type: git
location: https://github.com/gtk2hs/ige-mac-integration
location: https://github.com/gtk2hs/gtk-mac-integration.git

Library
build-depends: base >= 4 && < 5, array -any, containers -any, mtl -any,
Expand All @@ -48,6 +48,7 @@ Library
exposed-modules:
Graphics.UI.Gtk.OSX
Graphics.UI.Gtk.OSX.Application
Graphics.UI.Gtk.OSX.Window
other-modules:
Graphics.UI.Gtk.OSX.Types
Graphics.UI.Gtk.OSX.Signals
Expand All @@ -56,6 +57,7 @@ Library

include-dirs: .
cpp-options: -DDISABLE_DEPRECATED -U__BLOCKS__ -D__attribute__(A)=
c-sources: Graphics/UI/Gtk/OSX/extra.m

x-Signals-File: Graphics/UI/Gtk/OSX/Signals.chs
x-Signals-Modname: Graphics.UI.Gtk.OSX.Signals
Expand Down
1 change: 1 addition & 0 deletions hs-gtk-mac-integration.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
#endif
#include <gtkosxapplication.h>

void gtk2hs_osx_allow_fullscreen(GdkWindow *wnd);

0 comments on commit 418f78c

Please sign in to comment.