[DEVELOPMENT ENVIRONMENT]
* BUG: Fix a crash when closing the procedure list with F6. [EXAMPLES] * BUG: Fix the display of method signatures in the DBusExplorer example. [GB.WEB] * NEW: Disable HTTP compression if 'gzip' is not installed. git-svn-id: svn://localhost/gambas/trunk@3134 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
c1a2603c70
commit
e389bcfa9a
13 changed files with 235 additions and 167 deletions
|
@ -278,11 +278,11 @@ msgstr ""
|
|||
msgid "Loading information on component &1..."
|
||||
msgstr ""
|
||||
|
||||
#: CInsertColor.class:103 FEditor.class:3574 FTextEditor.class:912
|
||||
#: CInsertColor.class:103 FEditor.class:3582 FTextEditor.class:912
|
||||
msgid "Insert color"
|
||||
msgstr ""
|
||||
|
||||
#: CModule.class:28 FCreateFile.class:648 FEditor.class:3539 FForm.class:3704
|
||||
#: CModule.class:28 FCreateFile.class:648 FEditor.class:3547 FForm.class:3704
|
||||
#: FInfo.class:88
|
||||
msgid "Form"
|
||||
msgstr ""
|
||||
|
@ -400,23 +400,23 @@ msgstr ""
|
|||
msgid "No terminal emulator found."
|
||||
msgstr ""
|
||||
|
||||
#: FAbout.class:161
|
||||
#: FAbout.class:164
|
||||
msgid "Thanks to"
|
||||
msgstr ""
|
||||
|
||||
#: FAbout.class:513
|
||||
#: FAbout.class:516
|
||||
msgid "About Gambas..."
|
||||
msgstr ""
|
||||
|
||||
#: FAbout.class:521
|
||||
#: FAbout.class:524
|
||||
msgid "About"
|
||||
msgstr ""
|
||||
|
||||
#: FAbout.class:538
|
||||
#: FAbout.class:541
|
||||
msgid "Gambas Almost Means Basic!"
|
||||
msgstr ""
|
||||
|
||||
#: FAbout.class:552
|
||||
#: FAbout.class:555
|
||||
msgid ""
|
||||
"<h2 align=center>Licence</h2>\n"
|
||||
"\n"
|
||||
|
@ -431,23 +431,23 @@ msgid ""
|
|||
"Public License for more details.</p>\n"
|
||||
msgstr ""
|
||||
|
||||
#: FAbout.class:558
|
||||
#: FAbout.class:561
|
||||
msgid "<h2 align=center>Authors</h2>\n"
|
||||
msgstr ""
|
||||
|
||||
#: FAbout.class:582
|
||||
#: FAbout.class:585
|
||||
msgid "Make a gift!"
|
||||
msgstr ""
|
||||
|
||||
#: FAbout.class:594
|
||||
#: FAbout.class:597
|
||||
msgid "Hall Of Fame"
|
||||
msgstr ""
|
||||
|
||||
#: FAbout.class:608
|
||||
#: FAbout.class:611
|
||||
msgid "System information"
|
||||
msgstr ""
|
||||
|
||||
#: FAbout.class:618 FList.class:308 FMain.class:2455
|
||||
#: FAbout.class:621 FList.class:308 FMain.class:2455
|
||||
msgid "&Copy"
|
||||
msgstr ""
|
||||
|
||||
|
@ -509,45 +509,45 @@ msgid ""
|
|||
msgstr ""
|
||||
|
||||
#: FCommit.class:234 FConflict.class:325 FConnectionEditor.class:1808
|
||||
#: FEditor.class:3372 FForm.class:3534 FIconEditor.class:2165
|
||||
#: FEditor.class:3380 FForm.class:3534 FIconEditor.class:2165
|
||||
#: FImageEditor.class:77 FMenu.class:948 FOutput.class:377
|
||||
#: FTextEditor.class:706
|
||||
msgid "Cut"
|
||||
msgstr ""
|
||||
|
||||
#: FCommit.class:240 FConflict.class:331 FConnectionEditor.class:1708
|
||||
#: FEditor.class:3378 FForm.class:3541 FIconEditor.class:2173
|
||||
#: FEditor.class:3386 FForm.class:3541 FIconEditor.class:2173
|
||||
#: FImageEditor.class:86 FMenu.class:954 FOutput.class:384
|
||||
#: FTextEditor.class:713
|
||||
msgid "Copy"
|
||||
msgstr ""
|
||||
|
||||
#: FCommit.class:246 FConflict.class:337 FConnectionEditor.class:1829
|
||||
#: FEditor.class:3385 FForm.class:3554 FIconEditor.class:2181
|
||||
#: FEditor.class:3393 FForm.class:3554 FIconEditor.class:2181
|
||||
#: FImageEditor.class:95 FMenu.class:960 FOutput.class:391
|
||||
#: FTextEditor.class:720
|
||||
msgid "Paste"
|
||||
msgstr ""
|
||||
|
||||
#: FCommit.class:252 FConflict.class:343 FConnectionEditor.class:1836
|
||||
#: FEditor.class:3356 FForm.class:3779 FIconEditor.class:2149
|
||||
#: FEditor.class:3364 FForm.class:3779 FIconEditor.class:2149
|
||||
#: FImageEditor.class:104 FOption.class:1494 FOutput.class:360
|
||||
#: FTextEditor.class:689
|
||||
msgid "Undo"
|
||||
msgstr ""
|
||||
|
||||
#: FCommit.class:258 FConflict.class:349 FConnectionEditor.class:1843
|
||||
#: FEditor.class:3363 FForm.class:3789 FImageEditor.class:112
|
||||
#: FEditor.class:3371 FForm.class:3789 FImageEditor.class:112
|
||||
#: FOutput.class:367 FTextEditor.class:696
|
||||
msgid "Redo"
|
||||
msgstr ""
|
||||
|
||||
#: FCommit.class:264 FConflict.class:355 FEditor.class:3600 FMenu.class:970
|
||||
#: FCommit.class:264 FConflict.class:355 FEditor.class:3608 FMenu.class:970
|
||||
#: FTextEditor.class:871
|
||||
msgid "Indent"
|
||||
msgstr ""
|
||||
|
||||
#: FCommit.class:270 FConflict.class:361 FEditor.class:3608 FMenu.class:976
|
||||
#: FCommit.class:270 FConflict.class:361 FEditor.class:3616 FMenu.class:976
|
||||
#: FTextEditor.class:878
|
||||
msgid "Unindent"
|
||||
msgstr ""
|
||||
|
@ -693,7 +693,7 @@ msgstr ""
|
|||
msgid "The table '&1' has been modified. Do you want to save it?"
|
||||
msgstr ""
|
||||
|
||||
#: FConnectionEditor.class:261 FEditor.class:3490 FForm.class:3695
|
||||
#: FConnectionEditor.class:261 FEditor.class:3498 FForm.class:3695
|
||||
#: FIconEditor.class:1415 FImageEditor.class:60 FTextEditor.class:790
|
||||
msgid "Save"
|
||||
msgstr ""
|
||||
|
@ -1247,115 +1247,115 @@ msgstr ""
|
|||
msgid "(Declarations)"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3292
|
||||
#: FEditor.class:3300
|
||||
msgid "Go to"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3297 FTextEditor.class:680
|
||||
#: FEditor.class:3305 FTextEditor.class:680
|
||||
msgid "Go to line..."
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3303
|
||||
#: FEditor.class:3311
|
||||
msgid "Find definition"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3310 FHelpBrowser.class:271
|
||||
#: FEditor.class:3318 FHelpBrowser.class:271
|
||||
msgid "Go back"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3317
|
||||
#: FEditor.class:3325
|
||||
msgid "Open form"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3324 FForm.class:3466 FMain.class:2495
|
||||
#: FEditor.class:3332 FForm.class:3466 FMain.class:2495
|
||||
msgid "&Startup class"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3332
|
||||
#: FEditor.class:3340
|
||||
msgid "Run &until current line"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3339
|
||||
#: FEditor.class:3347
|
||||
msgid "Toggle &breakpoint"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3347
|
||||
#: FEditor.class:3355
|
||||
msgid "&Watch expression"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3392
|
||||
#: FEditor.class:3400
|
||||
msgid "Paste special..."
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3398 FTextEditor.class:727
|
||||
#: FEditor.class:3406 FTextEditor.class:727
|
||||
msgid "Insert color..."
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3407 FTextEditor.class:736
|
||||
#: FEditor.class:3415 FTextEditor.class:736
|
||||
msgid "Select &All"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3416
|
||||
#: FEditor.class:3424
|
||||
msgid "Comment"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3423
|
||||
#: FEditor.class:3431
|
||||
msgid "Uncomment"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3433 FOutput.class:408 FTextEditor.class:745
|
||||
#: FEditor.class:3441 FOutput.class:408 FTextEditor.class:745
|
||||
msgid "Find next"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3440 FOutput.class:415 FTextEditor.class:752
|
||||
#: FEditor.class:3448 FOutput.class:415 FTextEditor.class:752
|
||||
msgid "Find previous"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3449 FTextEditor.class:761
|
||||
#: FEditor.class:3457 FTextEditor.class:761
|
||||
msgid "View"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3453 FTextEditor.class:765
|
||||
#: FEditor.class:3461 FTextEditor.class:765
|
||||
msgid "No split"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3460 FTextEditor.class:772
|
||||
#: FEditor.class:3468 FTextEditor.class:772
|
||||
msgid "Horizontal split"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3467 FTextEditor.class:779
|
||||
#: FEditor.class:3475 FTextEditor.class:779
|
||||
msgid "Vertical split"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3478
|
||||
#: FEditor.class:3486
|
||||
msgid "Make code pretty"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3500 FPasteSpecial.class:253
|
||||
#: FEditor.class:3508 FPasteSpecial.class:253
|
||||
msgid "Paste as string"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3505 FPasteSpecial.class:258
|
||||
#: FEditor.class:3513 FPasteSpecial.class:258
|
||||
msgid "Paste as multi-line string"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3510 FPasteSpecial.class:243
|
||||
#: FEditor.class:3518 FPasteSpecial.class:243
|
||||
msgid "Paste as comments"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3517 FOption.class:1118
|
||||
#: FEditor.class:3525 FOption.class:1118
|
||||
msgid "Editor"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3667
|
||||
#: FEditor.class:3675
|
||||
msgid "Toggle breakpoint"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3676
|
||||
#: FEditor.class:3684
|
||||
msgid "Watch expression"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3688
|
||||
#: FEditor.class:3696
|
||||
msgid "Procedure list"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -83,10 +83,10 @@ Public Sub Menu_Show()
|
|||
hMenu = New Menu($hMenu) As "MenuColor"
|
||||
hMenu.Text = Replace(sDigit, "&", "&&")
|
||||
hMenu.Tag = sDigit
|
||||
hImage = New Image(16, 16)
|
||||
hImage.FillRect(0, 0, 16, 16, Color.Black)
|
||||
hImage = New Image(12, 12)
|
||||
hImage.FillRect(0, 0, hImage.W, hImage.H, &H808080)
|
||||
iColor = Val("&H" & Mid$(sDigit, Len($sPattern) + 1) & "&")
|
||||
hImage.FillRect(1, 1, 14, 14, iColor)
|
||||
hImage.FillRect(1, 1, hImage.W - 2, hImage.H - 2, iColor)
|
||||
hMenu.Picture = hImage.Picture
|
||||
Next
|
||||
|
||||
|
|
|
@ -850,7 +850,7 @@ Public Sub Editors_KeyPress()
|
|||
|
||||
If Key.Code = Key.F6 Then
|
||||
|
||||
btnProc_MouseDown
|
||||
ToggleProcList
|
||||
Stop Event
|
||||
|
||||
Else If Key.Code = Key.F2 Then
|
||||
|
@ -2955,13 +2955,13 @@ Private Sub ResizeProcList()
|
|||
|
||||
End
|
||||
|
||||
Public Sub btnProc_MouseDown()
|
||||
Private Sub ToggleProcList()
|
||||
|
||||
|
||||
Dim iCurrent As Integer
|
||||
Dim nRow As Integer
|
||||
|
||||
If Not btnProc.Enabled Then Return
|
||||
If Not Mouse.Left Then Return
|
||||
|
||||
If panProc.Visible Then
|
||||
|
||||
|
@ -2990,6 +2990,14 @@ Public Sub btnProc_MouseDown()
|
|||
|
||||
End
|
||||
|
||||
|
||||
Public Sub btnProc_MouseDown()
|
||||
|
||||
If Not Mouse.Left Then Return
|
||||
ToggleProcList
|
||||
|
||||
End
|
||||
|
||||
Public Sub gvwProc_LostFocus()
|
||||
|
||||
panProc.Hide
|
||||
|
@ -3065,7 +3073,7 @@ Public Sub gvwProc_KeyPress()
|
|||
gvwProc_Click
|
||||
Stop Event
|
||||
Else If Key.Code = Key.F6 Then
|
||||
btnProc_MouseDown
|
||||
ToggleProcList
|
||||
Stop Event
|
||||
Endif
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ Public Sub Form_Open()
|
|||
Dim sText As String
|
||||
Dim hImage As Image
|
||||
Dim Y As Integer
|
||||
Dim E As Float
|
||||
|
||||
$hWelcome = New CWelcome(dwgWelcome)
|
||||
|
||||
|
@ -44,12 +45,14 @@ Public Sub Form_Open()
|
|||
|
||||
hImage = New Image(picGradientTop.W, picGradientTop.H)
|
||||
For Y = 0 To hImage.H - 1
|
||||
hImage.FillRect(0, Y, hImage.W, 1, Color.RGB(255, 255, 255, Y * 255 / hImage.H))
|
||||
E = (Y / hImage.H)
|
||||
hImage.FillRect(0, Y, hImage.W, 1, Color.RGB(255, 255, 255, E * 255))
|
||||
Next
|
||||
picGradientTop.Picture = hImage.Picture
|
||||
|
||||
For Y = 0 To hImage.H - 1
|
||||
hImage.FillRect(0, Y, hImage.W, 1, Color.RGB(255, 255, 255, 255 - (Y * 255 / hImage.H)))
|
||||
E = 1 - (Y / hImage.H)
|
||||
hImage.FillRect(0, Y, hImage.W, 1, Color.RGB(255, 255, 255, E * 255))
|
||||
Next
|
||||
picGradientBottom.Picture = hImage.Picture
|
||||
|
||||
|
|
|
@ -66,10 +66,10 @@
|
|||
Picture = Picture["img/donate.png"]
|
||||
}
|
||||
{ picGradientTop PictureBox
|
||||
MoveScaled(0,1,79,5)
|
||||
MoveScaled(0,1,79,7)
|
||||
}
|
||||
{ picGradientBottom PictureBox
|
||||
MoveScaled(0,38,79,5)
|
||||
MoveScaled(0,35,79,7)
|
||||
}
|
||||
Index = 1
|
||||
Text = ("Hall Of Fame")
|
||||
|
|
|
@ -65,6 +65,7 @@
|
|||
2 Eloy Velázquez López
|
||||
2 Reza Salari
|
||||
2 Vincenzo Domenico Femia
|
||||
2 Yannick Butin
|
||||
2 Brice Vidal
|
||||
2 Mathew Rule
|
||||
2 Daniel Reumerman
|
||||
|
|
|
@ -105,9 +105,11 @@ Public Sub End()
|
|||
sFile = Temp$("response")
|
||||
|
||||
If Split(CGI["HTTP_ACCEPT_ENCODING"], ",").Exist("gzip") Then
|
||||
AddHeader("Content-Encoding", "gzip")
|
||||
Exec ["gzip", "-9", sFile] Wait
|
||||
sFile &= ".gz"
|
||||
If Stat(sFile).Size >= 128 Then
|
||||
AddHeader("Content-Encoding", "gzip")
|
||||
Exec ["gzip", "-9", sFile] Wait
|
||||
If Exist(sFile & ".gz") Then sFile &= ".gz"
|
||||
Endif
|
||||
Endif
|
||||
|
||||
$hFile = Open sFile For Read
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Gambas Project File 3.0
|
||||
# Compiled with Gambas 2.99.0 (r3015)
|
||||
# Compiled with Gambas 2.99.0 (r3125)
|
||||
Title=Gambas DBus Explorer
|
||||
Startup=FVersiongbXML
|
||||
Icon=dbus64.png
|
||||
|
|
|
@ -101,8 +101,8 @@ SearchString=True
|
|||
|
||||
[OpenFile]
|
||||
Active=1
|
||||
File[1]="/home/benoit/gambas/3.0/link/share/gambas3/examples/Automation/DBusExplorer/.src/FVersiongbXML.form"
|
||||
File[2]="/home/benoit/gambas/3.0/link/share/gambas3/examples/Automation/DBusExplorer/.src/FVersiongbXML.class:132.46"
|
||||
File[1]=".src/FVersiongbXML.form"
|
||||
File[2]=".src/FVersiongbXML.class:154.0"
|
||||
Count=2
|
||||
|
||||
[Watches]
|
||||
|
|
|
@ -1,22 +1,21 @@
|
|||
' Gambas class file
|
||||
|
||||
Private $ColArgs As New Collection
|
||||
Private $colTypes As New Collection
|
||||
Private $cArgs As New Collection
|
||||
Private $cType As New Collection
|
||||
|
||||
Public Sub _new()
|
||||
|
||||
$colTypes["i"] = "Integer"
|
||||
$colTypes["u"] = "Integer"
|
||||
$colTypes["s"] = "String"
|
||||
$colTypes["o"] = "DBusObject"
|
||||
$colTypes["b"] = "Boolean"
|
||||
$colTypes["y"] = "Byte"
|
||||
$colTypes["ay"] = "Byte[]"
|
||||
$colTypes["ai"] = "Integer[]"
|
||||
$colTypes["as"] = "String[]"
|
||||
$colTypes["v"] = "Variant"
|
||||
$colTypes["av"] = "Variant[]"
|
||||
$colTypes["ao"] = "DBusObject[]"
|
||||
|
||||
$cType["i"] = "Integer"
|
||||
$cType["u"] = "Integer"
|
||||
$cType["s"] = "String"
|
||||
$cType["o"] = "DBusObject"
|
||||
$cType["b"] = "Boolean"
|
||||
$cType["y"] = "Byte"
|
||||
$cType["v"] = "Variant"
|
||||
$cType["d"] = "Float"
|
||||
$cType["n"] = "Short"
|
||||
$cType["x"] = "Long"
|
||||
$cType["a{sv}"] = "Collection"
|
||||
|
||||
End
|
||||
|
||||
|
@ -35,15 +34,16 @@ Public Sub ShowPathContent(sPath As String, sBus As String, sApplication As Stri
|
|||
Dim aArgs As New String[]
|
||||
Dim sArgs As String
|
||||
Dim sIntr As String
|
||||
|
||||
'Dim haArgs As New Object[]
|
||||
|
||||
sIntr = DBus[sBus & sApplication]._Introspect(sPath)
|
||||
Print sIntr
|
||||
Try xmlDoc.FromString(sIntr)
|
||||
|
||||
If Error Then Return
|
||||
|
||||
For i = 0 To xmlDoc.Root.Children.Count - 1
|
||||
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
|
||||
|
@ -53,39 +53,37 @@ Public Sub ShowPathContent(sPath As String, sBus As String, sApplication As Stri
|
|||
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
|
||||
For Each hattr In hNode2.Attributes
|
||||
Break
|
||||
Next
|
||||
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] &= "|"
|
||||
$cArgs[sFullDbusPath & "|" & hattr.Value] &= aArgs.Join()
|
||||
|
||||
If k < hNode2.Children.Count - 2 Then $cArgs[sFullDbusPath & "|" & hattr.Value] &= "|"
|
||||
aArgs.Clear
|
||||
Endif
|
||||
Next
|
||||
|
||||
|
||||
Endif
|
||||
|
||||
|
||||
Next
|
||||
Next
|
||||
Endif
|
||||
Next
|
||||
|
||||
Next
|
||||
|
||||
For Each s In DBus[sApplication][sPath].Children
|
||||
sAppPath = [sBus, sApplication, sPath].join("|")
|
||||
|
@ -97,111 +95,149 @@ Public Sub ShowPathContent(sPath As String, sBus As String, sApplication As Stri
|
|||
Endif
|
||||
tvDbus.Add(sAppPath &/ s & "|child", "child",, sAppPath &/ s)
|
||||
tvDbus[sAppPath &/ s].Picture = Picture["icon:/small/directory"]
|
||||
|
||||
|
||||
Next
|
||||
|
||||
Catch
|
||||
Print Error.Text
|
||||
|
||||
|
||||
Catch
|
||||
Print Error.Text
|
||||
End
|
||||
|
||||
|
||||
|
||||
|
||||
Public Sub lstb_activate()
|
||||
tvDbus.Clear
|
||||
$ColArgs.Clear
|
||||
ShowPathContent("/", Last.Tag & "://", Last.current.text)
|
||||
|
||||
tvDbus.Clear
|
||||
$cArgs.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
|
||||
|
||||
Private Sub RemoveIds(aList As String[])
|
||||
|
||||
Dim iInd As Integer
|
||||
|
||||
While iInd < aList.Count
|
||||
If Left(aList[iInd]) = ":" Then
|
||||
aList.Remove(iInd)
|
||||
Else
|
||||
Inc iInd
|
||||
Endif
|
||||
Wend
|
||||
|
||||
End
|
||||
|
||||
|
||||
Public Sub btnRefresh_Click()
|
||||
|
||||
|
||||
Dim aList As String[]
|
||||
|
||||
lstbSystem.Clear
|
||||
lstbSession.Clear
|
||||
$ColArgs.Clear
|
||||
$cArgs.Clear
|
||||
tvDbus.Clear
|
||||
lstbSession.List = DBus.Session.Applications.Sort(gb.Natural)
|
||||
lstbSystem.List = DBus.System.Applications.Sort(gb.Natural)
|
||||
|
||||
|
||||
aList = DBus.Session.Applications.Sort(gb.Natural)
|
||||
If Not btnShowId.Value Then RemoveIds(aList)
|
||||
lstbSession.List = aList
|
||||
aList = DBus.System.Applications.Sort(gb.Natural)
|
||||
If Not btnShowId.Value Then RemoveIds(aList)
|
||||
lstbSystem.List = aList
|
||||
|
||||
End
|
||||
|
||||
|
||||
Public Sub lstb_DblClick()
|
||||
|
||||
|
||||
Try Print DBus[Last.current.text]._Introspect("/")
|
||||
|
||||
End
|
||||
|
||||
Private Sub GetType(sType As String) As String
|
||||
|
||||
If $cType.Exist(sType) Then Return $cType[sType]
|
||||
|
||||
If Left(sType) = "a" Then Return GetType(Mid$(sType, 2)) & "[]"
|
||||
|
||||
Return "Variant"
|
||||
|
||||
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
|
||||
Dim s, t, sOut As String
|
||||
Dim aArg As String[]
|
||||
Dim sName, sType As String
|
||||
Dim iArg As Integer
|
||||
|
||||
ars = Split(skey, "|")
|
||||
If Not $ColArgs.Exist(skey) Then Return
|
||||
|
||||
|
||||
|
||||
For Each s In Split($ColArgs[sKey], "|")
|
||||
|
||||
If InStr(s, "=out") Then
|
||||
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
|
||||
If Not $cArgs.Exist(skey) Then
|
||||
If ars.Max = 4 Then
|
||||
Return ars[ars.Max] & "()"
|
||||
Else
|
||||
sValue &= "Value As "
|
||||
Return
|
||||
Endif
|
||||
Endif
|
||||
|
||||
For Each s In Split($cArgs[sKey], "|")
|
||||
|
||||
Inc iArg
|
||||
|
||||
If InStr(s, "=out") Then
|
||||
|
||||
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
|
||||
|
||||
sType = GetType(s)
|
||||
Endif
|
||||
Next
|
||||
ars2.Add(sValue)
|
||||
sValue = ""
|
||||
|
||||
If Not sOut Then
|
||||
sOut = " As " & sType
|
||||
Else
|
||||
sOut = " As Variant[]"
|
||||
Endif
|
||||
|
||||
Else
|
||||
sName = "Arg" & CStr(iArg)
|
||||
For Each t In Split(s)
|
||||
aArg = Scan(t, "*=*")
|
||||
Select Case aArg[0]
|
||||
Case "type"
|
||||
sType = GetType(aArg[1])
|
||||
Case "name"
|
||||
sName = aArg[1]
|
||||
End Select
|
||||
Next
|
||||
ars2.Add(sName & " As " & sType)
|
||||
|
||||
Endif
|
||||
|
||||
|
||||
|
||||
Next
|
||||
sValue = ars[ars.Max] & "(" & ars2.Join(", ") & ")" & sOut
|
||||
|
||||
Return sValue
|
||||
Return ars[ars.Max] & "(" & ars2.Join(", ") & ")" & sOut
|
||||
|
||||
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
|
||||
|
@ -209,7 +245,7 @@ Public Sub tvDbus_MouseMove()
|
|||
If Not tvDbus.Find(Mouse.x, Mouse.y) Then
|
||||
|
||||
s = MakeSignature(tvDbus.item.key)
|
||||
|
||||
|
||||
hcont = tvDbus.Parent
|
||||
ix = tvDbus.Item.X + tvDbus.Item.w / 2
|
||||
iy = tvDbus.Item.Y
|
||||
|
@ -219,10 +255,15 @@ Public Sub tvDbus_MouseMove()
|
|||
'lblsignature.Y = iY
|
||||
'lblsignature.Visible = True
|
||||
'lblsignature.Refresh
|
||||
'Else
|
||||
'Else
|
||||
'lblsignature.Visible = False
|
||||
Endif
|
||||
lblsignature.Text = s
|
||||
|
||||
End
|
||||
|
||||
Public Sub btnShowId_Click()
|
||||
|
||||
btnRefresh_Click
|
||||
|
||||
End
|
||||
|
|
|
@ -6,16 +6,23 @@
|
|||
Icon = Picture["dbus64.png"]
|
||||
Arrangement = Arrange.Vertical
|
||||
{ Panel1 Panel
|
||||
MoveScaled(3,0,83,4)
|
||||
MoveScaled(3,0,102,4)
|
||||
Arrangement = Arrange.Horizontal
|
||||
{ btnRefresh ToolButton
|
||||
MoveScaled(0,0,7,4)
|
||||
MoveScaled(0,0,11,4)
|
||||
AutoResize = True
|
||||
Text = ("Refresh")
|
||||
Picture = Picture["icon:/small/refresh"]
|
||||
}
|
||||
{ btnShowId ToolButton
|
||||
MoveScaled(12,0,14,4)
|
||||
AutoResize = True
|
||||
Text = ("Show bus ids")
|
||||
Picture = Picture["icon:/small/lamp"]
|
||||
Toggle = True
|
||||
}
|
||||
{ HBox1 HBox
|
||||
MoveScaled(11,0,52,3)
|
||||
MoveScaled(47,0,52,3)
|
||||
Spacing = True
|
||||
{ Separator1 Separator
|
||||
MoveScaled(2,0,0,3)
|
||||
|
@ -105,11 +112,11 @@
|
|||
{ Separator4 Separator
|
||||
MoveScaled(12,45,23,0)
|
||||
}
|
||||
{ lblsignature Label
|
||||
{ lblsignature TextLabel
|
||||
MoveScaled(5,49,34,3)
|
||||
Font = Font["Monospace,-2"]
|
||||
Background = Color.LightBackground
|
||||
AutoResize = True
|
||||
Text = ("")
|
||||
Padding = 4
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,14 +36,14 @@ SearchComment=False
|
|||
SearchString=True
|
||||
|
||||
[OpenFile]
|
||||
File[1]="/home/benoit/gambas/3.0/trunk/gb.dbus/src/gb.dbus/.src/MMain.module:25.2"
|
||||
File[2]="/home/benoit/gambas/3.0/trunk/gb.dbus/src/gb.dbus/.src/DBusApplication.class:76.2"
|
||||
File[3]="/home/benoit/gambas/3.0/trunk/gb.dbus/src/gb.dbus/.src/DBus.class:9.0"
|
||||
File[4]="/home/benoit/gambas/3.0/trunk/gb.dbus/src/gb.dbus/.src/DBusProxy.class:159.28"
|
||||
File[5]="/home/benoit/gambas/3.0/trunk/gb.dbus/src/gb.dbus/.src/DBusObject.class:360.2"
|
||||
Active=6
|
||||
File[6]="/home/benoit/gambas/3.0/trunk/gb.dbus/src/gb.dbus/.src/CTest.class:16.0"
|
||||
File[7]="/home/benoit/gambas/3.0/trunk/gb.dbus/src/gb.dbus/.src/DBusSignal.class:18.3"
|
||||
Active=1
|
||||
File[1]=".src/MMain.module:34.28"
|
||||
File[2]=".src/DBusApplication.class:76.2"
|
||||
File[3]=".src/DBus.class:9.0"
|
||||
File[4]=".src/DBusProxy.class:159.28"
|
||||
File[5]=".src/DBusObject.class:360.2"
|
||||
File[6]=".src/CTest.class:16.0"
|
||||
File[7]=".src/DBusSignal.class:18.3"
|
||||
Count=7
|
||||
|
||||
[Watches]
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
Public Sub Main()
|
||||
|
||||
Dim aVal As Variant[]
|
||||
|
||||
'DBus["org.kde.kmail"]["/kmail/kmail_mainwindow_1"].geometry = [0, 24, 1024, 768] '.Get("", "rect")
|
||||
'aRect = DBus["org.kde.kmail"]["/kmail/kmail_mainwindow_1", "com.trolltech.Qt.QWidget"].geometry
|
||||
'Get("com.trolltech.Qt.QWidget", "rect")
|
||||
|
@ -21,11 +23,15 @@ Public Sub Main()
|
|||
|
||||
'Print DBus.Session._Name
|
||||
'Dim hTest As CTest = CTest
|
||||
DBus.Session.Register(CTest, "/Test")
|
||||
|
||||
'DBus.Session.Register(CTest, "/Test")
|
||||
|
||||
'Print DBus.Session.Applications
|
||||
|
||||
'DBus["org.kde.kmail"]["/kmail/kmail_mainwindow_1"].geometry = [0, 24, 1024, 768]
|
||||
'Print DBus["org.gambas.gb.dbus"]["/Test"].Compute(5, 7)
|
||||
|
||||
aVal = DBus["org.freedesktop.Notifications"]["/org/freedesktop/Notifications"].GetServerInformation()
|
||||
Print aVal[0];; aVal[1];; aVal[2]
|
||||
|
||||
End
|
||||
|
|
Loading…
Reference in a new issue