comp.lang.ada
 help / color / mirror / Atom feed
From: alby.gamper@gmail.com
Subject: Microsoft UWP/WinRT - Update
Date: Tue, 13 Jun 2017 22:43:24 -0700 (PDT)
Date: 2017-06-13T22:43:24-07:00	[thread overview]
Message-ID: <6ce292d0-1f78-474c-ad94-9129d5f7ce83@googlegroups.com> (raw)
In-Reply-To: <1496935894.11747.0.camel@obry.net>

On Friday, June 9, 2017 at 1:31:37 AM UTC+10, Pascal Obry wrote:
> Le vendredi 02 juin 2017 à 05:27 -0700, Lucretia a écrit :
> > Never heard of Win32Ada, where's this then?
> 
> Here:
> https://github.com/AdaCore/win32ada
> 
> Since some hours!
> 
> -- 
>   Pascal Obry /  Magny Les Hameaux (78)
> 
>   The best way to travel is by means of imagination
> 
>   http://www.obry.net
> 
>   gpg --keyserver keys.gnupg.net --recv-key F949BD3B

Dear Ada Community

I have managed to get the WinRt bindings into a usable state
and have managed to create a "Windows Store" application. But
the Windows App certification Fails, since the underlying
Ada runtime, ie libgnat uses api's that are restricted, Thus
preventing the application from being distributed via the "Windows
Store".

However it can be installed and run on a local PC)
Shown below is the application code which loads up some XAML
Over the coming weeks I will try and put together a demo/video clip
demonstrating the technology in its entirety.

--------------------------------------------------------------------------------

with Windows.UI.Xaml.Markup;				use Windows.UI.Xaml.Markup;
with Common;								use Common;

--------------------------------------------------------------------------------
package body AppOverrides is

	----------------------------------------------------------------------------
	overriding function OnLaunched
	(
		This : access MyAppOverrides_Interface;
		args : Windows.ApplicationModel.Activation.ILaunchActivatedEventArgs
	)
	return Windows.HRESULT is

		Hr				: HResult := S_OK;
		m_IWindow		: IWindow;
		m_Window		: Window;
		m_XamlReader	: XamlReader;	
		m_XamlContent	: Wide_String :=

			"<TextBlock xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"" " &
			"   Name=""Text"" TextAlignment=""Center"" HorizontalAlignment=""Center"" " &
			"   VerticalAlignment=""Center"" FontSize=""32""> " &
			"   <Run Text=""Hello World application - written in Ada""/> " &
			"   <LineBreak/> " &
			"   <Run Text=""Target - Windows Store Application (Xaml)""/> " &
			"</TextBlock>";
		
		m_Object		: Windows.Object;
		m_IUIElement	: aliased IUIElement := null;

	begin

		m_IWindow := m_Window.get_Current;
		m_Object := m_XamlReader.Load(To_String(m_XamlContent));
		Hr := m_Object.QueryInterface(IID_IUIElement'access, m_IUIElement'address);
		Hr := m_IWindow.put_Content(m_IUIElement);
		Hr := m_IWindow.Activate;
		return Hr; 

	end;

end;

Alex


  reply	other threads:[~2017-06-14  5:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-02  1:23 Microsoft UWP/WinRt alby.gamper
2017-06-02  7:24 ` Dmitry A. Kazakov
2017-06-02 12:27   ` Lucretia
2017-06-02 13:28     ` Dmitry A. Kazakov
2017-06-02 14:53       ` gautier_niouzes
2017-06-02 14:56         ` Dmitry A. Kazakov
2017-06-02 21:11         ` Randy Brukardt
2017-06-08 15:31     ` Pascal Obry
2017-06-14  5:43       ` alby.gamper [this message]
2017-06-18  1:15         ` Microsoft UWP/WinRT - Update Ivan Levashev
2017-06-18  2:03       ` JEDI, Win32Ada and GNAT-COM Ivan Levashev
2017-07-03 10:14         ` Luke A. Guest
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox