Merge branch 'master' of gitlab.com:gambas/gambas
This commit is contained in:
commit
a2c4c3b51a
25 changed files with 302 additions and 149 deletions
|
@ -47,8 +47,8 @@ build:debian-oldstable:
|
|||
postgresql-server-dev-9.6 libsqlite0-dev libsqlite3-dev libglib2.0-dev
|
||||
libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev
|
||||
libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev
|
||||
libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-glib-dev
|
||||
libpoppler-private-dev libasound2-dev libesd0-dev libdirectfb-dev
|
||||
libxslt1-dev librsvg2-dev libpoppler-private-dev libpoppler-dev libpoppler-glib-dev
|
||||
libpoppler-cpp-dev libasound2-dev libesd0-dev libdirectfb-dev
|
||||
libxtst-dev libffi-dev libqt4-dev libqtwebkit-dev libqt4-opengl-dev
|
||||
libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev
|
||||
libgnome-keyring-dev libgdk-pixbuf2.0-dev linux-libc-dev
|
||||
|
@ -74,7 +74,7 @@ build:debian-stable:
|
|||
libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev
|
||||
libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev
|
||||
libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-glib-dev
|
||||
libpoppler-private-dev libasound2-dev libdirectfb-dev libxtst-dev
|
||||
libpoppler-private-dev libpoppler-cpp-dev libasound2-dev libdirectfb-dev libxtst-dev
|
||||
libffi-dev libqt4-dev libqtwebkit-dev libqt4-opengl-dev libglew-dev
|
||||
libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgdk-pixbuf2.0-dev
|
||||
linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
|
||||
|
@ -96,11 +96,11 @@ build:debian-testing:
|
|||
- >
|
||||
apt-get update && apt-get install -y build-essential g++ automake
|
||||
autoconf libbz2-dev default-libmysqlclient-dev unixodbc-dev libpq-dev
|
||||
postgresql-server-dev-13 libsqlite0-dev libsqlite3-dev libglib2.0-dev
|
||||
postgresql-server-dev-13 libsqlite3-dev libglib2.0-dev
|
||||
libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev
|
||||
libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev
|
||||
libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-glib-dev
|
||||
libpoppler-private-dev libasound2-dev libdirectfb-dev libxtst-dev
|
||||
libpoppler-private-dev libpoppler-cpp-dev libasound2-dev libdirectfb-dev libxtst-dev
|
||||
libffi-dev libglew-dev
|
||||
libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgdk-pixbuf2.0-dev
|
||||
linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
|
||||
|
@ -111,7 +111,7 @@ build:debian-testing:
|
|||
qtwebengine5-dev libwebkit2gtk-4.0-dev git libssl-dev
|
||||
script:
|
||||
- ./reconf-all
|
||||
- GAMBAS_CONFIG_FAILURE=1 ./configure -C --disable-keyring --disable-qt4 --disable-qtwebkit
|
||||
- GAMBAS_CONFIG_FAILURE=1 ./configure -C --disable-keyring --disable-sqlite2 --disable-qt4 --disable-qtwebkit
|
||||
- make -j$(nproc)
|
||||
- make install
|
||||
|
||||
|
@ -120,7 +120,7 @@ build:debian-unstable:
|
|||
image: debian:unstable
|
||||
before_script:
|
||||
- >
|
||||
apt-get update && apt-get install -y build-essential g++ automake autoconf libbz2-dev default-libmysqlclient-dev unixodbc-dev libpq-dev postgresql-server-dev-12 libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-glib-dev libpoppler-private-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl-dev libncurses5-dev libgmime-3.0-dev libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libqt5opengl5-dev libqt5svg5-dev libqt5webkit5-dev libqt5x11extras5-dev qtbase5-dev qtwebengine5-dev libwebkit2gtk-4.0-dev git libssl-dev
|
||||
apt-get update && apt-get install -y build-essential g++ automake autoconf libbz2-dev default-libmysqlclient-dev unixodbc-dev libpq-dev postgresql-server-dev-12 libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-glib-dev libpoppler-private-dev libpoppler-cpp-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl-dev libncurses5-dev libgmime-3.0-dev libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libqt5opengl5-dev libqt5svg5-dev libqt5webkit5-dev libqt5x11extras5-dev qtbase5-dev qtwebengine5-dev libwebkit2gtk-4.0-dev git libssl-dev
|
||||
script:
|
||||
- ./reconf-all
|
||||
- GAMBAS_CONFIG_FAILURE=1 ./configure -C --disable-keyring --disable-qt4
|
||||
|
@ -131,7 +131,7 @@ build:ubuntu-latest:
|
|||
image: ubuntu:latest
|
||||
before_script:
|
||||
- >
|
||||
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential g++ automake autoconf libtool libbz2-dev libmysqlclient-dev unixodbc-dev libpq-dev postgresql-server-dev-12 libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-glib-dev libpoppler-private-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl-dev libncurses5-dev libgmime-2.6-dev llvm-dev llvm libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libssl-dev libqt5opengl5-dev libqt5svg5-dev libqt5webkit5-dev libqt5x11extras5-dev qtbase5-dev qtwebengine5-dev libwebkit2gtk-4.0-dev git
|
||||
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential g++ automake autoconf libtool libbz2-dev libmysqlclient-dev unixodbc-dev libpq-dev postgresql-server-dev-12 libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-private-dev libpoppler-glib-dev libpoppler-cpp-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl-dev libncurses5-dev libgmime-2.6-dev llvm-dev llvm libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libssl-dev libqt5opengl5-dev libqt5svg5-dev libqt5webkit5-dev libqt5x11extras5-dev qtbase5-dev qtwebengine5-dev libwebkit2gtk-4.0-dev git
|
||||
|
||||
script:
|
||||
- ./reconf-all
|
||||
|
@ -143,7 +143,7 @@ build:ubuntu-eoan:
|
|||
image: ubuntu:eoan
|
||||
before_script:
|
||||
- >
|
||||
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential g++ automake autoconf libtool libbz2-dev libmysqlclient-dev unixodbc-dev libpq-dev postgresql-server-dev-11 libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-glib-dev libpoppler-private-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libqt4-dev libqtwebkit-dev libqt4-opengl-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl-dev libncurses5-dev libgmime-2.6-dev llvm-dev llvm libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libssl-dev libqt5opengl5-dev libqt5svg5-dev libqt5webkit5-dev libqt5x11extras5-dev qtbase5-dev qtwebengine5-dev libwebkit2gtk-4.0-dev git
|
||||
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential g++ automake autoconf libtool libbz2-dev libmysqlclient-dev unixodbc-dev libpq-dev postgresql-server-dev-11 libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-glib-dev libpoppler-private-dev libpoppler-cpp-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libqt4-dev libqtwebkit-dev libqt4-opengl-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl-dev libncurses5-dev libgmime-2.6-dev llvm-dev llvm libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libssl-dev libqt5opengl5-dev libqt5svg5-dev libqt5webkit5-dev libqt5x11extras5-dev qtbase5-dev qtwebengine5-dev libwebkit2gtk-4.0-dev git
|
||||
|
||||
script:
|
||||
- ./reconf-all
|
||||
|
@ -155,7 +155,7 @@ build:ubuntu-xenial:
|
|||
image: ubuntu:xenial
|
||||
before_script:
|
||||
- >
|
||||
apt-get update && apt-get install -y build-essential g++ automake autoconf libtool libbz2-dev libmysqlclient-dev unixodbc-dev libpq-dev postgresql-server-dev-9.5 libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-glib-dev libpoppler-private-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libqt4-dev libqtwebkit-dev libqt4-opengl-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgnome-keyring-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl-dev libncurses5-dev libgmime-2.6-dev llvm-dev llvm libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libssl-dev libqt5opengl5-dev libqt5svg5-dev libqt5webkit5-dev libqt5x11extras5-dev qtbase5-dev libwebkit2gtk-3.0-dev git
|
||||
apt-get update && apt-get install -y build-essential g++ automake autoconf libtool libbz2-dev libmysqlclient-dev unixodbc-dev libpq-dev postgresql-server-dev-9.5 libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-glib-dev libpoppler-private-dev libpoppler-cpp-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libqt4-dev libqtwebkit-dev libqt4-opengl-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgnome-keyring-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl-dev libncurses5-dev libgmime-2.6-dev llvm-dev llvm libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libssl-dev libqt5opengl5-dev libqt5svg5-dev libqt5webkit5-dev libqt5x11extras5-dev qtbase5-dev libwebkit2gtk-3.0-dev git
|
||||
|
||||
script:
|
||||
- ./reconf-all
|
||||
|
@ -167,7 +167,7 @@ build:ubuntu-trusty:
|
|||
image: ubuntu:trusty
|
||||
before_script:
|
||||
- >
|
||||
apt-get update && apt-get install -y build-essential g++ automake autoconf libtool libbz2-dev libmysqlclient-dev unixodbc-dev libpq-dev postgresql-server-dev-9.3 libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-glib-dev libpoppler-private-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libqt4-dev libqtwebkit-dev libqt4-opengl-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgnome-keyring-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl0-dev libncurses5-dev libgmime-2.6-dev llvm-dev llvm libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libssl-dev git libglu1-mesa-dev libglu1-mesa-dev libglew1.10 libglu1-mesa libgles2-mesa-dev libwebkit2gtk-3.0-dev
|
||||
apt-get update && apt-get install -y build-essential g++ automake autoconf libtool libbz2-dev libmysqlclient-dev unixodbc-dev libpq-dev postgresql-server-dev-9.3 libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-glib-dev libpoppler-private-dev libpoppler-cpp-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libqt4-dev libqtwebkit-dev libqt4-opengl-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgnome-keyring-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl0-dev libncurses5-dev libgmime-2.6-dev llvm-dev llvm libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libssl-dev git libglu1-mesa-dev libglu1-mesa-dev libglew1.10 libglu1-mesa libgles2-mesa-dev libwebkit2gtk-3.0-dev
|
||||
|
||||
script:
|
||||
- ./reconf-all
|
||||
|
@ -192,3 +192,14 @@ build:alpine:
|
|||
- GAMBAS_CONFIG_FAILURE=1 ./configure -C --disable-openal --disable-qt4 --disable-sdl --disable-sqlite2 --disable-v4l --disable-gtkopengl
|
||||
- make -j$(nproc)
|
||||
- make install
|
||||
|
||||
build:fedora-latest:
|
||||
image: fedora:latest
|
||||
before_script:
|
||||
- >
|
||||
dnf groupinstall -y "Development Tools" "Development Libraries" && dnf install -y libtool libtool-ltdl-devel dumb-devel gmime-devel gmime30-devel libffi-devel mariadb-devel postgresql-devel unixODBC-devel sqlite2-devel libsqlite3x-devel SDL-devel SDL_*-devel libxslt-devel libv4l-devel glew-devel poppler-devel poppler-glib-devel poppler-cpp-devel qt-devel SDL2-devel SDL2_*-devel cairo-devel gtk2-devel imlib2-devel librsvg2-devel qt-webkit-devel openal-soft-devel libjpeg-turbo-devel gtkglext-devel gtk3-devel libxml2-devel libXtst-devel gsl-devel pcre-devel mesa-libGL*-devel dbus-devel libcurl-devel alure-devel gstreamer1-devel gstreamer1-plugins-base-devel libgnome-keyring-devel bzip2-devel mariadb-*-devel postgresql-libs libglvnd-devel efl-devel compiz-devel gtk+-devel gtk+extra-devel gtk2-engines-devel qt-devel-private qt5-*-devel postgresql-server-devel webkit2gtk3-devel
|
||||
script:
|
||||
- ./reconf-all
|
||||
- GAMBAS_CONFIG_FAILURE=1 ./configure -C
|
||||
- make -j$(nproc)
|
||||
- make install
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Gambas Project File 3.0
|
||||
Title=Common controls and classes for GUI components
|
||||
Startup=Main
|
||||
Startup=FTreeView
|
||||
Version=3.15.90
|
||||
VersionFile=1
|
||||
Component=gb.image
|
||||
|
|
|
@ -798,16 +798,28 @@ Public Sub GridView_KeyPress()
|
|||
|
||||
If Key.Code = Key.F2 Then
|
||||
hItem = Current_Read()
|
||||
If hItem Then hItem.Rename
|
||||
If hItem Then
|
||||
hItem.Rename
|
||||
Stop Event
|
||||
Endif
|
||||
Else If Key.Text = "+" Then
|
||||
hItem = Current_Read()
|
||||
If hItem Then hItem.Expanded = True
|
||||
If hItem Then
|
||||
hItem.Expanded = True
|
||||
Stop Event
|
||||
Endif
|
||||
Else If Key.Text = "-" Then
|
||||
hItem = Current_Read()
|
||||
If hItem Then hItem.Expanded = False
|
||||
If hItem Then
|
||||
hItem.Expanded = False
|
||||
Stop Event
|
||||
Endif
|
||||
Else If Key.Code = Key.Space Or If Key.Code = Key.Return Or If Key.Code = Key.Enter Then
|
||||
hItem = Current_Read()
|
||||
If hItem Then hItem.Expanded = Not hItem.Expanded
|
||||
If hItem Then
|
||||
hItem.Expanded = Not hItem.Expanded
|
||||
Stop Event
|
||||
Endif
|
||||
Endif
|
||||
|
||||
End
|
||||
|
@ -1397,6 +1409,8 @@ Public Sub _Rename(hItem As _TreeView_Item, iCol As Integer)
|
|||
|
||||
If iCol < 0 Or If iCol >= $hView.Columns.Count Then Error.Raise("Out of bounds")
|
||||
|
||||
Cancel()
|
||||
|
||||
_EnsureVisible(hItem)
|
||||
Wait
|
||||
Key_Write(hItem.Key)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[Component]
|
||||
Key=gb.net.smtp
|
||||
Version=3.14.90
|
||||
Version=3.15.90
|
||||
Requires=gb.net
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 7.9 KiB |
|
@ -2,9 +2,10 @@
|
|||
Title=SMTP client
|
||||
Startup=Main
|
||||
Icon=.hidden/control/smtpclient.png
|
||||
Version=3.14.90
|
||||
Version=3.15.90
|
||||
VersionFile=1
|
||||
Component=gb.net
|
||||
Environment="GB_PCODE_VERSION=3.8"
|
||||
TabSize=2
|
||||
Language=fr
|
||||
Type=Component
|
||||
|
|
|
@ -45,16 +45,16 @@ Public Sub PrintQuoted(hStream As Stream, sStr As String, bDebug As Boolean)
|
|||
If bDebug Then Error "=3D";
|
||||
W += 3
|
||||
|
||||
Case 10 'newline
|
||||
' Case 10 'newline
|
||||
'
|
||||
' If I > 1 And If Asc(sLastCar) <= 32 Then
|
||||
' Print #hStream, "="
|
||||
' If bDebug Then Error "="
|
||||
' Endif
|
||||
' Print #hStream
|
||||
' If bDebug Then Error
|
||||
' W = 0
|
||||
|
||||
If I > 1 And If Asc(sLastCar) <= 32 Then
|
||||
Print #hStream, "="
|
||||
If bDebug Then Error "="
|
||||
Endif
|
||||
Print #hStream
|
||||
If bDebug Then Error
|
||||
W = 0
|
||||
|
||||
Default
|
||||
|
||||
If Asc(sCar) < 33 Or If Asc(sCar) > 126 Then
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -83,6 +83,16 @@ static DB_DRIVER _driver;
|
|||
static int _last_error;
|
||||
/*static int _print_query = FALSE;*/
|
||||
|
||||
// Get the SQL expression returning the default value of a field
|
||||
|
||||
static const char *get_default_value(const char *old_way)
|
||||
{
|
||||
if (DB.GetCurrentDatabase()->version >= 90600)
|
||||
return "pg_get_expr(adbin, adrelid) AS adsrc";
|
||||
else
|
||||
return old_way;
|
||||
}
|
||||
|
||||
/* Internal function to check the result of a query */
|
||||
|
||||
static int check_result(PGresult *res, const char *err)
|
||||
|
@ -535,11 +545,11 @@ static void conv_data(const char *data, int len, GB_VARIANT_VALUE *val, Oid type
|
|||
|
||||
/* Internal function to substitute the table name into a query */
|
||||
|
||||
static char *query_param[3];
|
||||
static char *query_param[4];
|
||||
|
||||
static void query_get_param(int index, char **str, int *len, char quote)
|
||||
{
|
||||
if (index > 3)
|
||||
if (index > 4)
|
||||
return;
|
||||
|
||||
index--;
|
||||
|
@ -567,8 +577,8 @@ static int do_query(DB_DATABASE *db, const char *error, PGresult **pres, const c
|
|||
if (nsubst)
|
||||
{
|
||||
va_start(args, nsubst);
|
||||
if (nsubst > 3)
|
||||
nsubst = 3;
|
||||
if (nsubst > 4)
|
||||
nsubst = 4;
|
||||
for (i = 0; i < nsubst; i++)
|
||||
query_param[i] = va_arg(args, char *);
|
||||
|
||||
|
@ -1423,10 +1433,10 @@ static int table_init(DB_DATABASE *db, const char *table, DB_INFO *info)
|
|||
{
|
||||
qfield_all=
|
||||
"SELECT col.attname, col.atttypid::int, col.atttypmod, "
|
||||
"col.attnotnull, def.adsrc, col.atthasdef "
|
||||
"col.attnotnull, &1, col.atthasdef "
|
||||
"FROM pg_catalog.pg_class tbl, pg_catalog.pg_attribute col "
|
||||
"LEFT JOIN pg_catalog.pg_attrdef def ON (def.adnum = col.attnum AND def.adrelid = col.attrelid) "
|
||||
"WHERE tbl.relname = '&1' AND "
|
||||
"WHERE tbl.relname = '&2' AND "
|
||||
"col.attrelid = tbl.oid AND "
|
||||
"col.attnum > 0 AND "
|
||||
"not col.attisdropped "
|
||||
|
@ -1434,11 +1444,11 @@ static int table_init(DB_DATABASE *db, const char *table, DB_INFO *info)
|
|||
|
||||
qfield_schema_all =
|
||||
"select pg_attribute.attname, pg_attribute.atttypid::int, pg_attribute.atttypmod, "
|
||||
"pg_attribute.attnotnull, pg_attrdef.adsrc, pg_attribute.atthasdef "
|
||||
"pg_attribute.attnotnull, &1, pg_attribute.atthasdef "
|
||||
"from pg_class, pg_attribute "
|
||||
"LEFT JOIN pg_catalog.pg_attrdef ON (pg_attrdef.adnum = pg_attribute.attnum AND pg_attrdef.adrelid = pg_attribute.attrelid) "
|
||||
"where pg_class.relname = '&1' "
|
||||
"and (pg_class.relnamespace in (select oid from pg_namespace where nspname = '&2')) "
|
||||
"where pg_class.relname = '&2' "
|
||||
"and (pg_class.relnamespace in (select oid from pg_namespace where nspname = '&3')) "
|
||||
"and pg_attribute.attnum > 0 and not pg_attribute.attisdropped "
|
||||
"and pg_attribute.attrelid = pg_class.oid ";
|
||||
}
|
||||
|
@ -1446,11 +1456,11 @@ static int table_init(DB_DATABASE *db, const char *table, DB_INFO *info)
|
|||
{
|
||||
qfield_all=
|
||||
"SELECT col.attname, col.atttypid::int, col.atttypmod, "
|
||||
"col.attnotnull, def.adsrc, col.atthasdef, pg_collation.collname "
|
||||
"col.attnotnull, &1, col.atthasdef, pg_collation.collname "
|
||||
"FROM pg_catalog.pg_class tbl, pg_catalog.pg_attribute col "
|
||||
"LEFT JOIN pg_catalog.pg_attrdef def ON (def.adnum = col.attnum AND def.adrelid = col.attrelid) "
|
||||
"LEFT JOIN pg_collation ON (pg_collation.oid = col.attcollation) "
|
||||
"WHERE tbl.relname = '&1' AND "
|
||||
"WHERE tbl.relname = '&2' AND "
|
||||
"col.attrelid = tbl.oid AND "
|
||||
"col.attnum > 0 AND "
|
||||
"not col.attisdropped "
|
||||
|
@ -1458,12 +1468,12 @@ static int table_init(DB_DATABASE *db, const char *table, DB_INFO *info)
|
|||
|
||||
qfield_schema_all =
|
||||
"select pg_attribute.attname, pg_attribute.atttypid::int, pg_attribute.atttypmod, "
|
||||
"pg_attribute.attnotnull, pg_attrdef.adsrc, pg_attribute.atthasdef, pg_collation.collname "
|
||||
"pg_attribute.attnotnull, &1, pg_attribute.atthasdef, pg_collation.collname "
|
||||
"from pg_class, pg_attribute "
|
||||
"LEFT JOIN pg_catalog.pg_attrdef ON (pg_attrdef.adnum = pg_attribute.attnum AND pg_attrdef.adrelid = pg_attribute.attrelid) "
|
||||
"LEFT JOIN pg_collation ON (pg_collation.oid = pg_attribute.attcollation) "
|
||||
"where pg_class.relname = '&1' "
|
||||
"and (pg_class.relnamespace in (select oid from pg_namespace where nspname = '&2')) "
|
||||
"where pg_class.relname = '&2' "
|
||||
"and (pg_class.relnamespace in (select oid from pg_namespace where nspname = '&3')) "
|
||||
"and pg_attribute.attnum > 0 and not pg_attribute.attisdropped "
|
||||
"and pg_attribute.attrelid = pg_class.oid ";
|
||||
}
|
||||
|
@ -1478,12 +1488,12 @@ static int table_init(DB_DATABASE *db, const char *table, DB_INFO *info)
|
|||
|
||||
if (get_table_schema(&table, &schema))
|
||||
{
|
||||
if (do_query(db,"Unable to get table fields: &1", &res, qfield_all, 1, table))
|
||||
if (do_query(db,"Unable to get table fields: &1", &res, qfield_all, 2, get_default_value("def.adsrc"), table))
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (do_query(db, "Unable to get table fields: &1", &res, qfield_schema_all, 2, table, schema))
|
||||
if (do_query(db, "Unable to get table fields: &1", &res, qfield_schema_all, 3, get_default_value("pg_attrdef.adsrc"), table, schema))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -2230,23 +2240,23 @@ static int field_info(DB_DATABASE *db, const char *table, const char *field, DB_
|
|||
{
|
||||
query =
|
||||
"select pg_attribute.attname, pg_attribute.atttypid::int, "
|
||||
"pg_attribute.atttypmod, pg_attribute.attnotnull, pg_attrdef.adsrc, pg_attribute.atthasdef "
|
||||
"pg_attribute.atttypmod, pg_attribute.attnotnull, &1, pg_attribute.atthasdef "
|
||||
"from pg_class, pg_attribute "
|
||||
"left join pg_attrdef on (pg_attrdef.adrelid = pg_attribute.attrelid and pg_attrdef.adnum = pg_attribute.attnum) "
|
||||
"where pg_class.relname = '&1' "
|
||||
"where pg_class.relname = '&2' "
|
||||
"and (pg_class.relnamespace not in (select oid from pg_namespace where nspname = 'information_schema')) "
|
||||
"and pg_attribute.attname = '&2' "
|
||||
"and pg_attribute.attname = '&3' "
|
||||
"and pg_attribute.attnum > 0 and not pg_attribute.attisdropped "
|
||||
"and pg_attribute.attrelid = pg_class.oid";
|
||||
|
||||
query_schema =
|
||||
"select pg_attribute.attname, pg_attribute.atttypid::int, "
|
||||
"pg_attribute.atttypmod, pg_attribute.attnotnull, pg_attrdef.adsrc, pg_attribute.atthasdef "
|
||||
"pg_attribute.atttypmod, pg_attribute.attnotnull, &1, pg_attribute.atthasdef "
|
||||
"from pg_class, pg_attribute "
|
||||
"left join pg_attrdef on (pg_attrdef.adrelid = pg_attribute.attrelid and pg_attrdef.adnum = pg_attribute.attnum) "
|
||||
"where pg_class.relname = '&1' "
|
||||
"and (pg_class.relnamespace in (select oid from pg_namespace where nspname = '&3')) "
|
||||
"and pg_attribute.attname = '&2' "
|
||||
"where pg_class.relname = '&2' "
|
||||
"and (pg_class.relnamespace in (select oid from pg_namespace where nspname = '&4')) "
|
||||
"and pg_attribute.attname = '&3' "
|
||||
"and pg_attribute.attnum > 0 and not pg_attribute.attisdropped "
|
||||
"and pg_attribute.attrelid = pg_class.oid";
|
||||
}
|
||||
|
@ -2254,25 +2264,25 @@ static int field_info(DB_DATABASE *db, const char *table, const char *field, DB_
|
|||
{
|
||||
query =
|
||||
"select pg_attribute.attname, pg_attribute.atttypid::int, "
|
||||
"pg_attribute.atttypmod, pg_attribute.attnotnull, pg_attrdef.adsrc, pg_attribute.atthasdef, pg_collation.collname "
|
||||
"pg_attribute.atttypmod, pg_attribute.attnotnull, &1, pg_attribute.atthasdef, pg_collation.collname "
|
||||
"from pg_class, pg_attribute "
|
||||
"left join pg_attrdef on (pg_attrdef.adrelid = pg_attribute.attrelid and pg_attrdef.adnum = pg_attribute.attnum) "
|
||||
"left join pg_collation on (pg_collation.oid = pg_attribute.attcollation) "
|
||||
"where pg_class.relname = '&1' "
|
||||
"where pg_class.relname = '&2' "
|
||||
"and (pg_class.relnamespace not in (select oid from pg_namespace where nspname = 'information_schema')) "
|
||||
"and pg_attribute.attname = '&2' "
|
||||
"and pg_attribute.attname = '&3' "
|
||||
"and pg_attribute.attnum > 0 and not pg_attribute.attisdropped "
|
||||
"and pg_attribute.attrelid = pg_class.oid";
|
||||
|
||||
query_schema =
|
||||
"select pg_attribute.attname, pg_attribute.atttypid::int, "
|
||||
"pg_attribute.atttypmod, pg_attribute.attnotnull, pg_attrdef.adsrc, pg_attribute.atthasdef, pg_collation.collname "
|
||||
"pg_attribute.atttypmod, pg_attribute.attnotnull, &1, pg_attribute.atthasdef, pg_collation.collname "
|
||||
"from pg_class, pg_attribute "
|
||||
"left join pg_attrdef on (pg_attrdef.adrelid = pg_attribute.attrelid and pg_attrdef.adnum = pg_attribute.attnum) "
|
||||
"left join pg_collation on (pg_collation.oid = pg_attribute.attcollation) "
|
||||
"where pg_class.relname = '&1' "
|
||||
"and (pg_class.relnamespace in (select oid from pg_namespace where nspname = '&3')) "
|
||||
"and pg_attribute.attname = '&2' "
|
||||
"where pg_class.relname = '&2' "
|
||||
"and (pg_class.relnamespace in (select oid from pg_namespace where nspname = '&4')) "
|
||||
"and pg_attribute.attname = '&3' "
|
||||
"and pg_attribute.attnum > 0 and not pg_attribute.attisdropped "
|
||||
"and pg_attribute.attrelid = pg_class.oid";
|
||||
}
|
||||
|
@ -2283,12 +2293,12 @@ static int field_info(DB_DATABASE *db, const char *table, const char *field, DB_
|
|||
|
||||
if (get_table_schema(&table, &schema))
|
||||
{
|
||||
if (do_query(db, "Unable to get field info: &1", &res, query, 2, table, field))
|
||||
if (do_query(db, "Unable to get field info: &1", &res, query, 3, get_default_value("pg_attrdef.adsrc"), table, field))
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (do_query(db, "Unable to get field info: &1", &res, query_schema, 3, table, field, schema))
|
||||
if (do_query(db, "Unable to get field info: &1", &res, query_schema, 4, get_default_value("pg_attrdef.adsrc"), table, field, schema))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -767,7 +767,7 @@ END_METHOD
|
|||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
BEGIN_METHOD_VOID(CFORM_new)
|
||||
BEGIN_METHOD_VOID(Form_new)
|
||||
|
||||
if (!GB.Parent(_object))
|
||||
GB.Attach(_object, _object, "Form");
|
||||
|
@ -777,7 +777,7 @@ BEGIN_METHOD_VOID(CFORM_new)
|
|||
END_METHOD
|
||||
|
||||
|
||||
BEGIN_METHOD_VOID(CFORM_main)
|
||||
BEGIN_METHOD_VOID(Form_Main)
|
||||
|
||||
CWINDOW *form;
|
||||
|
||||
|
@ -788,7 +788,7 @@ BEGIN_METHOD_VOID(CFORM_main)
|
|||
END_METHOD
|
||||
|
||||
|
||||
BEGIN_METHOD(CFORM_load, GB_OBJECT parent)
|
||||
BEGIN_METHOD(Form_Load, GB_OBJECT parent)
|
||||
|
||||
gMainWindow *window = (gMainWindow *)((CWIDGET *)GB.AutoCreate(GB.GetClass(NULL), 0))->widget;
|
||||
CCONTAINER *parent = (CCONTAINER *)VARGOPT(parent, 0);
|
||||
|
@ -954,9 +954,9 @@ GB_DESC CFormDesc[] =
|
|||
GB_DECLARE("Form", sizeof(CFORM)), GB_INHERITS("Window"),
|
||||
GB_AUTO_CREATABLE(),
|
||||
|
||||
GB_STATIC_METHOD("Main", 0, CFORM_main, 0),
|
||||
GB_STATIC_METHOD("Load", 0, CFORM_load, "[(Parent)Container;]"),
|
||||
GB_METHOD("_new", 0, CFORM_new, 0),
|
||||
GB_STATIC_METHOD("Main", 0, Form_Main, 0),
|
||||
GB_STATIC_METHOD("Load", 0, Form_Load, "[(Parent)Container;]"),
|
||||
GB_METHOD("_new", 0, Form_new, 0),
|
||||
|
||||
FORM_DESCRIPTION,
|
||||
|
||||
|
|
|
@ -1352,7 +1352,8 @@ void gControl::restack(bool raise)
|
|||
GList *find;
|
||||
gpointer *p;
|
||||
|
||||
if (!pr) return;
|
||||
if (!pr)
|
||||
return;
|
||||
|
||||
parent = GTK_CONTAINER(gtk_widget_get_parent(border));
|
||||
|
||||
|
|
|
@ -197,7 +197,7 @@ public:
|
|||
|
||||
void lower() { restack(false); }
|
||||
void raise() { restack(true); }
|
||||
void restack(bool raise);
|
||||
virtual void restack(bool raise);
|
||||
|
||||
virtual void setFocus();
|
||||
bool hasFocus() const;
|
||||
|
|
|
@ -94,14 +94,26 @@ gMainWindow* gDesktop::activeWindow()
|
|||
return gMainWindow::_active ? gMainWindow::_active->topLevel() : NULL;
|
||||
}
|
||||
|
||||
int gDesktop::height()
|
||||
{
|
||||
return gdk_screen_get_height(gdk_screen_get_default ());
|
||||
}
|
||||
|
||||
int gDesktop::width()
|
||||
{
|
||||
#if GTK_CHECK_VERSION(3, 22, 0)
|
||||
GdkRectangle rect;
|
||||
gdk_monitor_get_geometry(gdk_display_get_primary_monitor(gdk_display_get_default()), &rect);
|
||||
return rect.width;
|
||||
#else
|
||||
return gdk_screen_get_width(gdk_screen_get_default ());
|
||||
#endif
|
||||
}
|
||||
|
||||
int gDesktop::height()
|
||||
{
|
||||
#if GTK_CHECK_VERSION(3, 22, 0)
|
||||
GdkRectangle rect;
|
||||
gdk_monitor_get_geometry(gdk_display_get_primary_monitor(gdk_display_get_default()), &rect);
|
||||
return rect.height;
|
||||
#else
|
||||
return gdk_screen_get_height(gdk_screen_get_default());
|
||||
#endif
|
||||
}
|
||||
|
||||
int gDesktop::resolution()
|
||||
|
@ -130,7 +142,9 @@ gPicture* gDesktop::screenshot(int x, int y, int w, int h)
|
|||
|
||||
int gDesktop::count()
|
||||
{
|
||||
#ifdef GTK3
|
||||
#if GTK_CHECK_VERSION(3, 22, 0)
|
||||
return gdk_display_get_n_monitors(gdk_display_get_default());
|
||||
#elif defined(GTK3)
|
||||
return gdk_screen_get_n_monitors(gdk_screen_get_default());
|
||||
#else
|
||||
return gdk_display_get_n_screens(gdk_display_get_default());
|
||||
|
@ -143,7 +157,9 @@ void gDesktop::geometry(int screen, GdkRectangle *rect)
|
|||
if (screen < 0 || screen >= count())
|
||||
return;
|
||||
|
||||
#ifdef GTK3
|
||||
#if GTK_CHECK_VERSION(3, 22, 0)
|
||||
gdk_monitor_get_geometry(gdk_display_get_monitor(gdk_display_get_default(), screen), rect);
|
||||
#elif defined(GTK3)
|
||||
gdk_screen_get_monitor_geometry(gdk_screen_get_default(), screen, rect);
|
||||
#else
|
||||
rect->width = gdk_screen_get_width(gdk_display_get_screen(gdk_display_get_default(), screen));
|
||||
|
@ -157,7 +173,9 @@ void gDesktop::availableGeometry(int screen, GdkRectangle *rect)
|
|||
if (screen < 0 || screen >= count())
|
||||
return;
|
||||
|
||||
#ifdef GTK3
|
||||
#if GTK_CHECK_VERSION(3, 22, 0)
|
||||
gdk_monitor_get_workarea(gdk_display_get_monitor(gdk_display_get_default(), screen), rect);
|
||||
#elif defined(GTK3)
|
||||
gdk_screen_get_monitor_workarea(gdk_screen_get_default(), screen, rect);
|
||||
#else
|
||||
if (X11_get_available_geometry(screen, &rect->x, &rect->y, &rect->width, &rect->height))
|
||||
|
|
|
@ -1072,10 +1072,18 @@ void gMainWindow::showPopup()
|
|||
showPopup(x, y);
|
||||
}
|
||||
|
||||
void gMainWindow::raise()
|
||||
void gMainWindow::restack(bool raise)
|
||||
{
|
||||
if (!isTopLevel()) { gControl::raise(); return; }
|
||||
present();
|
||||
if (!isTopLevel())
|
||||
{
|
||||
gControl::restack(raise);
|
||||
return;
|
||||
}
|
||||
|
||||
if (raise)
|
||||
present();
|
||||
else
|
||||
gdk_window_lower(gtk_widget_get_window(border));
|
||||
}
|
||||
|
||||
const char* gMainWindow::text()
|
||||
|
@ -1828,7 +1836,15 @@ void gMainWindow::setOpacity(double v)
|
|||
int gMainWindow::screen()
|
||||
{
|
||||
gMainWindow *tl = topLevel();
|
||||
#if GTK_CHECK_VERSION(3, 22, 0)
|
||||
GdkWindow *window = gtk_widget_get_window(tl->border);
|
||||
if (window)
|
||||
return gt_find_monitor(gdk_display_get_monitor_at_window(gdk_display_get_default(), window));
|
||||
else
|
||||
return -1;
|
||||
#else
|
||||
return gdk_screen_get_number(gtk_window_get_screen(GTK_WINDOW(tl->border)));
|
||||
#endif
|
||||
}
|
||||
|
||||
void gMainWindow::emitResize()
|
||||
|
|
|
@ -110,12 +110,12 @@ public:
|
|||
void showPopup();
|
||||
void showPopup(int x, int y);
|
||||
void activate();
|
||||
void raise();
|
||||
virtual void move(int x, int y);
|
||||
virtual bool resize(int w, int h);
|
||||
bool close();
|
||||
virtual void reparent(gContainer *newpr, int x, int y);
|
||||
virtual void destroy();
|
||||
virtual void restack(bool raise);
|
||||
|
||||
//"Signals"
|
||||
void (*onOpen)(gMainWindow *sender);
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "gmainwindow.h"
|
||||
#include "gapplication.h"
|
||||
#include "gdesktop.h"
|
||||
#include "gmouse.h"
|
||||
#include "gmenu.h"
|
||||
#include "CStyle.h"
|
||||
|
||||
|
@ -846,7 +847,7 @@ void gMenu::doPopup(bool move, int x, int y)
|
|||
{
|
||||
event = gdk_event_new(GDK_BUTTON_PRESS);
|
||||
event->button.time = GDK_CURRENT_TIME;
|
||||
gdk_event_set_device(event, gdk_device_manager_get_client_pointer(gdk_display_get_device_manager(gdk_display_get_default())));
|
||||
gdk_event_set_device(event, gMouse::getPointer());
|
||||
free = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,9 +48,13 @@ int gMouse::_click_y = -1;
|
|||
double gMouse::_click_timer = 0;
|
||||
|
||||
#ifdef GTK3
|
||||
static GdkDevice *get_pointer()
|
||||
GdkDevice *gMouse::getPointer()
|
||||
{
|
||||
#if GTK_CHECK_VERSION(3, 22, 0)
|
||||
return gdk_seat_get_pointer(gdk_display_get_default_seat(gdk_display_get_default()));
|
||||
#else
|
||||
return gdk_device_manager_get_client_pointer(gdk_display_get_device_manager(gdk_display_get_default()));
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -58,7 +62,7 @@ void gMouse::move(int x, int y)
|
|||
{
|
||||
GdkDisplay* dpy = gdk_display_get_default();
|
||||
#ifdef GTK3
|
||||
gdk_device_warp(get_pointer(), gdk_display_get_default_screen(dpy), x, y);
|
||||
gdk_device_warp(getPointer(), gdk_display_get_default_screen(dpy), x, y);
|
||||
#else
|
||||
gdk_display_warp_pointer(dpy, gdk_display_get_default_screen(dpy), x, y);
|
||||
#endif
|
||||
|
@ -134,7 +138,7 @@ void gMouse::getScreenPos(int *x, int *y)
|
|||
else
|
||||
{
|
||||
#ifdef GTK3
|
||||
gdk_device_get_position(get_pointer(), NULL, x, y);
|
||||
gdk_device_get_position(getPointer(), NULL, x, y);
|
||||
#else
|
||||
gdk_display_get_pointer(gdk_display_get_default(), NULL, x, y, NULL);
|
||||
#endif
|
||||
|
@ -146,7 +150,7 @@ int gMouse::screenX()
|
|||
gint x;
|
||||
|
||||
#ifdef GTK3
|
||||
gdk_device_get_position(get_pointer(), NULL, &x, NULL);
|
||||
gdk_device_get_position(getPointer(), NULL, &x, NULL);
|
||||
#else
|
||||
gdk_display_get_pointer(gdk_display_get_default(), NULL, &x, NULL, NULL);
|
||||
#endif
|
||||
|
@ -159,7 +163,7 @@ int gMouse::screenY()
|
|||
gint y;
|
||||
|
||||
#ifdef GTK3
|
||||
gdk_device_get_position(get_pointer(), NULL, NULL, &y);
|
||||
gdk_device_get_position(getPointer(), NULL, NULL, &y);
|
||||
#else
|
||||
gdk_display_get_pointer(gdk_display_get_default(), NULL, NULL, &y, NULL);
|
||||
#endif
|
||||
|
|
|
@ -74,6 +74,10 @@ public:
|
|||
|
||||
static void handleClickCount(GdkEvent *event);
|
||||
static int clickCount() { return _isValid ? _click_count : 0; }
|
||||
|
||||
#ifdef GTK3
|
||||
static GdkDevice *getPointer();
|
||||
#endif
|
||||
|
||||
private:
|
||||
static int _isValid;
|
||||
|
|
|
@ -2404,3 +2404,19 @@ void gt_on_theme_change()
|
|||
_style[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#if GTK_CHECK_VERSION(3, 22, 0)
|
||||
int gt_find_monitor(GdkMonitor *monitor)
|
||||
{
|
||||
GdkDisplay *display = gdk_display_get_default();
|
||||
int i;
|
||||
|
||||
for (i = 0; i < gdk_display_get_n_monitors(display); i++)
|
||||
{
|
||||
if (gdk_display_get_monitor(display, i) == monitor)
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -229,4 +229,8 @@ void gt_widget_reparent(GtkWidget *widget, GtkWidget *new_parent);
|
|||
#define gt_get_focus_on_click(_widget) (gtk_button_get_focus_on_click(GTK_BUTTON(_widget)))
|
||||
#endif
|
||||
|
||||
#if GTK_CHECK_VERSION(3, 22, 0)
|
||||
int gt_find_monitor(GdkMonitor *monitor);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -99,11 +99,21 @@ static gboolean master_client_restored= FALSE;
|
|||
|
||||
// BM: device grab management
|
||||
|
||||
#ifdef GTK3
|
||||
static GdkDevice *gt_get_pointer()
|
||||
{
|
||||
#if GTK_CHECK_VERSION(3, 22, 0)
|
||||
return gdk_seat_get_pointer(gdk_display_get_default_seat(gdk_display_get_default()));
|
||||
#else
|
||||
return gdk_device_manager_get_client_pointer(gdk_display_get_device_manager(gdk_display_get_default()));
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
static gboolean gt_pointer_is_grabbed()
|
||||
{
|
||||
#ifdef GTK3
|
||||
GdkDevice *pointer = gdk_device_manager_get_client_pointer(gdk_display_get_device_manager(gdk_display_get_default()));
|
||||
return gdk_display_device_is_grabbed(gdk_display_get_default(), pointer);
|
||||
return gdk_display_device_is_grabbed(gdk_display_get_default(), gt_get_pointer());
|
||||
#else
|
||||
return gdk_pointer_is_grabbed();
|
||||
#endif
|
||||
|
@ -111,10 +121,10 @@ static gboolean gt_pointer_is_grabbed()
|
|||
|
||||
static void gt_ungrab(void)
|
||||
{
|
||||
#ifdef GTK3
|
||||
GdkDevice *pointer = gdk_device_manager_get_client_pointer(gdk_display_get_device_manager(gdk_display_get_default()));
|
||||
GdkDevice *keyboard = gdk_device_get_associated_device(pointer);
|
||||
|
||||
#if GTK_CHECK_VERSION(3, 22, 0)
|
||||
gdk_seat_ungrab(gdk_display_get_default_seat(gdk_display_get_default()));
|
||||
#elif defined(GTK3)
|
||||
GdkDevice *keyboard = gdk_device_get_associated_device(get_pointer());
|
||||
gdk_device_ungrab(pointer, GDK_CURRENT_TIME);
|
||||
gdk_device_ungrab(keyboard, GDK_CURRENT_TIME);
|
||||
#else
|
||||
|
|
|
@ -9,6 +9,6 @@ GB_COMPONENT_PKG_CONFIG(
|
|||
POPPLER,
|
||||
gb.poppler,
|
||||
[src],
|
||||
'poppler >= 0.20' poppler-splash poppler-glib)
|
||||
'poppler >= 0.20' poppler-cpp poppler-glib)
|
||||
AC_OUTPUT( Makefile src/Makefile )
|
||||
GB_PRINT_MESSAGES
|
||||
|
|
|
@ -86,7 +86,7 @@ BEGIN_METHOD(PdfDocument_new, GB_STRING path; GB_STRING password)
|
|||
|
||||
const char *password;
|
||||
GError *error;
|
||||
SplashColor paper = { 0xFF, 0xFF, 0xFF };
|
||||
std::string rpasswd;
|
||||
|
||||
if (GB.LoadFile(STRING(path), LENGTH(path), &THIS->buffer, &THIS->length))
|
||||
return;
|
||||
|
@ -105,8 +105,15 @@ BEGIN_METHOD(PdfDocument_new, GB_STRING path; GB_STRING password)
|
|||
|
||||
THIS->resolution = 72.0;
|
||||
|
||||
THIS->renderer = new SplashOutputDev(splashModeRGB8, 3, false, paper);
|
||||
THIS->renderer->startDoc(GET_DOCUMENT());
|
||||
if (password)
|
||||
rpasswd = password;
|
||||
THIS->rdoc = poppler::document::load_from_raw_data(THIS->buffer, THIS->length, rpasswd, rpasswd);
|
||||
|
||||
THIS->renderer = new poppler::page_renderer;
|
||||
|
||||
THIS->renderer->set_render_hint(poppler::page_renderer::antialiasing, true);
|
||||
THIS->renderer->set_render_hint(poppler::page_renderer::text_antialiasing, true);
|
||||
THIS->renderer->set_render_hint(poppler::page_renderer::text_hinting, false);
|
||||
|
||||
END_METHOD
|
||||
|
||||
|
@ -134,6 +141,7 @@ BEGIN_METHOD_VOID(PdfDocument_free)
|
|||
}
|
||||
|
||||
delete THIS->renderer;
|
||||
delete THIS->rdoc;
|
||||
g_object_unref(THIS->doc);
|
||||
|
||||
GB.ReleaseFile(THIS->buffer, THIS->length);
|
||||
|
@ -309,6 +317,18 @@ BEGIN_METHOD(PdfDocument_Find, GB_STRING label)
|
|||
|
||||
END_METHOD
|
||||
|
||||
#define IMPLEMENT_DOC_HINT_PROP(_name, _hint) \
|
||||
BEGIN_PROPERTY(PdfDocument_##_name) \
|
||||
if (READ_PROPERTY) \
|
||||
GB.ReturnBoolean(THIS->renderer->render_hints() & poppler::page_renderer::_hint); \
|
||||
else \
|
||||
THIS->renderer->set_render_hint(poppler::page_renderer::_hint, VPROP(GB_BOOLEAN)); \
|
||||
END_PROPERTY
|
||||
|
||||
IMPLEMENT_DOC_HINT_PROP(Antialiasing, antialiasing)
|
||||
IMPLEMENT_DOC_HINT_PROP(TextAntialiasing, text_antialiasing)
|
||||
IMPLEMENT_DOC_HINT_PROP(TextHinting, text_hinting)
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
/*BEGIN_PROPERTY(PdfPage_Orientation)
|
||||
|
@ -319,27 +339,49 @@ END_PROPERTY*/
|
|||
|
||||
BEGIN_METHOD(PdfPage_Render, GB_INTEGER x; GB_INTEGER y; GB_INTEGER width; GB_INTEGER height; GB_INTEGER rotation; GB_FLOAT res)
|
||||
|
||||
Page *page = GET_CURRENT_PAGE();
|
||||
SplashBitmap *map;
|
||||
unsigned char *data = NULL;
|
||||
|
||||
poppler::page *page;
|
||||
poppler::rectf size;
|
||||
poppler::rotation_enum rot;
|
||||
poppler::image image;
|
||||
|
||||
const char *data = NULL;
|
||||
int rotation = VARGOPT(rotation, THIS->rotation);
|
||||
int orientation;
|
||||
int orientation = 0;
|
||||
double res = VARGOPT(res, THIS->resolution);
|
||||
int width, height;
|
||||
int x, y, w, h;
|
||||
|
||||
orientation = (rotation + page->getRotate() + 720) % 360;
|
||||
page = THIS->rdoc->create_page(poppler_page_get_index(THIS->current));
|
||||
|
||||
switch (page->orientation())
|
||||
{
|
||||
case poppler::page::portrait: orientation = 0; break;
|
||||
case poppler::page::landscape: orientation = 90; break;
|
||||
case poppler::page::upside_down: orientation = 180; break;
|
||||
case poppler::page::seascape: orientation = 270; break;
|
||||
}
|
||||
|
||||
orientation = (orientation + rotation + 720) % 360;
|
||||
|
||||
switch (orientation)
|
||||
{
|
||||
case 90: rot = poppler::rotate_90; break;
|
||||
case 180: rot = poppler::rotate_180; break;
|
||||
case 270: rot = poppler::rotate_270; break;
|
||||
default: rot = poppler::rotate_0;
|
||||
}
|
||||
|
||||
size = page->page_rect(poppler::media_box);
|
||||
|
||||
if (orientation % 180)
|
||||
{
|
||||
width = (int)(page->getMediaHeight() * res / 72.0);
|
||||
height = (int)(page->getMediaWidth() * res / 72.0);
|
||||
width = (int)(size.height() * res / 72.0);
|
||||
height = (int)(size.width() * res / 72.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
width = (int)(page->getMediaWidth() * res / 72.0);
|
||||
height = (int)(page->getMediaHeight() * res / 72.0);
|
||||
width = (int)(size.width() * res / 72.0);
|
||||
height = (int)(size.height() * res / 72.0);
|
||||
}
|
||||
|
||||
x = VARGOPT(x, 0);
|
||||
|
@ -367,28 +409,17 @@ BEGIN_METHOD(PdfPage_Render, GB_INTEGER x; GB_INTEGER y; GB_INTEGER width; GB_IN
|
|||
|
||||
if (w > 0 && h > 0)
|
||||
{
|
||||
page->displaySlice(THIS->renderer, res, res, rotation, false, true, x, y, w, h, false);
|
||||
map = THIS->renderer->getBitmap();
|
||||
data = (unsigned char *)map->getDataPtr();
|
||||
image = THIS->renderer->render_page(page, res, res, x, y, w, h, rot);
|
||||
data = image.const_data();
|
||||
}
|
||||
|
||||
GB.ReturnObject(IMAGE.Create(w, h, GB_IMAGE_RGB, (unsigned char *)data));
|
||||
GB.ReturnObject(IMAGE.Create(w, h, GB_IMAGE_BGRA, (unsigned char *)data));
|
||||
|
||||
END_METHOD
|
||||
|
||||
BEGIN_PROPERTY(PdfPage_Thumbnail)
|
||||
|
||||
Page *page = GET_CURRENT_PAGE();
|
||||
unsigned char *data;
|
||||
int width, height;
|
||||
|
||||
if (!page->loadThumb(&data, &width, &height, NULL))
|
||||
{
|
||||
GB.ReturnNull();
|
||||
return;
|
||||
}
|
||||
|
||||
GB.ReturnObject(IMAGE.Create(width, height, GB_IMAGE_RGB, (unsigned char *)data));
|
||||
GB.ReturnNull();
|
||||
|
||||
END_PROPERTY
|
||||
|
||||
|
@ -798,9 +829,10 @@ GB_DESC PdfDocumentDesc[] =
|
|||
|
||||
GB_PROPERTY("Resolution", "f", PdfDocument_Resolution),
|
||||
GB_PROPERTY("Rotation", "i", PdfDocument_Rotation),
|
||||
/*GB_PROPERTY("Antialiasing", "b", PdfDocument_Antialiasing),
|
||||
|
||||
GB_PROPERTY("Antialiasing", "b", PdfDocument_Antialiasing),
|
||||
GB_PROPERTY("TextAntialiasing", "b", PdfDocument_TextAntialiasing),
|
||||
GB_PROPERTY("TextHinting", "b", PdfDocument_TextHinting),*/
|
||||
GB_PROPERTY("TextHinting", "b", PdfDocument_TextHinting),
|
||||
|
||||
GB_PROPERTY_READ("Index", ".PdfDocumentIndex", PdfDocument_Index),
|
||||
|
||||
|
|
|
@ -26,9 +26,12 @@
|
|||
#ifndef __C_PDF_DOCUMENT_H
|
||||
#define __C_PDF_DOCUMENT_H
|
||||
|
||||
#include <SplashOutputDev.h>
|
||||
#include "splash/SplashBitmap.h"
|
||||
//#include <SplashOutputDev.h>
|
||||
//#include "splash/SplashBitmap.h"
|
||||
#include "glib/poppler.h"
|
||||
#include "cpp/poppler-document.h"
|
||||
#include "cpp/poppler-page.h"
|
||||
#include "cpp/poppler-page-renderer.h"
|
||||
#include "main.h"
|
||||
|
||||
#ifndef __C_PDF_DOCUMENT_CPP
|
||||
|
@ -69,10 +72,11 @@ typedef
|
|||
PopplerDocument *doc;
|
||||
PopplerPage **pages;
|
||||
PopplerPage *current;
|
||||
SplashOutputDev *renderer;
|
||||
double resolution;
|
||||
int rotation;
|
||||
CPDFINDEX **index;
|
||||
poppler::document *rdoc;
|
||||
poppler::page_renderer *renderer;
|
||||
}
|
||||
CPDFDOCUMENT;
|
||||
|
||||
|
|
|
@ -486,7 +486,7 @@ BEGIN_METHOD_VOID(CFORM_new)
|
|||
END_METHOD
|
||||
|
||||
|
||||
BEGIN_METHOD_VOID(CFORM_main)
|
||||
BEGIN_METHOD_VOID(Form_Main)
|
||||
|
||||
CWINDOW *form = (CWINDOW *)GB.AutoCreate(GB.GetClass(NULL), 0);
|
||||
|
||||
|
@ -496,9 +496,9 @@ BEGIN_METHOD_VOID(CFORM_main)
|
|||
END_METHOD
|
||||
|
||||
|
||||
BEGIN_METHOD(CFORM_load, GB_OBJECT parent)
|
||||
BEGIN_METHOD(Form_Load, GB_OBJECT parent)
|
||||
|
||||
//qDebug("CFORM_load");
|
||||
//qDebug("Form_Load");
|
||||
reparent_window((CWINDOW *)GB.AutoCreate(GB.GetClass(NULL), 0), VARGOPT(parent, 0), false);
|
||||
|
||||
END_METHOD
|
||||
|
@ -1084,6 +1084,8 @@ BEGIN_PROPERTY(Window_Visible)
|
|||
{
|
||||
bool show = !!VPROP(GB_BOOLEAN);
|
||||
|
||||
THIS->hidden = !show;
|
||||
|
||||
if (show == WINDOW->isHidden())
|
||||
{
|
||||
if (show)
|
||||
|
@ -1478,8 +1480,8 @@ GB_DESC CFormDesc[] =
|
|||
GB_DECLARE("Form", sizeof(CFORM)), GB_INHERITS("Window"),
|
||||
GB_AUTO_CREATABLE(),
|
||||
|
||||
GB_STATIC_METHOD("Main", NULL, CFORM_main, NULL),
|
||||
GB_STATIC_METHOD("Load", NULL, CFORM_load, "[(Parent)Control;]"),
|
||||
GB_STATIC_METHOD("Main", NULL, Form_Main, NULL),
|
||||
GB_STATIC_METHOD("Load", NULL, Form_Load, "[(Parent)Control;]"),
|
||||
GB_METHOD("_new", NULL, CFORM_new, NULL),
|
||||
|
||||
FORM_DESCRIPTION,
|
||||
|
|
Loading…
Reference in a new issue