ROOT on ios and RootBrowser app

Similar documents
Developing Applications for ios

The Past, Present, and Future of SWT

Cocoa. Last Week... Music 3SI: Introduction to Audio/Multimedia App. Programming. Today... Why Cocoa? Wikipedia - Cocoa

C SCI The X Window System Stewart Weiss

CS 4300 Computer Graphics

iplots extreme Next-generation interactive graphics for analysis of large data Simon Urbanek AT&T Labs Statistics Research

Xcode and Swift CS 4720 Mobile Application Development

CHAPTER 2: SYSTEM STRUCTURES. By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

Chapter 2: Operating-System Structures

CS193p Spring 2010 Wednesday, March 31, 2010

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edition

Chapter 2. Operating-System Structures

iphone App Basics iphone and ipod touch Development Fall 2009 Lecture 5

Object-Oriented Programming in Objective-C

Manual Xcode Ios 5 Simulator Black Screen >>>CLICK HERE<<<

X Review. Mac OS X Roots: NeXT. BWS Available for virtually every OS

Merits of QT for developing Imaging Applications UI

Science. Computer Science

NoteList 3.3 User Guide

Background Information About GTK+ and Related Libraries

Introduction to ROOT. M. Eads PHYS 474/790B. Friday, January 17, 14

icollections 4.5 What s new in v Problem with displaying Web Views on some monitors - fixed. Compatibility with the newest macos.

Introduction to Cocoa Programming

Welcome to CS193E. Mac OS X Cocoa Programming. James Dempsey Paul Marcos

Blender Notes. Introduction to Digital Modelling and Animation in Design Blender Tutorial - week 1 The Blender Interface and Basic Shapes

Android Pre-Release Deployment Release Notes (R2)

App Development. Quick Guides for Masterminds. J.D Gauchat Cover Illustration by Patrice Garden

Mac Os X Terminal User Guide

IBM Case Manager Mobile Version SDK for ios Developers' Guide IBM SC

Xcode 6 and ios 8 What s New for Software Developers

User Interfaces. Lecture 15. Application Programming on Mac OS. Hamza Bennani September 4, 2018

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edit9on

Laboratory 1: Eclipse and Karel the Robot

Case study on PhoneGap / Apache Cordova

UI, Graphics & EFL. Carsten Haitzler Principal Engineer Samsung Electronics Korea Founder/Leader Enlightenment / EFL

NoteList 4.1 User Guide

iphone Programming Patrick H. Madden SUNY Binghamton Computer Science Department

RenderMonkey 1.6. Natalya Tatarchuk ATI Research

GNUstep: What is it? gnustep.org

Core Graphics and OpenGL ES. Dr. Sarah Abraham

CS 160: Lecture 10. Professor John Canny Spring 2004 Feb 25 2/25/2004 1

Free Downloads OpenGL ES 3.0 Programming Guide

Curves & Splines. Assignment #3. Overview & Objectives. Due Dates. CPSC 453 Fall 2018 University of Calgary

April 4-7, 2016 Silicon Valley

Unified Functional Testing

Chapter 2: System Structures. Operating System Concepts 9 th Edition

Stanford CS193p. Developing Applications for ios Fall Stanford CS193p. Fall 2013

The Universal Developer

KIVY - A Framework for Natural User Interfaces

CS 371L - Mobile Computing (ios) Dr. William C. Bulko. CS 371L Mobile Computing (ios) Introduction

SCADE. SCADE Display Graphical Prototyping and Design. Tailored for Critical Embedded HMIs EMBEDDED SOFTWARE

Introduction. What s New in This Edition

xline 2.5 Documentation xline 2.5 for Mac Easy mind mapping and brainstorming tool Documentation ENGLISH VERSION apps.adnx.

Qt + Maemo development

HPE Java Add-in Extensibility

MOUNTAIN LION. A Quick Introduction

Praktikum Entwicklung von Mediensystemen mit

Godot engine Documentation

MyGraphicsLab ADOBE INDESIGN CC COURSE FOR PRINT & DIGITAL MEDIA PUBLICATION Curriculum Mapping to ACA Objectives

Display Systems International Software Demo Instructions

Review. Designing Interactive Systems II. Review. Base Window System. Apps UITK BWS GEL. 4-Layer Model Graphics and Event Library BWS GEL

Mac OS X Part 2. The University of Utah Student Computing Labs Macintosh Support

Release Notes OGantt version Bug Fixes 29 JUN :10 ID : 671 Fixed in version : 3.8.0

CS193E Lecture 17. Multiple Document Windows OpenGL & Cocoa

User Experience Modern, intuitive interface (OS X) No No No Yes Yes Yes. Modern, intuitive interface (Windows) No No No No No Yes

Manual Of Ios 7 Beta 2 Ipad Mini >>>CLICK HERE<<<

The VDC is already running on Windows, Mac OS and Linux. In Version 2 we implemented a lot new Functions and increased the stability.

ios Simulator User Guide

Transforming Selections In Photoshop

Quick Multitouch Apps using kivy and Python

ADOBE CHARACTER ANIMATOR PREVIEW ADOBE BLOGS

INFORMATICS LABORATORY WORK #2

Mac OS X Part 1. The University of Utah Student Computing Labs Macintosh Support

MindGenius v6: A revision tool

ITP 342 Mobile App Dev. Unit Testing

And FlexCel is much more than just an API to read or write xls files. On a high level view, FlexCel contains:

Views, Drawing, and Events. Lecture 5

Beginning Mac Programming

Mobile App Development. ios Platform

Datasheet for MiniGUI V3.2

SILVACO. An Intuitive Front-End to Effective and Efficient Schematic Capture Design INSIDE. Introduction. Concepts of Scholar Schematic Capture

This guide shows you how to set up Data Director to replicate Data from Head Office to Store.

TES Guiliani + BLU on Renesas Rx63N Embedded GUI Solution Kit - Introduction

Android is a software stack for mobile devices and comprises middleware, operating system and core

Integrated Software Environment. Part 2

COMP6700/2140 GUI and Event Driven Programming

Adobe InDesign CC Tutorial Part 1. By Kelly Conley

Presentation to the Linux Supporters Group Adelaide. on Wednesday 6/5/2009 by Hayden Tremethick.

Support for Adobe Acrobat Reader

Worn And Torn Text In Photoshop

Let s Make a Front Panel using FrontCAD

Beautiful User Interfaces with JavaFX

Educational Fusion. Implementing a Production Quality User Interface With JFC

Spring 2009 Prof. Hyesoon Kim

Widget. Widget is a generic name for parts of an interface that have their own behaviour. e.g., buttons, progress bars, sliders, drop-down

In the Driver s Seat

Copyright Khronos Group, Page Graphic Remedy. All Rights Reserved

Max scene used to generate the image from the second pdf in this tutorial.

Chapter 2: System Structures

Qt-Based Implementation of Low Level ROOT Graphical Layer

Transcription:

Native graphics on Mac OS X ROOT on ios and RootBrowser app Timur Pocheptsov root.cern.ch 1

Motivation X11.application (XQuartz) is not required anymore. No mysterious crashes with XQuartz (we can not fix XQuartz). But we can fix bugs in a ROOT s code. We have an access to the native modern graphics on Mac, not limited by outdated X11 (at the moment new features we have: transparency, anti-aliasing, gradient fills and shadows) We can mix native and ROOT s widgets in a ROOT GUI application. 2

Timeline Project started in December 2011 The first alpha-version (without OpenGL support) was available April 2012 (the first of 5.34 releases) May 2012 - OpenGL Became more stable and robust by September 2012 Support for new Retina devices - October 2012 pyroot - February 2013. 3

ROOT s graphics: ROOT s GUI Framework TGWindow, TGFrame, TGMainFrame,... TGButton... TGSlider... TGEtc. Window management, graphics, images, etc. Events (mouse, keyboard, geometry changes, etc.) TVirtualX TSystem Event loop TGX11/TGX11TTF TGWin32 TUnixSystem TWinNTSystem X11 Win GDI X11 Windows 4

ROOT s graphics: ROOT s GUI Framework TGWindow, TGFrame, TGMainFrame,... TGButton... TGSlider... TGEtc. Window management, graphics, images, etc. Events (mouse, keyboard, geometry changes, etc.) TVirtualX TSystem Event loop TGX11/TGX11TTF TGWin32 TUnixSystem TWinNTSystem TMacOSXSystem X11 Win GDI X11 Mac OS X (Cocoa) Windows 4

ROOT s graphics: ROOT s GUI Framework TGWindow, TGFrame, TGMainFrame,... TGButton... TGSlider... TGEtc. Window management, graphics, images, etc. Events (mouse, keyboard, geometry changes, etc.) TVirtualX TSystem Event loop TGX11/TGX11TTF TGCocoa TGWin32 TUnixSystem TWinNTSystem TMacOSXSystem X11 Mac OS X (Cocoa and Quartz) Win GDI X11 Mac OS X (Cocoa) Windows 4

Implementation: TVirtualX TVirtualX - abstract base class, includes functions for: Window management Pixmap and image management Font management Cursors Drag and drop OpenGL (window/context management) Graphical context management Drawing (GUI) Drawing (non-gui - for TPad) (Cocoa) Emulation (Quartz 2D) 5

Cocoa, Objective-C Cocoa: object-oriented API, written in Objective-C programming language Descendant of the NeXTSTEP API ( NS prefix in class names for NeXT STEP ) Consists of: Foundation Kit : containers, iterations, etc. - foundation. Application Kit : GUI programming Core Data : object persistence framework Objective-C: Simple general purpose object-oriented programming language Strict superset of the C programming language Adds simple object-oriented features (classes, protocols, messaging etc.) You can mix Objective-C and C++ : Objective-C++ 6

Quartz 2D Native API on Mac OS X for 2D graphics I use Quartz 2D to render: Text Lines Paths (filled polygons and strokes) Gradients Shadows The same code draws on the screen, into the image, can also draw into PDF context. From wikipedia: Quartz 2D is available to all Mac OS X and ios application environments, and provides resolution-independent and device-independent rendering of bitmap graphics, text, and vectors both on-screen and in preparation for printing.... 7

Implementation: TVirtualX $ROOTSYS/graf2/cocoa - new module introduced. Code is written in Objective-C++, contains C++ classes and functions + Objective-C protocols, classes. The heart of the module is the TGCocoa class, which inherits TVirtualX. ROOT is not a pure C/C++ framework anymore! ;) Examples: TBrowser, Eve: 8

Implementation: TVirtualX (graphics, examples) Thanks to Quartz, we have transparency, anti-aliasing, gradients and shadows: 9

Implementation: add OpenGL OpenGL with Cocoa (CMS Fireworks event display, compiled by Matevz Tadel and Alja Mrak Tadel, using ROOT with Cocoa back-end): 10

Implementation: event loop, TMacOSXSystem Typical Cocoa-based application has its own event loop hidden inside a black box function - NSApplicationMain ROOT has its own event loop and knows nothing about Cocoa s event loop. Cocoa has NSApplication class, using methods of this class you can (to some degree) emulate the same native Cocoa s event loop. This is the work done in TMacOSXSystem class (core/macosx module) - the new concrete TSystem s implementation for Mac OS X and Cocoa: works like TUnixSystem. Note: we have only one ROOT s process now, not two different applications, some things can happen faster than you expect - I do not have to synchronize with X11 server. 11

Implementation: event handling (dispatching) ROOT s GUI requires X11-like events: implementation should work like it s a real X-server. X11 has quite sophisticated event model And Cocoa has a different event model (some events are simpler, some - more complex, some events do not exist in Cocoa). Cocoa events has to be translated to X11-like events, if it s possible, also many artificial X11 events are generated. Event dispatching/processing is quite complicated and after Cocoa s window receive some simple event (e.g. mouse button press ), twisted logic is required to mimic X-server s event dispatching :) 12

Implementation: drag and drop, copy and paste operations Similar to the Windows version of ROOT: you can drag an object from a Finder s window into a ROOT s window (if it supports D&D) you can drag objects between ROOT s windows (if they support D&D) copy and paste operations in a ROOT s text editor (TGTextView, TGTextEditor) Implementation is a mix of: Pure emulation (X11 s properties and selections ) Native API (Cocoa). 13

Implementation: Retina displays Summer 2012: new MacBooks with Retina displays were introduced. It s possible to enable non-standard HD-resolutions on non-retina device and test your app (Quartz Debug tool). In General, TGCocoa was Retina-ready. All GUI parts were ok (clear and crisp text). Only a few modifications were done: Canvases/pads require larger pixmaps. OpenGL - almost literally one call: [self setwantsbestresolutionopenglsurface : YES];// somewhere inside ROOTOpenGLView class Some coordinate-translation functions had to be replaced. Matevz Tadel updated graf3d/gl and graf3d/eve to use larger viewports on Retina MacBooks (he also added a really nice multisampling setting into system.rootrc). 14

Implementation: pyroot Did not work at the beginning. Fixed in February 2013 (many thanks to Wim for help!): Required simple modification in TMacOSXSystem (now DispatchOneEvent functions is even more TUnixSystemlike). Simple modification in TGCocoa (ROOT s process manipulations/transformations) Modifications in pyroot (done by Wim). 15

How-to install Available in the 5.34 release, ROOT must be configured with --enable-cocoa option. Is default in the trunk (on Mac OS X 10.8) You can still switch back to the good old X11 version - configure ROOT with --disable-cocoa option. Cocoa-specific tutorials are in $ROOTSYS/tutorials/ cocoa 16

Conclusions, the status and future In general, it s a complete TVirtualX implementation (minus several very specific functions, which are never called from our GUI). It must be seriously tested - your feedback is welcome. The next step is to try to use multi-threaded rendering. Thread management is done by Cocoa automatically. The tough part is on the ROOT s side, though - gvirtualx->dosomething() - global variables, object with a complex (shared) state. Now it s possible to mix native controls and ROOT s GUI NSButton (Cocoa s control) inside TGMainFrame 17

ROOT on ios Starting from 2010 ROOT can be compiled for ios (but not the trunk version at the moment): configure with iossim/ios as a platform. In principle, your ios application has access to all ROOT s classes. But there is no ROOT s interactive session on ios, well, this can also be done, but still: ios has a very different GUI, ROOT s GUI can not be ported to ios. ROOT s non-gui graphics (2D/3D) can be ported and we have ios specific version of TCanvas/TPad (== 2Dgraphics), implementation is based on the Quartz 2D API, the same API as we use on Mac OS X. 18

ROOT on ios: RootBrowser app Simple ROOT based application for ios (ipad devices only) Simplified version of TBrowser + TCanvas. Uses TWebFile. Can browse ROOT files content and visualize TH1/ TH2/TGraph/TMultiGraph/TF1/TF2 objects (easy to add other ROOT s objects). Has a simplified version of graphical editor from TCanvas. GUI is done with UIKit (Cocoa Touch, ios-specific counterpart for AppKit). 19

ROOTBrowser app Example: browsing file contents 20

ROOTBrowser app: editor ROOT Users Workshop 11-14 March 2013 21

Demos? 22

Thank you! 23