SlideShare a Scribd company logo
3 UIs for the price of one code with YaST's libyui  Katarína Machálková Software Engineer (YaST) [email_address]
 
Talk outline Introduction – why libyui (Hello World!) Brief Tour de Libyui internals My first libyui application Introducing different language bindings Sample non-C++ libyui application Documentation, useful links Questions, answers, ...
Intro & Motivation
The most famous app of all times  ☺
Hello World in Qt ... int main(int argc, char *argv[]) { QApplication app(argc, argv); QPushButton hw("Hello World!"); hw.resize(75, 30); QObject::connect(&hw, SIGNAL(clicked()), &app, SLOT(quit())); hw.show(); return app.exec(); }
…  in Gtk ... int main (int argc, char *argv[]) { GtkWidget *window; GtkWidget *button; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (destroy), NULL); gtk_container_border_width (GTK_CONTAINER (window), 10); button = gtk_button_new_with_label ("Hello World"); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (hello), NULL); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window)); gtk_container_add (GTK_CONTAINER (window), button); gtk_widget_show (button); gtk_widget_show (window); gtk_main (); return 0; }
… and in ncurses ... int main(void) { WINDOW * mainwin; if ( (mainwin = initscr()) == NULL ) { exit(EXIT_FAILURE); } mvaddstr(13, 33, "Hello, world!"); refresh(); sleep(3); delwin(mainwin); endwin(); refresh(); return EXIT_SUCCESS; }
One code, three user interfaces! #include "YUI.h" #include "YWidgetFactory.h" #include "YDialog.h" #include "YLayoutBox.h" #include "YEvent.h" int main( int argc, char **argv ) { YDialog *dialog = YUI::widgetFactory()->createPopupDialog(); YLayoutBox *vbox = YUI::widgetFactory()->createVBox( dialog); YUI::widgetFactory()->createLabel( vbox, "Hello, World!" ); YUI::widgetFactory()->createPushButton( vbox, "&OK" ); dialog->waitForEvent(); dialog->destroy(); }
Libyui from the inside
Introducing libyui ,[object Object]
Provides abstraction from GUI and TUI toolkits (Qt, Gtk, ncurses) in terms of widgets (UI elements) and events
YaST user interface engine
Independent of YCP (after major rewrite in 2006)
Independent of YaST core libraries and libzypp (dtto)
Dialogs, widgets + event handling
YaST UI Architecture
Widgets (dialog building blocks) ,[object Object]
Properties (get/set) ,[object Object]
Items
Label
Current item
… ,[object Object]
Types of widgets ,[object Object]
Events (user input results) ,[object Object]
{
YEvent *ev = dialog->waitForEvent();
do_something (ev);
} ,[object Object]
Each event has ,[object Object]
Reason (selection changed, widget was activated,...)
Pointer (or id) of the widget that broke the event loop
What libyui does not support ,[object Object]
Signals, slots, callbacks,...
Advanced graphics (3D, animations,...)
Non-blocking event handling

More Related Content

What's hot

The Beauty of Java Script
The Beauty of Java ScriptThe Beauty of Java Script
The Beauty of Java Script
Michael Girouard
 
JavaScript Survival Guide
JavaScript Survival GuideJavaScript Survival Guide
JavaScript Survival Guide
Giordano Scalzo
 
The Beauty Of Java Script V5a
The Beauty Of Java Script V5aThe Beauty Of Java Script V5a
The Beauty Of Java Script V5arajivmordani
 
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6Dmitry Soshnikov
 
C++ game development with oxygine
C++ game development with oxygineC++ game development with oxygine
C++ game development with oxygine
corehard_by
 
Better Software: introduction to good code
Better Software: introduction to good codeBetter Software: introduction to good code
Better Software: introduction to good codeGiordano Scalzo
 
JavaScript Patterns
JavaScript PatternsJavaScript Patterns
JavaScript Patterns
Giordano Scalzo
 
The Browser Environment - A Systems Programmer's Perspective [sinatra edition]
The Browser Environment - A Systems Programmer's Perspective [sinatra edition]The Browser Environment - A Systems Programmer's Perspective [sinatra edition]
The Browser Environment - A Systems Programmer's Perspective [sinatra edition]
Eleanor McHugh
 
Test driven game development silly, stupid or inspired?
Test driven game development   silly, stupid or inspired?Test driven game development   silly, stupid or inspired?
Test driven game development silly, stupid or inspired?Eric Smith
 
JavaScript on the Desktop
JavaScript on the DesktopJavaScript on the Desktop
JavaScript on the Desktop
Domenic Denicola
 
Non stop random2b
Non stop random2bNon stop random2b
Non stop random2b
phanhung20
 
Test Driven Cocos2d
Test Driven Cocos2dTest Driven Cocos2d
Test Driven Cocos2d
Eric Smith
 
ES6 is Nigh
ES6 is NighES6 is Nigh
ES6 is Nigh
Domenic Denicola
 
【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ
【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ
【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ
Unite2017Tokyo
 
Introdução ao Desenvolvimento Android com Kotlin
Introdução ao Desenvolvimento Android com KotlinIntrodução ao Desenvolvimento Android com Kotlin
Introdução ao Desenvolvimento Android com Kotlin
Nelson Glauber Leal
 
The jsdom
The jsdomThe jsdom
The jsdom
Domenic Denicola
 
5. Ввод-вывод, доступ к файловой системе
5. Ввод-вывод, доступ к файловой системе5. Ввод-вывод, доступ к файловой системе
5. Ввод-вывод, доступ к файловой системе
DEVTYPE
 
Descripción Software libre
Descripción Software libreDescripción Software libre
Descripción Software libre
grupocisnerino
 
How to Clone Flappy Bird in Swift
How to Clone Flappy Bird in SwiftHow to Clone Flappy Bird in Swift
How to Clone Flappy Bird in SwiftGiordano Scalzo
 
JNI - Java & C in the same project
JNI - Java & C in the same projectJNI - Java & C in the same project
JNI - Java & C in the same project
Karol Wrótniak
 

What's hot (20)

The Beauty of Java Script
The Beauty of Java ScriptThe Beauty of Java Script
The Beauty of Java Script
 
JavaScript Survival Guide
JavaScript Survival GuideJavaScript Survival Guide
JavaScript Survival Guide
 
The Beauty Of Java Script V5a
The Beauty Of Java Script V5aThe Beauty Of Java Script V5a
The Beauty Of Java Script V5a
 
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
 
C++ game development with oxygine
C++ game development with oxygineC++ game development with oxygine
C++ game development with oxygine
 
Better Software: introduction to good code
Better Software: introduction to good codeBetter Software: introduction to good code
Better Software: introduction to good code
 
JavaScript Patterns
JavaScript PatternsJavaScript Patterns
JavaScript Patterns
 
The Browser Environment - A Systems Programmer's Perspective [sinatra edition]
The Browser Environment - A Systems Programmer's Perspective [sinatra edition]The Browser Environment - A Systems Programmer's Perspective [sinatra edition]
The Browser Environment - A Systems Programmer's Perspective [sinatra edition]
 
Test driven game development silly, stupid or inspired?
Test driven game development   silly, stupid or inspired?Test driven game development   silly, stupid or inspired?
Test driven game development silly, stupid or inspired?
 
JavaScript on the Desktop
JavaScript on the DesktopJavaScript on the Desktop
JavaScript on the Desktop
 
Non stop random2b
Non stop random2bNon stop random2b
Non stop random2b
 
Test Driven Cocos2d
Test Driven Cocos2dTest Driven Cocos2d
Test Driven Cocos2d
 
ES6 is Nigh
ES6 is NighES6 is Nigh
ES6 is Nigh
 
【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ
【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ
【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ
 
Introdução ao Desenvolvimento Android com Kotlin
Introdução ao Desenvolvimento Android com KotlinIntrodução ao Desenvolvimento Android com Kotlin
Introdução ao Desenvolvimento Android com Kotlin
 
The jsdom
The jsdomThe jsdom
The jsdom
 
5. Ввод-вывод, доступ к файловой системе
5. Ввод-вывод, доступ к файловой системе5. Ввод-вывод, доступ к файловой системе
5. Ввод-вывод, доступ к файловой системе
 
Descripción Software libre
Descripción Software libreDescripción Software libre
Descripción Software libre
 
How to Clone Flappy Bird in Swift
How to Clone Flappy Bird in SwiftHow to Clone Flappy Bird in Swift
How to Clone Flappy Bird in Swift
 
JNI - Java & C in the same project
JNI - Java & C in the same projectJNI - Java & C in the same project
JNI - Java & C in the same project
 

Similar to 3 UIs for the price of one code

Qt Workshop
Qt WorkshopQt Workshop
Qt Workshop
Johan Thelin
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008
Guillaume Laforge
 
Introduzione a Gwt
Introduzione a GwtIntroduzione a Gwt
Introduzione a Gwt
afranceschetti
 
Writing a slack chatbot seattle
Writing a slack chatbot seattleWriting a slack chatbot seattle
Writing a slack chatbot seattle
Jesus Manuel Olivas
 
GWT Extreme!
GWT Extreme!GWT Extreme!
GWT Extreme!
cromwellian
 
JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?
Doug Hawkins
 
Building Dojo in the Cloud
Building Dojo in the CloudBuilding Dojo in the Cloud
Building Dojo in the Cloud
James Thomas
 
Writing a slack chatbot DrupalCampLA
Writing a slack chatbot DrupalCampLAWriting a slack chatbot DrupalCampLA
Writing a slack chatbot DrupalCampLA
Jesus Manuel Olivas
 
mobl
moblmobl
mobl
zefhemel
 
Introduction to Griffon
Introduction to GriffonIntroduction to Griffon
Introduction to Griffon
James Williams
 
Silicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsSilicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM Mechanics
Azul Systems, Inc.
 
Google Web Toolkits
Google Web ToolkitsGoogle Web Toolkits
Google Web Toolkits
Yiguang Hu
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] Enterprise
Dave Artz
 
Developing Useful APIs
Developing Useful APIsDeveloping Useful APIs
Developing Useful APIsDmitry Buzdin
 
Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with XgxperfDeveloping and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
Prabindh Sundareson
 
Annotation processing tool
Annotation processing toolAnnotation processing tool
Annotation processing tool
Andrzej Ludwikowski
 
Playing With Fire - An Introduction to Node.js
Playing With Fire - An Introduction to Node.jsPlaying With Fire - An Introduction to Node.js
Playing With Fire - An Introduction to Node.js
Mike Hagedorn
 
Your Library Sucks, and why you should use it.
Your Library Sucks, and why you should use it.Your Library Sucks, and why you should use it.
Your Library Sucks, and why you should use it.Peter Higgins
 
DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.
JooinK
 

Similar to 3 UIs for the price of one code (20)

Qt Workshop
Qt WorkshopQt Workshop
Qt Workshop
 
Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web Toolkit
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008
 
Introduzione a Gwt
Introduzione a GwtIntroduzione a Gwt
Introduzione a Gwt
 
Writing a slack chatbot seattle
Writing a slack chatbot seattleWriting a slack chatbot seattle
Writing a slack chatbot seattle
 
GWT Extreme!
GWT Extreme!GWT Extreme!
GWT Extreme!
 
JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?
 
Building Dojo in the Cloud
Building Dojo in the CloudBuilding Dojo in the Cloud
Building Dojo in the Cloud
 
Writing a slack chatbot DrupalCampLA
Writing a slack chatbot DrupalCampLAWriting a slack chatbot DrupalCampLA
Writing a slack chatbot DrupalCampLA
 
mobl
moblmobl
mobl
 
Introduction to Griffon
Introduction to GriffonIntroduction to Griffon
Introduction to Griffon
 
Silicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsSilicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM Mechanics
 
Google Web Toolkits
Google Web ToolkitsGoogle Web Toolkits
Google Web Toolkits
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] Enterprise
 
Developing Useful APIs
Developing Useful APIsDeveloping Useful APIs
Developing Useful APIs
 
Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with XgxperfDeveloping and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
 
Annotation processing tool
Annotation processing toolAnnotation processing tool
Annotation processing tool
 
Playing With Fire - An Introduction to Node.js
Playing With Fire - An Introduction to Node.jsPlaying With Fire - An Introduction to Node.js
Playing With Fire - An Introduction to Node.js
 
Your Library Sucks, and why you should use it.
Your Library Sucks, and why you should use it.Your Library Sucks, and why you should use it.
Your Library Sucks, and why you should use it.
 
DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.
 

Recently uploaded

Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 

Recently uploaded (20)

Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 

3 UIs for the price of one code

  • 1. 3 UIs for the price of one code with YaST's libyui Katarína Machálková Software Engineer (YaST) [email_address]
  • 2.  
  • 3. Talk outline Introduction – why libyui (Hello World!) Brief Tour de Libyui internals My first libyui application Introducing different language bindings Sample non-C++ libyui application Documentation, useful links Questions, answers, ...
  • 5. The most famous app of all times ☺
  • 6. Hello World in Qt ... int main(int argc, char *argv[]) { QApplication app(argc, argv); QPushButton hw("Hello World!"); hw.resize(75, 30); QObject::connect(&hw, SIGNAL(clicked()), &app, SLOT(quit())); hw.show(); return app.exec(); }
  • 7. … in Gtk ... int main (int argc, char *argv[]) { GtkWidget *window; GtkWidget *button; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (destroy), NULL); gtk_container_border_width (GTK_CONTAINER (window), 10); button = gtk_button_new_with_label ("Hello World"); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (hello), NULL); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window)); gtk_container_add (GTK_CONTAINER (window), button); gtk_widget_show (button); gtk_widget_show (window); gtk_main (); return 0; }
  • 8. … and in ncurses ... int main(void) { WINDOW * mainwin; if ( (mainwin = initscr()) == NULL ) { exit(EXIT_FAILURE); } mvaddstr(13, 33, "Hello, world!"); refresh(); sleep(3); delwin(mainwin); endwin(); refresh(); return EXIT_SUCCESS; }
  • 9. One code, three user interfaces! #include "YUI.h" #include "YWidgetFactory.h" #include "YDialog.h" #include "YLayoutBox.h" #include "YEvent.h" int main( int argc, char **argv ) { YDialog *dialog = YUI::widgetFactory()->createPopupDialog(); YLayoutBox *vbox = YUI::widgetFactory()->createVBox( dialog); YUI::widgetFactory()->createLabel( vbox, "Hello, World!" ); YUI::widgetFactory()->createPushButton( vbox, "&OK" ); dialog->waitForEvent(); dialog->destroy(); }
  • 10. Libyui from the inside
  • 11.
  • 12. Provides abstraction from GUI and TUI toolkits (Qt, Gtk, ncurses) in terms of widgets (UI elements) and events
  • 14. Independent of YCP (after major rewrite in 2006)
  • 15. Independent of YaST core libraries and libzypp (dtto)
  • 16. Dialogs, widgets + event handling
  • 18.
  • 19.
  • 20. Items
  • 21. Label
  • 23.
  • 24.
  • 25.
  • 26. {
  • 27. YEvent *ev = dialog->waitForEvent();
  • 29.
  • 30.
  • 31. Reason (selection changed, widget was activated,...)
  • 32. Pointer (or id) of the widget that broke the event loop
  • 33.
  • 35. Advanced graphics (3D, animations,...)
  • 37. My first libyui application
  • 38.
  • 40. YaST UI package ( yast2-[qt|gtk|ncurses] )
  • 42. Code it ... #include "YUI.h" #include "YWidgetFactory.h" #include "YDialog.h" #include "YLayoutBox.h" #include "YEvent.h" int main( int argc, char **argv ) { YDialog *dialog = YUI::widgetFactory()->createPopupDialog(); YLayoutBox *vbox = YUI::widgetFactory()->createVBox( dialog); YUI::widgetFactory()->createLabel( vbox, "Hello, World!" ); YUI::widgetFactory()->createPushButton( vbox, "&OK" ); dialog->waitForEvent(); dialog->destroy(); }
  • 43.
  • 45.
  • 46. Hello World dissected, part I int main( int argc, char **argv ) { YDialog *dialog = YUI::widgetFactory()->createPopupDialog(); YLayoutBox *vbox = YUI::widgetFactory()->createVBox( dialog); 1 st call creates UI instance and w.factory instance Get widget pointer from w.factory Widget container (layout aid) Child of the main dialog
  • 47. Hello World dissected, part II YUI::widgetFactory()->createLabel( vbox, "Hello, World!" ); YUI::widgetFactory()->createPushButton( vbox, "&OK" ); Create new widget, specify parent + property (string) Vert. container can have many children
  • 48. Hello World dissected, part III dialog->waitForEvent(); dialog->destroy(); } Wait for user input Use this in event loops Close the dialog, do the final cleanup
  • 49. But I don't speak C++ … ?
  • 50. Other scripting language bindings Python Ruby Perl C++ bindings
  • 51.
  • 52. Standard C++ (STL) data types (std::string, std::list,...)
  • 53. Easy way to swig-generated language bindings
  • 54. Currently for perl, python and ruby
  • 55. ' zypper in [perl|python|ruby]-yui ' (that's it ☺ )
  • 56. Hello World with perl-yui !/usr/bin/perl # # Trivial read-write (not write-only :) # example of libyui used from Perl # use yui; my $factory = yui::YUI::widgetFactory; my $dialog = $factory->createPopupDialog; my $vbox = $factory->createVBox( $dialog ); $factory->createLabel( $vbox, "Hello,World!"); $factory->createPushButton( $vbox, "&OK" ); my $event = $dialog->waitForEvent(); $dialog->destroy();
  • 57. Hello World with python-yui # Trivial usage of libyui # in pretty the same way # in python # #!/usr/bin/python import sys import yui factory = yui.YUI.widgetFactory() dialog = factory.createPopupDialog() vbox = factory.createVBox( dialog ) factory.createLabel( vbox, "Hello, World!" ) factory.createPushButton( vbox, "&OK" ) event = dialog.waitForEvent() dialog.destroy()
  • 58. More complex non-C++ application
  • 59. Simple zypp.conf editor with perl-yui (live demonstration)
  • 60. When things don't work ...
  • 61.
  • 62.
  • 64. Where to get more information? On line dokumentace: http://www.suse.de/~ug/ On line dokumentace: http://www.suse.de/~ug/ On line dokumentace: http://www.suse.de/~ug/ On line dokumentace: http://www.suse.de/~ug/ On line dokumentace: http://www.suse.de/~ug/ *-yui package doc with examples: /usr/share/doc/packages/*-yui On line dokumentace: http://www.suse.de/~ug/ On line dokumentace: http://www.suse.de/~ug/ On line dokumentace: http://www.suse.de/~ug/ On line dokumentace: http://www.suse.de/~ug/ On line dokumentace: http://www.suse.de/~ug/ YaST development mailing list: [email_address] General YaST doc (incl. widget reference): http://forgeftp.novell.com/yast/doc/SL11 .1

Editor's Notes

  1. Now we'll move onto the different scripts you can run at different times. Followed by some example of the kind of thing that can be done in the scripts.
  2. Trouble shooting an Aytoyast seutp can be tricky. There are several places where things can go wrong, and debugging post install scripts can require a reinstall each time. However, there are some places to find information.