diff --git a/app/src/gambas3/.src/Project.module b/app/src/gambas3/.src/Project.module index e25bfad26..e949ed194 100644 --- a/app/src/gambas3/.src/Project.module +++ b/app/src/gambas3/.src/Project.module @@ -1730,17 +1730,17 @@ Private Sub IsTextFile(sPath As String) As Boolean While sStr sCar = String.Left(sStr) + sStr = Mid$(sStr, Len(sCar) + 1) If Not sCar Then Break If Len(sCar) = 1 Then iCode = Asc(sCar) If iCode = &HFE Then Return False If iCode = &HFF Then Return False - If iCode < 32 And If iCode <> 10 And If iCode <> 7 Then Return False - Else + If iCode < 32 And If iCode <> 10 And If iCode <> 9 Then Return False + Else If sStr Then Try sTest = Conv(sCar, "UTF-8", "UCS-4LE") Endif If Error Then Return False - sStr = Mid$(sStr, Len(sCar) + 1) Wend Return True diff --git a/app/src/gambas3/install/Makefile.am b/app/src/gambas3/install/Makefile.am index 4eef186df..5238446ce 100644 --- a/app/src/gambas3/install/Makefile.am +++ b/app/src/gambas3/install/Makefile.am @@ -27,10 +27,10 @@ install-exec-local: echo "Installing $(PACKAGE).list in $(GBINFO_path)"; \ $(INSTALL) .list $(DESTDIR)$(prefix)/$(GBINFO_path)/$(PACKAGE).list; \ chmod a-x $(DESTDIR)$(prefix)/$(GBINFO_path)/$(PACKAGE).list; \ - if test -d control; then \ + if test -d .hidden/control; then \ echo "Installing controls in $(GBCONTROL_path)"; \ $(INSTALL) -d $(DESTDIR)$(prefix)/$(GBCONTROL_path)/$(PACKAGE); \ - $(INSTALL) control/*.png $(DESTDIR)$(prefix)/$(GBCONTROL_path)/$(PACKAGE); \ + $(INSTALL) .hidden/control/*.png $(DESTDIR)$(prefix)/$(GBCONTROL_path)/$(PACKAGE); \ chmod a-x $(DESTDIR)$(prefix)/$(GBCONTROL_path)/$(PACKAGE)/*.png; \ fi \ else \ diff --git a/examples/examples/Automation/DBusExplorer/.project b/examples/examples/Automation/DBusExplorer/.project index 0f4f12ff7..724a5f942 100644 --- a/examples/examples/Automation/DBusExplorer/.project +++ b/examples/examples/Automation/DBusExplorer/.project @@ -1,5 +1,5 @@ # Gambas Project File 3.0 -# Compiled with Gambas 2.99.1 +# Compiled with Gambas 2.99.6 Title=Gambas DBus Explorer Startup=FVersiongbXML Icon=dbus64.png diff --git a/examples/examples/Automation/DBusExplorer/.settings b/examples/examples/Automation/DBusExplorer/.settings index e8c772ae3..35addf3fa 100644 --- a/examples/examples/Automation/DBusExplorer/.settings +++ b/examples/examples/Automation/DBusExplorer/.settings @@ -101,7 +101,7 @@ SearchString=True [OpenFile] Active=1 -File[1]=".src/FVersiongbXML.class:10.11" +File[1]=".src/FVersiongbXML.class:34.14" File[2]=".src/FVersiongbXML.form" Count=2 diff --git a/gb.dbus/src/c_dbusobserver.c b/gb.dbus/src/c_dbusobserver.c index 469bdb954..d29e997bb 100644 --- a/gb.dbus/src/c_dbusobserver.c +++ b/gb.dbus/src/c_dbusobserver.c @@ -73,8 +73,24 @@ static void update_match(CDBUSOBSERVER *_object, bool noerr) char *match = NULL; DBusError error; - if (THIS->type >= 0 && THIS->type <= 3) - match = add_rule(match, "type", type[THIS->type]); + switch(THIS->type) + { + case DBUS_MESSAGE_TYPE_METHOD_CALL: + match = add_rule(match, "type", "method_call"); + break; + case DBUS_MESSAGE_TYPE_METHOD_RETURN: + match = add_rule(match, "type", "method_return"); + break; + case DBUS_MESSAGE_TYPE_SIGNAL: + match = add_rule(match, "type", "signal"); + break; + case DBUS_MESSAGE_TYPE_ERROR: + match = add_rule(match, "type", "error"); + break; + default: + GB.Error("Invalid message type"); + return; + } match = add_rule(match, "path", THIS->object); match = add_rule(match, "member", THIS->member); @@ -89,6 +105,8 @@ static void update_match(CDBUSOBSERVER *_object, bool noerr) if (THIS->enabled) { + if (DBUS_Debug) + fprintf(stderr, "gb.dbus: add match: %s\n", match); dbus_bus_add_match(THIS->connection, match, &error); if (dbus_error_is_set(&error)) { @@ -98,6 +116,8 @@ static void update_match(CDBUSOBSERVER *_object, bool noerr) } else { + if (DBUS_Debug) + fprintf(stderr, "gb.dbus: remove match: %s\n", match); dbus_bus_remove_match(THIS->connection, match, &error); if (dbus_error_is_set(&error)) { @@ -106,7 +126,7 @@ static void update_match(CDBUSOBSERVER *_object, bool noerr) } } - dbus_bus_flush_connection(THIS->connection); + dbus_connection_flush(THIS->connection); GB.FreeString(&match); } @@ -133,6 +153,9 @@ BEGIN_METHOD(DBusObserver_new, GB_OBJECT connection; GB_INTEGER type; GB_STRING DBUS_observers = THIS; + THIS->enabled = TRUE; + update_match(THIS, FALSE); + END_METHOD BEGIN_METHOD_VOID(DBusObserver_free) diff --git a/gb.dbus/src/gb.dbus/.project b/gb.dbus/src/gb.dbus/.project index da4010b10..0c978b013 100644 --- a/gb.dbus/src/gb.dbus/.project +++ b/gb.dbus/src/gb.dbus/.project @@ -1,8 +1,8 @@ # Gambas Project File 3.0 -# Compiled with Gambas 2.99.1 +# Compiled with Gambas 2.99.6 Title=gb.dbus Startup=MMain -Version=2.99.1 +Version=2.99.6 VersionProgram=gbx3 -V Component=gb.dbus TabSize=2 diff --git a/gb.dbus/src/gb.dbus/.settings b/gb.dbus/src/gb.dbus/.settings index 295fef12a..7d3e7556b 100644 --- a/gb.dbus/src/gb.dbus/.settings +++ b/gb.dbus/src/gb.dbus/.settings @@ -36,14 +36,14 @@ SearchComment=False SearchString=True [OpenFile] -File[1]=".src/MMain.module:30.2" +Active=1 +File[1]=".src/MMain.module:45.0" File[2]=".src/DBusApplication.class:74.2" -File[3]=".src/DBus.class:9.0" +File[3]=".src/DBus.class:11.2" File[4]=".src/DBusProxy.class:154.0" -File[5]=".src/DBusObject.class:390.7" +File[5]=".src/DBusObject.class:95.28" File[6]=".src/CTest.class:11.2" -Active=7 -File[7]=".src/DBusSignal.class:18.3" +File[7]=".src/DBusSignal.class:9.0" Count=7 [Watches] diff --git a/gb.dbus/src/gb.dbus/.src/DBusSignal.class b/gb.dbus/src/gb.dbus/.src/DBusSignal.class index d3ce7ee79..3b59628aa 100644 --- a/gb.dbus/src/gb.dbus/.src/DBusSignal.class +++ b/gb.dbus/src/gb.dbus/.src/DBusSignal.class @@ -6,9 +6,9 @@ Event Signal(Signal As String, Arguments As Variant[]) Private $hObserver As DBusObserver -Public Sub _new(Connection As DBusConnection, Interface As String) +Public Sub _new(Connection As DBusConnection, Interface As String, Optional Every As Boolean) - $hObserver = New DBusObserver(Connection, DBus.Signal, "", "", Interface) As "DBusObserver" + $hObserver = New DBusObserver(Connection, DBus.Signal, "", "", Interface, If(Every, "*", "")) As "DBusObserver" End diff --git a/gb.dbus/src/gb.dbus/.src/MMain.module b/gb.dbus/src/gb.dbus/.src/MMain.module index 0e39d3bf5..e8fe9e6dc 100644 --- a/gb.dbus/src/gb.dbus/.src/MMain.module +++ b/gb.dbus/src/gb.dbus/.src/MMain.module @@ -3,6 +3,8 @@ Public Sub Main() Dim aVal As Variant[] + Dim hSignal As DBusSignal + '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 @@ -24,20 +26,32 @@ Public Sub Main() 'Print DBus.Session._Name 'Dim hTest As CTest = CTest - Dim cInts As Collection = ["image_path": "/usr/share/icons/gnome/48x48/actions/add.png"] - DBus["org.freedesktop.Notifications"]["/org/freedesktop/Notifications"].Notify("MyApp", 0, "", "PoissonTChat", "Fabien: Chu la ! ici", ["test"], cInts, 1000) - - 'Debug DBus.Session.Applications.Join("\n") - + ' Dim cInts As Collection = ["image_path": "/usr/share/icons/gnome/48x48/actions/add.png"] + ' DBus["org.freedesktop.Notifications"]["/org/freedesktop/Notifications"].Notify("MyApp", 0, "", "PoissonTChat", "Fabien: Chu la ! ici", ["test"], cInts, 1000) + ' + ' Debug DBus.Session.Applications.Join("\n") + ' DBus.Debug = True DBus.Session.Register(CTest, "/Test") 'Wait 10 ' - 'DBus.Session.Unregister(CTest) 'aVal = DBus["org.freedesktop.Notifications"]["/org/freedesktop/Notifications"].GetServerInformation() 'Print aVal[0];; aVal[1];; aVal[2] 'Print DBus["system://org.freedesktop.UDisks"]["/"].Children + + 'hSignal = New DBusSignal(DBus.Session, "org.freedesktop.DBus") As "MySignal" + hSignal = New DBusSignal(DBus.Session, "", True) As "MySignal" + Wait 10 + + DBus.Session.Unregister(CTest) + +End + +Public Sub MySignal_Signal(Method As String, Arguments As Variant[]) + + Debug Method;; Arguments[0] + End diff --git a/gb.gtk/src/CKey.cpp b/gb.gtk/src/CKey.cpp index b0d138f2e..2f02d6209 100644 --- a/gb.gtk/src/CKey.cpp +++ b/gb.gtk/src/CKey.cpp @@ -108,7 +108,7 @@ GB_DESC CKeyDesc[] = GB_CONSTANT("Esc", "i", GDK_Escape), GB_CONSTANT("Escape", "i", GDK_Escape), GB_CONSTANT("Tab", "i", GDK_Tab), - GB_CONSTANT("BackTab", "i", GDK_3270_BackTab), + GB_CONSTANT("BackTab", "i", GDK_KEY_ISO_Left_Tab), GB_CONSTANT("BackSpace", "i", GDK_BackSpace), GB_CONSTANT("Return", "i", GDK_Return), GB_CONSTANT("Enter", "i", GDK_KP_Enter),