From 54593a73cb87006735d219dae4162f2641b39263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Wed, 26 Aug 2009 08:47:30 +0000 Subject: [PATCH] [EXAMPLES] * NEW: The DBus Explorer example name is now "DBusExplorer". git-svn-id: svn://localhost/gambas/trunk@2276 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- .../examples/Misc/DBusExplorer/.directory | 2 + examples/examples/Misc/DBusExplorer/.icon.png | Bin 0 -> 7072 bytes examples/examples/Misc/DBusExplorer/.project | 14 ++ examples/examples/Misc/DBusExplorer/.settings | 109 +++++++++ .../DBusExplorer/.src/FVersiongbXML.class | 230 ++++++++++++++++++ .../Misc/DBusExplorer/.src/FVersiongbXML.form | 105 ++++++++ examples/examples/Misc/DBusExplorer/.startup | 13 + examples/examples/Misc/DBusExplorer/Text1 | 88 +++++++ examples/examples/Misc/DBusExplorer/Text2 | 51 ++++ .../examples/Misc/DBusExplorer/dbus22.png | Bin 0 -> 1144 bytes .../examples/Misc/DBusExplorer/dbus64.png | Bin 0 -> 4365 bytes .../examples/Misc/DBusExplorer/method.png | Bin 0 -> 636 bytes .../examples/Misc/DBusExplorer/property.png | Bin 0 -> 704 bytes .../examples/Misc/DBusExplorer/signal.png | Bin 0 -> 778 bytes 14 files changed, 612 insertions(+) create mode 100644 examples/examples/Misc/DBusExplorer/.directory create mode 100644 examples/examples/Misc/DBusExplorer/.icon.png create mode 100644 examples/examples/Misc/DBusExplorer/.project create mode 100644 examples/examples/Misc/DBusExplorer/.settings create mode 100644 examples/examples/Misc/DBusExplorer/.src/FVersiongbXML.class create mode 100644 examples/examples/Misc/DBusExplorer/.src/FVersiongbXML.form create mode 100644 examples/examples/Misc/DBusExplorer/.startup create mode 100644 examples/examples/Misc/DBusExplorer/Text1 create mode 100644 examples/examples/Misc/DBusExplorer/Text2 create mode 100644 examples/examples/Misc/DBusExplorer/dbus22.png create mode 100644 examples/examples/Misc/DBusExplorer/dbus64.png create mode 100644 examples/examples/Misc/DBusExplorer/method.png create mode 100644 examples/examples/Misc/DBusExplorer/property.png create mode 100644 examples/examples/Misc/DBusExplorer/signal.png diff --git a/examples/examples/Misc/DBusExplorer/.directory b/examples/examples/Misc/DBusExplorer/.directory new file mode 100644 index 000000000..06dab1c8a --- /dev/null +++ b/examples/examples/Misc/DBusExplorer/.directory @@ -0,0 +1,2 @@ +[Desktop Entry] +Icon=./.icon.png diff --git a/examples/examples/Misc/DBusExplorer/.icon.png b/examples/examples/Misc/DBusExplorer/.icon.png new file mode 100644 index 0000000000000000000000000000000000000000..c052b8fad76f04704d7369f45bf6eeb4e9d9b038 GIT binary patch literal 7072 zcmV;R8(-v!P){>7IQilgVVVkd-8a9m1Bd2H^@C zL<9j*fi6F=Xt8?sTTY%lj;?(7)r`(kgD7o+WY&#)i<>NJ@pwM z)(`tfNX;i!e?&=jSFpe{y)xusN2cNu;9MZ~LF@cqLBQlIRxgrL{8$%a*=Ls5a`TD? zT6@zh{c`*Sv+{)5cK^Dy0G0ppybodAAYI!^?fl(Csixm&4p;X-H33tudc9gI?og6X zU3gN3aoeXFa1AfN-V6;T1q1^I*(nz+wfom?s$TK83ze(xst9`O(`g;M=8VZS{r+D8 z`%rECQxZ^r^=m#Q^jnnVn~SCu`EL7U12d)+@t2+O+Fo!RSlbN8&n;(FWY)jbtaxde zuItObaLE*Iyrf=UcgI$1Rrj6~fg&J!sJ8y82$=S{wT6=Jl}d3(O~_mIjgL=Z`3dE` z(h85f3hC_rceA!+$kOna*Pgg^Q5m;iJ)NG29XazGyLL6VBx=#TrGWQvZT`~`F#Y;9 zXDh{ziwispKY!jNK6_pbo5S#JDZ+- zE7_0kwF-p4+SdJ*fd6pq{*MzdDWSO=d{x-1{DM#B$wzM1}@a z?0T;iC!OHym)7ygvugOsQz<_7!}hkU>vW_09fVN2^a@+^RRDp*wf{dxz^t1#Rx8E# zlv3B7F)w7?a_MA(Aup@iVP_a@x&Pfv+F{4mF1p)#S#eq=H(zoTZ|^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Cufxg!0#s_~E-}c1w zKr4_1c=gp+S5#G1-R|*t8nW5!mRKzIYCIl))pgys-VfmMb!-O zNPFm=ljf`2=Pz1#cY)75?#lCKOjz%SLI6P3@`o=7R8Rf6X6XKO*QS?xU%u^rnH}B= z3^I0(^xq<mxeW+? zjLoe5x5_0qJ&)IL3S3uZ|L|WIJ1ZYqO?i0*m!CKP@P+?>mj4F_y-JrEkw`ZH0000< KMNUMnLSTXb{s!v+ literal 0 HcmV?d00001 diff --git a/examples/examples/Misc/DBusExplorer/.project b/examples/examples/Misc/DBusExplorer/.project new file mode 100644 index 000000000..45f221c01 --- /dev/null +++ b/examples/examples/Misc/DBusExplorer/.project @@ -0,0 +1,14 @@ +# Gambas Project File 3.0 +# Compiled with Gambas 2.99.0 (r2272) +Title=Gambas DBus Explorer +Startup=FVersiongbXML +Icon=dbus64.png +Version=0.0.1 +Component=gb.gui +Component=gb.form +Component=gb.dbus +Component=gb.settings +Component=gb.form.mdi +Component=gb.xml +Authors="Fabien Bodard\nBenoƮt Minisini" +TabSize=2 diff --git a/examples/examples/Misc/DBusExplorer/.settings b/examples/examples/Misc/DBusExplorer/.settings new file mode 100644 index 000000000..139a7738c --- /dev/null +++ b/examples/examples/Misc/DBusExplorer/.settings @@ -0,0 +1,109 @@ +[Breakpoints] +Count=0 + +[DebugWindow] +Count=0 + +[DebugWindow/$xmlMyDoc] +Geometry=[0,0,210,210] + +[DebugWindow/$xmlMyDoc.Root] +Geometry=[350,29,210,210] + +[DebugWindow/$xmlMyDoc.Root.Attributes] +Geometry=[364,43,210,210] + +[DebugWindow/$xmlMyDoc.Root.Children] +Geometry=[702,60,210,210] + +[DebugWindow/$xmlMyDoc.Root.Children[0]] +Geometry=[612,36,210,210] + +[DebugWindow/$xmlMyDoc.Root.Children[0].Attributes] +Geometry=[730,88,210,210] + +[DebugWindow/$xmlMyDoc.Root.Children[1]] +Geometry=[716,74,433,364] + +[DebugWindow/$xmlMyDoc.Root.Children[1].Attributes] +Geometry=[730,88,229,225] + +[DebugWindow/DBus[Last.current.text]] +Geometry=[0,0,322,306] + +[DebugWindow/DBus[sApplication][sPath]] +Geometry=[0,0,210,210] + +[DebugWindow/Split($Value, "]")] +Geometry=[0,0,494,210] + +[DebugWindow/TreeView1] +ShowHidden=True +Geometry=[0,0,210,210] + +[DebugWindow/aConCat] +Geometry=[0,0,210,210] + +[DebugWindow/aa] +Geometry=[0,0,210,210] + +[DebugWindow/ars] +Geometry=[72,235,210,210] + +[DebugWindow/hApplication.Connection] +Geometry=[0,0,210,210] + +[DebugWindow/hApplication.Connection.Applications] +Geometry=[10,0,210,210] + +[DebugWindow/hInterface.Methods] +Geometry=[0,0,210,210] + +[DebugWindow/hInterface.Methods[0]] +Geometry=[10,0,210,210] + +[DebugWindow/hInterface.Properties] +Geometry=[0,0,210,210] + +[DebugWindow/hInterface.Properties[0]] +Geometry=[10,0,210,210] + +[DebugWindow/hInterface.Properties[0].Args] +Geometry=[228,185,210,210] + +[DebugWindow/hInterface.Properties[0].Args[0]] +Geometry=[360,0,210,210] + +[DebugWindow/hInterface.Signals] +Geometry=[0,0,210,210] + +[DebugWindow/hInterface.Signals[0]] +Geometry=[10,0,210,210] + +[DebugWindow/hInterface.Signals[2]] +Geometry=[10,0,210,210] + +[DebugWindow/hNode.Children] +Geometry=[0,0,210,210] + +[DebugWindow/tblV[0, 0]] +Geometry=[0,0,210,210] + +[DebugWindow/xmlDoc] +Geometry=[0,0,210,210] + +[FFind] +SearchIn="Module" +CaseSensitive=False +SearchWord=False +SearchComment=False +SearchString=True + +[OpenFile] +File[1]="/home/benoit/gambas/3.0/link/share/gambas3/examples/Misc/DBusExplorer/.src/FVersiongbXML.form" +File[2]="/home/benoit/gambas/3.0/link/share/gambas3/examples/Misc/DBusExplorer/.src/FVersiongbXML.class:74.0" +Count=2 + +[Watches] +Count=0 + diff --git a/examples/examples/Misc/DBusExplorer/.src/FVersiongbXML.class b/examples/examples/Misc/DBusExplorer/.src/FVersiongbXML.class new file mode 100644 index 000000000..0e5de073e --- /dev/null +++ b/examples/examples/Misc/DBusExplorer/.src/FVersiongbXML.class @@ -0,0 +1,230 @@ +' Gambas class file + +Private $ColArgs As New Collection +Private $colTypes As New Collection + +Public Sub _new() + + $colTypes["i"] = "Interger" + $colTypes["u"] = "Interger" + $colTypes["s"] = "Interger" + $colTypes["b"] = "Boolean" + $colTypes["y"] = "Byte" + $colTypes["ay"] = "Byte[]" + $colTypes["ai"] = "Integer[]" + $colTypes["as"] = "String[]" + $colTypes["v"] = "Variant" + $colTypes["av"] = "Variant[]" +End + +Public Sub Form_Open() + Me.Raise + btnRefresh_Click + +End + + + +Public Sub ShowPathContent(sPath As String, sBus As String, sApplication As String) + Dim xmlDoc As New XmlDocument + Dim sInterface, sFullDbusPath, s, sAppPath As String + Dim hattr, hattr2, hNode, hNode2 As XmlNode + Dim i, j, k As Integer + Dim aArgs As New String[] + Dim sArgs As String + 'Dim haArgs As New Object[] + + Try xmlDoc.FromString(DBus[sBus & sApplication]._introspect(sPath)) + + If Error Then Return + + For i = 0 To xmlDoc.Root.Children.Count - 1 + hNode = xmlDoc.Root.Children[i] + If hNode.Name = "interface" Then + For Each hattr In hNode.Attributes + sFullDbusPath = [sBus, sApplication, sPath, CStr(hattr.Value)].Join("|") + If Not tvDbus.Exist(sBus & "|" & sApplication & "|" & sPath) Then + tvDbus.Add(sFullDbusPath, hattr.Value) + Else + tvDbus.Add(sFullDbusPath, hattr.Value,, sBus & "|" & sApplication & "|" & sPath) + Endif + + For j = 0 To hNode.Children.Count - 1 + hNode2 = hNode.Children[j] + If hNode2.Name = "method" Or hNode2.Name = "property" Or hNode2.Name = "signal" Then + For Each hattr In hNode2.Attributes + Break + Next + Try tvDbus.Add(sFullDbusPath & "|" & hattr.Value, hattr.Value, Picture[hNode2.Name & ".png"], sFullDbusPath) + If Error Then Continue + For k = 0 To hNode2.Children.Count - 1 + If hNode2.Children[k].Name = "arg" Then + + For Each hattr2 In hNode2.Children[k].Attributes + + aArgs.Add(hattr2.Name & "=" & hattr2.Value) + + Next + + $ColArgs[sFullDbusPath & "|" & hattr.Value] &= aArgs.Join() + + If k < hNode2.Children.Count - 2 Then $ColArgs[sFullDbusPath & "|" & hattr.Value] &= "|" + aArgs.Clear + Endif + Next + + + Endif + + Next + Next + Endif + Next + + + For Each s In DBus[sApplication][sPath].Children + sAppPath = [sBus, sApplication, sPath].join("|") + + If tvDbus.Exist(sAppPath) Then + tvDbus.Add(sAppPath &/ s, s,, sAppPath) + Else + tvDbus.Add(sAppPath &/ s, s) + Endif + tvDbus.Add(sAppPath &/ s & "|child", "child",, sAppPath &/ s) + tvDbus[sAppPath &/ s].Picture = Picture["icon:/medium/directory"] + + Next + + + Catch + Print Error.Text +End + + + + +Public Sub lstb_activate() + tvDbus.Clear + $ColArgs.Clear + ShowPathContent("/", Last.Tag & "://", Last.current.text) + +End + +Public Sub tvDbus_Expand() + Dim ars As String[] + If Not tvDbus.Exist(tvDbus.item.Key & "|" & "child") Then Return + tvDbus.Remove(tvDbus.item.Key & "|" & "child") + ars = Split(tvDbus.Item.Key, "|") + ShowPathContent(ars[2], ars[0], ars[1]) + +End + +Public Sub btnRefresh_Click() + + lstbSystem.Clear + lstbSession.Clear + $ColArgs.Clear + tvDbus.Clear + lstbSession.List = DBus.Session.Applications + lstbSystem.List = DBus.System.Applications + +End + + +Public Sub lstb_DblClick() + + Try Print DBus[Last.current.text]._Introspect("/") + +End + + +Public Function MakeSignature(sKey As String) As String + Dim ars As String[] + Dim ars2 As New String[] + Dim sValue, s, t, sOut As String + ars = Split(skey, "|") + If Not $ColArgs.Exist(skey) Then Return + + + + For Each s In Split($ColArgs[sKey], "|") + + If InStr(s, "=in") Then + sValue &= "Value As " + For Each t In Split(s) + If Scan(t, "*=*")[0] = "type" Then + s = Scan(t, "*=*")[1] + If $colTypes.Exist(s) Then + sValue &= $colTypes[s] + Else + sValue &= s + Endif + Endif + + Next + ars2.Add(sValue) + sValue = "" + Else + For Each t In Split(s) + If Scan(t, "*=*")[0] = "type" Then + s = Scan(t, "*=*")[1] + If $colTypes.Exist(s) Then + sOut &= $colTypes[s] + Else + sOut &= s + Endif + Endif + + Next + sOut = " As " & sOut + Endif + + + Next + sValue = ars[ars.Max] & "(" & ars2.Join(", ") & ")" & sOut + + Return sValue + +End + + +Public Sub tvDbus_Select() + + MakeSignature(Last.item.key) + +End + + + +Public Sub tvDbus_MouseMove() + Dim s As String + Dim ix, iy As Integer + Dim hcont As Object + If Not tvDbus.Find(Mouse.x, Mouse.y) Then + + s = MakeSignature(tvDbus.item.key) + + If IsNull(s) Then + lblsignature.Visible = False + Return + Endif + hcont = tvDbus.Parent + ix = tvDbus.Item.X + tvDbus.Item.w / 2 + iy = tvDbus.Item.Y + + + lblsignature.Text = s + lblsignature.Left = Min(iX, tvDbus.Width - lblsignature.Width) + lblsignature.Y = iY + lblsignature.Visible = True + lblsignature.Refresh + Else + lblsignature.Visible = False + Endif +End + +Public Sub tvDbus_Leave() + + lblsignature.Visible = False + +End diff --git a/examples/examples/Misc/DBusExplorer/.src/FVersiongbXML.form b/examples/examples/Misc/DBusExplorer/.src/FVersiongbXML.form new file mode 100644 index 000000000..4ab24c29a --- /dev/null +++ b/examples/examples/Misc/DBusExplorer/.src/FVersiongbXML.form @@ -0,0 +1,105 @@ +# Gambas Form File 3.0 + +{ Form Form + MoveScaled(0,0,107,84) + Text = ("Gambas DBus Explorer - gb.xml version") + Icon = Picture["dbus64.png"] + Arrangement = Arrange.Vertical + { Panel1 Panel + MoveScaled(3,0,83,4) + Arrangement = Arrange.Horizontal + { btnRefresh ToolButton + MoveScaled(0,0,4,4) + AutoResize = True + Text = ("Refresh") + Picture = Picture["icon:/small/refresh"] + } + { HBox1 HBox + MoveScaled(11,0,52,3) + { Separator1 Separator + MoveScaled(2,0,2,3) + } + { Label4 Label + MoveScaled(7,0,9,3) + Text = ("Legend:") + } + { PictureBox1 PictureBox + MoveScaled(11,0,3,3) + Picture = Picture["method.png"] + Alignment = Align.Center + } + { Label1 Label + MoveScaled(14,0,9,3) + Text = ("Method") + } + { PictureBox2 PictureBox + MoveScaled(23,0,3,3) + Picture = Picture["property.png"] + Alignment = Align.Center + } + { Label2 Label + MoveScaled(28,0,10,3) + Text = ("Property") + } + { PictureBox3 PictureBox + MoveScaled(37,0,3,3) + Picture = Picture["signal.png"] + Alignment = Align.Center + } + { Label3 Label + MoveScaled(41,0,6,3) + Text = ("Signal") + } + } + } + { Separator2 Separator + MoveScaled(20,5,18,0) + } + { HSplit1 HSplit + MoveScaled(0,8,102,74) + Expand = True + { TabStrip3 TabStrip + MoveScaled(2,8,39,57) + Arrangement = Arrange.Fill + Count = 2 + Index = 0 + Text = ("Session") + { lstbSession ListBox lstb + Name = "lstbSession" + MoveScaled(2,1,30,51) + Tag = "session" + Expand = True + } + Index = 1 + Text = ("System") + { lstbSystem ListBox lstb + Name = "lstbSystem" + MoveScaled(3,1,30,50) + Tag = "system" + Expand = True + } + Index = 0 + } + { VBox1 HBox + MoveScaled(43,5,54,65) + Expand = True + { Separator3 Separator + MoveScaled(2,19,0,5) + } + { tvDbus TreeView + MoveScaled(5,6,45,53) + Expand = True + Border = False + } + { lblsignature Label + MoveScaled(0,0,22,3) + Visible = False + Background = Color.LightBackground + Ignore = True + AutoResize = True + Text = ("Label5") + Border = Border.Plain + } + } + } +} diff --git a/examples/examples/Misc/DBusExplorer/.startup b/examples/examples/Misc/DBusExplorer/.startup new file mode 100644 index 000000000..5bb5e7619 --- /dev/null +++ b/examples/examples/Misc/DBusExplorer/.startup @@ -0,0 +1,13 @@ +FVersiongbXML +Gambas DBus Explorer +0 +0 +0.0.1 + +gb.gui +gb.form +gb.dbus +gb.settings +gb.form.mdi +gb.xml + diff --git a/examples/examples/Misc/DBusExplorer/Text1 b/examples/examples/Misc/DBusExplorer/Text1 new file mode 100644 index 000000000..43e68b0a8 --- /dev/null +++ b/examples/examples/Misc/DBusExplorer/Text1 @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/examples/Misc/DBusExplorer/Text2 b/examples/examples/Misc/DBusExplorer/Text2 new file mode 100644 index 000000000..8c7cbf2cc --- /dev/null +++ b/examples/examples/Misc/DBusExplorer/Text2 @@ -0,0 +1,51 @@ +Connected to D-Bus. + +Received reply from :1.2 + Arguments: " " + Connected to D-Bus. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + " \ No newline at end of file diff --git a/examples/examples/Misc/DBusExplorer/dbus22.png b/examples/examples/Misc/DBusExplorer/dbus22.png new file mode 100644 index 0000000000000000000000000000000000000000..9253a28e9b64ec0917077192fdfd6c114c4967bd GIT binary patch literal 1144 zcmV-;1c&>HP)uf28amn++FrK2!hgfh3`BnA|j zo<@xlH71gnm>Bd2V@x#B|3QB+Bt(DG#2BL{#%M75%jv>!LI`6O*c{(RDbT^T_S$ak z^{#il`U_OYxA^+;o%j2Z_veSt+tq9~`M*(BRRBgLNqR*Pgza9hHw<{|^?FX%_4h|d zN7FZZUH5`jRrLTvfk5D8K@fI|qSzga#bRw8;qY9chSO{kkwn&pCFailohz5iukPBl zYXU&H1#$rce!u@kK@dh|S?-o)S#A$Uq8ZI(GPA@~`XaNr61L;C=DI=>2VURNQ#*6| z05H_rSXI>?Ns>PH`~4%)XfzUvL}QoB7E_nJSwI>t`9ZIEAebd(}?Em8&(^pPo+Kqcc9=8j*-A~Z(rBtnRXg0^bojbY~78YIt z_6xya@bmu7slJbXo#D`Ijz~}>F1L}01$lTw7hg}DBUh}hLVKcZyt#WbBO5yj1$=y_ zPV>!?^DNeyE^t)8a_*75VyB~E1W^ozc@s;X``;FNU}fMjQA6$So!)ZDgmP0BYWjMKp;q@^RAur{kme(|`Xc)$EUDrQU z6eZWXZby$EO(*)d4!-l{1WPNm7AUygJkS$nc>NlNlWRyuMOI2htxzZwOw+t>+xD1Y z7(W816h&#hr3H_VkM9hHLf<9&`g_LDT*tH;Z0PKuFBYJ>Tq@=B`TPxNqE@T@0HhT~ zx$8k$b&to!#)c$G`o!n+^#GP-StZ-HkLkMpJ#bu66#H(_t@#IXG|GP~N9Pv+0000< KMNUMnLSTZd`X65a literal 0 HcmV?d00001 diff --git a/examples/examples/Misc/DBusExplorer/dbus64.png b/examples/examples/Misc/DBusExplorer/dbus64.png new file mode 100644 index 0000000000000000000000000000000000000000..8de0df3d98eec6f52d8f24024bbaba2430956608 GIT binary patch literal 4365 zcmV+o5%TVdP)Zb%q(YOH$)IfqZHqfRv(%P}7_NnZ|9(%k< zn#~^1CQ;HXS|~0ODeg-jE_q2xq*lst`UeCN_nvd^xqp7=JKuJw$!4?se}E983pfGX z0~`bn06HK71b|-x&&jfUZadG>{I(J%glGniqmXn0*uBB7mw@MhXJuKQ-t2RKYX}oU z)C2cZAn4G_HWrHohr>Z#T^+TxwMddgI-MpOjWRnsOCS)S=zW)gugJ3e%4X*AsU=JZ zVFW%)fuJEkTim9$wibuOq5kRh`ZdRl$K%Y-&T{+qZNlL&KpOalEX&VqbY7nt!h{f7 zV2}bq_X5V^HU@(Mr_-qtWHcJfjI=&7nG6>%USxiLK7Z*cS(g89BYl6Pgb5+KDG>BI zpuYINPN&0ex2pu1&E|?@h2u$X`IlLYBv_2ZS&SxFiX`Z0uyFU@Cd|fC>C0xbT)A?E z8#iv`FFh^G^0(HT^CwD}5Tb(uK_`Ib;`@>$VYAs(f~;068jYsxScz1ci#Pm?Ow2Rt z@pAcgkW7Vl(MlTnIvTk5Kr>$&a#N!#tZa|R!}aUe0kXg`S(Z<)^$t5qm=K}?_&f!I z_Le+cqfr&L)9J)!vmr@R*|9R&ELUcNj7)eLnV9F|4L^xgded|2X?OC2KfDJ^k;GlN zaDlnGIe-s=!?G-=D)p}_VL}Kqa14c<<3Jx!A|iElbtQ^gr_)s&Z)zc=5agNX?BoLB zSh6bfbi1tl!`D8G%VGi`kw|d*^l8%RG{B>>EWcE#@3sgNLKuL%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{8Lovg?n%3~2Fe4Z!h(q><@TG;RbQz69P z1K$H^Y;2^br>Ek9t@RL##Z-cPKA##DDQ*J1O+kuAWm(=i7h@CH?1|j31OE(Y&1N&Z zcI~3Mxp~cF$)Lomb2BEB z39VL3CX*o&iLku9tSag<_=o~Qzm{cr^Sj4y09!gFpZooZCs1nqyEoWviUL8e%d))l zxw0L=wtt2}2+@y1-0uK(lrr`da0R7)_6&-m9^c+nKOOi#0xv-hZ+P|)00000NkvXX Hu0mjf+s$vY literal 0 HcmV?d00001 diff --git a/examples/examples/Misc/DBusExplorer/method.png b/examples/examples/Misc/DBusExplorer/method.png new file mode 100644 index 0000000000000000000000000000000000000000..d92a9303b97613806e6e83f79664c7844c7494e0 GIT binary patch literal 636 zcmV-?0)zdDP)e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00HDlL_t(I%eB)zYgAzr1mNes zceB~uWaC#%8VMLoWf^Q#M6vb{Sf)rN*a^0Rwl*T-f3UDoL>oo1P#eJyFojA;)I^ir z4SP3x_ukh+4F*vJaSo?C%rJ*x_(vqay}U7H!a<{=;HAX-zmvS-xThW^ACj`#uf}F< z#<4h7He%y(8q*Vhc5vCe1FnYYkk+PZCL5Ec!juUUIyzo^T`XHZvzcsO`$4H}k`zQo3Z&K-)9!Zvnoha|*Hu4QCRxDbyYE>>bV#JW4!%0l`{p?^`A<-eW zqhh_#9qU@&vFt_t1!!t&Y5C}*LXjAl!D40Wff5^7qpX*DwVqG4Px_&6t+A#SYBHH6 zOR_u@yRrP)!2(LT;0xtYDNl3l*w)K>T6@$D&a9uJkOS}2J9sK^RMr=X5126BaSKS=2o{h1}R-r|%f z)khcE_uar}xpi~q-2PSIo5*vsZebtxD+C!j23qb~ciIJa{;o{(c4B6$TGy@nANUG) Ww8}M#EG0000e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00JmUL_t(I%e9lcYZOr!#eetC z%mv{lPj~n}ew^YQ_(zGI4wLs5C#`|OX<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