易截截图软件、单文件、免安装、纯绿色、仅160KB

D Bus学习(八):利用XML定义D Bus之Server的例子


  在此先感谢http://blog.chinaunix.net/u3/111961/showart_2187819.html
。这是篇极好的文章。
  在上次学习中,我们写了client小例子,非常简单,而且通过dbus-binding-tool生成的头文件,非常规范。相比执行,server稍微复杂些,仍然使用上次的xml文件,但是去掉annotation,更为本原一些。文件wei.xml如下:
<?xml version="1.0" encoding="UTF-8" ?>
<node name="/com/wei/MyObject">
  <interface name="com.wei.MyObject.Sample">
    <method name="Test">
      <arg name="x" type="u" direction="in" />
      <arg name="d_ret" type="d" direction="out" />
    </method >
  </interface >
</node >
  客户端小程序上次学习给出,正好用于实验。下面详细讲述步骤。
步骤一:生成头文件
dbus-binding-tool --mode=glib-server --prefix=com_wei wei.xml > wei_server.h
  注意,--prefix是不可缺少的参数,在有些文章中,没有提到这个,至少我在Moblin的操作系统中测试是需要的。通常来讲,对于项目,也需要提供一个区分的命名空间,无论是否必须,建议加上。"--prefix"参数定义了对象前缀。设对象前缀是$(prefix),则生成的DBusGObjectInfo结构变量名就是dbus_glib_$(prefix)_object_info。
生成了头文件wei_server.h如下:
/* Generated by dbus-binding-tool; do not edit! */
#ifndef __dbus_glib_marshal_com_wei_MARSHAL_H__
#define __dbus_glib_marshal_com_wei_MARSHAL_H__
#include    <glib-object.h>
G_BEGIN_DECLS
#ifdef G_ENABLE_DEBUG
#define g_marshal_value_peek_boolean(v)  g_value_get_boolean (v)
#define g_marshal_value_peek_char(v)     g_value_get_char (v)
#define g_marshal_value_peek_uchar(v)    g_value_get_uchar (v)
#define g_marshal_value_peek_int(v)      g_value_get_int (v)
#define g_marshal_value_peek_uint(v)     g_value_get_uint (v)
#define


相关文档:

ASP.NET/XML深入编程技术

这是关于Asp.Net/XML深入编程的技术书,作者精心设计了66个实例详细介绍了.Net   Framework以及XML技术在.Net   Framework的编程方法和技巧。全书由12章构成,内容包括.Net平台的建立、Asp.Net的Web   Forms、控件、数据访问、Web   Service、Asp.Net的设置和跟踪、Asp.Net的安全 ......

vc实现xml的操作


<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:PMingLiU;
panos ......

Parsing XML from the Net Using the SAXParser


Parsing XML from the Net - Using the SAXParser
http://www.anddev.org/parsing_xml_from_the_net_-_using_the_saxparser-t353.html
What you learn:
You will learn how to properly parse XML
(here: from the net
) using a SAXParser
.
What it will look like:
Description:
0.)
In this tutorial we ......

DataSet序列化输出到XML(并指定输出XML标准)

 public partial class Form1 : Form
    {
        DataSet ds = new DataSet();
        public Form1()
        {
           ......

Expat XML解析器的介绍

互联网发展得很快,都是源自于使用了超文本的表达方式。比如你查看一篇文章,看到不懂的关键字,就可以通过链接去查看它的内容,看完之后再回来接着看原来的东西,这样比较适合学习的方式。使用HTML标记的文本,是结构化储存的,这样的表达方式才可以实现超级连接。由于HTML具有超强的表达能力,也就在互联网上生存下来,那 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号