WPF/XAML的开源替代品有哪些? [英] What are the Open Source alternatives to WPF/XAML?
问题描述
如果我们从HTML/CSS中学到了什么,那就是声明性语言(例如XML)在描述用户界面方面做得很好,因为:
If we've learned anything from HTML/CSS it's that, declarative languages (like XML) do a good job of describing User Interfaces because:
- 构建可以有效地对代码进行模板化的代码预处理器很容易.
- 代码采用定义良好,结构良好(理想)的格式,因此易于解析.
- 有效地解析或爬取基于XML的源文件的技术已经存在.
- UI脚本代码变得更加简单易懂.
- 非常简单,设计人员可以自己设计界面.
- 程序员很讨厌创建UI,因此对于设计人员来说应该足够容易.
我最近看了一看WPF应用程序(即XAML)的内容,它看起来惊人地熟悉HTML中使用的声明性语言样式.
I recently took a look at the meat of a WPF application (ie. the XAML) and it looks surprisingly familiar to the declarative language style used in HTML.
桌面UI开发的当前状态在很大程度上是分散的,否则在图形用户界面设计(IE.GTK,XUL,Qt,Winforms,WPF等)领域不会有太多重复的工作.
The current state of desktop UI development is largely fractionalized, otherwise there wouldn't be so much duplicated effort in the domain of graphical user interface design (IE. GTK, XUL, Qt, Winforms, WPF, etc).
什么是代表这些特征的开源GUI:
What are some Open Source GUI's that represent these characteristics:
- 标准化
- 与平台无关
- 声明性标记语言
- 不可知的语言
WPF,或更确切地说,XAML似乎是朝着正确方向迈出的一步.
WPF, or more specifically XAML seems like a pretty likely step in the right direction.
非常感谢您提供的信息,请保持联系.这是我从评论和答案中收集的选项.
Thanks a lot for the info, keep it comin'. Here's are the options I've gathered from the comments and answers.
GladeXML
- 编辑器: Glade接口设计器
- OS平台:全部
- GUI平台: GTK +
- 语言:C(libglade),C ++,C#(Glade#),Python,Ada,Pike,Perl,PHP,Eiffel,Ruby
- Editor: Glade Interface Designer
- OS Platforms: All
- GUI Platform: GTK+
- Languages: C (libglade), C++, C# (Glade#), Python, Ada, Pike, Perl, PHP, Eiffel, Ruby
XRC (XML Resource)
- Editors: wxGlade, XRCed, wxDesigner, DialogBlocks (non-free)
- OS Platforms: All
- GUI Platform: wxWidgets
- Languages: C++, Python (wxPython), Perl (wxPerl), .NET (wx.NET)
基于XML的格式,这些格式不是免费的,非跨平台的或特定于语言的
XUL
- 编辑器:任何基本的文本编辑器
- 操作系统平台:任何运行支持XUL的浏览器的操作系统
- GUI平台:Gecko引擎?
- 语言:C ++,Python,Ruby作为插件语言而非基本语言
注意:我不确定XUL是否值得在此列表中提及,因为它使用的不是桌面GUI语言,而是使用make-webapps-desktop-desktop语言.另外,它需要浏览器才能运行. IE,它是桌面DHTML".
Note: I'm not sure if XUL deserves mentioning in this list because it's less of a desktop GUI language and more of a make-webapps-run-on-the-desktop language. Plus, it requires a browser to run. IE, it's 'DHTML for the desktop.'
CookSwing
- 编辑器: Eclipse 通过 WindowBuilder , NetBeans 5.0 (非免费),通过
- Editor: Eclipse via WindowBuilder, NetBeans 5.0 (non-free) via Swing GUI Builder aka Matisse
- OS Platforms: All
- GUI Platform: Java
- Languages: Java only
XAML (Moonlight)
- 编辑器: MonoDevelop
- OS平台:仅Linux和其他基于Unix/X11的OS
- GUI平台: GTK +
- 语言:.NET
- Editor: MonoDevelop
- OS Platforms: Linux and other Unix/X11 based OSes only
- GUI Platforms: GTK+
- Languages: .NET
注意:XAML不是纯开放源代码格式,因为Microsoft控制其使用条款,包括随时更改条款的权利.合法地使Moonlight不能在Windows或Mac上运行.此外,唯一不受法律诉讼约束的平台是Novell. 参见我的意思的完整描述. XAML也不像C#,Managed C ++和CLR这样的ECMA标准.
Note: XAML is not a pure Open Source format because Microsoft controls its terms of use including the right to change the terms at any time. Moonlight can not legally be made to run on Windows or Mac. In addition, the only platform that is exempt from legal action is Novell. See this for a full description of what I mean. XAML is also not an ECMA standard like C#, Managed C++, and the CLR.
更新:该问题已从是否有WPF的开源替代品?"问题进行了更改,因为原始问题是错误的,而且很烂.该问题的方向已更改方向,以使其与WPF保持一致.新的输入.我对在更改之前做出回应的人们表示歉意.
推荐答案
Qt正在开发QML,除了JSON之外,它看起来非常类似于XAML.可以作为针对当前版本构建的预览,也可以在下一个版本的快照中获得.
Qt is developing QML, which looks a lot like XAML except in JSON. It's available as a preview built against the current version, and is available in snapshots of the next version.
以下是 http://doc中的一小段.qt.nokia.com/4.7-snapshot/declarative-ui-components-progressbar.html
import Qt 4.7
import "content"
Rectangle {
id: main
width: 600; height: 405
color: "#edecec"
Flickable {
anchors.fill: parent
contentHeight: column.height + 20
Column {
id: column
x: 10; y: 10
spacing: 10
Repeater {
model: 25
ProgressBar {
property int r: Math.floor(Math.random() * 5000 + 1000)
width: main.width - 20
NumberAnimation on value { duration: r; from: 0; to: 100; loops: Animation.Infinite }
ColorAnimation on color { duration: r; from: "lightsteelblue"; to: "thistle"; loops: Animation.Infinite }
ColorAnimation on secondColor { duration: r; from: "steelblue"; to: "#CD96CD"; loops: Animation.Infinite }
}
}
}
}
}
这篇关于WPF/XAML的开源替代品有哪些?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!